@octavus/agent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -0
- package/dist/browser-extension/assets/accessibility-tree.ts-5Nz2D1Mx.js +3 -0
- package/dist/browser-extension/assets/index.ts-Bis5r5UE.js +8 -0
- package/dist/browser-extension/assets/messages-akAS58tQ.js +1 -0
- package/dist/browser-extension/assets/offscreen-BKXLIRW6.js +1 -0
- package/dist/browser-extension/manifest.json +46 -0
- package/dist/browser-extension/service-worker-loader.js +1 -0
- package/dist/browser-extension/src/offscreen/recording.html +11 -0
- package/dist/browser-extension-mcp.js +61 -0
- package/dist/computer-mcp/dist/index.js +58 -0
- package/dist/computer-mcp/linux/linux-driver.py +966 -0
- package/dist/filesystem-mcp.mjs +148 -0
- package/dist/index.js +191 -0
- package/package.json +27 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as _createRequire } from 'module'; const require = _createRequire(import.meta.url);
|
|
3
|
+
var eF=Object.create;var pm=Object.defineProperty;var tF=Object.getOwnPropertyDescriptor;var rF=Object.getOwnPropertyNames;var nF=Object.getPrototypeOf,oF=Object.prototype.hasOwnProperty;var F=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zt=(e,t)=>{for(var r in t)pm(e,r,{get:t[r],enumerable:!0})},iF=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of rF(t))!oF.call(e,n)&&n!==r&&pm(e,n,{get:()=>t[n],enumerable:!(o=tF(t,n))||o.enumerable});return e};var We=(e,t,r)=>(r=e!=null?eF(nF(e)):{},iF(t||!e||!e.__esModule?pm(r,"default",{value:e,enumerable:!0}):r,e));var qr=w((fue,_E)=>{"use strict";var mE=["nodebuffer","arraybuffer","fragments"],gE=typeof Blob<"u";gE&&mE.push("blob");_E.exports={BINARY_TYPES:mE,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:gE,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Sa=w((pue,bl)=>{"use strict";var{EMPTY_BUFFER:sF}=qr(),hm=Buffer[Symbol.species];function aF(e,t){if(e.length===0)return sF;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),o=0;for(let n=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return o<t?new hm(r.buffer,r.byteOffset,o):r}function vE(e,t,r,o,n){for(let i=0;i<n;i++)r[o+i]=e[i]^t[i&3]}function yE(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function cF(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function mm(e){if(mm.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new hm(e):ArrayBuffer.isView(e)?t=new hm(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),mm.readOnly=!1),t}bl.exports={concat:aF,mask:vE,toArrayBuffer:cF,toBuffer:mm,unmask:yE};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=F("bufferutil");bl.exports.mask=function(t,r,o,n,i){i<48?vE(t,r,o,n,i):e.mask(t,r,o,n,i)},bl.exports.unmask=function(t,r){t.length<32?yE(t,r):e.unmask(t,r)}}catch{}});var wE=w((hue,xE)=>{"use strict";var bE=Symbol("kDone"),gm=Symbol("kRun"),_m=class{constructor(t){this[bE]=()=>{this.pending--,this[gm]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[gm]()}[gm](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[bE])}}};xE.exports=_m});var ka=w((mue,EE)=>{"use strict";var $a=F("zlib"),SE=Sa(),uF=wE(),{kStatusCode:$E}=qr(),lF=Buffer[Symbol.species],dF=Buffer.from([0,0,255,255]),wl=Symbol("permessage-deflate"),Br=Symbol("total-length"),pi=Symbol("callback"),Sn=Symbol("buffers"),hi=Symbol("error"),xl,vm=class{constructor(t,r,o){if(this._maxPayload=o|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!xl){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;xl=new uF(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[pi];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,o=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(o.server_no_context_takeover=!0),r.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(o.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?o.client_max_window_bits=r.clientMaxWindowBits:(o.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(o=>{let n=r[o];if(n.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(n=n[0],o==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else if(o==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else throw new Error(`Unknown parameter "${o}"`);r[o]=n})}),t}decompress(t,r,o){xl.add(n=>{this._decompress(t,r,(i,s)=>{n(),o(i,s)})})}compress(t,r,o){xl.add(n=>{this._compress(t,r,(i,s)=>{n(),o(i,s)})})}_decompress(t,r,o){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?$a.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=$a.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[wl]=this,this._inflate[Br]=0,this._inflate[Sn]=[],this._inflate.on("error",pF),this._inflate.on("data",kE)}this._inflate[pi]=o,this._inflate.write(t),r&&this._inflate.write(dF),this._inflate.flush(()=>{let i=this._inflate[hi];if(i){this._inflate.close(),this._inflate=null,o(i);return}let s=SE.concat(this._inflate[Sn],this._inflate[Br]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Br]=0,this._inflate[Sn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),o(null,s)})}_compress(t,r,o){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?$a.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=$a.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Br]=0,this._deflate[Sn]=[],this._deflate.on("data",fF)}this._deflate[pi]=o,this._deflate.write(t),this._deflate.flush($a.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=SE.concat(this._deflate[Sn],this._deflate[Br]);r&&(i=new lF(i.buffer,i.byteOffset,i.length-4)),this._deflate[pi]=null,this._deflate[Br]=0,this._deflate[Sn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,i)})}};EE.exports=vm;function fF(e){this[Sn].push(e),this[Br]+=e.length}function kE(e){if(this[Br]+=e.length,this[wl]._maxPayload<1||this[Br]<=this[wl]._maxPayload){this[Sn].push(e);return}this[hi]=new RangeError("Max payload size exceeded"),this[hi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[hi][$E]=1009,this.removeListener("data",kE),this.reset()}function pF(e){if(this[wl]._inflate=null,this[hi]){this[pi](this[hi]);return}e[$E]=1007,this[pi](e)}});var mi=w((gue,Sl)=>{"use strict";var{isUtf8:zE}=F("buffer"),{hasBlob:hF}=qr(),mF=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function gF(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function ym(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function _F(e){return hF&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Sl.exports={isBlob:_F,isValidStatusCode:gF,isValidUTF8:ym,tokenChars:mF};if(zE)Sl.exports.isValidUTF8=function(e){return e.length<24?ym(e):zE(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=F("utf-8-validate");Sl.exports.isValidUTF8=function(t){return t.length<32?ym(t):e(t)}}catch{}});var $m=w((_ue,AE)=>{"use strict";var{Writable:vF}=F("stream"),TE=ka(),{BINARY_TYPES:yF,EMPTY_BUFFER:IE,kStatusCode:bF,kWebSocket:xF}=qr(),{concat:bm,toArrayBuffer:wF,unmask:SF}=Sa(),{isValidStatusCode:$F,isValidUTF8:PE}=mi(),$l=Buffer[Symbol.species],Ft=0,OE=1,RE=2,CE=3,xm=4,wm=5,kl=6,Sm=class extends vF{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||yF[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[xF]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Ft}_write(t,r,o){if(this._opcode===8&&this._state==Ft)return o();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(o)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new $l(o.buffer,o.byteOffset+t,o.length-t),new $l(o.buffer,o.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let o=this._buffers[0],n=r.length-t;t>=o.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(o.buffer,o.byteOffset,t),n),this._buffers[0]=new $l(o.buffer,o.byteOffset+t,o.length-t)),t-=o.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Ft:this.getInfo(t);break;case OE:this.getPayloadLength16(t);break;case RE:this.getPayloadLength64(t);break;case CE:this.getMask();break;case xm:this.getData(t);break;case wm:case kl:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let o=(r[0]&64)===64;if(o&&!this._extensions[TE.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=OE:this._payloadLength===127?this._state=RE:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),o=r.readUInt32BE(0);if(o>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=o*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=CE:this._state=xm}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=xm}getData(t){let r=IE;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&SF(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=wm,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[TE.extensionName].decompress(t,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}this._fragments.push(i)}this.dataMessage(r),this._state===Ft&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Ft;return}let r=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=bm(o,r):this._binaryType==="arraybuffer"?n=wF(bm(o,r)):this._binaryType==="blob"?n=new Blob(o):n=o,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Ft):(this._state=kl,setImmediate(()=>{this.emit("message",n,!0),this._state=Ft,this.startLoop(t)}))}else{let n=bm(o,r);if(!this._skipUTF8Validation&&!PE(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===wm||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Ft):(this._state=kl,setImmediate(()=>{this.emit("message",n,!1),this._state=Ft,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,IE),this.end();else{let o=t.readUInt16BE(0);if(!$F(o)){let i=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new $l(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!PE(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",o,n),this.end()}this._state=Ft;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Ft):(this._state=kl,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Ft,this.startLoop(r)}))}createError(t,r,o,n,i){this._loop=!1,this._errored=!0;let s=new t(o?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=i,s[bF]=n,s}};AE.exports=Sm});var zm=w((yue,jE)=>{"use strict";var{Duplex:vue}=F("stream"),{randomFillSync:kF}=F("crypto"),NE=ka(),{EMPTY_BUFFER:EF,kWebSocket:zF,NOOP:TF}=qr(),{isBlob:gi,isValidStatusCode:IF}=mi(),{mask:DE,toBuffer:fo}=Sa(),qt=Symbol("kByteLength"),PF=Buffer.alloc(4),El=8*1024,po,_i=El,ar=0,OF=1,RF=2,km=class e{constructor(t,r,o){this._extensions=r||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=ar,this.onerror=TF,this[zF]=void 0}static frame(t,r){let o,n=!1,i=2,s=!1;r.mask&&(o=r.maskBuffer||PF,r.generateMask?r.generateMask(o):(_i===El&&(po===void 0&&(po=Buffer.alloc(El)),kF(po,0,El),_i=0),o[0]=po[_i++],o[1]=po[_i++],o[2]=po[_i++],o[3]=po[_i++]),s=(o[0]|o[1]|o[2]|o[3])===0,i=6);let a;typeof t=="string"?(!r.mask||s)&&r[qt]!==void 0?a=r[qt]:(t=Buffer.from(t),a=t.length):(a=t.length,n=r.mask&&r.readOnly&&!s);let u=a;a>=65536?(i+=8,u=127):a>125&&(i+=2,u=126);let c=Buffer.allocUnsafe(n?a+i:i);return c[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),r.mask?(c[1]|=128,c[i-4]=o[0],c[i-3]=o[1],c[i-2]=o[2],c[i-1]=o[3],s?[c,t]:n?(DE(t,o,c,i,a),[c]):(DE(t,o,t,0,a),[c,t])):[c,t]}close(t,r,o,n){let i;if(t===void 0)i=EF;else{if(typeof t!="number"||!IF(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(t,0),typeof r=="string"?i.write(r,2):i.set(r,2)}}let s={[qt]:i.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==ar?this.enqueue([this.dispatch,i,!1,s,n]):this.sendFrame(e.frame(i,s),n)}ping(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):gi(t)?(n=t.size,i=!1):(t=fo(t),n=t.length,i=fo.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[qt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};gi(t)?this._state!==ar?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==ar?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}pong(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):gi(t)?(n=t.size,i=!1):(t=fo(t),n=t.length,i=fo.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[qt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};gi(t)?this._state!==ar?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==ar?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}send(t,r,o){let n=this._extensions[NE.extensionName],i=r.binary?2:1,s=r.compress,a,u;typeof t=="string"?(a=Buffer.byteLength(t),u=!1):gi(t)?(a=t.size,u=!1):(t=fo(t),a=t.length,u=fo.readOnly),this._firstFragment?(this._firstFragment=!1,s&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=n._threshold),this._compress=s):(s=!1,i=0),r.fin&&(this._firstFragment=!0);let c={[qt]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:u,rsv1:s};gi(t)?this._state!==ar?this.enqueue([this.getBlobData,t,this._compress,c,o]):this.getBlobData(t,this._compress,c,o):this._state!==ar?this.enqueue([this.dispatch,t,this._compress,c,o]):this.dispatch(t,this._compress,c,o)}getBlobData(t,r,o,n){this._bufferedBytes+=o[qt],this._state=RF,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Em,this,a,n);return}this._bufferedBytes-=o[qt];let s=fo(i);r?this.dispatch(s,r,o,n):(this._state=ar,this.sendFrame(e.frame(s,o),n),this.dequeue())}).catch(i=>{process.nextTick(CF,this,i,n)})}dispatch(t,r,o,n){if(!r){this.sendFrame(e.frame(t,o),n);return}let i=this._extensions[NE.extensionName];this._bufferedBytes+=o[qt],this._state=OF,i.compress(t,o.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");Em(this,u,n);return}this._bufferedBytes-=o[qt],this._state=ar,o.readOnly=!1,this.sendFrame(e.frame(a,o),n),this.dequeue()})}dequeue(){for(;this._state===ar&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][qt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][qt],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};jE.exports=km;function Em(e,t,r){typeof r=="function"&&r(t);for(let o=0;o<e._queue.length;o++){let n=e._queue[o],i=n[n.length-1];typeof i=="function"&&i(t)}}function CF(e,t,r){Em(e,t,r),e.onerror(t)}});var WE=w((bue,VE)=>{"use strict";var{kForOnEventAttribute:Ea,kListener:Tm}=qr(),UE=Symbol("kCode"),LE=Symbol("kData"),ME=Symbol("kError"),ZE=Symbol("kMessage"),FE=Symbol("kReason"),vi=Symbol("kTarget"),qE=Symbol("kType"),BE=Symbol("kWasClean"),Vr=class{constructor(t){this[vi]=null,this[qE]=t}get target(){return this[vi]}get type(){return this[qE]}};Object.defineProperty(Vr.prototype,"target",{enumerable:!0});Object.defineProperty(Vr.prototype,"type",{enumerable:!0});var ho=class extends Vr{constructor(t,r={}){super(t),this[UE]=r.code===void 0?0:r.code,this[FE]=r.reason===void 0?"":r.reason,this[BE]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[UE]}get reason(){return this[FE]}get wasClean(){return this[BE]}};Object.defineProperty(ho.prototype,"code",{enumerable:!0});Object.defineProperty(ho.prototype,"reason",{enumerable:!0});Object.defineProperty(ho.prototype,"wasClean",{enumerable:!0});var yi=class extends Vr{constructor(t,r={}){super(t),this[ME]=r.error===void 0?null:r.error,this[ZE]=r.message===void 0?"":r.message}get error(){return this[ME]}get message(){return this[ZE]}};Object.defineProperty(yi.prototype,"error",{enumerable:!0});Object.defineProperty(yi.prototype,"message",{enumerable:!0});var za=class extends Vr{constructor(t,r={}){super(t),this[LE]=r.data===void 0?null:r.data}get data(){return this[LE]}};Object.defineProperty(za.prototype,"data",{enumerable:!0});var AF={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[Ea]&&n[Tm]===t&&!n[Ea])return;let o;if(e==="message")o=function(i,s){let a=new za("message",{data:s?i:i.toString()});a[vi]=this,zl(t,this,a)};else if(e==="close")o=function(i,s){let a=new ho("close",{code:i,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[vi]=this,zl(t,this,a)};else if(e==="error")o=function(i){let s=new yi("error",{error:i,message:i.message});s[vi]=this,zl(t,this,s)};else if(e==="open")o=function(){let i=new Vr("open");i[vi]=this,zl(t,this,i)};else return;o[Ea]=!!r[Ea],o[Tm]=t,r.once?this.once(e,o):this.on(e,o)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Tm]===t&&!r[Ea]){this.removeListener(e,r);break}}};VE.exports={CloseEvent:ho,ErrorEvent:yi,Event:Vr,EventTarget:AF,MessageEvent:za};function zl(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Im=w((xue,HE)=>{"use strict";var{tokenChars:Ta}=mi();function Sr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function NF(e){let t=Object.create(null),r=Object.create(null),o=!1,n=!1,i=!1,s,a,u=-1,c=-1,l=-1,f=0;for(;f<e.length;f++)if(c=e.charCodeAt(f),s===void 0)if(l===-1&&Ta[c]===1)u===-1&&(u=f);else if(f!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=f);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let p=e.slice(u,l);c===44?(Sr(t,p,r),r=Object.create(null)):s=p,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(l===-1&&Ta[c]===1)u===-1&&(u=f);else if(c===32||c===9)l===-1&&u!==-1&&(l=f);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f),Sr(r,e.slice(u,l),!0),c===44&&(Sr(t,s,r),r=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=e.slice(u,f),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(n){if(Ta[c]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1?u=f:o||(o=!0),n=!1}else if(i)if(Ta[c]===1)u===-1&&(u=f);else if(c===34&&u!==-1)i=!1,l=f;else if(c===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(c===34&&e.charCodeAt(f-1)===61)i=!0;else if(l===-1&&Ta[c]===1)u===-1&&(u=f);else if(u!==-1&&(c===32||c===9))l===-1&&(l=f);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let p=e.slice(u,l);o&&(p=p.replace(/\\/g,""),o=!1),Sr(r,a,p),c===44&&(Sr(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(u===-1||i||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=f);let h=e.slice(u,l);return s===void 0?Sr(t,h,r):(a===void 0?Sr(r,h,!0):o?Sr(r,a,h.replace(/\\/g,"")):Sr(r,a,h),Sr(t,s,r)),t}function DF(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(o=>[t].concat(Object.keys(o).map(n=>{let i=o[n];return Array.isArray(i)||(i=[i]),i.map(s=>s===!0?n:`${n}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}HE.exports={format:DF,parse:NF}});var Ol=w(($ue,iz)=>{"use strict";var jF=F("events"),UF=F("https"),LF=F("http"),KE=F("net"),MF=F("tls"),{randomBytes:ZF,createHash:FF}=F("crypto"),{Duplex:wue,Readable:Sue}=F("stream"),{URL:Pm}=F("url"),$n=ka(),qF=$m(),BF=zm(),{isBlob:VF}=mi(),{BINARY_TYPES:JE,CLOSE_TIMEOUT:WF,EMPTY_BUFFER:Tl,GUID:HF,kForOnEventAttribute:Om,kListener:JF,kStatusCode:GF,kWebSocket:He,NOOP:YE}=qr(),{EventTarget:{addEventListener:KF,removeEventListener:YF}}=WE(),{format:XF,parse:QF}=Im(),{toBuffer:eq}=Sa(),XE=Symbol("kAborted"),Rm=[8,13],Wr=["CONNECTING","OPEN","CLOSING","CLOSED"],tq=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Te=class e extends jF{constructor(t,r,o){super(),this._binaryType=JE[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Tl,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(o=r,r=[]):r=[r]),QE(this,t,r,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){JE.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,o){let n=new qF({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),i=new BF(t,this._extensions,o.generateMask);this._receiver=n,this._sender=i,this._socket=t,n[He]=this,i[He]=this,t[He]=this,n.on("conclude",oq),n.on("drain",iq),n.on("error",sq),n.on("message",aq),n.on("ping",cq),n.on("pong",uq),i.onerror=lq,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",rz),t.on("data",Pl),t.on("end",nz),t.on("error",oz),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[$n.extensionName]&&this._extensions[$n.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Rt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),tz(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Cm(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Tl,r,o)}pong(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Cm(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Tl,r,o)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(o=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Cm(this,t,o);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[$n.extensionName]||(n.compress=!1),this._sender.send(t||Tl,n,o)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Rt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Te,"CONNECTING",{enumerable:!0,value:Wr.indexOf("CONNECTING")});Object.defineProperty(Te.prototype,"CONNECTING",{enumerable:!0,value:Wr.indexOf("CONNECTING")});Object.defineProperty(Te,"OPEN",{enumerable:!0,value:Wr.indexOf("OPEN")});Object.defineProperty(Te.prototype,"OPEN",{enumerable:!0,value:Wr.indexOf("OPEN")});Object.defineProperty(Te,"CLOSING",{enumerable:!0,value:Wr.indexOf("CLOSING")});Object.defineProperty(Te.prototype,"CLOSING",{enumerable:!0,value:Wr.indexOf("CLOSING")});Object.defineProperty(Te,"CLOSED",{enumerable:!0,value:Wr.indexOf("CLOSED")});Object.defineProperty(Te.prototype,"CLOSED",{enumerable:!0,value:Wr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Te.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Te.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[Om])return t[JF];return null},set(t){for(let r of this.listeners(e))if(r[Om]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[Om]:!0})}})});Te.prototype.addEventListener=KF;Te.prototype.removeEventListener=YF;iz.exports=Te;function QE(e,t,r,o){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:WF,protocolVersion:Rm[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!Rm.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${Rm.join(", ")})`);let i;if(t instanceof Pm)i=t;else try{i=new Pm(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),e._url=i.href;let s=i.protocol==="wss:",a=i.protocol==="ws+unix:",u;if(i.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?u="The URL's pathname is empty":i.hash&&(u="The URL contains a fragment identifier"),u){let m=new SyntaxError(u);if(e._redirects===0)throw m;Il(e,m);return}let c=s?443:80,l=ZF(16).toString("base64"),f=s?UF.request:LF.request,h=new Set,p;if(n.createConnection=n.createConnection||(s?nq:rq),n.defaultPort=n.defaultPort||c,n.port=i.port||c,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(p=new $n(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=XF({[$n.extensionName]:p.offer()})),r.length){for(let m of r){if(typeof m!="string"||!tq.test(m)||h.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(m)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),a){let m=n.path.split(":");n.socketPath=m[0],n.path=m[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?n.socketPath:i.host;let m=o&&o.headers;if(o={...o,headers:{}},m)for(let[_,v]of Object.entries(m))o.headers[_.toLowerCase()]=v}else if(e.listenerCount("redirect")===0){let m=a?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:i.host===e._originalHostOrSocketPath;(!m||e._originalSecure&&!s)&&(delete n.headers.authorization,delete n.headers.cookie,m||delete n.headers.host,n.auth=void 0)}n.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=e._req=f(n),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=f(n);n.timeout&&g.on("timeout",()=>{Rt(e,g,"Opening handshake has timed out")}),g.on("error",m=>{g===null||g[XE]||(g=e._req=null,Il(e,m))}),g.on("response",m=>{let _=m.headers.location,v=m.statusCode;if(_&&n.followRedirects&&v>=300&&v<400){if(++e._redirects>n.maxRedirects){Rt(e,g,"Maximum redirects exceeded");return}g.abort();let S;try{S=new Pm(_,t)}catch{let b=new SyntaxError(`Invalid URL: ${_}`);Il(e,b);return}QE(e,S,r,o)}else e.emit("unexpected-response",g,m)||Rt(e,g,`Unexpected server response: ${m.statusCode}`)}),g.on("upgrade",(m,_,v)=>{if(e.emit("upgrade",m),e.readyState!==Te.CONNECTING)return;g=e._req=null;let S=m.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){Rt(e,_,"Invalid Upgrade header");return}let k=FF("sha1").update(l+HF).digest("base64");if(m.headers["sec-websocket-accept"]!==k){Rt(e,_,"Invalid Sec-WebSocket-Accept header");return}let b=m.headers["sec-websocket-protocol"],x;if(b!==void 0?h.size?h.has(b)||(x="Server sent an invalid subprotocol"):x="Server sent a subprotocol but none was requested":h.size&&(x="Server sent no subprotocol"),x){Rt(e,_,x);return}b&&(e._protocol=b);let T=m.headers["sec-websocket-extensions"];if(T!==void 0){if(!p){Rt(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=QF(T)}catch{Rt(e,_,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(C);if(D.length!==1||D[0]!==$n.extensionName){Rt(e,_,"Server indicated an extension that was not requested");return}try{p.accept(C[$n.extensionName])}catch{Rt(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[$n.extensionName]=p}e.setSocket(_,v,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,e):g.end()}function Il(e,t){e._readyState=Te.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function rq(e){return e.path=e.socketPath,KE.connect(e)}function nq(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=KE.isIP(e.host)?"":e.host),MF.connect(e)}function Rt(e,t,r){e._readyState=Te.CLOSING;let o=new Error(r);Error.captureStackTrace(o,Rt),t.setHeader?(t[XE]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Il,e,o)):(t.destroy(o),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Cm(e,t,r){if(t){let o=VF(t)?t.size:eq(t).length;e._socket?e._sender._bufferedBytes+=o:e._bufferedAmount+=o}if(r){let o=new Error(`WebSocket is not open: readyState ${e.readyState} (${Wr[e.readyState]})`);process.nextTick(r,o)}}function oq(e,t){let r=this[He];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[He]!==void 0&&(r._socket.removeListener("data",Pl),process.nextTick(ez,r._socket),e===1005?r.close():r.close(e,t))}function iq(){let e=this[He];e.isPaused||e._socket.resume()}function sq(e){let t=this[He];t._socket[He]!==void 0&&(t._socket.removeListener("data",Pl),process.nextTick(ez,t._socket),t.close(e[GF])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function GE(){this[He].emitClose()}function aq(e,t){this[He].emit("message",e,t)}function cq(e){let t=this[He];t._autoPong&&t.pong(e,!this._isServer,YE),t.emit("ping",e)}function uq(e){this[He].emit("pong",e)}function ez(e){e.resume()}function lq(e){let t=this[He];t.readyState!==Te.CLOSED&&(t.readyState===Te.OPEN&&(t._readyState=Te.CLOSING,tz(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function tz(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function rz(){let e=this[He];if(this.removeListener("close",rz),this.removeListener("data",Pl),this.removeListener("end",nz),e._readyState=Te.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[He]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",GE),e._receiver.on("finish",GE))}function Pl(e){this[He]._receiver.write(e)||this.pause()}function nz(){let e=this[He];e._readyState=Te.CLOSING,e._receiver.end(),this.end()}function oz(){let e=this[He];this.removeListener("error",oz),this.on("error",YE),e&&(e._readyState=Te.CLOSING,this.destroy())}});var uz=w((Eue,cz)=>{"use strict";var kue=Ol(),{Duplex:dq}=F("stream");function sz(e){e.emit("close")}function fq(){!this.destroyed&&this._writableState.finished&&this.destroy()}function az(e){this.removeListener("error",az),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function pq(e,t){let r=!0,o=new dq({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(i,s){let a=!s&&o._readableState.objectMode?i.toString():i;o.push(a)||e.pause()}),e.once("error",function(i){o.destroyed||(r=!1,o.destroy(i))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(n,i){if(e.readyState===e.CLOSED){i(n),process.nextTick(sz,o);return}let s=!1;e.once("error",function(u){s=!0,i(u)}),e.once("close",function(){s||i(n),process.nextTick(sz,o)}),r&&e.terminate()},o._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},o._read=function(){e.isPaused&&e.resume()},o._write=function(n,i,s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(n,i,s)});return}e.send(n,s)},o.on("end",fq),o.on("error",az),o}cz.exports=pq});var dz=w((zue,lz)=>{"use strict";var{tokenChars:hq}=mi();function mq(e){let t=new Set,r=-1,o=-1,n=0;for(n;n<e.length;n++){let s=e.charCodeAt(n);if(o===-1&&hq[s]===1)r===-1&&(r=n);else if(n!==0&&(s===32||s===9))o===-1&&r!==-1&&(o=n);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);o===-1&&(o=n);let a=e.slice(r,o);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=o=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}lz.exports={parse:mq}});var vz=w((Iue,_z)=>{"use strict";var gq=F("events"),Rl=F("http"),{Duplex:Tue}=F("stream"),{createHash:_q}=F("crypto"),fz=Im(),mo=ka(),vq=dz(),yq=Ol(),{CLOSE_TIMEOUT:bq,GUID:xq,kWebSocket:wq}=qr(),Sq=/^[+/0-9A-Za-z]{22}==$/,pz=0,hz=1,gz=2,Am=class extends gq{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:bq,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:yq,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Rl.createServer((o,n)=>{let i=Rl.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=$q(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,s)=>{this.handleUpgrade(n,i,s,o)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=pz}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===gz){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Ia,this);return}if(t&&this.once("close",t),this._state!==hz)if(this._state=hz,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Ia,this):process.nextTick(Ia,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Ia(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,o,n){r.on("error",mz);let i=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){go(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){go(this,t,r,400,"Invalid Upgrade header");return}if(i===void 0||!Sq.test(i)){go(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){go(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Pa(r,400);return}let u=t.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=vq.parse(u)}catch{go(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&l!==void 0){let h=new mo(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let p=fz.parse(l);p[mo.extensionName]&&(h.accept(p[mo.extensionName]),f[mo.extensionName]=h)}catch{go(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(p,g,m,_)=>{if(!p)return Pa(r,g||401,m,_);this.completeUpgrade(f,i,c,t,r,o,n)});return}if(!this.options.verifyClient(h))return Pa(r,401)}this.completeUpgrade(f,i,c,t,r,o,n)}completeUpgrade(t,r,o,n,i,s,a){if(!i.readable||!i.writable)return i.destroy();if(i[wq])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>pz)return Pa(i,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${_q("sha1").update(r+xq).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(o.size){let f=this.options.handleProtocols?this.options.handleProtocols(o,n):o.values().next().value;f&&(c.push(`Sec-WebSocket-Protocol: ${f}`),l._protocol=f)}if(t[mo.extensionName]){let f=t[mo.extensionName].params,h=fz.format({[mo.extensionName]:[f]});c.push(`Sec-WebSocket-Extensions: ${h}`),l._extensions=t}this.emit("headers",c,n),i.write(c.concat(`\r
|
|
4
|
+
`).join(`\r
|
|
5
|
+
`)),i.removeListener("error",mz),l.setSocket(i,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ia,this)})),a(l,n)}};_z.exports=Am;function $q(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let o of Object.keys(t))e.removeListener(o,t[o])}}function Ia(e){e._state=gz,e.emit("close")}function mz(){this.destroy()}function Pa(e,t,r,o){r=r||Rl.STATUS_CODES[t],o={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...o},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Rl.STATUS_CODES[t]}\r
|
|
6
|
+
`+Object.keys(o).map(n=>`${n}: ${o[n]}`).join(`\r
|
|
7
|
+
`)+`\r
|
|
8
|
+
\r
|
|
9
|
+
`+r)}function go(e,t,r,o,n,i){if(e.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,go),e.emit("wsClientError",s,r,t)}else Pa(r,o,n,i)}});var s1=w((Ipe,i1)=>{"use strict";i1.exports=function(t){return t.map(function(r){return r===""?"''":r&&typeof r=="object"?r.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(r)&&!/'/.test(r)?"'"+r.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(r)?'"'+r.replace(/(["\\$`!])/g,"\\$1")+'"':String(r).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var p1=w((Ppe,f1)=>{"use strict";var d1="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",a1=new RegExp("^"+d1+"$"),c1="|&;()<> \\t",vW='"((\\\\"|[^"])*?)"',yW="'((\\\\'|[^'])*?)'",bW=/^#$/,u1="'",l1='"',Kb="$",Eo="",xW=4294967296;for(Yb=0;Yb<4;Yb++)Eo+=(xW*Math.random()).toString(16);var Yb,wW=new RegExp("^"+Eo);function SW(e,t){for(var r=t.lastIndex,o=[],n;n=t.exec(e);)o.push(n),t.lastIndex===n.index&&(t.lastIndex+=1);return t.lastIndex=r,o}function $W(e,t,r){var o=typeof e=="function"?e(r):e[r];return typeof o>"u"&&r!=""?o="":typeof o>"u"&&(o="$"),typeof o=="object"?t+Eo+JSON.stringify(o)+Eo:t+o}function kW(e,t,r){r||(r={});var o=r.escape||"\\",n="(\\"+o+`['"`+c1+`]|[^\\s'"`+c1+"])+",i=new RegExp(["("+d1+")","("+n+"|"+vW+"|"+yW+")+"].join("|"),"g"),s=SW(e,i);if(s.length===0)return[];t||(t={});var a=!1;return s.map(function(u){var c=u[0];if(!c||a)return;if(a1.test(c))return{op:c};var l=!1,f=!1,h="",p=!1,g;function m(){g+=1;var S,k,b=c.charAt(g);if(b==="{"){if(g+=1,c.charAt(g)==="}")throw new Error("Bad substitution: "+c.slice(g-2,g+1));if(S=c.indexOf("}",g),S<0)throw new Error("Bad substitution: "+c.slice(g));k=c.slice(g,S),g=S}else if(/[*@#?$!_-]/.test(b))k=b,g+=1;else{var x=c.slice(g);S=x.match(/[^\w\d_]/),S?(k=x.slice(0,S.index),g+=S.index-1):(k=x,g=c.length)}return $W(t,"",k)}for(g=0;g<c.length;g++){var _=c.charAt(g);if(p=p||!l&&(_==="*"||_==="?"),f)h+=_,f=!1;else if(l)_===l?l=!1:l==u1?h+=_:_===o?(g+=1,_=c.charAt(g),_===l1||_===o||_===Kb?h+=_:h+=o+_):_===Kb?h+=m():h+=_;else if(_===l1||_===u1)l=_;else{if(a1.test(_))return{op:c};if(bW.test(_)){a=!0;var v={comment:e.slice(u.index+g+1)};return h.length?[h,v]:[v]}else _===o?f=!0:_===Kb?h+=m():h+=_}}return p?{op:"glob",pattern:h}:h}).reduce(function(u,c){return typeof c>"u"?u:u.concat(c)},[])}f1.exports=function(t,r,o){var n=kW(t,r,o);return typeof r!="function"?n:n.reduce(function(i,s){if(typeof s=="object")return i.concat(s);var a=s.split(RegExp("("+Eo+".*?"+Eo+")","g"));return a.length===1?i.concat(a[0]):i.concat(a.filter(Boolean).map(function(u){return wW.test(u)?JSON.parse(u.split(Eo)[1]):u}))},[])}});var h1=w(Xb=>{"use strict";Xb.quote=s1();Xb.parse=p1()});var fc=w((Rpe,Qb)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Qb.exports={nextTick:EW}:Qb.exports=process;function EW(e,t,r,o){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,i,s;switch(n){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,o)});default:for(i=new Array(n-1),s=0;s<i.length;)i[s++]=arguments[s];return process.nextTick(function(){e.apply(null,i)})}}});var g1=w((Cpe,m1)=>{"use strict";var zW={}.toString;m1.exports=Array.isArray||function(e){return zW.call(e)=="[object Array]"}});var ex=w((Ape,_1)=>{"use strict";_1.exports=F("stream")});var pc=w((tx,y1)=>{"use strict";var Tf=F("buffer"),Kr=Tf.Buffer;function v1(e,t){for(var r in e)t[r]=e[r]}Kr.from&&Kr.alloc&&Kr.allocUnsafe&&Kr.allocUnsafeSlow?y1.exports=Tf:(v1(Tf,tx),tx.Buffer=es);function es(e,t,r){return Kr(e,t,r)}v1(Kr,es);es.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Kr(e,t,r)};es.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=Kr(e);return t!==void 0?typeof r=="string"?o.fill(t,r):o.fill(t):o.fill(0),o};es.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Kr(e)};es.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Tf.SlowBuffer(e)}});var ts=w(at=>{"use strict";function TW(e){return Array.isArray?Array.isArray(e):If(e)==="[object Array]"}at.isArray=TW;function IW(e){return typeof e=="boolean"}at.isBoolean=IW;function PW(e){return e===null}at.isNull=PW;function OW(e){return e==null}at.isNullOrUndefined=OW;function RW(e){return typeof e=="number"}at.isNumber=RW;function CW(e){return typeof e=="string"}at.isString=CW;function AW(e){return typeof e=="symbol"}at.isSymbol=AW;function NW(e){return e===void 0}at.isUndefined=NW;function DW(e){return If(e)==="[object RegExp]"}at.isRegExp=DW;function jW(e){return typeof e=="object"&&e!==null}at.isObject=jW;function UW(e){return If(e)==="[object Date]"}at.isDate=UW;function LW(e){return If(e)==="[object Error]"||e instanceof Error}at.isError=LW;function MW(e){return typeof e=="function"}at.isFunction=MW;function ZW(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}at.isPrimitive=ZW;at.isBuffer=F("buffer").Buffer.isBuffer;function If(e){return Object.prototype.toString.call(e)}});var b1=w((Dpe,rx)=>{"use strict";typeof Object.create=="function"?rx.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:rx.exports=function(t,r){if(r){t.super_=r;var o=function(){};o.prototype=r.prototype,t.prototype=new o,t.prototype.constructor=t}}});var rs=w((jpe,ox)=>{"use strict";try{if(nx=F("util"),typeof nx.inherits!="function")throw"";ox.exports=nx.inherits}catch{ox.exports=b1()}var nx});var w1=w((Upe,ix)=>{"use strict";function FW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var x1=pc().Buffer,hc=F("util");function qW(e,t,r){e.copy(t,r)}ix.exports=(function(){function e(){FW(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var o={data:r,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length},e.prototype.unshift=function(r){var o={data:r,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var o=this.head,n=""+o.data;o=o.next;)n+=r+o.data;return n},e.prototype.concat=function(r){if(this.length===0)return x1.alloc(0);for(var o=x1.allocUnsafe(r>>>0),n=this.head,i=0;n;)qW(n.data,o,i),i+=n.data.length,n=n.next;return o},e})();hc&&hc.inspect&&hc.inspect.custom&&(ix.exports.prototype[hc.inspect.custom]=function(){var e=hc.inspect({length:this.length});return this.constructor.name+" "+e})});var sx=w((Lpe,S1)=>{"use strict";var Pf=fc();function BW(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return o||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Pf.nextTick(Of,this,e)):Pf.nextTick(Of,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(i){!t&&i?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,Pf.nextTick(Of,r,i)):Pf.nextTick(Of,r,i):t&&t(i)}),this)}function VW(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Of(e,t){e.emit("error",t)}S1.exports={destroy:BW,undestroy:VW}});var k1=w((Mpe,$1)=>{"use strict";$1.exports=F("util").deprecate});var cx=w((Zpe,C1)=>{"use strict";var zo=fc();C1.exports=Ze;function z1(e){var t=this;this.next=null,this.entry=null,this.finish=function(){uH(t,e)}}var WW=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:zo.nextTick,ns;Ze.WritableState=gc;var T1=Object.create(ts());T1.inherits=rs();var HW={deprecate:k1()},I1=ex(),Cf=pc().Buffer,JW=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function GW(e){return Cf.from(e)}function KW(e){return Cf.isBuffer(e)||e instanceof JW}var P1=sx();T1.inherits(Ze,I1);function YW(){}function gc(e,t){ns=ns||To(),e=e||{};var r=t instanceof ns;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,n=e.writableHighWaterMark,i=this.objectMode?16:16*1024;o||o===0?this.highWaterMark=o:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=e.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){oH(t,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new z1(this)}gc.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(gc.prototype,"buffer",{get:HW.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Rf;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Rf=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ze,Symbol.hasInstance,{value:function(e){return Rf.call(this,e)?!0:this!==Ze?!1:e&&e._writableState instanceof gc}})):Rf=function(e){return e instanceof this};function Ze(e){if(ns=ns||To(),!Rf.call(Ze,this)&&!(this instanceof ns))return new Ze(e);this._writableState=new gc(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),I1.call(this)}Ze.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function XW(e,t){var r=new Error("write after end");e.emit("error",r),zo.nextTick(t,r)}function QW(e,t,r,o){var n=!0,i=!1;return r===null?i=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i&&(e.emit("error",i),zo.nextTick(o,i),n=!1),n}Ze.prototype.write=function(e,t,r){var o=this._writableState,n=!1,i=!o.objectMode&&KW(e);return i&&!Cf.isBuffer(e)&&(e=GW(e)),typeof t=="function"&&(r=t,t=null),i?t="buffer":t||(t=o.defaultEncoding),typeof r!="function"&&(r=YW),o.ended?XW(this,r):(i||QW(this,o,e,r))&&(o.pendingcb++,n=tH(this,o,i,e,t,r)),n};Ze.prototype.cork=function(){var e=this._writableState;e.corked++};Ze.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&O1(this,e))};Ze.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function eH(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Cf.from(t,r)),t}Object.defineProperty(Ze.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tH(e,t,r,o,n,i){if(!r){var s=eH(t,o,n);o!==s&&(r=!0,n="buffer",o=s)}var a=t.objectMode?1:o.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:o,encoding:n,isBuf:r,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ax(e,t,!1,a,o,n,i);return u}function ax(e,t,r,o,n,i,s){t.writelen=o,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function rH(e,t,r,o,n){--t.pendingcb,r?(zo.nextTick(n,o),zo.nextTick(mc,e,t),e._writableState.errorEmitted=!0,e.emit("error",o)):(n(o),e._writableState.errorEmitted=!0,e.emit("error",o),mc(e,t))}function nH(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function oH(e,t){var r=e._writableState,o=r.sync,n=r.writecb;if(nH(r),t)rH(e,r,o,t,n);else{var i=R1(r);!i&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&O1(e,r),o?WW(E1,e,r,i,n):E1(e,r,i,n)}}function E1(e,t,r,o){r||iH(e,t),t.pendingcb--,o(),mc(e,t)}function iH(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function O1(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var o=t.bufferedRequestCount,n=new Array(o),i=t.corkedRequestsFree;i.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,ax(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new z1(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(ax(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}Ze.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};Ze.prototype._writev=null;Ze.prototype.end=function(e,t,r){var o=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||cH(this,o,r)};function R1(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function sH(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),mc(e,t)})}function aH(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,zo.nextTick(sH,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function mc(e,t){var r=R1(t);return r&&(aH(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function cH(e,t,r){t.ending=!0,mc(e,t),r&&(t.finished?zo.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function uH(e,t,r){var o=e.entry;for(e.entry=null;o;){var n=o.callback;t.pendingcb--,n(r),o=o.next}t.corkedRequestsFree.next=e}Object.defineProperty(Ze.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ze.prototype.destroy=P1.destroy;Ze.prototype._undestroy=P1.undestroy;Ze.prototype._destroy=function(e,t){this.end(),t(e)}});var To=w((Fpe,j1)=>{"use strict";var A1=fc(),lH=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};j1.exports=Yr;var N1=Object.create(ts());N1.inherits=rs();var D1=dx(),lx=cx();N1.inherits(Yr,D1);for(ux=lH(lx.prototype),Af=0;Af<ux.length;Af++)Nf=ux[Af],Yr.prototype[Nf]||(Yr.prototype[Nf]=lx.prototype[Nf]);var ux,Nf,Af;function Yr(e){if(!(this instanceof Yr))return new Yr(e);D1.call(this,e),lx.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",dH)}Object.defineProperty(Yr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function dH(){this.allowHalfOpen||this._writableState.ended||A1.nextTick(fH,this)}function fH(e){e.end()}Object.defineProperty(Yr.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});Yr.prototype._destroy=function(e,t){this.push(null),this.end(),A1.nextTick(t,e)}});var hx=w(L1=>{"use strict";var px=pc().Buffer,U1=px.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function pH(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function hH(e){var t=pH(e);if(typeof t!="string"&&(px.isEncoding===U1||!U1(e)))throw new Error("Unknown encoding: "+e);return t||e}L1.StringDecoder=_c;function _c(e){this.encoding=hH(e);var t;switch(this.encoding){case"utf16le":this.text=bH,this.end=xH,t=4;break;case"utf8":this.fillLast=_H,t=4;break;case"base64":this.text=wH,this.end=SH,t=3;break;default:this.write=$H,this.end=kH;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=px.allocUnsafe(t)}_c.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};_c.prototype.end=yH;_c.prototype.text=vH;_c.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function fx(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function mH(e,t,r){var o=t.length-1;if(o<r)return 0;var n=fx(t[o]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--o<r||n===-2?0:(n=fx(t[o]),n>=0?(n>0&&(e.lastNeed=n-2),n):--o<r||n===-2?0:(n=fx(t[o]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function gH(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function _H(e){var t=this.lastTotal-this.lastNeed,r=gH(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function vH(e,t){var r=mH(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var o=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,o),e.toString("utf8",t,o)}function yH(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function bH(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var o=r.charCodeAt(r.length-1);if(o>=55296&&o<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function xH(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function wH(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function SH(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function $H(e){return e.toString(this.encoding)}function kH(e){return e&&e.length?this.write(e):""}});var dx=w((Vpe,Y1)=>{"use strict";var is=fc();Y1.exports=Se;var EH=g1(),vc;Se.ReadableState=W1;var Bpe=F("events").EventEmitter,q1=function(e,t){return e.listeners(t).length},yx=ex(),yc=pc().Buffer,zH=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function TH(e){return yc.from(e)}function IH(e){return yc.isBuffer(e)||e instanceof zH}var B1=Object.create(ts());B1.inherits=rs();var mx=F("util"),ue=void 0;mx&&mx.debuglog?ue=mx.debuglog("stream"):ue=function(){};var PH=w1(),V1=sx(),os;B1.inherits(Se,yx);var gx=["error","close","destroy","pause","resume"];function OH(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):EH(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function W1(e,t){vc=vc||To(),e=e||{};var r=t instanceof vc;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,n=e.readableHighWaterMark,i=this.objectMode?16:16*1024;o||o===0?this.highWaterMark=o:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new PH,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(os||(os=hx().StringDecoder),this.decoder=new os(e.encoding),this.encoding=e.encoding)}function Se(e){if(vc=vc||To(),!(this instanceof Se))return new Se(e);this._readableState=new W1(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),yx.call(this)}Object.defineProperty(Se.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Se.prototype.destroy=V1.destroy;Se.prototype._undestroy=V1.undestroy;Se.prototype._destroy=function(e,t){this.push(null),t(e)};Se.prototype.push=function(e,t){var r=this._readableState,o;return r.objectMode?o=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=yc.from(e,t),t=""),o=!0),H1(this,e,t,!1,o)};Se.prototype.unshift=function(e){return H1(this,e,null,!0,!1)};function H1(e,t,r,o,n){var i=e._readableState;if(t===null)i.reading=!1,NH(e,i);else{var s;n||(s=RH(i,t)),s?e.emit("error",s):i.objectMode||t&&t.length>0?(typeof t!="string"&&!i.objectMode&&Object.getPrototypeOf(t)!==yc.prototype&&(t=TH(t)),o?i.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_x(e,i,t,!0):i.ended?e.emit("error",new Error("stream.push() after EOF")):(i.reading=!1,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||t.length!==0?_x(e,i,t,!1):J1(e,i)):_x(e,i,t,!1))):o||(i.reading=!1)}return CH(i)}function _x(e,t,r,o){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,o?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Df(e)),J1(e,t)}function RH(e,t){var r;return!IH(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function CH(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}Se.prototype.isPaused=function(){return this._readableState.flowing===!1};Se.prototype.setEncoding=function(e){return os||(os=hx().StringDecoder),this._readableState.decoder=new os(e),this._readableState.encoding=e,this};var M1=8388608;function AH(e){return e>=M1?e=M1:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Z1(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=AH(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Se.prototype.read=function(e){ue("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return ue("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?vx(this):Df(this),null;if(e=Z1(e,t),e===0&&t.ended)return t.length===0&&vx(this),null;var o=t.needReadable;ue("need readable",o),(t.length===0||t.length-e<t.highWaterMark)&&(o=!0,ue("length less than watermark",o)),t.ended||t.reading?(o=!1,ue("reading or ended",o)):o&&(ue("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=Z1(r,t)));var n;return e>0?n=G1(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&vx(this)),n!==null&&this.emit("data",n),n};function NH(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Df(e)}}function Df(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(ue("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?is.nextTick(F1,e):F1(e))}function F1(e){ue("emit readable"),e.emit("readable"),bx(e)}function J1(e,t){t.readingMore||(t.readingMore=!0,is.nextTick(DH,e,t))}function DH(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(ue("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}Se.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};Se.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e);break}o.pipesCount+=1,ue("pipe count=%d opts=%j",o.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,i=n?a:_;o.endEmitted?is.nextTick(i):r.once("end",i),e.on("unpipe",s);function s(v,S){ue("onunpipe"),v===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,l())}function a(){ue("onend"),e.end()}var u=jH(r);e.on("drain",u);var c=!1;function l(){ue("cleanup"),e.removeListener("close",g),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",_),r.removeListener("data",h),c=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}var f=!1;r.on("data",h);function h(v){ue("ondata"),f=!1;var S=e.write(v);S===!1&&!f&&((o.pipesCount===1&&o.pipes===e||o.pipesCount>1&&K1(o.pipes,e)!==-1)&&!c&&(ue("false write response, pause",o.awaitDrain),o.awaitDrain++,f=!0),r.pause())}function p(v){ue("onerror",v),_(),e.removeListener("error",p),q1(e,"error")===0&&e.emit("error",v)}OH(e,"error",p);function g(){e.removeListener("finish",m),_()}e.once("close",g);function m(){ue("onfinish"),e.removeListener("close",g),_()}e.once("finish",m);function _(){ue("unpipe"),r.unpipe(e)}return e.emit("pipe",r),o.flowing||(ue("pipe resume"),r.resume()),e};function jH(e){return function(){var t=e._readableState;ue("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&q1(e,"data")&&(t.flowing=!0,bx(e))}}Se.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var o=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)o[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=K1(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Se.prototype.on=function(e,t){var r=yx.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var o=this._readableState;!o.endEmitted&&!o.readableListening&&(o.readableListening=o.needReadable=!0,o.emittedReadable=!1,o.reading?o.length&&Df(this):is.nextTick(UH,this))}return r};Se.prototype.addListener=Se.prototype.on;function UH(e){ue("readable nexttick read 0"),e.read(0)}Se.prototype.resume=function(){var e=this._readableState;return e.flowing||(ue("resume"),e.flowing=!0,LH(this,e)),this};function LH(e,t){t.resumeScheduled||(t.resumeScheduled=!0,is.nextTick(MH,e,t))}function MH(e,t){t.reading||(ue("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),bx(e),t.flowing&&!t.reading&&e.read(0)}Se.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function bx(e){var t=e._readableState;for(ue("flow",t.flowing);t.flowing&&e.read()!==null;);}Se.prototype.wrap=function(e){var t=this,r=this._readableState,o=!1;e.on("end",function(){if(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=t.push(s);a||(o=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(s){return function(){return e[s].apply(e,arguments)}})(n));for(var i=0;i<gx.length;i++)e.on(gx[i],this.emit.bind(this,gx[i]));return this._read=function(s){ue("wrapped _read",s),o&&(o=!1,e.resume())},this};Object.defineProperty(Se.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Se._fromList=G1;function G1(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=ZH(e,t.buffer,t.decoder),r}function ZH(e,t,r){var o;return e<t.head.data.length?(o=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?o=t.shift():o=r?FH(e,t):qH(e,t),o}function FH(e,t){var r=t.head,o=1,n=r.data;for(e-=n.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),e-=s,e===0){s===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(s));break}++o}return t.length-=o,n}function qH(e,t){var r=yc.allocUnsafe(e),o=t.head,n=1;for(o.data.copy(r),e-=o.data.length;o=o.next;){var i=o.data,s=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,s),e-=s,e===0){s===i.length?(++n,o.next?t.head=o.next:t.head=t.tail=null):(t.head=o,o.data=i.slice(s));break}++n}return t.length-=n,r}function vx(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,is.nextTick(BH,t,e))}function BH(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function K1(e,t){for(var r=0,o=e.length;r<o;r++)if(e[r]===t)return r;return-1}});var xx=w((Wpe,eO)=>{"use strict";eO.exports=Xr;var jf=To(),Q1=Object.create(ts());Q1.inherits=rs();Q1.inherits(Xr,jf);function VH(e,t){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(!o)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),o(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Xr(e){if(!(this instanceof Xr))return new Xr(e);jf.call(this,e),this._transformState={afterTransform:VH.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",WH)}function WH(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){X1(e,t,r)}):X1(this,null,null)}Xr.prototype.push=function(e,t){return this._transformState.needTransform=!1,jf.prototype.push.call(this,e,t)};Xr.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};Xr.prototype._write=function(e,t,r){var o=this._transformState;if(o.writecb=r,o.writechunk=e,o.writeencoding=t,!o.transforming){var n=this._readableState;(o.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Xr.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Xr.prototype._destroy=function(e,t){var r=this;jf.prototype._destroy.call(this,e,function(o){t(o),r.emit("close")})};function X1(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var oO=w((Hpe,nO)=>{"use strict";nO.exports=bc;var tO=xx(),rO=Object.create(ts());rO.inherits=rs();rO.inherits(bc,tO);function bc(e){if(!(this instanceof bc))return new bc(e);tO.call(this,e)}bc.prototype._transform=function(e,t,r){r(null,e)}});var wx=w((Ke,Uf)=>{"use strict";var Tr=F("stream");process.env.READABLE_STREAM==="disable"&&Tr?(Uf.exports=Tr,Ke=Uf.exports=Tr.Readable,Ke.Readable=Tr.Readable,Ke.Writable=Tr.Writable,Ke.Duplex=Tr.Duplex,Ke.Transform=Tr.Transform,Ke.PassThrough=Tr.PassThrough,Ke.Stream=Tr):(Ke=Uf.exports=dx(),Ke.Stream=Tr||Ke,Ke.Readable=Ke,Ke.Writable=cx(),Ke.Duplex=To(),Ke.Transform=xx(),Ke.PassThrough=oO())});var Qr=w(Nt=>{"use strict";Nt.base64=!0;Nt.array=!0;Nt.string=!0;Nt.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";Nt.nodebuffer=typeof Buffer<"u";Nt.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")Nt.blob=!1;else{Sx=new ArrayBuffer(0);try{Nt.blob=new Blob([Sx],{type:"application/zip"}).size===0}catch{try{iO=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,$x=new iO,$x.append(Sx),Nt.blob=$x.getBlob("application/zip").size===0}catch{Nt.blob=!1}}}var Sx,iO,$x;try{Nt.nodestream=!!wx().Readable}catch{Nt.nodestream=!1}});var Ex=w(kx=>{"use strict";var HH=Ae(),JH=Qr(),Ir="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";kx.encode=function(e){for(var t=[],r,o,n,i,s,a,u,c=0,l=e.length,f=l,h=HH.getTypeOf(e)!=="string";c<e.length;)f=l-c,h?(r=e[c++],o=c<l?e[c++]:0,n=c<l?e[c++]:0):(r=e.charCodeAt(c++),o=c<l?e.charCodeAt(c++):0,n=c<l?e.charCodeAt(c++):0),i=r>>2,s=(r&3)<<4|o>>4,a=f>1?(o&15)<<2|n>>6:64,u=f>2?n&63:64,t.push(Ir.charAt(i)+Ir.charAt(s)+Ir.charAt(a)+Ir.charAt(u));return t.join("")};kx.decode=function(e){var t,r,o,n,i,s,a,u=0,c=0,l="data:";if(e.substr(0,l.length)===l)throw new Error("Invalid base64 input, it looks like a data url.");e=e.replace(/[^A-Za-z0-9+/=]/g,"");var f=e.length*3/4;if(e.charAt(e.length-1)===Ir.charAt(64)&&f--,e.charAt(e.length-2)===Ir.charAt(64)&&f--,f%1!==0)throw new Error("Invalid base64 input, bad content length.");var h;for(JH.uint8array?h=new Uint8Array(f|0):h=new Array(f|0);u<e.length;)n=Ir.indexOf(e.charAt(u++)),i=Ir.indexOf(e.charAt(u++)),s=Ir.indexOf(e.charAt(u++)),a=Ir.indexOf(e.charAt(u++)),t=n<<2|i>>4,r=(i&15)<<4|s>>2,o=(s&3)<<6|a,h[c++]=t,s!==64&&(h[c++]=r),a!==64&&(h[c++]=o);return h}});var xc=w((Kpe,sO)=>{"use strict";sO.exports={isNode:typeof Buffer<"u",newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e=="number")throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on=="function"&&typeof e.pause=="function"&&typeof e.resume=="function"}}});var lO=w((Ype,uO)=>{"use strict";var aO=global.MutationObserver||global.WebKitMutationObserver,ss;process.browser?aO?(zx=0,cO=new aO(wc),Tx=global.document.createTextNode(""),cO.observe(Tx,{characterData:!0}),ss=function(){Tx.data=zx=++zx%2}):!global.setImmediate&&typeof global.MessageChannel<"u"?(Ix=new global.MessageChannel,Ix.port1.onmessage=wc,ss=function(){Ix.port2.postMessage(0)}):"document"in global&&"onreadystatechange"in global.document.createElement("script")?ss=function(){var e=global.document.createElement("script");e.onreadystatechange=function(){wc(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},global.document.documentElement.appendChild(e)}:ss=function(){setTimeout(wc,0)}:ss=function(){process.nextTick(wc)};var zx,cO,Tx,Ix,Px,Sc=[];function wc(){Px=!0;for(var e,t,r=Sc.length;r;){for(t=Sc,Sc=[],e=-1;++e<r;)t[e]();r=Sc.length}Px=!1}uO.exports=GH;function GH(e){Sc.push(e)===1&&!Px&&ss()}});var _O=w((Xpe,gO)=>{"use strict";var dO=lO();function as(){}var ct={},fO=["REJECTED"],Ox=["FULFILLED"],pO=["PENDING"];process.browser||($c=["UNHANDLED"]);var $c;gO.exports=Dn;function Dn(e){if(typeof e!="function")throw new TypeError("resolver must be a function");this.state=pO,this.queue=[],this.outcome=void 0,process.browser||(this.handled=$c),e!==as&&hO(this,e)}Dn.prototype.finally=function(e){if(typeof e!="function")return this;var t=this.constructor;return this.then(r,o);function r(n){function i(){return n}return t.resolve(e()).then(i)}function o(n){function i(){throw n}return t.resolve(e()).then(i)}};Dn.prototype.catch=function(e){return this.then(null,e)};Dn.prototype.then=function(e,t){if(typeof e!="function"&&this.state===Ox||typeof t!="function"&&this.state===fO)return this;var r=new this.constructor(as);if(process.browser||this.handled===$c&&(this.handled=null),this.state!==pO){var o=this.state===Ox?e:t;Rx(r,o,this.outcome)}else this.queue.push(new kc(r,e,t));return r};function kc(e,t,r){this.promise=e,typeof t=="function"&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof r=="function"&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}kc.prototype.callFulfilled=function(e){ct.resolve(this.promise,e)};kc.prototype.otherCallFulfilled=function(e){Rx(this.promise,this.onFulfilled,e)};kc.prototype.callRejected=function(e){ct.reject(this.promise,e)};kc.prototype.otherCallRejected=function(e){Rx(this.promise,this.onRejected,e)};function Rx(e,t,r){dO(function(){var o;try{o=t(r)}catch(n){return ct.reject(e,n)}o===e?ct.reject(e,new TypeError("Cannot resolve promise with itself")):ct.resolve(e,o)})}ct.resolve=function(e,t){var r=mO(KH,t);if(r.status==="error")return ct.reject(e,r.value);var o=r.value;if(o)hO(e,o);else{e.state=Ox,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callFulfilled(t)}return e};ct.reject=function(e,t){e.state=fO,e.outcome=t,process.browser||e.handled===$c&&dO(function(){e.handled===$c&&process.emit("unhandledRejection",t,e)});for(var r=-1,o=e.queue.length;++r<o;)e.queue[r].callRejected(t);return e};function KH(e){var t=e&&e.then;if(e&&(typeof e=="object"||typeof e=="function")&&typeof t=="function")return function(){t.apply(e,arguments)}}function hO(e,t){var r=!1;function o(a){r||(r=!0,ct.reject(e,a))}function n(a){r||(r=!0,ct.resolve(e,a))}function i(){t(n,o)}var s=mO(i);s.status==="error"&&o(s.value)}function mO(e,t){var r={};try{r.value=e(t),r.status="success"}catch(o){r.status="error",r.value=o}return r}Dn.resolve=YH;function YH(e){return e instanceof this?e:ct.resolve(new this(as),e)}Dn.reject=XH;function XH(e){var t=new this(as);return ct.reject(t,e)}Dn.all=QH;function QH(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=e.length,o=!1;if(!r)return this.resolve([]);for(var n=new Array(r),i=0,s=-1,a=new this(as);++s<r;)u(e[s],s);return a;function u(c,l){t.resolve(c).then(f,function(h){o||(o=!0,ct.reject(a,h))});function f(h){n[l]=h,++i===r&&!o&&(o=!0,ct.resolve(a,n))}}}Dn.race=e5;function e5(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(new TypeError("must be an array"));var r=e.length,o=!1;if(!r)return this.resolve([]);for(var n=-1,i=new this(as);++n<r;)s(e[n]);return i;function s(a){t.resolve(a).then(function(u){o||(o=!0,ct.resolve(i,u))},function(u){o||(o=!0,ct.reject(i,u))})}}});var cs=w((Qpe,vO)=>{"use strict";var Cx=null;typeof Promise<"u"?Cx=Promise:Cx=_O();vO.exports={Promise:Cx}});var bO=w(yO=>{"use strict";(function(e,t){"use strict";if(e.setImmediate)return;var r=1,o={},n=!1,i=e.document,s;function a(S){typeof S!="function"&&(S=new Function(""+S));for(var k=new Array(arguments.length-1),b=0;b<k.length;b++)k[b]=arguments[b+1];var x={callback:S,args:k};return o[r]=x,s(r),r++}function u(S){delete o[S]}function c(S){var k=S.callback,b=S.args;switch(b.length){case 0:k();break;case 1:k(b[0]);break;case 2:k(b[0],b[1]);break;case 3:k(b[0],b[1],b[2]);break;default:k.apply(t,b);break}}function l(S){if(n)setTimeout(l,0,S);else{var k=o[S];if(k){n=!0;try{c(k)}finally{u(S),n=!1}}}}function f(){s=function(S){process.nextTick(function(){l(S)})}}function h(){if(e.postMessage&&!e.importScripts){var S=!0,k=e.onmessage;return e.onmessage=function(){S=!1},e.postMessage("","*"),e.onmessage=k,S}}function p(){var S="setImmediate$"+Math.random()+"$",k=function(b){b.source===e&&typeof b.data=="string"&&b.data.indexOf(S)===0&&l(+b.data.slice(S.length))};e.addEventListener?e.addEventListener("message",k,!1):e.attachEvent("onmessage",k),s=function(b){e.postMessage(S+b,"*")}}function g(){var S=new MessageChannel;S.port1.onmessage=function(k){var b=k.data;l(b)},s=function(k){S.port2.postMessage(k)}}function m(){var S=i.documentElement;s=function(k){var b=i.createElement("script");b.onreadystatechange=function(){l(k),b.onreadystatechange=null,S.removeChild(b),b=null},S.appendChild(b)}}function _(){s=function(S){setTimeout(l,0,S)}}var v=Object.getPrototypeOf&&Object.getPrototypeOf(e);v=v&&v.setTimeout?v:e,{}.toString.call(e.process)==="[object process]"?f():h()?p():e.MessageChannel?g():i&&"onreadystatechange"in i.createElement("script")?m():_(),v.setImmediate=a,v.clearImmediate=u})(typeof self>"u"?typeof global>"u"?yO:global:self)});var Ae=w(Fe=>{"use strict";var jn=Qr(),t5=Ex(),us=xc(),Ax=cs();bO();function r5(e){var t=null;return jn.uint8array?t=new Uint8Array(e.length):t=new Array(e.length),Mf(e,t)}Fe.newBlob=function(e,t){Fe.checkSupport("blob");try{return new Blob([e],{type:t})}catch{try{var r=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,o=new r;return o.append(e),o.getBlob(t)}catch{throw new Error("Bug : can't construct the Blob.")}}};function Ec(e){return e}function Mf(e,t){for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)&255;return t}var Lf={stringifyByChunk:function(e,t,r){var o=[],n=0,i=e.length;if(i<=r)return String.fromCharCode.apply(null,e);for(;n<i;)t==="array"||t==="nodebuffer"?o.push(String.fromCharCode.apply(null,e.slice(n,Math.min(n+r,i)))):o.push(String.fromCharCode.apply(null,e.subarray(n,Math.min(n+r,i)))),n+=r;return o.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:(function(){try{return jn.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return jn.nodebuffer&&String.fromCharCode.apply(null,us.allocBuffer(1)).length===1}catch{return!1}})()}};function zc(e){var t=65536,r=Fe.getTypeOf(e),o=!0;if(r==="uint8array"?o=Lf.applyCanBeUsed.uint8array:r==="nodebuffer"&&(o=Lf.applyCanBeUsed.nodebuffer),o)for(;t>1;)try{return Lf.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2)}return Lf.stringifyByChar(e)}Fe.applyFromCharCode=zc;function Zf(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}var Un={};Un.string={string:Ec,array:function(e){return Mf(e,new Array(e.length))},arraybuffer:function(e){return Un.string.uint8array(e).buffer},uint8array:function(e){return Mf(e,new Uint8Array(e.length))},nodebuffer:function(e){return Mf(e,us.allocBuffer(e.length))}};Un.array={string:zc,array:Ec,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return us.newBufferFrom(e)}};Un.arraybuffer={string:function(e){return zc(new Uint8Array(e))},array:function(e){return Zf(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:Ec,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return us.newBufferFrom(new Uint8Array(e))}};Un.uint8array={string:zc,array:function(e){return Zf(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:Ec,nodebuffer:function(e){return us.newBufferFrom(e)}};Un.nodebuffer={string:zc,array:function(e){return Zf(e,new Array(e.length))},arraybuffer:function(e){return Un.nodebuffer.uint8array(e).buffer},uint8array:function(e){return Zf(e,new Uint8Array(e.length))},nodebuffer:Ec};Fe.transformTo=function(e,t){if(t||(t=""),!e)return t;Fe.checkSupport(e);var r=Fe.getTypeOf(t),o=Un[r][e](t);return o};Fe.resolve=function(e){for(var t=e.split("/"),r=[],o=0;o<t.length;o++){var n=t[o];n==="."||n===""&&o!==0&&o!==t.length-1||(n===".."?r.pop():r.push(n))}return r.join("/")};Fe.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(jn.nodebuffer&&us.isBuffer(e))return"nodebuffer";if(jn.uint8array&&e instanceof Uint8Array)return"uint8array";if(jn.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};Fe.checkSupport=function(e){var t=jn[e.toLowerCase()];if(!t)throw new Error(e+" is not supported by this platform")};Fe.MAX_VALUE_16BITS=65535;Fe.MAX_VALUE_32BITS=-1;Fe.pretty=function(e){var t="",r,o;for(o=0;o<(e||"").length;o++)r=e.charCodeAt(o),t+="\\x"+(r<16?"0":"")+r.toString(16).toUpperCase();return t};Fe.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})};Fe.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r};Fe.extend=function(){var e={},t,r;for(t=0;t<arguments.length;t++)for(r in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],r)&&typeof e[r]>"u"&&(e[r]=arguments[t][r]);return e};Fe.prepareContent=function(e,t,r,o,n){var i=Ax.Promise.resolve(t).then(function(s){var a=jn.blob&&(s instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(s))!==-1);return a&&typeof FileReader<"u"?new Ax.Promise(function(u,c){var l=new FileReader;l.onload=function(f){u(f.target.result)},l.onerror=function(f){c(f.target.error)},l.readAsArrayBuffer(s)}):s});return i.then(function(s){var a=Fe.getTypeOf(s);return a?(a==="arraybuffer"?s=Fe.transformTo("uint8array",s):a==="string"&&(n?s=t5.decode(s):r&&o!==!0&&(s=r5(s))),s):Ax.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}});var Dt=w((rhe,wO)=>{"use strict";function xO(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}xO.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return this.isFinished?!1:(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){t.end()}),e.on("error",function(r){t.error(r)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};wO.exports=xO});var ds=w(Ln=>{"use strict";var ls=Ae(),Io=Qr(),n5=xc(),Ff=Dt(),Tc=new Array(256);for(en=0;en<256;en++)Tc[en]=en>=252?6:en>=248?5:en>=240?4:en>=224?3:en>=192?2:1;var en;Tc[254]=Tc[254]=1;var o5=function(e){var t,r,o,n,i,s=e.length,a=0;for(n=0;n<s;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<s&&(o=e.charCodeAt(n+1),(o&64512)===56320&&(r=65536+(r-55296<<10)+(o-56320),n++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(Io.uint8array?t=new Uint8Array(a):t=new Array(a),i=0,n=0;i<a;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<s&&(o=e.charCodeAt(n+1),(o&64512)===56320&&(r=65536+(r-55296<<10)+(o-56320),n++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|r&63):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|r&63):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|r&63);return t},i5=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Tc[e[r]]>t?r:t},s5=function(e){var t,r,o,n,i=e.length,s=new Array(i*2);for(r=0,t=0;t<i;){if(o=e[t++],o<128){s[r++]=o;continue}if(n=Tc[o],n>4){s[r++]=65533,t+=n-1;continue}for(o&=n===2?31:n===3?15:7;n>1&&t<i;)o=o<<6|e[t++]&63,n--;if(n>1){s[r++]=65533;continue}o<65536?s[r++]=o:(o-=65536,s[r++]=55296|o>>10&1023,s[r++]=56320|o&1023)}return s.length!==r&&(s.subarray?s=s.subarray(0,r):s.length=r),ls.applyFromCharCode(s)};Ln.utf8encode=function(t){return Io.nodebuffer?n5.newBufferFrom(t,"utf-8"):o5(t)};Ln.utf8decode=function(t){return Io.nodebuffer?ls.transformTo("nodebuffer",t).toString("utf-8"):(t=ls.transformTo(Io.uint8array?"uint8array":"array",t),s5(t))};function qf(){Ff.call(this,"utf-8 decode"),this.leftOver=null}ls.inherits(qf,Ff);qf.prototype.processChunk=function(e){var t=ls.transformTo(Io.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(Io.uint8array){var r=t;t=new Uint8Array(r.length+this.leftOver.length),t.set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=i5(t),n=t;o!==t.length&&(Io.uint8array?(n=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(n=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:Ln.utf8decode(n),meta:e.meta})};qf.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:Ln.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)};Ln.Utf8DecodeWorker=qf;function Nx(){Ff.call(this,"utf-8 encode")}ls.inherits(Nx,Ff);Nx.prototype.processChunk=function(e){this.push({data:Ln.utf8encode(e.data),meta:e.meta})};Ln.Utf8EncodeWorker=Nx});var EO=w((ohe,kO)=>{"use strict";var SO=Dt(),$O=Ae();function Dx(e){SO.call(this,"ConvertWorker to "+e),this.destType=e}$O.inherits(Dx,SO);Dx.prototype.processChunk=function(e){this.push({data:$O.transformTo(this.destType,e.data),meta:e.meta})};kO.exports=Dx});var IO=w((ihe,TO)=>{"use strict";var zO=wx().Readable,a5=Ae();a5.inherits(jx,zO);function jx(e,t,r){zO.call(this,t),this._helper=e;var o=this;e.on("data",function(n,i){o.push(n)||o._helper.pause(),r&&r(i)}).on("error",function(n){o.emit("error",n)}).on("end",function(){o.push(null)})}jx.prototype._read=function(){this._helper.resume()};TO.exports=jx});var Ux=w((she,RO)=>{"use strict";var Po=Ae(),c5=EO(),u5=Dt(),l5=Ex(),d5=Qr(),f5=cs(),PO=null;if(d5.nodestream)try{PO=IO()}catch{}function p5(e,t,r){switch(e){case"blob":return Po.newBlob(Po.transformTo("arraybuffer",t),r);case"base64":return l5.encode(t);default:return Po.transformTo(e,t)}}function h5(e,t){var r,o=0,n=null,i=0;for(r=0;r<t.length;r++)i+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(n=new Uint8Array(i),r=0;r<t.length;r++)n.set(t[r],o),o+=t[r].length;return n;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}function m5(e,t){return new f5.Promise(function(r,o){var n=[],i=e._internalType,s=e._outputType,a=e._mimeType;e.on("data",function(u,c){n.push(u),t&&t(c)}).on("error",function(u){n=[],o(u)}).on("end",function(){try{var u=p5(s,h5(i,n),a);r(u)}catch(c){o(c)}n=[]}).resume()})}function OO(e,t,r){var o=t;switch(t){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string";break}try{this._internalType=o,this._outputType=t,this._mimeType=r,Po.checkSupport(o),this._worker=e.pipe(new c5(o)),e.lock()}catch(n){this._worker=new u5("error"),this._worker.error(n)}}OO.prototype={accumulate:function(e){return m5(this,e)},on:function(e,t){var r=this;return e==="data"?this._worker.on(e,function(o){t.call(r,o.data,o.meta)}):this._worker.on(e,function(){Po.delay(t,arguments,r)}),this},resume:function(){return Po.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Po.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new PO(this,{objectMode:this._outputType!=="nodebuffer"},e)}};RO.exports=OO});var Lx=w(lr=>{"use strict";lr.base64=!1;lr.binary=!1;lr.dir=!1;lr.createFolders=!0;lr.date=null;lr.compression=null;lr.compressionOptions=null;lr.comment=null;lr.unixPermissions=null;lr.dosPermissions=null});var Mx=w((che,CO)=>{"use strict";var Bf=Ae(),Vf=Dt(),g5=16*1024;function fs(e){Vf.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(r){t.dataIsReady=!0,t.data=r,t.max=r&&r.length||0,t.type=Bf.getTypeOf(r),t.isPaused||t._tickAndRepeat()},function(r){t.error(r)})}Bf.inherits(fs,Vf);fs.prototype.cleanUp=function(){Vf.prototype.cleanUp.call(this),this.data=null};fs.prototype.resume=function(){return Vf.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Bf.delay(this._tickAndRepeat,[],this)),!0):!1};fs.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(Bf.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};fs.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=g5,t=null,r=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,r);break;case"uint8array":t=this.data.subarray(this.index,r);break;case"array":case"nodebuffer":t=this.data.slice(this.index,r);break}return this.index=r,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};CO.exports=fs});var Wf=w((uhe,NO)=>{"use strict";var _5=Ae();function v5(){for(var e,t=[],r=0;r<256;r++){e=r;for(var o=0;o<8;o++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var AO=v5();function y5(e,t,r,o){var n=AO,i=o+r;e=e^-1;for(var s=o;s<i;s++)e=e>>>8^n[(e^t[s])&255];return e^-1}function b5(e,t,r,o){var n=AO,i=o+r;e=e^-1;for(var s=o;s<i;s++)e=e>>>8^n[(e^t.charCodeAt(s))&255];return e^-1}NO.exports=function(t,r){if(typeof t>"u"||!t.length)return 0;var o=_5.getTypeOf(t)!=="string";return o?y5(r|0,t,t.length,0):b5(r|0,t,t.length,0)}});var Fx=w((lhe,jO)=>{"use strict";var DO=Dt(),x5=Wf(),w5=Ae();function Zx(){DO.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}w5.inherits(Zx,DO);Zx.prototype.processChunk=function(e){this.streamInfo.crc32=x5(e.data,this.streamInfo.crc32||0),this.push(e)};jO.exports=Zx});var LO=w((dhe,UO)=>{"use strict";var S5=Ae(),qx=Dt();function Bx(e){qx.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}S5.inherits(Bx,qx);Bx.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}qx.prototype.processChunk.call(this,e)};UO.exports=Bx});var Hf=w((fhe,FO)=>{"use strict";var MO=cs(),ZO=Mx(),$5=Fx(),Vx=LO();function Wx(e,t,r,o,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=o,this.compressedContent=n}Wx.prototype={getContentWorker:function(){var e=new ZO(MO.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Vx("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new ZO(MO.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};Wx.createWorkerFrom=function(e,t,r){return e.pipe(new $5).pipe(new Vx("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new Vx("compressedSize")).withStreamInfo("compression",t)};FO.exports=Wx});var WO=w((phe,VO)=>{"use strict";var k5=Ux(),E5=Mx(),Hx=ds(),Jx=Hf(),qO=Dt(),Gx=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};Gx.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");r=e.toLowerCase();var o=r==="string"||r==="text";(r==="binarystring"||r==="text")&&(r="string"),t=this._decompressWorker();var n=!this._dataBinary;n&&!o&&(t=t.pipe(new Hx.Utf8EncodeWorker)),!n&&o&&(t=t.pipe(new Hx.Utf8DecodeWorker))}catch(i){t=new qO("error"),t.error(i)}return new k5(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof Jx&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new Hx.Utf8EncodeWorker)),Jx.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof Jx?this._data.getContentWorker():this._data instanceof qO?this._data:new E5(this._data)}};var BO=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],z5=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(Jf=0;Jf<BO.length;Jf++)Gx.prototype[BO[Jf]]=z5;var Jf;VO.exports=Gx});var tn=w(mt=>{"use strict";var T5=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function I5(e,t){return Object.prototype.hasOwnProperty.call(e,t)}mt.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var o in r)I5(r,o)&&(e[o]=r[o])}}return e};mt.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var P5={arraySet:function(e,t,r,o,n){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+o),n);return}for(var i=0;i<o;i++)e[n+i]=t[r+i]},flattenChunks:function(e){var t,r,o,n,i,s;for(o=0,t=0,r=e.length;t<r;t++)o+=e[t].length;for(s=new Uint8Array(o),n=0,t=0,r=e.length;t<r;t++)i=e[t],s.set(i,n),n+=i.length;return s}},O5={arraySet:function(e,t,r,o,n){for(var i=0;i<o;i++)e[n+i]=t[r+i]},flattenChunks:function(e){return[].concat.apply([],e)}};mt.setTyped=function(e){e?(mt.Buf8=Uint8Array,mt.Buf16=Uint16Array,mt.Buf32=Int32Array,mt.assign(mt,P5)):(mt.Buf8=Array,mt.Buf16=Array,mt.Buf32=Array,mt.assign(mt,O5))};mt.setTyped(T5)});var mR=w(ms=>{"use strict";var R5=tn(),C5=4,HO=0,JO=1,A5=2;function hs(e){for(var t=e.length;--t>=0;)e[t]=0}var N5=0,eR=1,D5=2,j5=3,U5=258,rw=29,Ac=256,Pc=Ac+1+rw,ps=30,nw=19,tR=2*Pc+1,Oo=15,Kx=16,L5=7,ow=256,rR=16,nR=17,oR=18,ew=[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],Gf=[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],M5=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],iR=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Z5=512,rn=new Array((Pc+2)*2);hs(rn);var Ic=new Array(ps*2);hs(Ic);var Oc=new Array(Z5);hs(Oc);var Rc=new Array(U5-j5+1);hs(Rc);var iw=new Array(rw);hs(iw);var Kf=new Array(ps);hs(Kf);function Yx(e,t,r,o,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=o,this.max_length=n,this.has_stree=e&&e.length}var sR,aR,cR;function Xx(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function uR(e){return e<256?Oc[e]:Oc[256+(e>>>7)]}function Cc(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function $t(e,t,r){e.bi_valid>Kx-r?(e.bi_buf|=t<<e.bi_valid&65535,Cc(e,e.bi_buf),e.bi_buf=t>>Kx-e.bi_valid,e.bi_valid+=r-Kx):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function Pr(e,t,r){$t(e,r[t*2],r[t*2+1])}function lR(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function F5(e){e.bi_valid===16?(Cc(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function q5(e,t){var r=t.dyn_tree,o=t.max_code,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length,c,l,f,h,p,g,m=0;for(h=0;h<=Oo;h++)e.bl_count[h]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<tR;c++)l=e.heap[c],h=r[r[l*2+1]*2+1]+1,h>u&&(h=u,m++),r[l*2+1]=h,!(l>o)&&(e.bl_count[h]++,p=0,l>=a&&(p=s[l-a]),g=r[l*2],e.opt_len+=g*(h+p),i&&(e.static_len+=g*(n[l*2+1]+p)));if(m!==0){do{for(h=u-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[u]--,m-=2}while(m>0);for(h=u;h!==0;h--)for(l=e.bl_count[h];l!==0;)f=e.heap[--c],!(f>o)&&(r[f*2+1]!==h&&(e.opt_len+=(h-r[f*2+1])*r[f*2],r[f*2+1]=h),l--)}}function dR(e,t,r){var o=new Array(Oo+1),n=0,i,s;for(i=1;i<=Oo;i++)o[i]=n=n+r[i-1]<<1;for(s=0;s<=t;s++){var a=e[s*2+1];a!==0&&(e[s*2]=lR(o[a]++,a))}}function B5(){var e,t,r,o,n,i=new Array(Oo+1);for(r=0,o=0;o<rw-1;o++)for(iw[o]=r,e=0;e<1<<ew[o];e++)Rc[r++]=o;for(Rc[r-1]=o,n=0,o=0;o<16;o++)for(Kf[o]=n,e=0;e<1<<Gf[o];e++)Oc[n++]=o;for(n>>=7;o<ps;o++)for(Kf[o]=n<<7,e=0;e<1<<Gf[o]-7;e++)Oc[256+n++]=o;for(t=0;t<=Oo;t++)i[t]=0;for(e=0;e<=143;)rn[e*2+1]=8,e++,i[8]++;for(;e<=255;)rn[e*2+1]=9,e++,i[9]++;for(;e<=279;)rn[e*2+1]=7,e++,i[7]++;for(;e<=287;)rn[e*2+1]=8,e++,i[8]++;for(dR(rn,Pc+1,i),e=0;e<ps;e++)Ic[e*2+1]=5,Ic[e*2]=lR(e,5);sR=new Yx(rn,ew,Ac+1,Pc,Oo),aR=new Yx(Ic,Gf,0,ps,Oo),cR=new Yx(new Array(0),M5,0,nw,L5)}function fR(e){var t;for(t=0;t<Pc;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ps;t++)e.dyn_dtree[t*2]=0;for(t=0;t<nw;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ow*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function pR(e){e.bi_valid>8?Cc(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function V5(e,t,r,o){pR(e),o&&(Cc(e,r),Cc(e,~r)),R5.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function GO(e,t,r,o){var n=t*2,i=r*2;return e[n]<e[i]||e[n]===e[i]&&o[t]<=o[r]}function Qx(e,t,r){for(var o=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&GO(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!GO(t,o,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=o}function KO(e,t,r){var o,n,i=0,s,a;if(e.last_lit!==0)do o=e.pending_buf[e.d_buf+i*2]<<8|e.pending_buf[e.d_buf+i*2+1],n=e.pending_buf[e.l_buf+i],i++,o===0?Pr(e,n,t):(s=Rc[n],Pr(e,s+Ac+1,t),a=ew[s],a!==0&&(n-=iw[s],$t(e,n,a)),o--,s=uR(o),Pr(e,s,r),a=Gf[s],a!==0&&(o-=Kf[s],$t(e,o,a)));while(i<e.last_lit);Pr(e,ow,t)}function tw(e,t){var r=t.dyn_tree,o=t.stat_desc.static_tree,n=t.stat_desc.has_stree,i=t.stat_desc.elems,s,a,u=-1,c;for(e.heap_len=0,e.heap_max=tR,s=0;s<i;s++)r[s*2]!==0?(e.heap[++e.heap_len]=u=s,e.depth[s]=0):r[s*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=o[c*2+1]);for(t.max_code=u,s=e.heap_len>>1;s>=1;s--)Qx(e,r,s);c=i;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Qx(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,r[c*2]=r[s*2]+r[a*2],e.depth[c]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,r[s*2+1]=r[a*2+1]=c,e.heap[1]=c++,Qx(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],q5(e,t),dR(r,u,e.bl_count)}function YO(e,t,r){var o,n=-1,i,s=t[1],a=0,u=7,c=4;for(s===0&&(u=138,c=3),t[(r+1)*2+1]=65535,o=0;o<=r;o++)i=s,s=t[(o+1)*2+1],!(++a<u&&i===s)&&(a<c?e.bl_tree[i*2]+=a:i!==0?(i!==n&&e.bl_tree[i*2]++,e.bl_tree[rR*2]++):a<=10?e.bl_tree[nR*2]++:e.bl_tree[oR*2]++,a=0,n=i,s===0?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4))}function XO(e,t,r){var o,n=-1,i,s=t[1],a=0,u=7,c=4;for(s===0&&(u=138,c=3),o=0;o<=r;o++)if(i=s,s=t[(o+1)*2+1],!(++a<u&&i===s)){if(a<c)do Pr(e,i,e.bl_tree);while(--a!==0);else i!==0?(i!==n&&(Pr(e,i,e.bl_tree),a--),Pr(e,rR,e.bl_tree),$t(e,a-3,2)):a<=10?(Pr(e,nR,e.bl_tree),$t(e,a-3,3)):(Pr(e,oR,e.bl_tree),$t(e,a-11,7));a=0,n=i,s===0?(u=138,c=3):i===s?(u=6,c=3):(u=7,c=4)}}function W5(e){var t;for(YO(e,e.dyn_ltree,e.l_desc.max_code),YO(e,e.dyn_dtree,e.d_desc.max_code),tw(e,e.bl_desc),t=nw-1;t>=3&&e.bl_tree[iR[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function H5(e,t,r,o){var n;for($t(e,t-257,5),$t(e,r-1,5),$t(e,o-4,4),n=0;n<o;n++)$t(e,e.bl_tree[iR[n]*2+1],3);XO(e,e.dyn_ltree,t-1),XO(e,e.dyn_dtree,r-1)}function J5(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return HO;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return JO;for(r=32;r<Ac;r++)if(e.dyn_ltree[r*2]!==0)return JO;return HO}var QO=!1;function G5(e){QO||(B5(),QO=!0),e.l_desc=new Xx(e.dyn_ltree,sR),e.d_desc=new Xx(e.dyn_dtree,aR),e.bl_desc=new Xx(e.bl_tree,cR),e.bi_buf=0,e.bi_valid=0,fR(e)}function hR(e,t,r,o){$t(e,(N5<<1)+(o?1:0),3),V5(e,t,r,!0)}function K5(e){$t(e,eR<<1,3),Pr(e,ow,rn),F5(e)}function Y5(e,t,r,o){var n,i,s=0;e.level>0?(e.strm.data_type===A5&&(e.strm.data_type=J5(e)),tw(e,e.l_desc),tw(e,e.d_desc),s=W5(e),n=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=n&&(n=i)):n=i=r+5,r+4<=n&&t!==-1?hR(e,t,r,o):e.strategy===C5||i===n?($t(e,(eR<<1)+(o?1:0),3),KO(e,rn,Ic)):($t(e,(D5<<1)+(o?1:0),3),H5(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),KO(e,e.dyn_ltree,e.dyn_dtree)),fR(e),o&&pR(e)}function X5(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Rc[r]+Ac+1)*2]++,e.dyn_dtree[uR(t)*2]++),e.last_lit===e.lit_bufsize-1}ms._tr_init=G5;ms._tr_stored_block=hR;ms._tr_flush_block=Y5;ms._tr_tally=X5;ms._tr_align=K5});var sw=w((ghe,gR)=>{"use strict";function Q5(e,t,r,o){for(var n=e&65535|0,i=e>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do n=n+t[o++]|0,i=i+n|0;while(--s);n%=65521,i%=65521}return n|i<<16|0}gR.exports=Q5});var aw=w((_he,_R)=>{"use strict";function eJ(){for(var e,t=[],r=0;r<256;r++){e=r;for(var o=0;o<8;o++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var tJ=eJ();function rJ(e,t,r,o){var n=tJ,i=o+r;e^=-1;for(var s=o;s<i;s++)e=e>>>8^n[(e^t[s])&255];return e^-1}_R.exports=rJ});var Yf=w((vhe,vR)=>{"use strict";vR.exports={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"}});var zR=w(Cr=>{"use strict";var gt=tn(),Ht=mR(),wR=sw(),Mn=aw(),nJ=Yf(),No=0,oJ=1,iJ=3,Vn=4,yR=5,Rr=0,bR=1,Jt=-2,sJ=-3,cw=-5,aJ=-1,cJ=1,Xf=2,uJ=3,lJ=4,dJ=0,fJ=2,rp=8,pJ=9,hJ=15,mJ=8,gJ=29,_J=256,lw=_J+1+gJ,vJ=30,yJ=19,bJ=2*lw+1,xJ=15,te=3,qn=258,dr=qn+te+1,wJ=32,np=42,dw=69,Qf=73,ep=91,tp=103,Ro=113,Dc=666,qe=1,jc=2,Co=3,vs=4,SJ=3;function Bn(e,t){return e.msg=nJ[t],t}function xR(e){return(e<<1)-(e>4?9:0)}function Fn(e){for(var t=e.length;--t>=0;)e[t]=0}function Zn(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(gt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function Ye(e,t){Ht._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Zn(e.strm)}function ce(e,t){e.pending_buf[e.pending++]=t}function Nc(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function $J(e,t,r,o){var n=e.avail_in;return n>o&&(n=o),n===0?0:(e.avail_in-=n,gt.arraySet(t,e.input,e.next_in,n,r),e.state.wrap===1?e.adler=wR(e.adler,t,n,r):e.state.wrap===2&&(e.adler=Mn(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)}function SR(e,t){var r=e.max_chain_length,o=e.strstart,n,i,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-dr?e.strstart-(e.w_size-dr):0,c=e.window,l=e.w_mask,f=e.prev,h=e.strstart+qn,p=c[o+s-1],g=c[o+s];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(n=t,!(c[n+s]!==g||c[n+s-1]!==p||c[n]!==c[o]||c[++n]!==c[o+1])){o+=2,n++;do;while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<h);if(i=qn-(h-o),o=h-qn,i>s){if(e.match_start=t,s=i,i>=a)break;p=c[o+s-1],g=c[o+s]}}while((t=f[t&l])>u&&--r!==0);return s<=e.lookahead?s:e.lookahead}function Ao(e){var t=e.w_size,r,o,n,i,s;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-dr)){gt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,o=e.hash_size,r=o;do n=e.head[--r],e.head[r]=n>=t?n-t:0;while(--o);o=t,r=o;do n=e.prev[--r],e.prev[r]=n>=t?n-t:0;while(--o);i+=t}if(e.strm.avail_in===0)break;if(o=$J(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=o,e.lookahead+e.insert>=te)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+te-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<te)););}while(e.lookahead<dr&&e.strm.avail_in!==0)}function kJ(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ao(e),e.lookahead===0&&t===No)return qe;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var o=e.block_start+r;if((e.strstart===0||e.strstart>=o)&&(e.lookahead=e.strstart-o,e.strstart=o,Ye(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-dr&&(Ye(e,!1),e.strm.avail_out===0))return qe}return e.insert=0,t===Vn?(Ye(e,!0),e.strm.avail_out===0?Co:vs):(e.strstart>e.block_start&&(Ye(e,!1),e.strm.avail_out===0),qe)}function uw(e,t){for(var r,o;;){if(e.lookahead<dr){if(Ao(e),e.lookahead<dr&&t===No)return qe;if(e.lookahead===0)break}if(r=0,e.lookahead>=te&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+te-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-dr&&(e.match_length=SR(e,r)),e.match_length>=te)if(o=Ht._tr_tally(e,e.strstart-e.match_start,e.match_length-te),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=te){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+te-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else o=Ht._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(o&&(Ye(e,!1),e.strm.avail_out===0))return qe}return e.insert=e.strstart<te-1?e.strstart:te-1,t===Vn?(Ye(e,!0),e.strm.avail_out===0?Co:vs):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?qe:jc}function gs(e,t){for(var r,o,n;;){if(e.lookahead<dr){if(Ao(e),e.lookahead<dr&&t===No)return qe;if(e.lookahead===0)break}if(r=0,e.lookahead>=te&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+te-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=te-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-dr&&(e.match_length=SR(e,r),e.match_length<=5&&(e.strategy===cJ||e.match_length===te&&e.strstart-e.match_start>4096)&&(e.match_length=te-1)),e.prev_length>=te&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-te,o=Ht._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-te),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+te-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=te-1,e.strstart++,o&&(Ye(e,!1),e.strm.avail_out===0))return qe}else if(e.match_available){if(o=Ht._tr_tally(e,0,e.window[e.strstart-1]),o&&Ye(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return qe}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(o=Ht._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<te-1?e.strstart:te-1,t===Vn?(Ye(e,!0),e.strm.avail_out===0?Co:vs):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?qe:jc}function EJ(e,t){for(var r,o,n,i,s=e.window;;){if(e.lookahead<=qn){if(Ao(e),e.lookahead<=qn&&t===No)return qe;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=te&&e.strstart>0&&(n=e.strstart-1,o=s[n],o===s[++n]&&o===s[++n]&&o===s[++n])){i=e.strstart+qn;do;while(o===s[++n]&&o===s[++n]&&o===s[++n]&&o===s[++n]&&o===s[++n]&&o===s[++n]&&o===s[++n]&&o===s[++n]&&n<i);e.match_length=qn-(i-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=te?(r=Ht._tr_tally(e,1,e.match_length-te),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Ht._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Ye(e,!1),e.strm.avail_out===0))return qe}return e.insert=0,t===Vn?(Ye(e,!0),e.strm.avail_out===0?Co:vs):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?qe:jc}function zJ(e,t){for(var r;;){if(e.lookahead===0&&(Ao(e),e.lookahead===0)){if(t===No)return qe;break}if(e.match_length=0,r=Ht._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Ye(e,!1),e.strm.avail_out===0))return qe}return e.insert=0,t===Vn?(Ye(e,!0),e.strm.avail_out===0?Co:vs):e.last_lit&&(Ye(e,!1),e.strm.avail_out===0)?qe:jc}function Or(e,t,r,o,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=o,this.func=n}var _s;_s=[new Or(0,0,0,0,kJ),new Or(4,4,8,4,uw),new Or(4,5,16,8,uw),new Or(4,6,32,32,uw),new Or(4,4,16,16,gs),new Or(8,16,32,32,gs),new Or(8,16,128,128,gs),new Or(8,32,128,256,gs),new Or(32,128,258,1024,gs),new Or(32,258,258,4096,gs)];function TJ(e){e.window_size=2*e.w_size,Fn(e.head),e.max_lazy_match=_s[e.level].max_lazy,e.good_match=_s[e.level].good_length,e.nice_match=_s[e.level].nice_length,e.max_chain_length=_s[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=te-1,e.match_available=0,e.ins_h=0}function IJ(){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=rp,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 gt.Buf16(bJ*2),this.dyn_dtree=new gt.Buf16((2*vJ+1)*2),this.bl_tree=new gt.Buf16((2*yJ+1)*2),Fn(this.dyn_ltree),Fn(this.dyn_dtree),Fn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new gt.Buf16(xJ+1),this.heap=new gt.Buf16(2*lw+1),Fn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new gt.Buf16(2*lw+1),Fn(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 $R(e){var t;return!e||!e.state?Bn(e,Jt):(e.total_in=e.total_out=0,e.data_type=fJ,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?np:Ro,e.adler=t.wrap===2?0:1,t.last_flush=No,Ht._tr_init(t),Rr)}function kR(e){var t=$R(e);return t===Rr&&TJ(e.state),t}function PJ(e,t){return!e||!e.state||e.state.wrap!==2?Jt:(e.state.gzhead=t,Rr)}function ER(e,t,r,o,n,i){if(!e)return Jt;var s=1;if(t===aJ&&(t=6),o<0?(s=0,o=-o):o>15&&(s=2,o-=16),n<1||n>pJ||r!==rp||o<8||o>15||t<0||t>9||i<0||i>lJ)return Bn(e,Jt);o===8&&(o=9);var a=new IJ;return e.state=a,a.strm=e,a.wrap=s,a.gzhead=null,a.w_bits=o,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=n+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+te-1)/te),a.window=new gt.Buf8(a.w_size*2),a.head=new gt.Buf16(a.hash_size),a.prev=new gt.Buf16(a.w_size),a.lit_bufsize=1<<n+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new gt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=3*a.lit_bufsize,a.level=t,a.strategy=i,a.method=r,kR(e)}function OJ(e,t){return ER(e,t,rp,hJ,mJ,dJ)}function RJ(e,t){var r,o,n,i;if(!e||!e.state||t>yR||t<0)return e?Bn(e,Jt):Jt;if(o=e.state,!e.output||!e.input&&e.avail_in!==0||o.status===Dc&&t!==Vn)return Bn(e,e.avail_out===0?cw:Jt);if(o.strm=e,r=o.last_flush,o.last_flush=t,o.status===np)if(o.wrap===2)e.adler=0,ce(o,31),ce(o,139),ce(o,8),o.gzhead?(ce(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),ce(o,o.gzhead.time&255),ce(o,o.gzhead.time>>8&255),ce(o,o.gzhead.time>>16&255),ce(o,o.gzhead.time>>24&255),ce(o,o.level===9?2:o.strategy>=Xf||o.level<2?4:0),ce(o,o.gzhead.os&255),o.gzhead.extra&&o.gzhead.extra.length&&(ce(o,o.gzhead.extra.length&255),ce(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(e.adler=Mn(e.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=dw):(ce(o,0),ce(o,0),ce(o,0),ce(o,0),ce(o,0),ce(o,o.level===9?2:o.strategy>=Xf||o.level<2?4:0),ce(o,SJ),o.status=Ro);else{var s=rp+(o.w_bits-8<<4)<<8,a=-1;o.strategy>=Xf||o.level<2?a=0:o.level<6?a=1:o.level===6?a=2:a=3,s|=a<<6,o.strstart!==0&&(s|=wJ),s+=31-s%31,o.status=Ro,Nc(o,s),o.strstart!==0&&(Nc(o,e.adler>>>16),Nc(o,e.adler&65535)),e.adler=1}if(o.status===dw)if(o.gzhead.extra){for(n=o.pending;o.gzindex<(o.gzhead.extra.length&65535)&&!(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>n&&(e.adler=Mn(e.adler,o.pending_buf,o.pending-n,n)),Zn(e),n=o.pending,o.pending===o.pending_buf_size));)ce(o,o.gzhead.extra[o.gzindex]&255),o.gzindex++;o.gzhead.hcrc&&o.pending>n&&(e.adler=Mn(e.adler,o.pending_buf,o.pending-n,n)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=Qf)}else o.status=Qf;if(o.status===Qf)if(o.gzhead.name){n=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>n&&(e.adler=Mn(e.adler,o.pending_buf,o.pending-n,n)),Zn(e),n=o.pending,o.pending===o.pending_buf_size)){i=1;break}o.gzindex<o.gzhead.name.length?i=o.gzhead.name.charCodeAt(o.gzindex++)&255:i=0,ce(o,i)}while(i!==0);o.gzhead.hcrc&&o.pending>n&&(e.adler=Mn(e.adler,o.pending_buf,o.pending-n,n)),i===0&&(o.gzindex=0,o.status=ep)}else o.status=ep;if(o.status===ep)if(o.gzhead.comment){n=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>n&&(e.adler=Mn(e.adler,o.pending_buf,o.pending-n,n)),Zn(e),n=o.pending,o.pending===o.pending_buf_size)){i=1;break}o.gzindex<o.gzhead.comment.length?i=o.gzhead.comment.charCodeAt(o.gzindex++)&255:i=0,ce(o,i)}while(i!==0);o.gzhead.hcrc&&o.pending>n&&(e.adler=Mn(e.adler,o.pending_buf,o.pending-n,n)),i===0&&(o.status=tp)}else o.status=tp;if(o.status===tp&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&Zn(e),o.pending+2<=o.pending_buf_size&&(ce(o,e.adler&255),ce(o,e.adler>>8&255),e.adler=0,o.status=Ro)):o.status=Ro),o.pending!==0){if(Zn(e),e.avail_out===0)return o.last_flush=-1,Rr}else if(e.avail_in===0&&xR(t)<=xR(r)&&t!==Vn)return Bn(e,cw);if(o.status===Dc&&e.avail_in!==0)return Bn(e,cw);if(e.avail_in!==0||o.lookahead!==0||t!==No&&o.status!==Dc){var u=o.strategy===Xf?zJ(o,t):o.strategy===uJ?EJ(o,t):_s[o.level].func(o,t);if((u===Co||u===vs)&&(o.status=Dc),u===qe||u===Co)return e.avail_out===0&&(o.last_flush=-1),Rr;if(u===jc&&(t===oJ?Ht._tr_align(o):t!==yR&&(Ht._tr_stored_block(o,0,0,!1),t===iJ&&(Fn(o.head),o.lookahead===0&&(o.strstart=0,o.block_start=0,o.insert=0))),Zn(e),e.avail_out===0))return o.last_flush=-1,Rr}return t!==Vn?Rr:o.wrap<=0?bR:(o.wrap===2?(ce(o,e.adler&255),ce(o,e.adler>>8&255),ce(o,e.adler>>16&255),ce(o,e.adler>>24&255),ce(o,e.total_in&255),ce(o,e.total_in>>8&255),ce(o,e.total_in>>16&255),ce(o,e.total_in>>24&255)):(Nc(o,e.adler>>>16),Nc(o,e.adler&65535)),Zn(e),o.wrap>0&&(o.wrap=-o.wrap),o.pending!==0?Rr:bR)}function CJ(e){var t;return!e||!e.state?Jt:(t=e.state.status,t!==np&&t!==dw&&t!==Qf&&t!==ep&&t!==tp&&t!==Ro&&t!==Dc?Bn(e,Jt):(e.state=null,t===Ro?Bn(e,sJ):Rr))}function AJ(e,t){var r=t.length,o,n,i,s,a,u,c,l;if(!e||!e.state||(o=e.state,s=o.wrap,s===2||s===1&&o.status!==np||o.lookahead))return Jt;for(s===1&&(e.adler=wR(e.adler,t,r,0)),o.wrap=0,r>=o.w_size&&(s===0&&(Fn(o.head),o.strstart=0,o.block_start=0,o.insert=0),l=new gt.Buf8(o.w_size),gt.arraySet(l,t,r-o.w_size,o.w_size,0),t=l,r=o.w_size),a=e.avail_in,u=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,Ao(o);o.lookahead>=te;){n=o.strstart,i=o.lookahead-(te-1);do o.ins_h=(o.ins_h<<o.hash_shift^o.window[n+te-1])&o.hash_mask,o.prev[n&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=n,n++;while(--i);o.strstart=n,o.lookahead=te-1,Ao(o)}return o.strstart+=o.lookahead,o.block_start=o.strstart,o.insert=o.lookahead,o.lookahead=0,o.match_length=o.prev_length=te-1,o.match_available=0,e.next_in=u,e.input=c,e.avail_in=a,o.wrap=s,Rr}Cr.deflateInit=OJ;Cr.deflateInit2=ER;Cr.deflateReset=kR;Cr.deflateResetKeep=$R;Cr.deflateSetHeader=PJ;Cr.deflate=RJ;Cr.deflateEnd=CJ;Cr.deflateSetDictionary=AJ;Cr.deflateInfo="pako deflate (from Nodeca project)"});var fw=w(ys=>{"use strict";var op=tn(),TR=!0,IR=!0;try{String.fromCharCode.apply(null,[0])}catch{TR=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{IR=!1}var Uc=new op.Buf8(256);for(nn=0;nn<256;nn++)Uc[nn]=nn>=252?6:nn>=248?5:nn>=240?4:nn>=224?3:nn>=192?2:1;var nn;Uc[254]=Uc[254]=1;ys.string2buf=function(e){var t,r,o,n,i,s=e.length,a=0;for(n=0;n<s;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<s&&(o=e.charCodeAt(n+1),(o&64512)===56320&&(r=65536+(r-55296<<10)+(o-56320),n++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new op.Buf8(a),i=0,n=0;i<a;n++)r=e.charCodeAt(n),(r&64512)===55296&&n+1<s&&(o=e.charCodeAt(n+1),(o&64512)===56320&&(r=65536+(r-55296<<10)+(o-56320),n++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|r&63):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|r&63):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|r&63);return t};function PR(e,t){if(t<65534&&(e.subarray&&IR||!e.subarray&&TR))return String.fromCharCode.apply(null,op.shrinkBuf(e,t));for(var r="",o=0;o<t;o++)r+=String.fromCharCode(e[o]);return r}ys.buf2binstring=function(e){return PR(e,e.length)};ys.binstring2buf=function(e){for(var t=new op.Buf8(e.length),r=0,o=t.length;r<o;r++)t[r]=e.charCodeAt(r);return t};ys.buf2string=function(e,t){var r,o,n,i,s=t||e.length,a=new Array(s*2);for(o=0,r=0;r<s;){if(n=e[r++],n<128){a[o++]=n;continue}if(i=Uc[n],i>4){a[o++]=65533,r+=i-1;continue}for(n&=i===2?31:i===3?15:7;i>1&&r<s;)n=n<<6|e[r++]&63,i--;if(i>1){a[o++]=65533;continue}n<65536?a[o++]=n:(n-=65536,a[o++]=55296|n>>10&1023,a[o++]=56320|n&1023)}return PR(a,o)};ys.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Uc[e[r]]>t?r:t}});var pw=w((xhe,OR)=>{"use strict";function NJ(){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}OR.exports=NJ});var NR=w(Zc=>{"use strict";var Lc=zR(),Mc=tn(),mw=fw(),gw=Yf(),DJ=pw(),AR=Object.prototype.toString,jJ=0,hw=4,bs=0,RR=1,CR=2,UJ=-1,LJ=0,MJ=8;function Do(e){if(!(this instanceof Do))return new Do(e);this.options=Mc.assign({level:UJ,method:MJ,chunkSize:16384,windowBits:15,memLevel:8,strategy:LJ,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new DJ,this.strm.avail_out=0;var r=Lc.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==bs)throw new Error(gw[r]);if(t.header&&Lc.deflateSetHeader(this.strm,t.header),t.dictionary){var o;if(typeof t.dictionary=="string"?o=mw.string2buf(t.dictionary):AR.call(t.dictionary)==="[object ArrayBuffer]"?o=new Uint8Array(t.dictionary):o=t.dictionary,r=Lc.deflateSetDictionary(this.strm,o),r!==bs)throw new Error(gw[r]);this._dict_set=!0}}Do.prototype.push=function(e,t){var r=this.strm,o=this.options.chunkSize,n,i;if(this.ended)return!1;i=t===~~t?t:t===!0?hw:jJ,typeof e=="string"?r.input=mw.string2buf(e):AR.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Mc.Buf8(o),r.next_out=0,r.avail_out=o),n=Lc.deflate(r,i),n!==RR&&n!==bs)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(i===hw||i===CR))&&(this.options.to==="string"?this.onData(mw.buf2binstring(Mc.shrinkBuf(r.output,r.next_out))):this.onData(Mc.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==RR);return i===hw?(n=Lc.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===bs):(i===CR&&(this.onEnd(bs),r.avail_out=0),!0)};Do.prototype.onData=function(e){this.chunks.push(e)};Do.prototype.onEnd=function(e){e===bs&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function _w(e,t){var r=new Do(t);if(r.push(e,!0),r.err)throw r.msg||gw[r.err];return r.result}function ZJ(e,t){return t=t||{},t.raw=!0,_w(e,t)}function FJ(e,t){return t=t||{},t.gzip=!0,_w(e,t)}Zc.Deflate=Do;Zc.deflate=_w;Zc.deflateRaw=ZJ;Zc.gzip=FJ});var jR=w((She,DR)=>{"use strict";var ip=30,qJ=12;DR.exports=function(t,r){var o,n,i,s,a,u,c,l,f,h,p,g,m,_,v,S,k,b,x,T,C,D,M,G,U;o=t.state,n=t.next_in,G=t.input,i=n+(t.avail_in-5),s=t.next_out,U=t.output,a=s-(r-t.avail_out),u=s+(t.avail_out-257),c=o.dmax,l=o.wsize,f=o.whave,h=o.wnext,p=o.window,g=o.hold,m=o.bits,_=o.lencode,v=o.distcode,S=(1<<o.lenbits)-1,k=(1<<o.distbits)-1;e:do{m<15&&(g+=G[n++]<<m,m+=8,g+=G[n++]<<m,m+=8),b=_[g&S];t:for(;;){if(x=b>>>24,g>>>=x,m-=x,x=b>>>16&255,x===0)U[s++]=b&65535;else if(x&16){T=b&65535,x&=15,x&&(m<x&&(g+=G[n++]<<m,m+=8),T+=g&(1<<x)-1,g>>>=x,m-=x),m<15&&(g+=G[n++]<<m,m+=8,g+=G[n++]<<m,m+=8),b=v[g&k];r:for(;;){if(x=b>>>24,g>>>=x,m-=x,x=b>>>16&255,x&16){if(C=b&65535,x&=15,m<x&&(g+=G[n++]<<m,m+=8,m<x&&(g+=G[n++]<<m,m+=8)),C+=g&(1<<x)-1,C>c){t.msg="invalid distance too far back",o.mode=ip;break e}if(g>>>=x,m-=x,x=s-a,C>x){if(x=C-x,x>f&&o.sane){t.msg="invalid distance too far back",o.mode=ip;break e}if(D=0,M=p,h===0){if(D+=l-x,x<T){T-=x;do U[s++]=p[D++];while(--x);D=s-C,M=U}}else if(h<x){if(D+=l+h-x,x-=h,x<T){T-=x;do U[s++]=p[D++];while(--x);if(D=0,h<T){x=h,T-=x;do U[s++]=p[D++];while(--x);D=s-C,M=U}}}else if(D+=h-x,x<T){T-=x;do U[s++]=p[D++];while(--x);D=s-C,M=U}for(;T>2;)U[s++]=M[D++],U[s++]=M[D++],U[s++]=M[D++],T-=3;T&&(U[s++]=M[D++],T>1&&(U[s++]=M[D++]))}else{D=s-C;do U[s++]=U[D++],U[s++]=U[D++],U[s++]=U[D++],T-=3;while(T>2);T&&(U[s++]=U[D++],T>1&&(U[s++]=U[D++]))}}else if((x&64)===0){b=v[(b&65535)+(g&(1<<x)-1)];continue r}else{t.msg="invalid distance code",o.mode=ip;break e}break}}else if((x&64)===0){b=_[(b&65535)+(g&(1<<x)-1)];continue t}else if(x&32){o.mode=qJ;break e}else{t.msg="invalid literal/length code",o.mode=ip;break e}break}}while(n<i&&s<u);T=m>>3,n-=T,m-=T<<3,g&=(1<<m)-1,t.next_in=n,t.next_out=s,t.avail_in=n<i?5+(i-n):5-(n-i),t.avail_out=s<u?257+(u-s):257-(s-u),o.hold=g,o.bits=m}});var BR=w(($he,qR)=>{"use strict";var UR=tn(),xs=15,LR=852,MR=592,ZR=0,vw=1,FR=2,BJ=[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],VJ=[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],WJ=[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],HJ=[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];qR.exports=function(t,r,o,n,i,s,a,u){var c=u.bits,l=0,f=0,h=0,p=0,g=0,m=0,_=0,v=0,S=0,k=0,b,x,T,C,D,M=null,G=0,U,De=new UR.Buf16(xs+1),we=new UR.Buf16(xs+1),fi=null,pE=0,hE,vl,yl;for(l=0;l<=xs;l++)De[l]=0;for(f=0;f<n;f++)De[r[o+f]]++;for(g=c,p=xs;p>=1&&De[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,u.bits=1,0;for(h=1;h<p&&De[h]===0;h++);for(g<h&&(g=h),v=1,l=1;l<=xs;l++)if(v<<=1,v-=De[l],v<0)return-1;if(v>0&&(t===ZR||p!==1))return-1;for(we[1]=0,l=1;l<xs;l++)we[l+1]=we[l]+De[l];for(f=0;f<n;f++)r[o+f]!==0&&(a[we[r[o+f]]++]=f);if(t===ZR?(M=fi=a,U=19):t===vw?(M=BJ,G-=257,fi=VJ,pE-=257,U=256):(M=WJ,fi=HJ,U=-1),k=0,f=0,l=h,D=s,m=g,_=0,T=-1,S=1<<g,C=S-1,t===vw&&S>LR||t===FR&&S>MR)return 1;for(;;){hE=l-_,a[f]<U?(vl=0,yl=a[f]):a[f]>U?(vl=fi[pE+a[f]],yl=M[G+a[f]]):(vl=96,yl=0),b=1<<l-_,x=1<<m,h=x;do x-=b,i[D+(k>>_)+x]=hE<<24|vl<<16|yl|0;while(x!==0);for(b=1<<l-1;k&b;)b>>=1;if(b!==0?(k&=b-1,k+=b):k=0,f++,--De[l]===0){if(l===p)break;l=r[o+a[f]]}if(l>g&&(k&C)!==T){for(_===0&&(_=g),D+=h,m=l-_,v=1<<m;m+_<p&&(v-=De[m+_],!(v<=0));)m++,v<<=1;if(S+=1<<m,t===vw&&S>LR||t===FR&&S>MR)return 1;T=k&C,i[T]=g<<24|m<<16|D-s|0}}return k!==0&&(i[D+k]=l-_<<24|64<<16|0),u.bits=g,0}});var kC=w(fr=>{"use strict";var jt=tn(),$w=sw(),Ar=aw(),JJ=jR(),Fc=BR(),GJ=0,gC=1,_C=2,VR=4,KJ=5,sp=6,jo=0,YJ=1,XJ=2,Gt=-2,vC=-3,kw=-4,QJ=-5,WR=8,yC=1,HR=2,JR=3,GR=4,KR=5,YR=6,XR=7,QR=8,eC=9,tC=10,up=11,on=12,yw=13,rC=14,bw=15,nC=16,oC=17,iC=18,sC=19,ap=20,cp=21,aC=22,cC=23,uC=24,lC=25,dC=26,xw=27,fC=28,pC=29,Ie=30,Ew=31,eG=32,tG=852,rG=592,nG=15,oG=nG;function hC(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function iG(){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 jt.Buf16(320),this.work=new jt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function bC(e){var t;return!e||!e.state?Gt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=yC,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new jt.Buf32(tG),t.distcode=t.distdyn=new jt.Buf32(rG),t.sane=1,t.back=-1,jo)}function xC(e){var t;return!e||!e.state?Gt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,bC(e))}function wC(e,t){var r,o;return!e||!e.state||(o=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Gt:(o.window!==null&&o.wbits!==t&&(o.window=null),o.wrap=r,o.wbits=t,xC(e))}function SC(e,t){var r,o;return e?(o=new iG,e.state=o,o.window=null,r=wC(e,t),r!==jo&&(e.state=null),r):Gt}function sG(e){return SC(e,oG)}var mC=!0,ww,Sw;function aG(e){if(mC){var t;for(ww=new jt.Buf32(512),Sw=new jt.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Fc(gC,e.lens,0,288,ww,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Fc(_C,e.lens,0,32,Sw,0,e.work,{bits:5}),mC=!1}e.lencode=ww,e.lenbits=9,e.distcode=Sw,e.distbits=5}function $C(e,t,r,o){var n,i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new jt.Buf8(i.wsize)),o>=i.wsize?(jt.arraySet(i.window,t,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(n=i.wsize-i.wnext,n>o&&(n=o),jt.arraySet(i.window,t,r-o,n,i.wnext),o-=n,o?(jt.arraySet(i.window,t,r-o,o,0),i.wnext=o,i.whave=i.wsize):(i.wnext+=n,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=n))),0}function cG(e,t){var r,o,n,i,s,a,u,c,l,f,h,p,g,m,_=0,v,S,k,b,x,T,C,D,M=new jt.Buf8(4),G,U,De=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Gt;r=e.state,r.mode===on&&(r.mode=yw),s=e.next_out,n=e.output,u=e.avail_out,i=e.next_in,o=e.input,a=e.avail_in,c=r.hold,l=r.bits,f=a,h=u,D=jo;e:for(;;)switch(r.mode){case yC:if(r.wrap===0){r.mode=yw;break}for(;l<16;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,M[0]=c&255,M[1]=c>>>8&255,r.check=Ar(r.check,M,2,0),c=0,l=0,r.mode=HR;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Ie;break}if((c&15)!==WR){e.msg="unknown compression method",r.mode=Ie;break}if(c>>>=4,l-=4,C=(c&15)+8,r.wbits===0)r.wbits=C;else if(C>r.wbits){e.msg="invalid window size",r.mode=Ie;break}r.dmax=1<<C,e.adler=r.check=1,r.mode=c&512?tC:on,c=0,l=0;break;case HR:for(;l<16;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==WR){e.msg="unknown compression method",r.mode=Ie;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Ie;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,r.check=Ar(r.check,M,2,0)),c=0,l=0,r.mode=JR;case JR:for(;l<32;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,M[2]=c>>>16&255,M[3]=c>>>24&255,r.check=Ar(r.check,M,4,0)),c=0,l=0,r.mode=GR;case GR:for(;l<16;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,r.check=Ar(r.check,M,2,0)),c=0,l=0,r.mode=KR;case KR:if(r.flags&1024){for(;l<16;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(M[0]=c&255,M[1]=c>>>8&255,r.check=Ar(r.check,M,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=YR;case YR:if(r.flags&1024&&(p=r.length,p>a&&(p=a),p&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),jt.arraySet(r.head.extra,o,i,p,C)),r.flags&512&&(r.check=Ar(r.check,o,p,i)),a-=p,i+=p,r.length-=p),r.length))break e;r.length=0,r.mode=XR;case XR:if(r.flags&2048){if(a===0)break e;p=0;do C=o[i+p++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C));while(C&&p<a);if(r.flags&512&&(r.check=Ar(r.check,o,p,i)),a-=p,i+=p,C)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=QR;case QR:if(r.flags&4096){if(a===0)break e;p=0;do C=o[i+p++],r.head&&C&&r.length<65536&&(r.head.comment+=String.fromCharCode(C));while(C&&p<a);if(r.flags&512&&(r.check=Ar(r.check,o,p,i)),a-=p,i+=p,C)break e}else r.head&&(r.head.comment=null);r.mode=eC;case eC:if(r.flags&512){for(;l<16;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Ie;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=on;break;case tC:for(;l<32;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}e.adler=r.check=hC(c),c=0,l=0,r.mode=up;case up:if(r.havedict===0)return e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,r.hold=c,r.bits=l,XJ;e.adler=r.check=1,r.mode=on;case on:if(t===KJ||t===sp)break e;case yw:if(r.last){c>>>=l&7,l-=l&7,r.mode=xw;break}for(;l<3;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=rC;break;case 1:if(aG(r),r.mode=ap,t===sp){c>>>=2,l-=2;break e}break;case 2:r.mode=oC;break;case 3:e.msg="invalid block type",r.mode=Ie}c>>>=2,l-=2;break;case rC:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Ie;break}if(r.length=c&65535,c=0,l=0,r.mode=bw,t===sp)break e;case bw:r.mode=nC;case nC:if(p=r.length,p){if(p>a&&(p=a),p>u&&(p=u),p===0)break e;jt.arraySet(n,o,i,p,s),a-=p,i+=p,u-=p,s+=p,r.length-=p;break}r.mode=on;break;case oC:for(;l<14;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Ie;break}r.have=0,r.mode=iC;case iC:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}r.lens[De[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[De[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,G={bits:r.lenbits},D=Fc(GJ,r.lens,0,19,r.lencode,0,r.work,G),r.lenbits=G.bits,D){e.msg="invalid code lengths set",r.mode=Ie;break}r.have=0,r.mode=sC;case sC:for(;r.have<r.nlen+r.ndist;){for(;_=r.lencode[c&(1<<r.lenbits)-1],v=_>>>24,S=_>>>16&255,k=_&65535,!(v<=l);){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(k<16)c>>>=v,l-=v,r.lens[r.have++]=k;else{if(k===16){for(U=v+2;l<U;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(c>>>=v,l-=v,r.have===0){e.msg="invalid bit length repeat",r.mode=Ie;break}C=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(k===17){for(U=v+3;l<U;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}c>>>=v,l-=v,C=0,p=3+(c&7),c>>>=3,l-=3}else{for(U=v+7;l<U;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}c>>>=v,l-=v,C=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Ie;break}for(;p--;)r.lens[r.have++]=C}}if(r.mode===Ie)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Ie;break}if(r.lenbits=9,G={bits:r.lenbits},D=Fc(gC,r.lens,0,r.nlen,r.lencode,0,r.work,G),r.lenbits=G.bits,D){e.msg="invalid literal/lengths set",r.mode=Ie;break}if(r.distbits=6,r.distcode=r.distdyn,G={bits:r.distbits},D=Fc(_C,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,G),r.distbits=G.bits,D){e.msg="invalid distances set",r.mode=Ie;break}if(r.mode=ap,t===sp)break e;case ap:r.mode=cp;case cp:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,r.hold=c,r.bits=l,JJ(e,h),s=e.next_out,n=e.output,u=e.avail_out,i=e.next_in,o=e.input,a=e.avail_in,c=r.hold,l=r.bits,r.mode===on&&(r.back=-1);break}for(r.back=0;_=r.lencode[c&(1<<r.lenbits)-1],v=_>>>24,S=_>>>16&255,k=_&65535,!(v<=l);){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(S&&(S&240)===0){for(b=v,x=S,T=k;_=r.lencode[T+((c&(1<<b+x)-1)>>b)],v=_>>>24,S=_>>>16&255,k=_&65535,!(b+v<=l);){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=v,l-=v,r.back+=v,r.length=k,S===0){r.mode=dC;break}if(S&32){r.back=-1,r.mode=on;break}if(S&64){e.msg="invalid literal/length code",r.mode=Ie;break}r.extra=S&15,r.mode=aC;case aC:if(r.extra){for(U=r.extra;l<U;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=cC;case cC:for(;_=r.distcode[c&(1<<r.distbits)-1],v=_>>>24,S=_>>>16&255,k=_&65535,!(v<=l);){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if((S&240)===0){for(b=v,x=S,T=k;_=r.distcode[T+((c&(1<<b+x)-1)>>b)],v=_>>>24,S=_>>>16&255,k=_&65535,!(b+v<=l);){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=v,l-=v,r.back+=v,S&64){e.msg="invalid distance code",r.mode=Ie;break}r.offset=k,r.extra=S&15,r.mode=uC;case uC:if(r.extra){for(U=r.extra;l<U;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Ie;break}r.mode=lC;case lC:if(u===0)break e;if(p=h-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Ie;break}p>r.wnext?(p-=r.wnext,g=r.wsize-p):g=r.wnext-p,p>r.length&&(p=r.length),m=r.window}else m=n,g=s-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do n[s++]=m[g++];while(--p);r.length===0&&(r.mode=cp);break;case dC:if(u===0)break e;n[s++]=r.length,u--,r.mode=cp;break;case xw:if(r.wrap){for(;l<32;){if(a===0)break e;a--,c|=o[i++]<<l,l+=8}if(h-=u,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?Ar(r.check,n,h,s-h):$w(r.check,n,h,s-h)),h=u,(r.flags?c:hC(c))!==r.check){e.msg="incorrect data check",r.mode=Ie;break}c=0,l=0}r.mode=fC;case fC:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break e;a--,c+=o[i++]<<l,l+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Ie;break}c=0,l=0}r.mode=pC;case pC:D=YJ;break e;case Ie:D=vC;break e;case Ew:return kw;case eG:default:return Gt}return e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,r.hold=c,r.bits=l,(r.wsize||h!==e.avail_out&&r.mode<Ie&&(r.mode<xw||t!==VR))&&$C(e,e.output,e.next_out,h-e.avail_out)?(r.mode=Ew,kw):(f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?Ar(r.check,n,h,e.next_out-h):$w(r.check,n,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(r.mode===on?128:0)+(r.mode===ap||r.mode===bw?256:0),(f===0&&h===0||t===VR)&&D===jo&&(D=QJ),D)}function uG(e){if(!e||!e.state)return Gt;var t=e.state;return t.window&&(t.window=null),e.state=null,jo}function lG(e,t){var r;return!e||!e.state||(r=e.state,(r.wrap&2)===0)?Gt:(r.head=t,t.done=!1,jo)}function dG(e,t){var r=t.length,o,n,i;return!e||!e.state||(o=e.state,o.wrap!==0&&o.mode!==up)?Gt:o.mode===up&&(n=1,n=$w(n,t,r,0),n!==o.check)?vC:(i=$C(e,t,r,r),i?(o.mode=Ew,kw):(o.havedict=1,jo))}fr.inflateReset=xC;fr.inflateReset2=wC;fr.inflateResetKeep=bC;fr.inflateInit=sG;fr.inflateInit2=SC;fr.inflate=cG;fr.inflateEnd=uG;fr.inflateGetHeader=lG;fr.inflateSetDictionary=dG;fr.inflateInfo="pako inflate (from Nodeca project)"});var zw=w((Ehe,EC)=>{"use strict";EC.exports={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}});var TC=w((zhe,zC)=>{"use strict";function fG(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}zC.exports=fG});var PC=w(Bc=>{"use strict";var ws=kC(),qc=tn(),lp=fw(),je=zw(),Tw=Yf(),pG=pw(),hG=TC(),IC=Object.prototype.toString;function Uo(e){if(!(this instanceof Uo))return new Uo(e);this.options=qc.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pG,this.strm.avail_out=0;var r=ws.inflateInit2(this.strm,t.windowBits);if(r!==je.Z_OK)throw new Error(Tw[r]);if(this.header=new hG,ws.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=lp.string2buf(t.dictionary):IC.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=ws.inflateSetDictionary(this.strm,t.dictionary),r!==je.Z_OK)))throw new Error(Tw[r])}Uo.prototype.push=function(e,t){var r=this.strm,o=this.options.chunkSize,n=this.options.dictionary,i,s,a,u,c,l=!1;if(this.ended)return!1;s=t===~~t?t:t===!0?je.Z_FINISH:je.Z_NO_FLUSH,typeof e=="string"?r.input=lp.binstring2buf(e):IC.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new qc.Buf8(o),r.next_out=0,r.avail_out=o),i=ws.inflate(r,je.Z_NO_FLUSH),i===je.Z_NEED_DICT&&n&&(i=ws.inflateSetDictionary(this.strm,n)),i===je.Z_BUF_ERROR&&l===!0&&(i=je.Z_OK,l=!1),i!==je.Z_STREAM_END&&i!==je.Z_OK)return this.onEnd(i),this.ended=!0,!1;r.next_out&&(r.avail_out===0||i===je.Z_STREAM_END||r.avail_in===0&&(s===je.Z_FINISH||s===je.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=lp.utf8border(r.output,r.next_out),u=r.next_out-a,c=lp.buf2string(r.output,a),r.next_out=u,r.avail_out=o-u,u&&qc.arraySet(r.output,r.output,a,u,0),this.onData(c)):this.onData(qc.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(l=!0)}while((r.avail_in>0||r.avail_out===0)&&i!==je.Z_STREAM_END);return i===je.Z_STREAM_END&&(s=je.Z_FINISH),s===je.Z_FINISH?(i=ws.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===je.Z_OK):(s===je.Z_SYNC_FLUSH&&(this.onEnd(je.Z_OK),r.avail_out=0),!0)};Uo.prototype.onData=function(e){this.chunks.push(e)};Uo.prototype.onEnd=function(e){e===je.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=qc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Iw(e,t){var r=new Uo(t);if(r.push(e,!0),r.err)throw r.msg||Tw[r.err];return r.result}function mG(e,t){return t=t||{},t.raw=!0,Iw(e,t)}Bc.Inflate=Uo;Bc.inflate=Iw;Bc.inflateRaw=mG;Bc.ungzip=Iw});var CC=w((Ihe,RC)=>{"use strict";var gG=tn().assign,_G=NR(),vG=PC(),yG=zw(),OC={};gG(OC,_G,vG,yG);RC.exports=OC});var NC=w(fp=>{"use strict";var bG=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",xG=CC(),AC=Ae(),dp=Dt(),wG=bG?"uint8array":"array";fp.magic="\b\0";function Lo(e,t){dp.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}AC.inherits(Lo,dp);Lo.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(AC.transformTo(wG,e.data),!1)};Lo.prototype.flush=function(){dp.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)};Lo.prototype.cleanUp=function(){dp.prototype.cleanUp.call(this),this._pako=null};Lo.prototype._createPako=function(){this._pako=new xG[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};fp.compressWorker=function(e){return new Lo("Deflate",e)};fp.uncompressWorker=function(){return new Lo("Inflate",{})}});var Ow=w(Pw=>{"use strict";var DC=Dt();Pw.STORE={magic:"\0\0",compressWorker:function(){return new DC("STORE compression")},uncompressWorker:function(){return new DC("STORE decompression")}};Pw.DEFLATE=NC()});var Rw=w(Mo=>{"use strict";Mo.LOCAL_FILE_HEADER="PK";Mo.CENTRAL_FILE_HEADER="PK";Mo.CENTRAL_DIRECTORY_END="PK";Mo.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07";Mo.ZIP64_CENTRAL_DIRECTORY_END="PK";Mo.DATA_DESCRIPTOR="PK\x07\b"});var MC=w((Che,LC)=>{"use strict";var Ss=Ae(),$s=Dt(),Cw=ds(),jC=Wf(),pp=Rw(),be=function(e,t){var r="",o;for(o=0;o<t;o++)r+=String.fromCharCode(e&255),e=e>>>8;return r},SG=function(e,t){var r=e;return e||(r=t?16893:33204),(r&65535)<<16},$G=function(e){return(e||0)&63},UC=function(e,t,r,o,n,i){var s=e.file,a=e.compression,u=i!==Cw.utf8encode,c=Ss.transformTo("string",i(s.name)),l=Ss.transformTo("string",Cw.utf8encode(s.name)),f=s.comment,h=Ss.transformTo("string",i(f)),p=Ss.transformTo("string",Cw.utf8encode(f)),g=l.length!==s.name.length,m=p.length!==f.length,_,v,S="",k="",b="",x=s.dir,T=s.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!t||r)&&(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var D=0;t&&(D|=8),!u&&(g||m)&&(D|=2048);var M=0,G=0;x&&(M|=16),n==="UNIX"?(G=798,M|=SG(s.unixPermissions,x)):(G=20,M|=$G(s.dosPermissions,x)),_=T.getUTCHours(),_=_<<6,_=_|T.getUTCMinutes(),_=_<<5,_=_|T.getUTCSeconds()/2,v=T.getUTCFullYear()-1980,v=v<<4,v=v|T.getUTCMonth()+1,v=v<<5,v=v|T.getUTCDate(),g&&(k=be(1,1)+be(jC(c),4)+l,S+="up"+be(k.length,2)+k),m&&(b=be(1,1)+be(jC(h),4)+p,S+="uc"+be(b.length,2)+b);var U="";U+=`
|
|
10
|
+
\0`,U+=be(D,2),U+=a.magic,U+=be(_,2),U+=be(v,2),U+=be(C.crc32,4),U+=be(C.compressedSize,4),U+=be(C.uncompressedSize,4),U+=be(c.length,2),U+=be(S.length,2);var De=pp.LOCAL_FILE_HEADER+U+c+S,we=pp.CENTRAL_FILE_HEADER+be(G,2)+U+be(h.length,2)+"\0\0\0\0"+be(M,4)+be(o,4)+c+S+h;return{fileRecord:De,dirRecord:we}},kG=function(e,t,r,o,n){var i="",s=Ss.transformTo("string",n(o));return i=pp.CENTRAL_DIRECTORY_END+"\0\0\0\0"+be(e,2)+be(e,2)+be(t,4)+be(r,4)+be(s.length,2)+s,i},EG=function(e){var t="";return t=pp.DATA_DESCRIPTOR+be(e.crc32,4)+be(e.compressedSize,4)+be(e.uncompressedSize,4),t};function pr(e,t,r,o){$s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=o,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Ss.inherits(pr,$s);pr.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,o=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,$s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-o-1))/r:100}}))};pr.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=UC(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0};pr.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=UC(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:EG(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};pr.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,o=kG(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:o,meta:{percent:100}})};pr.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()};pr.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(r){t.error(r)}),this};pr.prototype.resume=function(){if(!$s.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};pr.prototype.error=function(e){var t=this._sources;if(!$s.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch{}return!0};pr.prototype.lock=function(){$s.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};LC.exports=pr});var FC=w(ZC=>{"use strict";var zG=Ow(),TG=MC(),IG=function(e,t){var r=e||t,o=zG[r];if(!o)throw new Error(r+" is not a valid compression method !");return o};ZC.generateWorker=function(e,t,r){var o=new TG(t.streamFiles,r,t.platform,t.encodeFileName),n=0;try{e.forEach(function(i,s){n++;var a=IG(s.options.compression,t.compression),u=s.options.compressionOptions||t.compressionOptions||{},c=s.dir,l=s.date;s._compressWorker(a,u).withStreamInfo("file",{name:i,dir:c,date:l,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(o)}),o.entriesCount=n}catch(i){o.error(i)}return o}});var BC=w((Nhe,qC)=>{"use strict";var PG=Ae(),hp=Dt();function Vc(e,t){hp.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}PG.inherits(Vc,hp);Vc.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(r){t.push({data:r,meta:{percent:0}})}).on("error",function(r){t.isPaused?this.generatedError=r:t.error(r)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})};Vc.prototype.pause=function(){return hp.prototype.pause.call(this)?(this._stream.pause(),!0):!1};Vc.prototype.resume=function(){return hp.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1};qC.exports=Vc});var eA=w((Dhe,QC)=>{"use strict";var OG=ds(),Wc=Ae(),JC=Dt(),RG=Ux(),GC=Lx(),VC=Hf(),CG=WO(),AG=FC(),WC=xc(),NG=BC(),KC=function(e,t,r){var o=Wc.getTypeOf(t),n,i=Wc.extend(r||{},GC);i.date=i.date||new Date,i.compression!==null&&(i.compression=i.compression.toUpperCase()),typeof i.unixPermissions=="string"&&(i.unixPermissions=parseInt(i.unixPermissions,8)),i.unixPermissions&&i.unixPermissions&16384&&(i.dir=!0),i.dosPermissions&&i.dosPermissions&16&&(i.dir=!0),i.dir&&(e=YC(e)),i.createFolders&&(n=DG(e))&&XC.call(this,n,!0);var s=o==="string"&&i.binary===!1&&i.base64===!1;(!r||typeof r.binary>"u")&&(i.binary=!s);var a=t instanceof VC&&t.uncompressedSize===0;(a||i.dir||!t||t.length===0)&&(i.base64=!1,i.binary=!0,t="",i.compression="STORE",o="string");var u=null;t instanceof VC||t instanceof JC?u=t:WC.isNode&&WC.isStream(t)?u=new NG(e,t):u=Wc.prepareContent(e,t,i.binary,i.optimizedBinaryString,i.base64);var c=new CG(e,u,i);this.files[e]=c},DG=function(e){e.slice(-1)==="/"&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},YC=function(e){return e.slice(-1)!=="/"&&(e+="/"),e},XC=function(e,t){return t=typeof t<"u"?t:GC.createFolders,e=YC(e),this.files[e]||KC.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function HC(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var jG={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,o;for(t in this.files)o=this.files[t],r=t.slice(this.root.length,t.length),r&&t.slice(0,this.root.length)===this.root&&e(r,o)},filter:function(e){var t=[];return this.forEach(function(r,o){e(r,o)&&t.push(o)}),t},file:function(e,t,r){if(arguments.length===1)if(HC(e)){var o=e;return this.filter(function(i,s){return!s.dir&&o.test(i)})}else{var n=this.files[this.root+e];return n&&!n.dir?n:null}else e=this.root+e,KC.call(this,e,t,r);return this},folder:function(e){if(!e)return this;if(HC(e))return this.filter(function(n,i){return i.dir&&e.test(n)});var t=this.root+e,r=XC.call(this,t),o=this.clone();return o.root=r.name,o},remove:function(e){e=this.root+e;var t=this.files[e];if(t||(e.slice(-1)!=="/"&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(n,i){return i.name.slice(0,e.length)===e}),o=0;o<r.length;o++)delete this.files[r[o].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if(r=Wc.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:OG.utf8encode}),r.type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),r.type==="binarystring"&&(r.type="string"),!r.type)throw new Error("No output type specified.");Wc.checkSupport(r.type),(r.platform==="darwin"||r.platform==="freebsd"||r.platform==="linux"||r.platform==="sunos")&&(r.platform="UNIX"),r.platform==="win32"&&(r.platform="DOS");var o=r.comment||this.comment||"";t=AG.generateWorker(this,r,o)}catch(n){t=new JC("error"),t.error(n)}return new RG(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return e=e||{},e.type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};QC.exports=jG});var Aw=w((jhe,rA)=>{"use strict";var UG=Ae();function tA(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}tA.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t=0,r;for(this.checkOffset(e),r=this.index+e-1;r>=this.index;r--)t=(t<<8)+this.byteAt(r);return this.index+=e,t},readString:function(e){return UG.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};rA.exports=tA});var Nw=w((Uhe,oA)=>{"use strict";var nA=Aw(),LG=Ae();function ks(e){nA.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}LG.inherits(ks,nA);ks.prototype.byteAt=function(e){return this.data[this.zero+e]};ks.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2),n=e.charCodeAt(3),i=this.length-4;i>=0;--i)if(this.data[i]===t&&this.data[i+1]===r&&this.data[i+2]===o&&this.data[i+3]===n)return i-this.zero;return-1};ks.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2),n=e.charCodeAt(3),i=this.readData(4);return t===i[0]&&r===i[1]&&o===i[2]&&n===i[3]};ks.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};oA.exports=ks});var aA=w((Lhe,sA)=>{"use strict";var iA=Aw(),MG=Ae();function Es(e){iA.call(this,e)}MG.inherits(Es,iA);Es.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};Es.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};Es.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};Es.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};sA.exports=Es});var jw=w((Mhe,uA)=>{"use strict";var cA=Nw(),ZG=Ae();function Dw(e){cA.call(this,e)}ZG.inherits(Dw,cA);Dw.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};uA.exports=Dw});var fA=w((Zhe,dA)=>{"use strict";var lA=jw(),FG=Ae();function Uw(e){lA.call(this,e)}FG.inherits(Uw,lA);Uw.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};dA.exports=Uw});var Lw=w((Fhe,hA)=>{"use strict";var mp=Ae(),pA=Qr(),qG=Nw(),BG=aA(),VG=fA(),WG=jw();hA.exports=function(e){var t=mp.getTypeOf(e);return mp.checkSupport(t),t==="string"&&!pA.uint8array?new BG(e):t==="nodebuffer"?new VG(e):pA.uint8array?new WG(mp.transformTo("uint8array",e)):new qG(mp.transformTo("array",e))}});var vA=w((qhe,_A)=>{"use strict";var Mw=Lw(),Wn=Ae(),HG=Hf(),mA=Wf(),gp=ds(),_p=Ow(),JG=Qr(),GG=0,KG=3,YG=function(e){for(var t in _p)if(Object.prototype.hasOwnProperty.call(_p,t)&&_p[t].magic===e)return _p[t];return null};function gA(e,t){this.options=e,this.loadOptions=t}gA.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=YG(this.compressionMethod),t===null)throw new Error("Corrupted zip : compression "+Wn.pretty(this.compressionMethod)+" unknown (inner file : "+Wn.transformTo("string",this.fileName)+")");this.decompressed=new HG(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===GG&&(this.dosPermissions=this.externalFileAttributes&63),e===KG&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=Mw(this.extraFields[1].value);this.uncompressedSize===Wn.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Wn.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Wn.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Wn.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t=e.index+this.extraFieldsLength,r,o,n;for(this.extraFields||(this.extraFields={});e.index+4<t;)r=e.readInt(2),o=e.readInt(2),n=e.readData(o),this.extraFields[r]={id:r,length:o,value:n};e.setIndex(t)},handleUTF8:function(){var e=JG.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=gp.utf8decode(this.fileName),this.fileCommentStr=gp.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var r=Wn.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var o=this.findExtraFieldUnicodeComment();if(o!==null)this.fileCommentStr=o;else{var n=Wn.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=Mw(e.value);return t.readInt(1)!==1||mA(this.fileName)!==t.readInt(4)?null:gp.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=Mw(e.value);return t.readInt(1)!==1||mA(this.fileComment)!==t.readInt(4)?null:gp.utf8decode(t.readData(e.length-5))}return null}};_A.exports=gA});var xA=w((Bhe,bA)=>{"use strict";var XG=Lw(),sn=Ae(),hr=Rw(),QG=vA(),eK=Qr();function yA(e){this.files=[],this.loadOptions=e}yA.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+sn.pretty(t)+", expected "+sn.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var o=this.reader.readString(4),n=o===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=eK.uint8array?"uint8array":"array",r=sn.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,r,o,n;t<e;)r=this.reader.readInt(2),o=this.reader.readInt(4),n=this.reader.readData(o),this.zip64ExtensibleData[r]={id:r,length:o,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(hr.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(hr.CENTRAL_FILE_HEADER);)e=new QG({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(hr.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,hr.LOCAL_FILE_HEADER);throw t?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var r=e;if(this.checkSignature(hr.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===sn.MAX_VALUE_16BITS||this.diskWithCentralDirStart===sn.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===sn.MAX_VALUE_16BITS||this.centralDirRecords===sn.MAX_VALUE_16BITS||this.centralDirSize===sn.MAX_VALUE_32BITS||this.centralDirOffset===sn.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(hr.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(hr.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,hr.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(hr.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(hr.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var o=this.centralDirOffset+this.centralDirSize;this.zip64&&(o+=20,o+=12+this.zip64EndOfCentralSize);var n=r-o;if(n>0)this.isSignature(r,hr.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=XG(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};bA.exports=yA});var $A=w((Vhe,SA)=>{"use strict";var Zw=Ae(),vp=cs(),tK=ds(),rK=xA(),nK=Fx(),wA=xc();function oK(e){return new vp.Promise(function(t,r){var o=e.decompressed.getContentWorker().pipe(new nK);o.on("error",function(n){r(n)}).on("end",function(){o.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}SA.exports=function(e,t){var r=this;return t=Zw.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:tK.utf8decode}),wA.isNode&&wA.isStream(e)?vp.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Zw.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(o){var n=new rK(t);return n.load(o),n}).then(function(n){var i=[vp.Promise.resolve(n)],s=n.files;if(t.checkCRC32)for(var a=0;a<s.length;a++)i.push(oK(s[a]));return vp.Promise.all(i)}).then(function(n){for(var i=n.shift(),s=i.files,a=0;a<s.length;a++){var u=s[a],c=u.fileNameStr,l=Zw.resolve(u.fileNameStr);r.file(l,u.decompressed,{binary:!0,optimizedBinaryString:!0,date:u.date,dir:u.dir,comment:u.fileCommentStr.length?u.fileCommentStr:null,unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions,createFolders:t.createFolders}),u.dir||(r.file(l).unsafeOriginalName=c)}return i.zipComment.length&&(r.comment=i.zipComment),r})}});var EA=w((Whe,kA)=>{"use strict";function Kt(){if(!(this instanceof Kt))return new Kt;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new Kt;for(var t in this)typeof this[t]!="function"&&(e[t]=this[t]);return e}}Kt.prototype=eA();Kt.prototype.loadAsync=$A();Kt.support=Qr();Kt.defaults=Lx();Kt.version="3.10.1";Kt.loadAsync=function(e,t){return new Kt().loadAsync(e,t)};Kt.external=cs();kA.exports=Kt});var wu=w(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.regexpCode=ae.getEsmExportName=ae.getProperty=ae.safeStringify=ae.stringify=ae.strConcat=ae.addCodeArg=ae.str=ae._=ae.nil=ae._Code=ae.Name=ae.IDENTIFIER=ae._CodeOrName=void 0;var bu=class{};ae._CodeOrName=bu;ae.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Vo=class extends bu{constructor(t){if(super(),!ae.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ae.Name=Vo;var tr=class extends bu{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,o)=>`${r}${o}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,o)=>(o instanceof Vo&&(r[o.str]=(r[o.str]||0)+1),r),{})}};ae._Code=tr;ae.nil=new tr("");function E4(e,...t){let r=[e[0]],o=0;for(;o<t.length;)wS(r,t[o]),r.push(e[++o]);return new tr(r)}ae._=E4;var xS=new tr("+");function z4(e,...t){let r=[xu(e[0])],o=0;for(;o<t.length;)r.push(xS),wS(r,t[o]),r.push(xS,xu(e[++o]));return xQ(r),new tr(r)}ae.str=z4;function wS(e,t){t instanceof tr?e.push(...t._items):t instanceof Vo?e.push(t):e.push($Q(t))}ae.addCodeArg=wS;function xQ(e){let t=1;for(;t<e.length-1;){if(e[t]===xS){let r=wQ(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function wQ(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Vo||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Vo))return`"${e}${t.slice(1)}`}function SQ(e,t){return t.emptyStr()?e:e.emptyStr()?t:z4`${e}${t}`}ae.strConcat=SQ;function $Q(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:xu(Array.isArray(e)?e.join(","):e)}function kQ(e){return new tr(xu(e))}ae.stringify=kQ;function xu(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ae.safeStringify=xu;function EQ(e){return typeof e=="string"&&ae.IDENTIFIER.test(e)?new tr(`.${e}`):E4`[${e}]`}ae.getProperty=EQ;function zQ(e){if(typeof e=="string"&&ae.IDENTIFIER.test(e))return new tr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ae.getEsmExportName=zQ;function TQ(e){return new tr(e.toString())}ae.regexpCode=TQ});var kS=w(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.ValueScope=Tt.ValueScopeName=Tt.Scope=Tt.varKinds=Tt.UsedValueState=void 0;var zt=wu(),SS=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},rh;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(rh||(Tt.UsedValueState=rh={}));Tt.varKinds={const:new zt.Name("const"),let:new zt.Name("let"),var:new zt.Name("var")};var nh=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof zt.Name?t:this.name(t)}name(t){return new zt.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,o;if(!((o=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||o===void 0)&&o.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Tt.Scope=nh;var oh=class extends zt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:o}){this.value=t,this.scopePath=(0,zt._)`.${new zt.Name(r)}[${o}]`}};Tt.ValueScopeName=oh;var IQ=(0,zt._)`\n`,$S=class extends nh{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?IQ:zt.nil}}get(){return this._scope}name(t){return new oh(t,this._newName(t))}value(t,r){var o;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(t),{prefix:i}=n,s=(o=r.key)!==null&&o!==void 0?o:r.ref,a=this._values[i];if(a){let l=a.get(s);if(l)return l}else a=this._values[i]=new Map;a.set(s,n);let u=this._scope[i]||(this._scope[i]=[]),c=u.length;return u[c]=r.ref,n.setValue(r,{property:i,itemIndex:c}),n}getValue(t,r){let o=this._values[t];if(o)return o.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,zt._)`${t}${o.scopePath}`})}scopeCode(t=this._values,r,o){return this._reduceValues(t,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,o)}_reduceValues(t,r,o={},n){let i=zt.nil;for(let s in t){let a=t[s];if(!a)continue;let u=o[s]=o[s]||new Map;a.forEach(c=>{if(u.has(c))return;u.set(c,rh.Started);let l=r(c);if(l){let f=this.opts.es5?Tt.varKinds.var:Tt.varKinds.const;i=(0,zt._)`${i}${f} ${c} = ${l};${this.opts._n}`}else if(l=n?.(c))i=(0,zt._)`${i}${l}${this.opts._n}`;else throw new SS(c);u.set(c,rh.Completed)})}return i}};Tt.ValueScope=$S});var X=w(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.or=Q.and=Q.not=Q.CodeGen=Q.operators=Q.varKinds=Q.ValueScopeName=Q.ValueScope=Q.Scope=Q.Name=Q.regexpCode=Q.stringify=Q.getProperty=Q.nil=Q.strConcat=Q.str=Q._=void 0;var ne=wu(),_r=kS(),eo=wu();Object.defineProperty(Q,"_",{enumerable:!0,get:function(){return eo._}});Object.defineProperty(Q,"str",{enumerable:!0,get:function(){return eo.str}});Object.defineProperty(Q,"strConcat",{enumerable:!0,get:function(){return eo.strConcat}});Object.defineProperty(Q,"nil",{enumerable:!0,get:function(){return eo.nil}});Object.defineProperty(Q,"getProperty",{enumerable:!0,get:function(){return eo.getProperty}});Object.defineProperty(Q,"stringify",{enumerable:!0,get:function(){return eo.stringify}});Object.defineProperty(Q,"regexpCode",{enumerable:!0,get:function(){return eo.regexpCode}});Object.defineProperty(Q,"Name",{enumerable:!0,get:function(){return eo.Name}});var ch=kS();Object.defineProperty(Q,"Scope",{enumerable:!0,get:function(){return ch.Scope}});Object.defineProperty(Q,"ValueScope",{enumerable:!0,get:function(){return ch.ValueScope}});Object.defineProperty(Q,"ValueScopeName",{enumerable:!0,get:function(){return ch.ValueScopeName}});Object.defineProperty(Q,"varKinds",{enumerable:!0,get:function(){return ch.varKinds}});Q.operators={GT:new ne._Code(">"),GTE:new ne._Code(">="),LT:new ne._Code("<"),LTE:new ne._Code("<="),EQ:new ne._Code("==="),NEQ:new ne._Code("!=="),NOT:new ne._Code("!"),OR:new ne._Code("||"),AND:new ne._Code("&&"),ADD:new ne._Code("+")};var fn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},ES=class extends fn{constructor(t,r,o){super(),this.varKind=t,this.name=r,this.rhs=o}render({es5:t,_n:r}){let o=t?_r.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Ws(this.rhs,t,r)),this}get names(){return this.rhs instanceof ne._CodeOrName?this.rhs.names:{}}},ih=class extends fn{constructor(t,r,o){super(),this.lhs=t,this.rhs=r,this.sideEffects=o}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ne.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Ws(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ne.Name?{}:{...this.lhs.names};return ah(t,this.rhs)}},zS=class extends ih{constructor(t,r,o,n){super(t,o,n),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},TS=class extends fn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},IS=class extends fn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},PS=class extends fn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},OS=class extends fn{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Ws(this.code,t,r),this}get names(){return this.code instanceof ne._CodeOrName?this.code.names:{}}},Su=class extends fn{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,o)=>r+o.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let o=t[r].optimizeNodes();Array.isArray(o)?t.splice(r,1,...o):o?t[r]=o:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:o}=this,n=o.length;for(;n--;){let i=o[n];i.optimizeNames(t,r)||(PQ(t,i.names),o.splice(n,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Jo(t,r.names),{})}},pn=class extends Su{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},RS=class extends Su{},Vs=class extends pn{};Vs.kind="else";var Wo=class e extends pn{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let o=r.optimizeNodes();r=this.else=Array.isArray(o)?new Vs(o):o}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(T4(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Ws(this.condition,t,r),this}get names(){let t=super.names;return ah(t,this.condition),this.else&&Jo(t,this.else.names),t}};Wo.kind="if";var Ho=class extends pn{};Ho.kind="for";var CS=class extends Ho{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Ws(this.iteration,t,r),this}get names(){return Jo(super.names,this.iteration.names)}},AS=class extends Ho{constructor(t,r,o,n){super(),this.varKind=t,this.name=r,this.from=o,this.to=n}render(t){let r=t.es5?_r.varKinds.var:this.varKind,{name:o,from:n,to:i}=this;return`for(${r} ${o}=${n}; ${o}<${i}; ${o}++)`+super.render(t)}get names(){let t=ah(super.names,this.from);return ah(t,this.to)}},sh=class extends Ho{constructor(t,r,o,n){super(),this.loop=t,this.varKind=r,this.name=o,this.iterable=n}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Ws(this.iterable,t,r),this}get names(){return Jo(super.names,this.iterable.names)}},$u=class extends pn{constructor(t,r,o){super(),this.name=t,this.args=r,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};$u.kind="func";var ku=class extends Su{render(t){return"return "+super.render(t)}};ku.kind="return";var NS=class extends pn{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var o,n;return super.optimizeNames(t,r),(o=this.catch)===null||o===void 0||o.optimizeNames(t,r),(n=this.finally)===null||n===void 0||n.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Jo(t,this.catch.names),this.finally&&Jo(t,this.finally.names),t}},Eu=class extends pn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Eu.kind="catch";var zu=class extends pn{render(t){return"finally"+super.render(t)}};zu.kind="finally";var DS=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
11
|
+
`:""},this._extScope=t,this._scope=new _r.Scope({parent:t}),this._nodes=[new RS]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let o=this._extScope.value(t,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,o,n){let i=this._scope.toName(r);return o!==void 0&&n&&(this._constants[i.str]=o),this._leafNode(new ES(t,i,o)),i}const(t,r,o){return this._def(_r.varKinds.const,t,r,o)}let(t,r,o){return this._def(_r.varKinds.let,t,r,o)}var(t,r,o){return this._def(_r.varKinds.var,t,r,o)}assign(t,r,o){return this._leafNode(new ih(t,r,o))}add(t,r){return this._leafNode(new zS(t,Q.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ne.nil&&this._leafNode(new OS(t)),this}object(...t){let r=["{"];for(let[o,n]of t)r.length>1&&r.push(","),r.push(o),(o!==n||this.opts.es5)&&(r.push(":"),(0,ne.addCodeArg)(r,n));return r.push("}"),new ne._Code(r)}if(t,r,o){if(this._blockNode(new Wo(t)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Wo(t))}else(){return this._elseNode(new Vs)}endIf(){return this._endBlockNode(Wo,Vs)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new CS(t),r)}forRange(t,r,o,n,i=this.opts.es5?_r.varKinds.var:_r.varKinds.let){let s=this._scope.toName(t);return this._for(new AS(i,s,r,o),()=>n(s))}forOf(t,r,o,n=_r.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ne.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ne._)`${s}.length`,a=>{this.var(i,(0,ne._)`${s}[${a}]`),o(i)})}return this._for(new sh("of",n,i,r),()=>o(i))}forIn(t,r,o,n=this.opts.es5?_r.varKinds.var:_r.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ne._)`Object.keys(${r})`,o);let i=this._scope.toName(t);return this._for(new sh("in",n,i,r),()=>o(i))}endFor(){return this._endBlockNode(Ho)}label(t){return this._leafNode(new TS(t))}break(t){return this._leafNode(new IS(t))}return(t){let r=new ku;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ku)}try(t,r,o){if(!r&&!o)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new NS;if(this._blockNode(n),this.code(t),r){let i=this.name("e");this._currNode=n.catch=new Eu(i),r(i)}return o&&(this._currNode=n.finally=new zu,this.code(o)),this._endBlockNode(Eu,zu)}throw(t){return this._leafNode(new PS(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let o=this._nodes.length-r;if(o<0||t!==void 0&&o!==t)throw new Error(`CodeGen: wrong number of nodes: ${o} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ne.nil,o,n){return this._blockNode(new $u(t,r,o)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode($u)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let o=this._currNode;if(o instanceof t||r&&o instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Wo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Q.CodeGen=DS;function Jo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function ah(e,t){return t instanceof ne._CodeOrName?Jo(e,t.names):e}function Ws(e,t,r){if(e instanceof ne.Name)return o(e);if(!n(e))return e;return new ne._Code(e._items.reduce((i,s)=>(s instanceof ne.Name&&(s=o(s)),s instanceof ne._Code?i.push(...s._items):i.push(s),i),[]));function o(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function n(i){return i instanceof ne._Code&&i._items.some(s=>s instanceof ne.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function PQ(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function T4(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ne._)`!${jS(e)}`}Q.not=T4;var OQ=I4(Q.operators.AND);function RQ(...e){return e.reduce(OQ)}Q.and=RQ;var CQ=I4(Q.operators.OR);function AQ(...e){return e.reduce(CQ)}Q.or=AQ;function I4(e){return(t,r)=>t===ne.nil?r:r===ne.nil?t:(0,ne._)`${jS(t)} ${e} ${jS(r)}`}function jS(e){return e instanceof ne.Name?e:(0,ne._)`(${e})`}});var oe=w(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;var ye=X(),NQ=wu();function DQ(e){let t={};for(let r of e)t[r]=!0;return t}ee.toHash=DQ;function jQ(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(R4(e,t),!C4(t,e.self.RULES.all))}ee.alwaysValidSchema=jQ;function R4(e,t=e.schema){let{opts:r,self:o}=e;if(!r.strictSchema||typeof t=="boolean")return;let n=o.RULES.keywords;for(let i in t)n[i]||D4(e,`unknown keyword: "${i}"`)}ee.checkUnknownRules=R4;function C4(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ee.schemaHasRules=C4;function UQ(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ee.schemaHasRulesButRef=UQ;function LQ({topSchemaRef:e,schemaPath:t},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ye._)`${r}`}return(0,ye._)`${e}${t}${(0,ye.getProperty)(o)}`}ee.schemaRefOrVal=LQ;function MQ(e){return A4(decodeURIComponent(e))}ee.unescapeFragment=MQ;function ZQ(e){return encodeURIComponent(LS(e))}ee.escapeFragment=ZQ;function LS(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=LS;function A4(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=A4;function FQ(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ee.eachItem=FQ;function P4({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(n,i,s,a)=>{let u=s===void 0?i:s instanceof ye.Name?(i instanceof ye.Name?e(n,i,s):t(n,i,s),s):i instanceof ye.Name?(t(n,s,i),i):r(i,s);return a===ye.Name&&!(u instanceof ye.Name)?o(n,u):u}}ee.mergeEvaluated={props:P4({mergeNames:(e,t,r)=>e.if((0,ye._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,ye._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,ye._)`${r} || {}`).code((0,ye._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,ye._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,ye._)`${r} || {}`),MS(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:N4}),items:P4({mergeNames:(e,t,r)=>e.if((0,ye._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,ye._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,ye._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,ye._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function N4(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,ye._)`{}`);return t!==void 0&&MS(e,r,t),r}ee.evaluatedPropsToName=N4;function MS(e,t,r){Object.keys(r).forEach(o=>e.assign((0,ye._)`${t}${(0,ye.getProperty)(o)}`,!0))}ee.setEvaluated=MS;var O4={};function qQ(e,t){return e.scopeValue("func",{ref:t,code:O4[t.code]||(O4[t.code]=new NQ._Code(t.code))})}ee.useFunc=qQ;var US;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(US||(ee.Type=US={}));function BQ(e,t,r){if(e instanceof ye.Name){let o=t===US.Num;return r?o?(0,ye._)`"[" + ${e} + "]"`:(0,ye._)`"['" + ${e} + "']"`:o?(0,ye._)`"/" + ${e}`:(0,ye._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ye.getProperty)(e).toString():"/"+LS(e)}ee.getErrorPath=BQ;function D4(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ee.checkStrictMode=D4});var hn=w(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var ut=X(),VQ={data:new ut.Name("data"),valCxt:new ut.Name("valCxt"),instancePath:new ut.Name("instancePath"),parentData:new ut.Name("parentData"),parentDataProperty:new ut.Name("parentDataProperty"),rootData:new ut.Name("rootData"),dynamicAnchors:new ut.Name("dynamicAnchors"),vErrors:new ut.Name("vErrors"),errors:new ut.Name("errors"),this:new ut.Name("this"),self:new ut.Name("self"),scope:new ut.Name("scope"),json:new ut.Name("json"),jsonPos:new ut.Name("jsonPos"),jsonLen:new ut.Name("jsonLen"),jsonPart:new ut.Name("jsonPart")};ZS.default=VQ});var Tu=w(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.extendErrors=lt.resetErrorsCount=lt.reportExtraError=lt.reportError=lt.keyword$DataError=lt.keywordError=void 0;var ie=X(),uh=oe(),yt=hn();lt.keywordError={message:({keyword:e})=>(0,ie.str)`must pass "${e}" keyword validation`};lt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ie.str)`"${e}" keyword must be ${t} ($data)`:(0,ie.str)`"${e}" keyword is invalid ($data)`};function WQ(e,t=lt.keywordError,r,o){let{it:n}=e,{gen:i,compositeRule:s,allErrors:a}=n,u=L4(e,t,r);o??(s||a)?j4(i,u):U4(n,(0,ie._)`[${u}]`)}lt.reportError=WQ;function HQ(e,t=lt.keywordError,r){let{it:o}=e,{gen:n,compositeRule:i,allErrors:s}=o,a=L4(e,t,r);j4(n,a),i||s||U4(o,yt.default.vErrors)}lt.reportExtraError=HQ;function JQ(e,t){e.assign(yt.default.errors,t),e.if((0,ie._)`${yt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ie._)`${yt.default.vErrors}.length`,t),()=>e.assign(yt.default.vErrors,null)))}lt.resetErrorsCount=JQ;function GQ({gen:e,keyword:t,schemaValue:r,data:o,errsCount:n,it:i}){if(n===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",n,yt.default.errors,a=>{e.const(s,(0,ie._)`${yt.default.vErrors}[${a}]`),e.if((0,ie._)`${s}.instancePath === undefined`,()=>e.assign((0,ie._)`${s}.instancePath`,(0,ie.strConcat)(yt.default.instancePath,i.errorPath))),e.assign((0,ie._)`${s}.schemaPath`,(0,ie.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,ie._)`${s}.schema`,r),e.assign((0,ie._)`${s}.data`,o))})}lt.extendErrors=GQ;function j4(e,t){let r=e.const("err",t);e.if((0,ie._)`${yt.default.vErrors} === null`,()=>e.assign(yt.default.vErrors,(0,ie._)`[${r}]`),(0,ie._)`${yt.default.vErrors}.push(${r})`),e.code((0,ie._)`${yt.default.errors}++`)}function U4(e,t){let{gen:r,validateName:o,schemaEnv:n}=e;n.$async?r.throw((0,ie._)`new ${e.ValidationError}(${t})`):(r.assign((0,ie._)`${o}.errors`,t),r.return(!1))}var Go={keyword:new ie.Name("keyword"),schemaPath:new ie.Name("schemaPath"),params:new ie.Name("params"),propertyName:new ie.Name("propertyName"),message:new ie.Name("message"),schema:new ie.Name("schema"),parentSchema:new ie.Name("parentSchema")};function L4(e,t,r){let{createErrors:o}=e.it;return o===!1?(0,ie._)`{}`:KQ(e,t,r)}function KQ(e,t,r={}){let{gen:o,it:n}=e,i=[YQ(n,r),XQ(e,r)];return QQ(e,t,i),o.object(...i)}function YQ({errorPath:e},{instancePath:t}){let r=t?(0,ie.str)`${e}${(0,uh.getErrorPath)(t,uh.Type.Str)}`:e;return[yt.default.instancePath,(0,ie.strConcat)(yt.default.instancePath,r)]}function XQ({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let n=o?t:(0,ie.str)`${t}/${e}`;return r&&(n=(0,ie.str)`${n}${(0,uh.getErrorPath)(r,uh.Type.Str)}`),[Go.schemaPath,n]}function QQ(e,{params:t,message:r},o){let{keyword:n,data:i,schemaValue:s,it:a}=e,{opts:u,propertyName:c,topSchemaRef:l,schemaPath:f}=a;o.push([Go.keyword,n],[Go.params,typeof t=="function"?t(e):t||(0,ie._)`{}`]),u.messages&&o.push([Go.message,typeof r=="function"?r(e):r]),u.verbose&&o.push([Go.schema,s],[Go.parentSchema,(0,ie._)`${l}${f}`],[yt.default.data,i]),c&&o.push([Go.propertyName,c])}});var Z4=w(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.boolOrEmptySchema=Hs.topBoolOrEmptySchema=void 0;var eee=Tu(),tee=X(),ree=hn(),nee={message:"boolean schema is false"};function oee(e){let{gen:t,schema:r,validateName:o}=e;r===!1?M4(e,!1):typeof r=="object"&&r.$async===!0?t.return(ree.default.data):(t.assign((0,tee._)`${o}.errors`,null),t.return(!0))}Hs.topBoolOrEmptySchema=oee;function iee(e,t){let{gen:r,schema:o}=e;o===!1?(r.var(t,!1),M4(e)):r.var(t,!0)}Hs.boolOrEmptySchema=iee;function M4(e,t){let{gen:r,data:o}=e,n={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,eee.reportError)(n,nee,void 0,t)}});var FS=w(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.getRules=Js.isJSONType=void 0;var see=["string","number","integer","boolean","null","object","array"],aee=new Set(see);function cee(e){return typeof e=="string"&&aee.has(e)}Js.isJSONType=cee;function uee(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Js.getRules=uee});var qS=w(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.shouldUseRule=to.shouldUseGroup=to.schemaHasRulesForType=void 0;function lee({schema:e,self:t},r){let o=t.RULES.types[r];return o&&o!==!0&&F4(e,o)}to.schemaHasRulesForType=lee;function F4(e,t){return t.rules.some(r=>q4(e,r))}to.shouldUseGroup=F4;function q4(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(o=>e[o]!==void 0))}to.shouldUseRule=q4});var Iu=w(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.reportTypeError=dt.checkDataTypes=dt.checkDataType=dt.coerceAndCheckDataType=dt.getJSONTypes=dt.getSchemaTypes=dt.DataType=void 0;var dee=FS(),fee=qS(),pee=Tu(),K=X(),B4=oe(),Gs;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Gs||(dt.DataType=Gs={}));function hee(e){let t=V4(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}dt.getSchemaTypes=hee;function V4(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(dee.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}dt.getJSONTypes=V4;function mee(e,t){let{gen:r,data:o,opts:n}=e,i=gee(t,n.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,fee.schemaHasRulesForType)(e,t[0]));if(s){let a=VS(t,o,n.strictNumbers,Gs.Wrong);r.if(a,()=>{i.length?_ee(e,t,i):WS(e)})}return s}dt.coerceAndCheckDataType=mee;var W4=new Set(["string","number","integer","boolean","null"]);function gee(e,t){return t?e.filter(r=>W4.has(r)||t==="array"&&r==="array"):[]}function _ee(e,t,r){let{gen:o,data:n,opts:i}=e,s=o.let("dataType",(0,K._)`typeof ${n}`),a=o.let("coerced",(0,K._)`undefined`);i.coerceTypes==="array"&&o.if((0,K._)`${s} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,K._)`${n}[0]`).assign(s,(0,K._)`typeof ${n}`).if(VS(t,n,i.strictNumbers),()=>o.assign(a,n))),o.if((0,K._)`${a} !== undefined`);for(let c of r)(W4.has(c)||c==="array"&&i.coerceTypes==="array")&&u(c);o.else(),WS(e),o.endIf(),o.if((0,K._)`${a} !== undefined`,()=>{o.assign(n,a),vee(e,a)});function u(c){switch(c){case"string":o.elseIf((0,K._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,K._)`"" + ${n}`).elseIf((0,K._)`${n} === null`).assign(a,(0,K._)`""`);return;case"number":o.elseIf((0,K._)`${s} == "boolean" || ${n} === null
|
|
12
|
+
|| (${s} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,K._)`+${n}`);return;case"integer":o.elseIf((0,K._)`${s} === "boolean" || ${n} === null
|
|
13
|
+
|| (${s} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,K._)`+${n}`);return;case"boolean":o.elseIf((0,K._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,K._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":o.elseIf((0,K._)`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(a,null);return;case"array":o.elseIf((0,K._)`${s} === "string" || ${s} === "number"
|
|
14
|
+
|| ${s} === "boolean" || ${n} === null`).assign(a,(0,K._)`[${n}]`)}}}function vee({gen:e,parentData:t,parentDataProperty:r},o){e.if((0,K._)`${t} !== undefined`,()=>e.assign((0,K._)`${t}[${r}]`,o))}function BS(e,t,r,o=Gs.Correct){let n=o===Gs.Correct?K.operators.EQ:K.operators.NEQ,i;switch(e){case"null":return(0,K._)`${t} ${n} null`;case"array":i=(0,K._)`Array.isArray(${t})`;break;case"object":i=(0,K._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,K._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,K._)`typeof ${t} ${n} ${e}`}return o===Gs.Correct?i:(0,K.not)(i);function s(a=K.nil){return(0,K.and)((0,K._)`typeof ${t} == "number"`,a,r?(0,K._)`isFinite(${t})`:K.nil)}}dt.checkDataType=BS;function VS(e,t,r,o){if(e.length===1)return BS(e[0],t,r,o);let n,i=(0,B4.toHash)(e);if(i.array&&i.object){let s=(0,K._)`typeof ${t} != "object"`;n=i.null?s:(0,K._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else n=K.nil;i.number&&delete i.integer;for(let s in i)n=(0,K.and)(n,BS(s,t,r,o));return n}dt.checkDataTypes=VS;var yee={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,K._)`{type: ${e}}`:(0,K._)`{type: ${t}}`};function WS(e){let t=bee(e);(0,pee.reportError)(t,yee)}dt.reportTypeError=WS;function bee(e){let{gen:t,data:r,schema:o}=e,n=(0,B4.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:n,schemaValue:n,parentSchema:o,params:{},it:e}}});var J4=w(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.assignDefaults=void 0;var Ks=X(),xee=oe();function wee(e,t){let{properties:r,items:o}=e.schema;if(t==="object"&&r)for(let n in r)H4(e,n,r[n].default);else t==="array"&&Array.isArray(o)&&o.forEach((n,i)=>H4(e,i,n.default))}lh.assignDefaults=wee;function H4(e,t,r){let{gen:o,compositeRule:n,data:i,opts:s}=e;if(r===void 0)return;let a=(0,Ks._)`${i}${(0,Ks.getProperty)(t)}`;if(n){(0,xee.checkStrictMode)(e,`default is ignored for: ${a}`);return}let u=(0,Ks._)`${a} === undefined`;s.useDefaults==="empty"&&(u=(0,Ks._)`${u} || ${a} === null || ${a} === ""`),o.if(u,(0,Ks._)`${a} = ${(0,Ks.stringify)(r)}`)}});var rr=w(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.validateUnion=me.validateArray=me.usePattern=me.callValidateCode=me.schemaProperties=me.allSchemaProperties=me.noPropertyInData=me.propertyInData=me.isOwnProperty=me.hasPropFunc=me.reportMissingProp=me.checkMissingProp=me.checkReportMissingProp=void 0;var Ee=X(),HS=oe(),ro=hn(),See=oe();function $ee(e,t){let{gen:r,data:o,it:n}=e;r.if(GS(r,o,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ee._)`${t}`},!0),e.error()})}me.checkReportMissingProp=$ee;function kee({gen:e,data:t,it:{opts:r}},o,n){return(0,Ee.or)(...o.map(i=>(0,Ee.and)(GS(e,t,i,r.ownProperties),(0,Ee._)`${n} = ${i}`)))}me.checkMissingProp=kee;function Eee(e,t){e.setParams({missingProperty:t},!0),e.error()}me.reportMissingProp=Eee;function G4(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ee._)`Object.prototype.hasOwnProperty`})}me.hasPropFunc=G4;function JS(e,t,r){return(0,Ee._)`${G4(e)}.call(${t}, ${r})`}me.isOwnProperty=JS;function zee(e,t,r,o){let n=(0,Ee._)`${t}${(0,Ee.getProperty)(r)} !== undefined`;return o?(0,Ee._)`${n} && ${JS(e,t,r)}`:n}me.propertyInData=zee;function GS(e,t,r,o){let n=(0,Ee._)`${t}${(0,Ee.getProperty)(r)} === undefined`;return o?(0,Ee.or)(n,(0,Ee.not)(JS(e,t,r))):n}me.noPropertyInData=GS;function K4(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}me.allSchemaProperties=K4;function Tee(e,t){return K4(t).filter(r=>!(0,HS.alwaysValidSchema)(e,t[r]))}me.schemaProperties=Tee;function Iee({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:n,errorPath:i},it:s},a,u,c){let l=c?(0,Ee._)`${e}, ${t}, ${o}${n}`:t,f=[[ro.default.instancePath,(0,Ee.strConcat)(ro.default.instancePath,i)],[ro.default.parentData,s.parentData],[ro.default.parentDataProperty,s.parentDataProperty],[ro.default.rootData,ro.default.rootData]];s.opts.dynamicRef&&f.push([ro.default.dynamicAnchors,ro.default.dynamicAnchors]);let h=(0,Ee._)`${l}, ${r.object(...f)}`;return u!==Ee.nil?(0,Ee._)`${a}.call(${u}, ${h})`:(0,Ee._)`${a}(${h})`}me.callValidateCode=Iee;var Pee=(0,Ee._)`new RegExp`;function Oee({gen:e,it:{opts:t}},r){let o=t.unicodeRegExp?"u":"",{regExp:n}=t.code,i=n(r,o);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Ee._)`${n.code==="new RegExp"?Pee:(0,See.useFunc)(e,n)}(${r}, ${o})`})}me.usePattern=Oee;function Ree(e){let{gen:t,data:r,keyword:o,it:n}=e,i=t.name("valid");if(n.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let u=t.const("len",(0,Ee._)`${r}.length`);t.forRange("i",0,u,c=>{e.subschema({keyword:o,dataProp:c,dataPropType:HS.Type.Num},i),t.if((0,Ee.not)(i),a)})}}me.validateArray=Ree;function Cee(e){let{gen:t,schema:r,keyword:o,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,HS.alwaysValidSchema)(n,u))&&!n.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((u,c)=>{let l=e.subschema({keyword:o,schemaProp:c,compositeRule:!0},a);t.assign(s,(0,Ee._)`${s} || ${a}`),e.mergeValidEvaluated(l,a)||t.if((0,Ee.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}me.validateUnion=Cee});var Q4=w(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.validateKeywordUsage=Dr.validSchemaType=Dr.funcKeywordCode=Dr.macroKeywordCode=void 0;var bt=X(),Ko=hn(),Aee=rr(),Nee=Tu();function Dee(e,t){let{gen:r,keyword:o,schema:n,parentSchema:i,it:s}=e,a=t.macro.call(s.self,n,i,s),u=X4(r,o,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let c=r.name("valid");e.subschema({schema:a,schemaPath:bt.nil,errSchemaPath:`${s.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},c),e.pass(c,()=>e.error(!0))}Dr.macroKeywordCode=Dee;function jee(e,t){var r;let{gen:o,keyword:n,schema:i,parentSchema:s,$data:a,it:u}=e;Lee(u,t);let c=!a&&t.compile?t.compile.call(u.self,i,s,u):t.validate,l=X4(o,n,c),f=o.let("valid");e.block$data(f,h),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function h(){if(t.errors===!1)m(),t.modifying&&Y4(e),_(()=>e.error());else{let v=t.async?p():g();t.modifying&&Y4(e),_(()=>Uee(e,v))}}function p(){let v=o.let("ruleErrs",null);return o.try(()=>m((0,bt._)`await `),S=>o.assign(f,!1).if((0,bt._)`${S} instanceof ${u.ValidationError}`,()=>o.assign(v,(0,bt._)`${S}.errors`),()=>o.throw(S))),v}function g(){let v=(0,bt._)`${l}.errors`;return o.assign(v,null),m(bt.nil),v}function m(v=t.async?(0,bt._)`await `:bt.nil){let S=u.opts.passContext?Ko.default.this:Ko.default.self,k=!("compile"in t&&!a||t.schema===!1);o.assign(f,(0,bt._)`${v}${(0,Aee.callValidateCode)(e,l,S,k)}`,t.modifying)}function _(v){var S;o.if((0,bt.not)((S=t.valid)!==null&&S!==void 0?S:f),v)}}Dr.funcKeywordCode=jee;function Y4(e){let{gen:t,data:r,it:o}=e;t.if(o.parentData,()=>t.assign(r,(0,bt._)`${o.parentData}[${o.parentDataProperty}]`))}function Uee(e,t){let{gen:r}=e;r.if((0,bt._)`Array.isArray(${t})`,()=>{r.assign(Ko.default.vErrors,(0,bt._)`${Ko.default.vErrors} === null ? ${t} : ${Ko.default.vErrors}.concat(${t})`).assign(Ko.default.errors,(0,bt._)`${Ko.default.vErrors}.length`),(0,Nee.extendErrors)(e)},()=>e.error())}function Lee({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function X4(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,bt.stringify)(r)})}function Mee(e,t,r=!1){return!t.length||t.some(o=>o==="array"?Array.isArray(e):o==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==o||r&&typeof e>"u")}Dr.validSchemaType=Mee;function Zee({schema:e,opts:t,self:r,errSchemaPath:o},n,i){if(Array.isArray(n.keyword)?!n.keyword.includes(i):n.keyword!==i)throw new Error("ajv implementation error");let s=n.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(n.validateSchema&&!n.validateSchema(e[i])){let u=`keyword "${i}" value is invalid at path "${o}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}Dr.validateKeywordUsage=Zee});var t2=w(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.extendSubschemaMode=no.extendSubschemaData=no.getSubschema=void 0;var jr=X(),e2=oe();function Fee(e,{keyword:t,schemaProp:r,schema:o,schemaPath:n,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,jr._)`${e.schemaPath}${(0,jr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,jr._)`${e.schemaPath}${(0,jr.getProperty)(t)}${(0,jr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,e2.escapeFragment)(r)}`}}if(o!==void 0){if(n===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:n,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}no.getSubschema=Fee;function qee(e,t,{dataProp:r,dataPropType:o,data:n,dataTypes:i,propertyName:s}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:c,dataPathArr:l,opts:f}=t,h=a.let("data",(0,jr._)`${t.data}${(0,jr.getProperty)(r)}`,!0);u(h),e.errorPath=(0,jr.str)`${c}${(0,e2.getErrorPath)(r,o,f.jsPropertySyntax)}`,e.parentDataProperty=(0,jr._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(n!==void 0){let c=n instanceof jr.Name?n:a.let("data",n,!0);u(c),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function u(c){e.data=c,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,c]}}no.extendSubschemaData=qee;function Bee(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:o,createErrors:n,allErrors:i}){o!==void 0&&(e.compositeRule=o),n!==void 0&&(e.createErrors=n),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}no.extendSubschemaMode=Bee});var KS=w((Cxe,r2)=>{"use strict";r2.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var s=i[n];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var o2=w((Axe,n2)=>{"use strict";var oo=n2.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var o=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};dh(t,o,n,e,"",e)};oo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};oo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};oo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};oo.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function dh(e,t,r,o,n,i,s,a,u,c){if(o&&typeof o=="object"&&!Array.isArray(o)){t(o,n,i,s,a,u,c);for(var l in o){var f=o[l];if(Array.isArray(f)){if(l in oo.arrayKeywords)for(var h=0;h<f.length;h++)dh(e,t,r,f[h],n+"/"+l+"/"+h,i,n,l,o,h)}else if(l in oo.propsKeywords){if(f&&typeof f=="object")for(var p in f)dh(e,t,r,f[p],n+"/"+l+"/"+Vee(p),i,n,l,o,p)}else(l in oo.keywords||e.allKeys&&!(l in oo.skipKeywords))&&dh(e,t,r,f,n+"/"+l,i,n,l,o)}r(o,n,i,s,a,u,c)}}function Vee(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Pu=w(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.getSchemaRefs=It.resolveUrl=It.normalizeId=It._getFullPath=It.getFullPath=It.inlineRef=void 0;var Wee=oe(),Hee=KS(),Jee=o2(),Gee=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Kee(e,t=!0){return typeof e=="boolean"?!0:t===!0?!YS(e):t?i2(e)<=t:!1}It.inlineRef=Kee;var Yee=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function YS(e){for(let t in e){if(Yee.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(YS)||typeof r=="object"&&YS(r))return!0}return!1}function i2(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Gee.has(r)&&(typeof e[r]=="object"&&(0,Wee.eachItem)(e[r],o=>t+=i2(o)),t===1/0))return 1/0}return t}function s2(e,t="",r){r!==!1&&(t=Ys(t));let o=e.parse(t);return a2(e,o)}It.getFullPath=s2;function a2(e,t){return e.serialize(t).split("#")[0]+"#"}It._getFullPath=a2;var Xee=/#\/?$/;function Ys(e){return e?e.replace(Xee,""):""}It.normalizeId=Ys;function Qee(e,t,r){return r=Ys(r),e.resolve(t,r)}It.resolveUrl=Qee;var ete=/^[a-z_][-a-z0-9._]*$/i;function tte(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:o}=this.opts,n=Ys(e[r]||t),i={"":n},s=s2(o,n,!1),a={},u=new Set;return Jee(e,{allKeys:!0},(f,h,p,g)=>{if(g===void 0)return;let m=s+h,_=i[g];typeof f[r]=="string"&&(_=v.call(this,f[r])),S.call(this,f.$anchor),S.call(this,f.$dynamicAnchor),i[h]=_;function v(k){let b=this.opts.uriResolver.resolve;if(k=Ys(_?b(_,k):k),u.has(k))throw l(k);u.add(k);let x=this.refs[k];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?c(f,x.schema,k):k!==Ys(m)&&(k[0]==="#"?(c(f,a[k],k),a[k]=f):this.refs[k]=m),k}function S(k){if(typeof k=="string"){if(!ete.test(k))throw new Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),a;function c(f,h,p){if(h!==void 0&&!Hee(f,h))throw l(p)}function l(f){return new Error(`reference "${f}" resolves to more than one schema`)}}It.getSchemaRefs=tte});var Cu=w(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.getData=io.KeywordCxt=io.validateFunctionCode=void 0;var f2=Z4(),c2=Iu(),QS=qS(),fh=Iu(),rte=J4(),Ru=Q4(),XS=t2(),Z=X(),H=hn(),nte=Pu(),mn=oe(),Ou=Tu();function ote(e){if(m2(e)&&(g2(e),h2(e))){ate(e);return}p2(e,()=>(0,f2.topBoolOrEmptySchema)(e))}io.validateFunctionCode=ote;function p2({gen:e,validateName:t,schema:r,schemaEnv:o,opts:n},i){n.code.es5?e.func(t,(0,Z._)`${H.default.data}, ${H.default.valCxt}`,o.$async,()=>{e.code((0,Z._)`"use strict"; ${u2(r,n)}`),ste(e,n),e.code(i)}):e.func(t,(0,Z._)`${H.default.data}, ${ite(n)}`,o.$async,()=>e.code(u2(r,n)).code(i))}function ite(e){return(0,Z._)`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?(0,Z._)`, ${H.default.dynamicAnchors}={}`:Z.nil}}={}`}function ste(e,t){e.if(H.default.valCxt,()=>{e.var(H.default.instancePath,(0,Z._)`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,(0,Z._)`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,(0,Z._)`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,(0,Z._)`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef&&e.var(H.default.dynamicAnchors,(0,Z._)`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{e.var(H.default.instancePath,(0,Z._)`""`),e.var(H.default.parentData,(0,Z._)`undefined`),e.var(H.default.parentDataProperty,(0,Z._)`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef&&e.var(H.default.dynamicAnchors,(0,Z._)`{}`)})}function ate(e){let{schema:t,opts:r,gen:o}=e;p2(e,()=>{r.$comment&&t.$comment&&v2(e),fte(e),o.let(H.default.vErrors,null),o.let(H.default.errors,0),r.unevaluated&&cte(e),_2(e),mte(e)})}function cte(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Z._)`${r}.evaluated`),t.if((0,Z._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,Z._)`${e.evaluated}.props`,(0,Z._)`undefined`)),t.if((0,Z._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,Z._)`${e.evaluated}.items`,(0,Z._)`undefined`))}function u2(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Z._)`/*# sourceURL=${r} */`:Z.nil}function ute(e,t){if(m2(e)&&(g2(e),h2(e))){lte(e,t);return}(0,f2.boolOrEmptySchema)(e,t)}function h2({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function m2(e){return typeof e.schema!="boolean"}function lte(e,t){let{schema:r,gen:o,opts:n}=e;n.$comment&&r.$comment&&v2(e),pte(e),hte(e);let i=o.const("_errs",H.default.errors);_2(e,i),o.var(t,(0,Z._)`${i} === ${H.default.errors}`)}function g2(e){(0,mn.checkUnknownRules)(e),dte(e)}function _2(e,t){if(e.opts.jtd)return l2(e,[],!1,t);let r=(0,c2.getSchemaTypes)(e.schema),o=(0,c2.coerceAndCheckDataType)(e,r);l2(e,r,!o,t)}function dte(e){let{schema:t,errSchemaPath:r,opts:o,self:n}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,mn.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function fte(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,mn.checkStrictMode)(e,"default is ignored in the schema root")}function pte(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,nte.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function hte(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function v2({gen:e,schemaEnv:t,schema:r,errSchemaPath:o,opts:n}){let i=r.$comment;if(n.$comment===!0)e.code((0,Z._)`${H.default.self}.logger.log(${i})`);else if(typeof n.$comment=="function"){let s=(0,Z.str)`${o}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,Z._)`${H.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function mte(e){let{gen:t,schemaEnv:r,validateName:o,ValidationError:n,opts:i}=e;r.$async?t.if((0,Z._)`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw((0,Z._)`new ${n}(${H.default.vErrors})`)):(t.assign((0,Z._)`${o}.errors`,H.default.vErrors),i.unevaluated&>e(e),t.return((0,Z._)`${H.default.errors} === 0`))}function gte({gen:e,evaluated:t,props:r,items:o}){r instanceof Z.Name&&e.assign((0,Z._)`${t}.props`,r),o instanceof Z.Name&&e.assign((0,Z._)`${t}.items`,o)}function l2(e,t,r,o){let{gen:n,schema:i,data:s,allErrors:a,opts:u,self:c}=e,{RULES:l}=c;if(i.$ref&&(u.ignoreKeywordsWithRef||!(0,mn.schemaHasRulesButRef)(i,l))){n.block(()=>b2(e,"$ref",l.all.$ref.definition));return}u.jtd||_te(e,t),n.block(()=>{for(let h of l.rules)f(h);f(l.post)});function f(h){(0,QS.shouldUseGroup)(i,h)&&(h.type?(n.if((0,fh.checkDataType)(h.type,s,u.strictNumbers)),d2(e,h),t.length===1&&t[0]===h.type&&r&&(n.else(),(0,fh.reportTypeError)(e)),n.endIf()):d2(e,h),a||n.if((0,Z._)`${H.default.errors} === ${o||0}`))}}function d2(e,t){let{gen:r,schema:o,opts:{useDefaults:n}}=e;n&&(0,rte.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,QS.shouldUseRule)(o,i)&&b2(e,i.keyword,i.definition,t.type)})}function _te(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(vte(e,t),e.opts.allowUnionTypes||yte(e,t),bte(e,e.dataTypes))}function vte(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{y2(e.dataTypes,r)||e$(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),wte(e,t)}}function yte(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&e$(e,"use allowUnionTypes to allow union type keyword")}function bte(e,t){let r=e.self.RULES.all;for(let o in r){let n=r[o];if(typeof n=="object"&&(0,QS.shouldUseRule)(e.schema,n)){let{type:i}=n.definition;i.length&&!i.some(s=>xte(t,s))&&e$(e,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function xte(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function y2(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function wte(e,t){let r=[];for(let o of e.dataTypes)y2(t,o)?r.push(o):t.includes("integer")&&o==="number"&&r.push("integer");e.dataTypes=r}function e$(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,mn.checkStrictMode)(e,t,e.opts.strictTypes)}var ph=class{constructor(t,r,o){if((0,Ru.validateKeywordUsage)(t,r,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,mn.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",x2(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ru.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",H.default.errors))}result(t,r,o){this.failResult((0,Z.not)(t),r,o)}failResult(t,r,o){this.gen.if(t),o?o():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,Z.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,Z._)`${r} !== undefined && (${(0,Z.or)(this.invalid$data(),t)})`)}error(t,r,o){if(r){this.setParams(r),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,r){(t?Ou.reportExtraError:Ou.reportError)(this,this.def.error,r)}$dataError(){(0,Ou.reportError)(this,this.def.$dataError||Ou.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ou.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,o=Z.nil){this.gen.block(()=>{this.check$data(t,o),r()})}check$data(t=Z.nil,r=Z.nil){if(!this.$data)return;let{gen:o,schemaCode:n,schemaType:i,def:s}=this;o.if((0,Z.or)((0,Z._)`${n} === undefined`,r)),t!==Z.nil&&o.assign(t,!0),(i.length||s.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),t!==Z.nil&&o.assign(t,!1)),o.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:o,def:n,it:i}=this;return(0,Z.or)(s(),a());function s(){if(o.length){if(!(r instanceof Z.Name))throw new Error("ajv implementation error");let u=Array.isArray(o)?o:[o];return(0,Z._)`${(0,fh.checkDataTypes)(u,r,i.opts.strictNumbers,fh.DataType.Wrong)}`}return Z.nil}function a(){if(n.validateSchema){let u=t.scopeValue("validate$data",{ref:n.validateSchema});return(0,Z._)`!${u}(${r})`}return Z.nil}}subschema(t,r){let o=(0,XS.getSubschema)(this.it,t);(0,XS.extendSubschemaData)(o,this.it,t),(0,XS.extendSubschemaMode)(o,t);let n={...this.it,...o,items:void 0,props:void 0};return ute(n,r),n}mergeEvaluated(t,r){let{it:o,gen:n}=this;o.opts.unevaluated&&(o.props!==!0&&t.props!==void 0&&(o.props=mn.mergeEvaluated.props(n,t.props,o.props,r)),o.items!==!0&&t.items!==void 0&&(o.items=mn.mergeEvaluated.items(n,t.items,o.items,r)))}mergeValidEvaluated(t,r){let{it:o,gen:n}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return n.if(r,()=>this.mergeEvaluated(t,Z.Name)),!0}};io.KeywordCxt=ph;function b2(e,t,r,o){let n=new ph(e,r,t);"code"in r?r.code(n,o):n.$data&&r.validate?(0,Ru.funcKeywordCode)(n,r):"macro"in r?(0,Ru.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Ru.funcKeywordCode)(n,r)}var Ste=/^\/(?:[^~]|~0|~1)*$/,$te=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x2(e,{dataLevel:t,dataNames:r,dataPathArr:o}){let n,i;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!Ste.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,i=H.default.rootData}else{let c=$te.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+c[1];if(n=c[2],n==="#"){if(l>=t)throw new Error(u("property/index",l));return o[t-l]}if(l>t)throw new Error(u("data",l));if(i=r[t-l],!n)return i}let s=i,a=n.split("/");for(let c of a)c&&(i=(0,Z._)`${i}${(0,Z.getProperty)((0,mn.unescapeJsonPointer)(c))}`,s=(0,Z._)`${s} && ${i}`);return s;function u(c,l){return`Cannot access ${c} ${l} levels up, current level is ${t}`}}io.getData=x2});var hh=w(r$=>{"use strict";Object.defineProperty(r$,"__esModule",{value:!0});var t$=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};r$.default=t$});var Au=w(i$=>{"use strict";Object.defineProperty(i$,"__esModule",{value:!0});var n$=Pu(),o$=class extends Error{constructor(t,r,o,n){super(n||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,n$.resolveUrl)(t,r,o),this.missingSchema=(0,n$.normalizeId)((0,n$.getFullPath)(t,this.missingRef))}};i$.default=o$});var gh=w(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.resolveSchema=nr.getCompilingSchema=nr.resolveRef=nr.compileSchema=nr.SchemaEnv=void 0;var vr=X(),kte=hh(),Yo=hn(),yr=Pu(),w2=oe(),Ete=Cu(),Xs=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let o;typeof t.schema=="object"&&(o=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,yr.normalizeId)(o?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o?.$async,this.refs={}}};nr.SchemaEnv=Xs;function a$(e){let t=S2.call(this,e);if(t)return t;let r=(0,yr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:i}=this.opts,s=new vr.CodeGen(this.scope,{es5:o,lines:n,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:kte.default,code:(0,vr._)`require("ajv/dist/runtime/validation_error").default`}));let u=s.scopeName("validate");e.validateName=u;let c={gen:s,allErrors:this.opts.allErrors,data:Yo.default.data,parentData:Yo.default.parentData,parentDataProperty:Yo.default.parentDataProperty,dataNames:[Yo.default.data],dataPathArr:[vr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,vr.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:vr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,vr._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,Ete.validateFunctionCode)(c),s.optimize(this.opts.code.optimize);let f=s.toString();l=`${s.scopeRefs(Yo.default.scope)}return ${f}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let p=new Function(`${Yo.default.self}`,`${Yo.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:u,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){let{props:g,items:m}=c;p.evaluated={props:g instanceof vr.Name?void 0:g,items:m instanceof vr.Name?void 0:m,dynamicProps:g instanceof vr.Name,dynamicItems:m instanceof vr.Name},p.source&&(p.source.evaluated=(0,vr.stringify)(p.evaluated))}return e.validate=p,e}catch(f){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),f}finally{this._compilations.delete(e)}}nr.compileSchema=a$;function zte(e,t,r){var o;r=(0,yr.resolveUrl)(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let i=Pte.call(this,e,r);if(i===void 0){let s=(o=e.localRefs)===null||o===void 0?void 0:o[r],{schemaId:a}=this.opts;s&&(i=new Xs({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Tte.call(this,i)}nr.resolveRef=zte;function Tte(e){return(0,yr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:a$.call(this,e)}function S2(e){for(let t of this._compilations)if(Ite(t,e))return t}nr.getCompilingSchema=S2;function Ite(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Pte(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||mh.call(this,e,t)}function mh(e,t){let r=this.opts.uriResolver.parse(t),o=(0,yr._getFullPath)(this.opts.uriResolver,r),n=(0,yr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===n)return s$.call(this,r,e);let i=(0,yr.normalizeId)(o),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=mh.call(this,e,s);return typeof a?.schema!="object"?void 0:s$.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||a$.call(this,s),i===(0,yr.normalizeId)(t)){let{schema:a}=s,{schemaId:u}=this.opts,c=a[u];return c&&(n=(0,yr.resolveUrl)(this.opts.uriResolver,n,c)),new Xs({schema:a,schemaId:u,root:e,baseId:n})}return s$.call(this,r,s)}}nr.resolveSchema=mh;var Ote=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function s$(e,{baseId:t,schema:r,root:o}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,w2.unescapeFragment)(a)];if(u===void 0)return;r=u;let c=typeof r=="object"&&r[this.opts.schemaId];!Ote.has(a)&&c&&(t=(0,yr.resolveUrl)(this.opts.uriResolver,t,c))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,w2.schemaHasRulesButRef)(r,this.RULES)){let a=(0,yr.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=mh.call(this,o,a)}let{schemaId:s}=this.opts;if(i=i||new Xs({schema:r,schemaId:s,root:o,baseId:t}),i.schema!==i.root.schema)return i}});var $2=w((Mxe,Rte)=>{Rte.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var u$=w((Zxe,T2)=>{"use strict";var Cte=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),E2=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function c$(e){let t="",r=0,o=0;for(o=0;o<e.length;o++)if(r=e[o].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o];break}for(o+=1;o<e.length;o++){if(r=e[o].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[o]}return t}var Ate=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function k2(e){return e.length=0,!0}function Nte(e,t,r){if(e.length){let o=c$(e);if(o!=="")t.push(o);else return r.error=!0,!1;e.length=0}return!0}function Dte(e){let t=0,r={error:!1,address:"",zone:""},o=[],n=[],i=!1,s=!1,a=Nte;for(let u=0;u<e.length;u++){let c=e[u];if(!(c==="["||c==="]"))if(c===":"){if(i===!0&&(s=!0),!a(n,o,r))break;if(++t>7){r.error=!0;break}u>0&&e[u-1]===":"&&(i=!0),o.push(":");continue}else if(c==="%"){if(!a(n,o,r))break;a=k2}else{n.push(c);continue}}return n.length&&(a===k2?r.zone=n.join(""):s?o.push(n.join("")):o.push(c$(n))),r.address=o.join(""),r}function z2(e){if(jte(e,":")<2)return{host:e,isIPV6:!1};let t=Dte(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,o=t.address;return t.zone&&(r+="%"+t.zone,o+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:o}}}function jte(e,t){let r=0;for(let o=0;o<e.length;o++)e[o]===t&&r++;return r}function Ute(e){let t=e,r=[],o=-1,n=0;for(;n=t.length;){if(n===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(n===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(n===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((o=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,o)),t=t.slice(o)}return r.join("")}function Lte(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function Mte(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!E2(r)){let o=z2(r);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}T2.exports={nonSimpleDomain:Ate,recomposeAuthority:Mte,normalizeComponentEncoding:Lte,removeDotSegments:Ute,isIPv4:E2,isUUID:Cte,normalizeIPv6:z2,stringArrayToHexStripped:c$}});var C2=w((Fxe,R2)=>{"use strict";var{isUUID:Zte}=u$(),Fte=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,qte=["http","https","ws","wss","urn","urn:uuid"];function Bte(e){return qte.indexOf(e)!==-1}function l$(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function I2(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function P2(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function Vte(e){return e.secure=l$(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Wte(e){if((e.port===(l$(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function Hte(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Fte);if(r){let o=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${o}:${t.nid||e.nid}`,i=d$(n);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Jte(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),n=`${r}:${t.nid||o}`,i=d$(n);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${o||t.nid}:${a}`,t.skipEscape=!0,s}function Gte(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Zte(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Kte(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var O2={scheme:"http",domainHost:!0,parse:I2,serialize:P2},Yte={scheme:"https",domainHost:O2.domainHost,parse:I2,serialize:P2},_h={scheme:"ws",domainHost:!0,parse:Vte,serialize:Wte},Xte={scheme:"wss",domainHost:_h.domainHost,parse:_h.parse,serialize:_h.serialize},Qte={scheme:"urn",parse:Hte,serialize:Jte,skipNormalize:!0},ere={scheme:"urn:uuid",parse:Gte,serialize:Kte,skipNormalize:!0},vh={http:O2,https:Yte,ws:_h,wss:Xte,urn:Qte,"urn:uuid":ere};Object.setPrototypeOf(vh,null);function d$(e){return e&&(vh[e]||vh[e.toLowerCase()])||void 0}R2.exports={wsIsSecure:l$,SCHEMES:vh,isValidSchemeName:Bte,getSchemeHandler:d$}});var D2=w((qxe,bh)=>{"use strict";var{normalizeIPv6:tre,removeDotSegments:Nu,recomposeAuthority:rre,normalizeComponentEncoding:yh,isIPv4:nre,nonSimpleDomain:ore}=u$(),{SCHEMES:ire,getSchemeHandler:A2}=C2();function sre(e,t){return typeof e=="string"?e=Ur(gn(e,t),t):typeof e=="object"&&(e=gn(Ur(e,t),t)),e}function are(e,t,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=N2(gn(e,o),gn(t,o),o,!0);return o.skipEscape=!0,Ur(n,o)}function N2(e,t,r,o){let n={};return o||(e=gn(Ur(e,r),r),t=gn(Ur(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=Nu(t.path||""),n.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=Nu(t.path||""),n.query=t.query):(t.path?(t.path[0]==="/"?n.path=Nu(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?n.path="/"+t.path:e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path,n.path=Nu(n.path)),n.query=t.query):(n.path=e.path,t.query!==void 0?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function cre(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ur(yh(gn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ur(yh(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ur(yh(gn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ur(yh(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Ur(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},o=Object.assign({},t),n=[],i=A2(o.scheme||r.scheme);i&&i.serialize&&i.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let s=rre(r);if(s!==void 0&&(o.reference!=="suffix"&&n.push("//"),n.push(s),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!o.absolutePath&&(!i||!i.absolutePath)&&(a=Nu(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var ure=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gn(e,t){let r=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let i=e.match(ure);if(i){if(o.scheme=i[1],o.userinfo=i[3],o.host=i[4],o.port=parseInt(i[5],10),o.path=i[6]||"",o.query=i[7],o.fragment=i[8],isNaN(o.port)&&(o.port=i[5]),o.host)if(nre(o.host)===!1){let u=tre(o.host);o.host=u.host.toLowerCase(),n=u.isIPV6}else n=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");let s=A2(r.scheme||o.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&o.host&&(r.domainHost||s&&s.domainHost)&&n===!1&&ore(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(a){o.error=o.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),s&&s.parse&&s.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}var f$={SCHEMES:ire,normalize:sre,resolve:are,resolveComponent:N2,equal:cre,serialize:Ur,parse:gn};bh.exports=f$;bh.exports.default=f$;bh.exports.fastUri=f$});var U2=w(p$=>{"use strict";Object.defineProperty(p$,"__esModule",{value:!0});var j2=D2();j2.code='require("ajv/dist/runtime/uri").default';p$.default=j2});var W2=w(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.CodeGen=rt.Name=rt.nil=rt.stringify=rt.str=rt._=rt.KeywordCxt=void 0;var lre=Cu();Object.defineProperty(rt,"KeywordCxt",{enumerable:!0,get:function(){return lre.KeywordCxt}});var Qs=X();Object.defineProperty(rt,"_",{enumerable:!0,get:function(){return Qs._}});Object.defineProperty(rt,"str",{enumerable:!0,get:function(){return Qs.str}});Object.defineProperty(rt,"stringify",{enumerable:!0,get:function(){return Qs.stringify}});Object.defineProperty(rt,"nil",{enumerable:!0,get:function(){return Qs.nil}});Object.defineProperty(rt,"Name",{enumerable:!0,get:function(){return Qs.Name}});Object.defineProperty(rt,"CodeGen",{enumerable:!0,get:function(){return Qs.CodeGen}});var dre=hh(),q2=Au(),fre=FS(),Du=gh(),pre=X(),ju=Pu(),xh=Iu(),m$=oe(),L2=$2(),hre=U2(),B2=(e,t)=>new RegExp(e,t);B2.code="new RegExp";var mre=["removeAdditional","useDefaults","coerceTypes"],gre=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_re={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},vre={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},M2=200;function yre(e){var t,r,o,n,i,s,a,u,c,l,f,h,p,g,m,_,v,S,k,b,x,T,C,D,M;let G=e.strict,U=(t=e.code)===null||t===void 0?void 0:t.optimize,De=U===!0||U===void 0?1:U||0,we=(o=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&o!==void 0?o:B2,fi=(n=e.uriResolver)!==null&&n!==void 0?n:hre.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:G)!==null&&s!==void 0?s:!0,strictNumbers:(u=(a=e.strictNumbers)!==null&&a!==void 0?a:G)!==null&&u!==void 0?u:!0,strictTypes:(l=(c=e.strictTypes)!==null&&c!==void 0?c:G)!==null&&l!==void 0?l:"log",strictTuples:(h=(f=e.strictTuples)!==null&&f!==void 0?f:G)!==null&&h!==void 0?h:"log",strictRequired:(g=(p=e.strictRequired)!==null&&p!==void 0?p:G)!==null&&g!==void 0?g:!1,code:e.code?{...e.code,optimize:De,regExp:we}:{optimize:De,regExp:we},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:M2,loopEnum:(_=e.loopEnum)!==null&&_!==void 0?_:M2,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(S=e.messages)!==null&&S!==void 0?S:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(b=e.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(x=e.addUsedSchema)!==null&&x!==void 0?x:!0,validateSchema:(T=e.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(C=e.validateFormats)!==null&&C!==void 0?C:!0,unicodeRegExp:(D=e.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(M=e.int32range)!==null&&M!==void 0?M:!0,uriResolver:fi}}var Uu=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...yre(t)};let{es5:r,lines:o}=this.opts.code;this.scope=new pre.ValueScope({scope:{},prefixes:gre,es5:r,lines:o}),this.logger=kre(t.logger);let n=t.validateFormats;t.validateFormats=!1,this.RULES=(0,fre.getRules)(),Z2.call(this,_re,t,"NOT SUPPORTED"),Z2.call(this,vre,t,"DEPRECATED","warn"),this._metaOpts=Sre.call(this),t.formats&&xre.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&wre.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),bre.call(this),t.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:o}=this.opts,n=L2;o==="id"&&(n={...L2},n.id=n.$id,delete n.$id),r&&t&&this.addMetaSchema(n,n[o],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let o;if(typeof t=="string"){if(o=this.getSchema(t),!o)throw new Error(`no schema with key or ref "${t}"`)}else o=this.compile(t);let n=o(r);return"$async"in o||(this.errors=o.errors),n}compile(t,r){let o=this._addSchema(t,r);return o.validate||this._compileSchemaEnv(o)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return n.call(this,t,r);async function n(l,f){await i.call(this,l.$schema);let h=this._addSchema(l,f);return h.validate||s.call(this,h)}async function i(l){l&&!this.getSchema(l)&&await n.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(f){if(!(f instanceof q2.default))throw f;return a.call(this,f),await u.call(this,f.missingSchema),s.call(this,l)}}function a({missingSchema:l,missingRef:f}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${f} cannot be resolved`)}async function u(l){let f=await c.call(this,l);this.refs[l]||await i.call(this,f.$schema),this.refs[l]||this.addSchema(f,l,r)}async function c(l){let f=this._loading[l];if(f)return f;try{return await(this._loading[l]=o(l))}finally{delete this._loading[l]}}}addSchema(t,r,o,n=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,o,n);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,ju.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,o,r,n,!0),this}addMetaSchema(t,r,o=this.opts.validateSchema){return this.addSchema(t,r,!0,o),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let o;if(o=t.$schema,o!==void 0&&typeof o!="string")throw new Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(o,t);if(!n&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return n}getSchema(t){let r;for(;typeof(r=F2.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:o}=this.opts,n=new Du.SchemaEnv({schema:{},schemaId:o});if(r=Du.resolveSchema.call(this,n,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=F2.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let o=t[this.opts.schemaId];return o&&(o=(0,ju.normalizeId)(o),delete this.schemas[o],delete this.refs[o]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let o;if(typeof t=="string")o=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=o);else if(typeof t=="object"&&r===void 0){if(r=t,o=r.keyword,Array.isArray(o)&&!o.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(zre.call(this,o,r),!r)return(0,m$.eachItem)(o,i=>h$.call(this,i)),this;Ire.call(this,r);let n={...r,type:(0,xh.getJSONTypes)(r.type),schemaType:(0,xh.getJSONTypes)(r.schemaType)};return(0,m$.eachItem)(o,n.type.length===0?i=>h$.call(this,i,n):i=>n.type.forEach(s=>h$.call(this,i,n,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let o of r.rules){let n=o.rules.findIndex(i=>i.keyword===t);n>=0&&o.rules.splice(n,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:o="data"}={}){return!t||t.length===0?"No errors":t.map(n=>`${o}${n.instancePath} ${n.message}`).reduce((n,i)=>n+r+i)}$dataMetaSchema(t,r){let o=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let n of r){let i=n.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in o){let u=o[a];if(typeof u!="object")continue;let{$data:c}=u.definition,l=s[a];c&&l&&(s[a]=V2(l))}}return t}_removeAllSchemas(t,r){for(let o in t){let n=t[o];(!r||r.test(o))&&(typeof n=="string"?delete t[o]:n&&!n.meta&&(this._cache.delete(n.schema),delete t[o]))}}_addSchema(t,r,o,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;o=(0,ju.normalizeId)(s||o);let c=ju.getSchemaRefs.call(this,t,o);return u=new Du.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:o,localRefs:c}),this._cache.set(u.schema,u),i&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=u),n&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Du.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Du.compileSchema.call(this,t)}finally{this.opts=r}}};Uu.ValidationError=dre.default;Uu.MissingRefError=q2.default;rt.default=Uu;function Z2(e,t,r,o="error"){for(let n in e){let i=n;i in t&&this.logger[o](`${r}: option ${n}. ${e[i]}`)}}function F2(e){return e=(0,ju.normalizeId)(e),this.schemas[e]||this.refs[e]}function bre(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function xre(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function wre(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function Sre(){let e={...this.opts};for(let t of mre)delete e[t];return e}var $re={log(){},warn(){},error(){}};function kre(e){if(e===!1)return $re;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var Ere=/^[a-z_$][a-z0-9_$:-]*$/i;function zre(e,t){let{RULES:r}=this;if((0,m$.eachItem)(e,o=>{if(r.keywords[o])throw new Error(`Keyword ${o} is already defined`);if(!Ere.test(o))throw new Error(`Keyword ${o} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function h$(e,t,r){var o;let n=t?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=n?i.post:i.rules.find(({type:u})=>u===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,xh.getJSONTypes)(t.type),schemaType:(0,xh.getJSONTypes)(t.schemaType)}};t.before?Tre.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(o=t.implements)===null||o===void 0||o.forEach(u=>this.addKeyword(u))}function Tre(e,t,r){let o=e.rules.findIndex(n=>n.keyword===r);o>=0?e.rules.splice(o,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function Ire(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=V2(t)),e.validateSchema=this.compile(t,!0))}var Pre={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function V2(e){return{anyOf:[e,Pre]}}});var H2=w(g$=>{"use strict";Object.defineProperty(g$,"__esModule",{value:!0});var Ore={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};g$.default=Ore});var Y2=w(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.callRef=Xo.getValidate=void 0;var Rre=Au(),J2=rr(),Pt=X(),ea=hn(),G2=gh(),wh=oe(),Cre={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:o}=e,{baseId:n,schemaEnv:i,validateName:s,opts:a,self:u}=o,{root:c}=i;if((r==="#"||r==="#/")&&n===c.baseId)return f();let l=G2.resolveRef.call(u,c,n,r);if(l===void 0)throw new Rre.default(o.opts.uriResolver,n,r);if(l instanceof G2.SchemaEnv)return h(l);return p(l);function f(){if(i===c)return Sh(e,s,i,i.$async);let g=t.scopeValue("root",{ref:c});return Sh(e,(0,Pt._)`${g}.validate`,c,c.$async)}function h(g){let m=K2(e,g);Sh(e,m,g,g.$async)}function p(g){let m=t.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,Pt.stringify)(g)}:{ref:g}),_=t.name("valid"),v=e.subschema({schema:g,dataTypes:[],schemaPath:Pt.nil,topSchemaRef:m,errSchemaPath:r},_);e.mergeEvaluated(v),e.ok(_)}}};function K2(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Pt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Xo.getValidate=K2;function Sh(e,t,r,o){let{gen:n,it:i}=e,{allErrors:s,schemaEnv:a,opts:u}=i,c=u.passContext?ea.default.this:Pt.nil;o?l():f();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let g=n.let("valid");n.try(()=>{n.code((0,Pt._)`await ${(0,J2.callValidateCode)(e,t,c)}`),p(t),s||n.assign(g,!0)},m=>{n.if((0,Pt._)`!(${m} instanceof ${i.ValidationError})`,()=>n.throw(m)),h(m),s||n.assign(g,!1)}),e.ok(g)}function f(){e.result((0,J2.callValidateCode)(e,t,c),()=>p(t),()=>h(t))}function h(g){let m=(0,Pt._)`${g}.errors`;n.assign(ea.default.vErrors,(0,Pt._)`${ea.default.vErrors} === null ? ${m} : ${ea.default.vErrors}.concat(${m})`),n.assign(ea.default.errors,(0,Pt._)`${ea.default.vErrors}.length`)}function p(g){var m;if(!i.opts.unevaluated)return;let _=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=wh.mergeEvaluated.props(n,_.props,i.props));else{let v=n.var("props",(0,Pt._)`${g}.evaluated.props`);i.props=wh.mergeEvaluated.props(n,v,i.props,Pt.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=wh.mergeEvaluated.items(n,_.items,i.items));else{let v=n.var("items",(0,Pt._)`${g}.evaluated.items`);i.items=wh.mergeEvaluated.items(n,v,i.items,Pt.Name)}}}Xo.callRef=Sh;Xo.default=Cre});var X2=w(_$=>{"use strict";Object.defineProperty(_$,"__esModule",{value:!0});var Are=H2(),Nre=Y2(),Dre=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Are.default,Nre.default];_$.default=Dre});var Q2=w(v$=>{"use strict";Object.defineProperty(v$,"__esModule",{value:!0});var $h=X(),so=$h.operators,kh={maximum:{okStr:"<=",ok:so.LTE,fail:so.GT},minimum:{okStr:">=",ok:so.GTE,fail:so.LT},exclusiveMaximum:{okStr:"<",ok:so.LT,fail:so.GTE},exclusiveMinimum:{okStr:">",ok:so.GT,fail:so.LTE}},jre={message:({keyword:e,schemaCode:t})=>(0,$h.str)`must be ${kh[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,$h._)`{comparison: ${kh[e].okStr}, limit: ${t}}`},Ure={keyword:Object.keys(kh),type:"number",schemaType:"number",$data:!0,error:jre,code(e){let{keyword:t,data:r,schemaCode:o}=e;e.fail$data((0,$h._)`${r} ${kh[t].fail} ${o} || isNaN(${r})`)}};v$.default=Ure});var eL=w(y$=>{"use strict";Object.defineProperty(y$,"__esModule",{value:!0});var Lu=X(),Lre={message:({schemaCode:e})=>(0,Lu.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Lu._)`{multipleOf: ${e}}`},Mre={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Lre,code(e){let{gen:t,data:r,schemaCode:o,it:n}=e,i=n.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Lu._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Lu._)`${s} !== parseInt(${s})`;e.fail$data((0,Lu._)`(${o} === 0 || (${s} = ${r}/${o}, ${a}))`)}};y$.default=Mre});var rL=w(b$=>{"use strict";Object.defineProperty(b$,"__esModule",{value:!0});function tL(e){let t=e.length,r=0,o=0,n;for(;o<t;)r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),(n&64512)===56320&&o++);return r}b$.default=tL;tL.code='require("ajv/dist/runtime/ucs2length").default'});var nL=w(x$=>{"use strict";Object.defineProperty(x$,"__esModule",{value:!0});var Qo=X(),Zre=oe(),Fre=rL(),qre={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Qo.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Qo._)`{limit: ${e}}`},Bre={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qre,code(e){let{keyword:t,data:r,schemaCode:o,it:n}=e,i=t==="maxLength"?Qo.operators.GT:Qo.operators.LT,s=n.opts.unicode===!1?(0,Qo._)`${r}.length`:(0,Qo._)`${(0,Zre.useFunc)(e.gen,Fre.default)}(${r})`;e.fail$data((0,Qo._)`${s} ${i} ${o}`)}};x$.default=Bre});var oL=w(w$=>{"use strict";Object.defineProperty(w$,"__esModule",{value:!0});var Vre=rr(),Wre=oe(),ta=X(),Hre={message:({schemaCode:e})=>(0,ta.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ta._)`{pattern: ${e}}`},Jre={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Hre,code(e){let{gen:t,data:r,$data:o,schema:n,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(o){let{regExp:u}=s.opts.code,c=u.code==="new RegExp"?(0,ta._)`new RegExp`:(0,Wre.useFunc)(t,u),l=t.let("valid");t.try(()=>t.assign(l,(0,ta._)`${c}(${i}, ${a}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,ta._)`!${l}`)}else{let u=(0,Vre.usePattern)(e,n);e.fail$data((0,ta._)`!${u}.test(${r})`)}}};w$.default=Jre});var iL=w(S$=>{"use strict";Object.defineProperty(S$,"__esModule",{value:!0});var Mu=X(),Gre={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Mu.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Mu._)`{limit: ${e}}`},Kre={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Gre,code(e){let{keyword:t,data:r,schemaCode:o}=e,n=t==="maxProperties"?Mu.operators.GT:Mu.operators.LT;e.fail$data((0,Mu._)`Object.keys(${r}).length ${n} ${o}`)}};S$.default=Kre});var sL=w($$=>{"use strict";Object.defineProperty($$,"__esModule",{value:!0});var Zu=rr(),Fu=X(),Yre=oe(),Xre={message:({params:{missingProperty:e}})=>(0,Fu.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Fu._)`{missingProperty: ${e}}`},Qre={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Xre,code(e){let{gen:t,schema:r,schemaCode:o,data:n,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let u=r.length>=a.loopRequired;if(s.allErrors?c():l(),a.strictRequired){let p=e.parentSchema.properties,{definedProperties:g}=e.it;for(let m of r)if(p?.[m]===void 0&&!g.has(m)){let _=s.schemaEnv.baseId+s.errSchemaPath,v=`required property "${m}" is not defined at "${_}" (strictRequired)`;(0,Yre.checkStrictMode)(s,v,s.opts.strictRequired)}}function c(){if(u||i)e.block$data(Fu.nil,f);else for(let p of r)(0,Zu.checkReportMissingProp)(e,p)}function l(){let p=t.let("missing");if(u||i){let g=t.let("valid",!0);e.block$data(g,()=>h(p,g)),e.ok(g)}else t.if((0,Zu.checkMissingProp)(e,r,p)),(0,Zu.reportMissingProp)(e,p),t.else()}function f(){t.forOf("prop",o,p=>{e.setParams({missingProperty:p}),t.if((0,Zu.noPropertyInData)(t,n,p,a.ownProperties),()=>e.error())})}function h(p,g){e.setParams({missingProperty:p}),t.forOf(p,o,()=>{t.assign(g,(0,Zu.propertyInData)(t,n,p,a.ownProperties)),t.if((0,Fu.not)(g),()=>{e.error(),t.break()})},Fu.nil)}}};$$.default=Qre});var aL=w(k$=>{"use strict";Object.defineProperty(k$,"__esModule",{value:!0});var qu=X(),ene={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,qu.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,qu._)`{limit: ${e}}`},tne={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ene,code(e){let{keyword:t,data:r,schemaCode:o}=e,n=t==="maxItems"?qu.operators.GT:qu.operators.LT;e.fail$data((0,qu._)`${r}.length ${n} ${o}`)}};k$.default=tne});var Eh=w(E$=>{"use strict";Object.defineProperty(E$,"__esModule",{value:!0});var cL=KS();cL.code='require("ajv/dist/runtime/equal").default';E$.default=cL});var uL=w(T$=>{"use strict";Object.defineProperty(T$,"__esModule",{value:!0});var z$=Iu(),nt=X(),rne=oe(),nne=Eh(),one={message:({params:{i:e,j:t}})=>(0,nt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,nt._)`{i: ${e}, j: ${t}}`},ine={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:one,code(e){let{gen:t,data:r,$data:o,schema:n,parentSchema:i,schemaCode:s,it:a}=e;if(!o&&!n)return;let u=t.let("valid"),c=i.items?(0,z$.getSchemaTypes)(i.items):[];e.block$data(u,l,(0,nt._)`${s} === false`),e.ok(u);function l(){let g=t.let("i",(0,nt._)`${r}.length`),m=t.let("j");e.setParams({i:g,j:m}),t.assign(u,!0),t.if((0,nt._)`${g} > 1`,()=>(f()?h:p)(g,m))}function f(){return c.length>0&&!c.some(g=>g==="object"||g==="array")}function h(g,m){let _=t.name("item"),v=(0,z$.checkDataTypes)(c,_,a.opts.strictNumbers,z$.DataType.Wrong),S=t.const("indices",(0,nt._)`{}`);t.for((0,nt._)`;${g}--;`,()=>{t.let(_,(0,nt._)`${r}[${g}]`),t.if(v,(0,nt._)`continue`),c.length>1&&t.if((0,nt._)`typeof ${_} == "string"`,(0,nt._)`${_} += "_"`),t.if((0,nt._)`typeof ${S}[${_}] == "number"`,()=>{t.assign(m,(0,nt._)`${S}[${_}]`),e.error(),t.assign(u,!1).break()}).code((0,nt._)`${S}[${_}] = ${g}`)})}function p(g,m){let _=(0,rne.useFunc)(t,nne.default),v=t.name("outer");t.label(v).for((0,nt._)`;${g}--;`,()=>t.for((0,nt._)`${m} = ${g}; ${m}--;`,()=>t.if((0,nt._)`${_}(${r}[${g}], ${r}[${m}])`,()=>{e.error(),t.assign(u,!1).break(v)})))}}};T$.default=ine});var lL=w(P$=>{"use strict";Object.defineProperty(P$,"__esModule",{value:!0});var I$=X(),sne=oe(),ane=Eh(),cne={message:"must be equal to constant",params:({schemaCode:e})=>(0,I$._)`{allowedValue: ${e}}`},une={keyword:"const",$data:!0,error:cne,code(e){let{gen:t,data:r,$data:o,schemaCode:n,schema:i}=e;o||i&&typeof i=="object"?e.fail$data((0,I$._)`!${(0,sne.useFunc)(t,ane.default)}(${r}, ${n})`):e.fail((0,I$._)`${i} !== ${r}`)}};P$.default=une});var dL=w(O$=>{"use strict";Object.defineProperty(O$,"__esModule",{value:!0});var Bu=X(),lne=oe(),dne=Eh(),fne={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Bu._)`{allowedValues: ${e}}`},pne={keyword:"enum",schemaType:"array",$data:!0,error:fne,code(e){let{gen:t,data:r,$data:o,schema:n,schemaCode:i,it:s}=e;if(!o&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=s.opts.loopEnum,u,c=()=>u??(u=(0,lne.useFunc)(t,dne.default)),l;if(a||o)l=t.let("valid"),e.block$data(l,f);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let p=t.const("vSchema",i);l=(0,Bu.or)(...n.map((g,m)=>h(p,m)))}e.pass(l);function f(){t.assign(l,!1),t.forOf("v",i,p=>t.if((0,Bu._)`${c()}(${r}, ${p})`,()=>t.assign(l,!0).break()))}function h(p,g){let m=n[g];return typeof m=="object"&&m!==null?(0,Bu._)`${c()}(${r}, ${p}[${g}])`:(0,Bu._)`${r} === ${m}`}}};O$.default=pne});var fL=w(R$=>{"use strict";Object.defineProperty(R$,"__esModule",{value:!0});var hne=Q2(),mne=eL(),gne=nL(),_ne=oL(),vne=iL(),yne=sL(),bne=aL(),xne=uL(),wne=lL(),Sne=dL(),$ne=[hne.default,mne.default,gne.default,_ne.default,vne.default,yne.default,bne.default,xne.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},wne.default,Sne.default];R$.default=$ne});var A$=w(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.validateAdditionalItems=void 0;var ei=X(),C$=oe(),kne={message:({params:{len:e}})=>(0,ei.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ei._)`{limit: ${e}}`},Ene={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:kne,code(e){let{parentSchema:t,it:r}=e,{items:o}=t;if(!Array.isArray(o)){(0,C$.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pL(e,o)}};function pL(e,t){let{gen:r,schema:o,data:n,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,ei._)`${n}.length`);if(o===!1)e.setParams({len:t.length}),e.pass((0,ei._)`${a} <= ${t.length}`);else if(typeof o=="object"&&!(0,C$.alwaysValidSchema)(s,o)){let c=r.var("valid",(0,ei._)`${a} <= ${t.length}`);r.if((0,ei.not)(c),()=>u(c)),e.ok(c)}function u(c){r.forRange("i",t.length,a,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:C$.Type.Num},c),s.allErrors||r.if((0,ei.not)(c),()=>r.break())})}}Vu.validateAdditionalItems=pL;Vu.default=Ene});var N$=w(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.validateTuple=void 0;var hL=X(),zh=oe(),zne=rr(),Tne={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return mL(e,"additionalItems",t);r.items=!0,!(0,zh.alwaysValidSchema)(r,t)&&e.ok((0,zne.validateArray)(e))}};function mL(e,t,r=e.schema){let{gen:o,parentSchema:n,data:i,keyword:s,it:a}=e;l(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=zh.mergeEvaluated.items(o,r.length,a.items));let u=o.name("valid"),c=o.const("len",(0,hL._)`${i}.length`);r.forEach((f,h)=>{(0,zh.alwaysValidSchema)(a,f)||(o.if((0,hL._)`${c} > ${h}`,()=>e.subschema({keyword:s,schemaProp:h,dataProp:h},u)),e.ok(u))});function l(f){let{opts:h,errSchemaPath:p}=a,g=r.length,m=g===f.minItems&&(g===f.maxItems||f[t]===!1);if(h.strictTuples&&!m){let _=`"${s}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,zh.checkStrictMode)(a,_,h.strictTuples)}}}Wu.validateTuple=mL;Wu.default=Tne});var gL=w(D$=>{"use strict";Object.defineProperty(D$,"__esModule",{value:!0});var Ine=N$(),Pne={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Ine.validateTuple)(e,"items")};D$.default=Pne});var vL=w(j$=>{"use strict";Object.defineProperty(j$,"__esModule",{value:!0});var _L=X(),One=oe(),Rne=rr(),Cne=A$(),Ane={message:({params:{len:e}})=>(0,_L.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,_L._)`{limit: ${e}}`},Nne={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Ane,code(e){let{schema:t,parentSchema:r,it:o}=e,{prefixItems:n}=r;o.items=!0,!(0,One.alwaysValidSchema)(o,t)&&(n?(0,Cne.validateAdditionalItems)(e,n):e.ok((0,Rne.validateArray)(e)))}};j$.default=Nne});var yL=w(U$=>{"use strict";Object.defineProperty(U$,"__esModule",{value:!0});var or=X(),Th=oe(),Dne={message:({params:{min:e,max:t}})=>t===void 0?(0,or.str)`must contain at least ${e} valid item(s)`:(0,or.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,or._)`{minContains: ${e}}`:(0,or._)`{minContains: ${e}, maxContains: ${t}}`},jne={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Dne,code(e){let{gen:t,schema:r,parentSchema:o,data:n,it:i}=e,s,a,{minContains:u,maxContains:c}=o;i.opts.next?(s=u===void 0?1:u,a=c):s=1;let l=t.const("len",(0,or._)`${n}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,Th.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Th.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Th.alwaysValidSchema)(i,r)){let m=(0,or._)`${l} >= ${s}`;a!==void 0&&(m=(0,or._)`${m} && ${l} <= ${a}`),e.pass(m);return}i.items=!0;let f=t.name("valid");a===void 0&&s===1?p(f,()=>t.if(f,()=>t.break())):s===0?(t.let(f,!0),a!==void 0&&t.if((0,or._)`${n}.length > 0`,h)):(t.let(f,!1),h()),e.result(f,()=>e.reset());function h(){let m=t.name("_valid"),_=t.let("count",0);p(m,()=>t.if(m,()=>g(_)))}function p(m,_){t.forRange("i",0,l,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:Th.Type.Num,compositeRule:!0},m),_()})}function g(m){t.code((0,or._)`${m}++`),a===void 0?t.if((0,or._)`${m} >= ${s}`,()=>t.assign(f,!0).break()):(t.if((0,or._)`${m} > ${a}`,()=>t.assign(f,!1).break()),s===1?t.assign(f,!0):t.if((0,or._)`${m} >= ${s}`,()=>t.assign(f,!0)))}}};U$.default=jne});var wL=w(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.validateSchemaDeps=Lr.validatePropertyDeps=Lr.error=void 0;var L$=X(),Une=oe(),Hu=rr();Lr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let o=t===1?"property":"properties";return(0,L$.str)`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:o}})=>(0,L$._)`{property: ${e},
|
|
15
|
+
missingProperty: ${o},
|
|
16
|
+
depsCount: ${t},
|
|
17
|
+
deps: ${r}}`};var Lne={keyword:"dependencies",type:"object",schemaType:"object",error:Lr.error,code(e){let[t,r]=Mne(e);bL(e,t),xL(e,r)}};function Mne({schema:e}){let t={},r={};for(let o in e){if(o==="__proto__")continue;let n=Array.isArray(e[o])?t:r;n[o]=e[o]}return[t,r]}function bL(e,t=e.schema){let{gen:r,data:o,it:n}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let u=(0,Hu.propertyInData)(r,o,s,n.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(u,()=>{for(let c of a)(0,Hu.checkReportMissingProp)(e,c)}):(r.if((0,L$._)`${u} && (${(0,Hu.checkMissingProp)(e,a,i)})`),(0,Hu.reportMissingProp)(e,i),r.else())}}Lr.validatePropertyDeps=bL;function xL(e,t=e.schema){let{gen:r,data:o,keyword:n,it:i}=e,s=r.name("valid");for(let a in t)(0,Une.alwaysValidSchema)(i,t[a])||(r.if((0,Hu.propertyInData)(r,o,a,i.opts.ownProperties),()=>{let u=e.subschema({keyword:n,schemaProp:a},s);e.mergeValidEvaluated(u,s)},()=>r.var(s,!0)),e.ok(s))}Lr.validateSchemaDeps=xL;Lr.default=Lne});var $L=w(M$=>{"use strict";Object.defineProperty(M$,"__esModule",{value:!0});var SL=X(),Zne=oe(),Fne={message:"property name must be valid",params:({params:e})=>(0,SL._)`{propertyName: ${e.propertyName}}`},qne={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Fne,code(e){let{gen:t,schema:r,data:o,it:n}=e;if((0,Zne.alwaysValidSchema)(n,r))return;let i=t.name("valid");t.forIn("key",o,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,SL.not)(i),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(i)}};M$.default=qne});var F$=w(Z$=>{"use strict";Object.defineProperty(Z$,"__esModule",{value:!0});var Ih=rr(),br=X(),Bne=hn(),Ph=oe(),Vne={message:"must NOT have additional properties",params:({params:e})=>(0,br._)`{additionalProperty: ${e.additionalProperty}}`},Wne={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Vne,code(e){let{gen:t,schema:r,parentSchema:o,data:n,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,Ph.alwaysValidSchema)(s,r))return;let c=(0,Ih.allSchemaProperties)(o.properties),l=(0,Ih.allSchemaProperties)(o.patternProperties);f(),e.ok((0,br._)`${i} === ${Bne.default.errors}`);function f(){t.forIn("key",n,_=>{!c.length&&!l.length?g(_):t.if(h(_),()=>g(_))})}function h(_){let v;if(c.length>8){let S=(0,Ph.schemaRefOrVal)(s,o.properties,"properties");v=(0,Ih.isOwnProperty)(t,S,_)}else c.length?v=(0,br.or)(...c.map(S=>(0,br._)`${_} === ${S}`)):v=br.nil;return l.length&&(v=(0,br.or)(v,...l.map(S=>(0,br._)`${(0,Ih.usePattern)(e,S)}.test(${_})`))),(0,br.not)(v)}function p(_){t.code((0,br._)`delete ${n}[${_}]`)}function g(_){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){p(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,Ph.alwaysValidSchema)(s,r)){let v=t.name("valid");u.removeAdditional==="failing"?(m(_,v,!1),t.if((0,br.not)(v),()=>{e.reset(),p(_)})):(m(_,v),a||t.if((0,br.not)(v),()=>t.break()))}}function m(_,v,S){let k={keyword:"additionalProperties",dataProp:_,dataPropType:Ph.Type.Str};S===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(k,v)}}};Z$.default=Wne});var zL=w(B$=>{"use strict";Object.defineProperty(B$,"__esModule",{value:!0});var Hne=Cu(),kL=rr(),q$=oe(),EL=F$(),Jne={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:o,data:n,it:i}=e;i.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&EL.default.code(new Hne.KeywordCxt(i,EL.default,"additionalProperties"));let s=(0,kL.allSchemaProperties)(r);for(let f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=q$.mergeEvaluated.props(t,(0,q$.toHash)(s),i.props));let a=s.filter(f=>!(0,q$.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let u=t.name("valid");for(let f of a)c(f)?l(f):(t.if((0,kL.propertyInData)(t,n,f,i.opts.ownProperties)),l(f),i.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(u);function c(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function l(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}}};B$.default=Jne});var OL=w(V$=>{"use strict";Object.defineProperty(V$,"__esModule",{value:!0});var TL=rr(),Oh=X(),IL=oe(),PL=oe(),Gne={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:o,parentSchema:n,it:i}=e,{opts:s}=i,a=(0,TL.allSchemaProperties)(r),u=a.filter(m=>(0,IL.alwaysValidSchema)(i,r[m]));if(a.length===0||u.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let c=s.strictSchema&&!s.allowMatchingProperties&&n.properties,l=t.name("valid");i.props!==!0&&!(i.props instanceof Oh.Name)&&(i.props=(0,PL.evaluatedPropsToName)(t,i.props));let{props:f}=i;h();function h(){for(let m of a)c&&p(m),i.allErrors?g(m):(t.var(l,!0),g(m),t.if(l))}function p(m){for(let _ in c)new RegExp(m).test(_)&&(0,IL.checkStrictMode)(i,`property ${_} matches pattern ${m} (use allowMatchingProperties)`)}function g(m){t.forIn("key",o,_=>{t.if((0,Oh._)`${(0,TL.usePattern)(e,m)}.test(${_})`,()=>{let v=u.includes(m);v||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:_,dataPropType:PL.Type.Str},l),i.opts.unevaluated&&f!==!0?t.assign((0,Oh._)`${f}[${_}]`,!0):!v&&!i.allErrors&&t.if((0,Oh.not)(l),()=>t.break())})})}}};V$.default=Gne});var RL=w(W$=>{"use strict";Object.defineProperty(W$,"__esModule",{value:!0});var Kne=oe(),Yne={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:o}=e;if((0,Kne.alwaysValidSchema)(o,r)){e.fail();return}let n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};W$.default=Yne});var CL=w(H$=>{"use strict";Object.defineProperty(H$,"__esModule",{value:!0});var Xne=rr(),Qne={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Xne.validateUnion,error:{message:"must match a schema in anyOf"}};H$.default=Qne});var AL=w(J$=>{"use strict";Object.defineProperty(J$,"__esModule",{value:!0});var Rh=X(),eoe=oe(),toe={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Rh._)`{passingSchemas: ${e.passing}}`},roe={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:toe,code(e){let{gen:t,schema:r,parentSchema:o,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&o.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),u=t.name("_valid");e.setParams({passing:a}),t.block(c),e.result(s,()=>e.reset(),()=>e.error(!0));function c(){i.forEach((l,f)=>{let h;(0,eoe.alwaysValidSchema)(n,l)?t.var(u,!0):h=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&t.if((0,Rh._)`${u} && ${s}`).assign(s,!1).assign(a,(0,Rh._)`[${a}, ${f}]`).else(),t.if(u,()=>{t.assign(s,!0),t.assign(a,f),h&&e.mergeEvaluated(h,Rh.Name)})})}}};J$.default=roe});var NL=w(G$=>{"use strict";Object.defineProperty(G$,"__esModule",{value:!0});var noe=oe(),ooe={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=t.name("valid");r.forEach((i,s)=>{if((0,noe.alwaysValidSchema)(o,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},n);e.ok(n),e.mergeEvaluated(a)})}};G$.default=ooe});var UL=w(K$=>{"use strict";Object.defineProperty(K$,"__esModule",{value:!0});var Ch=X(),jL=oe(),ioe={message:({params:e})=>(0,Ch.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ch._)`{failingKeyword: ${e.ifClause}}`},soe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ioe,code(e){let{gen:t,parentSchema:r,it:o}=e;r.then===void 0&&r.else===void 0&&(0,jL.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let n=DL(o,"then"),i=DL(o,"else");if(!n&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(u(),e.reset(),n&&i){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(a,c("then",l),c("else",l))}else n?t.if(a,c("then")):t.if((0,Ch.not)(a),c("else"));e.pass(s,()=>e.error(!0));function u(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(l)}function c(l,f){return()=>{let h=e.subschema({keyword:l},a);t.assign(s,a),e.mergeValidEvaluated(h,s),f?t.assign(f,(0,Ch._)`${l}`):e.setParams({ifClause:l})}}}};function DL(e,t){let r=e.schema[t];return r!==void 0&&!(0,jL.alwaysValidSchema)(e,r)}K$.default=soe});var LL=w(Y$=>{"use strict";Object.defineProperty(Y$,"__esModule",{value:!0});var aoe=oe(),coe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,aoe.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Y$.default=coe});var ML=w(X$=>{"use strict";Object.defineProperty(X$,"__esModule",{value:!0});var uoe=A$(),loe=gL(),doe=N$(),foe=vL(),poe=yL(),hoe=wL(),moe=$L(),goe=F$(),_oe=zL(),voe=OL(),yoe=RL(),boe=CL(),xoe=AL(),woe=NL(),Soe=UL(),$oe=LL();function koe(e=!1){let t=[yoe.default,boe.default,xoe.default,woe.default,Soe.default,$oe.default,moe.default,goe.default,hoe.default,_oe.default,voe.default];return e?t.push(loe.default,foe.default):t.push(uoe.default,doe.default),t.push(poe.default),t}X$.default=koe});var ZL=w(Q$=>{"use strict";Object.defineProperty(Q$,"__esModule",{value:!0});var Le=X(),Eoe={message:({schemaCode:e})=>(0,Le.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Le._)`{format: ${e}}`},zoe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Eoe,code(e,t){let{gen:r,data:o,$data:n,schema:i,schemaCode:s,it:a}=e,{opts:u,errSchemaPath:c,schemaEnv:l,self:f}=a;if(!u.validateFormats)return;n?h():p();function h(){let g=r.scopeValue("formats",{ref:f.formats,code:u.code.formats}),m=r.const("fDef",(0,Le._)`${g}[${s}]`),_=r.let("fType"),v=r.let("format");r.if((0,Le._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(_,(0,Le._)`${m}.type || "string"`).assign(v,(0,Le._)`${m}.validate`),()=>r.assign(_,(0,Le._)`"string"`).assign(v,m)),e.fail$data((0,Le.or)(S(),k()));function S(){return u.strictSchema===!1?Le.nil:(0,Le._)`${s} && !${v}`}function k(){let b=l.$async?(0,Le._)`(${m}.async ? await ${v}(${o}) : ${v}(${o}))`:(0,Le._)`${v}(${o})`,x=(0,Le._)`(typeof ${v} == "function" ? ${b} : ${v}.test(${o}))`;return(0,Le._)`${v} && ${v} !== true && ${_} === ${t} && !${x}`}}function p(){let g=f.formats[i];if(!g){S();return}if(g===!0)return;let[m,_,v]=k(g);m===t&&e.pass(b());function S(){if(u.strictSchema===!1){f.logger.warn(x());return}throw new Error(x());function x(){return`unknown format "${i}" ignored in schema at path "${c}"`}}function k(x){let T=x instanceof RegExp?(0,Le.regexpCode)(x):u.code.formats?(0,Le._)`${u.code.formats}${(0,Le.getProperty)(i)}`:void 0,C=r.scopeValue("formats",{key:i,ref:x,code:T});return typeof x=="object"&&!(x instanceof RegExp)?[x.type||"string",x.validate,(0,Le._)`${C}.validate`]:["string",x,C]}function b(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${v}(${o})`}return typeof _=="function"?(0,Le._)`${v}(${o})`:(0,Le._)`${v}.test(${o})`}}}};Q$.default=zoe});var FL=w(ek=>{"use strict";Object.defineProperty(ek,"__esModule",{value:!0});var Toe=ZL(),Ioe=[Toe.default];ek.default=Ioe});var qL=w(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.contentVocabulary=ra.metadataVocabulary=void 0;ra.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ra.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var VL=w(tk=>{"use strict";Object.defineProperty(tk,"__esModule",{value:!0});var Poe=X2(),Ooe=fL(),Roe=ML(),Coe=FL(),BL=qL(),Aoe=[Poe.default,Ooe.default,(0,Roe.default)(),Coe.default,BL.metadataVocabulary,BL.contentVocabulary];tk.default=Aoe});var HL=w(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.DiscrError=void 0;var WL;(function(e){e.Tag="tag",e.Mapping="mapping"})(WL||(Ah.DiscrError=WL={}))});var GL=w(nk=>{"use strict";Object.defineProperty(nk,"__esModule",{value:!0});var na=X(),rk=HL(),JL=gh(),Noe=Au(),Doe=oe(),joe={message:({params:{discrError:e,tagName:t}})=>e===rk.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,na._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Uoe={keyword:"discriminator",type:"object",schemaType:"object",error:joe,code(e){let{gen:t,data:r,schema:o,parentSchema:n,it:i}=e,{oneOf:s}=n;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let u=t.let("valid",!1),c=t.const("tag",(0,na._)`${r}${(0,na.getProperty)(a)}`);t.if((0,na._)`typeof ${c} == "string"`,()=>l(),()=>e.error(!1,{discrError:rk.DiscrError.Tag,tag:c,tagName:a})),e.ok(u);function l(){let p=h();t.if(!1);for(let g in p)t.elseIf((0,na._)`${c} === ${g}`),t.assign(u,f(p[g]));t.else(),e.error(!1,{discrError:rk.DiscrError.Mapping,tag:c,tagName:a}),t.endIf()}function f(p){let g=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:p},g);return e.mergeEvaluated(m,na.Name),g}function h(){var p;let g={},m=v(n),_=!0;for(let b=0;b<s.length;b++){let x=s[b];if(x?.$ref&&!(0,Doe.schemaHasRulesButRef)(x,i.self.RULES)){let C=x.$ref;if(x=JL.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,C),x instanceof JL.SchemaEnv&&(x=x.schema),x===void 0)throw new Noe.default(i.opts.uriResolver,i.baseId,C)}let T=(p=x?.properties)===null||p===void 0?void 0:p[a];if(typeof T!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);_=_&&(m||v(x)),S(T,b)}if(!_)throw new Error(`discriminator: "${a}" must be required`);return g;function v({required:b}){return Array.isArray(b)&&b.includes(a)}function S(b,x){if(b.const)k(b.const,x);else if(b.enum)for(let T of b.enum)k(T,x);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(b,x){if(typeof b!="string"||b in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[b]=x}}}};nk.default=Uoe});var KL=w((Owe,Loe)=>{Loe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var ik=w((ze,ok)=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.MissingRefError=ze.ValidationError=ze.CodeGen=ze.Name=ze.nil=ze.stringify=ze.str=ze._=ze.KeywordCxt=ze.Ajv=void 0;var Moe=W2(),Zoe=VL(),Foe=GL(),YL=KL(),qoe=["/properties"],Nh="http://json-schema.org/draft-07/schema",oa=class extends Moe.default{_addVocabularies(){super._addVocabularies(),Zoe.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Foe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(YL,qoe):YL;this.addMetaSchema(t,Nh,!1),this.refs["http://json-schema.org/schema"]=Nh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Nh)?Nh:void 0)}};ze.Ajv=oa;ok.exports=ze=oa;ok.exports.Ajv=oa;Object.defineProperty(ze,"__esModule",{value:!0});ze.default=oa;var Boe=Cu();Object.defineProperty(ze,"KeywordCxt",{enumerable:!0,get:function(){return Boe.KeywordCxt}});var ia=X();Object.defineProperty(ze,"_",{enumerable:!0,get:function(){return ia._}});Object.defineProperty(ze,"str",{enumerable:!0,get:function(){return ia.str}});Object.defineProperty(ze,"stringify",{enumerable:!0,get:function(){return ia.stringify}});Object.defineProperty(ze,"nil",{enumerable:!0,get:function(){return ia.nil}});Object.defineProperty(ze,"Name",{enumerable:!0,get:function(){return ia.Name}});Object.defineProperty(ze,"CodeGen",{enumerable:!0,get:function(){return ia.CodeGen}});var Voe=hh();Object.defineProperty(ze,"ValidationError",{enumerable:!0,get:function(){return Voe.default}});var Woe=Au();Object.defineProperty(ze,"MissingRefError",{enumerable:!0,get:function(){return Woe.default}})});var iM=w(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.formatNames=Zr.fastFormats=Zr.fullFormats=void 0;function Mr(e,t){return{validate:e,compare:t}}Zr.fullFormats={date:Mr(tM,uk),time:Mr(ak(!0),lk),"date-time":Mr(XL(!0),nM),"iso-time":Mr(ak(),rM),"iso-date-time":Mr(XL(),oM),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Xoe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:iie,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Qoe,int32:{type:"number",validate:rie},int64:{type:"number",validate:nie},float:{type:"number",validate:eM},double:{type:"number",validate:eM},password:!0,binary:!0};Zr.fastFormats={...Zr.fullFormats,date:Mr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,uk),time:Mr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lk),"date-time":Mr(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,nM),"iso-time":Mr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,rM),"iso-date-time":Mr(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,oM),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Zr.formatNames=Object.keys(Zr.fullFormats);function Hoe(e){return e%4===0&&(e%100!==0||e%400===0)}var Joe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Goe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function tM(e){let t=Joe.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],n=+t[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&Hoe(r)?29:Goe[o])}function uk(e,t){if(e&&t)return e>t?1:e<t?-1:0}var sk=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function ak(e){return function(r){let o=sk.exec(r);if(!o)return!1;let n=+o[1],i=+o[2],s=+o[3],a=o[4],u=o[5]==="-"?-1:1,c=+(o[6]||0),l=+(o[7]||0);if(c>23||l>59||e&&!a)return!1;if(n<=23&&i<=59&&s<60)return!0;let f=i-l*u,h=n-c*u-(f<0?1:0);return(h===23||h===-1)&&(f===59||f===-1)&&s<61}}function lk(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),o=new Date("2020-01-01T"+t).valueOf();if(r&&o)return r-o}function rM(e,t){if(!(e&&t))return;let r=sk.exec(e),o=sk.exec(t);if(r&&o)return e=r[1]+r[2]+r[3],t=o[1]+o[2]+o[3],e>t?1:e<t?-1:0}var ck=/t|\s/i;function XL(e){let t=ak(e);return function(o){let n=o.split(ck);return n.length===2&&tM(n[0])&&t(n[1])}}function nM(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),o=new Date(t).valueOf();if(r&&o)return r-o}function oM(e,t){if(!(e&&t))return;let[r,o]=e.split(ck),[n,i]=t.split(ck),s=uk(r,n);if(s!==void 0)return s||lk(o,i)}var Koe=/\/|:/,Yoe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Xoe(e){return Koe.test(e)&&Yoe.test(e)}var QL=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Qoe(e){return QL.lastIndex=0,QL.test(e)}var eie=-(2**31),tie=2**31-1;function rie(e){return Number.isInteger(e)&&e<=tie&&e>=eie}function nie(e){return Number.isInteger(e)}function eM(){return!0}var oie=/[^\\]\\Z/;function iie(e){if(oie.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var sM=w(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.formatLimitDefinition=void 0;var sie=ik(),xr=X(),ao=xr.operators,Dh={formatMaximum:{okStr:"<=",ok:ao.LTE,fail:ao.GT},formatMinimum:{okStr:">=",ok:ao.GTE,fail:ao.LT},formatExclusiveMaximum:{okStr:"<",ok:ao.LT,fail:ao.GTE},formatExclusiveMinimum:{okStr:">",ok:ao.GT,fail:ao.LTE}},aie={message:({keyword:e,schemaCode:t})=>(0,xr.str)`should be ${Dh[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,xr._)`{comparison: ${Dh[e].okStr}, limit: ${t}}`};sa.formatLimitDefinition={keyword:Object.keys(Dh),type:"string",schemaType:"string",$data:!0,error:aie,code(e){let{gen:t,data:r,schemaCode:o,keyword:n,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let u=new sie.KeywordCxt(i,a.RULES.all.format.definition,"format");u.$data?c():l();function c(){let h=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=t.const("fmt",(0,xr._)`${h}[${u.schemaCode}]`);e.fail$data((0,xr.or)((0,xr._)`typeof ${p} != "object"`,(0,xr._)`${p} instanceof RegExp`,(0,xr._)`typeof ${p}.compare != "function"`,f(p)))}function l(){let h=u.schema,p=a.formats[h];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${n}": format "${h}" does not define "compare" function`);let g=t.scopeValue("formats",{key:h,ref:p,code:s.code.formats?(0,xr._)`${s.code.formats}${(0,xr.getProperty)(h)}`:void 0});e.fail$data(f(g))}function f(h){return(0,xr._)`${h}.compare(${r}, ${o}) ${Dh[n].fail} 0`}},dependencies:["format"]};var cie=e=>(e.addKeyword(sa.formatLimitDefinition),e);sa.default=cie});var lM=w((Ju,uM)=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});var aa=iM(),uie=sM(),dk=X(),aM=new dk.Name("fullFormats"),lie=new dk.Name("fastFormats"),fk=(e,t={keywords:!0})=>{if(Array.isArray(t))return cM(e,t,aa.fullFormats,aM),e;let[r,o]=t.mode==="fast"?[aa.fastFormats,lie]:[aa.fullFormats,aM],n=t.formats||aa.formatNames;return cM(e,n,r,o),t.keywords&&(0,uie.default)(e),e};fk.get=(e,t="full")=>{let o=(t==="fast"?aa.fastFormats:aa.fullFormats)[e];if(!o)throw new Error(`Unknown format "${e}"`);return o};function cM(e,t,r,o){var n,i;(n=(i=e.opts.code).formats)!==null&&n!==void 0||(i.formats=(0,dk._)`require("ajv-formats/dist/formats").${o}`);for(let s of t)e.addFormat(s,r[s])}uM.exports=Ju=fk;Object.defineProperty(Ju,"__esModule",{value:!0});Ju.default=fk});var yM=w((Vwe,vM)=>{"use strict";vM.exports=_M;_M.sync=hie;var mM=F("fs");function pie(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var o=0;o<r.length;o++){var n=r[o].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function gM(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:pie(t,r)}function _M(e,t,r){mM.stat(e,function(o,n){r(o,o?!1:gM(n,e,t))})}function hie(e,t){return gM(mM.statSync(e),e,t)}});var $M=w((Wwe,SM)=>{"use strict";SM.exports=xM;xM.sync=mie;var bM=F("fs");function xM(e,t,r){bM.stat(e,function(o,n){r(o,o?!1:wM(n,t))})}function mie(e,t){return wM(bM.statSync(e),t)}function wM(e,t){return e.isFile()&&gie(e,t)}function gie(e,t){var r=e.mode,o=e.uid,n=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,f=r&c||r&u&&n===s||r&a&&o===i||r&l&&i===0;return f}});var EM=w((Jwe,kM)=>{"use strict";var Hwe=F("fs"),Zh;process.platform==="win32"||global.TESTING_WINDOWS?Zh=yM():Zh=$M();kM.exports=pk;pk.sync=_ie;function pk(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,n){pk(e,t||{},function(i,s){i?n(i):o(s)})})}Zh(e,t||{},function(o,n){o&&(o.code==="EACCES"||t&&t.ignoreErrors)&&(o=null,n=!1),r(o,n)})}function _ie(e,t){try{return Zh.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var CM=w((Gwe,RM)=>{"use strict";var ca=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zM=F("path"),vie=ca?";":":",TM=EM(),IM=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),PM=(e,t)=>{let r=t.colon||vie,o=e.match(/\//)||ca&&e.match(/\\/)?[""]:[...ca?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=ca?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=ca?n.split(r):[""];return ca&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:o,pathExt:i,pathExtExe:n}},OM=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:n,pathExtExe:i}=PM(e,t),s=[],a=c=>new Promise((l,f)=>{if(c===o.length)return t.all&&s.length?l(s):f(IM(e));let h=o[c],p=/^".*"$/.test(h)?h.slice(1,-1):h,g=zM.join(p,e),m=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;l(u(m,c,0))}),u=(c,l,f)=>new Promise((h,p)=>{if(f===n.length)return h(a(l+1));let g=n[f];TM(c+g,{pathExt:i},(m,_)=>{if(!m&&_)if(t.all)s.push(c+g);else return h(c+g);return h(u(c,l,f+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},yie=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:o,pathExtExe:n}=PM(e,t),i=[];for(let s=0;s<r.length;s++){let a=r[s],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=zM.join(u,e),l=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let f=0;f<o.length;f++){let h=l+o[f];try{if(TM.sync(h,{pathExt:n}))if(t.all)i.push(h);else return h}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw IM(e)};RM.exports=OM;OM.sync=yie});var NM=w((Kwe,hk)=>{"use strict";var AM=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};hk.exports=AM;hk.exports.default=AM});var LM=w((Ywe,UM)=>{"use strict";var DM=F("path"),bie=CM(),xie=NM();function jM(e,t){let r=e.options.env||process.env,o=process.cwd(),n=e.options.cwd!=null,i=n&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=bie.sync(e.command,{path:r[xie({env:r})],pathExt:t?DM.delimiter:void 0})}catch{}finally{i&&process.chdir(o)}return s&&(s=DM.resolve(n?e.options.cwd:"",s)),s}function wie(e){return jM(e)||jM(e,!0)}UM.exports=wie});var MM=w((Xwe,gk)=>{"use strict";var mk=/([()\][%!^"`<>&|;, *?])/g;function Sie(e){return e=e.replace(mk,"^$1"),e}function $ie(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(mk,"^$1"),t&&(e=e.replace(mk,"^$1")),e}gk.exports.command=Sie;gk.exports.argument=$ie});var FM=w((Qwe,ZM)=>{"use strict";ZM.exports=/^#!(.*)/});var BM=w((e0e,qM)=>{"use strict";var kie=FM();qM.exports=(e="")=>{let t=e.match(kie);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?o:o?`${n} ${o}`:n}});var WM=w((t0e,VM)=>{"use strict";var _k=F("fs"),Eie=BM();function zie(e){let r=Buffer.alloc(150),o;try{o=_k.openSync(e,"r"),_k.readSync(o,r,0,150,0),_k.closeSync(o)}catch{}return Eie(r.toString())}VM.exports=zie});var KM=w((r0e,GM)=>{"use strict";var Tie=F("path"),HM=LM(),JM=MM(),Iie=WM(),Pie=process.platform==="win32",Oie=/\.(?:com|exe)$/i,Rie=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Cie(e){e.file=HM(e);let t=e.file&&Iie(e.file);return t?(e.args.unshift(e.file),e.command=t,HM(e)):e.file}function Aie(e){if(!Pie)return e;let t=Cie(e),r=!Oie.test(t);if(e.options.forceShell||r){let o=Rie.test(t);e.command=Tie.normalize(e.command),e.command=JM.command(e.command),e.args=e.args.map(i=>JM.argument(i,o));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Nie(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let o={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?o:Aie(o)}GM.exports=Nie});var QM=w((n0e,XM)=>{"use strict";var vk=process.platform==="win32";function yk(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Die(e,t){if(!vk)return;let r=e.emit;e.emit=function(o,n){if(o==="exit"){let i=YM(n,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function YM(e,t){return vk&&e===1&&!t.file?yk(t.original,"spawn"):null}function jie(e,t){return vk&&e===1&&!t.file?yk(t.original,"spawnSync"):null}XM.exports={hookChildProcess:Die,verifyENOENT:YM,verifyENOENTSync:jie,notFoundError:yk}});var rZ=w((o0e,ua)=>{"use strict";var eZ=F("child_process"),bk=KM(),xk=QM();function tZ(e,t,r){let o=bk(e,t,r),n=eZ.spawn(o.command,o.args,o.options);return xk.hookChildProcess(n,o),n}function Uie(e,t,r){let o=bk(e,t,r),n=eZ.spawnSync(o.command,o.args,o.options);return n.error=n.error||xk.verifyENOENTSync(n.status,o),n}ua.exports=tZ;ua.exports.spawn=tZ;ua.exports.sync=Uie;ua.exports._parse=bk;ua.exports._enoent=xk});var yn=w((x$e,DZ)=>{"use strict";var AZ=["nodebuffer","arraybuffer","fragments"],NZ=typeof Blob<"u";NZ&&AZ.push("blob");DZ.exports={BINARY_TYPES:AZ,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:NZ,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ul=w((w$e,Gh)=>{"use strict";var{EMPTY_BUFFER:eae}=yn(),Lk=Buffer[Symbol.species];function tae(e,t){if(e.length===0)return eae;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),o=0;for(let n=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return o<t?new Lk(r.buffer,r.byteOffset,o):r}function jZ(e,t,r,o,n){for(let i=0;i<n;i++)r[o+i]=e[i]^t[i&3]}function UZ(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function rae(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Mk(e){if(Mk.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Lk(e):ArrayBuffer.isView(e)?t=new Lk(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Mk.readOnly=!1),t}Gh.exports={concat:tae,mask:jZ,toArrayBuffer:rae,toBuffer:Mk,unmask:UZ};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=F("bufferutil");Gh.exports.mask=function(t,r,o,n,i){i<48?jZ(t,r,o,n,i):e.mask(t,r,o,n,i)},Gh.exports.unmask=function(t,r){t.length<32?UZ(t,r):e.unmask(t,r)}}catch{}});var ZZ=w((S$e,MZ)=>{"use strict";var LZ=Symbol("kDone"),Zk=Symbol("kRun"),Fk=class{constructor(t){this[LZ]=()=>{this.pending--,this[Zk]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Zk]()}[Zk](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[LZ])}}};MZ.exports=Fk});var ha=w(($$e,VZ)=>{"use strict";var ll=F("zlib"),FZ=ul(),nae=ZZ(),{kStatusCode:qZ}=yn(),oae=Buffer[Symbol.species],iae=Buffer.from([0,0,255,255]),Yh=Symbol("permessage-deflate"),bn=Symbol("total-length"),fa=Symbol("callback"),uo=Symbol("buffers"),pa=Symbol("error"),Kh,qk=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Kh){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Kh=new nae(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[fa];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,o=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(o.server_no_context_takeover=!0),r.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(o.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?o.client_max_window_bits=r.clientMaxWindowBits:(o.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(o=>{let n=r[o];if(n.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(n=n[0],o==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else if(o==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else throw new Error(`Unknown parameter "${o}"`);r[o]=n})}),t}decompress(t,r,o){Kh.add(n=>{this._decompress(t,r,(i,s)=>{n(),o(i,s)})})}compress(t,r,o){Kh.add(n=>{this._compress(t,r,(i,s)=>{n(),o(i,s)})})}_decompress(t,r,o){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?ll.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=ll.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Yh]=this,this._inflate[bn]=0,this._inflate[uo]=[],this._inflate.on("error",aae),this._inflate.on("data",BZ)}this._inflate[fa]=o,this._inflate.write(t),r&&this._inflate.write(iae),this._inflate.flush(()=>{let i=this._inflate[pa];if(i){this._inflate.close(),this._inflate=null,o(i);return}let s=FZ.concat(this._inflate[uo],this._inflate[bn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[bn]=0,this._inflate[uo]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),o(null,s)})}_compress(t,r,o){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?ll.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=ll.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[bn]=0,this._deflate[uo]=[],this._deflate.on("data",sae)}this._deflate[fa]=o,this._deflate.write(t),this._deflate.flush(ll.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=FZ.concat(this._deflate[uo],this._deflate[bn]);r&&(i=new oae(i.buffer,i.byteOffset,i.length-4)),this._deflate[fa]=null,this._deflate[bn]=0,this._deflate[uo]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,i)})}};VZ.exports=qk;function sae(e){this[uo].push(e),this[bn]+=e.length}function BZ(e){if(this[bn]+=e.length,this[Yh]._maxPayload<1||this[bn]<=this[Yh]._maxPayload){this[uo].push(e);return}this[pa]=new RangeError("Max payload size exceeded"),this[pa].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[pa][qZ]=1009,this.removeListener("data",BZ),this.reset()}function aae(e){if(this[Yh]._inflate=null,this[pa]){this[fa](this[pa]);return}e[qZ]=1007,this[fa](e)}});var ma=w((k$e,Xh)=>{"use strict";var{isUtf8:WZ}=F("buffer"),{hasBlob:cae}=yn(),uae=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function lae(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function Bk(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function dae(e){return cae&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Xh.exports={isBlob:dae,isValidStatusCode:lae,isValidUTF8:Bk,tokenChars:uae};if(WZ)Xh.exports.isValidUTF8=function(e){return e.length<24?Bk(e):WZ(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=F("utf-8-validate");Xh.exports.isValidUTF8=function(t){return t.length<32?Bk(t):e(t)}}catch{}});var Gk=w((E$e,QZ)=>{"use strict";var{Writable:fae}=F("stream"),HZ=ha(),{BINARY_TYPES:pae,EMPTY_BUFFER:JZ,kStatusCode:hae,kWebSocket:mae}=yn(),{concat:Vk,toArrayBuffer:gae,unmask:_ae}=ul(),{isValidStatusCode:vae,isValidUTF8:GZ}=ma(),Qh=Buffer[Symbol.species],ir=0,KZ=1,YZ=2,XZ=3,Wk=4,Hk=5,em=6,Jk=class extends fae{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||pae[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[mae]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=ir}_write(t,r,o){if(this._opcode===8&&this._state==ir)return o();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(o)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new Qh(o.buffer,o.byteOffset+t,o.length-t),new Qh(o.buffer,o.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let o=this._buffers[0],n=r.length-t;t>=o.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(o.buffer,o.byteOffset,t),n),this._buffers[0]=new Qh(o.buffer,o.byteOffset+t,o.length-t)),t-=o.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case ir:this.getInfo(t);break;case KZ:this.getPayloadLength16(t);break;case YZ:this.getPayloadLength64(t);break;case XZ:this.getMask();break;case Wk:this.getData(t);break;case Hk:case em:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let o=(r[0]&64)===64;if(o&&!this._extensions[HZ.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=KZ:this._payloadLength===127?this._state=YZ:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),o=r.readUInt32BE(0);if(o>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=o*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=XZ:this._state=Wk}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Wk}getData(t){let r=JZ;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&_ae(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Hk,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[HZ.extensionName].decompress(t,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}this._fragments.push(i)}this.dataMessage(r),this._state===ir&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=ir;return}let r=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Vk(o,r):this._binaryType==="arraybuffer"?n=gae(Vk(o,r)):this._binaryType==="blob"?n=new Blob(o):n=o,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=ir):(this._state=em,setImmediate(()=>{this.emit("message",n,!0),this._state=ir,this.startLoop(t)}))}else{let n=Vk(o,r);if(!this._skipUTF8Validation&&!GZ(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===Hk||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=ir):(this._state=em,setImmediate(()=>{this.emit("message",n,!1),this._state=ir,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,JZ),this.end();else{let o=t.readUInt16BE(0);if(!vae(o)){let i=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new Qh(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!GZ(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",o,n),this.end()}this._state=ir;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=ir):(this._state=em,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=ir,this.startLoop(r)}))}createError(t,r,o,n,i){this._loop=!1,this._errored=!0;let s=new t(o?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=i,s[hae]=n,s}};QZ.exports=Jk});var Xk=w((T$e,r6)=>{"use strict";var{Duplex:z$e}=F("stream"),{randomFillSync:yae}=F("crypto"),e6=ha(),{EMPTY_BUFFER:bae,kWebSocket:xae,NOOP:wae}=yn(),{isBlob:ga,isValidStatusCode:Sae}=ma(),{mask:t6,toBuffer:ii}=ul(),sr=Symbol("kByteLength"),$ae=Buffer.alloc(4),tm=8*1024,si,_a=tm,wr=0,kae=1,Eae=2,Kk=class e{constructor(t,r,o){this._extensions=r||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=wr,this.onerror=wae,this[xae]=void 0}static frame(t,r){let o,n=!1,i=2,s=!1;r.mask&&(o=r.maskBuffer||$ae,r.generateMask?r.generateMask(o):(_a===tm&&(si===void 0&&(si=Buffer.alloc(tm)),yae(si,0,tm),_a=0),o[0]=si[_a++],o[1]=si[_a++],o[2]=si[_a++],o[3]=si[_a++]),s=(o[0]|o[1]|o[2]|o[3])===0,i=6);let a;typeof t=="string"?(!r.mask||s)&&r[sr]!==void 0?a=r[sr]:(t=Buffer.from(t),a=t.length):(a=t.length,n=r.mask&&r.readOnly&&!s);let u=a;a>=65536?(i+=8,u=127):a>125&&(i+=2,u=126);let c=Buffer.allocUnsafe(n?a+i:i);return c[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),r.mask?(c[1]|=128,c[i-4]=o[0],c[i-3]=o[1],c[i-2]=o[2],c[i-1]=o[3],s?[c,t]:n?(t6(t,o,c,i,a),[c]):(t6(t,o,t,0,a),[c,t])):[c,t]}close(t,r,o,n){let i;if(t===void 0)i=bae;else{if(typeof t!="number"||!Sae(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(t,0),typeof r=="string"?i.write(r,2):i.set(r,2)}}let s={[sr]:i.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==wr?this.enqueue([this.dispatch,i,!1,s,n]):this.sendFrame(e.frame(i,s),n)}ping(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):ga(t)?(n=t.size,i=!1):(t=ii(t),n=t.length,i=ii.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[sr]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};ga(t)?this._state!==wr?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==wr?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}pong(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):ga(t)?(n=t.size,i=!1):(t=ii(t),n=t.length,i=ii.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[sr]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};ga(t)?this._state!==wr?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==wr?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}send(t,r,o){let n=this._extensions[e6.extensionName],i=r.binary?2:1,s=r.compress,a,u;typeof t=="string"?(a=Buffer.byteLength(t),u=!1):ga(t)?(a=t.size,u=!1):(t=ii(t),a=t.length,u=ii.readOnly),this._firstFragment?(this._firstFragment=!1,s&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=n._threshold),this._compress=s):(s=!1,i=0),r.fin&&(this._firstFragment=!0);let c={[sr]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:u,rsv1:s};ga(t)?this._state!==wr?this.enqueue([this.getBlobData,t,this._compress,c,o]):this.getBlobData(t,this._compress,c,o):this._state!==wr?this.enqueue([this.dispatch,t,this._compress,c,o]):this.dispatch(t,this._compress,c,o)}getBlobData(t,r,o,n){this._bufferedBytes+=o[sr],this._state=Eae,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Yk,this,a,n);return}this._bufferedBytes-=o[sr];let s=ii(i);r?this.dispatch(s,r,o,n):(this._state=wr,this.sendFrame(e.frame(s,o),n),this.dequeue())}).catch(i=>{process.nextTick(zae,this,i,n)})}dispatch(t,r,o,n){if(!r){this.sendFrame(e.frame(t,o),n);return}let i=this._extensions[e6.extensionName];this._bufferedBytes+=o[sr],this._state=kae,i.compress(t,o.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");Yk(this,u,n);return}this._bufferedBytes-=o[sr],this._state=wr,o.readOnly=!1,this.sendFrame(e.frame(a,o),n),this.dequeue()})}dequeue(){for(;this._state===wr&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][sr],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][sr],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};r6.exports=Kk;function Yk(e,t,r){typeof r=="function"&&r(t);for(let o=0;o<e._queue.length;o++){let n=e._queue[o],i=n[n.length-1];typeof i=="function"&&i(t)}}function zae(e,t,r){Yk(e,t,r),e.onerror(t)}});var d6=w((I$e,l6)=>{"use strict";var{kForOnEventAttribute:dl,kListener:Qk}=yn(),n6=Symbol("kCode"),o6=Symbol("kData"),i6=Symbol("kError"),s6=Symbol("kMessage"),a6=Symbol("kReason"),va=Symbol("kTarget"),c6=Symbol("kType"),u6=Symbol("kWasClean"),xn=class{constructor(t){this[va]=null,this[c6]=t}get target(){return this[va]}get type(){return this[c6]}};Object.defineProperty(xn.prototype,"target",{enumerable:!0});Object.defineProperty(xn.prototype,"type",{enumerable:!0});var ai=class extends xn{constructor(t,r={}){super(t),this[n6]=r.code===void 0?0:r.code,this[a6]=r.reason===void 0?"":r.reason,this[u6]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[n6]}get reason(){return this[a6]}get wasClean(){return this[u6]}};Object.defineProperty(ai.prototype,"code",{enumerable:!0});Object.defineProperty(ai.prototype,"reason",{enumerable:!0});Object.defineProperty(ai.prototype,"wasClean",{enumerable:!0});var ya=class extends xn{constructor(t,r={}){super(t),this[i6]=r.error===void 0?null:r.error,this[s6]=r.message===void 0?"":r.message}get error(){return this[i6]}get message(){return this[s6]}};Object.defineProperty(ya.prototype,"error",{enumerable:!0});Object.defineProperty(ya.prototype,"message",{enumerable:!0});var fl=class extends xn{constructor(t,r={}){super(t),this[o6]=r.data===void 0?null:r.data}get data(){return this[o6]}};Object.defineProperty(fl.prototype,"data",{enumerable:!0});var Tae={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[dl]&&n[Qk]===t&&!n[dl])return;let o;if(e==="message")o=function(i,s){let a=new fl("message",{data:s?i:i.toString()});a[va]=this,rm(t,this,a)};else if(e==="close")o=function(i,s){let a=new ai("close",{code:i,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[va]=this,rm(t,this,a)};else if(e==="error")o=function(i){let s=new ya("error",{error:i,message:i.message});s[va]=this,rm(t,this,s)};else if(e==="open")o=function(){let i=new xn("open");i[va]=this,rm(t,this,i)};else return;o[dl]=!!r[dl],o[Qk]=t,r.once?this.once(e,o):this.on(e,o)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Qk]===t&&!r[dl]){this.removeListener(e,r);break}}};l6.exports={CloseEvent:ai,ErrorEvent:ya,Event:xn,EventTarget:Tae,MessageEvent:fl};function rm(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var nm=w((P$e,f6)=>{"use strict";var{tokenChars:pl}=ma();function Fr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function Iae(e){let t=Object.create(null),r=Object.create(null),o=!1,n=!1,i=!1,s,a,u=-1,c=-1,l=-1,f=0;for(;f<e.length;f++)if(c=e.charCodeAt(f),s===void 0)if(l===-1&&pl[c]===1)u===-1&&(u=f);else if(f!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=f);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let p=e.slice(u,l);c===44?(Fr(t,p,r),r=Object.create(null)):s=p,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(l===-1&&pl[c]===1)u===-1&&(u=f);else if(c===32||c===9)l===-1&&u!==-1&&(l=f);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f),Fr(r,e.slice(u,l),!0),c===44&&(Fr(t,s,r),r=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=e.slice(u,f),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(n){if(pl[c]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1?u=f:o||(o=!0),n=!1}else if(i)if(pl[c]===1)u===-1&&(u=f);else if(c===34&&u!==-1)i=!1,l=f;else if(c===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(c===34&&e.charCodeAt(f-1)===61)i=!0;else if(l===-1&&pl[c]===1)u===-1&&(u=f);else if(u!==-1&&(c===32||c===9))l===-1&&(l=f);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${f}`);l===-1&&(l=f);let p=e.slice(u,l);o&&(p=p.replace(/\\/g,""),o=!1),Fr(r,a,p),c===44&&(Fr(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(u===-1||i||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=f);let h=e.slice(u,l);return s===void 0?Fr(t,h,r):(a===void 0?Fr(r,h,!0):o?Fr(r,a,h.replace(/\\/g,"")):Fr(r,a,h),Fr(t,s,r)),t}function Pae(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(o=>[t].concat(Object.keys(o).map(n=>{let i=o[n];return Array.isArray(i)||(i=[i]),i.map(s=>s===!0?n:`${n}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}f6.exports={format:Pae,parse:Iae}});var am=w((C$e,$6)=>{"use strict";var Oae=F("events"),Rae=F("https"),Cae=F("http"),m6=F("net"),Aae=F("tls"),{randomBytes:Nae,createHash:Dae}=F("crypto"),{Duplex:O$e,Readable:R$e}=F("stream"),{URL:eE}=F("url"),lo=ha(),jae=Gk(),Uae=Xk(),{isBlob:Lae}=ma(),{BINARY_TYPES:p6,CLOSE_TIMEOUT:Mae,EMPTY_BUFFER:om,GUID:Zae,kForOnEventAttribute:tE,kListener:Fae,kStatusCode:qae,kWebSocket:Je,NOOP:g6}=yn(),{EventTarget:{addEventListener:Bae,removeEventListener:Vae}}=d6(),{format:Wae,parse:Hae}=nm(),{toBuffer:Jae}=ul(),_6=Symbol("kAborted"),rE=[8,13],wn=["CONNECTING","OPEN","CLOSING","CLOSED"],Gae=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ce=class e extends Oae{constructor(t,r,o){super(),this._binaryType=p6[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=om,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(o=r,r=[]):r=[r]),v6(this,t,r,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){p6.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,o){let n=new jae({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),i=new Uae(t,this._extensions,o.generateMask);this._receiver=n,this._sender=i,this._socket=t,n[Je]=this,i[Je]=this,t[Je]=this,n.on("conclude",Xae),n.on("drain",Qae),n.on("error",ece),n.on("message",tce),n.on("ping",rce),n.on("pong",nce),i.onerror=oce,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",x6),t.on("data",sm),t.on("end",w6),t.on("error",S6),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[lo.extensionName]&&this._extensions[lo.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Mt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),b6(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){nE(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||om,r,o)}pong(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){nE(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||om,r,o)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(o=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){nE(this,t,o);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[lo.extensionName]||(n.compress=!1),this._sender.send(t||om,n,o)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Mt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ce,"CONNECTING",{enumerable:!0,value:wn.indexOf("CONNECTING")});Object.defineProperty(Ce.prototype,"CONNECTING",{enumerable:!0,value:wn.indexOf("CONNECTING")});Object.defineProperty(Ce,"OPEN",{enumerable:!0,value:wn.indexOf("OPEN")});Object.defineProperty(Ce.prototype,"OPEN",{enumerable:!0,value:wn.indexOf("OPEN")});Object.defineProperty(Ce,"CLOSING",{enumerable:!0,value:wn.indexOf("CLOSING")});Object.defineProperty(Ce.prototype,"CLOSING",{enumerable:!0,value:wn.indexOf("CLOSING")});Object.defineProperty(Ce,"CLOSED",{enumerable:!0,value:wn.indexOf("CLOSED")});Object.defineProperty(Ce.prototype,"CLOSED",{enumerable:!0,value:wn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Ce.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Ce.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[tE])return t[Fae];return null},set(t){for(let r of this.listeners(e))if(r[tE]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[tE]:!0})}})});Ce.prototype.addEventListener=Bae;Ce.prototype.removeEventListener=Vae;$6.exports=Ce;function v6(e,t,r,o){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Mae,protocolVersion:rE[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!rE.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${rE.join(", ")})`);let i;if(t instanceof eE)i=t;else try{i=new eE(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),e._url=i.href;let s=i.protocol==="wss:",a=i.protocol==="ws+unix:",u;if(i.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?u="The URL's pathname is empty":i.hash&&(u="The URL contains a fragment identifier"),u){let m=new SyntaxError(u);if(e._redirects===0)throw m;im(e,m);return}let c=s?443:80,l=Nae(16).toString("base64"),f=s?Rae.request:Cae.request,h=new Set,p;if(n.createConnection=n.createConnection||(s?Yae:Kae),n.defaultPort=n.defaultPort||c,n.port=i.port||c,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(p=new lo({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=Wae({[lo.extensionName]:p.offer()})),r.length){for(let m of r){if(typeof m!="string"||!Gae.test(m)||h.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(m)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),a){let m=n.path.split(":");n.socketPath=m[0],n.path=m[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?n.socketPath:i.host;let m=o&&o.headers;if(o={...o,headers:{}},m)for(let[_,v]of Object.entries(m))o.headers[_.toLowerCase()]=v}else if(e.listenerCount("redirect")===0){let m=a?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:i.host===e._originalHostOrSocketPath;(!m||e._originalSecure&&!s)&&(delete n.headers.authorization,delete n.headers.cookie,m||delete n.headers.host,n.auth=void 0)}n.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=e._req=f(n),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=f(n);n.timeout&&g.on("timeout",()=>{Mt(e,g,"Opening handshake has timed out")}),g.on("error",m=>{g===null||g[_6]||(g=e._req=null,im(e,m))}),g.on("response",m=>{let _=m.headers.location,v=m.statusCode;if(_&&n.followRedirects&&v>=300&&v<400){if(++e._redirects>n.maxRedirects){Mt(e,g,"Maximum redirects exceeded");return}g.abort();let S;try{S=new eE(_,t)}catch{let b=new SyntaxError(`Invalid URL: ${_}`);im(e,b);return}v6(e,S,r,o)}else e.emit("unexpected-response",g,m)||Mt(e,g,`Unexpected server response: ${m.statusCode}`)}),g.on("upgrade",(m,_,v)=>{if(e.emit("upgrade",m),e.readyState!==Ce.CONNECTING)return;g=e._req=null;let S=m.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){Mt(e,_,"Invalid Upgrade header");return}let k=Dae("sha1").update(l+Zae).digest("base64");if(m.headers["sec-websocket-accept"]!==k){Mt(e,_,"Invalid Sec-WebSocket-Accept header");return}let b=m.headers["sec-websocket-protocol"],x;if(b!==void 0?h.size?h.has(b)||(x="Server sent an invalid subprotocol"):x="Server sent a subprotocol but none was requested":h.size&&(x="Server sent no subprotocol"),x){Mt(e,_,x);return}b&&(e._protocol=b);let T=m.headers["sec-websocket-extensions"];if(T!==void 0){if(!p){Mt(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=Hae(T)}catch{Mt(e,_,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(C);if(D.length!==1||D[0]!==lo.extensionName){Mt(e,_,"Server indicated an extension that was not requested");return}try{p.accept(C[lo.extensionName])}catch{Mt(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[lo.extensionName]=p}e.setSocket(_,v,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,e):g.end()}function im(e,t){e._readyState=Ce.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function Kae(e){return e.path=e.socketPath,m6.connect(e)}function Yae(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=m6.isIP(e.host)?"":e.host),Aae.connect(e)}function Mt(e,t,r){e._readyState=Ce.CLOSING;let o=new Error(r);Error.captureStackTrace(o,Mt),t.setHeader?(t[_6]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(im,e,o)):(t.destroy(o),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function nE(e,t,r){if(t){let o=Lae(t)?t.size:Jae(t).length;e._socket?e._sender._bufferedBytes+=o:e._bufferedAmount+=o}if(r){let o=new Error(`WebSocket is not open: readyState ${e.readyState} (${wn[e.readyState]})`);process.nextTick(r,o)}}function Xae(e,t){let r=this[Je];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Je]!==void 0&&(r._socket.removeListener("data",sm),process.nextTick(y6,r._socket),e===1005?r.close():r.close(e,t))}function Qae(){let e=this[Je];e.isPaused||e._socket.resume()}function ece(e){let t=this[Je];t._socket[Je]!==void 0&&(t._socket.removeListener("data",sm),process.nextTick(y6,t._socket),t.close(e[qae])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function h6(){this[Je].emitClose()}function tce(e,t){this[Je].emit("message",e,t)}function rce(e){let t=this[Je];t._autoPong&&t.pong(e,!this._isServer,g6),t.emit("ping",e)}function nce(e){this[Je].emit("pong",e)}function y6(e){e.resume()}function oce(e){let t=this[Je];t.readyState!==Ce.CLOSED&&(t.readyState===Ce.OPEN&&(t._readyState=Ce.CLOSING,b6(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function b6(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function x6(){let e=this[Je];if(this.removeListener("close",x6),this.removeListener("data",sm),this.removeListener("end",w6),e._readyState=Ce.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Je]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",h6),e._receiver.on("finish",h6))}function sm(e){this[Je]._receiver.write(e)||this.pause()}function w6(){let e=this[Je];e._readyState=Ce.CLOSING,e._receiver.end(),this.end()}function S6(){let e=this[Je];this.removeListener("error",S6),this.on("error",g6),e&&(e._readyState=Ce.CLOSING,this.destroy())}});var T6=w((N$e,z6)=>{"use strict";var A$e=am(),{Duplex:ice}=F("stream");function k6(e){e.emit("close")}function sce(){!this.destroyed&&this._writableState.finished&&this.destroy()}function E6(e){this.removeListener("error",E6),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function ace(e,t){let r=!0,o=new ice({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(i,s){let a=!s&&o._readableState.objectMode?i.toString():i;o.push(a)||e.pause()}),e.once("error",function(i){o.destroyed||(r=!1,o.destroy(i))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(n,i){if(e.readyState===e.CLOSED){i(n),process.nextTick(k6,o);return}let s=!1;e.once("error",function(u){s=!0,i(u)}),e.once("close",function(){s||i(n),process.nextTick(k6,o)}),r&&e.terminate()},o._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},o._read=function(){e.isPaused&&e.resume()},o._write=function(n,i,s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(n,i,s)});return}e.send(n,s)},o.on("end",sce),o.on("error",E6),o}z6.exports=ace});var oE=w((D$e,I6)=>{"use strict";var{tokenChars:cce}=ma();function uce(e){let t=new Set,r=-1,o=-1,n=0;for(n;n<e.length;n++){let s=e.charCodeAt(n);if(o===-1&&cce[s]===1)r===-1&&(r=n);else if(n!==0&&(s===32||s===9))o===-1&&r!==-1&&(o=n);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);o===-1&&(o=n);let a=e.slice(r,o);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=o=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}I6.exports={parse:uce}});var D6=w((U$e,N6)=>{"use strict";var lce=F("events"),cm=F("http"),{Duplex:j$e}=F("stream"),{createHash:dce}=F("crypto"),P6=nm(),ci=ha(),fce=oE(),pce=am(),{CLOSE_TIMEOUT:hce,GUID:mce,kWebSocket:gce}=yn(),_ce=/^[+/0-9A-Za-z]{22}==$/,O6=0,R6=1,A6=2,iE=class extends lce{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:hce,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:pce,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=cm.createServer((o,n)=>{let i=cm.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=vce(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,s)=>{this.handleUpgrade(n,i,s,o)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=O6}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===A6){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(hl,this);return}if(t&&this.once("close",t),this._state!==R6)if(this._state=R6,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(hl,this):process.nextTick(hl,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{hl(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,o,n){r.on("error",C6);let i=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ui(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ui(this,t,r,400,"Invalid Upgrade header");return}if(i===void 0||!_ce.test(i)){ui(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ui(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){ml(r,400);return}let u=t.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=fce.parse(u)}catch{ui(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&l!==void 0){let h=new ci({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let p=P6.parse(l);p[ci.extensionName]&&(h.accept(p[ci.extensionName]),f[ci.extensionName]=h)}catch{ui(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(p,g,m,_)=>{if(!p)return ml(r,g||401,m,_);this.completeUpgrade(f,i,c,t,r,o,n)});return}if(!this.options.verifyClient(h))return ml(r,401)}this.completeUpgrade(f,i,c,t,r,o,n)}completeUpgrade(t,r,o,n,i,s,a){if(!i.readable||!i.writable)return i.destroy();if(i[gce])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>O6)return ml(i,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${dce("sha1").update(r+mce).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(o.size){let f=this.options.handleProtocols?this.options.handleProtocols(o,n):o.values().next().value;f&&(c.push(`Sec-WebSocket-Protocol: ${f}`),l._protocol=f)}if(t[ci.extensionName]){let f=t[ci.extensionName].params,h=P6.format({[ci.extensionName]:[f]});c.push(`Sec-WebSocket-Extensions: ${h}`),l._extensions=t}this.emit("headers",c,n),i.write(c.concat(`\r
|
|
18
|
+
`).join(`\r
|
|
19
|
+
`)),i.removeListener("error",C6),l.setSocket(i,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(hl,this)})),a(l,n)}};N6.exports=iE;function vce(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let o of Object.keys(t))e.removeListener(o,t[o])}}function hl(e){e._state=A6,e.emit("close")}function C6(){this.destroy()}function ml(e,t,r,o){r=r||cm.STATUS_CODES[t],o={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...o},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${cm.STATUS_CODES[t]}\r
|
|
20
|
+
`+Object.keys(o).map(n=>`${n}: ${o[n]}`).join(`\r
|
|
21
|
+
`)+`\r
|
|
22
|
+
\r
|
|
23
|
+
`+r)}function ui(e,t,r,o,n,i){if(e.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,ui),e.emit("wsClientError",s,r,t)}else ml(r,o,n,i)}});import{arch as nue,homedir as Y6,platform as oue}from"os";import{mkdirSync as iue}from"fs";import{join as sue,resolve as aue}from"path";var kq=We(uz(),1),Eq=We($m(),1),zq=We(zm(),1),yz=We(Ol(),1),Tq=We(vz(),1);var kn=yz.default;var d={};Zt(d,{$brand:()=>Cl,$input:()=>ev,$output:()=>Q_,NEVER:()=>Nm,TimePrecision:()=>ov,ZodAny:()=>Hy,ZodArray:()=>Yy,ZodBase64:()=>af,ZodBase64URL:()=>cf,ZodBigInt:()=>Gi,ZodBigIntFormat:()=>df,ZodBoolean:()=>Ji,ZodCIDRv4:()=>of,ZodCIDRv6:()=>sf,ZodCUID:()=>Yd,ZodCUID2:()=>Xd,ZodCatch:()=>yb,ZodCodec:()=>yf,ZodCustom:()=>cc,ZodCustomStringFormat:()=>Wi,ZodDate:()=>nc,ZodDefault:()=>pb,ZodDiscriminatedUnion:()=>Qy,ZodE164:()=>uf,ZodEmail:()=>Jd,ZodEmoji:()=>Gd,ZodEnum:()=>Bi,ZodError:()=>rV,ZodExactOptional:()=>lb,ZodFile:()=>cb,ZodFirstPartyTypeKind:()=>Ob,ZodFunction:()=>Tb,ZodGUID:()=>Xa,ZodIPv4:()=>rf,ZodIPv6:()=>nf,ZodISODate:()=>Fd,ZodISODateTime:()=>Zd,ZodISODuration:()=>Bd,ZodISOTime:()=>qd,ZodIntersection:()=>eb,ZodIssueCode:()=>oV,ZodJWT:()=>lf,ZodKSUID:()=>tf,ZodLazy:()=>kb,ZodLiteral:()=>ab,ZodMAC:()=>My,ZodMap:()=>ib,ZodNaN:()=>xb,ZodNanoID:()=>Kd,ZodNever:()=>Gy,ZodNonOptional:()=>_f,ZodNull:()=>Vy,ZodNullable:()=>fb,ZodNumber:()=>Hi,ZodNumberFormat:()=>$o,ZodObject:()=>ic,ZodOptional:()=>gf,ZodPipe:()=>vf,ZodPrefault:()=>mb,ZodPromise:()=>zb,ZodReadonly:()=>wb,ZodRealError:()=>St,ZodRecord:()=>ac,ZodSet:()=>sb,ZodString:()=>Vi,ZodStringFormat:()=>pe,ZodSuccess:()=>vb,ZodSymbol:()=>qy,ZodTemplateLiteral:()=>$b,ZodTransform:()=>ub,ZodTuple:()=>rb,ZodType:()=>J,ZodULID:()=>Qd,ZodURL:()=>rc,ZodUUID:()=>zr,ZodUndefined:()=>By,ZodUnion:()=>sc,ZodUnknown:()=>Jy,ZodVoid:()=>Ky,ZodXID:()=>ef,ZodXor:()=>Xy,_ZodString:()=>Hd,_default:()=>hb,_function:()=>XI,any:()=>PI,array:()=>oc,base64:()=>pI,base64url:()=>hI,bigint:()=>kI,boolean:()=>Fy,catch:()=>bb,check:()=>QI,cidrv4:()=>dI,cidrv6:()=>fI,clone:()=>ft,codec:()=>GI,coerce:()=>Rb,config:()=>Ne,core:()=>Gr,cuid:()=>nI,cuid2:()=>oI,custom:()=>eP,date:()=>RI,decode:()=>Cy,decodeAsync:()=>Ny,describe:()=>tP,discriminatedUnion:()=>UI,e164:()=>mI,email:()=>HT,emoji:()=>tI,encode:()=>Ry,encodeAsync:()=>Ay,endsWith:()=>Ai,enum:()=>hf,exactOptional:()=>db,file:()=>VI,flattenError:()=>La,float32:()=>xI,float64:()=>wI,formatError:()=>Ma,fromJSONSchema:()=>cP,function:()=>XI,getErrorMap:()=>sV,globalRegistry:()=>Ge,gt:()=>kr,gte:()=>pt,guid:()=>JT,hash:()=>bI,hex:()=>yI,hostname:()=>vI,httpUrl:()=>eI,includes:()=>Ri,instanceof:()=>nP,int:()=>Wd,int32:()=>SI,int64:()=>EI,intersection:()=>tb,ipv4:()=>cI,ipv6:()=>lI,iso:()=>qi,json:()=>iP,jwt:()=>gI,keyof:()=>CI,ksuid:()=>aI,lazy:()=>Eb,length:()=>wo,literal:()=>BI,locales:()=>Ja,looseObject:()=>DI,looseRecord:()=>MI,lowercase:()=>Pi,lt:()=>$r,lte:()=>At,mac:()=>uI,map:()=>ZI,maxLength:()=>xo,maxSize:()=>Rn,meta:()=>rP,mime:()=>Ni,minLength:()=>Jr,minSize:()=>Er,multipleOf:()=>On,nan:()=>JI,nanoid:()=>rI,nativeEnum:()=>qI,negative:()=>Od,never:()=>ff,nonnegative:()=>Cd,nonoptional:()=>_b,nonpositive:()=>Rd,normalize:()=>Di,null:()=>Wy,nullable:()=>ec,nullish:()=>WI,number:()=>Zy,object:()=>AI,optional:()=>Qa,overwrite:()=>ur,parse:()=>Ty,parseAsync:()=>Iy,partialRecord:()=>LI,pipe:()=>tc,positive:()=>Pd,prefault:()=>gb,preprocess:()=>sP,prettifyError:()=>Hm,promise:()=>YI,property:()=>Ad,readonly:()=>Sb,record:()=>ob,refine:()=>Ib,regex:()=>Ii,regexes:()=>Vt,registry:()=>ud,safeDecode:()=>jy,safeDecodeAsync:()=>Ly,safeEncode:()=>Dy,safeEncodeAsync:()=>Uy,safeParse:()=>Py,safeParseAsync:()=>Oy,set:()=>FI,setErrorMap:()=>iV,size:()=>bo,slugify:()=>Mi,startsWith:()=>Ci,strictObject:()=>NI,string:()=>Vd,stringFormat:()=>_I,stringbool:()=>oP,success:()=>HI,superRefine:()=>Pb,symbol:()=>TI,templateLiteral:()=>KI,toJSONSchema:()=>Ud,toLowerCase:()=>Ui,toUpperCase:()=>Li,transform:()=>mf,treeifyError:()=>Wm,trim:()=>ji,tuple:()=>nb,uint32:()=>$I,uint64:()=>zI,ulid:()=>iI,undefined:()=>II,union:()=>pf,unknown:()=>So,uppercase:()=>Oi,url:()=>QT,util:()=>O,uuid:()=>GT,uuidv4:()=>KT,uuidv6:()=>YT,uuidv7:()=>XT,void:()=>OI,xid:()=>sI,xor:()=>jI});var Gr={};Zt(Gr,{$ZodAny:()=>x_,$ZodArray:()=>E_,$ZodAsyncError:()=>cr,$ZodBase64:()=>d_,$ZodBase64URL:()=>f_,$ZodBigInt:()=>rd,$ZodBigIntFormat:()=>__,$ZodBoolean:()=>Ba,$ZodCIDRv4:()=>c_,$ZodCIDRv6:()=>u_,$ZodCUID:()=>Kg,$ZodCUID2:()=>Yg,$ZodCatch:()=>B_,$ZodCheck:()=>ge,$ZodCheckBigIntFormat:()=>Eg,$ZodCheckEndsWith:()=>Ug,$ZodCheckGreaterThan:()=>Gl,$ZodCheckIncludes:()=>Dg,$ZodCheckLengthEquals:()=>Rg,$ZodCheckLessThan:()=>Jl,$ZodCheckLowerCase:()=>Ag,$ZodCheckMaxLength:()=>Pg,$ZodCheckMaxSize:()=>zg,$ZodCheckMimeType:()=>Mg,$ZodCheckMinLength:()=>Og,$ZodCheckMinSize:()=>Tg,$ZodCheckMultipleOf:()=>$g,$ZodCheckNumberFormat:()=>kg,$ZodCheckOverwrite:()=>Zg,$ZodCheckProperty:()=>Lg,$ZodCheckRegex:()=>Cg,$ZodCheckSizeEquals:()=>Ig,$ZodCheckStartsWith:()=>jg,$ZodCheckStringFormat:()=>zi,$ZodCheckUpperCase:()=>Ng,$ZodCodec:()=>Wa,$ZodCustom:()=>X_,$ZodCustomStringFormat:()=>m_,$ZodDate:()=>k_,$ZodDefault:()=>M_,$ZodDiscriminatedUnion:()=>I_,$ZodE164:()=>p_,$ZodEmail:()=>Wg,$ZodEmoji:()=>Jg,$ZodEncodeError:()=>En,$ZodEnum:()=>A_,$ZodError:()=>Ua,$ZodExactOptional:()=>U_,$ZodFile:()=>D_,$ZodFunction:()=>G_,$ZodGUID:()=>Bg,$ZodIPv4:()=>i_,$ZodIPv6:()=>s_,$ZodISODate:()=>r_,$ZodISODateTime:()=>t_,$ZodISODuration:()=>o_,$ZodISOTime:()=>n_,$ZodIntersection:()=>P_,$ZodJWT:()=>h_,$ZodKSUID:()=>e_,$ZodLazy:()=>Y_,$ZodLiteral:()=>N_,$ZodMAC:()=>a_,$ZodMap:()=>R_,$ZodNaN:()=>V_,$ZodNanoID:()=>Gg,$ZodNever:()=>S_,$ZodNonOptional:()=>F_,$ZodNull:()=>b_,$ZodNullable:()=>L_,$ZodNumber:()=>td,$ZodNumberFormat:()=>g_,$ZodObject:()=>Wz,$ZodObjectJIT:()=>z_,$ZodOptional:()=>od,$ZodPipe:()=>W_,$ZodPrefault:()=>Z_,$ZodPromise:()=>K_,$ZodReadonly:()=>H_,$ZodRealError:()=>wt,$ZodRecord:()=>O_,$ZodRegistry:()=>cd,$ZodSet:()=>C_,$ZodString:()=>yo,$ZodStringFormat:()=>fe,$ZodSuccess:()=>q_,$ZodSymbol:()=>v_,$ZodTemplateLiteral:()=>J_,$ZodTransform:()=>j_,$ZodTuple:()=>nd,$ZodType:()=>W,$ZodULID:()=>Xg,$ZodURL:()=>Hg,$ZodUUID:()=>Vg,$ZodUndefined:()=>y_,$ZodUnion:()=>Va,$ZodUnknown:()=>w_,$ZodVoid:()=>$_,$ZodXID:()=>Qg,$ZodXor:()=>T_,$brand:()=>Cl,$constructor:()=>$,$input:()=>ev,$output:()=>Q_,Doc:()=>qa,JSONSchema:()=>VT,JSONSchemaGenerator:()=>Ld,NEVER:()=>Nm,TimePrecision:()=>ov,_any:()=>kv,_array:()=>Rv,_base64:()=>Ed,_base64url:()=>zd,_bigint:()=>vv,_boolean:()=>gv,_catch:()=>J3,_check:()=>BT,_cidrv4:()=>$d,_cidrv6:()=>kd,_coercedBigint:()=>yv,_coercedBoolean:()=>_v,_coercedDate:()=>Pv,_coercedNumber:()=>lv,_coercedString:()=>rv,_cuid:()=>_d,_cuid2:()=>vd,_custom:()=>Av,_date:()=>Iv,_decode:()=>Ll,_decodeAsync:()=>Zl,_default:()=>V3,_discriminatedUnion:()=>C3,_e164:()=>Td,_email:()=>ld,_emoji:()=>md,_encode:()=>Ul,_encodeAsync:()=>Ml,_endsWith:()=>Ai,_enum:()=>L3,_file:()=>Cv,_float32:()=>fv,_float64:()=>pv,_gt:()=>kr,_gte:()=>pt,_guid:()=>Ga,_includes:()=>Ri,_int:()=>dv,_int32:()=>hv,_int64:()=>bv,_intersection:()=>A3,_ipv4:()=>wd,_ipv6:()=>Sd,_isoDate:()=>sv,_isoDateTime:()=>iv,_isoDuration:()=>cv,_isoTime:()=>av,_jwt:()=>Id,_ksuid:()=>xd,_lazy:()=>X3,_length:()=>wo,_literal:()=>Z3,_lowercase:()=>Pi,_lt:()=>$r,_lte:()=>At,_mac:()=>nv,_map:()=>j3,_max:()=>At,_maxLength:()=>xo,_maxSize:()=>Rn,_mime:()=>Ni,_min:()=>pt,_minLength:()=>Jr,_minSize:()=>Er,_multipleOf:()=>On,_nan:()=>Ov,_nanoid:()=>gd,_nativeEnum:()=>M3,_negative:()=>Od,_never:()=>zv,_nonnegative:()=>Cd,_nonoptional:()=>W3,_nonpositive:()=>Rd,_normalize:()=>Di,_null:()=>$v,_nullable:()=>B3,_number:()=>uv,_optional:()=>q3,_overwrite:()=>ur,_parse:()=>Si,_parseAsync:()=>$i,_pipe:()=>G3,_positive:()=>Pd,_promise:()=>Q3,_property:()=>Ad,_readonly:()=>K3,_record:()=>D3,_refine:()=>Nv,_regex:()=>Ii,_safeDecode:()=>ql,_safeDecodeAsync:()=>Vl,_safeEncode:()=>Fl,_safeEncodeAsync:()=>Bl,_safeParse:()=>ki,_safeParseAsync:()=>Ei,_set:()=>U3,_size:()=>bo,_slugify:()=>Mi,_startsWith:()=>Ci,_string:()=>tv,_stringFormat:()=>Zi,_stringbool:()=>Lv,_success:()=>H3,_superRefine:()=>Dv,_symbol:()=>wv,_templateLiteral:()=>Y3,_toLowerCase:()=>Ui,_toUpperCase:()=>Li,_transform:()=>F3,_trim:()=>ji,_tuple:()=>N3,_uint32:()=>mv,_uint64:()=>xv,_ulid:()=>yd,_undefined:()=>Sv,_union:()=>O3,_unknown:()=>Ev,_uppercase:()=>Oi,_url:()=>Ka,_uuid:()=>dd,_uuidv4:()=>fd,_uuidv6:()=>pd,_uuidv7:()=>hd,_void:()=>Tv,_xid:()=>bd,_xor:()=>R3,clone:()=>ft,config:()=>Ne,createStandardJSONSchemaMethod:()=>Fi,createToJSONSchemaMethod:()=>Mv,decode:()=>rB,decodeAsync:()=>oB,describe:()=>jv,encode:()=>tB,encodeAsync:()=>nB,extractDefs:()=>An,finalize:()=>Nn,flattenError:()=>La,formatError:()=>Ma,globalConfig:()=>Oa,globalRegistry:()=>Ge,initializeContext:()=>Cn,isValidBase64:()=>l_,isValidBase64URL:()=>Fz,isValidJWT:()=>qz,locales:()=>Ja,meta:()=>Uv,parse:()=>Dl,parseAsync:()=>jl,prettifyError:()=>Hm,process:()=>de,regexes:()=>Vt,registry:()=>ud,safeDecode:()=>sB,safeDecodeAsync:()=>cB,safeEncode:()=>iB,safeEncodeAsync:()=>aB,safeParse:()=>Jm,safeParseAsync:()=>Gm,toDotPath:()=>$z,toJSONSchema:()=>Ud,treeifyError:()=>Wm,util:()=>O,version:()=>Fg});var Nm=Object.freeze({status:"aborted"});function $(e,t,r){function o(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);let c=s.prototype,l=Object.keys(c);for(let f=0;f<l.length;f++){let h=l[f];h in a||(a[h]=c[h].bind(a))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function s(a){var u;let c=r?.Parent?new i:this;o(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Cl=Symbol("zod_brand"),cr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},En=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Oa={};function Ne(e){return e&&Object.assign(Oa,e),Oa}var O={};Zt(O,{BIGINT_FORMAT_RANGES:()=>Vm,Class:()=>jm,NUMBER_FORMAT_RANGES:()=>Bm,aborted:()=>Pn,allowsEval:()=>Mm,assert:()=>Cq,assertEqual:()=>Iq,assertIs:()=>Oq,assertNever:()=>Rq,assertNotEqual:()=>Pq,assignProp:()=>Tn,base64ToUint8Array:()=>xz,base64urlToUint8Array:()=>Kq,cached:()=>xi,captureStackTrace:()=>Nl,cleanEnum:()=>Gq,cleanRegex:()=>Aa,clone:()=>ft,cloneDef:()=>Nq,createTransparentProxy:()=>Zq,defineLazy:()=>Y,esc:()=>Al,escapeRegex:()=>Bt,extend:()=>Bq,finalizeIssue:()=>xt,floatSafeRemainder:()=>Um,getElementAtPath:()=>Dq,getEnumValues:()=>Ca,getLengthableOrigin:()=>ja,getParsedType:()=>Mq,getSizableOrigin:()=>Da,hexToUint8Array:()=>Xq,isObject:()=>_o,isPlainObject:()=>In,issue:()=>wi,joinValues:()=>E,jsonStringifyReplacer:()=>bi,merge:()=>Wq,mergeDefs:()=>Hr,normalizeParams:()=>R,nullish:()=>zn,numKeys:()=>Lq,objectClone:()=>Aq,omit:()=>qq,optionalKeys:()=>qm,parsedType:()=>P,partial:()=>Hq,pick:()=>Fq,prefixIssues:()=>Ct,primitiveTypes:()=>Fm,promiseAllObject:()=>jq,propertyKeyTypes:()=>Na,randomString:()=>Uq,required:()=>Jq,safeExtend:()=>Vq,shallowClone:()=>Zm,slugify:()=>Lm,stringifyPrimitive:()=>I,uint8ArrayToBase64:()=>wz,uint8ArrayToBase64url:()=>Yq,uint8ArrayToHex:()=>Qq,unwrapMessage:()=>Ra});function Iq(e){return e}function Pq(e){return e}function Oq(e){}function Rq(e){throw new Error("Unexpected value in exhaustive check")}function Cq(e){}function Ca(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function E(e,t="|"){return e.map(r=>I(r)).join(t)}function bi(e,t){return typeof t=="bigint"?t.toString():t}function xi(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function zn(e){return e==null}function Aa(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Um(e,t){let r=(e.toString().split(".")[1]||"").length,o=t.toString(),n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){let u=o.match(/\d?e-(\d?)/);u?.[1]&&(n=Number.parseInt(u[1]))}let i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}var bz=Symbol("evaluating");function Y(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==bz)return o===void 0&&(o=bz,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Aq(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Tn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Hr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Nq(e){return Hr(e._zod.def)}function Dq(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function jq(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function Uq(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Al(e){return JSON.stringify(e)}function Lm(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Nl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Mm=xi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(e){if(_o(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(_o(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Zm(e){return In(e)?{...e}:Array.isArray(e)?[...e]:e}function Lq(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Mq=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Na=new Set(["string","number","symbol"]),Fm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ft(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function R(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Zq(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function I(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function qm(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Bm={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Fq(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Hr(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return Tn(this,"shape",s),s},checks:[]});return ft(e,i)}function qq(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Hr(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return Tn(this,"shape",s),s},checks:[]});return ft(e,i)}function Bq(e,t){if(!In(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Hr(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Tn(this,"shape",i),i}});return ft(e,n)}function Vq(e,t){if(!In(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Hr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Tn(this,"shape",o),o}});return ft(e,r)}function Wq(e,t){let r=Hr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Tn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ft(e,r)}function Hq(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Hr(t._zod.def,{get shape(){let a=t._zod.def.shape,u={...a};if(r)for(let c in r){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(u[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(let c in a)u[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Tn(this,"shape",u),u},checks:[]});return ft(t,s)}function Jq(e,t,r){let o=Hr(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return Tn(this,"shape",i),i}});return ft(t,o)}function Pn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ct(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Ra(e){return typeof e=="string"?e:e?.message}function xt(e,t,r){let o={...e,path:e.path??[]};if(!e.message){let n=Ra(e.inst?._zod.def?.error?.(e))??Ra(t?.error?.(e))??Ra(r.customError?.(e))??Ra(r.localeError?.(e))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Da(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ja(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function P(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function wi(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function Gq(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function xz(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function wz(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Kq(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return xz(t+r)}function Yq(e){return wz(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Xq(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function Qq(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var jm=class{constructor(...t){}};var Sz=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,bi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ua=$("$ZodError",Sz),wt=$("$ZodError",Sz,{Parent:Error});function La(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Ma(e,t=r=>r.message){let r={_errors:[]},o=n=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let s=r,a=0;for(;a<i.path.length;){let u=i.path[a];a===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(t(i))):s[u]=s[u]||{_errors:[]},s=s[u],a++}}};return o(e),r}function Wm(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var s,a;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>o({issues:c},u.path));else if(u.code==="invalid_key")o({issues:u.issues},u.path);else if(u.code==="invalid_element")o({issues:u.issues},u.path);else{let c=[...i,...u.path];if(c.length===0){r.errors.push(t(u));continue}let l=r,f=0;for(;f<c.length;){let h=c[f],p=f===c.length-1;typeof h=="string"?(l.properties??(l.properties={}),(s=l.properties)[h]??(s[h]={errors:[]}),l=l.properties[h]):(l.items??(l.items=[]),(a=l.items)[h]??(a[h]={errors:[]}),l=l.items[h]),p&&l.errors.push(t(u)),f++}}};return o(e),r}function $z(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Hm(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${$z(o.path)}`);return t.join(`
|
|
24
|
+
`)}var Si=e=>(t,r,o,n)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new cr;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map(u=>xt(u,i,Ne())));throw Nl(a,n?.callee),a}return s.value},Dl=Si(wt),$i=e=>async(t,r,o,n)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??e)(s.issues.map(u=>xt(u,i,Ne())));throw Nl(a,n?.callee),a}return s.value},jl=$i(wt),ki=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new cr;return i.issues.length?{success:!1,error:new(e??Ua)(i.issues.map(s=>xt(s,n,Ne())))}:{success:!0,data:i.value}},Jm=ki(wt),Ei=e=>async(t,r,o)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>xt(s,n,Ne())))}:{success:!0,data:i.value}},Gm=Ei(wt),Ul=e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Si(e)(t,r,n)},tB=Ul(wt),Ll=e=>(t,r,o)=>Si(e)(t,r,o),rB=Ll(wt),Ml=e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return $i(e)(t,r,n)},nB=Ml(wt),Zl=e=>async(t,r,o)=>$i(e)(t,r,o),oB=Zl(wt),Fl=e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ki(e)(t,r,n)},iB=Fl(wt),ql=e=>(t,r,o)=>ki(e)(t,r,o),sB=ql(wt),Bl=e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ei(e)(t,r,n)},aB=Bl(wt),Vl=e=>async(t,r,o)=>Ei(e)(t,r,o),cB=Vl(wt);var Vt={};Zt(Vt,{base64:()=>dg,base64url:()=>Wl,bigint:()=>_g,boolean:()=>yg,browserEmail:()=>gB,cidrv4:()=>ug,cidrv6:()=>lg,cuid:()=>Km,cuid2:()=>Ym,date:()=>pg,datetime:()=>mg,domain:()=>yB,duration:()=>rg,e164:()=>fg,email:()=>og,emoji:()=>ig,extendedDuration:()=>uB,guid:()=>ng,hex:()=>bB,hostname:()=>vB,html5Email:()=>pB,idnEmail:()=>mB,integer:()=>vg,ipv4:()=>sg,ipv6:()=>ag,ksuid:()=>eg,lowercase:()=>wg,mac:()=>cg,md5_base64:()=>wB,md5_base64url:()=>SB,md5_hex:()=>xB,nanoid:()=>tg,null:()=>bg,number:()=>Hl,rfc5322Email:()=>hB,sha1_base64:()=>kB,sha1_base64url:()=>EB,sha1_hex:()=>$B,sha256_base64:()=>TB,sha256_base64url:()=>IB,sha256_hex:()=>zB,sha384_base64:()=>OB,sha384_base64url:()=>RB,sha384_hex:()=>PB,sha512_base64:()=>AB,sha512_base64url:()=>NB,sha512_hex:()=>CB,string:()=>gg,time:()=>hg,ulid:()=>Xm,undefined:()=>xg,unicodeEmail:()=>kz,uppercase:()=>Sg,uuid:()=>vo,uuid4:()=>lB,uuid6:()=>dB,uuid7:()=>fB,xid:()=>Qm});var Km=/^[cC][^\s-]{8,}$/,Ym=/^[0-9a-z]+$/,Xm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qm=/^[0-9a-vA-V]{20}$/,eg=/^[A-Za-z0-9]{27}$/,tg=/^[a-zA-Z0-9_-]{21}$/,rg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,uB=/^[-+]?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)?)??$/,ng=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vo=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lB=vo(4),dB=vo(6),fB=vo(7),og=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pB=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hB=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,kz=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mB=kz,gB=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_B="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ig(){return new RegExp(_B,"u")}var sg=/^(?:(?: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])$/,ag=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,cg=e=>{let t=Bt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},ug=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,lg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wl=/^[A-Za-z0-9_-]*$/,vB=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,yB=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,fg=/^\+[1-9]\d{6,14}$/,Ez="(?:(?:\\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])))",pg=new RegExp(`^${Ez}$`);function zz(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function hg(e){return new RegExp(`^${zz(e)}$`)}function mg(e){let t=zz({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ez}T(?:${o})$`)}var gg=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},_g=/^-?\d+n?$/,vg=/^-?\d+$/,Hl=/^-?\d+(?:\.\d+)?$/,yg=/^(?:true|false)$/i,bg=/^null$/i;var xg=/^undefined$/i;var wg=/^[^A-Z]*$/,Sg=/^[^a-z]*$/,bB=/^[0-9a-fA-F]*$/;function Za(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Fa(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var xB=/^[0-9a-fA-F]{32}$/,wB=Za(22,"=="),SB=Fa(22),$B=/^[0-9a-fA-F]{40}$/,kB=Za(27,"="),EB=Fa(27),zB=/^[0-9a-fA-F]{64}$/,TB=Za(43,"="),IB=Fa(43),PB=/^[0-9a-fA-F]{96}$/,OB=Za(64,""),RB=Fa(64),CB=/^[0-9a-fA-F]{128}$/,AB=Za(86,"=="),NB=Fa(86);var ge=$("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Iz={number:"number",bigint:"bigint",object:"date"},Jl=$("$ZodCheckLessThan",(e,t)=>{ge.init(e,t);let r=Iz[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Gl=$("$ZodCheckGreaterThan",(e,t)=>{ge.init(e,t);let r=Iz[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$g=$("$ZodCheckMultipleOf",(e,t)=>{ge.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Um(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),kg=$("$ZodCheckNumberFormat",(e,t)=>{ge.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Bm[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=n,a.maximum=i,r&&(a.pattern=vg)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Eg=$("$ZodCheckBigIntFormat",(e,t)=>{ge.init(e,t);let[r,o]=Vm[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),zg=$("$ZodCheckMaxSize",(e,t)=>{var r;ge.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Da(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Tg=$("$ZodCheckMinSize",(e,t)=>{var r;ge.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Da(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ig=$("$ZodCheckSizeEquals",(e,t)=>{var r;ge.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:Da(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Pg=$("$ZodCheckMaxLength",(e,t)=>{var r;ge.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let s=ja(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Og=$("$ZodCheckMinLength",(e,t)=>{var r;ge.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let s=ja(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Rg=$("$ZodCheckLengthEquals",(e,t)=>{var r;ge.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let s=ja(n),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),zi=$("$ZodCheckStringFormat",(e,t)=>{var r,o;ge.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Cg=$("$ZodCheckRegex",(e,t)=>{zi.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ag=$("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=wg),zi.init(e,t)}),Ng=$("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sg),zi.init(e,t)}),Dg=$("$ZodCheckIncludes",(e,t)=>{ge.init(e,t);let r=Bt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),jg=$("$ZodCheckStartsWith",(e,t)=>{ge.init(e,t);let r=new RegExp(`^${Bt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Ug=$("$ZodCheckEndsWith",(e,t)=>{ge.init(e,t);let r=new RegExp(`.*${Bt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Tz(e,t,r){e.issues.length&&t.issues.push(...Ct(r,e.issues))}var Lg=$("$ZodCheckProperty",(e,t)=>{ge.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Tz(n,r,t.property));Tz(o,r,t.property)}}),Mg=$("$ZodCheckMimeType",(e,t)=>{ge.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Zg=$("$ZodCheckOverwrite",(e,t)=>{ge.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var qa=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
25
|
+
`).filter(s=>s),n=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
26
|
+
`))}};var Fg={major:4,minor:3,patch:5};var W=$("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fg;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,u)=>{let c=Pn(s),l;for(let f of a){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(c)continue;let h=s.issues.length,p=f._zod.check(s);if(p instanceof Promise&&u?.async===!1)throw new cr;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,s.issues.length!==h&&(c||(c=Pn(s,h)))});else{if(s.issues.length===h)continue;c||(c=Pn(s,h))}}return l?l.then(()=>s):s},i=(s,a,u)=>{if(Pn(s))return s.aborted=!0,s;let c=n(a,o,u);if(c instanceof Promise){if(u.async===!1)throw new cr;return c.then(l=>e._zod.parse(l,u))}return e._zod.parse(c,u)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(l=>i(l,s,a)):i(c,s,a)}let u=e._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new cr;return u.then(c=>n(c,o,a))}return n(u,o,a)}}Y(e,"~standard",()=>({validate:n=>{try{let i=Jm(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Gm(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),yo=$("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??gg(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),fe=$("$ZodStringFormat",(e,t)=>{zi.init(e,t),yo.init(e,t)}),Bg=$("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ng),fe.init(e,t)}),Vg=$("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vo(o))}else t.pattern??(t.pattern=vo());fe.init(e,t)}),Wg=$("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=og),fe.init(e,t)}),Hg=$("$ZodURL",(e,t)=>{fe.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Jg=$("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ig()),fe.init(e,t)}),Gg=$("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=tg),fe.init(e,t)}),Kg=$("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Km),fe.init(e,t)}),Yg=$("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ym),fe.init(e,t)}),Xg=$("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Xm),fe.init(e,t)}),Qg=$("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Qm),fe.init(e,t)}),e_=$("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eg),fe.init(e,t)}),t_=$("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=mg(t)),fe.init(e,t)}),r_=$("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=pg),fe.init(e,t)}),n_=$("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=hg(t)),fe.init(e,t)}),o_=$("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rg),fe.init(e,t)}),i_=$("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=sg),fe.init(e,t),e._zod.bag.format="ipv4"}),s_=$("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ag),fe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),a_=$("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=cg(t.delimiter)),fe.init(e,t),e._zod.bag.format="mac"}),c_=$("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ug),fe.init(e,t)}),u_=$("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=lg),fe.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function l_(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var d_=$("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=dg),fe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{l_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Fz(e){if(!Wl.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return l_(r)}var f_=$("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wl),fe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Fz(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),p_=$("$ZodE164",(e,t)=>{t.pattern??(t.pattern=fg),fe.init(e,t)});function qz(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var h_=$("$ZodJWT",(e,t)=>{fe.init(e,t),e._zod.check=r=>{qz(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),m_=$("$ZodCustomStringFormat",(e,t)=>{fe.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),td=$("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??Hl,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),g_=$("$ZodNumberFormat",(e,t)=>{kg.init(e,t),td.init(e,t)}),Ba=$("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=yg,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),rd=$("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=_g,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),__=$("$ZodBigIntFormat",(e,t)=>{Eg.init(e,t),rd.init(e,t)}),v_=$("$ZodSymbol",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),y_=$("$ZodUndefined",(e,t)=>{W.init(e,t),e._zod.pattern=xg,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),b_=$("$ZodNull",(e,t)=>{W.init(e,t),e._zod.pattern=bg,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),x_=$("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),w_=$("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),S_=$("$ZodNever",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),$_=$("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),k_=$("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Oz(e,t,r){e.issues.length&&t.issues.push(...Ct(r,e.issues)),t.value[r]=e.value}var E_=$("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let a=n[s],u=t.element._zod.run({value:a,issues:[]},o);u instanceof Promise?i.push(u.then(c=>Oz(c,r,s))):Oz(u,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function ed(e,t,r,o,n){if(e.issues.length){if(n&&!(r in o))return;t.issues.push(...Ct(r,e.issues))}e.value===void 0?r in o&&(t.value[r]=void 0):t.value[r]=e.value}function Bz(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=qm(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Vz(e,t,r,o,n,i){let s=[],a=n.keySet,u=n.catchall._zod,c=u.def.type,l=u.optout==="optional";for(let f in t){if(a.has(f))continue;if(c==="never"){s.push(f);continue}let h=u.run({value:t[f],issues:[]},o);h instanceof Promise?e.push(h.then(p=>ed(p,r,f,t,l))):ed(h,r,f,t,l)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var Wz=$("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...a};return Object.defineProperty(t,"shape",{value:u}),u}})}let o=xi(()=>Bz(t));Y(e._zod,"propValues",()=>{let a=t.shape,u={};for(let c in a){let l=a[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(let f of l.values)u[c].add(f)}}return u});let n=_o,i=t.catchall,s;e._zod.parse=(a,u)=>{s??(s=o.value);let c=a.value;if(!n(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};let l=[],f=s.shape;for(let h of s.keys){let p=f[h],g=p._zod.optout==="optional",m=p._zod.run({value:c[h],issues:[]},u);m instanceof Promise?l.push(m.then(_=>ed(_,a,h,c,g))):ed(m,a,h,c,g)}return i?Vz(l,c,a,u,o.value,e):l.length?Promise.all(l).then(()=>a):a}}),z_=$("$ZodObjectJIT",(e,t)=>{Wz.init(e,t);let r=e._zod.parse,o=xi(()=>Bz(t)),n=h=>{let p=new qa(["shape","payload","ctx"]),g=o.value,m=k=>{let b=Al(k);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");let _=Object.create(null),v=0;for(let k of g.keys)_[k]=`key_${v++}`;p.write("const newResult = {};");for(let k of g.keys){let b=_[k],x=Al(k),C=h[k]?._zod?.optout==="optional";p.write(`const ${b} = ${m(k)};`),C?p.write(`
|
|
27
|
+
if (${b}.issues.length) {
|
|
28
|
+
if (${x} in input) {
|
|
29
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
30
|
+
...iss,
|
|
31
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
32
|
+
})));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (${b}.value === undefined) {
|
|
37
|
+
if (${x} in input) {
|
|
38
|
+
newResult[${x}] = undefined;
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
newResult[${x}] = ${b}.value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
`):p.write(`
|
|
45
|
+
if (${b}.issues.length) {
|
|
46
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
47
|
+
...iss,
|
|
48
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
49
|
+
})));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${b}.value === undefined) {
|
|
53
|
+
if (${x} in input) {
|
|
54
|
+
newResult[${x}] = undefined;
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
newResult[${x}] = ${b}.value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");let S=p.compile();return(k,b)=>S(h,k,b)},i,s=_o,a=!Oa.jitless,c=a&&Mm.value,l=t.catchall,f;e._zod.parse=(h,p)=>{f??(f=o.value);let g=h.value;return s(g)?a&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=n(t.shape)),h=i(h,p),l?Vz([],g,h,p,f,e):h):r(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function Rz(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Pn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>xt(s,o,Ne())))}),t)}var Va=$("$ZodUnion",(e,t)=>{W.init(e,t),Y(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Aa(i.source)).join("|")})$`)}});let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,a=[];for(let u of t.options){let c=u._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(u=>Rz(u,n,e,i)):Rz(a,n,e,i)}});function Cz(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>xt(s,o,Ne())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var T_=$("$ZodXor",(e,t)=>{Va.init(e,t),t.inclusive=!1;let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,a=[];for(let u of t.options){let c=u._zod.run({value:n.value,issues:[]},i);c instanceof Promise?(a.push(c),s=!0):a.push(c)}return s?Promise.all(a).then(u=>Cz(u,n,e,i)):Cz(a,n,e,i)}}),I_=$("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Va.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,u]of Object.entries(s)){n[a]||(n[a]=new Set);for(let c of u)n[a].add(c)}}return n});let o=xi(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of a){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!_o(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(n,i):t.unionFallback?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),P_=$("$ZodIntersection",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,c])=>Az(r,u,c)):Az(r,i,s)}});function qg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(In(e)&&In(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=qg(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=qg(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Az(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let u of a.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let u of a.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n&&e.issues.push({...n,keys:i}),Pn(e))return e;let s=qg(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var nd=$("$ZodTuple",(e,t)=>{W.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=[...r].reverse().findIndex(l=>l._zod.optin!=="optional"),u=a===-1?0:r.length-a;if(!t.rest){let l=i.length>r.length,f=i.length<u-1;if(l||f)return o.issues.push({...l?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:i,inst:e,origin:"array"}),o}let c=-1;for(let l of r){if(c++,c>=i.length&&c>=u)continue;let f=l._zod.run({value:i[c],issues:[]},n);f instanceof Promise?s.push(f.then(h=>Kl(h,o,c))):Kl(f,o,c)}if(t.rest){let l=i.slice(r.length);for(let f of l){c++;let h=t.rest._zod.run({value:f,issues:[]},n);h instanceof Promise?s.push(h.then(p=>Kl(p,o,c))):Kl(h,o,c)}}return s.length?Promise.all(s).then(()=>o):o}});function Kl(e,t,r){e.issues.length&&t.issues.push(...Ct(r,e.issues)),t.value[r]=e.value}var O_=$("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!In(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let l=t.valueType._zod.run({value:n[c],issues:[]},o);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&r.issues.push(...Ct(c,f.issues)),r.value[c]=f.value})):(l.issues.length&&r.issues.push(...Ct(c,l.issues)),r.value[c]=l.value)}let u;for(let c in n)a.has(c)||(u=u??[],u.push(c));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let u=t.keyType._zod.run({value:a,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Hl.test(a)&&u.issues.length&&u.issues.some(f=>f.code==="invalid_type"&&f.expected==="number")){let f=t.keyType._zod.run({value:Number(a),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(u=f)}if(u.issues.length){t.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>xt(f,o,Ne())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&r.issues.push(...Ct(a,f.issues)),r.value[u.value]=f.value})):(l.issues.length&&r.issues.push(...Ct(a,l.issues)),r.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),R_=$("$ZodMap",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[s,a]of n){let u=t.keyType._zod.run({value:s,issues:[]},o),c=t.valueType._zod.run({value:a,issues:[]},o);u instanceof Promise||c instanceof Promise?i.push(Promise.all([u,c]).then(([l,f])=>{Nz(l,f,r,s,n,e,o)})):Nz(u,c,r,s,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Nz(e,t,r,o,n,i,s){e.issues.length&&(Na.has(typeof o)?r.issues.push(...Ct(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(a=>xt(a,s,Ne()))})),t.issues.length&&(Na.has(typeof o)?r.issues.push(...Ct(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(a=>xt(a,s,Ne()))})),r.value.set(e.value,t.value)}var C_=$("$ZodSet",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let a=t.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then(u=>Dz(u,r))):Dz(a,r)}return i.length?Promise.all(i).then(()=>r):r}});function Dz(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var A_=$("$ZodEnum",(e,t)=>{W.init(e,t);let r=Ca(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Na.has(typeof n)).map(n=>typeof n=="string"?Bt(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),N_=$("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Bt(o):o?Bt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),D_=$("$ZodFile",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),j_=$("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new En(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new cr;return r.value=n,r}});function jz(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var od=$("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Aa(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>jz(i,r.value)):jz(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),U_=$("$ZodExactOptional",(e,t)=>{od.init(e,t),Y(e._zod,"values",()=>t.innerType._zod.values),Y(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),L_=$("$ZodNullable",(e,t)=>{W.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Aa(r.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),M_=$("$ZodDefault",(e,t)=>{W.init(e,t),e._zod.optin="optional",Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Uz(i,t)):Uz(n,t)}});function Uz(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Z_=$("$ZodPrefault",(e,t)=>{W.init(e,t),e._zod.optin="optional",Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),F_=$("$ZodNonOptional",(e,t)=>{W.init(e,t),Y(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Lz(i,e)):Lz(n,e)}});function Lz(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var q_=$("$ZodSuccess",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new En("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),B_=$("$ZodCatch",(e,t)=>{W.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>xt(s,o,Ne()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>xt(i,o,Ne()))},input:r.value}),r.issues=[]),r)}}),V_=$("$ZodNaN",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),W_=$("$ZodPipe",(e,t)=>{W.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Yl(s,t.in,o)):Yl(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Yl(i,t.out,o)):Yl(n,t.out,o)}});function Yl(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Wa=$("$ZodCodec",(e,t)=>{W.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(s=>Xl(s,t,o)):Xl(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Xl(s,t,o)):Xl(i,t,o)}}});function Xl(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ql(e,i,t.out,r)):Ql(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ql(e,i,t.in,r)):Ql(e,n,t.in,r)}}function Ql(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var H_=$("$ZodReadonly",(e,t)=>{W.init(e,t),Y(e._zod,"propValues",()=>t.innerType._zod.propValues),Y(e._zod,"values",()=>t.innerType._zod.values),Y(e._zod,"optin",()=>t.innerType?._zod?.optin),Y(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Mz):Mz(n)}});function Mz(e){return e.value=Object.freeze(e.value),e}var J_=$("$ZodTemplateLiteral",(e,t)=>{W.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||Fm.has(typeof o))r.push(Bt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),G_=$("$ZodFunction",(e,t)=>(W.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?Dl(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Dl(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await jl(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await jl(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new nd({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),K_=$("$ZodPromise",(e,t)=>{W.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Y_=$("$ZodLazy",(e,t)=>{W.init(e,t),Y(e._zod,"innerType",()=>t.getter()),Y(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Y(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Y(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Y(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),X_=$("$ZodCustom",(e,t)=>{ge.init(e,t),W.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Zz(i,r,o,e));Zz(n,r,o,e)}});function Zz(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(wi(n))}}var Ja={};Zt(Ja,{ar:()=>Hz,az:()=>Jz,be:()=>Kz,bg:()=>Yz,ca:()=>Xz,cs:()=>Qz,da:()=>eT,de:()=>tT,en:()=>id,eo:()=>rT,es:()=>nT,fa:()=>oT,fi:()=>iT,fr:()=>sT,frCA:()=>aT,he:()=>cT,hu:()=>uT,hy:()=>dT,id:()=>fT,is:()=>pT,it:()=>hT,ja:()=>mT,ka:()=>gT,kh:()=>_T,km:()=>sd,ko:()=>vT,lt:()=>bT,mk:()=>xT,ms:()=>wT,nl:()=>ST,no:()=>$T,ota:()=>kT,pl:()=>zT,ps:()=>ET,pt:()=>TT,ru:()=>PT,sl:()=>OT,sv:()=>RT,ta:()=>CT,th:()=>AT,tr:()=>NT,ua:()=>DT,uk:()=>ad,ur:()=>jT,uz:()=>UT,vi:()=>LT,yo:()=>FT,zhCN:()=>MT,zhTW:()=>ZT});var jB=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${I(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${E(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Hz(){return{localeError:jB()}}var UB=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${I(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Jz(){return{localeError:UB()}}function Gz(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var LB=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${I(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),u=Gz(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),u=Gz(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Kz(){return{localeError:LB()}}var MB=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${I(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function Yz(){return{localeError:MB()}}var ZB=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${I(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${E(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function Xz(){return{localeError:ZB()}}var FB=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${I(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${E(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Qz(){return{localeError:FB()}}var qB=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${I(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function eT(){return{localeError:qB()}}var BB=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${I(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function tT(){return{localeError:BB()}}var VB=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${I(n.values[0])}`:`Invalid option: expected one of ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function id(){return{localeError:VB()}}var WB=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${I(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function rT(){return{localeError:WB()}}var HB=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${I(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function nT(){return{localeError:HB()}}var JB=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${I(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${E(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${E(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function oT(){return{localeError:JB()}}var GB=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${I(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${E(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function iT(){return{localeError:GB()}}var KB=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${I(n.values[0])} attendu`:`Option invalide : une valeur parmi ${E(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${E(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function sT(){return{localeError:KB()}}var YB=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${I(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${E(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function aT(){return{localeError:YB()}}var XB=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=c=>c?e[c]:void 0,o=c=>{let l=r(c);return l?l.label:c??e.unknown.label},n=c=>`\u05D4${o(c)}`,i=c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=c=>c?t[c]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let l=c.expected,f=u[l??""]??o(l),h=P(c.input),p=u[h]??e[h]?.label??h;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${I(c.values[0])}`;let l=c.values.map(p=>I(p));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;let f=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${f}`}case"too_big":{let l=s(c.origin),f=n(c.origin??"value");if(c.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",m=c.inclusive?`${c.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let h=c.inclusive?"<=":"<",p=i(c.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${f} ${p} ${h}${c.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${f} ${p} ${h}${c.maximum.toString()}`}case"too_small":{let l=s(c.origin),f=n(c.origin??"value");if(c.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let _=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let m=c.inclusive?`${c.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let h=c.inclusive?">=":">",p=i(c.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${f} ${p} ${h}${c.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${f} ${p} ${h}${c.minimum.toString()}`}case"invalid_format":{let l=c;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;let f=a[l.format],h=f?.label??l.format,g=(f?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${h} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${E(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function cT(){return{localeError:XB()}}var QB=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${I(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function uT(){return{localeError:QB()}}function lT(e,t,r){return Math.abs(e)===1?t:r}function Ti(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var e3=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${I(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),u=lT(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ti(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ti(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),u=lT(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ti(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ti(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${E(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Ti(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Ti(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function dT(){return{localeError:e3()}}var t3=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${I(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function fT(){return{localeError:t3()}}var r3=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${I(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${E(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function pT(){return{localeError:r3()}}var n3=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${I(n.values[0])}`:`Opzione non valida: atteso uno tra ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${E(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function hT(){return{localeError:n3()}}var o3=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${I(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${E(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${E(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function mT(){return{localeError:o3()}}var i3=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${I(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${E(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function gT(){return{localeError:i3()}}var s3=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${I(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${E(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function sd(){return{localeError:s3()}}function _T(){return sd()}var a3=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${I(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${E(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),u=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),u=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${E(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function vT(){return{localeError:a3()}}var Ha=e=>e.charAt(0).toUpperCase()+e.slice(1);function yT(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var c3=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,s,a){let u=e[n]??null;return u===null?u:{unit:u.unit[i],verb:u.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${I(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${E(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=t(n.origin,yT(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Ha(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ha(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=t(n.origin,yT(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Ha(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ha(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${E(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Ha(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function bT(){return{localeError:c3()}}var u3=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${I(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function xT(){return{localeError:u3()}}var l3=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${I(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${E(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function wT(){return{localeError:l3()}}var d3=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${I(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function ST(){return{localeError:d3()}}var f3=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${I(n.values[0])}`:`Ugyldig valg: forventet en av ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function $T(){return{localeError:f3()}}var p3=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${I(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function kT(){return{localeError:p3()}}var h3=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${I(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${E(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function ET(){return{localeError:h3()}}var m3=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${I(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function zT(){return{localeError:m3()}}var g3=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${I(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function TT(){return{localeError:g3()}}function IT(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var _3=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${I(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),u=IT(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),u=IT(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function PT(){return{localeError:_3()}}var v3=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${I(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${E(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function OT(){return{localeError:v3()}}var y3=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${I(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function RT(){return{localeError:y3()}}var b3=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${I(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${E(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function CT(){return{localeError:b3()}}var x3=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${I(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${E(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function AT(){return{localeError:x3()}}var w3=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${I(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function NT(){return{localeError:w3()}}var S3=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${I(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function ad(){return{localeError:S3()}}function DT(){return ad()}var $3=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${I(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${E(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${E(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function jT(){return{localeError:$3()}}var k3=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${I(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function UT(){return{localeError:k3()}}var E3=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${I(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${E(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function LT(){return{localeError:E3()}}var z3=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${I(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function MT(){return{localeError:z3()}}var T3=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${I(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${E(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function ZT(){return{localeError:T3()}}var I3=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${I(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${E(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function FT(){return{localeError:I3()}}var qT,Q_=Symbol("ZodOutput"),ev=Symbol("ZodInput"),cd=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ud(){return new cd}(qT=globalThis).__zod_globalRegistry??(qT.__zod_globalRegistry=ud());var Ge=globalThis.__zod_globalRegistry;function tv(e,t){return new e({type:"string",...R(t)})}function rv(e,t){return new e({type:"string",coerce:!0,...R(t)})}function ld(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...R(t)})}function Ga(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...R(t)})}function dd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...R(t)})}function fd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(t)})}function pd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(t)})}function hd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(t)})}function Ka(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...R(t)})}function md(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...R(t)})}function gd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(t)})}function _d(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...R(t)})}function vd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(t)})}function yd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...R(t)})}function bd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...R(t)})}function xd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(t)})}function wd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(t)})}function Sd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(t)})}function nv(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...R(t)})}function $d(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(t)})}function kd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(t)})}function Ed(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...R(t)})}function zd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...R(t)})}function Td(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...R(t)})}function Id(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...R(t)})}var ov={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function iv(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(t)})}function sv(e,t){return new e({type:"string",format:"date",check:"string_format",...R(t)})}function av(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...R(t)})}function cv(e,t){return new e({type:"string",format:"duration",check:"string_format",...R(t)})}function uv(e,t){return new e({type:"number",checks:[],...R(t)})}function lv(e,t){return new e({type:"number",coerce:!0,checks:[],...R(t)})}function dv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...R(t)})}function fv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...R(t)})}function pv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...R(t)})}function hv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...R(t)})}function mv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...R(t)})}function gv(e,t){return new e({type:"boolean",...R(t)})}function _v(e,t){return new e({type:"boolean",coerce:!0,...R(t)})}function vv(e,t){return new e({type:"bigint",...R(t)})}function yv(e,t){return new e({type:"bigint",coerce:!0,...R(t)})}function bv(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...R(t)})}function xv(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...R(t)})}function wv(e,t){return new e({type:"symbol",...R(t)})}function Sv(e,t){return new e({type:"undefined",...R(t)})}function $v(e,t){return new e({type:"null",...R(t)})}function kv(e){return new e({type:"any"})}function Ev(e){return new e({type:"unknown"})}function zv(e,t){return new e({type:"never",...R(t)})}function Tv(e,t){return new e({type:"void",...R(t)})}function Iv(e,t){return new e({type:"date",...R(t)})}function Pv(e,t){return new e({type:"date",coerce:!0,...R(t)})}function Ov(e,t){return new e({type:"nan",...R(t)})}function $r(e,t){return new Jl({check:"less_than",...R(t),value:e,inclusive:!1})}function At(e,t){return new Jl({check:"less_than",...R(t),value:e,inclusive:!0})}function kr(e,t){return new Gl({check:"greater_than",...R(t),value:e,inclusive:!1})}function pt(e,t){return new Gl({check:"greater_than",...R(t),value:e,inclusive:!0})}function Pd(e){return kr(0,e)}function Od(e){return $r(0,e)}function Rd(e){return At(0,e)}function Cd(e){return pt(0,e)}function On(e,t){return new $g({check:"multiple_of",...R(t),value:e})}function Rn(e,t){return new zg({check:"max_size",...R(t),maximum:e})}function Er(e,t){return new Tg({check:"min_size",...R(t),minimum:e})}function bo(e,t){return new Ig({check:"size_equals",...R(t),size:e})}function xo(e,t){return new Pg({check:"max_length",...R(t),maximum:e})}function Jr(e,t){return new Og({check:"min_length",...R(t),minimum:e})}function wo(e,t){return new Rg({check:"length_equals",...R(t),length:e})}function Ii(e,t){return new Cg({check:"string_format",format:"regex",...R(t),pattern:e})}function Pi(e){return new Ag({check:"string_format",format:"lowercase",...R(e)})}function Oi(e){return new Ng({check:"string_format",format:"uppercase",...R(e)})}function Ri(e,t){return new Dg({check:"string_format",format:"includes",...R(t),includes:e})}function Ci(e,t){return new jg({check:"string_format",format:"starts_with",...R(t),prefix:e})}function Ai(e,t){return new Ug({check:"string_format",format:"ends_with",...R(t),suffix:e})}function Ad(e,t,r){return new Lg({check:"property",property:e,schema:t,...R(r)})}function Ni(e,t){return new Mg({check:"mime_type",mime:e,...R(t)})}function ur(e){return new Zg({check:"overwrite",tx:e})}function Di(e){return ur(t=>t.normalize(e))}function ji(){return ur(e=>e.trim())}function Ui(){return ur(e=>e.toLowerCase())}function Li(){return ur(e=>e.toUpperCase())}function Mi(){return ur(e=>Lm(e))}function Rv(e,t,r){return new e({type:"array",element:t,...R(r)})}function O3(e,t,r){return new e({type:"union",options:t,...R(r)})}function R3(e,t,r){return new e({type:"union",options:t,inclusive:!1,...R(r)})}function C3(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...R(o)})}function A3(e,t,r){return new e({type:"intersection",left:t,right:r})}function N3(e,t,r,o){let n=r instanceof W,i=n?o:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...R(i)})}function D3(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...R(o)})}function j3(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...R(o)})}function U3(e,t,r){return new e({type:"set",valueType:t,...R(r)})}function L3(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...R(r)})}function M3(e,t,r){return new e({type:"enum",entries:t,...R(r)})}function Z3(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...R(r)})}function Cv(e,t){return new e({type:"file",...R(t)})}function F3(e,t){return new e({type:"transform",transform:t})}function q3(e,t){return new e({type:"optional",innerType:t})}function B3(e,t){return new e({type:"nullable",innerType:t})}function V3(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Zm(r)}})}function W3(e,t,r){return new e({type:"nonoptional",innerType:t,...R(r)})}function H3(e,t){return new e({type:"success",innerType:t})}function J3(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function G3(e,t,r){return new e({type:"pipe",in:t,out:r})}function K3(e,t){return new e({type:"readonly",innerType:t})}function Y3(e,t,r){return new e({type:"template_literal",parts:t,...R(r)})}function X3(e,t){return new e({type:"lazy",getter:t})}function Q3(e,t){return new e({type:"promise",innerType:t})}function Av(e,t,r){let o=R(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Nv(e,t,r){return new e({type:"custom",check:"custom",fn:t,...R(r)})}function Dv(e){let t=BT(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(wi(o,r.value,t._zod.def));else{let n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(wi(n))}},e(r.value,r)));return t}function BT(e,t){let r=new ge({check:"custom",...R(t)});return r._zod.check=e,r}function jv(e){let t=new ge({check:"describe"});return t._zod.onattach=[r=>{let o=Ge.get(r)??{};Ge.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Uv(e){let t=new ge({check:"meta"});return t._zod.onattach=[r=>{let o=Ge.get(r)??{};Ge.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Lv(e,t){let r=R(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(o),s=new Set(n),a=e.Codec??Wa,u=e.Boolean??Ba,c=e.String??yo,l=new c({type:"string",error:r.error}),f=new u({type:"boolean",error:r.error}),h=new a({type:"pipe",in:l,out:f,transform:((p,g)=>{let m=p;return r.case!=="sensitive"&&(m=m.toLowerCase()),i.has(m)?!0:s.has(m)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:g.value,inst:h,continue:!1}),{})}),reverseTransform:((p,g)=>p===!0?o[0]||"true":n[0]||"false"),error:r.error});return h}function Zi(e,t,r,o={}){let n=R(o),i={...R(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Cn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ge,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function de(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let h=s.schema,p=t.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(e,t,h,l)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),de(f,t,l),t.seen.get(f).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&ht(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function An(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let u=o.get(a);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,h=e.external.uri??(g=>g);if(f)return{ref:h(f)};let p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${h("__shared")}#/${a}/${p}`}}if(s[1]===r)return{ref:"#"};let c=`#/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+l}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:u,defId:c}=n(s);a.def={...a.schema},c&&(a.defId=c);let l=a.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
61
|
+
|
|
62
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Nn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let a=e.seen.get(s);if(a.ref===null)return;let u=a.def??a.schema,c={...u},l=a.ref;if(a.ref=null,l){o(l);let h=e.seen.get(l),p=h.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(p)):Object.assign(u,p),Object.assign(u,c),s._zod.parent===l)for(let m in u)m==="$ref"||m==="allOf"||m in c||delete u[m];if(p.$ref)for(let m in u)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(u[m])===JSON.stringify(h.def[m])&&delete u[m]}let f=s._zod.parent;if(f&&f!==l){o(f);let h=e.seen.get(f);if(h?.schema.$ref&&(u.$ref=h.schema.$ref,h.def))for(let p in u)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(u[p])===JSON.stringify(h.def[p])&&delete u[p]}e.override({zodSchema:s,jsonSchema:u,path:a.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Fi(t,"input",e.processors),output:Fi(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ht(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ht(o.element,r);if(o.type==="set")return ht(o.valueType,r);if(o.type==="lazy")return ht(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ht(o.innerType,r);if(o.type==="intersection")return ht(o.left,r)||ht(o.right,r);if(o.type==="record"||o.type==="map")return ht(o.keyType,r)||ht(o.valueType,r);if(o.type==="pipe")return ht(o.in,r)||ht(o.out,r);if(o.type==="object"){for(let n in o.shape)if(ht(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(ht(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(ht(n,r))return!0;return!!(o.rest&&ht(o.rest,r))}return!1}var Mv=(e,t={})=>r=>{let o=Cn({...r,processors:t});return de(e,o),An(o,e),Nn(o,e)},Fi=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=Cn({...n??{},target:i,io:t,processors:r});return de(e,s),An(s,e),Nn(s,e)};var eV={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zv=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),a&&(n.format=eV[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),c&&(n.contentEncoding=c),u&&u.size>0){let l=[...u];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Fv=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l),typeof i=="number"&&(n.minimum=i,typeof l=="number"&&t.target!=="draft-04"&&(l>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c),typeof s=="number"&&(n.maximum=s,typeof c=="number"&&t.target!=="draft-04"&&(c<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},qv=(e,t,r,o)=>{r.type="boolean"},Bv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Vv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Wv=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Hv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Jv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Gv=(e,t,r,o)=>{r.not={}},Kv=(e,t,r,o)=>{},Yv=(e,t,r,o)=>{},Xv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Qv=(e,t,r,o)=>{let n=e._zod.def,i=Ca(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},ey=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},ty=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},ry=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},ny=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:u}=e._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),u?u.length===1?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(n,i)},oy=(e,t,r,o)=>{r.type="boolean"},iy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ay=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},uy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},ly=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=de(i.element,t,{...o,path:[...o.path,"items"]})},dy=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let c in s)n.properties[c]=de(s[c],t,{...o,path:[...o.path,"properties",c]});let a=new Set(Object.keys(s)),u=new Set([...a].filter(c=>{let l=i.shape[c]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=de(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Dd=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,u)=>de(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},fy=(e,t,r,o)=>{let n=e._zod.def,i=de(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=de(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=u},py=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((h,p)=>de(h,t,{...o,path:[...o.path,s,p]})),c=i.rest?de(i.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,c&&(n.items=c)):t.target==="openapi-3.0"?(n.items={anyOf:u},c&&n.items.anyOf.push(c),n.minItems=u.length,c||(n.maxItems=u.length)):(n.items=u,c&&(n.additionalItems=c));let{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof f=="number"&&(n.maxItems=f)},hy=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,u=s._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let l=de(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of u)n.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=de(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=de(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let c=s._zod.values;if(c){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(n.required=l)}},my=(e,t,r,o)=>{let n=e._zod.def,i=de(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},gy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},_y=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},vy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},yy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},by=(e,t,r,o)=>{let n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;de(i,t,o);let s=t.seen.get(e);s.ref=i},xy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},wy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},jd=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Sy=(e,t,r,o)=>{let n=e._zod.innerType;de(n,t,o);let i=t.seen.get(e);i.ref=n},Nd={string:Zv,number:Fv,boolean:qv,bigint:Bv,symbol:Vv,null:Wv,undefined:Hv,void:Jv,never:Gv,any:Kv,unknown:Yv,date:Xv,enum:Qv,literal:ey,nan:ty,template_literal:ry,file:ny,success:oy,custom:iy,function:sy,transform:ay,map:cy,set:uy,array:ly,object:dy,union:Dd,intersection:fy,tuple:py,record:hy,nullable:my,nonoptional:gy,default:_y,prefault:vy,catch:yy,pipe:by,readonly:xy,promise:wy,optional:jd,lazy:Sy};function Ud(e,t){if("_idmap"in e){let o=e,n=Cn({...t,processors:Nd}),i={};for(let u of o._idmap.entries()){let[c,l]=u;de(l,n)}let s={},a={registry:o,uri:t?.uri,defs:i};n.external=a;for(let u of o._idmap.entries()){let[c,l]=u;An(n,l),s[c]=Nn(n,l)}if(Object.keys(i).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:i}}return{schemas:s}}let r=Cn({...t,processors:Nd});return de(e,r),An(r,e),Nn(r,e)}var Ld=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Cn({processors:Nd,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return de(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),An(this.ctx,t);let o=Nn(this.ctx,t),{"~standard":n,...i}=o;return i}};var VT={};var Ya={};Zt(Ya,{ZodAny:()=>Hy,ZodArray:()=>Yy,ZodBase64:()=>af,ZodBase64URL:()=>cf,ZodBigInt:()=>Gi,ZodBigIntFormat:()=>df,ZodBoolean:()=>Ji,ZodCIDRv4:()=>of,ZodCIDRv6:()=>sf,ZodCUID:()=>Yd,ZodCUID2:()=>Xd,ZodCatch:()=>yb,ZodCodec:()=>yf,ZodCustom:()=>cc,ZodCustomStringFormat:()=>Wi,ZodDate:()=>nc,ZodDefault:()=>pb,ZodDiscriminatedUnion:()=>Qy,ZodE164:()=>uf,ZodEmail:()=>Jd,ZodEmoji:()=>Gd,ZodEnum:()=>Bi,ZodExactOptional:()=>lb,ZodFile:()=>cb,ZodFunction:()=>Tb,ZodGUID:()=>Xa,ZodIPv4:()=>rf,ZodIPv6:()=>nf,ZodIntersection:()=>eb,ZodJWT:()=>lf,ZodKSUID:()=>tf,ZodLazy:()=>kb,ZodLiteral:()=>ab,ZodMAC:()=>My,ZodMap:()=>ib,ZodNaN:()=>xb,ZodNanoID:()=>Kd,ZodNever:()=>Gy,ZodNonOptional:()=>_f,ZodNull:()=>Vy,ZodNullable:()=>fb,ZodNumber:()=>Hi,ZodNumberFormat:()=>$o,ZodObject:()=>ic,ZodOptional:()=>gf,ZodPipe:()=>vf,ZodPrefault:()=>mb,ZodPromise:()=>zb,ZodReadonly:()=>wb,ZodRecord:()=>ac,ZodSet:()=>sb,ZodString:()=>Vi,ZodStringFormat:()=>pe,ZodSuccess:()=>vb,ZodSymbol:()=>qy,ZodTemplateLiteral:()=>$b,ZodTransform:()=>ub,ZodTuple:()=>rb,ZodType:()=>J,ZodULID:()=>Qd,ZodURL:()=>rc,ZodUUID:()=>zr,ZodUndefined:()=>By,ZodUnion:()=>sc,ZodUnknown:()=>Jy,ZodVoid:()=>Ky,ZodXID:()=>ef,ZodXor:()=>Xy,_ZodString:()=>Hd,_default:()=>hb,_function:()=>XI,any:()=>PI,array:()=>oc,base64:()=>pI,base64url:()=>hI,bigint:()=>kI,boolean:()=>Fy,catch:()=>bb,check:()=>QI,cidrv4:()=>dI,cidrv6:()=>fI,codec:()=>GI,cuid:()=>nI,cuid2:()=>oI,custom:()=>eP,date:()=>RI,describe:()=>tP,discriminatedUnion:()=>UI,e164:()=>mI,email:()=>HT,emoji:()=>tI,enum:()=>hf,exactOptional:()=>db,file:()=>VI,float32:()=>xI,float64:()=>wI,function:()=>XI,guid:()=>JT,hash:()=>bI,hex:()=>yI,hostname:()=>vI,httpUrl:()=>eI,instanceof:()=>nP,int:()=>Wd,int32:()=>SI,int64:()=>EI,intersection:()=>tb,ipv4:()=>cI,ipv6:()=>lI,json:()=>iP,jwt:()=>gI,keyof:()=>CI,ksuid:()=>aI,lazy:()=>Eb,literal:()=>BI,looseObject:()=>DI,looseRecord:()=>MI,mac:()=>uI,map:()=>ZI,meta:()=>rP,nan:()=>JI,nanoid:()=>rI,nativeEnum:()=>qI,never:()=>ff,nonoptional:()=>_b,null:()=>Wy,nullable:()=>ec,nullish:()=>WI,number:()=>Zy,object:()=>AI,optional:()=>Qa,partialRecord:()=>LI,pipe:()=>tc,prefault:()=>gb,preprocess:()=>sP,promise:()=>YI,readonly:()=>Sb,record:()=>ob,refine:()=>Ib,set:()=>FI,strictObject:()=>NI,string:()=>Vd,stringFormat:()=>_I,stringbool:()=>oP,success:()=>HI,superRefine:()=>Pb,symbol:()=>TI,templateLiteral:()=>KI,transform:()=>mf,tuple:()=>nb,uint32:()=>$I,uint64:()=>zI,ulid:()=>iI,undefined:()=>II,union:()=>pf,unknown:()=>So,url:()=>QT,uuid:()=>GT,uuidv4:()=>KT,uuidv6:()=>YT,uuidv7:()=>XT,void:()=>OI,xid:()=>sI,xor:()=>jI});var Md={};Zt(Md,{endsWith:()=>Ai,gt:()=>kr,gte:()=>pt,includes:()=>Ri,length:()=>wo,lowercase:()=>Pi,lt:()=>$r,lte:()=>At,maxLength:()=>xo,maxSize:()=>Rn,mime:()=>Ni,minLength:()=>Jr,minSize:()=>Er,multipleOf:()=>On,negative:()=>Od,nonnegative:()=>Cd,nonpositive:()=>Rd,normalize:()=>Di,overwrite:()=>ur,positive:()=>Pd,property:()=>Ad,regex:()=>Ii,size:()=>bo,slugify:()=>Mi,startsWith:()=>Ci,toLowerCase:()=>Ui,toUpperCase:()=>Li,trim:()=>ji,uppercase:()=>Oi});var qi={};Zt(qi,{ZodISODate:()=>Fd,ZodISODateTime:()=>Zd,ZodISODuration:()=>Bd,ZodISOTime:()=>qd,date:()=>ky,datetime:()=>$y,duration:()=>zy,time:()=>Ey});var Zd=$("ZodISODateTime",(e,t)=>{t_.init(e,t),pe.init(e,t)});function $y(e){return iv(Zd,e)}var Fd=$("ZodISODate",(e,t)=>{r_.init(e,t),pe.init(e,t)});function ky(e){return sv(Fd,e)}var qd=$("ZodISOTime",(e,t)=>{n_.init(e,t),pe.init(e,t)});function Ey(e){return av(qd,e)}var Bd=$("ZodISODuration",(e,t)=>{o_.init(e,t),pe.init(e,t)});function zy(e){return cv(Bd,e)}var WT=(e,t)=>{Ua.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ma(e,r)},flatten:{value:r=>La(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,bi,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,bi,2)}},isEmpty:{get(){return e.issues.length===0}}})},rV=$("ZodError",WT),St=$("ZodError",WT,{Parent:Error});var Ty=Si(St),Iy=$i(St),Py=ki(St),Oy=Ei(St),Ry=Ul(St),Cy=Ll(St),Ay=Ml(St),Ny=Zl(St),Dy=Fl(St),jy=ql(St),Uy=Bl(St),Ly=Vl(St);var J=$("ZodType",(e,t)=>(W.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Fi(e,"input"),output:Fi(e,"output")}}),e.toJSONSchema=Mv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(O.mergeDefs(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>ft(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>Ty(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Py(e,r,o),e.parseAsync=async(r,o)=>Iy(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Oy(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Ry(e,r,o),e.decode=(r,o)=>Cy(e,r,o),e.encodeAsync=async(r,o)=>Ay(e,r,o),e.decodeAsync=async(r,o)=>Ny(e,r,o),e.safeEncode=(r,o)=>Dy(e,r,o),e.safeDecode=(r,o)=>jy(e,r,o),e.safeEncodeAsync=async(r,o)=>Uy(e,r,o),e.safeDecodeAsync=async(r,o)=>Ly(e,r,o),e.refine=(r,o)=>e.check(Ib(r,o)),e.superRefine=r=>e.check(Pb(r)),e.overwrite=r=>e.check(ur(r)),e.optional=()=>Qa(e),e.exactOptional=()=>db(e),e.nullable=()=>ec(e),e.nullish=()=>Qa(ec(e)),e.nonoptional=r=>_b(e,r),e.array=()=>oc(e),e.or=r=>pf([e,r]),e.and=r=>tb(e,r),e.transform=r=>tc(e,mf(r)),e.default=r=>hb(e,r),e.prefault=r=>gb(e,r),e.catch=r=>bb(e,r),e.pipe=r=>tc(e,r),e.readonly=()=>Sb(e),e.describe=r=>{let o=e.clone();return Ge.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Ge.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ge.get(e);let o=e.clone();return Ge.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Hd=$("_ZodString",(e,t)=>{yo.init(e,t),J.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Zv(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Ii(...o)),e.includes=(...o)=>e.check(Ri(...o)),e.startsWith=(...o)=>e.check(Ci(...o)),e.endsWith=(...o)=>e.check(Ai(...o)),e.min=(...o)=>e.check(Jr(...o)),e.max=(...o)=>e.check(xo(...o)),e.length=(...o)=>e.check(wo(...o)),e.nonempty=(...o)=>e.check(Jr(1,...o)),e.lowercase=o=>e.check(Pi(o)),e.uppercase=o=>e.check(Oi(o)),e.trim=()=>e.check(ji()),e.normalize=(...o)=>e.check(Di(...o)),e.toLowerCase=()=>e.check(Ui()),e.toUpperCase=()=>e.check(Li()),e.slugify=()=>e.check(Mi())}),Vi=$("ZodString",(e,t)=>{yo.init(e,t),Hd.init(e,t),e.email=r=>e.check(ld(Jd,r)),e.url=r=>e.check(Ka(rc,r)),e.jwt=r=>e.check(Id(lf,r)),e.emoji=r=>e.check(md(Gd,r)),e.guid=r=>e.check(Ga(Xa,r)),e.uuid=r=>e.check(dd(zr,r)),e.uuidv4=r=>e.check(fd(zr,r)),e.uuidv6=r=>e.check(pd(zr,r)),e.uuidv7=r=>e.check(hd(zr,r)),e.nanoid=r=>e.check(gd(Kd,r)),e.guid=r=>e.check(Ga(Xa,r)),e.cuid=r=>e.check(_d(Yd,r)),e.cuid2=r=>e.check(vd(Xd,r)),e.ulid=r=>e.check(yd(Qd,r)),e.base64=r=>e.check(Ed(af,r)),e.base64url=r=>e.check(zd(cf,r)),e.xid=r=>e.check(bd(ef,r)),e.ksuid=r=>e.check(xd(tf,r)),e.ipv4=r=>e.check(wd(rf,r)),e.ipv6=r=>e.check(Sd(nf,r)),e.cidrv4=r=>e.check($d(of,r)),e.cidrv6=r=>e.check(kd(sf,r)),e.e164=r=>e.check(Td(uf,r)),e.datetime=r=>e.check($y(r)),e.date=r=>e.check(ky(r)),e.time=r=>e.check(Ey(r)),e.duration=r=>e.check(zy(r))});function Vd(e){return tv(Vi,e)}var pe=$("ZodStringFormat",(e,t)=>{fe.init(e,t),Hd.init(e,t)}),Jd=$("ZodEmail",(e,t)=>{Wg.init(e,t),pe.init(e,t)});function HT(e){return ld(Jd,e)}var Xa=$("ZodGUID",(e,t)=>{Bg.init(e,t),pe.init(e,t)});function JT(e){return Ga(Xa,e)}var zr=$("ZodUUID",(e,t)=>{Vg.init(e,t),pe.init(e,t)});function GT(e){return dd(zr,e)}function KT(e){return fd(zr,e)}function YT(e){return pd(zr,e)}function XT(e){return hd(zr,e)}var rc=$("ZodURL",(e,t)=>{Hg.init(e,t),pe.init(e,t)});function QT(e){return Ka(rc,e)}function eI(e){return Ka(rc,{protocol:/^https?$/,hostname:Vt.domain,...O.normalizeParams(e)})}var Gd=$("ZodEmoji",(e,t)=>{Jg.init(e,t),pe.init(e,t)});function tI(e){return md(Gd,e)}var Kd=$("ZodNanoID",(e,t)=>{Gg.init(e,t),pe.init(e,t)});function rI(e){return gd(Kd,e)}var Yd=$("ZodCUID",(e,t)=>{Kg.init(e,t),pe.init(e,t)});function nI(e){return _d(Yd,e)}var Xd=$("ZodCUID2",(e,t)=>{Yg.init(e,t),pe.init(e,t)});function oI(e){return vd(Xd,e)}var Qd=$("ZodULID",(e,t)=>{Xg.init(e,t),pe.init(e,t)});function iI(e){return yd(Qd,e)}var ef=$("ZodXID",(e,t)=>{Qg.init(e,t),pe.init(e,t)});function sI(e){return bd(ef,e)}var tf=$("ZodKSUID",(e,t)=>{e_.init(e,t),pe.init(e,t)});function aI(e){return xd(tf,e)}var rf=$("ZodIPv4",(e,t)=>{i_.init(e,t),pe.init(e,t)});function cI(e){return wd(rf,e)}var My=$("ZodMAC",(e,t)=>{a_.init(e,t),pe.init(e,t)});function uI(e){return nv(My,e)}var nf=$("ZodIPv6",(e,t)=>{s_.init(e,t),pe.init(e,t)});function lI(e){return Sd(nf,e)}var of=$("ZodCIDRv4",(e,t)=>{c_.init(e,t),pe.init(e,t)});function dI(e){return $d(of,e)}var sf=$("ZodCIDRv6",(e,t)=>{u_.init(e,t),pe.init(e,t)});function fI(e){return kd(sf,e)}var af=$("ZodBase64",(e,t)=>{d_.init(e,t),pe.init(e,t)});function pI(e){return Ed(af,e)}var cf=$("ZodBase64URL",(e,t)=>{f_.init(e,t),pe.init(e,t)});function hI(e){return zd(cf,e)}var uf=$("ZodE164",(e,t)=>{p_.init(e,t),pe.init(e,t)});function mI(e){return Td(uf,e)}var lf=$("ZodJWT",(e,t)=>{h_.init(e,t),pe.init(e,t)});function gI(e){return Id(lf,e)}var Wi=$("ZodCustomStringFormat",(e,t)=>{m_.init(e,t),pe.init(e,t)});function _I(e,t,r={}){return Zi(Wi,e,t,r)}function vI(e){return Zi(Wi,"hostname",Vt.hostname,e)}function yI(e){return Zi(Wi,"hex",Vt.hex,e)}function bI(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=Vt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Zi(Wi,o,n,t)}var Hi=$("ZodNumber",(e,t)=>{td.init(e,t),J.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Fv(e,o,n,i),e.gt=(o,n)=>e.check(kr(o,n)),e.gte=(o,n)=>e.check(pt(o,n)),e.min=(o,n)=>e.check(pt(o,n)),e.lt=(o,n)=>e.check($r(o,n)),e.lte=(o,n)=>e.check(At(o,n)),e.max=(o,n)=>e.check(At(o,n)),e.int=o=>e.check(Wd(o)),e.safe=o=>e.check(Wd(o)),e.positive=o=>e.check(kr(0,o)),e.nonnegative=o=>e.check(pt(0,o)),e.negative=o=>e.check($r(0,o)),e.nonpositive=o=>e.check(At(0,o)),e.multipleOf=(o,n)=>e.check(On(o,n)),e.step=(o,n)=>e.check(On(o,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Zy(e){return uv(Hi,e)}var $o=$("ZodNumberFormat",(e,t)=>{g_.init(e,t),Hi.init(e,t)});function Wd(e){return dv($o,e)}function xI(e){return fv($o,e)}function wI(e){return pv($o,e)}function SI(e){return hv($o,e)}function $I(e){return mv($o,e)}var Ji=$("ZodBoolean",(e,t)=>{Ba.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qv(e,r,o,n)});function Fy(e){return gv(Ji,e)}var Gi=$("ZodBigInt",(e,t)=>{rd.init(e,t),J.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Bv(e,o,n,i),e.gte=(o,n)=>e.check(pt(o,n)),e.min=(o,n)=>e.check(pt(o,n)),e.gt=(o,n)=>e.check(kr(o,n)),e.gte=(o,n)=>e.check(pt(o,n)),e.min=(o,n)=>e.check(pt(o,n)),e.lt=(o,n)=>e.check($r(o,n)),e.lte=(o,n)=>e.check(At(o,n)),e.max=(o,n)=>e.check(At(o,n)),e.positive=o=>e.check(kr(BigInt(0),o)),e.negative=o=>e.check($r(BigInt(0),o)),e.nonpositive=o=>e.check(At(BigInt(0),o)),e.nonnegative=o=>e.check(pt(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(On(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function kI(e){return vv(Gi,e)}var df=$("ZodBigIntFormat",(e,t)=>{__.init(e,t),Gi.init(e,t)});function EI(e){return bv(df,e)}function zI(e){return xv(df,e)}var qy=$("ZodSymbol",(e,t)=>{v_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vv(e,r,o,n)});function TI(e){return wv(qy,e)}var By=$("ZodUndefined",(e,t)=>{y_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hv(e,r,o,n)});function II(e){return Sv(By,e)}var Vy=$("ZodNull",(e,t)=>{b_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wv(e,r,o,n)});function Wy(e){return $v(Vy,e)}var Hy=$("ZodAny",(e,t)=>{x_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kv(e,r,o,n)});function PI(){return kv(Hy)}var Jy=$("ZodUnknown",(e,t)=>{w_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yv(e,r,o,n)});function So(){return Ev(Jy)}var Gy=$("ZodNever",(e,t)=>{S_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gv(e,r,o,n)});function ff(e){return zv(Gy,e)}var Ky=$("ZodVoid",(e,t)=>{$_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jv(e,r,o,n)});function OI(e){return Tv(Ky,e)}var nc=$("ZodDate",(e,t)=>{k_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Xv(e,o,n,i),e.min=(o,n)=>e.check(pt(o,n)),e.max=(o,n)=>e.check(At(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function RI(e){return Iv(nc,e)}var Yy=$("ZodArray",(e,t)=>{E_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ly(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(Jr(r,o)),e.nonempty=r=>e.check(Jr(1,r)),e.max=(r,o)=>e.check(xo(r,o)),e.length=(r,o)=>e.check(wo(r,o)),e.unwrap=()=>e.element});function oc(e,t){return Rv(Yy,e,t)}function CI(e){let t=e._zod.def.shape;return hf(Object.keys(t))}var ic=$("ZodObject",(e,t)=>{z_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dy(e,r,o,n),O.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>hf(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:So()}),e.loose=()=>e.clone({...e._zod.def,catchall:So()}),e.strict=()=>e.clone({...e._zod.def,catchall:ff()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>O.extend(e,r),e.safeExtend=r=>O.safeExtend(e,r),e.merge=r=>O.merge(e,r),e.pick=r=>O.pick(e,r),e.omit=r=>O.omit(e,r),e.partial=(...r)=>O.partial(gf,e,r[0]),e.required=(...r)=>O.required(_f,e,r[0])});function AI(e,t){let r={type:"object",shape:e??{},...O.normalizeParams(t)};return new ic(r)}function NI(e,t){return new ic({type:"object",shape:e,catchall:ff(),...O.normalizeParams(t)})}function DI(e,t){return new ic({type:"object",shape:e,catchall:So(),...O.normalizeParams(t)})}var sc=$("ZodUnion",(e,t)=>{Va.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dd(e,r,o,n),e.options=t.options});function pf(e,t){return new sc({type:"union",options:e,...O.normalizeParams(t)})}var Xy=$("ZodXor",(e,t)=>{sc.init(e,t),T_.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dd(e,r,o,n),e.options=t.options});function jI(e,t){return new Xy({type:"union",options:e,inclusive:!1,...O.normalizeParams(t)})}var Qy=$("ZodDiscriminatedUnion",(e,t)=>{sc.init(e,t),I_.init(e,t)});function UI(e,t,r){return new Qy({type:"union",options:t,discriminator:e,...O.normalizeParams(r)})}var eb=$("ZodIntersection",(e,t)=>{P_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fy(e,r,o,n)});function tb(e,t){return new eb({type:"intersection",left:e,right:t})}var rb=$("ZodTuple",(e,t)=>{nd.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>py(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function nb(e,t,r){let o=t instanceof W,n=o?r:t,i=o?t:null;return new rb({type:"tuple",items:e,rest:i,...O.normalizeParams(n)})}var ac=$("ZodRecord",(e,t)=>{O_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hy(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ob(e,t,r){return new ac({type:"record",keyType:e,valueType:t,...O.normalizeParams(r)})}function LI(e,t,r){let o=ft(e);return o._zod.values=void 0,new ac({type:"record",keyType:o,valueType:t,...O.normalizeParams(r)})}function MI(e,t,r){return new ac({type:"record",keyType:e,valueType:t,mode:"loose",...O.normalizeParams(r)})}var ib=$("ZodMap",(e,t)=>{R_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cy(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Er(...r)),e.nonempty=r=>e.check(Er(1,r)),e.max=(...r)=>e.check(Rn(...r)),e.size=(...r)=>e.check(bo(...r))});function ZI(e,t,r){return new ib({type:"map",keyType:e,valueType:t,...O.normalizeParams(r)})}var sb=$("ZodSet",(e,t)=>{C_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uy(e,r,o,n),e.min=(...r)=>e.check(Er(...r)),e.nonempty=r=>e.check(Er(1,r)),e.max=(...r)=>e.check(Rn(...r)),e.size=(...r)=>e.check(bo(...r))});function FI(e,t){return new sb({type:"set",valueType:e,...O.normalizeParams(t)})}var Bi=$("ZodEnum",(e,t)=>{A_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Qv(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Bi({...t,checks:[],...O.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Bi({...t,checks:[],...O.normalizeParams(n),entries:i})}});function hf(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Bi({type:"enum",entries:r,...O.normalizeParams(t)})}function qI(e,t){return new Bi({type:"enum",entries:e,...O.normalizeParams(t)})}var ab=$("ZodLiteral",(e,t)=>{N_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ey(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function BI(e,t){return new ab({type:"literal",values:Array.isArray(e)?e:[e],...O.normalizeParams(t)})}var cb=$("ZodFile",(e,t)=>{D_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ny(e,r,o,n),e.min=(r,o)=>e.check(Er(r,o)),e.max=(r,o)=>e.check(Rn(r,o)),e.mime=(r,o)=>e.check(Ni(Array.isArray(r)?r:[r],o))});function VI(e){return Cv(cb,e)}var ub=$("ZodTransform",(e,t)=>{j_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ay(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new En(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(O.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(O.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function mf(e){return new ub({type:"transform",transform:e})}var gf=$("ZodOptional",(e,t)=>{od.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jd(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Qa(e){return new gf({type:"optional",innerType:e})}var lb=$("ZodExactOptional",(e,t)=>{U_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jd(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function db(e){return new lb({type:"optional",innerType:e})}var fb=$("ZodNullable",(e,t)=>{L_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>my(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ec(e){return new fb({type:"nullable",innerType:e})}function WI(e){return Qa(ec(e))}var pb=$("ZodDefault",(e,t)=>{M_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_y(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hb(e,t){return new pb({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var mb=$("ZodPrefault",(e,t)=>{Z_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function gb(e,t){return new mb({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():O.shallowClone(t)}})}var _f=$("ZodNonOptional",(e,t)=>{F_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _b(e,t){return new _f({type:"nonoptional",innerType:e,...O.normalizeParams(t)})}var vb=$("ZodSuccess",(e,t)=>{q_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function HI(e){return new vb({type:"success",innerType:e})}var yb=$("ZodCatch",(e,t)=>{B_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bb(e,t){return new yb({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var xb=$("ZodNaN",(e,t)=>{V_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ty(e,r,o,n)});function JI(e){return Ov(xb,e)}var vf=$("ZodPipe",(e,t)=>{W_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>by(e,r,o,n),e.in=t.in,e.out=t.out});function tc(e,t){return new vf({type:"pipe",in:e,out:t})}var yf=$("ZodCodec",(e,t)=>{vf.init(e,t),Wa.init(e,t)});function GI(e,t,r){return new yf({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var wb=$("ZodReadonly",(e,t)=>{H_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sb(e){return new wb({type:"readonly",innerType:e})}var $b=$("ZodTemplateLiteral",(e,t)=>{J_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ry(e,r,o,n)});function KI(e,t){return new $b({type:"template_literal",parts:e,...O.normalizeParams(t)})}var kb=$("ZodLazy",(e,t)=>{Y_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sy(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Eb(e){return new kb({type:"lazy",getter:e})}var zb=$("ZodPromise",(e,t)=>{K_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function YI(e){return new zb({type:"promise",innerType:e})}var Tb=$("ZodFunction",(e,t)=>{G_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sy(e,r,o,n)});function XI(e){return new Tb({type:"function",input:Array.isArray(e?.input)?nb(e?.input):e?.input??oc(So()),output:e?.output??So()})}var cc=$("ZodCustom",(e,t)=>{X_.init(e,t),J.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iy(e,r,o,n)});function QI(e){let t=new ge({check:"custom"});return t._zod.check=e,t}function eP(e,t){return Av(cc,e??(()=>!0),t)}function Ib(e,t={}){return Nv(cc,e,t)}function Pb(e){return Dv(e)}var tP=jv,rP=Uv;function nP(e,t={}){let r=new cc({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...O.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var oP=(...e)=>Lv({Codec:yf,Boolean:Ji,String:Vi},...e);function iP(e){let t=Eb(()=>pf([Vd(e),Zy(),Fy(),Wy(),oc(t),ob(Vd(),t)]));return t}function sP(e,t){return tc(mf(e),t)}var oV={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function iV(e){Ne({customError:e})}function sV(){return Ne().customError}var Ob;Ob||(Ob={});var j={...Ya,...Md,iso:qi},aV=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function cV(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function uV(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function aP(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return j.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return j.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=uV(n,t),s=it(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return j.null();if(n.length===0)return j.never();if(n.length===1)return j.literal(n[0]);if(n.every(s=>typeof s=="string"))return j.enum(n);let i=n.map(s=>j.literal(s));return i.length<2?i[0]:j.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return j.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...e,type:i};return aP(s,t)});return n.length===0?j.never():n.length===1?n[0]:j.union(n)}if(!r)return j.any();let o;switch(r){case"string":{let n=j.string();if(e.format){let i=e.format;i==="email"?n=n.check(j.email()):i==="uri"||i==="uri-reference"?n=n.check(j.url()):i==="uuid"||i==="guid"?n=n.check(j.uuid()):i==="date-time"?n=n.check(j.iso.datetime()):i==="date"?n=n.check(j.iso.date()):i==="time"?n=n.check(j.iso.time()):i==="duration"?n=n.check(j.iso.duration()):i==="ipv4"?n=n.check(j.ipv4()):i==="ipv6"?n=n.check(j.ipv6()):i==="mac"?n=n.check(j.mac()):i==="cidr"?n=n.check(j.cidrv4()):i==="cidr-v6"?n=n.check(j.cidrv6()):i==="base64"?n=n.check(j.base64()):i==="base64url"?n=n.check(j.base64url()):i==="e164"?n=n.check(j.e164()):i==="jwt"?n=n.check(j.jwt()):i==="emoji"?n=n.check(j.emoji()):i==="nanoid"?n=n.check(j.nanoid()):i==="cuid"?n=n.check(j.cuid()):i==="cuid2"?n=n.check(j.cuid2()):i==="ulid"?n=n.check(j.ulid()):i==="xid"?n=n.check(j.xid()):i==="ksuid"&&(n=n.check(j.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?j.number().int():j.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=j.boolean();break}case"null":{o=j.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[u,c]of Object.entries(i)){let l=it(c,t);n[u]=s.has(u)?l:l.optional()}if(e.propertyNames){let u=it(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?it(e.additionalProperties,t):j.any();if(Object.keys(n).length===0){o=j.record(u,c);break}let l=j.object(n).passthrough(),f=j.looseRecord(u,c);o=j.intersection(l,f);break}if(e.patternProperties){let u=e.patternProperties,c=Object.keys(u),l=[];for(let h of c){let p=it(u[h],t),g=j.string().regex(new RegExp(h));l.push(j.looseRecord(g,p))}let f=[];if(Object.keys(n).length>0&&f.push(j.object(n).passthrough()),f.push(...l),f.length===0)o=j.object({}).passthrough();else if(f.length===1)o=f[0];else{let h=j.intersection(f[0],f[1]);for(let p=2;p<f.length;p++)h=j.intersection(h,f[p]);o=h}break}let a=j.object(n);e.additionalProperties===!1?o=a.strict():typeof e.additionalProperties=="object"?o=a.catchall(it(e.additionalProperties,t)):o=a.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let s=n.map(u=>it(u,t)),a=i&&typeof i=="object"&&!Array.isArray(i)?it(i,t):void 0;a?o=j.tuple(s).rest(a):o=j.tuple(s),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(u=>it(u,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?it(e.additionalItems,t):void 0;a?o=j.tuple(s).rest(a):o=j.tuple(s),typeof e.minItems=="number"&&(o=o.check(j.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(j.maxLength(e.maxItems)))}else if(i!==void 0){let s=it(i,t),a=j.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),o=a}else o=j.array(j.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}function it(e,t){if(typeof e=="boolean")return e?j.any():j.never();let r=aP(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(c=>it(c,t)),u=j.union(a);r=o?j.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(c=>it(c,t)),u=j.xor(a);r=o?j.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:j.any();else{let a=o?r:it(e.allOf[0],t),u=o?0:1;for(let c=u;c<e.allOf.length;c++)a=j.intersection(a,it(e.allOf[c],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=j.nullable(r)),e.readOnly===!0&&(r=j.readonly(r));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(n[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(n[a]=e[a]);for(let a of Object.keys(e))aV.has(a)||(n[a]=e[a]);return Object.keys(n).length>0&&t.registry.add(r,n),r}function cP(e,t){if(typeof e=="boolean")return e?j.any():j.never();let r=cV(e,t?.defaultTarget),o=e.$defs||e.definitions||{},n={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Ge};return it(e,n)}var Rb={};Zt(Rb,{bigint:()=>pV,boolean:()=>fV,date:()=>hV,number:()=>dV,string:()=>lV});function lV(e){return rv(Vi,e)}function dV(e){return lv(Hi,e)}function fV(e){return _v(Ji,e)}function pV(e){return yv(Gi,e)}function hV(e){return Pv(nc,e)}Ne(id());var uP=d.enum(["network","computer_unreachable","platform","provider","timeout","transport","unknown","limit","billing"]),mV="octavus.error";function gV(e){if(!(e instanceof Error))return!1;let t=e;return t.__octavusErrorMarker===mV&&typeof t.errorType=="string"&&typeof t.source=="string"}function bf(e){if(!(e instanceof Error))return typeof e=="string"?e:"Unknown error";let t=e.message||e.name||"Error",r=new Set([e]),o=e.cause,n=0;for(;o instanceof Error&&!r.has(o)&&n<3;){r.add(o);let i=o.message?.trim();i&&!t.includes(i)&&(t=`${t}: ${i}`),o=o.cause,n+=1}return t}var _V=["terminated","fetch failed","socket hang up","other side closed","connection closed","econnreset","econnrefused","epipe","etimedout","enotfound","eai_again","und_err_socket","und_err_connect_timeout","und_err_headers_timeout","und_err_body_timeout"];function vV(e){let t=e;for(let r=0;r<5&&!(typeof t!="object"||t===null);r++){let o=t,n=`${typeof o.message=="string"?o.message:""} ${typeof o.code=="string"?o.code:""}`.toLowerCase();if(_V.some(i=>n.includes(i)))return!0;t=o.cause}return!1}function lP(e,t){let r=typeof e?.message=="string"?e.message:"Session ended unexpectedly",o=typeof e?.source=="string"?e.source:void 0,n=typeof e?.errorType=="string"?e.errorType:void 0;return{status:"failed",error:r,errorType:dP(o,n,r),title:t??void 0,retryable:wV(e)}}var yV=new Set(["rate_limit_error","provider_overloaded","provider_timeout","provider_error"]),bV=new Set(["PROVIDER_ACCOUNT_ERROR","FILE_DOWNLOAD_ERROR","FILE_DOWNLOAD_TIMEOUT","NETWORK_ERROR"]),xV=new Set(["CONTENT_FILTER","CONTEXT_OVERFLOW"]);function wV(e){if(!e)return!1;let t=typeof e.errorType=="string"?e.errorType:void 0,r=typeof e.code=="string"?e.code:void 0;return r!==void 0&&xV.has(r)?!1:!!(t!==void 0&&yV.has(t)||r!==void 0&&bV.has(r))}function xf(e){return gV(e)?dP(e.source,e.errorType,e.message):typeof e=="string"?Cb(e):e instanceof Error?vV(e)?"transport":Cb(e.message):"unknown"}function dP(e,t,r){if(t==="quota_exceeded_error")return"billing";if(e==="provider")return"provider";if(typeof t=="string"){if(t==="rate_limit_error"||t==="provider_error"||t==="provider_overloaded")return"provider";if(t==="provider_timeout")return"timeout"}return Cb(r)}function Cb(e){let t=kV(e);if(t.errorType)return t.errorType;let r=e.toLowerCase();return r.includes("fetch failed")||r.includes("econnrefused")||r.includes("econnreset")||r.includes("socket hang up")||r.includes("network request failed")?"network":r.includes("timed out")||r.includes("timeout")?"timeout":"platform"}var SV=/^\[([a-z_]+)\] /,$V=new Set(uP.options);function kV(e){let t=SV.exec(e);return t&&$V.has(t[1])?{errorType:t[1],message:e.slice(t[0].length)}:{errorType:null,message:e}}var EV=d.object({type:d.literal("sync"),octoAgentIds:d.array(d.string().min(1)),activeSessionIds:d.array(d.string().min(1)).optional()}),zV=d.object({type:d.literal("session-event"),sessionId:d.string().min(1),event:d.record(d.string(),d.unknown()),seq:d.number().int().optional()}),TV=d.object({type:d.literal("session-started"),sessionId:d.string().min(1)}),IV=d.object({type:d.literal("session-complete"),sessionId:d.string().min(1),status:d.enum(["completed","failed"]),error:d.string().optional(),errorType:uP.optional(),title:d.string().optional()}),PV=d.object({type:d.literal("session-state"),sessionId:d.string().min(1),events:d.array(d.record(d.string(),d.unknown())),lastSeq:d.number().int()}),OV=d.object({type:d.literal("dispatch-ack"),sessionId:d.string().min(1)}),RV=d.object({type:d.literal("session-title"),sessionId:d.string().min(1),title:d.string().min(1)}),CV=d.enum(["transport-drop","network-error","provider-error"]),AV=d.object({type:d.literal("session-retry"),sessionId:d.string().min(1),attempt:d.number().int().positive(),reason:CV,delayMs:d.number().int().nonnegative()}),NV=d.object({type:d.literal("heartbeat")}),wfe=d.discriminatedUnion("type",[EV,zV,TV,IV,RV,AV,PV,OV,NV]),DV=d.object({namespace:d.string().min(1),name:d.string().min(1),description:d.string(),command:d.string().min(1),args:d.array(d.string()),env:d.record(d.string(),d.string()),connection:d.enum(["eager","lazy"])}),jV=d.object({slug:d.string().min(1),bundleUrl:d.string().min(1),bundleSha256:d.string().optional(),secrets:d.record(d.string(),d.string())}),UV=d.object({id:d.string().optional(),name:d.string().optional(),image:d.string().optional()}),LV=d.object({type:d.literal("dispatch"),sessionId:d.string().min(1),operatorToken:d.string().min(1),trigger:d.object({triggerName:d.string().min(1),input:d.record(d.string(),d.unknown()).optional(),sender:UV.optional()}),deviceId:d.string().min(1).optional(),deviceMcpConfigs:d.array(DV).optional(),deviceSkillConfigs:d.array(jV).optional()}),MV=d.object({type:d.literal("stop"),sessionId:d.string().min(1)}),ZV=d.object({type:d.literal("request-session-state"),sessionId:d.string().min(1)}),FV=d.object({type:d.literal("heartbeat")}),fP=d.object({type:d.literal("start-screen-stream"),livekitUrl:d.string().min(1),token:d.string().min(1),roomName:d.string().min(1)}),pP=d.object({type:d.literal("device-reconnect")}),hP=d.object({type:d.literal("device-reconnect-agents")}),mP=d.object({type:d.literal("device-restart"),force:d.boolean()}),gP=d.object({type:d.literal("read-slack-prefs"),octoAgentId:d.string().min(1),workspaceHost:d.string().min(1),correlationId:d.string().min(1)}),qV=d.object({uploadUrl:d.string().min(1),mediaType:d.string().min(1)}),Sfe=d.object({fileId:d.string().min(1),key:d.string().min(1),mediaType:d.string().min(1),filename:d.string().min(1)}),_P=d.object({type:d.literal("start-voice-call"),sessionId:d.string().min(1),octoAgentId:d.string().min(1),ephemeralSecret:d.string().min(1),model:d.string().min(1),voiceToken:d.string().min(1),operatorWsUrl:d.string().min(1),recording:qV.optional()}),$fe=d.discriminatedUnion("type",[fP,pP,hP,mP,_P,gP]),vP=d.discriminatedUnion("type",[LV,MV,ZV,FV,fP,pP,hP,mP,_P,gP]),BV=d.object({speaker:d.enum(["user","agent"]),text:d.string(),at:d.number()}),kfe=d.object({at:d.number(),kind:d.enum(["ask","answer","cancel","end","silence"]),name:d.string().optional(),callId:d.string().optional(),request:d.string().optional(),answer:d.string().optional(),reason:d.string().optional()}),VV=d.object({audioInputTokens:d.number().int().nonnegative(),cachedAudioInputTokens:d.number().int().nonnegative(),textInputTokens:d.number().int().nonnegative(),cachedTextInputTokens:d.number().int().nonnegative(),audioOutputTokens:d.number().int().nonnegative(),textOutputTokens:d.number().int().nonnegative()}),WV=d.object({type:d.literal("function"),name:d.string(),description:d.string(),parameters:d.record(d.string(),d.unknown())}),HV=d.object({ask:d.string().optional(),cancel:d.string().optional(),end:d.string().optional(),silence:d.string().optional()}),JV=d.object({type:d.string(),eagerness:d.string().optional(),create_response:d.boolean(),interrupt_response:d.boolean()}),GV=d.object({engagementNudgeMs:d.number().int().positive().optional(),recheckNudgeMs:d.number().int().positive().optional(),endNudgeMs:d.number().int().positive().optional(),waitingNudgeMs:d.number().int().positive().optional(),engagementNote:d.string().optional(),recheckNote:d.string().optional(),endNote:d.string().optional(),waitingNote:d.string().optional()}),KV=d.object({tools:d.array(WV),toolChoice:d.enum(["auto","none","required"]),modalities:d.array(d.enum(["audio","text"])).min(1),transcriptionModel:d.string(),transcriptionLanguage:d.string().optional(),transcriptionPrompt:d.string().optional(),turnDetection:JV,noiseReduction:d.enum(["near_field","far_field"]).optional(),filler:d.string(),roles:HV,silence:GV.optional()}),YV=d.object({type:d.literal("ask"),callId:d.string().min(1),request:d.string()}),XV=d.object({type:d.literal("cancel"),callId:d.string().min(1),reason:d.string().optional()}),QV=d.object({type:d.literal("transcript"),entries:d.array(BV).max(200)}),e9=d.object({type:d.literal("usage"),usage:VV}),t9=d.object({type:d.literal("tool-event"),kind:d.enum(["silence"]),reason:d.string().optional()}),r9=d.object({type:d.literal("end"),reason:d.string().optional(),endedByTool:d.boolean().optional()}),Efe=d.discriminatedUnion("type",[YV,XV,QV,e9,t9,r9]),n9=d.object({type:d.literal("ready"),instructions:d.string(),sessionConfig:KV}),o9=d.object({type:d.literal("observer")}),i9=d.object({type:d.literal("answer"),callId:d.string().min(1),answer:d.string()}),s9=d.object({type:d.literal("ended"),reason:d.string().optional()}),zfe=d.discriminatedUnion("type",[n9,o9,i9,s9]),yP=3e4;var bP=4003,Ab=[2e3,5e3,15e3,3e4,6e4,6e4];var xP="octavus.error",Sf=class extends Error{__octavusErrorMarker=xP;errorType;source;retryable;retryAfter;code;provider;tool;constructor(e){super(e.message),this.name="OctavusError",this.errorType=e.errorType,this.source=e.source,this.retryable=e.retryable??!1,this.retryAfter=e.retryAfter,this.code=e.code,this.provider=e.provider,this.tool=e.tool,e.cause instanceof Error&&e.cause.stack&&(this.stack=`${this.stack}
|
|
63
|
+
Caused by: ${e.cause.stack}`)}static isInstance(e){return typeof e=="object"&&e!==null&&"__octavusErrorMarker"in e&&e.__octavusErrorMarker===xP}toJSON(){return{name:this.name,message:this.message,errorType:this.errorType,source:this.source,retryable:this.retryable,retryAfter:this.retryAfter,code:this.code,provider:this.provider,tool:this.tool}}};function $f(e){return{type:"error",errorType:e.errorType,message:e.message,source:e.source,retryable:e.retryable??!1,retryAfter:e.retryAfter,code:e.code,provider:e.provider,tool:e.tool}}function Nb(e){return $f({errorType:e.errorType,message:e.message,source:e.source,retryable:e.retryable,retryAfter:e.retryAfter,code:e.code,provider:e.provider,tool:e.tool})}var a9=["terminated","fetch failed","socket hang up","other side closed","connection closed","econnreset","econnrefused","epipe","etimedout","enotfound","eai_again","und_err_socket","und_err_connect_timeout","und_err_headers_timeout","und_err_body_timeout"];function Db(e){let t=e;for(let r=0;r<5&&!(typeof t!="object"||t===null);r++){let o=t,n=`${typeof o.message=="string"?o.message:""} ${typeof o.code=="string"?o.code:""}`.toLowerCase();if(a9.some(i=>n.includes(i)))return!0;t=o.cause}return!1}function Ki(e){return $f({errorType:"internal_error",message:e,source:"platform",retryable:!1})}function c9(e){switch(e){case 400:return"validation_error";case 401:return"authentication_error";case 402:return"quota_exceeded_error";case 403:return"permission_error";case 404:return"not_found_error";case 429:return"rate_limit_error";case 503:return"provider_overloaded";case 504:return"provider_timeout";default:return e>=500?"internal_error":"unknown_error"}}function kf(e,t){let r=c9(e),o=e===429||e>=500;return $f({errorType:r,message:t,source:"platform",retryable:o})}function lc(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function jb(e){return uc(u9(e))}function u9(e){let{allOf:t,anyOf:r,oneOf:o,...n}=e,i=[{jointlyRequired:!0,branches:t},{jointlyRequired:!1,branches:r},{jointlyRequired:!1,branches:o}];if(!i.some(({branches:l})=>Array.isArray(l)))return e;let s={...n},a=typeof s.properties=="object"&&s.properties!==null?{...s.properties}:{},u=new Set(Array.isArray(s.required)?s.required.filter(l=>typeof l=="string"):[]);for(let{jointlyRequired:l,branches:f}of i)if(Array.isArray(f))for(let h of f){if(typeof h!="object"||h===null)continue;let p=h,g=p.properties;if(typeof g=="object"&&g!==null)for(let[m,_]of Object.entries(g))m in a||(a[m]=_);if(l&&Array.isArray(p.required))for(let m of p.required)typeof m=="string"&&u.add(m)}s.type="object",s.properties=a;let c=[...u].filter(l=>l in a);return c.length>0?s.required=c:delete s.required,s}var l9=[/\(\?=/,/\(\?!/,/\(\?<=/,/\(\?<!/,/\\[1-9]/,/\\k[<']/];function d9(e){return l9.some(t=>t.test(e))}var f9=["items","additionalProperties","contains","propertyNames","if","then","else","not","unevaluatedItems","unevaluatedProperties"],p9=["allOf","anyOf","oneOf","prefixItems"],h9=["properties","patternProperties","$defs","definitions","dependentSchemas"];function uc(e){if(Array.isArray(e))return e.map(uc);if(typeof e!="object"||e===null)return e;let t={...e};t.type==="object"&&!("properties"in t)&&(t.properties={}),typeof t.pattern=="string"&&d9(t.pattern)&&delete t.pattern;for(let r of f9)r in t&&(t[r]=uc(t[r]));for(let r of p9){let o=t[r];Array.isArray(o)&&(t[r]=o.map(uc))}for(let r of h9){let o=t[r];if(typeof o=="object"&&o!==null&&!Array.isArray(o)){let n={};for(let[i,s]of Object.entries(o))n[i]=uc(s);t[r]=n}}return t}function Ub(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var Ef=d.enum(["hidden","name","description","stream","title"]),m9=d.enum(["user","assistant","system"]),g9=d.enum(["pending","streaming","available","error"]),_9=d.enum(["stop","tool-calls","client-tool-calls","length","content-filter","error","other"]),Lb=d.object({id:d.string(),name:d.string(),description:d.string().optional(),arguments:d.record(d.string(),d.unknown()),status:g9,result:d.unknown().optional(),error:d.string().optional(),display:Ef.optional()}),v9=d.object({type:d.literal("start"),messageId:d.string().optional(),executionId:d.string().optional(),lastMessageId:d.string().optional(),sessionId:d.string().optional()}),y9=d.object({type:d.literal("finish"),finishReason:_9,executionId:d.string().optional()}),b9=d.enum(["authentication_error","permission_error","validation_error","not_found_error","rate_limit_error","quota_exceeded_error","provider_error","provider_overloaded","provider_timeout","execution_error","tool_error","protocol_error","internal_error","unknown_error"]),x9=d.enum(["platform","provider","tool","client"]),w9=d.object({name:d.string(),model:d.string().optional(),statusCode:d.number().optional(),errorType:d.string().optional(),requestId:d.string().optional()}),S9=d.object({name:d.string(),callId:d.string().optional()}),$9=d.object({type:d.literal("error"),errorType:b9,message:d.string(),retryable:d.boolean(),source:x9,retryAfter:d.number().optional(),code:d.string().optional(),provider:w9.optional(),tool:S9.optional()}),k9=d.object({type:d.literal("text-start"),id:d.string(),responseType:d.string().optional(),workerId:d.string().optional()}),E9=d.object({type:d.literal("text-delta"),id:d.string(),delta:d.string(),workerId:d.string().optional()}),z9=d.object({type:d.literal("text-end"),id:d.string(),workerId:d.string().optional()}),T9=d.object({type:d.literal("reasoning-start"),id:d.string(),workerId:d.string().optional()}),I9=d.object({type:d.literal("reasoning-delta"),id:d.string(),delta:d.string(),workerId:d.string().optional()}),P9=d.object({type:d.literal("reasoning-end"),id:d.string(),workerId:d.string().optional()}),O9=d.object({type:d.literal("tool-input-start"),toolCallId:d.string(),toolName:d.string(),title:d.string().optional(),display:Ef.optional(),workerId:d.string().optional()}),R9=d.object({type:d.literal("tool-input-delta"),toolCallId:d.string(),inputTextDelta:d.string(),workerId:d.string().optional()}),C9=d.object({type:d.literal("tool-input-end"),toolCallId:d.string(),workerId:d.string().optional()}),A9=d.object({type:d.literal("tool-input-available"),toolCallId:d.string(),toolName:d.string(),input:d.unknown(),workerId:d.string().optional()}),N9=d.object({type:d.literal("tool-output-available"),toolCallId:d.string(),output:d.unknown(),workerId:d.string().optional()}),D9=d.object({type:d.literal("tool-output-error"),toolCallId:d.string(),error:d.string(),workerId:d.string().optional()}),j9=d.object({type:d.literal("source"),sourceType:d.literal("url"),id:d.string(),url:d.string(),title:d.string().optional(),workerId:d.string().optional()}),U9=d.object({type:d.literal("source"),sourceType:d.literal("document"),id:d.string(),mediaType:d.string(),title:d.string(),filename:d.string().optional(),workerId:d.string().optional()}),L9=d.discriminatedUnion("sourceType",[j9,U9]),M9=d.object({type:d.literal("block-start"),blockId:d.string(),blockName:d.string(),blockType:d.string(),display:Ef,description:d.string().optional(),outputToChat:d.boolean().optional(),thread:d.string().optional(),workerId:d.string().optional()}),Z9=d.object({type:d.literal("block-end"),blockId:d.string(),summary:d.string().optional(),workerId:d.string().optional()}),F9=d.object({type:d.literal("resource-update"),name:d.string(),value:d.unknown()}),q9=d.object({id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional()}),wP=d.object({toolCallId:d.string(),toolName:d.string(),args:d.record(d.string(),d.unknown()),source:d.enum(["llm","block"]).optional(),outputVariable:d.string().optional(),blockIndex:d.number().optional(),thread:d.string().optional(),workerId:d.string().optional()}),B9=d.object({toolCallId:d.string(),toolName:d.string().optional(),result:d.unknown().optional(),error:d.string().optional(),files:d.array(q9).optional(),outputVariable:d.string().optional(),blockIndex:d.number().optional(),thread:d.string().optional(),workerId:d.string().optional()}),V9=d.object({type:d.literal("tool-request"),toolCalls:d.array(wP),workerId:d.string().optional()}),W9=d.object({type:d.literal("client-tool-request"),executionId:d.string(),toolCalls:d.array(wP),serverToolResults:d.array(B9).optional()}),H9=d.object({type:d.literal("file-available"),id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional(),toolCallId:d.string().optional(),workerId:d.string().optional()}),SP=d.enum(["pending","in_progress","completed","cancelled"]),$P=d.object({id:d.string(),content:d.string(),status:SP}),J9=d.object({type:d.literal("todo-update"),todos:d.array($P),workerId:d.string().optional()}),G9=d.object({type:d.literal("worker-start"),workerId:d.string(),workerSlug:d.string(),description:d.string().optional(),input:d.record(d.string(),d.unknown()).optional()}),K9=d.object({type:d.literal("worker-result"),workerId:d.string(),output:d.unknown().optional(),error:d.string().optional()}),Y9=d.object({type:d.literal("worker-input-start"),workerId:d.string(),workerSlug:d.string(),description:d.string().optional()}),X9=d.object({type:d.literal("worker-input-delta"),workerId:d.string(),delta:d.string()}),Q9=d.object({type:d.literal("worker-input-ready"),workerId:d.string(),input:d.record(d.string(),d.unknown())}),e8=d.object({type:d.literal("usage"),cost:d.object({currency:d.string(),bandwidthFee:d.number(),providerFee:d.number(),totalFee:d.number(),byok:d.boolean(),estimatedProviderFee:d.number().optional()}),tokens:d.object({inputTokens:d.number(),outputTokens:d.number(),totalTokens:d.number()})}),t8=d.union([v9,y9,$9,k9,E9,z9,T9,I9,P9,O9,R9,C9,A9,N9,D9,L9,J9,M9,Z9,F9,V9,W9,H9,G9,K9,Y9,X9,Q9,e8]),r8=d.enum(["text","reasoning","tool-call","step-start","operation","source","file","object","worker","todo"]),n8=d.object({sourceType:d.literal("url"),id:d.string(),url:d.string(),title:d.string().optional()}),o8=d.object({sourceType:d.literal("document"),id:d.string(),mediaType:d.string(),title:d.string(),filename:d.string().optional()}),kP=d.discriminatedUnion("sourceType",[n8,o8]),EP=d.object({id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional(),toolCallId:d.string().optional()}),zP=d.object({id:d.string(),typeName:d.string(),value:d.unknown()}),TP=d.object({id:d.string(),name:d.string(),operationType:d.string()}),IP=d.object({todos:d.array($P)}),PP=d.record(d.string(),d.record(d.string(),d.unknown())).optional(),i8=d.object({type:d.enum(["text","reasoning","tool-call","operation","source","file","object","todo"]),visible:d.boolean(),content:d.string().optional(),toolCall:Lb.optional(),operation:TP.optional(),source:kP.optional(),file:EP.optional(),object:zP.optional(),todo:IP.optional(),thread:d.string().optional(),providerMetadata:PP}),s8=d.object({workerId:d.string(),workerSlug:d.string(),description:d.string().optional(),input:d.record(d.string(),d.unknown()).optional(),nestedParts:d.array(i8),output:d.unknown().optional(),error:d.string().optional(),cancelled:d.boolean().optional()}),a8=d.object({type:r8,visible:d.boolean(),content:d.string().optional(),toolCall:Lb.optional(),operation:TP.optional(),source:kP.optional(),file:EP.optional(),object:zP.optional(),worker:s8.optional(),todo:IP.optional(),thread:d.string().optional(),providerMetadata:PP}),OP=d.object({id:d.string().optional(),name:d.string().optional(),image:d.string().optional()}),RP=d.object({id:d.string(),role:m9,parts:d.array(a8),createdAt:d.string(),content:d.string(),toolCalls:d.array(Lb).optional(),sender:OP.optional()}),c8=d.enum(["streaming","done"]),Mb=d.enum(["streaming","done"]),u8=d.enum(["pending","running","done","error","cancelled"]),CP=d.object({type:d.literal("text"),text:d.string(),status:Mb,thread:d.string().optional()}),AP=d.object({type:d.literal("reasoning"),text:d.string(),status:Mb,thread:d.string().optional(),providerMetadata:d.record(d.string(),d.unknown()).optional()}),NP=d.object({type:d.literal("tool-call"),toolCallId:d.string(),toolName:d.string(),displayName:d.string().optional(),args:d.record(d.string(),d.unknown()),result:d.unknown().optional(),error:d.string().optional(),status:u8,display:Ef.optional(),thread:d.string().optional(),providerMetadata:d.record(d.string(),d.unknown()).optional()}),l8=d.enum(["running","done","cancelled"]),DP=d.object({type:d.literal("operation"),operationId:d.string(),name:d.string(),operationType:d.string(),status:l8,thread:d.string().optional()}),d8=d.object({type:d.literal("source"),sourceType:d.literal("url"),id:d.string(),url:d.string(),title:d.string().optional(),thread:d.string().optional()}),f8=d.object({type:d.literal("source"),sourceType:d.literal("document"),id:d.string(),mediaType:d.string(),title:d.string(),filename:d.string().optional(),thread:d.string().optional()}),jP=d.discriminatedUnion("sourceType",[d8,f8]),UP=d.object({type:d.literal("file"),id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional(),toolCallId:d.string().optional(),thread:d.string().optional()}),p8=d.enum(["streaming","done","error"]),LP=d.object({type:d.literal("object"),id:d.string(),typeName:d.string(),partial:d.unknown().optional(),object:d.unknown().optional(),status:p8,error:d.string().optional(),thread:d.string().optional()}),h8=d.object({id:d.string(),content:d.string(),status:SP}),MP=d.object({type:d.literal("todo"),todos:d.array(h8),status:Mb,thread:d.string().optional()}),m8=d.enum(["running","done","error","cancelled"]),ZP=d.object({type:d.literal("step-start")}),g8=d.union([CP,AP,NP,DP,jP,UP,LP,MP,ZP]),_8=d.object({type:d.literal("worker"),workerId:d.string(),workerSlug:d.string(),description:d.string().optional(),input:d.record(d.string(),d.unknown()).optional(),parts:d.array(g8),output:d.unknown().optional(),error:d.string().optional(),status:m8}),v8=d.union([CP,AP,NP,DP,jP,UP,LP,_8,MP,ZP]),zf=d.object({id:d.string(),role:d.enum(["user","assistant"]),parts:d.array(v8),status:c8,createdAt:d.coerce.date(),sender:OP.optional()});function Zb(e){return t8.safeParse(e)}function dc(e){return"getHealth"in e&&"ensureReady"in e}function Yi(e){return"addEntry"in e&&"removeEntry"in e&&"restartEntry"in e&&"hasEntry"in e}var Wt={SKILL_READ:"octavus_skill_read",SKILL_LIST:"octavus_skill_list",SKILL_RUN:"octavus_skill_run",SKILL_SETUP:"octavus_skill_setup",CODE_RUN:"octavus_code_run",FILE_WRITE:"octavus_file_write",FILE_READ:"octavus_file_read",FILE_UPLOAD:"octavus_file_upload",REFERENCE_LIST:"octavus_reference_list",REFERENCE_READ:"octavus_reference_read",MCP_LIST:"octavus_mcp_list",MCP_ACTIVATE:"octavus_mcp_activate",GENERATE_IMAGE:"octavus_generate_image",GENERATE_VIDEO:"octavus_generate_video",GENERATE_SPEECH:"octavus_generate_speech",TRANSCRIBE_AUDIO:"octavus_transcribe_audio",WEB_SEARCH:"octavus_web_search",TODO_WRITE:"octavus_todo_write"};var st={SKILL_READ:Wt.SKILL_READ,SKILL_LIST:Wt.SKILL_LIST,SKILL_RUN:Wt.SKILL_RUN,SKILL_SETUP:Wt.SKILL_SETUP,CODE_RUN:Wt.CODE_RUN,FILE_WRITE:Wt.FILE_WRITE,FILE_READ:Wt.FILE_READ,FILE_UPLOAD:Wt.FILE_UPLOAD};var Fb={MCP_LIST:Wt.MCP_LIST,MCP_ACTIVATE:Wt.MCP_ACTIVATE};var Pfe={REFERENCE_LIST:Wt.REFERENCE_LIST,REFERENCE_READ:Wt.REFERENCE_READ};var y8=new Set(["image","audio","blob"]);function wf(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.type=="string"&&y8.has(t.type)&&typeof t.data=="string"}function FP(e){return e.mimeType?e.mimeType:e.type==="image"?"image/png":"application/octet-stream"}function qP(e){let t=e;if(t.length>=8&&t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71&&t[4]===13&&t[5]===10&&t[6]===26&&t[7]===10)return"image/png";if(t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255)return"image/jpeg";if(t.length>=6&&t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56&&(t[4]===55||t[4]===57)&&t[5]===97)return"image/gif";if(t.length>=12&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80)return"image/webp"}var BP="This file was reported as an image but its contents are not a valid or supported image, so it was provided as a download link only and not shown to the model as an image. The download likely returned non-image content (for example an HTML error or sign-in page) or a corrupt/unsupported file - verify the source and re-fetch if you need the image.";function VP(e){if(Array.isArray(e))return e.some(wf)?{parts:e,rebuild:t=>t}:null;if(typeof e=="object"&&e!==null){let{content:t}=e;if(Array.isArray(t)&&t.some(wf)){let r=e;return{parts:t,rebuild:o=>({...r,content:o})}}}return null}var b8={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif","image/svg+xml":"svg","image/bmp":"bmp","audio/mpeg":"mp3","audio/wav":"wav","audio/ogg":"ogg","audio/flac":"flac","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov","application/pdf":"pdf","application/zip":"zip"};function WP(e){return b8[e]??"bin"}var x8=d.object({error:d.string().optional(),message:d.string().optional(),code:d.string().optional()}),w8=class extends Error{constructor(e,t,r){super(e),this.status=t,this.code=r,this.name="ApiError"}};async function XP(e,t){let r=`${t}: ${e.statusText}`;try{let o=await e.json(),n=x8.safeParse(o);if(n.success)return{message:n.data.error??n.data.message??r,code:n.data.code}}catch{}return{message:r}}async function ko(e,t){let{message:r,code:o}=await XP(e,t);throw new w8(r,e.status,o)}var Qi=class{config;constructor(e){this.config=e}async httpGet(e,t){let r=await fetch(`${this.config.baseUrl}${e}`,{method:"GET",headers:await this.config.getHeaders()});r.ok||await ko(r,"Request failed");let o=await r.json();return t.parse(o)}async httpPost(e,t,r){let o=await fetch(`${this.config.baseUrl}${e}`,{method:"POST",headers:await this.config.getHeaders(),body:JSON.stringify(t)});o.ok||await ko(o,"Request failed");let n=await o.json();return r.parse(n)}async httpPatch(e,t,r){let o=await fetch(`${this.config.baseUrl}${e}`,{method:"PATCH",headers:await this.config.getHeaders(),body:JSON.stringify(t)});o.ok||await ko(o,"Request failed");let n=await o.json();return r.parse(n)}async httpDelete(e,t){let r=await fetch(`${this.config.baseUrl}${e}`,{method:"DELETE",headers:await this.config.getHeaders()});r.ok||await ko(r,"Request failed");let o=await r.json();return t.parse(o)}},QP=d.enum(["interactive","worker"]),S8=d.object({slug:d.string(),name:d.string(),description:d.string().optional(),format:QP}),$8=d.object({name:d.string(),content:d.string()}),k8=d.object({slug:d.string(),id:d.string(),name:d.string(),description:d.string().nullable(),format:QP,createdAt:d.string(),updatedAt:d.string(),projectId:d.string()}),E8=d.object({agents:d.array(k8)}),z8=d.object({settings:S8,protocol:d.string(),prompts:d.array($8),id:d.string()}),T8=class extends Qi{async list(){return(await this.httpGet("/api/agents",E8)).agents}async get(e){return await this.httpGet(`/api/agents/${e}`,z8)}},I8=4*1024*1024,P8=256*1024,O8=16*1024,R8=16*1024,C8=new TextEncoder;function Xi(e){return C8.encode(e).length}function Wb(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function e1(e){if(typeof e=="string")return e;try{return JSON.stringify(e)??""}catch{return""}}function qb(e){return Xi(JSON.stringify(e))}function A8(e){let t=e.result!==void 0?e1(e.result):e.error??"";return Xi(t)}function N8(e,t){if(e.length<=t)return e;let r=Math.ceil(t*.6),o=t-r,n=e.length-r-o;return`${e.slice(0,r)}
|
|
64
|
+
|
|
65
|
+
...[Octavus trimmed ${n.toLocaleString()} characters]...
|
|
66
|
+
|
|
67
|
+
${e.slice(e.length-o)}`}function D8(e){let t=-1,r=-1;return e.forEach((o,n)=>{let i=A8(o);i>r&&(r=i,t=n)}),t}function j8(e){let t=e.result!==void 0,r=t?e1(e.result):e.error??"",o=Xi(r);if(o<=O8)return null;if(t&&e.outputVariable){let s=`Result omitted: it was ${Wb(o)}, too large to capture into variable "${e.outputVariable}" and send back. Reduce the output - add filters or a limit, request fewer fields, paginate, or write it to a file and return a reference instead of inline data.`;return e.result=void 0,e.error=s,{toolCallId:e.toolCallId,toolName:e.toolName,originalBytes:o,keptBytes:Xi(s),variableCapture:!0}}let i=`${`[Octavus: this tool result was too large to send (${Wb(o)}), so only the start and end are shown below. To use the full data, reduce the output - add filters or a limit, request fewer fields, paginate, or write it to a file and return a reference instead of inline data.]`}
|
|
68
|
+
|
|
69
|
+
${N8(r,R8)}`;return t?e.result=i:e.error=i,{toolCallId:e.toolCallId,toolName:e.toolName,originalBytes:o,keptBytes:Xi(i),variableCapture:!1}}function U8(e,t){if(!e||e.length===0)return{results:e,truncations:[],overflow:!1};if(qb(e)<=t)return{results:e,truncations:[],overflow:!1};let r=e.map(i=>({...i})),o=[],n=r.length;for(;n>0&&qb(r)>t;){n-=1;let i=D8(r);if(i<0)break;let s=j8(r[i]);if(!s)break;o.push(s)}return{results:r,truncations:o,overflow:qb(r)>t}}var L8=2,M8=1e3,HP=8e3,Z8=.25,F8=6e4;function q8(e){return e===408||e===429||e===502||e===503||e===504}function B8(e){return e instanceof TypeError}function V8(e){let t=Number(e);if(Number.isFinite(t))return Math.max(0,t*1e3);let r=Date.parse(e);return Number.isFinite(r)?Math.max(0,r-Date.now()):null}async function Bb(e,t,r){let o=t?.headers.get("retry-after"),n=o?V8(o):null,i;if(n!==null)i=Math.min(n,HP);else{let s=Math.min(M8*2**e,HP),a=s*Z8*(Math.random()*2-1);i=s+a}r?.aborted||await new Promise((s,a)=>{let u={timer:null},c=()=>{u.timer!==null&&clearTimeout(u.timer),a(r.reason instanceof Error?r.reason:new Error("Aborted"))};u.timer=setTimeout(()=>{r?.removeEventListener("abort",c),s()},i),r?.addEventListener("abort",c,{once:!0})})}async function*Hb(e,t,r){let o=t.toolResults,n=t.executionId,i=!0,s=Math.max(0,e.config.streamIdleTimeoutMs??F8),a=e.config.maxContinuationBytes??I8,u=a-Math.min(P8,Math.floor(a/2));for(;i;){if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}let c=U8(o,u);if(o=c.results,e.onToolResultTruncated)for(let v of c.truncations)e.onToolResultTruncated(v);let l=e.buildBody({executionId:n,toolResults:o});if(c.overflow||Xi(JSON.stringify(l))>a){yield kf(413,`${e.errorContext??"Request"}: the results are too large to send (over ${Wb(a)}) and could not be reduced enough. Return less data - filter, limit, or paginate the results, or write them to a file and return a reference.`);return}let f=Math.max(0,e.config.maxRetries??L8),h,p=!1,g,m,_=null;try{for(let x=0;x<=f;x++){if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}let T=new AbortController,C=()=>T.abort(r?.reason);r&&(r.aborted?T.abort(r.reason):r.addEventListener("abort",C,{once:!0}));let D=!1,M=s>0?setTimeout(()=>{D=!0,T.abort()},s):void 0,G=!1;try{let U=typeof e.url=="function"?e.url():e.url;if(h=await fetch(U,{method:"POST",headers:await e.config.getHeaders(),body:JSON.stringify(l),signal:T.signal}),q8(h.status)&&x<f){await h.body?.cancel().catch(()=>{}),await Bb(x,h,r);continue}p=!0,G=!0,g=T,m=C;break}catch(U){if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}if(D){if(x<f){await Bb(x,null,r);continue}return}if(x<f&&B8(U)){await Bb(x,null,r);continue}throw U}finally{M&&clearTimeout(M),!G&&r&&r.removeEventListener("abort",C)}}if(!p)return;if(!h.ok){let{message:x}=await XP(h,e.errorContext??"Request failed");yield kf(h.status,x);return}if(!h.body){yield Ki("Response body is not readable");return}e.onResponse?.(h),o=void 0;let v=h.body.getReader(),S=new TextDecoder,k="",b=!1;for(;!b;){if(r?.aborted){v.releaseLock(),yield{type:"finish",finishReason:"stop"};return}let x=v.read(),T,C;try{if(s>0){let U=new Promise(De=>{T=setTimeout(()=>De("idle"),s)});C=await Promise.race([x,U])}else C=await x}catch(U){if(T&&clearTimeout(T),Ub(U)){v.releaseLock(),yield{type:"finish",finishReason:"stop"};return}if(Db(U)){await v.cancel().catch(()=>{});return}throw U}if(T&&clearTimeout(T),C==="idle"){x.then(()=>{},()=>{}),await v.cancel().catch(()=>{});return}let{done:D,value:M}=C;if(D){b=!0;continue}k+=S.decode(M,{stream:!0});let G=k.split(`
|
|
70
|
+
`);k=G.pop()??"";for(let U of G)if(U.startsWith("data: ")&&U!=="data: [DONE]")try{let De=Zb(JSON.parse(U.slice(6)));if(!De.success)continue;let we=De.data;if(we.type==="start"&&we.executionId&&(n=we.executionId),we.type==="start"&&we.sessionId&&e.onSessionId?.(we.sessionId),we.type==="tool-request"){_=we.toolCalls;continue}if(we.type==="finish"){if(we.finishReason==="tool-calls"&&_)continue;yield we,i=!1;continue}we.type==="resource-update"&&e.onResourceUpdate&&e.onResourceUpdate(we.name,we.value),yield we}catch{}}}finally{g&&m&&r&&r.removeEventListener("abort",m)}if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}if(_&&_.length>0){let v=e.getToolHandlers(),S=_.filter(T=>v[T.toolName]),k=_.filter(T=>!v[T.toolName]),b=Promise.all(S.map(async T=>{let C=v[T.toolName];try{let D=await C(T.args);return{toolCallId:T.toolCallId,toolName:T.toolName,result:D,outputVariable:T.outputVariable,blockIndex:T.blockIndex,thread:T.thread,workerId:T.workerId}}catch(D){return{toolCallId:T.toolCallId,toolName:T.toolName,error:D instanceof Error?D.message:"Tool execution failed",outputVariable:T.outputVariable,blockIndex:T.blockIndex,thread:T.thread,workerId:T.workerId}}})),x;if(r&&!r.aborted){let T,C=new Promise(M=>{T=()=>M("aborted"),r.addEventListener("abort",T,{once:!0})}),D;try{D=await Promise.race([b,C])}finally{T&&r.removeEventListener("abort",T)}if(D==="aborted"){yield{type:"finish",finishReason:"stop"};return}x=D}else if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}else x=await b;if(e.onToolResults&&x.length>0&&await e.onToolResults(x),r?.aborted){yield{type:"finish",finishReason:"stop"};return}for(let T of x)T.error?yield{type:"tool-output-error",toolCallId:T.toolCallId,error:T.error}:yield{type:"tool-output-available",toolCallId:T.toolCallId,output:T.result};if(k.length>0)if(e.rejectClientToolCalls){let T=k.map(C=>({toolCallId:C.toolCallId,toolName:C.toolName,error:`Tool "${C.toolName}" is not available. No handler is registered for this tool.`,outputVariable:C.outputVariable,blockIndex:C.blockIndex,thread:C.thread,workerId:C.workerId}));for(let C of T)yield{type:"tool-output-error",toolCallId:C.toolCallId,error:C.error};o=[...x,...T]}else{if(!n){yield Ki("Missing executionId for client-tool-request");return}yield{type:"client-tool-request",executionId:n,toolCalls:k,serverToolResults:x.length>0?x:void 0},yield{type:"finish",finishReason:"client-tool-calls",executionId:n},i=!1}else o=x}else i=!1}}function Jb(e,t,r){let o=new Set,n={...t},i=r?[...r]:[],s=new Set(i.map(a=>a.name));for(let a of e){if(o.has(a.namespace))throw new Error(`Duplicate MCP namespace "${a.namespace}". Each inline MCP server must have a unique namespace.`);o.add(a.namespace);let u=a.toolHandlers(),c=a.toolSchemas();for(let[l,f]of Object.entries(u)){if(n[l])throw new Error(`Tool name collision: "${l}" is already registered. Ensure no overlap between MCP-namespaced tools and static tool handlers.`);n[l]=f}for(let l of c){if(s.has(l.name))throw new Error(`Tool schema name collision: "${l.name}" is already registered as a dynamic tool schema.`);s.add(l.name),i.push(l)}}return{toolHandlers:n,dynamicToolSchemas:i}}function W8(e){let t=e.toolHandlers();return e.toolSchemas().filter(r=>t[r.name]).map(r=>({schema:r,handler:t[r.name]}))}var JP=class{sessionId;config;deferredStart;idempotencyKey;baseHandlers;toolHandlers;resourceMap;mcpToolSchemas=[];dynamicToolSchemas;socketAbortController=null;onToolResults;onToolResultTruncated;rejectClientToolCalls;constructor(e){if(this.sessionId=e.sessionId,this.config=e.config,this.deferredStart=e.deferredStart,this.idempotencyKey=e.deferredStart?e.deferredStart.idempotencyKey??lc():void 0,this.onToolResults=e.onToolResults,this.onToolResultTruncated=e.onToolResultTruncated,this.rejectClientToolCalls=e.rejectClientToolCalls??!1,this.resourceMap=new Map,e.mcpServers!==void 0&&e.mcpServers.length>0){let t=Jb(e.mcpServers,e.tools);this.baseHandlers=t.toolHandlers,this.mcpToolSchemas=t.dynamicToolSchemas}else this.baseHandlers=e.tools??{};this.toolHandlers={...this.baseHandlers};for(let t of e.resources??[])this.resourceMap.set(t.name,t)}async*execute(e,t){if(e.type==="continue"){if(!this.sessionId)throw new Error("Cannot continue a session before it exists. Run a trigger first to create the session.");yield*this.executeStream({executionId:e.executionId,toolResults:e.toolResults},t?.signal)}else yield*this.executeStream({triggerName:e.triggerName,input:e.input,rollbackAfterMessageId:e.rollbackAfterMessageId,sender:e.sender},t?.signal)}getSessionId(){return this.sessionId}setDynamicTools(e){let t=Array.isArray(e)?e:W8(e),r={...this.baseHandlers};for(let o of t)r[o.schema.name]=o.handler;this.toolHandlers=r,this.dynamicToolSchemas=t.map(o=>o.schema)}async handleSocketMessage(e,t){if(e.type==="stop"){this.socketAbortController?.abort();return}this.socketAbortController?.abort(),this.socketAbortController=new AbortController;let r=this.socketAbortController;try{let o=this.execute(e,{signal:r.signal});for await(let n of o){if(r.signal.aborted)break;t.onEvent(n)}!r.signal.aborted&&t.onFinish&&await t.onFinish()}catch(o){if(!r.signal.aborted){let n=Ki(o instanceof Error?o.message:"Unknown error");t.onEvent(n)}}}async*executeStream(e,t){yield*Hb({config:this.config,getToolHandlers:()=>this.toolHandlers,url:()=>this.sessionId?`${this.config.baseUrl}/api/agent-sessions/${this.sessionId}/trigger`:`${this.config.baseUrl}/api/agent-sessions/start`,buildBody:({executionId:r,toolResults:o})=>this.buildRequestBody(e,r,o),onResponse:this.deferredStart?r=>this.latchSessionIdFromHeader(r):void 0,onSessionId:this.deferredStart?r=>this.latchSessionId(r):void 0,onResourceUpdate:(r,o)=>this.handleResourceUpdate(r,o),onToolResults:this.onToolResults,onToolResultTruncated:this.onToolResultTruncated,rejectClientToolCalls:this.rejectClientToolCalls,errorContext:"Failed to trigger"},{executionId:e.executionId,toolResults:e.toolResults},t)}buildRequestBody(e,t,r){let o=this.collectDynamicSchemas();if(this.deferredStart&&this.sessionId===void 0&&t===void 0){let i={};e.triggerName!==void 0&&(i.triggerName=e.triggerName),e.input!==void 0&&(i.input=e.input),e.sender!==void 0&&(i.sender=e.sender),o!==void 0&&(i.dynamicToolSchemas=o);let s={agentId:this.deferredStart.agentId,trigger:i};return this.deferredStart.input!==void 0&&(s.input=this.deferredStart.input),this.idempotencyKey!==void 0&&(s.idempotencyKey=this.idempotencyKey),s}let n={};return e.triggerName!==void 0&&(n.triggerName=e.triggerName),e.input!==void 0&&(n.input=e.input),e.rollbackAfterMessageId!==void 0&&(n.rollbackAfterMessageId=e.rollbackAfterMessageId),e.sender!==void 0&&(n.sender=e.sender),t!==void 0&&(n.executionId=t),r!==void 0&&(n.toolResults=r),o!==void 0&&(n.dynamicToolSchemas=o),n}latchSessionId(e){this.sessionId||(this.sessionId=e,this.deferredStart?.onSessionCreated?.(e))}latchSessionIdFromHeader(e){if(this.sessionId)return;let t=e.headers.get("X-Octavus-Session-Id");t&&this.latchSessionId(t)}handleResourceUpdate(e,t){let r=this.resourceMap.get(e);r&&r.onUpdate(t)}collectDynamicSchemas(){return this.mcpToolSchemas.length===0?this.dynamicToolSchemas:[...this.mcpToolSchemas,...this.dynamicToolSchemas??[]]}},H8=d.object({sessionId:d.string()}),J8=d.object({id:d.string(),agentId:d.string(),input:d.record(d.string(),d.unknown()),variables:d.record(d.string(),d.unknown()),resources:d.record(d.string(),d.unknown()),messages:d.array(RP),status:d.literal("active").optional(),createdAt:d.string(),updatedAt:d.string()}),G8=d.object({sessionId:d.string(),agentId:d.string(),messages:d.array(zf),status:d.literal("active").optional()}),Vb=d.object({sessionId:d.string(),agentId:d.string(),status:d.literal("expired"),createdAt:d.string()}),K8=d.object({sessionId:d.string(),restored:d.boolean()}),Y8=d.object({sessionId:d.string(),cleared:d.boolean()}),X8=d.looseObject({id:d.string(),timestamp:d.string(),type:d.string()}),Q8=d.object({sessionId:d.string(),entries:d.array(X8),total:d.number().optional(),truncated:d.boolean().optional()}),eW=class extends Qi{async create(e,t){return(await this.httpPost("/api/agent-sessions",{agentId:e,input:t},H8)).sessionId}async get(e){let t=await fetch(`${this.config.baseUrl}/api/agent-sessions/${e}`,{method:"GET",headers:await this.config.getHeaders()});t.ok||await ko(t,"Request failed");let r=await t.json(),o=Vb.safeParse(r);return o.success?o.data:J8.parse(r)}async getMessages(e){let t=await fetch(`${this.config.baseUrl}/api/agent-sessions/${e}?format=ui`,{method:"GET",headers:await this.config.getHeaders()});t.ok||await ko(t,"Request failed");let r=await t.json(),o=Vb.safeParse(r);return o.success?o.data:G8.parse(r)}async restore(e,t,r){return await this.httpPost(`/api/agent-sessions/${e}/restore`,{messages:t,input:r},K8)}async clear(e){return await this.httpDelete(`/api/agent-sessions/${e}`,Y8)}async getLogs(e,t){let r=new URLSearchParams;t?.excludeModelRequests&&r.set("excludeModelRequests","true");let o=r.toString(),n=`${this.config.baseUrl}/api/agent-sessions/${e}/logs${o?`?${o}`:""}`,i=await fetch(n,{method:"GET",headers:await this.config.getHeaders()});i.ok||await ko(i,"Request failed");let s=await i.json(),a=Vb.safeParse(s);return a.success?a.data:Q8.parse(s)}attach(e,t={}){return new JP({sessionId:e,config:this.config,tools:t.tools,resources:t.resources,mcpServers:t.mcpServers,onToolResults:t.onToolResults,onToolResultTruncated:t.onToolResultTruncated,rejectClientToolCalls:t.rejectClientToolCalls})}start(e){return new JP({config:this.config,deferredStart:{agentId:e.agentId,input:e.input,idempotencyKey:e.idempotencyKey,onSessionCreated:e.onSessionCreated},tools:e.tools,resources:e.resources,mcpServers:e.mcpServers,onToolResults:e.onToolResults,onToolResultTruncated:e.onToolResultTruncated,rejectClientToolCalls:e.rejectClientToolCalls})}},lpe=d.object({filename:d.string().min(1).max(255),mediaType:d.string().min(1),size:d.number().int().positive()}),tW=d.object({id:d.string(),uploadUrl:d.url(),downloadUrl:d.url()}),rW=d.object({files:d.array(tW)}),nW=class extends Qi{async getUploadUrls(e,t){return await this.httpPost("/api/files/upload-urls",{sessionId:e,files:t},rW)}},GP=class extends Error{constructor(e,t,r){super(e),this.sessionId=t,this.details=r,this.name="WorkerError"}},oW=class extends Qi{async*execute(e,t,r={}){let o=r.mcpServers,n=o!==void 0&&o.length>0?Jb(o,r.tools,r.dynamicToolSchemas):{toolHandlers:r.tools??{},dynamicToolSchemas:r.dynamicToolSchemas};yield*Hb({config:this.config,getToolHandlers:()=>n.toolHandlers,url:`${this.config.baseUrl}/api/agents/${e}/execute`,buildBody:({executionId:i,toolResults:s})=>i?{type:"continue",executionId:i,toolResults:s}:{type:"start",input:t,...n.dynamicToolSchemas!==void 0&&{dynamicToolSchemas:n.dynamicToolSchemas}},errorContext:"Failed to execute worker"},{},r.signal)}async generate(e,t,r={}){let o,n,i,s,a,u,c;for await(let l of this.execute(e,t,r))l.type==="start"&&l.executionId?o=l.executionId:l.type==="error"?(i=l.message,s={errorType:l.errorType,source:l.source,code:l.code,retryable:l.retryable,retryAfter:l.retryAfter,provider:l.provider}):l.type==="worker-result"?(a=l.workerId,l.error!==void 0?i=i??l.error:n={output:l.output,sessionId:o??l.workerId}):l.type==="usage"&&(u=l.cost,c=l.tokens);if(i!==void 0)throw new GP(i,o??a,s);if(n!==void 0)return u!==void 0&&(n.cost=u),c!==void 0&&(n.tokens=c),n;throw new GP("Worker completed without producing a result",o)}async*continue(e,t,r,o={}){let n=o.mcpServers,i=n!==void 0&&n.length>0?Jb(n,o.tools).toolHandlers:o.tools??{};yield*Hb({config:this.config,getToolHandlers:()=>i,url:`${this.config.baseUrl}/api/agents/${e}/execute`,buildBody:({executionId:s,toolResults:a})=>({type:"continue",executionId:s??t,toolResults:a??r}),errorContext:"Failed to continue worker"},{executionId:t,toolResults:r},o.signal)}},iW=new Set(["completed","failed","cancelled"]);function sW(e){return iW.has(e)}var t1=d.string().transform(e=>e),KP=d.object({threadId:d.string(),status:t1}),aW=d.object({threadId:d.string(),status:t1,failureReason:d.string().nullable(),messages:d.array(zf)}),cW=3e3,uW=900*1e3,lW=class extends Qi{async dispatch(e,t,r={}){return await this.httpPost(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads`,{message:t,files:r.files},KP)}async getThread(e,t){return await this.httpGet(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}`,aW)}async followUp(e,t,r,o={}){return await this.httpPost(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}/messages`,{message:r,files:o.files},KP)}async waitForCompletion(e,t,r={}){let o=r.pollIntervalMs??cW,n=r.timeoutMs??uW,i=Date.now()+n;for(;;){let s=await this.getThread(e,t);if(sW(s.status))return s;if(Date.now()+o>=i)throw new Error(`Workforce thread ${t} did not finish within ${n}ms (last status: ${s.status})`);await dW(o,r.signal)}}async run(e,t,r={}){let{threadId:o}=await this.dispatch(e,t,{files:r.files});return await this.waitForCompletion(e,o,r)}};function dW(e,t){return new Promise((r,o)=>{if(t?.aborted){o(YP(t));return}let n=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e);function i(){clearTimeout(n),o(YP(t))}t?.addEventListener("abort",i,{once:!0})})}function YP(e){let t=e?.reason;return t instanceof Error?t:new Error("The wait was aborted")}var hpe=d.object({agentId:d.string().min(1),sessionId:d.string().min(1).optional(),ttlSeconds:d.number().int().positive().optional()}),fW=d.object({token:d.string(),jti:d.string(),expiresAt:d.string()}),pW=class extends Qi{async mint(e){return await this.httpPost("/api/tokens",e,fW)}async revoke(e){return await this.httpPost("/api/tokens/revoke",{token:e},d.object({revoked:d.boolean(),jti:d.string().optional()}))}},hW="4",Gb=class{agents;agentSessions;files;workers;workforce;tokens;baseUrl;apiKey;traceModelRequests;constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey,this.traceModelRequests=e.traceModelRequests??!1;let t={baseUrl:this.baseUrl,getHeaders:()=>this.getHeaders(),maxRetries:e.maxRetries,streamIdleTimeoutMs:e.streamIdleTimeoutMs};this.agents=new T8(t),this.agentSessions=new eW(t),this.files=new nW(t),this.workers=new oW(t),this.workforce=new lW(t),this.tokens=new pW(t)}getSessionUrl(e){return`${this.baseUrl}/platform/sessions/${e}`}getAgentUrl(e){return`${this.baseUrl}/platform/agents/${e}`}async getHeaders(){let e={"Content-Type":"application/json","X-Octavus-Sdk-Version":hW},t=typeof this.apiKey=="function"?await this.apiKey():this.apiKey;return t&&(e.Authorization=`Bearer ${t}`),this.traceModelRequests&&(e["X-Octavus-Trace"]="true"),e}};function mW(e){let t=atob(e),r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return r}async function r1(e,t,r){for(let o of e){if(o.outputVariable)continue;let n=VP(o.result);if(!n)continue;let i=o.files?[...o.files]:[],s=[],a=[],u=[],c=[],l=[];if(n.parts.forEach((m,_)=>{if(!wf(m))return;let v=mW(m.data),S=m.type==="image"?qP(new Uint8Array(v)):void 0,k=m.type==="image"&&S!==void 0,b=S??FP(m);s.push(_),a.push(m.type),u.push(v),l.push(k),c.push({filename:`${m.type}-${lc()}.${WP(b)}`,mediaType:b,size:v.byteLength})}),c.length===0)continue;let f=null;try{f=(await t.getUploadUrls(r,c)).files}catch{f=null}let h=f===null?null:await Promise.allSettled(f.map((m,_)=>fetch(m.uploadUrl,{method:"PUT",body:u[_],headers:{"Content-Type":c[_].mediaType}}))),p=new Map;s.forEach((m,_)=>{let v=a[_],S=c[_].mediaType,k=c[_].filename,b=u[_].byteLength,x=f?.[_],T=h?.[_],C=T?.status==="fulfilled"&&T.value.ok&&x!==void 0,D=l[_];if(C){D&&i.push({id:x.id,mediaType:S,url:x.downloadUrl,filename:k,size:b});let M=v==="image"&&!D;p.set(m,{type:v,mediaType:S,size:b,url:x.downloadUrl,...M&&{error:BP}})}else p.set(m,{type:v,mediaType:S,size:b,error:"Upload failed"})});let g=n.parts.map((m,_)=>p.has(_)?p.get(_):m);o.files=i,o.result=n.rebuild(g)}}function n1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gW(e){return n1(e)?typeof e.name=="string"&&(e.path===void 0||typeof e.path=="string")&&typeof e.mediaType=="string"&&typeof e.size=="number"&&typeof e.contentBase64=="string":!1}function _W(e){let t=atob(e),r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return r}async function o1(e,t,r){for(let o of e){if(o.outputVariable)continue;let n=o.result;if(!n1(n))continue;let i=n.outputFiles;if(!Array.isArray(i)||i.length===0)continue;let s=i.filter(gW);if(s.length===0)continue;let a=[],u=[];for(let p of s){let g=_W(p.contentBase64);a.push(g),u.push({filename:p.name,mediaType:p.mediaType,size:p.size})}let c;try{c=(await t.getUploadUrls(r,u)).files}catch{n.outputFiles=s.map(p=>({name:p.name,...p.path!==void 0?{path:p.path}:{},mediaType:p.mediaType,size:p.size,error:"Upload failed"}));continue}let l=await Promise.allSettled(c.map((p,g)=>fetch(p.uploadUrl,{method:"PUT",body:a[g],headers:{"Content-Type":u[g].mediaType}}))),f=o.files?[...o.files]:[],h=[];for(let p=0;p<s.length;p++){let g=l[p],m=c[p],_=u[p],v=s[p];g.status==="fulfilled"&&g.value.ok?(f.push({id:m.id,mediaType:_.mediaType,url:m.downloadUrl,filename:_.filename,size:_.size}),h.push({name:_.filename,...v.path!==void 0?{path:v.path}:{},mediaType:_.mediaType,size:_.size,url:m.downloadUrl})):h.push({name:_.filename,...v.path!==void 0?{path:v.path}:{},mediaType:_.mediaType,size:_.size,error:"Upload failed"})}o.files=f,n.outputFiles=h}}var OA=We(h1(),1);import{existsSync as Hc,mkdirSync as xp,readdirSync as yp,readFileSync as Fw,renameSync as iK,rmSync as bp,statSync as sK,writeFileSync as IA}from"fs";import{execFile as aK}from"child_process";import{dirname as cK,join as _t,normalize as uK,relative as PA,sep as lK}from"path";import{createHash as dK,randomBytes as zA}from"crypto";var fK={txt:"text/plain",md:"text/markdown",csv:"text/csv",json:"application/json",yaml:"application/yaml",yml:"application/yaml",xml:"application/xml",html:"text/html",htm:"text/html",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",py:"text/x-python",js:"text/javascript",ts:"text/typescript",zip:"application/zip"};function Vw(e){let t=e.lastIndexOf(".");if(t<0)return"application/octet-stream";let r=e.slice(t+1).toLowerCase();return fK[r]??"application/octet-stream"}var pK=3e5,hK=10*1024*1024,mK=20*1024*1024,gK=50*1024*1024,_K=20*1024*1024,TA=".octavus-skill.json",vK=new Set(["PATH","HOME","USER","LOGNAME","SHELL","TMPDIR","TEMP","TMP","LANG","LC_ALL","LC_CTYPE","TZ","APPDATA","LOCALAPPDATA","PROGRAMDATA","USERPROFILE","USERNAME","USERDOMAIN","HOMEDRIVE","HOMEPATH","SYSTEMROOT","SYSTEMDRIVE","WINDIR","COMSPEC","PATHEXT","PUBLIC","PROGRAMFILES","PROGRAMFILES(X86)","PROGRAMW6432","COMMONPROGRAMFILES","COMMONPROGRAMFILES(X86)","COMMONPROGRAMW6432","NUMBER_OF_PROCESSORS","PROCESSOR_ARCHITECTURE","OS"]),Ww=class{skills=new Map;extracted=new Map;inflight=new Map;installedSha=new Map;installErrors=new Map;installLocks=new Map;skillsDir;pythonPath;bashPath;turnOutputDir=null;collectedFiles=new Map;constructor(e){this.skillsDir=e.skillsDir,this.pythonPath=e.pythonPath,this.bashPath=e.bashPath,xp(this.skillsDir,{recursive:!0}),this.sweepStagingDirs(),this.reconcileFromDisk();for(let t of e.skills)this.skills.set(t.slug,t)}setSkills(e){this.skills.clear();for(let t of e)this.skills.set(t.slug,t);for(let t of[...this.extracted.keys()]){let r=this.skills.get(t);if(!r){this.extracted.delete(t);continue}let o=this.installedSha.get(t);r.bundleSha256&&o!==r.bundleSha256&&this.extracted.delete(t)}for(let t of[...this.installErrors.keys()])this.skills.has(t)||this.installErrors.delete(t);this.reconcileFromDisk()}reconcileFromDisk(){let e;try{e=yp(this.skillsDir,{withFileTypes:!0})}catch{return}for(let t of e){if(!t.isDirectory())continue;let r=t.name;if(r.startsWith(".")||r.includes(".staging-"))continue;let o=_t(this.skillsDir,r);(Hc(_t(o,"SKILL.md"))||Hc(_t(o,"scripts")))&&(this.skills.has(r)||this.skills.set(r,{slug:r,secrets:{}}),this.installedSha.has(r)||this.installedSha.set(r,this.readInstalledMarker(o)))}}readInstalledMarker(e){try{let t=Fw(_t(e,TA),"utf-8"),r=JSON.parse(t);return typeof r.sha256=="string"?r.sha256:void 0}catch{return}}async setupSkill(e){this.skills.set(e.slug,e),this.extracted.delete(e.slug);try{let t=await this.downloadAndExtract(e.slug,{allowStaleFallback:!1});return t?{installed:!0,path:PA(_t(this.skillsDir,".."),t.dir)||t.dir}:{installed:!1,error:`Skill "${e.slug}" is not configured on this device`}}catch(t){let r=t instanceof Error?t.message:String(t);return this.installErrors.set(e.slug,r),{installed:!1,error:r}}}toolHandlers(){return{octavus_skill_read:e=>this.handleSkillRead(e),octavus_skill_list:e=>this.handleSkillList(e),octavus_skill_run:e=>this.handleSkillRun(e)}}async handleSkillRead(e){let t=zs(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=await this.ensureExtracted(t);if(!r)return this.unavailableError(t);let o=zs(e,"file")??"SKILL.md",n=Bw(r.dir,o);if(!n)return{error:`Invalid file path: ${o}`};let i=qw(r);try{return{content:Fw(n,"utf-8"),path:o,...i?{warning:i}:{}}}catch{return{error:`File not found: ${o}`}}}async handleSkillList(e){let t=zs(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=await this.ensureExtracted(t);if(!r)return this.unavailableError(t);let o=qw(r),n=_t(r.dir,"scripts");try{let s=yp(n,{withFileTypes:!0}).filter(a=>a.isFile()).map(a=>({name:a.name,path:`scripts/${a.name}`}));return{skill:t,scripts:s,...o?{warning:o}:{}}}catch{return{skill:t,scripts:[],...o?{warning:o}:{}}}}async handleSkillRun(e){let t=zs(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=zs(e,"script");if(!r)return{error:"Missing required parameter: script"};let o=await this.ensureExtracted(t);if(!o)return this.unavailableError(t);let n=Bw(o.dir,r);if(!n||!Hc(n))return{error:`Script not found: ${r}`};let i=this.ensureTurnOutputDir(),s=Date.now(),a=yK(e.input)?e.input:void 0,u=this.skills.get(t)?.secrets??{},c={...SK(),...u,OUTPUT_DIR:i,PYTHONUTF8:"1",PYTHONIOENCODING:"utf-8"},l=bK(zs(e,"args"),c),{command:f,prefixArgs:h}=this.resolveInterpreter(n),p=await new Promise(_=>{let v=aK(f,[...h,n,...l],{cwd:o.dir,env:c,timeout:pK,maxBuffer:hK},(S,k,b)=>{_({stdout:k,stderr:b,exitCode:typeof S?.code=="number"?S.code:0,error:S?S.message:void 0})});a&&v.stdin&&(v.stdin.write(JSON.stringify(a)),v.stdin.end())}),g=this.readNewOutputFiles(s),m=qw(o);return{stdout:p.stdout||void 0,stderr:p.stderr||void 0,exitCode:p.exitCode,error:p.error,outputFiles:g.length>0?g:void 0,...m?{warning:m}:{}}}resolveInterpreter(e){return e.endsWith(".py")?{command:this.pythonPath??(process.platform==="win32"?"python":"python3"),prefixArgs:[]}:process.platform==="win32"&&e.endsWith(".ps1")?{command:"powershell.exe",prefixArgs:["-NoProfile","-ExecutionPolicy","Bypass","-File"]}:{command:this.bashPath??"bash",prefixArgs:[]}}unavailableError(e){let t=this.installErrors.get(e);return t?{error:`${t} (install failed - call octavus_skill_setup with skill "${e}" to retry)`}:{error:`Skill "${e}" is not available on this device`}}ensureTurnOutputDir(){if(!this.turnOutputDir){let e=zA(4).toString("hex");this.turnOutputDir=_t(this.skillsDir,".runs",e,"output"),xp(this.turnOutputDir,{recursive:!0})}return this.turnOutputDir}readNewOutputFiles(e){if(!this.turnOutputDir)return[];let t;try{t=yp(this.turnOutputDir,{withFileTypes:!0})}catch{return[]}let r=[],o=0;for(let n of t){if(!n.isFile())continue;let i=_t(this.turnOutputDir,n.name);try{let s=sK(i),a=this.collectedFiles.get(n.name),u=!a,c=a!==void 0&&s.mtimeMs>e;if(!u&&!c)continue;let l=Fw(i);if(l.byteLength>mK)continue;if(o+l.byteLength>gK)break;o+=l.byteLength,r.push({name:n.name,path:i,mediaType:Vw(n.name),size:l.byteLength,contentBase64:l.toString("base64")}),this.collectedFiles.set(n.name,{size:s.size,mtimeMs:s.mtimeMs})}catch{}}return r}cleanupRuns(){let e=_t(this.skillsDir,".runs");try{bp(e,{recursive:!0,force:!0})}catch{}this.turnOutputDir=null,this.collectedFiles.clear()}async ensureExtracted(e){let t=this.extracted.get(e);if(t)return t;let r=this.inflight.get(e);if(r)return await r;let o=this.downloadAndExtract(e,{allowStaleFallback:!0}).catch(n=>(this.installErrors.set(e,n instanceof Error?n.message:String(n)),null)).finally(()=>{this.inflight.delete(e)});return this.inflight.set(e,o),await o}async downloadAndExtract(e,t){let r=this.skills.get(e);if(!r)return null;let o=_t(this.skillsDir,e),n=Hc(_t(o,"SKILL.md"))||Hc(_t(o,"scripts")),i=this.installedSha.get(e),s=r.bundleSha256!==void 0&&i!==r.bundleSha256;if(n&&!s){let u={slug:e,dir:o};return this.extracted.set(e,u),u}try{await this.installBundle(r,o)}catch(u){let c=u instanceof Error?u.message:String(u);if(t.allowStaleFallback&&n){let l={slug:e,dir:o,staleReason:c};return this.extracted.set(e,l),l}throw new Error(`Skill "${e}" bundle error: ${c}`,{cause:u})}this.installedSha.set(e,r.bundleSha256),this.installErrors.delete(e);let a={slug:e,dir:o};return this.extracted.set(e,a),a}async installBundle(e,t){let o=(this.installLocks.get(e.slug)??Promise.resolve()).then(()=>this.performBundleInstall(e,t));this.installLocks.set(e.slug,o.then(()=>{},()=>{})),await o}async performBundleInstall(e,t){if(!e.bundleUrl)throw new Error(`No bundle URL for skill "${e.slug}" - call octavus_skill_setup to (re)install it`);let r=await fetch(e.bundleUrl);if(!r.ok)throw new Error(`Bundle download failed: HTTP ${r.status} ${r.statusText}`);let o=Buffer.from(await r.arrayBuffer());if(e.bundleSha256){let i=dK("sha256").update(o).digest("hex");if(i!==e.bundleSha256)throw new Error(`Bundle SHA-256 mismatch: expected ${e.bundleSha256.slice(0,12)}..., got ${i.slice(0,12)}...`)}let n=`${t}.staging-${zA(4).toString("hex")}`;try{xp(n,{recursive:!0}),await $K(o,n),IA(_t(n,TA),JSON.stringify({sha256:e.bundleSha256??null})),bp(t,{recursive:!0,force:!0}),iK(n,t)}catch(i){throw bp(n,{recursive:!0,force:!0}),i}}sweepStagingDirs(){let e;try{e=yp(this.skillsDir,{withFileTypes:!0})}catch{return}for(let t of e)if(!(!t.isDirectory()||!t.name.includes(".staging-")))try{bp(_t(this.skillsDir,t.name),{recursive:!0,force:!0})}catch{}}};function zs(e,t){let r=e[t];return typeof r=="string"&&r.length>0?r:void 0}function qw(e){return e.staleReason?`Using the previously installed version of "${e.slug}" - the latest bundle failed to install: ${e.staleReason}`:void 0}function yK(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bw(e,t){let r=uK(_t(e,t)),o=PA(e,r);return o===".."||o.startsWith(`..${lK}`)?null:r}function bK(e,t){return e?process.platform==="win32"?xK(e,t):(0,OA.parse)(e,t).filter(r=>typeof r=="string"):[]}function xK(e,t){let r=[],o="",n=!1,i=!1;for(let s of e){if(s==='"'){n=!n,i=!0;continue}if(!n&&(s===" "||s===" ")){i&&(r.push(o),o="",i=!1);continue}o+=s,i=!0}return i&&r.push(o),r.map(s=>wK(s,t))}function wK(e,t){let r=e.replace(/%([A-Za-z_][A-Za-z0-9_()]*)%/g,(o,n)=>t[n]??o);return r=r.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(o,n)=>t[n]??""),r=r.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(o,n)=>t[n]??""),r}function SK(){let e={};for(let t of vK){let r=process.env[t];typeof r=="string"&&(e[t]=r)}return e}async function $K(e,t){let o=await(await Promise.resolve().then(()=>We(EA(),1))).default.loadAsync(e),n=Object.keys(o.files).filter(s=>!o.files[s].dir);if(n.length===0)return;let i=kK(n);for(let s of n){if(s.includes("__MACOSX/"))continue;let a=i?s.slice(i.length):s;if(!a)continue;let u=Bw(t,a);if(!u)continue;let l=await o.files[s].async("nodebuffer");if(l.byteLength>_K)throw new Error(`Skill bundle entry too large: ${s}`);xp(cK(u),{recursive:!0}),IA(u,l)}}function kK(e){let t=null;for(let r of e){if(r.startsWith("__MACOSX/"))continue;let o=r.indexOf("/");if(o===-1)return null;let n=r.slice(0,o+1);if(t===null)t=n;else if(t!==n)return null}return t}import{stat as AK,readFile as NK}from"fs/promises";import{basename as DK,resolve as Hw,isAbsolute as jA,relative as jK,sep as UK}from"path";var wp={info(e,t){console.log(JSON.stringify({level:"info",message:e,...t,ts:new Date().toISOString()}))},warn(e,t){console.warn(JSON.stringify({level:"warn",message:e,...t,ts:new Date().toISOString()}))},error(e,t,r){let o=t instanceof Error?{error:t.message,stack:t.stack}:{error:t};console.error(JSON.stringify({level:"error",message:e,...o,...r,ts:new Date().toISOString()}))}},EK=1e3,zK=3e4,TK=.25,IK=60,RA=50,PK=6e4,OK=1e4,RK=45e3,CK=1e4,DA=class{config;log;ws=null;state="disconnected";reconnectAttempts=0;reconnectTimer=null;heartbeatTimer=null;livenessTimer=null;lastPingAt=0;intentionalClose=!1;hadDisconnect=!1;pendingLifecycle=[];constructor(e){this.config=e,this.log=e.logger??wp}getState(){return this.state}connect(){this.state==="connected"||this.state==="connecting"||(this.intentionalClose=!1,this.openWebSocket())}updateToken(e){this.config={...this.config,computerToken:e}}disconnect(){this.intentionalClose=!0,this.hadDisconnect=!1,this.clearTimers(),this.closeSocket("Client disconnect"),this.pendingLifecycle=[],this.setState("disconnected")}async closeGracefully(e=3e3){this.intentionalClose=!0,this.hadDisconnect=!1,this.clearTimers(),this.pendingLifecycle=[],this.setState("disconnected");let t=this.ws;this.ws=null,t&&await new Promise(r=>{let o=!1,n=null,i=()=>{o||(o=!0,n&&clearTimeout(n),r())};t.removeAllListeners(),t.on("close",i),t.on("error",i),t.readyState===kn.OPEN||t.readyState===kn.CONNECTING?(t.close(1e3,"Client disconnect"),n=setTimeout(()=>{try{t.terminate()}catch{}i()},e)):i()})}resetAndReconnect(){this.intentionalClose=!1,this.clearTimers(),this.closeSocket("Reset for reconnect"),this.reconnectAttempts=0,this.openWebSocket()}closeSocket(e){if(!this.ws)return;let t=this.ws;this.ws=null,t.removeAllListeners(),t.on("error",()=>{}),(t.readyState===kn.OPEN||t.readyState===kn.CONNECTING)&&t.close(1e3,e)}sendSessionEvent(e,t,r){this.send({type:"session-event",sessionId:e,event:t,seq:r})}sendSessionState(e,t,r){this.send({type:"session-state",sessionId:e,events:t,lastSeq:r})}sendSessionStarted(e){this.send({type:"session-started",sessionId:e})}sendSessionComplete(e,t,r,o,n){this.send({type:"session-complete",sessionId:e,status:t,error:r,errorType:o,title:n})}sendSessionTitle(e,t){this.send({type:"session-title",sessionId:e,title:t})}sendSessionRetry(e,t){this.send({type:"session-retry",sessionId:e,attempt:t.attempt,reason:t.reason,delayMs:t.delayMs})}sendDispatchAck(e){this.send({type:"dispatch-ack",sessionId:e})}openWebSocket(){this.setState("connecting");let e=new URL("/ws/computer",this.config.operatorWsUrl);e.searchParams.set("token",this.config.computerToken),this.ws=new kn(e.toString(),{handshakeTimeout:OK}),this.ws.on("open",()=>{let t=this.reconnectAttempts>0||this.hadDisconnect;this.reconnectAttempts=0,this.hadDisconnect=!1,this.setState("connected"),this.send({type:"sync",octoAgentIds:[this.config.octoAgentId],activeSessionIds:this.config.getActiveSessionIds?.()}),this.flushPendingLifecycle(),this.startHeartbeat(),this.startPingLiveness(),this.log.info("Connected to operator",{octoAgentId:this.config.octoAgentId,isReconnect:t}),t&&this.config.onReconnected?.()}),this.ws.on("message",t=>{let r=typeof t=="string"?t:Buffer.from(t).toString("utf8");this.handleMessage(r)}),this.ws.on("ping",()=>{this.lastPingAt=Date.now()}),this.ws.on("close",(t,r)=>{this.log.info("WebSocket closed",{octoAgentId:this.config.octoAgentId,code:t,reason:r?.toString()}),this.onDisconnect(t)}),this.ws.on("error",t=>{this.log.error("WebSocket error",t,{octoAgentId:this.config.octoAgentId})})}handleMessage(e){let t;try{t=vP.parse(JSON.parse(e))}catch{this.log.warn("Invalid message from operator",{octoAgentId:this.config.octoAgentId});return}switch(t.type){case"dispatch":this.config.onDispatch(t);break;case"stop":this.config.onStop(t.sessionId);break;case"request-session-state":this.config.onRequestSessionState(t.sessionId);break;case"start-screen-stream":case"device-reconnect":case"device-reconnect-agents":case"device-restart":case"start-voice-call":case"read-slack-prefs":this.config.onDeviceControl?.(t);break;case"heartbeat":break}}onDisconnect(e){if(this.clearTimers(),this.ws=null,this.intentionalClose){this.setState("disconnected");return}if(this.hadDisconnect=!0,e===bP){this.log.info("Connection revoked by operator, not reconnecting",{octoAgentId:this.config.octoAgentId}),this.config.onDisconnected?.({revoked:!0}),this.setState("disconnected");return}if(this.config.onDisconnected?.({revoked:!1}),this.reconnectAttempts>=IK){this.log.error("Max reconnect attempts reached",void 0,{octoAgentId:this.config.octoAgentId,attempts:this.reconnectAttempts}),this.setState("disconnected");return}this.setState("reconnecting"),this.scheduleReconnect()}scheduleReconnect(){let e=Math.min(EK*2**this.reconnectAttempts,zK),t=e*TK*(Math.random()*2-1),r=Math.max(0,e+t);this.reconnectAttempts+=1,this.log.info("Scheduling reconnect",{octoAgentId:this.config.octoAgentId,attempt:this.reconnectAttempts,delayMs:Math.round(r)}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.openWebSocket()},r)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.send({type:"heartbeat"})},yP)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}startPingLiveness(){this.stopPingLiveness(),this.lastPingAt=Date.now(),this.livenessTimer=setInterval(()=>{Date.now()-this.lastPingAt<=RK||(this.log.warn("No ping from operator - terminating stale socket",{octoAgentId:this.config.octoAgentId}),this.ws?.terminate())},CK)}stopPingLiveness(){this.livenessTimer&&(clearInterval(this.livenessTimer),this.livenessTimer=null)}clearTimers(){this.stopHeartbeat(),this.stopPingLiveness(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}send(e){this.ws?.readyState===kn.OPEN?this.ws.send(JSON.stringify(e)):(e.type==="session-started"||e.type==="session-complete"||e.type==="dispatch-ack")&&(this.pendingLifecycle.length<RA?(this.pendingLifecycle.push({msg:e,at:Date.now()}),this.log.info("Buffered lifecycle message for reconnect",{type:e.type,sessionId:"sessionId"in e?e.sessionId:void 0,buffered:this.pendingLifecycle.length})):this.log.warn("Lifecycle buffer full, dropping message",{type:e.type,sessionId:"sessionId"in e?e.sessionId:void 0,cap:RA}))}setState(e){this.state!==e&&(this.state=e,this.config.onStateChange?.(e))}flushPendingLifecycle(){if(this.pendingLifecycle.length===0)return;let e=Date.now(),t=this.pendingLifecycle.filter(({at:r})=>e-r<PK);if(this.pendingLifecycle=[],t.length!==0){this.log.info("Flushing buffered lifecycle messages",{count:t.length});for(let{msg:r}of t)this.ws?.readyState===kn.OPEN&&this.ws.send(JSON.stringify(r))}}},UA=1,Gw=600,LK=d.object({seconds:d.number().min(UA).max(Gw)}),MK=Ab.length+1,ZK=800*1e3,Jw=120*1e3,FK=ZK+Gw*1e3+Jw+120*1e3,qK=class{config;client;abortController=null;agentSession=null;title=null;eventBuffer=[];nextSeq=0;stalledByWatchdog=!1;stallTimer=null;constructor(e){this.config=e,this.client=new Gb({baseUrl:e.platformUrl,apiKey:e.operatorToken,traceModelRequests:e.traceModelRequests})}get sessionId(){return this.config.sessionId}updateConfig(e){this.config=e,this.client=new Gb({baseUrl:e.platformUrl,apiKey:e.operatorToken,traceModelRequests:e.traceModelRequests}),this.title=null,this.eventBuffer=[],this.nextSeq=0}async execute(){this.abortController=new AbortController,this.stalledByWatchdog=!1;let e;for(let t=0;t<MK;t++){let r=await this.runOnce();if(r.kind==="completed"||r.kind==="hard-error")return r.sessionResult;r.kind==="provider-error"&&(e=r.sessionResult);let o=Ab[t];if(o===void 0||this.abortController.signal.aborted||(this.config.onRetry?.(t+1,r.kind,o),await this.sleepUnlessAborted(o),this.abortController.signal.aborted))break;this.resetForRetry()}return this.abortController.signal.aborted?{status:"completed",title:this.title??void 0}:e||{status:"failed",error:"Lost connection to platform after multiple retry attempts",errorType:"transport",title:this.title??void 0}}async runOnce(){let{sessionId:e,trigger:t,onEvent:r}=this.config;this.agentSession??=this.createAgentSession();try{let o=this.agentSession.execute({type:"trigger",triggerName:t.triggerName,input:t.input,sender:t.sender},{signal:this.abortController.signal}),n=null,i=!1;this.bumpStallWatchdog();for await(let s of o){if(this.abortController.signal.aborted)break;let a=this.nextSeq;this.nextSeq+=1;let u=s;this.eventBuffer.push({seq:a,event:u}),r(e,s,a),this.bumpStallWatchdog(),s.type==="finish"?(this.eventBuffer=[],i=!0):(i=!1,s.type==="error"&&(n=u))}if(i)return{kind:"completed",sessionResult:{status:"completed",title:this.title??void 0}};if(this.stalledByWatchdog)return{kind:"hard-error",sessionResult:this.stallResult()};if(n){let s=lP(n,this.title);return s.retryable?{kind:"provider-error",sessionResult:s}:{kind:"hard-error",sessionResult:s}}return{kind:"transport-drop"}}catch(o){if(this.stalledByWatchdog)return{kind:"hard-error",sessionResult:this.stallResult()};if(this.abortController.signal.aborted)return{kind:"completed",sessionResult:{status:"completed",title:this.title??void 0}};let n=xf(o);if(n==="transport")return{kind:"transport-drop"};let i=bf(o),s=Sf.isInstance(o)?o:new Sf({errorType:"internal_error",message:i,source:"platform",retryable:!1,cause:o}),a=Nb(s),u=this.nextSeq;return this.nextSeq+=1,this.eventBuffer.push({seq:u,event:a}),r(e,a,u),n==="network"||n==="timeout"?{kind:"network-error"}:{kind:"hard-error",sessionResult:{status:"failed",error:i,errorType:n,title:this.title??void 0}}}finally{this.clearStallWatchdog()}}bumpStallWatchdog(){this.clearStallWatchdog(),this.stallTimer=setTimeout(()=>{this.stallTimer=null,this.stalledByWatchdog=!0,this.abortController?.abort()},FK)}clearStallWatchdog(){this.stallTimer&&(clearTimeout(this.stallTimer),this.stallTimer=null)}stallResult(){return{status:"failed",error:"The run stopped making progress and was ended. Send a message to continue.",errorType:"transport",title:this.title??void 0}}getBufferedEvents(){return{events:this.eventBuffer.map(e=>e.event),lastSeq:this.nextSeq>0?this.nextSeq-1:-1}}stop(){this.abortController?.abort()}createAgentSession(){let{sessionId:e,computer:t,tools:r}=this.config,o=this.client.agentSessions.attach(e,{tools:this.buildStaticToolHandlers(r,t),onToolResults:n=>this.uploadToolResults(n,e),onToolResultTruncated:n=>{(this.config.logger??wp).warn("Tool result too large; reduced to a preview before sending",{sessionId:e,toolName:n.toolName,originalBytes:n.originalBytes,keptBytes:n.keptBytes,variableCapture:n.variableCapture})},rejectClientToolCalls:!0});return o.setDynamicTools(t),o}async uploadToolResults(e,t){this.stallTimer&&this.bumpStallWatchdog();let r=(async()=>{await r1(e,this.client.files,t),await o1(e,this.client.files,t)})(),o,n=new Promise(i=>{o=setTimeout(()=>i("timeout"),Jw)});try{await Promise.race([r.then(()=>"done"),n])==="timeout"&&((this.config.logger??wp).warn("Tool result upload exceeded its time budget; continuing without full offload",{sessionId:t,budgetMs:Jw}),r.catch(()=>{}))}finally{o&&clearTimeout(o)}}resetForRetry(){this.eventBuffer=[],this.agentSession=this.createAgentSession()}sleepUnlessAborted(e){return new Promise(t=>{let r=this.abortController?.signal;if(r?.aborted){t();return}let o=null,n=()=>{o!==null&&clearTimeout(o),t()};o=setTimeout(()=>{r?.removeEventListener("abort",n),t()},e),r?.addEventListener("abort",n,{once:!0})})}buildStaticToolHandlers(e,t){let r=d.object({title:d.string().min(1)}),o={"set-chat-title":n=>{let i=r.safeParse(n);return i.success?(this.title=i.data.title,this.config.onTitleChange?.(this.config.sessionId,i.data.title),Promise.resolve({success:!0,title:i.data.title})):Promise.resolve({success:!1,error:"Title must be a non-empty string"})},wait:n=>this.handleWait(n)};return t&&(o["computer-ensure-ready"]=()=>this.handleEnsureReady(),o["computer-get-status"]=()=>this.handleGetStatus(),o["computer-reset"]=()=>this.handleReset()),e&&Object.assign(o,e),o}async handleEnsureReady(){let e=this.config.computer,{environment:t}=this.config;if(dc(e))try{let r=await e.ensureReady();return this.agentSession?.setDynamicTools(e),{ready:r.healthy,tools:e.toolSchemas().map(o=>o.name),...(r.recovered?.length??0)>0&&{recovered:r.recovered},...(r.failedEntries?.length??0)>0&&{failedEntries:r.failedEntries},...t&&{environment:t}}}catch(r){return{ready:!1,error:r instanceof Error?r.message:String(r)}}return{ready:!0,tools:e.toolSchemas().map(r=>r.name),...t&&{environment:t}}}async handleGetStatus(){let e=this.config.computer;if(dc(e))try{let t=await e.getHealth();return{ready:t.healthy,tools:t.totalTools,entries:t.entries}}catch(t){return{ready:!1,error:t instanceof Error?t.message:String(t)}}return{ready:!0,schemasAvailable:!0,tools:e.toolSchemas().length}}async handleReset(){let{onComputerReset:e}=this.config;if(!e)return{ready:!1,error:"Reset not available"};try{let t=await e();return this.config.computer=t,this.agentSession?.setDynamicTools(t),{ready:dc(t)?(await t.getHealth()).healthy:!0,tools:t.toolSchemas().map(o=>o.name),reset:!0}}catch(t){return{ready:!1,error:t instanceof Error?t.message:String(t)}}}handleWait(e){let t=LK.safeParse(e);if(!t.success)return Promise.resolve({success:!1,error:`seconds must be a number between ${UA} and ${Gw}`});let r=Math.round(t.data.seconds*1e3),o=this.abortController?.signal;return new Promise(n=>{if(o?.aborted){n({success:!0,waited_ms:0,aborted:!0});return}let i=setTimeout(()=>n({success:!0,waited_ms:r}),r);o?.addEventListener("abort",()=>{clearTimeout(i),n({success:!0,waited_ms:0,aborted:!0})},{once:!0})})}},BK=5e3,VK=10*6e4,WK=6e4,CA=20*1024*1024,AA=4e4;function HK(e){return new Promise(t=>{setTimeout(t,e)})}var JK=d.object({slug:d.string().min(1)}),GK=d.object({command:d.string().min(1),args:d.array(d.string()).optional(),env:d.record(d.string(),d.string()).optional(),connection:d.enum(["eager","lazy"]).optional()});function NA(e){return JSON.stringify({command:e.command,args:e.args,env:e.env,connection:e.connection})}var LA=class{config;log;activeExecutors=new Map;executorCache=new Map;cancelledSessions=new Map;terminalFailures=new Map;connectionLossTimer=null;idleCleanupTimer=null;afterSessionTimer=null;running=!1;resolvedComputer=null;computerPromise=null;currentDeviceMcpFingerprints=new Map;deviceSkillHandler=null;activeToolHandlers=null;oneShotResolvers=new Map;constructor(e){this.config=e,this.log=e.logger??wp}start(){this.running||(this.running=!0,this.idleCleanupTimer=setInterval(()=>this.cleanupIdleExecutors(),6e4))}async stop(){if(this.running=!1,this.cancelConnectionLossTimer(),this.idleCleanupTimer&&(clearInterval(this.idleCleanupTimer),this.idleCleanupTimer=null),this.afterSessionTimer&&(this.cancelAfterSessionTimer(),await this.fireAfterSession()),this.activeExecutors.size>0){for(let t of this.activeExecutors.values())t.stop();let e=Date.now()+BK;for(;this.activeExecutors.size>0&&Date.now()<e;)await HK(200);this.activeExecutors.size>0&&(this.log.warn("Drain timed out, forcing cleanup",{remaining:this.activeExecutors.size}),this.activeExecutors.clear(),this.notifyStateChange())}this.executorCache.clear(),this.cancelledSessions.clear()}getActiveSessions(){return[...this.activeExecutors.keys()].map(e=>({sessionId:e,octoAgentId:this.config.octoAgentId}))}isExecuting(){return this.activeExecutors.size>0}resetComputer(){this.resolvedComputer=null,this.computerPromise=null,this.currentDeviceMcpFingerprints.clear()}handleDispatch(e){return this.running?(this.cancelAfterSessionTimer(),this.activeExecutors.has(e.sessionId)?(this.log.warn("Ignoring duplicate dispatch for active session",{sessionId:e.sessionId}),this.config.connection.sendDispatchAck(e.sessionId),!0):(this.config.connection.sendDispatchAck(e.sessionId),this.executeSession(e).catch(t=>{this.log.error("Session execution threw outside its handler",t,{sessionId:e.sessionId})}),!0)):!1}async runLocalDispatch(e){let t=new Promise(r=>{this.oneShotResolvers.set(e.sessionId,r)});if(!this.handleDispatch(e))throw this.oneShotResolvers.delete(e.sessionId),new Error("SessionManager is not running");return await t}emitSessionComplete(e,t,r,o,n){this.config.connection.sendSessionComplete(e,t,r,o,n);let i=this.oneShotResolvers.get(e);i&&(this.oneShotResolvers.delete(e),i({status:t,error:r,errorType:o,title:n}))}handleStop(e){let t=this.activeExecutors.get(e);t?t.stop():this.cancelledSessions.set(e,Date.now())}handleConnectionLost(e){if(e.revoked){this.cancelConnectionLossTimer(),this.failActiveSessions("Operator connection revoked");return}this.activeExecutors.size!==0&&(this.connectionLossTimer||(this.log.warn("Operator connection lost with active sessions - starting grace window",{activeSessions:this.activeExecutors.size,graceMs:AA}),this.connectionLossTimer=setTimeout(()=>{this.connectionLossTimer=null,this.failActiveSessions("Operator connection lost",{report:!0})},AA)))}handleConnectionRestored(){this.connectionLossTimer&&(this.cancelConnectionLossTimer(),this.log.info("Operator connection restored within grace window - sessions continue"))}cancelConnectionLossTimer(){this.connectionLossTimer&&(clearTimeout(this.connectionLossTimer),this.connectionLossTimer=null)}failActiveSessions(e,t={}){if(this.activeExecutors.size!==0)for(let[r,o]of this.activeExecutors)this.terminalFailures.set(r,{reason:e,report:t.report??!1}),o.stop()}handleRequestSessionState(e){let t=this.activeExecutors.get(e);if(t){let{events:r,lastSeq:o}=t.getBufferedEvents();this.config.connection.sendSessionState(e,r,o)}else this.config.connection.sendSessionState(e,[],-1)}async getComputer(){if(this.resolvedComputer)return this.resolvedComputer;if(!this.computerPromise){let{computer:e}=this.config;this.computerPromise=typeof e=="function"?e():Promise.resolve(e)}return this.resolvedComputer=await this.computerPromise,this.resolvedComputer}consumeCancellation(e){return this.cancelledSessions.has(e)?(this.cancelledSessions.delete(e),this.log.info("Session was cancelled before execution started",{sessionId:e}),this.emitSessionComplete(e,"completed"),!0):!1}async executeSession(e){let{sessionId:t,operatorToken:r,trigger:o}=e;try{let n;try{n=await this.getComputer()}catch(a){let u=bf(a);this.log.error("Computer factory failed",a,{sessionId:t});let c=xf(a);this.emitSessionComplete(t,"failed",u,c==="transport"?"network":c);return}if(this.consumeCancellation(t))return;if(await this.reconcileDeviceMcps(n,e.deviceMcpConfigs),this.reconcileDeviceSkills(e.deviceSkillConfigs),this.config.onBeforeSession)try{await this.config.onBeforeSession()}catch(a){this.log.error("onBeforeSession failed",a)}if(this.consumeCancellation(t))return;let i=this.buildDeviceToolHandlers(n,e),s=this.getOrCreateExecutor(t,r,o,n,i);this.activeExecutors.set(t,s),this.notifyStateChange(),this.config.connection.sendSessionStarted(t);try{let a=await s.execute();if(this.consumeTerminalFailure(t))return;this.emitSessionComplete(t,a.status,a.error,a.errorType,a.title)}catch(a){if(this.consumeTerminalFailure(t))return;this.log.error("Session execution failed unexpectedly",a,{sessionId:t}),this.emitSessionComplete(t,"failed","Internal execution error","platform")}finally{this.deviceSkillHandler?.cleanupRuns(),this.terminalFailures.delete(t),this.activeExecutors.delete(t),this.notifyStateChange(),this.config.onAfterSession&&this.activeExecutors.size===0&&this.scheduleAfterSession()}}finally{let n=this.oneShotResolvers.get(t);n&&(this.oneShotResolvers.delete(t),n({status:"failed",error:"Run ended without completing",errorType:"network"})),this.config.onSessionSettled?.(t)}}consumeTerminalFailure(e){let t=this.terminalFailures.get(e);return t?(this.log.warn("Session aborted after operator disconnect",{sessionId:e,reason:t.reason}),t.report&&this.emitSessionComplete(e,"failed",t.reason,"network"),!0):!1}async reconcileDeviceMcps(e,t){if(!Yi(e)){t&&t.length>0&&this.log.warn("Device MCP configs provided but Computer does not support dynamic entries",{namespaces:t.map(o=>o.namespace)});return}let r=new Map;for(let o of t??[])r.set(o.namespace,o);for(let o of[...this.currentDeviceMcpFingerprints.keys()])if(!r.has(o))try{await e.removeEntry(o),this.currentDeviceMcpFingerprints.delete(o)}catch(n){this.log.warn("Failed to remove device MCP entry",{namespace:o,error:String(n)})}for(let[o,n]of r){let i=NA(n);if(this.currentDeviceMcpFingerprints.get(o)!==i){if(this.currentDeviceMcpFingerprints.has(o)){try{await e.removeEntry(o)}catch(s){this.log.warn("Failed to replace device MCP entry",{namespace:o,error:String(s)})}this.currentDeviceMcpFingerprints.delete(o)}try{await e.addEntry(o,{type:"stdio",command:n.command,args:n.args,env:n.env},{deferred:n.connection==="lazy"}),this.currentDeviceMcpFingerprints.set(o,i)}catch(s){this.log.warn("Failed to add device MCP entry",{namespace:o,error:String(s)})}}}}reconcileDeviceSkills(e){if(!e||e.length===0){this.deviceSkillHandler=null;return}if(!this.config.deviceSkillsDir){this.log.warn("Device skill configs provided but no deviceSkillsDir configured",{slugs:e.map(r=>r.slug)});return}let t=e.map(r=>({slug:r.slug,bundleUrl:r.bundleUrl,bundleSha256:r.bundleSha256,secrets:r.secrets}));this.deviceSkillHandler?this.deviceSkillHandler.setSkills(t):this.deviceSkillHandler=new Ww({skills:t,skillsDir:this.config.deviceSkillsDir,pythonPath:this.config.pythonPath})}buildDeviceToolHandlers(e,t){let r=!!(this.deviceSkillHandler&&(t.deviceSkillConfigs?.length??0)>0),o=(t.deviceMcpConfigs?.length??0)>0&&Yi(e),n=Yi(e),i=!!this.config.deviceSkillsDir,s=!!this.config.agentWorkspaceDir;if(!r&&!o&&!n&&!i&&!s)return this.activeToolHandlers=null,this.config.tools;let a={...this.config.tools??{}};if(this.activeToolHandlers=a,r){let u=this.deviceSkillHandler.toolHandlers();a[st.SKILL_READ]=u[st.SKILL_READ],a[st.SKILL_LIST]=u[st.SKILL_LIST],a[st.SKILL_RUN]=u[st.SKILL_RUN]}if(i&&(a[st.SKILL_SETUP]=u=>this.handleSkillSetup(u)),n&&(a[Fb.MCP_ACTIVATE]=u=>this.handleDeviceMcpActivate(e,u)),s){let u=this.config.agentWorkspaceDir;a[st.FILE_UPLOAD]=c=>this.handleFileUpload(c,u)}return a}async handleSkillSetup(e){let t=typeof e.skill=="string"?e.skill:void 0;if(!t)return{error:"Missing required parameter: skill"};let r=typeof e.bundleUrl=="string"?e.bundleUrl:void 0;if(!r)return{error:`Skill "${t}" could not be resolved - bundleUrl missing`};let o=typeof e.bundleSha256=="string"?e.bundleSha256:void 0,n=typeof e.secrets=="object"&&e.secrets!==null&&!Array.isArray(e.secrets)?e.secrets:{},i={slug:t,bundleUrl:r,bundleSha256:o,secrets:n};if(!this.deviceSkillHandler){if(!this.config.deviceSkillsDir)return{error:"Device skills are not configured on this device"};this.deviceSkillHandler=new Ww({skills:[i],skillsDir:this.config.deviceSkillsDir,pythonPath:this.config.pythonPath})}let s=await this.deviceSkillHandler.setupSkill(i);if(s.installed&&this.activeToolHandlers){let a=this.deviceSkillHandler.toolHandlers();this.activeToolHandlers[st.SKILL_READ]=a[st.SKILL_READ],this.activeToolHandlers[st.SKILL_LIST]=a[st.SKILL_LIST],this.activeToolHandlers[st.SKILL_RUN]=a[st.SKILL_RUN]}return s}async handleDeviceMcpActivate(e,t){let r=JK.safeParse(t);if(!r.success)return{error:"slug is required"};if(!Yi(e))return{error:"This computer does not support dynamic MCP activation"};let{slug:o}=r.data,n=GK.safeParse(t.deviceConfig);if(n.success&&!this.currentDeviceMcpFingerprints.has(o)){let a=n.data;try{let u=a.connection==="eager"?"eager":"lazy",c=a.args??[],l=a.env??{};await e.addEntry(o,{type:"stdio",command:a.command,args:c,env:l},{deferred:u==="lazy"}),this.currentDeviceMcpFingerprints.set(o,NA({namespace:o,name:o,description:"",command:a.command,args:c,env:l,connection:u}))}catch(u){return{error:u instanceof Error?u.message:String(u)}}}if(!this.currentDeviceMcpFingerprints.has(o))return{error:`MCP "${o}" is not registered on this device. Call computer-reset to refresh the device's MCP set.`};try{await e.restartEntry(o)}catch(a){return{error:a instanceof Error?a.message:String(a)}}let i=`${o}__`;return{activated:!0,tools:e.toolSchemas().filter(a=>a.name.startsWith(i))}}async handleFileUpload(e,t){let r=typeof e.path=="string"?e.path.trim():"";if(!r)return{error:"Missing required parameter: path"};let o=Hw(t),n=jA(r)?r:Hw(o,r),i=Hw(n);if(!KK(i,o))return{error:`Path is outside the agent workspace (${o}). Only files inside the workspace can be uploaded.`};let s;try{s=await AK(i)}catch{return{error:`File not found: ${i}`}}if(!s.isFile())return{error:`Path is not a file: ${i}`};if(s.size>CA)return{error:`File exceeds maximum upload size of ${CA/(1024*1024)}MB`};let a;try{a=await NK(i)}catch(l){return{error:l instanceof Error?l.message:"Failed to read file"}}let u=DK(i),c=Vw(u);return{outputFiles:[{name:u,path:i,mediaType:c,size:a.byteLength,contentBase64:a.toString("base64")}]}}getOrCreateExecutor(e,t,r,o,n){let i=(h,p,g)=>{this.config.connection.sendSessionEvent(e,p,g)},s=this.config.onComputerReset,a=s?async()=>{let h=await s();return this.resolvedComputer=h,this.currentDeviceMcpFingerprints.clear(),h}:void 0,u=(h,p)=>{this.config.connection.sendSessionTitle(e,p)},c={sessionId:e,operatorToken:t,trigger:r,platformUrl:this.config.platformUrl,computer:o,onEvent:i,onTitleChange:u,onRetry:(h,p,g)=>{this.log.warn("Retrying session execution",{sessionId:e,attempt:h,reason:p,delayMs:g}),this.config.connection.sendSessionRetry(e,{attempt:h,reason:p,delayMs:g})},tools:n??this.config.tools,onComputerReset:a,traceModelRequests:this.config.traceModelRequests,environment:this.config.environment,logger:this.log},l=this.executorCache.get(e);if(l)return l.lastActiveAt=Date.now(),l.executor.updateConfig(c),this.log.info("Reusing executor for session",{sessionId:e}),l.executor;let f=new qK(c);return this.executorCache.set(e,{executor:f,lastActiveAt:Date.now()}),f}cancelAfterSessionTimer(){this.afterSessionTimer&&(clearTimeout(this.afterSessionTimer),this.afterSessionTimer=null)}scheduleAfterSession(){if(this.cancelAfterSessionTimer(),!this.running)return;let e=this.config.idleTimeoutMs??0;if(e<=0){this.fireAfterSession();return}this.afterSessionTimer=setTimeout(()=>{this.afterSessionTimer=null,this.fireAfterSession()},e)}async fireAfterSession(){if(!(this.activeExecutors.size>0))try{await this.config.onAfterSession?.()}catch(e){this.log.error("onAfterSession failed",e)}}cleanupIdleExecutors(){let e=Date.now();for(let[t,r]of this.executorCache)e-r.lastActiveAt>VK&&!this.activeExecutors.has(t)&&(this.log.info("Removing idle executor cache for session",{sessionId:t}),this.executorCache.delete(t));for(let[t,r]of this.cancelledSessions)e-r>WK&&this.cancelledSessions.delete(t)}notifyStateChange(){this.config.onSessionStateChange?.(this.getActiveSessions())}};function KK(e,t){if(e===t)return!0;let r=jK(t,e);return r===""?!0:r.startsWith("..")||jA(r)?!1:!r.split(UK).includes("..")}import{homedir as YK}from"os";import{join as Jc}from"path";import{mkdirSync as MA,readFileSync as XK,writeFileSync as QK}from"fs";var e7="production",t7={production:"https://octavus.ai",local:"http://localhost:3000"};function Gc(e){let t=(e||process.env.OCTAVUS_ENV||e7).trim();if(!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t))throw new Error(`Invalid environment "${t}": use letters, digits, dot, underscore, or hyphen (e.g. production, staging).`);return t}function Ts(e){return process.env.OCTAVUS_HOME||Jc(YK(),".octavus",e)}function ZA(e){return Jc(Ts(e),"config.json")}function Is(e){try{let t=XK(ZA(e),"utf8"),r=JSON.parse(t);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}function FA(e,t){let r=Ts(e);MA(r,{recursive:!0,mode:448});let o={...Is(e),...t};return QK(ZA(e),`${JSON.stringify(o,null,2)}
|
|
71
|
+
`,{mode:384}),o}function qA(e,t){return t||process.env.OCTAVUS_API_KEY||Is(e).apiKey}function Kc(e,t){let r=t||process.env.OCTAVUS_PLATFORM_URL||Is(e).platformUrl||t7[e];return r?r.replace(/\/+$/,""):void 0}function Sp(e,t){let r=t||process.env.OCTAVUS_OPERATOR_WS_URL||Is(e).operatorWsUrl;return r?r.replace(/\/+$/,""):void 0}function BA(e,t){let r=Jc(Ts(e),t),o=Jc(r,"browser-profile"),n=Jc(r,"skills");for(let i of[r,o,n])MA(i,{recursive:!0,mode:448});return{base:r,browserProfileDir:o,skillsDir:n}}function r7(e){return e instanceof Error?e.message:String(e)}function VA(e){let t=(r,o,n)=>{let i=n&&Object.keys(n).length>0?` ${JSON.stringify(n)}`:"";process.stderr.write(`[${r}] ${o}${i}
|
|
72
|
+
`)};return{info:(r,o)=>{e&&t("info",r,o)},warn:(r,o)=>t("warn",r,o),error:(r,o,n)=>t("error",r,{...n,...o==null?{}:{error:r7(o)}})}}import{createRequire as Bce}from"module";import{existsSync as Vce}from"fs";import{dirname as B6,join as wa}from"path";import{fileURLToPath as Wce}from"url";var WA,Kw=Object.freeze({status:"aborted"});function z(e,t,r){function o(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);let c=s.prototype,l=Object.keys(c);for(let f=0;f<l.length;f++){let h=l[f];h in a||(a[h]=c[h].bind(a))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function s(a){var u;let c=r?.Parent?new i:this;o(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var n7=Symbol("zod_brand"),Nr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ps=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(WA=globalThis).__zod_globalConfig??(WA.__zod_globalConfig={});var Os=globalThis.__zod_globalConfig;function kt(e){return e&&Object.assign(Os,e),Os}var re={};Zt(re,{BIGINT_FORMAT_RANGES:()=>KA,Class:()=>Xw,NUMBER_FORMAT_RANGES:()=>o0,aborted:()=>Gn,allowsEval:()=>t0,assert:()=>c7,assertEqual:()=>o7,assertIs:()=>s7,assertNever:()=>a7,assertNotEqual:()=>i7,assignProp:()=>Hn,base64ToUint8Array:()=>XA,base64urlToUint8Array:()=>k7,cached:()=>Cs,captureStackTrace:()=>Ep,cleanEnum:()=>$7,cleanRegex:()=>eu,clone:()=>Yt,cloneDef:()=>l7,createTransparentProxy:()=>g7,defineLazy:()=>le,esc:()=>kp,escapeRegex:()=>cn,explicitlyAborted:()=>i0,extend:()=>y7,finalizeIssue:()=>Xt,floatSafeRemainder:()=>Qw,getElementAtPath:()=>d7,getEnumValues:()=>Xc,getLengthableOrigin:()=>tu,getParsedType:()=>m7,getSizableOrigin:()=>YA,hexToUint8Array:()=>z7,isObject:()=>Zo,isPlainObject:()=>Jn,issue:()=>As,joinValues:()=>$p,jsonStringifyReplacer:()=>Rs,merge:()=>x7,mergeDefs:()=>an,normalizeParams:()=>q,nullish:()=>Qc,numKeys:()=>h7,objectClone:()=>u7,omit:()=>v7,optionalKeys:()=>n0,parsedType:()=>s0,partial:()=>w7,pick:()=>_7,prefixIssues:()=>un,primitiveTypes:()=>GA,promiseAllObject:()=>f7,propertyKeyTypes:()=>r0,randomString:()=>p7,required:()=>S7,safeExtend:()=>b7,shallowClone:()=>JA,slugify:()=>e0,stringifyPrimitive:()=>zp,uint8ArrayToBase64:()=>QA,uint8ArrayToBase64url:()=>E7,uint8ArrayToHex:()=>T7,unwrapMessage:()=>Yc});function o7(e){return e}function i7(e){return e}function s7(e){}function a7(e){throw new Error("Unexpected value in exhaustive check")}function c7(e){}function Xc(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function $p(e,t="|"){return e.map(r=>zp(r)).join(t)}function Rs(e,t){return typeof t=="bigint"?t.toString():t}function Cs(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Qc(e){return e==null}function eu(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Qw(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var HA=Symbol("evaluating");function le(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==HA)return o===void 0&&(o=HA,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function u7(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Hn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function an(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function l7(e){return an(e._zod.def)}function d7(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function f7(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function p7(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function kp(e){return JSON.stringify(e)}function e0(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ep="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var t0=Cs(()=>{if(Os.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Jn(e){if(Zo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Zo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function JA(e){return Jn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function h7(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var m7=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},r0=new Set(["string","number","symbol"]),GA=new Set(["string","number","bigint","boolean","symbol","undefined"]);function cn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yt(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function g7(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function zp(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function n0(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var o0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},KA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _7(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=an(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return Hn(this,"shape",s),s},checks:[]});return Yt(e,i)}function v7(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=an(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return Hn(this,"shape",s),s},checks:[]});return Yt(e,i)}function y7(e,t){if(!Jn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=an(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Hn(this,"shape",i),i}});return Yt(e,n)}function b7(e,t){if(!Jn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=an(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Hn(this,"shape",o),o}});return Yt(e,r)}function x7(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=an(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Hn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Yt(e,r)}function w7(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=an(t._zod.def,{get shape(){let a=t._zod.def.shape,u={...a};if(r)for(let c in r){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(u[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(let c in a)u[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Hn(this,"shape",u),u},checks:[]});return Yt(t,s)}function S7(e,t,r){let o=an(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return Hn(this,"shape",i),i}});return Yt(t,o)}function Gn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function i0(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function un(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Yc(e){return typeof e=="string"?e:e?.message}function Xt(e,t,r){let o=e.message?e.message:Yc(e.inst?._zod.def?.error?.(e))??Yc(t?.error?.(e))??Yc(r.customError?.(e))??Yc(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=s),a}function YA(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function tu(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function s0(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function As(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function $7(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function XA(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function QA(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function k7(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return XA(t+r)}function E7(e){return QA(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function z7(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function T7(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xw=class{constructor(...t){}};var eN=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Rs,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Tp=z("$ZodError",eN),a0=z("$ZodError",eN,{Parent:Error});function c0(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function u0(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let u=r,c=0;for(;c<a.length;){let l=a[c];c===a.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(t(s))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}}};return o(e),r}var Ip=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Nr;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map(u=>Xt(u,i,kt())));throw Ep(a,n?.callee),a}return s.value};var Pp=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??e)(s.issues.map(u=>Xt(u,i,kt())));throw Ep(a,n?.callee),a}return s.value};var ru=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Nr;return i.issues.length?{success:!1,error:new(e??Tp)(i.issues.map(s=>Xt(s,n,kt())))}:{success:!0,data:i.value}},nu=ru(a0),ou=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Xt(s,n,kt())))}:{success:!0,data:i.value}},Op=ou(a0),tN=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ip(e)(t,r,n)};var rN=e=>(t,r,o)=>Ip(e)(t,r,o);var nN=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Pp(e)(t,r,n)};var oN=e=>async(t,r,o)=>Pp(e)(t,r,o);var iN=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ru(e)(t,r,n)};var sN=e=>(t,r,o)=>ru(e)(t,r,o);var aN=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ou(e)(t,r,n)};var cN=e=>async(t,r,o)=>ou(e)(t,r,o);var uN=/^[cC][0-9a-z]{6,}$/,lN=/^[0-9a-z]+$/,dN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fN=/^[0-9a-vA-V]{20}$/,pN=/^[A-Za-z0-9]{27}$/,hN=/^[a-zA-Z0-9_-]{21}$/,mN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var gN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,l0=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var _N=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var P7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vN(){return new RegExp(P7,"u")}var yN=/^(?:(?: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])$/,bN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var xN=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,wN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,SN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,d0=/^[A-Za-z0-9_-]*$/;var $N=/^https?$/,kN=/^\+[1-9]\d{6,14}$/,EN="(?:(?:\\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])))",zN=new RegExp(`^${EN}$`);function TN(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function IN(e){return new RegExp(`^${TN(e)}$`)}function PN(e){let t=TN({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${EN}T(?:${o})$`)}var ON=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},RN=/^-?\d+n?$/,CN=/^-?\d+$/,f0=/^-?\d+(?:\.\d+)?$/,AN=/^(?:true|false)$/i,NN=/^null$/i;var DN=/^[^A-Z]*$/,jN=/^[^a-z]*$/;var Xe=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),UN={number:"number",bigint:"bigint",object:"date"},p0=z("$ZodCheckLessThan",(e,t)=>{Xe.init(e,t);let r=UN[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),h0=z("$ZodCheckGreaterThan",(e,t)=>{Xe.init(e,t);let r=UN[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),LN=z("$ZodCheckMultipleOf",(e,t)=>{Xe.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Qw(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),MN=z("$ZodCheckNumberFormat",(e,t)=>{Xe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=o0[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=n,a.maximum=i,r&&(a.pattern=CN)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var ZN=z("$ZodCheckMaxLength",(e,t)=>{var r;Xe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Qc(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let s=tu(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),FN=z("$ZodCheckMinLength",(e,t)=>{var r;Xe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Qc(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let s=tu(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qN=z("$ZodCheckLengthEquals",(e,t)=>{var r;Xe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Qc(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let s=tu(n),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),su=z("$ZodCheckStringFormat",(e,t)=>{var r,o;Xe.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),BN=z("$ZodCheckRegex",(e,t)=>{su.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),VN=z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=DN),su.init(e,t)}),WN=z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jN),su.init(e,t)}),HN=z("$ZodCheckIncludes",(e,t)=>{Xe.init(e,t);let r=cn(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),JN=z("$ZodCheckStartsWith",(e,t)=>{Xe.init(e,t);let r=new RegExp(`^${cn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),GN=z("$ZodCheckEndsWith",(e,t)=>{Xe.init(e,t);let r=new RegExp(`.*${cn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var KN=z("$ZodCheckOverwrite",(e,t)=>{Xe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Rp=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
73
|
+
`).filter(s=>s),n=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
74
|
+
`))}};var XN={major:4,minor:4,patch:1};var he=z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=XN;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,u)=>{let c=Gn(s),l;for(let f of a){if(f._zod.def.when){if(i0(s)||!f._zod.def.when(s))continue}else if(c)continue;let h=s.issues.length,p=f._zod.check(s);if(p instanceof Promise&&u?.async===!1)throw new Nr;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,s.issues.length!==h&&(c||(c=Gn(s,h)))});else{if(s.issues.length===h)continue;c||(c=Gn(s,h))}}return l?l.then(()=>s):s},i=(s,a,u)=>{if(Gn(s))return s.aborted=!0,s;let c=n(a,o,u);if(c instanceof Promise){if(u.async===!1)throw new Nr;return c.then(l=>e._zod.parse(l,u))}return e._zod.parse(c,u)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(l=>i(l,s,a)):i(c,s,a)}let u=e._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new Nr;return u.then(c=>n(c,o,a))}return n(u,o,a)}}le(e,"~standard",()=>({validate:n=>{try{let i=nu(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Op(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Np=z("$ZodString",(e,t)=>{he.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ON(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$e=z("$ZodStringFormat",(e,t)=>{su.init(e,t),Np.init(e,t)}),aD=z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gN),$e.init(e,t)}),cD=z("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=l0(o))}else t.pattern??(t.pattern=l0());$e.init(e,t)}),uD=z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_N),$e.init(e,t)}),lD=z("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===$N.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),dD=z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vN()),$e.init(e,t)}),fD=z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hN),$e.init(e,t)}),pD=z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uN),$e.init(e,t)}),hD=z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=lN),$e.init(e,t)}),mD=z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dN),$e.init(e,t)}),gD=z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=fN),$e.init(e,t)}),_D=z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=pN),$e.init(e,t)}),vD=z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=PN(t)),$e.init(e,t)}),yD=z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zN),$e.init(e,t)}),bD=z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=IN(t)),$e.init(e,t)}),xD=z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mN),$e.init(e,t)}),wD=z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yN),$e.init(e,t),e._zod.bag.format="ipv4"}),SD=z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=bN),$e.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var $D=z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=xN),$e.init(e,t)}),kD=z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=wN),$e.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ED(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var zD=z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=SN),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ED(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function C7(e){if(!d0.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ED(r)}var TD=z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=d0),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{C7(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ID=z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=kN),$e.init(e,t)});function A7(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var PD=z("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=r=>{A7(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var g0=z("$ZodNumber",(e,t)=>{he.init(e,t),e._zod.pattern=e._zod.bag.pattern??f0,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),OD=z("$ZodNumberFormat",(e,t)=>{MN.init(e,t),g0.init(e,t)}),RD=z("$ZodBoolean",(e,t)=>{he.init(e,t),e._zod.pattern=AN,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),CD=z("$ZodBigInt",(e,t)=>{he.init(e,t),e._zod.pattern=RN,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var AD=z("$ZodNull",(e,t)=>{he.init(e,t),e._zod.pattern=NN,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),ND=z("$ZodAny",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),DD=z("$ZodUnknown",(e,t)=>{he.init(e,t),e._zod.parse=r=>r}),jD=z("$ZodNever",(e,t)=>{he.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var UD=z("$ZodDate",(e,t)=>{he.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function QN(e,t,r){e.issues.length&&t.issues.push(...un(r,e.issues)),t.value[r]=e.value}var LD=z("$ZodArray",(e,t)=>{he.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let a=n[s],u=t.element._zod.run({value:a,issues:[]},o);u instanceof Promise?i.push(u.then(c=>QN(c,r,s))):QN(u,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Ap(e,t,r,o,n,i){let s=r in o;if(e.issues.length){if(n&&i&&!s)return;t.issues.push(...un(r,e.issues))}if(!s&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function MD(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=n0(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function ZD(e,t,r,o,n,i){let s=[],a=n.keySet,u=n.catchall._zod,c=u.def.type,l=u.optin==="optional",f=u.optout==="optional";for(let h in t){if(h==="__proto__"||a.has(h))continue;if(c==="never"){s.push(h);continue}let p=u.run({value:t[h],issues:[]},o);p instanceof Promise?e.push(p.then(g=>Ap(g,r,h,t,l,f))):Ap(p,r,h,t,l,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var N7=z("$ZodObject",(e,t)=>{if(he.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...a};return Object.defineProperty(t,"shape",{value:u}),u}})}let o=Cs(()=>MD(t));le(e._zod,"propValues",()=>{let a=t.shape,u={};for(let c in a){let l=a[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(let f of l.values)u[c].add(f)}}return u});let n=Zo,i=t.catchall,s;e._zod.parse=(a,u)=>{s??(s=o.value);let c=a.value;if(!n(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};let l=[],f=s.shape;for(let h of s.keys){let p=f[h],g=p._zod.optin==="optional",m=p._zod.optout==="optional",_=p._zod.run({value:c[h],issues:[]},u);_ instanceof Promise?l.push(_.then(v=>Ap(v,a,h,c,g,m))):Ap(_,a,h,c,g,m)}return i?ZD(l,c,a,u,o.value,e):l.length?Promise.all(l).then(()=>a):a}}),FD=z("$ZodObjectJIT",(e,t)=>{N7.init(e,t);let r=e._zod.parse,o=Cs(()=>MD(t)),n=h=>{let p=new Rp(["shape","payload","ctx"]),g=o.value,m=k=>{let b=kp(k);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");let _=Object.create(null),v=0;for(let k of g.keys)_[k]=`key_${v++}`;p.write("const newResult = {};");for(let k of g.keys){let b=_[k],x=kp(k),T=h[k],C=T?._zod?.optin==="optional",D=T?._zod?.optout==="optional";p.write(`const ${b} = ${m(k)};`),C&&D?p.write(`
|
|
75
|
+
if (${b}.issues.length) {
|
|
76
|
+
if (${x} in input) {
|
|
77
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
78
|
+
...iss,
|
|
79
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
80
|
+
})));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${b}.value === undefined) {
|
|
85
|
+
if (${x} in input) {
|
|
86
|
+
newResult[${x}] = undefined;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newResult[${x}] = ${b}.value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
`):C?p.write(`
|
|
93
|
+
if (${b}.issues.length) {
|
|
94
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
95
|
+
...iss,
|
|
96
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
97
|
+
})));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (${b}.value === undefined) {
|
|
101
|
+
if (${x} in input) {
|
|
102
|
+
newResult[${x}] = undefined;
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
newResult[${x}] = ${b}.value;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
`):p.write(`
|
|
109
|
+
const ${b}_present = ${x} in input;
|
|
110
|
+
if (${b}.issues.length) {
|
|
111
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
112
|
+
...iss,
|
|
113
|
+
path: iss.path ? [${x}, ...iss.path] : [${x}]
|
|
114
|
+
})));
|
|
115
|
+
}
|
|
116
|
+
if (!${b}_present && !${b}.issues.length) {
|
|
117
|
+
payload.issues.push({
|
|
118
|
+
code: "invalid_type",
|
|
119
|
+
expected: "nonoptional",
|
|
120
|
+
input: undefined,
|
|
121
|
+
path: [${x}]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (${b}_present) {
|
|
126
|
+
if (${b}.value === undefined) {
|
|
127
|
+
newResult[${x}] = undefined;
|
|
128
|
+
} else {
|
|
129
|
+
newResult[${x}] = ${b}.value;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");let S=p.compile();return(k,b)=>S(h,k,b)},i,s=Zo,a=!Os.jitless,c=a&&t0.value,l=t.catchall,f;e._zod.parse=(h,p)=>{f??(f=o.value);let g=h.value;return s(g)?a&&c&&p?.async===!1&&p.jitless!==!0?(i||(i=n(t.shape)),h=i(h,p),l?ZD([],g,h,p,f,e):h):r(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function eD(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Gn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Xt(s,o,kt())))}),t)}var _0=z("$ZodUnion",(e,t)=>{he.init(e,t),le(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),le(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),le(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),le(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>eu(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let u=a._zod.run({value:o.value,issues:[]},n);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}return i?Promise.all(s).then(a=>eD(a,o,e,n)):eD(s,o,e,n)}});var qD=z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,_0.init(e,t);let r=e._zod.parse;le(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,u]of Object.entries(s)){n[a]||(n[a]=new Set);for(let c of u)n[a].add(c)}}return n});let o=Cs(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of a){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!Zo(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),n)}}),BD=z("$ZodIntersection",(e,t)=>{he.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,c])=>tD(r,u,c)):tD(r,i,s)}});function m0(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Jn(e)&&Jn(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=m0(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=m0(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function tD(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let u of a.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let u of a.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n&&e.issues.push({...n,keys:i}),Gn(e))return e;let s=m0(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var VD=z("$ZodRecord",(e,t)=>{he.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Jn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let l=t.keyType._zod.run({value:c,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Xt(p,o,kt())),input:c,path:[c],inst:e});continue}let f=l.value,h=t.valueType._zod.run({value:n[c],issues:[]},o);h instanceof Promise?i.push(h.then(p=>{p.issues.length&&r.issues.push(...un(c,p.issues)),r.value[f]=p.value})):(h.issues.length&&r.issues.push(...un(c,h.issues)),r.value[f]=h.value)}let u;for(let c in n)a.has(c)||(u=u??[],u.push(c));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let u=t.keyType._zod.run({value:a,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&f0.test(a)&&u.issues.length){let f=t.keyType._zod.run({value:Number(a),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(u=f)}if(u.issues.length){t.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>Xt(f,o,kt())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&r.issues.push(...un(a,f.issues)),r.value[u.value]=f.value})):(l.issues.length&&r.issues.push(...un(a,l.issues)),r.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}});var WD=z("$ZodEnum",(e,t)=>{he.init(e,t);let r=Xc(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>r0.has(typeof n)).map(n=>typeof n=="string"?cn(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),HD=z("$ZodLiteral",(e,t)=>{if(he.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?cn(o):o?cn(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}});var JD=z("$ZodTransform",(e,t)=>{he.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ps(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new Nr;return r.value=n,r}});function rD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var v0=z("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),le(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${eu(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>rD(i,r.value)):rD(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),GD=z("$ZodExactOptional",(e,t)=>{v0.init(e,t),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),KD=z("$ZodNullable",(e,t)=>{he.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${eu(r.source)}|null)$`):void 0}),le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),YD=z("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>nD(i,t)):nD(n,t)}});function nD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var XD=z("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),QD=z("$ZodNonOptional",(e,t)=>{he.init(e,t),le(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>oD(i,e)):oD(n,e)}});function oD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var ej=z("$ZodCatch",(e,t)=>{he.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>Xt(s,o,kt()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Xt(i,o,kt()))},input:r.value}),r.issues=[]),r)}});var tj=z("$ZodPipe",(e,t)=>{he.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Cp(s,t.in,o)):Cp(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Cp(i,t.out,o)):Cp(n,t.out,o)}});function Cp(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var rj=z("$ZodReadonly",(e,t)=>{he.init(e,t),le(e._zod,"propValues",()=>t.innerType._zod.propValues),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"optin",()=>t.innerType?._zod?.optin),le(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(iD):iD(n)}});function iD(e){return e.value=Object.freeze(e.value),e}var nj=z("$ZodCustom",(e,t)=>{Xe.init(e,t),he.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>sD(i,r,o,e));sD(n,r,o,e)}});function sD(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(As(n))}}var D7=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=s0(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${zp(n.values[0])}`:`Invalid option: expected one of ${$p(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${$p(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function oj(){return{localeError:D7()}}var ij,j7=Symbol("ZodOutput"),U7=Symbol("ZodInput"),y0=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function sj(){return new y0}(ij=globalThis).__zod_globalRegistry??(ij.__zod_globalRegistry=sj());var Kn=globalThis.__zod_globalRegistry;function aj(e,t){return new e({type:"string",...q(t)})}function cj(e,t){return new e({type:"string",coerce:!0,...q(t)})}function uj(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...q(t)})}function b0(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...q(t)})}function lj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...q(t)})}function dj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...q(t)})}function fj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...q(t)})}function pj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...q(t)})}function x0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(t)})}function hj(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...q(t)})}function mj(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...q(t)})}function gj(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...q(t)})}function _j(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...q(t)})}function vj(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...q(t)})}function yj(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...q(t)})}function bj(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...q(t)})}function xj(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...q(t)})}function wj(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...q(t)})}function Sj(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...q(t)})}function $j(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...q(t)})}function kj(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...q(t)})}function Ej(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...q(t)})}function zj(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...q(t)})}function Tj(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...q(t)})}function Ij(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...q(t)})}function Pj(e,t){return new e({type:"string",format:"date",check:"string_format",...q(t)})}function Oj(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...q(t)})}function Rj(e,t){return new e({type:"string",format:"duration",check:"string_format",...q(t)})}function Cj(e,t){return new e({type:"number",checks:[],...q(t)})}function Aj(e,t){return new e({type:"number",coerce:!0,checks:[],...q(t)})}function Nj(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...q(t)})}function Dj(e,t){return new e({type:"boolean",...q(t)})}function jj(e,t){return new e({type:"boolean",coerce:!0,...q(t)})}function Uj(e,t){return new e({type:"bigint",coerce:!0,...q(t)})}function Lj(e,t){return new e({type:"null",...q(t)})}function Mj(e){return new e({type:"any"})}function Zj(e){return new e({type:"unknown"})}function Fj(e,t){return new e({type:"never",...q(t)})}function qj(e,t){return new e({type:"date",coerce:!0,...q(t)})}function Ns(e,t){return new p0({check:"less_than",...q(t),value:e,inclusive:!1})}function ln(e,t){return new p0({check:"less_than",...q(t),value:e,inclusive:!0})}function Ds(e,t){return new h0({check:"greater_than",...q(t),value:e,inclusive:!1})}function mr(e,t){return new h0({check:"greater_than",...q(t),value:e,inclusive:!0})}function au(e,t){return new LN({check:"multiple_of",...q(t),value:e})}function Dp(e,t){return new ZN({check:"max_length",...q(t),maximum:e})}function js(e,t){return new FN({check:"min_length",...q(t),minimum:e})}function jp(e,t){return new qN({check:"length_equals",...q(t),length:e})}function w0(e,t){return new BN({check:"string_format",format:"regex",...q(t),pattern:e})}function S0(e){return new VN({check:"string_format",format:"lowercase",...q(e)})}function $0(e){return new WN({check:"string_format",format:"uppercase",...q(e)})}function k0(e,t){return new HN({check:"string_format",format:"includes",...q(t),includes:e})}function E0(e,t){return new JN({check:"string_format",format:"starts_with",...q(t),prefix:e})}function z0(e,t){return new GN({check:"string_format",format:"ends_with",...q(t),suffix:e})}function Yn(e){return new KN({check:"overwrite",tx:e})}function T0(e){return Yn(t=>t.normalize(e))}function I0(){return Yn(e=>e.trim())}function P0(){return Yn(e=>e.toLowerCase())}function O0(){return Yn(e=>e.toUpperCase())}function R0(){return Yn(e=>e0(e))}function Bj(e,t,r){return new e({type:"array",element:t,...q(r)})}function Vj(e,t,r){let o=q(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Wj(e,t,r){return new e({type:"custom",check:"custom",fn:t,...q(r)})}function Hj(e,t){let r=L7(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(As(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(As(i))}},e(o.value,o)),t);return r}function L7(e,t){let r=new Xe({check:"custom",...q(t)});return r._zod.check=e,r}function C0(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Kn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ue(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let h=s.schema,p=t.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(e,t,h,l)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),Ue(f,t,l),t.seen.get(f).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&vt(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function A0(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let u=o.get(a);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,h=e.external.uri??(g=>g);if(f)return{ref:h(f)};let p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${h("__shared")}#/${a}/${p}`}}if(s[1]===r)return{ref:"#"};let c=`#/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+l}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:u,defId:c}=n(s);a.def={...a.schema},c&&(a.defId=c);let l=a.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
134
|
+
|
|
135
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function N0(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let u=e.seen.get(a);if(u.ref===null)return;let c=u.def??u.schema,l={...c},f=u.ref;if(u.ref=null,f){o(f);let p=e.seen.get(f),g=p.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,l),a._zod.parent===f)for(let _ in c)_==="$ref"||_==="allOf"||_ in l||delete c[_];if(g.$ref&&p.def)for(let _ in c)_==="$ref"||_==="allOf"||_ in p.def&&JSON.stringify(c[_])===JSON.stringify(p.def[_])&&delete c[_]}let h=a._zod.parent;if(h&&h!==f){o(h);let p=e.seen.get(h);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let g in c)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(c[g])===JSON.stringify(p.def[g])&&delete c[g]}e.override({zodSchema:a,jsonSchema:c,path:u.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,s[u.defId]=u.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:cu(t,"input",e.processors),output:cu(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function vt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return vt(o.element,r);if(o.type==="set")return vt(o.valueType,r);if(o.type==="lazy")return vt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return vt(o.innerType,r);if(o.type==="intersection")return vt(o.left,r)||vt(o.right,r);if(o.type==="record"||o.type==="map")return vt(o.keyType,r)||vt(o.valueType,r);if(o.type==="pipe")return vt(o.in,r)||vt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(vt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(vt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(vt(n,r))return!0;return!!(o.rest&&vt(o.rest,r))}return!1}var Jj=(e,t={})=>r=>{let o=C0({...r,processors:t});return Ue(e,o),A0(o,e),N0(o,e)},cu=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=C0({...n??{},target:i,io:t,processors:r});return Ue(e,s),A0(s,e),N0(s,e)};var M7={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gj=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),a&&(n.format=M7[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),c&&(n.contentEncoding=c),u&&u.size>0){let l=[...u];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Kj=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let f=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";f?p?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof i=="number"&&(n.minimum=i),h?p?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof s=="number"&&(n.maximum=s),typeof u=="number"&&(n.multipleOf=u)},Yj=(e,t,r,o)=>{r.type="boolean"},Xj=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")};var Qj=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var eU=(e,t,r,o)=>{r.not={}},tU=(e,t,r,o)=>{},rU=(e,t,r,o)=>{},nU=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},oU=(e,t,r,o)=>{let n=e._zod.def,i=Xc(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},iU=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i};var sU=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var aU=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var cU=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=Ue(i.element,t,{...o,path:[...o.path,"items"]})},uU=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let c in s)n.properties[c]=Ue(s[c],t,{...o,path:[...o.path,"properties",c]});let a=new Set(Object.keys(s)),u=new Set([...a].filter(c=>{let l=i.shape[c]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=Ue(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},lU=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,u)=>Ue(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},dU=(e,t,r,o)=>{let n=e._zod.def,i=Ue(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=Ue(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=u};var fU=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,u=s._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let l=Ue(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of u)n.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Ue(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=Ue(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let c=s._zod.values;if(c){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(n.required=l)}},pU=(e,t,r,o)=>{let n=e._zod.def,i=Ue(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},hU=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},mU=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},gU=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},_U=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},vU=(e,t,r,o)=>{let n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;Ue(i,t,o);let s=t.seen.get(e);s.ref=i},yU=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0};var D0=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType};function Ls(e){return!!e._zod}function gr(e,t){return Ls(e)?nu(e,t):e.safeParse(t)}function Up(e){if(!e)return;let t;if(Ls(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function bU(e){if(Ls(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let o=e.value;if(o!==void 0)return o}var uu={};Zt(uu,{ZodISODate:()=>wU,ZodISODateTime:()=>xU,ZodISODuration:()=>$U,ZodISOTime:()=>SU,date:()=>U0,datetime:()=>j0,duration:()=>M0,time:()=>L0});var xU=z("ZodISODateTime",(e,t)=>{vD.init(e,t),Pe.init(e,t)});function j0(e){return Ij(xU,e)}var wU=z("ZodISODate",(e,t)=>{yD.init(e,t),Pe.init(e,t)});function U0(e){return Pj(wU,e)}var SU=z("ZodISOTime",(e,t)=>{bD.init(e,t),Pe.init(e,t)});function L0(e){return Oj(SU,e)}var $U=z("ZodISODuration",(e,t)=>{xD.init(e,t),Pe.init(e,t)});function M0(e){return Rj($U,e)}var J7=(e,t)=>{Tp.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>u0(e,r)},flatten:{value:r=>c0(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Rs,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Rs,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Ut=z("ZodError",J7,{Parent:Error});var EU=Ip(Ut),zU=Pp(Ut),TU=ru(Ut),IU=ou(Ut),PU=tN(Ut),OU=rN(Ut),RU=nN(Ut),CU=oN(Ut),AU=iN(Ut),NU=sN(Ut),DU=aN(Ut),jU=cN(Ut);var UU=new WeakMap;function lu(e,t,r){let o=Object.getPrototypeOf(e),n=UU.get(o);if(n||(n=new Set,UU.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let s=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var _e=z("ZodType",(e,t)=>(he.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:cu(e,"input"),output:cu(e,"output")}}),e.toJSONSchema=Jj(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>EU(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>TU(e,r,o),e.parseAsync=async(r,o)=>zU(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>IU(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>PU(e,r,o),e.decode=(r,o)=>OU(e,r,o),e.encodeAsync=async(r,o)=>RU(e,r,o),e.decodeAsync=async(r,o)=>CU(e,r,o),e.safeEncode=(r,o)=>AU(e,r,o),e.safeDecode=(r,o)=>NU(e,r,o),e.safeEncodeAsync=async(r,o)=>DU(e,r,o),e.safeDecodeAsync=async(r,o)=>jU(e,r,o),lu(e,"ZodType",{check(...r){let o=this.def;return this.clone(re.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Yt(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(DY(r,o))},superRefine(r,o){return this.check(jY(r,o))},overwrite(r){return this.check(Yn(r))},optional(){return Re(this)},exactOptional(){return $Y(this)},nullable(){return FU(this)},nullish(){return Re(FU(this))},nonoptional(r){return PY(this,r)},array(){return A(this)},or(r){return ke([this,r])},and(r){return Zp(this,r)},transform(r){return F0(this,XU(r))},default(r){return zY(this,r)},prefault(r){return IY(this,r)},catch(r){return RY(this,r)},pipe(r){return F0(this,r)},readonly(){return NY(this)},describe(r){let o=this.clone();return Kn.add(o,{description:r}),o},meta(...r){if(r.length===0)return Kn.get(this);let o=this.clone();return Kn.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Kn.get(e)?.description},configurable:!0}),e)),qU=z("_ZodString",(e,t)=>{Np.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Gj(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,lu(e,"_ZodString",{regex(...o){return this.check(w0(...o))},includes(...o){return this.check(k0(...o))},startsWith(...o){return this.check(E0(...o))},endsWith(...o){return this.check(z0(...o))},min(...o){return this.check(js(...o))},max(...o){return this.check(Dp(...o))},length(...o){return this.check(jp(...o))},nonempty(...o){return this.check(js(1,...o))},lowercase(o){return this.check(S0(o))},uppercase(o){return this.check($0(o))},trim(){return this.check(I0())},normalize(...o){return this.check(T0(...o))},toLowerCase(){return this.check(P0())},toUpperCase(){return this.check(O0())},slugify(){return this.check(R0())}})}),q0=z("ZodString",(e,t)=>{Np.init(e,t),qU.init(e,t),e.email=r=>e.check(uj(K7,r)),e.url=r=>e.check(x0(BU,r)),e.jwt=r=>e.check(Tj(dY,r)),e.emoji=r=>e.check(hj(Y7,r)),e.guid=r=>e.check(b0(LU,r)),e.uuid=r=>e.check(lj(Lp,r)),e.uuidv4=r=>e.check(dj(Lp,r)),e.uuidv6=r=>e.check(fj(Lp,r)),e.uuidv7=r=>e.check(pj(Lp,r)),e.nanoid=r=>e.check(mj(X7,r)),e.guid=r=>e.check(b0(LU,r)),e.cuid=r=>e.check(gj(Q7,r)),e.cuid2=r=>e.check(_j(eY,r)),e.ulid=r=>e.check(vj(tY,r)),e.base64=r=>e.check(kj(cY,r)),e.base64url=r=>e.check(Ej(uY,r)),e.xid=r=>e.check(yj(rY,r)),e.ksuid=r=>e.check(bj(nY,r)),e.ipv4=r=>e.check(xj(oY,r)),e.ipv6=r=>e.check(wj(iY,r)),e.cidrv4=r=>e.check(Sj(sY,r)),e.cidrv6=r=>e.check($j(aY,r)),e.e164=r=>e.check(zj(lY,r)),e.datetime=r=>e.check(j0(r)),e.date=r=>e.check(U0(r)),e.time=r=>e.check(L0(r)),e.duration=r=>e.check(M0(r))});function y(e){return aj(q0,e)}var Pe=z("ZodStringFormat",(e,t)=>{$e.init(e,t),qU.init(e,t)}),K7=z("ZodEmail",(e,t)=>{uD.init(e,t),Pe.init(e,t)});var LU=z("ZodGUID",(e,t)=>{aD.init(e,t),Pe.init(e,t)});var Lp=z("ZodUUID",(e,t)=>{cD.init(e,t),Pe.init(e,t)});var BU=z("ZodURL",(e,t)=>{lD.init(e,t),Pe.init(e,t)});function VU(e){return x0(BU,e)}var Y7=z("ZodEmoji",(e,t)=>{dD.init(e,t),Pe.init(e,t)});var X7=z("ZodNanoID",(e,t)=>{fD.init(e,t),Pe.init(e,t)});var Q7=z("ZodCUID",(e,t)=>{pD.init(e,t),Pe.init(e,t)});var eY=z("ZodCUID2",(e,t)=>{hD.init(e,t),Pe.init(e,t)});var tY=z("ZodULID",(e,t)=>{mD.init(e,t),Pe.init(e,t)});var rY=z("ZodXID",(e,t)=>{gD.init(e,t),Pe.init(e,t)});var nY=z("ZodKSUID",(e,t)=>{_D.init(e,t),Pe.init(e,t)});var oY=z("ZodIPv4",(e,t)=>{wD.init(e,t),Pe.init(e,t)});var iY=z("ZodIPv6",(e,t)=>{SD.init(e,t),Pe.init(e,t)});var sY=z("ZodCIDRv4",(e,t)=>{$D.init(e,t),Pe.init(e,t)});var aY=z("ZodCIDRv6",(e,t)=>{kD.init(e,t),Pe.init(e,t)});var cY=z("ZodBase64",(e,t)=>{zD.init(e,t),Pe.init(e,t)});var uY=z("ZodBase64URL",(e,t)=>{TD.init(e,t),Pe.init(e,t)});var lY=z("ZodE164",(e,t)=>{ID.init(e,t),Pe.init(e,t)});var dY=z("ZodJWT",(e,t)=>{PD.init(e,t),Pe.init(e,t)});var Mp=z("ZodNumber",(e,t)=>{g0.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Kj(e,o,n,i),lu(e,"ZodNumber",{gt(o,n){return this.check(Ds(o,n))},gte(o,n){return this.check(mr(o,n))},min(o,n){return this.check(mr(o,n))},lt(o,n){return this.check(Ns(o,n))},lte(o,n){return this.check(ln(o,n))},max(o,n){return this.check(ln(o,n))},int(o){return this.check(MU(o))},safe(o){return this.check(MU(o))},positive(o){return this.check(Ds(0,o))},nonnegative(o){return this.check(mr(0,o))},negative(o){return this.check(Ns(0,o))},nonpositive(o){return this.check(ln(0,o))},multipleOf(o,n){return this.check(au(o,n))},step(o,n){return this.check(au(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function se(e){return Cj(Mp,e)}var fY=z("ZodNumberFormat",(e,t)=>{OD.init(e,t),Mp.init(e,t)});function MU(e){return Nj(fY,e)}var B0=z("ZodBoolean",(e,t)=>{RD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yj(e,r,o,n)});function ve(e){return Dj(B0,e)}var WU=z("ZodBigInt",(e,t)=>{CD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Xj(e,o,n,i),e.gte=(o,n)=>e.check(mr(o,n)),e.min=(o,n)=>e.check(mr(o,n)),e.gt=(o,n)=>e.check(Ds(o,n)),e.gte=(o,n)=>e.check(mr(o,n)),e.min=(o,n)=>e.check(mr(o,n)),e.lt=(o,n)=>e.check(Ns(o,n)),e.lte=(o,n)=>e.check(ln(o,n)),e.max=(o,n)=>e.check(ln(o,n)),e.positive=o=>e.check(Ds(BigInt(0),o)),e.negative=o=>e.check(Ns(BigInt(0),o)),e.nonpositive=o=>e.check(ln(BigInt(0),o)),e.nonnegative=o=>e.check(mr(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(au(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});var pY=z("ZodNull",(e,t)=>{AD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qj(e,r,o,n)});function HU(e){return Lj(pY,e)}var hY=z("ZodAny",(e,t)=>{ND.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tU(e,r,o,n)});function JU(){return Mj(hY)}var mY=z("ZodUnknown",(e,t)=>{DD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rU(e,r,o,n)});function Oe(){return Zj(mY)}var gY=z("ZodNever",(e,t)=>{jD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eU(e,r,o,n)});function _Y(e){return Fj(gY,e)}var GU=z("ZodDate",(e,t)=>{UD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(o,n,i)=>nU(e,o,n,i),e.min=(o,n)=>e.check(mr(o,n)),e.max=(o,n)=>e.check(ln(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});var vY=z("ZodArray",(e,t)=>{LD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cU(e,r,o,n),e.element=t.element,lu(e,"ZodArray",{min(r,o){return this.check(js(r,o))},nonempty(r){return this.check(js(1,r))},max(r,o){return this.check(Dp(r,o))},length(r,o){return this.check(jp(r,o))},unwrap(){return this.element}})});function A(e,t){return Bj(vY,e,t)}var KU=z("ZodObject",(e,t)=>{FD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uU(e,r,o,n),re.defineLazy(e,"shape",()=>t.shape),lu(e,"ZodObject",{keyof(){return Et(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Oe()})},loose(){return this.clone({...this._zod.def,catchall:Oe()})},strict(){return this.clone({...this._zod.def,catchall:_Y()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return re.extend(this,r)},safeExtend(r){return re.safeExtend(this,r)},merge(r){return re.merge(this,r)},pick(r){return re.pick(this,r)},omit(r){return re.omit(this,r)},partial(...r){return re.partial(QU,this,r[0])},required(...r){return re.required(e4,this,r[0])}})});function N(e,t){let r={type:"object",shape:e??{},...re.normalizeParams(t)};return new KU(r)}function Be(e,t){return new KU({type:"object",shape:e,catchall:Oe(),...re.normalizeParams(t)})}var YU=z("ZodUnion",(e,t)=>{_0.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lU(e,r,o,n),e.options=t.options});function ke(e,t){return new YU({type:"union",options:e,...re.normalizeParams(t)})}var yY=z("ZodDiscriminatedUnion",(e,t)=>{YU.init(e,t),qD.init(e,t)});function V0(e,t,r){return new yY({type:"union",options:t,discriminator:e,...re.normalizeParams(r)})}var bY=z("ZodIntersection",(e,t)=>{BD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dU(e,r,o,n)});function Zp(e,t){return new bY({type:"intersection",left:e,right:t})}var ZU=z("ZodRecord",(e,t)=>{VD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fU(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function xe(e,t,r){return!t||!t._zod?new ZU({type:"record",keyType:y(),valueType:e,...re.normalizeParams(t)}):new ZU({type:"record",keyType:e,valueType:t,...re.normalizeParams(r)})}var Z0=z("ZodEnum",(e,t)=>{WD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(o,n,i)=>oU(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Z0({...t,checks:[],...re.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Z0({...t,checks:[],...re.normalizeParams(n),entries:i})}});function Et(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Z0({type:"enum",entries:r,...re.normalizeParams(t)})}var xY=z("ZodLiteral",(e,t)=>{HD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iU(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function L(e,t){return new xY({type:"literal",values:Array.isArray(e)?e:[e],...re.normalizeParams(t)})}var wY=z("ZodTransform",(e,t)=>{JD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>aU(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ps(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(re.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(re.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function XU(e){return new wY({type:"transform",transform:e})}var QU=z("ZodOptional",(e,t)=>{v0.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>D0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Re(e){return new QU({type:"optional",innerType:e})}var SY=z("ZodExactOptional",(e,t)=>{GD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>D0(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function $Y(e){return new SY({type:"optional",innerType:e})}var kY=z("ZodNullable",(e,t)=>{KD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pU(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function FU(e){return new kY({type:"nullable",innerType:e})}var EY=z("ZodDefault",(e,t)=>{YD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mU(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zY(e,t){return new EY({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():re.shallowClone(t)}})}var TY=z("ZodPrefault",(e,t)=>{XD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gU(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function IY(e,t){return new TY({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():re.shallowClone(t)}})}var e4=z("ZodNonOptional",(e,t)=>{QD.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hU(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function PY(e,t){return new e4({type:"nonoptional",innerType:e,...re.normalizeParams(t)})}var OY=z("ZodCatch",(e,t)=>{ej.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_U(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function RY(e,t){return new OY({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var CY=z("ZodPipe",(e,t)=>{tj.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vU(e,r,o,n),e.in=t.in,e.out=t.out});function F0(e,t){return new CY({type:"pipe",in:e,out:t})}var AY=z("ZodReadonly",(e,t)=>{rj.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yU(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function NY(e){return new AY({type:"readonly",innerType:e})}var t4=z("ZodCustom",(e,t)=>{nj.init(e,t),_e.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sU(e,r,o,n)});function r4(e,t){return Vj(t4,e??(()=>!0),t)}function DY(e,t={}){return Wj(t4,e,t)}function jY(e,t){return Hj(e,t)}function W0(e,t){return F0(XU(e),t)}var o4={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var n4;n4||(n4={});var Fp={};Zt(Fp,{bigint:()=>ZY,boolean:()=>MY,date:()=>FY,number:()=>LY,string:()=>UY});function UY(e){return cj(q0,e)}function LY(e){return Aj(Mp,e)}function MY(e){return jj(B0,e)}function ZY(e){return Uj(WU,e)}function FY(e){return qj(GU,e)}kt(oj());var Zs="2025-11-25";var i4=[Zs,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Xn="io.modelcontextprotocol/related-task",Bp="2.0",Ve=r4(e=>e!==null&&(typeof e=="object"||typeof e=="function")),s4=ke([y(),se().int()]),a4=y(),C_e=Be({ttl:se().optional(),pollInterval:se().optional()}),BY=N({ttl:se().optional()}),VY=N({taskId:y()}),J0=Be({progressToken:s4.optional(),[Xn]:VY.optional()}),Lt=N({_meta:J0.optional()}),du=Lt.extend({task:BY.optional()}),c4=e=>du.safeParse(e).success,Qe=N({method:y(),params:Lt.loose().optional()}),Qt=N({_meta:J0.optional()}),er=N({method:y(),params:Qt.loose().optional()}),et=Be({_meta:J0.optional()}),Vp=ke([y(),se().int()]),u4=N({jsonrpc:L(Bp),id:Vp,...Qe.shape}).strict(),fu=e=>u4.safeParse(e).success,l4=N({jsonrpc:L(Bp),...er.shape}).strict(),d4=e=>l4.safeParse(e).success,G0=N({jsonrpc:L(Bp),id:Vp,result:et}).strict(),Fo=e=>G0.safeParse(e).success;var V;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(V||(V={}));var K0=N({jsonrpc:L(Bp),id:Vp.optional(),error:N({code:se().int(),message:y(),data:Oe().optional()})}).strict();var f4=e=>K0.safeParse(e).success;var Fs=ke([u4,l4,G0,K0]),A_e=ke([G0,K0]),qo=et.strict(),WY=Qt.extend({requestId:Vp.optional(),reason:y().optional()}),Wp=er.extend({method:L("notifications/cancelled"),params:WY}),HY=N({src:y(),mimeType:y().optional(),sizes:A(y()).optional(),theme:Et(["light","dark"]).optional()}),pu=N({icons:A(HY).optional()}),Ms=N({name:y(),title:y().optional()}),p4=Ms.extend({...Ms.shape,...pu.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),JY=Zp(N({applyDefaults:ve().optional()}),xe(y(),Oe())),GY=W0(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Zp(N({form:JY.optional(),url:Ve.optional()}),xe(y(),Oe()).optional())),KY=Be({list:Ve.optional(),cancel:Ve.optional(),requests:Be({sampling:Be({createMessage:Ve.optional()}).optional(),elicitation:Be({create:Ve.optional()}).optional()}).optional()}),YY=Be({list:Ve.optional(),cancel:Ve.optional(),requests:Be({tools:Be({call:Ve.optional()}).optional()}).optional()}),XY=N({experimental:xe(y(),Ve).optional(),sampling:N({context:Ve.optional(),tools:Ve.optional()}).optional(),elicitation:GY.optional(),roots:N({listChanged:ve().optional()}).optional(),tasks:KY.optional(),extensions:xe(y(),Ve).optional()}),QY=Lt.extend({protocolVersion:y(),capabilities:XY,clientInfo:p4}),eX=Qe.extend({method:L("initialize"),params:QY});var tX=N({experimental:xe(y(),Ve).optional(),logging:Ve.optional(),completions:Ve.optional(),prompts:N({listChanged:ve().optional()}).optional(),resources:N({subscribe:ve().optional(),listChanged:ve().optional()}).optional(),tools:N({listChanged:ve().optional()}).optional(),tasks:YY.optional(),extensions:xe(y(),Ve).optional()}),Y0=et.extend({protocolVersion:y(),capabilities:tX,serverInfo:p4,instructions:y().optional()}),h4=er.extend({method:L("notifications/initialized"),params:Qt.optional()}),m4=e=>h4.safeParse(e).success,Hp=Qe.extend({method:L("ping"),params:Lt.optional()}),rX=N({progress:se(),total:Re(se()),message:Re(y())}),nX=N({...Qt.shape,...rX.shape,progressToken:s4}),Jp=er.extend({method:L("notifications/progress"),params:nX}),oX=Lt.extend({cursor:a4.optional()}),hu=Qe.extend({params:oX.optional()}),mu=et.extend({nextCursor:a4.optional()}),iX=Et(["working","input_required","completed","failed","cancelled"]),gu=N({taskId:y(),status:iX,ttl:ke([se(),HU()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:Re(se()),statusMessage:Re(y())}),Bo=et.extend({task:gu}),sX=Qt.merge(gu),_u=er.extend({method:L("notifications/tasks/status"),params:sX}),Gp=Qe.extend({method:L("tasks/get"),params:Lt.extend({taskId:y()})}),Kp=et.merge(gu),Yp=Qe.extend({method:L("tasks/result"),params:Lt.extend({taskId:y()})}),N_e=et.loose(),Xp=hu.extend({method:L("tasks/list")}),Qp=mu.extend({tasks:A(gu)}),eh=Qe.extend({method:L("tasks/cancel"),params:Lt.extend({taskId:y()})}),g4=et.merge(gu),_4=N({uri:y(),mimeType:Re(y()),_meta:xe(y(),Oe()).optional()}),v4=_4.extend({text:y()}),X0=y().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),y4=_4.extend({blob:X0}),vu=Et(["user","assistant"]),qs=N({audience:A(vu).optional(),priority:se().min(0).max(1).optional(),lastModified:uu.datetime({offset:!0}).optional()}),b4=N({...Ms.shape,...pu.shape,uri:y(),description:Re(y()),mimeType:Re(y()),size:Re(se()),annotations:qs.optional(),_meta:Re(Be({}))}),aX=N({...Ms.shape,...pu.shape,uriTemplate:y(),description:Re(y()),mimeType:Re(y()),annotations:qs.optional(),_meta:Re(Be({}))}),cX=hu.extend({method:L("resources/list")}),Q0=mu.extend({resources:A(b4)}),uX=hu.extend({method:L("resources/templates/list")}),eS=mu.extend({resourceTemplates:A(aX)}),tS=Lt.extend({uri:y()}),lX=tS,dX=Qe.extend({method:L("resources/read"),params:lX}),rS=et.extend({contents:A(ke([v4,y4]))}),nS=er.extend({method:L("notifications/resources/list_changed"),params:Qt.optional()}),fX=tS,pX=Qe.extend({method:L("resources/subscribe"),params:fX}),hX=tS,mX=Qe.extend({method:L("resources/unsubscribe"),params:hX}),gX=Qt.extend({uri:y()}),_X=er.extend({method:L("notifications/resources/updated"),params:gX}),vX=N({name:y(),description:Re(y()),required:Re(ve())}),yX=N({...Ms.shape,...pu.shape,description:Re(y()),arguments:Re(A(vX)),_meta:Re(Be({}))}),bX=hu.extend({method:L("prompts/list")}),oS=mu.extend({prompts:A(yX)}),xX=Lt.extend({name:y(),arguments:xe(y(),y()).optional()}),wX=Qe.extend({method:L("prompts/get"),params:xX}),iS=N({type:L("text"),text:y(),annotations:qs.optional(),_meta:xe(y(),Oe()).optional()}),sS=N({type:L("image"),data:X0,mimeType:y(),annotations:qs.optional(),_meta:xe(y(),Oe()).optional()}),aS=N({type:L("audio"),data:X0,mimeType:y(),annotations:qs.optional(),_meta:xe(y(),Oe()).optional()}),SX=N({type:L("tool_use"),name:y(),id:y(),input:xe(y(),Oe()),_meta:xe(y(),Oe()).optional()}),$X=N({type:L("resource"),resource:ke([v4,y4]),annotations:qs.optional(),_meta:xe(y(),Oe()).optional()}),kX=b4.extend({type:L("resource_link")}),cS=ke([iS,sS,aS,kX,$X]),EX=N({role:vu,content:cS}),uS=et.extend({description:y().optional(),messages:A(EX)}),lS=er.extend({method:L("notifications/prompts/list_changed"),params:Qt.optional()}),zX=N({title:y().optional(),readOnlyHint:ve().optional(),destructiveHint:ve().optional(),idempotentHint:ve().optional(),openWorldHint:ve().optional()}),TX=N({taskSupport:Et(["required","optional","forbidden"]).optional()}),x4=N({...Ms.shape,...pu.shape,description:y().optional(),inputSchema:N({type:L("object"),properties:xe(y(),Ve).optional(),required:A(y()).optional()}).catchall(Oe()),outputSchema:N({type:L("object"),properties:xe(y(),Ve).optional(),required:A(y()).optional()}).catchall(Oe()).optional(),annotations:zX.optional(),execution:TX.optional(),_meta:xe(y(),Oe()).optional()}),IX=hu.extend({method:L("tools/list")}),dS=mu.extend({tools:A(x4)}),Bs=et.extend({content:A(cS).default([]),structuredContent:xe(y(),Oe()).optional(),isError:ve().optional()}),D_e=Bs.or(et.extend({toolResult:Oe()})),PX=du.extend({name:y(),arguments:xe(y(),Oe()).optional()}),OX=Qe.extend({method:L("tools/call"),params:PX}),fS=er.extend({method:L("notifications/tools/list_changed"),params:Qt.optional()}),w4=N({autoRefresh:ve().default(!0),debounceMs:se().int().nonnegative().default(300)}),S4=Et(["debug","info","notice","warning","error","critical","alert","emergency"]),RX=Lt.extend({level:S4}),CX=Qe.extend({method:L("logging/setLevel"),params:RX}),AX=Qt.extend({level:S4,logger:y().optional(),data:Oe()}),NX=er.extend({method:L("notifications/message"),params:AX}),DX=N({name:y().optional()}),jX=N({hints:A(DX).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),UX=N({mode:Et(["auto","required","none"]).optional()}),LX=N({type:L("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:A(cS).default([]),structuredContent:N({}).loose().optional(),isError:ve().optional(),_meta:xe(y(),Oe()).optional()}),MX=V0("type",[iS,sS,aS]),qp=V0("type",[iS,sS,aS,SX,LX]),ZX=N({role:vu,content:ke([qp,A(qp)]),_meta:xe(y(),Oe()).optional()}),FX=du.extend({messages:A(ZX),modelPreferences:jX.optional(),systemPrompt:y().optional(),includeContext:Et(["none","thisServer","allServers"]).optional(),temperature:se().optional(),maxTokens:se().int(),stopSequences:A(y()).optional(),metadata:Ve.optional(),tools:A(x4).optional(),toolChoice:UX.optional()}),pS=Qe.extend({method:L("sampling/createMessage"),params:FX}),hS=et.extend({model:y(),stopReason:Re(Et(["endTurn","stopSequence","maxTokens"]).or(y())),role:vu,content:MX}),mS=et.extend({model:y(),stopReason:Re(Et(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:vu,content:ke([qp,A(qp)])}),qX=N({type:L("boolean"),title:y().optional(),description:y().optional(),default:ve().optional()}),BX=N({type:L("string"),title:y().optional(),description:y().optional(),minLength:se().optional(),maxLength:se().optional(),format:Et(["email","uri","date","date-time"]).optional(),default:y().optional()}),VX=N({type:Et(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),WX=N({type:L("string"),title:y().optional(),description:y().optional(),enum:A(y()),default:y().optional()}),HX=N({type:L("string"),title:y().optional(),description:y().optional(),oneOf:A(N({const:y(),title:y()})),default:y().optional()}),JX=N({type:L("string"),title:y().optional(),description:y().optional(),enum:A(y()),enumNames:A(y()).optional(),default:y().optional()}),GX=ke([WX,HX]),KX=N({type:L("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:N({type:L("string"),enum:A(y())}),default:A(y()).optional()}),YX=N({type:L("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:N({anyOf:A(N({const:y(),title:y()}))}),default:A(y()).optional()}),XX=ke([KX,YX]),QX=ke([JX,GX,XX]),eQ=ke([QX,qX,BX,VX]),tQ=du.extend({mode:L("form").optional(),message:y(),requestedSchema:N({type:L("object"),properties:xe(y(),eQ),required:A(y()).optional()})}),rQ=du.extend({mode:L("url"),message:y(),elicitationId:y(),url:y().url()}),nQ=ke([tQ,rQ]),gS=Qe.extend({method:L("elicitation/create"),params:nQ}),oQ=Qt.extend({elicitationId:y()}),iQ=er.extend({method:L("notifications/elicitation/complete"),params:oQ}),_S=et.extend({action:Et(["accept","decline","cancel"]),content:W0(e=>e===null?void 0:e,xe(y(),ke([y(),se(),ve(),A(y())])).optional())}),sQ=N({type:L("ref/resource"),uri:y()});var aQ=N({type:L("ref/prompt"),name:y()}),cQ=Lt.extend({ref:ke([aQ,sQ]),argument:N({name:y(),value:y()}),context:N({arguments:xe(y(),y()).optional()}).optional()}),uQ=Qe.extend({method:L("completion/complete"),params:cQ});var vS=et.extend({completion:Be({values:A(y()).max(100),total:Re(se().int()),hasMore:Re(ve())})}),lQ=N({uri:y().startsWith("file://"),name:y().optional(),_meta:xe(y(),Oe()).optional()}),dQ=Qe.extend({method:L("roots/list"),params:Lt.optional()}),fQ=et.extend({roots:A(lQ)}),pQ=er.extend({method:L("notifications/roots/list_changed"),params:Qt.optional()}),j_e=ke([Hp,eX,uQ,CX,wX,bX,cX,uX,dX,pX,mX,OX,IX,Gp,Yp,Xp,eh]),U_e=ke([Wp,Jp,h4,pQ,_u]),L_e=ke([qo,hS,mS,_S,fQ,Kp,Qp,Bo]),M_e=ke([Hp,pS,gS,dQ,Gp,Yp,Xp,eh]),Z_e=ke([Wp,Jp,NX,_X,nS,fS,lS,_u,iQ]),F_e=ke([qo,Y0,vS,uS,oS,Q0,eS,rS,Bs,dS,Kp,Qp,Bo]),B=class e extends Error{constructor(t,r,o){super(`MCP error ${t}: ${r}`),this.code=t,this.data=o,this.name="McpError"}static fromError(t,r,o){if(t===V.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new H0(n.elicitations,r)}return new e(t,r,o)}},H0=class extends B{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(V.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function Qn(e){return e==="completed"||e==="failed"||e==="cancelled"}var hQ=Symbol("Let zodToJsonSchema decide on which parser to use");var xve=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function yS(e){let r=Up(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=bU(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function bS(e,t){let r=gr(e,t);if(!r.success)throw r.error;return r.data}var bQ=6e4,th=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Wp,r=>{this._oncancel(r)}),this.setNotificationHandler(Jp,r=>{this._onprogress(r)}),this.setRequestHandler(Hp,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Gp,async(r,o)=>{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new B(V.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Yp,async(r,o)=>{let n=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,o.sessionId);){if(a.type==="response"||a.type==="error"){let u=a.message,c=u.id,l=this._requestResolvers.get(c);if(l)if(this._requestResolvers.delete(c),a.type==="response")l(u);else{let f=u,h=new B(f.error.code,f.error.message,f.error.data);l(h)}else{let f=a.type==="response"?"Response":"Error";this._onerror(new Error(`${f} handler missing for request ${c}`))}continue}await this._transport?.send(a.message,{relatedRequestId:o.requestId})}}let s=await this._taskStore.getTask(i,o.sessionId);if(!s)throw new B(V.InvalidParams,`Task not found: ${i}`);if(!Qn(s.status))return await this._waitForTaskUpdate(i,o.signal),await n();if(Qn(s.status)){let a=await this._taskStore.getTaskResult(i,o.sessionId);return this._clearTaskQueue(i),{...a,_meta:{...a._meta,[Xn]:{taskId:i}}}}return await n()};return await n()}),this.setRequestHandler(Xp,async(r,o)=>{try{let{tasks:n,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,o.sessionId);return{tasks:n,nextCursor:i,_meta:{}}}catch(n){throw new B(V.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(eh,async(r,o)=>{try{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new B(V.InvalidParams,`Task not found: ${r.params.taskId}`);if(Qn(n.status))throw new B(V.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!i)throw new B(V.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(n){throw n instanceof B?n:new B(V.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,o,n,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:i,onTimeout:n})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),B.fromError(V.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let o=this.transport?.onerror;this._transport.onerror=i=>{o?.(i),this._onerror(i)};let n=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{n?.(i,s),Fo(i)||f4(i)?this._onresponse(i):fu(i)?this._onrequest(i,s):d4(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(let o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();let r=B.fromError(V.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let o of t.values())o(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(t,r){let o=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,n=this._transport,i=t.params?._meta?.[Xn]?.taskId;if(o===void 0){let l={jsonrpc:"2.0",id:t.id,error:{code:V.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},n?.sessionId).catch(f=>this._onerror(new Error(`Failed to enqueue error response: ${f}`))):n?.send(l).catch(f=>this._onerror(new Error(`Failed to send an error response: ${f}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let a=c4(t.params)?t.params.task:void 0,u=this._taskStore?this.requestTaskStore(t,n?.sessionId):void 0,c={signal:s.signal,sessionId:n?.sessionId,_meta:t.params?._meta,sendNotification:async l=>{if(s.signal.aborted)return;let f={relatedRequestId:t.id};i&&(f.relatedTask={taskId:i}),await this.notification(l,f)},sendRequest:async(l,f,h)=>{if(s.signal.aborted)throw new B(V.ConnectionClosed,"Request was cancelled");let p={...h,relatedRequestId:t.id};i&&!p.relatedTask&&(p.relatedTask={taskId:i});let g=p.relatedTask?.taskId??i;return g&&u&&await u.updateTaskStatus(g,"input_required"),await this.request(l,f,p)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:u,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>o(t,c)).then(async l=>{if(s.signal.aborted)return;let f={result:l,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:f,timestamp:Date.now()},n?.sessionId):await n?.send(f)},async l=>{if(s.signal.aborted)return;let f={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(l.code)?l.code:V.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:f,timestamp:Date.now()},n?.sessionId):await n?.send(f)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===s&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...o}=t.params,n=Number(r),i=this._progressHandlers.get(n);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(u){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),s(u);return}i(o)}_onresponse(t){let r=Number(t.id),o=this._requestResolvers.get(r);if(o){if(this._requestResolvers.delete(r),Fo(t))o(t);else{let s=new B(t.error.code,t.error.message,t.error.data);o(s)}return}let n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(Fo(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),Fo(t))n(t);else{let s=B.fromError(t.error.code,t.error.message,t.error.data);n(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,o){let{task:n}=o??{};if(!n){try{yield{type:"result",result:await this.request(t,r,o)}}catch(s){yield{type:"error",error:s instanceof B?s:new B(V.InternalError,String(s))}}return}let i;try{let s=await this.request(t,Bo,o);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new B(V.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},o);if(yield{type:"taskStatus",task:a},Qn(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,o)}:a.status==="failed"?yield{type:"error",error:new B(V.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new B(V.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,o)};return}let u=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(c=>setTimeout(c,u)),o?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof B?s:new B(V.InternalError,String(s))}}}request(t,r,o){let{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:u}=o??{};return new Promise((c,l)=>{let f=S=>{l(S)};if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(S){f(S);return}o?.signal?.throwIfAborted();let h=this._requestMessageId++,p={...t,jsonrpc:"2.0",id:h};o?.onprogress&&(this._progressHandlers.set(h,o.onprogress),p.params={...t.params,_meta:{...t.params?._meta||{},progressToken:h}}),a&&(p.params={...p.params,task:a}),u&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Xn]:u}});let g=S=>{this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(S)}},{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s}).catch(b=>this._onerror(new Error(`Failed to send cancellation: ${b}`)));let k=S instanceof B?S:new B(V.RequestTimeout,String(S));l(k)};this._responseHandlers.set(h,S=>{if(!o?.signal?.aborted){if(S instanceof Error)return l(S);try{let k=gr(r,S.result);k.success?c(k.data):l(k.error)}catch(k){l(k)}}}),o?.signal?.addEventListener("abort",()=>{g(o?.signal?.reason)});let m=o?.timeout??bQ,_=()=>g(B.fromError(V.RequestTimeout,"Request timed out",{timeout:m}));this._setupTimeout(h,m,o?.maxTotalTimeout,_,o?.resetTimeoutOnProgress??!1);let v=u?.taskId;if(v){let S=k=>{let b=this._responseHandlers.get(h);b?b(k):this._onerror(new Error(`Response handler missing for side-channeled request ${h}`))};this._requestResolvers.set(h,S),this._enqueueTaskMessage(v,{type:"request",message:p,timestamp:Date.now()}).catch(k=>{this._cleanupTimeout(h),l(k)})}else this._transport.send(p,{relatedRequestId:n,resumptionToken:i,onresumptiontoken:s}).catch(S=>{this._cleanupTimeout(h),l(S)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Kp,r)}async getTaskResult(t,r,o){return this.request({method:"tasks/result",params:t},r,o)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Qp,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},g4,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let o=r?.relatedTask?.taskId;if(o){let a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Xn]:r.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Xn]:r.relatedTask}}}),this._transport?.send(a,r).catch(u=>this._onerror(u))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Xn]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let o=yS(t);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(n,i)=>{let s=bS(t,n);return Promise.resolve(r(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let o=yS(t);this._notificationHandlers.set(o,n=>{let i=bS(t,n);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,o,n)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let o=await this._taskMessageQueue.dequeueAll(t,r);for(let n of o)if(n.type==="request"&&fu(n.message)){let i=n.message.id,s=this._requestResolvers.get(i);s?(s(new B(V.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let o=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(t);n?.pollInterval&&(o=n.pollInterval)}catch{}return new Promise((n,i)=>{if(r.aborted){i(new B(V.InvalidRequest,"Request cancelled"));return}let s=setTimeout(n,o);r.addEventListener("abort",()=>{clearTimeout(s),i(new B(V.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async n=>{if(!t)throw new Error("No request provided");return await o.createTask(n,t.id,{method:t.method,params:t.params},r)},getTask:async n=>{let i=await o.getTask(n,r);if(!i)throw new B(V.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(n,i,s)=>{await o.storeTaskResult(n,i,s,r);let a=await o.getTask(n,r);if(a){let u=_u.parse({method:"notifications/tasks/status",params:a});await this.notification(u),Qn(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>o.getTaskResult(n,r),updateTaskStatus:async(n,i,s)=>{let a=await o.getTask(n,r);if(!a)throw new B(V.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(Qn(a.status))throw new B(V.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(n,i,s,r);let u=await o.getTask(n,r);if(u){let c=_u.parse({method:"notifications/tasks/status",params:u});await this.notification(c),Qn(u.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>o.listTasks(n,r)}}};function $4(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function k4(e,t){let r={...e};for(let o in t){let n=o,i=t[n];if(i===void 0)continue;let s=r[n];$4(s)&&$4(i)?r[n]={...s,...i}:r[n]=i}return r}var dM=We(ik(),1),fM=We(lM(),1);function die(){let e=new dM.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,fM.default)(e),e}var jh=class{constructor(t){this._ajv=t??die()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Uh=class{constructor(t){this._client=t}async*callToolStream(t,r=Bs,o){let n=this._client,i={...o,task:o?.task??(n.isToolTask(t.name)?{}:void 0)},s=n.requestStream({method:"tools/call",params:t},r,i),a=n.getToolOutputValidator(t.name);for await(let u of s){if(u.type==="result"&&a){let c=u.result;if(!c.structuredContent&&!c.isError){yield{type:"error",error:new B(V.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`)};return}if(c.structuredContent)try{let l=a(c.structuredContent);if(!l.valid){yield{type:"error",error:new B(V.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof B){yield{type:"error",error:l};return}yield{type:"error",error:new B(V.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(t,r){return this._client.getTask({taskId:t},r)}async getTaskResult(t,r,o){return this._client.getTaskResult({taskId:t},r,o)}async listTasks(t,r){return this._client.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._client.cancelTask({taskId:t},r)}requestStream(t,r,o){return this._client.requestStream(t,r,o)}};function pM(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function hM(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}function Lh(e,t){if(!(!e||t===null||typeof t!="object")){if(e.type==="object"&&e.properties&&typeof e.properties=="object"){let r=t,o=e.properties;for(let n of Object.keys(o)){let i=o[n];r[n]===void 0&&Object.prototype.hasOwnProperty.call(i,"default")&&(r[n]=i.default),r[n]!==void 0&&Lh(i,r[n])}}if(Array.isArray(e.anyOf))for(let r of e.anyOf)typeof r!="boolean"&&Lh(r,t);if(Array.isArray(e.oneOf))for(let r of e.oneOf)typeof r!="boolean"&&Lh(r,t)}}function fie(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,r=e.url!==void 0;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}var Mh=class extends th{constructor(t,r){super(r),this._clientInfo=t,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new jh,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(t){t.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",fS,t.tools,async()=>(await this.listTools()).tools),t.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",lS,t.prompts,async()=>(await this.listPrompts()).prompts),t.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",nS,t.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Uh(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=k4(this._capabilities,t)}setRequestHandler(t,r){let n=Up(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i;if(Ls(n)){let a=n;i=a._zod?.def?.value??a.value}else{let a=n;i=a._def?.value??a.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");let s=i;if(s==="elicitation/create"){let a=async(u,c)=>{let l=gr(gS,u);if(!l.success){let S=l.error instanceof Error?l.error.message:String(l.error);throw new B(V.InvalidParams,`Invalid elicitation request: ${S}`)}let{params:f}=l.data;f.mode=f.mode??"form";let{supportsFormMode:h,supportsUrlMode:p}=fie(this._capabilities.elicitation);if(f.mode==="form"&&!h)throw new B(V.InvalidParams,"Client does not support form-mode elicitation requests");if(f.mode==="url"&&!p)throw new B(V.InvalidParams,"Client does not support URL-mode elicitation requests");let g=await Promise.resolve(r(u,c));if(f.task){let S=gr(Bo,g);if(!S.success){let k=S.error instanceof Error?S.error.message:String(S.error);throw new B(V.InvalidParams,`Invalid task creation result: ${k}`)}return S.data}let m=gr(_S,g);if(!m.success){let S=m.error instanceof Error?m.error.message:String(m.error);throw new B(V.InvalidParams,`Invalid elicitation result: ${S}`)}let _=m.data,v=f.mode==="form"?f.requestedSchema:void 0;if(f.mode==="form"&&_.action==="accept"&&_.content&&v&&this._capabilities.elicitation?.form?.applyDefaults)try{Lh(v,_.content)}catch{}return _};return super.setRequestHandler(t,a)}if(s==="sampling/createMessage"){let a=async(u,c)=>{let l=gr(pS,u);if(!l.success){let _=l.error instanceof Error?l.error.message:String(l.error);throw new B(V.InvalidParams,`Invalid sampling request: ${_}`)}let{params:f}=l.data,h=await Promise.resolve(r(u,c));if(f.task){let _=gr(Bo,h);if(!_.success){let v=_.error instanceof Error?_.error.message:String(_.error);throw new B(V.InvalidParams,`Invalid task creation result: ${v}`)}return _.data}let g=f.tools||f.toolChoice?mS:hS,m=gr(g,h);if(!m.success){let _=m.error instanceof Error?m.error.message:String(m.error);throw new B(V.InvalidParams,`Invalid sampling result: ${_}`)}return m.data};return super.setRequestHandler(t,a)}return super.setRequestHandler(t,r)}assertCapability(t,r){if(!this._serverCapabilities?.[t])throw new Error(`Server does not support ${t} (required for ${r})`)}async connect(t,r){if(await super.connect(t),t.sessionId===void 0)try{let o=await this.request({method:"initialize",params:{protocolVersion:Zs,capabilities:this._capabilities,clientInfo:this._clientInfo}},Y0,r);if(o===void 0)throw new Error(`Server sent invalid initialize result: ${o}`);if(!i4.includes(o.protocolVersion))throw new Error(`Server's protocol version is not supported: ${o.protocolVersion}`);this._serverCapabilities=o.capabilities,this._serverVersion=o.serverInfo,t.setProtocolVersion&&t.setProtocolVersion(o.protocolVersion),this._instructions=o.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(o){throw this.close(),o}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(t){switch(t){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${t})`);if(t==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${t})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${t})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${t})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${t})`);break;case"ping":break}}assertTaskCapability(t){pM(this._serverCapabilities?.tasks?.requests,t,"Server")}assertTaskHandlerCapability(t){this._capabilities&&hM(this._capabilities.tasks?.requests,t,"Client")}async ping(t){return this.request({method:"ping"},qo,t)}async complete(t,r){return this.request({method:"completion/complete",params:t},vS,r)}async setLoggingLevel(t,r){return this.request({method:"logging/setLevel",params:{level:t}},qo,r)}async getPrompt(t,r){return this.request({method:"prompts/get",params:t},uS,r)}async listPrompts(t,r){return this.request({method:"prompts/list",params:t},oS,r)}async listResources(t,r){return this.request({method:"resources/list",params:t},Q0,r)}async listResourceTemplates(t,r){return this.request({method:"resources/templates/list",params:t},eS,r)}async readResource(t,r){return this.request({method:"resources/read",params:t},rS,r)}async subscribeResource(t,r){return this.request({method:"resources/subscribe",params:t},qo,r)}async unsubscribeResource(t,r){return this.request({method:"resources/unsubscribe",params:t},qo,r)}async callTool(t,r=Bs,o){if(this.isToolTaskRequired(t.name))throw new B(V.InvalidRequest,`Tool "${t.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let n=await this.request({method:"tools/call",params:t},r,o),i=this.getToolOutputValidator(t.name);if(i){if(!n.structuredContent&&!n.isError)throw new B(V.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`);if(n.structuredContent)try{let s=i(n.structuredContent);if(!s.valid)throw new B(V.InvalidParams,`Structured content does not match the tool's output schema: ${s.errorMessage}`)}catch(s){throw s instanceof B?s:new B(V.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return n}isToolTask(t){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(t):!1}isToolTaskRequired(t){return this._cachedRequiredTaskTools.has(t)}cacheToolMetadata(t){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of t){if(r.outputSchema){let n=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,n)}let o=r.execution?.taskSupport;(o==="required"||o==="optional")&&this._cachedKnownTaskTools.add(r.name),o==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(t){return this._cachedToolOutputValidators.get(t)}async listTools(t,r){let o=await this.request({method:"tools/list",params:t},dS,r);return this.cacheToolMetadata(o.tools),o}_setupListChangedHandler(t,r,o,n){let i=w4.safeParse(o);if(!i.success)throw new Error(`Invalid ${t} listChanged options: ${i.error.message}`);if(typeof o.onChanged!="function")throw new Error(`Invalid ${t} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:a}=i.data,{onChanged:u}=o,c=async()=>{if(!s){u(null,null);return}try{let f=await n();u(null,f)}catch(f){let h=f instanceof Error?f:new Error(String(f));u(h,null)}},l=()=>{if(a){let f=this._listChangedDebounceTimers.get(t);f&&clearTimeout(f);let h=setTimeout(c,a);this._listChangedDebounceTimers.set(t,h)}else c()};this.setNotificationHandler(r,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var oZ=We(rZ(),1);import wk from"process";import{PassThrough as Mie}from"stream";var Fh=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
136
|
+
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),Lie(r)}clear(){this._buffer=void 0}};function Lie(e){return Fs.parse(JSON.parse(e))}function nZ(e){return JSON.stringify(e)+`
|
|
137
|
+
`}var Zie=wk.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Fie(){let e={};for(let t of Zie){let r=wk.env[t];r!==void 0&&(r.startsWith("()")||(e[t]=r))}return e}var qh=class{constructor(t){this._readBuffer=new Fh,this._stderrStream=null,this._serverParams=t,(t.stderr==="pipe"||t.stderr==="overlapped")&&(this._stderrStream=new Mie)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,r)=>{this._process=(0,oZ.default)(this._serverParams.command,this._serverParams.args??[],{env:{...Fie(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:wk.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",o=>{r(o),this.onerror?.(o)}),this._process.on("spawn",()=>{t()}),this._process.on("close",o=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",o=>{this.onerror?.(o)}),this._process.stdout?.on("data",o=>{this._readBuffer.append(o),this.processReadBuffer()}),this._process.stdout?.on("error",o=>{this.onerror?.(o)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){if(this._process){let t=this._process;this._process=void 0;let r=new Promise(o=>{t.once("close",()=>{o()})});try{t.stdin?.end()}catch{}if(await Promise.race([r,new Promise(o=>setTimeout(o,2e3).unref())]),t.exitCode===null){try{t.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(o=>setTimeout(o,2e3).unref())])}if(t.exitCode===null)try{t.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(t){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let o=nZ(t);this._process.stdin.write(o)?r():this._process.stdin.once("drain",r)})}};function Bh(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function iZ(e=fetch,t){return t?async(r,o)=>{let n={...t,...o,headers:o?.headers?{...Bh(t.headers),...Bh(o.headers)}:t.headers};return e(r,n)}:e}var Sk;Sk=globalThis.crypto?.webcrypto??globalThis.crypto??import("crypto").then(e=>e.webcrypto);async function qie(e){return(await Sk).getRandomValues(new Uint8Array(e))}async function Bie(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,o="";for(;o.length<e;){let n=await qie(e-o.length);for(let i of n)i<r&&(o+=t[i%t.length])}return o}async function Vie(e){return await Bie(e)}async function Wie(e){let t=await(await Sk).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function $k(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Vie(e),r=await Wie(t);return{code_verifier:t,code_challenge:r}}var ot=VU().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:o4.custom,message:"URL must be parseable",fatal:!0}),Kw}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),aZ=Be({resource:y().url(),authorization_servers:A(ot).optional(),jwks_uri:y().url().optional(),scopes_supported:A(y()).optional(),bearer_methods_supported:A(y()).optional(),resource_signing_alg_values_supported:A(y()).optional(),resource_name:y().optional(),resource_documentation:y().optional(),resource_policy_uri:y().url().optional(),resource_tos_uri:y().url().optional(),tls_client_certificate_bound_access_tokens:ve().optional(),authorization_details_types_supported:A(y()).optional(),dpop_signing_alg_values_supported:A(y()).optional(),dpop_bound_access_tokens_required:ve().optional()}),kk=Be({issuer:y(),authorization_endpoint:ot,token_endpoint:ot,registration_endpoint:ot.optional(),scopes_supported:A(y()).optional(),response_types_supported:A(y()),response_modes_supported:A(y()).optional(),grant_types_supported:A(y()).optional(),token_endpoint_auth_methods_supported:A(y()).optional(),token_endpoint_auth_signing_alg_values_supported:A(y()).optional(),service_documentation:ot.optional(),revocation_endpoint:ot.optional(),revocation_endpoint_auth_methods_supported:A(y()).optional(),revocation_endpoint_auth_signing_alg_values_supported:A(y()).optional(),introspection_endpoint:y().optional(),introspection_endpoint_auth_methods_supported:A(y()).optional(),introspection_endpoint_auth_signing_alg_values_supported:A(y()).optional(),code_challenge_methods_supported:A(y()).optional(),client_id_metadata_document_supported:ve().optional()}),Hie=Be({issuer:y(),authorization_endpoint:ot,token_endpoint:ot,userinfo_endpoint:ot.optional(),jwks_uri:ot,registration_endpoint:ot.optional(),scopes_supported:A(y()).optional(),response_types_supported:A(y()),response_modes_supported:A(y()).optional(),grant_types_supported:A(y()).optional(),acr_values_supported:A(y()).optional(),subject_types_supported:A(y()),id_token_signing_alg_values_supported:A(y()),id_token_encryption_alg_values_supported:A(y()).optional(),id_token_encryption_enc_values_supported:A(y()).optional(),userinfo_signing_alg_values_supported:A(y()).optional(),userinfo_encryption_alg_values_supported:A(y()).optional(),userinfo_encryption_enc_values_supported:A(y()).optional(),request_object_signing_alg_values_supported:A(y()).optional(),request_object_encryption_alg_values_supported:A(y()).optional(),request_object_encryption_enc_values_supported:A(y()).optional(),token_endpoint_auth_methods_supported:A(y()).optional(),token_endpoint_auth_signing_alg_values_supported:A(y()).optional(),display_values_supported:A(y()).optional(),claim_types_supported:A(y()).optional(),claims_supported:A(y()).optional(),service_documentation:y().optional(),claims_locales_supported:A(y()).optional(),ui_locales_supported:A(y()).optional(),claims_parameter_supported:ve().optional(),request_parameter_supported:ve().optional(),request_uri_parameter_supported:ve().optional(),require_request_uri_registration:ve().optional(),op_policy_uri:ot.optional(),op_tos_uri:ot.optional(),client_id_metadata_document_supported:ve().optional()}),cZ=N({...Hie.shape,...kk.pick({code_challenge_methods_supported:!0}).shape}),uZ=N({access_token:y(),id_token:y().optional(),token_type:y(),expires_in:Fp.number().optional(),scope:y().optional(),refresh_token:y().optional()}).strip(),lZ=N({error:y(),error_description:y().optional(),error_uri:y().optional()}),sZ=ot.optional().or(L("").transform(()=>{})),Jie=N({redirect_uris:A(ot),token_endpoint_auth_method:y().optional(),grant_types:A(y()).optional(),response_types:A(y()).optional(),client_name:y().optional(),client_uri:ot.optional(),logo_uri:sZ,scope:y().optional(),contacts:A(y()).optional(),tos_uri:sZ,policy_uri:y().optional(),jwks_uri:ot.optional(),jwks:JU().optional(),software_id:y().optional(),software_version:y().optional(),software_statement:y().optional()}).strip(),Gie=N({client_id:y(),client_secret:y().optional(),client_id_issued_at:se().optional(),client_secret_expires_at:se().optional()}).strip(),dZ=Jie.merge(Gie),p0e=N({error:y(),error_description:y().optional()}).strip(),h0e=N({token:y(),token_type_hint:y().optional()}).strip();function fZ(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function pZ({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),o=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==o.origin||r.pathname.length<o.pathname.length)return!1;let n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=o.pathname.endsWith("/")?o.pathname:o.pathname+"/";return n.startsWith(i)}var Me=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Gu=class extends Me{};Gu.errorCode="invalid_request";var ti=class extends Me{};ti.errorCode="invalid_client";var ri=class extends Me{};ri.errorCode="invalid_grant";var ni=class extends Me{};ni.errorCode="unauthorized_client";var Ku=class extends Me{};Ku.errorCode="unsupported_grant_type";var Yu=class extends Me{};Yu.errorCode="invalid_scope";var Xu=class extends Me{};Xu.errorCode="access_denied";var _n=class extends Me{};_n.errorCode="server_error";var Qu=class extends Me{};Qu.errorCode="temporarily_unavailable";var el=class extends Me{};el.errorCode="unsupported_response_type";var tl=class extends Me{};tl.errorCode="unsupported_token_type";var rl=class extends Me{};rl.errorCode="invalid_token";var nl=class extends Me{};nl.errorCode="method_not_allowed";var ol=class extends Me{};ol.errorCode="too_many_requests";var oi=class extends Me{};oi.errorCode="invalid_client_metadata";var il=class extends Me{};il.errorCode="insufficient_scope";var sl=class extends Me{};sl.errorCode="invalid_target";var hZ={[Gu.errorCode]:Gu,[ti.errorCode]:ti,[ri.errorCode]:ri,[ni.errorCode]:ni,[Ku.errorCode]:Ku,[Yu.errorCode]:Yu,[Xu.errorCode]:Xu,[_n.errorCode]:_n,[Qu.errorCode]:Qu,[el.errorCode]:el,[tl.errorCode]:tl,[rl.errorCode]:rl,[nl.errorCode]:nl,[ol.errorCode]:ol,[oi.errorCode]:oi,[il.errorCode]:il,[sl.errorCode]:sl};var vn=class extends Error{constructor(t){super(t??"Unauthorized")}};function Kie(e){return["client_secret_basic","client_secret_post","none"].includes(e)}var Ek="code",zk="S256";function Yie(e,t){let r=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Kie(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?r?"client_secret_basic":"none":r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function Xie(e,t,r,o){let{client_id:n,client_secret:i}=t;switch(e){case"client_secret_basic":Qie(n,i,r);return;case"client_secret_post":ese(n,i,o);return;case"none":tse(n,o);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Qie(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let o=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${o}`)}function ese(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function tse(e,t){t.set("client_id",e)}async function gZ(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let o=lZ.parse(JSON.parse(r)),{error:n,error_description:i,error_uri:s}=o,a=hZ[n]||_n;return new a(i||"",s)}catch(o){let n=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new _n(n)}}async function al(e,t){try{return await Tk(e,t)}catch(r){if(r instanceof ti||r instanceof ni)return await e.invalidateCredentials?.("all"),await Tk(e,t);if(r instanceof ri)return await e.invalidateCredentials?.("tokens"),await Tk(e,t);throw r}}async function Tk(e,{serverUrl:t,authorizationCode:r,scope:o,resourceMetadataUrl:n,fetchFn:i}){let s=await e.discoveryState?.(),a,u,c,l=n;if(!l&&s?.resourceMetadataUrl&&(l=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(u=s.authorizationServerUrl,a=s.resourceMetadata,c=s.authorizationServerMetadata??await vZ(u,{fetchFn:i}),!a)try{a=await _Z(t,{resourceMetadataUrl:l},i)}catch{}(c!==s.authorizationServerMetadata||a!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(u),resourceMetadataUrl:l?.toString(),resourceMetadata:a,authorizationServerMetadata:c})}else{let k=await cse(t,{resourceMetadataUrl:l,fetchFn:i});u=k.authorizationServerUrl,c=k.authorizationServerMetadata,a=k.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(u),resourceMetadataUrl:l?.toString(),resourceMetadata:a,authorizationServerMetadata:c})}let f=await nse(t,e,a),h=o||a?.scopes_supported?.join(" ")||e.clientMetadata.scope,p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let k=c?.client_id_metadata_document_supported===!0,b=e.clientMetadataUrl;if(b&&!rse(b))throw new oi(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${b}`);if(k&&b)p={client_id:b},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let T=await pse(u,{metadata:c,clientMetadata:e.clientMetadata,scope:h,fetchFn:i});await e.saveClientInformation(T),p=T}}let g=!e.redirectUrl;if(r!==void 0||g){let k=await fse(e,u,{metadata:c,resource:f,authorizationCode:r,fetchFn:i});return await e.saveTokens(k),"AUTHORIZED"}let m=await e.tokens();if(m?.refresh_token)try{let k=await dse(u,{metadata:c,clientInformation:p,refreshToken:m.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(k),"AUTHORIZED"}catch(k){if(!(!(k instanceof Me)||k instanceof _n))throw k}let _=e.state?await e.state():void 0,{authorizationUrl:v,codeVerifier:S}=await use(u,{metadata:c,clientInformation:p,state:_,redirectUrl:e.redirectUrl,scope:h,resource:f});return await e.saveCodeVerifier(S),await e.redirectToAuthorization(v),"REDIRECT"}function rse(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function nse(e,t,r){let o=fZ(e);if(t.validateResourceURL)return await t.validateResourceURL(o,r?.resource);if(r){if(!pZ({requestedResource:o,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${o} (or origin)`);return new URL(r.resource)}}function Pk(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,o]=t.split(" ");if(r.toLowerCase()!=="bearer"||!o)return{};let n=Ik(e,"resource_metadata")||void 0,i;if(n)try{i=new URL(n)}catch{}let s=Ik(e,"scope")||void 0,a=Ik(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function Ik(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let o=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),n=r.match(o);return n?n[1]||n[2]:null}async function _Z(e,t,r=fetch){let o=await sse(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!o||o.status===404)throw await o?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!o.ok)throw await o.body?.cancel(),new Error(`HTTP ${o.status} trying to load well-known OAuth protected resource metadata.`);return aZ.parse(await o.json())}async function Ok(e,t,r=fetch){try{return await r(e,{headers:t})}catch(o){if(o instanceof TypeError)return t?Ok(e,void 0,r):void 0;throw o}}function ose(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function mZ(e,t,r=fetch){return await Ok(e,{"MCP-Protocol-Version":t},r)}function ise(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function sse(e,t,r,o){let n=new URL(e),i=o?.protocolVersion??Zs,s;if(o?.metadataUrl)s=new URL(o.metadataUrl);else{let u=ose(t,n.pathname);s=new URL(u,o?.metadataServerUrl??n),s.search=n.search}let a=await mZ(s,i,r);if(!o?.metadataUrl&&ise(a,n.pathname)){let u=new URL(`/.well-known/${t}`,n);a=await mZ(u,i,r)}return a}function ase(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",o=[];if(!r)return o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),o.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),o;let n=t.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),o.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,t.origin),type:"oauth"}),o.push({url:new URL(`/.well-known/openid-configuration${n}`,t.origin),type:"oidc"}),o.push({url:new URL(`${n}/.well-known/openid-configuration`,t.origin),type:"oidc"}),o}async function vZ(e,{fetchFn:t=fetch,protocolVersion:r=Zs}={}){let o={"MCP-Protocol-Version":r,Accept:"application/json"},n=ase(e);for(let{url:i,type:s}of n){let a=await Ok(i,o,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?kk.parse(await a.json()):cZ.parse(await a.json())}}}async function cse(e,t){let r,o;try{r=await _Z(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(o=r.authorization_servers[0])}catch{}o||(o=String(new URL("/",e)));let n=await vZ(o,{fetchFn:t?.fetchFn});return{authorizationServerUrl:o,authorizationServerMetadata:n,resourceMetadata:r}}async function use(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:n,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Ek))throw new Error(`Incompatible auth server: does not support response type ${Ek}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(zk))throw new Error(`Incompatible auth server: does not support code challenge method ${zk}`)}else a=new URL("/authorize",e);let u=await $k(),c=u.code_verifier,l=u.code_challenge;return a.searchParams.set("response_type",Ek),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",l),a.searchParams.set("code_challenge_method",zk),a.searchParams.set("redirect_uri",String(o)),i&&a.searchParams.set("state",i),n&&a.searchParams.set("scope",n),n?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:c}}function lse(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function yZ(e,{metadata:t,tokenRequestParams:r,clientInformation:o,addClientAuthentication:n,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),n)await n(u,r,a,t);else if(o){let l=t?.token_endpoint_auth_methods_supported??[],f=Yie(o,l);Xie(f,o,u,r)}let c=await(s??fetch)(a,{method:"POST",headers:u,body:r});if(!c.ok)throw await gZ(c);return uZ.parse(await c.json())}async function dse(e,{metadata:t,clientInformation:r,refreshToken:o,resource:n,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:o}),u=await yZ(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:n,fetchFn:s});return{refresh_token:o,...u}}async function fse(e,t,{metadata:r,resource:o,authorizationCode:n,fetchFn:i}={}){let s=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(s)),!a){if(!n)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let c=await e.codeVerifier();a=lse(n,c,e.redirectUrl)}let u=await e.clientInformation();return yZ(t,{metadata:r,tokenRequestParams:a,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:o,fetchFn:i})}async function pse(e,{metadata:t,clientMetadata:r,scope:o,fetchFn:n}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);let s=await(n??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...o!==void 0?{scope:o}:{}})});if(!s.ok)throw await gZ(s);return dZ.parse(await s.json())}var Vh=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function Rk(e){}function bZ(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Rk,onError:r=Rk,onRetry:o=Rk,onComment:n}=e,i="",s=!0,a,u="",c="";function l(m){let _=s?m.replace(/^\xEF\xBB\xBF/,""):m,[v,S]=hse(`${i}${_}`);for(let k of v)f(k);i=S,s=!1}function f(m){if(m===""){p();return}if(m.startsWith(":")){n&&n(m.slice(m.startsWith(": ")?2:1));return}let _=m.indexOf(":");if(_!==-1){let v=m.slice(0,_),S=m[_+1]===" "?2:1,k=m.slice(_+S);h(v,k,m);return}h(m,"",m)}function h(m,_,v){switch(m){case"event":c=_;break;case"data":u=`${u}${_}
|
|
138
|
+
`;break;case"id":a=_.includes("\0")?void 0:_;break;case"retry":/^\d+$/.test(_)?o(parseInt(_,10)):r(new Vh(`Invalid \`retry\` value: "${_}"`,{type:"invalid-retry",value:_,line:v}));break;default:r(new Vh(`Unknown field "${m.length>20?`${m.slice(0,20)}\u2026`:m}"`,{type:"unknown-field",field:m,value:_,line:v}));break}}function p(){u.length>0&&t({id:a,event:c||void 0,data:u.endsWith(`
|
|
139
|
+
`)?u.slice(0,-1):u}),a=void 0,u="",c=""}function g(m={}){i&&m.consume&&f(i),s=!0,a=void 0,u="",c="",i=""}return{feed:l,reset:g}}function hse(e){let t=[],r="",o=0;for(;o<e.length;){let n=e.indexOf("\r",o),i=e.indexOf(`
|
|
140
|
+
`,o),s=-1;if(n!==-1&&i!==-1?s=Math.min(n,i):n!==-1?n===e.length-1?s=-1:s=n:i!==-1&&(s=i),s===-1){r=e.slice(o);break}else{let a=e.slice(o,s);t.push(a),o=s+1,e[o-1]==="\r"&&e[o]===`
|
|
141
|
+
`&&o++}}return[t,r]}var Wh=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:o}={}){let n;super({start(i){n=bZ({onEvent:s=>{i.enqueue(s)},onError(s){t==="terminate"?i.error(s):typeof t=="function"&&t(s)},onRetry:r,onComment:o})},transform(i){n.feed(i)}})}};var mse={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},co=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},Hh=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=iZ(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??mse}async _authThenStart(){if(!this._authProvider)throw new vn("No auth provider");let t;try{t=await al(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new vn;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let o=await this._authProvider.tokens();o&&(t.Authorization=`Bearer ${o.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=Bh(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let o=await this._commonHeaders();o.set("Accept","text/event-stream"),r&&o.set("last-event-id",r);let n=await(this._fetch??fetch)(this._url,{method:"GET",headers:o,signal:this._abortController?.signal});if(!n.ok){if(await n.body?.cancel(),n.status===401&&this._authProvider)return await this._authThenStart();if(n.status===405)return;throw new co(n.status,`Failed to open SSE stream: ${n.statusText}`)}this._handleSseStream(n.body,t,!0)}catch(o){throw this.onerror?.(o),o}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,o=this._reconnectionOptions.reconnectionDelayGrowFactor,n=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(o,t),n)}_scheduleReconnection(t,r=0){let o=this._reconnectionOptions.maxRetries;if(r>=o){this.onerror?.(new Error(`Maximum reconnection attempts (${o}) exceeded.`));return}let n=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},n)}_handleSseStream(t,r,o){if(!t)return;let{onresumptiontoken:n,replayMessageId:i}=r,s,a=!1,u=!1;(async()=>{try{let l=t.pipeThrough(new TextDecoderStream).pipeThrough(new Wh({onRetry:p=>{this._serverRetryMs=p}})).getReader();for(;;){let{value:p,done:g}=await l.read();if(g)break;if(p.id&&(s=p.id,a=!0,n?.(p.id)),!!p.data&&(!p.event||p.event==="message"))try{let m=Fs.parse(JSON.parse(p.data));Fo(m)&&(u=!0,i!==void 0&&(m.id=i)),this.onmessage?.(m)}catch(m){this.onerror?.(m)}}(o||a)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:n,replayMessageId:i},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(o||a)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:n,replayMessageId:i},0)}catch(p){this.onerror?.(new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new vn("No auth provider");if(await al(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new vn("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:o,onresumptiontoken:n}=r||{};if(o){this._startOrAuthSse({resumptionToken:o,replayMessageId:fu(t)?t.id:void 0}).catch(h=>this.onerror?.(h));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),u=a.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!a.ok){let h=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new co(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:p,scope:g}=Pk(a);if(this._resourceMetadataUrl=p,this._scope=g,await al(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new vn;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:p,scope:g,error:m}=Pk(a);if(m==="insufficient_scope"){let _=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===_)throw new co(403,"Server returned 403 after trying upscoping");if(g&&(this._scope=g),p&&(this._resourceMetadataUrl=p),this._lastUpscopingHeader=_??void 0,await al(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new vn;return this.send(t)}}throw new co(a.status,`Error POSTing to endpoint: ${h}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),m4(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(h=>this.onerror?.(h));return}let l=(Array.isArray(t)?t:[t]).filter(h=>"method"in h&&"id"in h&&h.id!==void 0).length>0,f=a.headers.get("content-type");if(l)if(f?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:n},!1);else if(f?.includes("application/json")){let h=await a.json(),p=Array.isArray(h)?h.map(g=>Fs.parse(g)):[Fs.parse(h)];for(let g of p)this.onmessage?.(g)}else throw await a.body?.cancel(),new co(-1,`Unexpected content type: ${f}`);else await a.body?.cancel()}catch(o){throw this.onerror?.(o),o}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,r);if(await o.body?.cancel(),!o.ok&&o.status!==405)throw new co(o.status,`Failed to terminate session: ${o.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}};import{spawn as wZ}from"child_process";import{platform as EZ}from"os";import{spawn as Ose,spawnSync as Rse}from"child_process";import{createServer as Cse}from"net";import{platform as Ase}from"os";import{existsSync as Nse}from"fs";var cl="__";function gse(e,t,r){return{type:"stdio",command:e,args:t,...r}}function _se(e,t){return{type:"http",url:e,...t}}function vse(e){return{type:"shell",...e}}var yse="octavus-computer",bse="1.0.0",xZ=12e4;function xse(e,t){return`${e}${cl}${t}`}function wse(e){return e.type==="text"&&typeof e.text=="string"?e.text:e}function Sse(e){if(e.isError)return{error:(e.content??[]).filter(i=>i.type==="text"&&typeof i.text=="string").map(i=>i.text).join(`
|
|
142
|
+
`)||"Tool execution failed"};if(e.structuredContent!==void 0&&e.structuredContent!==null)return e.structuredContent;let t=e.content??[];if(t.length===0)return{success:!0};let r=t.filter(n=>n.type==="text"&&typeof n.text=="string");if(!t.some(n=>n.type!=="text")){if(r.length===1)try{return JSON.parse(r[0].text)}catch{return r[0].text}return r.map(n=>n.text).join(`
|
|
143
|
+
`)}return t.map(wse)}async function $se(e,t){let{tools:r}=await e.listTools(),o={},n=[];for(let i of r){let s=xse(t,i.name),a=i.name;n.push({name:s,description:i.description??a,inputSchema:jb(i.inputSchema),outputSchema:i.outputSchema?jb(i.outputSchema):void 0}),o[s]=async u=>{let c=await e.callTool({name:a,arguments:u},void 0,{timeout:xZ,maxTotalTimeout:xZ,resetTimeoutOnProgress:!1});return Sse(c)}}return{handlers:o,schemas:n}}async function kZ(e,t){let r=new Mh({name:yse,version:bse});await r.connect(t);let{handlers:o,schemas:n}=await $se(r,e);return{client:r,namespace:e,handlers:o,schemas:n,close:()=>r.close(),ping:async()=>{await r.ping()}}}function kse(e,t){let r=new qh({command:t.command,args:t.args,env:t.env,cwd:t.cwd,stderr:"pipe"});return kZ(e,r)}function Ese(e,t){let r=new Hh(new URL(t.url),{requestInit:t.headers?{headers:t.headers}:void 0});return kZ(e,r)}var SZ=3e5,Ck=1e5;function zse(){return EZ()==="win32"?{shell:"cmd.exe",args:["/c"]}:{shell:process.env.SHELL??"/bin/bash",args:["-l","-c"]}}function Tse(e,t){if(t==="unrestricted")return!0;if(t.blockedPatterns){for(let r of t.blockedPatterns)if(r.test(e))return!1}if(t.allowedPatterns){for(let r of t.allowedPatterns)if(r.test(e))return!0;return!1}return!0}function la(e){if(e.length<=Ck)return e;let t=Math.floor(Ck/2);return e.slice(0,t)+`
|
|
144
|
+
|
|
145
|
+
... truncated ${e.length-Ck} characters ...
|
|
146
|
+
|
|
147
|
+
`+e.slice(-t)}function Ise(e,t,r){return new Promise(o=>{let{shell:n,args:i}=zse(),s=EZ()==="win32",a=wZ(n,[...i,e],{cwd:t,env:process.env,stdio:["ignore","pipe","pipe"],detached:!s,windowsHide:!0,windowsVerbatimArguments:s}),u="",c="",l=!1,f={},h=p=>{l||(l=!0,f.handle!==void 0&&clearTimeout(f.handle),a.stdout?.destroy(),a.stderr?.destroy(),o(p))};f.handle=setTimeout(()=>{if(a.pid!==void 0)try{s?wZ("taskkill",["/pid",String(a.pid),"/t","/f"]).on("error",()=>{}):process.kill(-a.pid,"SIGKILL")}catch{}h({exitCode:124,stdout:la(u),stderr:la(c+`
|
|
148
|
+
[command timed out]`)})},r),a.stdout.on("data",p=>{u+=p.toString()}),a.stderr.on("data",p=>{c+=p.toString()}),a.on("error",p=>{h({exitCode:1,stdout:la(u),stderr:la(p.message)})}),a.on("exit",(p,g)=>{h({exitCode:p??(g?1:-1),stdout:la(u),stderr:la(c)})})})}function Pse(e,t){let r=t.timeout??SZ,o=async i=>{let s=i.command;if(!s)return{error:"command is required"};if(!Tse(s,t.mode))return{error:`Command not allowed by safety policy: ${s}`};let a=i.cwd??t.cwd,u=i.timeout??r;return await Ise(s,a,u)},n=`${e}${cl}run_command`;return{handlers:{[n]:o},schemas:[{name:n,description:"Run a shell command on the local machine. Commands execute in a login shell with the user's full environment.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The shell command to execute"},cwd:{type:"string",description:"Working directory (optional, defaults to configured directory)"},timeout:{type:"number",description:`Timeout in milliseconds (optional, default ${SZ})`}},required:["command"]}}]}}function Ak(e,t,r,o,n){let i=`${e}${cl}status`,s=t==="degraded"?`The ${e} capability is currently unavailable. Call this tool to diagnose the issue and get fix instructions.`:`Check the health of the ${e} capability and list available tools.`;return{handler:()=>t==="degraded"?Promise.resolve({status:"unavailable",error:o??"Unknown error",...n&&n.prerequisites.length>0&&{prerequisites:n.prerequisites},...n&&n.suggestedFixes.length>0&&{suggestedFixes:n.suggestedFixes}}):Promise.resolve({status:"connected",tools:r}),schema:{name:i,description:s,inputSchema:{type:"object",properties:{}}}}}var $Z={darwin:["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary","/Applications/Chromium.app/Contents/MacOS/Chromium"],linux:["google-chrome","google-chrome-stable","chromium-browser","chromium"],win32:["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"]};function Dse(){let e=Ase(),t=$Z[e]??$Z.linux;for(let r of t)if(r.startsWith("/")||r.startsWith("C:\\")){if(Nse(r))return r}else if(jse(r))return r;throw new Error(`Chrome not found. Searched: ${t.join(", ")}. Install Google Chrome or set the path explicitly.`)}function jse(e){try{return Rse("which",[e],{stdio:"ignore"}).status===0}catch{return!1}}function Use(){return new Promise((e,t)=>{let r=Cse();r.listen(0,"127.0.0.1",()=>{let o=r.address();if(o!==null&&typeof o=="object"){let n=o.port;r.close(()=>e(n))}else r.close(()=>t(new Error("Failed to allocate port")))}),r.on("error",t)})}function Lse(e,t=3e4){let r=Date.now();return new Promise((o,n)=>{function i(){if(Date.now()-r>t){n(new Error(`Chrome debugging port ${e} not ready after ${t}ms`));return}fetch(`http://127.0.0.1:${e}/json/version`).then(s=>{s.ok?o():setTimeout(i,200)}).catch(()=>{setTimeout(i,200)})}i()})}async function Mse(e){let t=e.chromePath??Dse(),r=e.debuggingPort??await Use(),o=[`--remote-debugging-port=${r}`,`--user-data-dir=${e.profileDir}`,"--no-first-run","--no-default-browser-check",...e.flags??[]],n=Ose(t,o,{stdio:"ignore",detached:!1});if(n.pid===void 0)throw new Error(`Failed to launch Chrome at ${t}`);return n.on("error",()=>{}),await Lse(r,e.debuggingPortTimeoutMs),{port:r,process:n,pid:n.pid}}var Zse=3e3,da=class{config;entries=new Map;started=!1;constructor(e){this.config=e}static stdio(e,t,r){return gse(e,t,r)}static http(e,t){return _se(e,t)}static shell(e){return vse(e)}static launchChrome(e){return Mse(e)}async start(){if(this.started)return{errors:[]};let e=new Set(this.config.deferredEntries??[]);for(let n of e)this.setDegradedEntry(n,"Deferred - connect via restartEntry()");let t=Object.entries(this.config.mcpServers).filter(([n])=>!e.has(n)),r=await Promise.allSettled(t.map(([n,i])=>this.connectEntry(n,i))),o=[];for(let n=0;n<r.length;n++){let i=r[n];if(i.status==="rejected"){let s=t[n][0],a=i.reason instanceof Error?i.reason.message:String(i.reason);o.push(`${s}: ${a}`),this.setDegradedEntry(s,a)}}if(o.length>0&&o.length===t.length)throw new Error(`All MCP connections failed:
|
|
149
|
+
${o.join(`
|
|
150
|
+
`)}`);return this.started=!0,{errors:o}}async stop(){let e=[];for(let t of this.entries.values())t.connection&&e.push(t.connection.close().catch(()=>{}));if(await Promise.allSettled(e),this.config.managedProcesses)for(let t of this.config.managedProcesses)try{t.process.kill()}catch{}this.entries.clear(),this.started=!1}async retryDegraded(){let e=[],t=[],r=[...this.entries.values()].filter(n=>n.status==="degraded");if(r.length===0)return{recovered:e,stillDegraded:t};let o=await Promise.allSettled(r.map(async n=>(n.connection&&await n.connection.close().catch(()=>{}),await this.connectEntry(n.namespace,this.config.mcpServers[n.namespace]),n.namespace)));for(let n=0;n<o.length;n++){let i=o[n],s=r[n].namespace;if(i.status==="fulfilled")e.push(s);else{let a=i.reason instanceof Error?i.reason.message:String(i.reason);this.setDegradedEntry(s,a),t.push(s)}}return{recovered:e,stillDegraded:t}}async stopEntry(e){let t=this.entries.get(e);t?.connection&&await t.connection.close().catch(()=>{}),this.setDegradedEntry(e,"Entry stopped")}hasEntry(e){return this.config.mcpServers[e]!==void 0}async addEntry(e,t,r){if(this.config.mcpServers[e])throw new Error(`MCP entry "${e}" already exists. Call removeEntry first to replace.`);if(this.config.mcpServers[e]=t,r?.deferred)this.setDegradedEntry(e,"Deferred - connect via restartEntry()");else try{await this.connectEntry(e,t)}catch(o){let n=o instanceof Error?o.message:String(o);this.setDegradedEntry(e,n)}}async removeEntry(e){let t=this.entries.get(e);t?.connection&&await t.connection.close().catch(()=>{}),this.entries.delete(e);let{[e]:r,...o}=this.config.mcpServers;this.config.mcpServers=o}async restartEntry(e){let t=this.config.mcpServers[e];if(!t)return;let r=this.entries.get(e);r?.connection&&await r.connection.close().catch(()=>{});try{await this.connectEntry(e,t)}catch(o){let n=o instanceof Error?o.message:String(o);this.setDegradedEntry(e,n)}}async getHealth(){let e=[...this.entries.values()].map(o=>this.probeEntry(o)),t=await Promise.all(e);return{healthy:t.length>0&&t.every(o=>o.healthy),entries:t,totalTools:this.toolSchemas().length}}async ensureReady(){let e=await this.getHealth();if(e.healthy)return e;let t=e.entries.filter(i=>!i.healthy);await Promise.allSettled(t.map(i=>this.restartEntry(i.name)));let r=await this.getHealth(),o=[],n=[];for(let i of t)r.entries.find(a=>a.name===i.name)?.healthy?o.push(i.name):n.push(i.name);return{...r,recovered:o,failedEntries:n}}toolHandlers(){let e={};for(let t of this.entries.values())Object.assign(e,t.handlers);return e}toolSchemas(){let e=[];for(let t of this.entries.values())e.push(...t.schemas);return e}async probeEntry(e){if(e.status==="degraded")return{name:e.namespace,healthy:!1,error:e.error};if(!e.connection)return{name:e.namespace,healthy:!0};try{return await Promise.race([e.connection.ping(),new Promise((t,r)=>{setTimeout(()=>r(new Error("Health probe timed out")),Zse)})]),{name:e.namespace,healthy:!0}}catch(t){let r=t instanceof Error?t.message:String(t);return{name:e.namespace,healthy:!1,error:r}}}setDegradedEntry(e,t){let r=this.config.diagnostics?.[e],o=Ak(e,"degraded",[],t,r);this.entries.set(e,{namespace:e,handlers:{[o.schema.name]:o.handler},schemas:[o.schema],status:"degraded",error:t})}async connectEntry(e,t){if(t.type==="shell"){let i=Pse(e,t),s=i.schemas.map(u=>u.name.split(cl)[1]),a=Ak(e,"connected",s);this.entries.set(e,{namespace:e,handlers:{...i.handlers,[a.schema.name]:a.handler},schemas:[...i.schemas,a.schema],status:"connected"});return}let r=t.type==="stdio"?await kse(e,t):await Ese(e,t),o=r.schemas.map(i=>i.name.split(cl)[1]),n=Ak(e,"connected",o);this.entries.set(e,{namespace:e,handlers:{...r.handlers,[n.schema.name]:n.handler},schemas:[...r.schemas,n.schema],connection:r,status:"connected"})}};import{spawn as Nce,spawnSync as Dce}from"child_process";import{existsSync as jce}from"fs";import{platform as Uce}from"os";var zZ=Symbol();var TZ=async(e,t=Object.create(null))=>{let{all:r=!1,dot:o=!1}=t,i=(e instanceof Nk?e.raw.headers:e.headers).get("Content-Type");return i?.startsWith("multipart/form-data")||i?.startsWith("application/x-www-form-urlencoded")?Fse(e,{all:r,dot:o}):{}};async function Fse(e,t){let r=await e.formData();return r?qse(r,t):{}}function qse(e,t){let r=Object.create(null);return e.forEach((o,n)=>{t.all||n.endsWith("[]")?Bse(r,n,o):r[n]=o}),t.dot&&Object.entries(r).forEach(([o,n])=>{o.includes(".")&&(Vse(r,o,n),delete r[o])}),r}var Bse=(e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},Vse=(e,t,r)=>{let o=e,n=t.split(".");n.forEach((i,s)=>{s===n.length-1?o[i]=r:((!o[i]||typeof o[i]!="object"||Array.isArray(o[i])||o[i]instanceof File)&&(o[i]=Object.create(null)),o=o[i])})};var jk=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}};var Dk=e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?jk(e,Uk):e):e,IZ=(e,t,r)=>{let o;if(!r&&t&&!/[%+]/.test(t)){let s=e.indexOf("?",8);if(s===-1)return;for(e.startsWith(t,s+1)||(s=e.indexOf(`&${t}`,s+1));s!==-1;){let a=e.charCodeAt(s+t.length+1);if(a===61){let u=s+t.length+2,c=e.indexOf("&",u);return Dk(e.slice(u,c===-1?void 0:c))}else if(a==38||isNaN(a))return"";s=e.indexOf(`&${t}`,s+1)}if(o=/[%+]/.test(e),!o)return}let n={};o??=/[%+]/.test(e);let i=e.indexOf("?",8);for(;i!==-1;){let s=e.indexOf("&",i+1),a=e.indexOf("=",i);a>s&&s!==-1&&(a=-1);let u=e.slice(i+1,a===-1?s===-1?void 0:s:a);if(o&&(u=Dk(u)),i=s,u==="")continue;let c;a===-1?c="":(c=e.slice(a+1,s===-1?void 0:s),o&&(c=Dk(c))),r?(n[u]&&Array.isArray(n[u])||(n[u]=[]),n[u].push(c)):n[u]??=c}return t?n[t]:n},PZ=IZ,OZ=(e,t)=>IZ(e,t,!0),Uk=decodeURIComponent;var RZ=e=>jk(e,Uk),Nk=class{raw;#t;#e;routeIndex=0;path;bodyCache={};constructor(e,t="/",r=[[]]){this.raw=e,this.path=t,this.#e=r,this.#t={}}param(e){return e?this.#o(e):this.#i()}#o(e){let t=this.#e[0][this.routeIndex][1][e],r=this.#n(t);return r&&/\%/.test(r)?RZ(r):r}#i(){let e={},t=Object.keys(this.#e[0][this.routeIndex][1]);for(let r of t){let o=this.#n(this.#e[0][this.routeIndex][1][r]);o!==void 0&&(e[r]=/\%/.test(o)?RZ(o):o)}return e}#n(e){return this.#e[1]?this.#e[1][e]:e}query(e){return PZ(this.url,e)}queries(e){return OZ(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t={};return this.raw.headers.forEach((r,o)=>{t[o]=r}),t}async parseBody(e){return this.bodyCache.parsedBody??=await TZ(this,e)}#r=e=>{let{bodyCache:t,raw:r}=this,o=t[e];if(o)return o;let n=Object.keys(t)[0];return n?t[n].then(i=>(n==="json"&&(i=JSON.stringify(i)),new Response(i)[e]())):t[e]=r[e]()};json(){return this.#r("text").then(e=>JSON.parse(e))}text(){return this.#r("text")}arrayBuffer(){return this.#r("arrayBuffer")}blob(){return this.#r("blob")}formData(){return this.#r("formData")}addValidatedData(e,t){this.#t[e]=t}valid(e){return this.#t[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[zZ](){return this.#e}get matchedRoutes(){return this.#e[0].map(([[,e]])=>e)}get routePath(){return this.#e[0].map(([[,e]])=>e)[this.routeIndex].path}};var TSe=new Set(".\\+*[^]$()");var yce=We(T6(),1),bce=We(nm(),1),xce=We(ha(),1),wce=We(Gk(),1),Sce=We(Xk(),1),$ce=We(oE(),1),sE=We(am(),1),kce=We(D6(),1);import{Readable as j6}from"stream";import Cce from"crypto";var Ece=global.Request,uE=class extends Ece{constructor(e,t){typeof e=="object"&&xa in e&&(e=e[xa]()),typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},zce=e=>{let t=[],r=e.rawHeaders;for(let o=0;o<r.length;o+=2){let{[o]:n,[o+1]:i}=r;n.charCodeAt(0)!==58&&t.push([n,i])}return new Headers(t)},Tce=Symbol("wrapBodyStream"),Ice=(e,t,r,o,n)=>{let i={method:e,headers:r,signal:n.signal};if(e==="TRACE"){i.method="GET";let s=new uE(t,i);return Object.defineProperty(s,"method",{get(){return"TRACE"}}),s}if(!(e==="GET"||e==="HEAD"))if("rawBody"in o&&o.rawBody instanceof Buffer)i.body=new ReadableStream({start(s){s.enqueue(o.rawBody),s.close()}});else if(o[Tce]){let s;i.body=new ReadableStream({async pull(a){try{s||=j6.toWeb(o).getReader();let{done:u,value:c}=await s.read();u?a.close():a.enqueue(c)}catch(u){a.error(u)}}})}else i.body=j6.toWeb(o);return new uE(t,i)},xa=Symbol("getRequestCache"),Pce=Symbol("requestCache"),aE=Symbol("incomingKey"),U6=Symbol("urlKey"),Oce=Symbol("headersKey"),cE=Symbol("abortControllerKey"),Rce=Symbol("getAbortController"),lE={get method(){return this[aE].method||"GET"},get url(){return this[U6]},get headers(){return this[Oce]||=zce(this[aE])},[Rce](){return this[xa](),this[cE]},[xa](){return this[cE]||=new AbortController,this[Pce]||=Ice(this.method,this[U6],this.headers,this[aE],this[cE])}};["body","bodyUsed","cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","signal","keepalive"].forEach(e=>{Object.defineProperty(lE,e,{get(){return this[xa]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(lE,e,{value:function(){return this[xa]()[e]()}})});Object.setPrototypeOf(lE,uE.prototype);var L6=Symbol("responseCache"),ba=Symbol("getResponseCache"),um=Symbol("cache"),dE=global.Response,lm=class M6{#t;#e;[ba](){return delete this[um],this[L6]||=new dE(this.#t,this.#e)}constructor(t,r){let o;if(this.#t=t,r instanceof M6){let n=r[L6];if(n){this.#e=n,this[ba]();return}else this.#e=r.#e,o=new Headers(r.#e.headers)}else this.#e=r;(typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(o||=r?.headers||{"content-type":"text/plain; charset=UTF-8"},this[um]=[r?.status||200,t,o])}get headers(){let t=this[um];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2])),t[2]):this[ba]().headers}get status(){return this[um]?.[0]??this[ba]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(lm.prototype,e,{get(){return this[ba]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(lm.prototype,e,{value:function(){return this[ba]()[e]()}})});Object.setPrototypeOf(lm,dE);Object.setPrototypeOf(lm.prototype,dE.prototype);typeof global.crypto>"u"&&(global.crypto=Cce);var F$e=Symbol("outgoingEnded");var Ace="browser-extension",W$e=`${Ace}__`,Z6={blockedPatterns:[/\bpkill\b[^|;&]*\b(node|entry(\.js)?|chromium?|supervise-entry)\b/,/\bkillall\b[^|;&]*\b(node|chromium?|chrome)\b/,/\bfuser\s+-k\s+.*\b(8080|6080|5900)\b/,/\b(reboot|shutdown|halt|poweroff)\b/,/\binit\s+0\b/]};async function F6(){if(Uce()==="linux"){if(!process.env.DBUS_SESSION_BUS_ADDRESS){console.warn("[atspi] DBUS_SESSION_BUS_ADDRESS unset; skipping AT-SPI bootstrap");return}Mce(),await Fce(400),Zce()}}var Lce=["/usr/libexec/at-spi-bus-launcher","/usr/lib/at-spi2-core/at-spi-bus-launcher"];function Mce(){let e=Lce.find(t=>jce(t));if(e)try{let t=Nce(e,["--launch-immediately"],{detached:!0,stdio:"ignore"});t.on("error",r=>console.warn("[atspi] at-spi-bus-launcher failed to start:",r)),t.unref()}catch(t){console.warn("[atspi] Could not start at-spi-bus-launcher:",t)}}function Zce(){for(let e of["ScreenReaderEnabled","IsEnabled"]){let t=Dce("dbus-send",["--session","--type=method_call","--dest=org.a11y.Bus","/org/a11y/bus","org.freedesktop.DBus.Properties.Set","string:org.a11y.Status",`string:${e}`,"variant:boolean:true"],{stdio:"ignore",timeout:5e3});(t.error||t.status!==0)&&console.warn(`[atspi] Could not set org.a11y.Status.${e}`)}}function Fce(e){return new Promise(t=>{setTimeout(t,e)})}var Y$e=20*1024*1024;var X$e=process.platform==="win32";var qce=65536,eke=Buffer.alloc(qce);var fE=Bce(import.meta.url);function q6(e){return B6(fE.resolve(`${e}/package.json`))}function Hce(){let e=B6(Wce(import.meta.url)),t=wa(e,"browser-extension-mcp.js");return Vce(t)?{browserMcpEntry:t,computerUseMcpEntry:wa(e,"computer-mcp","dist","index.js"),filesystemMcpEntry:wa(e,"filesystem-mcp.mjs"),extensionDir:wa(e,"browser-extension")}:{browserMcpEntry:fE.resolve("@octavus/browser-extension-mcp"),computerUseMcpEntry:fE.resolve("@octavus/computer-use-mcp"),filesystemMcpEntry:wa(q6("@modelcontextprotocol/server-filesystem"),"dist/index.js"),extensionDir:wa(q6("browser-extension"),"dist")}}function V6(e){let{browserMcpEntry:t,computerUseMcpEntry:r,filesystemMcpEntry:o,extensionDir:n}=Hce(),i={};e.display&&(i.DISPLAY=e.display),process.env.DBUS_SESSION_BUS_ADDRESS&&(i.DBUS_SESSION_BUS_ADDRESS=process.env.DBUS_SESSION_BUS_ADDRESS);let s=[t,`--extension-dir=${n}`,`--profile-dir=${e.browserProfileDir}`,`--download-dir=${e.downloadsDir}`,...e.chromePath?[`--chrome-path=${e.chromePath}`]:[],"--durable-profile",...e.fillWindowSize?["--extra-flag=--window-position=0,0",`--extra-flag=--window-size=${e.fillWindowSize.width},${e.fillWindowSize.height}`,"--reset-window-placement"]:[]];return new da({mcpServers:{filesystem:da.stdio("node",[o,e.workspaceDir,e.skillsDir]),shell:da.shell({cwd:e.workspaceDir,mode:Z6}),"computer-use":da.stdio("node",[r],{env:i}),"browser-extension":da.stdio("node",s,{env:i})},deferredEntries:["browser-extension","computer-use"]})}import{spawn as Jce,spawnSync as dm}from"child_process";import{existsSync as Gce}from"fs";import{platform as Kce}from"os";var gl={width:1920,height:1080};function W6(e){return dm("which",[e],{stdio:"ignore"}).status===0}function H6(e){return dm("xdpyinfo",["-display",e],{stdio:"ignore"}).status===0}function Yce(e){let t=dm("xdpyinfo",["-display",e],{encoding:"utf8"}),r=/dimensions:\s+(\d+)x(\d+)\s+pixels/.exec(t.stdout??"");return r?{width:Number(r[1]),height:Number(r[2])}:void 0}function Xce(){for(let e=99;e<120;e++)if(!Gce(`/tmp/.X11-unix/X${e}`))return`:${e}`;return":99"}async function Qce(e,t){let r=Date.now()+t;for(;Date.now()<r;){if(H6(e))return!0;await new Promise(o=>{setTimeout(o,200)})}return!1}async function J6(e){if(Kce()!=="linux")return{cleanup:()=>{}};let t=[],r,o=!1;if(!process.env.DISPLAY||!H6(process.env.DISPLAY))if(W6("Xvfb")){let n=Xce(),i=Jce("Xvfb",[n,"-screen","0",`${gl.width}x${gl.height}x24`,"-ac","-nolisten","tcp"],{stdio:"ignore"});i.unref(),t.push(()=>i.kill()),process.env.DISPLAY=n,r={...gl},o=!0,await Qce(n,5e3)?e.info("Started virtual display",{display:n,...gl}):e.warn("Virtual display did not become ready; browser/computer-use may be unavailable",{display:n})}else e.warn("Xvfb not installed; browser and computer-use tools will be unavailable",{hint:"Install xvfb (e.g. apt-get install -y xvfb) or run under an existing DISPLAY."});else r=Yce(process.env.DISPLAY)??{...gl};if(!process.env.DBUS_SESSION_BUS_ADDRESS&&W6("dbus-launch")){let n=dm("dbus-launch",["--sh-syntax"],{encoding:"utf8"}),i=/DBUS_SESSION_BUS_ADDRESS='([^']+)'/.exec(n.stdout??"")?.[1],s=/DBUS_SESSION_BUS_PID=(\d+)/.exec(n.stdout??"")?.[1];i&&(process.env.DBUS_SESSION_BUS_ADDRESS=i,e.info("Started D-Bus session",{pid:s}),s&&t.push(()=>{try{process.kill(Number(s))}catch{}}))}try{await F6()}catch(n){e.warn("AT-SPI bootstrap failed (computer-use labeling may be degraded)",{error:String(n)})}return{display:process.env.DISPLAY,dimensions:r,ownsDisplay:o,cleanup:()=>{for(let n of t)n()}}}import{createRequire as eue}from"module";var tue=eue(import.meta.url),rue=tue("../package.json"),li=rue.version;var _l=class extends Error{constructor(r,o,n){super(r);this.status=o;this.code=n;this.name="PlatformError"}};async function G6(e){let t={};try{t=await e.json()}catch{}return new _l(t.error??e.statusText??"Request failed",e.status,t.code)}async function fm(e){let t=await fetch(`${e}/api/cli/version`);if(!t.ok)throw await G6(t);return await t.json()}async function K6(e,t,r){let o=await fetch(`${e}/api/v1/workforce/cli/sessions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,"X-Octavus-CLI-Version":li},body:JSON.stringify(r)});if(!o.ok)throw await G6(o);return await o.json()}function di(e){process.stderr.write(`Error: ${e}
|
|
151
|
+
`)}function cue(e,t){let r=e.split("."),o=t.split("."),n=Math.max(r.length,o.length);for(let i=0;i<n;i+=1){let s=Number(r[i]??"0"),a=Number(o[i]??"0"),u=Number.isNaN(s)?0:s,c=Number.isNaN(a)?0:a;if(u!==c)return u-c}return 0}async function X6(e){let t=VA(!!e.verbose),r=Kc(e.env,e.platformUrl),o=qA(e.env,e.apiKey),n=Sp(e.env,e.operatorUrl);if(!r)return di(`No platform URL for environment "${e.env}". Configure it once with \`octoagent auth --env ${e.env} --platform-url <url> --api-key <oct_agt_...>\`, or pass --platform-url / set OCTAVUS_PLATFORM_URL.`),2;if(!o)return di("No API key configured. Run `octoagent auth --api-key <oct_agt_...>` or pass --api-key."),2;let i=aue(e.workdir??process.cwd());if(!e.force&&(i===Y6()||i==="/"))return di(`Refusing to run with the workspace at ${i}. cd into a project directory, pass --workdir <dir>, or --force to override.`),2;try{let b=await fm(r);if(cue(li,b.minVersion)<0)return di(`This Octavus Agent CLI (${li}) is out of date. Update to ${b.minVersion} or newer to run.`),3}catch(b){t.warn("Could not check the supported CLI version; continuing",{error:String(b)})}let s;try{s=await K6(r,o,{prompt:e.prompt})}catch(b){return b instanceof _l?(di(b.message),b.status===426?3:1):(di(`Failed to start the run: ${String(b)}`),1)}let a=`${r}/agents/${s.octoAgentId}/chat/${s.threadId}`;process.stdout.write(`Started run. Watch it live: ${a}
|
|
152
|
+
`);let u=BA(e.env,s.octoAgentId),c=sue(i,"downloads");iue(c,{recursive:!0});let l=await J6(t),f={os:oue(),arch:nue(),workingDirectory:i,homeDirectory:Y6(),skillsDirectory:u.skillsDir,downloadsDirectory:c,...l.dimensions?{display:l.dimensions}:{}},h=async()=>{let b=V6({workspaceDir:i,skillsDir:u.skillsDir,browserProfileDir:u.browserProfileDir,downloadsDir:c,chromePath:e.chromePath,display:l.display,fillWindowSize:l.ownsDisplay?l.dimensions:void 0}),{errors:x}=await b.start();return x.length>0&&t.warn("Some computer tools failed to start",{errors:x}),b},p=null,g,m=new Promise(b=>{g=b}),_=new DA({operatorWsUrl:n??s.operator.wsUrl,computerToken:s.operator.computerToken,octoAgentId:s.octoAgentId,onDispatch:()=>{},onStop:b=>p?.handleStop(b),onRequestSessionState:b=>p?.handleRequestSessionState(b),getActiveSessionIds:()=>p?.getActiveSessions().map(b=>b.sessionId)??[],onDisconnected:b=>p?.handleConnectionLost(b),onReconnected:()=>p?.handleConnectionRestored(),onStateChange:b=>{b==="connected"&&g()},logger:t}),v=new LA({octoAgentId:s.octoAgentId,connection:_,computer:h,platformUrl:r,deviceSkillsDir:u.skillsDir,agentWorkspaceDir:i,environment:f,logger:t,onComputerReset:h});p=v,v.start(),_.connect(),await Promise.race([m,new Promise(b=>{setTimeout(b,2e4)})]),_.getState()!=="connected"&&t.warn("Operator relay not connected; the run still completes, but its live view may lag");let S={type:"dispatch",sessionId:s.sessionId,operatorToken:s.driverToken,trigger:s.trigger,deviceMcpConfigs:s.deviceMcpConfigs,deviceSkillConfigs:s.deviceSkillConfigs},k;try{k=await v.runLocalDispatch(S)}finally{await v.stop(),await _.closeGracefully(),l.cleanup()}return k.status==="completed"?(process.stdout.write(`Run completed. View: ${a}
|
|
153
|
+
`),0):(di(`Run ${k.status}${k.error?`: ${k.error}`:""}. View: ${a}`),1)}function uue(e){let t=[],r={};for(let o=0;o<e.length;o++){let n=e[o];if(n.startsWith("--")){let i=n.slice(2),s=i.indexOf("=");if(s>=0)r[i.slice(0,s)]=i.slice(s+1);else{let a=e[o+1];a!==void 0&&!a.startsWith("--")?(r[i]=a,o+=1):r[i]=!0}}else t.push(n)}return{positionals:t,flags:r}}function Ot(e){return typeof e=="string"?e:void 0}var Q6=`octoagent - run your cloud Octavus Agent on a machine you control
|
|
154
|
+
|
|
155
|
+
Usage:
|
|
156
|
+
octoagent run "<prompt>" Run a prompt on the configured agent, in the current directory
|
|
157
|
+
--workdir <dir> Use <dir> as the agent's filesystem/shell root (default: cwd)
|
|
158
|
+
--api-key <oct_agt_...> Override the stored API key for this run
|
|
159
|
+
--platform-url <url> Override the platform base URL
|
|
160
|
+
--operator-url <ws-url> Override the operator WS URL (container/tunnel setups)
|
|
161
|
+
--env <name> Environment to use (default: production; e.g. staging)
|
|
162
|
+
--chrome-path <path> Path to Chrome for Testing (else resolved from PATH)
|
|
163
|
+
--force Allow running with the workspace at $HOME or /
|
|
164
|
+
--verbose Print diagnostic logs to stderr
|
|
165
|
+
|
|
166
|
+
octoagent auth --api-key <oct_agt_...> [--platform-url <url>] [--operator-url <ws-url>] [--env <name>]
|
|
167
|
+
Store the agent API key (the only credential you handle)
|
|
168
|
+
octoagent config [--env <name>] Show the current configuration
|
|
169
|
+
octoagent version [--env <name>] Show the CLI and platform-supported versions
|
|
170
|
+
|
|
171
|
+
Environments (--env / OCTAVUS_ENV, default production) each keep their own credentials
|
|
172
|
+
and browser profile under ~/.octavus/<env>/, so staging and production run independently.
|
|
173
|
+
Only production and local have built-in URLs; for any other environment, pass
|
|
174
|
+
--platform-url once with auth (it's stored per environment).
|
|
175
|
+
|
|
176
|
+
The agent must have its computer set to "Your own machine (CLI)" in the dashboard.`;async function lue(){let[e,...t]=process.argv.slice(2),{positionals:r,flags:o}=uue(t);switch(e){case"run":{let n=(r.join(" ").trim()||Ot(o.prompt))??"";return n?await X6({prompt:n,env:Gc(Ot(o.env)),workdir:Ot(o.workdir),apiKey:Ot(o["api-key"]),platformUrl:Ot(o["platform-url"]),operatorUrl:Ot(o["operator-url"]),chromePath:Ot(o["chrome-path"]),force:!!o.force,verbose:!!o.verbose}):(process.stderr.write(`A prompt is required: octoagent run "<prompt>"
|
|
177
|
+
`),2)}case"auth":{let n=Ot(o["api-key"]);if(!n)return process.stderr.write(`Provide the key: octoagent auth --api-key <oct_agt_...>
|
|
178
|
+
`),2;let i=Gc(Ot(o.env)),s=Ot(o["platform-url"]),a=Ot(o["operator-url"]);return FA(i,{apiKey:n,...s?{platformUrl:s}:{},...a?{operatorWsUrl:a}:{}}),process.stdout.write(`Saved ${i} credentials to ${Ts(i)}/config.json
|
|
179
|
+
`),0}case"config":{let n=Gc(Ot(o.env)),i=Is(n),s=i.apiKey?`${i.apiKey.slice(0,12)}...`:"(none)",a=Kc(n)??"(unset - pass --platform-url with auth)",u=Sp(n)??"(from platform per run)";return process.stdout.write(`env: ${n}
|
|
180
|
+
configDir: ${Ts(n)}
|
|
181
|
+
apiKey: ${s}
|
|
182
|
+
platformUrl: ${a}
|
|
183
|
+
operatorUrl: ${u}
|
|
184
|
+
`),0}case"version":{process.stdout.write(`octoagent ${li}
|
|
185
|
+
`);let n=Gc(Ot(o.env)),i=Kc(n,Ot(o["platform-url"]));if(i)try{let s=await fm(i);process.stdout.write(`platform: minimum ${s.minVersion}, latest ${s.latestVersion}
|
|
186
|
+
`)}catch{}return 0}case void 0:case"help":case"--help":case"-h":return process.stdout.write(`${Q6}
|
|
187
|
+
`),0;default:return process.stderr.write(`Unknown command: ${e}
|
|
188
|
+
|
|
189
|
+
${Q6}
|
|
190
|
+
`),2}}lue().then(e=>process.exit(e)).catch(e=>{process.stderr.write(`Fatal: ${e instanceof Error?e.stack??e.message:String(e)}
|
|
191
|
+
`),process.exit(1)});
|