familiar-vtt 2.5.20 → 2.5.22

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.
@@ -1,43 +1,43 @@
1
1
  #!/usr/bin/env node
2
- var Kj=Object.create;var zm=Object.defineProperty;var Qj=Object.getOwnPropertyDescriptor;var Yj=Object.getOwnPropertyNames;var Xj=Object.getPrototypeOf,eD=Object.prototype.hasOwnProperty;var ie=(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 T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wr=(e,t)=>{for(var r in t)zm(e,r,{get:t[r],enumerable:!0})},tD=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Yj(t))!eD.call(e,n)&&n!==r&&zm(e,n,{get:()=>t[n],enumerable:!(i=Qj(t,n))||i.enumerable});return e};var Vt=(e,t,r)=>(r=e!=null?Kj(Xj(e)):{},tD(t||!e||!e.__esModule?zm(r,"default",{value:e,enumerable:!0}):r,e));var Om=T((LW,kw)=>{"use strict";var Jo=e=>e&&typeof e.message=="string",Rm=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return Jo(r)?r:void 0}else return Jo(t)?t:void 0},ww=(e,t)=>{if(!Jo(e))return"";let r=e.stack||"";if(t.has(e))return r+`
3
- causes have become circular...`;let i=Rm(e);return i?(t.add(e),r+`
4
- caused by: `+ww(i,t)):r},rD=e=>ww(e,new Set),$w=(e,t,r)=>{if(!Jo(e))return"";let i=r?"":e.message||"";if(t.has(e))return i+": ...";let n=Rm(e);if(n){t.add(e);let o=typeof e.cause=="function";return i+(o?"":": ")+$w(n,t,o)}else return i},nD=e=>$w(e,new Set);kw.exports={isErrorLike:Jo,getErrorCause:Rm,stackWithCauses:rD,messageWithCauses:nD}});var jm=T((qW,Iw)=>{"use strict";var iD=Symbol("circular-ref-tag"),mc=Symbol("pino-raw-err-ref"),Tw=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[mc]},set:function(e){this[mc]=e}}});Object.defineProperty(Tw,mc,{writable:!0,value:{}});Iw.exports={pinoErrProto:Tw,pinoErrorSymbols:{seen:iD,rawSymbol:mc}}});var zw=T((ZW,Pw)=>{"use strict";Pw.exports=Nm;var{messageWithCauses:oD,stackWithCauses:aD,isErrorLike:Ew}=Om(),{pinoErrProto:sD,pinoErrorSymbols:cD}=jm(),{seen:Dm}=cD,{toString:lD}=Object.prototype;function Nm(e){if(!Ew(e))return e;e[Dm]=void 0;let t=Object.create(sD);t.type=lD.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=oD(e),t.stack=aD(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Nm(r)));for(let r in e)if(t[r]===void 0){let i=e[r];Ew(i)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(i,Dm)&&(t[r]=Nm(i)):t[r]=i}return delete e[Dm],t.raw=e,t}});var Ow=T((FW,Rw)=>{"use strict";Rw.exports=hc;var{isErrorLike:Cm}=Om(),{pinoErrProto:uD,pinoErrorSymbols:dD}=jm(),{seen:fc}=dD,{toString:pD}=Object.prototype;function hc(e){if(!Cm(e))return e;e[fc]=void 0;let t=Object.create(uD);t.type=pD.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>hc(r))),Cm(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,fc)&&(t.cause=hc(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];Cm(i)?Object.prototype.hasOwnProperty.call(i,fc)||(t[r]=hc(i)):t[r]=i}return delete e[fc],t.raw=e,t}});var Cw=T((VW,Nw)=>{"use strict";Nw.exports={mapHttpRequest:mD,reqSerializer:Dw};var Am=Symbol("pino-raw-req-ref"),jw=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Am]},set:function(e){this[Am]=e}}});Object.defineProperty(jw,Am,{writable:!0,value:{}});function Dw(e){let t=e.info||e.socket,r=Object.create(jw);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let i=e.path;r.url=typeof i=="string"?i:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function mD(e){return{req:Dw(e)}}});var Lw=T((BW,Uw)=>{"use strict";Uw.exports={mapHttpResponse:fD,resSerializer:Mw};var Mm=Symbol("pino-raw-res-ref"),Aw=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Mm]},set:function(e){this[Mm]=e}}});Object.defineProperty(Aw,Mm,{writable:!0,value:{}});function Mw(e){let t=Object.create(Aw);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function fD(e){return{res:Mw(e)}}});var Lm=T((HW,qw)=>{"use strict";var Um=zw(),hD=Ow(),gc=Cw(),yc=Lw();qw.exports={err:Um,errWithCause:hD,mapHttpRequest:gc.mapHttpRequest,mapHttpResponse:yc.mapHttpResponse,req:gc.reqSerializer,res:yc.resSerializer,wrapErrorSerializer:function(t){return t===Um?t:function(i){return t(Um(i))}},wrapRequestSerializer:function(t){return t===gc.reqSerializer?t:function(i){return t(gc.reqSerializer(i))}},wrapResponseSerializer:function(t){return t===yc.resSerializer?t:function(i){return t(yc.resSerializer(i))}}}});var qm=T((WW,Zw)=>{"use strict";function gD(e,t){return t}Zw.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=gD;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let i=r.slice(2),n=[];for(let o of i)o&&n.push(o.getFileName());return n}});var Jw=T((JW,Ww)=>{"use strict";function Zm(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=Zm(e[r]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Zm(e[r]));return t}return e}function Fw(e){let t=[],r="",i=!1,n=!1,o="";for(let a=0;a<e.length;a++){let s=e[a];!i&&s==="."?r&&(t.push(r),r=""):s==="["?(r&&(t.push(r),r=""),i=!0):s==="]"&&i?(t.push(r),r="",i=!1,n=!1):(s==='"'||s==="'")&&i?n?s===o?(n=!1,o=""):r+=s:(n=!0,o=s):r+=s}return r&&t.push(r),t}function Vw(e,t,r){let i=e;for(let o=0;o<t.length-1;o++){let a=t[o];if(typeof i!="object"||i===null||!(a in i)||typeof i[a]!="object"||i[a]===null)return!1;i=i[a]}let n=t[t.length-1];if(n==="*"){if(Array.isArray(i))for(let o=0;o<i.length;o++)i[o]=r;else if(typeof i=="object"&&i!==null)for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&(i[o]=r)}else typeof i=="object"&&i!==null&&n in i&&Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=r);return!0}function Bw(e,t){let r=e;for(let n=0;n<t.length-1;n++){let o=t[n];if(typeof r!="object"||r===null||!(o in r)||typeof r[o]!="object"||r[o]===null)return!1;r=r[o]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(r))for(let n=0;n<r.length;n++)r[n]=void 0;else if(typeof r=="object"&&r!==null)for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&delete r[n]}else typeof r=="object"&&r!==null&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];return!0}var vc=Symbol("PATH_NOT_FOUND");function yD(e,t){let r=e;for(let i of t){if(r==null||typeof r!="object"||r===null||!(i in r))return vc;r=r[i]}return r}function vD(e,t){let r=e;for(let i of t){if(r==null||typeof r!="object"||r===null)return;r=r[i]}return r}function bD(e,t,r,i=!1){for(let n of t){let o=Fw(n);if(o.includes("*"))Hw(e,o,r,n,i);else if(i)Bw(e,o);else{let a=yD(e,o);if(a===vc)continue;let s=typeof r=="function"?r(a,o):r;Vw(e,o,s)}}}function Hw(e,t,r,i,n=!1){let o=t.indexOf("*");if(o===t.length-1){let a=t.slice(0,-1),s=e;for(let l of a){if(s==null||typeof s!="object"||s===null)return;s=s[l]}if(Array.isArray(s))if(n)for(let l=0;l<s.length;l++)s[l]=void 0;else for(let l=0;l<s.length;l++){let u=[...a,l.toString()],d=typeof r=="function"?r(s[l],u):r;s[l]=d}else if(typeof s=="object"&&s!==null)if(n){let l=[];for(let u in s)Object.prototype.hasOwnProperty.call(s,u)&&l.push(u);for(let u of l)delete s[u]}else for(let l in s){let u=[...a,l],d=typeof r=="function"?r(s[l],u):r;s[l]=d}}else _D(e,t,r,o,i,n)}function _D(e,t,r,i,n,o=!1){let a=t.slice(0,i),s=t.slice(i+1),l=[];function u(d,p){if(p===a.length){if(Array.isArray(d))for(let f=0;f<d.length;f++)l[p]=f.toString(),u(d[f],p+1);else if(typeof d=="object"&&d!==null)for(let f in d)l[p]=f,u(d[f],p+1)}else if(p<a.length){let f=a[p];d&&typeof d=="object"&&d!==null&&f in d&&(l[p]=f,u(d[f],p+1))}else if(s.includes("*"))Hw(d,s,typeof r=="function"?(h,m)=>{let g=[...l.slice(0,p),...m];return r(h,g)}:r,n,o);else if(o)Bw(d,s);else{let f=typeof r=="function"?r(vD(d,s),[...l.slice(0,p),...s]):r;Vw(d,s,f)}}if(a.length===0)u(e,0);else{let d=e;for(let p=0;p<a.length;p++){let f=a[p];if(d==null||typeof d!="object"||d===null)return;d=d[f],l[p]=f}d!=null&&u(d,a.length)}}function SD(e){if(e.length===0)return null;let t=new Map;for(let r of e){let i=Fw(r),n=t;for(let o=0;o<i.length;o++){let a=i[o];n.has(a)||n.set(a,new Map),n=n.get(a)}}return t}function xD(e,t){if(!t)return e;function r(i,n,o=0){if(!n||n.size===0||i===null||typeof i!="object")return i;if(i instanceof Date)return new Date(i.getTime());if(Array.isArray(i)){let s=[];for(let l=0;l<i.length;l++){let u=l.toString();n.has(u)||n.has("*")?s[l]=r(i[l],n.get(u)||n.get("*")):s[l]=i[l]}return s}let a=Object.create(Object.getPrototypeOf(i));for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n.has(s)||n.has("*")?a[s]=r(i[s],n.get(s)||n.get("*")):a[s]=i[s]);return a}return r(e,t)}function wD(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,r=!1,i="";for(let n=0;n<e.length;n++){let o=e[n];if((o==='"'||o==="'")&&t>0)r?o===i&&(r=!1,i=""):(r=!0,i=o);else if(o==="["&&!r)t++;else if(o==="]"&&!r&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function $D(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)wD(t)}function kD(e={}){let{paths:t=[],censor:r="[REDACTED]",serialize:i=JSON.stringify,strict:n=!0,remove:o=!1}=e;$D(t);let a=SD(t);return function(l){if(n&&(l===null||typeof l!="object")&&(l==null||typeof l!="object"))return i?i(l):l;let u=xD(l,a),d=l,p=r;return typeof r=="function"&&(p=r),bD(u,t,p,o),i===!1?(u.restore=function(){return Zm(d)},u):typeof i=="function"?i(u):JSON.stringify(u)}}Ww.exports=kD});var yi=T((GW,Gw)=>{"use strict";var TD=Symbol("pino.setLevel"),ID=Symbol("pino.getLevel"),ED=Symbol("pino.levelVal"),PD=Symbol("pino.levelComp"),zD=Symbol("pino.useLevelLabels"),RD=Symbol("pino.useOnlyCustomLevels"),OD=Symbol("pino.mixin"),jD=Symbol("pino.lsCache"),DD=Symbol("pino.chindings"),ND=Symbol("pino.asJson"),CD=Symbol("pino.write"),AD=Symbol("pino.redactFmt"),MD=Symbol("pino.time"),UD=Symbol("pino.timeSliceIndex"),LD=Symbol("pino.stream"),qD=Symbol("pino.stringify"),ZD=Symbol("pino.stringifySafe"),FD=Symbol("pino.stringifiers"),VD=Symbol("pino.end"),BD=Symbol("pino.formatOpts"),HD=Symbol("pino.messageKey"),WD=Symbol("pino.errorKey"),JD=Symbol("pino.nestedKey"),GD=Symbol("pino.nestedKeyStr"),KD=Symbol("pino.mixinMergeStrategy"),QD=Symbol("pino.msgPrefix"),YD=Symbol("pino.wildcardFirst"),XD=Symbol.for("pino.serializers"),eN=Symbol.for("pino.formatters"),tN=Symbol.for("pino.hooks"),rN=Symbol.for("pino.metadata");Gw.exports={setLevelSym:TD,getLevelSym:ID,levelValSym:ED,levelCompSym:PD,useLevelLabelsSym:zD,mixinSym:OD,lsCacheSym:jD,chindingsSym:DD,asJsonSym:ND,writeSym:CD,serializersSym:XD,redactFmtSym:AD,timeSym:MD,timeSliceIndexSym:UD,streamSym:LD,stringifySym:qD,stringifySafeSym:ZD,stringifiersSym:FD,endSym:VD,formatOptsSym:BD,messageKeySym:HD,errorKeySym:WD,nestedKeySym:JD,wildcardFirstSym:YD,needsMetadataGsym:rN,useOnlyCustomLevelsSym:RD,formattersSym:eN,hooksSym:tN,nestedKeyStrSym:GD,mixinMergeStrategySym:KD,msgPrefixSym:QD}});var Vm=T((KW,Xw)=>{"use strict";var Kw=Jw(),{redactFmtSym:nN,wildcardFirstSym:bc}=yi(),Fm=/[^.[\]]+|\[([^[\]]*?)\]/g,Qw="[Redacted]",Yw=!1;function iN(e,t){let{paths:r,censor:i,remove:n}=oN(e),o=r.reduce((l,u)=>{Fm.lastIndex=0;let d=Fm.exec(u),p=Fm.exec(u),f=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(f==="*"&&(f=bc),p===null)return l[f]=null,l;if(l[f]===null)return l;let{index:h}=p,m=`${u.substr(h,u.length-1)}`;return l[f]=l[f]||[],f!==bc&&l[f].length===0&&l[f].push(...l[bc]||[]),f===bc&&Object.keys(l).forEach(function(g){l[g]&&l[g].push(m)}),l[f].push(m),l},{}),a={[nN]:Kw({paths:r,censor:i,serialize:t,strict:Yw,remove:n})},s=(...l)=>t(typeof i=="function"?i(...l):i);return[...Object.keys(o),...Object.getOwnPropertySymbols(o)].reduce((l,u)=>{if(o[u]===null)l[u]=d=>s(d,[u]);else{let d=typeof i=="function"?(p,f)=>i(p,[u,...f]):i;l[u]=Kw({paths:o[u],censor:d,serialize:t,strict:Yw,remove:n})}return l},a)}function oN(e){if(Array.isArray(e))return e={paths:e,censor:Qw},e;let{paths:t,censor:r=Qw,remove:i}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(r=void 0),{paths:t,censor:r,remove:i}}Xw.exports=iN});var r0=T((QW,t0)=>{"use strict";var aN=()=>"",sN=()=>`,"time":${Date.now()}`,cN=()=>`,"time":${Math.round(Date.now()/1e3)}`,lN=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,uN=1000000n,e0=1000000000n,dN=BigInt(Date.now())*uN,pN=process.hrtime.bigint(),mN=()=>{let e=process.hrtime.bigint()-pN,t=dN+e,r=t/e0,i=t%e0,n=Number(r*1000n+i/1000000n),o=new Date(n),a=o.getUTCFullYear(),s=(o.getUTCMonth()+1).toString().padStart(2,"0"),l=o.getUTCDate().toString().padStart(2,"0"),u=o.getUTCHours().toString().padStart(2,"0"),d=o.getUTCMinutes().toString().padStart(2,"0"),p=o.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${a}-${s}-${l}T${u}:${d}:${p}.${i.toString().padStart(9,"0")}Z"`};t0.exports={nullTime:aN,epochTime:sN,unixTime:cN,isoTime:lN,isoTimeNano:mN}});var i0=T((YW,n0)=>{"use strict";function fN(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}n0.exports=hN;function hN(e,t,r){var i=r&&r.stringify||fN,n=1;if(typeof e=="object"&&e!==null){var o=t.length+n;if(o===1)return e;var a=new Array(o);a[0]=i(e);for(var s=1;s<o;s++)a[s]=i(t[s]);return a.join(" ")}if(typeof e!="string")return e;var l=t.length;if(l===0)return e;for(var u="",d=1-n,p=-1,f=e&&e.length||0,h=0;h<f;){if(e.charCodeAt(h)===37&&h+1<f){switch(p=p>-1?p:0,e.charCodeAt(h+1)){case 100:case 102:if(d>=l||t[d]==null)break;p<h&&(u+=e.slice(p,h)),u+=Number(t[d]),p=h+2,h++;break;case 105:if(d>=l||t[d]==null)break;p<h&&(u+=e.slice(p,h)),u+=Math.floor(Number(t[d])),p=h+2,h++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;p<h&&(u+=e.slice(p,h));var m=typeof t[d];if(m==="string"){u+="'"+t[d]+"'",p=h+2,h++;break}if(m==="function"){u+=t[d].name||"<anonymous>",p=h+2,h++;break}u+=i(t[d]),p=h+2,h++;break;case 115:if(d>=l)break;p<h&&(u+=e.slice(p,h)),u+=String(t[d]),p=h+2,h++;break;case 37:p<h&&(u+=e.slice(p,h)),u+="%",p=h+2,h++,d--;break}++d}++h}return p===-1?e:(p<f&&(u+=e.slice(p)),u)}});var Hm=T((XW,Bm)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));Bm.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let i=Date.now()+Number(t);for(;i>Date.now(););};Bm.exports=e}});var p0=T((eJ,d0)=>{"use strict";var Re=ie("fs"),gN=ie("events"),yN=ie("util").inherits,o0=ie("path"),Jm=Hm(),vN=ie("assert"),_c=100,Sc=Buffer.allocUnsafe(0),bN=16*1024,a0="buffer",s0="utf8",[_N,SN]=(process.versions.node||"0.0").split(".").map(Number),xN=_N>=22&&SN>=7;function c0(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(o,a){if(o){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",o)}):t.emit("error",o);return}let s=t._reopening;t.fd=a,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():s&&process.nextTick(()=>t.emit("drain")))}let i=t.append?"a":"w",n=t.mode;if(t.sync)try{t.mkdir&&Re.mkdirSync(o0.dirname(e),{recursive:!0});let o=Re.openSync(e,i,n);r(null,o)}catch(o){throw r(o),o}else t.mkdir?Re.mkdir(o0.dirname(e),{recursive:!0},o=>{if(o)return r(o);Re.open(e,i,n,r)}):Re.open(e,i,n,r)}function Bt(e){if(!(this instanceof Bt))return new Bt(e);let{fd:t,dest:r,minLength:i,maxLength:n,maxWrite:o,periodicFlush:a,sync:s,append:l=!0,mkdir:u,retryEAGAIN:d,fsync:p,contentMode:f,mode:h}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=n||0,this.maxWrite=o||bN,this._periodicFlush=a||0,this._periodicFlushTimer=void 0,this.sync=s||!1,this.writable=!0,this._fsync=p||!1,this.append=l||!1,this.mode=h,this.retryEAGAIN=d||(()=>!0),this.mkdir=u||!1;let m,g;if(f===a0)this._writingBuf=Sc,this.write=kN,this.flush=IN,this.flushSync=PN,this._actualWrite=RN,m=()=>Re.writeSync(this.fd,this._writingBuf),g=()=>Re.write(this.fd,this._writingBuf,this.release);else if(f===void 0||f===s0)this._writingBuf="",this.write=$N,this.flush=TN,this.flushSync=EN,this._actualWrite=zN,m=()=>Buffer.isBuffer(this._writingBuf)?Re.writeSync(this.fd,this._writingBuf):Re.writeSync(this.fd,this._writingBuf,"utf8"),g=()=>Buffer.isBuffer(this._writingBuf)?Re.write(this.fd,this._writingBuf,this.release):Re.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${s0}" and "${a0}", but passed ${f}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")c0(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(v,_)=>{if(v){if((v.code==="EAGAIN"||v.code==="EBUSY")&&this.retryEAGAIN(v,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Jm(_c),this.release(void 0,0)}catch(E){this.release(E)}else setTimeout(g,_c);else this._writing=!1,this.emit("error",v);return}this.emit("write",_);let w=Wm(this._writingBuf,this._len,_);if(this._len=w.len,this._writingBuf=w.writingBuf,this._writingBuf.length){if(!this.sync){g();return}try{do{let E=m(),N=Wm(this._writingBuf,this._len,E);this._len=N.len,this._writingBuf=N.writingBuf}while(this._writingBuf.length)}catch(E){this.release(E);return}}this._fsync&&Re.fsyncSync(this.fd);let $=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):$>this.minLength?this._actualWrite():this._ending?$>0?this._actualWrite():(this._writing=!1,xc(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(wN,this)):this.emit("drain"))},this.on("newListener",function(v){v==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function Wm(e,t,r){return typeof e=="string"&&(e=Buffer.from(e)),t=Math.max(t-r,0),e=e.subarray(r),{writingBuf:e,len:t}}function wN(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}yN(Bt,gN);function l0(e,t){return e.length===0?Sc:e.length===1?e[0]:Buffer.concat(e,t)}function $N(e){if(this.destroyed)throw new Error("SonicBoom destroyed");e=""+e;let t=Buffer.byteLength(e),r=this._len+t,i=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(i.length===0||Buffer.byteLength(i[i.length-1])+t>this.maxWrite?i.push(e):i[i.length-1]+=e,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function kN(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,i=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||i[i.length-1]+e.length>this.maxWrite?(r.push([e]),i.push(e.length)):(r[r.length-1].push(e),i[i.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function u0(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{Re.fsync(this.fd,i=>{this._flushPending=!1,e(i)})}catch(i){e(i)}this.off("error",r)},r=i=>{this._flushPending=!1,e(i),this.off("drain",t)};this.once("drain",t),this.once("error",r)}function TN(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&u0.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function IN(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&u0.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Bt.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&Re.close(t,r=>{if(r)return this.emit("error",r)})}),c0(this.file,this)};Bt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():xc(this)))};function EN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let e="";for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?Re.writeSync(this.fd,e):Re.writeSync(this.fd,e,"utf8"),r=Wm(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Jm(_c)}}try{Re.fsyncSync(this.fd)}catch{}}function PN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Sc);let e=Sc;for(;this._bufs.length||e.length;){e.length<=0&&(e=l0(this._bufs[0],this._lens[0]));try{let t=Re.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Jm(_c)}}}Bt.prototype.destroy=function(){this.destroyed||xc(this)};function zN(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?Re.writeSync(this.fd,this._writingBuf):Re.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else Re.write(this.fd,this._writingBuf,e)}function RN(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:l0(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=Re.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else xN&&(this._writingBuf=Buffer.from(this._writingBuf)),Re.write(this.fd,this._writingBuf,e)}function xc(e){if(e.fd===-1){e.once("ready",xc.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],vN(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{Re.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?Re.close(e.fd,r):r()}function r(i){if(i){e.emit("error",i);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}Bt.SonicBoom=Bt;Bt.default=Bt;d0.exports=Bt});var Gm=T((tJ,y0)=>{"use strict";var Ht={exit:[],beforeExit:[]},m0={exit:DN,beforeExit:NN},vi;function ON(){vi===void 0&&(vi=new FinalizationRegistry(CN))}function jN(e){Ht[e].length>0||process.on(e,m0[e])}function f0(e){Ht[e].length>0||(process.removeListener(e,m0[e]),Ht.exit.length===0&&Ht.beforeExit.length===0&&(vi=void 0))}function DN(){h0("exit")}function NN(){h0("beforeExit")}function h0(e){for(let t of Ht[e]){let r=t.deref(),i=t.fn;r!==void 0&&i(r,e)}Ht[e]=[]}function CN(e){for(let t of["exit","beforeExit"]){let r=Ht[t].indexOf(e);Ht[t].splice(r,r+1),f0(t)}}function g0(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");jN(e);let i=new WeakRef(t);i.fn=r,ON(),vi.register(t,i),Ht[e].push(i)}function AN(e,t){g0("exit",e,t)}function MN(e,t){g0("beforeExit",e,t)}function UN(e){if(vi!==void 0){vi.unregister(e);for(let t of["exit","beforeExit"])Ht[t]=Ht[t].filter(r=>{let i=r.deref();return i&&i!==e}),f0(t)}}y0.exports={register:AN,registerBeforeExit:MN,unregister:UN}});var v0=T((rJ,LN)=>{LN.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var _0=T((nJ,b0)=>{"use strict";function qN(e,t,r,i,n){let o=i===1/0?1/0:Date.now()+i,a=()=>{let s=Atomics.load(e,t);if(s===r){n(null,"ok");return}if(o!==1/0&&Date.now()>o){n(null,"timed-out");return}let l=o===1/0?1e4:Math.min(1e4,Math.max(1,o-Date.now())),u=Atomics.waitAsync(e,t,s,l);u.async?u.value.then(a):setImmediate(a)};a()}function ZN(e,t,r,i,n){let o=i===1/0?1/0:Date.now()+i,a=()=>{if(Atomics.load(e,t)!==r){n(null,"ok");return}if(o!==1/0&&Date.now()>o){n(null,"timed-out");return}let l=o===1/0?1e4:Math.min(1e4,Math.max(1,o-Date.now())),u=Atomics.waitAsync(e,t,r,l);u.async?u.value.then(a):setImmediate(a)};a()}b0.exports={wait:qN,waitDiff:ZN}});var x0=T((iJ,S0)=>{"use strict";S0.exports={WRITE_INDEX:4,READ_INDEX:8}});var I0=T((oJ,T0)=>{"use strict";var{version:FN}=v0(),{EventEmitter:VN}=ie("events"),{Worker:BN}=ie("worker_threads"),{join:HN}=ie("path"),{pathToFileURL:WN}=ie("url"),{wait:JN}=_0(),{WRITE_INDEX:gt,READ_INDEX:ht}=x0(),GN=ie("buffer"),KN=ie("assert"),k=Symbol("kImpl"),QN=GN.constants.MAX_STRING_LENGTH,Go=class{constructor(t){this._value=t}deref(){return this._value}},$c=class{register(){}unregister(){}},YN=process.env.NODE_V8_COVERAGE?$c:global.FinalizationRegistry||$c,XN=process.env.NODE_V8_COVERAGE?Go:global.WeakRef||Go,w0=new YN(e=>{e.exited||e.terminate()});function eC(e,t){let{filename:r,workerData:i}=t,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||HN(__dirname,"lib","worker.js"),a=new BN(o,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:WN(r).href,dataBuf:e[k].dataBuf,stateBuf:e[k].stateBuf,workerData:{$context:{threadStreamVersion:FN},...i}}});return a.stream=new Go(e),a.on("message",tC),a.on("exit",k0),w0.register(e,a),a}function $0(e){KN(!e[k].sync),e[k].needDrain&&(e[k].needDrain=!1,e.emit("drain"))}function wc(e){let t=Atomics.load(e[k].state,gt),r=e[k].data.length-t;if(r>0){if(e[k].buf.length===0){e[k].flushing=!1,e[k].ending?ef(e):e[k].needDrain&&process.nextTick($0,e);return}let i=e[k].buf.slice(0,r),n=Buffer.byteLength(i);n<=r?(e[k].buf=e[k].buf.slice(r),kc(e,i,wc.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[k].state,ht,0),Atomics.store(e[k].state,gt,0),Atomics.notify(e[k].state,ht);n>e[k].data.length;)r=r/2,i=e[k].buf.slice(0,r),n=Buffer.byteLength(i);e[k].buf=e[k].buf.slice(r),kc(e,i,wc.bind(null,e))}})}else if(r===0){if(t===0&&e[k].buf.length===0)return;e.flush(()=>{Atomics.store(e[k].state,ht,0),Atomics.store(e[k].state,gt,0),Atomics.notify(e[k].state,ht),wc(e)})}else lr(e,new Error("overwritten"))}function tC(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new XN(t),t.flush(()=>{t[k].ready=!0,t.emit("ready")});break;case"ERROR":lr(t,e.err);break;case"EVENT":Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case"WARNING":process.emitWarning(e.err);break;default:lr(t,new Error("this should not happen: "+e.code))}}function k0(e){let t=this.stream.deref();t!==void 0&&(w0.unregister(t),t.worker.exited=!0,t.worker.off("exit",k0),lr(t,e!==0?new Error("the worker thread exited"):null))}var Qm=class extends VN{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[k]={},this[k].stateBuf=new SharedArrayBuffer(128),this[k].state=new Int32Array(this[k].stateBuf),this[k].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[k].data=Buffer.from(this[k].dataBuf),this[k].sync=t.sync||!1,this[k].ending=!1,this[k].ended=!1,this[k].needDrain=!1,this[k].destroyed=!1,this[k].flushing=!1,this[k].ready=!1,this[k].finished=!1,this[k].errored=null,this[k].closed=!1,this[k].buf="",this.worker=eC(this,t),this.on("message",(r,i)=>{this.worker.postMessage(r,i)})}write(t){if(this[k].destroyed)return Ym(this,new Error("the worker has exited")),!1;if(this[k].ending)return Ym(this,new Error("the worker is ending")),!1;if(this[k].flushing&&this[k].buf.length+t.length>=QN)try{Km(this),this[k].flushing=!0}catch(r){return lr(this,r),!1}if(this[k].buf+=t,this[k].sync)try{return Km(this),!0}catch(r){return lr(this,r),!1}return this[k].flushing||(this[k].flushing=!0,setImmediate(wc,this)),this[k].needDrain=this[k].data.length-this[k].buf.length-Atomics.load(this[k].state,gt)<=0,!this[k].needDrain}end(){this[k].destroyed||(this[k].ending=!0,ef(this))}flush(t){if(this[k].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[k].state,gt);JN(this[k].state,ht,r,1/0,(i,n)=>{if(i){lr(this,i),process.nextTick(t,i);return}if(n==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[k].destroyed||(Km(this),Xm(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[k].ready}get destroyed(){return this[k].destroyed}get closed(){return this[k].closed}get writable(){return!this[k].destroyed&&!this[k].ending}get writableEnded(){return this[k].ending}get writableFinished(){return this[k].finished}get writableNeedDrain(){return this[k].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[k].errored}};function Ym(e,t){setImmediate(()=>{e.emit("error",t)})}function lr(e,t){e[k].destroyed||(e[k].destroyed=!0,t&&(e[k].errored=t,Ym(e,t)),e.worker.exited?setImmediate(()=>{e[k].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[k].closed=!0,e.emit("close")}))}function kc(e,t,r){let i=Atomics.load(e[k].state,gt),n=Buffer.byteLength(t);return e[k].data.write(t,i),Atomics.store(e[k].state,gt,i+n),Atomics.notify(e[k].state,gt),r(),!0}function ef(e){if(!(e[k].ended||!e[k].ending||e[k].flushing)){e[k].ended=!0;try{e.flushSync();let t=Atomics.load(e[k].state,ht);Atomics.store(e[k].state,gt,-1),Atomics.notify(e[k].state,gt);let r=0;for(;t!==-1;){if(Atomics.wait(e[k].state,ht,t,1e3),t=Atomics.load(e[k].state,ht),t===-2){lr(e,new Error("end() failed"));return}if(++r===10){lr(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[k].finished=!0,e.emit("finish")})}catch(t){lr(e,t)}}}function Km(e){let t=()=>{e[k].ending?ef(e):e[k].needDrain&&process.nextTick($0,e)};for(e[k].flushing=!1;e[k].buf.length!==0;){let r=Atomics.load(e[k].state,gt),i=e[k].data.length-r;if(i===0){Xm(e),Atomics.store(e[k].state,ht,0),Atomics.store(e[k].state,gt,0),Atomics.notify(e[k].state,ht);continue}else if(i<0)throw new Error("overwritten");let n=e[k].buf.slice(0,i),o=Buffer.byteLength(n);if(o<=i)e[k].buf=e[k].buf.slice(i),kc(e,n,t);else{for(Xm(e),Atomics.store(e[k].state,ht,0),Atomics.store(e[k].state,gt,0),Atomics.notify(e[k].state,ht);o>e[k].buf.length;)i=i/2,n=e[k].buf.slice(0,i),o=Buffer.byteLength(n);e[k].buf=e[k].buf.slice(i),kc(e,n,t)}}}function Xm(e){if(e[k].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[k].state,gt),r=0;for(;;){let i=Atomics.load(e[k].state,ht);if(i===-2)throw Error("_flushSync failed");if(i!==t)Atomics.wait(e[k].state,ht,i,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}T0.exports=Qm});var nf=T((aJ,z0)=>{"use strict";var{createRequire:rC}=ie("module"),{existsSync:nC}=ie("node:fs"),iC=qm(),{join:tf,isAbsolute:P0,sep:oC}=ie("node:path"),{fileURLToPath:aC}=ie("node:url"),sC=Hm(),rf=Gm(),cC=I0();function lC(e){rf.register(e,fC),rf.registerBeforeExit(e,hC),e.on("close",function(){rf.unregister(e)})}function uC(){let e=process.execArgv;for(let t=0;t<e.length;t++){let r=e[t];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function dC(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let r=[],i=!1;for(let n=0;n<t.length;n++){let o=t[n];if(o==="--require"||o==="-r"||o==="--import"){let a=t[n+1];if(a&&E0(a)){i=!0,n++;continue}r.push(o),a&&(r.push(a),n++);continue}if(o.startsWith("--require=")||o.startsWith("-r=")||o.startsWith("--import=")){let a=o.slice(o.indexOf("=")+1);if(E0(a)){i=!0;continue}}r.push(o)}return i?r.join(" "):e}function E0(e){let t=pC(e);if(!t)return!1;let r=t;if(r.startsWith("file://"))try{r=aC(r)}catch{return!1}return P0(r)&&!nC(r)}function pC(e){let t=e[0],r=e[e.length-1];return t==='"'&&r==='"'||t==="'"&&r==="'"?e.slice(1,-1):e}function mC(e,t,r,i,n){if(!r.execArgv&&uC()&&ie.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let l=dC(process.env.NODE_OPTIONS);l!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:l}})}r={...r,name:n};let o=new cC({filename:e,workerData:t,workerOpts:r,sync:i});o.on("ready",a),o.on("close",function(){process.removeListener("exit",s)}),process.on("exit",s);function a(){process.removeListener("exit",s),o.unref(),r.autoEnd!==!1&&lC(o)}function s(){o.closed||(o.flushSync(),sC(100),o.end())}return o}function fC(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function hC(e){e.flushSync()}function gC(e){let{pipeline:t,targets:r,levels:i,dedupe:n,worker:o={},caller:a=iC(),sync:s=!1}=e,l={...e.options},u=typeof a=="string"?[a]:a,d=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),p=e.target;if(p&&r)throw new Error("only one of target or targets can be specified");r?(p=d["pino-worker"]||tf(__dirname,"worker.js"),l.targets=r.filter(m=>m.target).map(m=>({...m,target:h(m.target)})),l.pipelines=r.filter(m=>m.pipeline).map(m=>m.pipeline.map(g=>({...g,level:m.level,target:h(g.target)})))):t&&(p=d["pino-worker"]||tf(__dirname,"worker.js"),l.pipelines=[t.map(m=>({...m,target:h(m.target)}))]),i&&(l.levels=i),n&&(l.dedupe=n),l.pinoWillSendConfig=!0;let f=r||t?"pino.transport":p;return mC(h(p),l,o,s,f);function h(m){if(m=d[m]||m,P0(m)||m.indexOf("file://")===0)return m;if(m==="pino/file")return tf(__dirname,"..","file.js");let g;for(let v of u)try{let _=v==="node:repl"?process.cwd()+oC:v;g=rC(_).resolve(m);break}catch{continue}if(!g)throw new Error(`unable to determine transport target for "${m}"`);return g}}z0.exports=gC});var Ec=T((cJ,F0)=>{"use strict";var yC=ie("node:diagnostics_channel"),R0=i0(),{mapHttpRequest:vC,mapHttpResponse:bC}=Lm(),af=p0(),O0=Gm(),{lsCacheSym:_C,chindingsSym:A0,writeSym:j0,serializersSym:M0,formatOptsSym:D0,endSym:SC,stringifiersSym:U0,stringifySym:L0,stringifySafeSym:sf,wildcardFirstSym:q0,nestedKeySym:xC,formattersSym:Z0,messageKeySym:wC,errorKeySym:$C,nestedKeyStrSym:kC,msgPrefixSym:Tc}=yi(),{isMainThread:TC}=ie("worker_threads"),IC=nf(),[EC]=process.versions.node.split(".").map(e=>Number(e)),N0=yC.tracingChannel("pino_asJson"),of=EC>=25?e=>JSON.stringify(e):zC;function bi(){}function PC(e,t){if(!t)return r;return function(...n){t.call(this,n,r,e)};function r(i,...n){if(typeof i=="object"){let o=i;i!==null&&(i.method&&i.headers&&i.socket?i=vC(i):typeof i.setHeader=="function"&&(i=bC(i)));let a;o===null&&n.length===0?a=[null]:(o=n.shift(),a=n),typeof this[Tc]=="string"&&o!==void 0&&o!==null&&(o=this[Tc]+o),this[j0](i,R0(o,a,this[D0]),e)}else{let o=i===void 0?n.shift():i;typeof this[Tc]=="string"&&o!==void 0&&o!==null&&(o=this[Tc]+o),this[j0](null,R0(o,n,this[D0]),e)}}}function zC(e){let t="",r=0,i=!1,n=255,o=e.length;if(o>100)return JSON.stringify(e);for(var a=0;a<o&&n>=32;a++)n=e.charCodeAt(a),(n===34||n===92)&&(t+=e.slice(r,a)+"\\",r=a,i=!0);return i?t+=e.slice(r):t=e,n<32?JSON.stringify(e):'"'+t+'"'}function RC(e,t,r,i){if(N0.hasSubscribers===!1)return C0.call(this,e,t,r,i);let n={instance:this,arguments};return N0.traceSync(C0,n,this,e,t,r,i)}function C0(e,t,r,i){let n=this[L0],o=this[sf],a=this[U0],s=this[SC],l=this[A0],u=this[M0],d=this[Z0],p=this[wC],f=this[$C],h=this[_C][r]+i;h=h+l;let m;d.log&&(e=d.log(e));let g=a[q0],v="";for(let w in e)if(m=e[w],Object.prototype.hasOwnProperty.call(e,w)&&m!==void 0){u[w]?m=u[w](m):w===f&&u.err&&(m=u.err(m));let $=a[w]||g;switch(typeof m){case"undefined":case"function":continue;case"number":Number.isFinite(m)===!1&&(m=null);case"boolean":$&&(m=$(m));break;case"string":m=($||of)(m);break;default:m=($||n)(m,o)}if(m===void 0)continue;let E=of(w);v+=","+E+":"+m}let _="";if(t!==void 0){m=u[p]?u[p](t):t;let w=a[p]||g;switch(typeof m){case"function":break;case"number":Number.isFinite(m)===!1&&(m=null);case"boolean":w&&(m=w(m)),_=',"'+p+'":'+m;break;case"string":m=(w||of)(m),_=',"'+p+'":'+m;break;default:m=(w||n)(m,o),_=',"'+p+'":'+m}}return this[xC]&&v?h+this[kC]+v.slice(1)+"}"+_+s:h+v+_+s}function OC(e,t){let r,i=e[A0],n=e[L0],o=e[sf],a=e[U0],s=a[q0],l=e[M0],u=e[Z0].bindings;t=u(t);for(let d in t)if(r=t[d],((d.length<5||d!=="level"&&d!=="serializers"&&d!=="formatters"&&d!=="customLevels")&&t.hasOwnProperty(d)&&r!==void 0)===!0){if(r=l[d]?l[d](r):r,r=(a[d]||s||n)(r,o),r===void 0)continue;i+=',"'+d+'":'+r}return i}function jC(e){return e.write!==e.constructor.prototype.write}function Ic(e){let t=new af(e);return t.on("error",r),!e.sync&&TC&&(O0.register(t,DC),t.on("close",function(){O0.unregister(t)})),t;function r(i){if(i.code==="EPIPE"){t.write=bi,t.end=bi,t.flushSync=bi,t.destroy=bi;return}t.removeListener("error",r),t.emit("error",i)}}function DC(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function NC(e){return function(r,i,n={},o){if(typeof n=="string")o=Ic({dest:n}),n={};else if(typeof o=="string"){if(n&&n.transport)throw Error("only one of option.transport or stream can be specified");o=Ic({dest:o})}else if(n instanceof af||n.writable||n._writableState)o=n,n={};else if(n.transport){if(n.transport instanceof af||n.transport.writable||n.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(n.transport.targets&&n.transport.targets.length&&n.formatters&&typeof n.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;n.customLevels&&(l=n.useOnlyCustomLevels?n.customLevels:Object.assign({},n.levels,n.customLevels)),o=IC({caller:i,...n.transport,levels:l})}if(n=Object.assign({},e,n),n.serializers=Object.assign({},e.serializers,n.serializers),n.formatters=Object.assign({},e.formatters,n.formatters),n.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:a,onChild:s}=n;return a===!1&&(n.level="silent"),s||(n.onChild=bi),o||(jC(process.stdout)?o=process.stdout:o=Ic({fd:process.stdout.fd||1})),{opts:n,stream:o}}}function CC(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[sf])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function AC(e,t,r){return{level:e,bindings:t,log:r}}function MC(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}F0.exports={noop:bi,buildSafeSonicBoom:Ic,asChindings:OC,asJson:RC,genLog:PC,createArgsNormalizer:NC,stringify:CC,buildFormatters:AC,normalizeDestFileDescriptor:MC}});var Pc=T((lJ,V0)=>{var UC={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},LC={ASC:"ASC",DESC:"DESC"};V0.exports={DEFAULT_LEVELS:UC,SORTING_ORDER:LC}});var uf=T((uJ,J0)=>{"use strict";var{lsCacheSym:qC,levelValSym:cf,useOnlyCustomLevelsSym:ZC,streamSym:FC,formattersSym:VC,hooksSym:BC,levelCompSym:B0}=yi(),{noop:HC,genLog:Tn}=Ec(),{DEFAULT_LEVELS:ur,SORTING_ORDER:H0}=Pc(),W0={fatal:e=>{let t=Tn(ur.fatal,e);return function(...r){let i=this[FC];if(t.call(this,...r),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:e=>Tn(ur.error,e),warn:e=>Tn(ur.warn,e),info:e=>Tn(ur.info,e),debug:e=>Tn(ur.debug,e),trace:e=>Tn(ur.trace,e)},lf=Object.keys(ur).reduce((e,t)=>(e[ur[t]]=t,e),{}),WC=Object.keys(lf).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function JC(e){let t=e[VC].level,{labels:r}=e.levels,i={};for(let n in r){let o=t(r[n],Number(n));i[n]=JSON.stringify(o).slice(0,-1)}return e[qC]=i,e}function GC(e,t){if(t)return!1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function KC(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let i=this[cf],n=this[cf]=r[e],o=this[ZC],a=this[B0],s=this[BC].logMethod;for(let l in r){if(a(r[l],n)===!1){this[l]=HC;continue}this[l]=GC(l,o)?W0[l](s):Tn(r[l],s)}this.emit("level-change",e,n,t[i],i,this)}function QC(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function YC(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&this[B0](r,this[cf])}function XC(e,t,r){return e===H0.DESC?t<=r:t>=r}function eA(e){return typeof e=="string"?XC.bind(null,e):e}function tA(e=null,t=!1){let r=e?Object.keys(e).reduce((o,a)=>(o[e[a]]=a,o),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:lf,r),n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:ur,e);return{labels:i,values:n}}function rA(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(o=>t[o]),r?[]:Object.keys(lf).map(o=>+o),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:ur,t);if(!(e in i))throw Error(`default level:${e} must be included in custom levels`)}function nA(e,t){let{labels:r,values:i}=e;for(let n in t){if(n in i)throw Error("levels cannot be overridden");if(t[n]in r)throw Error("pre-existing level values cannot be used for new levels")}}function iA(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(H0).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}J0.exports={initialLsCache:WC,genLsCache:JC,levelMethods:W0,getLevel:QC,setLevel:KC,isLevelEnabled:YC,mappings:tA,assertNoLevelCollisions:nA,assertDefaultLevelFound:rA,genLevelComparison:eA,assertLevelComparison:iA}});var df=T((dJ,G0)=>{"use strict";G0.exports={version:"10.3.1"}});var n$=T((mJ,r$)=>{"use strict";var{EventEmitter:oA}=ie("node:events"),{lsCacheSym:aA,levelValSym:sA,setLevelSym:mf,getLevelSym:K0,chindingsSym:Rc,mixinSym:cA,asJsonSym:Y0,writeSym:lA,mixinMergeStrategySym:uA,timeSym:dA,timeSliceIndexSym:pA,streamSym:X0,serializersSym:In,formattersSym:Ko,errorKeySym:mA,messageKeySym:fA,useOnlyCustomLevelsSym:hA,needsMetadataGsym:gA,redactFmtSym:yA,stringifySym:vA,formatOptsSym:bA,stringifiersSym:_A,msgPrefixSym:ff,hooksSym:SA}=yi(),{getLevel:xA,setLevel:wA,isLevelEnabled:$A,mappings:kA,initialLsCache:TA,genLsCache:IA,assertNoLevelCollisions:EA}=uf(),{asChindings:hf,asJson:PA,buildFormatters:pf,stringify:Q0,noop:e$}=Ec(),{version:zA}=df(),RA=Vm(),OA=class{},t$={constructor:OA,child:jA,bindings:DA,setBindings:NA,flush:MA,isLevelEnabled:$A,version:zA,get level(){return this[K0]()},set level(e){this[mf](e)},get levelVal(){return this[sA]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[ff]},get[Symbol.toStringTag](){return"Pino"},[aA]:TA,[lA]:AA,[Y0]:PA,[K0]:xA,[mf]:wA};Object.setPrototypeOf(t$,oA.prototype);r$.exports=function(){return Object.create(t$)};var zc=e=>e;function jA(e,t){if(!e)throw Error("missing bindings for child Pino");let r=this[In],i=this[Ko],n=Object.create(this);if(t==null)return n[Ko].bindings!==zc&&(n[Ko]=pf(i.level,zc,i.log)),n[Rc]=hf(n,e),this.onChild!==e$&&this.onChild(n),n;if(t.hasOwnProperty("serializers")===!0){n[In]=Object.create(null);for(let u in r)n[In][u]=r[u];let s=Object.getOwnPropertySymbols(r);for(var o=0;o<s.length;o++){let u=s[o];n[In][u]=r[u]}for(let u in t.serializers)n[In][u]=t.serializers[u];let l=Object.getOwnPropertySymbols(t.serializers);for(var a=0;a<l.length;a++){let u=l[a];n[In][u]=t.serializers[u]}}else n[In]=r;if(t.hasOwnProperty("formatters")){let{level:s,bindings:l,log:u}=t.formatters;n[Ko]=pf(s||i.level,l||zc,u||i.log)}else n[Ko]=pf(i.level,zc,i.log);if(t.hasOwnProperty("customLevels")===!0&&(EA(this.levels,t.customLevels),n.levels=kA(t.customLevels,n[hA]),IA(n)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){n.redact=t.redact;let s=RA(n.redact,Q0),l={stringify:s[yA]};n[vA]=Q0,n[_A]=s,n[bA]=l}if(typeof t.msgPrefix=="string"&&(n[ff]=(this[ff]||"")+t.msgPrefix),n[Rc]=hf(n,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty("customLevels")){let s=t.level||this.level;n[mf](s)}return this.onChild(n),n}function DA(){let t=`{${this[Rc].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function NA(e){let t=hf(this,e);this[Rc]=t}function CA(e,t){return Object.assign(t,e)}function AA(e,t,r){let i=this[dA](),n=this[cA],o=this[mA],a=this[fA],s=this[uA]||CA,l,u=this[SA].streamWrite;e==null?l={}:e instanceof Error?(l={[o]:e},t===void 0&&(t=e.message)):(l=e,t===void 0&&e[a]===void 0&&e[o]&&(t=e[o].message)),n&&(l=s(l,n(l,r,this)));let d=this[Y0](l,t,r,i),p=this[X0];p[gA]===!0&&(p.lastLevel=r,p.lastObj=l,p.lastMsg=t,p.lastTime=i.slice(this[pA]),p.lastLogger=this),p.write(u?u(d):d)}function MA(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[X0];typeof t.flush=="function"?t.flush(e||e$):e&&e()}});var s$=T((bf,a$)=>{"use strict";var{hasOwnProperty:Qo}=Object.prototype,Pn=vf();Pn.configure=vf;Pn.stringify=Pn;Pn.default=Pn;bf.stringify=Pn;bf.configure=vf;a$.exports=Pn;var UA=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Fr(e){return e.length<5e3&&!UA.test(e)?`"${e}"`:JSON.stringify(e)}function gf(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let i=e[r],n=r;for(;n!==0&&e[n-1]>i;)e[n]=e[n-1],n--;e[n]=i}return e}var LA=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function yf(e){return LA.call(e)!==void 0&&e.length!==0}function i$(e,t,r){e.length<r&&(r=e.length);let i=t===","?"":" ",n=`"0":${i}${e[0]}`;for(let o=1;o<r;o++)n+=`${t}"${o}":${i}${e[o]}`;return n}function qA(e){if(Qo.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function ZA(e){let t;if(Qo.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function FA(e,t){let r;if(Qo.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function o$(e,t){let r;if(Qo.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function En(e){return e===1?"1 item":`${e} items`}function VA(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function BA(e){if(Qo.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let i=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(i+=` (${r.toString()})`),new Error(i)}}}function vf(e){e={...e};let t=BA(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=qA(e),i=FA(e,"bigint"),n=ZA(e),o=typeof n=="function"?n:void 0,a=o$(e,"maximumDepth"),s=o$(e,"maximumBreadth");function l(h,m,g,v,_,w){let $=m[h];switch(typeof $=="object"&&$!==null&&typeof $.toJSON=="function"&&($=$.toJSON(h)),$=v.call(m,h,$),typeof $){case"string":return Fr($);case"object":{if($===null)return"null";if(g.indexOf($)!==-1)return r;let E="",N=",",de=w;if(Array.isArray($)){if($.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push($),_!==""&&(w+=_,E+=`
2
+ var cD=Object.create;var jm=Object.defineProperty;var lD=Object.getOwnPropertyDescriptor;var uD=Object.getOwnPropertyNames;var dD=Object.getPrototypeOf,pD=Object.prototype.hasOwnProperty;var ie=(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 I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$r=(e,t)=>{for(var r in t)jm(e,r,{get:t[r],enumerable:!0})},mD=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of uD(t))!pD.call(e,n)&&n!==r&&jm(e,n,{get:()=>t[n],enumerable:!(i=lD(t,n))||i.enumerable});return e};var Bt=(e,t,r)=>(r=e!=null?cD(dD(e)):{},mD(t||!e||!e.__esModule?jm(r,"default",{value:e,enumerable:!0}):r,e));var Nm=I((mJ,Lw)=>{"use strict";var Go=e=>e&&typeof e.message=="string",Dm=e=>{if(!e)return;let t=e.cause;if(typeof t=="function"){let r=e.cause();return Go(r)?r:void 0}else return Go(t)?t:void 0},Mw=(e,t)=>{if(!Go(e))return"";let r=e.stack||"";if(t.has(e))return r+`
3
+ causes have become circular...`;let i=Dm(e);return i?(t.add(e),r+`
4
+ caused by: `+Mw(i,t)):r},fD=e=>Mw(e,new Set),Uw=(e,t,r)=>{if(!Go(e))return"";let i=r?"":e.message||"";if(t.has(e))return i+": ...";let n=Dm(e);if(n){t.add(e);let o=typeof e.cause=="function";return i+(o?"":": ")+Uw(n,t,o)}else return i},hD=e=>Uw(e,new Set);Lw.exports={isErrorLike:Go,getErrorCause:Dm,stackWithCauses:fD,messageWithCauses:hD}});var Cm=I((fJ,Zw)=>{"use strict";var gD=Symbol("circular-ref-tag"),hc=Symbol("pino-raw-err-ref"),qw=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[hc]},set:function(e){this[hc]=e}}});Object.defineProperty(qw,hc,{writable:!0,value:{}});Zw.exports={pinoErrProto:qw,pinoErrorSymbols:{seen:gD,rawSymbol:hc}}});var Bw=I((hJ,Vw)=>{"use strict";Vw.exports=Mm;var{messageWithCauses:yD,stackWithCauses:vD,isErrorLike:Fw}=Nm(),{pinoErrProto:bD,pinoErrorSymbols:_D}=Cm(),{seen:Am}=_D,{toString:SD}=Object.prototype;function Mm(e){if(!Fw(e))return e;e[Am]=void 0;let t=Object.create(bD);t.type=SD.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=yD(e),t.stack=vD(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>Mm(r)));for(let r in e)if(t[r]===void 0){let i=e[r];Fw(i)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(i,Am)&&(t[r]=Mm(i)):t[r]=i}return delete e[Am],t.raw=e,t}});var Ww=I((gJ,Hw)=>{"use strict";Hw.exports=yc;var{isErrorLike:Um}=Nm(),{pinoErrProto:xD,pinoErrorSymbols:wD}=Cm(),{seen:gc}=wD,{toString:$D}=Object.prototype;function yc(e){if(!Um(e))return e;e[gc]=void 0;let t=Object.create(xD);t.type=$D.call(e.constructor)==="[object Function]"?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(r=>yc(r))),Um(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,gc)&&(t.cause=yc(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];Um(i)?Object.prototype.hasOwnProperty.call(i,gc)||(t[r]=yc(i)):t[r]=i}return delete e[gc],t.raw=e,t}});var Qw=I((yJ,Kw)=>{"use strict";Kw.exports={mapHttpRequest:kD,reqSerializer:Gw};var Lm=Symbol("pino-raw-req-ref"),Jw=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Lm]},set:function(e){this[Lm]=e}}});Object.defineProperty(Jw,Lm,{writable:!0,value:{}});function Gw(e){let t=e.info||e.socket,r=Object.create(Jw);if(r.id=typeof e.id=="function"?e.id():e.id||(e.info?e.info.id:void 0),r.method=e.method,e.originalUrl)r.url=e.originalUrl;else{let i=e.path;r.url=typeof i=="string"?i:e.url?e.url.path||e.url:void 0}return e.query&&(r.query=e.query),e.params&&(r.params=e.params),r.headers=e.headers,r.remoteAddress=t&&t.remoteAddress,r.remotePort=t&&t.remotePort,r.raw=e.raw||e,r}function kD(e){return{req:Gw(e)}}});var t0=I((vJ,e0)=>{"use strict";e0.exports={mapHttpResponse:TD,resSerializer:Xw};var qm=Symbol("pino-raw-res-ref"),Yw=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[qm]},set:function(e){this[qm]=e}}});Object.defineProperty(Yw,qm,{writable:!0,value:{}});function Xw(e){let t=Object.create(Yw);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function TD(e){return{res:Xw(e)}}});var Fm=I((bJ,r0)=>{"use strict";var Zm=Bw(),ID=Ww(),vc=Qw(),bc=t0();r0.exports={err:Zm,errWithCause:ID,mapHttpRequest:vc.mapHttpRequest,mapHttpResponse:bc.mapHttpResponse,req:vc.reqSerializer,res:bc.resSerializer,wrapErrorSerializer:function(t){return t===Zm?t:function(i){return t(Zm(i))}},wrapRequestSerializer:function(t){return t===vc.reqSerializer?t:function(i){return t(vc.reqSerializer(i))}},wrapResponseSerializer:function(t){return t===bc.resSerializer?t:function(i){return t(bc.resSerializer(i))}}}});var Vm=I((_J,n0)=>{"use strict";function ED(e,t){return t}n0.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=ED;let r=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(r))return;let i=r.slice(2),n=[];for(let o of i)o&&n.push(o.getFileName());return n}});var l0=I((SJ,c0)=>{"use strict";function Bm(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=Bm(e[r]);return t}if(typeof e=="object"){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Bm(e[r]));return t}return e}function i0(e){let t=[],r="",i=!1,n=!1,o="";for(let a=0;a<e.length;a++){let s=e[a];!i&&s==="."?r&&(t.push(r),r=""):s==="["?(r&&(t.push(r),r=""),i=!0):s==="]"&&i?(t.push(r),r="",i=!1,n=!1):(s==='"'||s==="'")&&i?n?s===o?(n=!1,o=""):r+=s:(n=!0,o=s):r+=s}return r&&t.push(r),t}function o0(e,t,r){let i=e;for(let o=0;o<t.length-1;o++){let a=t[o];if(typeof i!="object"||i===null||!(a in i)||typeof i[a]!="object"||i[a]===null)return!1;i=i[a]}let n=t[t.length-1];if(n==="*"){if(Array.isArray(i))for(let o=0;o<i.length;o++)i[o]=r;else if(typeof i=="object"&&i!==null)for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&(i[o]=r)}else typeof i=="object"&&i!==null&&n in i&&Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=r);return!0}function a0(e,t){let r=e;for(let n=0;n<t.length-1;n++){let o=t[n];if(typeof r!="object"||r===null||!(o in r)||typeof r[o]!="object"||r[o]===null)return!1;r=r[o]}let i=t[t.length-1];if(i==="*"){if(Array.isArray(r))for(let n=0;n<r.length;n++)r[n]=void 0;else if(typeof r=="object"&&r!==null)for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&delete r[n]}else typeof r=="object"&&r!==null&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];return!0}var _c=Symbol("PATH_NOT_FOUND");function PD(e,t){let r=e;for(let i of t){if(r==null||typeof r!="object"||r===null||!(i in r))return _c;r=r[i]}return r}function zD(e,t){let r=e;for(let i of t){if(r==null||typeof r!="object"||r===null)return;r=r[i]}return r}function RD(e,t,r,i=!1){for(let n of t){let o=i0(n);if(o.includes("*"))s0(e,o,r,n,i);else if(i)a0(e,o);else{let a=PD(e,o);if(a===_c)continue;let s=typeof r=="function"?r(a,o):r;o0(e,o,s)}}}function s0(e,t,r,i,n=!1){let o=t.indexOf("*");if(o===t.length-1){let a=t.slice(0,-1),s=e;for(let c of a){if(s==null||typeof s!="object"||s===null)return;s=s[c]}if(Array.isArray(s))if(n)for(let c=0;c<s.length;c++)s[c]=void 0;else for(let c=0;c<s.length;c++){let u=[...a,c.toString()],d=typeof r=="function"?r(s[c],u):r;s[c]=d}else if(typeof s=="object"&&s!==null)if(n){let c=[];for(let u in s)Object.prototype.hasOwnProperty.call(s,u)&&c.push(u);for(let u of c)delete s[u]}else for(let c in s){let u=[...a,c],d=typeof r=="function"?r(s[c],u):r;s[c]=d}}else OD(e,t,r,o,i,n)}function OD(e,t,r,i,n,o=!1){let a=t.slice(0,i),s=t.slice(i+1),c=[];function u(d,p){if(p===a.length){if(Array.isArray(d))for(let f=0;f<d.length;f++)c[p]=f.toString(),u(d[f],p+1);else if(typeof d=="object"&&d!==null)for(let f in d)c[p]=f,u(d[f],p+1)}else if(p<a.length){let f=a[p];d&&typeof d=="object"&&d!==null&&f in d&&(c[p]=f,u(d[f],p+1))}else if(s.includes("*"))s0(d,s,typeof r=="function"?(h,m)=>{let g=[...c.slice(0,p),...m];return r(h,g)}:r,n,o);else if(o)a0(d,s);else{let f=typeof r=="function"?r(zD(d,s),[...c.slice(0,p),...s]):r;o0(d,s,f)}}if(a.length===0)u(e,0);else{let d=e;for(let p=0;p<a.length;p++){let f=a[p];if(d==null||typeof d!="object"||d===null)return;d=d[f],c[p]=f}d!=null&&u(d,a.length)}}function jD(e){if(e.length===0)return null;let t=new Map;for(let r of e){let i=i0(r),n=t;for(let o=0;o<i.length;o++){let a=i[o];n.has(a)||n.set(a,new Map),n=n.get(a)}}return t}function DD(e,t){if(!t)return e;function r(i,n,o=0){if(!n||n.size===0||i===null||typeof i!="object")return i;if(i instanceof Date)return new Date(i.getTime());if(Array.isArray(i)){let s=[];for(let c=0;c<i.length;c++){let u=c.toString();n.has(u)||n.has("*")?s[c]=r(i[c],n.get(u)||n.get("*")):s[c]=i[c]}return s}let a=Object.create(Object.getPrototypeOf(i));for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n.has(s)||n.has("*")?a[s]=r(i[s],n.get(s)||n.get("*")):a[s]=i[s]);return a}return r(e,t)}function ND(e){if(typeof e!="string")throw new Error("Paths must be (non-empty) strings");if(e==="")throw new Error("Invalid redaction path ()");if(e.includes(".."))throw new Error(`Invalid redaction path (${e})`);if(e.includes(","))throw new Error(`Invalid redaction path (${e})`);let t=0,r=!1,i="";for(let n=0;n<e.length;n++){let o=e[n];if((o==='"'||o==="'")&&t>0)r?o===i&&(r=!1,i=""):(r=!0,i=o);else if(o==="["&&!r)t++;else if(o==="]"&&!r&&(t--,t<0))throw new Error(`Invalid redaction path (${e})`)}if(t!==0)throw new Error(`Invalid redaction path (${e})`)}function CD(e){if(!Array.isArray(e))throw new TypeError("paths must be an array");for(let t of e)ND(t)}function AD(e={}){let{paths:t=[],censor:r="[REDACTED]",serialize:i=JSON.stringify,strict:n=!0,remove:o=!1}=e;CD(t);let a=jD(t);return function(c){if(n&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return i?i(c):c;let u=DD(c,a),d=c,p=r;return typeof r=="function"&&(p=r),RD(u,t,p,o),i===!1?(u.restore=function(){return Bm(d)},u):typeof i=="function"?i(u):JSON.stringify(u)}}c0.exports=AD});var vi=I((xJ,u0)=>{"use strict";var MD=Symbol("pino.setLevel"),UD=Symbol("pino.getLevel"),LD=Symbol("pino.levelVal"),qD=Symbol("pino.levelComp"),ZD=Symbol("pino.useLevelLabels"),FD=Symbol("pino.useOnlyCustomLevels"),VD=Symbol("pino.mixin"),BD=Symbol("pino.lsCache"),HD=Symbol("pino.chindings"),WD=Symbol("pino.asJson"),JD=Symbol("pino.write"),GD=Symbol("pino.redactFmt"),KD=Symbol("pino.time"),QD=Symbol("pino.timeSliceIndex"),YD=Symbol("pino.stream"),XD=Symbol("pino.stringify"),eN=Symbol("pino.stringifySafe"),tN=Symbol("pino.stringifiers"),rN=Symbol("pino.end"),nN=Symbol("pino.formatOpts"),iN=Symbol("pino.messageKey"),oN=Symbol("pino.errorKey"),aN=Symbol("pino.nestedKey"),sN=Symbol("pino.nestedKeyStr"),cN=Symbol("pino.mixinMergeStrategy"),lN=Symbol("pino.msgPrefix"),uN=Symbol("pino.wildcardFirst"),dN=Symbol.for("pino.serializers"),pN=Symbol.for("pino.formatters"),mN=Symbol.for("pino.hooks"),fN=Symbol.for("pino.metadata");u0.exports={setLevelSym:MD,getLevelSym:UD,levelValSym:LD,levelCompSym:qD,useLevelLabelsSym:ZD,mixinSym:VD,lsCacheSym:BD,chindingsSym:HD,asJsonSym:WD,writeSym:JD,serializersSym:dN,redactFmtSym:GD,timeSym:KD,timeSliceIndexSym:QD,streamSym:YD,stringifySym:XD,stringifySafeSym:eN,stringifiersSym:tN,endSym:rN,formatOptsSym:nN,messageKeySym:iN,errorKeySym:oN,nestedKeySym:aN,wildcardFirstSym:uN,needsMetadataGsym:fN,useOnlyCustomLevelsSym:FD,formattersSym:pN,hooksSym:mN,nestedKeyStrSym:sN,mixinMergeStrategySym:cN,msgPrefixSym:lN}});var Wm=I((wJ,f0)=>{"use strict";var d0=l0(),{redactFmtSym:hN,wildcardFirstSym:Sc}=vi(),Hm=/[^.[\]]+|\[([^[\]]*?)\]/g,p0="[Redacted]",m0=!1;function gN(e,t){let{paths:r,censor:i,remove:n}=yN(e),o=r.reduce((c,u)=>{Hm.lastIndex=0;let d=Hm.exec(u),p=Hm.exec(u),f=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(f==="*"&&(f=Sc),p===null)return c[f]=null,c;if(c[f]===null)return c;let{index:h}=p,m=`${u.substr(h,u.length-1)}`;return c[f]=c[f]||[],f!==Sc&&c[f].length===0&&c[f].push(...c[Sc]||[]),f===Sc&&Object.keys(c).forEach(function(g){c[g]&&c[g].push(m)}),c[f].push(m),c},{}),a={[hN]:d0({paths:r,censor:i,serialize:t,strict:m0,remove:n})},s=(...c)=>t(typeof i=="function"?i(...c):i);return[...Object.keys(o),...Object.getOwnPropertySymbols(o)].reduce((c,u)=>{if(o[u]===null)c[u]=d=>s(d,[u]);else{let d=typeof i=="function"?(p,f)=>i(p,[u,...f]):i;c[u]=d0({paths:o[u],censor:d,serialize:t,strict:m0,remove:n})}return c},a)}function yN(e){if(Array.isArray(e))return e={paths:e,censor:p0},e;let{paths:t,censor:r=p0,remove:i}=e;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(r=void 0),{paths:t,censor:r,remove:i}}f0.exports=gN});var y0=I(($J,g0)=>{"use strict";var vN=()=>"",bN=()=>`,"time":${Date.now()}`,_N=()=>`,"time":${Math.round(Date.now()/1e3)}`,SN=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,xN=1000000n,h0=1000000000n,wN=BigInt(Date.now())*xN,$N=process.hrtime.bigint(),kN=()=>{let e=process.hrtime.bigint()-$N,t=wN+e,r=t/h0,i=t%h0,n=Number(r*1000n+i/1000000n),o=new Date(n),a=o.getUTCFullYear(),s=(o.getUTCMonth()+1).toString().padStart(2,"0"),c=o.getUTCDate().toString().padStart(2,"0"),u=o.getUTCHours().toString().padStart(2,"0"),d=o.getUTCMinutes().toString().padStart(2,"0"),p=o.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${a}-${s}-${c}T${u}:${d}:${p}.${i.toString().padStart(9,"0")}Z"`};g0.exports={nullTime:vN,epochTime:bN,unixTime:_N,isoTime:SN,isoTimeNano:kN}});var b0=I((kJ,v0)=>{"use strict";function TN(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}v0.exports=IN;function IN(e,t,r){var i=r&&r.stringify||TN,n=1;if(typeof e=="object"&&e!==null){var o=t.length+n;if(o===1)return e;var a=new Array(o);a[0]=i(e);for(var s=1;s<o;s++)a[s]=i(t[s]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var u="",d=1-n,p=-1,f=e&&e.length||0,h=0;h<f;){if(e.charCodeAt(h)===37&&h+1<f){switch(p=p>-1?p:0,e.charCodeAt(h+1)){case 100:case 102:if(d>=c||t[d]==null)break;p<h&&(u+=e.slice(p,h)),u+=Number(t[d]),p=h+2,h++;break;case 105:if(d>=c||t[d]==null)break;p<h&&(u+=e.slice(p,h)),u+=Math.floor(Number(t[d])),p=h+2,h++;break;case 79:case 111:case 106:if(d>=c||t[d]===void 0)break;p<h&&(u+=e.slice(p,h));var m=typeof t[d];if(m==="string"){u+="'"+t[d]+"'",p=h+2,h++;break}if(m==="function"){u+=t[d].name||"<anonymous>",p=h+2,h++;break}u+=i(t[d]),p=h+2,h++;break;case 115:if(d>=c)break;p<h&&(u+=e.slice(p,h)),u+=String(t[d]),p=h+2,h++;break;case 37:p<h&&(u+=e.slice(p,h)),u+="%",p=h+2,h++,d--;break}++d}++h}return p===-1?e:(p<f&&(u+=e.slice(p)),u)}});var Gm=I((TJ,Jm)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(e,0,0,Number(r))},e=new Int32Array(new SharedArrayBuffer(4));Jm.exports=t}else{let e=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let i=Date.now()+Number(t);for(;i>Date.now(););};Jm.exports=e}});var I0=I((IJ,T0)=>{"use strict";var Re=ie("fs"),EN=ie("events"),PN=ie("util").inherits,_0=ie("path"),Qm=Gm(),zN=ie("assert"),xc=100,wc=Buffer.allocUnsafe(0),RN=16*1024,S0="buffer",x0="utf8",[ON,jN]=(process.versions.node||"0.0").split(".").map(Number),DN=ON>=22&&jN>=7;function w0(e,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function r(o,a){if(o){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",o)}):t.emit("error",o);return}let s=t._reopening;t.fd=a,t.file=e,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():s&&process.nextTick(()=>t.emit("drain")))}let i=t.append?"a":"w",n=t.mode;if(t.sync)try{t.mkdir&&Re.mkdirSync(_0.dirname(e),{recursive:!0});let o=Re.openSync(e,i,n);r(null,o)}catch(o){throw r(o),o}else t.mkdir?Re.mkdir(_0.dirname(e),{recursive:!0},o=>{if(o)return r(o);Re.open(e,i,n,r)}):Re.open(e,i,n,r)}function Ht(e){if(!(this instanceof Ht))return new Ht(e);let{fd:t,dest:r,minLength:i,maxLength:n,maxWrite:o,periodicFlush:a,sync:s,append:c=!0,mkdir:u,retryEAGAIN:d,fsync:p,contentMode:f,mode:h}=e||{};t=t||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=n||0,this.maxWrite=o||RN,this._periodicFlush=a||0,this._periodicFlushTimer=void 0,this.sync=s||!1,this.writable=!0,this._fsync=p||!1,this.append=c||!1,this.mode=h,this.retryEAGAIN=d||(()=>!0),this.mkdir=u||!1;let m,g;if(f===S0)this._writingBuf=wc,this.write=AN,this.flush=UN,this.flushSync=qN,this._actualWrite=FN,m=()=>Re.writeSync(this.fd,this._writingBuf),g=()=>Re.write(this.fd,this._writingBuf,this.release);else if(f===void 0||f===x0)this._writingBuf="",this.write=CN,this.flush=MN,this.flushSync=LN,this._actualWrite=ZN,m=()=>Buffer.isBuffer(this._writingBuf)?Re.writeSync(this.fd,this._writingBuf):Re.writeSync(this.fd,this._writingBuf,"utf8"),g=()=>Buffer.isBuffer(this._writingBuf)?Re.write(this.fd,this._writingBuf,this.release):Re.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${x0}" and "${S0}", but passed ${f}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")w0(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(v,_)=>{if(v){if((v.code==="EAGAIN"||v.code==="EBUSY")&&this.retryEAGAIN(v,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Qm(xc),this.release(void 0,0)}catch(E){this.release(E)}else setTimeout(g,xc);else this._writing=!1,this.emit("error",v);return}this.emit("write",_);let w=Km(this._writingBuf,this._len,_);if(this._len=w.len,this._writingBuf=w.writingBuf,this._writingBuf.length){if(!this.sync){g();return}try{do{let E=m(),N=Km(this._writingBuf,this._len,E);this._len=N.len,this._writingBuf=N.writingBuf}while(this._writingBuf.length)}catch(E){this.release(E);return}}this._fsync&&Re.fsyncSync(this.fd);let $=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):$>this.minLength?this._actualWrite():this._ending?$>0?this._actualWrite():(this._writing=!1,$c(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(NN,this)):this.emit("drain"))},this.on("newListener",function(v){v==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function Km(e,t,r){return typeof e=="string"&&(e=Buffer.from(e)),t=Math.max(t-r,0),e=e.subarray(r),{writingBuf:e,len:t}}function NN(e){e.listenerCount("drain")>0&&(e._asyncDrainScheduled=!1,e.emit("drain"))}PN(Ht,EN);function $0(e,t){return e.length===0?wc:e.length===1?e[0]:Buffer.concat(e,t)}function CN(e){if(this.destroyed)throw new Error("SonicBoom destroyed");e=""+e;let t=Buffer.byteLength(e),r=this._len+t,i=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(i.length===0||Buffer.byteLength(i[i.length-1])+t>this.maxWrite?i.push(e):i[i.length-1]+=e,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function AN(e){if(this.destroyed)throw new Error("SonicBoom destroyed");let t=this._len+e.length,r=this._bufs,i=this._lens;return this.maxLength&&t>this.maxLength?(this.emit("drop",e),this._len<this._hwm):(r.length===0||i[i.length-1]+e.length>this.maxWrite?(r.push([e]),i.push(e.length)):(r[r.length-1].push(e),i[i.length-1]+=e.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function k0(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{Re.fsync(this.fd,i=>{this._flushPending=!1,e(i)})}catch(i){e(i)}this.off("error",r)},r=i=>{this._flushPending=!1,e(i),this.off("drain",t)};this.once("drain",t),this.once("error",r)}function MN(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&k0.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function UN(e){if(e!=null&&typeof e!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(e){e(t);return}throw t}if(this.minLength<=0){e?.();return}e&&k0.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}Ht.prototype.reopen=function(e){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(e)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(e&&(this.file=e),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&Re.close(t,r=>{if(r)return this.emit("error",r)})}),w0(this.file,this)};Ht.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():$c(this)))};function LN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let e="";for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?Re.writeSync(this.fd,e):Re.writeSync(this.fd,e,"utf8"),r=Km(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Qm(xc)}}try{Re.fsyncSync(this.fd)}catch{}}function qN(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=wc);let e=wc;for(;this._bufs.length||e.length;){e.length<=0&&(e=$0(this._bufs[0],this._lens[0]));try{let t=Re.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;Qm(xc)}}}Ht.prototype.destroy=function(){this.destroyed||$c(this)};function ZN(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?Re.writeSync(this.fd,this._writingBuf):Re.writeSync(this.fd,this._writingBuf,"utf8");e(null,t)}catch(t){e(t)}else Re.write(this.fd,this._writingBuf,e)}function FN(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:$0(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=Re.writeSync(this.fd,this._writingBuf);e(null,t)}catch(t){e(t)}else DN&&(this._writingBuf=Buffer.from(this._writingBuf)),Re.write(this.fd,this._writingBuf,e)}function $c(e){if(e.fd===-1){e.once("ready",$c.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],zN(typeof e.fd=="number",`sonic.fd must be a number, got ${typeof e.fd}`);try{Re.fsync(e.fd,t)}catch{}function t(){e.fd!==1&&e.fd!==2?Re.close(e.fd,r):r()}function r(i){if(i){e.emit("error",i);return}e._ending&&!e._writing&&e.emit("finish"),e.emit("close")}}Ht.SonicBoom=Ht;Ht.default=Ht;T0.exports=Ht});var Ym=I((EJ,O0)=>{"use strict";var Wt={exit:[],beforeExit:[]},E0={exit:HN,beforeExit:WN},bi;function VN(){bi===void 0&&(bi=new FinalizationRegistry(JN))}function BN(e){Wt[e].length>0||process.on(e,E0[e])}function P0(e){Wt[e].length>0||(process.removeListener(e,E0[e]),Wt.exit.length===0&&Wt.beforeExit.length===0&&(bi=void 0))}function HN(){z0("exit")}function WN(){z0("beforeExit")}function z0(e){for(let t of Wt[e]){let r=t.deref(),i=t.fn;r!==void 0&&i(r,e)}Wt[e]=[]}function JN(e){for(let t of["exit","beforeExit"]){let r=Wt[t].indexOf(e);Wt[t].splice(r,r+1),P0(t)}}function R0(e,t,r){if(t===void 0)throw new Error("the object can't be undefined");BN(e);let i=new WeakRef(t);i.fn=r,VN(),bi.register(t,i),Wt[e].push(i)}function GN(e,t){R0("exit",e,t)}function KN(e,t){R0("beforeExit",e,t)}function QN(e){if(bi!==void 0){bi.unregister(e);for(let t of["exit","beforeExit"])Wt[t]=Wt[t].filter(r=>{let i=r.deref();return i&&i!==e}),P0(t)}}O0.exports={register:GN,registerBeforeExit:KN,unregister:QN}});var j0=I((PJ,YN)=>{YN.exports={name:"thread-stream",version:"4.0.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^22.0.0","@yao-pkg/pkg":"^6.0.0",borp:"^0.21.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",husky:"^9.0.6",neostandard:"^0.12.2","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:"npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:ci":"npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'","test:yarn":"npm run transpile && borp --pattern 'test/*.test.js'",transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var N0=I((zJ,D0)=>{"use strict";function XN(e,t,r,i,n){let o=i===1/0?1/0:Date.now()+i,a=()=>{let s=Atomics.load(e,t);if(s===r){n(null,"ok");return}if(o!==1/0&&Date.now()>o){n(null,"timed-out");return}let c=o===1/0?1e4:Math.min(1e4,Math.max(1,o-Date.now())),u=Atomics.waitAsync(e,t,s,c);u.async?u.value.then(a):setImmediate(a)};a()}function eC(e,t,r,i,n){let o=i===1/0?1/0:Date.now()+i,a=()=>{if(Atomics.load(e,t)!==r){n(null,"ok");return}if(o!==1/0&&Date.now()>o){n(null,"timed-out");return}let c=o===1/0?1e4:Math.min(1e4,Math.max(1,o-Date.now())),u=Atomics.waitAsync(e,t,r,c);u.async?u.value.then(a):setImmediate(a)};a()}D0.exports={wait:XN,waitDiff:eC}});var A0=I((RJ,C0)=>{"use strict";C0.exports={WRITE_INDEX:4,READ_INDEX:8}});var Z0=I((OJ,q0)=>{"use strict";var{version:tC}=j0(),{EventEmitter:rC}=ie("events"),{Worker:nC}=ie("worker_threads"),{join:iC}=ie("path"),{pathToFileURL:oC}=ie("url"),{wait:aC}=N0(),{WRITE_INDEX:yt,READ_INDEX:gt}=A0(),sC=ie("buffer"),cC=ie("assert"),k=Symbol("kImpl"),lC=sC.constants.MAX_STRING_LENGTH,Ko=class{constructor(t){this._value=t}deref(){return this._value}},Tc=class{register(){}unregister(){}},uC=process.env.NODE_V8_COVERAGE?Tc:global.FinalizationRegistry||Tc,dC=process.env.NODE_V8_COVERAGE?Ko:global.WeakRef||Ko,M0=new uC(e=>{e.exited||e.terminate()});function pC(e,t){let{filename:r,workerData:i}=t,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||iC(__dirname,"lib","worker.js"),a=new nC(o,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:oC(r).href,dataBuf:e[k].dataBuf,stateBuf:e[k].stateBuf,workerData:{$context:{threadStreamVersion:tC},...i}}});return a.stream=new Ko(e),a.on("message",mC),a.on("exit",L0),M0.register(e,a),a}function U0(e){cC(!e[k].sync),e[k].needDrain&&(e[k].needDrain=!1,e.emit("drain"))}function kc(e){let t=Atomics.load(e[k].state,yt),r=e[k].data.length-t;if(r>0){if(e[k].buf.length===0){e[k].flushing=!1,e[k].ending?nf(e):e[k].needDrain&&process.nextTick(U0,e);return}let i=e[k].buf.slice(0,r),n=Buffer.byteLength(i);n<=r?(e[k].buf=e[k].buf.slice(r),Ic(e,i,kc.bind(null,e))):e.flush(()=>{if(!e.destroyed){for(Atomics.store(e[k].state,gt,0),Atomics.store(e[k].state,yt,0),Atomics.notify(e[k].state,gt);n>e[k].data.length;)r=r/2,i=e[k].buf.slice(0,r),n=Buffer.byteLength(i);e[k].buf=e[k].buf.slice(r),Ic(e,i,kc.bind(null,e))}})}else if(r===0){if(t===0&&e[k].buf.length===0)return;e.flush(()=>{Atomics.store(e[k].state,gt,0),Atomics.store(e[k].state,yt,0),Atomics.notify(e[k].state,gt),kc(e)})}else ur(e,new Error("overwritten"))}function mC(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}switch(e.code){case"READY":this.stream=new dC(t),t.flush(()=>{t[k].ready=!0,t.emit("ready")});break;case"ERROR":ur(t,e.err);break;case"EVENT":Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case"WARNING":process.emitWarning(e.err);break;default:ur(t,new Error("this should not happen: "+e.code))}}function L0(e){let t=this.stream.deref();t!==void 0&&(M0.unregister(t),t.worker.exited=!0,t.worker.off("exit",L0),ur(t,e!==0?new Error("the worker thread exited"):null))}var ef=class extends rC{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[k]={},this[k].stateBuf=new SharedArrayBuffer(128),this[k].state=new Int32Array(this[k].stateBuf),this[k].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[k].data=Buffer.from(this[k].dataBuf),this[k].sync=t.sync||!1,this[k].ending=!1,this[k].ended=!1,this[k].needDrain=!1,this[k].destroyed=!1,this[k].flushing=!1,this[k].ready=!1,this[k].finished=!1,this[k].errored=null,this[k].closed=!1,this[k].buf="",this.worker=pC(this,t),this.on("message",(r,i)=>{this.worker.postMessage(r,i)})}write(t){if(this[k].destroyed)return tf(this,new Error("the worker has exited")),!1;if(this[k].ending)return tf(this,new Error("the worker is ending")),!1;if(this[k].flushing&&this[k].buf.length+t.length>=lC)try{Xm(this),this[k].flushing=!0}catch(r){return ur(this,r),!1}if(this[k].buf+=t,this[k].sync)try{return Xm(this),!0}catch(r){return ur(this,r),!1}return this[k].flushing||(this[k].flushing=!0,setImmediate(kc,this)),this[k].needDrain=this[k].data.length-this[k].buf.length-Atomics.load(this[k].state,yt)<=0,!this[k].needDrain}end(){this[k].destroyed||(this[k].ending=!0,nf(this))}flush(t){if(this[k].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let r=Atomics.load(this[k].state,yt);aC(this[k].state,gt,r,1/0,(i,n)=>{if(i){ur(this,i),process.nextTick(t,i);return}if(n==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[k].destroyed||(Xm(this),rf(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[k].ready}get destroyed(){return this[k].destroyed}get closed(){return this[k].closed}get writable(){return!this[k].destroyed&&!this[k].ending}get writableEnded(){return this[k].ending}get writableFinished(){return this[k].finished}get writableNeedDrain(){return this[k].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[k].errored}};function tf(e,t){setImmediate(()=>{e.emit("error",t)})}function ur(e,t){e[k].destroyed||(e[k].destroyed=!0,t&&(e[k].errored=t,tf(e,t)),e.worker.exited?setImmediate(()=>{e[k].closed=!0,e.emit("close")}):e.worker.terminate().catch(()=>{}).then(()=>{e[k].closed=!0,e.emit("close")}))}function Ic(e,t,r){let i=Atomics.load(e[k].state,yt),n=Buffer.byteLength(t);return e[k].data.write(t,i),Atomics.store(e[k].state,yt,i+n),Atomics.notify(e[k].state,yt),r(),!0}function nf(e){if(!(e[k].ended||!e[k].ending||e[k].flushing)){e[k].ended=!0;try{e.flushSync();let t=Atomics.load(e[k].state,gt);Atomics.store(e[k].state,yt,-1),Atomics.notify(e[k].state,yt);let r=0;for(;t!==-1;){if(Atomics.wait(e[k].state,gt,t,1e3),t=Atomics.load(e[k].state,gt),t===-2){ur(e,new Error("end() failed"));return}if(++r===10){ur(e,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{e[k].finished=!0,e.emit("finish")})}catch(t){ur(e,t)}}}function Xm(e){let t=()=>{e[k].ending?nf(e):e[k].needDrain&&process.nextTick(U0,e)};for(e[k].flushing=!1;e[k].buf.length!==0;){let r=Atomics.load(e[k].state,yt),i=e[k].data.length-r;if(i===0){rf(e),Atomics.store(e[k].state,gt,0),Atomics.store(e[k].state,yt,0),Atomics.notify(e[k].state,gt);continue}else if(i<0)throw new Error("overwritten");let n=e[k].buf.slice(0,i),o=Buffer.byteLength(n);if(o<=i)e[k].buf=e[k].buf.slice(i),Ic(e,n,t);else{for(rf(e),Atomics.store(e[k].state,gt,0),Atomics.store(e[k].state,yt,0),Atomics.notify(e[k].state,gt);o>e[k].buf.length;)i=i/2,n=e[k].buf.slice(0,i),o=Buffer.byteLength(n);e[k].buf=e[k].buf.slice(i),Ic(e,n,t)}}}function rf(e){if(e[k].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(e[k].state,yt),r=0;for(;;){let i=Atomics.load(e[k].state,gt);if(i===-2)throw Error("_flushSync failed");if(i!==t)Atomics.wait(e[k].state,gt,i,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}q0.exports=ef});var sf=I((jJ,B0)=>{"use strict";var{createRequire:fC}=ie("module"),{existsSync:hC}=ie("node:fs"),gC=Vm(),{join:of,isAbsolute:V0,sep:yC}=ie("node:path"),{fileURLToPath:vC}=ie("node:url"),bC=Gm(),af=Ym(),_C=Z0();function SC(e){af.register(e,TC),af.registerBeforeExit(e,IC),e.on("close",function(){af.unregister(e)})}function xC(){let e=process.execArgv;for(let t=0;t<e.length;t++){let r=e[t];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function wC(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let r=[],i=!1;for(let n=0;n<t.length;n++){let o=t[n];if(o==="--require"||o==="-r"||o==="--import"){let a=t[n+1];if(a&&F0(a)){i=!0,n++;continue}r.push(o),a&&(r.push(a),n++);continue}if(o.startsWith("--require=")||o.startsWith("-r=")||o.startsWith("--import=")){let a=o.slice(o.indexOf("=")+1);if(F0(a)){i=!0;continue}}r.push(o)}return i?r.join(" "):e}function F0(e){let t=$C(e);if(!t)return!1;let r=t;if(r.startsWith("file://"))try{r=vC(r)}catch{return!1}return V0(r)&&!hC(r)}function $C(e){let t=e[0],r=e[e.length-1];return t==='"'&&r==='"'||t==="'"&&r==="'"?e.slice(1,-1):e}function kC(e,t,r,i,n){if(!r.execArgv&&xC()&&ie.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=wC(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:n};let o=new _C({filename:e,workerData:t,workerOpts:r,sync:i});o.on("ready",a),o.on("close",function(){process.removeListener("exit",s)}),process.on("exit",s);function a(){process.removeListener("exit",s),o.unref(),r.autoEnd!==!1&&SC(o)}function s(){o.closed||(o.flushSync(),bC(100),o.end())}return o}function TC(e){e.ref(),e.flushSync(),e.end(),e.once("close",function(){e.unref()})}function IC(e){e.flushSync()}function EC(e){let{pipeline:t,targets:r,levels:i,dedupe:n,worker:o={},caller:a=gC(),sync:s=!1}=e,c={...e.options},u=typeof a=="string"?[a]:a,d=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),p=e.target;if(p&&r)throw new Error("only one of target or targets can be specified");r?(p=d["pino-worker"]||of(__dirname,"worker.js"),c.targets=r.filter(m=>m.target).map(m=>({...m,target:h(m.target)})),c.pipelines=r.filter(m=>m.pipeline).map(m=>m.pipeline.map(g=>({...g,level:m.level,target:h(g.target)})))):t&&(p=d["pino-worker"]||of(__dirname,"worker.js"),c.pipelines=[t.map(m=>({...m,target:h(m.target)}))]),i&&(c.levels=i),n&&(c.dedupe=n),c.pinoWillSendConfig=!0;let f=r||t?"pino.transport":p;return kC(h(p),c,o,s,f);function h(m){if(m=d[m]||m,V0(m)||m.indexOf("file://")===0)return m;if(m==="pino/file")return of(__dirname,"..","file.js");let g;for(let v of u)try{let _=v==="node:repl"?process.cwd()+yC:v;g=fC(_).resolve(m);break}catch{continue}if(!g)throw new Error(`unable to determine transport target for "${m}"`);return g}}B0.exports=EC});var zc=I((NJ,i$)=>{"use strict";var PC=ie("node:diagnostics_channel"),H0=b0(),{mapHttpRequest:zC,mapHttpResponse:RC}=Fm(),lf=I0(),W0=Ym(),{lsCacheSym:OC,chindingsSym:Y0,writeSym:J0,serializersSym:X0,formatOptsSym:G0,endSym:jC,stringifiersSym:e$,stringifySym:t$,stringifySafeSym:uf,wildcardFirstSym:r$,nestedKeySym:DC,formattersSym:n$,messageKeySym:NC,errorKeySym:CC,nestedKeyStrSym:AC,msgPrefixSym:Ec}=vi(),{isMainThread:MC}=ie("worker_threads"),UC=sf(),[LC]=process.versions.node.split(".").map(e=>Number(e)),K0=PC.tracingChannel("pino_asJson"),cf=LC>=25?e=>JSON.stringify(e):ZC;function _i(){}function qC(e,t){if(!t)return r;return function(...n){t.call(this,n,r,e)};function r(i,...n){if(typeof i=="object"){let o=i;i!==null&&(i.method&&i.headers&&i.socket?i=zC(i):typeof i.setHeader=="function"&&(i=RC(i)));let a;o===null&&n.length===0?a=[null]:(o=n.shift(),a=n),typeof this[Ec]=="string"&&o!==void 0&&o!==null&&(o=this[Ec]+o),this[J0](i,H0(o,a,this[G0]),e)}else{let o=i===void 0?n.shift():i;typeof this[Ec]=="string"&&o!==void 0&&o!==null&&(o=this[Ec]+o),this[J0](null,H0(o,n,this[G0]),e)}}}function ZC(e){let t="",r=0,i=!1,n=255,o=e.length;if(o>100)return JSON.stringify(e);for(var a=0;a<o&&n>=32;a++)n=e.charCodeAt(a),(n===34||n===92)&&(t+=e.slice(r,a)+"\\",r=a,i=!0);return i?t+=e.slice(r):t=e,n<32?JSON.stringify(e):'"'+t+'"'}function FC(e,t,r,i){if(K0.hasSubscribers===!1)return Q0.call(this,e,t,r,i);let n={instance:this,arguments};return K0.traceSync(Q0,n,this,e,t,r,i)}function Q0(e,t,r,i){let n=this[t$],o=this[uf],a=this[e$],s=this[jC],c=this[Y0],u=this[X0],d=this[n$],p=this[NC],f=this[CC],h=this[OC][r]+i;h=h+c;let m;d.log&&(e=d.log(e));let g=a[r$],v="";for(let w in e)if(m=e[w],Object.prototype.hasOwnProperty.call(e,w)&&m!==void 0){u[w]?m=u[w](m):w===f&&u.err&&(m=u.err(m));let $=a[w]||g;switch(typeof m){case"undefined":case"function":continue;case"number":Number.isFinite(m)===!1&&(m=null);case"boolean":$&&(m=$(m));break;case"string":m=($||cf)(m);break;default:m=($||n)(m,o)}if(m===void 0)continue;let E=cf(w);v+=","+E+":"+m}let _="";if(t!==void 0){m=u[p]?u[p](t):t;let w=a[p]||g;switch(typeof m){case"function":break;case"number":Number.isFinite(m)===!1&&(m=null);case"boolean":w&&(m=w(m)),_=',"'+p+'":'+m;break;case"string":m=(w||cf)(m),_=',"'+p+'":'+m;break;default:m=(w||n)(m,o),_=',"'+p+'":'+m}}return this[DC]&&v?h+this[AC]+v.slice(1)+"}"+_+s:h+v+_+s}function VC(e,t){let r,i=e[Y0],n=e[t$],o=e[uf],a=e[e$],s=a[r$],c=e[X0],u=e[n$].bindings;t=u(t);for(let d in t)if(r=t[d],((d.length<5||d!=="level"&&d!=="serializers"&&d!=="formatters"&&d!=="customLevels")&&t.hasOwnProperty(d)&&r!==void 0)===!0){if(r=c[d]?c[d](r):r,r=(a[d]||s||n)(r,o),r===void 0)continue;i+=',"'+d+'":'+r}return i}function BC(e){return e.write!==e.constructor.prototype.write}function Pc(e){let t=new lf(e);return t.on("error",r),!e.sync&&MC&&(W0.register(t,HC),t.on("close",function(){W0.unregister(t)})),t;function r(i){if(i.code==="EPIPE"){t.write=_i,t.end=_i,t.flushSync=_i,t.destroy=_i;return}t.removeListener("error",r),t.emit("error",i)}}function HC(e,t){e.destroyed||(t==="beforeExit"?(e.flush(),e.on("drain",function(){e.end()})):e.flushSync())}function WC(e){return function(r,i,n={},o){if(typeof n=="string")o=Pc({dest:n}),n={};else if(typeof o=="string"){if(n&&n.transport)throw Error("only one of option.transport or stream can be specified");o=Pc({dest:o})}else if(n instanceof lf||n.writable||n._writableState)o=n,n={};else if(n.transport){if(n.transport instanceof lf||n.transport.writable||n.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(n.transport.targets&&n.transport.targets.length&&n.formatters&&typeof n.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;n.customLevels&&(c=n.useOnlyCustomLevels?n.customLevels:Object.assign({},n.levels,n.customLevels)),o=UC({caller:i,...n.transport,levels:c})}if(n=Object.assign({},e,n),n.serializers=Object.assign({},e.serializers,n.serializers),n.formatters=Object.assign({},e.formatters,n.formatters),n.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:a,onChild:s}=n;return a===!1&&(n.level="silent"),s||(n.onChild=_i),o||(BC(process.stdout)?o=process.stdout:o=Pc({fd:process.stdout.fd||1})),{opts:n,stream:o}}}function JC(e,t){try{return JSON.stringify(e)}catch{try{return(t||this[uf])(e)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function GC(e,t,r){return{level:e,bindings:t,log:r}}function KC(e){let t=Number(e);return typeof e=="string"&&Number.isFinite(t)?t:e===void 0?1:e}i$.exports={noop:_i,buildSafeSonicBoom:Pc,asChindings:VC,asJson:FC,genLog:qC,createArgsNormalizer:WC,stringify:JC,buildFormatters:GC,normalizeDestFileDescriptor:KC}});var Rc=I((CJ,o$)=>{var QC={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},YC={ASC:"ASC",DESC:"DESC"};o$.exports={DEFAULT_LEVELS:QC,SORTING_ORDER:YC}});var mf=I((AJ,l$)=>{"use strict";var{lsCacheSym:XC,levelValSym:df,useOnlyCustomLevelsSym:eA,streamSym:tA,formattersSym:rA,hooksSym:nA,levelCompSym:a$}=vi(),{noop:iA,genLog:En}=zc(),{DEFAULT_LEVELS:dr,SORTING_ORDER:s$}=Rc(),c$={fatal:e=>{let t=En(dr.fatal,e);return function(...r){let i=this[tA];if(t.call(this,...r),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:e=>En(dr.error,e),warn:e=>En(dr.warn,e),info:e=>En(dr.info,e),debug:e=>En(dr.debug,e),trace:e=>En(dr.trace,e)},pf=Object.keys(dr).reduce((e,t)=>(e[dr[t]]=t,e),{}),oA=Object.keys(pf).reduce((e,t)=>(e[t]='{"level":'+Number(t),e),{});function aA(e){let t=e[rA].level,{labels:r}=e.levels,i={};for(let n in r){let o=t(r[n],Number(n));i[n]=JSON.stringify(o).slice(0,-1)}return e[XC]=i,e}function sA(e,t){if(t)return!1;switch(e){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function cA(e){let{labels:t,values:r}=this.levels;if(typeof e=="number"){if(t[e]===void 0)throw Error("unknown level value"+e);e=t[e]}if(r[e]===void 0)throw Error("unknown level "+e);let i=this[df],n=this[df]=r[e],o=this[eA],a=this[a$],s=this[nA].logMethod;for(let c in r){if(a(r[c],n)===!1){this[c]=iA;continue}this[c]=sA(c,o)?c$[c](s):En(r[c],s)}this.emit("level-change",e,n,t[i],i,this)}function lA(e){let{levels:t,levelVal:r}=this;return t&&t.labels?t.labels[r]:""}function uA(e){let{values:t}=this.levels,r=t[e];return r!==void 0&&this[a$](r,this[df])}function dA(e,t,r){return e===s$.DESC?t<=r:t>=r}function pA(e){return typeof e=="string"?dA.bind(null,e):e}function mA(e=null,t=!1){let r=e?Object.keys(e).reduce((o,a)=>(o[e[a]]=a,o),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:pf,r),n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:dr,e);return{labels:i,values:n}}function fA(e,t,r){if(typeof e=="number"){if(![].concat(Object.keys(t||{}).map(o=>t[o]),r?[]:Object.keys(pf).map(o=>+o),1/0).includes(e))throw Error(`default level:${e} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:dr,t);if(!(e in i))throw Error(`default level:${e} must be included in custom levels`)}function hA(e,t){let{labels:r,values:i}=e;for(let n in t){if(n in i)throw Error("levels cannot be overridden");if(t[n]in r)throw Error("pre-existing level values cannot be used for new levels")}}function gA(e){if(typeof e!="function"&&!(typeof e=="string"&&Object.values(s$).includes(e)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}l$.exports={initialLsCache:oA,genLsCache:aA,levelMethods:c$,getLevel:lA,setLevel:cA,isLevelEnabled:uA,mappings:mA,assertNoLevelCollisions:hA,assertDefaultLevelFound:fA,genLevelComparison:pA,assertLevelComparison:gA}});var ff=I((MJ,u$)=>{"use strict";u$.exports={version:"10.3.1"}});var v$=I((LJ,y$)=>{"use strict";var{EventEmitter:yA}=ie("node:events"),{lsCacheSym:vA,levelValSym:bA,setLevelSym:gf,getLevelSym:d$,chindingsSym:jc,mixinSym:_A,asJsonSym:m$,writeSym:SA,mixinMergeStrategySym:xA,timeSym:wA,timeSliceIndexSym:$A,streamSym:f$,serializersSym:Pn,formattersSym:Qo,errorKeySym:kA,messageKeySym:TA,useOnlyCustomLevelsSym:IA,needsMetadataGsym:EA,redactFmtSym:PA,stringifySym:zA,formatOptsSym:RA,stringifiersSym:OA,msgPrefixSym:yf,hooksSym:jA}=vi(),{getLevel:DA,setLevel:NA,isLevelEnabled:CA,mappings:AA,initialLsCache:MA,genLsCache:UA,assertNoLevelCollisions:LA}=mf(),{asChindings:vf,asJson:qA,buildFormatters:hf,stringify:p$,noop:h$}=zc(),{version:ZA}=ff(),FA=Wm(),VA=class{},g$={constructor:VA,child:BA,bindings:HA,setBindings:WA,flush:KA,isLevelEnabled:CA,version:ZA,get level(){return this[d$]()},set level(e){this[gf](e)},get levelVal(){return this[bA]},set levelVal(e){throw Error("levelVal is read-only")},get msgPrefix(){return this[yf]},get[Symbol.toStringTag](){return"Pino"},[vA]:MA,[SA]:GA,[m$]:qA,[d$]:DA,[gf]:NA};Object.setPrototypeOf(g$,yA.prototype);y$.exports=function(){return Object.create(g$)};var Oc=e=>e;function BA(e,t){if(!e)throw Error("missing bindings for child Pino");let r=this[Pn],i=this[Qo],n=Object.create(this);if(t==null)return n[Qo].bindings!==Oc&&(n[Qo]=hf(i.level,Oc,i.log)),n[jc]=vf(n,e),this.onChild!==h$&&this.onChild(n),n;if(t.hasOwnProperty("serializers")===!0){n[Pn]=Object.create(null);for(let u in r)n[Pn][u]=r[u];let s=Object.getOwnPropertySymbols(r);for(var o=0;o<s.length;o++){let u=s[o];n[Pn][u]=r[u]}for(let u in t.serializers)n[Pn][u]=t.serializers[u];let c=Object.getOwnPropertySymbols(t.serializers);for(var a=0;a<c.length;a++){let u=c[a];n[Pn][u]=t.serializers[u]}}else n[Pn]=r;if(t.hasOwnProperty("formatters")){let{level:s,bindings:c,log:u}=t.formatters;n[Qo]=hf(s||i.level,c||Oc,u||i.log)}else n[Qo]=hf(i.level,Oc,i.log);if(t.hasOwnProperty("customLevels")===!0&&(LA(this.levels,t.customLevels),n.levels=AA(t.customLevels,n[IA]),UA(n)),typeof t.redact=="object"&&t.redact!==null||Array.isArray(t.redact)){n.redact=t.redact;let s=FA(n.redact,p$),c={stringify:s[PA]};n[zA]=p$,n[OA]=s,n[RA]=c}if(typeof t.msgPrefix=="string"&&(n[yf]=(this[yf]||"")+t.msgPrefix),n[jc]=vf(n,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty("customLevels")){let s=t.level||this.level;n[gf](s)}return this.onChild(n),n}function HA(){let t=`{${this[jc].substr(1)}}`,r=JSON.parse(t);return delete r.pid,delete r.hostname,r}function WA(e){let t=vf(this,e);this[jc]=t}function JA(e,t){return Object.assign(t,e)}function GA(e,t,r){let i=this[wA](),n=this[_A],o=this[kA],a=this[TA],s=this[xA]||JA,c,u=this[jA].streamWrite;e==null?c={}:e instanceof Error?(c={[o]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[a]===void 0&&e[o]&&(t=e[o].message)),n&&(c=s(c,n(c,r,this)));let d=this[m$](c,t,r,i),p=this[f$];p[EA]===!0&&(p.lastLevel=r,p.lastObj=c,p.lastMsg=t,p.lastTime=i.slice(this[$A]),p.lastLogger=this),p.write(u?u(d):d)}function KA(e){if(e!=null&&typeof e!="function")throw Error("callback must be a function");let t=this[f$];typeof t.flush=="function"?t.flush(e||h$):e&&e()}});var x$=I((xf,S$)=>{"use strict";var{hasOwnProperty:Yo}=Object.prototype,Rn=Sf();Rn.configure=Sf;Rn.stringify=Rn;Rn.default=Rn;xf.stringify=Rn;xf.configure=Sf;S$.exports=Rn;var QA=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function Br(e){return e.length<5e3&&!QA.test(e)?`"${e}"`:JSON.stringify(e)}function bf(e,t){if(e.length>200||t)return e.sort(t);for(let r=1;r<e.length;r++){let i=e[r],n=r;for(;n!==0&&e[n-1]>i;)e[n]=e[n-1],n--;e[n]=i}return e}var YA=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function _f(e){return YA.call(e)!==void 0&&e.length!==0}function b$(e,t,r){e.length<r&&(r=e.length);let i=t===","?"":" ",n=`"0":${i}${e[0]}`;for(let o=1;o<r;o++)n+=`${t}"${o}":${i}${e[o]}`;return n}function XA(e){if(Yo.call(e,"circularValue")){let t=e.circularValue;if(typeof t=="string")return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function eM(e){let t;if(Yo.call(e,"deterministic")&&(t=e.deterministic,typeof t!="boolean"&&typeof t!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return t===void 0?!0:t}function tM(e,t){let r;if(Yo.call(e,t)&&(r=e[t],typeof r!="boolean"))throw new TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function _$(e,t){let r;if(Yo.call(e,t)){if(r=e[t],typeof r!="number")throw new TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${t}" argument must be an integer`);if(r<1)throw new RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function zn(e){return e===1?"1 item":`${e} items`}function rM(e){let t=new Set;for(let r of e)(typeof r=="string"||typeof r=="number")&&t.add(String(r));return t}function nM(e){if(Yo.call(e,"strict")){let t=e.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return r=>{let i=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(i+=` (${r.toString()})`),new Error(i)}}}function Sf(e){e={...e};let t=nM(e);t&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let r=XA(e),i=tM(e,"bigint"),n=eM(e),o=typeof n=="function"?n:void 0,a=_$(e,"maximumDepth"),s=_$(e,"maximumBreadth");function c(h,m,g,v,_,w){let $=m[h];switch(typeof $=="object"&&$!==null&&typeof $.toJSON=="function"&&($=$.toJSON(h)),$=v.call(m,h,$),typeof $){case"string":return Br($);case"object":{if($===null)return"null";if(g.indexOf($)!==-1)return r;let E="",N=",",de=w;if(Array.isArray($)){if($.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push($),_!==""&&(w+=_,E+=`
5
5
  ${w}`,N=`,
6
- ${w}`);let Me=Math.min($.length,s),st=0;for(;st<Me-1;st++){let kn=l(String(st),$,g,v,_,w);E+=kn!==void 0?kn:"null",E+=N}let ft=l(String(st),$,g,v,_,w);if(E+=ft!==void 0?ft:"null",$.length-1>s){let kn=$.length-s-1;E+=`${N}"... ${En(kn)} not stringified"`}return _!==""&&(E+=`
6
+ ${w}`);let Le=Math.min($.length,s),ct=0;for(;ct<Le-1;ct++){let In=c(String(ct),$,g,v,_,w);E+=In!==void 0?In:"null",E+=N}let ht=c(String(ct),$,g,v,_,w);if(E+=ht!==void 0?ht:"null",$.length-1>s){let In=$.length-s-1;E+=`${N}"... ${zn(In)} not stringified"`}return _!==""&&(E+=`
7
7
  ${de}`),g.pop(),`[${E}]`}let Y=Object.keys($),be=Y.length;if(be===0)return"{}";if(a<g.length+1)return'"[Object]"';let ee="",Pe="";_!==""&&(w+=_,N=`,
8
- ${w}`,ee=" ");let Fe=Math.min(be,s);n&&!yf($)&&(Y=gf(Y,o)),g.push($);for(let Me=0;Me<Fe;Me++){let st=Y[Me],ft=l(st,$,g,v,_,w);ft!==void 0&&(E+=`${Pe}${Fr(st)}:${ee}${ft}`,Pe=N)}if(be>s){let Me=be-s;E+=`${Pe}"...":${ee}"${En(Me)} not stringified"`,Pe=N}return _!==""&&Pe.length>1&&(E=`
8
+ ${w}`,ee=" ");let Be=Math.min(be,s);n&&!_f($)&&(Y=bf(Y,o)),g.push($);for(let Le=0;Le<Be;Le++){let ct=Y[Le],ht=c(ct,$,g,v,_,w);ht!==void 0&&(E+=`${Pe}${Br(ct)}:${ee}${ht}`,Pe=N)}if(be>s){let Le=be-s;E+=`${Pe}"...":${ee}"${zn(Le)} not stringified"`,Pe=N}return _!==""&&Pe.length>1&&(E=`
9
9
  ${w}${E}
10
- ${de}`),g.pop(),`{${E}}`}case"number":return isFinite($)?String($):t?t($):"null";case"boolean":return $===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String($);default:return t?t($):void 0}}function u(h,m,g,v,_,w){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(h)),typeof m){case"string":return Fr(m);case"object":{if(m===null)return"null";if(g.indexOf(m)!==-1)return r;let $=w,E="",N=",";if(Array.isArray(m)){if(m.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(m),_!==""&&(w+=_,E+=`
10
+ ${de}`),g.pop(),`{${E}}`}case"number":return isFinite($)?String($):t?t($):"null";case"boolean":return $===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String($);default:return t?t($):void 0}}function u(h,m,g,v,_,w){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(h)),typeof m){case"string":return Br(m);case"object":{if(m===null)return"null";if(g.indexOf(m)!==-1)return r;let $=w,E="",N=",";if(Array.isArray(m)){if(m.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(m),_!==""&&(w+=_,E+=`
11
11
  ${w}`,N=`,
12
- ${w}`);let be=Math.min(m.length,s),ee=0;for(;ee<be-1;ee++){let Fe=u(String(ee),m[ee],g,v,_,w);E+=Fe!==void 0?Fe:"null",E+=N}let Pe=u(String(ee),m[ee],g,v,_,w);if(E+=Pe!==void 0?Pe:"null",m.length-1>s){let Fe=m.length-s-1;E+=`${N}"... ${En(Fe)} not stringified"`}return _!==""&&(E+=`
12
+ ${w}`);let be=Math.min(m.length,s),ee=0;for(;ee<be-1;ee++){let Be=u(String(ee),m[ee],g,v,_,w);E+=Be!==void 0?Be:"null",E+=N}let Pe=u(String(ee),m[ee],g,v,_,w);if(E+=Pe!==void 0?Pe:"null",m.length-1>s){let Be=m.length-s-1;E+=`${N}"... ${zn(Be)} not stringified"`}return _!==""&&(E+=`
13
13
  ${$}`),g.pop(),`[${E}]`}g.push(m);let de="";_!==""&&(w+=_,N=`,
14
- ${w}`,de=" ");let Y="";for(let be of v){let ee=u(be,m[be],g,v,_,w);ee!==void 0&&(E+=`${Y}${Fr(be)}:${de}${ee}`,Y=N)}return _!==""&&Y.length>1&&(E=`
14
+ ${w}`,de=" ");let Y="";for(let be of v){let ee=u(be,m[be],g,v,_,w);ee!==void 0&&(E+=`${Y}${Br(be)}:${de}${ee}`,Y=N)}return _!==""&&Y.length>1&&(E=`
15
15
  ${w}${E}
16
- ${$}`),g.pop(),`{${E}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(m);default:return t?t(m):void 0}}function d(h,m,g,v,_){switch(typeof m){case"string":return Fr(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(h),typeof m!="object")return d(h,m,g,v,_);if(m===null)return"null"}if(g.indexOf(m)!==-1)return r;let w=_;if(Array.isArray(m)){if(m.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(m),_+=v;let ee=`
16
+ ${$}`),g.pop(),`{${E}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(m);default:return t?t(m):void 0}}function d(h,m,g,v,_){switch(typeof m){case"string":return Br(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(h),typeof m!="object")return d(h,m,g,v,_);if(m===null)return"null"}if(g.indexOf(m)!==-1)return r;let w=_;if(Array.isArray(m)){if(m.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(m),_+=v;let ee=`
17
17
  ${_}`,Pe=`,
18
- ${_}`,Fe=Math.min(m.length,s),Me=0;for(;Me<Fe-1;Me++){let ft=d(String(Me),m[Me],g,v,_);ee+=ft!==void 0?ft:"null",ee+=Pe}let st=d(String(Me),m[Me],g,v,_);if(ee+=st!==void 0?st:"null",m.length-1>s){let ft=m.length-s-1;ee+=`${Pe}"... ${En(ft)} not stringified"`}return ee+=`
18
+ ${_}`,Be=Math.min(m.length,s),Le=0;for(;Le<Be-1;Le++){let ht=d(String(Le),m[Le],g,v,_);ee+=ht!==void 0?ht:"null",ee+=Pe}let ct=d(String(Le),m[Le],g,v,_);if(ee+=ct!==void 0?ct:"null",m.length-1>s){let ht=m.length-s-1;ee+=`${Pe}"... ${zn(ht)} not stringified"`}return ee+=`
19
19
  ${w}`,g.pop(),`[${ee}]`}let $=Object.keys(m),E=$.length;if(E===0)return"{}";if(a<g.length+1)return'"[Object]"';_+=v;let N=`,
20
- ${_}`,de="",Y="",be=Math.min(E,s);yf(m)&&(de+=i$(m,N,s),$=$.slice(m.length),be-=m.length,Y=N),n&&($=gf($,o)),g.push(m);for(let ee=0;ee<be;ee++){let Pe=$[ee],Fe=d(Pe,m[Pe],g,v,_);Fe!==void 0&&(de+=`${Y}${Fr(Pe)}: ${Fe}`,Y=N)}if(E>s){let ee=E-s;de+=`${Y}"...": "${En(ee)} not stringified"`,Y=N}return Y!==""&&(de=`
20
+ ${_}`,de="",Y="",be=Math.min(E,s);_f(m)&&(de+=b$(m,N,s),$=$.slice(m.length),be-=m.length,Y=N),n&&($=bf($,o)),g.push(m);for(let ee=0;ee<be;ee++){let Pe=$[ee],Be=d(Pe,m[Pe],g,v,_);Be!==void 0&&(de+=`${Y}${Br(Pe)}: ${Be}`,Y=N)}if(E>s){let ee=E-s;de+=`${Y}"...": "${zn(ee)} not stringified"`,Y=N}return Y!==""&&(de=`
21
21
  ${_}${de}
22
- ${w}`),g.pop(),`{${de}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(m);default:return t?t(m):void 0}}function p(h,m,g){switch(typeof m){case"string":return Fr(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(h),typeof m!="object")return p(h,m,g);if(m===null)return"null"}if(g.indexOf(m)!==-1)return r;let v="",_=m.length!==void 0;if(_&&Array.isArray(m)){if(m.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(m);let de=Math.min(m.length,s),Y=0;for(;Y<de-1;Y++){let ee=p(String(Y),m[Y],g);v+=ee!==void 0?ee:"null",v+=","}let be=p(String(Y),m[Y],g);if(v+=be!==void 0?be:"null",m.length-1>s){let ee=m.length-s-1;v+=`,"... ${En(ee)} not stringified"`}return g.pop(),`[${v}]`}let w=Object.keys(m),$=w.length;if($===0)return"{}";if(a<g.length+1)return'"[Object]"';let E="",N=Math.min($,s);_&&yf(m)&&(v+=i$(m,",",s),w=w.slice(m.length),N-=m.length,E=","),n&&(w=gf(w,o)),g.push(m);for(let de=0;de<N;de++){let Y=w[de],be=p(Y,m[Y],g);be!==void 0&&(v+=`${E}${Fr(Y)}:${be}`,E=",")}if($>s){let de=$-s;v+=`${E}"...":"${En(de)} not stringified"`}return g.pop(),`{${v}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(m);default:return t?t(m):void 0}}function f(h,m,g){if(arguments.length>1){let v="";if(typeof g=="number"?v=" ".repeat(Math.min(g,10)):typeof g=="string"&&(v=g.slice(0,10)),m!=null){if(typeof m=="function")return l("",{"":h},[],m,v,"");if(Array.isArray(m))return u("",h,[],VA(m),v,"")}if(v.length!==0)return d("",h,[],v,"")}return p("",h,[])}return f}});var d$=T((fJ,u$)=>{"use strict";var _f=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:l$}=Pc(),HA=l$.info;function WA(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create(l$);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(p=>{r[p]=t.levels[p]});let i={write:n,add:s,remove:l,emit:o,flushSync:a,end:u,minLevel:0,lastId:0,streams:[],clone:d,[_f]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(s,i):s.call(i,e),e=null,i;function n(p){let f,h=this.lastLevel,{streams:m}=this,g=0,v;for(let _=JA(m.length,t.dedupe);KA(_,m.length,t.dedupe);_=GA(_,t.dedupe))if(f=m[_],f.level<=h){if(g!==0&&g!==f.level)break;if(v=f.stream,v[_f]){let{lastTime:w,lastMsg:$,lastObj:E,lastLogger:N}=this;v.lastLevel=h,v.lastTime=w,v.lastMsg=$,v.lastObj=E,v.lastLogger=N}v.write(p),t.dedupe&&(g=f.level)}else if(!t.dedupe)break}function o(...p){for(let{stream:f}of this.streams)typeof f.emit=="function"&&f.emit(...p)}function a(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync()}function s(p){if(!p)return i;let f=typeof p.write=="function"||p.stream,h=p.write?p:p.stream;if(!f)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:g}=this,v;typeof p.levelVal=="number"?v=p.levelVal:typeof p.level=="string"?v=g[p.level]:typeof p.level=="number"?v=p.level:v=HA;let _={stream:h,level:v,levelVal:void 0,id:++i.lastId};return m.unshift(_),m.sort(c$),this.minLevel=m[0].level,i}function l(p){let{streams:f}=this,h=f.findIndex(m=>m.id===p);return h>=0&&(f.splice(h,1),f.sort(c$),this.minLevel=f.length>0?f[0].level:-1),i}function u(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync(),p.end()}function d(p){let f=new Array(this.streams.length);for(let h=0;h<f.length;h++)f[h]={level:p,stream:this.streams[h].stream};return{write:n,add:s,remove:l,minLevel:p,streams:f,clone:d,emit:o,flushSync:a,[_f]:!0}}}function c$(e,t){return e.level-t.level}function JA(e,t){return t?e-1:0}function GA(e,t){return t?e-1:e+1}function KA(e,t,r){return r?e>=0:e<t}u$.exports=WA});var k$=T((hJ,Rt)=>{"use strict";var QA=ie("node:os"),b$=Lm(),YA=qm(),XA=Vm(),_$=r0(),eM=n$(),S$=yi(),{configure:tM}=s$(),{assertDefaultLevelFound:rM,mappings:x$,genLsCache:nM,genLevelComparison:iM,assertLevelComparison:oM}=uf(),{DEFAULT_LEVELS:w$,SORTING_ORDER:aM}=Pc(),{createArgsNormalizer:sM,asChindings:cM,buildSafeSonicBoom:p$,buildFormatters:lM,stringify:Sf,normalizeDestFileDescriptor:m$,noop:uM}=Ec(),{version:dM}=df(),{chindingsSym:f$,redactFmtSym:pM,serializersSym:h$,timeSym:mM,timeSliceIndexSym:fM,streamSym:hM,stringifySym:g$,stringifySafeSym:xf,stringifiersSym:y$,setLevelSym:gM,endSym:yM,formatOptsSym:vM,messageKeySym:bM,errorKeySym:_M,nestedKeySym:SM,mixinSym:xM,levelCompSym:wM,useOnlyCustomLevelsSym:$M,formattersSym:v$,hooksSym:kM,nestedKeyStrSym:TM,mixinMergeStrategySym:IM,msgPrefixSym:EM}=S$,{epochTime:$$,nullTime:PM}=_$,{pid:zM}=process,RM=QA.hostname(),OM=b$.err,jM={level:"info",levelComparison:aM.ASC,levels:w$,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:zM,hostname:RM},serializers:Object.assign(Object.create(null),{err:OM}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:$$,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},DM=sM(jM),NM=Object.assign(Object.create(null),b$);function wf(...e){let t={},{opts:r,stream:i}=DM(t,YA(),...e);r.level&&typeof r.level=="string"&&w$[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:n,crlf:o,serializers:a,timestamp:s,messageKey:l,errorKey:u,nestedKey:d,base:p,name:f,level:h,customLevels:m,levelComparison:g,mixin:v,mixinMergeStrategy:_,useOnlyCustomLevels:w,formatters:$,hooks:E,depthLimit:N,edgeLimit:de,onChild:Y,msgPrefix:be}=r,ee=tM({maximumDepth:N,maximumBreadth:de}),Pe=lM($.level,$.bindings,$.log),Fe=Sf.bind({[xf]:ee}),Me=n?XA(n,Fe):{},st=n?{stringify:Me[pM]}:{stringify:Fe},ft="}"+(o?`\r
22
+ ${w}`),g.pop(),`{${de}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(m);default:return t?t(m):void 0}}function p(h,m,g){switch(typeof m){case"string":return Br(m);case"object":{if(m===null)return"null";if(typeof m.toJSON=="function"){if(m=m.toJSON(h),typeof m!="object")return p(h,m,g);if(m===null)return"null"}if(g.indexOf(m)!==-1)return r;let v="",_=m.length!==void 0;if(_&&Array.isArray(m)){if(m.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(m);let de=Math.min(m.length,s),Y=0;for(;Y<de-1;Y++){let ee=p(String(Y),m[Y],g);v+=ee!==void 0?ee:"null",v+=","}let be=p(String(Y),m[Y],g);if(v+=be!==void 0?be:"null",m.length-1>s){let ee=m.length-s-1;v+=`,"... ${zn(ee)} not stringified"`}return g.pop(),`[${v}]`}let w=Object.keys(m),$=w.length;if($===0)return"{}";if(a<g.length+1)return'"[Object]"';let E="",N=Math.min($,s);_&&_f(m)&&(v+=b$(m,",",s),w=w.slice(m.length),N-=m.length,E=","),n&&(w=bf(w,o)),g.push(m);for(let de=0;de<N;de++){let Y=w[de],be=p(Y,m[Y],g);be!==void 0&&(v+=`${E}${Br(Y)}:${be}`,E=",")}if($>s){let de=$-s;v+=`${E}"...":"${zn(de)} not stringified"`}return g.pop(),`{${v}}`}case"number":return isFinite(m)?String(m):t?t(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(m);default:return t?t(m):void 0}}function f(h,m,g){if(arguments.length>1){let v="";if(typeof g=="number"?v=" ".repeat(Math.min(g,10)):typeof g=="string"&&(v=g.slice(0,10)),m!=null){if(typeof m=="function")return c("",{"":h},[],m,v,"");if(Array.isArray(m))return u("",h,[],rM(m),v,"")}if(v.length!==0)return d("",h,[],v,"")}return p("",h,[])}return f}});var T$=I((qJ,k$)=>{"use strict";var wf=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:$$}=Rc(),iM=$$.info;function oM(e,t){e=e||[],t=t||{dedupe:!1};let r=Object.create($$);r.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(p=>{r[p]=t.levels[p]});let i={write:n,add:s,remove:c,emit:o,flushSync:a,end:u,minLevel:0,lastId:0,streams:[],clone:d,[wf]:!0,streamLevels:r};return Array.isArray(e)?e.forEach(s,i):s.call(i,e),e=null,i;function n(p){let f,h=this.lastLevel,{streams:m}=this,g=0,v;for(let _=aM(m.length,t.dedupe);cM(_,m.length,t.dedupe);_=sM(_,t.dedupe))if(f=m[_],f.level<=h){if(g!==0&&g!==f.level)break;if(v=f.stream,v[wf]){let{lastTime:w,lastMsg:$,lastObj:E,lastLogger:N}=this;v.lastLevel=h,v.lastTime=w,v.lastMsg=$,v.lastObj=E,v.lastLogger=N}v.write(p),t.dedupe&&(g=f.level)}else if(!t.dedupe)break}function o(...p){for(let{stream:f}of this.streams)typeof f.emit=="function"&&f.emit(...p)}function a(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync()}function s(p){if(!p)return i;let f=typeof p.write=="function"||p.stream,h=p.write?p:p.stream;if(!f)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:g}=this,v;typeof p.levelVal=="number"?v=p.levelVal:typeof p.level=="string"?v=g[p.level]:typeof p.level=="number"?v=p.level:v=iM;let _={stream:h,level:v,levelVal:void 0,id:++i.lastId};return m.unshift(_),m.sort(w$),this.minLevel=m[0].level,i}function c(p){let{streams:f}=this,h=f.findIndex(m=>m.id===p);return h>=0&&(f.splice(h,1),f.sort(w$),this.minLevel=f.length>0?f[0].level:-1),i}function u(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync(),p.end()}function d(p){let f=new Array(this.streams.length);for(let h=0;h<f.length;h++)f[h]={level:p,stream:this.streams[h].stream};return{write:n,add:s,remove:c,minLevel:p,streams:f,clone:d,emit:o,flushSync:a,[wf]:!0}}}function w$(e,t){return e.level-t.level}function aM(e,t){return t?e-1:0}function sM(e,t){return t?e-1:e+1}function cM(e,t,r){return r?e>=0:e<t}k$.exports=oM});var L$=I((ZJ,Ot)=>{"use strict";var lM=ie("node:os"),D$=Fm(),uM=Vm(),dM=Wm(),N$=y0(),pM=v$(),C$=vi(),{configure:mM}=x$(),{assertDefaultLevelFound:fM,mappings:A$,genLsCache:hM,genLevelComparison:gM,assertLevelComparison:yM}=mf(),{DEFAULT_LEVELS:M$,SORTING_ORDER:vM}=Rc(),{createArgsNormalizer:bM,asChindings:_M,buildSafeSonicBoom:I$,buildFormatters:SM,stringify:$f,normalizeDestFileDescriptor:E$,noop:xM}=zc(),{version:wM}=ff(),{chindingsSym:P$,redactFmtSym:$M,serializersSym:z$,timeSym:kM,timeSliceIndexSym:TM,streamSym:IM,stringifySym:R$,stringifySafeSym:kf,stringifiersSym:O$,setLevelSym:EM,endSym:PM,formatOptsSym:zM,messageKeySym:RM,errorKeySym:OM,nestedKeySym:jM,mixinSym:DM,levelCompSym:NM,useOnlyCustomLevelsSym:CM,formattersSym:j$,hooksSym:AM,nestedKeyStrSym:MM,mixinMergeStrategySym:UM,msgPrefixSym:LM}=C$,{epochTime:U$,nullTime:qM}=N$,{pid:ZM}=process,FM=lM.hostname(),VM=D$.err,BM={level:"info",levelComparison:vM.ASC,levels:M$,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:ZM,hostname:FM},serializers:Object.assign(Object.create(null),{err:VM}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:U$,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},HM=bM(BM),WM=Object.assign(Object.create(null),D$);function Tf(...e){let t={},{opts:r,stream:i}=HM(t,uM(),...e);r.level&&typeof r.level=="string"&&M$[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:n,crlf:o,serializers:a,timestamp:s,messageKey:c,errorKey:u,nestedKey:d,base:p,name:f,level:h,customLevels:m,levelComparison:g,mixin:v,mixinMergeStrategy:_,useOnlyCustomLevels:w,formatters:$,hooks:E,depthLimit:N,edgeLimit:de,onChild:Y,msgPrefix:be}=r,ee=mM({maximumDepth:N,maximumBreadth:de}),Pe=SM($.level,$.bindings,$.log),Be=$f.bind({[kf]:ee}),Le=n?dM(n,Be):{},ct=n?{stringify:Le[$M]}:{stringify:Be},ht="}"+(o?`\r
23
23
  `:`
24
- `),kn=cM.bind(null,{[f$]:"",[h$]:a,[y$]:Me,[g$]:Sf,[xf]:ee,[v$]:Pe}),Pm="";p!==null&&(f===void 0?Pm=kn(p):Pm=kn(Object.assign({},p,{name:f})));let Sw=s instanceof Function?s:s?$$:PM,Jj=Sw().indexOf(":")+1;if(w&&!m)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(v&&typeof v!="function")throw Error(`Unknown mixin type "${typeof v}" - expected "function"`);if(be&&typeof be!="string")throw Error(`Unknown msgPrefix type "${typeof be}" - expected "string"`);rM(h,m,w);let xw=x$(m,w);typeof i.emit=="function"&&i.emit("message",{code:"PINO_CONFIG",config:{levels:xw,messageKey:l,errorKey:u}}),oM(g);let Gj=iM(g);return Object.assign(t,{levels:xw,[wM]:Gj,[$M]:w,[hM]:i,[mM]:Sw,[fM]:Jj,[g$]:Sf,[xf]:ee,[y$]:Me,[yM]:ft,[vM]:st,[bM]:l,[_M]:u,[SM]:d,[TM]:d?`,${JSON.stringify(d)}:{`:"",[h$]:a,[xM]:v,[IM]:_,[f$]:Pm,[v$]:Pe,[kM]:E,silent:uM,onChild:Y,[EM]:be}),Object.setPrototypeOf(t,eM()),nM(t),t[gM](h),t}Rt.exports=wf;Rt.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=m$(e.dest||process.stdout.fd),p$(e)):p$({dest:m$(e),minLength:0});Rt.exports.transport=nf();Rt.exports.multistream=d$();Rt.exports.levels=x$();Rt.exports.stdSerializers=NM;Rt.exports.stdTimeFunctions=Object.assign({},_$);Rt.exports.symbols=S$;Rt.exports.version=dM;Rt.exports.default=wf;Rt.exports.pino=wf});var Ir=T((p7,EI)=>{"use strict";var TI=["nodebuffer","arraybuffer","fragments"],II=typeof Blob<"u";II&&TI.push("blob");EI.exports={BINARY_TYPES:TI,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:II,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Xa=T((m7,Nd)=>{"use strict";var{EMPTY_BUFFER:h6}=Ir(),Sy=Buffer[Symbol.species];function g6(e,t){if(e.length===0)return h6;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let n=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return i<t?new Sy(r.buffer,r.byteOffset,i):r}function PI(e,t,r,i,n){for(let o=0;o<n;o++)r[i+o]=e[o]^t[o&3]}function zI(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function y6(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function xy(e){if(xy.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Sy(e):ArrayBuffer.isView(e)?t=new Sy(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),xy.readOnly=!1),t}Nd.exports={concat:g6,mask:PI,toArrayBuffer:y6,toBuffer:xy,unmask:zI};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=ie("bufferutil");Nd.exports.mask=function(t,r,i,n,o){o<48?PI(t,r,i,n,o):e.mask(t,r,i,n,o)},Nd.exports.unmask=function(t,r){t.length<32?zI(t,r):e.unmask(t,r)}}catch{}});var jI=T((f7,OI)=>{"use strict";var RI=Symbol("kDone"),wy=Symbol("kRun"),$y=class{constructor(t){this[RI]=()=>{this.pending--,this[wy]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[wy]()}[wy](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[RI])}}};OI.exports=$y});var Ki=T((h7,AI)=>{"use strict";var es=ie("zlib"),DI=Xa(),v6=jI(),{kStatusCode:NI}=Ir(),b6=Buffer[Symbol.species],_6=Buffer.from([0,0,255,255]),Ad=Symbol("permessage-deflate"),Er=Symbol("total-length"),Ji=Symbol("callback"),an=Symbol("buffers"),Gi=Symbol("error"),Cd,ky=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,!Cd){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Cd=new v6(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[Ji];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,i=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(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}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(i=>{let n=r[i];if(n.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(n=n[0],i==="client_max_window_bits"){if(n!==!0){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else if(i==="server_max_window_bits"){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=n})}),t}decompress(t,r,i){Cd.add(n=>{this._decompress(t,r,(o,a)=>{n(),i(o,a)})})}compress(t,r,i){Cd.add(n=>{this._compress(t,r,(o,a)=>{n(),i(o,a)})})}_decompress(t,r,i){let n=this._isServer?"client":"server";if(!this._inflate){let o=`${n}_max_window_bits`,a=typeof this.params[o]!="number"?es.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=es.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[Ad]=this,this._inflate[Er]=0,this._inflate[an]=[],this._inflate.on("error",x6),this._inflate.on("data",CI)}this._inflate[Ji]=i,this._inflate.write(t),r&&this._inflate.write(_6),this._inflate.flush(()=>{let o=this._inflate[Gi];if(o){this._inflate.close(),this._inflate=null,i(o);return}let a=DI.concat(this._inflate[an],this._inflate[Er]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Er]=0,this._inflate[an]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),i(null,a)})}_compress(t,r,i){let n=this._isServer?"server":"client";if(!this._deflate){let o=`${n}_max_window_bits`,a=typeof this.params[o]!="number"?es.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=es.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[Er]=0,this._deflate[an]=[],this._deflate.on("data",S6)}this._deflate[Ji]=i,this._deflate.write(t),this._deflate.flush(es.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=DI.concat(this._deflate[an],this._deflate[Er]);r&&(o=new b6(o.buffer,o.byteOffset,o.length-4)),this._deflate[Ji]=null,this._deflate[Er]=0,this._deflate[an]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};AI.exports=ky;function S6(e){this[an].push(e),this[Er]+=e.length}function CI(e){if(this[Er]+=e.length,this[Ad]._maxPayload<1||this[Er]<=this[Ad]._maxPayload){this[an].push(e);return}this[Gi]=new RangeError("Max payload size exceeded"),this[Gi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Gi][NI]=1009,this.removeListener("data",CI),this.reset()}function x6(e){if(this[Ad]._inflate=null,this[Gi]){this[Ji](this[Gi]);return}e[NI]=1007,this[Ji](e)}});var Qi=T((g7,Md)=>{"use strict";var{isUtf8:MI}=ie("buffer"),{hasBlob:w6}=Ir(),$6=[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 k6(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function Ty(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 T6(e){return w6&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Md.exports={isBlob:T6,isValidStatusCode:k6,isValidUTF8:Ty,tokenChars:$6};if(MI)Md.exports.isValidUTF8=function(e){return e.length<24?Ty(e):MI(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=ie("utf-8-validate");Md.exports.isValidUTF8=function(t){return t.length<32?Ty(t):e(t)}}catch{}});var Ry=T((y7,BI)=>{"use strict";var{Writable:I6}=ie("stream"),UI=Ki(),{BINARY_TYPES:E6,EMPTY_BUFFER:LI,kStatusCode:P6,kWebSocket:z6}=Ir(),{concat:Iy,toArrayBuffer:R6,unmask:O6}=Xa(),{isValidStatusCode:j6,isValidUTF8:qI}=Qi(),Ud=Buffer[Symbol.species],Dt=0,ZI=1,FI=2,VI=3,Ey=4,Py=5,Ld=6,zy=class extends I6{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||E6[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[z6]=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=Dt}_write(t,r,i){if(this._opcode===8&&this._state==Dt)return i();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new Ud(i.buffer,i.byteOffset+t,i.length-t),new Ud(i.buffer,i.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let i=this._buffers[0],n=r.length-t;t>=i.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),n),this._buffers[0]=new Ud(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Dt:this.getInfo(t);break;case ZI:this.getPayloadLength16(t);break;case FI:this.getPayloadLength64(t);break;case VI:this.getMask();break;case Ey:this.getData(t);break;case Py:case Ld: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 i=(r[0]&64)===64;if(i&&!this._extensions[UI.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(i){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=i}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(i){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=ZI:this._payloadLength===127?this._state=FI: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),i=r.readUInt32BE(0);if(i>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=i*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=VI:this._state=Ey}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ey}getData(t){let r=LI;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&&O6(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Py,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[UI.extensionName].decompress(t,this._fin,(n,o)=>{if(n)return r(n);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let a=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(a);return}this._fragments.push(o)}this.dataMessage(r),this._state===Dt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Dt;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Iy(i,r):this._binaryType==="arraybuffer"?n=R6(Iy(i,r)):this._binaryType==="blob"?n=new Blob(i):n=i,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Dt):(this._state=Ld,setImmediate(()=>{this.emit("message",n,!0),this._state=Dt,this.startLoop(t)}))}else{let n=Iy(i,r);if(!this._skipUTF8Validation&&!qI(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===Py||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Dt):(this._state=Ld,setImmediate(()=>{this.emit("message",n,!1),this._state=Dt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,LI),this.end();else{let i=t.readUInt16BE(0);if(!j6(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let n=new Ud(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!qI(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",i,n),this.end()}this._state=Dt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Dt):(this._state=Ld,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Dt,this.startLoop(r)}))}createError(t,r,i,n,o){this._loop=!1,this._errored=!0;let a=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=o,a[P6]=n,a}};BI.exports=zy});var Dy=T((b7,JI)=>{"use strict";var{Duplex:v7}=ie("stream"),{randomFillSync:D6}=ie("crypto"),HI=Ki(),{EMPTY_BUFFER:N6,kWebSocket:C6,NOOP:A6}=Ir(),{isBlob:Yi,isValidStatusCode:M6}=Qi(),{mask:WI,toBuffer:Jn}=Xa(),Nt=Symbol("kByteLength"),U6=Buffer.alloc(4),qd=8*1024,Gn,Xi=qd,Qt=0,L6=1,q6=2,Oy=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Qt,this.onerror=A6,this[C6]=void 0}static frame(t,r){let i,n=!1,o=2,a=!1;r.mask&&(i=r.maskBuffer||U6,r.generateMask?r.generateMask(i):(Xi===qd&&(Gn===void 0&&(Gn=Buffer.alloc(qd)),D6(Gn,0,qd),Xi=0),i[0]=Gn[Xi++],i[1]=Gn[Xi++],i[2]=Gn[Xi++],i[3]=Gn[Xi++]),a=(i[0]|i[1]|i[2]|i[3])===0,o=6);let s;typeof t=="string"?(!r.mask||a)&&r[Nt]!==void 0?s=r[Nt]:(t=Buffer.from(t),s=t.length):(s=t.length,n=r.mask&&r.readOnly&&!a);let l=s;s>=65536?(o+=8,l=127):s>125&&(o+=2,l=126);let u=Buffer.allocUnsafe(n?s+o:o);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=l,l===126?u.writeUInt16BE(s,2):l===127&&(u[2]=u[3]=0,u.writeUIntBE(s,4,6)),r.mask?(u[1]|=128,u[o-4]=i[0],u[o-3]=i[1],u[o-2]=i[2],u[o-1]=i[3],a?[u,t]:n?(WI(t,i,u,o,s),[u]):(WI(t,i,t,0,s),[u,t])):[u,t]}close(t,r,i,n){let o;if(t===void 0)o=N6;else{if(typeof t!="number"||!M6(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+s),o.writeUInt16BE(t,0),typeof r=="string"?o.write(r,2):o.set(r,2)}}let a={[Nt]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Qt?this.enqueue([this.dispatch,o,!1,a,n]):this.sendFrame(e.frame(o,a),n)}ping(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Yi(t)?(n=t.size,o=!1):(t=Jn(t),n=t.length,o=Jn.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[Nt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};Yi(t)?this._state!==Qt?this.enqueue([this.getBlobData,t,!1,a,i]):this.getBlobData(t,!1,a,i):this._state!==Qt?this.enqueue([this.dispatch,t,!1,a,i]):this.sendFrame(e.frame(t,a),i)}pong(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Yi(t)?(n=t.size,o=!1):(t=Jn(t),n=t.length,o=Jn.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[Nt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};Yi(t)?this._state!==Qt?this.enqueue([this.getBlobData,t,!1,a,i]):this.getBlobData(t,!1,a,i):this._state!==Qt?this.enqueue([this.dispatch,t,!1,a,i]):this.sendFrame(e.frame(t,a),i)}send(t,r,i){let n=this._extensions[HI.extensionName],o=r.binary?2:1,a=r.compress,s,l;typeof t=="string"?(s=Buffer.byteLength(t),l=!1):Yi(t)?(s=t.size,l=!1):(t=Jn(t),s=t.length,l=Jn.readOnly),this._firstFragment?(this._firstFragment=!1,a&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=s>=n._threshold),this._compress=a):(a=!1,o=0),r.fin&&(this._firstFragment=!0);let u={[Nt]:s,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:l,rsv1:a};Yi(t)?this._state!==Qt?this.enqueue([this.getBlobData,t,this._compress,u,i]):this.getBlobData(t,this._compress,u,i):this._state!==Qt?this.enqueue([this.dispatch,t,this._compress,u,i]):this.dispatch(t,this._compress,u,i)}getBlobData(t,r,i,n){this._bufferedBytes+=i[Nt],this._state=q6,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let s=new Error("The socket was closed while the blob was being read");process.nextTick(jy,this,s,n);return}this._bufferedBytes-=i[Nt];let a=Jn(o);r?this.dispatch(a,r,i,n):(this._state=Qt,this.sendFrame(e.frame(a,i),n),this.dequeue())}).catch(o=>{process.nextTick(Z6,this,o,n)})}dispatch(t,r,i,n){if(!r){this.sendFrame(e.frame(t,i),n);return}let o=this._extensions[HI.extensionName];this._bufferedBytes+=i[Nt],this._state=L6,o.compress(t,i.fin,(a,s)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");jy(this,l,n);return}this._bufferedBytes-=i[Nt],this._state=Qt,i.readOnly=!1,this.sendFrame(e.frame(s,i),n),this.dequeue()})}dequeue(){for(;this._state===Qt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Nt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Nt],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)}};JI.exports=Oy;function jy(e,t,r){typeof r=="function"&&r(t);for(let i=0;i<e._queue.length;i++){let n=e._queue[i],o=n[n.length-1];typeof o=="function"&&o(t)}}function Z6(e,t,r){jy(e,t,r),e.onerror(t)}});var nE=T((_7,rE)=>{"use strict";var{kForOnEventAttribute:ts,kListener:Ny}=Ir(),GI=Symbol("kCode"),KI=Symbol("kData"),QI=Symbol("kError"),YI=Symbol("kMessage"),XI=Symbol("kReason"),eo=Symbol("kTarget"),eE=Symbol("kType"),tE=Symbol("kWasClean"),Pr=class{constructor(t){this[eo]=null,this[eE]=t}get target(){return this[eo]}get type(){return this[eE]}};Object.defineProperty(Pr.prototype,"target",{enumerable:!0});Object.defineProperty(Pr.prototype,"type",{enumerable:!0});var Kn=class extends Pr{constructor(t,r={}){super(t),this[GI]=r.code===void 0?0:r.code,this[XI]=r.reason===void 0?"":r.reason,this[tE]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[GI]}get reason(){return this[XI]}get wasClean(){return this[tE]}};Object.defineProperty(Kn.prototype,"code",{enumerable:!0});Object.defineProperty(Kn.prototype,"reason",{enumerable:!0});Object.defineProperty(Kn.prototype,"wasClean",{enumerable:!0});var to=class extends Pr{constructor(t,r={}){super(t),this[QI]=r.error===void 0?null:r.error,this[YI]=r.message===void 0?"":r.message}get error(){return this[QI]}get message(){return this[YI]}};Object.defineProperty(to.prototype,"error",{enumerable:!0});Object.defineProperty(to.prototype,"message",{enumerable:!0});var rs=class extends Pr{constructor(t,r={}){super(t),this[KI]=r.data===void 0?null:r.data}get data(){return this[KI]}};Object.defineProperty(rs.prototype,"data",{enumerable:!0});var F6={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[ts]&&n[Ny]===t&&!n[ts])return;let i;if(e==="message")i=function(o,a){let s=new rs("message",{data:a?o:o.toString()});s[eo]=this,Zd(t,this,s)};else if(e==="close")i=function(o,a){let s=new Kn("close",{code:o,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});s[eo]=this,Zd(t,this,s)};else if(e==="error")i=function(o){let a=new to("error",{error:o,message:o.message});a[eo]=this,Zd(t,this,a)};else if(e==="open")i=function(){let o=new Pr("open");o[eo]=this,Zd(t,this,o)};else return;i[ts]=!!r[ts],i[Ny]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Ny]===t&&!r[ts]){this.removeListener(e,r);break}}};rE.exports={CloseEvent:Kn,ErrorEvent:to,Event:Pr,EventTarget:F6,MessageEvent:rs};function Zd(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Fd=T((S7,iE)=>{"use strict";var{tokenChars:ns}=Qi();function mr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function V6(e){let t=Object.create(null),r=Object.create(null),i=!1,n=!1,o=!1,a,s,l=-1,u=-1,d=-1,p=0;for(;p<e.length;p++)if(u=e.charCodeAt(p),a===void 0)if(d===-1&&ns[u]===1)l===-1&&(l=p);else if(p!==0&&(u===32||u===9))d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let h=e.slice(l,d);u===44?(mr(t,h,r),r=Object.create(null)):a=h,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(s===void 0)if(d===-1&&ns[u]===1)l===-1&&(l=p);else if(u===32||u===9)d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),mr(r,e.slice(l,d),!0),u===44&&(mr(t,a,r),r=Object.create(null),a=void 0),l=d=-1}else if(u===61&&l!==-1&&d===-1)s=e.slice(l,p),l=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(n){if(ns[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1?l=p:i||(i=!0),n=!1}else if(o)if(ns[u]===1)l===-1&&(l=p);else if(u===34&&l!==-1)o=!1,d=p;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&e.charCodeAt(p-1)===61)o=!0;else if(d===-1&&ns[u]===1)l===-1&&(l=p);else if(l!==-1&&(u===32||u===9))d===-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let h=e.slice(l,d);i&&(h=h.replace(/\\/g,""),i=!1),mr(r,s,h),u===44&&(mr(t,a,r),r=Object.create(null),a=void 0),s=void 0,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(l===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let f=e.slice(l,d);return a===void 0?mr(t,f,r):(s===void 0?mr(r,f,!0):i?mr(r,s,f.replace(/\\/g,"")):mr(r,s,f),mr(t,a,r)),t}function B6(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(n=>{let o=i[n];return Array.isArray(o)||(o=[o]),o.map(a=>a===!0?n:`${n}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}iE.exports={format:B6,parse:V6}});var Wd=T(($7,gE)=>{"use strict";var H6=ie("events"),W6=ie("https"),J6=ie("http"),sE=ie("net"),G6=ie("tls"),{randomBytes:K6,createHash:Q6}=ie("crypto"),{Duplex:x7,Readable:w7}=ie("stream"),{URL:Cy}=ie("url"),sn=Ki(),Y6=Ry(),X6=Dy(),{isBlob:eU}=Qi(),{BINARY_TYPES:oE,CLOSE_TIMEOUT:tU,EMPTY_BUFFER:Vd,GUID:rU,kForOnEventAttribute:Ay,kListener:nU,kStatusCode:iU,kWebSocket:He,NOOP:cE}=Ir(),{EventTarget:{addEventListener:oU,removeEventListener:aU}}=nE(),{format:sU,parse:cU}=Fd(),{toBuffer:lU}=Xa(),lE=Symbol("kAborted"),My=[8,13],zr=["CONNECTING","OPEN","CLOSING","CLOSED"],uU=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ne=class e extends H6{constructor(t,r,i){super(),this._binaryType=oE[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Vd,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?(i=r,r=[]):r=[r]),uE(this,t,r,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){oE.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,i){let n=new Y6({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),o=new X6(t,this._extensions,i.generateMask);this._receiver=n,this._sender=o,this._socket=t,n[He]=this,o[He]=this,t[He]=this,n.on("conclude",mU),n.on("drain",fU),n.on("error",hU),n.on("message",gU),n.on("ping",yU),n.on("pong",vU),o.onerror=bU,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",mE),t.on("data",Hd),t.on("end",fE),t.on("error",hE),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[sn.extensionName]&&this._extensions[sn.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){It(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,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),pE(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Uy(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Vd,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Uy(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Vd,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Uy(this,t,i);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[sn.extensionName]||(n.compress=!1),this._sender.send(t||Vd,n,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){It(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ne,"CONNECTING",{enumerable:!0,value:zr.indexOf("CONNECTING")});Object.defineProperty(Ne.prototype,"CONNECTING",{enumerable:!0,value:zr.indexOf("CONNECTING")});Object.defineProperty(Ne,"OPEN",{enumerable:!0,value:zr.indexOf("OPEN")});Object.defineProperty(Ne.prototype,"OPEN",{enumerable:!0,value:zr.indexOf("OPEN")});Object.defineProperty(Ne,"CLOSING",{enumerable:!0,value:zr.indexOf("CLOSING")});Object.defineProperty(Ne.prototype,"CLOSING",{enumerable:!0,value:zr.indexOf("CLOSING")});Object.defineProperty(Ne,"CLOSED",{enumerable:!0,value:zr.indexOf("CLOSED")});Object.defineProperty(Ne.prototype,"CLOSED",{enumerable:!0,value:zr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Ne.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Ne.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[Ay])return t[nU];return null},set(t){for(let r of this.listeners(e))if(r[Ay]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[Ay]:!0})}})});Ne.prototype.addEventListener=oU;Ne.prototype.removeEventListener=aU;gE.exports=Ne;function uE(e,t,r,i){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:tU,protocolVersion:My[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,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,!My.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${My.join(", ")})`);let o;if(t instanceof Cy)o=t;else try{o=new Cy(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let a=o.protocol==="wss:",s=o.protocol==="ws+unix:",l;if(o.protocol!=="ws:"&&!a&&!s?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:s&&!o.pathname?l="The URL's pathname is empty":o.hash&&(l="The URL contains a fragment identifier"),l){let g=new SyntaxError(l);if(e._redirects===0)throw g;Bd(e,g);return}let u=a?443:80,d=K6(16).toString("base64"),p=a?W6.request:J6.request,f=new Set,h;if(n.createConnection=n.createConnection||(a?pU:dU),n.defaultPort=n.defaultPort||u,n.port=o.port||u,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(h=new sn({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=sU({[sn.extensionName]:h.offer()})),r.length){for(let g of r){if(typeof g!="string"||!uU.test(g)||f.has(g))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(g)}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),(o.username||o.password)&&(n.auth=`${o.username}:${o.password}`),s){let g=n.path.split(":");n.socketPath=g[0],n.path=g[1]}let m;if(n.followRedirects){if(e._redirects===0){e._originalIpc=s,e._originalSecure=a,e._originalHostOrSocketPath=s?n.socketPath:o.host;let g=i&&i.headers;if(i={...i,headers:{}},g)for(let[v,_]of Object.entries(g))i.headers[v.toLowerCase()]=_}else if(e.listenerCount("redirect")===0){let g=s?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!g||e._originalSecure&&!a)&&(delete n.headers.authorization,delete n.headers.cookie,g||delete n.headers.host,n.auth=void 0)}n.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),m=e._req=p(n),e._redirects&&e.emit("redirect",e.url,m)}else m=e._req=p(n);n.timeout&&m.on("timeout",()=>{It(e,m,"Opening handshake has timed out")}),m.on("error",g=>{m===null||m[lE]||(m=e._req=null,Bd(e,g))}),m.on("response",g=>{let v=g.headers.location,_=g.statusCode;if(v&&n.followRedirects&&_>=300&&_<400){if(++e._redirects>n.maxRedirects){It(e,m,"Maximum redirects exceeded");return}m.abort();let w;try{w=new Cy(v,t)}catch{let E=new SyntaxError(`Invalid URL: ${v}`);Bd(e,E);return}uE(e,w,r,i)}else e.emit("unexpected-response",m,g)||It(e,m,`Unexpected server response: ${g.statusCode}`)}),m.on("upgrade",(g,v,_)=>{if(e.emit("upgrade",g),e.readyState!==Ne.CONNECTING)return;m=e._req=null;let w=g.headers.upgrade;if(w===void 0||w.toLowerCase()!=="websocket"){It(e,v,"Invalid Upgrade header");return}let $=Q6("sha1").update(d+rU).digest("base64");if(g.headers["sec-websocket-accept"]!==$){It(e,v,"Invalid Sec-WebSocket-Accept header");return}let E=g.headers["sec-websocket-protocol"],N;if(E!==void 0?f.size?f.has(E)||(N="Server sent an invalid subprotocol"):N="Server sent a subprotocol but none was requested":f.size&&(N="Server sent no subprotocol"),N){It(e,v,N);return}E&&(e._protocol=E);let de=g.headers["sec-websocket-extensions"];if(de!==void 0){if(!h){It(e,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Y;try{Y=cU(de)}catch{It(e,v,"Invalid Sec-WebSocket-Extensions header");return}let be=Object.keys(Y);if(be.length!==1||be[0]!==sn.extensionName){It(e,v,"Server indicated an extension that was not requested");return}try{h.accept(Y[sn.extensionName])}catch{It(e,v,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[sn.extensionName]=h}e.setSocket(v,_,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(m,e):m.end()}function Bd(e,t){e._readyState=Ne.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function dU(e){return e.path=e.socketPath,sE.connect(e)}function pU(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=sE.isIP(e.host)?"":e.host),G6.connect(e)}function It(e,t,r){e._readyState=Ne.CLOSING;let i=new Error(r);Error.captureStackTrace(i,It),t.setHeader?(t[lE]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Bd,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Uy(e,t,r){if(t){let i=eU(t)?t.size:lU(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${zr[e.readyState]})`);process.nextTick(r,i)}}function mU(e,t){let r=this[He];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[He]!==void 0&&(r._socket.removeListener("data",Hd),process.nextTick(dE,r._socket),e===1005?r.close():r.close(e,t))}function fU(){let e=this[He];e.isPaused||e._socket.resume()}function hU(e){let t=this[He];t._socket[He]!==void 0&&(t._socket.removeListener("data",Hd),process.nextTick(dE,t._socket),t.close(e[iU])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function aE(){this[He].emitClose()}function gU(e,t){this[He].emit("message",e,t)}function yU(e){let t=this[He];t._autoPong&&t.pong(e,!this._isServer,cE),t.emit("ping",e)}function vU(e){this[He].emit("pong",e)}function dE(e){e.resume()}function bU(e){let t=this[He];t.readyState!==Ne.CLOSED&&(t.readyState===Ne.OPEN&&(t._readyState=Ne.CLOSING,pE(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function pE(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function mE(){let e=this[He];if(this.removeListener("close",mE),this.removeListener("data",Hd),this.removeListener("end",fE),e._readyState=Ne.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",aE),e._receiver.on("finish",aE))}function Hd(e){this[He]._receiver.write(e)||this.pause()}function fE(){let e=this[He];e._readyState=Ne.CLOSING,e._receiver.end(),this.end()}function hE(){let e=this[He];this.removeListener("error",hE),this.on("error",cE),e&&(e._readyState=Ne.CLOSING,this.destroy())}});var _E=T((T7,bE)=>{"use strict";var k7=Wd(),{Duplex:_U}=ie("stream");function yE(e){e.emit("close")}function SU(){!this.destroyed&&this._writableState.finished&&this.destroy()}function vE(e){this.removeListener("error",vE),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function xU(e,t){let r=!0,i=new _U({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,a){let s=!a&&i._readableState.objectMode?o.toString():o;i.push(s)||e.pause()}),e.once("error",function(o){i.destroyed||(r=!1,i.destroy(o))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(n,o){if(e.readyState===e.CLOSED){o(n),process.nextTick(yE,i);return}let a=!1;e.once("error",function(l){a=!0,o(l)}),e.once("close",function(){a||o(n),process.nextTick(yE,i)}),r&&e.terminate()},i._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(n,o,a){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(n,o,a)});return}e.send(n,a)},i.on("end",SU),i.on("error",vE),i}bE.exports=xU});var Ly=T((I7,SE)=>{"use strict";var{tokenChars:wU}=Qi();function $U(e){let t=new Set,r=-1,i=-1,n=0;for(n;n<e.length;n++){let a=e.charCodeAt(n);if(i===-1&&wU[a]===1)r===-1&&(r=n);else if(n!==0&&(a===32||a===9))i===-1&&r!==-1&&(i=n);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);i===-1&&(i=n);let s=e.slice(r,i);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),r=i=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,n);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}SE.exports={parse:$U}});var EE=T((P7,IE)=>{"use strict";var kU=ie("events"),Jd=ie("http"),{Duplex:E7}=ie("stream"),{createHash:TU}=ie("crypto"),xE=Fd(),Qn=Ki(),IU=Ly(),EU=Wd(),{CLOSE_TIMEOUT:PU,GUID:zU,kWebSocket:RU}=Ir(),OU=/^[+/0-9A-Za-z]{22}==$/,wE=0,$E=1,TE=2,qy=class extends kU{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:PU,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:EU,...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=Jd.createServer((i,n)=>{let o=Jd.STATUS_CODES[426];n.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),n.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=jU(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,o,a)=>{this.handleUpgrade(n,o,a,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=wE}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===TE){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(is,this);return}if(t&&this.once("close",t),this._state!==$E)if(this._state=$E,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(is,this):process.nextTick(is,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{is(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,i,n){r.on("error",kE);let o=t.headers["sec-websocket-key"],a=t.headers.upgrade,s=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Yn(this,t,r,405,"Invalid HTTP method");return}if(a===void 0||a.toLowerCase()!=="websocket"){Yn(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!OU.test(o)){Yn(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(s!==13&&s!==8){Yn(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){os(r,400);return}let l=t.headers["sec-websocket-protocol"],u=new Set;if(l!==void 0)try{u=IU.parse(l)}catch{Yn(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let f=new Qn({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=xE.parse(d);h[Qn.extensionName]&&(f.accept(h[Qn.extensionName]),p[Qn.extensionName]=f)}catch{Yn(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:t.headers[`${s===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,m,g,v)=>{if(!h)return os(r,m||401,g,v);this.completeUpgrade(p,o,u,t,r,i,n)});return}if(!this.options.verifyClient(f))return os(r,401)}this.completeUpgrade(p,o,u,t,r,i,n)}completeUpgrade(t,r,i,n,o,a,s){if(!o.readable||!o.writable)return o.destroy();if(o[RU])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>wE)return os(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${TU("sha1").update(r+zU).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(i.size){let p=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[Qn.extensionName]){let p=t[Qn.extensionName].params,f=xE.format({[Qn.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${f}`),d._extensions=t}this.emit("headers",u,n),o.write(u.concat(`\r
24
+ `),In=_M.bind(null,{[P$]:"",[z$]:a,[O$]:Le,[R$]:$f,[kf]:ee,[j$]:Pe}),Om="";p!==null&&(f===void 0?Om=In(p):Om=In(Object.assign({},p,{name:f})));let Cw=s instanceof Function?s:s?U$:qM,aD=Cw().indexOf(":")+1;if(w&&!m)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(v&&typeof v!="function")throw Error(`Unknown mixin type "${typeof v}" - expected "function"`);if(be&&typeof be!="string")throw Error(`Unknown msgPrefix type "${typeof be}" - expected "string"`);fM(h,m,w);let Aw=A$(m,w);typeof i.emit=="function"&&i.emit("message",{code:"PINO_CONFIG",config:{levels:Aw,messageKey:c,errorKey:u}}),yM(g);let sD=gM(g);return Object.assign(t,{levels:Aw,[NM]:sD,[CM]:w,[IM]:i,[kM]:Cw,[TM]:aD,[R$]:$f,[kf]:ee,[O$]:Le,[PM]:ht,[zM]:ct,[RM]:c,[OM]:u,[jM]:d,[MM]:d?`,${JSON.stringify(d)}:{`:"",[z$]:a,[DM]:v,[UM]:_,[P$]:Om,[j$]:Pe,[AM]:E,silent:xM,onChild:Y,[LM]:be}),Object.setPrototypeOf(t,pM()),hM(t),t[EM](h),t}Ot.exports=Tf;Ot.exports.destination=(e=process.stdout.fd)=>typeof e=="object"?(e.dest=E$(e.dest||process.stdout.fd),I$(e)):I$({dest:E$(e),minLength:0});Ot.exports.transport=sf();Ot.exports.multistream=T$();Ot.exports.levels=A$();Ot.exports.stdSerializers=WM;Ot.exports.stdTimeFunctions=Object.assign({},N$);Ot.exports.symbols=C$;Ot.exports.version=wM;Ot.exports.default=Tf;Ot.exports.pino=Tf});var Er=I((Z7,VI)=>{"use strict";var ZI=["nodebuffer","arraybuffer","fragments"],FI=typeof Blob<"u";FI&&ZI.push("blob");VI.exports={BINARY_TYPES:ZI,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:FI,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var es=I((F7,Ad)=>{"use strict";var{EMPTY_BUFFER:R6}=Er(),ky=Buffer[Symbol.species];function O6(e,t){if(e.length===0)return R6;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),i=0;for(let n=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return i<t?new ky(r.buffer,r.byteOffset,i):r}function BI(e,t,r,i,n){for(let o=0;o<n;o++)r[i+o]=e[o]^t[o&3]}function HI(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function j6(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Ty(e){if(Ty.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new ky(e):ArrayBuffer.isView(e)?t=new ky(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Ty.readOnly=!1),t}Ad.exports={concat:O6,mask:BI,toArrayBuffer:j6,toBuffer:Ty,unmask:HI};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=ie("bufferutil");Ad.exports.mask=function(t,r,i,n,o){o<48?BI(t,r,i,n,o):e.mask(t,r,i,n,o)},Ad.exports.unmask=function(t,r){t.length<32?HI(t,r):e.unmask(t,r)}}catch{}});var GI=I((V7,JI)=>{"use strict";var WI=Symbol("kDone"),Iy=Symbol("kRun"),Ey=class{constructor(t){this[WI]=()=>{this.pending--,this[Iy]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Iy]()}[Iy](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[WI])}}};JI.exports=Ey});var Qi=I((B7,XI)=>{"use strict";var ts=ie("zlib"),KI=es(),D6=GI(),{kStatusCode:QI}=Er(),N6=Buffer[Symbol.species],C6=Buffer.from([0,0,255,255]),Ud=Symbol("permessage-deflate"),Pr=Symbol("total-length"),Gi=Symbol("callback"),cn=Symbol("buffers"),Ki=Symbol("error"),Md,Py=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,!Md){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Md=new D6(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[Gi];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,i=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(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}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(i=>{let n=r[i];if(n.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(n=n[0],i==="client_max_window_bits"){if(n!==!0){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else if(i==="server_max_window_bits"){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=n})}),t}decompress(t,r,i){Md.add(n=>{this._decompress(t,r,(o,a)=>{n(),i(o,a)})})}compress(t,r,i){Md.add(n=>{this._compress(t,r,(o,a)=>{n(),i(o,a)})})}_decompress(t,r,i){let n=this._isServer?"client":"server";if(!this._inflate){let o=`${n}_max_window_bits`,a=typeof this.params[o]!="number"?ts.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=ts.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[Ud]=this,this._inflate[Pr]=0,this._inflate[cn]=[],this._inflate.on("error",M6),this._inflate.on("data",YI)}this._inflate[Gi]=i,this._inflate.write(t),r&&this._inflate.write(C6),this._inflate.flush(()=>{let o=this._inflate[Ki];if(o){this._inflate.close(),this._inflate=null,i(o);return}let a=KI.concat(this._inflate[cn],this._inflate[Pr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Pr]=0,this._inflate[cn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),i(null,a)})}_compress(t,r,i){let n=this._isServer?"server":"client";if(!this._deflate){let o=`${n}_max_window_bits`,a=typeof this.params[o]!="number"?ts.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=ts.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[Pr]=0,this._deflate[cn]=[],this._deflate.on("data",A6)}this._deflate[Gi]=i,this._deflate.write(t),this._deflate.flush(ts.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=KI.concat(this._deflate[cn],this._deflate[Pr]);r&&(o=new N6(o.buffer,o.byteOffset,o.length-4)),this._deflate[Gi]=null,this._deflate[Pr]=0,this._deflate[cn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};XI.exports=Py;function A6(e){this[cn].push(e),this[Pr]+=e.length}function YI(e){if(this[Pr]+=e.length,this[Ud]._maxPayload<1||this[Pr]<=this[Ud]._maxPayload){this[cn].push(e);return}this[Ki]=new RangeError("Max payload size exceeded"),this[Ki].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ki][QI]=1009,this.removeListener("data",YI),this.reset()}function M6(e){if(this[Ud]._inflate=null,this[Ki]){this[Gi](this[Ki]);return}e[QI]=1007,this[Gi](e)}});var Yi=I((H7,Ld)=>{"use strict";var{isUtf8:eE}=ie("buffer"),{hasBlob:U6}=Er(),L6=[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 q6(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function zy(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 Z6(e){return U6&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Ld.exports={isBlob:Z6,isValidStatusCode:q6,isValidUTF8:zy,tokenChars:L6};if(eE)Ld.exports.isValidUTF8=function(e){return e.length<24?zy(e):eE(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=ie("utf-8-validate");Ld.exports.isValidUTF8=function(t){return t.length<32?zy(t):e(t)}}catch{}});var Ny=I((W7,sE)=>{"use strict";var{Writable:F6}=ie("stream"),tE=Qi(),{BINARY_TYPES:V6,EMPTY_BUFFER:rE,kStatusCode:B6,kWebSocket:H6}=Er(),{concat:Ry,toArrayBuffer:W6,unmask:J6}=es(),{isValidStatusCode:G6,isValidUTF8:nE}=Yi(),qd=Buffer[Symbol.species],Nt=0,iE=1,oE=2,aE=3,Oy=4,jy=5,Zd=6,Dy=class extends F6{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||V6[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[H6]=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=Nt}_write(t,r,i){if(this._opcode===8&&this._state==Nt)return i();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new qd(i.buffer,i.byteOffset+t,i.length-t),new qd(i.buffer,i.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let i=this._buffers[0],n=r.length-t;t>=i.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(i.buffer,i.byteOffset,t),n),this._buffers[0]=new qd(i.buffer,i.byteOffset+t,i.length-t)),t-=i.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Nt:this.getInfo(t);break;case iE:this.getPayloadLength16(t);break;case oE:this.getPayloadLength64(t);break;case aE:this.getMask();break;case Oy:this.getData(t);break;case jy:case Zd: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 i=(r[0]&64)===64;if(i&&!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(i){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=i}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(i){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=iE:this._payloadLength===127?this._state=oE: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),i=r.readUInt32BE(0);if(i>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=i*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=aE:this._state=Oy}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Oy}getData(t){let r=rE;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&&J6(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=jy,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,o)=>{if(n)return r(n);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let a=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(a);return}this._fragments.push(o)}this.dataMessage(r),this._state===Nt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Nt;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Ry(i,r):this._binaryType==="arraybuffer"?n=W6(Ry(i,r)):this._binaryType==="blob"?n=new Blob(i):n=i,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Nt):(this._state=Zd,setImmediate(()=>{this.emit("message",n,!0),this._state=Nt,this.startLoop(t)}))}else{let n=Ry(i,r);if(!this._skipUTF8Validation&&!nE(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===jy||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Nt):(this._state=Zd,setImmediate(()=>{this.emit("message",n,!1),this._state=Nt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,rE),this.end();else{let i=t.readUInt16BE(0);if(!G6(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let n=new qd(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!nE(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",i,n),this.end()}this._state=Nt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Nt):(this._state=Zd,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Nt,this.startLoop(r)}))}createError(t,r,i,n,o){this._loop=!1,this._errored=!0;let a=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=o,a[B6]=n,a}};sE.exports=Dy});var My=I((G7,uE)=>{"use strict";var{Duplex:J7}=ie("stream"),{randomFillSync:K6}=ie("crypto"),cE=Qi(),{EMPTY_BUFFER:Q6,kWebSocket:Y6,NOOP:X6}=Er(),{isBlob:Xi,isValidStatusCode:eU}=Yi(),{mask:lE,toBuffer:Kn}=es(),Ct=Symbol("kByteLength"),tU=Buffer.alloc(4),Fd=8*1024,Qn,eo=Fd,Yt=0,rU=1,nU=2,Cy=class e{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Yt,this.onerror=X6,this[Y6]=void 0}static frame(t,r){let i,n=!1,o=2,a=!1;r.mask&&(i=r.maskBuffer||tU,r.generateMask?r.generateMask(i):(eo===Fd&&(Qn===void 0&&(Qn=Buffer.alloc(Fd)),K6(Qn,0,Fd),eo=0),i[0]=Qn[eo++],i[1]=Qn[eo++],i[2]=Qn[eo++],i[3]=Qn[eo++]),a=(i[0]|i[1]|i[2]|i[3])===0,o=6);let s;typeof t=="string"?(!r.mask||a)&&r[Ct]!==void 0?s=r[Ct]:(t=Buffer.from(t),s=t.length):(s=t.length,n=r.mask&&r.readOnly&&!a);let c=s;s>=65536?(o+=8,c=127):s>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(n?s+o:o);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(s,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(s,4,6)),r.mask?(u[1]|=128,u[o-4]=i[0],u[o-3]=i[1],u[o-2]=i[2],u[o-1]=i[3],a?[u,t]:n?(lE(t,i,u,o,s),[u]):(lE(t,i,t,0,s),[u,t])):[u,t]}close(t,r,i,n){let o;if(t===void 0)o=Q6;else{if(typeof t!="number"||!eU(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+s),o.writeUInt16BE(t,0),typeof r=="string"?o.write(r,2):o.set(r,2)}}let a={[Ct]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Yt?this.enqueue([this.dispatch,o,!1,a,n]):this.sendFrame(e.frame(o,a),n)}ping(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Xi(t)?(n=t.size,o=!1):(t=Kn(t),n=t.length,o=Kn.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[Ct]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};Xi(t)?this._state!==Yt?this.enqueue([this.getBlobData,t,!1,a,i]):this.getBlobData(t,!1,a,i):this._state!==Yt?this.enqueue([this.dispatch,t,!1,a,i]):this.sendFrame(e.frame(t,a),i)}pong(t,r,i){let n,o;if(typeof t=="string"?(n=Buffer.byteLength(t),o=!1):Xi(t)?(n=t.size,o=!1):(t=Kn(t),n=t.length,o=Kn.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[Ct]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};Xi(t)?this._state!==Yt?this.enqueue([this.getBlobData,t,!1,a,i]):this.getBlobData(t,!1,a,i):this._state!==Yt?this.enqueue([this.dispatch,t,!1,a,i]):this.sendFrame(e.frame(t,a),i)}send(t,r,i){let n=this._extensions[cE.extensionName],o=r.binary?2:1,a=r.compress,s,c;typeof t=="string"?(s=Buffer.byteLength(t),c=!1):Xi(t)?(s=t.size,c=!1):(t=Kn(t),s=t.length,c=Kn.readOnly),this._firstFragment?(this._firstFragment=!1,a&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=s>=n._threshold),this._compress=a):(a=!1,o=0),r.fin&&(this._firstFragment=!0);let u={[Ct]:s,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:a};Xi(t)?this._state!==Yt?this.enqueue([this.getBlobData,t,this._compress,u,i]):this.getBlobData(t,this._compress,u,i):this._state!==Yt?this.enqueue([this.dispatch,t,this._compress,u,i]):this.dispatch(t,this._compress,u,i)}getBlobData(t,r,i,n){this._bufferedBytes+=i[Ct],this._state=nU,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let s=new Error("The socket was closed while the blob was being read");process.nextTick(Ay,this,s,n);return}this._bufferedBytes-=i[Ct];let a=Kn(o);r?this.dispatch(a,r,i,n):(this._state=Yt,this.sendFrame(e.frame(a,i),n),this.dequeue())}).catch(o=>{process.nextTick(iU,this,o,n)})}dispatch(t,r,i,n){if(!r){this.sendFrame(e.frame(t,i),n);return}let o=this._extensions[cE.extensionName];this._bufferedBytes+=i[Ct],this._state=rU,o.compress(t,i.fin,(a,s)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Ay(this,c,n);return}this._bufferedBytes-=i[Ct],this._state=Yt,i.readOnly=!1,this.sendFrame(e.frame(s,i),n),this.dequeue()})}dequeue(){for(;this._state===Yt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Ct],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Ct],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)}};uE.exports=Cy;function Ay(e,t,r){typeof r=="function"&&r(t);for(let i=0;i<e._queue.length;i++){let n=e._queue[i],o=n[n.length-1];typeof o=="function"&&o(t)}}function iU(e,t,r){Ay(e,t,r),e.onerror(t)}});var bE=I((K7,vE)=>{"use strict";var{kForOnEventAttribute:rs,kListener:Uy}=Er(),dE=Symbol("kCode"),pE=Symbol("kData"),mE=Symbol("kError"),fE=Symbol("kMessage"),hE=Symbol("kReason"),to=Symbol("kTarget"),gE=Symbol("kType"),yE=Symbol("kWasClean"),zr=class{constructor(t){this[to]=null,this[gE]=t}get target(){return this[to]}get type(){return this[gE]}};Object.defineProperty(zr.prototype,"target",{enumerable:!0});Object.defineProperty(zr.prototype,"type",{enumerable:!0});var Yn=class extends zr{constructor(t,r={}){super(t),this[dE]=r.code===void 0?0:r.code,this[hE]=r.reason===void 0?"":r.reason,this[yE]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[dE]}get reason(){return this[hE]}get wasClean(){return this[yE]}};Object.defineProperty(Yn.prototype,"code",{enumerable:!0});Object.defineProperty(Yn.prototype,"reason",{enumerable:!0});Object.defineProperty(Yn.prototype,"wasClean",{enumerable:!0});var ro=class extends zr{constructor(t,r={}){super(t),this[mE]=r.error===void 0?null:r.error,this[fE]=r.message===void 0?"":r.message}get error(){return this[mE]}get message(){return this[fE]}};Object.defineProperty(ro.prototype,"error",{enumerable:!0});Object.defineProperty(ro.prototype,"message",{enumerable:!0});var ns=class extends zr{constructor(t,r={}){super(t),this[pE]=r.data===void 0?null:r.data}get data(){return this[pE]}};Object.defineProperty(ns.prototype,"data",{enumerable:!0});var oU={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[rs]&&n[Uy]===t&&!n[rs])return;let i;if(e==="message")i=function(o,a){let s=new ns("message",{data:a?o:o.toString()});s[to]=this,Vd(t,this,s)};else if(e==="close")i=function(o,a){let s=new Yn("close",{code:o,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});s[to]=this,Vd(t,this,s)};else if(e==="error")i=function(o){let a=new ro("error",{error:o,message:o.message});a[to]=this,Vd(t,this,a)};else if(e==="open")i=function(){let o=new zr("open");o[to]=this,Vd(t,this,o)};else return;i[rs]=!!r[rs],i[Uy]=t,r.once?this.once(e,i):this.on(e,i)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Uy]===t&&!r[rs]){this.removeListener(e,r);break}}};vE.exports={CloseEvent:Yn,ErrorEvent:ro,Event:zr,EventTarget:oU,MessageEvent:ns};function Vd(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var Bd=I((Q7,_E)=>{"use strict";var{tokenChars:is}=Yi();function fr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function aU(e){let t=Object.create(null),r=Object.create(null),i=!1,n=!1,o=!1,a,s,c=-1,u=-1,d=-1,p=0;for(;p<e.length;p++)if(u=e.charCodeAt(p),a===void 0)if(d===-1&&is[u]===1)c===-1&&(c=p);else if(p!==0&&(u===32||u===9))d===-1&&c!==-1&&(d=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let h=e.slice(c,d);u===44?(fr(t,h,r),r=Object.create(null)):a=h,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(s===void 0)if(d===-1&&is[u]===1)c===-1&&(c=p);else if(u===32||u===9)d===-1&&c!==-1&&(d=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),fr(r,e.slice(c,d),!0),u===44&&(fr(t,a,r),r=Object.create(null),a=void 0),c=d=-1}else if(u===61&&c!==-1&&d===-1)s=e.slice(c,p),c=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(n){if(is[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1?c=p:i||(i=!0),n=!1}else if(o)if(is[u]===1)c===-1&&(c=p);else if(u===34&&c!==-1)o=!1,d=p;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&e.charCodeAt(p-1)===61)o=!0;else if(d===-1&&is[u]===1)c===-1&&(c=p);else if(c!==-1&&(u===32||u===9))d===-1&&(d=p);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let h=e.slice(c,d);i&&(h=h.replace(/\\/g,""),i=!1),fr(r,s,h),u===44&&(fr(t,a,r),r=Object.create(null),a=void 0),s=void 0,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let f=e.slice(c,d);return a===void 0?fr(t,f,r):(s===void 0?fr(r,f,!0):i?fr(r,s,f.replace(/\\/g,"")):fr(r,s,f),fr(t,a,r)),t}function sU(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(i=>[t].concat(Object.keys(i).map(n=>{let o=i[n];return Array.isArray(o)||(o=[o]),o.map(a=>a===!0?n:`${n}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}_E.exports={format:sU,parse:aU}});var Gd=I((eK,OE)=>{"use strict";var cU=ie("events"),lU=ie("https"),uU=ie("http"),wE=ie("net"),dU=ie("tls"),{randomBytes:pU,createHash:mU}=ie("crypto"),{Duplex:Y7,Readable:X7}=ie("stream"),{URL:Ly}=ie("url"),ln=Qi(),fU=Ny(),hU=My(),{isBlob:gU}=Yi(),{BINARY_TYPES:SE,CLOSE_TIMEOUT:yU,EMPTY_BUFFER:Hd,GUID:vU,kForOnEventAttribute:qy,kListener:bU,kStatusCode:_U,kWebSocket:Je,NOOP:$E}=Er(),{EventTarget:{addEventListener:SU,removeEventListener:xU}}=bE(),{format:wU,parse:$U}=Bd(),{toBuffer:kU}=es(),kE=Symbol("kAborted"),Zy=[8,13],Rr=["CONNECTING","OPEN","CLOSING","CLOSED"],TU=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ne=class e extends cU{constructor(t,r,i){super(),this._binaryType=SE[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Hd,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?(i=r,r=[]):r=[r]),TE(this,t,r,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){SE.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,i){let n=new fU({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),o=new hU(t,this._extensions,i.generateMask);this._receiver=n,this._sender=o,this._socket=t,n[Je]=this,o[Je]=this,t[Je]=this,n.on("conclude",PU),n.on("drain",zU),n.on("error",RU),n.on("message",OU),n.on("ping",jU),n.on("pong",DU),o.onerror=NU,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",PE),t.on("data",Jd),t.on("end",zE),t.on("error",RE),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[ln.extensionName]&&this._extensions[ln.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){Et(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,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),EE(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Fy(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Hd,r,i)}pong(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(i=t,t=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Fy(this,t,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Hd,r,i)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Fy(this,t,i);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[ln.extensionName]||(n.compress=!1),this._sender.send(t||Hd,n,i)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){Et(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ne,"CONNECTING",{enumerable:!0,value:Rr.indexOf("CONNECTING")});Object.defineProperty(Ne.prototype,"CONNECTING",{enumerable:!0,value:Rr.indexOf("CONNECTING")});Object.defineProperty(Ne,"OPEN",{enumerable:!0,value:Rr.indexOf("OPEN")});Object.defineProperty(Ne.prototype,"OPEN",{enumerable:!0,value:Rr.indexOf("OPEN")});Object.defineProperty(Ne,"CLOSING",{enumerable:!0,value:Rr.indexOf("CLOSING")});Object.defineProperty(Ne.prototype,"CLOSING",{enumerable:!0,value:Rr.indexOf("CLOSING")});Object.defineProperty(Ne,"CLOSED",{enumerable:!0,value:Rr.indexOf("CLOSED")});Object.defineProperty(Ne.prototype,"CLOSED",{enumerable:!0,value:Rr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Ne.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Ne.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[qy])return t[bU];return null},set(t){for(let r of this.listeners(e))if(r[qy]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[qy]:!0})}})});Ne.prototype.addEventListener=SU;Ne.prototype.removeEventListener=xU;OE.exports=Ne;function TE(e,t,r,i){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:yU,protocolVersion:Zy[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,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,!Zy.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${Zy.join(", ")})`);let o;if(t instanceof Ly)o=t;else try{o=new Ly(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let a=o.protocol==="wss:",s=o.protocol==="ws+unix:",c;if(o.protocol!=="ws:"&&!a&&!s?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:s&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let g=new SyntaxError(c);if(e._redirects===0)throw g;Wd(e,g);return}let u=a?443:80,d=pU(16).toString("base64"),p=a?lU.request:uU.request,f=new Set,h;if(n.createConnection=n.createConnection||(a?EU:IU),n.defaultPort=n.defaultPort||u,n.port=o.port||u,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(h=new ln({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=wU({[ln.extensionName]:h.offer()})),r.length){for(let g of r){if(typeof g!="string"||!TU.test(g)||f.has(g))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(g)}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),(o.username||o.password)&&(n.auth=`${o.username}:${o.password}`),s){let g=n.path.split(":");n.socketPath=g[0],n.path=g[1]}let m;if(n.followRedirects){if(e._redirects===0){e._originalIpc=s,e._originalSecure=a,e._originalHostOrSocketPath=s?n.socketPath:o.host;let g=i&&i.headers;if(i={...i,headers:{}},g)for(let[v,_]of Object.entries(g))i.headers[v.toLowerCase()]=_}else if(e.listenerCount("redirect")===0){let g=s?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!g||e._originalSecure&&!a)&&(delete n.headers.authorization,delete n.headers.cookie,g||delete n.headers.host,n.auth=void 0)}n.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),m=e._req=p(n),e._redirects&&e.emit("redirect",e.url,m)}else m=e._req=p(n);n.timeout&&m.on("timeout",()=>{Et(e,m,"Opening handshake has timed out")}),m.on("error",g=>{m===null||m[kE]||(m=e._req=null,Wd(e,g))}),m.on("response",g=>{let v=g.headers.location,_=g.statusCode;if(v&&n.followRedirects&&_>=300&&_<400){if(++e._redirects>n.maxRedirects){Et(e,m,"Maximum redirects exceeded");return}m.abort();let w;try{w=new Ly(v,t)}catch{let E=new SyntaxError(`Invalid URL: ${v}`);Wd(e,E);return}TE(e,w,r,i)}else e.emit("unexpected-response",m,g)||Et(e,m,`Unexpected server response: ${g.statusCode}`)}),m.on("upgrade",(g,v,_)=>{if(e.emit("upgrade",g),e.readyState!==Ne.CONNECTING)return;m=e._req=null;let w=g.headers.upgrade;if(w===void 0||w.toLowerCase()!=="websocket"){Et(e,v,"Invalid Upgrade header");return}let $=mU("sha1").update(d+vU).digest("base64");if(g.headers["sec-websocket-accept"]!==$){Et(e,v,"Invalid Sec-WebSocket-Accept header");return}let E=g.headers["sec-websocket-protocol"],N;if(E!==void 0?f.size?f.has(E)||(N="Server sent an invalid subprotocol"):N="Server sent a subprotocol but none was requested":f.size&&(N="Server sent no subprotocol"),N){Et(e,v,N);return}E&&(e._protocol=E);let de=g.headers["sec-websocket-extensions"];if(de!==void 0){if(!h){Et(e,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Y;try{Y=$U(de)}catch{Et(e,v,"Invalid Sec-WebSocket-Extensions header");return}let be=Object.keys(Y);if(be.length!==1||be[0]!==ln.extensionName){Et(e,v,"Server indicated an extension that was not requested");return}try{h.accept(Y[ln.extensionName])}catch{Et(e,v,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[ln.extensionName]=h}e.setSocket(v,_,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(m,e):m.end()}function Wd(e,t){e._readyState=Ne.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function IU(e){return e.path=e.socketPath,wE.connect(e)}function EU(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=wE.isIP(e.host)?"":e.host),dU.connect(e)}function Et(e,t,r){e._readyState=Ne.CLOSING;let i=new Error(r);Error.captureStackTrace(i,Et),t.setHeader?(t[kE]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Wd,e,i)):(t.destroy(i),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Fy(e,t,r){if(t){let i=gU(t)?t.size:kU(t).length;e._socket?e._sender._bufferedBytes+=i:e._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${e.readyState} (${Rr[e.readyState]})`);process.nextTick(r,i)}}function PU(e,t){let r=this[Je];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Je]!==void 0&&(r._socket.removeListener("data",Jd),process.nextTick(IE,r._socket),e===1005?r.close():r.close(e,t))}function zU(){let e=this[Je];e.isPaused||e._socket.resume()}function RU(e){let t=this[Je];t._socket[Je]!==void 0&&(t._socket.removeListener("data",Jd),process.nextTick(IE,t._socket),t.close(e[_U])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function xE(){this[Je].emitClose()}function OU(e,t){this[Je].emit("message",e,t)}function jU(e){let t=this[Je];t._autoPong&&t.pong(e,!this._isServer,$E),t.emit("ping",e)}function DU(e){this[Je].emit("pong",e)}function IE(e){e.resume()}function NU(e){let t=this[Je];t.readyState!==Ne.CLOSED&&(t.readyState===Ne.OPEN&&(t._readyState=Ne.CLOSING,EE(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function EE(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function PE(){let e=this[Je];if(this.removeListener("close",PE),this.removeListener("data",Jd),this.removeListener("end",zE),e._readyState=Ne.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",xE),e._receiver.on("finish",xE))}function Jd(e){this[Je]._receiver.write(e)||this.pause()}function zE(){let e=this[Je];e._readyState=Ne.CLOSING,e._receiver.end(),this.end()}function RE(){let e=this[Je];this.removeListener("error",RE),this.on("error",$E),e&&(e._readyState=Ne.CLOSING,this.destroy())}});var CE=I((rK,NE)=>{"use strict";var tK=Gd(),{Duplex:CU}=ie("stream");function jE(e){e.emit("close")}function AU(){!this.destroyed&&this._writableState.finished&&this.destroy()}function DE(e){this.removeListener("error",DE),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function MU(e,t){let r=!0,i=new CU({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,a){let s=!a&&i._readableState.objectMode?o.toString():o;i.push(s)||e.pause()}),e.once("error",function(o){i.destroyed||(r=!1,i.destroy(o))}),e.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(n,o){if(e.readyState===e.CLOSED){o(n),process.nextTick(jE,i);return}let a=!1;e.once("error",function(c){a=!0,o(c)}),e.once("close",function(){a||o(n),process.nextTick(jE,i)}),r&&e.terminate()},i._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){i._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},i._read=function(){e.isPaused&&e.resume()},i._write=function(n,o,a){if(e.readyState===e.CONNECTING){e.once("open",function(){i._write(n,o,a)});return}e.send(n,a)},i.on("end",AU),i.on("error",DE),i}NE.exports=MU});var Vy=I((nK,AE)=>{"use strict";var{tokenChars:UU}=Yi();function LU(e){let t=new Set,r=-1,i=-1,n=0;for(n;n<e.length;n++){let a=e.charCodeAt(n);if(i===-1&&UU[a]===1)r===-1&&(r=n);else if(n!==0&&(a===32||a===9))i===-1&&r!==-1&&(i=n);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);i===-1&&(i=n);let s=e.slice(r,i);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),r=i=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,n);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}AE.exports={parse:LU}});var VE=I((oK,FE)=>{"use strict";var qU=ie("events"),Kd=ie("http"),{Duplex:iK}=ie("stream"),{createHash:ZU}=ie("crypto"),ME=Bd(),Xn=Qi(),FU=Vy(),VU=Gd(),{CLOSE_TIMEOUT:BU,GUID:HU,kWebSocket:WU}=Er(),JU=/^[+/0-9A-Za-z]{22}==$/,UE=0,LE=1,ZE=2,By=class extends qU{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:BU,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:VU,...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=Kd.createServer((i,n)=>{let o=Kd.STATUS_CODES[426];n.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),n.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=GU(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,o,a)=>{this.handleUpgrade(n,o,a,i)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=UE}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===ZE){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(os,this);return}if(t&&this.once("close",t),this._state!==LE)if(this._state=LE,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(os,this):process.nextTick(os,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{os(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,i,n){r.on("error",qE);let o=t.headers["sec-websocket-key"],a=t.headers.upgrade,s=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ei(this,t,r,405,"Invalid HTTP method");return}if(a===void 0||a.toLowerCase()!=="websocket"){ei(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!JU.test(o)){ei(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(s!==13&&s!==8){ei(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){as(r,400);return}let c=t.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=FU.parse(c)}catch{ei(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let f=new Xn({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=ME.parse(d);h[Xn.extensionName]&&(f.accept(h[Xn.extensionName]),p[Xn.extensionName]=f)}catch{ei(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:t.headers[`${s===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,m,g,v)=>{if(!h)return as(r,m||401,g,v);this.completeUpgrade(p,o,u,t,r,i,n)});return}if(!this.options.verifyClient(f))return as(r,401)}this.completeUpgrade(p,o,u,t,r,i,n)}completeUpgrade(t,r,i,n,o,a,s){if(!o.readable||!o.writable)return o.destroy();if(o[WU])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>UE)return as(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${ZU("sha1").update(r+HU).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(i.size){let p=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[Xn.extensionName]){let p=t[Xn.extensionName].params,f=ME.format({[Xn.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${f}`),d._extensions=t}this.emit("headers",u,n),o.write(u.concat(`\r
25
25
  `).join(`\r
26
- `)),o.removeListener("error",kE),d.setSocket(o,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(is,this)})),s(d,n)}};IE.exports=qy;function jU(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let i of Object.keys(t))e.removeListener(i,t[i])}}function is(e){e._state=TE,e.emit("close")}function kE(){this.destroy()}function os(e,t,r,i){r=r||Jd.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Jd.STATUS_CODES[t]}\r
26
+ `)),o.removeListener("error",qE),d.setSocket(o,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(os,this)})),s(d,n)}};FE.exports=By;function GU(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let i of Object.keys(t))e.removeListener(i,t[i])}}function os(e){e._state=ZE,e.emit("close")}function qE(){this.destroy()}function as(e,t,r,i){r=r||Kd.STATUS_CODES[t],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Kd.STATUS_CODES[t]}\r
27
27
  `+Object.keys(i).map(n=>`${n}: ${i[n]}`).join(`\r
28
28
  `)+`\r
29
29
  \r
30
- `+r)}function Yn(e,t,r,i,n,o){if(e.listenerCount("wsClientError")){let a=new Error(n);Error.captureStackTrace(a,Yn),e.emit("wsClientError",a,r,t)}else os(r,i,n,o)}});var Ns=T(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.regexpCode=ye.getEsmExportName=ye.getProperty=ye.safeStringify=ye.stringify=ye.strConcat=ye.addCodeArg=ye.str=ye._=ye.nil=ye._Code=ye.Name=ye.IDENTIFIER=ye._CodeOrName=void 0;var js=class{};ye._CodeOrName=js;ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ni=class extends js{constructor(t){if(super(),!ye.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}}};ye.Name=ni;var Lt=class extends js{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,i)=>`${r}${i}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,i)=>(i instanceof ni&&(r[i.str]=(r[i.str]||0)+1),r),{})}};ye._Code=Lt;ye.nil=new Lt("");function az(e,...t){let r=[e[0]],i=0;for(;i<t.length;)Pv(r,t[i]),r.push(e[++i]);return new Lt(r)}ye._=az;var Ev=new Lt("+");function sz(e,...t){let r=[Ds(e[0])],i=0;for(;i<t.length;)r.push(Ev),Pv(r,t[i]),r.push(Ev,Ds(e[++i]));return GZ(r),new Lt(r)}ye.str=sz;function Pv(e,t){t instanceof Lt?e.push(...t._items):t instanceof ni?e.push(t):e.push(YZ(t))}ye.addCodeArg=Pv;function GZ(e){let t=1;for(;t<e.length-1;){if(e[t]===Ev){let r=KZ(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function KZ(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof ni||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 ni))return`"${e}${t.slice(1)}`}function QZ(e,t){return t.emptyStr()?e:e.emptyStr()?t:sz`${e}${t}`}ye.strConcat=QZ;function YZ(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ds(Array.isArray(e)?e.join(","):e)}function XZ(e){return new Lt(Ds(e))}ye.stringify=XZ;function Ds(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ye.safeStringify=Ds;function eF(e){return typeof e=="string"&&ye.IDENTIFIER.test(e)?new Lt(`.${e}`):az`[${e}]`}ye.getProperty=eF;function tF(e){if(typeof e=="string"&&ye.IDENTIFIER.test(e))return new Lt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ye.getEsmExportName=tF;function rF(e){return new Lt(e.toString())}ye.regexpCode=rF});var Ov=T(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var St=Ns(),zv=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Rp;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Rp||(xt.UsedValueState=Rp={}));xt.varKinds={const:new St.Name("const"),let:new St.Name("let"),var:new St.Name("var")};var Op=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof St.Name?t:this.name(t)}name(t){return new St.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.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}}};xt.Scope=Op;var jp=class extends St.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:i}){this.value=t,this.scopePath=(0,St._)`.${new St.Name(r)}[${i}]`}};xt.ValueScopeName=jp;var nF=(0,St._)`\n`,Rv=class extends Op{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?nF:St.nil}}get(){return this._scope}name(t){return new jp(t,this._newName(t))}value(t,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(t),{prefix:o}=n,a=(i=r.key)!==null&&i!==void 0?i:r.ref,s=this._values[o];if(s){let d=s.get(a);if(d)return d}else s=this._values[o]=new Map;s.set(a,n);let l=this._scope[o]||(this._scope[o]=[]),u=l.length;return l[u]=r.ref,n.setValue(r,{property:o,itemIndex:u}),n}getValue(t,r){let i=this._values[t];if(i)return i.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,St._)`${t}${i.scopePath}`})}scopeCode(t=this._values,r,i){return this._reduceValues(t,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,i)}_reduceValues(t,r,i={},n){let o=St.nil;for(let a in t){let s=t[a];if(!s)continue;let l=i[a]=i[a]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,Rp.Started);let d=r(u);if(d){let p=this.opts.es5?xt.varKinds.var:xt.varKinds.const;o=(0,St._)`${o}${p} ${u} = ${d};${this.opts._n}`}else if(d=n?.(u))o=(0,St._)`${o}${d}${this.opts._n}`;else throw new zv(u);l.set(u,Rp.Completed)})}return o}};xt.ValueScope=Rv});var ae=T(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.or=le.and=le.not=le.CodeGen=le.operators=le.varKinds=le.ValueScopeName=le.ValueScope=le.Scope=le.Name=le.regexpCode=le.stringify=le.getProperty=le.nil=le.strConcat=le.str=le._=void 0;var fe=Ns(),nr=Ov(),gn=Ns();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return gn._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return gn.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return gn.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return gn.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return gn.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return gn.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return gn.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return gn.Name}});var Ap=Ov();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return Ap.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return Ap.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return Ap.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return Ap.varKinds}});le.operators={GT:new fe._Code(">"),GTE:new fe._Code(">="),LT:new fe._Code("<"),LTE:new fe._Code("<="),EQ:new fe._Code("==="),NEQ:new fe._Code("!=="),NOT:new fe._Code("!"),OR:new fe._Code("||"),AND:new fe._Code("&&"),ADD:new fe._Code("+")};var Mr=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},jv=class extends Mr{constructor(t,r,i){super(),this.varKind=t,this.name=r,this.rhs=i}render({es5:t,_n:r}){let i=t?nr.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=To(this.rhs,t,r)),this}get names(){return this.rhs instanceof fe._CodeOrName?this.rhs.names:{}}},Dp=class extends Mr{constructor(t,r,i){super(),this.lhs=t,this.rhs=r,this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof fe.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=To(this.rhs,t,r),this}get names(){let t=this.lhs instanceof fe.Name?{}:{...this.lhs.names};return Cp(t,this.rhs)}},Dv=class extends Dp{constructor(t,r,i,n){super(t,i,n),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Nv=class extends Mr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Cv=class extends Mr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Av=class extends Mr{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Mv=class extends Mr{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=To(this.code,t,r),this}get names(){return this.code instanceof fe._CodeOrName?this.code.names:{}}},Cs=class extends Mr{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,i)=>r+i.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let i=t[r].optimizeNodes();Array.isArray(i)?t.splice(r,1,...i):i?t[r]=i:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:i}=this,n=i.length;for(;n--;){let o=i[n];o.optimizeNames(t,r)||(iF(t,o.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>ai(t,r.names),{})}},Ur=class extends Cs{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Uv=class extends Cs{},ko=class extends Ur{};ko.kind="else";var ii=class e extends Ur{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 i=r.optimizeNodes();r=this.else=Array.isArray(i)?new ko(i):i}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(cz(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=To(this.condition,t,r),this}get names(){let t=super.names;return Cp(t,this.condition),this.else&&ai(t,this.else.names),t}};ii.kind="if";var oi=class extends Ur{};oi.kind="for";var Lv=class extends oi{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=To(this.iteration,t,r),this}get names(){return ai(super.names,this.iteration.names)}},qv=class extends oi{constructor(t,r,i,n){super(),this.varKind=t,this.name=r,this.from=i,this.to=n}render(t){let r=t.es5?nr.varKinds.var:this.varKind,{name:i,from:n,to:o}=this;return`for(${r} ${i}=${n}; ${i}<${o}; ${i}++)`+super.render(t)}get names(){let t=Cp(super.names,this.from);return Cp(t,this.to)}},Np=class extends oi{constructor(t,r,i,n){super(),this.loop=t,this.varKind=r,this.name=i,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=To(this.iterable,t,r),this}get names(){return ai(super.names,this.iterable.names)}},As=class extends Ur{constructor(t,r,i){super(),this.name=t,this.args=r,this.async=i}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};As.kind="func";var Ms=class extends Cs{render(t){return"return "+super.render(t)}};Ms.kind="return";var Zv=class extends Ur{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 i,n;return super.optimizeNames(t,r),(i=this.catch)===null||i===void 0||i.optimizeNames(t,r),(n=this.finally)===null||n===void 0||n.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&ai(t,this.catch.names),this.finally&&ai(t,this.finally.names),t}},Us=class extends Ur{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Us.kind="catch";var Ls=class extends Ur{render(t){return"finally"+super.render(t)}};Ls.kind="finally";var Fv=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
31
- `:""},this._extScope=t,this._scope=new nr.Scope({parent:t}),this._nodes=[new Uv]}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 i=this._extScope.value(t,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}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,i,n){let o=this._scope.toName(r);return i!==void 0&&n&&(this._constants[o.str]=i),this._leafNode(new jv(t,o,i)),o}const(t,r,i){return this._def(nr.varKinds.const,t,r,i)}let(t,r,i){return this._def(nr.varKinds.let,t,r,i)}var(t,r,i){return this._def(nr.varKinds.var,t,r,i)}assign(t,r,i){return this._leafNode(new Dp(t,r,i))}add(t,r){return this._leafNode(new Dv(t,le.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==fe.nil&&this._leafNode(new Mv(t)),this}object(...t){let r=["{"];for(let[i,n]of t)r.length>1&&r.push(","),r.push(i),(i!==n||this.opts.es5)&&(r.push(":"),(0,fe.addCodeArg)(r,n));return r.push("}"),new fe._Code(r)}if(t,r,i){if(this._blockNode(new ii(t)),r&&i)this.code(r).else().code(i).endIf();else if(r)this.code(r).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new ii(t))}else(){return this._elseNode(new ko)}endIf(){return this._endBlockNode(ii,ko)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Lv(t),r)}forRange(t,r,i,n,o=this.opts.es5?nr.varKinds.var:nr.varKinds.let){let a=this._scope.toName(t);return this._for(new qv(o,a,r,i),()=>n(a))}forOf(t,r,i,n=nr.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let a=r instanceof fe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,fe._)`${a}.length`,s=>{this.var(o,(0,fe._)`${a}[${s}]`),i(o)})}return this._for(new Np("of",n,o,r),()=>i(o))}forIn(t,r,i,n=this.opts.es5?nr.varKinds.var:nr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,fe._)`Object.keys(${r})`,i);let o=this._scope.toName(t);return this._for(new Np("in",n,o,r),()=>i(o))}endFor(){return this._endBlockNode(oi)}label(t){return this._leafNode(new Nv(t))}break(t){return this._leafNode(new Cv(t))}return(t){let r=new Ms;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ms)}try(t,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Zv;if(this._blockNode(n),this.code(t),r){let o=this.name("e");this._currNode=n.catch=new Us(o),r(o)}return i&&(this._currNode=n.finally=new Ls,this.code(i)),this._endBlockNode(Us,Ls)}throw(t){return this._leafNode(new Av(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 i=this._nodes.length-r;if(i<0||t!==void 0&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=fe.nil,i,n){return this._blockNode(new As(t,r,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(As)}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 i=this._currNode;if(i instanceof t||r&&i 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 ii))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}};le.CodeGen=Fv;function ai(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Cp(e,t){return t instanceof fe._CodeOrName?ai(e,t.names):e}function To(e,t,r){if(e instanceof fe.Name)return i(e);if(!n(e))return e;return new fe._Code(e._items.reduce((o,a)=>(a instanceof fe.Name&&(a=i(a)),a instanceof fe._Code?o.push(...a._items):o.push(a),o),[]));function i(o){let a=r[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function n(o){return o instanceof fe._Code&&o._items.some(a=>a instanceof fe.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function iF(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function cz(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,fe._)`!${Vv(e)}`}le.not=cz;var oF=lz(le.operators.AND);function aF(...e){return e.reduce(oF)}le.and=aF;var sF=lz(le.operators.OR);function cF(...e){return e.reduce(sF)}le.or=cF;function lz(e){return(t,r)=>t===fe.nil?r:r===fe.nil?t:(0,fe._)`${Vv(t)} ${e} ${Vv(r)}`}function Vv(e){return e instanceof fe.Name?e:(0,fe._)`(${e})`}});var he=T(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;var Ee=ae(),lF=Ns();function uF(e){let t={};for(let r of e)t[r]=!0;return t}ue.toHash=uF;function dF(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(pz(e,t),!mz(t,e.self.RULES.all))}ue.alwaysValidSchema=dF;function pz(e,t=e.schema){let{opts:r,self:i}=e;if(!r.strictSchema||typeof t=="boolean")return;let n=i.RULES.keywords;for(let o in t)n[o]||gz(e,`unknown keyword: "${o}"`)}ue.checkUnknownRules=pz;function mz(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ue.schemaHasRules=mz;function pF(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ue.schemaHasRulesButRef=pF;function mF({topSchemaRef:e,schemaPath:t},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ee._)`${r}`}return(0,Ee._)`${e}${t}${(0,Ee.getProperty)(i)}`}ue.schemaRefOrVal=mF;function fF(e){return fz(decodeURIComponent(e))}ue.unescapeFragment=fF;function hF(e){return encodeURIComponent(Hv(e))}ue.escapeFragment=hF;function Hv(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Hv;function fz(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=fz;function gF(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ue.eachItem=gF;function uz({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(n,o,a,s)=>{let l=a===void 0?o:a instanceof Ee.Name?(o instanceof Ee.Name?e(n,o,a):t(n,o,a),a):o instanceof Ee.Name?(t(n,a,o),o):r(o,a);return s===Ee.Name&&!(l instanceof Ee.Name)?i(n,l):l}}ue.mergeEvaluated={props:uz({mergeNames:(e,t,r)=>e.if((0,Ee._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Ee._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Ee._)`${r} || {}`).code((0,Ee._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Ee._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Ee._)`${r} || {}`),Wv(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:hz}),items:uz({mergeNames:(e,t,r)=>e.if((0,Ee._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Ee._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Ee._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Ee._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function hz(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Ee._)`{}`);return t!==void 0&&Wv(e,r,t),r}ue.evaluatedPropsToName=hz;function Wv(e,t,r){Object.keys(r).forEach(i=>e.assign((0,Ee._)`${t}${(0,Ee.getProperty)(i)}`,!0))}ue.setEvaluated=Wv;var dz={};function yF(e,t){return e.scopeValue("func",{ref:t,code:dz[t.code]||(dz[t.code]=new lF._Code(t.code))})}ue.useFunc=yF;var Bv;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Bv||(ue.Type=Bv={}));function vF(e,t,r){if(e instanceof Ee.Name){let i=t===Bv.Num;return r?i?(0,Ee._)`"[" + ${e} + "]"`:(0,Ee._)`"['" + ${e} + "']"`:i?(0,Ee._)`"/" + ${e}`:(0,Ee._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ee.getProperty)(e).toString():"/"+Hv(e)}ue.getErrorPath=vF;function gz(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ue.checkStrictMode=gz});var Lr=T(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var it=ae(),bF={data:new it.Name("data"),valCxt:new it.Name("valCxt"),instancePath:new it.Name("instancePath"),parentData:new it.Name("parentData"),parentDataProperty:new it.Name("parentDataProperty"),rootData:new it.Name("rootData"),dynamicAnchors:new it.Name("dynamicAnchors"),vErrors:new it.Name("vErrors"),errors:new it.Name("errors"),this:new it.Name("this"),self:new it.Name("self"),scope:new it.Name("scope"),json:new it.Name("json"),jsonPos:new it.Name("jsonPos"),jsonLen:new it.Name("jsonLen"),jsonPart:new it.Name("jsonPart")};Jv.default=bF});var qs=T(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.extendErrors=ot.resetErrorsCount=ot.reportExtraError=ot.reportError=ot.keyword$DataError=ot.keywordError=void 0;var ge=ae(),Mp=he(),pt=Lr();ot.keywordError={message:({keyword:e})=>(0,ge.str)`must pass "${e}" keyword validation`};ot.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ge.str)`"${e}" keyword must be ${t} ($data)`:(0,ge.str)`"${e}" keyword is invalid ($data)`};function _F(e,t=ot.keywordError,r,i){let{it:n}=e,{gen:o,compositeRule:a,allErrors:s}=n,l=bz(e,t,r);i??(a||s)?yz(o,l):vz(n,(0,ge._)`[${l}]`)}ot.reportError=_F;function SF(e,t=ot.keywordError,r){let{it:i}=e,{gen:n,compositeRule:o,allErrors:a}=i,s=bz(e,t,r);yz(n,s),o||a||vz(i,pt.default.vErrors)}ot.reportExtraError=SF;function xF(e,t){e.assign(pt.default.errors,t),e.if((0,ge._)`${pt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ge._)`${pt.default.vErrors}.length`,t),()=>e.assign(pt.default.vErrors,null)))}ot.resetErrorsCount=xF;function wF({gen:e,keyword:t,schemaValue:r,data:i,errsCount:n,it:o}){if(n===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",n,pt.default.errors,s=>{e.const(a,(0,ge._)`${pt.default.vErrors}[${s}]`),e.if((0,ge._)`${a}.instancePath === undefined`,()=>e.assign((0,ge._)`${a}.instancePath`,(0,ge.strConcat)(pt.default.instancePath,o.errorPath))),e.assign((0,ge._)`${a}.schemaPath`,(0,ge.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,ge._)`${a}.schema`,r),e.assign((0,ge._)`${a}.data`,i))})}ot.extendErrors=wF;function yz(e,t){let r=e.const("err",t);e.if((0,ge._)`${pt.default.vErrors} === null`,()=>e.assign(pt.default.vErrors,(0,ge._)`[${r}]`),(0,ge._)`${pt.default.vErrors}.push(${r})`),e.code((0,ge._)`${pt.default.errors}++`)}function vz(e,t){let{gen:r,validateName:i,schemaEnv:n}=e;n.$async?r.throw((0,ge._)`new ${e.ValidationError}(${t})`):(r.assign((0,ge._)`${i}.errors`,t),r.return(!1))}var si={keyword:new ge.Name("keyword"),schemaPath:new ge.Name("schemaPath"),params:new ge.Name("params"),propertyName:new ge.Name("propertyName"),message:new ge.Name("message"),schema:new ge.Name("schema"),parentSchema:new ge.Name("parentSchema")};function bz(e,t,r){let{createErrors:i}=e.it;return i===!1?(0,ge._)`{}`:$F(e,t,r)}function $F(e,t,r={}){let{gen:i,it:n}=e,o=[kF(n,r),TF(e,r)];return IF(e,t,o),i.object(...o)}function kF({errorPath:e},{instancePath:t}){let r=t?(0,ge.str)`${e}${(0,Mp.getErrorPath)(t,Mp.Type.Str)}`:e;return[pt.default.instancePath,(0,ge.strConcat)(pt.default.instancePath,r)]}function TF({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:(0,ge.str)`${t}/${e}`;return r&&(n=(0,ge.str)`${n}${(0,Mp.getErrorPath)(r,Mp.Type.Str)}`),[si.schemaPath,n]}function IF(e,{params:t,message:r},i){let{keyword:n,data:o,schemaValue:a,it:s}=e,{opts:l,propertyName:u,topSchemaRef:d,schemaPath:p}=s;i.push([si.keyword,n],[si.params,typeof t=="function"?t(e):t||(0,ge._)`{}`]),l.messages&&i.push([si.message,typeof r=="function"?r(e):r]),l.verbose&&i.push([si.schema,a],[si.parentSchema,(0,ge._)`${d}${p}`],[pt.default.data,o]),u&&i.push([si.propertyName,u])}});var Sz=T(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.boolOrEmptySchema=Io.topBoolOrEmptySchema=void 0;var EF=qs(),PF=ae(),zF=Lr(),RF={message:"boolean schema is false"};function OF(e){let{gen:t,schema:r,validateName:i}=e;r===!1?_z(e,!1):typeof r=="object"&&r.$async===!0?t.return(zF.default.data):(t.assign((0,PF._)`${i}.errors`,null),t.return(!0))}Io.topBoolOrEmptySchema=OF;function jF(e,t){let{gen:r,schema:i}=e;i===!1?(r.var(t,!1),_z(e)):r.var(t,!0)}Io.boolOrEmptySchema=jF;function _z(e,t){let{gen:r,data:i}=e,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,EF.reportError)(n,RF,void 0,t)}});var Gv=T(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.getRules=Eo.isJSONType=void 0;var DF=["string","number","integer","boolean","null","object","array"],NF=new Set(DF);function CF(e){return typeof e=="string"&&NF.has(e)}Eo.isJSONType=CF;function AF(){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:{}}}Eo.getRules=AF});var Kv=T(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.shouldUseRule=yn.shouldUseGroup=yn.schemaHasRulesForType=void 0;function MF({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&xz(e,i)}yn.schemaHasRulesForType=MF;function xz(e,t){return t.rules.some(r=>wz(e,r))}yn.shouldUseGroup=xz;function wz(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(i=>e[i]!==void 0))}yn.shouldUseRule=wz});var Zs=T(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.reportTypeError=at.checkDataTypes=at.checkDataType=at.coerceAndCheckDataType=at.getJSONTypes=at.getSchemaTypes=at.DataType=void 0;var UF=Gv(),LF=Kv(),qF=qs(),oe=ae(),$z=he(),Po;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Po||(at.DataType=Po={}));function ZF(e){let t=kz(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}at.getSchemaTypes=ZF;function kz(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(UF.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}at.getJSONTypes=kz;function FF(e,t){let{gen:r,data:i,opts:n}=e,o=VF(t,n.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,LF.schemaHasRulesForType)(e,t[0]));if(a){let s=Yv(t,i,n.strictNumbers,Po.Wrong);r.if(s,()=>{o.length?BF(e,t,o):Xv(e)})}return a}at.coerceAndCheckDataType=FF;var Tz=new Set(["string","number","integer","boolean","null"]);function VF(e,t){return t?e.filter(r=>Tz.has(r)||t==="array"&&r==="array"):[]}function BF(e,t,r){let{gen:i,data:n,opts:o}=e,a=i.let("dataType",(0,oe._)`typeof ${n}`),s=i.let("coerced",(0,oe._)`undefined`);o.coerceTypes==="array"&&i.if((0,oe._)`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,oe._)`${n}[0]`).assign(a,(0,oe._)`typeof ${n}`).if(Yv(t,n,o.strictNumbers),()=>i.assign(s,n))),i.if((0,oe._)`${s} !== undefined`);for(let u of r)(Tz.has(u)||u==="array"&&o.coerceTypes==="array")&&l(u);i.else(),Xv(e),i.endIf(),i.if((0,oe._)`${s} !== undefined`,()=>{i.assign(n,s),HF(e,s)});function l(u){switch(u){case"string":i.elseIf((0,oe._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,oe._)`"" + ${n}`).elseIf((0,oe._)`${n} === null`).assign(s,(0,oe._)`""`);return;case"number":i.elseIf((0,oe._)`${a} == "boolean" || ${n} === null
30
+ `+r)}function ei(e,t,r,i,n,o){if(e.listenerCount("wsClientError")){let a=new Error(n);Error.captureStackTrace(a,ei),e.emit("wsClientError",a,r,t)}else as(r,i,n,o)}});var Cs=I(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.regexpCode=ye.getEsmExportName=ye.getProperty=ye.safeStringify=ye.stringify=ye.strConcat=ye.addCodeArg=ye.str=ye._=ye.nil=ye._Code=ye.Name=ye.IDENTIFIER=ye._CodeOrName=void 0;var Ds=class{};ye._CodeOrName=Ds;ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ii=class extends Ds{constructor(t){if(super(),!ye.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}}};ye.Name=ii;var qt=class extends Ds{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,i)=>`${r}${i}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,i)=>(i instanceof ii&&(r[i.str]=(r[i.str]||0)+1),r),{})}};ye._Code=qt;ye.nil=new qt("");function xz(e,...t){let r=[e[0]],i=0;for(;i<t.length;)jv(r,t[i]),r.push(e[++i]);return new qt(r)}ye._=xz;var Ov=new qt("+");function wz(e,...t){let r=[Ns(e[0])],i=0;for(;i<t.length;)r.push(Ov),jv(r,t[i]),r.push(Ov,Ns(e[++i]));return gF(r),new qt(r)}ye.str=wz;function jv(e,t){t instanceof qt?e.push(...t._items):t instanceof ii?e.push(t):e.push(bF(t))}ye.addCodeArg=jv;function gF(e){let t=1;for(;t<e.length-1;){if(e[t]===Ov){let r=yF(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function yF(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof ii||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 ii))return`"${e}${t.slice(1)}`}function vF(e,t){return t.emptyStr()?e:e.emptyStr()?t:wz`${e}${t}`}ye.strConcat=vF;function bF(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ns(Array.isArray(e)?e.join(","):e)}function _F(e){return new qt(Ns(e))}ye.stringify=_F;function Ns(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ye.safeStringify=Ns;function SF(e){return typeof e=="string"&&ye.IDENTIFIER.test(e)?new qt(`.${e}`):xz`[${e}]`}ye.getProperty=SF;function xF(e){if(typeof e=="string"&&ye.IDENTIFIER.test(e))return new qt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ye.getEsmExportName=xF;function wF(e){return new qt(e.toString())}ye.regexpCode=wF});var Cv=I(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.ValueScope=wt.ValueScopeName=wt.Scope=wt.varKinds=wt.UsedValueState=void 0;var xt=Cs(),Dv=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Np;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Np||(wt.UsedValueState=Np={}));wt.varKinds={const:new xt.Name("const"),let:new xt.Name("let"),var:new xt.Name("var")};var Cp=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof xt.Name?t:this.name(t)}name(t){return new xt.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.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}}};wt.Scope=Cp;var Ap=class extends xt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:i}){this.value=t,this.scopePath=(0,xt._)`.${new xt.Name(r)}[${i}]`}};wt.ValueScopeName=Ap;var $F=(0,xt._)`\n`,Nv=class extends Cp{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?$F:xt.nil}}get(){return this._scope}name(t){return new Ap(t,this._newName(t))}value(t,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(t),{prefix:o}=n,a=(i=r.key)!==null&&i!==void 0?i:r.ref,s=this._values[o];if(s){let d=s.get(a);if(d)return d}else s=this._values[o]=new Map;s.set(a,n);let c=this._scope[o]||(this._scope[o]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:o,itemIndex:u}),n}getValue(t,r){let i=this._values[t];if(i)return i.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,xt._)`${t}${i.scopePath}`})}scopeCode(t=this._values,r,i){return this._reduceValues(t,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,i)}_reduceValues(t,r,i={},n){let o=xt.nil;for(let a in t){let s=t[a];if(!s)continue;let c=i[a]=i[a]||new Map;s.forEach(u=>{if(c.has(u))return;c.set(u,Np.Started);let d=r(u);if(d){let p=this.opts.es5?wt.varKinds.var:wt.varKinds.const;o=(0,xt._)`${o}${p} ${u} = ${d};${this.opts._n}`}else if(d=n?.(u))o=(0,xt._)`${o}${d}${this.opts._n}`;else throw new Dv(u);c.set(u,Np.Completed)})}return o}};wt.ValueScope=Nv});var ae=I(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.or=le.and=le.not=le.CodeGen=le.operators=le.varKinds=le.ValueScopeName=le.ValueScope=le.Scope=le.Name=le.regexpCode=le.stringify=le.getProperty=le.nil=le.strConcat=le.str=le._=void 0;var fe=Cs(),ir=Cv(),vn=Cs();Object.defineProperty(le,"_",{enumerable:!0,get:function(){return vn._}});Object.defineProperty(le,"str",{enumerable:!0,get:function(){return vn.str}});Object.defineProperty(le,"strConcat",{enumerable:!0,get:function(){return vn.strConcat}});Object.defineProperty(le,"nil",{enumerable:!0,get:function(){return vn.nil}});Object.defineProperty(le,"getProperty",{enumerable:!0,get:function(){return vn.getProperty}});Object.defineProperty(le,"stringify",{enumerable:!0,get:function(){return vn.stringify}});Object.defineProperty(le,"regexpCode",{enumerable:!0,get:function(){return vn.regexpCode}});Object.defineProperty(le,"Name",{enumerable:!0,get:function(){return vn.Name}});var qp=Cv();Object.defineProperty(le,"Scope",{enumerable:!0,get:function(){return qp.Scope}});Object.defineProperty(le,"ValueScope",{enumerable:!0,get:function(){return qp.ValueScope}});Object.defineProperty(le,"ValueScopeName",{enumerable:!0,get:function(){return qp.ValueScopeName}});Object.defineProperty(le,"varKinds",{enumerable:!0,get:function(){return qp.varKinds}});le.operators={GT:new fe._Code(">"),GTE:new fe._Code(">="),LT:new fe._Code("<"),LTE:new fe._Code("<="),EQ:new fe._Code("==="),NEQ:new fe._Code("!=="),NOT:new fe._Code("!"),OR:new fe._Code("||"),AND:new fe._Code("&&"),ADD:new fe._Code("+")};var Lr=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},Av=class extends Lr{constructor(t,r,i){super(),this.varKind=t,this.name=r,this.rhs=i}render({es5:t,_n:r}){let i=t?ir.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Io(this.rhs,t,r)),this}get names(){return this.rhs instanceof fe._CodeOrName?this.rhs.names:{}}},Mp=class extends Lr{constructor(t,r,i){super(),this.lhs=t,this.rhs=r,this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof fe.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Io(this.rhs,t,r),this}get names(){let t=this.lhs instanceof fe.Name?{}:{...this.lhs.names};return Lp(t,this.rhs)}},Mv=class extends Mp{constructor(t,r,i,n){super(t,i,n),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Uv=class extends Lr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Lv=class extends Lr{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},qv=class extends Lr{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Zv=class extends Lr{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=Io(this.code,t,r),this}get names(){return this.code instanceof fe._CodeOrName?this.code.names:{}}},As=class extends Lr{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,i)=>r+i.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let i=t[r].optimizeNodes();Array.isArray(i)?t.splice(r,1,...i):i?t[r]=i:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:i}=this,n=i.length;for(;n--;){let o=i[n];o.optimizeNames(t,r)||(kF(t,o.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>si(t,r.names),{})}},qr=class extends As{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Fv=class extends As{},To=class extends qr{};To.kind="else";var oi=class e extends qr{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 i=r.optimizeNodes();r=this.else=Array.isArray(i)?new To(i):i}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e($z(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Io(this.condition,t,r),this}get names(){let t=super.names;return Lp(t,this.condition),this.else&&si(t,this.else.names),t}};oi.kind="if";var ai=class extends qr{};ai.kind="for";var Vv=class extends ai{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=Io(this.iteration,t,r),this}get names(){return si(super.names,this.iteration.names)}},Bv=class extends ai{constructor(t,r,i,n){super(),this.varKind=t,this.name=r,this.from=i,this.to=n}render(t){let r=t.es5?ir.varKinds.var:this.varKind,{name:i,from:n,to:o}=this;return`for(${r} ${i}=${n}; ${i}<${o}; ${i}++)`+super.render(t)}get names(){let t=Lp(super.names,this.from);return Lp(t,this.to)}},Up=class extends ai{constructor(t,r,i,n){super(),this.loop=t,this.varKind=r,this.name=i,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=Io(this.iterable,t,r),this}get names(){return si(super.names,this.iterable.names)}},Ms=class extends qr{constructor(t,r,i){super(),this.name=t,this.args=r,this.async=i}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Ms.kind="func";var Us=class extends As{render(t){return"return "+super.render(t)}};Us.kind="return";var Hv=class extends qr{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 i,n;return super.optimizeNames(t,r),(i=this.catch)===null||i===void 0||i.optimizeNames(t,r),(n=this.finally)===null||n===void 0||n.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&si(t,this.catch.names),this.finally&&si(t,this.finally.names),t}},Ls=class extends qr{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Ls.kind="catch";var qs=class extends qr{render(t){return"finally"+super.render(t)}};qs.kind="finally";var Wv=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
31
+ `:""},this._extScope=t,this._scope=new ir.Scope({parent:t}),this._nodes=[new Fv]}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 i=this._extScope.value(t,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}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,i,n){let o=this._scope.toName(r);return i!==void 0&&n&&(this._constants[o.str]=i),this._leafNode(new Av(t,o,i)),o}const(t,r,i){return this._def(ir.varKinds.const,t,r,i)}let(t,r,i){return this._def(ir.varKinds.let,t,r,i)}var(t,r,i){return this._def(ir.varKinds.var,t,r,i)}assign(t,r,i){return this._leafNode(new Mp(t,r,i))}add(t,r){return this._leafNode(new Mv(t,le.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==fe.nil&&this._leafNode(new Zv(t)),this}object(...t){let r=["{"];for(let[i,n]of t)r.length>1&&r.push(","),r.push(i),(i!==n||this.opts.es5)&&(r.push(":"),(0,fe.addCodeArg)(r,n));return r.push("}"),new fe._Code(r)}if(t,r,i){if(this._blockNode(new oi(t)),r&&i)this.code(r).else().code(i).endIf();else if(r)this.code(r).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new oi(t))}else(){return this._elseNode(new To)}endIf(){return this._endBlockNode(oi,To)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Vv(t),r)}forRange(t,r,i,n,o=this.opts.es5?ir.varKinds.var:ir.varKinds.let){let a=this._scope.toName(t);return this._for(new Bv(o,a,r,i),()=>n(a))}forOf(t,r,i,n=ir.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let a=r instanceof fe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,fe._)`${a}.length`,s=>{this.var(o,(0,fe._)`${a}[${s}]`),i(o)})}return this._for(new Up("of",n,o,r),()=>i(o))}forIn(t,r,i,n=this.opts.es5?ir.varKinds.var:ir.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,fe._)`Object.keys(${r})`,i);let o=this._scope.toName(t);return this._for(new Up("in",n,o,r),()=>i(o))}endFor(){return this._endBlockNode(ai)}label(t){return this._leafNode(new Uv(t))}break(t){return this._leafNode(new Lv(t))}return(t){let r=new Us;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Us)}try(t,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Hv;if(this._blockNode(n),this.code(t),r){let o=this.name("e");this._currNode=n.catch=new Ls(o),r(o)}return i&&(this._currNode=n.finally=new qs,this.code(i)),this._endBlockNode(Ls,qs)}throw(t){return this._leafNode(new qv(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 i=this._nodes.length-r;if(i<0||t!==void 0&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=fe.nil,i,n){return this._blockNode(new Ms(t,r,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Ms)}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 i=this._currNode;if(i instanceof t||r&&i 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 oi))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}};le.CodeGen=Wv;function si(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Lp(e,t){return t instanceof fe._CodeOrName?si(e,t.names):e}function Io(e,t,r){if(e instanceof fe.Name)return i(e);if(!n(e))return e;return new fe._Code(e._items.reduce((o,a)=>(a instanceof fe.Name&&(a=i(a)),a instanceof fe._Code?o.push(...a._items):o.push(a),o),[]));function i(o){let a=r[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function n(o){return o instanceof fe._Code&&o._items.some(a=>a instanceof fe.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function kF(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function $z(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,fe._)`!${Jv(e)}`}le.not=$z;var TF=kz(le.operators.AND);function IF(...e){return e.reduce(TF)}le.and=IF;var EF=kz(le.operators.OR);function PF(...e){return e.reduce(EF)}le.or=PF;function kz(e){return(t,r)=>t===fe.nil?r:r===fe.nil?t:(0,fe._)`${Jv(t)} ${e} ${Jv(r)}`}function Jv(e){return e instanceof fe.Name?e:(0,fe._)`(${e})`}});var he=I(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;var Ee=ae(),zF=Cs();function RF(e){let t={};for(let r of e)t[r]=!0;return t}ue.toHash=RF;function OF(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Ez(e,t),!Pz(t,e.self.RULES.all))}ue.alwaysValidSchema=OF;function Ez(e,t=e.schema){let{opts:r,self:i}=e;if(!r.strictSchema||typeof t=="boolean")return;let n=i.RULES.keywords;for(let o in t)n[o]||Oz(e,`unknown keyword: "${o}"`)}ue.checkUnknownRules=Ez;function Pz(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ue.schemaHasRules=Pz;function jF(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ue.schemaHasRulesButRef=jF;function DF({topSchemaRef:e,schemaPath:t},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ee._)`${r}`}return(0,Ee._)`${e}${t}${(0,Ee.getProperty)(i)}`}ue.schemaRefOrVal=DF;function NF(e){return zz(decodeURIComponent(e))}ue.unescapeFragment=NF;function CF(e){return encodeURIComponent(Kv(e))}ue.escapeFragment=CF;function Kv(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=Kv;function zz(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=zz;function AF(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ue.eachItem=AF;function Tz({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(n,o,a,s)=>{let c=a===void 0?o:a instanceof Ee.Name?(o instanceof Ee.Name?e(n,o,a):t(n,o,a),a):o instanceof Ee.Name?(t(n,a,o),o):r(o,a);return s===Ee.Name&&!(c instanceof Ee.Name)?i(n,c):c}}ue.mergeEvaluated={props:Tz({mergeNames:(e,t,r)=>e.if((0,Ee._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Ee._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Ee._)`${r} || {}`).code((0,Ee._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Ee._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Ee._)`${r} || {}`),Qv(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Rz}),items:Tz({mergeNames:(e,t,r)=>e.if((0,Ee._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Ee._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Ee._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Ee._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Rz(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Ee._)`{}`);return t!==void 0&&Qv(e,r,t),r}ue.evaluatedPropsToName=Rz;function Qv(e,t,r){Object.keys(r).forEach(i=>e.assign((0,Ee._)`${t}${(0,Ee.getProperty)(i)}`,!0))}ue.setEvaluated=Qv;var Iz={};function MF(e,t){return e.scopeValue("func",{ref:t,code:Iz[t.code]||(Iz[t.code]=new zF._Code(t.code))})}ue.useFunc=MF;var Gv;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Gv||(ue.Type=Gv={}));function UF(e,t,r){if(e instanceof Ee.Name){let i=t===Gv.Num;return r?i?(0,Ee._)`"[" + ${e} + "]"`:(0,Ee._)`"['" + ${e} + "']"`:i?(0,Ee._)`"/" + ${e}`:(0,Ee._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ee.getProperty)(e).toString():"/"+Kv(e)}ue.getErrorPath=UF;function Oz(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ue.checkStrictMode=Oz});var Zr=I(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var ot=ae(),LF={data:new ot.Name("data"),valCxt:new ot.Name("valCxt"),instancePath:new ot.Name("instancePath"),parentData:new ot.Name("parentData"),parentDataProperty:new ot.Name("parentDataProperty"),rootData:new ot.Name("rootData"),dynamicAnchors:new ot.Name("dynamicAnchors"),vErrors:new ot.Name("vErrors"),errors:new ot.Name("errors"),this:new ot.Name("this"),self:new ot.Name("self"),scope:new ot.Name("scope"),json:new ot.Name("json"),jsonPos:new ot.Name("jsonPos"),jsonLen:new ot.Name("jsonLen"),jsonPart:new ot.Name("jsonPart")};Yv.default=LF});var Zs=I(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.extendErrors=at.resetErrorsCount=at.reportExtraError=at.reportError=at.keyword$DataError=at.keywordError=void 0;var ge=ae(),Zp=he(),mt=Zr();at.keywordError={message:({keyword:e})=>(0,ge.str)`must pass "${e}" keyword validation`};at.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ge.str)`"${e}" keyword must be ${t} ($data)`:(0,ge.str)`"${e}" keyword is invalid ($data)`};function qF(e,t=at.keywordError,r,i){let{it:n}=e,{gen:o,compositeRule:a,allErrors:s}=n,c=Nz(e,t,r);i??(a||s)?jz(o,c):Dz(n,(0,ge._)`[${c}]`)}at.reportError=qF;function ZF(e,t=at.keywordError,r){let{it:i}=e,{gen:n,compositeRule:o,allErrors:a}=i,s=Nz(e,t,r);jz(n,s),o||a||Dz(i,mt.default.vErrors)}at.reportExtraError=ZF;function FF(e,t){e.assign(mt.default.errors,t),e.if((0,ge._)`${mt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ge._)`${mt.default.vErrors}.length`,t),()=>e.assign(mt.default.vErrors,null)))}at.resetErrorsCount=FF;function VF({gen:e,keyword:t,schemaValue:r,data:i,errsCount:n,it:o}){if(n===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",n,mt.default.errors,s=>{e.const(a,(0,ge._)`${mt.default.vErrors}[${s}]`),e.if((0,ge._)`${a}.instancePath === undefined`,()=>e.assign((0,ge._)`${a}.instancePath`,(0,ge.strConcat)(mt.default.instancePath,o.errorPath))),e.assign((0,ge._)`${a}.schemaPath`,(0,ge.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,ge._)`${a}.schema`,r),e.assign((0,ge._)`${a}.data`,i))})}at.extendErrors=VF;function jz(e,t){let r=e.const("err",t);e.if((0,ge._)`${mt.default.vErrors} === null`,()=>e.assign(mt.default.vErrors,(0,ge._)`[${r}]`),(0,ge._)`${mt.default.vErrors}.push(${r})`),e.code((0,ge._)`${mt.default.errors}++`)}function Dz(e,t){let{gen:r,validateName:i,schemaEnv:n}=e;n.$async?r.throw((0,ge._)`new ${e.ValidationError}(${t})`):(r.assign((0,ge._)`${i}.errors`,t),r.return(!1))}var ci={keyword:new ge.Name("keyword"),schemaPath:new ge.Name("schemaPath"),params:new ge.Name("params"),propertyName:new ge.Name("propertyName"),message:new ge.Name("message"),schema:new ge.Name("schema"),parentSchema:new ge.Name("parentSchema")};function Nz(e,t,r){let{createErrors:i}=e.it;return i===!1?(0,ge._)`{}`:BF(e,t,r)}function BF(e,t,r={}){let{gen:i,it:n}=e,o=[HF(n,r),WF(e,r)];return JF(e,t,o),i.object(...o)}function HF({errorPath:e},{instancePath:t}){let r=t?(0,ge.str)`${e}${(0,Zp.getErrorPath)(t,Zp.Type.Str)}`:e;return[mt.default.instancePath,(0,ge.strConcat)(mt.default.instancePath,r)]}function WF({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:(0,ge.str)`${t}/${e}`;return r&&(n=(0,ge.str)`${n}${(0,Zp.getErrorPath)(r,Zp.Type.Str)}`),[ci.schemaPath,n]}function JF(e,{params:t,message:r},i){let{keyword:n,data:o,schemaValue:a,it:s}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:p}=s;i.push([ci.keyword,n],[ci.params,typeof t=="function"?t(e):t||(0,ge._)`{}`]),c.messages&&i.push([ci.message,typeof r=="function"?r(e):r]),c.verbose&&i.push([ci.schema,a],[ci.parentSchema,(0,ge._)`${d}${p}`],[mt.default.data,o]),u&&i.push([ci.propertyName,u])}});var Az=I(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.boolOrEmptySchema=Eo.topBoolOrEmptySchema=void 0;var GF=Zs(),KF=ae(),QF=Zr(),YF={message:"boolean schema is false"};function XF(e){let{gen:t,schema:r,validateName:i}=e;r===!1?Cz(e,!1):typeof r=="object"&&r.$async===!0?t.return(QF.default.data):(t.assign((0,KF._)`${i}.errors`,null),t.return(!0))}Eo.topBoolOrEmptySchema=XF;function e5(e,t){let{gen:r,schema:i}=e;i===!1?(r.var(t,!1),Cz(e)):r.var(t,!0)}Eo.boolOrEmptySchema=e5;function Cz(e,t){let{gen:r,data:i}=e,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,GF.reportError)(n,YF,void 0,t)}});var Xv=I(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.getRules=Po.isJSONType=void 0;var t5=["string","number","integer","boolean","null","object","array"],r5=new Set(t5);function n5(e){return typeof e=="string"&&r5.has(e)}Po.isJSONType=n5;function i5(){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:{}}}Po.getRules=i5});var eb=I(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.shouldUseRule=bn.shouldUseGroup=bn.schemaHasRulesForType=void 0;function o5({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&Mz(e,i)}bn.schemaHasRulesForType=o5;function Mz(e,t){return t.rules.some(r=>Uz(e,r))}bn.shouldUseGroup=Mz;function Uz(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(i=>e[i]!==void 0))}bn.shouldUseRule=Uz});var Fs=I(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.reportTypeError=st.checkDataTypes=st.checkDataType=st.coerceAndCheckDataType=st.getJSONTypes=st.getSchemaTypes=st.DataType=void 0;var a5=Xv(),s5=eb(),c5=Zs(),oe=ae(),Lz=he(),zo;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(zo||(st.DataType=zo={}));function l5(e){let t=qz(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}st.getSchemaTypes=l5;function qz(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(a5.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}st.getJSONTypes=qz;function u5(e,t){let{gen:r,data:i,opts:n}=e,o=d5(t,n.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,s5.schemaHasRulesForType)(e,t[0]));if(a){let s=rb(t,i,n.strictNumbers,zo.Wrong);r.if(s,()=>{o.length?p5(e,t,o):nb(e)})}return a}st.coerceAndCheckDataType=u5;var Zz=new Set(["string","number","integer","boolean","null"]);function d5(e,t){return t?e.filter(r=>Zz.has(r)||t==="array"&&r==="array"):[]}function p5(e,t,r){let{gen:i,data:n,opts:o}=e,a=i.let("dataType",(0,oe._)`typeof ${n}`),s=i.let("coerced",(0,oe._)`undefined`);o.coerceTypes==="array"&&i.if((0,oe._)`${a} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,oe._)`${n}[0]`).assign(a,(0,oe._)`typeof ${n}`).if(rb(t,n,o.strictNumbers),()=>i.assign(s,n))),i.if((0,oe._)`${s} !== undefined`);for(let u of r)(Zz.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);i.else(),nb(e),i.endIf(),i.if((0,oe._)`${s} !== undefined`,()=>{i.assign(n,s),m5(e,s)});function c(u){switch(u){case"string":i.elseIf((0,oe._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,oe._)`"" + ${n}`).elseIf((0,oe._)`${n} === null`).assign(s,(0,oe._)`""`);return;case"number":i.elseIf((0,oe._)`${a} == "boolean" || ${n} === null
32
32
  || (${a} == "string" && ${n} && ${n} == +${n})`).assign(s,(0,oe._)`+${n}`);return;case"integer":i.elseIf((0,oe._)`${a} === "boolean" || ${n} === null
33
33
  || (${a} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(s,(0,oe._)`+${n}`);return;case"boolean":i.elseIf((0,oe._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(s,!1).elseIf((0,oe._)`${n} === "true" || ${n} === 1`).assign(s,!0);return;case"null":i.elseIf((0,oe._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(s,null);return;case"array":i.elseIf((0,oe._)`${a} === "string" || ${a} === "number"
34
- || ${a} === "boolean" || ${n} === null`).assign(s,(0,oe._)`[${n}]`)}}}function HF({gen:e,parentData:t,parentDataProperty:r},i){e.if((0,oe._)`${t} !== undefined`,()=>e.assign((0,oe._)`${t}[${r}]`,i))}function Qv(e,t,r,i=Po.Correct){let n=i===Po.Correct?oe.operators.EQ:oe.operators.NEQ,o;switch(e){case"null":return(0,oe._)`${t} ${n} null`;case"array":o=(0,oe._)`Array.isArray(${t})`;break;case"object":o=(0,oe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,oe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,oe._)`typeof ${t} ${n} ${e}`}return i===Po.Correct?o:(0,oe.not)(o);function a(s=oe.nil){return(0,oe.and)((0,oe._)`typeof ${t} == "number"`,s,r?(0,oe._)`isFinite(${t})`:oe.nil)}}at.checkDataType=Qv;function Yv(e,t,r,i){if(e.length===1)return Qv(e[0],t,r,i);let n,o=(0,$z.toHash)(e);if(o.array&&o.object){let a=(0,oe._)`typeof ${t} != "object"`;n=o.null?a:(0,oe._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else n=oe.nil;o.number&&delete o.integer;for(let a in o)n=(0,oe.and)(n,Qv(a,t,r,i));return n}at.checkDataTypes=Yv;var WF={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,oe._)`{type: ${e}}`:(0,oe._)`{type: ${t}}`};function Xv(e){let t=JF(e);(0,qF.reportError)(t,WF)}at.reportTypeError=Xv;function JF(e){let{gen:t,data:r,schema:i}=e,n=(0,$z.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}});var Ez=T(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.assignDefaults=void 0;var zo=ae(),GF=he();function KF(e,t){let{properties:r,items:i}=e.schema;if(t==="object"&&r)for(let n in r)Iz(e,n,r[n].default);else t==="array"&&Array.isArray(i)&&i.forEach((n,o)=>Iz(e,o,n.default))}Up.assignDefaults=KF;function Iz(e,t,r){let{gen:i,compositeRule:n,data:o,opts:a}=e;if(r===void 0)return;let s=(0,zo._)`${o}${(0,zo.getProperty)(t)}`;if(n){(0,GF.checkStrictMode)(e,`default is ignored for: ${s}`);return}let l=(0,zo._)`${s} === undefined`;a.useDefaults==="empty"&&(l=(0,zo._)`${l} || ${s} === null || ${s} === ""`),i.if(l,(0,zo._)`${s} = ${(0,zo.stringify)(r)}`)}});var qt=T(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.validateUnion=Te.validateArray=Te.usePattern=Te.callValidateCode=Te.schemaProperties=Te.allSchemaProperties=Te.noPropertyInData=Te.propertyInData=Te.isOwnProperty=Te.hasPropFunc=Te.reportMissingProp=Te.checkMissingProp=Te.checkReportMissingProp=void 0;var je=ae(),eb=he(),vn=Lr(),QF=he();function YF(e,t){let{gen:r,data:i,it:n}=e;r.if(rb(r,i,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:(0,je._)`${t}`},!0),e.error()})}Te.checkReportMissingProp=YF;function XF({gen:e,data:t,it:{opts:r}},i,n){return(0,je.or)(...i.map(o=>(0,je.and)(rb(e,t,o,r.ownProperties),(0,je._)`${n} = ${o}`)))}Te.checkMissingProp=XF;function e5(e,t){e.setParams({missingProperty:t},!0),e.error()}Te.reportMissingProp=e5;function Pz(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,je._)`Object.prototype.hasOwnProperty`})}Te.hasPropFunc=Pz;function tb(e,t,r){return(0,je._)`${Pz(e)}.call(${t}, ${r})`}Te.isOwnProperty=tb;function t5(e,t,r,i){let n=(0,je._)`${t}${(0,je.getProperty)(r)} !== undefined`;return i?(0,je._)`${n} && ${tb(e,t,r)}`:n}Te.propertyInData=t5;function rb(e,t,r,i){let n=(0,je._)`${t}${(0,je.getProperty)(r)} === undefined`;return i?(0,je.or)(n,(0,je.not)(tb(e,t,r))):n}Te.noPropertyInData=rb;function zz(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Te.allSchemaProperties=zz;function r5(e,t){return zz(t).filter(r=>!(0,eb.alwaysValidSchema)(e,t[r]))}Te.schemaProperties=r5;function n5({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:a},s,l,u){let d=u?(0,je._)`${e}, ${t}, ${i}${n}`:t,p=[[vn.default.instancePath,(0,je.strConcat)(vn.default.instancePath,o)],[vn.default.parentData,a.parentData],[vn.default.parentDataProperty,a.parentDataProperty],[vn.default.rootData,vn.default.rootData]];a.opts.dynamicRef&&p.push([vn.default.dynamicAnchors,vn.default.dynamicAnchors]);let f=(0,je._)`${d}, ${r.object(...p)}`;return l!==je.nil?(0,je._)`${s}.call(${l}, ${f})`:(0,je._)`${s}(${f})`}Te.callValidateCode=n5;var i5=(0,je._)`new RegExp`;function o5({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:n}=t.code,o=n(r,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,je._)`${n.code==="new RegExp"?i5:(0,QF.useFunc)(e,n)}(${r}, ${i})`})}Te.usePattern=o5;function a5(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(o,!0),a(()=>t.break()),o;function a(s){let l=t.const("len",(0,je._)`${r}.length`);t.forRange("i",0,l,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:eb.Type.Num},o),t.if((0,je.not)(o),s)})}}Te.validateArray=a5;function s5(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,eb.alwaysValidSchema)(n,l))&&!n.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((l,u)=>{let d=e.subschema({keyword:i,schemaProp:u,compositeRule:!0},s);t.assign(a,(0,je._)`${a} || ${s}`),e.mergeValidEvaluated(d,s)||t.if((0,je.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}Te.validateUnion=s5});var jz=T(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.validateKeywordUsage=yr.validSchemaType=yr.funcKeywordCode=yr.macroKeywordCode=void 0;var mt=ae(),ci=Lr(),c5=qt(),l5=qs();function u5(e,t){let{gen:r,keyword:i,schema:n,parentSchema:o,it:a}=e,s=t.macro.call(a.self,n,o,a),l=Oz(r,i,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=r.name("valid");e.subschema({schema:s,schemaPath:mt.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}yr.macroKeywordCode=u5;function d5(e,t){var r;let{gen:i,keyword:n,schema:o,parentSchema:a,$data:s,it:l}=e;m5(l,t);let u=!s&&t.compile?t.compile.call(l.self,o,a,l):t.validate,d=Oz(i,n,u),p=i.let("valid");e.block$data(p,f),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function f(){if(t.errors===!1)g(),t.modifying&&Rz(e),v(()=>e.error());else{let _=t.async?h():m();t.modifying&&Rz(e),v(()=>p5(e,_))}}function h(){let _=i.let("ruleErrs",null);return i.try(()=>g((0,mt._)`await `),w=>i.assign(p,!1).if((0,mt._)`${w} instanceof ${l.ValidationError}`,()=>i.assign(_,(0,mt._)`${w}.errors`),()=>i.throw(w))),_}function m(){let _=(0,mt._)`${d}.errors`;return i.assign(_,null),g(mt.nil),_}function g(_=t.async?(0,mt._)`await `:mt.nil){let w=l.opts.passContext?ci.default.this:ci.default.self,$=!("compile"in t&&!s||t.schema===!1);i.assign(p,(0,mt._)`${_}${(0,c5.callValidateCode)(e,d,w,$)}`,t.modifying)}function v(_){var w;i.if((0,mt.not)((w=t.valid)!==null&&w!==void 0?w:p),_)}}yr.funcKeywordCode=d5;function Rz(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,(0,mt._)`${i.parentData}[${i.parentDataProperty}]`))}function p5(e,t){let{gen:r}=e;r.if((0,mt._)`Array.isArray(${t})`,()=>{r.assign(ci.default.vErrors,(0,mt._)`${ci.default.vErrors} === null ? ${t} : ${ci.default.vErrors}.concat(${t})`).assign(ci.default.errors,(0,mt._)`${ci.default.vErrors}.length`),(0,l5.extendErrors)(e)},()=>e.error())}function m5({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Oz(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,mt.stringify)(r)})}function f5(e,t,r=!1){return!t.length||t.some(i=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||r&&typeof e>"u")}yr.validSchemaType=f5;function h5({schema:e,opts:t,self:r,errSchemaPath:i},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");let a=n.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(n.validateSchema&&!n.validateSchema(e[o])){let l=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}yr.validateKeywordUsage=h5});var Nz=T(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.extendSubschemaMode=bn.extendSubschemaData=bn.getSubschema=void 0;var vr=ae(),Dz=he();function g5(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,vr._)`${e.schemaPath}${(0,vr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:(0,vr._)`${e.schemaPath}${(0,vr.getProperty)(t)}${(0,vr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Dz.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}bn.getSubschema=g5;function y5(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:a}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:p}=t,f=s.let("data",(0,vr._)`${t.data}${(0,vr.getProperty)(r)}`,!0);l(f),e.errorPath=(0,vr.str)`${u}${(0,Dz.getErrorPath)(r,i,p.jsPropertySyntax)}`,e.parentDataProperty=(0,vr._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(n!==void 0){let u=n instanceof vr.Name?n:s.let("data",n,!0);l(u),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function l(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}bn.extendSubschemaData=y5;function v5(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){i!==void 0&&(e.compositeRule=i),n!==void 0&&(e.createErrors=n),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}bn.extendSubschemaMode=v5});var nb=T((Mte,Cz)=>{"use strict";Cz.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 i,n,o;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(n=i;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(o=Object.keys(t),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var a=o[n];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var Mz=T((Ute,Az)=>{"use strict";var _n=Az.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Lp(t,i,n,e,"",e)};_n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};_n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};_n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};_n.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 Lp(e,t,r,i,n,o,a,s,l,u){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,n,o,a,s,l,u);for(var d in i){var p=i[d];if(Array.isArray(p)){if(d in _n.arrayKeywords)for(var f=0;f<p.length;f++)Lp(e,t,r,p[f],n+"/"+d+"/"+f,o,n,d,i,f)}else if(d in _n.propsKeywords){if(p&&typeof p=="object")for(var h in p)Lp(e,t,r,p[h],n+"/"+d+"/"+b5(h),o,n,d,i,h)}else(d in _n.keywords||e.allKeys&&!(d in _n.skipKeywords))&&Lp(e,t,r,p,n+"/"+d,o,n,d,i)}r(i,n,o,a,s,l,u)}}function b5(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Fs=T(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.getSchemaRefs=wt.resolveUrl=wt.normalizeId=wt._getFullPath=wt.getFullPath=wt.inlineRef=void 0;var _5=he(),S5=nb(),x5=Mz(),w5=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function $5(e,t=!0){return typeof e=="boolean"?!0:t===!0?!ib(e):t?Uz(e)<=t:!1}wt.inlineRef=$5;var k5=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function ib(e){for(let t in e){if(k5.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(ib)||typeof r=="object"&&ib(r))return!0}return!1}function Uz(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!w5.has(r)&&(typeof e[r]=="object"&&(0,_5.eachItem)(e[r],i=>t+=Uz(i)),t===1/0))return 1/0}return t}function Lz(e,t="",r){r!==!1&&(t=Ro(t));let i=e.parse(t);return qz(e,i)}wt.getFullPath=Lz;function qz(e,t){return e.serialize(t).split("#")[0]+"#"}wt._getFullPath=qz;var T5=/#\/?$/;function Ro(e){return e?e.replace(T5,""):""}wt.normalizeId=Ro;function I5(e,t,r){return r=Ro(r),e.resolve(t,r)}wt.resolveUrl=I5;var E5=/^[a-z_][-a-z0-9._]*$/i;function P5(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=Ro(e[r]||t),o={"":n},a=Lz(i,n,!1),s={},l=new Set;return x5(e,{allKeys:!0},(p,f,h,m)=>{if(m===void 0)return;let g=a+f,v=o[m];typeof p[r]=="string"&&(v=_.call(this,p[r])),w.call(this,p.$anchor),w.call(this,p.$dynamicAnchor),o[f]=v;function _($){let E=this.opts.uriResolver.resolve;if($=Ro(v?E(v,$):$),l.has($))throw d($);l.add($);let N=this.refs[$];return typeof N=="string"&&(N=this.refs[N]),typeof N=="object"?u(p,N.schema,$):$!==Ro(g)&&($[0]==="#"?(u(p,s[$],$),s[$]=p):this.refs[$]=g),$}function w($){if(typeof $=="string"){if(!E5.test($))throw new Error(`invalid anchor "${$}"`);_.call(this,`#${$}`)}}}),s;function u(p,f,h){if(f!==void 0&&!S5(p,f))throw d(h)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}wt.getSchemaRefs=P5});var Hs=T(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getData=Sn.KeywordCxt=Sn.validateFunctionCode=void 0;var Hz=Sz(),Zz=Zs(),ab=Kv(),qp=Zs(),z5=Ez(),Bs=jz(),ob=Nz(),B=ae(),Q=Lr(),R5=Fs(),qr=he(),Vs=qs();function O5(e){if(Gz(e)&&(Kz(e),Jz(e))){N5(e);return}Wz(e,()=>(0,Hz.topBoolOrEmptySchema)(e))}Sn.validateFunctionCode=O5;function Wz({gen:e,validateName:t,schema:r,schemaEnv:i,opts:n},o){n.code.es5?e.func(t,(0,B._)`${Q.default.data}, ${Q.default.valCxt}`,i.$async,()=>{e.code((0,B._)`"use strict"; ${Fz(r,n)}`),D5(e,n),e.code(o)}):e.func(t,(0,B._)`${Q.default.data}, ${j5(n)}`,i.$async,()=>e.code(Fz(r,n)).code(o))}function j5(e){return(0,B._)`{${Q.default.instancePath}="", ${Q.default.parentData}, ${Q.default.parentDataProperty}, ${Q.default.rootData}=${Q.default.data}${e.dynamicRef?(0,B._)`, ${Q.default.dynamicAnchors}={}`:B.nil}}={}`}function D5(e,t){e.if(Q.default.valCxt,()=>{e.var(Q.default.instancePath,(0,B._)`${Q.default.valCxt}.${Q.default.instancePath}`),e.var(Q.default.parentData,(0,B._)`${Q.default.valCxt}.${Q.default.parentData}`),e.var(Q.default.parentDataProperty,(0,B._)`${Q.default.valCxt}.${Q.default.parentDataProperty}`),e.var(Q.default.rootData,(0,B._)`${Q.default.valCxt}.${Q.default.rootData}`),t.dynamicRef&&e.var(Q.default.dynamicAnchors,(0,B._)`${Q.default.valCxt}.${Q.default.dynamicAnchors}`)},()=>{e.var(Q.default.instancePath,(0,B._)`""`),e.var(Q.default.parentData,(0,B._)`undefined`),e.var(Q.default.parentDataProperty,(0,B._)`undefined`),e.var(Q.default.rootData,Q.default.data),t.dynamicRef&&e.var(Q.default.dynamicAnchors,(0,B._)`{}`)})}function N5(e){let{schema:t,opts:r,gen:i}=e;Wz(e,()=>{r.$comment&&t.$comment&&Yz(e),L5(e),i.let(Q.default.vErrors,null),i.let(Q.default.errors,0),r.unevaluated&&C5(e),Qz(e),F5(e)})}function C5(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,B._)`${r}.evaluated`),t.if((0,B._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,B._)`${e.evaluated}.props`,(0,B._)`undefined`)),t.if((0,B._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,B._)`${e.evaluated}.items`,(0,B._)`undefined`))}function Fz(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,B._)`/*# sourceURL=${r} */`:B.nil}function A5(e,t){if(Gz(e)&&(Kz(e),Jz(e))){M5(e,t);return}(0,Hz.boolOrEmptySchema)(e,t)}function Jz({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 Gz(e){return typeof e.schema!="boolean"}function M5(e,t){let{schema:r,gen:i,opts:n}=e;n.$comment&&r.$comment&&Yz(e),q5(e),Z5(e);let o=i.const("_errs",Q.default.errors);Qz(e,o),i.var(t,(0,B._)`${o} === ${Q.default.errors}`)}function Kz(e){(0,qr.checkUnknownRules)(e),U5(e)}function Qz(e,t){if(e.opts.jtd)return Vz(e,[],!1,t);let r=(0,Zz.getSchemaTypes)(e.schema),i=(0,Zz.coerceAndCheckDataType)(e,r);Vz(e,r,!i,t)}function U5(e){let{schema:t,errSchemaPath:r,opts:i,self:n}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,qr.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function L5(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,qr.checkStrictMode)(e,"default is ignored in the schema root")}function q5(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,R5.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Z5(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Yz({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)e.code((0,B._)`${Q.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let a=(0,B.str)`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,B._)`${Q.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function F5(e){let{gen:t,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=e;r.$async?t.if((0,B._)`${Q.default.errors} === 0`,()=>t.return(Q.default.data),()=>t.throw((0,B._)`new ${n}(${Q.default.vErrors})`)):(t.assign((0,B._)`${i}.errors`,Q.default.vErrors),o.unevaluated&&V5(e),t.return((0,B._)`${Q.default.errors} === 0`))}function V5({gen:e,evaluated:t,props:r,items:i}){r instanceof B.Name&&e.assign((0,B._)`${t}.props`,r),i instanceof B.Name&&e.assign((0,B._)`${t}.items`,i)}function Vz(e,t,r,i){let{gen:n,schema:o,data:a,allErrors:s,opts:l,self:u}=e,{RULES:d}=u;if(o.$ref&&(l.ignoreKeywordsWithRef||!(0,qr.schemaHasRulesButRef)(o,d))){n.block(()=>e1(e,"$ref",d.all.$ref.definition));return}l.jtd||B5(e,t),n.block(()=>{for(let f of d.rules)p(f);p(d.post)});function p(f){(0,ab.shouldUseGroup)(o,f)&&(f.type?(n.if((0,qp.checkDataType)(f.type,a,l.strictNumbers)),Bz(e,f),t.length===1&&t[0]===f.type&&r&&(n.else(),(0,qp.reportTypeError)(e)),n.endIf()):Bz(e,f),s||n.if((0,B._)`${Q.default.errors} === ${i||0}`))}}function Bz(e,t){let{gen:r,schema:i,opts:{useDefaults:n}}=e;n&&(0,z5.assignDefaults)(e,t.type),r.block(()=>{for(let o of t.rules)(0,ab.shouldUseRule)(i,o)&&e1(e,o.keyword,o.definition,t.type)})}function B5(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(H5(e,t),e.opts.allowUnionTypes||W5(e,t),J5(e,e.dataTypes))}function H5(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Xz(e.dataTypes,r)||sb(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),K5(e,t)}}function W5(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&sb(e,"use allowUnionTypes to allow union type keyword")}function J5(e,t){let r=e.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,ab.shouldUseRule)(e.schema,n)){let{type:o}=n.definition;o.length&&!o.some(a=>G5(t,a))&&sb(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function G5(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Xz(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function K5(e,t){let r=[];for(let i of e.dataTypes)Xz(t,i)?r.push(i):t.includes("integer")&&i==="number"&&r.push("integer");e.dataTypes=r}function sb(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,qr.checkStrictMode)(e,t,e.opts.strictTypes)}var Zp=class{constructor(t,r,i){if((0,Bs.validateKeywordUsage)(t,r,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,qr.schemaRefOrVal)(t,this.schema,i,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",t1(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Bs.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Q.default.errors))}result(t,r,i){this.failResult((0,B.not)(t),r,i)}failResult(t,r,i){this.gen.if(t),i?i():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,B.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,B._)`${r} !== undefined && (${(0,B.or)(this.invalid$data(),t)})`)}error(t,r,i){if(r){this.setParams(r),this._error(t,i),this.setParams({});return}this._error(t,i)}_error(t,r){(t?Vs.reportExtraError:Vs.reportError)(this,this.def.error,r)}$dataError(){(0,Vs.reportError)(this,this.def.$dataError||Vs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Vs.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,i=B.nil){this.gen.block(()=>{this.check$data(t,i),r()})}check$data(t=B.nil,r=B.nil){if(!this.$data)return;let{gen:i,schemaCode:n,schemaType:o,def:a}=this;i.if((0,B.or)((0,B._)`${n} === undefined`,r)),t!==B.nil&&i.assign(t,!0),(o.length||a.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==B.nil&&i.assign(t,!1)),i.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:i,def:n,it:o}=this;return(0,B.or)(a(),s());function a(){if(i.length){if(!(r instanceof B.Name))throw new Error("ajv implementation error");let l=Array.isArray(i)?i:[i];return(0,B._)`${(0,qp.checkDataTypes)(l,r,o.opts.strictNumbers,qp.DataType.Wrong)}`}return B.nil}function s(){if(n.validateSchema){let l=t.scopeValue("validate$data",{ref:n.validateSchema});return(0,B._)`!${l}(${r})`}return B.nil}}subschema(t,r){let i=(0,ob.getSubschema)(this.it,t);(0,ob.extendSubschemaData)(i,this.it,t),(0,ob.extendSubschemaMode)(i,t);let n={...this.it,...i,items:void 0,props:void 0};return A5(n,r),n}mergeEvaluated(t,r){let{it:i,gen:n}=this;i.opts.unevaluated&&(i.props!==!0&&t.props!==void 0&&(i.props=qr.mergeEvaluated.props(n,t.props,i.props,r)),i.items!==!0&&t.items!==void 0&&(i.items=qr.mergeEvaluated.items(n,t.items,i.items,r)))}mergeValidEvaluated(t,r){let{it:i,gen:n}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return n.if(r,()=>this.mergeEvaluated(t,B.Name)),!0}};Sn.KeywordCxt=Zp;function e1(e,t,r,i){let n=new Zp(e,r,t);"code"in r?r.code(n,i):n.$data&&r.validate?(0,Bs.funcKeywordCode)(n,r):"macro"in r?(0,Bs.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Bs.funcKeywordCode)(n,r)}var Q5=/^\/(?:[^~]|~0|~1)*$/,Y5=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function t1(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let n,o;if(e==="")return Q.default.rootData;if(e[0]==="/"){if(!Q5.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,o=Q.default.rootData}else{let u=Y5.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(n=u[2],n==="#"){if(d>=t)throw new Error(l("property/index",d));return i[t-d]}if(d>t)throw new Error(l("data",d));if(o=r[t-d],!n)return o}let a=o,s=n.split("/");for(let u of s)u&&(o=(0,B._)`${o}${(0,B.getProperty)((0,qr.unescapeJsonPointer)(u))}`,a=(0,B._)`${a} && ${o}`);return a;function l(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}Sn.getData=t1});var Fp=T(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var cb=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};lb.default=cb});var Ws=T(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var ub=Fs(),db=class extends Error{constructor(t,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,ub.resolveUrl)(t,r,i),this.missingSchema=(0,ub.normalizeId)((0,ub.getFullPath)(t,this.missingRef))}};pb.default=db});var Bp=T(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.resolveSchema=Zt.getCompilingSchema=Zt.resolveRef=Zt.compileSchema=Zt.SchemaEnv=void 0;var ir=ae(),X5=Fp(),li=Lr(),or=Fs(),r1=he(),e9=Hs(),Oo=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let i;typeof t.schema=="object"&&(i=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,or.normalizeId)(i?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=i?.$async,this.refs={}}};Zt.SchemaEnv=Oo;function fb(e){let t=n1.call(this,e);if(t)return t;let r=(0,or.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,a=new ir.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:X5.default,code:(0,ir._)`require("ajv/dist/runtime/validation_error").default`}));let l=a.scopeName("validate");e.validateName=l;let u={gen:a,allErrors:this.opts.allErrors,data:li.default.data,parentData:li.default.parentData,parentDataProperty:li.default.parentDataProperty,dataNames:[li.default.data],dataPathArr:[ir.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,ir.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ir.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ir._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,e9.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let p=a.toString();d=`${a.scopeRefs(li.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));let h=new Function(`${li.default.self}`,`${li.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:g}=u;h.evaluated={props:m instanceof ir.Name?void 0:m,items:g instanceof ir.Name?void 0:g,dynamicProps:m instanceof ir.Name,dynamicItems:g instanceof ir.Name},h.source&&(h.source.evaluated=(0,ir.stringify)(h.evaluated))}return e.validate=h,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}Zt.compileSchema=fb;function t9(e,t,r){var i;r=(0,or.resolveUrl)(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let o=i9.call(this,e,r);if(o===void 0){let a=(i=e.localRefs)===null||i===void 0?void 0:i[r],{schemaId:s}=this.opts;a&&(o=new Oo({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=r9.call(this,o)}Zt.resolveRef=t9;function r9(e){return(0,or.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:fb.call(this,e)}function n1(e){for(let t of this._compilations)if(n9(t,e))return t}Zt.getCompilingSchema=n1;function n9(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function i9(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Vp.call(this,e,t)}function Vp(e,t){let r=this.opts.uriResolver.parse(t),i=(0,or._getFullPath)(this.opts.uriResolver,r),n=(0,or.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===n)return mb.call(this,r,e);let o=(0,or.normalizeId)(i),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=Vp.call(this,e,a);return typeof s?.schema!="object"?void 0:mb.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||fb.call(this,a),o===(0,or.normalizeId)(t)){let{schema:s}=a,{schemaId:l}=this.opts,u=s[l];return u&&(n=(0,or.resolveUrl)(this.opts.uriResolver,n,u)),new Oo({schema:s,schemaId:l,root:e,baseId:n})}return mb.call(this,r,a)}}Zt.resolveSchema=Vp;var o9=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function mb(e,{baseId:t,schema:r,root:i}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,r1.unescapeFragment)(s)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!o9.has(s)&&u&&(t=(0,or.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,r1.schemaHasRulesButRef)(r,this.RULES)){let s=(0,or.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Vp.call(this,i,s)}let{schemaId:a}=this.opts;if(o=o||new Oo({schema:r,schemaId:a,root:i,baseId:t}),o.schema!==o.root.schema)return o}});var i1=T((Bte,a9)=>{a9.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 gb=T((Hte,c1)=>{"use strict";var s9=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),a1=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 hb(e){let t="",r=0,i=0;for(i=0;i<e.length;i++)if(r=e[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(r=e[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i]}return t}var c9=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o1(e){return e.length=0,!0}function l9(e,t,r){if(e.length){let i=hb(e);if(i!=="")t.push(i);else return r.error=!0,!1;e.length=0}return!0}function u9(e){let t=0,r={error:!1,address:"",zone:""},i=[],n=[],o=!1,a=!1,s=l9;for(let l=0;l<e.length;l++){let u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!s(n,i,r))break;if(++t>7){r.error=!0;break}l>0&&e[l-1]===":"&&(o=!0),i.push(":");continue}else if(u==="%"){if(!s(n,i,r))break;s=o1}else{n.push(u);continue}}return n.length&&(s===o1?r.zone=n.join(""):a?i.push(n.join("")):i.push(hb(n))),r.address=i.join(""),r}function s1(e){if(d9(e,":")<2)return{host:e,isIPV6:!1};let t=u9(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,i=t.address;return t.zone&&(r+="%"+t.zone,i+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:i}}}function d9(e,t){let r=0;for(let i=0;i<e.length;i++)e[i]===t&&r++;return r}function p9(e){let t=e,r=[],i=-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((i=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,i)),t=t.slice(i)}return r.join("")}function m9(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 f9(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!a1(r)){let i=s1(r);i.isIPV6===!0?r=`[${i.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}c1.exports={nonSimpleDomain:c9,recomposeAuthority:f9,normalizeComponentEncoding:m9,removeDotSegments:p9,isIPv4:a1,isUUID:s9,normalizeIPv6:s1,stringArrayToHexStripped:hb}});var m1=T((Wte,p1)=>{"use strict";var{isUUID:h9}=gb(),g9=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,y9=["http","https","ws","wss","urn","urn:uuid"];function v9(e){return y9.indexOf(e)!==-1}function yb(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 l1(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function u1(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 b9(e){return e.secure=yb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function _9(e){if((e.port===(yb(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 S9(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(g9);if(r){let i=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${i}:${t.nid||e.nid}`,o=vb(n);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function x9(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),n=`${r}:${t.nid||i}`,o=vb(n);o&&(e=o.serialize(e,t));let a=e,s=e.nss;return a.path=`${i||t.nid}:${s}`,t.skipEscape=!0,a}function w9(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!h9(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function $9(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var d1={scheme:"http",domainHost:!0,parse:l1,serialize:u1},k9={scheme:"https",domainHost:d1.domainHost,parse:l1,serialize:u1},Hp={scheme:"ws",domainHost:!0,parse:b9,serialize:_9},T9={scheme:"wss",domainHost:Hp.domainHost,parse:Hp.parse,serialize:Hp.serialize},I9={scheme:"urn",parse:S9,serialize:x9,skipNormalize:!0},E9={scheme:"urn:uuid",parse:w9,serialize:$9,skipNormalize:!0},Wp={http:d1,https:k9,ws:Hp,wss:T9,urn:I9,"urn:uuid":E9};Object.setPrototypeOf(Wp,null);function vb(e){return e&&(Wp[e]||Wp[e.toLowerCase()])||void 0}p1.exports={wsIsSecure:yb,SCHEMES:Wp,isValidSchemeName:v9,getSchemeHandler:vb}});var g1=T((Jte,Gp)=>{"use strict";var{normalizeIPv6:P9,removeDotSegments:Js,recomposeAuthority:z9,normalizeComponentEncoding:Jp,isIPv4:R9,nonSimpleDomain:O9}=gb(),{SCHEMES:j9,getSchemeHandler:f1}=m1();function D9(e,t){return typeof e=="string"?e=br(Zr(e,t),t):typeof e=="object"&&(e=Zr(br(e,t),t)),e}function N9(e,t,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=h1(Zr(e,i),Zr(t,i),i,!0);return i.skipEscape=!0,br(n,i)}function h1(e,t,r,i){let n={};return i||(e=Zr(br(e,r),r),t=Zr(br(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=Js(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=Js(t.path||""),n.query=t.query):(t.path?(t.path[0]==="/"?n.path=Js(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=Js(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 C9(e,t,r){return typeof e=="string"?(e=unescape(e),e=br(Jp(Zr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=br(Jp(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=br(Jp(Zr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=br(Jp(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function br(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:""},i=Object.assign({},t),n=[],o=f1(i.scheme||r.scheme);o&&o.serialize&&o.serialize(r,i),r.path!==void 0&&(i.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),i.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let a=z9(r);if(a!==void 0&&(i.reference!=="suffix"&&n.push("//"),n.push(a),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let s=r.path;!i.absolutePath&&(!o||!o.absolutePath)&&(s=Js(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),n.push(s)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var A9=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Zr(e,t){let r=Object.assign({},t),i={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 o=e.match(A9);if(o){if(i.scheme=o[1],i.userinfo=o[3],i.host=o[4],i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=o[7],i.fragment=o[8],isNaN(i.port)&&(i.port=o[5]),i.host)if(R9(i.host)===!1){let l=P9(i.host);i.host=l.host.toLowerCase(),n=l.isIPV6}else n=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let a=f1(r.scheme||i.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&i.host&&(r.domainHost||a&&a.domainHost)&&n===!1&&O9(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(s){i.error=i.error||"Host's domain name can not be converted to ASCII: "+s}(!a||a&&!a.skipNormalize)&&(e.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),a&&a.parse&&a.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}var bb={SCHEMES:j9,normalize:D9,resolve:N9,resolveComponent:h1,equal:C9,serialize:br,parse:Zr};Gp.exports=bb;Gp.exports.default=bb;Gp.exports.fastUri=bb});var v1=T(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var y1=g1();y1.code='require("ajv/dist/runtime/uri").default';_b.default=y1});var T1=T(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.CodeGen=et.Name=et.nil=et.stringify=et.str=et._=et.KeywordCxt=void 0;var M9=Hs();Object.defineProperty(et,"KeywordCxt",{enumerable:!0,get:function(){return M9.KeywordCxt}});var jo=ae();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return jo._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return jo.str}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return jo.stringify}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return jo.nil}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return jo.Name}});Object.defineProperty(et,"CodeGen",{enumerable:!0,get:function(){return jo.CodeGen}});var U9=Fp(),w1=Ws(),L9=Gv(),Gs=Bp(),q9=ae(),Ks=Fs(),Kp=Zs(),xb=he(),b1=i1(),Z9=v1(),$1=(e,t)=>new RegExp(e,t);$1.code="new RegExp";var F9=["removeAdditional","useDefaults","coerceTypes"],V9=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),B9={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."},H9={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},_1=200;function W9(e){var t,r,i,n,o,a,s,l,u,d,p,f,h,m,g,v,_,w,$,E,N,de,Y,be,ee;let Pe=e.strict,Fe=(t=e.code)===null||t===void 0?void 0:t.optimize,Me=Fe===!0||Fe===void 0?1:Fe||0,st=(i=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:$1,ft=(n=e.uriResolver)!==null&&n!==void 0?n:Z9.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Pe)!==null&&a!==void 0?a:!0,strictNumbers:(l=(s=e.strictNumbers)!==null&&s!==void 0?s:Pe)!==null&&l!==void 0?l:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:Pe)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:Pe)!==null&&f!==void 0?f:"log",strictRequired:(m=(h=e.strictRequired)!==null&&h!==void 0?h:Pe)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:Me,regExp:st}:{optimize:Me,regExp:st},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:_1,loopEnum:(v=e.loopEnum)!==null&&v!==void 0?v:_1,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:($=e.inlineRefs)!==null&&$!==void 0?$:!0,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(N=e.addUsedSchema)!==null&&N!==void 0?N:!0,validateSchema:(de=e.validateSchema)!==null&&de!==void 0?de:!0,validateFormats:(Y=e.validateFormats)!==null&&Y!==void 0?Y:!0,unicodeRegExp:(be=e.unicodeRegExp)!==null&&be!==void 0?be:!0,int32range:(ee=e.int32range)!==null&&ee!==void 0?ee:!0,uriResolver:ft}}var Qs=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...W9(t)};let{es5:r,lines:i}=this.opts.code;this.scope=new q9.ValueScope({scope:{},prefixes:V9,es5:r,lines:i}),this.logger=X9(t.logger);let n=t.validateFormats;t.validateFormats=!1,this.RULES=(0,L9.getRules)(),S1.call(this,B9,t,"NOT SUPPORTED"),S1.call(this,H9,t,"DEPRECATED","warn"),this._metaOpts=Q9.call(this),t.formats&&G9.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&K9.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),J9.call(this),t.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:i}=this.opts,n=b1;i==="id"&&(n={...b1},n.id=n.$id,delete n.$id),r&&t&&this.addMetaSchema(n,n[i],!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 i;if(typeof t=="string"){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);let n=i(r);return"$async"in i||(this.errors=i.errors),n}compile(t,r){let i=this._addSchema(t,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return n.call(this,t,r);async function n(d,p){await o.call(this,d.$schema);let f=this._addSchema(d,p);return f.validate||a.call(this,f)}async function o(d){d&&!this.getSchema(d)&&await n.call(this,{$ref:d},!0)}async function a(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof w1.default))throw p;return s.call(this,p),await l.call(this,p.missingSchema),a.call(this,d)}}function s({missingSchema:d,missingRef:p}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}async function l(d){let p=await u.call(this,d);this.refs[d]||await o.call(this,p.$schema),this.refs[d]||this.addSchema(p,d,r)}async function u(d){let p=this._loading[d];if(p)return p;try{return await(this._loading[d]=i(d))}finally{delete this._loading[d]}}}addSchema(t,r,i,n=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,i,n);return this}let o;if(typeof t=="object"){let{schemaId:a}=this.opts;if(o=t[a],o!==void 0&&typeof o!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Ks.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(t,i,r,n,!0),this}addMetaSchema(t,r,i=this.opts.validateSchema){return this.addSchema(t,r,!0,i),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let i;if(i=t.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(i,t);if(!n&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return n}getSchema(t){let r;for(;typeof(r=x1.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Gs.SchemaEnv({schema:{},schemaId:i});if(r=Gs.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=x1.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 i=t[this.opts.schemaId];return i&&(i=(0,Ks.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),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 i;if(typeof t=="string")i=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof t=="object"&&r===void 0){if(r=t,i=r.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(t3.call(this,i,r),!r)return(0,xb.eachItem)(i,o=>Sb.call(this,o)),this;n3.call(this,r);let n={...r,type:(0,Kp.getJSONTypes)(r.type),schemaType:(0,Kp.getJSONTypes)(r.schemaType)};return(0,xb.eachItem)(i,n.type.length===0?o=>Sb.call(this,o,n):o=>n.type.forEach(a=>Sb.call(this,o,n,a))),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 i of r.rules){let n=i.rules.findIndex(o=>o.keyword===t);n>=0&&i.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:i="data"}={}){return!t||t.length===0?"No errors":t.map(n=>`${i}${n.instancePath} ${n.message}`).reduce((n,o)=>n+r+o)}$dataMetaSchema(t,r){let i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let n of r){let o=n.split("/").slice(1),a=t;for(let s of o)a=a[s];for(let s in i){let l=i[s];if(typeof l!="object")continue;let{$data:u}=l.definition,d=a[s];u&&d&&(a[s]=k1(d))}}return t}_removeAllSchemas(t,r){for(let i in t){let n=t[i];(!r||r.test(i))&&(typeof n=="string"?delete t[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete t[i]))}}_addSchema(t,r,i,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];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 l=this._cache.get(t);if(l!==void 0)return l;i=(0,Ks.normalizeId)(a||i);let u=Ks.getSchemaRefs.call(this,t,i);return l=new Gs.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:i,localRefs:u}),this._cache.set(l.schema,l),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=l),n&&this.validateSchema(t,!0),l}_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):Gs.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{Gs.compileSchema.call(this,t)}finally{this.opts=r}}};Qs.ValidationError=U9.default;Qs.MissingRefError=w1.default;et.default=Qs;function S1(e,t,r,i="error"){for(let n in e){let o=n;o in t&&this.logger[i](`${r}: option ${n}. ${e[o]}`)}}function x1(e){return e=(0,Ks.normalizeId)(e),this.schemas[e]||this.refs[e]}function J9(){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 G9(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function K9(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 Q9(){let e={...this.opts};for(let t of F9)delete e[t];return e}var Y9={log(){},warn(){},error(){}};function X9(e){if(e===!1)return Y9;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 e3=/^[a-z_$][a-z0-9_$:-]*$/i;function t3(e,t){let{RULES:r}=this;if((0,xb.eachItem)(e,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!e3.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function Sb(e,t,r){var i;let n=t?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=n?o.post:o.rules.find(({type:l})=>l===r);if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,Kp.getJSONTypes)(t.type),schemaType:(0,Kp.getJSONTypes)(t.schemaType)}};t.before?r3.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(i=t.implements)===null||i===void 0||i.forEach(l=>this.addKeyword(l))}function r3(e,t,r){let i=e.rules.findIndex(n=>n.keyword===r);i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function n3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=k1(t)),e.validateSchema=this.compile(t,!0))}var i3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function k1(e){return{anyOf:[e,i3]}}});var I1=T(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var o3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};wb.default=o3});var R1=T(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.callRef=ui.getValidate=void 0;var a3=Ws(),E1=qt(),$t=ae(),Do=Lr(),P1=Bp(),Qp=he(),s3={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:n,schemaEnv:o,validateName:a,opts:s,self:l}=i,{root:u}=o;if((r==="#"||r==="#/")&&n===u.baseId)return p();let d=P1.resolveRef.call(l,u,n,r);if(d===void 0)throw new a3.default(i.opts.uriResolver,n,r);if(d instanceof P1.SchemaEnv)return f(d);return h(d);function p(){if(o===u)return Yp(e,a,o,o.$async);let m=t.scopeValue("root",{ref:u});return Yp(e,(0,$t._)`${m}.validate`,u,u.$async)}function f(m){let g=z1(e,m);Yp(e,g,m,m.$async)}function h(m){let g=t.scopeValue("schema",s.code.source===!0?{ref:m,code:(0,$t.stringify)(m)}:{ref:m}),v=t.name("valid"),_=e.subschema({schema:m,dataTypes:[],schemaPath:$t.nil,topSchemaRef:g,errSchemaPath:r},v);e.mergeEvaluated(_),e.ok(v)}}};function z1(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,$t._)`${r.scopeValue("wrapper",{ref:t})}.validate`}ui.getValidate=z1;function Yp(e,t,r,i){let{gen:n,it:o}=e,{allErrors:a,schemaEnv:s,opts:l}=o,u=l.passContext?Do.default.this:$t.nil;i?d():p();function d(){if(!s.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,$t._)`await ${(0,E1.callValidateCode)(e,t,u)}`),h(t),a||n.assign(m,!0)},g=>{n.if((0,$t._)`!(${g} instanceof ${o.ValidationError})`,()=>n.throw(g)),f(g),a||n.assign(m,!1)}),e.ok(m)}function p(){e.result((0,E1.callValidateCode)(e,t,u),()=>h(t),()=>f(t))}function f(m){let g=(0,$t._)`${m}.errors`;n.assign(Do.default.vErrors,(0,$t._)`${Do.default.vErrors} === null ? ${g} : ${Do.default.vErrors}.concat(${g})`),n.assign(Do.default.errors,(0,$t._)`${Do.default.vErrors}.length`)}function h(m){var g;if(!o.opts.unevaluated)return;let v=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=Qp.mergeEvaluated.props(n,v.props,o.props));else{let _=n.var("props",(0,$t._)`${m}.evaluated.props`);o.props=Qp.mergeEvaluated.props(n,_,o.props,$t.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=Qp.mergeEvaluated.items(n,v.items,o.items));else{let _=n.var("items",(0,$t._)`${m}.evaluated.items`);o.items=Qp.mergeEvaluated.items(n,_,o.items,$t.Name)}}}ui.callRef=Yp;ui.default=s3});var O1=T($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var c3=I1(),l3=R1(),u3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",c3.default,l3.default];$b.default=u3});var j1=T(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var Xp=ae(),xn=Xp.operators,em={maximum:{okStr:"<=",ok:xn.LTE,fail:xn.GT},minimum:{okStr:">=",ok:xn.GTE,fail:xn.LT},exclusiveMaximum:{okStr:"<",ok:xn.LT,fail:xn.GTE},exclusiveMinimum:{okStr:">",ok:xn.GT,fail:xn.LTE}},d3={message:({keyword:e,schemaCode:t})=>(0,Xp.str)`must be ${em[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Xp._)`{comparison: ${em[e].okStr}, limit: ${t}}`},p3={keyword:Object.keys(em),type:"number",schemaType:"number",$data:!0,error:d3,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data((0,Xp._)`${r} ${em[t].fail} ${i} || isNaN(${r})`)}};kb.default=p3});var D1=T(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var Ys=ae(),m3={message:({schemaCode:e})=>(0,Ys.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ys._)`{multipleOf: ${e}}`},f3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:m3,code(e){let{gen:t,data:r,schemaCode:i,it:n}=e,o=n.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,Ys._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Ys._)`${a} !== parseInt(${a})`;e.fail$data((0,Ys._)`(${i} === 0 || (${a} = ${r}/${i}, ${s}))`)}};Tb.default=f3});var C1=T(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});function N1(e){let t=e.length,r=0,i=0,n;for(;i<t;)r++,n=e.charCodeAt(i++),n>=55296&&n<=56319&&i<t&&(n=e.charCodeAt(i),(n&64512)===56320&&i++);return r}Ib.default=N1;N1.code='require("ajv/dist/runtime/ucs2length").default'});var A1=T(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var di=ae(),h3=he(),g3=C1(),y3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,di.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,di._)`{limit: ${e}}`},v3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:y3,code(e){let{keyword:t,data:r,schemaCode:i,it:n}=e,o=t==="maxLength"?di.operators.GT:di.operators.LT,a=n.opts.unicode===!1?(0,di._)`${r}.length`:(0,di._)`${(0,h3.useFunc)(e.gen,g3.default)}(${r})`;e.fail$data((0,di._)`${a} ${o} ${i}`)}};Eb.default=v3});var M1=T(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var b3=qt(),_3=he(),No=ae(),S3={message:({schemaCode:e})=>(0,No.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,No._)`{pattern: ${e}}`},x3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:S3,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(i){let{regExp:l}=a.opts.code,u=l.code==="new RegExp"?(0,No._)`new RegExp`:(0,_3.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,No._)`${u}(${o}, ${s}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,No._)`!${d}`)}else{let l=(0,b3.usePattern)(e,n);e.fail$data((0,No._)`!${l}.test(${r})`)}}};Pb.default=x3});var U1=T(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var Xs=ae(),w3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Xs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Xs._)`{limit: ${e}}`},$3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:w3,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxProperties"?Xs.operators.GT:Xs.operators.LT;e.fail$data((0,Xs._)`Object.keys(${r}).length ${n} ${i}`)}};zb.default=$3});var L1=T(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var ec=qt(),tc=ae(),k3=he(),T3={message:({params:{missingProperty:e}})=>(0,tc.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,tc._)`{missingProperty: ${e}}`},I3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:T3,code(e){let{gen:t,schema:r,schemaCode:i,data:n,$data:o,it:a}=e,{opts:s}=a;if(!o&&r.length===0)return;let l=r.length>=s.loopRequired;if(a.allErrors?u():d(),s.strictRequired){let h=e.parentSchema.properties,{definedProperties:m}=e.it;for(let g of r)if(h?.[g]===void 0&&!m.has(g)){let v=a.schemaEnv.baseId+a.errSchemaPath,_=`required property "${g}" is not defined at "${v}" (strictRequired)`;(0,k3.checkStrictMode)(a,_,a.opts.strictRequired)}}function u(){if(l||o)e.block$data(tc.nil,p);else for(let h of r)(0,ec.checkReportMissingProp)(e,h)}function d(){let h=t.let("missing");if(l||o){let m=t.let("valid",!0);e.block$data(m,()=>f(h,m)),e.ok(m)}else t.if((0,ec.checkMissingProp)(e,r,h)),(0,ec.reportMissingProp)(e,h),t.else()}function p(){t.forOf("prop",i,h=>{e.setParams({missingProperty:h}),t.if((0,ec.noPropertyInData)(t,n,h,s.ownProperties),()=>e.error())})}function f(h,m){e.setParams({missingProperty:h}),t.forOf(h,i,()=>{t.assign(m,(0,ec.propertyInData)(t,n,h,s.ownProperties)),t.if((0,tc.not)(m),()=>{e.error(),t.break()})},tc.nil)}}};Rb.default=I3});var q1=T(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var rc=ae(),E3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,rc.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,rc._)`{limit: ${e}}`},P3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:E3,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxItems"?rc.operators.GT:rc.operators.LT;e.fail$data((0,rc._)`${r}.length ${n} ${i}`)}};Ob.default=P3});var tm=T(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var Z1=nb();Z1.code='require("ajv/dist/runtime/equal").default';jb.default=Z1});var F1=T(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var Db=Zs(),tt=ae(),z3=he(),R3=tm(),O3={message:({params:{i:e,j:t}})=>(0,tt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,tt._)`{i: ${e}, j: ${t}}`},j3={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:O3,code(e){let{gen:t,data:r,$data:i,schema:n,parentSchema:o,schemaCode:a,it:s}=e;if(!i&&!n)return;let l=t.let("valid"),u=o.items?(0,Db.getSchemaTypes)(o.items):[];e.block$data(l,d,(0,tt._)`${a} === false`),e.ok(l);function d(){let m=t.let("i",(0,tt._)`${r}.length`),g=t.let("j");e.setParams({i:m,j:g}),t.assign(l,!0),t.if((0,tt._)`${m} > 1`,()=>(p()?f:h)(m,g))}function p(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,g){let v=t.name("item"),_=(0,Db.checkDataTypes)(u,v,s.opts.strictNumbers,Db.DataType.Wrong),w=t.const("indices",(0,tt._)`{}`);t.for((0,tt._)`;${m}--;`,()=>{t.let(v,(0,tt._)`${r}[${m}]`),t.if(_,(0,tt._)`continue`),u.length>1&&t.if((0,tt._)`typeof ${v} == "string"`,(0,tt._)`${v} += "_"`),t.if((0,tt._)`typeof ${w}[${v}] == "number"`,()=>{t.assign(g,(0,tt._)`${w}[${v}]`),e.error(),t.assign(l,!1).break()}).code((0,tt._)`${w}[${v}] = ${m}`)})}function h(m,g){let v=(0,z3.useFunc)(t,R3.default),_=t.name("outer");t.label(_).for((0,tt._)`;${m}--;`,()=>t.for((0,tt._)`${g} = ${m}; ${g}--;`,()=>t.if((0,tt._)`${v}(${r}[${m}], ${r}[${g}])`,()=>{e.error(),t.assign(l,!1).break(_)})))}}};Nb.default=j3});var V1=T(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var Cb=ae(),D3=he(),N3=tm(),C3={message:"must be equal to constant",params:({schemaCode:e})=>(0,Cb._)`{allowedValue: ${e}}`},A3={keyword:"const",$data:!0,error:C3,code(e){let{gen:t,data:r,$data:i,schemaCode:n,schema:o}=e;i||o&&typeof o=="object"?e.fail$data((0,Cb._)`!${(0,D3.useFunc)(t,N3.default)}(${r}, ${n})`):e.fail((0,Cb._)`${o} !== ${r}`)}};Ab.default=A3});var B1=T(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var nc=ae(),M3=he(),U3=tm(),L3={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,nc._)`{allowedValues: ${e}}`},q3={keyword:"enum",schemaType:"array",$data:!0,error:L3,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:a}=e;if(!i&&n.length===0)throw new Error("enum must have non-empty array");let s=n.length>=a.opts.loopEnum,l,u=()=>l??(l=(0,M3.useFunc)(t,U3.default)),d;if(s||i)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let h=t.const("vSchema",o);d=(0,nc.or)(...n.map((m,g)=>f(h,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",o,h=>t.if((0,nc._)`${u()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function f(h,m){let g=n[m];return typeof g=="object"&&g!==null?(0,nc._)`${u()}(${r}, ${h}[${m}])`:(0,nc._)`${r} === ${g}`}}};Mb.default=q3});var H1=T(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var Z3=j1(),F3=D1(),V3=A1(),B3=M1(),H3=U1(),W3=L1(),J3=q1(),G3=F1(),K3=V1(),Q3=B1(),Y3=[Z3.default,F3.default,V3.default,B3.default,H3.default,W3.default,J3.default,G3.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},K3.default,Q3.default];Ub.default=Y3});var qb=T(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.validateAdditionalItems=void 0;var pi=ae(),Lb=he(),X3={message:({params:{len:e}})=>(0,pi.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,pi._)`{limit: ${e}}`},eV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:X3,code(e){let{parentSchema:t,it:r}=e,{items:i}=t;if(!Array.isArray(i)){(0,Lb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}W1(e,i)}};function W1(e,t){let{gen:r,schema:i,data:n,keyword:o,it:a}=e;a.items=!0;let s=r.const("len",(0,pi._)`${n}.length`);if(i===!1)e.setParams({len:t.length}),e.pass((0,pi._)`${s} <= ${t.length}`);else if(typeof i=="object"&&!(0,Lb.alwaysValidSchema)(a,i)){let u=r.var("valid",(0,pi._)`${s} <= ${t.length}`);r.if((0,pi.not)(u),()=>l(u)),e.ok(u)}function l(u){r.forRange("i",t.length,s,d=>{e.subschema({keyword:o,dataProp:d,dataPropType:Lb.Type.Num},u),a.allErrors||r.if((0,pi.not)(u),()=>r.break())})}}ic.validateAdditionalItems=W1;ic.default=eV});var Zb=T(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.validateTuple=void 0;var J1=ae(),rm=he(),tV=qt(),rV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return G1(e,"additionalItems",t);r.items=!0,!(0,rm.alwaysValidSchema)(r,t)&&e.ok((0,tV.validateArray)(e))}};function G1(e,t,r=e.schema){let{gen:i,parentSchema:n,data:o,keyword:a,it:s}=e;d(n),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=rm.mergeEvaluated.items(i,r.length,s.items));let l=i.name("valid"),u=i.const("len",(0,J1._)`${o}.length`);r.forEach((p,f)=>{(0,rm.alwaysValidSchema)(s,p)||(i.if((0,J1._)`${u} > ${f}`,()=>e.subschema({keyword:a,schemaProp:f,dataProp:f},l)),e.ok(l))});function d(p){let{opts:f,errSchemaPath:h}=s,m=r.length,g=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(f.strictTuples&&!g){let v=`"${a}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,rm.checkStrictMode)(s,v,f.strictTuples)}}}oc.validateTuple=G1;oc.default=rV});var K1=T(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var nV=Zb(),iV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,nV.validateTuple)(e,"items")};Fb.default=iV});var Y1=T(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});var Q1=ae(),oV=he(),aV=qt(),sV=qb(),cV={message:({params:{len:e}})=>(0,Q1.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Q1._)`{limit: ${e}}`},lV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cV,code(e){let{schema:t,parentSchema:r,it:i}=e,{prefixItems:n}=r;i.items=!0,!(0,oV.alwaysValidSchema)(i,t)&&(n?(0,sV.validateAdditionalItems)(e,n):e.ok((0,aV.validateArray)(e)))}};Vb.default=lV});var X1=T(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var Ft=ae(),nm=he(),uV={message:({params:{min:e,max:t}})=>t===void 0?(0,Ft.str)`must contain at least ${e} valid item(s)`:(0,Ft.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Ft._)`{minContains: ${e}}`:(0,Ft._)`{minContains: ${e}, maxContains: ${t}}`},dV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:uV,code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e,a,s,{minContains:l,maxContains:u}=i;o.opts.next?(a=l===void 0?1:l,s=u):a=1;let d=t.const("len",(0,Ft._)`${n}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,nm.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,nm.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,nm.alwaysValidSchema)(o,r)){let g=(0,Ft._)`${d} >= ${a}`;s!==void 0&&(g=(0,Ft._)`${g} && ${d} <= ${s}`),e.pass(g);return}o.items=!0;let p=t.name("valid");s===void 0&&a===1?h(p,()=>t.if(p,()=>t.break())):a===0?(t.let(p,!0),s!==void 0&&t.if((0,Ft._)`${n}.length > 0`,f)):(t.let(p,!1),f()),e.result(p,()=>e.reset());function f(){let g=t.name("_valid"),v=t.let("count",0);h(g,()=>t.if(g,()=>m(v)))}function h(g,v){t.forRange("i",0,d,_=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:nm.Type.Num,compositeRule:!0},g),v()})}function m(g){t.code((0,Ft._)`${g}++`),s===void 0?t.if((0,Ft._)`${g} >= ${a}`,()=>t.assign(p,!0).break()):(t.if((0,Ft._)`${g} > ${s}`,()=>t.assign(p,!1).break()),a===1?t.assign(p,!0):t.if((0,Ft._)`${g} >= ${a}`,()=>t.assign(p,!0)))}}};Bb.default=dV});var rR=T(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.validateSchemaDeps=_r.validatePropertyDeps=_r.error=void 0;var Hb=ae(),pV=he(),ac=qt();_r.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=t===1?"property":"properties";return(0,Hb.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>(0,Hb._)`{property: ${e},
34
+ || ${a} === "boolean" || ${n} === null`).assign(s,(0,oe._)`[${n}]`)}}}function m5({gen:e,parentData:t,parentDataProperty:r},i){e.if((0,oe._)`${t} !== undefined`,()=>e.assign((0,oe._)`${t}[${r}]`,i))}function tb(e,t,r,i=zo.Correct){let n=i===zo.Correct?oe.operators.EQ:oe.operators.NEQ,o;switch(e){case"null":return(0,oe._)`${t} ${n} null`;case"array":o=(0,oe._)`Array.isArray(${t})`;break;case"object":o=(0,oe._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,oe._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,oe._)`typeof ${t} ${n} ${e}`}return i===zo.Correct?o:(0,oe.not)(o);function a(s=oe.nil){return(0,oe.and)((0,oe._)`typeof ${t} == "number"`,s,r?(0,oe._)`isFinite(${t})`:oe.nil)}}st.checkDataType=tb;function rb(e,t,r,i){if(e.length===1)return tb(e[0],t,r,i);let n,o=(0,Lz.toHash)(e);if(o.array&&o.object){let a=(0,oe._)`typeof ${t} != "object"`;n=o.null?a:(0,oe._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else n=oe.nil;o.number&&delete o.integer;for(let a in o)n=(0,oe.and)(n,tb(a,t,r,i));return n}st.checkDataTypes=rb;var f5={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,oe._)`{type: ${e}}`:(0,oe._)`{type: ${t}}`};function nb(e){let t=h5(e);(0,c5.reportError)(t,f5)}st.reportTypeError=nb;function h5(e){let{gen:t,data:r,schema:i}=e,n=(0,Lz.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}});var Vz=I(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.assignDefaults=void 0;var Ro=ae(),g5=he();function y5(e,t){let{properties:r,items:i}=e.schema;if(t==="object"&&r)for(let n in r)Fz(e,n,r[n].default);else t==="array"&&Array.isArray(i)&&i.forEach((n,o)=>Fz(e,o,n.default))}Fp.assignDefaults=y5;function Fz(e,t,r){let{gen:i,compositeRule:n,data:o,opts:a}=e;if(r===void 0)return;let s=(0,Ro._)`${o}${(0,Ro.getProperty)(t)}`;if(n){(0,g5.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,Ro._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,Ro._)`${c} || ${s} === null || ${s} === ""`),i.if(c,(0,Ro._)`${s} = ${(0,Ro.stringify)(r)}`)}});var Zt=I(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.validateUnion=Te.validateArray=Te.usePattern=Te.callValidateCode=Te.schemaProperties=Te.allSchemaProperties=Te.noPropertyInData=Te.propertyInData=Te.isOwnProperty=Te.hasPropFunc=Te.reportMissingProp=Te.checkMissingProp=Te.checkReportMissingProp=void 0;var je=ae(),ib=he(),_n=Zr(),v5=he();function b5(e,t){let{gen:r,data:i,it:n}=e;r.if(ab(r,i,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:(0,je._)`${t}`},!0),e.error()})}Te.checkReportMissingProp=b5;function _5({gen:e,data:t,it:{opts:r}},i,n){return(0,je.or)(...i.map(o=>(0,je.and)(ab(e,t,o,r.ownProperties),(0,je._)`${n} = ${o}`)))}Te.checkMissingProp=_5;function S5(e,t){e.setParams({missingProperty:t},!0),e.error()}Te.reportMissingProp=S5;function Bz(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,je._)`Object.prototype.hasOwnProperty`})}Te.hasPropFunc=Bz;function ob(e,t,r){return(0,je._)`${Bz(e)}.call(${t}, ${r})`}Te.isOwnProperty=ob;function x5(e,t,r,i){let n=(0,je._)`${t}${(0,je.getProperty)(r)} !== undefined`;return i?(0,je._)`${n} && ${ob(e,t,r)}`:n}Te.propertyInData=x5;function ab(e,t,r,i){let n=(0,je._)`${t}${(0,je.getProperty)(r)} === undefined`;return i?(0,je.or)(n,(0,je.not)(ob(e,t,r))):n}Te.noPropertyInData=ab;function Hz(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Te.allSchemaProperties=Hz;function w5(e,t){return Hz(t).filter(r=>!(0,ib.alwaysValidSchema)(e,t[r]))}Te.schemaProperties=w5;function $5({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:a},s,c,u){let d=u?(0,je._)`${e}, ${t}, ${i}${n}`:t,p=[[_n.default.instancePath,(0,je.strConcat)(_n.default.instancePath,o)],[_n.default.parentData,a.parentData],[_n.default.parentDataProperty,a.parentDataProperty],[_n.default.rootData,_n.default.rootData]];a.opts.dynamicRef&&p.push([_n.default.dynamicAnchors,_n.default.dynamicAnchors]);let f=(0,je._)`${d}, ${r.object(...p)}`;return c!==je.nil?(0,je._)`${s}.call(${c}, ${f})`:(0,je._)`${s}(${f})`}Te.callValidateCode=$5;var k5=(0,je._)`new RegExp`;function T5({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:n}=t.code,o=n(r,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,je._)`${n.code==="new RegExp"?k5:(0,v5.useFunc)(e,n)}(${r}, ${i})`})}Te.usePattern=T5;function I5(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(o,!0),a(()=>t.break()),o;function a(s){let c=t.const("len",(0,je._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:ib.Type.Num},o),t.if((0,je.not)(o),s)})}}Te.validateArray=I5;function E5(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,ib.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:i,schemaProp:u,compositeRule:!0},s);t.assign(a,(0,je._)`${a} || ${s}`),e.mergeValidEvaluated(d,s)||t.if((0,je.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}Te.validateUnion=E5});var Gz=I(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.validateKeywordUsage=vr.validSchemaType=vr.funcKeywordCode=vr.macroKeywordCode=void 0;var ft=ae(),li=Zr(),P5=Zt(),z5=Zs();function R5(e,t){let{gen:r,keyword:i,schema:n,parentSchema:o,it:a}=e,s=t.macro.call(a.self,n,o,a),c=Jz(r,i,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=r.name("valid");e.subschema({schema:s,schemaPath:ft.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}vr.macroKeywordCode=R5;function O5(e,t){var r;let{gen:i,keyword:n,schema:o,parentSchema:a,$data:s,it:c}=e;D5(c,t);let u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,d=Jz(i,n,u),p=i.let("valid");e.block$data(p,f),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function f(){if(t.errors===!1)g(),t.modifying&&Wz(e),v(()=>e.error());else{let _=t.async?h():m();t.modifying&&Wz(e),v(()=>j5(e,_))}}function h(){let _=i.let("ruleErrs",null);return i.try(()=>g((0,ft._)`await `),w=>i.assign(p,!1).if((0,ft._)`${w} instanceof ${c.ValidationError}`,()=>i.assign(_,(0,ft._)`${w}.errors`),()=>i.throw(w))),_}function m(){let _=(0,ft._)`${d}.errors`;return i.assign(_,null),g(ft.nil),_}function g(_=t.async?(0,ft._)`await `:ft.nil){let w=c.opts.passContext?li.default.this:li.default.self,$=!("compile"in t&&!s||t.schema===!1);i.assign(p,(0,ft._)`${_}${(0,P5.callValidateCode)(e,d,w,$)}`,t.modifying)}function v(_){var w;i.if((0,ft.not)((w=t.valid)!==null&&w!==void 0?w:p),_)}}vr.funcKeywordCode=O5;function Wz(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,(0,ft._)`${i.parentData}[${i.parentDataProperty}]`))}function j5(e,t){let{gen:r}=e;r.if((0,ft._)`Array.isArray(${t})`,()=>{r.assign(li.default.vErrors,(0,ft._)`${li.default.vErrors} === null ? ${t} : ${li.default.vErrors}.concat(${t})`).assign(li.default.errors,(0,ft._)`${li.default.vErrors}.length`),(0,z5.extendErrors)(e)},()=>e.error())}function D5({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Jz(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,ft.stringify)(r)})}function N5(e,t,r=!1){return!t.length||t.some(i=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||r&&typeof e>"u")}vr.validSchemaType=N5;function C5({schema:e,opts:t,self:r,errSchemaPath:i},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");let a=n.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(n.validateSchema&&!n.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}vr.validateKeywordUsage=C5});var Qz=I(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.extendSubschemaMode=Sn.extendSubschemaData=Sn.getSubschema=void 0;var br=ae(),Kz=he();function A5(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,br._)`${e.schemaPath}${(0,br.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:(0,br._)`${e.schemaPath}${(0,br.getProperty)(t)}${(0,br.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Kz.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Sn.getSubschema=A5;function M5(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:a}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:p}=t,f=s.let("data",(0,br._)`${t.data}${(0,br.getProperty)(r)}`,!0);c(f),e.errorPath=(0,br.str)`${u}${(0,Kz.getErrorPath)(r,i,p.jsPropertySyntax)}`,e.parentDataProperty=(0,br._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(n!==void 0){let u=n instanceof br.Name?n:s.let("data",n,!0);c(u),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Sn.extendSubschemaData=M5;function U5(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){i!==void 0&&(e.compositeRule=i),n!==void 0&&(e.createErrors=n),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}Sn.extendSubschemaMode=U5});var sb=I((yre,Yz)=>{"use strict";Yz.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 i,n,o;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(n=i;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(o=Object.keys(t),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var a=o[n];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var e1=I((vre,Xz)=>{"use strict";var xn=Xz.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Vp(t,i,n,e,"",e)};xn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};xn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};xn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};xn.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 Vp(e,t,r,i,n,o,a,s,c,u){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,n,o,a,s,c,u);for(var d in i){var p=i[d];if(Array.isArray(p)){if(d in xn.arrayKeywords)for(var f=0;f<p.length;f++)Vp(e,t,r,p[f],n+"/"+d+"/"+f,o,n,d,i,f)}else if(d in xn.propsKeywords){if(p&&typeof p=="object")for(var h in p)Vp(e,t,r,p[h],n+"/"+d+"/"+L5(h),o,n,d,i,h)}else(d in xn.keywords||e.allKeys&&!(d in xn.skipKeywords))&&Vp(e,t,r,p,n+"/"+d,o,n,d,i)}r(i,n,o,a,s,c,u)}}function L5(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Vs=I($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.getSchemaRefs=$t.resolveUrl=$t.normalizeId=$t._getFullPath=$t.getFullPath=$t.inlineRef=void 0;var q5=he(),Z5=sb(),F5=e1(),V5=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function B5(e,t=!0){return typeof e=="boolean"?!0:t===!0?!cb(e):t?t1(e)<=t:!1}$t.inlineRef=B5;var H5=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function cb(e){for(let t in e){if(H5.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(cb)||typeof r=="object"&&cb(r))return!0}return!1}function t1(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!V5.has(r)&&(typeof e[r]=="object"&&(0,q5.eachItem)(e[r],i=>t+=t1(i)),t===1/0))return 1/0}return t}function r1(e,t="",r){r!==!1&&(t=Oo(t));let i=e.parse(t);return n1(e,i)}$t.getFullPath=r1;function n1(e,t){return e.serialize(t).split("#")[0]+"#"}$t._getFullPath=n1;var W5=/#\/?$/;function Oo(e){return e?e.replace(W5,""):""}$t.normalizeId=Oo;function J5(e,t,r){return r=Oo(r),e.resolve(t,r)}$t.resolveUrl=J5;var G5=/^[a-z_][-a-z0-9._]*$/i;function K5(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=Oo(e[r]||t),o={"":n},a=r1(i,n,!1),s={},c=new Set;return F5(e,{allKeys:!0},(p,f,h,m)=>{if(m===void 0)return;let g=a+f,v=o[m];typeof p[r]=="string"&&(v=_.call(this,p[r])),w.call(this,p.$anchor),w.call(this,p.$dynamicAnchor),o[f]=v;function _($){let E=this.opts.uriResolver.resolve;if($=Oo(v?E(v,$):$),c.has($))throw d($);c.add($);let N=this.refs[$];return typeof N=="string"&&(N=this.refs[N]),typeof N=="object"?u(p,N.schema,$):$!==Oo(g)&&($[0]==="#"?(u(p,s[$],$),s[$]=p):this.refs[$]=g),$}function w($){if(typeof $=="string"){if(!G5.test($))throw new Error(`invalid anchor "${$}"`);_.call(this,`#${$}`)}}}),s;function u(p,f,h){if(f!==void 0&&!Z5(p,f))throw d(h)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}$t.getSchemaRefs=K5});var Ws=I(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.getData=wn.KeywordCxt=wn.validateFunctionCode=void 0;var c1=Az(),i1=Fs(),ub=eb(),Bp=Fs(),Q5=Vz(),Hs=Gz(),lb=Qz(),B=ae(),Q=Zr(),Y5=Vs(),Fr=he(),Bs=Zs();function X5(e){if(d1(e)&&(p1(e),u1(e))){r9(e);return}l1(e,()=>(0,c1.topBoolOrEmptySchema)(e))}wn.validateFunctionCode=X5;function l1({gen:e,validateName:t,schema:r,schemaEnv:i,opts:n},o){n.code.es5?e.func(t,(0,B._)`${Q.default.data}, ${Q.default.valCxt}`,i.$async,()=>{e.code((0,B._)`"use strict"; ${o1(r,n)}`),t9(e,n),e.code(o)}):e.func(t,(0,B._)`${Q.default.data}, ${e9(n)}`,i.$async,()=>e.code(o1(r,n)).code(o))}function e9(e){return(0,B._)`{${Q.default.instancePath}="", ${Q.default.parentData}, ${Q.default.parentDataProperty}, ${Q.default.rootData}=${Q.default.data}${e.dynamicRef?(0,B._)`, ${Q.default.dynamicAnchors}={}`:B.nil}}={}`}function t9(e,t){e.if(Q.default.valCxt,()=>{e.var(Q.default.instancePath,(0,B._)`${Q.default.valCxt}.${Q.default.instancePath}`),e.var(Q.default.parentData,(0,B._)`${Q.default.valCxt}.${Q.default.parentData}`),e.var(Q.default.parentDataProperty,(0,B._)`${Q.default.valCxt}.${Q.default.parentDataProperty}`),e.var(Q.default.rootData,(0,B._)`${Q.default.valCxt}.${Q.default.rootData}`),t.dynamicRef&&e.var(Q.default.dynamicAnchors,(0,B._)`${Q.default.valCxt}.${Q.default.dynamicAnchors}`)},()=>{e.var(Q.default.instancePath,(0,B._)`""`),e.var(Q.default.parentData,(0,B._)`undefined`),e.var(Q.default.parentDataProperty,(0,B._)`undefined`),e.var(Q.default.rootData,Q.default.data),t.dynamicRef&&e.var(Q.default.dynamicAnchors,(0,B._)`{}`)})}function r9(e){let{schema:t,opts:r,gen:i}=e;l1(e,()=>{r.$comment&&t.$comment&&f1(e),s9(e),i.let(Q.default.vErrors,null),i.let(Q.default.errors,0),r.unevaluated&&n9(e),m1(e),u9(e)})}function n9(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,B._)`${r}.evaluated`),t.if((0,B._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,B._)`${e.evaluated}.props`,(0,B._)`undefined`)),t.if((0,B._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,B._)`${e.evaluated}.items`,(0,B._)`undefined`))}function o1(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,B._)`/*# sourceURL=${r} */`:B.nil}function i9(e,t){if(d1(e)&&(p1(e),u1(e))){o9(e,t);return}(0,c1.boolOrEmptySchema)(e,t)}function u1({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 d1(e){return typeof e.schema!="boolean"}function o9(e,t){let{schema:r,gen:i,opts:n}=e;n.$comment&&r.$comment&&f1(e),c9(e),l9(e);let o=i.const("_errs",Q.default.errors);m1(e,o),i.var(t,(0,B._)`${o} === ${Q.default.errors}`)}function p1(e){(0,Fr.checkUnknownRules)(e),a9(e)}function m1(e,t){if(e.opts.jtd)return a1(e,[],!1,t);let r=(0,i1.getSchemaTypes)(e.schema),i=(0,i1.coerceAndCheckDataType)(e,r);a1(e,r,!i,t)}function a9(e){let{schema:t,errSchemaPath:r,opts:i,self:n}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,Fr.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function s9(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Fr.checkStrictMode)(e,"default is ignored in the schema root")}function c9(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Y5.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function l9(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function f1({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)e.code((0,B._)`${Q.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let a=(0,B.str)`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,B._)`${Q.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function u9(e){let{gen:t,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=e;r.$async?t.if((0,B._)`${Q.default.errors} === 0`,()=>t.return(Q.default.data),()=>t.throw((0,B._)`new ${n}(${Q.default.vErrors})`)):(t.assign((0,B._)`${i}.errors`,Q.default.vErrors),o.unevaluated&&d9(e),t.return((0,B._)`${Q.default.errors} === 0`))}function d9({gen:e,evaluated:t,props:r,items:i}){r instanceof B.Name&&e.assign((0,B._)`${t}.props`,r),i instanceof B.Name&&e.assign((0,B._)`${t}.items`,i)}function a1(e,t,r,i){let{gen:n,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Fr.schemaHasRulesButRef)(o,d))){n.block(()=>g1(e,"$ref",d.all.$ref.definition));return}c.jtd||p9(e,t),n.block(()=>{for(let f of d.rules)p(f);p(d.post)});function p(f){(0,ub.shouldUseGroup)(o,f)&&(f.type?(n.if((0,Bp.checkDataType)(f.type,a,c.strictNumbers)),s1(e,f),t.length===1&&t[0]===f.type&&r&&(n.else(),(0,Bp.reportTypeError)(e)),n.endIf()):s1(e,f),s||n.if((0,B._)`${Q.default.errors} === ${i||0}`))}}function s1(e,t){let{gen:r,schema:i,opts:{useDefaults:n}}=e;n&&(0,Q5.assignDefaults)(e,t.type),r.block(()=>{for(let o of t.rules)(0,ub.shouldUseRule)(i,o)&&g1(e,o.keyword,o.definition,t.type)})}function p9(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(m9(e,t),e.opts.allowUnionTypes||f9(e,t),h9(e,e.dataTypes))}function m9(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{h1(e.dataTypes,r)||db(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),y9(e,t)}}function f9(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&db(e,"use allowUnionTypes to allow union type keyword")}function h9(e,t){let r=e.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,ub.shouldUseRule)(e.schema,n)){let{type:o}=n.definition;o.length&&!o.some(a=>g9(t,a))&&db(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function g9(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function h1(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function y9(e,t){let r=[];for(let i of e.dataTypes)h1(t,i)?r.push(i):t.includes("integer")&&i==="number"&&r.push("integer");e.dataTypes=r}function db(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Fr.checkStrictMode)(e,t,e.opts.strictTypes)}var Hp=class{constructor(t,r,i){if((0,Hs.validateKeywordUsage)(t,r,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Fr.schemaRefOrVal)(t,this.schema,i,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",y1(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Hs.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Q.default.errors))}result(t,r,i){this.failResult((0,B.not)(t),r,i)}failResult(t,r,i){this.gen.if(t),i?i():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,B.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,B._)`${r} !== undefined && (${(0,B.or)(this.invalid$data(),t)})`)}error(t,r,i){if(r){this.setParams(r),this._error(t,i),this.setParams({});return}this._error(t,i)}_error(t,r){(t?Bs.reportExtraError:Bs.reportError)(this,this.def.error,r)}$dataError(){(0,Bs.reportError)(this,this.def.$dataError||Bs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bs.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,i=B.nil){this.gen.block(()=>{this.check$data(t,i),r()})}check$data(t=B.nil,r=B.nil){if(!this.$data)return;let{gen:i,schemaCode:n,schemaType:o,def:a}=this;i.if((0,B.or)((0,B._)`${n} === undefined`,r)),t!==B.nil&&i.assign(t,!0),(o.length||a.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==B.nil&&i.assign(t,!1)),i.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:i,def:n,it:o}=this;return(0,B.or)(a(),s());function a(){if(i.length){if(!(r instanceof B.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,B._)`${(0,Bp.checkDataTypes)(c,r,o.opts.strictNumbers,Bp.DataType.Wrong)}`}return B.nil}function s(){if(n.validateSchema){let c=t.scopeValue("validate$data",{ref:n.validateSchema});return(0,B._)`!${c}(${r})`}return B.nil}}subschema(t,r){let i=(0,lb.getSubschema)(this.it,t);(0,lb.extendSubschemaData)(i,this.it,t),(0,lb.extendSubschemaMode)(i,t);let n={...this.it,...i,items:void 0,props:void 0};return i9(n,r),n}mergeEvaluated(t,r){let{it:i,gen:n}=this;i.opts.unevaluated&&(i.props!==!0&&t.props!==void 0&&(i.props=Fr.mergeEvaluated.props(n,t.props,i.props,r)),i.items!==!0&&t.items!==void 0&&(i.items=Fr.mergeEvaluated.items(n,t.items,i.items,r)))}mergeValidEvaluated(t,r){let{it:i,gen:n}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return n.if(r,()=>this.mergeEvaluated(t,B.Name)),!0}};wn.KeywordCxt=Hp;function g1(e,t,r,i){let n=new Hp(e,r,t);"code"in r?r.code(n,i):n.$data&&r.validate?(0,Hs.funcKeywordCode)(n,r):"macro"in r?(0,Hs.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Hs.funcKeywordCode)(n,r)}var v9=/^\/(?:[^~]|~0|~1)*$/,b9=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function y1(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let n,o;if(e==="")return Q.default.rootData;if(e[0]==="/"){if(!v9.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,o=Q.default.rootData}else{let u=b9.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(n=u[2],n==="#"){if(d>=t)throw new Error(c("property/index",d));return i[t-d]}if(d>t)throw new Error(c("data",d));if(o=r[t-d],!n)return o}let a=o,s=n.split("/");for(let u of s)u&&(o=(0,B._)`${o}${(0,B.getProperty)((0,Fr.unescapeJsonPointer)(u))}`,a=(0,B._)`${a} && ${o}`);return a;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}wn.getData=y1});var Wp=I(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var pb=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};mb.default=pb});var Js=I(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var fb=Vs(),hb=class extends Error{constructor(t,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,fb.resolveUrl)(t,r,i),this.missingSchema=(0,fb.normalizeId)((0,fb.getFullPath)(t,this.missingRef))}};gb.default=hb});var Gp=I(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.resolveSchema=Ft.getCompilingSchema=Ft.resolveRef=Ft.compileSchema=Ft.SchemaEnv=void 0;var or=ae(),_9=Wp(),ui=Zr(),ar=Vs(),v1=he(),S9=Ws(),jo=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let i;typeof t.schema=="object"&&(i=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,ar.normalizeId)(i?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=i?.$async,this.refs={}}};Ft.SchemaEnv=jo;function vb(e){let t=b1.call(this,e);if(t)return t;let r=(0,ar.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,a=new or.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:_9.default,code:(0,or._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:ui.default.data,parentData:ui.default.parentData,parentDataProperty:ui.default.parentDataProperty,dataNames:[ui.default.data],dataPathArr:[or.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,or.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:or.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,or._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,S9.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let p=a.toString();d=`${a.scopeRefs(ui.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));let h=new Function(`${ui.default.self}`,`${ui.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:g}=u;h.evaluated={props:m instanceof or.Name?void 0:m,items:g instanceof or.Name?void 0:g,dynamicProps:m instanceof or.Name,dynamicItems:g instanceof or.Name},h.source&&(h.source.evaluated=(0,or.stringify)(h.evaluated))}return e.validate=h,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}Ft.compileSchema=vb;function x9(e,t,r){var i;r=(0,ar.resolveUrl)(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let o=k9.call(this,e,r);if(o===void 0){let a=(i=e.localRefs)===null||i===void 0?void 0:i[r],{schemaId:s}=this.opts;a&&(o=new jo({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=w9.call(this,o)}Ft.resolveRef=x9;function w9(e){return(0,ar.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:vb.call(this,e)}function b1(e){for(let t of this._compilations)if($9(t,e))return t}Ft.getCompilingSchema=b1;function $9(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function k9(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Jp.call(this,e,t)}function Jp(e,t){let r=this.opts.uriResolver.parse(t),i=(0,ar._getFullPath)(this.opts.uriResolver,r),n=(0,ar.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===n)return yb.call(this,r,e);let o=(0,ar.normalizeId)(i),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=Jp.call(this,e,a);return typeof s?.schema!="object"?void 0:yb.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||vb.call(this,a),o===(0,ar.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(n=(0,ar.resolveUrl)(this.opts.uriResolver,n,u)),new jo({schema:s,schemaId:c,root:e,baseId:n})}return yb.call(this,r,a)}}Ft.resolveSchema=Jp;var T9=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function yb(e,{baseId:t,schema:r,root:i}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,v1.unescapeFragment)(s)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!T9.has(s)&&u&&(t=(0,ar.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,v1.schemaHasRulesButRef)(r,this.RULES)){let s=(0,ar.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Jp.call(this,i,s)}let{schemaId:a}=this.opts;if(o=o||new jo({schema:r,schemaId:a,root:i,baseId:t}),o.schema!==o.root.schema)return o}});var _1=I(($re,I9)=>{I9.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 _b=I((kre,$1)=>{"use strict";var E9=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),x1=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 bb(e){let t="",r=0,i=0;for(i=0;i<e.length;i++)if(r=e[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(r=e[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i]}return t}var P9=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function S1(e){return e.length=0,!0}function z9(e,t,r){if(e.length){let i=bb(e);if(i!=="")t.push(i);else return r.error=!0,!1;e.length=0}return!0}function R9(e){let t=0,r={error:!1,address:"",zone:""},i=[],n=[],o=!1,a=!1,s=z9;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!s(n,i,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(o=!0),i.push(":");continue}else if(u==="%"){if(!s(n,i,r))break;s=S1}else{n.push(u);continue}}return n.length&&(s===S1?r.zone=n.join(""):a?i.push(n.join("")):i.push(bb(n))),r.address=i.join(""),r}function w1(e){if(O9(e,":")<2)return{host:e,isIPV6:!1};let t=R9(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,i=t.address;return t.zone&&(r+="%"+t.zone,i+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:i}}}function O9(e,t){let r=0;for(let i=0;i<e.length;i++)e[i]===t&&r++;return r}function j9(e){let t=e,r=[],i=-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((i=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,i)),t=t.slice(i)}return r.join("")}function D9(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 N9(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!x1(r)){let i=w1(r);i.isIPV6===!0?r=`[${i.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}$1.exports={nonSimpleDomain:P9,recomposeAuthority:N9,normalizeComponentEncoding:D9,removeDotSegments:j9,isIPv4:x1,isUUID:E9,normalizeIPv6:w1,stringArrayToHexStripped:bb}});var P1=I((Tre,E1)=>{"use strict";var{isUUID:C9}=_b(),A9=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,M9=["http","https","ws","wss","urn","urn:uuid"];function U9(e){return M9.indexOf(e)!==-1}function Sb(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 k1(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function T1(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 L9(e){return e.secure=Sb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function q9(e){if((e.port===(Sb(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 Z9(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(A9);if(r){let i=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${i}:${t.nid||e.nid}`,o=xb(n);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function F9(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),n=`${r}:${t.nid||i}`,o=xb(n);o&&(e=o.serialize(e,t));let a=e,s=e.nss;return a.path=`${i||t.nid}:${s}`,t.skipEscape=!0,a}function V9(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!C9(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function B9(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var I1={scheme:"http",domainHost:!0,parse:k1,serialize:T1},H9={scheme:"https",domainHost:I1.domainHost,parse:k1,serialize:T1},Kp={scheme:"ws",domainHost:!0,parse:L9,serialize:q9},W9={scheme:"wss",domainHost:Kp.domainHost,parse:Kp.parse,serialize:Kp.serialize},J9={scheme:"urn",parse:Z9,serialize:F9,skipNormalize:!0},G9={scheme:"urn:uuid",parse:V9,serialize:B9,skipNormalize:!0},Qp={http:I1,https:H9,ws:Kp,wss:W9,urn:J9,"urn:uuid":G9};Object.setPrototypeOf(Qp,null);function xb(e){return e&&(Qp[e]||Qp[e.toLowerCase()])||void 0}E1.exports={wsIsSecure:Sb,SCHEMES:Qp,isValidSchemeName:U9,getSchemeHandler:xb}});var O1=I((Ire,Xp)=>{"use strict";var{normalizeIPv6:K9,removeDotSegments:Gs,recomposeAuthority:Q9,normalizeComponentEncoding:Yp,isIPv4:Y9,nonSimpleDomain:X9}=_b(),{SCHEMES:e3,getSchemeHandler:z1}=P1();function t3(e,t){return typeof e=="string"?e=_r(Vr(e,t),t):typeof e=="object"&&(e=Vr(_r(e,t),t)),e}function r3(e,t,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=R1(Vr(e,i),Vr(t,i),i,!0);return i.skipEscape=!0,_r(n,i)}function R1(e,t,r,i){let n={};return i||(e=Vr(_r(e,r),r),t=Vr(_r(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=Gs(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=Gs(t.path||""),n.query=t.query):(t.path?(t.path[0]==="/"?n.path=Gs(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=Gs(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 n3(e,t,r){return typeof e=="string"?(e=unescape(e),e=_r(Yp(Vr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=_r(Yp(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=_r(Yp(Vr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=_r(Yp(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function _r(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:""},i=Object.assign({},t),n=[],o=z1(i.scheme||r.scheme);o&&o.serialize&&o.serialize(r,i),r.path!==void 0&&(i.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),i.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let a=Q9(r);if(a!==void 0&&(i.reference!=="suffix"&&n.push("//"),n.push(a),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let s=r.path;!i.absolutePath&&(!o||!o.absolutePath)&&(s=Gs(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),n.push(s)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var i3=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Vr(e,t){let r=Object.assign({},t),i={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 o=e.match(i3);if(o){if(i.scheme=o[1],i.userinfo=o[3],i.host=o[4],i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=o[7],i.fragment=o[8],isNaN(i.port)&&(i.port=o[5]),i.host)if(Y9(i.host)===!1){let c=K9(i.host);i.host=c.host.toLowerCase(),n=c.isIPV6}else n=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let a=z1(r.scheme||i.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&i.host&&(r.domainHost||a&&a.domainHost)&&n===!1&&X9(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(s){i.error=i.error||"Host's domain name can not be converted to ASCII: "+s}(!a||a&&!a.skipNormalize)&&(e.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),a&&a.parse&&a.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}var wb={SCHEMES:e3,normalize:t3,resolve:r3,resolveComponent:R1,equal:n3,serialize:_r,parse:Vr};Xp.exports=wb;Xp.exports.default=wb;Xp.exports.fastUri=wb});var D1=I($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var j1=O1();j1.code='require("ajv/dist/runtime/uri").default';$b.default=j1});var Z1=I(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.CodeGen=tt.Name=tt.nil=tt.stringify=tt.str=tt._=tt.KeywordCxt=void 0;var o3=Ws();Object.defineProperty(tt,"KeywordCxt",{enumerable:!0,get:function(){return o3.KeywordCxt}});var Do=ae();Object.defineProperty(tt,"_",{enumerable:!0,get:function(){return Do._}});Object.defineProperty(tt,"str",{enumerable:!0,get:function(){return Do.str}});Object.defineProperty(tt,"stringify",{enumerable:!0,get:function(){return Do.stringify}});Object.defineProperty(tt,"nil",{enumerable:!0,get:function(){return Do.nil}});Object.defineProperty(tt,"Name",{enumerable:!0,get:function(){return Do.Name}});Object.defineProperty(tt,"CodeGen",{enumerable:!0,get:function(){return Do.CodeGen}});var a3=Wp(),U1=Js(),s3=Xv(),Ks=Gp(),c3=ae(),Qs=Vs(),em=Fs(),Tb=he(),N1=_1(),l3=D1(),L1=(e,t)=>new RegExp(e,t);L1.code="new RegExp";var u3=["removeAdditional","useDefaults","coerceTypes"],d3=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),p3={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."},m3={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},C1=200;function f3(e){var t,r,i,n,o,a,s,c,u,d,p,f,h,m,g,v,_,w,$,E,N,de,Y,be,ee;let Pe=e.strict,Be=(t=e.code)===null||t===void 0?void 0:t.optimize,Le=Be===!0||Be===void 0?1:Be||0,ct=(i=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:L1,ht=(n=e.uriResolver)!==null&&n!==void 0?n:l3.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Pe)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:Pe)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:Pe)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:Pe)!==null&&f!==void 0?f:"log",strictRequired:(m=(h=e.strictRequired)!==null&&h!==void 0?h:Pe)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:Le,regExp:ct}:{optimize:Le,regExp:ct},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:C1,loopEnum:(v=e.loopEnum)!==null&&v!==void 0?v:C1,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:($=e.inlineRefs)!==null&&$!==void 0?$:!0,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(N=e.addUsedSchema)!==null&&N!==void 0?N:!0,validateSchema:(de=e.validateSchema)!==null&&de!==void 0?de:!0,validateFormats:(Y=e.validateFormats)!==null&&Y!==void 0?Y:!0,unicodeRegExp:(be=e.unicodeRegExp)!==null&&be!==void 0?be:!0,int32range:(ee=e.int32range)!==null&&ee!==void 0?ee:!0,uriResolver:ht}}var Ys=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...f3(t)};let{es5:r,lines:i}=this.opts.code;this.scope=new c3.ValueScope({scope:{},prefixes:d3,es5:r,lines:i}),this.logger=_3(t.logger);let n=t.validateFormats;t.validateFormats=!1,this.RULES=(0,s3.getRules)(),A1.call(this,p3,t,"NOT SUPPORTED"),A1.call(this,m3,t,"DEPRECATED","warn"),this._metaOpts=v3.call(this),t.formats&&g3.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&y3.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),h3.call(this),t.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:i}=this.opts,n=N1;i==="id"&&(n={...N1},n.id=n.$id,delete n.$id),r&&t&&this.addMetaSchema(n,n[i],!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 i;if(typeof t=="string"){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);let n=i(r);return"$async"in i||(this.errors=i.errors),n}compile(t,r){let i=this._addSchema(t,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return n.call(this,t,r);async function n(d,p){await o.call(this,d.$schema);let f=this._addSchema(d,p);return f.validate||a.call(this,f)}async function o(d){d&&!this.getSchema(d)&&await n.call(this,{$ref:d},!0)}async function a(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof U1.default))throw p;return s.call(this,p),await c.call(this,p.missingSchema),a.call(this,d)}}function s({missingSchema:d,missingRef:p}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}async function c(d){let p=await u.call(this,d);this.refs[d]||await o.call(this,p.$schema),this.refs[d]||this.addSchema(p,d,r)}async function u(d){let p=this._loading[d];if(p)return p;try{return await(this._loading[d]=i(d))}finally{delete this._loading[d]}}}addSchema(t,r,i,n=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,i,n);return this}let o;if(typeof t=="object"){let{schemaId:a}=this.opts;if(o=t[a],o!==void 0&&typeof o!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Qs.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(t,i,r,n,!0),this}addMetaSchema(t,r,i=this.opts.validateSchema){return this.addSchema(t,r,!0,i),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let i;if(i=t.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(i,t);if(!n&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return n}getSchema(t){let r;for(;typeof(r=M1.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Ks.SchemaEnv({schema:{},schemaId:i});if(r=Ks.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=M1.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 i=t[this.opts.schemaId];return i&&(i=(0,Qs.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),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 i;if(typeof t=="string")i=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof t=="object"&&r===void 0){if(r=t,i=r.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(x3.call(this,i,r),!r)return(0,Tb.eachItem)(i,o=>kb.call(this,o)),this;$3.call(this,r);let n={...r,type:(0,em.getJSONTypes)(r.type),schemaType:(0,em.getJSONTypes)(r.schemaType)};return(0,Tb.eachItem)(i,n.type.length===0?o=>kb.call(this,o,n):o=>n.type.forEach(a=>kb.call(this,o,n,a))),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 i of r.rules){let n=i.rules.findIndex(o=>o.keyword===t);n>=0&&i.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:i="data"}={}){return!t||t.length===0?"No errors":t.map(n=>`${i}${n.instancePath} ${n.message}`).reduce((n,o)=>n+r+o)}$dataMetaSchema(t,r){let i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let n of r){let o=n.split("/").slice(1),a=t;for(let s of o)a=a[s];for(let s in i){let c=i[s];if(typeof c!="object")continue;let{$data:u}=c.definition,d=a[s];u&&d&&(a[s]=q1(d))}}return t}_removeAllSchemas(t,r){for(let i in t){let n=t[i];(!r||r.test(i))&&(typeof n=="string"?delete t[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete t[i]))}}_addSchema(t,r,i,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];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 c=this._cache.get(t);if(c!==void 0)return c;i=(0,Qs.normalizeId)(a||i);let u=Qs.getSchemaRefs.call(this,t,i);return c=new Ks.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:i,localRefs:u}),this._cache.set(c.schema,c),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=c),n&&this.validateSchema(t,!0),c}_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):Ks.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{Ks.compileSchema.call(this,t)}finally{this.opts=r}}};Ys.ValidationError=a3.default;Ys.MissingRefError=U1.default;tt.default=Ys;function A1(e,t,r,i="error"){for(let n in e){let o=n;o in t&&this.logger[i](`${r}: option ${n}. ${e[o]}`)}}function M1(e){return e=(0,Qs.normalizeId)(e),this.schemas[e]||this.refs[e]}function h3(){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 g3(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function y3(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 v3(){let e={...this.opts};for(let t of u3)delete e[t];return e}var b3={log(){},warn(){},error(){}};function _3(e){if(e===!1)return b3;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 S3=/^[a-z_$][a-z0-9_$:-]*$/i;function x3(e,t){let{RULES:r}=this;if((0,Tb.eachItem)(e,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!S3.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function kb(e,t,r){var i;let n=t?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=n?o.post:o.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,em.getJSONTypes)(t.type),schemaType:(0,em.getJSONTypes)(t.schemaType)}};t.before?w3.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(i=t.implements)===null||i===void 0||i.forEach(c=>this.addKeyword(c))}function w3(e,t,r){let i=e.rules.findIndex(n=>n.keyword===r);i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function $3(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=q1(t)),e.validateSchema=this.compile(t,!0))}var k3={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function q1(e){return{anyOf:[e,k3]}}});var F1=I(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var T3={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ib.default=T3});var W1=I(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.callRef=di.getValidate=void 0;var I3=Js(),V1=Zt(),kt=ae(),No=Zr(),B1=Gp(),tm=he(),E3={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:n,schemaEnv:o,validateName:a,opts:s,self:c}=i,{root:u}=o;if((r==="#"||r==="#/")&&n===u.baseId)return p();let d=B1.resolveRef.call(c,u,n,r);if(d===void 0)throw new I3.default(i.opts.uriResolver,n,r);if(d instanceof B1.SchemaEnv)return f(d);return h(d);function p(){if(o===u)return rm(e,a,o,o.$async);let m=t.scopeValue("root",{ref:u});return rm(e,(0,kt._)`${m}.validate`,u,u.$async)}function f(m){let g=H1(e,m);rm(e,g,m,m.$async)}function h(m){let g=t.scopeValue("schema",s.code.source===!0?{ref:m,code:(0,kt.stringify)(m)}:{ref:m}),v=t.name("valid"),_=e.subschema({schema:m,dataTypes:[],schemaPath:kt.nil,topSchemaRef:g,errSchemaPath:r},v);e.mergeEvaluated(_),e.ok(v)}}};function H1(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,kt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}di.getValidate=H1;function rm(e,t,r,i){let{gen:n,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?No.default.this:kt.nil;i?d():p();function d(){if(!s.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,kt._)`await ${(0,V1.callValidateCode)(e,t,u)}`),h(t),a||n.assign(m,!0)},g=>{n.if((0,kt._)`!(${g} instanceof ${o.ValidationError})`,()=>n.throw(g)),f(g),a||n.assign(m,!1)}),e.ok(m)}function p(){e.result((0,V1.callValidateCode)(e,t,u),()=>h(t),()=>f(t))}function f(m){let g=(0,kt._)`${m}.errors`;n.assign(No.default.vErrors,(0,kt._)`${No.default.vErrors} === null ? ${g} : ${No.default.vErrors}.concat(${g})`),n.assign(No.default.errors,(0,kt._)`${No.default.vErrors}.length`)}function h(m){var g;if(!o.opts.unevaluated)return;let v=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=tm.mergeEvaluated.props(n,v.props,o.props));else{let _=n.var("props",(0,kt._)`${m}.evaluated.props`);o.props=tm.mergeEvaluated.props(n,_,o.props,kt.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=tm.mergeEvaluated.items(n,v.items,o.items));else{let _=n.var("items",(0,kt._)`${m}.evaluated.items`);o.items=tm.mergeEvaluated.items(n,_,o.items,kt.Name)}}}di.callRef=rm;di.default=E3});var J1=I(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var P3=F1(),z3=W1(),R3=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",P3.default,z3.default];Eb.default=R3});var G1=I(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var nm=ae(),$n=nm.operators,im={maximum:{okStr:"<=",ok:$n.LTE,fail:$n.GT},minimum:{okStr:">=",ok:$n.GTE,fail:$n.LT},exclusiveMaximum:{okStr:"<",ok:$n.LT,fail:$n.GTE},exclusiveMinimum:{okStr:">",ok:$n.GT,fail:$n.LTE}},O3={message:({keyword:e,schemaCode:t})=>(0,nm.str)`must be ${im[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,nm._)`{comparison: ${im[e].okStr}, limit: ${t}}`},j3={keyword:Object.keys(im),type:"number",schemaType:"number",$data:!0,error:O3,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data((0,nm._)`${r} ${im[t].fail} ${i} || isNaN(${r})`)}};Pb.default=j3});var K1=I(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var Xs=ae(),D3={message:({schemaCode:e})=>(0,Xs.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Xs._)`{multipleOf: ${e}}`},N3={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:D3,code(e){let{gen:t,data:r,schemaCode:i,it:n}=e,o=n.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,Xs._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Xs._)`${a} !== parseInt(${a})`;e.fail$data((0,Xs._)`(${i} === 0 || (${a} = ${r}/${i}, ${s}))`)}};zb.default=N3});var Y1=I(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});function Q1(e){let t=e.length,r=0,i=0,n;for(;i<t;)r++,n=e.charCodeAt(i++),n>=55296&&n<=56319&&i<t&&(n=e.charCodeAt(i),(n&64512)===56320&&i++);return r}Rb.default=Q1;Q1.code='require("ajv/dist/runtime/ucs2length").default'});var X1=I(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var pi=ae(),C3=he(),A3=Y1(),M3={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,pi.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,pi._)`{limit: ${e}}`},U3={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:M3,code(e){let{keyword:t,data:r,schemaCode:i,it:n}=e,o=t==="maxLength"?pi.operators.GT:pi.operators.LT,a=n.opts.unicode===!1?(0,pi._)`${r}.length`:(0,pi._)`${(0,C3.useFunc)(e.gen,A3.default)}(${r})`;e.fail$data((0,pi._)`${a} ${o} ${i}`)}};Ob.default=U3});var eR=I(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var L3=Zt(),q3=he(),Co=ae(),Z3={message:({schemaCode:e})=>(0,Co.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Co._)`{pattern: ${e}}`},F3={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Z3,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(i){let{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,Co._)`new RegExp`:(0,q3.useFunc)(t,c),d=t.let("valid");t.try(()=>t.assign(d,(0,Co._)`${u}(${o}, ${s}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,Co._)`!${d}`)}else{let c=(0,L3.usePattern)(e,n);e.fail$data((0,Co._)`!${c}.test(${r})`)}}};jb.default=F3});var tR=I(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var ec=ae(),V3={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,ec.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,ec._)`{limit: ${e}}`},B3={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:V3,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxProperties"?ec.operators.GT:ec.operators.LT;e.fail$data((0,ec._)`Object.keys(${r}).length ${n} ${i}`)}};Db.default=B3});var rR=I(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var tc=Zt(),rc=ae(),H3=he(),W3={message:({params:{missingProperty:e}})=>(0,rc.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,rc._)`{missingProperty: ${e}}`},J3={keyword:"required",type:"object",schemaType:"array",$data:!0,error:W3,code(e){let{gen:t,schema:r,schemaCode:i,data:n,$data:o,it:a}=e,{opts:s}=a;if(!o&&r.length===0)return;let c=r.length>=s.loopRequired;if(a.allErrors?u():d(),s.strictRequired){let h=e.parentSchema.properties,{definedProperties:m}=e.it;for(let g of r)if(h?.[g]===void 0&&!m.has(g)){let v=a.schemaEnv.baseId+a.errSchemaPath,_=`required property "${g}" is not defined at "${v}" (strictRequired)`;(0,H3.checkStrictMode)(a,_,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(rc.nil,p);else for(let h of r)(0,tc.checkReportMissingProp)(e,h)}function d(){let h=t.let("missing");if(c||o){let m=t.let("valid",!0);e.block$data(m,()=>f(h,m)),e.ok(m)}else t.if((0,tc.checkMissingProp)(e,r,h)),(0,tc.reportMissingProp)(e,h),t.else()}function p(){t.forOf("prop",i,h=>{e.setParams({missingProperty:h}),t.if((0,tc.noPropertyInData)(t,n,h,s.ownProperties),()=>e.error())})}function f(h,m){e.setParams({missingProperty:h}),t.forOf(h,i,()=>{t.assign(m,(0,tc.propertyInData)(t,n,h,s.ownProperties)),t.if((0,rc.not)(m),()=>{e.error(),t.break()})},rc.nil)}}};Nb.default=J3});var nR=I(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var nc=ae(),G3={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,nc.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,nc._)`{limit: ${e}}`},K3={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:G3,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxItems"?nc.operators.GT:nc.operators.LT;e.fail$data((0,nc._)`${r}.length ${n} ${i}`)}};Cb.default=K3});var om=I(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var iR=sb();iR.code='require("ajv/dist/runtime/equal").default';Ab.default=iR});var oR=I(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var Mb=Fs(),rt=ae(),Q3=he(),Y3=om(),X3={message:({params:{i:e,j:t}})=>(0,rt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,rt._)`{i: ${e}, j: ${t}}`},eV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:X3,code(e){let{gen:t,data:r,$data:i,schema:n,parentSchema:o,schemaCode:a,it:s}=e;if(!i&&!n)return;let c=t.let("valid"),u=o.items?(0,Mb.getSchemaTypes)(o.items):[];e.block$data(c,d,(0,rt._)`${a} === false`),e.ok(c);function d(){let m=t.let("i",(0,rt._)`${r}.length`),g=t.let("j");e.setParams({i:m,j:g}),t.assign(c,!0),t.if((0,rt._)`${m} > 1`,()=>(p()?f:h)(m,g))}function p(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,g){let v=t.name("item"),_=(0,Mb.checkDataTypes)(u,v,s.opts.strictNumbers,Mb.DataType.Wrong),w=t.const("indices",(0,rt._)`{}`);t.for((0,rt._)`;${m}--;`,()=>{t.let(v,(0,rt._)`${r}[${m}]`),t.if(_,(0,rt._)`continue`),u.length>1&&t.if((0,rt._)`typeof ${v} == "string"`,(0,rt._)`${v} += "_"`),t.if((0,rt._)`typeof ${w}[${v}] == "number"`,()=>{t.assign(g,(0,rt._)`${w}[${v}]`),e.error(),t.assign(c,!1).break()}).code((0,rt._)`${w}[${v}] = ${m}`)})}function h(m,g){let v=(0,Q3.useFunc)(t,Y3.default),_=t.name("outer");t.label(_).for((0,rt._)`;${m}--;`,()=>t.for((0,rt._)`${g} = ${m}; ${g}--;`,()=>t.if((0,rt._)`${v}(${r}[${m}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};Ub.default=eV});var aR=I(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var Lb=ae(),tV=he(),rV=om(),nV={message:"must be equal to constant",params:({schemaCode:e})=>(0,Lb._)`{allowedValue: ${e}}`},iV={keyword:"const",$data:!0,error:nV,code(e){let{gen:t,data:r,$data:i,schemaCode:n,schema:o}=e;i||o&&typeof o=="object"?e.fail$data((0,Lb._)`!${(0,tV.useFunc)(t,rV.default)}(${r}, ${n})`):e.fail((0,Lb._)`${o} !== ${r}`)}};qb.default=iV});var sR=I(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var ic=ae(),oV=he(),aV=om(),sV={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ic._)`{allowedValues: ${e}}`},cV={keyword:"enum",schemaType:"array",$data:!0,error:sV,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:a}=e;if(!i&&n.length===0)throw new Error("enum must have non-empty array");let s=n.length>=a.opts.loopEnum,c,u=()=>c??(c=(0,oV.useFunc)(t,aV.default)),d;if(s||i)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let h=t.const("vSchema",o);d=(0,ic.or)(...n.map((m,g)=>f(h,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",o,h=>t.if((0,ic._)`${u()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function f(h,m){let g=n[m];return typeof g=="object"&&g!==null?(0,ic._)`${u()}(${r}, ${h}[${m}])`:(0,ic._)`${r} === ${g}`}}};Zb.default=cV});var cR=I(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var lV=G1(),uV=K1(),dV=X1(),pV=eR(),mV=tR(),fV=rR(),hV=nR(),gV=oR(),yV=aR(),vV=sR(),bV=[lV.default,uV.default,dV.default,pV.default,mV.default,fV.default,hV.default,gV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},yV.default,vV.default];Fb.default=bV});var Bb=I(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.validateAdditionalItems=void 0;var mi=ae(),Vb=he(),_V={message:({params:{len:e}})=>(0,mi.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,mi._)`{limit: ${e}}`},SV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_V,code(e){let{parentSchema:t,it:r}=e,{items:i}=t;if(!Array.isArray(i)){(0,Vb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}lR(e,i)}};function lR(e,t){let{gen:r,schema:i,data:n,keyword:o,it:a}=e;a.items=!0;let s=r.const("len",(0,mi._)`${n}.length`);if(i===!1)e.setParams({len:t.length}),e.pass((0,mi._)`${s} <= ${t.length}`);else if(typeof i=="object"&&!(0,Vb.alwaysValidSchema)(a,i)){let u=r.var("valid",(0,mi._)`${s} <= ${t.length}`);r.if((0,mi.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,s,d=>{e.subschema({keyword:o,dataProp:d,dataPropType:Vb.Type.Num},u),a.allErrors||r.if((0,mi.not)(u),()=>r.break())})}}oc.validateAdditionalItems=lR;oc.default=SV});var Hb=I(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.validateTuple=void 0;var uR=ae(),am=he(),xV=Zt(),wV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return dR(e,"additionalItems",t);r.items=!0,!(0,am.alwaysValidSchema)(r,t)&&e.ok((0,xV.validateArray)(e))}};function dR(e,t,r=e.schema){let{gen:i,parentSchema:n,data:o,keyword:a,it:s}=e;d(n),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=am.mergeEvaluated.items(i,r.length,s.items));let c=i.name("valid"),u=i.const("len",(0,uR._)`${o}.length`);r.forEach((p,f)=>{(0,am.alwaysValidSchema)(s,p)||(i.if((0,uR._)`${u} > ${f}`,()=>e.subschema({keyword:a,schemaProp:f,dataProp:f},c)),e.ok(c))});function d(p){let{opts:f,errSchemaPath:h}=s,m=r.length,g=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(f.strictTuples&&!g){let v=`"${a}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,am.checkStrictMode)(s,v,f.strictTuples)}}}ac.validateTuple=dR;ac.default=wV});var pR=I(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var $V=Hb(),kV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,$V.validateTuple)(e,"items")};Wb.default=kV});var fR=I(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var mR=ae(),TV=he(),IV=Zt(),EV=Bb(),PV={message:({params:{len:e}})=>(0,mR.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,mR._)`{limit: ${e}}`},zV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:PV,code(e){let{schema:t,parentSchema:r,it:i}=e,{prefixItems:n}=r;i.items=!0,!(0,TV.alwaysValidSchema)(i,t)&&(n?(0,EV.validateAdditionalItems)(e,n):e.ok((0,IV.validateArray)(e)))}};Jb.default=zV});var hR=I(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var Vt=ae(),sm=he(),RV={message:({params:{min:e,max:t}})=>t===void 0?(0,Vt.str)`must contain at least ${e} valid item(s)`:(0,Vt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Vt._)`{minContains: ${e}}`:(0,Vt._)`{minContains: ${e}, maxContains: ${t}}`},OV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:RV,code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e,a,s,{minContains:c,maxContains:u}=i;o.opts.next?(a=c===void 0?1:c,s=u):a=1;let d=t.const("len",(0,Vt._)`${n}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,sm.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,sm.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,sm.alwaysValidSchema)(o,r)){let g=(0,Vt._)`${d} >= ${a}`;s!==void 0&&(g=(0,Vt._)`${g} && ${d} <= ${s}`),e.pass(g);return}o.items=!0;let p=t.name("valid");s===void 0&&a===1?h(p,()=>t.if(p,()=>t.break())):a===0?(t.let(p,!0),s!==void 0&&t.if((0,Vt._)`${n}.length > 0`,f)):(t.let(p,!1),f()),e.result(p,()=>e.reset());function f(){let g=t.name("_valid"),v=t.let("count",0);h(g,()=>t.if(g,()=>m(v)))}function h(g,v){t.forRange("i",0,d,_=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:sm.Type.Num,compositeRule:!0},g),v()})}function m(g){t.code((0,Vt._)`${g}++`),s===void 0?t.if((0,Vt._)`${g} >= ${a}`,()=>t.assign(p,!0).break()):(t.if((0,Vt._)`${g} > ${s}`,()=>t.assign(p,!1).break()),a===1?t.assign(p,!0):t.if((0,Vt._)`${g} >= ${a}`,()=>t.assign(p,!0)))}}};Gb.default=OV});var vR=I(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.validateSchemaDeps=Sr.validatePropertyDeps=Sr.error=void 0;var Kb=ae(),jV=he(),sc=Zt();Sr.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=t===1?"property":"properties";return(0,Kb.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>(0,Kb._)`{property: ${e},
35
35
  missingProperty: ${i},
36
36
  depsCount: ${t},
37
- deps: ${r}}`};var mV={keyword:"dependencies",type:"object",schemaType:"object",error:_r.error,code(e){let[t,r]=fV(e);eR(e,t),tR(e,r)}};function fV({schema:e}){let t={},r={};for(let i in e){if(i==="__proto__")continue;let n=Array.isArray(e[i])?t:r;n[i]=e[i]}return[t,r]}function eR(e,t=e.schema){let{gen:r,data:i,it:n}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let l=(0,ac.propertyInData)(r,i,a,n.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),n.allErrors?r.if(l,()=>{for(let u of s)(0,ac.checkReportMissingProp)(e,u)}):(r.if((0,Hb._)`${l} && (${(0,ac.checkMissingProp)(e,s,o)})`),(0,ac.reportMissingProp)(e,o),r.else())}}_r.validatePropertyDeps=eR;function tR(e,t=e.schema){let{gen:r,data:i,keyword:n,it:o}=e,a=r.name("valid");for(let s in t)(0,pV.alwaysValidSchema)(o,t[s])||(r.if((0,ac.propertyInData)(r,i,s,o.opts.ownProperties),()=>{let l=e.subschema({keyword:n,schemaProp:s},a);e.mergeValidEvaluated(l,a)},()=>r.var(a,!0)),e.ok(a))}_r.validateSchemaDeps=tR;_r.default=mV});var iR=T(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var nR=ae(),hV=he(),gV={message:"property name must be valid",params:({params:e})=>(0,nR._)`{propertyName: ${e.propertyName}}`},yV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:gV,code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,hV.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,nR.not)(o),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(o)}};Wb.default=yV});var Gb=T(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var im=qt(),ar=ae(),vV=Lr(),om=he(),bV={message:"must NOT have additional properties",params:({params:e})=>(0,ar._)`{additionalProperty: ${e.additionalProperty}}`},_V={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:bV,code(e){let{gen:t,schema:r,parentSchema:i,data:n,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");let{allErrors:s,opts:l}=a;if(a.props=!0,l.removeAdditional!=="all"&&(0,om.alwaysValidSchema)(a,r))return;let u=(0,im.allSchemaProperties)(i.properties),d=(0,im.allSchemaProperties)(i.patternProperties);p(),e.ok((0,ar._)`${o} === ${vV.default.errors}`);function p(){t.forIn("key",n,v=>{!u.length&&!d.length?m(v):t.if(f(v),()=>m(v))})}function f(v){let _;if(u.length>8){let w=(0,om.schemaRefOrVal)(a,i.properties,"properties");_=(0,im.isOwnProperty)(t,w,v)}else u.length?_=(0,ar.or)(...u.map(w=>(0,ar._)`${v} === ${w}`)):_=ar.nil;return d.length&&(_=(0,ar.or)(_,...d.map(w=>(0,ar._)`${(0,im.usePattern)(e,w)}.test(${v})`))),(0,ar.not)(_)}function h(v){t.code((0,ar._)`delete ${n}[${v}]`)}function m(v){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,om.alwaysValidSchema)(a,r)){let _=t.name("valid");l.removeAdditional==="failing"?(g(v,_,!1),t.if((0,ar.not)(_),()=>{e.reset(),h(v)})):(g(v,_),s||t.if((0,ar.not)(_),()=>t.break()))}}function g(v,_,w){let $={keyword:"additionalProperties",dataProp:v,dataPropType:om.Type.Str};w===!1&&Object.assign($,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema($,_)}}};Jb.default=_V});var sR=T(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var SV=Hs(),oR=qt(),Kb=he(),aR=Gb(),xV={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&aR.default.code(new SV.KeywordCxt(o,aR.default,"additionalProperties"));let a=(0,oR.allSchemaProperties)(r);for(let p of a)o.definedProperties.add(p);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=Kb.mergeEvaluated.props(t,(0,Kb.toHash)(a),o.props));let s=a.filter(p=>!(0,Kb.alwaysValidSchema)(o,r[p]));if(s.length===0)return;let l=t.name("valid");for(let p of s)u(p)?d(p):(t.if((0,oR.propertyInData)(t,n,p,o.opts.ownProperties)),d(p),o.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(l);function u(p){return o.opts.useDefaults&&!o.compositeRule&&r[p].default!==void 0}function d(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},l)}}};Qb.default=xV});var dR=T(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var cR=qt(),am=ae(),lR=he(),uR=he(),wV={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:i,parentSchema:n,it:o}=e,{opts:a}=o,s=(0,cR.allSchemaProperties)(r),l=s.filter(g=>(0,lR.alwaysValidSchema)(o,r[g]));if(s.length===0||l.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&n.properties,d=t.name("valid");o.props!==!0&&!(o.props instanceof am.Name)&&(o.props=(0,uR.evaluatedPropsToName)(t,o.props));let{props:p}=o;f();function f(){for(let g of s)u&&h(g),o.allErrors?m(g):(t.var(d,!0),m(g),t.if(d))}function h(g){for(let v in u)new RegExp(g).test(v)&&(0,lR.checkStrictMode)(o,`property ${v} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){t.forIn("key",i,v=>{t.if((0,am._)`${(0,cR.usePattern)(e,g)}.test(${v})`,()=>{let _=l.includes(g);_||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:v,dataPropType:uR.Type.Str},d),o.opts.unevaluated&&p!==!0?t.assign((0,am._)`${p}[${v}]`,!0):!_&&!o.allErrors&&t.if((0,am.not)(d),()=>t.break())})})}}};Yb.default=wV});var pR=T(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var $V=he(),kV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,$V.alwaysValidSchema)(i,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"}};Xb.default=kV});var mR=T(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});var TV=qt(),IV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:TV.validateUnion,error:{message:"must match a schema in anyOf"}};e_.default=IV});var fR=T(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});var sm=ae(),EV=he(),PV={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,sm._)`{passingSchemas: ${e.passing}}`},zV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:PV,code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,a=t.let("valid",!1),s=t.let("passing",null),l=t.name("_valid");e.setParams({passing:s}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,p)=>{let f;(0,EV.alwaysValidSchema)(n,d)?t.var(l,!0):f=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},l),p>0&&t.if((0,sm._)`${l} && ${a}`).assign(a,!1).assign(s,(0,sm._)`[${s}, ${p}]`).else(),t.if(l,()=>{t.assign(a,!0),t.assign(s,p),f&&e.mergeEvaluated(f,sm.Name)})})}}};t_.default=zV});var hR=T(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});var RV=he(),OV={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=t.name("valid");r.forEach((o,a)=>{if((0,RV.alwaysValidSchema)(i,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},n);e.ok(n),e.mergeEvaluated(s)})}};r_.default=OV});var vR=T(n_=>{"use strict";Object.defineProperty(n_,"__esModule",{value:!0});var cm=ae(),yR=he(),jV={message:({params:e})=>(0,cm.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,cm._)`{failingKeyword: ${e.ifClause}}`},DV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:jV,code(e){let{gen:t,parentSchema:r,it:i}=e;r.then===void 0&&r.else===void 0&&(0,yR.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=gR(i,"then"),o=gR(i,"else");if(!n&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(l(),e.reset(),n&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(s,u("then",d),u("else",d))}else n?t.if(s,u("then")):t.if((0,cm.not)(s),u("else"));e.pass(a,()=>e.error(!0));function l(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(d)}function u(d,p){return()=>{let f=e.subschema({keyword:d},s);t.assign(a,s),e.mergeValidEvaluated(f,a),p?t.assign(p,(0,cm._)`${d}`):e.setParams({ifClause:d})}}}};function gR(e,t){let r=e.schema[t];return r!==void 0&&!(0,yR.alwaysValidSchema)(e,r)}n_.default=DV});var bR=T(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});var NV=he(),CV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,NV.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};i_.default=CV});var _R=T(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});var AV=qb(),MV=K1(),UV=Zb(),LV=Y1(),qV=X1(),ZV=rR(),FV=iR(),VV=Gb(),BV=sR(),HV=dR(),WV=pR(),JV=mR(),GV=fR(),KV=hR(),QV=vR(),YV=bR();function XV(e=!1){let t=[WV.default,JV.default,GV.default,KV.default,QV.default,YV.default,FV.default,VV.default,ZV.default,BV.default,HV.default];return e?t.push(MV.default,LV.default):t.push(AV.default,UV.default),t.push(qV.default),t}o_.default=XV});var SR=T(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var Le=ae(),eB={message:({schemaCode:e})=>(0,Le.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Le._)`{format: ${e}}`},tB={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:eB,code(e,t){let{gen:r,data:i,$data:n,schema:o,schemaCode:a,it:s}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=s;if(!l.validateFormats)return;n?f():h();function f(){let m=r.scopeValue("formats",{ref:p.formats,code:l.code.formats}),g=r.const("fDef",(0,Le._)`${m}[${a}]`),v=r.let("fType"),_=r.let("format");r.if((0,Le._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(v,(0,Le._)`${g}.type || "string"`).assign(_,(0,Le._)`${g}.validate`),()=>r.assign(v,(0,Le._)`"string"`).assign(_,g)),e.fail$data((0,Le.or)(w(),$()));function w(){return l.strictSchema===!1?Le.nil:(0,Le._)`${a} && !${_}`}function $(){let E=d.$async?(0,Le._)`(${g}.async ? await ${_}(${i}) : ${_}(${i}))`:(0,Le._)`${_}(${i})`,N=(0,Le._)`(typeof ${_} == "function" ? ${E} : ${_}.test(${i}))`;return(0,Le._)`${_} && ${_} !== true && ${v} === ${t} && !${N}`}}function h(){let m=p.formats[o];if(!m){w();return}if(m===!0)return;let[g,v,_]=$(m);g===t&&e.pass(E());function w(){if(l.strictSchema===!1){p.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function $(N){let de=N instanceof RegExp?(0,Le.regexpCode)(N):l.code.formats?(0,Le._)`${l.code.formats}${(0,Le.getProperty)(o)}`:void 0,Y=r.scopeValue("formats",{key:o,ref:N,code:de});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,Le._)`${Y}.validate`]:["string",N,Y]}function E(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${_}(${i})`}return typeof v=="function"?(0,Le._)`${_}(${i})`:(0,Le._)`${_}.test(${i})`}}}};a_.default=tB});var xR=T(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});var rB=SR(),nB=[rB.default];s_.default=nB});var wR=T(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.contentVocabulary=Co.metadataVocabulary=void 0;Co.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Co.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kR=T(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});var iB=O1(),oB=H1(),aB=_R(),sB=xR(),$R=wR(),cB=[iB.default,oB.default,(0,aB.default)(),sB.default,$R.metadataVocabulary,$R.contentVocabulary];c_.default=cB});var IR=T(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.DiscrError=void 0;var TR;(function(e){e.Tag="tag",e.Mapping="mapping"})(TR||(lm.DiscrError=TR={}))});var PR=T(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var Ao=ae(),l_=IR(),ER=Bp(),lB=Ws(),uB=he(),dB={message:({params:{discrError:e,tagName:t}})=>e===l_.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Ao._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},pB={keyword:"discriminator",type:"object",schemaType:"object",error:dB,code(e){let{gen:t,data:r,schema:i,parentSchema:n,it:o}=e,{oneOf:a}=n;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=i.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let l=t.let("valid",!1),u=t.const("tag",(0,Ao._)`${r}${(0,Ao.getProperty)(s)}`);t.if((0,Ao._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:l_.DiscrError.Tag,tag:u,tagName:s})),e.ok(l);function d(){let h=f();t.if(!1);for(let m in h)t.elseIf((0,Ao._)`${u} === ${m}`),t.assign(l,p(h[m]));t.else(),e.error(!1,{discrError:l_.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function p(h){let m=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:h},m);return e.mergeEvaluated(g,Ao.Name),m}function f(){var h;let m={},g=_(n),v=!0;for(let E=0;E<a.length;E++){let N=a[E];if(N?.$ref&&!(0,uB.schemaHasRulesButRef)(N,o.self.RULES)){let Y=N.$ref;if(N=ER.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,Y),N instanceof ER.SchemaEnv&&(N=N.schema),N===void 0)throw new lB.default(o.opts.uriResolver,o.baseId,Y)}let de=(h=N?.properties)===null||h===void 0?void 0:h[s];if(typeof de!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);v=v&&(g||_(N)),w(de,E)}if(!v)throw new Error(`discriminator: "${s}" must be required`);return m;function _({required:E}){return Array.isArray(E)&&E.includes(s)}function w(E,N){if(E.const)$(E.const,N);else if(E.enum)for(let de of E.enum)$(de,N);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function $(E,N){if(typeof E!="string"||E in m)throw new Error(`discriminator: "${s}" values must be unique strings`);m[E]=N}}}};u_.default=pB});var zR=T((Cre,mB)=>{mB.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 p_=T((De,d_)=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.MissingRefError=De.ValidationError=De.CodeGen=De.Name=De.nil=De.stringify=De.str=De._=De.KeywordCxt=De.Ajv=void 0;var fB=T1(),hB=kR(),gB=PR(),RR=zR(),yB=["/properties"],um="http://json-schema.org/draft-07/schema",Mo=class extends fB.default{_addVocabularies(){super._addVocabularies(),hB.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(gB.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(RR,yB):RR;this.addMetaSchema(t,um,!1),this.refs["http://json-schema.org/schema"]=um}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(um)?um:void 0)}};De.Ajv=Mo;d_.exports=De=Mo;d_.exports.Ajv=Mo;Object.defineProperty(De,"__esModule",{value:!0});De.default=Mo;var vB=Hs();Object.defineProperty(De,"KeywordCxt",{enumerable:!0,get:function(){return vB.KeywordCxt}});var Uo=ae();Object.defineProperty(De,"_",{enumerable:!0,get:function(){return Uo._}});Object.defineProperty(De,"str",{enumerable:!0,get:function(){return Uo.str}});Object.defineProperty(De,"stringify",{enumerable:!0,get:function(){return Uo.stringify}});Object.defineProperty(De,"nil",{enumerable:!0,get:function(){return Uo.nil}});Object.defineProperty(De,"Name",{enumerable:!0,get:function(){return Uo.Name}});Object.defineProperty(De,"CodeGen",{enumerable:!0,get:function(){return Uo.CodeGen}});var bB=Fp();Object.defineProperty(De,"ValidationError",{enumerable:!0,get:function(){return bB.default}});var _B=Ws();Object.defineProperty(De,"MissingRefError",{enumerable:!0,get:function(){return _B.default}})});var UR=T(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.formatNames=xr.fastFormats=xr.fullFormats=void 0;function Sr(e,t){return{validate:e,compare:t}}xr.fullFormats={date:Sr(NR,g_),time:Sr(f_(!0),y_),"date-time":Sr(OR(!0),AR),"iso-time":Sr(f_(),CR),"iso-date-time":Sr(OR(),MR),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:TB,"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:jB,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:IB,int32:{type:"number",validate:zB},int64:{type:"number",validate:RB},float:{type:"number",validate:DR},double:{type:"number",validate:DR},password:!0,binary:!0};xr.fastFormats={...xr.fullFormats,date:Sr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,g_),time:Sr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,y_),"date-time":Sr(/^\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,AR),"iso-time":Sr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,CR),"iso-date-time":Sr(/^\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,MR),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};xr.formatNames=Object.keys(xr.fullFormats);function SB(e){return e%4===0&&(e%100!==0||e%400===0)}var xB=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,wB=[0,31,28,31,30,31,30,31,31,30,31,30,31];function NR(e){let t=xB.exec(e);if(!t)return!1;let r=+t[1],i=+t[2],n=+t[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&SB(r)?29:wB[i])}function g_(e,t){if(e&&t)return e>t?1:e<t?-1:0}var m_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function f_(e){return function(r){let i=m_.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],a=+i[3],s=i[4],l=i[5]==="-"?-1:1,u=+(i[6]||0),d=+(i[7]||0);if(u>23||d>59||e&&!s)return!1;if(n<=23&&o<=59&&a<60)return!0;let p=o-d*l,f=n-u*l-(p<0?1:0);return(f===23||f===-1)&&(p===59||p===-1)&&a<61}}function y_(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(r&&i)return r-i}function CR(e,t){if(!(e&&t))return;let r=m_.exec(e),i=m_.exec(t);if(r&&i)return e=r[1]+r[2]+r[3],t=i[1]+i[2]+i[3],e>t?1:e<t?-1:0}var h_=/t|\s/i;function OR(e){let t=f_(e);return function(i){let n=i.split(h_);return n.length===2&&NR(n[0])&&t(n[1])}}function AR(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),i=new Date(t).valueOf();if(r&&i)return r-i}function MR(e,t){if(!(e&&t))return;let[r,i]=e.split(h_),[n,o]=t.split(h_),a=g_(r,n);if(a!==void 0)return a||y_(i,o)}var $B=/\/|:/,kB=/^(?:[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 TB(e){return $B.test(e)&&kB.test(e)}var jR=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function IB(e){return jR.lastIndex=0,jR.test(e)}var EB=-(2**31),PB=2**31-1;function zB(e){return Number.isInteger(e)&&e<=PB&&e>=EB}function RB(e){return Number.isInteger(e)}function DR(){return!0}var OB=/[^\\]\\Z/;function jB(e){if(OB.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var LR=T(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.formatLimitDefinition=void 0;var DB=p_(),sr=ae(),wn=sr.operators,dm={formatMaximum:{okStr:"<=",ok:wn.LTE,fail:wn.GT},formatMinimum:{okStr:">=",ok:wn.GTE,fail:wn.LT},formatExclusiveMaximum:{okStr:"<",ok:wn.LT,fail:wn.GTE},formatExclusiveMinimum:{okStr:">",ok:wn.GT,fail:wn.LTE}},NB={message:({keyword:e,schemaCode:t})=>(0,sr.str)`should be ${dm[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,sr._)`{comparison: ${dm[e].okStr}, limit: ${t}}`};Lo.formatLimitDefinition={keyword:Object.keys(dm),type:"string",schemaType:"string",$data:!0,error:NB,code(e){let{gen:t,data:r,schemaCode:i,keyword:n,it:o}=e,{opts:a,self:s}=o;if(!a.validateFormats)return;let l=new DB.KeywordCxt(o,s.RULES.all.format.definition,"format");l.$data?u():d();function u(){let f=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),h=t.const("fmt",(0,sr._)`${f}[${l.schemaCode}]`);e.fail$data((0,sr.or)((0,sr._)`typeof ${h} != "object"`,(0,sr._)`${h} instanceof RegExp`,(0,sr._)`typeof ${h}.compare != "function"`,p(h)))}function d(){let f=l.schema,h=s.formats[f];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${n}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:h,code:a.code.formats?(0,sr._)`${a.code.formats}${(0,sr.getProperty)(f)}`:void 0});e.fail$data(p(m))}function p(f){return(0,sr._)`${f}.compare(${r}, ${i}) ${dm[n].fail} 0`}},dependencies:["format"]};var CB=e=>(e.addKeyword(Lo.formatLimitDefinition),e);Lo.default=CB});var VR=T((sc,FR)=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});var qo=UR(),AB=LR(),v_=ae(),qR=new v_.Name("fullFormats"),MB=new v_.Name("fastFormats"),b_=(e,t={keywords:!0})=>{if(Array.isArray(t))return ZR(e,t,qo.fullFormats,qR),e;let[r,i]=t.mode==="fast"?[qo.fastFormats,MB]:[qo.fullFormats,qR],n=t.formats||qo.formatNames;return ZR(e,n,r,i),t.keywords&&(0,AB.default)(e),e};b_.get=(e,t="full")=>{let i=(t==="fast"?qo.fastFormats:qo.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function ZR(e,t,r,i){var n,o;(n=(o=e.opts.code).formats)!==null&&n!==void 0||(o.formats=(0,v_._)`require("ajv-formats/dist/formats").${i}`);for(let a of t)e.addFormat(a,r[a])}FR.exports=sc=b_;Object.defineProperty(sc,"__esModule",{value:!0});sc.default=b_});var Oc=Vt(k$(),1),CM=process.env.NODE_ENV==="production",AM=new Set(["fatal","error","warn","info","debug","trace"]);function MM(){let e=process.env.FAMILIAR_LOG_LEVEL;return e==null||e===""?"info":AM.has(e)?e:(console.warn(`familiar: invalid FAMILIAR_LOG_LEVEL "${e}", falling back to "info"`),"info")}var T$=MM(),I$={paths:["polarWebhookSecret","httpSecret","wsSecret","licenseKey","*.polarWebhookSecret","*.httpSecret","*.wsSecret","*.licenseKey"],censor:"[REDACTED]"},I=CM?(0,Oc.default)({level:T$,redact:I$},Oc.default.destination(2)):(0,Oc.default)({level:T$,redact:I$,transport:{target:"pino/file",options:{destination:2}}});var UM=6e4,jc=class{constructor(t){this.onUpdate=t}clients=[];lingerTimers=new Map;add(t){t.sessionId!=null&&this.lingerTimers.has(t.sessionId)&&(clearTimeout(this.lingerTimers.get(t.sessionId)),this.lingerTimers.delete(t.sessionId)),this.clients=this.clients.filter(r=>!(r.name===t.name&&r.transport===t.transport)),this.clients.push(t),I.info({name:t.name,transport:t.transport},"MCP client connected"),this.broadcast()}removeBySessionId(t){this.clients.find(i=>i.sessionId===t)&&this.lingerTimers.set(t,setTimeout(()=>{this.lingerTimers.delete(t);let i=this.clients.length;this.clients=this.clients.filter(n=>n.sessionId!==t),this.clients.length<i&&(I.info({sessionId:t},"MCP HTTP client disconnected (linger expired)"),this.broadcast())},UM))}removeByTransport(t){let r=this.clients.length;this.clients=this.clients.filter(i=>i.transport!==t),this.clients.length<r&&(I.info({transport:t},"MCP client disconnected"),this.broadcast())}getClients(){return[...this.clients]}broadcastNow(){this.broadcast()}broadcast(){this.onUpdate([...this.clients])}};var c={};wr(c,{$brand:()=>Xo,$input:()=>gu,$output:()=>hu,NEVER:()=>Dc,TimePrecision:()=>_u,ZodAny:()=>Dg,ZodArray:()=>Mg,ZodBase64:()=>$d,ZodBase64URL:()=>kd,ZodBigInt:()=>Vi,ZodBigIntFormat:()=>Ed,ZodBoolean:()=>Fi,ZodCIDRv4:()=>xd,ZodCIDRv6:()=>wd,ZodCUID:()=>hd,ZodCUID2:()=>gd,ZodCatch:()=>iy,ZodCodec:()=>jd,ZodCustom:()=>Qa,ZodCustomStringFormat:()=>qi,ZodDate:()=>Ha,ZodDefault:()=>Yg,ZodDiscriminatedUnion:()=>Lg,ZodE164:()=>Td,ZodEmail:()=>pd,ZodEmoji:()=>md,ZodEnum:()=>Ui,ZodError:()=>X2,ZodExactOptional:()=>Gg,ZodFile:()=>Wg,ZodFirstPartyTypeKind:()=>gy,ZodFunction:()=>my,ZodGUID:()=>Za,ZodIPv4:()=>_d,ZodIPv6:()=>Sd,ZodISODate:()=>sd,ZodISODateTime:()=>ad,ZodISODuration:()=>ld,ZodISOTime:()=>cd,ZodIntersection:()=>qg,ZodIssueCode:()=>t6,ZodJWT:()=>Id,ZodKSUID:()=>bd,ZodLazy:()=>uy,ZodLiteral:()=>Hg,ZodMAC:()=>zg,ZodMap:()=>Vg,ZodNaN:()=>ay,ZodNanoID:()=>fd,ZodNever:()=>Cg,ZodNonOptional:()=>Rd,ZodNull:()=>jg,ZodNullable:()=>Qg,ZodNumber:()=>Zi,ZodNumberFormat:()=>Wn,ZodObject:()=>Wa,ZodOptional:()=>Wi,ZodPipe:()=>Od,ZodPrefault:()=>ey,ZodPromise:()=>py,ZodReadonly:()=>sy,ZodRealError:()=>_t,ZodRecord:()=>Ka,ZodSet:()=>Bg,ZodString:()=>Li,ZodStringFormat:()=>$e,ZodSuccess:()=>ny,ZodSymbol:()=>Rg,ZodTemplateLiteral:()=>ly,ZodTransform:()=>Jg,ZodTuple:()=>Zg,ZodType:()=>re,ZodULID:()=>yd,ZodURL:()=>Ba,ZodUUID:()=>pr,ZodUndefined:()=>Og,ZodUnion:()=>Ja,ZodUnknown:()=>Ng,ZodVoid:()=>Ag,ZodXID:()=>vd,ZodXor:()=>Ug,_ZodString:()=>dd,_default:()=>Xg,_function:()=>hI,any:()=>QT,array:()=>se,base64:()=>DT,base64url:()=>NT,bigint:()=>HT,boolean:()=>Ue,catch:()=>oy,check:()=>gI,cidrv4:()=>OT,cidrv6:()=>jT,clone:()=>Ve,codec:()=>pI,coerce:()=>yy,config:()=>Ae,core:()=>Tt,cuid:()=>$T,cuid2:()=>kT,custom:()=>Dd,date:()=>XT,decode:()=>wg,decodeAsync:()=>kg,describe:()=>yI,discriminatedUnion:()=>Ga,e164:()=>CT,email:()=>fT,emoji:()=>xT,encode:()=>xg,encodeAsync:()=>$g,endsWith:()=>Un,enum:()=>Ge,exactOptional:()=>Kg,file:()=>cI,flattenError:()=>wi,float32:()=>ZT,float64:()=>FT,formatError:()=>$i,fromJSONSchema:()=>wI,function:()=>hI,getErrorMap:()=>n6,globalRegistry:()=>Be,gt:()=>Gt,gte:()=>We,guid:()=>hT,hash:()=>qT,hex:()=>LT,hostname:()=>UT,httpUrl:()=>ST,includes:()=>An,instanceof:()=>bI,int:()=>ud,int32:()=>VT,int64:()=>WT,intersection:()=>Hi,ipv4:()=>PT,ipv6:()=>RT,iso:()=>on,json:()=>SI,jwt:()=>AT,keyof:()=>eI,ksuid:()=>ET,lazy:()=>dy,length:()=>en,literal:()=>F,locales:()=>Di,looseObject:()=>Je,looseRecord:()=>iI,lowercase:()=>Nn,lt:()=>Jt,lte:()=>ct,mac:()=>zT,map:()=>oI,maxLength:()=>Xr,maxSize:()=>Tr,meta:()=>vI,mime:()=>Ln,minLength:()=>dr,minSize:()=>Kt,multipleOf:()=>kr,nan:()=>dI,nanoid:()=>wT,nativeEnum:()=>sI,negative:()=>Aa,never:()=>Pd,nonnegative:()=>Ua,nonoptional:()=>ry,nonpositive:()=>Ma,normalize:()=>qn,null:()=>Bi,nullable:()=>Fa,nullish:()=>lI,number:()=>ve,object:()=>U,optional:()=>ze,overwrite:()=>jt,parse:()=>vg,parseAsync:()=>bg,partialRecord:()=>nI,pipe:()=>Va,positive:()=>Ca,prefault:()=>ty,preprocess:()=>Ya,prettifyError:()=>Uc,promise:()=>fI,property:()=>La,readonly:()=>cy,record:()=>Ie,refine:()=>fy,regex:()=>Dn,regexes:()=>bt,registry:()=>ha,safeDecode:()=>Ig,safeDecodeAsync:()=>Pg,safeEncode:()=>Tg,safeEncodeAsync:()=>Eg,safeParse:()=>_g,safeParseAsync:()=>Sg,set:()=>aI,setErrorMap:()=>r6,size:()=>Yr,slugify:()=>Ai,startsWith:()=>Mn,strictObject:()=>tI,string:()=>x,stringFormat:()=>MT,stringbool:()=>_I,success:()=>uI,superRefine:()=>hy,symbol:()=>GT,templateLiteral:()=>mI,toJSONSchema:()=>Hn,toLowerCase:()=>Fn,toUpperCase:()=>Vn,transform:()=>zd,treeifyError:()=>Mc,trim:()=>Zn,tuple:()=>Fg,uint32:()=>BT,uint64:()=>JT,ulid:()=>TT,undefined:()=>KT,union:()=>xe,unknown:()=>ke,uppercase:()=>Cn,url:()=>_T,util:()=>z,uuid:()=>gT,uuidv4:()=>yT,uuidv6:()=>vT,uuidv7:()=>bT,void:()=>YT,xid:()=>IT,xor:()=>rI});var Tt={};wr(Tt,{$ZodAny:()=>jl,$ZodArray:()=>Ml,$ZodAsyncError:()=>Wt,$ZodBase64:()=>wl,$ZodBase64URL:()=>$l,$ZodBigInt:()=>da,$ZodBigIntFormat:()=>Pl,$ZodBoolean:()=>zi,$ZodCIDRv4:()=>Sl,$ZodCIDRv6:()=>xl,$ZodCUID:()=>ll,$ZodCUID2:()=>ul,$ZodCatch:()=>ru,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>lh,$ZodCheckEndsWith:()=>Sh,$ZodCheckGreaterThan:()=>Qc,$ZodCheckIncludes:()=>bh,$ZodCheckLengthEquals:()=>hh,$ZodCheckLessThan:()=>Kc,$ZodCheckLowerCase:()=>yh,$ZodCheckMaxLength:()=>mh,$ZodCheckMaxSize:()=>uh,$ZodCheckMimeType:()=>wh,$ZodCheckMinLength:()=>fh,$ZodCheckMinSize:()=>dh,$ZodCheckMultipleOf:()=>sh,$ZodCheckNumberFormat:()=>ch,$ZodCheckOverwrite:()=>$h,$ZodCheckProperty:()=>xh,$ZodCheckRegex:()=>gh,$ZodCheckSizeEquals:()=>ph,$ZodCheckStartsWith:()=>_h,$ZodCheckStringFormat:()=>Pi,$ZodCheckUpperCase:()=>vh,$ZodCodec:()=>Oi,$ZodCustom:()=>uu,$ZodCustomStringFormat:()=>Il,$ZodDate:()=>Al,$ZodDefault:()=>Yl,$ZodDiscriminatedUnion:()=>ql,$ZodE164:()=>kl,$ZodEmail:()=>ol,$ZodEmoji:()=>sl,$ZodEncodeError:()=>Vr,$ZodEnum:()=>Hl,$ZodError:()=>aa,$ZodExactOptional:()=>Kl,$ZodFile:()=>Jl,$ZodFunction:()=>su,$ZodGUID:()=>nl,$ZodIPv4:()=>vl,$ZodIPv6:()=>bl,$ZodISODate:()=>hl,$ZodISODateTime:()=>fl,$ZodISODuration:()=>yl,$ZodISOTime:()=>gl,$ZodIntersection:()=>Zl,$ZodJWT:()=>Tl,$ZodKSUID:()=>ml,$ZodLazy:()=>lu,$ZodLiteral:()=>Wl,$ZodMAC:()=>_l,$ZodMap:()=>Vl,$ZodNaN:()=>nu,$ZodNanoID:()=>cl,$ZodNever:()=>Nl,$ZodNonOptional:()=>eu,$ZodNull:()=>Ol,$ZodNullable:()=>Ql,$ZodNumber:()=>ua,$ZodNumberFormat:()=>El,$ZodObject:()=>Ul,$ZodObjectJIT:()=>Eh,$ZodOptional:()=>ma,$ZodPipe:()=>iu,$ZodPrefault:()=>Xl,$ZodPromise:()=>cu,$ZodReadonly:()=>ou,$ZodRealError:()=>vt,$ZodRecord:()=>Fl,$ZodRegistry:()=>fu,$ZodSet:()=>Bl,$ZodString:()=>Qr,$ZodStringFormat:()=>Se,$ZodSuccess:()=>tu,$ZodSymbol:()=>zl,$ZodTemplateLiteral:()=>au,$ZodTransform:()=>Gl,$ZodTuple:()=>pa,$ZodType:()=>K,$ZodULID:()=>dl,$ZodURL:()=>al,$ZodUUID:()=>il,$ZodUndefined:()=>Rl,$ZodUnion:()=>Ri,$ZodUnknown:()=>Dl,$ZodVoid:()=>Cl,$ZodXID:()=>pl,$ZodXor:()=>Ll,$brand:()=>Xo,$constructor:()=>b,$input:()=>gu,$output:()=>hu,Doc:()=>la,JSONSchema:()=>pT,JSONSchemaGenerator:()=>id,NEVER:()=>Dc,TimePrecision:()=>_u,_any:()=>qu,_array:()=>Ph,_base64:()=>Oa,_base64url:()=>ja,_bigint:()=>Du,_boolean:()=>Ou,_catch:()=>B2,_check:()=>dT,_cidrv4:()=>za,_cidrv6:()=>Ra,_coercedBigint:()=>Nu,_coercedBoolean:()=>ju,_coercedDate:()=>Hu,_coercedNumber:()=>Tu,_coercedString:()=>vu,_cuid:()=>wa,_cuid2:()=>$a,_custom:()=>Gu,_date:()=>Bu,_decode:()=>qc,_decodeAsync:()=>Fc,_default:()=>Z2,_discriminatedUnion:()=>z2,_e164:()=>Da,_email:()=>ga,_emoji:()=>Sa,_encode:()=>Lc,_encodeAsync:()=>Zc,_endsWith:()=>Un,_enum:()=>C2,_file:()=>Ju,_float32:()=>Eu,_float64:()=>Pu,_gt:()=>Gt,_gte:()=>We,_guid:()=>Ni,_includes:()=>An,_int:()=>Iu,_int32:()=>zu,_int64:()=>Cu,_intersection:()=>R2,_ipv4:()=>Ea,_ipv6:()=>Pa,_isoDate:()=>xu,_isoDateTime:()=>Su,_isoDuration:()=>$u,_isoTime:()=>wu,_jwt:()=>Na,_ksuid:()=>Ia,_lazy:()=>G2,_length:()=>en,_literal:()=>M2,_lowercase:()=>Nn,_lt:()=>Jt,_lte:()=>ct,_mac:()=>bu,_map:()=>D2,_max:()=>ct,_maxLength:()=>Xr,_maxSize:()=>Tr,_mime:()=>Ln,_min:()=>We,_minLength:()=>dr,_minSize:()=>Kt,_multipleOf:()=>kr,_nan:()=>Wu,_nanoid:()=>xa,_nativeEnum:()=>A2,_negative:()=>Aa,_never:()=>Fu,_nonnegative:()=>Ua,_nonoptional:()=>F2,_nonpositive:()=>Ma,_normalize:()=>qn,_null:()=>Lu,_nullable:()=>q2,_number:()=>ku,_optional:()=>L2,_overwrite:()=>jt,_parse:()=>ki,_parseAsync:()=>Ti,_pipe:()=>H2,_positive:()=>Ca,_promise:()=>K2,_property:()=>La,_readonly:()=>W2,_record:()=>j2,_refine:()=>Ku,_regex:()=>Dn,_safeDecode:()=>Bc,_safeDecodeAsync:()=>Wc,_safeEncode:()=>Vc,_safeEncodeAsync:()=>Hc,_safeParse:()=>Ii,_safeParseAsync:()=>Ei,_set:()=>N2,_size:()=>Yr,_slugify:()=>Ai,_startsWith:()=>Mn,_string:()=>yu,_stringFormat:()=>Bn,_stringbool:()=>ed,_success:()=>V2,_superRefine:()=>Qu,_symbol:()=>Mu,_templateLiteral:()=>J2,_toLowerCase:()=>Fn,_toUpperCase:()=>Vn,_transform:()=>U2,_trim:()=>Zn,_tuple:()=>O2,_uint32:()=>Ru,_uint64:()=>Au,_ulid:()=>ka,_undefined:()=>Uu,_union:()=>E2,_unknown:()=>Zu,_uppercase:()=>Cn,_url:()=>Ci,_uuid:()=>ya,_uuidv4:()=>va,_uuidv6:()=>ba,_uuidv7:()=>_a,_void:()=>Vu,_xid:()=>Ta,_xor:()=>P2,clone:()=>Ve,config:()=>Ae,createStandardJSONSchemaMethod:()=>Mi,createToJSONSchemaMethod:()=>zh,decode:()=>L$,decodeAsync:()=>Z$,describe:()=>Yu,encode:()=>U$,encodeAsync:()=>q$,extractDefs:()=>rn,finalize:()=>nn,flattenError:()=>wi,formatError:()=>$i,globalConfig:()=>Yo,globalRegistry:()=>Be,initializeContext:()=>tn,isValidBase64:()=>Ih,isValidBase64URL:()=>uk,isValidJWT:()=>dk,locales:()=>Di,meta:()=>Xu,parse:()=>Rn,parseAsync:()=>On,prettifyError:()=>Uc,process:()=>_e,regexes:()=>bt,registry:()=>ha,safeDecode:()=>V$,safeDecodeAsync:()=>H$,safeEncode:()=>F$,safeEncodeAsync:()=>B$,safeParse:()=>Gr,safeParseAsync:()=>Kr,toDotPath:()=>M$,toJSONSchema:()=>Hn,treeifyError:()=>Mc,util:()=>z,version:()=>kh});var Dc=Object.freeze({status:"aborted"});function b(e,t,r){function i(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let f=d[p];f in s||(s[f]=u[f].bind(s))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function a(s){var l;let u=r?.Parent?new o:this;i(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Xo=Symbol("zod_brand"),Wt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Vr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Yo={};function Ae(e){return e&&Object.assign(Yo,e),Yo}var z={};wr(z,{BIGINT_FORMAT_RANGES:()=>Of,Class:()=>kf,NUMBER_FORMAT_RANGES:()=>Rf,aborted:()=>Jr,allowsEval:()=>Ef,assert:()=>VM,assertEqual:()=>LM,assertIs:()=>ZM,assertNever:()=>FM,assertNotEqual:()=>qM,assignProp:()=>Hr,base64ToUint8Array:()=>N$,base64urlToUint8Array:()=>t4,cached:()=>Si,captureStackTrace:()=>Cc,cleanEnum:()=>e4,cleanRegex:()=>ra,clone:()=>Ve,cloneDef:()=>HM,createTransparentProxy:()=>YM,defineLazy:()=>te,esc:()=>Nc,escapeRegex:()=>Ot,extend:()=>R$,finalizeIssue:()=>yt,floatSafeRemainder:()=>Tf,getElementAtPath:()=>WM,getEnumValues:()=>ta,getLengthableOrigin:()=>oa,getParsedType:()=>QM,getSizableOrigin:()=>ia,hexToUint8Array:()=>n4,isObject:()=>zn,isPlainObject:()=>Wr,issue:()=>xi,joinValues:()=>S,jsonStringifyReplacer:()=>_i,merge:()=>XM,mergeDefs:()=>$r,normalizeParams:()=>j,nullish:()=>Br,numKeys:()=>KM,objectClone:()=>BM,omit:()=>z$,optionalKeys:()=>zf,parsedType:()=>O,partial:()=>j$,pick:()=>P$,prefixIssues:()=>kt,primitiveTypes:()=>Pf,promiseAllObject:()=>JM,propertyKeyTypes:()=>na,randomString:()=>GM,required:()=>D$,safeExtend:()=>O$,shallowClone:()=>Ac,slugify:()=>If,stringifyPrimitive:()=>P,uint8ArrayToBase64:()=>C$,uint8ArrayToBase64url:()=>r4,uint8ArrayToHex:()=>i4,unwrapMessage:()=>ea});function LM(e){return e}function qM(e){return e}function ZM(e){}function FM(e){throw new Error("Unexpected value in exhaustive check")}function VM(e){}function ta(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function S(e,t="|"){return e.map(r=>P(r)).join(t)}function _i(e,t){return typeof t=="bigint"?t.toString():t}function Si(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Br(e){return e==null}function ra(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Tf(e,t){let r=(e.toString().split(".")[1]||"").length,i=t.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let l=i.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return a%s/10**o}var E$=Symbol("evaluating");function te(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==E$)return i===void 0&&(i=E$,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function BM(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Hr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $r(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function HM(e){return $r(e._zod.def)}function WM(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function JM(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function GM(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Nc(e){return JSON.stringify(e)}function If(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Cc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ef=Si(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Wr(e){if(zn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(zn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ac(e){return Wr(e)?{...e}:Array.isArray(e)?[...e]:e}function KM(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var QM=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"]),Pf=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ot(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ve(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function j(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 YM(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function P(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zf(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Rf={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]},Of={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function P$(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=$r(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Hr(this,"shape",a),a},checks:[]});return Ve(e,o)}function z$(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=$r(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Hr(this,"shape",a),a},checks:[]});return Ve(e,o)}function R$(e,t){if(!Wr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=$r(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Hr(this,"shape",o),o}});return Ve(e,n)}function O$(e,t){if(!Wr(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=$r(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Hr(this,"shape",i),i}});return Ve(e,r)}function XM(e,t){let r=$r(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Hr(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return Ve(e,r)}function j$(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 a=$r(t._zod.def,{get shape(){let s=t._zod.def.shape,l={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)l[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Hr(this,"shape",l),l},checks:[]});return Ve(t,a)}function D$(e,t,r){let i=$r(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new e({type:"nonoptional",innerType:n[a]});return Hr(this,"shape",o),o}});return Ve(t,i)}function Jr(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 kt(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function ea(e){return typeof e=="string"?e:e?.message}function yt(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let n=ea(e.inst?._zod.def?.error?.(e))??ea(t?.error?.(e))??ea(r.customError?.(e))??ea(r.localeError?.(e))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function ia(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function oa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function O(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 xi(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function e4(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function N$(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function C$(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function t4(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return N$(t+r)}function r4(e){return C$(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function n4(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 i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function i4(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var kf=class{constructor(...t){}};var A$=(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,_i,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},aa=b("$ZodError",A$),vt=b("$ZodError",A$,{Parent:Error});function wi(e,t=r=>r.message){let r={},i=[];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))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function $i(e,t=r=>r.message){let r={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let a=r,s=0;for(;s<o.path.length;){let l=o.path[s];s===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(o))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return i(e),r}function Mc(e,t=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>i({issues:u},l.path));else if(l.code==="invalid_key")i({issues:l.issues},l.path);else if(l.code==="invalid_element")i({issues:l.issues},l.path);else{let u=[...o,...l.path];if(u.length===0){r.errors.push(t(l));continue}let d=r,p=0;for(;p<u.length;){let f=u[p],h=p===u.length-1;typeof f=="string"?(d.properties??(d.properties={}),(a=d.properties)[f]??(a[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(s=d.items)[f]??(s[f]={errors:[]}),d=d.items[f]),h&&d.errors.push(t(l)),p++}}};return i(e),r}function M$(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Uc(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${M$(i.path)}`);return t.join(`
38
- `)}var ki=e=>(t,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Wt;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>yt(l,o,Ae())));throw Cc(s,n?.callee),s}return a.value},Rn=ki(vt),Ti=e=>async(t,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>yt(l,o,Ae())));throw Cc(s,n?.callee),s}return a.value},On=Ti(vt),Ii=e=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Wt;return o.issues.length?{success:!1,error:new(e??aa)(o.issues.map(a=>yt(a,n,Ae())))}:{success:!0,data:o.value}},Gr=Ii(vt),Ei=e=>async(t,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>yt(a,n,Ae())))}:{success:!0,data:o.value}},Kr=Ei(vt),Lc=e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ki(e)(t,r,n)},U$=Lc(vt),qc=e=>(t,r,i)=>ki(e)(t,r,i),L$=qc(vt),Zc=e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ti(e)(t,r,n)},q$=Zc(vt),Fc=e=>async(t,r,i)=>Ti(e)(t,r,i),Z$=Fc(vt),Vc=e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ii(e)(t,r,n)},F$=Vc(vt),Bc=e=>(t,r,i)=>Ii(e)(t,r,i),V$=Bc(vt),Hc=e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ei(e)(t,r,n)},B$=Hc(vt),Wc=e=>async(t,r,i)=>Ei(e)(t,r,i),H$=Wc(vt);var bt={};wr(bt,{base64:()=>Jf,base64url:()=>Jc,bigint:()=>eh,boolean:()=>rh,browserEmail:()=>m4,cidrv4:()=>Hf,cidrv6:()=>Wf,cuid:()=>jf,cuid2:()=>Df,date:()=>Kf,datetime:()=>Yf,domain:()=>g4,duration:()=>Uf,e164:()=>Gf,email:()=>qf,emoji:()=>Zf,extendedDuration:()=>a4,guid:()=>Lf,hex:()=>y4,hostname:()=>h4,html5Email:()=>u4,idnEmail:()=>p4,integer:()=>th,ipv4:()=>Ff,ipv6:()=>Vf,ksuid:()=>Af,lowercase:()=>oh,mac:()=>Bf,md5_base64:()=>b4,md5_base64url:()=>_4,md5_hex:()=>v4,nanoid:()=>Mf,null:()=>nh,number:()=>Gc,rfc5322Email:()=>d4,sha1_base64:()=>x4,sha1_base64url:()=>w4,sha1_hex:()=>S4,sha256_base64:()=>k4,sha256_base64url:()=>T4,sha256_hex:()=>$4,sha384_base64:()=>E4,sha384_base64url:()=>P4,sha384_hex:()=>I4,sha512_base64:()=>R4,sha512_base64url:()=>O4,sha512_hex:()=>z4,string:()=>Xf,time:()=>Qf,ulid:()=>Nf,undefined:()=>ih,unicodeEmail:()=>W$,uppercase:()=>ah,uuid:()=>jn,uuid4:()=>s4,uuid6:()=>c4,uuid7:()=>l4,xid:()=>Cf});var jf=/^[cC][^\s-]{8,}$/,Df=/^[0-9a-z]+$/,Nf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cf=/^[0-9a-vA-V]{20}$/,Af=/^[A-Za-z0-9]{27}$/,Mf=/^[a-zA-Z0-9_-]{21}$/,Uf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,a4=/^[-+]?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)?)??$/,Lf=/^([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})$/,jn=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)$/,s4=jn(4),c4=jn(6),l4=jn(7),qf=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,u4=/^[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])?)*$/,d4=/^(([^<>()\[\]\\.,;:\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,}))$/,W$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,p4=W$,m4=/^[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])?)*$/,f4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Zf(){return new RegExp(f4,"u")}var Ff=/^(?:(?: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])$/,Vf=/^(([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}|:))$/,Bf=e=>{let t=Ot(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Hf=/^((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])$/,Wf=/^(([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])$/,Jf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jc=/^[A-Za-z0-9_-]*$/,h4=/^(?=.{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])?)*\.?$/,g4=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Gf=/^\+[1-9]\d{6,14}$/,J$="(?:(?:\\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])))",Kf=new RegExp(`^${J$}$`);function G$(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 Qf(e){return new RegExp(`^${G$(e)}$`)}function Yf(e){let t=G$({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${J$}T(?:${i})$`)}var Xf=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eh=/^-?\d+n?$/,th=/^-?\d+$/,Gc=/^-?\d+(?:\.\d+)?$/,rh=/^(?:true|false)$/i,nh=/^null$/i;var ih=/^undefined$/i;var oh=/^[^A-Z]*$/,ah=/^[^a-z]*$/,y4=/^[0-9a-fA-F]*$/;function sa(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ca(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var v4=/^[0-9a-fA-F]{32}$/,b4=sa(22,"=="),_4=ca(22),S4=/^[0-9a-fA-F]{40}$/,x4=sa(27,"="),w4=ca(27),$4=/^[0-9a-fA-F]{64}$/,k4=sa(43,"="),T4=ca(43),I4=/^[0-9a-fA-F]{96}$/,E4=sa(64,""),P4=ca(64),z4=/^[0-9a-fA-F]{128}$/,R4=sa(86,"=="),O4=ca(86);var we=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Q$={number:"number",bigint:"bigint",object:"date"},Kc=b("$ZodCheckLessThan",(e,t)=>{we.init(e,t);let r=Q$[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qc=b("$ZodCheckGreaterThan",(e,t)=>{we.init(e,t);let r=Q$[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sh=b("$ZodCheckMultipleOf",(e,t)=>{we.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.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):Tf(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})}}),ch=b("$ZodCheckNumberFormat",(e,t)=>{we.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=Rf[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=o,r&&(s.pattern=th)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),lh=b("$ZodCheckBigIntFormat",(e,t)=>{we.init(e,t);let[r,i]=Of[t.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),uh=b("$ZodCheckMaxSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Br(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;n.size<=t.maximum||i.issues.push({origin:ia(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),dh=b("$ZodCheckMinSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Br(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;n.size>=t.minimum||i.issues.push({origin:ia(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ph=b("$ZodCheckSizeEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Br(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=i=>{let n=i.value,o=n.size;if(o===t.size)return;let a=o>t.size;i.issues.push({origin:ia(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),mh=b("$ZodCheckMaxLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Br(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;if(n.length<=t.maximum)return;let a=oa(n);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),fh=b("$ZodCheckMinLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Br(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;if(n.length>=t.minimum)return;let a=oa(n);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),hh=b("$ZodCheckLengthEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Br(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=i=>{let n=i.value,o=n.length;if(o===t.length)return;let a=oa(n),s=o>t.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Pi=b("$ZodCheckStringFormat",(e,t)=>{var r,i;we.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.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})}):(i=e._zod).check??(i.check=()=>{})}),gh=b("$ZodCheckRegex",(e,t)=>{Pi.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})}}),yh=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=oh),Pi.init(e,t)}),vh=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ah),Pi.init(e,t)}),bh=b("$ZodCheckIncludes",(e,t)=>{we.init(e,t);let r=Ot(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),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})}}),_h=b("$ZodCheckStartsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`^${Ot(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Sh=b("$ZodCheckEndsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`.*${Ot(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function K$(e,t,r){e.issues.length&&t.issues.push(...kt(r,e.issues))}var xh=b("$ZodCheckProperty",(e,t)=>{we.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>K$(n,r,t.property));K$(i,r,t.property)}}),wh=b("$ZodCheckMimeType",(e,t)=>{we.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),$h=b("$ZodCheckOverwrite",(e,t)=>{we.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var la=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 i=t.split(`
37
+ deps: ${r}}`};var DV={keyword:"dependencies",type:"object",schemaType:"object",error:Sr.error,code(e){let[t,r]=NV(e);gR(e,t),yR(e,r)}};function NV({schema:e}){let t={},r={};for(let i in e){if(i==="__proto__")continue;let n=Array.isArray(e[i])?t:r;n[i]=e[i]}return[t,r]}function gR(e,t=e.schema){let{gen:r,data:i,it:n}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,sc.propertyInData)(r,i,a,n.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),n.allErrors?r.if(c,()=>{for(let u of s)(0,sc.checkReportMissingProp)(e,u)}):(r.if((0,Kb._)`${c} && (${(0,sc.checkMissingProp)(e,s,o)})`),(0,sc.reportMissingProp)(e,o),r.else())}}Sr.validatePropertyDeps=gR;function yR(e,t=e.schema){let{gen:r,data:i,keyword:n,it:o}=e,a=r.name("valid");for(let s in t)(0,jV.alwaysValidSchema)(o,t[s])||(r.if((0,sc.propertyInData)(r,i,s,o.opts.ownProperties),()=>{let c=e.subschema({keyword:n,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a))}Sr.validateSchemaDeps=yR;Sr.default=DV});var _R=I(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var bR=ae(),CV=he(),AV={message:"property name must be valid",params:({params:e})=>(0,bR._)`{propertyName: ${e.propertyName}}`},MV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:AV,code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,CV.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,bR.not)(o),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(o)}};Qb.default=MV});var Xb=I(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var cm=Zt(),sr=ae(),UV=Zr(),lm=he(),LV={message:"must NOT have additional properties",params:({params:e})=>(0,sr._)`{additionalProperty: ${e.additionalProperty}}`},qV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:LV,code(e){let{gen:t,schema:r,parentSchema:i,data:n,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");let{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,lm.alwaysValidSchema)(a,r))return;let u=(0,cm.allSchemaProperties)(i.properties),d=(0,cm.allSchemaProperties)(i.patternProperties);p(),e.ok((0,sr._)`${o} === ${UV.default.errors}`);function p(){t.forIn("key",n,v=>{!u.length&&!d.length?m(v):t.if(f(v),()=>m(v))})}function f(v){let _;if(u.length>8){let w=(0,lm.schemaRefOrVal)(a,i.properties,"properties");_=(0,cm.isOwnProperty)(t,w,v)}else u.length?_=(0,sr.or)(...u.map(w=>(0,sr._)`${v} === ${w}`)):_=sr.nil;return d.length&&(_=(0,sr.or)(_,...d.map(w=>(0,sr._)`${(0,cm.usePattern)(e,w)}.test(${v})`))),(0,sr.not)(_)}function h(v){t.code((0,sr._)`delete ${n}[${v}]`)}function m(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){h(v);return}if(r===!1){e.setParams({additionalProperty:v}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,lm.alwaysValidSchema)(a,r)){let _=t.name("valid");c.removeAdditional==="failing"?(g(v,_,!1),t.if((0,sr.not)(_),()=>{e.reset(),h(v)})):(g(v,_),s||t.if((0,sr.not)(_),()=>t.break()))}}function g(v,_,w){let $={keyword:"additionalProperties",dataProp:v,dataPropType:lm.Type.Str};w===!1&&Object.assign($,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema($,_)}}};Yb.default=qV});var wR=I(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});var ZV=Ws(),SR=Zt(),e_=he(),xR=Xb(),FV={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&xR.default.code(new ZV.KeywordCxt(o,xR.default,"additionalProperties"));let a=(0,SR.allSchemaProperties)(r);for(let p of a)o.definedProperties.add(p);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=e_.mergeEvaluated.props(t,(0,e_.toHash)(a),o.props));let s=a.filter(p=>!(0,e_.alwaysValidSchema)(o,r[p]));if(s.length===0)return;let c=t.name("valid");for(let p of s)u(p)?d(p):(t.if((0,SR.propertyInData)(t,n,p,o.opts.ownProperties)),d(p),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(c);function u(p){return o.opts.useDefaults&&!o.compositeRule&&r[p].default!==void 0}function d(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},c)}}};t_.default=FV});var IR=I(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});var $R=Zt(),um=ae(),kR=he(),TR=he(),VV={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:i,parentSchema:n,it:o}=e,{opts:a}=o,s=(0,$R.allSchemaProperties)(r),c=s.filter(g=>(0,kR.alwaysValidSchema)(o,r[g]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&n.properties,d=t.name("valid");o.props!==!0&&!(o.props instanceof um.Name)&&(o.props=(0,TR.evaluatedPropsToName)(t,o.props));let{props:p}=o;f();function f(){for(let g of s)u&&h(g),o.allErrors?m(g):(t.var(d,!0),m(g),t.if(d))}function h(g){for(let v in u)new RegExp(g).test(v)&&(0,kR.checkStrictMode)(o,`property ${v} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){t.forIn("key",i,v=>{t.if((0,um._)`${(0,$R.usePattern)(e,g)}.test(${v})`,()=>{let _=c.includes(g);_||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:v,dataPropType:TR.Type.Str},d),o.opts.unevaluated&&p!==!0?t.assign((0,um._)`${p}[${v}]`,!0):!_&&!o.allErrors&&t.if((0,um.not)(d),()=>t.break())})})}}};r_.default=VV});var ER=I(n_=>{"use strict";Object.defineProperty(n_,"__esModule",{value:!0});var BV=he(),HV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,BV.alwaysValidSchema)(i,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"}};n_.default=HV});var PR=I(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});var WV=Zt(),JV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:WV.validateUnion,error:{message:"must match a schema in anyOf"}};i_.default=JV});var zR=I(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});var dm=ae(),GV=he(),KV={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,dm._)`{passingSchemas: ${e.passing}}`},QV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:KV,code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,p)=>{let f;(0,GV.alwaysValidSchema)(n,d)?t.var(c,!0):f=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},c),p>0&&t.if((0,dm._)`${c} && ${a}`).assign(a,!1).assign(s,(0,dm._)`[${s}, ${p}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,p),f&&e.mergeEvaluated(f,dm.Name)})})}}};o_.default=QV});var RR=I(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var YV=he(),XV={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=t.name("valid");r.forEach((o,a)=>{if((0,YV.alwaysValidSchema)(i,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},n);e.ok(n),e.mergeEvaluated(s)})}};a_.default=XV});var DR=I(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});var pm=ae(),jR=he(),eB={message:({params:e})=>(0,pm.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,pm._)`{failingKeyword: ${e.ifClause}}`},tB={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:eB,code(e){let{gen:t,parentSchema:r,it:i}=e;r.then===void 0&&r.else===void 0&&(0,jR.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=OR(i,"then"),o=OR(i,"else");if(!n&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),n&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(s,u("then",d),u("else",d))}else n?t.if(s,u("then")):t.if((0,pm.not)(s),u("else"));e.pass(a,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(d)}function u(d,p){return()=>{let f=e.subschema({keyword:d},s);t.assign(a,s),e.mergeValidEvaluated(f,a),p?t.assign(p,(0,pm._)`${d}`):e.setParams({ifClause:d})}}}};function OR(e,t){let r=e.schema[t];return r!==void 0&&!(0,jR.alwaysValidSchema)(e,r)}s_.default=tB});var NR=I(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});var rB=he(),nB={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,rB.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};c_.default=nB});var CR=I(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});var iB=Bb(),oB=pR(),aB=Hb(),sB=fR(),cB=hR(),lB=vR(),uB=_R(),dB=Xb(),pB=wR(),mB=IR(),fB=ER(),hB=PR(),gB=zR(),yB=RR(),vB=DR(),bB=NR();function _B(e=!1){let t=[fB.default,hB.default,gB.default,yB.default,vB.default,bB.default,uB.default,dB.default,lB.default,pB.default,mB.default];return e?t.push(oB.default,sB.default):t.push(iB.default,aB.default),t.push(cB.default),t}l_.default=_B});var AR=I(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var Ze=ae(),SB={message:({schemaCode:e})=>(0,Ze.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Ze._)`{format: ${e}}`},xB={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:SB,code(e,t){let{gen:r,data:i,$data:n,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:p}=s;if(!c.validateFormats)return;n?f():h();function f(){let m=r.scopeValue("formats",{ref:p.formats,code:c.code.formats}),g=r.const("fDef",(0,Ze._)`${m}[${a}]`),v=r.let("fType"),_=r.let("format");r.if((0,Ze._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(v,(0,Ze._)`${g}.type || "string"`).assign(_,(0,Ze._)`${g}.validate`),()=>r.assign(v,(0,Ze._)`"string"`).assign(_,g)),e.fail$data((0,Ze.or)(w(),$()));function w(){return c.strictSchema===!1?Ze.nil:(0,Ze._)`${a} && !${_}`}function $(){let E=d.$async?(0,Ze._)`(${g}.async ? await ${_}(${i}) : ${_}(${i}))`:(0,Ze._)`${_}(${i})`,N=(0,Ze._)`(typeof ${_} == "function" ? ${E} : ${_}.test(${i}))`;return(0,Ze._)`${_} && ${_} !== true && ${v} === ${t} && !${N}`}}function h(){let m=p.formats[o];if(!m){w();return}if(m===!0)return;let[g,v,_]=$(m);g===t&&e.pass(E());function w(){if(c.strictSchema===!1){p.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function $(N){let de=N instanceof RegExp?(0,Ze.regexpCode)(N):c.code.formats?(0,Ze._)`${c.code.formats}${(0,Ze.getProperty)(o)}`:void 0,Y=r.scopeValue("formats",{key:o,ref:N,code:de});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,Ze._)`${Y}.validate`]:["string",N,Y]}function E(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Ze._)`await ${_}(${i})`}return typeof v=="function"?(0,Ze._)`${_}(${i})`:(0,Ze._)`${_}.test(${i})`}}}};u_.default=xB});var MR=I(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});var wB=AR(),$B=[wB.default];d_.default=$B});var UR=I(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.contentVocabulary=Ao.metadataVocabulary=void 0;Ao.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ao.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var qR=I(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});var kB=J1(),TB=cR(),IB=CR(),EB=MR(),LR=UR(),PB=[kB.default,TB.default,(0,IB.default)(),EB.default,LR.metadataVocabulary,LR.contentVocabulary];p_.default=PB});var FR=I(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.DiscrError=void 0;var ZR;(function(e){e.Tag="tag",e.Mapping="mapping"})(ZR||(mm.DiscrError=ZR={}))});var BR=I(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var Mo=ae(),m_=FR(),VR=Gp(),zB=Js(),RB=he(),OB={message:({params:{discrError:e,tagName:t}})=>e===m_.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Mo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},jB={keyword:"discriminator",type:"object",schemaType:"object",error:OB,code(e){let{gen:t,data:r,schema:i,parentSchema:n,it:o}=e,{oneOf:a}=n;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=i.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",(0,Mo._)`${r}${(0,Mo.getProperty)(s)}`);t.if((0,Mo._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:m_.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function d(){let h=f();t.if(!1);for(let m in h)t.elseIf((0,Mo._)`${u} === ${m}`),t.assign(c,p(h[m]));t.else(),e.error(!1,{discrError:m_.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function p(h){let m=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:h},m);return e.mergeEvaluated(g,Mo.Name),m}function f(){var h;let m={},g=_(n),v=!0;for(let E=0;E<a.length;E++){let N=a[E];if(N?.$ref&&!(0,RB.schemaHasRulesButRef)(N,o.self.RULES)){let Y=N.$ref;if(N=VR.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,Y),N instanceof VR.SchemaEnv&&(N=N.schema),N===void 0)throw new zB.default(o.opts.uriResolver,o.baseId,Y)}let de=(h=N?.properties)===null||h===void 0?void 0:h[s];if(typeof de!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);v=v&&(g||_(N)),w(de,E)}if(!v)throw new Error(`discriminator: "${s}" must be required`);return m;function _({required:E}){return Array.isArray(E)&&E.includes(s)}function w(E,N){if(E.const)$(E.const,N);else if(E.enum)for(let de of E.enum)$(de,N);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function $(E,N){if(typeof E!="string"||E in m)throw new Error(`discriminator: "${s}" values must be unique strings`);m[E]=N}}}};f_.default=jB});var HR=I((hne,DB)=>{DB.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 g_=I((De,h_)=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.MissingRefError=De.ValidationError=De.CodeGen=De.Name=De.nil=De.stringify=De.str=De._=De.KeywordCxt=De.Ajv=void 0;var NB=Z1(),CB=qR(),AB=BR(),WR=HR(),MB=["/properties"],fm="http://json-schema.org/draft-07/schema",Uo=class extends NB.default{_addVocabularies(){super._addVocabularies(),CB.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(AB.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(WR,MB):WR;this.addMetaSchema(t,fm,!1),this.refs["http://json-schema.org/schema"]=fm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(fm)?fm:void 0)}};De.Ajv=Uo;h_.exports=De=Uo;h_.exports.Ajv=Uo;Object.defineProperty(De,"__esModule",{value:!0});De.default=Uo;var UB=Ws();Object.defineProperty(De,"KeywordCxt",{enumerable:!0,get:function(){return UB.KeywordCxt}});var Lo=ae();Object.defineProperty(De,"_",{enumerable:!0,get:function(){return Lo._}});Object.defineProperty(De,"str",{enumerable:!0,get:function(){return Lo.str}});Object.defineProperty(De,"stringify",{enumerable:!0,get:function(){return Lo.stringify}});Object.defineProperty(De,"nil",{enumerable:!0,get:function(){return Lo.nil}});Object.defineProperty(De,"Name",{enumerable:!0,get:function(){return Lo.Name}});Object.defineProperty(De,"CodeGen",{enumerable:!0,get:function(){return Lo.CodeGen}});var LB=Wp();Object.defineProperty(De,"ValidationError",{enumerable:!0,get:function(){return LB.default}});var qB=Js();Object.defineProperty(De,"MissingRefError",{enumerable:!0,get:function(){return qB.default}})});var tO=I(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.formatNames=wr.fastFormats=wr.fullFormats=void 0;function xr(e,t){return{validate:e,compare:t}}wr.fullFormats={date:xr(QR,__),time:xr(v_(!0),S_),"date-time":xr(JR(!0),XR),"iso-time":xr(v_(),YR),"iso-date-time":xr(JR(),eO),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:WB,"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:eH,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:JB,int32:{type:"number",validate:QB},int64:{type:"number",validate:YB},float:{type:"number",validate:KR},double:{type:"number",validate:KR},password:!0,binary:!0};wr.fastFormats={...wr.fullFormats,date:xr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,__),time:xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,S_),"date-time":xr(/^\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,XR),"iso-time":xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,YR),"iso-date-time":xr(/^\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,eO),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};wr.formatNames=Object.keys(wr.fullFormats);function ZB(e){return e%4===0&&(e%100!==0||e%400===0)}var FB=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,VB=[0,31,28,31,30,31,30,31,31,30,31,30,31];function QR(e){let t=FB.exec(e);if(!t)return!1;let r=+t[1],i=+t[2],n=+t[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&ZB(r)?29:VB[i])}function __(e,t){if(e&&t)return e>t?1:e<t?-1:0}var y_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function v_(e){return function(r){let i=y_.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],a=+i[3],s=i[4],c=i[5]==="-"?-1:1,u=+(i[6]||0),d=+(i[7]||0);if(u>23||d>59||e&&!s)return!1;if(n<=23&&o<=59&&a<60)return!0;let p=o-d*c,f=n-u*c-(p<0?1:0);return(f===23||f===-1)&&(p===59||p===-1)&&a<61}}function S_(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(r&&i)return r-i}function YR(e,t){if(!(e&&t))return;let r=y_.exec(e),i=y_.exec(t);if(r&&i)return e=r[1]+r[2]+r[3],t=i[1]+i[2]+i[3],e>t?1:e<t?-1:0}var b_=/t|\s/i;function JR(e){let t=v_(e);return function(i){let n=i.split(b_);return n.length===2&&QR(n[0])&&t(n[1])}}function XR(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),i=new Date(t).valueOf();if(r&&i)return r-i}function eO(e,t){if(!(e&&t))return;let[r,i]=e.split(b_),[n,o]=t.split(b_),a=__(r,n);if(a!==void 0)return a||S_(i,o)}var BB=/\/|:/,HB=/^(?:[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 WB(e){return BB.test(e)&&HB.test(e)}var GR=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function JB(e){return GR.lastIndex=0,GR.test(e)}var GB=-(2**31),KB=2**31-1;function QB(e){return Number.isInteger(e)&&e<=KB&&e>=GB}function YB(e){return Number.isInteger(e)}function KR(){return!0}var XB=/[^\\]\\Z/;function eH(e){if(XB.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var rO=I(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.formatLimitDefinition=void 0;var tH=g_(),cr=ae(),kn=cr.operators,hm={formatMaximum:{okStr:"<=",ok:kn.LTE,fail:kn.GT},formatMinimum:{okStr:">=",ok:kn.GTE,fail:kn.LT},formatExclusiveMaximum:{okStr:"<",ok:kn.LT,fail:kn.GTE},formatExclusiveMinimum:{okStr:">",ok:kn.GT,fail:kn.LTE}},rH={message:({keyword:e,schemaCode:t})=>(0,cr.str)`should be ${hm[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,cr._)`{comparison: ${hm[e].okStr}, limit: ${t}}`};qo.formatLimitDefinition={keyword:Object.keys(hm),type:"string",schemaType:"string",$data:!0,error:rH,code(e){let{gen:t,data:r,schemaCode:i,keyword:n,it:o}=e,{opts:a,self:s}=o;if(!a.validateFormats)return;let c=new tH.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?u():d();function u(){let f=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),h=t.const("fmt",(0,cr._)`${f}[${c.schemaCode}]`);e.fail$data((0,cr.or)((0,cr._)`typeof ${h} != "object"`,(0,cr._)`${h} instanceof RegExp`,(0,cr._)`typeof ${h}.compare != "function"`,p(h)))}function d(){let f=c.schema,h=s.formats[f];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${n}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:h,code:a.code.formats?(0,cr._)`${a.code.formats}${(0,cr.getProperty)(f)}`:void 0});e.fail$data(p(m))}function p(f){return(0,cr._)`${f}.compare(${r}, ${i}) ${hm[n].fail} 0`}},dependencies:["format"]};var nH=e=>(e.addKeyword(qo.formatLimitDefinition),e);qo.default=nH});var aO=I((cc,oO)=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var Zo=tO(),iH=rO(),x_=ae(),nO=new x_.Name("fullFormats"),oH=new x_.Name("fastFormats"),w_=(e,t={keywords:!0})=>{if(Array.isArray(t))return iO(e,t,Zo.fullFormats,nO),e;let[r,i]=t.mode==="fast"?[Zo.fastFormats,oH]:[Zo.fullFormats,nO],n=t.formats||Zo.formatNames;return iO(e,n,r,i),t.keywords&&(0,iH.default)(e),e};w_.get=(e,t="full")=>{let i=(t==="fast"?Zo.fastFormats:Zo.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function iO(e,t,r,i){var n,o;(n=(o=e.opts.code).formats)!==null&&n!==void 0||(o.formats=(0,x_._)`require("ajv-formats/dist/formats").${i}`);for(let a of t)e.addFormat(a,r[a])}oO.exports=cc=w_;Object.defineProperty(cc,"__esModule",{value:!0});cc.default=w_});var Dc=Bt(L$(),1),JM=process.env.NODE_ENV==="production",GM=new Set(["fatal","error","warn","info","debug","trace"]);function KM(){let e=process.env.FAMILIAR_LOG_LEVEL;return e==null||e===""?"info":GM.has(e)?e:(console.warn(`familiar: invalid FAMILIAR_LOG_LEVEL "${e}", falling back to "info"`),"info")}var q$=KM(),Z$={paths:["polarWebhookSecret","httpSecret","wsSecret","licenseKey","*.polarWebhookSecret","*.httpSecret","*.wsSecret","*.licenseKey"],censor:"[REDACTED]"},T=JM?(0,Dc.default)({level:q$,redact:Z$},Dc.default.destination(2)):(0,Dc.default)({level:q$,redact:Z$,transport:{target:"pino/file",options:{destination:2}}});var QM=6e4,Nc=class{constructor(t){this.onUpdate=t}clients=[];lingerTimers=new Map;add(t){t.sessionId!=null&&this.lingerTimers.has(t.sessionId)&&(clearTimeout(this.lingerTimers.get(t.sessionId)),this.lingerTimers.delete(t.sessionId)),this.clients=this.clients.filter(r=>!(r.name===t.name&&r.transport===t.transport)),this.clients.push(t),T.info({name:t.name,transport:t.transport},"MCP client connected"),this.broadcast()}removeBySessionId(t){this.clients.find(i=>i.sessionId===t)&&this.lingerTimers.set(t,setTimeout(()=>{this.lingerTimers.delete(t);let i=this.clients.length;this.clients=this.clients.filter(n=>n.sessionId!==t),this.clients.length<i&&(T.info({sessionId:t},"MCP HTTP client disconnected (linger expired)"),this.broadcast())},QM))}removeByTransport(t){let r=this.clients.length;this.clients=this.clients.filter(i=>i.transport!==t),this.clients.length<r&&(T.info({transport:t},"MCP client disconnected"),this.broadcast())}getClients(){return[...this.clients]}broadcastNow(){this.broadcast()}broadcast(){this.onUpdate([...this.clients])}};import{existsSync as $6}from"node:fs";import{homedir as UI,platform as k6}from"node:os";import $y from"node:path";var l={};$r(l,{$brand:()=>ea,$input:()=>vu,$output:()=>yu,NEVER:()=>Cc,TimePrecision:()=>xu,ZodAny:()=>Ag,ZodArray:()=>qg,ZodBase64:()=>Td,ZodBase64URL:()=>Id,ZodBigInt:()=>Bi,ZodBigIntFormat:()=>zd,ZodBoolean:()=>Vi,ZodCIDRv4:()=>$d,ZodCIDRv6:()=>kd,ZodCUID:()=>yd,ZodCUID2:()=>vd,ZodCatch:()=>sy,ZodCodec:()=>Nd,ZodCustom:()=>Ya,ZodCustomStringFormat:()=>Zi,ZodDate:()=>Wa,ZodDefault:()=>ty,ZodDiscriminatedUnion:()=>Fg,ZodE164:()=>Ed,ZodEmail:()=>fd,ZodEmoji:()=>hd,ZodEnum:()=>Li,ZodError:()=>d6,ZodExactOptional:()=>Yg,ZodFile:()=>Kg,ZodFirstPartyTypeKind:()=>by,ZodFunction:()=>gy,ZodGUID:()=>Fa,ZodIPv4:()=>xd,ZodIPv6:()=>wd,ZodISODate:()=>ld,ZodISODateTime:()=>cd,ZodISODuration:()=>dd,ZodISOTime:()=>ud,ZodIntersection:()=>Vg,ZodIssueCode:()=>m6,ZodJWT:()=>Pd,ZodKSUID:()=>Sd,ZodLazy:()=>my,ZodLiteral:()=>Gg,ZodMAC:()=>jg,ZodMap:()=>Wg,ZodNaN:()=>ly,ZodNanoID:()=>gd,ZodNever:()=>Ug,ZodNonOptional:()=>jd,ZodNull:()=>Cg,ZodNullable:()=>ey,ZodNumber:()=>Fi,ZodNumberFormat:()=>Gn,ZodObject:()=>Ja,ZodOptional:()=>Ji,ZodPipe:()=>Dd,ZodPrefault:()=>ny,ZodPromise:()=>hy,ZodReadonly:()=>uy,ZodRealError:()=>St,ZodRecord:()=>Qa,ZodSet:()=>Jg,ZodString:()=>qi,ZodStringFormat:()=>$e,ZodSuccess:()=>ay,ZodSymbol:()=>Dg,ZodTemplateLiteral:()=>py,ZodTransform:()=>Qg,ZodTuple:()=>Bg,ZodType:()=>re,ZodULID:()=>bd,ZodURL:()=>Ha,ZodUUID:()=>mr,ZodUndefined:()=>Ng,ZodUnion:()=>Ga,ZodUnknown:()=>Mg,ZodVoid:()=>Lg,ZodXID:()=>_d,ZodXor:()=>Zg,_ZodString:()=>md,_default:()=>ry,_function:()=>zI,any:()=>pI,array:()=>se,base64:()=>GT,base64url:()=>KT,bigint:()=>sI,boolean:()=>qe,catch:()=>cy,check:()=>RI,cidrv4:()=>WT,cidrv6:()=>JT,clone:()=>He,codec:()=>II,coerce:()=>_y,config:()=>Me,core:()=>It,cuid:()=>UT,cuid2:()=>LT,custom:()=>Cd,date:()=>fI,decode:()=>Tg,decodeAsync:()=>Eg,describe:()=>OI,discriminatedUnion:()=>Ka,e164:()=>QT,email:()=>PT,emoji:()=>AT,encode:()=>kg,encodeAsync:()=>Ig,endsWith:()=>qn,enum:()=>Qe,exactOptional:()=>Xg,file:()=>wI,flattenError:()=>$i,float32:()=>nI,float64:()=>iI,formatError:()=>ki,fromJSONSchema:()=>MI,function:()=>zI,getErrorMap:()=>h6,globalRegistry:()=>We,gt:()=>Kt,gte:()=>Ge,guid:()=>zT,hash:()=>rI,hex:()=>tI,hostname:()=>eI,httpUrl:()=>CT,includes:()=>Un,instanceof:()=>DI,int:()=>pd,int32:()=>oI,int64:()=>cI,intersection:()=>Wi,ipv4:()=>VT,ipv6:()=>HT,iso:()=>sn,json:()=>CI,jwt:()=>YT,keyof:()=>hI,ksuid:()=>FT,lazy:()=>fy,length:()=>rn,literal:()=>F,locales:()=>Ni,looseObject:()=>Ke,looseRecord:()=>bI,lowercase:()=>An,lt:()=>Gt,lte:()=>lt,mac:()=>BT,map:()=>_I,maxLength:()=>tn,maxSize:()=>Ir,meta:()=>jI,mime:()=>Zn,minLength:()=>pr,minSize:()=>Qt,multipleOf:()=>Tr,nan:()=>TI,nanoid:()=>MT,nativeEnum:()=>xI,negative:()=>Ma,never:()=>Rd,nonnegative:()=>La,nonoptional:()=>oy,nonpositive:()=>Ua,normalize:()=>Fn,null:()=>Hi,nullable:()=>Va,nullish:()=>$I,number:()=>ve,object:()=>L,optional:()=>ze,overwrite:()=>Dt,parse:()=>Sg,parseAsync:()=>xg,partialRecord:()=>vI,pipe:()=>Ba,positive:()=>Aa,prefault:()=>iy,preprocess:()=>Xa,prettifyError:()=>qc,promise:()=>PI,property:()=>qa,readonly:()=>dy,record:()=>Ie,refine:()=>yy,regex:()=>Cn,regexes:()=>_t,registry:()=>ga,safeDecode:()=>zg,safeDecodeAsync:()=>Og,safeEncode:()=>Pg,safeEncodeAsync:()=>Rg,safeParse:()=>wg,safeParseAsync:()=>$g,set:()=>SI,setErrorMap:()=>f6,size:()=>en,slugify:()=>Mi,startsWith:()=>Ln,strictObject:()=>gI,string:()=>x,stringFormat:()=>XT,stringbool:()=>NI,success:()=>kI,superRefine:()=>vy,symbol:()=>uI,templateLiteral:()=>EI,toJSONSchema:()=>Jn,toLowerCase:()=>Bn,toUpperCase:()=>Hn,transform:()=>Od,treeifyError:()=>Lc,trim:()=>Vn,tuple:()=>Hg,uint32:()=>aI,uint64:()=>lI,ulid:()=>qT,undefined:()=>dI,union:()=>xe,unknown:()=>ke,uppercase:()=>Mn,url:()=>NT,util:()=>z,uuid:()=>RT,uuidv4:()=>OT,uuidv6:()=>jT,uuidv7:()=>DT,void:()=>mI,xid:()=>ZT,xor:()=>yI});var It={};$r(It,{$ZodAny:()=>Nl,$ZodArray:()=>Ll,$ZodAsyncError:()=>Jt,$ZodBase64:()=>kl,$ZodBase64URL:()=>Tl,$ZodBigInt:()=>pa,$ZodBigIntFormat:()=>Rl,$ZodBoolean:()=>Ri,$ZodCIDRv4:()=>wl,$ZodCIDRv6:()=>$l,$ZodCUID:()=>dl,$ZodCUID2:()=>pl,$ZodCatch:()=>iu,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>ph,$ZodCheckEndsWith:()=>$h,$ZodCheckGreaterThan:()=>Xc,$ZodCheckIncludes:()=>xh,$ZodCheckLengthEquals:()=>vh,$ZodCheckLessThan:()=>Yc,$ZodCheckLowerCase:()=>_h,$ZodCheckMaxLength:()=>gh,$ZodCheckMaxSize:()=>mh,$ZodCheckMimeType:()=>Th,$ZodCheckMinLength:()=>yh,$ZodCheckMinSize:()=>fh,$ZodCheckMultipleOf:()=>uh,$ZodCheckNumberFormat:()=>dh,$ZodCheckOverwrite:()=>Ih,$ZodCheckProperty:()=>kh,$ZodCheckRegex:()=>bh,$ZodCheckSizeEquals:()=>hh,$ZodCheckStartsWith:()=>wh,$ZodCheckStringFormat:()=>zi,$ZodCheckUpperCase:()=>Sh,$ZodCodec:()=>ji,$ZodCustom:()=>pu,$ZodCustomStringFormat:()=>Pl,$ZodDate:()=>Ul,$ZodDefault:()=>eu,$ZodDiscriminatedUnion:()=>Fl,$ZodE164:()=>Il,$ZodEmail:()=>sl,$ZodEmoji:()=>ll,$ZodEncodeError:()=>Hr,$ZodEnum:()=>Jl,$ZodError:()=>sa,$ZodExactOptional:()=>Yl,$ZodFile:()=>Kl,$ZodFunction:()=>lu,$ZodGUID:()=>ol,$ZodIPv4:()=>_l,$ZodIPv6:()=>Sl,$ZodISODate:()=>yl,$ZodISODateTime:()=>gl,$ZodISODuration:()=>bl,$ZodISOTime:()=>vl,$ZodIntersection:()=>Vl,$ZodJWT:()=>El,$ZodKSUID:()=>hl,$ZodLazy:()=>du,$ZodLiteral:()=>Gl,$ZodMAC:()=>xl,$ZodMap:()=>Hl,$ZodNaN:()=>ou,$ZodNanoID:()=>ul,$ZodNever:()=>Al,$ZodNonOptional:()=>ru,$ZodNull:()=>Dl,$ZodNullable:()=>Xl,$ZodNumber:()=>da,$ZodNumberFormat:()=>zl,$ZodObject:()=>ql,$ZodObjectJIT:()=>Rh,$ZodOptional:()=>fa,$ZodPipe:()=>au,$ZodPrefault:()=>tu,$ZodPromise:()=>uu,$ZodReadonly:()=>su,$ZodRealError:()=>bt,$ZodRecord:()=>Bl,$ZodRegistry:()=>gu,$ZodSet:()=>Wl,$ZodString:()=>Xr,$ZodStringFormat:()=>Se,$ZodSuccess:()=>nu,$ZodSymbol:()=>Ol,$ZodTemplateLiteral:()=>cu,$ZodTransform:()=>Ql,$ZodTuple:()=>ma,$ZodType:()=>K,$ZodULID:()=>ml,$ZodURL:()=>cl,$ZodUUID:()=>al,$ZodUndefined:()=>jl,$ZodUnion:()=>Oi,$ZodUnknown:()=>Cl,$ZodVoid:()=>Ml,$ZodXID:()=>fl,$ZodXor:()=>Zl,$brand:()=>ea,$constructor:()=>b,$input:()=>vu,$output:()=>yu,Doc:()=>ua,JSONSchema:()=>IT,JSONSchemaGenerator:()=>ad,NEVER:()=>Cc,TimePrecision:()=>xu,_any:()=>Fu,_array:()=>Oh,_base64:()=>ja,_base64url:()=>Da,_bigint:()=>Cu,_boolean:()=>Du,_catch:()=>n6,_check:()=>TT,_cidrv4:()=>Ra,_cidrv6:()=>Oa,_coercedBigint:()=>Au,_coercedBoolean:()=>Nu,_coercedDate:()=>Ju,_coercedNumber:()=>Eu,_coercedString:()=>_u,_cuid:()=>$a,_cuid2:()=>ka,_custom:()=>Qu,_date:()=>Wu,_decode:()=>Fc,_decodeAsync:()=>Bc,_default:()=>e6,_discriminatedUnion:()=>Z2,_e164:()=>Na,_email:()=>ya,_emoji:()=>xa,_encode:()=>Zc,_encodeAsync:()=>Vc,_endsWith:()=>qn,_enum:()=>J2,_file:()=>Ku,_float32:()=>zu,_float64:()=>Ru,_gt:()=>Kt,_gte:()=>Ge,_guid:()=>Ci,_includes:()=>Un,_int:()=>Pu,_int32:()=>Ou,_int64:()=>Mu,_intersection:()=>F2,_ipv4:()=>Pa,_ipv6:()=>za,_isoDate:()=>$u,_isoDateTime:()=>wu,_isoDuration:()=>Tu,_isoTime:()=>ku,_jwt:()=>Ca,_ksuid:()=>Ea,_lazy:()=>s6,_length:()=>rn,_literal:()=>K2,_lowercase:()=>An,_lt:()=>Gt,_lte:()=>lt,_mac:()=>Su,_map:()=>H2,_max:()=>lt,_maxLength:()=>tn,_maxSize:()=>Ir,_mime:()=>Zn,_min:()=>Ge,_minLength:()=>pr,_minSize:()=>Qt,_multipleOf:()=>Tr,_nan:()=>Gu,_nanoid:()=>wa,_nativeEnum:()=>G2,_negative:()=>Ma,_never:()=>Bu,_nonnegative:()=>La,_nonoptional:()=>t6,_nonpositive:()=>Ua,_normalize:()=>Fn,_null:()=>Zu,_nullable:()=>X2,_number:()=>Iu,_optional:()=>Y2,_overwrite:()=>Dt,_parse:()=>Ti,_parseAsync:()=>Ii,_pipe:()=>i6,_positive:()=>Aa,_promise:()=>c6,_property:()=>qa,_readonly:()=>o6,_record:()=>B2,_refine:()=>Yu,_regex:()=>Cn,_safeDecode:()=>Wc,_safeDecodeAsync:()=>Gc,_safeEncode:()=>Hc,_safeEncodeAsync:()=>Jc,_safeParse:()=>Ei,_safeParseAsync:()=>Pi,_set:()=>W2,_size:()=>en,_slugify:()=>Mi,_startsWith:()=>Ln,_string:()=>bu,_stringFormat:()=>Wn,_stringbool:()=>rd,_success:()=>r6,_superRefine:()=>Xu,_symbol:()=>Lu,_templateLiteral:()=>a6,_toLowerCase:()=>Bn,_toUpperCase:()=>Hn,_transform:()=>Q2,_trim:()=>Vn,_tuple:()=>V2,_uint32:()=>ju,_uint64:()=>Uu,_ulid:()=>Ta,_undefined:()=>qu,_union:()=>L2,_unknown:()=>Vu,_uppercase:()=>Mn,_url:()=>Ai,_uuid:()=>va,_uuidv4:()=>ba,_uuidv6:()=>_a,_uuidv7:()=>Sa,_void:()=>Hu,_xid:()=>Ia,_xor:()=>q2,clone:()=>He,config:()=>Me,createStandardJSONSchemaMethod:()=>Ui,createToJSONSchemaMethod:()=>jh,decode:()=>tk,decodeAsync:()=>nk,describe:()=>ed,encode:()=>ek,encodeAsync:()=>rk,extractDefs:()=>on,finalize:()=>an,flattenError:()=>$i,formatError:()=>ki,globalConfig:()=>Xo,globalRegistry:()=>We,initializeContext:()=>nn,isValidBase64:()=>zh,isValidBase64URL:()=>kk,isValidJWT:()=>Tk,locales:()=>Ni,meta:()=>td,parse:()=>jn,parseAsync:()=>Dn,prettifyError:()=>qc,process:()=>_e,regexes:()=>_t,registry:()=>ga,safeDecode:()=>ok,safeDecodeAsync:()=>sk,safeEncode:()=>ik,safeEncodeAsync:()=>ak,safeParse:()=>Qr,safeParseAsync:()=>Yr,toDotPath:()=>X$,toJSONSchema:()=>Jn,treeifyError:()=>Lc,util:()=>z,version:()=>Eh});var Cc=Object.freeze({status:"aborted"});function b(e,t,r){function i(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let f=d[p];f in s||(s[f]=u[f].bind(s))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function a(s){var c;let u=r?.Parent?new o:this;i(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var ea=Symbol("zod_brand"),Jt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Hr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Xo={};function Me(e){return e&&Object.assign(Xo,e),Xo}var z={};$r(z,{BIGINT_FORMAT_RANGES:()=>Nf,Class:()=>Ef,NUMBER_FORMAT_RANGES:()=>Df,aborted:()=>Kr,allowsEval:()=>Rf,assert:()=>r4,assertEqual:()=>YM,assertIs:()=>e4,assertNever:()=>t4,assertNotEqual:()=>XM,assignProp:()=>Jr,base64ToUint8Array:()=>K$,base64urlToUint8Array:()=>m4,cached:()=>xi,captureStackTrace:()=>Mc,cleanEnum:()=>p4,cleanRegex:()=>na,clone:()=>He,cloneDef:()=>i4,createTransparentProxy:()=>u4,defineLazy:()=>te,esc:()=>Ac,escapeRegex:()=>jt,extend:()=>H$,finalizeIssue:()=>vt,floatSafeRemainder:()=>Pf,getElementAtPath:()=>o4,getEnumValues:()=>ra,getLengthableOrigin:()=>aa,getParsedType:()=>l4,getSizableOrigin:()=>oa,hexToUint8Array:()=>h4,isObject:()=>On,isPlainObject:()=>Gr,issue:()=>wi,joinValues:()=>S,jsonStringifyReplacer:()=>Si,merge:()=>d4,mergeDefs:()=>kr,normalizeParams:()=>j,nullish:()=>Wr,numKeys:()=>c4,objectClone:()=>n4,omit:()=>B$,optionalKeys:()=>jf,parsedType:()=>O,partial:()=>J$,pick:()=>V$,prefixIssues:()=>Tt,primitiveTypes:()=>Of,promiseAllObject:()=>a4,propertyKeyTypes:()=>ia,randomString:()=>s4,required:()=>G$,safeExtend:()=>W$,shallowClone:()=>Uc,slugify:()=>zf,stringifyPrimitive:()=>P,uint8ArrayToBase64:()=>Q$,uint8ArrayToBase64url:()=>f4,uint8ArrayToHex:()=>g4,unwrapMessage:()=>ta});function YM(e){return e}function XM(e){return e}function e4(e){}function t4(e){throw new Error("Unexpected value in exhaustive check")}function r4(e){}function ra(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function S(e,t="|"){return e.map(r=>P(r)).join(t)}function Si(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 Wr(e){return e==null}function na(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Pf(e,t){let r=(e.toString().split(".")[1]||"").length,i=t.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let c=i.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}let o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return a%s/10**o}var F$=Symbol("evaluating");function te(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==F$)return i===void 0&&(i=F$,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function n4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Jr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function kr(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function i4(e){return kr(e._zod.def)}function o4(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function a4(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function s4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Ac(e){return JSON.stringify(e)}function zf(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Mc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function On(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Rf=xi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Gr(e){if(On(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(On(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Uc(e){return Gr(e)?{...e}:Array.isArray(e)?[...e]:e}function c4(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var l4=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}`)}},ia=new Set(["string","number","symbol"]),Of=new Set(["string","number","bigint","boolean","symbol","undefined"]);function jt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function He(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function j(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 u4(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function P(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function jf(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Df={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]},Nf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function V$(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=kr(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Jr(this,"shape",a),a},checks:[]});return He(e,o)}function B$(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=kr(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Jr(this,"shape",a),a},checks:[]});return He(e,o)}function H$(e,t){if(!Gr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=kr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Jr(this,"shape",o),o}});return He(e,n)}function W$(e,t){if(!Gr(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=kr(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Jr(this,"shape",i),i}});return He(e,r)}function d4(e,t){let r=kr(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Jr(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return He(e,r)}function J$(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 a=kr(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Jr(this,"shape",c),c},checks:[]});return He(t,a)}function G$(e,t,r){let i=kr(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(r)for(let a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new e({type:"nonoptional",innerType:n[a]});return Jr(this,"shape",o),o}});return He(t,i)}function Kr(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 Tt(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function ta(e){return typeof e=="string"?e:e?.message}function vt(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let n=ta(e.inst?._zod.def?.error?.(e))??ta(t?.error?.(e))??ta(r.customError?.(e))??ta(r.localeError?.(e))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function oa(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function aa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function O(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,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function p4(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function K$(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function Q$(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function m4(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return K$(t+r)}function f4(e){return Q$(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function h4(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 i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function g4(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ef=class{constructor(...t){}};var Y$=(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,Si,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},sa=b("$ZodError",Y$),bt=b("$ZodError",Y$,{Parent:Error});function $i(e,t=r=>r.message){let r={},i=[];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))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function ki(e,t=r=>r.message){let r={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let a=r,s=0;for(;s<o.path.length;){let c=o.path[s];s===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return i(e),r}function Lc(e,t=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{let u=[...o,...c.path];if(u.length===0){r.errors.push(t(c));continue}let d=r,p=0;for(;p<u.length;){let f=u[p],h=p===u.length-1;typeof f=="string"?(d.properties??(d.properties={}),(a=d.properties)[f]??(a[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(s=d.items)[f]??(s[f]={errors:[]}),d=d.items[f]),h&&d.errors.push(t(c)),p++}}};return i(e),r}function X$(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function qc(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${X$(i.path)}`);return t.join(`
38
+ `)}var Ti=e=>(t,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Jt;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>vt(c,o,Me())));throw Mc(s,n?.callee),s}return a.value},jn=Ti(bt),Ii=e=>async(t,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>vt(c,o,Me())));throw Mc(s,n?.callee),s}return a.value},Dn=Ii(bt),Ei=e=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Jt;return o.issues.length?{success:!1,error:new(e??sa)(o.issues.map(a=>vt(a,n,Me())))}:{success:!0,data:o.value}},Qr=Ei(bt),Pi=e=>async(t,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>vt(a,n,Me())))}:{success:!0,data:o.value}},Yr=Pi(bt),Zc=e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ti(e)(t,r,n)},ek=Zc(bt),Fc=e=>(t,r,i)=>Ti(e)(t,r,i),tk=Fc(bt),Vc=e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ii(e)(t,r,n)},rk=Vc(bt),Bc=e=>async(t,r,i)=>Ii(e)(t,r,i),nk=Bc(bt),Hc=e=>(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ei(e)(t,r,n)},ik=Hc(bt),Wc=e=>(t,r,i)=>Ei(e)(t,r,i),ok=Wc(bt),Jc=e=>async(t,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Pi(e)(t,r,n)},ak=Jc(bt),Gc=e=>async(t,r,i)=>Pi(e)(t,r,i),sk=Gc(bt);var _t={};$r(_t,{base64:()=>Qf,base64url:()=>Kc,bigint:()=>nh,boolean:()=>oh,browserEmail:()=>k4,cidrv4:()=>Gf,cidrv6:()=>Kf,cuid:()=>Cf,cuid2:()=>Af,date:()=>Xf,datetime:()=>th,domain:()=>E4,duration:()=>Zf,e164:()=>Yf,email:()=>Vf,emoji:()=>Bf,extendedDuration:()=>v4,guid:()=>Ff,hex:()=>P4,hostname:()=>I4,html5Email:()=>x4,idnEmail:()=>$4,integer:()=>ih,ipv4:()=>Hf,ipv6:()=>Wf,ksuid:()=>Lf,lowercase:()=>ch,mac:()=>Jf,md5_base64:()=>R4,md5_base64url:()=>O4,md5_hex:()=>z4,nanoid:()=>qf,null:()=>ah,number:()=>Qc,rfc5322Email:()=>w4,sha1_base64:()=>D4,sha1_base64url:()=>N4,sha1_hex:()=>j4,sha256_base64:()=>A4,sha256_base64url:()=>M4,sha256_hex:()=>C4,sha384_base64:()=>L4,sha384_base64url:()=>q4,sha384_hex:()=>U4,sha512_base64:()=>F4,sha512_base64url:()=>V4,sha512_hex:()=>Z4,string:()=>rh,time:()=>eh,ulid:()=>Mf,undefined:()=>sh,unicodeEmail:()=>ck,uppercase:()=>lh,uuid:()=>Nn,uuid4:()=>b4,uuid6:()=>_4,uuid7:()=>S4,xid:()=>Uf});var Cf=/^[cC][^\s-]{8,}$/,Af=/^[0-9a-z]+$/,Mf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Uf=/^[0-9a-vA-V]{20}$/,Lf=/^[A-Za-z0-9]{27}$/,qf=/^[a-zA-Z0-9_-]{21}$/,Zf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,v4=/^[-+]?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)?)??$/,Ff=/^([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})$/,Nn=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)$/,b4=Nn(4),_4=Nn(6),S4=Nn(7),Vf=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,x4=/^[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])?)*$/,w4=/^(([^<>()\[\]\\.,;:\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,}))$/,ck=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$4=ck,k4=/^[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])?)*$/,T4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bf(){return new RegExp(T4,"u")}var Hf=/^(?:(?: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])$/,Wf=/^(([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}|:))$/,Jf=e=>{let t=jt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Gf=/^((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])$/,Kf=/^(([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])$/,Qf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kc=/^[A-Za-z0-9_-]*$/,I4=/^(?=.{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])?)*\.?$/,E4=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Yf=/^\+[1-9]\d{6,14}$/,lk="(?:(?:\\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])))",Xf=new RegExp(`^${lk}$`);function uk(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 eh(e){return new RegExp(`^${uk(e)}$`)}function th(e){let t=uk({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${lk}T(?:${i})$`)}var rh=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},nh=/^-?\d+n?$/,ih=/^-?\d+$/,Qc=/^-?\d+(?:\.\d+)?$/,oh=/^(?:true|false)$/i,ah=/^null$/i;var sh=/^undefined$/i;var ch=/^[^A-Z]*$/,lh=/^[^a-z]*$/,P4=/^[0-9a-fA-F]*$/;function ca(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function la(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var z4=/^[0-9a-fA-F]{32}$/,R4=ca(22,"=="),O4=la(22),j4=/^[0-9a-fA-F]{40}$/,D4=ca(27,"="),N4=la(27),C4=/^[0-9a-fA-F]{64}$/,A4=ca(43,"="),M4=la(43),U4=/^[0-9a-fA-F]{96}$/,L4=ca(64,""),q4=la(64),Z4=/^[0-9a-fA-F]{128}$/,F4=ca(86,"=="),V4=la(86);var we=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),pk={number:"number",bigint:"bigint",object:"date"},Yc=b("$ZodCheckLessThan",(e,t)=>{we.init(e,t);let r=pk[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xc=b("$ZodCheckGreaterThan",(e,t)=>{we.init(e,t);let r=pk[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),uh=b("$ZodCheckMultipleOf",(e,t)=>{we.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.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):Pf(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})}}),dh=b("$ZodCheckNumberFormat",(e,t)=>{we.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=Df[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=o,r&&(s.pattern=ih)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),ph=b("$ZodCheckBigIntFormat",(e,t)=>{we.init(e,t);let[r,i]=Nf[t.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),mh=b("$ZodCheckMaxSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Wr(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;n.size<=t.maximum||i.issues.push({origin:oa(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),fh=b("$ZodCheckMinSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Wr(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;n.size>=t.minimum||i.issues.push({origin:oa(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),hh=b("$ZodCheckSizeEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Wr(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=i=>{let n=i.value,o=n.size;if(o===t.size)return;let a=o>t.size;i.issues.push({origin:oa(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),gh=b("$ZodCheckMaxLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Wr(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;if(n.length<=t.maximum)return;let a=aa(n);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),yh=b("$ZodCheckMinLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Wr(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;if(n.length>=t.minimum)return;let a=aa(n);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),vh=b("$ZodCheckLengthEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Wr(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=i=>{let n=i.value,o=n.length;if(o===t.length)return;let a=aa(n),s=o>t.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),zi=b("$ZodCheckStringFormat",(e,t)=>{var r,i;we.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.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})}):(i=e._zod).check??(i.check=()=>{})}),bh=b("$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})}}),_h=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ch),zi.init(e,t)}),Sh=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=lh),zi.init(e,t)}),xh=b("$ZodCheckIncludes",(e,t)=>{we.init(e,t);let r=jt(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),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})}}),wh=b("$ZodCheckStartsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`^${jt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),$h=b("$ZodCheckEndsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`.*${jt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function dk(e,t,r){e.issues.length&&t.issues.push(...Tt(r,e.issues))}var kh=b("$ZodCheckProperty",(e,t)=>{we.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>dk(n,r,t.property));dk(i,r,t.property)}}),Th=b("$ZodCheckMimeType",(e,t)=>{we.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Ih=b("$ZodCheckOverwrite",(e,t)=>{we.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ua=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 i=t.split(`
39
39
  `).filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,n.join(`
40
- `))}};var kh={major:4,minor:3,patch:6};var K=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kh;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,l)=>{let u=Jr(a),d;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&l?.async===!1)throw new Wt;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,a.issues.length!==f&&(u||(u=Jr(a,f)))});else{if(a.issues.length===f)continue;u||(u=Jr(a,f))}}return d?d.then(()=>a):a},o=(a,s,l)=>{if(Jr(a))return a.aborted=!0,a;let u=n(s,i,l);if(u instanceof Promise){if(l.async===!1)throw new Wt;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>o(d,a,s)):o(u,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Wt;return l.then(u=>n(u,i,s))}return n(l,i,s)}}te(e,"~standard",()=>({validate:n=>{try{let o=Gr(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Kr(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Qr=b("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Xf(e._zod.bag),e._zod.parse=(r,i)=>{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}}),Se=b("$ZodStringFormat",(e,t)=>{Pi.init(e,t),Qr.init(e,t)}),nl=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Lf),Se.init(e,t)}),il=b("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=jn(i))}else t.pattern??(t.pattern=jn());Se.init(e,t)}),ol=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qf),Se.init(e,t)}),al=b("$ZodURL",(e,t)=>{Se.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);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=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),sl=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Zf()),Se.init(e,t)}),cl=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Mf),Se.init(e,t)}),ll=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=jf),Se.init(e,t)}),ul=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Df),Se.init(e,t)}),dl=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Nf),Se.init(e,t)}),pl=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Cf),Se.init(e,t)}),ml=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Af),Se.init(e,t)}),fl=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Yf(t)),Se.init(e,t)}),hl=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Kf),Se.init(e,t)}),gl=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Qf(t)),Se.init(e,t)}),yl=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Uf),Se.init(e,t)}),vl=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ff),Se.init(e,t),e._zod.bag.format="ipv4"}),bl=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Vf),Se.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})}}}),_l=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Bf(t.delimiter)),Se.init(e,t),e._zod.bag.format="mac"}),Sl=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Hf),Se.init(e,t)}),xl=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Wf),Se.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>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 Ih(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var wl=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Jf),Se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ih(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function uk(e){if(!Jc.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ih(r)}var $l=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Jc),Se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{uk(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),kl=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Gf),Se.init(e,t)});function dk(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Tl=b("$ZodJWT",(e,t)=>{Se.init(e,t),e._zod.check=r=>{dk(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Il=b("$ZodCustomStringFormat",(e,t)=>{Se.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})}}),ua=b("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??Gc,e._zod.parse=(r,i)=>{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 o=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,...o?{received:o}:{}}),r}}),El=b("$ZodNumberFormat",(e,t)=>{ch.init(e,t),ua.init(e,t)}),zi=b("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=rh,e._zod.parse=(r,i)=>{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}}),da=b("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=eh,e._zod.parse=(r,i)=>{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}}),Pl=b("$ZodBigIntFormat",(e,t)=>{lh.init(e,t),da.init(e,t)}),zl=b("$ZodSymbol",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Rl=b("$ZodUndefined",(e,t)=>{K.init(e,t),e._zod.pattern=ih,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Ol=b("$ZodNull",(e,t)=>{K.init(e,t),e._zod.pattern=nh,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),jl=b("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),Dl=b("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),Nl=b("$ZodNever",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Cl=b("$ZodVoid",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Al=b("$ZodDate",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function X$(e,t,r){e.issues.length&&t.issues.push(...kt(r,e.issues)),t.value[r]=e.value}var Ml=b("$ZodArray",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{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 o=[];for(let a=0;a<n.length;a++){let s=n[a],l=t.element._zod.run({value:s,issues:[]},i);l instanceof Promise?o.push(l.then(u=>X$(u,r,a))):X$(l,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function rl(e,t,r,i,n){if(e.issues.length){if(n&&!(r in i))return;t.issues.push(...kt(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}function pk(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=zf(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function mk(e,t,r,i,n,o){let a=[],s=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optout==="optional";for(let p in t){if(s.has(p))continue;if(u==="never"){a.push(p);continue}let f=l.run({value:t[p],issues:[]},i);f instanceof Promise?e.push(f.then(h=>rl(h,r,p,t,d))):rl(f,r,p,t,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}var Ul=b("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}let i=Si(()=>pk(t));te(e._zod,"propValues",()=>{let s=t.shape,l={};for(let u in s){let d=s[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let n=zn,o=t.catchall,a;e._zod.parse=(s,l)=>{a??(a=i.value);let u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],p=a.shape;for(let f of a.keys){let h=p[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},l);g instanceof Promise?d.push(g.then(v=>rl(v,s,f,u,m))):rl(g,s,f,u,m)}return o?mk(d,u,s,l,i.value,e):d.length?Promise.all(d).then(()=>s):s}}),Eh=b("$ZodObjectJIT",(e,t)=>{Ul.init(e,t);let r=e._zod.parse,i=Si(()=>pk(t)),n=f=>{let h=new la(["shape","payload","ctx"]),m=i.value,g=$=>{let E=Nc($);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};h.write("const input = payload.value;");let v=Object.create(null),_=0;for(let $ of m.keys)v[$]=`key_${_++}`;h.write("const newResult = {};");for(let $ of m.keys){let E=v[$],N=Nc($),Y=f[$]?._zod?.optout==="optional";h.write(`const ${E} = ${g($)};`),Y?h.write(`
40
+ `))}};var Eh={major:4,minor:3,patch:6};var K=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Eh;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,c)=>{let u=Kr(a),d;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,h=p._zod.check(a);if(h instanceof Promise&&c?.async===!1)throw new Jt;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,a.issues.length!==f&&(u||(u=Kr(a,f)))});else{if(a.issues.length===f)continue;u||(u=Kr(a,f))}}return d?d.then(()=>a):a},o=(a,s,c)=>{if(Kr(a))return a.aborted=!0,a;let u=n(s,i,c);if(u instanceof Promise){if(c.async===!1)throw new Jt;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>o(d,a,s)):o(u,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Jt;return c.then(u=>n(u,i,s))}return n(c,i,s)}}te(e,"~standard",()=>({validate:n=>{try{let o=Qr(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Yr(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Xr=b("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rh(e._zod.bag),e._zod.parse=(r,i)=>{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}}),Se=b("$ZodStringFormat",(e,t)=>{zi.init(e,t),Xr.init(e,t)}),ol=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ff),Se.init(e,t)}),al=b("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Nn(i))}else t.pattern??(t.pattern=Nn());Se.init(e,t)}),sl=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vf),Se.init(e,t)}),cl=b("$ZodURL",(e,t)=>{Se.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);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=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),ll=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Bf()),Se.init(e,t)}),ul=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=qf),Se.init(e,t)}),dl=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Cf),Se.init(e,t)}),pl=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Af),Se.init(e,t)}),ml=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Mf),Se.init(e,t)}),fl=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Uf),Se.init(e,t)}),hl=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Lf),Se.init(e,t)}),gl=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=th(t)),Se.init(e,t)}),yl=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Xf),Se.init(e,t)}),vl=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=eh(t)),Se.init(e,t)}),bl=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Zf),Se.init(e,t)}),_l=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Hf),Se.init(e,t),e._zod.bag.format="ipv4"}),Sl=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wf),Se.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})}}}),xl=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Jf(t.delimiter)),Se.init(e,t),e._zod.bag.format="mac"}),wl=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gf),Se.init(e,t)}),$l=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Kf),Se.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>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 zh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var kl=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qf),Se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{zh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function kk(e){if(!Kc.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return zh(r)}var Tl=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Kc),Se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{kk(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Il=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Yf),Se.init(e,t)});function Tk(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var El=b("$ZodJWT",(e,t)=>{Se.init(e,t),e._zod.check=r=>{Tk(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Pl=b("$ZodCustomStringFormat",(e,t)=>{Se.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})}}),da=b("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??Qc,e._zod.parse=(r,i)=>{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 o=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,...o?{received:o}:{}}),r}}),zl=b("$ZodNumberFormat",(e,t)=>{dh.init(e,t),da.init(e,t)}),Ri=b("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=oh,e._zod.parse=(r,i)=>{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}}),pa=b("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=nh,e._zod.parse=(r,i)=>{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}}),Rl=b("$ZodBigIntFormat",(e,t)=>{ph.init(e,t),pa.init(e,t)}),Ol=b("$ZodSymbol",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),jl=b("$ZodUndefined",(e,t)=>{K.init(e,t),e._zod.pattern=sh,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Dl=b("$ZodNull",(e,t)=>{K.init(e,t),e._zod.pattern=ah,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Nl=b("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),Cl=b("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),Al=b("$ZodNever",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Ml=b("$ZodVoid",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Ul=b("$ZodDate",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function fk(e,t,r){e.issues.length&&t.issues.push(...Tt(r,e.issues)),t.value[r]=e.value}var Ll=b("$ZodArray",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{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 o=[];for(let a=0;a<n.length;a++){let s=n[a],c=t.element._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(u=>fk(u,r,a))):fk(c,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function il(e,t,r,i,n){if(e.issues.length){if(n&&!(r in i))return;t.issues.push(...Tt(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}function Ik(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=jf(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Ek(e,t,r,i,n,o){let a=[],s=n.keySet,c=n.catchall._zod,u=c.def.type,d=c.optout==="optional";for(let p in t){if(s.has(p))continue;if(u==="never"){a.push(p);continue}let f=c.run({value:t[p],issues:[]},i);f instanceof Promise?e.push(f.then(h=>il(h,r,p,t,d))):il(f,r,p,t,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}var ql=b("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let i=xi(()=>Ik(t));te(e._zod,"propValues",()=>{let s=t.shape,c={};for(let u in s){let d=s[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let p of d.values)c[u].add(p)}}return c});let n=On,o=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=i.value);let u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],p=a.shape;for(let f of a.keys){let h=p[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},c);g instanceof Promise?d.push(g.then(v=>il(v,s,f,u,m))):il(g,s,f,u,m)}return o?Ek(d,u,s,c,i.value,e):d.length?Promise.all(d).then(()=>s):s}}),Rh=b("$ZodObjectJIT",(e,t)=>{ql.init(e,t);let r=e._zod.parse,i=xi(()=>Ik(t)),n=f=>{let h=new ua(["shape","payload","ctx"]),m=i.value,g=$=>{let E=Ac($);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};h.write("const input = payload.value;");let v=Object.create(null),_=0;for(let $ of m.keys)v[$]=`key_${_++}`;h.write("const newResult = {};");for(let $ of m.keys){let E=v[$],N=Ac($),Y=f[$]?._zod?.optout==="optional";h.write(`const ${E} = ${g($)};`),Y?h.write(`
41
41
  if (${E}.issues.length) {
42
42
  if (${N} in input) {
43
43
  payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
@@ -71,29 +71,29 @@ ${w}`),g.pop(),`{${de}}`}case"number":return isFinite(m)?String(m):t?t(m):"null"
71
71
  newResult[${N}] = ${E}.value;
72
72
  }
73
73
 
74
- `)}h.write("payload.value = newResult;"),h.write("return payload;");let w=h.compile();return($,E)=>w(f,$,E)},o,a=zn,s=!Yo.jitless,u=s&&Ef.value,d=t.catchall,p;e._zod.parse=(f,h)=>{p??(p=i.value);let m=f.value;return a(m)?s&&u&&h?.async===!1&&h.jitless!==!0?(o||(o=n(t.shape)),f=o(f,h),d?mk([],m,f,h,p,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function ek(e,t,r,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let n=e.filter(o=>!Jr(o));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(o=>o.issues.map(a=>yt(a,i,Ae())))}),t)}var Ri=b("$ZodUnion",(e,t)=>{K.init(e,t),te(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),te(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),te(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),te(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>ra(o.source)).join("|")})$`)}});let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,s=[];for(let l of t.options){let u=l._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(l=>ek(l,n,e,o)):ek(s,n,e,o)}});function tk(e,t,r,i){let n=e.filter(o=>o.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(o=>o.issues.map(a=>yt(a,i,Ae())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Ll=b("$ZodXor",(e,t)=>{Ri.init(e,t),t.inclusive=!1;let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,s=[];for(let l of t.options){let u=l._zod.run({value:n.value,issues:[]},o);u instanceof Promise?(s.push(u),a=!0):s.push(u)}return a?Promise.all(s).then(l=>tk(l,n,e,o)):tk(s,n,e,o)}}),ql=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ri.init(e,t);let r=e._zod.parse;te(e._zod,"propValues",()=>{let n={};for(let o of t.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let u of l)n[s].add(u)}}return n});let i=Si(()=>{let n=t.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of s){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});e._zod.parse=(n,o)=>{let a=n.value;if(!zn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=i.value.get(a?.[t.discriminator]);return s?s._zod.run(n,o):t.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),n)}}),Zl=b("$ZodIntersection",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),a=t.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,u])=>rk(r,l,u)):rk(r,o,a)}});function Th(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(Wr(e)&&Wr(t)){let r=Object.keys(t),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let a=Th(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.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 i=0;i<e.length;i++){let n=e[i],o=t[i],a=Th(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function rk(e,t,r){let i=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let l of s.keys)i.has(l)||i.set(l,{}),i.get(l).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)i.has(l)||i.set(l,{}),i.get(l).r=!0;else e.issues.push(s);let o=[...i].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&n&&e.issues.push({...n,keys:o}),Jr(e))return e;let a=Th(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var pa=b("$ZodTuple",(e,t)=>{K.init(e,t);let r=t.items;e._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),l=s===-1?0:r.length-s;if(!t.rest){let d=o.length>r.length,p=o.length<l-1;if(d||p)return i.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),i}let u=-1;for(let d of r){if(u++,u>=o.length&&u>=l)continue;let p=d._zod.run({value:o[u],issues:[]},n);p instanceof Promise?a.push(p.then(f=>Yc(f,i,u))):Yc(p,i,u)}if(t.rest){let d=o.slice(r.length);for(let p of d){u++;let f=t.rest._zod.run({value:p,issues:[]},n);f instanceof Promise?a.push(f.then(h=>Yc(h,i,u))):Yc(f,i,u)}}return a.length?Promise.all(a).then(()=>i):i}});function Yc(e,t,r){e.issues.length&&t.issues.push(...kt(r,e.issues)),t.value[r]=e.value}var Fl=b("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Wr(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let d=t.valueType._zod.run({value:n[u],issues:[]},i);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...kt(u,p.issues)),r.value[u]=p.value})):(d.issues.length&&r.issues.push(...kt(u,d.issues)),r.value[u]=d.value)}let l;for(let u in n)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let l=t.keyType._zod.run({value:s,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Gc.test(s)&&l.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>yt(p,i,Ae())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:n[s],issues:[]},i);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...kt(s,p.issues)),r.value[l.value]=p.value})):(d.issues.length&&r.issues.push(...kt(s,d.issues)),r.value[l.value]=d.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Vl=b("$ZodMap",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[a,s]of n){let l=t.keyType._zod.run({value:a,issues:[]},i),u=t.valueType._zod.run({value:s,issues:[]},i);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([d,p])=>{nk(d,p,r,a,n,e,i)})):nk(l,u,r,a,n,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function nk(e,t,r,i,n,o,a){e.issues.length&&(na.has(typeof i)?r.issues.push(...kt(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(s=>yt(s,a,Ae()))})),t.issues.length&&(na.has(typeof i)?r.issues.push(...kt(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map(s=>yt(s,a,Ae()))})),r.value.set(e.value,t.value)}var Bl=b("$ZodSet",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(l=>ik(l,r))):ik(s,r)}return o.length?Promise.all(o).then(()=>r):r}});function ik(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Hl=b("$ZodEnum",(e,t)=>{K.init(e,t);let r=ta(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(n=>na.has(typeof n)).map(n=>typeof n=="string"?Ot(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Wl=b("$ZodLiteral",(e,t)=>{if(K.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(i=>typeof i=="string"?Ot(i):i?Ot(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),Jl=b("$ZodFile",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Gl=b("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vr(e.constructor.name);let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new Wt;return r.value=n,r}});function ok(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var ma=b("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ra(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ok(o,r.value)):ok(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),Kl=b("$ZodExactOptional",(e,t)=>{ma.init(e,t),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Ql=b("$ZodNullable",(e,t)=>{K.init(e,t),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ra(r.source)}|null)$`):void 0}),te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),Yl=b("$ZodDefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>ak(o,t)):ak(n,t)}});function ak(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Xl=b("$ZodPrefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),eu=b("$ZodNonOptional",(e,t)=>{K.init(e,t),te(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>sk(o,e)):sk(n,e)}});function sk(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 tu=b("$ZodSuccess",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vr("ZodSuccess");let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),ru=b("$ZodCatch",(e,t)=>{K.init(e,t),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>yt(a,i,Ae()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(o=>yt(o,i,Ae()))},input:r.value}),r.issues=[]),r)}}),nu=b("$ZodNaN",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),iu=b("$ZodPipe",(e,t)=>{K.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(e._zod,"optout",()=>t.out._zod.optout),te(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(a=>Xc(a,t.in,i)):Xc(o,t.in,i)}let n=t.in._zod.run(r,i);return n instanceof Promise?n.then(o=>Xc(o,t.out,i)):Xc(n,t.out,i)}});function Xc(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Oi=b("$ZodCodec",(e,t)=>{K.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(e._zod,"optout",()=>t.out._zod.optout),te(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(r,i);return o instanceof Promise?o.then(a=>el(a,t,i)):el(o,t,i)}else{let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(a=>el(a,t,i)):el(o,t,i)}}});function el(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(o=>tl(e,o,t.out,r)):tl(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(o=>tl(e,o,t.in,r)):tl(e,n,t.in,r)}}function tl(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}var ou=b("$ZodReadonly",(e,t)=>{K.init(e,t),te(e._zod,"propValues",()=>t.innerType._zod.propValues),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"optin",()=>t.innerType?._zod?.optin),te(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(ck):ck(n)}});function ck(e){return e.value=Object.freeze(e.value),e}var au=b("$ZodTemplateLiteral",(e,t)=>{K.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,a))}else if(i===null||Pf.has(typeof i))r.push(Ot(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),su=b("$ZodFunction",(e,t)=>(K.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(...i){let n=e._def.input?Rn(e._def.input,i):i,o=Reflect.apply(r,this,n);return e._def.output?Rn(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=e._def.input?await On(e._def.input,i):i,o=await Reflect.apply(r,this,n);return e._def.output?await On(e._def.output,o):o}},e._zod.parse=(r,i)=>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 i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new pa({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),cu=b("$ZodPromise",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),lu=b("$ZodLazy",(e,t)=>{K.init(e,t),te(e._zod,"innerType",()=>t.getter()),te(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),te(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),te(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),te(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),uu=b("$ZodCustom",(e,t)=>{we.init(e,t),K.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(o=>lk(o,r,i,e));lk(n,r,i,e)}});function lk(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(xi(n))}}var Di={};wr(Di,{ar:()=>fk,az:()=>hk,be:()=>yk,bg:()=>vk,ca:()=>bk,cs:()=>_k,da:()=>Sk,de:()=>xk,en:()=>du,eo:()=>wk,es:()=>$k,fa:()=>kk,fi:()=>Tk,fr:()=>Ik,frCA:()=>Ek,he:()=>Pk,hu:()=>zk,hy:()=>Ok,id:()=>jk,is:()=>Dk,it:()=>Nk,ja:()=>Ck,ka:()=>Ak,kh:()=>Mk,km:()=>pu,ko:()=>Uk,lt:()=>qk,mk:()=>Zk,ms:()=>Fk,nl:()=>Vk,no:()=>Bk,ota:()=>Hk,pl:()=>Jk,ps:()=>Wk,pt:()=>Gk,ru:()=>Qk,sl:()=>Yk,sv:()=>Xk,ta:()=>eT,th:()=>tT,tr:()=>rT,ua:()=>nT,uk:()=>mu,ur:()=>iT,uz:()=>oT,vi:()=>aT,yo:()=>lT,zhCN:()=>sT,zhTW:()=>cT});var D4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}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 ${P(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: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?` \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"} ${o} ${n.maximum.toString()} ${a.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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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 ${o} ${n.minimum.toString()} ${a.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 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${r[o.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":""}: ${S(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 fk(){return{localeError:D4()}}var N4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${P(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.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":""}: ${S(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 hk(){return{localeError:N4()}}function gk(e,t,r,i){let n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?r:i}var C4=()=>{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"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=gk(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${n.maximum.toString()} ${l}`}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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=gk(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${n.minimum.toString()} ${l}`}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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.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"}: ${S(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 yk(){return{localeError:C4()}}var A4=()=>{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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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 ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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 ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[o.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":""}: ${S(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 vk(){return{localeError:A4()}}var M4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${P(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${S(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.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":""}: ${S(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 bk(){return{localeError:M4()}}var U4=()=>{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"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${P(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.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: ${S(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 _k(){return{localeError:U4()}}var L4=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${P(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=i[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=i[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${S(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 Sk(){return{localeError:L4()}}var q4=()=>{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"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${P(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.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"}: ${S(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 xk(){return{localeError:q4()}}var Z4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${P(n.values[0])}`:`Invalid option: expected one of ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.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":""}: ${S(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 du(){return{localeError:Z4()}}var F4=()=>{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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${P(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.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":""}: ${S(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 wk(){return{localeError:F4()}}var V4=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${P(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${o}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.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":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function $k(){return{localeError:V4()}}var B4=()=>{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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s} \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 ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \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 ${P(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 ${S(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.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: ${S(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 kk(){return{localeError:B4()}}var H4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${P(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.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"}: ${S(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 Tk(){return{localeError:H4()}}var W4=()=>{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"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${P(n.values[0])} attendu`:`Option invalide : une valeur parmi ${S(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.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":""} : ${S(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 Ik(){return{localeError:W4()}}var J4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${P(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.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":""} : ${S(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 Ek(){return{localeError:J4()}}var G4=()=>{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=u=>u?e[u]:void 0,i=u=>{let d=r(u);return d?d.label:u??e.unknown.label},n=u=>`\u05D4${i(u)}`,o=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?t[u]??null:null,s={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"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=l[d??""]??i(d),f=O(u.input),h=l[f]??e[f]?.label??f;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(u.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 ${P(u.values[0])}`;let d=u.values.map(h=>P(h));if(u.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 ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.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 ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let f=u.inclusive?"<=":"<",h=o(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let v=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let g=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let f=u.inclusive?">=":">",h=o(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.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 ${d.pattern}`;let p=s[d.format],f=p?.label??d.format,m=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}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 ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${S(u.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(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Pk(){return{localeError:G4()}}var K4=()=>{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"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${P(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.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":""}: ${S(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 zk(){return{localeError:K4()}}function Rk(e,t,r){return Math.abs(e)===1?t:r}function ji(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 Q4=()=>{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"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Rk(s,a.unit.one,a.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 ${ji(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${l}`}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 ${ji(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Rk(s,a.unit.one,a.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 ${ji(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${l}`}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 ${ji(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.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":""}. ${S(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ji(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 ${ji(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Ok(){return{localeError:Q4()}}var Y4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${P(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.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":""}: ${S(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 jk(){return{localeError:Y4()}}var X4=()=>{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"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${P(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.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"}: ${S(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 Dk(){return{localeError:X4()}}var e2=()=>{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"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${P(n.values[0])}`:`Opzione non valida: atteso uno tra ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.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"}: ${S(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 Nk(){return{localeError:e2()}}var t2=()=>{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"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${P(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${S(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.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":""}: ${S(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 Ck(){return{localeError:t2()}}var r2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}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 ${P(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 ${S(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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"} ${a.verb} ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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} ${a.verb} ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"-\u10D8\u10D7`:o.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 "${o.suffix}"-\u10D8\u10D7`:o.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 "${o.includes}"-\u10E1`:o.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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.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"}: ${S(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 Ak(){return{localeError:r2()}}var n2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.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 ${S(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 pu(){return{localeError:n2()}}function Mk(){return pu()}var i2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${P(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${S(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.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: ${S(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 Uk(){return{localeError:i2()}}var fa=e=>e.charAt(0).toUpperCase()+e.slice(1);function Lk(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var o2=()=>{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,o,a,s){let l=e[n]??null;return l===null?l:{unit:l.unit[o],verb:l.verb[s][a?"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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${P(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${S(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,a=t(n.origin,Lk(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${fa(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${fa(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,a=t(n.origin,Lk(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${fa(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${fa(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.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"}: ${S(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${fa(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function qk(){return{localeError:o2()}}var a2=()=>{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"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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 ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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 ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${r[o.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"}: ${S(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 Zk(){return{localeError:a2()}}var s2=()=>{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"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${P(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${S(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 Fk(){return{localeError:s2()}}var c2=()=>{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"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${P(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.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":""}: ${S(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 Vk(){return{localeError:c2()}}var l2=()=>{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"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${P(n.values[0])}`:`Ugyldig valg: forventet en av ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${S(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 Bk(){return{localeError:l2()}}var u2=()=>{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"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${P(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.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":""}: ${S(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 Hk(){return{localeError:u2()}}var d2=()=>{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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \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 ${P(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${S(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.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"}: ${S(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 Wk(){return{localeError:d2()}}var p2=()=>{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"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${P(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.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":""}: ${S(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 Jk(){return{localeError:p2()}}var m2=()=>{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"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${P(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.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":""}: ${S(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 Gk(){return{localeError:m2()}}function Kk(e,t,r,i){let n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?r:i}var f2=()=>{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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Kk(s,a.unit.one,a.unit.few,a.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 ${o}${n.maximum.toString()} ${l}`}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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Kk(s,a.unit.one,a.unit.few,a.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 ${o}${n.minimum.toString()} ${l}`}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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.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":""}: ${S(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 Qk(){return{localeError:f2()}}var h2=()=>{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"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${P(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.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"}: ${S(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 Yk(){return{localeError:h2()}}var g2=()=>{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"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${P(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.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"}: ${S(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 Xk(){return{localeError:g2()}}var y2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}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 ${P(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 ${S(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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"} ${o}${n.maximum.toString()} ${a.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"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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} ${o}${n.minimum.toString()} ${a.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} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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[o.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":""}: ${S(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 eT(){return{localeError:y2()}}var v2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.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${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.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: ${S(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 tT(){return{localeError:v2()}}var b2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${P(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.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":""}: ${S(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 rT(){return{localeError:b2()}}var _2=()=>{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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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"} ${a.verb} ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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} ${a.verb} ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.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":""}: ${S(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 mu(){return{localeError:_2()}}function nT(){return mu()}var S2=()=>{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"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${P(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${S(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.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":""}: ${S(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 iT(){return{localeError:S2()}}var x2=()=>{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"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${P(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.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":""}: ${S(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 oT(){return{localeError:x2()}}var w2=()=>{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"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.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: ${S(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 aT(){return{localeError:w2()}}var $2=()=>{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"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${P(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.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): ${S(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 sT(){return{localeError:$2()}}var k2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${P(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.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${S(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 cT(){return{localeError:k2()}}var T2=()=>{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"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${P(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.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: ${S(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 lT(){return{localeError:T2()}}var uT,hu=Symbol("ZodOutput"),gu=Symbol("ZodInput"),fu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.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 i={...this.get(r)??{}};delete i.id;let n={...i,...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 ha(){return new fu}(uT=globalThis).__zod_globalRegistry??(uT.__zod_globalRegistry=ha());var Be=globalThis.__zod_globalRegistry;function yu(e,t){return new e({type:"string",...j(t)})}function vu(e,t){return new e({type:"string",coerce:!0,...j(t)})}function ga(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function Ni(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function ya(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function va(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function ba(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function _a(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function Ci(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function Sa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function xa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function wa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function $a(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function ka(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function Ta(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function Ia(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Ea(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function Pa(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function bu(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...j(t)})}function za(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Ra(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function Oa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function ja(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Da(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function Na(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}var _u={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Su(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function xu(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function wu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function $u(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function ku(e,t){return new e({type:"number",checks:[],...j(t)})}function Tu(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}function Iu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function Eu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...j(t)})}function Pu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...j(t)})}function zu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...j(t)})}function Ru(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...j(t)})}function Ou(e,t){return new e({type:"boolean",...j(t)})}function ju(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}function Du(e,t){return new e({type:"bigint",...j(t)})}function Nu(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}function Cu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...j(t)})}function Au(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...j(t)})}function Mu(e,t){return new e({type:"symbol",...j(t)})}function Uu(e,t){return new e({type:"undefined",...j(t)})}function Lu(e,t){return new e({type:"null",...j(t)})}function qu(e){return new e({type:"any"})}function Zu(e){return new e({type:"unknown"})}function Fu(e,t){return new e({type:"never",...j(t)})}function Vu(e,t){return new e({type:"void",...j(t)})}function Bu(e,t){return new e({type:"date",...j(t)})}function Hu(e,t){return new e({type:"date",coerce:!0,...j(t)})}function Wu(e,t){return new e({type:"nan",...j(t)})}function Jt(e,t){return new Kc({check:"less_than",...j(t),value:e,inclusive:!1})}function ct(e,t){return new Kc({check:"less_than",...j(t),value:e,inclusive:!0})}function Gt(e,t){return new Qc({check:"greater_than",...j(t),value:e,inclusive:!1})}function We(e,t){return new Qc({check:"greater_than",...j(t),value:e,inclusive:!0})}function Ca(e){return Gt(0,e)}function Aa(e){return Jt(0,e)}function Ma(e){return ct(0,e)}function Ua(e){return We(0,e)}function kr(e,t){return new sh({check:"multiple_of",...j(t),value:e})}function Tr(e,t){return new uh({check:"max_size",...j(t),maximum:e})}function Kt(e,t){return new dh({check:"min_size",...j(t),minimum:e})}function Yr(e,t){return new ph({check:"size_equals",...j(t),size:e})}function Xr(e,t){return new mh({check:"max_length",...j(t),maximum:e})}function dr(e,t){return new fh({check:"min_length",...j(t),minimum:e})}function en(e,t){return new hh({check:"length_equals",...j(t),length:e})}function Dn(e,t){return new gh({check:"string_format",format:"regex",...j(t),pattern:e})}function Nn(e){return new yh({check:"string_format",format:"lowercase",...j(e)})}function Cn(e){return new vh({check:"string_format",format:"uppercase",...j(e)})}function An(e,t){return new bh({check:"string_format",format:"includes",...j(t),includes:e})}function Mn(e,t){return new _h({check:"string_format",format:"starts_with",...j(t),prefix:e})}function Un(e,t){return new Sh({check:"string_format",format:"ends_with",...j(t),suffix:e})}function La(e,t,r){return new xh({check:"property",property:e,schema:t,...j(r)})}function Ln(e,t){return new wh({check:"mime_type",mime:e,...j(t)})}function jt(e){return new $h({check:"overwrite",tx:e})}function qn(e){return jt(t=>t.normalize(e))}function Zn(){return jt(e=>e.trim())}function Fn(){return jt(e=>e.toLowerCase())}function Vn(){return jt(e=>e.toUpperCase())}function Ai(){return jt(e=>If(e))}function Ph(e,t,r){return new e({type:"array",element:t,...j(r)})}function E2(e,t,r){return new e({type:"union",options:t,...j(r)})}function P2(e,t,r){return new e({type:"union",options:t,inclusive:!1,...j(r)})}function z2(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...j(i)})}function R2(e,t,r){return new e({type:"intersection",left:t,right:r})}function O2(e,t,r,i){let n=r instanceof K,o=n?i:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...j(o)})}function j2(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...j(i)})}function D2(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...j(i)})}function N2(e,t,r){return new e({type:"set",valueType:t,...j(r)})}function C2(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...j(r)})}function A2(e,t,r){return new e({type:"enum",entries:t,...j(r)})}function M2(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...j(r)})}function Ju(e,t){return new e({type:"file",...j(t)})}function U2(e,t){return new e({type:"transform",transform:t})}function L2(e,t){return new e({type:"optional",innerType:t})}function q2(e,t){return new e({type:"nullable",innerType:t})}function Z2(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Ac(r)}})}function F2(e,t,r){return new e({type:"nonoptional",innerType:t,...j(r)})}function V2(e,t){return new e({type:"success",innerType:t})}function B2(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function H2(e,t,r){return new e({type:"pipe",in:t,out:r})}function W2(e,t){return new e({type:"readonly",innerType:t})}function J2(e,t,r){return new e({type:"template_literal",parts:t,...j(r)})}function G2(e,t){return new e({type:"lazy",getter:t})}function K2(e,t){return new e({type:"promise",innerType:t})}function Gu(e,t,r){let i=j(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function Ku(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}function Qu(e){let t=dT(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(xi(i,r.value,t._zod.def));else{let n=i;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(xi(n))}},e(r.value,r)));return t}function dT(e,t){let r=new we({check:"custom",...j(t)});return r._zod.check=e,r}function Yu(e){let t=new we({check:"describe"});return t._zod.onattach=[r=>{let i=Be.get(r)??{};Be.add(r,{...i,description:e})}],t._zod.check=()=>{},t}function Xu(e){let t=new we({check:"meta"});return t._zod.onattach=[r=>{let i=Be.get(r)??{};Be.add(r,{...i,...e})}],t._zod.check=()=>{},t}function ed(e,t){let r=j(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),n=n.map(h=>typeof h=="string"?h.toLowerCase():h));let o=new Set(i),a=new Set(n),s=e.Codec??Oi,l=e.Boolean??zi,u=e.String??Qr,d=new u({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),f=new s({type:"pipe",in:d,out:p,transform:((h,m)=>{let g=h;return r.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:a.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((h,m)=>h===!0?i[0]||"true":n[0]||"false"),error:r.error});return f}function Bn(e,t,r,i={}){let n=j(i),o={...j(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(o.pattern=r),new e(o)}function tn(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??Be,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 _e(e,t,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let f=a.schema,h=t.processors[n.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,f,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),_e(p,t,d),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&lt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function rn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let l=i.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,f=e.external.uri??(m=>m);if(p)return{ref:f(p)};let h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${f("__shared")}#/${s}/${h}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);let d=s.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
74
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");let w=h.compile();return($,E)=>w(f,$,E)},o,a=On,s=!Xo.jitless,u=s&&Rf.value,d=t.catchall,p;e._zod.parse=(f,h)=>{p??(p=i.value);let m=f.value;return a(m)?s&&u&&h?.async===!1&&h.jitless!==!0?(o||(o=n(t.shape)),f=o(f,h),d?Ek([],m,f,h,p,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function hk(e,t,r,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let n=e.filter(o=>!Kr(o));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(o=>o.issues.map(a=>vt(a,i,Me())))}),t)}var Oi=b("$ZodUnion",(e,t)=>{K.init(e,t),te(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),te(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),te(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),te(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>na(o.source)).join("|")})$`)}});let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(c=>hk(c,n,e,o)):hk(s,n,e,o)}});function gk(e,t,r,i){let n=e.filter(o=>o.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(o=>o.issues.map(a=>vt(a,i,Me())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Zl=b("$ZodXor",(e,t)=>{Oi.init(e,t),t.inclusive=!1;let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);u instanceof Promise?(s.push(u),a=!0):s.push(u)}return a?Promise.all(s).then(c=>gk(c,n,e,o)):gk(s,n,e,o)}}),Fl=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Oi.init(e,t);let r=e._zod.parse;te(e._zod,"propValues",()=>{let n={};for(let o of t.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[s,c]of Object.entries(a)){n[s]||(n[s]=new Set);for(let u of c)n[s].add(u)}}return n});let i=xi(()=>{let n=t.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,a)}}return o});e._zod.parse=(n,o)=>{let a=n.value;if(!On(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=i.value.get(a?.[t.discriminator]);return s?s._zod.run(n,o):t.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),n)}}),Vl=b("$ZodIntersection",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),a=t.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,u])=>yk(r,c,u)):yk(r,o,a)}});function Ph(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(Gr(e)&&Gr(t)){let r=Object.keys(t),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let a=Ph(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.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 i=0;i<e.length;i++){let n=e[i],o=t[i],a=Ph(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function yk(e,t,r){let i=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let c of s.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else e.issues.push(s);let o=[...i].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&n&&e.issues.push({...n,keys:o}),Kr(e))return e;let a=Ph(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var ma=b("$ZodTuple",(e,t)=>{K.init(e,t);let r=t.items;e._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),c=s===-1?0:r.length-s;if(!t.rest){let d=o.length>r.length,p=o.length<c-1;if(d||p)return i.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),i}let u=-1;for(let d of r){if(u++,u>=o.length&&u>=c)continue;let p=d._zod.run({value:o[u],issues:[]},n);p instanceof Promise?a.push(p.then(f=>el(f,i,u))):el(p,i,u)}if(t.rest){let d=o.slice(r.length);for(let p of d){u++;let f=t.rest._zod.run({value:p,issues:[]},n);f instanceof Promise?a.push(f.then(h=>el(h,i,u))):el(f,i,u)}}return a.length?Promise.all(a).then(()=>i):i}});function el(e,t,r){e.issues.length&&t.issues.push(...Tt(r,e.issues)),t.value[r]=e.value}var Bl=b("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Gr(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let d=t.valueType._zod.run({value:n[u],issues:[]},i);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...Tt(u,p.issues)),r.value[u]=p.value})):(d.issues.length&&r.issues.push(...Tt(u,d.issues)),r.value[u]=d.value)}let c;for(let u in n)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let c=t.keyType._zod.run({value:s,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Qc.test(s)&&c.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>vt(p,i,Me())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:n[s],issues:[]},i);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&r.issues.push(...Tt(s,p.issues)),r.value[c.value]=p.value})):(d.issues.length&&r.issues.push(...Tt(s,d.issues)),r.value[c.value]=d.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Hl=b("$ZodMap",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[a,s]of n){let c=t.keyType._zod.run({value:a,issues:[]},i),u=t.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([d,p])=>{vk(d,p,r,a,n,e,i)})):vk(c,u,r,a,n,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function vk(e,t,r,i,n,o,a){e.issues.length&&(ia.has(typeof i)?r.issues.push(...Tt(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(s=>vt(s,a,Me()))})),t.issues.length&&(ia.has(typeof i)?r.issues.push(...Tt(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map(s=>vt(s,a,Me()))})),r.value.set(e.value,t.value)}var Wl=b("$ZodSet",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(c=>bk(c,r))):bk(s,r)}return o.length?Promise.all(o).then(()=>r):r}});function bk(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Jl=b("$ZodEnum",(e,t)=>{K.init(e,t);let r=ra(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(n=>ia.has(typeof n)).map(n=>typeof n=="string"?jt(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Gl=b("$ZodLiteral",(e,t)=>{if(K.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(i=>typeof i=="string"?jt(i):i?jt(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),Kl=b("$ZodFile",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Ql=b("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Hr(e.constructor.name);let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new Jt;return r.value=n,r}});function _k(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var fa=b("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${na(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>_k(o,r.value)):_k(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),Yl=b("$ZodExactOptional",(e,t)=>{fa.init(e,t),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Xl=b("$ZodNullable",(e,t)=>{K.init(e,t),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${na(r.source)}|null)$`):void 0}),te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),eu=b("$ZodDefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Sk(o,t)):Sk(n,t)}});function Sk(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var tu=b("$ZodPrefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),ru=b("$ZodNonOptional",(e,t)=>{K.init(e,t),te(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>xk(o,e)):xk(n,e)}});function xk(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 nu=b("$ZodSuccess",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Hr("ZodSuccess");let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),iu=b("$ZodCatch",(e,t)=>{K.init(e,t),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>vt(a,i,Me()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(o=>vt(o,i,Me()))},input:r.value}),r.issues=[]),r)}}),ou=b("$ZodNaN",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),au=b("$ZodPipe",(e,t)=>{K.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(e._zod,"optout",()=>t.out._zod.optout),te(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(a=>tl(a,t.in,i)):tl(o,t.in,i)}let n=t.in._zod.run(r,i);return n instanceof Promise?n.then(o=>tl(o,t.out,i)):tl(n,t.out,i)}});function tl(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var ji=b("$ZodCodec",(e,t)=>{K.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(e._zod,"optout",()=>t.out._zod.optout),te(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(r,i);return o instanceof Promise?o.then(a=>rl(a,t,i)):rl(o,t,i)}else{let o=t.out._zod.run(r,i);return o instanceof Promise?o.then(a=>rl(a,t,i)):rl(o,t,i)}}});function rl(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(o=>nl(e,o,t.out,r)):nl(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(o=>nl(e,o,t.in,r)):nl(e,n,t.in,r)}}function nl(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}var su=b("$ZodReadonly",(e,t)=>{K.init(e,t),te(e._zod,"propValues",()=>t.innerType._zod.propValues),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"optin",()=>t.innerType?._zod?.optin),te(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(wk):wk(n)}});function wk(e){return e.value=Object.freeze(e.value),e}var cu=b("$ZodTemplateLiteral",(e,t)=>{K.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,a))}else if(i===null||Of.has(typeof i))r.push(jt(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),lu=b("$ZodFunction",(e,t)=>(K.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(...i){let n=e._def.input?jn(e._def.input,i):i,o=Reflect.apply(r,this,n);return e._def.output?jn(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=e._def.input?await Dn(e._def.input,i):i,o=await Reflect.apply(r,this,n);return e._def.output?await Dn(e._def.output,o):o}},e._zod.parse=(r,i)=>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 i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new ma({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),uu=b("$ZodPromise",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),du=b("$ZodLazy",(e,t)=>{K.init(e,t),te(e._zod,"innerType",()=>t.getter()),te(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),te(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),te(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),te(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),pu=b("$ZodCustom",(e,t)=>{we.init(e,t),K.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(o=>$k(o,r,i,e));$k(n,r,i,e)}});function $k(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(wi(n))}}var Ni={};$r(Ni,{ar:()=>Pk,az:()=>zk,be:()=>Ok,bg:()=>jk,ca:()=>Dk,cs:()=>Nk,da:()=>Ck,de:()=>Ak,en:()=>mu,eo:()=>Mk,es:()=>Uk,fa:()=>Lk,fi:()=>qk,fr:()=>Zk,frCA:()=>Fk,he:()=>Vk,hu:()=>Bk,hy:()=>Wk,id:()=>Jk,is:()=>Gk,it:()=>Kk,ja:()=>Qk,ka:()=>Yk,kh:()=>Xk,km:()=>fu,ko:()=>eT,lt:()=>rT,mk:()=>nT,ms:()=>iT,nl:()=>oT,no:()=>aT,ota:()=>sT,pl:()=>lT,ps:()=>cT,pt:()=>uT,ru:()=>pT,sl:()=>mT,sv:()=>fT,ta:()=>hT,th:()=>gT,tr:()=>yT,ua:()=>vT,uk:()=>hu,ur:()=>bT,uz:()=>_T,vi:()=>ST,yo:()=>$T,zhCN:()=>xT,zhTW:()=>wT});var H4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}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 ${P(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: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?` \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"} ${o} ${n.maximum.toString()} ${a.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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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 ${o} ${n.minimum.toString()} ${a.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 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${r[o.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":""}: ${S(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 Pk(){return{localeError:H4()}}var W4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${P(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.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":""}: ${S(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 zk(){return{localeError:W4()}}function Rk(e,t,r,i){let n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?r:i}var J4=()=>{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"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=Rk(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${n.maximum.toString()} ${c}`}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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=Rk(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${n.minimum.toString()} ${c}`}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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.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"}: ${S(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 Ok(){return{localeError:J4()}}var G4=()=>{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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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 ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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 ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[o.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":""}: ${S(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 jk(){return{localeError:G4()}}var K4=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${P(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${S(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.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":""}: ${S(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 Dk(){return{localeError:K4()}}var Q4=()=>{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"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${P(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.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: ${S(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 Nk(){return{localeError:Q4()}}var Y4=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${P(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=i[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=i[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${S(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 Ck(){return{localeError:Y4()}}var X4=()=>{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"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${P(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.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"}: ${S(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 Ak(){return{localeError:X4()}}var e2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${P(n.values[0])}`:`Invalid option: expected one of ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.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":""}: ${S(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 mu(){return{localeError:e2()}}var t2=()=>{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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${P(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.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":""}: ${S(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 Mk(){return{localeError:t2()}}var r2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${P(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${o}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.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":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function Uk(){return{localeError:r2()}}var n2=()=>{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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s} \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 ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \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 ${P(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 ${S(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.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: ${S(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 Lk(){return{localeError:n2()}}var i2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${P(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.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"}: ${S(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 qk(){return{localeError:i2()}}var o2=()=>{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"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${P(n.values[0])} attendu`:`Option invalide : une valeur parmi ${S(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.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":""} : ${S(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 Zk(){return{localeError:o2()}}var a2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${P(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.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":""} : ${S(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 Fk(){return{localeError:a2()}}var s2=()=>{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=u=>u?e[u]:void 0,i=u=>{let d=r(u);return d?d.label:u??e.unknown.label},n=u=>`\u05D4${i(u)}`,o=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?t[u]??null:null,s={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"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=c[d??""]??i(d),f=O(u.input),h=c[f]??e[f]?.label??f;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(u.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 ${P(u.values[0])}`;let d=u.values.map(h=>P(h));if(u.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 ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.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 ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let f=u.inclusive?"<=":"<",h=o(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let v=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let g=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let f=u.inclusive?">=":">",h=o(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${h} ${f}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.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 ${d.pattern}`;let p=s[d.format],f=p?.label??d.format,m=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}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 ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${S(u.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(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Vk(){return{localeError:s2()}}var c2=()=>{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"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${P(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.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":""}: ${S(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 Bk(){return{localeError:c2()}}function Hk(e,t,r){return Math.abs(e)===1?t:r}function Di(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 l2=()=>{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"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=Hk(s,a.unit.one,a.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 ${Di(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${c}`}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 ${Di(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=Hk(s,a.unit.one,a.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 ${Di(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${c}`}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 ${Di(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.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":""}. ${S(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Di(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 ${Di(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Wk(){return{localeError:l2()}}var u2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${P(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.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":""}: ${S(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 Jk(){return{localeError:u2()}}var d2=()=>{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"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${P(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.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"}: ${S(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 Gk(){return{localeError:d2()}}var p2=()=>{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"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${P(n.values[0])}`:`Opzione non valida: atteso uno tra ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.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"}: ${S(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 Kk(){return{localeError:p2()}}var m2=()=>{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"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${P(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${S(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.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":""}: ${S(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 Qk(){return{localeError:m2()}}var f2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}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 ${P(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 ${S(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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"} ${a.verb} ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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} ${a.verb} ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"-\u10D8\u10D7`:o.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 "${o.suffix}"-\u10D8\u10D7`:o.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 "${o.includes}"-\u10E1`:o.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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.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"}: ${S(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 Yk(){return{localeError:f2()}}var h2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.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 ${S(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 fu(){return{localeError:h2()}}function Xk(){return fu()}var g2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${P(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${S(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.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: ${S(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 eT(){return{localeError:g2()}}var ha=e=>e.charAt(0).toUpperCase()+e.slice(1);function tT(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var y2=()=>{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,o,a,s){let c=e[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[s][a?"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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${P(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${S(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,a=t(n.origin,tT(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${ha(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${ha(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,a=t(n.origin,tT(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${ha(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${ha(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.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"}: ${S(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${ha(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function rT(){return{localeError:y2()}}var v2=()=>{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"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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 ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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 ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${r[o.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"}: ${S(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 nT(){return{localeError:v2()}}var b2=()=>{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"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${P(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${S(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 iT(){return{localeError:b2()}}var _2=()=>{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"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${P(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.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":""}: ${S(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 oT(){return{localeError:_2()}}var S2=()=>{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"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${P(n.values[0])}`:`Ugyldig valg: forventet en av ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${S(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 aT(){return{localeError:S2()}}var x2=()=>{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"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${P(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.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":""}: ${S(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 sT(){return{localeError:x2()}}var w2=()=>{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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \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 ${P(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${S(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.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"}: ${S(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 cT(){return{localeError:w2()}}var $2=()=>{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"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${P(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.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":""}: ${S(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 lT(){return{localeError:$2()}}var k2=()=>{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"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${P(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.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":""}: ${S(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 uT(){return{localeError:k2()}}function dT(e,t,r,i){let n=Math.abs(e),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?r:i}var T2=()=>{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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=dT(s,a.unit.one,a.unit.few,a.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 ${o}${n.maximum.toString()} ${c}`}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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=dT(s,a.unit.one,a.unit.few,a.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 ${o}${n.minimum.toString()} ${c}`}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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.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":""}: ${S(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:T2()}}var I2=()=>{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"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${P(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.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"}: ${S(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 mT(){return{localeError:I2()}}var E2=()=>{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"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${P(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.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"}: ${S(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 fT(){return{localeError:E2()}}var P2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}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 ${P(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 ${S(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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"} ${o}${n.maximum.toString()} ${a.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"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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} ${o}${n.minimum.toString()} ${a.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} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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[o.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":""}: ${S(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 hT(){return{localeError:P2()}}var z2=()=>{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"},i={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 o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.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${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.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: ${S(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 gT(){return{localeError:z2()}}var R2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${P(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.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":""}: ${S(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 yT(){return{localeError:R2()}}var O2=()=>{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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}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 ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\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"} ${a.verb} ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\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} ${a.verb} ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.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":""}: ${S(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 hu(){return{localeError:O2()}}function vT(){return hu()}var j2=()=>{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"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${P(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${S(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.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 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.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 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.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":""}: ${S(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 bT(){return{localeError:j2()}}var D2=()=>{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"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${P(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.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":""}: ${S(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 _T(){return{localeError:D2()}}var N2=()=>{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"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${P(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 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.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: ${S(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 ST(){return{localeError:N2()}}var C2=()=>{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"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${P(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.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): ${S(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 xT(){return{localeError:C2()}}var A2=()=>{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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${P(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.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${S(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 wT(){return{localeError:A2()}}var M2=()=>{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"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=O(n.input),s=i[a]??a;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 ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${P(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${S(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.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: ${S(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 $T(){return{localeError:M2()}}var kT,yu=Symbol("ZodOutput"),vu=Symbol("ZodInput"),gu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.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 i={...this.get(r)??{}};delete i.id;let n={...i,...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 ga(){return new gu}(kT=globalThis).__zod_globalRegistry??(kT.__zod_globalRegistry=ga());var We=globalThis.__zod_globalRegistry;function bu(e,t){return new e({type:"string",...j(t)})}function _u(e,t){return new e({type:"string",coerce:!0,...j(t)})}function ya(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...j(t)})}function Ci(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...j(t)})}function va(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...j(t)})}function ba(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(t)})}function _a(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(t)})}function Sa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(t)})}function Ai(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}function xa(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...j(t)})}function wa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(t)})}function $a(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...j(t)})}function ka(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(t)})}function Ta(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...j(t)})}function Ia(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...j(t)})}function Ea(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(t)})}function Pa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(t)})}function za(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(t)})}function Su(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...j(t)})}function Ra(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(t)})}function Oa(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(t)})}function ja(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...j(t)})}function Da(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...j(t)})}function Na(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...j(t)})}function Ca(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...j(t)})}var xu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function wu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(t)})}function $u(e,t){return new e({type:"string",format:"date",check:"string_format",...j(t)})}function ku(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...j(t)})}function Tu(e,t){return new e({type:"string",format:"duration",check:"string_format",...j(t)})}function Iu(e,t){return new e({type:"number",checks:[],...j(t)})}function Eu(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}function Pu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}function zu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...j(t)})}function Ru(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...j(t)})}function Ou(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...j(t)})}function ju(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...j(t)})}function Du(e,t){return new e({type:"boolean",...j(t)})}function Nu(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}function Cu(e,t){return new e({type:"bigint",...j(t)})}function Au(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}function Mu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...j(t)})}function Uu(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...j(t)})}function Lu(e,t){return new e({type:"symbol",...j(t)})}function qu(e,t){return new e({type:"undefined",...j(t)})}function Zu(e,t){return new e({type:"null",...j(t)})}function Fu(e){return new e({type:"any"})}function Vu(e){return new e({type:"unknown"})}function Bu(e,t){return new e({type:"never",...j(t)})}function Hu(e,t){return new e({type:"void",...j(t)})}function Wu(e,t){return new e({type:"date",...j(t)})}function Ju(e,t){return new e({type:"date",coerce:!0,...j(t)})}function Gu(e,t){return new e({type:"nan",...j(t)})}function Gt(e,t){return new Yc({check:"less_than",...j(t),value:e,inclusive:!1})}function lt(e,t){return new Yc({check:"less_than",...j(t),value:e,inclusive:!0})}function Kt(e,t){return new Xc({check:"greater_than",...j(t),value:e,inclusive:!1})}function Ge(e,t){return new Xc({check:"greater_than",...j(t),value:e,inclusive:!0})}function Aa(e){return Kt(0,e)}function Ma(e){return Gt(0,e)}function Ua(e){return lt(0,e)}function La(e){return Ge(0,e)}function Tr(e,t){return new uh({check:"multiple_of",...j(t),value:e})}function Ir(e,t){return new mh({check:"max_size",...j(t),maximum:e})}function Qt(e,t){return new fh({check:"min_size",...j(t),minimum:e})}function en(e,t){return new hh({check:"size_equals",...j(t),size:e})}function tn(e,t){return new gh({check:"max_length",...j(t),maximum:e})}function pr(e,t){return new yh({check:"min_length",...j(t),minimum:e})}function rn(e,t){return new vh({check:"length_equals",...j(t),length:e})}function Cn(e,t){return new bh({check:"string_format",format:"regex",...j(t),pattern:e})}function An(e){return new _h({check:"string_format",format:"lowercase",...j(e)})}function Mn(e){return new Sh({check:"string_format",format:"uppercase",...j(e)})}function Un(e,t){return new xh({check:"string_format",format:"includes",...j(t),includes:e})}function Ln(e,t){return new wh({check:"string_format",format:"starts_with",...j(t),prefix:e})}function qn(e,t){return new $h({check:"string_format",format:"ends_with",...j(t),suffix:e})}function qa(e,t,r){return new kh({check:"property",property:e,schema:t,...j(r)})}function Zn(e,t){return new Th({check:"mime_type",mime:e,...j(t)})}function Dt(e){return new Ih({check:"overwrite",tx:e})}function Fn(e){return Dt(t=>t.normalize(e))}function Vn(){return Dt(e=>e.trim())}function Bn(){return Dt(e=>e.toLowerCase())}function Hn(){return Dt(e=>e.toUpperCase())}function Mi(){return Dt(e=>zf(e))}function Oh(e,t,r){return new e({type:"array",element:t,...j(r)})}function L2(e,t,r){return new e({type:"union",options:t,...j(r)})}function q2(e,t,r){return new e({type:"union",options:t,inclusive:!1,...j(r)})}function Z2(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...j(i)})}function F2(e,t,r){return new e({type:"intersection",left:t,right:r})}function V2(e,t,r,i){let n=r instanceof K,o=n?i:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...j(o)})}function B2(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...j(i)})}function H2(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...j(i)})}function W2(e,t,r){return new e({type:"set",valueType:t,...j(r)})}function J2(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...j(r)})}function G2(e,t,r){return new e({type:"enum",entries:t,...j(r)})}function K2(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...j(r)})}function Ku(e,t){return new e({type:"file",...j(t)})}function Q2(e,t){return new e({type:"transform",transform:t})}function Y2(e,t){return new e({type:"optional",innerType:t})}function X2(e,t){return new e({type:"nullable",innerType:t})}function e6(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Uc(r)}})}function t6(e,t,r){return new e({type:"nonoptional",innerType:t,...j(r)})}function r6(e,t){return new e({type:"success",innerType:t})}function n6(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function i6(e,t,r){return new e({type:"pipe",in:t,out:r})}function o6(e,t){return new e({type:"readonly",innerType:t})}function a6(e,t,r){return new e({type:"template_literal",parts:t,...j(r)})}function s6(e,t){return new e({type:"lazy",getter:t})}function c6(e,t){return new e({type:"promise",innerType:t})}function Qu(e,t,r){let i=j(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function Yu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...j(r)})}function Xu(e){let t=TT(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(wi(i,r.value,t._zod.def));else{let n=i;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 TT(e,t){let r=new we({check:"custom",...j(t)});return r._zod.check=e,r}function ed(e){let t=new we({check:"describe"});return t._zod.onattach=[r=>{let i=We.get(r)??{};We.add(r,{...i,description:e})}],t._zod.check=()=>{},t}function td(e){let t=new we({check:"meta"});return t._zod.onattach=[r=>{let i=We.get(r)??{};We.add(r,{...i,...e})}],t._zod.check=()=>{},t}function rd(e,t){let r=j(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),n=n.map(h=>typeof h=="string"?h.toLowerCase():h));let o=new Set(i),a=new Set(n),s=e.Codec??ji,c=e.Boolean??Ri,u=e.String??Xr,d=new u({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),f=new s({type:"pipe",in:d,out:p,transform:((h,m)=>{let g=h;return r.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:a.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((h,m)=>h===!0?i[0]||"true":n[0]||"false"),error:r.error});return f}function Wn(e,t,r,i={}){let n=j(i),o={...j(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(o.pattern=r),new e(o)}function nn(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??We,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 _e(e,t,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let f=a.schema,h=t.processors[n.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,f,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),_e(p,t,d),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&ut(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function on(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=i.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,f=e.external.uri??(m=>m);if(p)return{ref:f(p)};let h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${f("__shared")}#/${s}/${h}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);let d=s.schema;for(let p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
75
75
 
76
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&e.reused==="ref"){o(a);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 i=a=>{let s=e.seen.get(a);if(s.ref===null)return;let l=s.def??s.schema,u={...l},d=s.ref;if(s.ref=null,d){i(d);let f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,u),a._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(h.$ref&&f.def)for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}e.override({zodSchema:a,jsonSchema:l,path:s.path??[]})};for(let a of[...e.seen.entries()].reverse())i(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 o=e.external?.defs??{};for(let a of e.seen.entries()){let s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Mi(t,"input",e.processors),output:Mi(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function lt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return lt(i.element,r);if(i.type==="set")return lt(i.valueType,r);if(i.type==="lazy")return lt(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return lt(i.innerType,r);if(i.type==="intersection")return lt(i.left,r)||lt(i.right,r);if(i.type==="record"||i.type==="map")return lt(i.keyType,r)||lt(i.valueType,r);if(i.type==="pipe")return lt(i.in,r)||lt(i.out,r);if(i.type==="object"){for(let n in i.shape)if(lt(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(lt(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(lt(n,r))return!0;return!!(i.rest&&lt(i.rest,r))}return!1}var zh=(e,t={})=>r=>{let i=tn({...r,processors:t});return _e(e,i),rn(i,e),nn(i,e)},Mi=(e,t,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},a=tn({...n??{},target:o,io:t,processors:r});return _e(e,a),rn(a,e),nn(a,e)};var Q2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Rh=(e,t,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:a,format:s,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=Q2[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Oh=(e,t,r,i)=>{let n=r,{minimum:o,maximum:a,format:s,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d),typeof o=="number"&&(n.minimum=o,typeof d=="number"&&t.target!=="draft-04"&&(d>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),typeof a=="number"&&(n.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof l=="number"&&(n.multipleOf=l)},jh=(e,t,r,i)=>{r.type="boolean"},Dh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Nh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Ch=(e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ah=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Mh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Uh=(e,t,r,i)=>{r.not={}},Lh=(e,t,r,i)=>{},qh=(e,t,r,i)=>{},Zh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Fh=(e,t,r,i)=>{let n=e._zod.def,o=ta(n.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},Vh=(e,t,r,i)=>{let n=e._zod.def,o=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},Bh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Hh=(e,t,r,i)=>{let n=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},Wh=(e,t,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),l?l.length===1?(o.contentMediaType=l[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,o)},Jh=(e,t,r,i)=>{r.type="boolean"},Gh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Kh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Qh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Yh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Xh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},eg=(e,t,r,i)=>{let n=r,o=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=_e(o.element,t,{...i,path:[...i.path,"items"]})},tg=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object",n.properties={};let a=o.shape;for(let u in a)n.properties[u]=_e(a[u],t,{...i,path:[...i.path,"properties",u]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{let d=o.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=_e(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},rd=(e,t,r,i)=>{let n=e._zod.def,o=n.inclusive===!1,a=n.options.map((s,l)=>_e(s,t,{...i,path:[...i.path,o?"oneOf":"anyOf",l]}));o?r.oneOf=a:r.anyOf=a},rg=(e,t,r,i)=>{let n=e._zod.def,o=_e(n.left,t,{...i,path:[...i.path,"allOf",0]}),a=_e(n.right,t,{...i,path:[...i.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,l=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=l},ng=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=o.items.map((f,h)=>_e(f,t,{...i,path:[...i.path,a,h]})),u=o.rest?_e(o.rest,t,{...i,path:[...i.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},ig=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object";let a=o.keyType,l=a._zod.bag?.patterns;if(o.mode==="loose"&&l&&l.size>0){let d=_e(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let p of l)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=_e(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=_e(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let u=a._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},og=(e,t,r,i)=>{let n=e._zod.def,o=_e(n.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},ag=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},sg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},cg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},lg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},ug=(e,t,r,i)=>{let n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;_e(o,t,i);let a=t.seen.get(e);a.ref=o},dg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.readOnly=!0},pg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},nd=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},mg=(e,t,r,i)=>{let n=e._zod.innerType;_e(n,t,i);let o=t.seen.get(e);o.ref=n},td={string:Rh,number:Oh,boolean:jh,bigint:Dh,symbol:Nh,null:Ch,undefined:Ah,void:Mh,never:Uh,any:Lh,unknown:qh,date:Zh,enum:Fh,literal:Vh,nan:Bh,template_literal:Hh,file:Wh,success:Jh,custom:Gh,function:Kh,transform:Qh,map:Yh,set:Xh,array:eg,object:tg,union:rd,intersection:rg,tuple:ng,record:ig,nullable:og,nonoptional:ag,default:sg,prefault:cg,catch:lg,pipe:ug,readonly:dg,promise:pg,optional:nd,lazy:mg};function Hn(e,t){if("_idmap"in e){let i=e,n=tn({...t,processors:td}),o={};for(let l of i._idmap.entries()){let[u,d]=l;_e(d,n)}let a={},s={registry:i,uri:t?.uri,defs:o};n.external=s;for(let l of i._idmap.entries()){let[u,d]=l;rn(n,d),a[u]=nn(n,d)}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:o}}return{schemas:a}}let r=tn({...t,processors:td});return _e(e,r),rn(r,e),nn(r,e)}var id=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=tn({processors:td,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 _e(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)),rn(this.ctx,t);let i=nn(this.ctx,t),{"~standard":n,...o}=i;return o}};var pT={};var qa={};wr(qa,{ZodAny:()=>Dg,ZodArray:()=>Mg,ZodBase64:()=>$d,ZodBase64URL:()=>kd,ZodBigInt:()=>Vi,ZodBigIntFormat:()=>Ed,ZodBoolean:()=>Fi,ZodCIDRv4:()=>xd,ZodCIDRv6:()=>wd,ZodCUID:()=>hd,ZodCUID2:()=>gd,ZodCatch:()=>iy,ZodCodec:()=>jd,ZodCustom:()=>Qa,ZodCustomStringFormat:()=>qi,ZodDate:()=>Ha,ZodDefault:()=>Yg,ZodDiscriminatedUnion:()=>Lg,ZodE164:()=>Td,ZodEmail:()=>pd,ZodEmoji:()=>md,ZodEnum:()=>Ui,ZodExactOptional:()=>Gg,ZodFile:()=>Wg,ZodFunction:()=>my,ZodGUID:()=>Za,ZodIPv4:()=>_d,ZodIPv6:()=>Sd,ZodIntersection:()=>qg,ZodJWT:()=>Id,ZodKSUID:()=>bd,ZodLazy:()=>uy,ZodLiteral:()=>Hg,ZodMAC:()=>zg,ZodMap:()=>Vg,ZodNaN:()=>ay,ZodNanoID:()=>fd,ZodNever:()=>Cg,ZodNonOptional:()=>Rd,ZodNull:()=>jg,ZodNullable:()=>Qg,ZodNumber:()=>Zi,ZodNumberFormat:()=>Wn,ZodObject:()=>Wa,ZodOptional:()=>Wi,ZodPipe:()=>Od,ZodPrefault:()=>ey,ZodPromise:()=>py,ZodReadonly:()=>sy,ZodRecord:()=>Ka,ZodSet:()=>Bg,ZodString:()=>Li,ZodStringFormat:()=>$e,ZodSuccess:()=>ny,ZodSymbol:()=>Rg,ZodTemplateLiteral:()=>ly,ZodTransform:()=>Jg,ZodTuple:()=>Zg,ZodType:()=>re,ZodULID:()=>yd,ZodURL:()=>Ba,ZodUUID:()=>pr,ZodUndefined:()=>Og,ZodUnion:()=>Ja,ZodUnknown:()=>Ng,ZodVoid:()=>Ag,ZodXID:()=>vd,ZodXor:()=>Ug,_ZodString:()=>dd,_default:()=>Xg,_function:()=>hI,any:()=>QT,array:()=>se,base64:()=>DT,base64url:()=>NT,bigint:()=>HT,boolean:()=>Ue,catch:()=>oy,check:()=>gI,cidrv4:()=>OT,cidrv6:()=>jT,codec:()=>pI,cuid:()=>$T,cuid2:()=>kT,custom:()=>Dd,date:()=>XT,describe:()=>yI,discriminatedUnion:()=>Ga,e164:()=>CT,email:()=>fT,emoji:()=>xT,enum:()=>Ge,exactOptional:()=>Kg,file:()=>cI,float32:()=>ZT,float64:()=>FT,function:()=>hI,guid:()=>hT,hash:()=>qT,hex:()=>LT,hostname:()=>UT,httpUrl:()=>ST,instanceof:()=>bI,int:()=>ud,int32:()=>VT,int64:()=>WT,intersection:()=>Hi,ipv4:()=>PT,ipv6:()=>RT,json:()=>SI,jwt:()=>AT,keyof:()=>eI,ksuid:()=>ET,lazy:()=>dy,literal:()=>F,looseObject:()=>Je,looseRecord:()=>iI,mac:()=>zT,map:()=>oI,meta:()=>vI,nan:()=>dI,nanoid:()=>wT,nativeEnum:()=>sI,never:()=>Pd,nonoptional:()=>ry,null:()=>Bi,nullable:()=>Fa,nullish:()=>lI,number:()=>ve,object:()=>U,optional:()=>ze,partialRecord:()=>nI,pipe:()=>Va,prefault:()=>ty,preprocess:()=>Ya,promise:()=>fI,readonly:()=>cy,record:()=>Ie,refine:()=>fy,set:()=>aI,strictObject:()=>tI,string:()=>x,stringFormat:()=>MT,stringbool:()=>_I,success:()=>uI,superRefine:()=>hy,symbol:()=>GT,templateLiteral:()=>mI,transform:()=>zd,tuple:()=>Fg,uint32:()=>BT,uint64:()=>JT,ulid:()=>TT,undefined:()=>KT,union:()=>xe,unknown:()=>ke,url:()=>_T,uuid:()=>gT,uuidv4:()=>yT,uuidv6:()=>vT,uuidv7:()=>bT,void:()=>YT,xid:()=>IT,xor:()=>rI});var od={};wr(od,{endsWith:()=>Un,gt:()=>Gt,gte:()=>We,includes:()=>An,length:()=>en,lowercase:()=>Nn,lt:()=>Jt,lte:()=>ct,maxLength:()=>Xr,maxSize:()=>Tr,mime:()=>Ln,minLength:()=>dr,minSize:()=>Kt,multipleOf:()=>kr,negative:()=>Aa,nonnegative:()=>Ua,nonpositive:()=>Ma,normalize:()=>qn,overwrite:()=>jt,positive:()=>Ca,property:()=>La,regex:()=>Dn,size:()=>Yr,slugify:()=>Ai,startsWith:()=>Mn,toLowerCase:()=>Fn,toUpperCase:()=>Vn,trim:()=>Zn,uppercase:()=>Cn});var on={};wr(on,{ZodISODate:()=>sd,ZodISODateTime:()=>ad,ZodISODuration:()=>ld,ZodISOTime:()=>cd,date:()=>hg,datetime:()=>fg,duration:()=>yg,time:()=>gg});var ad=b("ZodISODateTime",(e,t)=>{fl.init(e,t),$e.init(e,t)});function fg(e){return Su(ad,e)}var sd=b("ZodISODate",(e,t)=>{hl.init(e,t),$e.init(e,t)});function hg(e){return xu(sd,e)}var cd=b("ZodISOTime",(e,t)=>{gl.init(e,t),$e.init(e,t)});function gg(e){return wu(cd,e)}var ld=b("ZodISODuration",(e,t)=>{yl.init(e,t),$e.init(e,t)});function yg(e){return $u(ld,e)}var mT=(e,t)=>{aa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>$i(e,r)},flatten:{value:r=>wi(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,_i,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,_i,2)}},isEmpty:{get(){return e.issues.length===0}}})},X2=b("ZodError",mT),_t=b("ZodError",mT,{Parent:Error});var vg=ki(_t),bg=Ti(_t),_g=Ii(_t),Sg=Ei(_t),xg=Lc(_t),wg=qc(_t),$g=Zc(_t),kg=Fc(_t),Tg=Vc(_t),Ig=Bc(_t),Eg=Hc(_t),Pg=Wc(_t);var re=b("ZodType",(e,t)=>(K.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Mi(e,"input"),output:Mi(e,"output")}}),e.toJSONSchema=zh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(z.mergeDefs(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(r,i)=>Ve(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>vg(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>_g(e,r,i),e.parseAsync=async(r,i)=>bg(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Sg(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>xg(e,r,i),e.decode=(r,i)=>wg(e,r,i),e.encodeAsync=async(r,i)=>$g(e,r,i),e.decodeAsync=async(r,i)=>kg(e,r,i),e.safeEncode=(r,i)=>Tg(e,r,i),e.safeDecode=(r,i)=>Ig(e,r,i),e.safeEncodeAsync=async(r,i)=>Eg(e,r,i),e.safeDecodeAsync=async(r,i)=>Pg(e,r,i),e.refine=(r,i)=>e.check(fy(r,i)),e.superRefine=r=>e.check(hy(r)),e.overwrite=r=>e.check(jt(r)),e.optional=()=>ze(e),e.exactOptional=()=>Kg(e),e.nullable=()=>Fa(e),e.nullish=()=>ze(Fa(e)),e.nonoptional=r=>ry(e,r),e.array=()=>se(e),e.or=r=>xe([e,r]),e.and=r=>Hi(e,r),e.transform=r=>Va(e,zd(r)),e.default=r=>Xg(e,r),e.prefault=r=>ty(e,r),e.catch=r=>oy(e,r),e.pipe=r=>Va(e,r),e.readonly=()=>cy(e),e.describe=r=>{let i=e.clone();return Be.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return Be.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Be.get(e);let i=e.clone();return Be.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),dd=b("_ZodString",(e,t)=>{Qr.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Rh(e,i,n,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(Dn(...i)),e.includes=(...i)=>e.check(An(...i)),e.startsWith=(...i)=>e.check(Mn(...i)),e.endsWith=(...i)=>e.check(Un(...i)),e.min=(...i)=>e.check(dr(...i)),e.max=(...i)=>e.check(Xr(...i)),e.length=(...i)=>e.check(en(...i)),e.nonempty=(...i)=>e.check(dr(1,...i)),e.lowercase=i=>e.check(Nn(i)),e.uppercase=i=>e.check(Cn(i)),e.trim=()=>e.check(Zn()),e.normalize=(...i)=>e.check(qn(...i)),e.toLowerCase=()=>e.check(Fn()),e.toUpperCase=()=>e.check(Vn()),e.slugify=()=>e.check(Ai())}),Li=b("ZodString",(e,t)=>{Qr.init(e,t),dd.init(e,t),e.email=r=>e.check(ga(pd,r)),e.url=r=>e.check(Ci(Ba,r)),e.jwt=r=>e.check(Na(Id,r)),e.emoji=r=>e.check(Sa(md,r)),e.guid=r=>e.check(Ni(Za,r)),e.uuid=r=>e.check(ya(pr,r)),e.uuidv4=r=>e.check(va(pr,r)),e.uuidv6=r=>e.check(ba(pr,r)),e.uuidv7=r=>e.check(_a(pr,r)),e.nanoid=r=>e.check(xa(fd,r)),e.guid=r=>e.check(Ni(Za,r)),e.cuid=r=>e.check(wa(hd,r)),e.cuid2=r=>e.check($a(gd,r)),e.ulid=r=>e.check(ka(yd,r)),e.base64=r=>e.check(Oa($d,r)),e.base64url=r=>e.check(ja(kd,r)),e.xid=r=>e.check(Ta(vd,r)),e.ksuid=r=>e.check(Ia(bd,r)),e.ipv4=r=>e.check(Ea(_d,r)),e.ipv6=r=>e.check(Pa(Sd,r)),e.cidrv4=r=>e.check(za(xd,r)),e.cidrv6=r=>e.check(Ra(wd,r)),e.e164=r=>e.check(Da(Td,r)),e.datetime=r=>e.check(fg(r)),e.date=r=>e.check(hg(r)),e.time=r=>e.check(gg(r)),e.duration=r=>e.check(yg(r))});function x(e){return yu(Li,e)}var $e=b("ZodStringFormat",(e,t)=>{Se.init(e,t),dd.init(e,t)}),pd=b("ZodEmail",(e,t)=>{ol.init(e,t),$e.init(e,t)});function fT(e){return ga(pd,e)}var Za=b("ZodGUID",(e,t)=>{nl.init(e,t),$e.init(e,t)});function hT(e){return Ni(Za,e)}var pr=b("ZodUUID",(e,t)=>{il.init(e,t),$e.init(e,t)});function gT(e){return ya(pr,e)}function yT(e){return va(pr,e)}function vT(e){return ba(pr,e)}function bT(e){return _a(pr,e)}var Ba=b("ZodURL",(e,t)=>{al.init(e,t),$e.init(e,t)});function _T(e){return Ci(Ba,e)}function ST(e){return Ci(Ba,{protocol:/^https?$/,hostname:bt.domain,...z.normalizeParams(e)})}var md=b("ZodEmoji",(e,t)=>{sl.init(e,t),$e.init(e,t)});function xT(e){return Sa(md,e)}var fd=b("ZodNanoID",(e,t)=>{cl.init(e,t),$e.init(e,t)});function wT(e){return xa(fd,e)}var hd=b("ZodCUID",(e,t)=>{ll.init(e,t),$e.init(e,t)});function $T(e){return wa(hd,e)}var gd=b("ZodCUID2",(e,t)=>{ul.init(e,t),$e.init(e,t)});function kT(e){return $a(gd,e)}var yd=b("ZodULID",(e,t)=>{dl.init(e,t),$e.init(e,t)});function TT(e){return ka(yd,e)}var vd=b("ZodXID",(e,t)=>{pl.init(e,t),$e.init(e,t)});function IT(e){return Ta(vd,e)}var bd=b("ZodKSUID",(e,t)=>{ml.init(e,t),$e.init(e,t)});function ET(e){return Ia(bd,e)}var _d=b("ZodIPv4",(e,t)=>{vl.init(e,t),$e.init(e,t)});function PT(e){return Ea(_d,e)}var zg=b("ZodMAC",(e,t)=>{_l.init(e,t),$e.init(e,t)});function zT(e){return bu(zg,e)}var Sd=b("ZodIPv6",(e,t)=>{bl.init(e,t),$e.init(e,t)});function RT(e){return Pa(Sd,e)}var xd=b("ZodCIDRv4",(e,t)=>{Sl.init(e,t),$e.init(e,t)});function OT(e){return za(xd,e)}var wd=b("ZodCIDRv6",(e,t)=>{xl.init(e,t),$e.init(e,t)});function jT(e){return Ra(wd,e)}var $d=b("ZodBase64",(e,t)=>{wl.init(e,t),$e.init(e,t)});function DT(e){return Oa($d,e)}var kd=b("ZodBase64URL",(e,t)=>{$l.init(e,t),$e.init(e,t)});function NT(e){return ja(kd,e)}var Td=b("ZodE164",(e,t)=>{kl.init(e,t),$e.init(e,t)});function CT(e){return Da(Td,e)}var Id=b("ZodJWT",(e,t)=>{Tl.init(e,t),$e.init(e,t)});function AT(e){return Na(Id,e)}var qi=b("ZodCustomStringFormat",(e,t)=>{Il.init(e,t),$e.init(e,t)});function MT(e,t,r={}){return Bn(qi,e,t,r)}function UT(e){return Bn(qi,"hostname",bt.hostname,e)}function LT(e){return Bn(qi,"hex",bt.hex,e)}function qT(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,n=bt[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Bn(qi,i,n,t)}var Zi=b("ZodNumber",(e,t)=>{ua.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Oh(e,i,n,o),e.gt=(i,n)=>e.check(Gt(i,n)),e.gte=(i,n)=>e.check(We(i,n)),e.min=(i,n)=>e.check(We(i,n)),e.lt=(i,n)=>e.check(Jt(i,n)),e.lte=(i,n)=>e.check(ct(i,n)),e.max=(i,n)=>e.check(ct(i,n)),e.int=i=>e.check(ud(i)),e.safe=i=>e.check(ud(i)),e.positive=i=>e.check(Gt(0,i)),e.nonnegative=i=>e.check(We(0,i)),e.negative=i=>e.check(Jt(0,i)),e.nonpositive=i=>e.check(ct(0,i)),e.multipleOf=(i,n)=>e.check(kr(i,n)),e.step=(i,n)=>e.check(kr(i,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 ve(e){return ku(Zi,e)}var Wn=b("ZodNumberFormat",(e,t)=>{El.init(e,t),Zi.init(e,t)});function ud(e){return Iu(Wn,e)}function ZT(e){return Eu(Wn,e)}function FT(e){return Pu(Wn,e)}function VT(e){return zu(Wn,e)}function BT(e){return Ru(Wn,e)}var Fi=b("ZodBoolean",(e,t)=>{zi.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>jh(e,r,i,n)});function Ue(e){return Ou(Fi,e)}var Vi=b("ZodBigInt",(e,t)=>{da.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Dh(e,i,n,o),e.gte=(i,n)=>e.check(We(i,n)),e.min=(i,n)=>e.check(We(i,n)),e.gt=(i,n)=>e.check(Gt(i,n)),e.gte=(i,n)=>e.check(We(i,n)),e.min=(i,n)=>e.check(We(i,n)),e.lt=(i,n)=>e.check(Jt(i,n)),e.lte=(i,n)=>e.check(ct(i,n)),e.max=(i,n)=>e.check(ct(i,n)),e.positive=i=>e.check(Gt(BigInt(0),i)),e.negative=i=>e.check(Jt(BigInt(0),i)),e.nonpositive=i=>e.check(ct(BigInt(0),i)),e.nonnegative=i=>e.check(We(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(kr(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function HT(e){return Du(Vi,e)}var Ed=b("ZodBigIntFormat",(e,t)=>{Pl.init(e,t),Vi.init(e,t)});function WT(e){return Cu(Ed,e)}function JT(e){return Au(Ed,e)}var Rg=b("ZodSymbol",(e,t)=>{zl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Nh(e,r,i,n)});function GT(e){return Mu(Rg,e)}var Og=b("ZodUndefined",(e,t)=>{Rl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Ah(e,r,i,n)});function KT(e){return Uu(Og,e)}var jg=b("ZodNull",(e,t)=>{Ol.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Ch(e,r,i,n)});function Bi(e){return Lu(jg,e)}var Dg=b("ZodAny",(e,t)=>{jl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Lh(e,r,i,n)});function QT(){return qu(Dg)}var Ng=b("ZodUnknown",(e,t)=>{Dl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>qh(e,r,i,n)});function ke(){return Zu(Ng)}var Cg=b("ZodNever",(e,t)=>{Nl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Uh(e,r,i,n)});function Pd(e){return Fu(Cg,e)}var Ag=b("ZodVoid",(e,t)=>{Cl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Mh(e,r,i,n)});function YT(e){return Vu(Ag,e)}var Ha=b("ZodDate",(e,t)=>{Al.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Zh(e,i,n,o),e.min=(i,n)=>e.check(We(i,n)),e.max=(i,n)=>e.check(ct(i,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 XT(e){return Bu(Ha,e)}var Mg=b("ZodArray",(e,t)=>{Ml.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>eg(e,r,i,n),e.element=t.element,e.min=(r,i)=>e.check(dr(r,i)),e.nonempty=r=>e.check(dr(1,r)),e.max=(r,i)=>e.check(Xr(r,i)),e.length=(r,i)=>e.check(en(r,i)),e.unwrap=()=>e.element});function se(e,t){return Ph(Mg,e,t)}function eI(e){let t=e._zod.def.shape;return Ge(Object.keys(t))}var Wa=b("ZodObject",(e,t)=>{Eh.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>tg(e,r,i,n),z.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Ge(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ke()}),e.loose=()=>e.clone({...e._zod.def,catchall:ke()}),e.strict=()=>e.clone({...e._zod.def,catchall:Pd()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>z.extend(e,r),e.safeExtend=r=>z.safeExtend(e,r),e.merge=r=>z.merge(e,r),e.pick=r=>z.pick(e,r),e.omit=r=>z.omit(e,r),e.partial=(...r)=>z.partial(Wi,e,r[0]),e.required=(...r)=>z.required(Rd,e,r[0])});function U(e,t){let r={type:"object",shape:e??{},...z.normalizeParams(t)};return new Wa(r)}function tI(e,t){return new Wa({type:"object",shape:e,catchall:Pd(),...z.normalizeParams(t)})}function Je(e,t){return new Wa({type:"object",shape:e,catchall:ke(),...z.normalizeParams(t)})}var Ja=b("ZodUnion",(e,t)=>{Ri.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rd(e,r,i,n),e.options=t.options});function xe(e,t){return new Ja({type:"union",options:e,...z.normalizeParams(t)})}var Ug=b("ZodXor",(e,t)=>{Ja.init(e,t),Ll.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rd(e,r,i,n),e.options=t.options});function rI(e,t){return new Ug({type:"union",options:e,inclusive:!1,...z.normalizeParams(t)})}var Lg=b("ZodDiscriminatedUnion",(e,t)=>{Ja.init(e,t),ql.init(e,t)});function Ga(e,t,r){return new Lg({type:"union",options:t,discriminator:e,...z.normalizeParams(r)})}var qg=b("ZodIntersection",(e,t)=>{Zl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rg(e,r,i,n)});function Hi(e,t){return new qg({type:"intersection",left:e,right:t})}var Zg=b("ZodTuple",(e,t)=>{pa.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ng(e,r,i,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Fg(e,t,r){let i=t instanceof K,n=i?r:t,o=i?t:null;return new Zg({type:"tuple",items:e,rest:o,...z.normalizeParams(n)})}var Ka=b("ZodRecord",(e,t)=>{Fl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ig(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function Ie(e,t,r){return new Ka({type:"record",keyType:e,valueType:t,...z.normalizeParams(r)})}function nI(e,t,r){let i=Ve(e);return i._zod.values=void 0,new Ka({type:"record",keyType:i,valueType:t,...z.normalizeParams(r)})}function iI(e,t,r){return new Ka({type:"record",keyType:e,valueType:t,mode:"loose",...z.normalizeParams(r)})}var Vg=b("ZodMap",(e,t)=>{Vl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Yh(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Kt(...r)),e.nonempty=r=>e.check(Kt(1,r)),e.max=(...r)=>e.check(Tr(...r)),e.size=(...r)=>e.check(Yr(...r))});function oI(e,t,r){return new Vg({type:"map",keyType:e,valueType:t,...z.normalizeParams(r)})}var Bg=b("ZodSet",(e,t)=>{Bl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Xh(e,r,i,n),e.min=(...r)=>e.check(Kt(...r)),e.nonempty=r=>e.check(Kt(1,r)),e.max=(...r)=>e.check(Tr(...r)),e.size=(...r)=>e.check(Yr(...r))});function aI(e,t){return new Bg({type:"set",valueType:e,...z.normalizeParams(t)})}var Ui=b("ZodEnum",(e,t)=>{Hl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Fh(e,i,n,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let a of i)if(r.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ui({...t,checks:[],...z.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Ui({...t,checks:[],...z.normalizeParams(n),entries:o})}});function Ge(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Ui({type:"enum",entries:r,...z.normalizeParams(t)})}function sI(e,t){return new Ui({type:"enum",entries:e,...z.normalizeParams(t)})}var Hg=b("ZodLiteral",(e,t)=>{Wl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Vh(e,r,i,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 F(e,t){return new Hg({type:"literal",values:Array.isArray(e)?e:[e],...z.normalizeParams(t)})}var Wg=b("ZodFile",(e,t)=>{Jl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Wh(e,r,i,n),e.min=(r,i)=>e.check(Kt(r,i)),e.max=(r,i)=>e.check(Tr(r,i)),e.mime=(r,i)=>e.check(Ln(Array.isArray(r)?r:[r],i))});function cI(e){return Ju(Wg,e)}var Jg=b("ZodTransform",(e,t)=>{Gl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Qh(e,r,i,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vr(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(z.issue(o,r.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(z.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function zd(e){return new Jg({type:"transform",transform:e})}var Wi=b("ZodOptional",(e,t)=>{ma.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>nd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function ze(e){return new Wi({type:"optional",innerType:e})}var Gg=b("ZodExactOptional",(e,t)=>{Kl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>nd(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Kg(e){return new Gg({type:"optional",innerType:e})}var Qg=b("ZodNullable",(e,t)=>{Ql.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>og(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Fa(e){return new Qg({type:"nullable",innerType:e})}function lI(e){return ze(Fa(e))}var Yg=b("ZodDefault",(e,t)=>{Yl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>sg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Xg(e,t){return new Yg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():z.shallowClone(t)}})}var ey=b("ZodPrefault",(e,t)=>{Xl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>cg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function ty(e,t){return new ey({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():z.shallowClone(t)}})}var Rd=b("ZodNonOptional",(e,t)=>{eu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ag(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function ry(e,t){return new Rd({type:"nonoptional",innerType:e,...z.normalizeParams(t)})}var ny=b("ZodSuccess",(e,t)=>{tu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Jh(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function uI(e){return new ny({type:"success",innerType:e})}var iy=b("ZodCatch",(e,t)=>{ru.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>lg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oy(e,t){return new iy({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var ay=b("ZodNaN",(e,t)=>{nu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Bh(e,r,i,n)});function dI(e){return Wu(ay,e)}var Od=b("ZodPipe",(e,t)=>{iu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ug(e,r,i,n),e.in=t.in,e.out=t.out});function Va(e,t){return new Od({type:"pipe",in:e,out:t})}var jd=b("ZodCodec",(e,t)=>{Od.init(e,t),Oi.init(e,t)});function pI(e,t,r){return new jd({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var sy=b("ZodReadonly",(e,t)=>{ou.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>dg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function cy(e){return new sy({type:"readonly",innerType:e})}var ly=b("ZodTemplateLiteral",(e,t)=>{au.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Hh(e,r,i,n)});function mI(e,t){return new ly({type:"template_literal",parts:e,...z.normalizeParams(t)})}var uy=b("ZodLazy",(e,t)=>{lu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>mg(e,r,i,n),e.unwrap=()=>e._zod.def.getter()});function dy(e){return new uy({type:"lazy",getter:e})}var py=b("ZodPromise",(e,t)=>{cu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>pg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function fI(e){return new py({type:"promise",innerType:e})}var my=b("ZodFunction",(e,t)=>{su.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Kh(e,r,i,n)});function hI(e){return new my({type:"function",input:Array.isArray(e?.input)?Fg(e?.input):e?.input??se(ke()),output:e?.output??ke()})}var Qa=b("ZodCustom",(e,t)=>{uu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Gh(e,r,i,n)});function gI(e){let t=new we({check:"custom"});return t._zod.check=e,t}function Dd(e,t){return Gu(Qa,e??(()=>!0),t)}function fy(e,t={}){return Ku(Qa,e,t)}function hy(e){return Qu(e)}var yI=Yu,vI=Xu;function bI(e,t={}){let r=new Qa({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...z.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var _I=(...e)=>ed({Codec:jd,Boolean:Fi,String:Li},...e);function SI(e){let t=dy(()=>xe([x(e),ve(),Ue(),Bi(),se(t),Ie(x(),t)]));return t}function Ya(e,t){return Va(zd(e),t)}var t6={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 r6(e){Ae({customError:e})}function n6(){return Ae().customError}var gy;gy||(gy={});var A={...qa,...od,iso:on},i6=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 o6(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 a6(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 i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){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 xI(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return A.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 A.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=a6(n,t),a=rt(o,t);return t.refs.set(n,a),t.processing.delete(n),a}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 A.null();if(n.length===0)return A.never();if(n.length===1)return A.literal(n[0]);if(n.every(a=>typeof a=="string"))return A.enum(n);let o=n.map(a=>A.literal(a));return o.length<2?o[0]:A.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return A.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(o=>{let a={...e,type:o};return xI(a,t)});return n.length===0?A.never():n.length===1?n[0]:A.union(n)}if(!r)return A.any();let i;switch(r){case"string":{let n=A.string();if(e.format){let o=e.format;o==="email"?n=n.check(A.email()):o==="uri"||o==="uri-reference"?n=n.check(A.url()):o==="uuid"||o==="guid"?n=n.check(A.uuid()):o==="date-time"?n=n.check(A.iso.datetime()):o==="date"?n=n.check(A.iso.date()):o==="time"?n=n.check(A.iso.time()):o==="duration"?n=n.check(A.iso.duration()):o==="ipv4"?n=n.check(A.ipv4()):o==="ipv6"?n=n.check(A.ipv6()):o==="mac"?n=n.check(A.mac()):o==="cidr"?n=n.check(A.cidrv4()):o==="cidr-v6"?n=n.check(A.cidrv6()):o==="base64"?n=n.check(A.base64()):o==="base64url"?n=n.check(A.base64url()):o==="e164"?n=n.check(A.e164()):o==="jwt"?n=n.check(A.jwt()):o==="emoji"?n=n.check(A.emoji()):o==="nanoid"?n=n.check(A.nanoid()):o==="cuid"?n=n.check(A.cuid()):o==="cuid2"?n=n.check(A.cuid2()):o==="ulid"?n=n.check(A.ulid()):o==="xid"?n=n.check(A.xid()):o==="ksuid"&&(n=n.check(A.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))),i=n;break}case"number":case"integer":{let n=r==="integer"?A.number().int():A.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)),i=n;break}case"boolean":{i=A.boolean();break}case"null":{i=A.null();break}case"object":{let n={},o=e.properties||{},a=new Set(e.required||[]);for(let[l,u]of Object.entries(o)){let d=rt(u,t);n[l]=a.has(l)?d:d.optional()}if(e.propertyNames){let l=rt(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?rt(e.additionalProperties,t):A.any();if(Object.keys(n).length===0){i=A.record(l,u);break}let d=A.object(n).passthrough(),p=A.looseRecord(l,u);i=A.intersection(d,p);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let f of u){let h=rt(l[f],t),m=A.string().regex(new RegExp(f));d.push(A.looseRecord(m,h))}let p=[];if(Object.keys(n).length>0&&p.push(A.object(n).passthrough()),p.push(...d),p.length===0)i=A.object({}).passthrough();else if(p.length===1)i=p[0];else{let f=A.intersection(p[0],p[1]);for(let h=2;h<p.length;h++)f=A.intersection(f,p[h]);i=f}break}let s=A.object(n);e.additionalProperties===!1?i=s.strict():typeof e.additionalProperties=="object"?i=s.catchall(rt(e.additionalProperties,t)):i=s.passthrough();break}case"array":{let n=e.prefixItems,o=e.items;if(n&&Array.isArray(n)){let a=n.map(l=>rt(l,t)),s=o&&typeof o=="object"&&!Array.isArray(o)?rt(o,t):void 0;s?i=A.tuple(a).rest(s):i=A.tuple(a),typeof e.minItems=="number"&&(i=i.check(A.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(A.maxLength(e.maxItems)))}else if(Array.isArray(o)){let a=o.map(l=>rt(l,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?rt(e.additionalItems,t):void 0;s?i=A.tuple(a).rest(s):i=A.tuple(a),typeof e.minItems=="number"&&(i=i.check(A.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(A.maxLength(e.maxItems)))}else if(o!==void 0){let a=rt(o,t),s=A.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),i=s}else i=A.array(A.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(i=i.describe(e.description)),e.default!==void 0&&(i=i.default(e.default)),i}function rt(e,t){if(typeof e=="boolean")return e?A.any():A.never();let r=xI(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>rt(u,t)),l=A.union(s);r=i?A.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>rt(u,t)),l=A.xor(s);r=i?A.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:A.any();else{let s=i?r:rt(e.allOf[0],t),l=i?0:1;for(let u=l;u<e.allOf.length;u++)s=A.intersection(s,rt(e.allOf[u],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=A.nullable(r)),e.readOnly===!0&&(r=A.readonly(r));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))i6.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),r}function wI(e,t){if(typeof e=="boolean")return e?A.any():A.never();let r=o6(e,t?.defaultTarget),i=e.$defs||e.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Be};return rt(e,n)}var yy={};wr(yy,{bigint:()=>u6,boolean:()=>l6,date:()=>d6,number:()=>c6,string:()=>s6});function s6(e){return vu(Li,e)}function c6(e){return Tu(Zi,e)}function l6(e){return ju(Fi,e)}function u6(e){return Nu(Vi,e)}function d6(e){return Hu(Ha,e)}Ae(du());var vy="127.0.0.1";var by="127.0.0.1";var p6=c.string().optional().transform(e=>{if(!(e==null||e.trim()===""))return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}),m6=c.object({wsHost:c.string().min(1).default(vy),wsPort:c.coerce.number().int().min(1024).max(65535).default(3005),logLevel:c.enum(["fatal","error","warn","info","debug","trace"]).default("info"),httpHost:c.string().min(1).default(by),httpPort:c.coerce.number().int().min(1024).max(65535).optional(),httpSecret:c.string().min(1).optional(),corsOrigins:p6,wsAllowedOrigins:c.string().optional().transform(e=>{if(!(e==null||e.trim()===""))return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}),wsSecret:c.string().min(1).optional(),polarWebhookSecret:c.string().min(1).optional(),polarOrganizationId:c.string().min(1).optional()});function f6(){let e=process.argv.indexOf("--http");if(e===-1)return;let t=process.argv[e+1];if(t==null||t==="")return 3006;let r=Number(t);return Number.isFinite(r)?r:(console.warn(`familiar: --http value "${t}" is not a valid port number, using default ${String(3006)}`),3006)}function kI(){let e=f6(),t=process.env.FAMILIAR_HTTP_PORT,r=m6.safeParse({wsHost:process.env.FAMILIAR_WS_HOST??vy,wsPort:process.env.FAMILIAR_WS_PORT??3005,logLevel:process.env.FAMILIAR_LOG_LEVEL??"info",httpHost:process.env.FAMILIAR_HTTP_HOST??by,httpPort:e??t,httpSecret:process.env.FAMILIAR_HTTP_SECRET,corsOrigins:process.env.FAMILIAR_CORS_ORIGIN,wsAllowedOrigins:process.env.FAMILIAR_WS_ALLOWED_ORIGINS,wsSecret:process.env.FAMILIAR_WS_SECRET,polarWebhookSecret:process.env.POLAR_WEBHOOK_SECRET,polarOrganizationId:process.env.POLAR_ORGANIZATION_ID});if(!r.success){let n=r.error.issues.map(o=>` - ${o.path.join(".")}: ${o.message}`);throw new Error(`Invalid server configuration:
77
- ${n.join(`
78
- `)}`)}let i=r.data;return i.httpPort!=null&&i.httpPort!==0&&!i.corsOrigins&&(i.corsOrigins=[`http://localhost:${String(i.httpPort)}`,`http://127.0.0.1:${String(i.httpPort)}`]),i.wsAllowedOrigins??=["http://localhost:30000","http://127.0.0.1:30000"],i}import{randomUUID as tL}from"node:crypto";var DU=Vt(_E(),1),NU=Vt(Fd(),1),CU=Vt(Ki(),1),AU=Vt(Ry(),1),MU=Vt(Dy(),1),UU=Vt(Ly(),1),as=Vt(Wd(),1),Zy=Vt(EE(),1);function Yt(e){return e===void 0?"Unknown error":typeof e=="string"?e:e.error}function Rr(e){if(!(e===void 0||typeof e=="string"))return e.code}function PE(e){if(!(e===void 0||typeof e=="string"))return e.retryable}function zE(e,t){throw new Error(t??`Unexpected value: ${e}`)}function Xn(e){return e instanceof Error?e.message:String(e)}function fr(e,t,r){return{success:!1,error:{error:e,code:t,...r?.retryable!==void 0&&{retryable:r.retryable},...r?.retryAfterMs!==void 0&&{retryAfterMs:r.retryAfterMs}}}}var Ke={QUERY:"mcp-query",RESPONSE:"mcp-response",PING:"ping",PONG:"pong",CLIENT_UPDATE:"mcp-client-update"},LU=c.object({type:c.literal(Ke.QUERY),id:c.string(),data:c.object({method:c.string().max(256),params:c.record(c.string(),c.unknown()).optional()})}),qU=c.object({type:c.literal(Ke.RESPONSE),id:c.string(),data:c.object({success:c.boolean(),result:c.unknown().optional(),error:c.union([c.string(),c.object({error:c.string(),code:c.string().optional(),retryable:c.boolean().optional(),retryAfterMs:c.number().optional()})]).optional()})}),ZU=c.object({type:c.literal(Ke.PING),id:c.string()}),FU=c.object({type:c.literal(Ke.PONG),id:c.string()}),VU=c.object({name:c.string(),version:c.string(),transport:c.enum(["stdio","http"]),sessionId:c.string().optional(),connectedAt:c.string()}),BU=c.object({valid:c.boolean(),status:c.enum(["active","trial","expired","cancelled","unknown"]),daysRemaining:c.number().optional()}),HU=c.object({type:c.literal(Ke.CLIENT_UPDATE),clients:c.array(VU),license:BU.optional()}),RE=c.discriminatedUnion("type",[LU,qU,ZU,FU,HU]);var Or=class{constructor(t,r){this.maxTokens=t;this.refillRate=r;this.tokens=t,this.lastRefill=Date.now()}tokens;lastRefill;consume(){return this.refill(),this.tokens<1?!1:(this.tokens--,!0)}msUntilNextToken(){return this.refill(),this.tokens>=1?0:Math.ceil((1-this.tokens)/this.refillRate*1e3)}reset(){this.tokens=this.maxTokens,this.lastRefill=Date.now()}refill(){let t=Date.now(),r=t-this.lastRefill;this.tokens=Math.min(this.maxTokens,this.tokens+r*this.refillRate/1e3),this.lastRefill=t}};import{timingSafeEqual as WU}from"node:crypto";import{Buffer as Fy}from"node:buffer";function jE(e){return e instanceof Fy?e.toString("utf8"):typeof e=="string"?e:void 0}function JU(e){let t=e.searchParams.get("v");if(t!==null){let r=Number.parseInt(t,10);r!==1&&I.warn({serverVersion:1,clientVersion:r},"Protocol version mismatch \u2014 server and module may be incompatible. Update both to the same version.")}}function DE(e,t,r){let i=`http://${e.req.headers.host??"localhost"}`,n=new URL(e.req.url??"",i);if(r!==void 0&&r!==""){let a=n.searchParams.get("secret");if(a?.length!==r.length||!WU(Fy.from(a),Fy.from(r)))return I.warn("WebSocket connection rejected: invalid or missing secret"),!1}JU(n);let o=e.origin!==""?e.origin:e.req.headers.origin;return o===void 0||o===""?!0:t.size>0&&!t.has(o)?(I.warn({origin:o},"WebSocket connection rejected: origin not allowed"),!1):!0}import{randomUUID as KU}from"node:crypto";var QU=3;function NE(e,t){let r=jE(e);if(r===void 0){I.warn("Received non-text WebSocket message, ignoring");return}let i;try{i=JSON.parse(r)}catch{I.warn("Received invalid JSON, ignoring");return}let n=RE.safeParse(i);if(!n.success){I.warn({errors:n.error.issues},"Received invalid message");return}let o=n.data;if(o.type!==Ke.PONG&&!t.rateLimiter.consume()){XU(o,t);return}switch(o.type){case Ke.RESPONSE:{YU(o,t);break}case Ke.PONG:{o.id===t.lastPingId?(t.missedPongs=0,I.trace({id:o.id},"Pong received")):I.debug({expected:t.lastPingId,received:o.id},"Stale pong ignored");break}case Ke.QUERY:case Ke.PING:case Ke.CLIENT_UPDATE:{I.warn({type:o.type},"Unexpected message type from client");break}default:zE(o)}}function YU(e,t){let r=t.pendingQueries.get(e.id);if(!r){I.warn({id:e.id},"Received response for unknown query");return}clearTimeout(r.timer),t.pendingQueries.delete(e.id);let i=Date.now()-r.sentAt;r.resolve(e.data.success?{success:!0,result:e.data.result}:{success:!1,error:e.data.error??"Unknown error"}),I.info({id:e.id,method:r.method,durationMs:i,success:e.data.success},"Query completed")}function XU(e,t){if(e.type===Ke.RESPONSE&&e.id!==void 0){let r=t.pendingQueries.get(e.id);r?(clearTimeout(r.timer),t.pendingQueries.delete(e.id),r.resolve(fr("Response dropped \u2014 WebSocket rate limit exceeded","RATE_LIMITED",{retryable:!0,retryAfterMs:t.rateLimiter.msUntilNextToken()})),I.warn({id:e.id,method:r.method},"Rate-limited RESPONSE \u2014 rejected pending query")):I.warn({id:e.id},"Rate-limited RESPONSE for unknown query")}else I.warn({type:e.type},"WebSocket rate limit exceeded \u2014 dropping message")}function CE(e,t,r){e.pingTimer=setInterval(()=>{if(t()){if(e.missedPongs++,e.missedPongs>QU){I.warn({missedPongs:e.missedPongs},"Client unresponsive \u2014 terminating dead connection"),e.client?.terminate();return}e.lastPingId=KU();let i=JSON.stringify({type:Ke.PING,id:e.lastPingId});r(i)}},3e4)}function ss(e){e.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=null)}function cs(e,t){e.pendingQueries.size>0&&I.warn({count:e.pendingQueries.size,reason:t},"Dropping pending queries");for(let[r,i]of e.pendingQueries)clearTimeout(i.timer),i.resolve({success:!1,error:t}),e.pendingQueries.delete(r)}function AE(e,t,r){if(r.state.client?.readyState===as.default.OPEN){I.warn("Rejected new WebSocket connection: existing healthy client is connected"),e.close(4002,"Another client is already connected");return}r.state.client&&(ss(r.state),cs(r.state,fr("Stale client replaced by new connection","FOUNDRY_DISCONNECTED",{retryable:!0}).error),r.state.client=null),r.state.client=e,r.state.missedPongs=0,r.state.rateLimiter.reset(),I.info("Foundry module connected"),CE(r.state,r.isConnected,o=>r.safeSend(o));let n=new URL(t.url??"",`http://${t.headers.host??"localhost"}`).searchParams.get("licenseKey")??void 0;try{r.moduleConnectCallback?.(n)}catch(o){I.error({err:o},"moduleConnectCallback threw during connection setup")}e.on("message",o=>NE(o,r.state)),e.on("close",(o,a)=>{o===1009&&I.error({maxPayload:524288},"WebSocket closed: message exceeded maxPayload (1009). A response from Foundry was too large."),I.info({code:o,reason:a.toString("utf8")},"Foundry module disconnected"),r.state.client=null,r.state.missedPongs=0,ss(r.state),cs(r.state,fr("Foundry module disconnected","FOUNDRY_DISCONNECTED").error)}),e.on("error",o=>I.error({err:o},"WebSocket client error"))}var Gd=class e{wss=null;state={client:null,pendingQueries:new Map,missedPongs:0,lastPingId:null,rateLimiter:new Or(100,100/6e4*1e3),pingTimer:null};moduleConnectCallback=null;get ws(){if(!this.state.client)throw new Error("No WebSocket client connected");return this.state.client}get isConnected(){return this.state.client?.readyState===as.default.OPEN}onModuleConnect(t){this.moduleConnectCallback=t}start(t,r,i,n){let o=new Set(i);this.wss=new Zy.default({host:r,port:t,maxPayload:524288,perMessageDeflate:{threshold:1024},verifyClient:a=>DE(a,o,n)}),this.wss.on("connection",(a,s)=>{AE(a,s,{state:this.state,isConnected:()=>this.isConnected,safeSend:l=>this.safeSend(l),moduleConnectCallback:this.moduleConnectCallback})}),this.wss.on("error",a=>I.error({err:a},"WebSocket server error")),n!==void 0&&n!==""?I.info("WebSocket shared secret authentication enabled"):I.warn("WebSocket has no authentication \u2014 set FAMILIAR_WS_SECRET to secure it"),I.info({host:r,port:t},"WebSocket server listening")}static RETRY_DELAY_MS=500;static RETRYABLE_CODES=new Set(["QUERY_TIMEOUT"]);async query(t,r,i){let n=await this.queryOnce(t,r,i);if(!n.success){let o=Rr(n.error);if(o!==void 0&&e.RETRYABLE_CODES.has(o)&&this.isConnected)return I.info({method:t,code:o},"Retrying transient query failure"),await new Promise(a=>{setTimeout(a,e.RETRY_DELAY_MS)}),this.queryOnce(t,r,i)}return n}async queryOnce(t,r,i){if(!this.isConnected)return fr("Foundry module is not connected","FOUNDRY_DISCONNECTED");if(this.state.pendingQueries.size>=50)return I.warn({pending:this.state.pendingQueries.size,max:50},"Too many pending queries \u2014 server is overloaded"),fr("Too many pending queries \u2014 server is overloaded","QUERY_OVERLOADED",{retryable:!0,retryAfterMs:1e3});let n=tL(),o={type:Ke.QUERY,id:n,data:{method:t,params:r}},a=i??1e4;return new Promise(s=>{let l=setTimeout(()=>{this.state.pendingQueries.delete(n),I.warn({method:t,timeoutMs:a,id:n},"Query timed out \u2014 possible hung Foundry module"),s(fr(`Query timed out after ${a}ms: ${t}`,"QUERY_TIMEOUT",{retryable:!0}))},a);if(this.state.pendingQueries.set(n,{resolve:s,timer:l,sentAt:Date.now(),method:t}),!this.safeSend(JSON.stringify(o))){clearTimeout(l),this.state.pendingQueries.delete(n),s(fr("Failed to send message to Foundry module","SEND_FAILED"));return}I.debug({id:n,method:t},"Query sent")})}pushClientUpdate(t,r){if(!this.isConnected)return;let i=JSON.stringify({type:Ke.CLIENT_UPDATE,clients:t,license:r});this.safeSend(i)&&I.debug({clientCount:t.length},"Pushed client update to module")}async shutdown(){return ss(this.state),cs(this.state,"Server shutting down"),this.state.client&&(this.state.client.close(1e3,"Server shutting down"),this.state.client=null),new Promise(t=>{this.wss?this.wss.close(()=>{I.info("WebSocket server closed"),t()}):t()})}static BUFFER_HIGH_WATER_MARK=256*1024;safeSend(t){try{let r=this.ws.bufferedAmount;return r>e.BUFFER_HIGH_WATER_MARK&&I.warn({bufferedAmount:r,highWaterMark:e.BUFFER_HIGH_WATER_MARK},"WebSocket send buffer backpressure \u2014 outgoing data is accumulating"),this.ws.send(t),!0}catch(r){return I.warn({err:r},"Failed to send WebSocket message"),!1}}};function rL(e){return e?.valid===!0&&e.status==="active"}function nL(){return`${["Li","cen","se is ","not ac","tive."].join("")} Please check your Familiar subscription status.`}function LE(e,t){return{query:(r,i,n)=>rL(t())?e.query(r,i,n):Promise.resolve({success:!1,error:nL()})}}import{createHash as oL}from"node:crypto";var aL="https://api.polar.sh/v1/customer-portal/license-keys/validate",sL=1e4;function hr(e){return e.length>8?`${e.slice(0,8)}...`:"***"}var cL=256,lL=/^[\w-]+$/;function qE(e){return e.length>0&&e.length<=cL&&lL.test(e)}function Hy(e){return oL("sha256").update(e).digest("hex")}function uL(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dL(e){return e==="granted"?{valid:!0,status:"active"}:e==="revoked"?{valid:!1,status:"cancelled"}:e==="disabled"?{valid:!1,status:"expired"}:{valid:!1,status:"unknown"}}function pL(e){let t,r=1/0;for(let[i,n]of e)n.expiresAt<r&&(r=n.expiresAt,t=i);t!==void 0&&e.delete(t)}function Kd(e,t,r){let i=e.get(t);if(i){let n=i.expiresAt-6048e5;return Date.now()-n>6048e5?(I.warn({key:hr(r)},"Cached license fallback too stale, rejecting"),{valid:!1,status:"unknown"}):(I.debug({key:hr(r)},"Returning expired cached license result as fallback"),i.result)}return{valid:!1,status:"unknown"}}async function mL(e,t,r){let i=Date.now(),n=Hy(t),o=e.get(n);if(o&&o.expiresAt>i)return I.debug({key:hr(t)},"License cache hit"),o.result;I.info({key:hr(t)},"Validating license key with Polar");let a=new AbortController,s=setTimeout(()=>a.abort(),1e4),l;try{l=await fetch(aL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t,organization_id:r}),signal:a.signal})}catch(f){return I.warn({key:hr(t),error:Xn(f)},"License validation fetch failed"),Kd(e,n,t)}finally{clearTimeout(s)}if(l.status===429)return I.warn({key:hr(t)},"License validation rate limited (429)"),Kd(e,n,t);if(!l.ok)return I.warn({key:hr(t),status:l.status},"License validation returned non-2xx"),Kd(e,n,t);let u;try{u=await l.json()}catch(f){return I.warn({key:hr(t),error:Xn(f)},"Failed to parse license validation response"),Kd(e,n,t)}let d=uL(u)?u.status:void 0,p=dL(d);return e.size>=sL&&pL(e),e.set(n,{result:p,expiresAt:i+6048e5}),I.info({key:hr(t),valid:p.valid,status:p.status},"License validation complete"),p}function FE(e){let t=new Map,r=new Map;return{validate:async i=>{if(!qE(i))return I.warn({key:hr(i)},"Rejected malformed license key"),{valid:!1,status:"unknown"};let n=Hy(i),o=r.get(n);if(o)return o;let a=mL(t,i,e);r.set(n,a);try{return await a}finally{r.delete(n)}},invalidate:i=>{qE(i)&&t.delete(Hy(i))},invalidateAll:()=>t.clear()}}import{createHmac as $L,timingSafeEqual as kL}from"node:crypto";import{timingSafeEqual as fL}from"node:crypto";import{gzip as hL}from"node:zlib";import{promisify as gL}from"node:util";var yL=gL(hL),vL=1024;function Oe(e,t,r,i){let n={"Content-Type":"application/json",...i};e.writeHead(t,n),e.end(JSON.stringify({error:r}))}function Qd(e,t,r){let i=e.headers.origin;i!==void 0&&i!==""&&r.has(i)&&(t.setHeader("Access-Control-Allow-Origin",i),t.setHeader("Vary","Origin"),t.setHeader("Access-Control-Allow-Methods","GET, POST, DELETE, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Accept, Authorization, Mcp-Session-Id, MCP-Protocol-Version"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id, Retry-After")),t.setHeader("X-Content-Type-Options","nosniff"),t.setHeader("X-Frame-Options","DENY"),t.setHeader("Referrer-Policy","no-referrer"),t.setHeader("Cache-Control","no-store"),t.setHeader("Content-Security-Policy","default-src 'none'")}function VE(e,t,r){if(r===void 0||r===""||e.method==="OPTIONS")return!0;let i=e.headers.authorization;if(!i?.startsWith("Bearer "))return I.warn({method:e.method,pathname:(e.url??"/").split("?")[0]},"Missing or malformed Authorization header"),Oe(t,401,"Authentication required",{"WWW-Authenticate":"Bearer"}),!1;let n=Buffer.from(i.slice(7)),o=Buffer.from(r);return n.length!==o.length||!fL(n,o)?(I.warn({method:e.method,pathname:(e.url??"/").split("?")[0]},"Invalid bearer token"),Oe(t,401,"Invalid token",{"WWW-Authenticate":"Bearer"}),!1):!0}function BE(e,t,r,i){let n=e.headers.origin;if(n!==void 0&&n!==""&&!r.has(n))return I.warn({origin:n},"Rejected request from disallowed origin"),Oe(t,403,"Origin not allowed"),!1;if(e.method==="OPTIONS")return t.writeHead(204),t.end(),!1;if(e.method===void 0||!bL.has(e.method))return Oe(t,405,"Method not allowed"),!1;if(e.method==="POST"&&!(e.headers["content-type"]?.toLowerCase()??"").startsWith("application/json"))return I.warn({contentType:e.headers["content-type"]},"Rejected POST with unsupported Content-Type"),Oe(t,415,"Unsupported Media Type \u2014 Content-Type must be application/json"),!1;let o=e.headers["content-length"];return o!==void 0&&Number.parseInt(o,10)>i?(Oe(t,413,"Request body too large"),!1):!0}var bL=new Set(["GET","POST","DELETE","OPTIONS"]);function HE(e,t,r){if(e.method!=="POST")return;let i=0,n=e.emit.bind(e);e.emit=function(o,...a){return o==="data"&&Buffer.isBuffer(a[0])&&(i+=a[0].length,i>r)?(Oe(t,413,"Request body too large"),e.destroy(),!1):n(o,...a)}}function _L(e){let t=e.headers["accept-encoding"];return typeof t=="string"&&t.includes("gzip")}function SL(e,t){let r=e.getHeader("content-type");return typeof r=="string"&&r.includes("text/event-stream")||e.getHeader("content-encoding")!==void 0?!1:t.length>=vL}function WE(e,t){if(!_L(e))return;let r=t.end.bind(t);t.end=((i,n,o)=>{let a=i,s="utf8",l;typeof i=="function"?(l=i,a=void 0):typeof n=="function"?l=n:typeof n=="string"&&(s=n,l=o);let u;return Buffer.isBuffer(a)?u=a:typeof a=="string"&&(u=Buffer.from(a,s)),u?SL(t,u)?((async()=>{try{let d=await yL(u);t.setHeader("Content-Encoding","gzip"),t.setHeader("Vary","Accept-Encoding"),t.removeHeader("Content-Length"),r(d,void 0,l)}catch{r(u,void 0,l)}})(),t):r(u,void 0,l):r(a,s,l)})}var TL=512*1024,ls=new Set;function IL(e,t){return new Promise((r,i)=>{let n=!1,o=[],a=0;e.on("data",s=>{if(!n){if(a+=s.length,a>t){n=!0,e.destroy(),i(new Error("Request body too large"));return}o.push(s)}}),e.on("end",()=>{n||(n=!0,r(Buffer.concat(o).toString("utf8")))}),e.on("error",s=>{n||(n=!0,i(s))})})}function EL(e){let{secret:t,webhookId:r,timestamp:i,body:n,signatureHeader:o}=e,a=t.startsWith("whsec_")?t.slice(6):t,s=Buffer.from(a,"base64"),l=`${r}.${i}.${n}`,u=$L("sha256",s).update(l).digest("base64"),d=Buffer.from(u),p=o.split(" ");for(let f of p){let h=f.split(",");if(h.length<2||h[0]!=="v1")continue;let m=h.slice(1).join(","),g=Buffer.from(m);if(g.length===d.length&&kL(g,d))return!0}return!1}function PL(e){let t=Number.parseInt(e,10);if(Number.isNaN(t))return!1;let r=Math.floor(Date.now()/1e3);return Math.abs(r-t)<=300}function zL(e){if(ls.has(e))return!0;if(ls.size>=1e4){let t=ls.values().next();t.done||ls.delete(t.value)}return ls.add(e),!1}function JE(e){e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({received:!0}))}function RL(e){return typeof e!="object"||e===null?!1:"type"in e&&typeof e.type=="string"}function Wy(e,t){let r=e.headers[t];return typeof r=="string"?r:void 0}function OL(e){let t=Wy(e,"webhook-id"),r=Wy(e,"webhook-timestamp"),i=Wy(e,"webhook-signature");if(!(t===void 0||t===""||r===void 0||r===""||i===void 0||i===""))return{webhookId:t,timestamp:r,signature:i}}function jL(e,t,r){switch(e){case"subscription.revoked":case"subscription.canceled":case"subscription.updated":case"order.refunded":case"benefit_grant.revoked":{I.warn({type:e},"Polar webhook: revoking all cached licenses"),t.invalidateAll(),r?.();break}case"subscription.active":case"order.paid":case"benefit_grant.created":{I.info({type:e},"Polar webhook: subscription/order event");break}default:{I.debug({type:e},"Polar webhook: unhandled event type");break}}}function GE(e,t,r){return(i,n)=>{(async()=>{try{if(i.method!=="POST"){Oe(n,405,"Method not allowed");return}if(!i.headers["content-type"]?.startsWith("application/json")){Oe(n,415,"Unsupported Media Type");return}let o;try{o=await IL(i,TL)}catch{Oe(n,413,"Request body too large");return}let a=OL(i);if(!a){Oe(n,400,"Missing required webhook headers");return}let{webhookId:s,timestamp:l,signature:u}=a;if(!PL(l)){Oe(n,401,"Webhook timestamp outside tolerance");return}if(!EL({secret:e,webhookId:s,timestamp:l,body:o,signatureHeader:u})){Oe(n,401,"Invalid webhook signature");return}if(zL(s)){JE(n);return}let d;try{d=JSON.parse(o)}catch{Oe(n,400,"Invalid JSON body");return}if(!RL(d)){Oe(n,400,"Missing or invalid event type");return}jL(d.type,t,r),JE(n)}catch(o){I.error({error:Xn(o)},"Polar webhook handler error"),Oe(n,500,"Internal server error")}})()}}function KE(){return!0}async function Jy(e){try{await e.shutdown()}catch(t){I.warn({err:t},`Error during connector shutdown: ${Xn(t)}`)}}function Gy(e){let t=!1,r=async()=>{t||(t=!0,I.info("Shutting down..."),await e(),process.exit(0))};process.on("SIGINT",()=>{r()}),process.on("SIGTERM",()=>{r()})}function QE(e){if(e.polarOrganizationId!=null&&e.polarOrganizationId!=="")return I.info("Polar license validation enabled"),FE(e.polarOrganizationId);if(!KE()&&process.env.NODE_ENV!=="production"){I.warn("POLAR_ORGANIZATION_ID not set \u2014 license validation disabled (dev mode)");return}return I.fatal("POLAR_ORGANIZATION_ID is required \u2014 refusing to start without license validation"),process.exit(1)}function YE(e,t,r){if(!t||e.polarWebhookSecret==null||e.polarWebhookSecret==="")return;let i=GE(e.polarWebhookSecret,t,r);return e.polarWebhookSecret.startsWith("whsec_")||I.warn('POLAR_WEBHOOK_SECRET does not start with "whsec_" \u2014 verify this is a Standard Webhooks secret'),I.info("Polar webhook handler enabled"),i}function XE(e){e.httpPort!=null&&(e.httpSecret===void 0||e.httpSecret==="")&&(I.fatal("FAMILIAR_HTTP_SECRET is required when HTTP transport is enabled \u2014 refusing to start without authentication"),process.exit(1)),KE()&&(e.wsSecret===void 0||e.wsSecret==="")&&(I.fatal("FAMILIAR_WS_SECRET is required \u2014 refusing to start without WebSocket authentication"),process.exit(1))}var pe;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},e.getValidEnumValues=n=>{let o=e.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(let s of o)a[s]=n[s];return e.objectValues(a)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},e.find=(n,o)=>{for(let a of n)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(pe||(pe={}));var eP;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(eP||(eP={}));var L=pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),jr=e=>{switch(typeof e){case"undefined":return L.undefined;case"string":return L.string;case"number":return Number.isNaN(e)?L.nan:L.number;case"boolean":return L.boolean;case"function":return L.function;case"bigint":return L.bigint;case"symbol":return L.symbol;case"object":return Array.isArray(e)?L.array:e===null?L.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?L.promise:typeof Map<"u"&&e instanceof Map?L.map:typeof Set<"u"&&e instanceof Set?L.set:typeof Date<"u"&&e instanceof Date?L.date:L.object;default:return L.unknown}};var R=pe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Et=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},i={_errors:[]},n=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let s=i,l=0;for(;l<a.path.length;){let u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),i=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];r[o]=r[o]||[],r[o].push(t(n))}else i.push(t(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Et.create=e=>new Et(e);var DL=(e,t)=>{let r;switch(e.code){case R.invalid_type:e.received===L.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case R.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,pe.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:r=`Unrecognized key(s) in object: ${pe.joinValues(e.keys,", ")}`;break;case R.invalid_union:r="Invalid input";break;case R.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${pe.joinValues(e.options)}`;break;case R.invalid_enum_value:r=`Invalid enum value. Expected ${pe.joinValues(e.options)}, received '${e.received}'`;break;case R.invalid_arguments:r="Invalid function arguments";break;case R.invalid_return_type:r="Invalid function return type";break;case R.invalid_date:r="Invalid date";break;case R.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:pe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case R.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case R.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case R.custom:r="Invalid input";break;case R.invalid_intersection_types:r="Intersection results could not be merged";break;case R.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case R.not_finite:r="Number must be finite";break;default:r=t.defaultError,pe.assertNever(e)}return{message:r}},cn=DL;var NL=cn;function us(){return NL}var Yd=e=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,o=[...r,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let s="",l=i.filter(u=>!!u).slice().reverse();for(let u of l)s=u(a,{data:t,defaultError:s}).message;return{...n,path:o,message:s}};function M(e,t){let r=us(),i=Yd({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===cn?void 0:cn].filter(n=>!!n)});e.common.issues.push(i)}var nt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let i=[];for(let n of r){if(n.status==="aborted")return J;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,r){let i=[];for(let n of r){let o=await n.key,a=await n.value;i.push({key:o,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,r){let i={};for(let n of r){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return J;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}},J=Object.freeze({status:"aborted"}),ro=e=>({status:"dirty",value:e}),ut=e=>({status:"valid",value:e}),Ky=e=>e.status==="aborted",Qy=e=>e.status==="dirty",ei=e=>e.status==="valid",ds=e=>typeof Promise<"u"&&e instanceof Promise;var Z;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Z||(Z={}));var Ct=class{constructor(t,r,i,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},tP=(e,t)=>{if(ei(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Et(e.common.issues);return this._error=r,this._error}}};function ne(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(a,s)=>{let{message:l}=e;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:n}}var ce=class{get description(){return this._def.description}_getType(t){return jr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:jr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new nt,ctx:{common:t.parent.common,data:t.data,parsedType:jr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ds(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:jr(t)},n=this._parseSync({data:t,path:i.path,parent:i});return tP(i,n)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:jr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:r});return ei(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>ei(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){let i=await this.safeParseAsync(t,r);if(i.success)return i.data;throw i.error}async safeParseAsync(t,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:jr(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(ds(n)?n:Promise.resolve(n));return tP(i,o)}refine(t,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let a=t(n),s=()=>o.addIssue({code:R.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(t){return new er({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Xt.create(this,this._def)}nullable(){return Cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return un.create(this)}promise(){return ti.create(this,this._def)}or(t){return so.create([this,t],this._def)}and(t){return co.create(this,t,this._def)}transform(t){return new er({...ne(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new fo({...ne(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new Xd({typeName:D.ZodBranded,type:this,...ne(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new ho({...ne(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ep.create(this,t)}readonly(){return go.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},CL=/^c[^\s-]{8,}$/i,AL=/^[0-9a-z]+$/,ML=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UL=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,LL=/^[a-z0-9_-]{21}$/i,qL=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ZL=/^[-+]?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)?)??$/,FL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,VL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Yy,BL=/^(?:(?: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])$/,HL=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,WL=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,JL=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,KL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,rP="((\\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])))",QL=new RegExp(`^${rP}$`);function nP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function YL(e){return new RegExp(`^${nP(e)}$`)}function XL(e){let t=`${rP}T${nP(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function eq(e,t){return!!((t==="v4"||!t)&&BL.test(e)||(t==="v6"||!t)&&WL.test(e))}function tq(e,t){if(!qL.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||t&&n.alg!==t)}catch{return!1}}function rq(e,t){return!!((t==="v4"||!t)&&HL.test(e)||(t==="v6"||!t)&&JL.test(e))}var io=class e extends ce{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==L.string){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_type,expected:L.string,received:o.parsedType}),J}let i=new nt,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(n=this._getOrReturnCtx(t,n),a?M(n,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&M(n,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")FL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"email",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Yy||(Yy=new RegExp(VL,"u")),Yy.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"emoji",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")UL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"uuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")LL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"nanoid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")CL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"cuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")AL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"cuid2",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")ML.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"ulid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),M(n,{validation:"url",code:R.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"regex",code:R.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?XL(o).test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?QL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?YL(o).test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?ZL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"duration",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?eq(t.data,o.version)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"ip",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?tq(t.data,o.alg)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"jwt",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?rq(t.data,o.version)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"cidr",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?GL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"base64",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?KL.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"base64url",code:R.invalid_string,message:o.message}),i.dirty()):pe.assertNever(o);return{status:i.value,value:t.data}}_regex(t,r,i){return this.refinement(n=>t.test(n),{validation:r,code:R.invalid_string,...Z.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Z.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Z.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Z.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Z.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Z.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Z.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Z.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Z.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Z.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Z.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Z.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Z.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Z.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Z.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Z.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Z.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Z.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Z.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Z.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Z.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Z.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Z.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Z.errToObj(r)})}nonempty(t){return this.min(1,Z.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};io.create=e=>new io({checks:[],typeName:D.ZodString,coerce:e?.coerce??!1,...ne(e)});function nq(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),a=Number.parseInt(t.toFixed(n).replace(".",""));return o%a/10**n}var ps=class e extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==L.number){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_type,expected:L.number,received:o.parsedType}),J}let i,n=new nt;for(let o of this._def.checks)o.kind==="int"?pe.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:R.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?nq(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:R.not_finite,message:o.message}),n.dirty()):pe.assertNever(o);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Z.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Z.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Z.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Z.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Z.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Z.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Z.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Z.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&pe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ps.create=e=>new ps({checks:[],typeName:D.ZodNumber,coerce:e?.coerce||!1,...ne(e)});var ms=class e extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==L.bigint)return this._getInvalidInput(t);let i,n=new nt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):pe.assertNever(o);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return M(r,{code:R.invalid_type,expected:L.bigint,received:r.parsedType}),J}gte(t,r){return this.setLimit("min",t,!0,Z.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Z.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Z.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Z.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Z.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Z.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};ms.create=e=>new ms({checks:[],typeName:D.ZodBigInt,coerce:e?.coerce??!1,...ne(e)});var fs=class extends ce{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==L.boolean){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:L.boolean,received:i.parsedType}),J}return ut(t.data)}};fs.create=e=>new fs({typeName:D.ZodBoolean,coerce:e?.coerce||!1,...ne(e)});var hs=class e extends ce{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==L.date){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_type,expected:L.date,received:o.parsedType}),J}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_date}),J}let i=new nt,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):pe.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Z.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Z.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};hs.create=e=>new hs({checks:[],coerce:e?.coerce||!1,typeName:D.ZodDate,...ne(e)});var gs=class extends ce{_parse(t){if(this._getType(t)!==L.symbol){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:L.symbol,received:i.parsedType}),J}return ut(t.data)}};gs.create=e=>new gs({typeName:D.ZodSymbol,...ne(e)});var oo=class extends ce{_parse(t){if(this._getType(t)!==L.undefined){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:L.undefined,received:i.parsedType}),J}return ut(t.data)}};oo.create=e=>new oo({typeName:D.ZodUndefined,...ne(e)});var ao=class extends ce{_parse(t){if(this._getType(t)!==L.null){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:L.null,received:i.parsedType}),J}return ut(t.data)}};ao.create=e=>new ao({typeName:D.ZodNull,...ne(e)});var ys=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(t){return ut(t.data)}};ys.create=e=>new ys({typeName:D.ZodAny,...ne(e)});var ln=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ut(t.data)}};ln.create=e=>new ln({typeName:D.ZodUnknown,...ne(e)});var gr=class extends ce{_parse(t){let r=this._getOrReturnCtx(t);return M(r,{code:R.invalid_type,expected:L.never,received:r.parsedType}),J}};gr.create=e=>new gr({typeName:D.ZodNever,...ne(e)});var vs=class extends ce{_parse(t){if(this._getType(t)!==L.undefined){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:L.void,received:i.parsedType}),J}return ut(t.data)}};vs.create=e=>new vs({typeName:D.ZodVoid,...ne(e)});var un=class e extends ce{_parse(t){let{ctx:r,status:i}=this._processInputParams(t),n=this._def;if(r.parsedType!==L.array)return M(r,{code:R.invalid_type,expected:L.array,received:r.parsedType}),J;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,s=r.data.length<n.exactLength.value;(a||s)&&(M(r,{code:a?R.too_big:R.too_small,minimum:s?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(M(r,{code:R.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(M(r,{code:R.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>n.type._parseAsync(new Ct(r,a,r.path,s)))).then(a=>nt.mergeArray(i,a));let o=[...r.data].map((a,s)=>n.type._parseSync(new Ct(r,a,r.path,s)));return nt.mergeArray(i,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Z.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Z.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Z.toString(r)}})}nonempty(t){return this.min(1,t)}};un.create=(e,t)=>new un({type:e,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...ne(t)});function no(e){if(e instanceof Pt){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=Xt.create(no(i))}return new Pt({...e._def,shape:()=>t})}else return e instanceof un?new un({...e._def,type:no(e.element)}):e instanceof Xt?Xt.create(no(e.unwrap())):e instanceof Cr?Cr.create(no(e.unwrap())):e instanceof Nr?Nr.create(e.items.map(t=>no(t))):e}var Pt=class e extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=pe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==L.object){let u=this._getOrReturnCtx(t);return M(u,{code:R.invalid_type,expected:L.object,received:u.parsedType}),J}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof gr&&this._def.unknownKeys==="strip"))for(let u in n.data)a.includes(u)||s.push(u);let l=[];for(let u of a){let d=o[u],p=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Ct(n,p,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof gr){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of s)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")s.length>0&&(M(n,{code:R.unrecognized_keys,keys:s}),i.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of s){let p=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Ct(n,p,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let p=await d.key,f=await d.value;u.push({key:p,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>nt.mergeObjectSync(i,u)):nt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(t){return Z.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,i)=>{let n=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:Z.errToObj(t).message??n}:{message:n}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:D.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let i of pe.objectKeys(t))t[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let i of pe.objectKeys(this.shape))t[i]||(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}deepPartial(){return no(this)}partial(t){let r={};for(let i of pe.objectKeys(this.shape)){let n=this.shape[i];t&&!t[i]?r[i]=n:r[i]=n.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let i of pe.objectKeys(this.shape))if(t&&!t[i])r[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Xt;)o=o._def.innerType;r[i]=o}return new e({...this._def,shape:()=>r})}keyof(){return iP(pe.objectKeys(this.shape))}};Pt.create=(e,t)=>new Pt({shape:()=>e,unknownKeys:"strip",catchall:gr.create(),typeName:D.ZodObject,...ne(t)});Pt.strictCreate=(e,t)=>new Pt({shape:()=>e,unknownKeys:"strict",catchall:gr.create(),typeName:D.ZodObject,...ne(t)});Pt.lazycreate=(e,t)=>new Pt({shape:e,unknownKeys:"strip",catchall:gr.create(),typeName:D.ZodObject,...ne(t)});var so=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Et(s.ctx.common.issues));return M(r,{code:R.invalid_union,unionErrors:a}),J}if(r.common.async)return Promise.all(i.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let l of i){let u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new Et(l));return M(r,{code:R.invalid_union,unionErrors:s}),J}}get options(){return this._def.options}};so.create=(e,t)=>new so({options:e,typeName:D.ZodUnion,...ne(t)});var Dr=e=>e instanceof lo?Dr(e.schema):e instanceof er?Dr(e.innerType()):e instanceof uo?[e.value]:e instanceof po?e.options:e instanceof mo?pe.objectValues(e.enum):e instanceof fo?Dr(e._def.innerType):e instanceof oo?[void 0]:e instanceof ao?[null]:e instanceof Xt?[void 0,...Dr(e.unwrap())]:e instanceof Cr?[null,...Dr(e.unwrap())]:e instanceof Xd||e instanceof go?Dr(e.unwrap()):e instanceof ho?Dr(e._def.innerType):[],Xy=class e extends ce{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==L.object)return M(r,{code:R.invalid_type,expected:L.object,received:r.parsedType}),J;let i=this.discriminator,n=r.data[i],o=this.optionsMap.get(n);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){let n=new Map;for(let o of r){let a=Dr(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(n.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);n.set(s,o)}}return new e({typeName:D.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...ne(i)})}};function ev(e,t){let r=jr(e),i=jr(t);if(e===t)return{valid:!0,data:e};if(r===L.object&&i===L.object){let n=pe.objectKeys(t),o=pe.objectKeys(e).filter(s=>n.indexOf(s)!==-1),a={...e,...t};for(let s of o){let l=ev(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===L.array&&i===L.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],l=ev(a,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===L.date&&i===L.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var co=class extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=(o,a)=>{if(Ky(o)||Ky(a))return J;let s=ev(o.value,a.value);return s.valid?((Qy(o)||Qy(a))&&r.dirty(),{status:r.value,value:s.data}):(M(i,{code:R.invalid_intersection_types}),J)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};co.create=(e,t,r)=>new co({left:e,right:t,typeName:D.ZodIntersection,...ne(r)});var Nr=class e extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==L.array)return M(i,{code:R.invalid_type,expected:L.array,received:i.parsedType}),J;if(i.data.length<this._def.items.length)return M(i,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&i.data.length>this._def.items.length&&(M(i,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...i.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ct(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>nt.mergeArray(r,a)):nt.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Nr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nr({items:e,typeName:D.ZodTuple,rest:null,...ne(t)})};var tv=class e extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==L.object)return M(i,{code:R.invalid_type,expected:L.object,received:i.parsedType}),J;let n=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)n.push({key:o._parse(new Ct(i,s,i.path,s)),value:a._parse(new Ct(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?nt.mergeObjectAsync(r,n):nt.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,i){return r instanceof ce?new e({keyType:t,valueType:r,typeName:D.ZodRecord,...ne(i)}):new e({keyType:io.create(),valueType:t,typeName:D.ZodRecord,...ne(r)})}},bs=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==L.map)return M(i,{code:R.invalid_type,expected:L.map,received:i.parsedType}),J;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,l],u)=>({key:n._parse(new Ct(i,s,i.path,[u,"key"])),value:o._parse(new Ct(i,l,i.path,[u,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return J;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let l of a){let u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return J;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}}}};bs.create=(e,t,r)=>new bs({valueType:t,keyType:e,typeName:D.ZodMap,...ne(r)});var _s=class e extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==L.set)return M(i,{code:R.invalid_type,expected:L.set,received:i.parsedType}),J;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(M(i,{code:R.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(M(i,{code:R.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function a(l){let u=new Set;for(let d of l){if(d.status==="aborted")return J;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let s=[...i.data.values()].map((l,u)=>o._parse(new Ct(i,l,i.path,u)));return i.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:Z.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Z.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};_s.create=(e,t)=>new _s({valueType:e,minSize:null,maxSize:null,typeName:D.ZodSet,...ne(t)});var rv=class e extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==L.function)return M(r,{code:R.invalid_type,expected:L.function,received:r.parsedType}),J;function i(s,l){return Yd({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,us(),cn].filter(u=>!!u),issueData:{code:R.invalid_arguments,argumentsError:l}})}function n(s,l){return Yd({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,us(),cn].filter(u=>!!u),issueData:{code:R.invalid_return_type,returnTypeError:l}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof ti){let s=this;return ut(async function(...l){let u=new Et([]),d=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(i(l,h)),u}),p=await Reflect.apply(a,this,d);return await s._def.returns._def.type.parseAsync(p,o).catch(h=>{throw u.addIssue(n(p,h)),u})})}else{let s=this;return ut(function(...l){let u=s._def.args.safeParse(l,o);if(!u.success)throw new Et([i(l,u.error)]);let d=Reflect.apply(a,this,u.data),p=s._def.returns.safeParse(d,o);if(!p.success)throw new Et([n(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Nr.create(t).rest(ln.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new e({args:t||Nr.create([]).rest(ln.create()),returns:r||ln.create(),typeName:D.ZodFunction,...ne(i)})}},lo=class extends ce{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};lo.create=(e,t)=>new lo({getter:e,typeName:D.ZodLazy,...ne(t)});var uo=class extends ce{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return M(r,{received:r.data,code:R.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:t.data}}get value(){return this._def.value}};uo.create=(e,t)=>new uo({value:e,typeName:D.ZodLiteral,...ne(t)});function iP(e,t){return new po({values:e,typeName:D.ZodEnum,...ne(t)})}var po=class e extends ce{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),i=this._def.values;return M(r,{expected:pe.joinValues(i),received:r.parsedType,code:R.invalid_type}),J}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),i=this._def.values;return M(r,{received:r.data,code:R.invalid_enum_value,options:i}),J}return ut(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}};po.create=iP;var mo=class extends ce{_parse(t){let r=pe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==L.string&&i.parsedType!==L.number){let n=pe.objectValues(r);return M(i,{expected:pe.joinValues(n),received:i.parsedType,code:R.invalid_type}),J}if(this._cache||(this._cache=new Set(pe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let n=pe.objectValues(r);return M(i,{received:i.data,code:R.invalid_enum_value,options:n}),J}return ut(t.data)}get enum(){return this._def.values}};mo.create=(e,t)=>new mo({values:e,typeName:D.ZodNativeEnum,...ne(t)});var ti=class extends ce{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==L.promise&&r.common.async===!1)return M(r,{code:R.invalid_type,expected:L.promise,received:r.parsedType}),J;let i=r.parsedType===L.promise?r.data:Promise.resolve(r.data);return ut(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ti.create=(e,t)=>new ti({type:e,typeName:D.ZodPromise,...ne(t)});var er=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:a=>{M(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let a=n.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return J;let l=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return l.status==="aborted"?J:l.status==="dirty"?ro(l.value):r.value==="dirty"?ro(l.value):l});{if(r.value==="aborted")return J;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?J:s.status==="dirty"?ro(s.value):r.value==="dirty"?ro(s.value):s}}if(n.type==="refinement"){let a=s=>{let l=n.refinement(s,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?J:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?J:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ei(a))return J;let s=n.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>ei(a)?Promise.resolve(n.transform(a.value,o)).then(s=>({status:r.value,value:s})):J);pe.assertNever(n)}};er.create=(e,t,r)=>new er({schema:e,typeName:D.ZodEffects,effect:t,...ne(r)});er.createWithPreprocess=(e,t,r)=>new er({schema:t,effect:{type:"preprocess",transform:e},typeName:D.ZodEffects,...ne(r)});var Xt=class extends ce{_parse(t){return this._getType(t)===L.undefined?ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Xt.create=(e,t)=>new Xt({innerType:e,typeName:D.ZodOptional,...ne(t)});var Cr=class extends ce{_parse(t){return this._getType(t)===L.null?ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Cr.create=(e,t)=>new Cr({innerType:e,typeName:D.ZodNullable,...ne(t)});var fo=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return r.parsedType===L.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};fo.create=(e,t)=>new fo({innerType:e,typeName:D.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ne(t)});var ho=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ds(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Et(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Et(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};ho.create=(e,t)=>new ho({innerType:e,typeName:D.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ne(t)});var Ss=class extends ce{_parse(t){if(this._getType(t)!==L.nan){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:L.nan,received:i.parsedType}),J}return{status:"valid",value:t.data}}};Ss.create=e=>new Ss({typeName:D.ZodNaN,...ne(e)});var Xd=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},ep=class e extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?J:o.status==="dirty"?(r.dirty(),ro(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?J:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,r){return new e({in:t,out:r,typeName:D.ZodPipeline})}},go=class extends ce{_parse(t){let r=this._def.innerType._parse(t),i=n=>(ei(n)&&(n.value=Object.freeze(n.value)),n);return ds(r)?r.then(n=>i(n)):i(r)}unwrap(){return this._def.innerType}};go.create=(e,t)=>new go({innerType:e,typeName:D.ZodReadonly,...ne(t)});var YK={object:Pt.lazycreate},D;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(D||(D={}));var XK=io.create,eQ=ps.create,tQ=Ss.create,rQ=ms.create,nQ=fs.create,iQ=hs.create,oQ=gs.create,aQ=oo.create,sQ=ao.create,cQ=ys.create,lQ=ln.create,uQ=gr.create,dQ=vs.create,pQ=un.create,oP=Pt.create,mQ=Pt.strictCreate,fQ=so.create,hQ=Xy.create,gQ=co.create,yQ=Nr.create,vQ=tv.create,bQ=bs.create,_Q=_s.create,SQ=rv.create,xQ=lo.create,wQ=uo.create,$Q=po.create,kQ=mo.create,TQ=ti.create,IQ=er.create,EQ=Xt.create,PQ=Cr.create,zQ=er.createWithPreprocess,RQ=ep.create;var sq=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>Rn(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Gr(e,r,i),e.parseAsync=async(r,i)=>On(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Kr(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>Ve(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.apply=r=>r(e)});var cq=b("ZodMiniObject",(e,t)=>{Ul.init(e,t),sq.init(e,t),te(e,"shape",()=>t.shape)});function nv(e,t){let r={type:"object",shape:e??{},...j(t)};return new cq(r)}function At(e){return!!e._zod}function ri(e){let t=Object.values(e);if(t.length===0)return nv({});let r=t.every(At),i=t.every(n=>!At(n));if(r)return nv(e);if(i)return oP(e);throw new Error("Mixed Zod versions detected in object shape.")}function dn(e,t){return At(e)?Gr(e,t):e.safeParse(t)}async function tp(e,t){return At(e)?await Kr(e,t):await e.safeParseAsync(t)}function pn(e){if(!e)return;let t;if(At(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function yo(e){if(e){if(typeof e=="object"){let t=e,r=e;if(!t._def&&!r._zod){let i=Object.values(e);if(i.length>0&&i.every(n=>typeof n=="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse=="function")))return ri(e)}}if(At(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function rp(e){if(e&&typeof e=="object"){if("message"in e&&typeof e.message=="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t=="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function cP(e){return e.description}function lP(e){if(At(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function np(e){if(At(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.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 i=e.value;if(i!==void 0)return i}var ov="2025-11-25",uP="2025-03-26",bo=[ov,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],mn="io.modelcontextprotocol/related-task",op="2.0",Qe=Dd(e=>e!==null&&(typeof e=="object"||typeof e=="function")),dP=xe([x(),ve().int()]),pP=x(),pY=Je({ttl:xe([ve(),Bi()]).optional(),pollInterval:ve().optional()}),mq=U({ttl:ve().optional()}),fq=U({taskId:x()}),av=Je({progressToken:dP.optional(),[mn]:fq.optional()}),zt=U({_meta:av.optional()}),xs=zt.extend({task:mq.optional()}),mP=e=>xs.safeParse(e).success,Ye=U({method:x(),params:zt.loose().optional()}),Mt=U({_meta:av.optional()}),Ut=U({method:x(),params:Mt.loose().optional()}),Xe=Je({_meta:av.optional()}),ap=xe([x(),ve().int()]),fP=U({jsonrpc:F(op),id:ap,...Ye.shape}).strict(),fn=e=>fP.safeParse(e).success,hP=U({jsonrpc:F(op),...Ut.shape}).strict(),gP=e=>hP.safeParse(e).success,sv=U({jsonrpc:F(op),id:ap,result:Xe}).strict(),Ar=e=>sv.safeParse(e).success;var H;(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"})(H||(H={}));var cv=U({jsonrpc:F(op),id:ap.optional(),error:U({code:ve().int(),message:x(),data:ke().optional()})}).strict();var _o=e=>cv.safeParse(e).success;var ws=xe([fP,hP,sv,cv]),mY=xe([sv,cv]),sp=Xe.strict(),hq=Mt.extend({requestId:ap.optional(),reason:x().optional()}),cp=Ut.extend({method:F("notifications/cancelled"),params:hq}),gq=U({src:x(),mimeType:x().optional(),sizes:se(x()).optional(),theme:Ge(["light","dark"]).optional()}),$s=U({icons:se(gq).optional()}),vo=U({name:x(),title:x().optional()}),yP=vo.extend({...vo.shape,...$s.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),yq=Hi(U({applyDefaults:Ue().optional()}),Ie(x(),ke())),vq=Ya(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Hi(U({form:yq.optional(),url:Qe.optional()}),Ie(x(),ke()).optional())),bq=Je({list:Qe.optional(),cancel:Qe.optional(),requests:Je({sampling:Je({createMessage:Qe.optional()}).optional(),elicitation:Je({create:Qe.optional()}).optional()}).optional()}),_q=Je({list:Qe.optional(),cancel:Qe.optional(),requests:Je({tools:Je({call:Qe.optional()}).optional()}).optional()}),Sq=U({experimental:Ie(x(),Qe).optional(),sampling:U({context:Qe.optional(),tools:Qe.optional()}).optional(),elicitation:vq.optional(),roots:U({listChanged:Ue().optional()}).optional(),tasks:bq.optional()}),xq=zt.extend({protocolVersion:x(),capabilities:Sq,clientInfo:yP}),lp=Ye.extend({method:F("initialize"),params:xq}),lv=e=>lp.safeParse(e).success,wq=U({experimental:Ie(x(),Qe).optional(),logging:Qe.optional(),completions:Qe.optional(),prompts:U({listChanged:Ue().optional()}).optional(),resources:U({subscribe:Ue().optional(),listChanged:Ue().optional()}).optional(),tools:U({listChanged:Ue().optional()}).optional(),tasks:_q.optional()}),$q=Xe.extend({protocolVersion:x(),capabilities:wq,serverInfo:yP,instructions:x().optional()}),uv=Ut.extend({method:F("notifications/initialized"),params:Mt.optional()});var up=Ye.extend({method:F("ping"),params:zt.optional()}),kq=U({progress:ve(),total:ze(ve()),message:ze(x())}),Tq=U({...Mt.shape,...kq.shape,progressToken:dP}),dp=Ut.extend({method:F("notifications/progress"),params:Tq}),Iq=zt.extend({cursor:pP.optional()}),ks=Ye.extend({params:Iq.optional()}),Ts=Xe.extend({nextCursor:pP.optional()}),Eq=Ge(["working","input_required","completed","failed","cancelled"]),Is=U({taskId:x(),status:Eq,ttl:xe([ve(),Bi()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:ze(ve()),statusMessage:ze(x())}),So=Xe.extend({task:Is}),Pq=Mt.merge(Is),Es=Ut.extend({method:F("notifications/tasks/status"),params:Pq}),pp=Ye.extend({method:F("tasks/get"),params:zt.extend({taskId:x()})}),mp=Xe.merge(Is),fp=Ye.extend({method:F("tasks/result"),params:zt.extend({taskId:x()})}),fY=Xe.loose(),hp=ks.extend({method:F("tasks/list")}),gp=Ts.extend({tasks:se(Is)}),yp=Ye.extend({method:F("tasks/cancel"),params:zt.extend({taskId:x()})}),vP=Xe.merge(Is),bP=U({uri:x(),mimeType:ze(x()),_meta:Ie(x(),ke()).optional()}),_P=bP.extend({text:x()}),dv=x().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),SP=bP.extend({blob:dv}),Ps=Ge(["user","assistant"]),xo=U({audience:se(Ps).optional(),priority:ve().min(0).max(1).optional(),lastModified:on.datetime({offset:!0}).optional()}),xP=U({...vo.shape,...$s.shape,uri:x(),description:ze(x()),mimeType:ze(x()),annotations:xo.optional(),_meta:ze(Je({}))}),zq=U({...vo.shape,...$s.shape,uriTemplate:x(),description:ze(x()),mimeType:ze(x()),annotations:xo.optional(),_meta:ze(Je({}))}),vp=ks.extend({method:F("resources/list")}),Rq=Ts.extend({resources:se(xP)}),bp=ks.extend({method:F("resources/templates/list")}),Oq=Ts.extend({resourceTemplates:se(zq)}),pv=zt.extend({uri:x()}),jq=pv,_p=Ye.extend({method:F("resources/read"),params:jq}),Dq=Xe.extend({contents:se(xe([_P,SP]))}),Nq=Ut.extend({method:F("notifications/resources/list_changed"),params:Mt.optional()}),Cq=pv,Aq=Ye.extend({method:F("resources/subscribe"),params:Cq}),Mq=pv,Uq=Ye.extend({method:F("resources/unsubscribe"),params:Mq}),Lq=Mt.extend({uri:x()}),qq=Ut.extend({method:F("notifications/resources/updated"),params:Lq}),Zq=U({name:x(),description:ze(x()),required:ze(Ue())}),Fq=U({...vo.shape,...$s.shape,description:ze(x()),arguments:ze(se(Zq)),_meta:ze(Je({}))}),Sp=ks.extend({method:F("prompts/list")}),Vq=Ts.extend({prompts:se(Fq)}),Bq=zt.extend({name:x(),arguments:Ie(x(),x()).optional()}),xp=Ye.extend({method:F("prompts/get"),params:Bq}),mv=U({type:F("text"),text:x(),annotations:xo.optional(),_meta:Ie(x(),ke()).optional()}),fv=U({type:F("image"),data:dv,mimeType:x(),annotations:xo.optional(),_meta:Ie(x(),ke()).optional()}),hv=U({type:F("audio"),data:dv,mimeType:x(),annotations:xo.optional(),_meta:Ie(x(),ke()).optional()}),Hq=U({type:F("tool_use"),name:x(),id:x(),input:Ie(x(),ke()),_meta:Ie(x(),ke()).optional()}),Wq=U({type:F("resource"),resource:xe([_P,SP]),annotations:xo.optional(),_meta:Ie(x(),ke()).optional()}),Jq=xP.extend({type:F("resource_link")}),gv=xe([mv,fv,hv,Jq,Wq]),Gq=U({role:Ps,content:gv}),Kq=Xe.extend({description:x().optional(),messages:se(Gq)}),Qq=Ut.extend({method:F("notifications/prompts/list_changed"),params:Mt.optional()}),Yq=U({title:x().optional(),readOnlyHint:Ue().optional(),destructiveHint:Ue().optional(),idempotentHint:Ue().optional(),openWorldHint:Ue().optional()}),Xq=U({taskSupport:Ge(["required","optional","forbidden"]).optional()}),wP=U({...vo.shape,...$s.shape,description:x().optional(),inputSchema:U({type:F("object"),properties:Ie(x(),Qe).optional(),required:se(x()).optional()}).catchall(ke()),outputSchema:U({type:F("object"),properties:Ie(x(),Qe).optional(),required:se(x()).optional()}).catchall(ke()).optional(),annotations:Yq.optional(),execution:Xq.optional(),_meta:Ie(x(),ke()).optional()}),wp=ks.extend({method:F("tools/list")}),eZ=Ts.extend({tools:se(wP)}),$p=Xe.extend({content:se(gv).default([]),structuredContent:Ie(x(),ke()).optional(),isError:Ue().optional()}),hY=$p.or(Xe.extend({toolResult:ke()})),tZ=xs.extend({name:x(),arguments:Ie(x(),ke()).optional()}),wo=Ye.extend({method:F("tools/call"),params:tZ}),rZ=Ut.extend({method:F("notifications/tools/list_changed"),params:Mt.optional()}),gY=U({autoRefresh:Ue().default(!0),debounceMs:ve().int().nonnegative().default(300)}),zs=Ge(["debug","info","notice","warning","error","critical","alert","emergency"]),nZ=zt.extend({level:zs}),yv=Ye.extend({method:F("logging/setLevel"),params:nZ}),iZ=Mt.extend({level:zs,logger:x().optional(),data:ke()}),oZ=Ut.extend({method:F("notifications/message"),params:iZ}),aZ=U({name:x().optional()}),sZ=U({hints:se(aZ).optional(),costPriority:ve().min(0).max(1).optional(),speedPriority:ve().min(0).max(1).optional(),intelligencePriority:ve().min(0).max(1).optional()}),cZ=U({mode:Ge(["auto","required","none"]).optional()}),lZ=U({type:F("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:se(gv).default([]),structuredContent:U({}).loose().optional(),isError:Ue().optional(),_meta:Ie(x(),ke()).optional()}),uZ=Ga("type",[mv,fv,hv]),ip=Ga("type",[mv,fv,hv,Hq,lZ]),dZ=U({role:Ps,content:xe([ip,se(ip)]),_meta:Ie(x(),ke()).optional()}),pZ=xs.extend({messages:se(dZ),modelPreferences:sZ.optional(),systemPrompt:x().optional(),includeContext:Ge(["none","thisServer","allServers"]).optional(),temperature:ve().optional(),maxTokens:ve().int(),stopSequences:se(x()).optional(),metadata:Qe.optional(),tools:se(wP).optional(),toolChoice:cZ.optional()}),mZ=Ye.extend({method:F("sampling/createMessage"),params:pZ}),Rs=Xe.extend({model:x(),stopReason:ze(Ge(["endTurn","stopSequence","maxTokens"]).or(x())),role:Ps,content:uZ}),vv=Xe.extend({model:x(),stopReason:ze(Ge(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:Ps,content:xe([ip,se(ip)])}),fZ=U({type:F("boolean"),title:x().optional(),description:x().optional(),default:Ue().optional()}),hZ=U({type:F("string"),title:x().optional(),description:x().optional(),minLength:ve().optional(),maxLength:ve().optional(),format:Ge(["email","uri","date","date-time"]).optional(),default:x().optional()}),gZ=U({type:Ge(["number","integer"]),title:x().optional(),description:x().optional(),minimum:ve().optional(),maximum:ve().optional(),default:ve().optional()}),yZ=U({type:F("string"),title:x().optional(),description:x().optional(),enum:se(x()),default:x().optional()}),vZ=U({type:F("string"),title:x().optional(),description:x().optional(),oneOf:se(U({const:x(),title:x()})),default:x().optional()}),bZ=U({type:F("string"),title:x().optional(),description:x().optional(),enum:se(x()),enumNames:se(x()).optional(),default:x().optional()}),_Z=xe([yZ,vZ]),SZ=U({type:F("array"),title:x().optional(),description:x().optional(),minItems:ve().optional(),maxItems:ve().optional(),items:U({type:F("string"),enum:se(x())}),default:se(x()).optional()}),xZ=U({type:F("array"),title:x().optional(),description:x().optional(),minItems:ve().optional(),maxItems:ve().optional(),items:U({anyOf:se(U({const:x(),title:x()}))}),default:se(x()).optional()}),wZ=xe([SZ,xZ]),$Z=xe([bZ,_Z,wZ]),kZ=xe([$Z,fZ,hZ,gZ]),TZ=xs.extend({mode:F("form").optional(),message:x(),requestedSchema:U({type:F("object"),properties:Ie(x(),kZ),required:se(x()).optional()})}),IZ=xs.extend({mode:F("url"),message:x(),elicitationId:x(),url:x().url()}),EZ=xe([TZ,IZ]),PZ=Ye.extend({method:F("elicitation/create"),params:EZ}),zZ=Mt.extend({elicitationId:x()}),RZ=Ut.extend({method:F("notifications/elicitation/complete"),params:zZ}),$o=Xe.extend({action:Ge(["accept","decline","cancel"]),content:Ya(e=>e===null?void 0:e,Ie(x(),xe([x(),ve(),Ue(),se(x())])).optional())}),OZ=U({type:F("ref/resource"),uri:x()});var jZ=U({type:F("ref/prompt"),name:x()}),DZ=zt.extend({ref:xe([jZ,OZ]),argument:U({name:x(),value:x()}),context:U({arguments:Ie(x(),x()).optional()}).optional()}),kp=Ye.extend({method:F("completion/complete"),params:DZ});function $P(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function kP(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var NZ=Xe.extend({completion:Je({values:se(x()).max(100),total:ze(ve().int()),hasMore:ze(Ue())})}),CZ=U({uri:x().startsWith("file://"),name:x().optional(),_meta:Ie(x(),ke()).optional()}),AZ=Ye.extend({method:F("roots/list"),params:zt.optional()}),bv=Xe.extend({roots:se(CZ)}),MZ=Ut.extend({method:F("notifications/roots/list_changed"),params:Mt.optional()}),yY=xe([up,lp,kp,yv,xp,Sp,vp,bp,_p,Aq,Uq,wo,wp,pp,fp,hp,yp]),vY=xe([cp,dp,uv,MZ,Es]),bY=xe([sp,Rs,vv,$o,bv,mp,gp,So]),_Y=xe([up,mZ,PZ,AZ,pp,fp,hp,yp]),SY=xe([cp,dp,oZ,qq,Nq,rZ,Qq,Es,RZ]),xY=xe([sp,$q,NZ,Kq,Vq,Rq,Oq,Dq,$p,eZ,mp,gp,So]),V=class e extends Error{constructor(t,r,i){super(`MCP error ${t}: ${r}`),this.code=t,this.data=i,this.name="McpError"}static fromError(t,r,i){if(t===H.UrlElicitationRequired&&i){let n=i;if(n.elicitations)return new iv(n.elicitations,r)}return new e(t,r,i)}},iv=class extends V{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(H.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function hn(e){return e==="completed"||e==="failed"||e==="cancelled"}var IP=Symbol("Let zodToJsonSchema decide on which parser to use");var TP={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},EP=e=>typeof e=="string"?{...TP,name:e}:{...TP,...e};var PP=e=>{let t=EP(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function _v(e,t,r,i){i?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function me(e,t,r,i,n){e[t]=r,_v(e,t,i,n)}var Tp=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function Ce(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Tp(t,e.currentPath):t.join("/")}}function zP(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==D.ZodAny&&(r.items=G(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&me(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&me(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(me(r,"minItems",e.exactLength.value,e.exactLength.message,t),me(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function RP(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"min":t.target==="jsonSchema7"?i.inclusive?me(r,"minimum",i.value,i.message,t):me(r,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(r.exclusiveMinimum=!0),me(r,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?me(r,"maximum",i.value,i.message,t):me(r,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(r.exclusiveMaximum=!0),me(r,"maximum",i.value,i.message,t));break;case"multipleOf":me(r,"multipleOf",i.value,i.message,t);break}return r}function OP(){return{type:"boolean"}}function Ip(e,t){return G(e.type._def,t)}var jP=(e,t)=>G(e.innerType._def,t);function Sv(e,t,r){let i=r??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>Sv(e,t,n))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return UZ(e,t)}}var UZ=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let i of e.checks)switch(i.kind){case"min":me(r,"minimum",i.value,i.message,t);break;case"max":me(r,"maximum",i.value,i.message,t);break}return r};function DP(e,t){return{...G(e.innerType._def,t),default:e.defaultValue()}}function NP(e,t){return t.effectStrategy==="input"?G(e.schema._def,t):Ce(t)}function CP(e){return{type:"string",enum:Array.from(e.values)}}var LZ=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function AP(e,t){let r=[G(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),G(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(o=>{if(LZ(o))n.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let a=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:s,...l}=o;a=l}else i=void 0;n.push(a)}}),n.length?{allOf:n,...i}:void 0}function MP(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var xv,tr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(xv===void 0&&(xv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),xv),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ep(e,t){let r={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":me(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,t);break;case"max":me(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":rr(r,"email",i.message,t);break;case"format:idn-email":rr(r,"idn-email",i.message,t);break;case"pattern:zod":dt(r,tr.email,i.message,t);break}break;case"url":rr(r,"uri",i.message,t);break;case"uuid":rr(r,"uuid",i.message,t);break;case"regex":dt(r,i.regex,i.message,t);break;case"cuid":dt(r,tr.cuid,i.message,t);break;case"cuid2":dt(r,tr.cuid2,i.message,t);break;case"startsWith":dt(r,RegExp(`^${wv(i.value,t)}`),i.message,t);break;case"endsWith":dt(r,RegExp(`${wv(i.value,t)}$`),i.message,t);break;case"datetime":rr(r,"date-time",i.message,t);break;case"date":rr(r,"date",i.message,t);break;case"time":rr(r,"time",i.message,t);break;case"duration":rr(r,"duration",i.message,t);break;case"length":me(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,t),me(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"includes":{dt(r,RegExp(wv(i.value,t)),i.message,t);break}case"ip":{i.version!=="v6"&&rr(r,"ipv4",i.message,t),i.version!=="v4"&&rr(r,"ipv6",i.message,t);break}case"base64url":dt(r,tr.base64url,i.message,t);break;case"jwt":dt(r,tr.jwt,i.message,t);break;case"cidr":{i.version!=="v6"&&dt(r,tr.ipv4Cidr,i.message,t),i.version!=="v4"&&dt(r,tr.ipv6Cidr,i.message,t);break}case"emoji":dt(r,tr.emoji(),i.message,t);break;case"ulid":{dt(r,tr.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{rr(r,"binary",i.message,t);break}case"contentEncoding:base64":{me(r,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{dt(r,tr.base64,i.message,t);break}}break}case"nanoid":dt(r,tr.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function wv(e,t){return t.patternStrategy==="escape"?ZZ(e):e}var qZ=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ZZ(e){let t="";for(let r=0;r<e.length;r++)qZ.has(e[r])||(t+="\\"),t+=e[r];return t}function rr(e,t,r,i){e.format||e.anyOf?.some(n=>n.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&i.errorMessages&&{errorMessage:{format:r}}})):me(e,"format",t,r,i)}function dt(e,t,r,i){e.pattern||e.allOf?.some(n=>n.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:UP(t,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):me(e,"pattern",UP(t,i),r,i)}function UP(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source,n="",o=!1,a=!1,s=!1;for(let l=0;l<i.length;l++){if(o){n+=i[l],o=!1;continue}if(r.i){if(a){if(i[l].match(/[a-z]/)){s?(n+=i[l],n+=`${i[l-2]}-${i[l]}`.toUpperCase(),s=!1):i[l+1]==="-"&&i[l+2]?.match(/[a-z]/)?(n+=i[l],s=!0):n+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){n+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){n+=`(^|(?<=[\r
79
- ]))`;continue}else if(i[l]==="$"){n+=`($|(?=[\r
80
- ]))`;continue}}if(r.s&&i[l]==="."){n+=a?`${i[l]}\r
81
- `:`[${i[l]}\r
82
- ]`;continue}n+=i[l],i[l]==="\\"?o=!0:a&&i[l]==="]"?a=!1:!a&&i[l]==="["&&(a=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function Pp(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===D.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((i,n)=>({...i,[n]:G(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??Ce(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:G(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===D.ZodString&&e.keyType._def.checks?.length){let{type:i,...n}=Ep(e.keyType._def,t);return{...r,propertyNames:n}}else{if(e.keyType?._def.typeName===D.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===D.ZodBranded&&e.keyType._def.type._def.typeName===D.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...n}=Ip(e.keyType._def,t);return{...r,propertyNames:n}}}return r}function LP(e,t){if(t.mapStrategy==="record")return Pp(e,t);let r=G(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ce(t),i=G(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ce(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}function qP(e){let t=e.values,i=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),n=Array.from(new Set(i.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:i}}function ZP(e){return e.target==="openAi"?void 0:{not:Ce({...e,currentPath:[...e.currentPath,"not"]})}}function FP(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Os={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function BP(e,t){if(t.target==="openApi3")return VP(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(i=>i._def.typeName in Os&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let a=Os[o._def.typeName];return a&&!n.includes(a)?[...n,a]:n},[]);return{type:i.length>1?i:i[0]}}else if(r.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=r.reduce((n,o)=>{let a=typeof o._def.value;switch(a){case"string":case"number":case"boolean":return[...n,a];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];default:return n}},[]);if(i.length===r.length){let n=i.filter((o,a,s)=>s.indexOf(o)===a);return{type:n.length>1?n:n[0],enum:r.reduce((o,a)=>o.includes(a._def.value)?o:[...o,a._def.value],[])}}}else if(r.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((i,n)=>[...i,...n._def.values.filter(o=>!i.includes(o))],[])};return VP(e,t)}var VP=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,n)=>G(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(i=>!!i&&(!t.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0};function HP(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Os[e.innerType._def.typeName],nullable:!0}:{type:[Os[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let i=G(e.innerType._def,{...t,currentPath:[...t.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let r=G(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function WP(e,t){let r={type:"number"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"int":r.type="integer",_v(r,"type",i.message,t);break;case"min":t.target==="jsonSchema7"?i.inclusive?me(r,"minimum",i.value,i.message,t):me(r,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(r.exclusiveMinimum=!0),me(r,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?me(r,"maximum",i.value,i.message,t):me(r,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(r.exclusiveMaximum=!0),me(r,"maximum",i.value,i.message,t));break;case"multipleOf":me(r,"multipleOf",i.value,i.message,t);break}return r}function JP(e,t){let r=t.target==="openAi",i={type:"object",properties:{}},n=[],o=e.shape();for(let s in o){let l=o[s];if(l===void 0||l._def===void 0)continue;let u=VZ(l);u&&r&&(l._def.typeName==="ZodOptional"&&(l=l._def.innerType),l.isNullable()||(l=l.nullable()),u=!1);let d=G(l._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});d!==void 0&&(i.properties[s]=d,u||n.push(s))}n.length&&(i.required=n);let a=FZ(e,t);return a!==void 0&&(i.additionalProperties=a),i}function FZ(e,t){if(e.catchall._def.typeName!=="ZodNever")return G(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function VZ(e){try{return e.isOptional()}catch{return!0}}var GP=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return G(e.innerType._def,t);let r=G(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ce(t)},r]}:Ce(t)};var KP=(e,t)=>{if(t.pipeStrategy==="input")return G(e.in._def,t);if(t.pipeStrategy==="output")return G(e.out._def,t);let r=G(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=G(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter(n=>n!==void 0)}};function QP(e,t){return G(e.type._def,t)}function YP(e,t){let i={type:"array",uniqueItems:!0,items:G(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&me(i,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&me(i,"maxItems",e.maxSize.value,e.maxSize.message,t),i}function XP(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,i)=>G(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:G(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,i)=>G(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}function ez(e){return{not:Ce(e)}}function tz(e){return Ce(e)}var rz=(e,t)=>G(e.innerType._def,t);var nz=(e,t,r)=>{switch(t){case D.ZodString:return Ep(e,r);case D.ZodNumber:return WP(e,r);case D.ZodObject:return JP(e,r);case D.ZodBigInt:return RP(e,r);case D.ZodBoolean:return OP();case D.ZodDate:return Sv(e,r);case D.ZodUndefined:return ez(r);case D.ZodNull:return FP(r);case D.ZodArray:return zP(e,r);case D.ZodUnion:case D.ZodDiscriminatedUnion:return BP(e,r);case D.ZodIntersection:return AP(e,r);case D.ZodTuple:return XP(e,r);case D.ZodRecord:return Pp(e,r);case D.ZodLiteral:return MP(e,r);case D.ZodEnum:return CP(e);case D.ZodNativeEnum:return qP(e);case D.ZodNullable:return HP(e,r);case D.ZodOptional:return GP(e,r);case D.ZodMap:return LP(e,r);case D.ZodSet:return YP(e,r);case D.ZodLazy:return()=>e.getter()._def;case D.ZodPromise:return QP(e,r);case D.ZodNaN:case D.ZodNever:return ZP(r);case D.ZodEffects:return NP(e,r);case D.ZodAny:return Ce(r);case D.ZodUnknown:return tz(r);case D.ZodDefault:return DP(e,r);case D.ZodBranded:return Ip(e,r);case D.ZodReadonly:return rz(e,r);case D.ZodCatch:return jP(e,r);case D.ZodPipeline:return KP(e,r);case D.ZodFunction:case D.ZodVoid:case D.ZodSymbol:return;default:return(i=>{})(t)}};function G(e,t,r=!1){let i=t.seen.get(e);if(t.override){let s=t.override?.(e,t,i,r);if(s!==IP)return s}if(i&&!r){let s=BZ(i,t);if(s!==void 0)return s}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let o=nz(e,e.typeName,t),a=typeof o=="function"?G(o(),t):o;if(a&&HZ(e,t,a),t.postProcess){let s=t.postProcess(a,e,t);return n.jsonSchema=a,s}return n.jsonSchema=a,a}var BZ=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Tp(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,i)=>t.currentPath[i]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Ce(t)):t.$refStrategy==="seen"?Ce(t):void 0}},HZ=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var $v=(e,t)=>{let r=PP(t),i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((l,[u,d])=>({...l,[u]:G(d._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Ce(r)}),{}):void 0,n=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=G(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Ce(r),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(o.title=a),r.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[r.openAiAnyTypeName]||(i[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let s=n===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...i,[n]:o}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s};function WZ(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function kv(e,t){return At(e)?Hn(e,{target:WZ(t?.target),io:t?.pipeStrategy??"input"}):$v(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function Tv(e){let r=pn(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=np(r);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function Iv(e,t){let r=dn(e,t);if(!r.success)throw r.error;return r.data}var JZ=6e4,zp=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(cp,r=>{this._oncancel(r)}),this.setNotificationHandler(dp,r=>{this._onprogress(r)}),this.setRequestHandler(up,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pp,async(r,i)=>{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new V(H.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(fp,async(r,i)=>{let n=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(s.type==="response"||s.type==="error"){let l=s.message,u=l.id,d=this._requestResolvers.get(u);if(d)if(this._requestResolvers.delete(u),s.type==="response")d(l);else{let p=l,f=new V(p.error.code,p.error.message,p.error.data);d(f)}else{let p=s.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${u}`))}continue}await this._transport?.send(s.message,{relatedRequestId:i.requestId})}}let a=await this._taskStore.getTask(o,i.sessionId);if(!a)throw new V(H.InvalidParams,`Task not found: ${o}`);if(!hn(a.status))return await this._waitForTaskUpdate(o,i.signal),await n();if(hn(a.status)){let s=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...s,_meta:{...s._meta,[mn]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(hp,async(r,i)=>{try{let{tasks:n,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,i.sessionId);return{tasks:n,nextCursor:o,_meta:{}}}catch(n){throw new V(H.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(yp,async(r,i)=>{try{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new V(H.InvalidParams,`Task not found: ${r.params.taskId}`);if(hn(n.status))throw new V(H.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!o)throw new V(H.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof V?n:new V(H.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,i,n,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let i=Date.now()-r.startTime;if(r.maxTotalTimeout&&i>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),V.fromError(H.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:i});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 i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let n=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{n?.(o,a),Ar(o)||_o(o)?this._onresponse(o):fn(o)?this._onrequest(o,a):gP(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let r=V.fromError(H.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of t.values())i(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(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(t,r){let i=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,n=this._transport,o=t.params?._meta?.[mn]?.taskId;if(i===void 0){let d={jsonrpc:"2.0",id:t.id,error:{code:H.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},n?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):n?.send(d).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);let s=mP(t.params)?t.params.task:void 0,l=this._taskStore?this.requestTaskStore(t,n?.sessionId):void 0,u={signal:a.signal,sessionId:n?.sessionId,_meta:t.params?._meta,sendNotification:async d=>{if(a.signal.aborted)return;let p={relatedRequestId:t.id};o&&(p.relatedTask={taskId:o}),await this.notification(d,p)},sendRequest:async(d,p,f)=>{if(a.signal.aborted)throw new V(H.ConnectionClosed,"Request was cancelled");let h={...f,relatedRequestId:t.id};o&&!h.relatedTask&&(h.relatedTask={taskId:o});let m=h.relatedTask?.taskId??o;return m&&l&&await l.updateTaskStatus(m,"input_required"),await this.request(d,p,h)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:o,taskStore:l,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(t.method)}).then(()=>i(t,u)).then(async d=>{if(a.signal.aborted)return;let p={result:d,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:p,timestamp:Date.now()},n?.sessionId):await n?.send(p)},async d=>{if(a.signal.aborted)return;let p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(d.code)?d.code:H.InternalError,message:d.message??"Internal error",...d.data!==void 0&&{data:d.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},n?.sessionId):await n?.send(p)}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...i}=t.params,n=Number(r),o=this._progressHandlers.get(n);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let a=this._responseHandlers.get(n),s=this._timeoutInfo.get(n);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(l){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),a(l);return}o(i)}_onresponse(t){let r=Number(t.id),i=this._requestResolvers.get(r);if(i){if(this._requestResolvers.delete(r),Ar(t))i(t);else{let a=new V(t.error.code,t.error.message,t.error.data);i(a)}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 o=!1;if(Ar(t)&&t.result&&typeof t.result=="object"){let a=t.result;if(a.task&&typeof a.task=="object"){let s=a.task;typeof s.taskId=="string"&&(o=!0,this._taskProgressTokens.set(s.taskId,r))}}if(o||this._progressHandlers.delete(r),Ar(t))n(t);else{let a=V.fromError(t.error.code,t.error.message,t.error.data);n(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,i){let{task:n}=i??{};if(!n){try{yield{type:"result",result:await this.request(t,r,i)}}catch(a){yield{type:"error",error:a instanceof V?a:new V(H.InternalError,String(a))}}return}let o;try{let a=await this.request(t,So,i);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new V(H.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:s},hn(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)}:s.status==="failed"?yield{type:"error",error:new V(H.InternalError,`Task ${o} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new V(H.InternalError,`Task ${o} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)};return}let l=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,l)),i?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof V?a:new V(H.InternalError,String(a))}}}request(t,r,i){let{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a,task:s,relatedTask:l}=i??{};return new Promise((u,d)=>{let p=w=>{d(w)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(w){p(w);return}i?.signal?.throwIfAborted();let f=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:f};i?.onprogress&&(this._progressHandlers.set(f,i.onprogress),h.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),s&&(h.params={...h.params,task:s}),l&&(h.params={...h.params,_meta:{...h.params?._meta||{},[mn]:l}});let m=w=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(w)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a}).catch(E=>this._onerror(new Error(`Failed to send cancellation: ${E}`)));let $=w instanceof V?w:new V(H.RequestTimeout,String(w));d($)};this._responseHandlers.set(f,w=>{if(!i?.signal?.aborted){if(w instanceof Error)return d(w);try{let $=dn(r,w.result);$.success?u($.data):d($.error)}catch($){d($)}}}),i?.signal?.addEventListener("abort",()=>{m(i?.signal?.reason)});let g=i?.timeout??JZ,v=()=>m(V.fromError(H.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(f,g,i?.maxTotalTimeout,v,i?.resetTimeoutOnProgress??!1);let _=l?.taskId;if(_){let w=$=>{let E=this._responseHandlers.get(f);E?E($):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,w),this._enqueueTaskMessage(_,{type:"request",message:h,timestamp:Date.now()}).catch($=>{this._cleanupTimeout(f),d($)})}else this._transport.send(h,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a}).catch(w=>{this._cleanupTimeout(f),d(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},mp,r)}async getTaskResult(t,r,i){return this.request({method:"tasks/result",params:t},r,i)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},gp,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},vP,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let i=r?.relatedTask?.taskId;if(i){let s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[mn]:r.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:s,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 s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[mn]:r.relatedTask}}}),this._transport?.send(s,r).catch(l=>this._onerror(l))});return}let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[mn]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(t,r){let i=Tv(t);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(n,o)=>{let a=Iv(t,n);return Promise.resolve(r(a,o))})}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 i=Tv(t);this._notificationHandlers.set(i,n=>{let o=Iv(t,n);return Promise.resolve(r(o))})}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,i){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,i,n)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(t,r);for(let n of i)if(n.type==="request"&&fn(n.message)){let o=n.message.id,a=this._requestResolvers.get(o);a?(a(new V(H.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let i=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(t);n?.pollInterval&&(i=n.pollInterval)}catch{}return new Promise((n,o)=>{if(r.aborted){o(new V(H.InvalidRequest,"Request cancelled"));return}let a=setTimeout(n,i);r.addEventListener("abort",()=>{clearTimeout(a),o(new V(H.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async n=>{if(!t)throw new Error("No request provided");return await i.createTask(n,t.id,{method:t.method,params:t.params},r)},getTask:async n=>{let o=await i.getTask(n,r);if(!o)throw new V(H.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,a)=>{await i.storeTaskResult(n,o,a,r);let s=await i.getTask(n,r);if(s){let l=Es.parse({method:"notifications/tasks/status",params:s});await this.notification(l),hn(s.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>i.getTaskResult(n,r),updateTaskStatus:async(n,o,a)=>{let s=await i.getTask(n,r);if(!s)throw new V(H.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(hn(s.status))throw new V(H.InvalidParams,`Cannot update task "${n}" from terminal status "${s.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(n,o,a,r);let l=await i.getTask(n,r);if(l){let u=Es.parse({method:"notifications/tasks/status",params:l});await this.notification(u),hn(l.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>i.listTasks(n,r)}}};function iz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function oz(e,t){let r={...e};for(let i in t){let n=i,o=t[n];if(o===void 0)continue;let a=r[n];iz(a)&&iz(o)?r[n]={...a,...o}:r[n]=o}return r}var BR=Vt(p_(),1),HR=Vt(VR(),1);function UB(){let e=new BR.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,HR.default)(e),e}var pm=class{constructor(t){this._ajv=t??UB()}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 i=>r(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var mm=class{constructor(t){this._server=t}requestStream(t,r,i){return this._server.requestStream(t,r,i)}createMessageStream(t,r){let i=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],a=o.some(d=>d.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,l=s?Array.isArray(s.content)?s.content:[s.content]:[],u=l.some(d=>d.type==="tool_use");if(a){if(o.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(f=>f.type==="tool_use").map(f=>f.id)),p=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(d.size!==p.size||![...d].every(f=>p.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},Rs,r)}elicitInputStream(t,r){let i=this._server.getClientCapabilities(),n=t.mode??"form";switch(n){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=n==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:o},$o,r)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,i){return this._server.getTaskResult({taskId:t},r,i)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function WR(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 JR(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}}var fm=class extends zp{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(zs.options.map((i,n)=>[i,n])),this.isMessageIgnored=(i,n)=>{let o=this._loggingLevels.get(n);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new pm,this.setRequestHandler(lp,i=>this._oninitialize(i)),this.setNotificationHandler(uv,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(yv,async(i,n)=>{let o=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=i.params,s=zs.safeParse(a);return s.success&&this._loggingLevels.set(o,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new mm(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=oz(this._capabilities,t)}setRequestHandler(t,r){let n=pn(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let o;if(At(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let s=async(l,u)=>{let d=dn(wo,l);if(!d.success){let m=d.error instanceof Error?d.error.message:String(d.error);throw new V(H.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:p}=d.data,f=await Promise.resolve(r(l,u));if(p.task){let m=dn(So,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new V(H.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=dn($p,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new V(H.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){JR(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&WR(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:bo.includes(r)?r:ov,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},sp)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let i=t.messages[t.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some(u=>u.type==="tool_result"),a=t.messages.length>1?t.messages[t.messages.length-2]:void 0,s=a?Array.isArray(a.content)?a.content:[a.content]:[],l=s.some(u=>u.type==="tool_use");if(o){if(n.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(s.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(n.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(u.size!==d.size||![...u].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},vv,r):this.request({method:"sampling/createMessage",params:t},Rs,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=t;return this.request({method:"elicitation/create",params:n},$o,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:n},$o,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new V(H.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof V?a:new V(H.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},bv,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var KR=Symbol.for("mcp.completable");function __(e){return!!e&&typeof e=="object"&&KR in e}function QR(e){return e[KR]?.complete}var GR;(function(e){e.Completable="McpCompletable"})(GR||(GR={}));var LB=/^[A-Za-z0-9._-]{1,128}$/;function qB(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!LB.test(e)){let r=e.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return t.push(`Tool name contains invalid characters: ${r.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function ZB(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function S_(e){let t=qB(e);return ZB(e,t.warnings),t.isValid}var hm=class{constructor(t){this._mcpServer=t}registerToolTask(t,r,i){let n={taskSupport:"required",...r.execution};if(n.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,n,r._meta,i)}};var lc=class{constructor(t,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new fm(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new hm(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler($n(wp)),this.server.assertCanSetRequestHandler($n(wo)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(wp,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,r])=>{let i={name:t,title:r.title,description:r.description,inputSchema:(()=>{let n=yo(r.inputSchema);return n?kv(n,{strictUnions:!0,pipeStrategy:"input"}):FB})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let n=yo(r.outputSchema);n&&(i.outputSchema=kv(n,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(wo,async(t,r)=>{try{let i=this._registeredTools[t.params.name];if(!i)throw new V(H.InvalidParams,`Tool ${t.params.name} not found`);if(!i.enabled)throw new V(H.InvalidParams,`Tool ${t.params.name} disabled`);let n=!!t.params.task,o=i.execution?.taskSupport,a="createTask"in i.handler;if((o==="required"||o==="optional")&&!a)throw new V(H.InternalError,`Tool ${t.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!n)throw new V(H.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!n&&a)return await this.handleAutomaticTaskPolling(i,t,r);let s=await this.validateToolInput(i,t.params.arguments,t.params.name),l=await this.executeToolHandler(i,s,r);return n||await this.validateToolOutput(i,l,t.params.name),l}catch(i){if(i instanceof V&&i.code===H.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,r,i){if(!t.inputSchema)return;let o=yo(t.inputSchema)??t.inputSchema,a=await tp(o,r);if(!a.success){let s="error"in a?a.error:"Unknown error",l=rp(s);throw new V(H.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${l}`)}return a.data}async validateToolOutput(t,r,i){if(!t.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new V(H.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let n=yo(t.outputSchema),o=await tp(n,r.structuredContent);if(!o.success){let a="error"in o?o.error:"Unknown error",s=rp(a);throw new V(H.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${s}`)}}async executeToolHandler(t,r,i){let n=t.handler;if("createTask"in n){if(!i.taskStore)throw new Error("No task store provided.");let a={...i,taskStore:i.taskStore};if(t.inputSchema){let s=n;return await Promise.resolve(s.createTask(r,a))}else{let s=n;return await Promise.resolve(s.createTask(a))}}if(t.inputSchema){let a=n;return await Promise.resolve(a(r,i))}else{let a=n;return await Promise.resolve(a(i))}}async handleAutomaticTaskPolling(t,r,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let n=await this.validateToolInput(t,r.params.arguments,r.params.name),o=t.handler,a={...i,taskStore:i.taskStore},s=n?await Promise.resolve(o.createTask(n,a)):await Promise.resolve(o.createTask(a)),l=s.task.taskId,u=s.task,d=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(f=>setTimeout(f,d));let p=await i.taskStore.getTask(l);if(!p)throw new V(H.InternalError,`Task ${l} not found during polling`);u=p}return await i.taskStore.getTaskResult(l)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler($n(kp)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(kp,async t=>{switch(t.params.ref.type){case"ref/prompt":return $P(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return kP(t),this.handleResourceCompletion(t,t.params.ref);default:throw new V(H.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,r){let i=this._registeredPrompts[r.name];if(!i)throw new V(H.InvalidParams,`Prompt ${r.name} not found`);if(!i.enabled)throw new V(H.InvalidParams,`Prompt ${r.name} disabled`);if(!i.argsSchema)return cc;let o=pn(i.argsSchema)?.[t.params.argument.name];if(!__(o))return cc;let a=QR(o);if(!a)return cc;let s=await a(t.params.argument.value,t.params.context);return XR(s)}async handleResourceCompletion(t,r){let i=Object.values(this._registeredResourceTemplates).find(a=>a.resourceTemplate.uriTemplate.toString()===r.uri);if(!i){if(this._registeredResources[r.uri])return cc;throw new V(H.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let n=i.resourceTemplate.completeCallback(t.params.argument.name);if(!n)return cc;let o=await n(t.params.argument.value,t.params.context);return XR(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler($n(vp)),this.server.assertCanSetRequestHandler($n(bp)),this.server.assertCanSetRequestHandler($n(_p)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(vp,async(t,r)=>{let i=Object.entries(this._registeredResources).filter(([o,a])=>a.enabled).map(([o,a])=>({uri:o,name:a.name,...a.metadata})),n=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let a=await o.resourceTemplate.listCallback(r);for(let s of a.resources)n.push({...o.metadata,...s})}return{resources:[...i,...n]}}),this.server.setRequestHandler(bp,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,i])=>({name:r,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(_p,async(t,r)=>{let i=new URL(t.params.uri),n=this._registeredResources[i.toString()];if(n){if(!n.enabled)throw new V(H.InvalidParams,`Resource ${i} disabled`);return n.readCallback(i,r)}for(let o of Object.values(this._registeredResourceTemplates)){let a=o.resourceTemplate.uriTemplate.match(i.toString());if(a)return o.readCallback(i,a,r)}throw new V(H.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler($n(Sp)),this.server.assertCanSetRequestHandler($n(xp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Sp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?BB(r.argsSchema):void 0}))})),this.server.setRequestHandler(xp,async(t,r)=>{let i=this._registeredPrompts[t.params.name];if(!i)throw new V(H.InvalidParams,`Prompt ${t.params.name} not found`);if(!i.enabled)throw new V(H.InvalidParams,`Prompt ${t.params.name} disabled`);if(i.argsSchema){let n=yo(i.argsSchema),o=await tp(n,t.params.arguments);if(!o.success){let l="error"in o?o.error:"Unknown error",u=rp(l);throw new V(H.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}let a=o.data,s=i.callback;return await Promise.resolve(s(a,r))}else{let n=i.callback;return await Promise.resolve(n(r))}}),this._promptHandlersInitialized=!0)}resource(t,r,...i){let n;typeof i[0]=="object"&&(n=i.shift());let o=i[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let a=this._createRegisteredResource(t,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let a=this._createRegisteredResourceTemplate(t,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}registerResource(t,r,i,n){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(t,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let o=this._createRegisteredResourceTemplate(t,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(t,r,i,n,o){let a={name:t,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:s=>{typeof s.uri<"u"&&s.uri!==i&&(delete this._registeredResources[i],s.uri&&(this._registeredResources[s.uri]=a)),typeof s.name<"u"&&(a.name=s.name),typeof s.title<"u"&&(a.title=s.title),typeof s.metadata<"u"&&(a.metadata=s.metadata),typeof s.callback<"u"&&(a.readCallback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=a,a}_createRegisteredResourceTemplate(t,r,i,n,o){let a={resourceTemplate:i,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=a)),typeof u.title<"u"&&(a.title=u.title),typeof u.template<"u"&&(a.resourceTemplate=u.template),typeof u.metadata<"u"&&(a.metadata=u.metadata),typeof u.callback<"u"&&(a.readCallback=u.callback),typeof u.enabled<"u"&&(a.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=a;let s=i.uriTemplate.variableNames;return Array.isArray(s)&&s.some(u=>!!i.completeCallback(u))&&this.setCompletionRequestHandler(),a}_createRegisteredPrompt(t,r,i,n,o){let a={title:r,description:i,argsSchema:n===void 0?void 0:ri(n),callback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:s=>{typeof s.name<"u"&&s.name!==t&&(delete this._registeredPrompts[t],s.name&&(this._registeredPrompts[s.name]=a)),typeof s.title<"u"&&(a.title=s.title),typeof s.description<"u"&&(a.description=s.description),typeof s.argsSchema<"u"&&(a.argsSchema=ri(s.argsSchema)),typeof s.callback<"u"&&(a.callback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=a,n&&Object.values(n).some(l=>{let u=l instanceof Wi?l._def?.innerType:l;return __(u)})&&this.setCompletionRequestHandler(),a}_createRegisteredTool(t,r,i,n,o,a,s,l,u){S_(t);let d={title:r,description:i,inputSchema:YR(n),outputSchema:YR(o),annotations:a,execution:s,_meta:l,handler:u,enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:p=>{typeof p.name<"u"&&p.name!==t&&(typeof p.name=="string"&&S_(p.name),delete this._registeredTools[t],p.name&&(this._registeredTools[p.name]=d)),typeof p.title<"u"&&(d.title=p.title),typeof p.description<"u"&&(d.description=p.description),typeof p.paramsSchema<"u"&&(d.inputSchema=ri(p.paramsSchema)),typeof p.outputSchema<"u"&&(d.outputSchema=ri(p.outputSchema)),typeof p.callback<"u"&&(d.handler=p.callback),typeof p.annotations<"u"&&(d.annotations=p.annotations),typeof p._meta<"u"&&(d._meta=p._meta),typeof p.enabled<"u"&&(d.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}tool(t,...r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let i,n,o,a;if(typeof r[0]=="string"&&(i=r.shift()),r.length>1){let l=r[0];x_(l)?(n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!x_(r[0])&&(a=r.shift())):typeof l=="object"&&l!==null&&(a=r.shift())}let s=r[0];return this._createRegisteredTool(t,void 0,i,n,o,a,{taskSupport:"forbidden"},void 0,s)}registerTool(t,r,i){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:n,description:o,inputSchema:a,outputSchema:s,annotations:l,_meta:u}=r;return this._createRegisteredTool(t,n,o,a,s,l,{taskSupport:"forbidden"},u,i)}prompt(t,...r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let i;typeof r[0]=="string"&&(i=r.shift());let n;r.length>1&&(n=r.shift());let o=r[0],a=this._createRegisteredPrompt(t,void 0,i,n,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}registerPrompt(t,r,i){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:n,description:o,argsSchema:a}=r,s=this._createRegisteredPrompt(t,n,o,a,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,r){return this.server.sendLoggingMessage(t,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var FB={type:"object",properties:{}};function eO(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function VB(e){return"_def"in e||"_zod"in e||eO(e)}function x_(e){return typeof e!="object"||e===null||VB(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(eO)}function YR(e){if(e)return x_(e)?ri(e):e}function BB(e){let t=pn(e);return t?Object.entries(t).map(([r,i])=>{let n=cP(i),o=lP(i);return{name:r,description:n,required:!o}}):[]}function $n(e){let r=pn(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=np(r);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function XR(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var cc={completion:{values:[],hasMore:!1}};import rO from"node:process";var gm=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
83
- `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),HB(r)}clear(){this._buffer=void 0}};function HB(e){return ws.parse(JSON.parse(e))}function tO(e){return JSON.stringify(e)+`
84
- `}var ym=class{constructor(t=rO.stdin,r=rO.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new gm,this._started=!1,this._ondata=i=>{this._readBuffer.append(i),this.processReadBuffer()},this._onerror=i=>{this.onerror?.(i)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let i=tO(t);this._stdout.write(i)?r():this._stdout.once("drain",r)})}};import{createServer as SH}from"node:http";import{randomUUID as uH}from"node:crypto";import{Http2ServerRequest as WB}from"http2";import{Http2ServerRequest as w_}from"http2";import{Readable as nO}from"stream";import oH from"crypto";var mi=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},JB=e=>e instanceof mi?e:new mi(e.message,{cause:e}),GB=global.Request,uc=class extends GB{constructor(e,t){typeof e=="object"&&Vo in e&&(e=e[Vo]()),typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},KB=e=>{let t=[],r=e.rawHeaders;for(let i=0;i<r.length;i+=2){let{[i]:n,[i+1]:o}=r;n.charCodeAt(0)!==58&&t.push([n,o])}return new Headers(t)},oO=Symbol("wrapBodyStream"),QB=(e,t,r,i,n)=>{let o={method:e,headers:r,signal:n.signal};if(e==="TRACE"){o.method="GET";let a=new uc(t,o);return Object.defineProperty(a,"method",{get(){return"TRACE"}}),a}if(!(e==="GET"||e==="HEAD"))if("rawBody"in i&&i.rawBody instanceof Buffer)o.body=new ReadableStream({start(a){a.enqueue(i.rawBody),a.close()}});else if(i[oO]){let a;o.body=new ReadableStream({async pull(s){try{a||=nO.toWeb(i).getReader();let{done:l,value:u}=await a.read();l?s.close():s.enqueue(u)}catch(l){s.error(l)}}})}else o.body=nO.toWeb(i);return new uc(t,o)},Vo=Symbol("getRequestCache"),YB=Symbol("requestCache"),vm=Symbol("incomingKey"),bm=Symbol("urlKey"),XB=Symbol("headersKey"),Fo=Symbol("abortControllerKey"),eH=Symbol("getAbortController"),_m={get method(){return this[vm].method||"GET"},get url(){return this[bm]},get headers(){return this[XB]||=KB(this[vm])},[eH](){return this[Vo](),this[Fo]},[Vo](){return this[Fo]||=new AbortController,this[YB]||=QB(this.method,this[bm],this.headers,this[vm],this[Fo])}};["body","bodyUsed","cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","signal","keepalive"].forEach(e=>{Object.defineProperty(_m,e,{get(){return this[Vo]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(_m,e,{value:function(){return this[Vo]()[e]()}})});Object.setPrototypeOf(_m,uc.prototype);var tH=(e,t)=>{let r=Object.create(_m);r[vm]=e;let i=e.url||"";if(i[0]!=="/"&&(i.startsWith("http://")||i.startsWith("https://"))){if(e instanceof w_)throw new mi("Absolute URL for :path is not allowed in HTTP/2");try{let s=new URL(i);r[bm]=s.href}catch(s){throw new mi("Invalid absolute URL",{cause:s})}return r}let n=(e instanceof w_?e.authority:e.headers.host)||t;if(!n)throw new mi("Missing host header");let o;if(e instanceof w_){if(o=e.scheme,!(o==="http"||o==="https"))throw new mi("Unsupported scheme")}else o=e.socket&&e.socket.encrypted?"https":"http";let a=new URL(`${o}://${n}${i}`);if(a.hostname.length!==n.length&&a.hostname!==n.replace(/:\d+$/,""))throw new mi("Invalid host header");return r[bm]=a.href,r},iO=Symbol("responseCache"),Zo=Symbol("getResponseCache"),fi=Symbol("cache"),T_=global.Response,dc=class aO{#t;#e;[Zo](){return delete this[fi],this[iO]||=new T_(this.#t,this.#e)}constructor(t,r){let i;if(this.#t=t,r instanceof aO){let n=r[iO];if(n){this.#e=n,this[Zo]();return}else this.#e=r.#e,i=new Headers(r.#e.headers)}else this.#e=r;(typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[fi]=[r?.status||200,t,i||r?.headers])}get headers(){let t=this[fi];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||{"content-type":"text/plain; charset=UTF-8"})),t[2]):this[Zo]().headers}get status(){return this[fi]?.[0]??this[Zo]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(dc.prototype,e,{get(){return this[Zo]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(dc.prototype,e,{value:function(){return this[Zo]()[e]()}})});Object.setPrototypeOf(dc,T_);Object.setPrototypeOf(dc.prototype,T_.prototype);async function rH(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function sO(e,t,r){let i=s=>{e.cancel(s).catch(()=>{})};return t.on("close",i),t.on("error",i),(r??e.read()).then(a,n),e.closed.finally(()=>{t.off("close",i),t.off("error",i)});function n(s){s&&t.destroy(s)}function o(){e.read().then(a,n)}function a({done:s,value:l}){try{if(s)t.end();else if(!t.write(l))t.once("drain",o);else return e.read().then(a,n)}catch(u){n(u)}}}function nH(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:sO(e.getReader(),t)}var $_=e=>{let t={};e instanceof Headers||(e=new Headers(e??void 0));let r=[];for(let[i,n]of e)i==="set-cookie"?r.push(n):t[i]=n;return r.length>0&&(t["set-cookie"]=r),t["content-type"]??="text/plain; charset=UTF-8",t},iH="x-hono-already-sent";typeof global.crypto>"u"&&(global.crypto=oH);var I_=Symbol("outgoingEnded"),aH=()=>new Response(null,{status:400}),cO=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),k_=(e,t)=>{let r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},lO=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},uO=async(e,t)=>{let[r,i,n]=e[fi],o=!1;if(!n)n={"content-type":"text/plain; charset=UTF-8"};else if(n instanceof Headers)o=n.has("content-length"),n=$_(n);else if(Array.isArray(n)){let a=new Headers(n);o=a.has("content-length"),n=$_(a)}else for(let a in n)if(a.length===14&&a.toLowerCase()==="content-length"){o=!0;break}o||(typeof i=="string"?n["Content-Length"]=Buffer.byteLength(i):i instanceof Uint8Array?n["Content-Length"]=i.byteLength:i instanceof Blob&&(n["Content-Length"]=i.size)),t.writeHead(r,n),typeof i=="string"||i instanceof Uint8Array?t.end(i):i instanceof Blob?t.end(new Uint8Array(await i.arrayBuffer())):(lO(t),await nH(i,t)?.catch(a=>k_(a,t))),t[I_]?.()},sH=e=>typeof e.then=="function",cH=async(e,t,r={})=>{if(sH(e))if(r.errorHandler)try{e=await e}catch(n){let o=await r.errorHandler(n);if(!o)return;e=o}else e=await e.catch(cO);if(fi in e)return uO(e,t);let i=$_(e.headers);if(e.body){let n=e.body.getReader(),o=[],a=!1,s;if(i["transfer-encoding"]!=="chunked"){let l=2;for(let u=0;u<l;u++){s||=n.read();let d=await rH(s).catch(p=>{console.error(p),a=!0});if(!d){if(u===1){await new Promise(p=>setTimeout(p)),l=3;continue}break}if(s=void 0,d.value&&o.push(d.value),d.done){a=!0;break}}a&&!("content-length"in i)&&(i["content-length"]=o.reduce((u,d)=>u+d.length,0))}t.writeHead(e.status,i),o.forEach(l=>{t.write(l)}),a?t.end():(o.length===0&&lO(t),await sO(n,t,s))}else i[iH]||(t.writeHead(e.status,i),t.end());t[I_]?.()},E_=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==uc&&(Object.defineProperty(global,"Request",{value:uc}),Object.defineProperty(global,"Response",{value:dc})),async(i,n)=>{let o,a;try{a=tH(i,t.hostname);let s=!r||i.method==="GET"||i.method==="HEAD";if(s||(i[oO]=!0,i.on("end",()=>{s=!0}),i instanceof WB&&(n[I_]=()=>{s||setTimeout(()=>{s||setTimeout(()=>{i.destroy(),n.destroy()})})})),n.on("close",()=>{a[Fo]&&(i.errored?a[Fo].abort(i.errored.toString()):n.writableFinished||a[Fo].abort("Client connection prematurely closed.")),s||setTimeout(()=>{s||setTimeout(()=>{i.destroy()})})}),o=e(a,{incoming:i,outgoing:n}),fi in o)return uO(o,n)}catch(s){if(o)return k_(s,n);if(t.errorHandler){if(o=await t.errorHandler(a?s:JB(s)),!o)return}else a?o=cO(s):o=aH()}try{return await cH(o,n,t)}catch(s){return k_(s,n)}}};var Sm=class{constructor(t={}){this._started=!1,this._hasHandledRequest=!1,this._streamMapping=new Map,this._requestToStreamMapping=new Map,this._requestResponseMap=new Map,this._initialized=!1,this._enableJsonResponse=!1,this._standaloneSseStreamId="_GET_stream",this.sessionIdGenerator=t.sessionIdGenerator,this._enableJsonResponse=t.enableJsonResponse??!1,this._eventStore=t.eventStore,this._onsessioninitialized=t.onsessioninitialized,this._onsessionclosed=t.onsessionclosed,this._allowedHosts=t.allowedHosts,this._allowedOrigins=t.allowedOrigins,this._enableDnsRebindingProtection=t.enableDnsRebindingProtection??!1,this._retryInterval=t.retryInterval}async start(){if(this._started)throw new Error("Transport already started");this._started=!0}createJsonErrorResponse(t,r,i,n){let o={code:r,message:i};return n?.data!==void 0&&(o.data=n.data),new Response(JSON.stringify({jsonrpc:"2.0",error:o,id:null}),{status:t,headers:{"Content-Type":"application/json",...n?.headers}})}validateRequestHeaders(t){if(this._enableDnsRebindingProtection){if(this._allowedHosts&&this._allowedHosts.length>0){let r=t.headers.get("host");if(!r||!this._allowedHosts.includes(r)){let i=`Invalid Host header: ${r}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let r=t.headers.get("origin");if(r&&!this._allowedOrigins.includes(r)){let i=`Invalid Origin header: ${r}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}}}async handleRequest(t,r){if(!this.sessionIdGenerator&&this._hasHandledRequest)throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let i=this.validateRequestHeaders(t);if(i)return i;switch(t.method){case"POST":return this.handlePostRequest(t,r);case"GET":return this.handleGetRequest(t);case"DELETE":return this.handleDeleteRequest(t);default:return this.handleUnsupportedRequest()}}async writePrimingEvent(t,r,i,n){if(!this._eventStore||n<"2025-11-25")return;let o=await this._eventStore.storeEvent(i,{}),a=`id: ${o}
76
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&e.reused==="ref"){o(a);continue}}}function an(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let s=e.seen.get(a);if(s.ref===null)return;let c=s.def??s.schema,u={...c},d=s.ref;if(s.ref=null,d){i(d);let f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),a._zod.parent===d)for(let g in c)g==="$ref"||g==="allOf"||g in u||delete c[g];if(h.$ref&&f.def)for(let g in c)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(c[g])===JSON.stringify(f.def[g])&&delete c[g]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=e.seen.get(p);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};for(let a of[...e.seen.entries()].reverse())i(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 o=e.external?.defs??{};for(let a of e.seen.entries()){let s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ui(t,"input",e.processors),output:Ui(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ut(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ut(i.element,r);if(i.type==="set")return ut(i.valueType,r);if(i.type==="lazy")return ut(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ut(i.innerType,r);if(i.type==="intersection")return ut(i.left,r)||ut(i.right,r);if(i.type==="record"||i.type==="map")return ut(i.keyType,r)||ut(i.valueType,r);if(i.type==="pipe")return ut(i.in,r)||ut(i.out,r);if(i.type==="object"){for(let n in i.shape)if(ut(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(ut(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(ut(n,r))return!0;return!!(i.rest&&ut(i.rest,r))}return!1}var jh=(e,t={})=>r=>{let i=nn({...r,processors:t});return _e(e,i),on(i,e),an(i,e)},Ui=(e,t,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},a=nn({...n??{},target:o,io:t,processors:r});return _e(e,a),on(a,e),an(a,e)};var l6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Dh=(e,t,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=l6[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let d=[...c];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Nh=(e,t,r,i)=>{let n=r,{minimum:o,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d),typeof o=="number"&&(n.minimum=o,typeof d=="number"&&t.target!=="draft-04"&&(d>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),typeof a=="number"&&(n.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete n.maximum:delete n.exclusiveMaximum)),typeof c=="number"&&(n.multipleOf=c)},Ch=(e,t,r,i)=>{r.type="boolean"},Ah=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Mh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Uh=(e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Lh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},qh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Zh=(e,t,r,i)=>{r.not={}},Fh=(e,t,r,i)=>{},Vh=(e,t,r,i)=>{},Bh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Hh=(e,t,r,i)=>{let n=e._zod.def,o=ra(n.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},Wh=(e,t,r,i)=>{let n=e._zod.def,o=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},Jh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Gh=(e,t,r,i)=>{let n=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},Kh=(e,t,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,o)},Qh=(e,t,r,i)=>{r.type="boolean"},Yh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Xh=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},eg=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},tg=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},rg=(e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},ng=(e,t,r,i)=>{let n=r,o=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=_e(o.element,t,{...i,path:[...i.path,"items"]})},ig=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object",n.properties={};let a=o.shape;for(let u in a)n.properties[u]=_e(a[u],t,{...i,path:[...i.path,"properties",u]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(u=>{let d=o.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(n.required=Array.from(c)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=_e(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},id=(e,t,r,i)=>{let n=e._zod.def,o=n.inclusive===!1,a=n.options.map((s,c)=>_e(s,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=a:r.anyOf=a},og=(e,t,r,i)=>{let n=e._zod.def,o=_e(n.left,t,{...i,path:[...i.path,"allOf",0]}),a=_e(n.right,t,{...i,path:[...i.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=c},ag=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,h)=>_e(f,t,{...i,path:[...i.path,a,h]})),u=o.rest?_e(o.rest,t,{...i,path:[...i.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),n.minItems=c.length,u||(n.maxItems=c.length)):(n.items=c,u&&(n.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},sg=(e,t,r,i)=>{let n=r,o=e._zod.def;n.type="object";let a=o.keyType,c=a._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let d=_e(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let p of c)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=_e(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=_e(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let u=a._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},cg=(e,t,r,i)=>{let n=e._zod.def,o=_e(n.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},lg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},ug=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},dg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},pg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},mg=(e,t,r,i)=>{let n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;_e(o,t,i);let a=t.seen.get(e);a.ref=o},fg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType,r.readOnly=!0},hg=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},od=(e,t,r,i)=>{let n=e._zod.def;_e(n.innerType,t,i);let o=t.seen.get(e);o.ref=n.innerType},gg=(e,t,r,i)=>{let n=e._zod.innerType;_e(n,t,i);let o=t.seen.get(e);o.ref=n},nd={string:Dh,number:Nh,boolean:Ch,bigint:Ah,symbol:Mh,null:Uh,undefined:Lh,void:qh,never:Zh,any:Fh,unknown:Vh,date:Bh,enum:Hh,literal:Wh,nan:Jh,template_literal:Gh,file:Kh,success:Qh,custom:Yh,function:Xh,transform:eg,map:tg,set:rg,array:ng,object:ig,union:id,intersection:og,tuple:ag,record:sg,nullable:cg,nonoptional:lg,default:ug,prefault:dg,catch:pg,pipe:mg,readonly:fg,promise:hg,optional:od,lazy:gg};function Jn(e,t){if("_idmap"in e){let i=e,n=nn({...t,processors:nd}),o={};for(let c of i._idmap.entries()){let[u,d]=c;_e(d,n)}let a={},s={registry:i,uri:t?.uri,defs:o};n.external=s;for(let c of i._idmap.entries()){let[u,d]=c;on(n,d),a[u]=an(n,d)}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let r=nn({...t,processors:nd});return _e(e,r),on(r,e),an(r,e)}var ad=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=nn({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 _e(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)),on(this.ctx,t);let i=an(this.ctx,t),{"~standard":n,...o}=i;return o}};var IT={};var Za={};$r(Za,{ZodAny:()=>Ag,ZodArray:()=>qg,ZodBase64:()=>Td,ZodBase64URL:()=>Id,ZodBigInt:()=>Bi,ZodBigIntFormat:()=>zd,ZodBoolean:()=>Vi,ZodCIDRv4:()=>$d,ZodCIDRv6:()=>kd,ZodCUID:()=>yd,ZodCUID2:()=>vd,ZodCatch:()=>sy,ZodCodec:()=>Nd,ZodCustom:()=>Ya,ZodCustomStringFormat:()=>Zi,ZodDate:()=>Wa,ZodDefault:()=>ty,ZodDiscriminatedUnion:()=>Fg,ZodE164:()=>Ed,ZodEmail:()=>fd,ZodEmoji:()=>hd,ZodEnum:()=>Li,ZodExactOptional:()=>Yg,ZodFile:()=>Kg,ZodFunction:()=>gy,ZodGUID:()=>Fa,ZodIPv4:()=>xd,ZodIPv6:()=>wd,ZodIntersection:()=>Vg,ZodJWT:()=>Pd,ZodKSUID:()=>Sd,ZodLazy:()=>my,ZodLiteral:()=>Gg,ZodMAC:()=>jg,ZodMap:()=>Wg,ZodNaN:()=>ly,ZodNanoID:()=>gd,ZodNever:()=>Ug,ZodNonOptional:()=>jd,ZodNull:()=>Cg,ZodNullable:()=>ey,ZodNumber:()=>Fi,ZodNumberFormat:()=>Gn,ZodObject:()=>Ja,ZodOptional:()=>Ji,ZodPipe:()=>Dd,ZodPrefault:()=>ny,ZodPromise:()=>hy,ZodReadonly:()=>uy,ZodRecord:()=>Qa,ZodSet:()=>Jg,ZodString:()=>qi,ZodStringFormat:()=>$e,ZodSuccess:()=>ay,ZodSymbol:()=>Dg,ZodTemplateLiteral:()=>py,ZodTransform:()=>Qg,ZodTuple:()=>Bg,ZodType:()=>re,ZodULID:()=>bd,ZodURL:()=>Ha,ZodUUID:()=>mr,ZodUndefined:()=>Ng,ZodUnion:()=>Ga,ZodUnknown:()=>Mg,ZodVoid:()=>Lg,ZodXID:()=>_d,ZodXor:()=>Zg,_ZodString:()=>md,_default:()=>ry,_function:()=>zI,any:()=>pI,array:()=>se,base64:()=>GT,base64url:()=>KT,bigint:()=>sI,boolean:()=>qe,catch:()=>cy,check:()=>RI,cidrv4:()=>WT,cidrv6:()=>JT,codec:()=>II,cuid:()=>UT,cuid2:()=>LT,custom:()=>Cd,date:()=>fI,describe:()=>OI,discriminatedUnion:()=>Ka,e164:()=>QT,email:()=>PT,emoji:()=>AT,enum:()=>Qe,exactOptional:()=>Xg,file:()=>wI,float32:()=>nI,float64:()=>iI,function:()=>zI,guid:()=>zT,hash:()=>rI,hex:()=>tI,hostname:()=>eI,httpUrl:()=>CT,instanceof:()=>DI,int:()=>pd,int32:()=>oI,int64:()=>cI,intersection:()=>Wi,ipv4:()=>VT,ipv6:()=>HT,json:()=>CI,jwt:()=>YT,keyof:()=>hI,ksuid:()=>FT,lazy:()=>fy,literal:()=>F,looseObject:()=>Ke,looseRecord:()=>bI,mac:()=>BT,map:()=>_I,meta:()=>jI,nan:()=>TI,nanoid:()=>MT,nativeEnum:()=>xI,never:()=>Rd,nonoptional:()=>oy,null:()=>Hi,nullable:()=>Va,nullish:()=>$I,number:()=>ve,object:()=>L,optional:()=>ze,partialRecord:()=>vI,pipe:()=>Ba,prefault:()=>iy,preprocess:()=>Xa,promise:()=>PI,readonly:()=>dy,record:()=>Ie,refine:()=>yy,set:()=>SI,strictObject:()=>gI,string:()=>x,stringFormat:()=>XT,stringbool:()=>NI,success:()=>kI,superRefine:()=>vy,symbol:()=>uI,templateLiteral:()=>EI,transform:()=>Od,tuple:()=>Hg,uint32:()=>aI,uint64:()=>lI,ulid:()=>qT,undefined:()=>dI,union:()=>xe,unknown:()=>ke,url:()=>NT,uuid:()=>RT,uuidv4:()=>OT,uuidv6:()=>jT,uuidv7:()=>DT,void:()=>mI,xid:()=>ZT,xor:()=>yI});var sd={};$r(sd,{endsWith:()=>qn,gt:()=>Kt,gte:()=>Ge,includes:()=>Un,length:()=>rn,lowercase:()=>An,lt:()=>Gt,lte:()=>lt,maxLength:()=>tn,maxSize:()=>Ir,mime:()=>Zn,minLength:()=>pr,minSize:()=>Qt,multipleOf:()=>Tr,negative:()=>Ma,nonnegative:()=>La,nonpositive:()=>Ua,normalize:()=>Fn,overwrite:()=>Dt,positive:()=>Aa,property:()=>qa,regex:()=>Cn,size:()=>en,slugify:()=>Mi,startsWith:()=>Ln,toLowerCase:()=>Bn,toUpperCase:()=>Hn,trim:()=>Vn,uppercase:()=>Mn});var sn={};$r(sn,{ZodISODate:()=>ld,ZodISODateTime:()=>cd,ZodISODuration:()=>dd,ZodISOTime:()=>ud,date:()=>vg,datetime:()=>yg,duration:()=>_g,time:()=>bg});var cd=b("ZodISODateTime",(e,t)=>{gl.init(e,t),$e.init(e,t)});function yg(e){return wu(cd,e)}var ld=b("ZodISODate",(e,t)=>{yl.init(e,t),$e.init(e,t)});function vg(e){return $u(ld,e)}var ud=b("ZodISOTime",(e,t)=>{vl.init(e,t),$e.init(e,t)});function bg(e){return ku(ud,e)}var dd=b("ZodISODuration",(e,t)=>{bl.init(e,t),$e.init(e,t)});function _g(e){return Tu(dd,e)}var ET=(e,t)=>{sa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ki(e,r)},flatten:{value:r=>$i(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Si,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Si,2)}},isEmpty:{get(){return e.issues.length===0}}})},d6=b("ZodError",ET),St=b("ZodError",ET,{Parent:Error});var Sg=Ti(St),xg=Ii(St),wg=Ei(St),$g=Pi(St),kg=Zc(St),Tg=Fc(St),Ig=Vc(St),Eg=Bc(St),Pg=Hc(St),zg=Wc(St),Rg=Jc(St),Og=Gc(St);var re=b("ZodType",(e,t)=>(K.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ui(e,"input"),output:Ui(e,"output")}}),e.toJSONSchema=jh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(z.mergeDefs(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(r,i)=>He(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>Sg(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>wg(e,r,i),e.parseAsync=async(r,i)=>xg(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>$g(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>kg(e,r,i),e.decode=(r,i)=>Tg(e,r,i),e.encodeAsync=async(r,i)=>Ig(e,r,i),e.decodeAsync=async(r,i)=>Eg(e,r,i),e.safeEncode=(r,i)=>Pg(e,r,i),e.safeDecode=(r,i)=>zg(e,r,i),e.safeEncodeAsync=async(r,i)=>Rg(e,r,i),e.safeDecodeAsync=async(r,i)=>Og(e,r,i),e.refine=(r,i)=>e.check(yy(r,i)),e.superRefine=r=>e.check(vy(r)),e.overwrite=r=>e.check(Dt(r)),e.optional=()=>ze(e),e.exactOptional=()=>Xg(e),e.nullable=()=>Va(e),e.nullish=()=>ze(Va(e)),e.nonoptional=r=>oy(e,r),e.array=()=>se(e),e.or=r=>xe([e,r]),e.and=r=>Wi(e,r),e.transform=r=>Ba(e,Od(r)),e.default=r=>ry(e,r),e.prefault=r=>iy(e,r),e.catch=r=>cy(e,r),e.pipe=r=>Ba(e,r),e.readonly=()=>dy(e),e.describe=r=>{let i=e.clone();return We.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return We.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return We.get(e);let i=e.clone();return We.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),md=b("_ZodString",(e,t)=>{Xr.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Dh(e,i,n,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(Cn(...i)),e.includes=(...i)=>e.check(Un(...i)),e.startsWith=(...i)=>e.check(Ln(...i)),e.endsWith=(...i)=>e.check(qn(...i)),e.min=(...i)=>e.check(pr(...i)),e.max=(...i)=>e.check(tn(...i)),e.length=(...i)=>e.check(rn(...i)),e.nonempty=(...i)=>e.check(pr(1,...i)),e.lowercase=i=>e.check(An(i)),e.uppercase=i=>e.check(Mn(i)),e.trim=()=>e.check(Vn()),e.normalize=(...i)=>e.check(Fn(...i)),e.toLowerCase=()=>e.check(Bn()),e.toUpperCase=()=>e.check(Hn()),e.slugify=()=>e.check(Mi())}),qi=b("ZodString",(e,t)=>{Xr.init(e,t),md.init(e,t),e.email=r=>e.check(ya(fd,r)),e.url=r=>e.check(Ai(Ha,r)),e.jwt=r=>e.check(Ca(Pd,r)),e.emoji=r=>e.check(xa(hd,r)),e.guid=r=>e.check(Ci(Fa,r)),e.uuid=r=>e.check(va(mr,r)),e.uuidv4=r=>e.check(ba(mr,r)),e.uuidv6=r=>e.check(_a(mr,r)),e.uuidv7=r=>e.check(Sa(mr,r)),e.nanoid=r=>e.check(wa(gd,r)),e.guid=r=>e.check(Ci(Fa,r)),e.cuid=r=>e.check($a(yd,r)),e.cuid2=r=>e.check(ka(vd,r)),e.ulid=r=>e.check(Ta(bd,r)),e.base64=r=>e.check(ja(Td,r)),e.base64url=r=>e.check(Da(Id,r)),e.xid=r=>e.check(Ia(_d,r)),e.ksuid=r=>e.check(Ea(Sd,r)),e.ipv4=r=>e.check(Pa(xd,r)),e.ipv6=r=>e.check(za(wd,r)),e.cidrv4=r=>e.check(Ra($d,r)),e.cidrv6=r=>e.check(Oa(kd,r)),e.e164=r=>e.check(Na(Ed,r)),e.datetime=r=>e.check(yg(r)),e.date=r=>e.check(vg(r)),e.time=r=>e.check(bg(r)),e.duration=r=>e.check(_g(r))});function x(e){return bu(qi,e)}var $e=b("ZodStringFormat",(e,t)=>{Se.init(e,t),md.init(e,t)}),fd=b("ZodEmail",(e,t)=>{sl.init(e,t),$e.init(e,t)});function PT(e){return ya(fd,e)}var Fa=b("ZodGUID",(e,t)=>{ol.init(e,t),$e.init(e,t)});function zT(e){return Ci(Fa,e)}var mr=b("ZodUUID",(e,t)=>{al.init(e,t),$e.init(e,t)});function RT(e){return va(mr,e)}function OT(e){return ba(mr,e)}function jT(e){return _a(mr,e)}function DT(e){return Sa(mr,e)}var Ha=b("ZodURL",(e,t)=>{cl.init(e,t),$e.init(e,t)});function NT(e){return Ai(Ha,e)}function CT(e){return Ai(Ha,{protocol:/^https?$/,hostname:_t.domain,...z.normalizeParams(e)})}var hd=b("ZodEmoji",(e,t)=>{ll.init(e,t),$e.init(e,t)});function AT(e){return xa(hd,e)}var gd=b("ZodNanoID",(e,t)=>{ul.init(e,t),$e.init(e,t)});function MT(e){return wa(gd,e)}var yd=b("ZodCUID",(e,t)=>{dl.init(e,t),$e.init(e,t)});function UT(e){return $a(yd,e)}var vd=b("ZodCUID2",(e,t)=>{pl.init(e,t),$e.init(e,t)});function LT(e){return ka(vd,e)}var bd=b("ZodULID",(e,t)=>{ml.init(e,t),$e.init(e,t)});function qT(e){return Ta(bd,e)}var _d=b("ZodXID",(e,t)=>{fl.init(e,t),$e.init(e,t)});function ZT(e){return Ia(_d,e)}var Sd=b("ZodKSUID",(e,t)=>{hl.init(e,t),$e.init(e,t)});function FT(e){return Ea(Sd,e)}var xd=b("ZodIPv4",(e,t)=>{_l.init(e,t),$e.init(e,t)});function VT(e){return Pa(xd,e)}var jg=b("ZodMAC",(e,t)=>{xl.init(e,t),$e.init(e,t)});function BT(e){return Su(jg,e)}var wd=b("ZodIPv6",(e,t)=>{Sl.init(e,t),$e.init(e,t)});function HT(e){return za(wd,e)}var $d=b("ZodCIDRv4",(e,t)=>{wl.init(e,t),$e.init(e,t)});function WT(e){return Ra($d,e)}var kd=b("ZodCIDRv6",(e,t)=>{$l.init(e,t),$e.init(e,t)});function JT(e){return Oa(kd,e)}var Td=b("ZodBase64",(e,t)=>{kl.init(e,t),$e.init(e,t)});function GT(e){return ja(Td,e)}var Id=b("ZodBase64URL",(e,t)=>{Tl.init(e,t),$e.init(e,t)});function KT(e){return Da(Id,e)}var Ed=b("ZodE164",(e,t)=>{Il.init(e,t),$e.init(e,t)});function QT(e){return Na(Ed,e)}var Pd=b("ZodJWT",(e,t)=>{El.init(e,t),$e.init(e,t)});function YT(e){return Ca(Pd,e)}var Zi=b("ZodCustomStringFormat",(e,t)=>{Pl.init(e,t),$e.init(e,t)});function XT(e,t,r={}){return Wn(Zi,e,t,r)}function eI(e){return Wn(Zi,"hostname",_t.hostname,e)}function tI(e){return Wn(Zi,"hex",_t.hex,e)}function rI(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,n=_t[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Wn(Zi,i,n,t)}var Fi=b("ZodNumber",(e,t)=>{da.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Nh(e,i,n,o),e.gt=(i,n)=>e.check(Kt(i,n)),e.gte=(i,n)=>e.check(Ge(i,n)),e.min=(i,n)=>e.check(Ge(i,n)),e.lt=(i,n)=>e.check(Gt(i,n)),e.lte=(i,n)=>e.check(lt(i,n)),e.max=(i,n)=>e.check(lt(i,n)),e.int=i=>e.check(pd(i)),e.safe=i=>e.check(pd(i)),e.positive=i=>e.check(Kt(0,i)),e.nonnegative=i=>e.check(Ge(0,i)),e.negative=i=>e.check(Gt(0,i)),e.nonpositive=i=>e.check(lt(0,i)),e.multipleOf=(i,n)=>e.check(Tr(i,n)),e.step=(i,n)=>e.check(Tr(i,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 ve(e){return Iu(Fi,e)}var Gn=b("ZodNumberFormat",(e,t)=>{zl.init(e,t),Fi.init(e,t)});function pd(e){return Pu(Gn,e)}function nI(e){return zu(Gn,e)}function iI(e){return Ru(Gn,e)}function oI(e){return Ou(Gn,e)}function aI(e){return ju(Gn,e)}var Vi=b("ZodBoolean",(e,t)=>{Ri.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Ch(e,r,i,n)});function qe(e){return Du(Vi,e)}var Bi=b("ZodBigInt",(e,t)=>{pa.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Ah(e,i,n,o),e.gte=(i,n)=>e.check(Ge(i,n)),e.min=(i,n)=>e.check(Ge(i,n)),e.gt=(i,n)=>e.check(Kt(i,n)),e.gte=(i,n)=>e.check(Ge(i,n)),e.min=(i,n)=>e.check(Ge(i,n)),e.lt=(i,n)=>e.check(Gt(i,n)),e.lte=(i,n)=>e.check(lt(i,n)),e.max=(i,n)=>e.check(lt(i,n)),e.positive=i=>e.check(Kt(BigInt(0),i)),e.negative=i=>e.check(Gt(BigInt(0),i)),e.nonpositive=i=>e.check(lt(BigInt(0),i)),e.nonnegative=i=>e.check(Ge(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Tr(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function sI(e){return Cu(Bi,e)}var zd=b("ZodBigIntFormat",(e,t)=>{Rl.init(e,t),Bi.init(e,t)});function cI(e){return Mu(zd,e)}function lI(e){return Uu(zd,e)}var Dg=b("ZodSymbol",(e,t)=>{Ol.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Mh(e,r,i,n)});function uI(e){return Lu(Dg,e)}var Ng=b("ZodUndefined",(e,t)=>{jl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Lh(e,r,i,n)});function dI(e){return qu(Ng,e)}var Cg=b("ZodNull",(e,t)=>{Dl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Uh(e,r,i,n)});function Hi(e){return Zu(Cg,e)}var Ag=b("ZodAny",(e,t)=>{Nl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Fh(e,r,i,n)});function pI(){return Fu(Ag)}var Mg=b("ZodUnknown",(e,t)=>{Cl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Vh(e,r,i,n)});function ke(){return Vu(Mg)}var Ug=b("ZodNever",(e,t)=>{Al.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Zh(e,r,i,n)});function Rd(e){return Bu(Ug,e)}var Lg=b("ZodVoid",(e,t)=>{Ml.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>qh(e,r,i,n)});function mI(e){return Hu(Lg,e)}var Wa=b("ZodDate",(e,t)=>{Ul.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Bh(e,i,n,o),e.min=(i,n)=>e.check(Ge(i,n)),e.max=(i,n)=>e.check(lt(i,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 fI(e){return Wu(Wa,e)}var qg=b("ZodArray",(e,t)=>{Ll.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ng(e,r,i,n),e.element=t.element,e.min=(r,i)=>e.check(pr(r,i)),e.nonempty=r=>e.check(pr(1,r)),e.max=(r,i)=>e.check(tn(r,i)),e.length=(r,i)=>e.check(rn(r,i)),e.unwrap=()=>e.element});function se(e,t){return Oh(qg,e,t)}function hI(e){let t=e._zod.def.shape;return Qe(Object.keys(t))}var Ja=b("ZodObject",(e,t)=>{Rh.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ig(e,r,i,n),z.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Qe(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ke()}),e.loose=()=>e.clone({...e._zod.def,catchall:ke()}),e.strict=()=>e.clone({...e._zod.def,catchall:Rd()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>z.extend(e,r),e.safeExtend=r=>z.safeExtend(e,r),e.merge=r=>z.merge(e,r),e.pick=r=>z.pick(e,r),e.omit=r=>z.omit(e,r),e.partial=(...r)=>z.partial(Ji,e,r[0]),e.required=(...r)=>z.required(jd,e,r[0])});function L(e,t){let r={type:"object",shape:e??{},...z.normalizeParams(t)};return new Ja(r)}function gI(e,t){return new Ja({type:"object",shape:e,catchall:Rd(),...z.normalizeParams(t)})}function Ke(e,t){return new Ja({type:"object",shape:e,catchall:ke(),...z.normalizeParams(t)})}var Ga=b("ZodUnion",(e,t)=>{Oi.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>id(e,r,i,n),e.options=t.options});function xe(e,t){return new Ga({type:"union",options:e,...z.normalizeParams(t)})}var Zg=b("ZodXor",(e,t)=>{Ga.init(e,t),Zl.init(e,t),e._zod.processJSONSchema=(r,i,n)=>id(e,r,i,n),e.options=t.options});function yI(e,t){return new Zg({type:"union",options:e,inclusive:!1,...z.normalizeParams(t)})}var Fg=b("ZodDiscriminatedUnion",(e,t)=>{Ga.init(e,t),Fl.init(e,t)});function Ka(e,t,r){return new Fg({type:"union",options:t,discriminator:e,...z.normalizeParams(r)})}var Vg=b("ZodIntersection",(e,t)=>{Vl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>og(e,r,i,n)});function Wi(e,t){return new Vg({type:"intersection",left:e,right:t})}var Bg=b("ZodTuple",(e,t)=>{ma.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ag(e,r,i,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Hg(e,t,r){let i=t instanceof K,n=i?r:t,o=i?t:null;return new Bg({type:"tuple",items:e,rest:o,...z.normalizeParams(n)})}var Qa=b("ZodRecord",(e,t)=>{Bl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>sg(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType});function Ie(e,t,r){return new Qa({type:"record",keyType:e,valueType:t,...z.normalizeParams(r)})}function vI(e,t,r){let i=He(e);return i._zod.values=void 0,new Qa({type:"record",keyType:i,valueType:t,...z.normalizeParams(r)})}function bI(e,t,r){return new Qa({type:"record",keyType:e,valueType:t,mode:"loose",...z.normalizeParams(r)})}var Wg=b("ZodMap",(e,t)=>{Hl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>tg(e,r,i,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Qt(...r)),e.nonempty=r=>e.check(Qt(1,r)),e.max=(...r)=>e.check(Ir(...r)),e.size=(...r)=>e.check(en(...r))});function _I(e,t,r){return new Wg({type:"map",keyType:e,valueType:t,...z.normalizeParams(r)})}var Jg=b("ZodSet",(e,t)=>{Wl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>rg(e,r,i,n),e.min=(...r)=>e.check(Qt(...r)),e.nonempty=r=>e.check(Qt(1,r)),e.max=(...r)=>e.check(Ir(...r)),e.size=(...r)=>e.check(en(...r))});function SI(e,t){return new Jg({type:"set",valueType:e,...z.normalizeParams(t)})}var Li=b("ZodEnum",(e,t)=>{Jl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,o)=>Hh(e,i,n,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let a of i)if(r.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Li({...t,checks:[],...z.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Li({...t,checks:[],...z.normalizeParams(n),entries:o})}});function Qe(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Li({type:"enum",entries:r,...z.normalizeParams(t)})}function xI(e,t){return new Li({type:"enum",entries:e,...z.normalizeParams(t)})}var Gg=b("ZodLiteral",(e,t)=>{Gl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Wh(e,r,i,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 F(e,t){return new Gg({type:"literal",values:Array.isArray(e)?e:[e],...z.normalizeParams(t)})}var Kg=b("ZodFile",(e,t)=>{Kl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Kh(e,r,i,n),e.min=(r,i)=>e.check(Qt(r,i)),e.max=(r,i)=>e.check(Ir(r,i)),e.mime=(r,i)=>e.check(Zn(Array.isArray(r)?r:[r],i))});function wI(e){return Ku(Kg,e)}var Qg=b("ZodTransform",(e,t)=>{Ql.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>eg(e,r,i,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Hr(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(z.issue(o,r.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(z.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function Od(e){return new Qg({type:"transform",transform:e})}var Ji=b("ZodOptional",(e,t)=>{fa.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>od(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function ze(e){return new Ji({type:"optional",innerType:e})}var Yg=b("ZodExactOptional",(e,t)=>{Yl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>od(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Xg(e){return new Yg({type:"optional",innerType:e})}var ey=b("ZodNullable",(e,t)=>{Xl.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>cg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function Va(e){return new ey({type:"nullable",innerType:e})}function $I(e){return ze(Va(e))}var ty=b("ZodDefault",(e,t)=>{eu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>ug(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ry(e,t){return new ty({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():z.shallowClone(t)}})}var ny=b("ZodPrefault",(e,t)=>{tu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>dg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function iy(e,t){return new ny({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():z.shallowClone(t)}})}var jd=b("ZodNonOptional",(e,t)=>{ru.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>lg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function oy(e,t){return new jd({type:"nonoptional",innerType:e,...z.normalizeParams(t)})}var ay=b("ZodSuccess",(e,t)=>{nu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Qh(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function kI(e){return new ay({type:"success",innerType:e})}var sy=b("ZodCatch",(e,t)=>{iu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>pg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cy(e,t){return new sy({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var ly=b("ZodNaN",(e,t)=>{ou.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Jh(e,r,i,n)});function TI(e){return Gu(ly,e)}var Dd=b("ZodPipe",(e,t)=>{au.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>mg(e,r,i,n),e.in=t.in,e.out=t.out});function Ba(e,t){return new Dd({type:"pipe",in:e,out:t})}var Nd=b("ZodCodec",(e,t)=>{Dd.init(e,t),ji.init(e,t)});function II(e,t,r){return new Nd({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var uy=b("ZodReadonly",(e,t)=>{su.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>fg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function dy(e){return new uy({type:"readonly",innerType:e})}var py=b("ZodTemplateLiteral",(e,t)=>{cu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Gh(e,r,i,n)});function EI(e,t){return new py({type:"template_literal",parts:e,...z.normalizeParams(t)})}var my=b("ZodLazy",(e,t)=>{du.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>gg(e,r,i,n),e.unwrap=()=>e._zod.def.getter()});function fy(e){return new my({type:"lazy",getter:e})}var hy=b("ZodPromise",(e,t)=>{uu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>hg(e,r,i,n),e.unwrap=()=>e._zod.def.innerType});function PI(e){return new hy({type:"promise",innerType:e})}var gy=b("ZodFunction",(e,t)=>{lu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Xh(e,r,i,n)});function zI(e){return new gy({type:"function",input:Array.isArray(e?.input)?Hg(e?.input):e?.input??se(ke()),output:e?.output??ke()})}var Ya=b("ZodCustom",(e,t)=>{pu.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,i,n)=>Yh(e,r,i,n)});function RI(e){let t=new we({check:"custom"});return t._zod.check=e,t}function Cd(e,t){return Qu(Ya,e??(()=>!0),t)}function yy(e,t={}){return Yu(Ya,e,t)}function vy(e){return Xu(e)}var OI=ed,jI=td;function DI(e,t={}){let r=new Ya({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...z.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var NI=(...e)=>rd({Codec:Nd,Boolean:Vi,String:qi},...e);function CI(e){let t=fy(()=>xe([x(e),ve(),qe(),Hi(),se(t),Ie(x(),t)]));return t}function Xa(e,t){return Ba(Od(e),t)}var m6={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 f6(e){Me({customError:e})}function h6(){return Me().customError}var by;by||(by={});var A={...Za,...sd,iso:sn},g6=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 y6(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 v6(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 i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){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 AI(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return A.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 A.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=v6(n,t),a=nt(o,t);return t.refs.set(n,a),t.processing.delete(n),a}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 A.null();if(n.length===0)return A.never();if(n.length===1)return A.literal(n[0]);if(n.every(a=>typeof a=="string"))return A.enum(n);let o=n.map(a=>A.literal(a));return o.length<2?o[0]:A.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return A.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(o=>{let a={...e,type:o};return AI(a,t)});return n.length===0?A.never():n.length===1?n[0]:A.union(n)}if(!r)return A.any();let i;switch(r){case"string":{let n=A.string();if(e.format){let o=e.format;o==="email"?n=n.check(A.email()):o==="uri"||o==="uri-reference"?n=n.check(A.url()):o==="uuid"||o==="guid"?n=n.check(A.uuid()):o==="date-time"?n=n.check(A.iso.datetime()):o==="date"?n=n.check(A.iso.date()):o==="time"?n=n.check(A.iso.time()):o==="duration"?n=n.check(A.iso.duration()):o==="ipv4"?n=n.check(A.ipv4()):o==="ipv6"?n=n.check(A.ipv6()):o==="mac"?n=n.check(A.mac()):o==="cidr"?n=n.check(A.cidrv4()):o==="cidr-v6"?n=n.check(A.cidrv6()):o==="base64"?n=n.check(A.base64()):o==="base64url"?n=n.check(A.base64url()):o==="e164"?n=n.check(A.e164()):o==="jwt"?n=n.check(A.jwt()):o==="emoji"?n=n.check(A.emoji()):o==="nanoid"?n=n.check(A.nanoid()):o==="cuid"?n=n.check(A.cuid()):o==="cuid2"?n=n.check(A.cuid2()):o==="ulid"?n=n.check(A.ulid()):o==="xid"?n=n.check(A.xid()):o==="ksuid"&&(n=n.check(A.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))),i=n;break}case"number":case"integer":{let n=r==="integer"?A.number().int():A.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)),i=n;break}case"boolean":{i=A.boolean();break}case"null":{i=A.null();break}case"object":{let n={},o=e.properties||{},a=new Set(e.required||[]);for(let[c,u]of Object.entries(o)){let d=nt(u,t);n[c]=a.has(c)?d:d.optional()}if(e.propertyNames){let c=nt(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?nt(e.additionalProperties,t):A.any();if(Object.keys(n).length===0){i=A.record(c,u);break}let d=A.object(n).passthrough(),p=A.looseRecord(c,u);i=A.intersection(d,p);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),d=[];for(let f of u){let h=nt(c[f],t),m=A.string().regex(new RegExp(f));d.push(A.looseRecord(m,h))}let p=[];if(Object.keys(n).length>0&&p.push(A.object(n).passthrough()),p.push(...d),p.length===0)i=A.object({}).passthrough();else if(p.length===1)i=p[0];else{let f=A.intersection(p[0],p[1]);for(let h=2;h<p.length;h++)f=A.intersection(f,p[h]);i=f}break}let s=A.object(n);e.additionalProperties===!1?i=s.strict():typeof e.additionalProperties=="object"?i=s.catchall(nt(e.additionalProperties,t)):i=s.passthrough();break}case"array":{let n=e.prefixItems,o=e.items;if(n&&Array.isArray(n)){let a=n.map(c=>nt(c,t)),s=o&&typeof o=="object"&&!Array.isArray(o)?nt(o,t):void 0;s?i=A.tuple(a).rest(s):i=A.tuple(a),typeof e.minItems=="number"&&(i=i.check(A.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(A.maxLength(e.maxItems)))}else if(Array.isArray(o)){let a=o.map(c=>nt(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?nt(e.additionalItems,t):void 0;s?i=A.tuple(a).rest(s):i=A.tuple(a),typeof e.minItems=="number"&&(i=i.check(A.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(A.maxLength(e.maxItems)))}else if(o!==void 0){let a=nt(o,t),s=A.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),i=s}else i=A.array(A.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(i=i.describe(e.description)),e.default!==void 0&&(i=i.default(e.default)),i}function nt(e,t){if(typeof e=="boolean")return e?A.any():A.never();let r=AI(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>nt(u,t)),c=A.union(s);r=i?A.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>nt(u,t)),c=A.xor(s);r=i?A.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:A.any();else{let s=i?r:nt(e.allOf[0],t),c=i?0:1;for(let u=c;u<e.allOf.length;u++)s=A.intersection(s,nt(e.allOf[u],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=A.nullable(r)),e.readOnly===!0&&(r=A.readonly(r));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))g6.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),r}function MI(e,t){if(typeof e=="boolean")return e?A.any():A.never();let r=y6(e,t?.defaultTarget),i=e.$defs||e.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??We};return nt(e,n)}var _y={};$r(_y,{bigint:()=>x6,boolean:()=>S6,date:()=>w6,number:()=>_6,string:()=>b6});function b6(e){return _u(qi,e)}function _6(e){return Eu(Fi,e)}function S6(e){return Nu(Vi,e)}function x6(e){return Au(Bi,e)}function w6(e){return Ju(Wa,e)}Me(mu());var Sy="127.0.0.1";var xy="127.0.0.1";var T6=l.string().optional().transform(e=>{if(!(e==null||e.trim()===""))return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}),I6=l.object({wsHost:l.string().min(1).default(Sy),wsPort:l.coerce.number().int().min(1024).max(65535).default(3005),logLevel:l.enum(["fatal","error","warn","info","debug","trace"]).default("info"),httpHost:l.string().min(1).default(xy),httpPort:l.coerce.number().int().min(1024).max(65535).optional(),httpSecret:l.string().min(1).optional(),corsOrigins:T6,wsAllowedOrigins:l.string().optional().transform(e=>{if(!(e==null||e.trim()===""))return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}),wsSecret:l.string().min(1).optional(),polarWebhookSecret:l.string().min(1).optional(),polarOrganizationId:l.string().min(1).optional(),foundryDataPath:l.string().min(1).optional()});function E6(){let e=process.env.FAMILIAR_FOUNDRY_DATA;return e!==void 0&&e!==""?e:{win32:()=>{let r=process.env.LOCALAPPDATA;return r!==void 0&&r!==""?$y.join(r,"FoundryVTT","Data"):void 0},darwin:()=>$y.join(UI(),"Library","Application Support","FoundryVTT","Data"),linux:()=>$y.join(UI(),".local","share","FoundryVTT","Data")}[k6()]?.()}function P6(){let e=process.argv.indexOf("--http");if(e===-1)return;let t=process.argv[e+1];if(t==null||t==="")return 3006;let r=Number(t);return Number.isFinite(r)?r:(console.warn(`familiar: --http value "${t.slice(0,20).replaceAll(/[^\w.-]/g,"")}" is not a valid port number, using default ${String(3006)}`),3006)}function z6(e){if(e.httpPort!=null&&e.httpPort!==0&&!e.corsOrigins&&(e.corsOrigins=[`http://localhost:${String(e.httpPort)}`,`http://127.0.0.1:${String(e.httpPort)}`]),e.wsAllowedOrigins??=["http://localhost:30000","http://127.0.0.1:30000"],e.foundryDataPath===void 0){let t=E6();t!==void 0&&$6(t)&&(e.foundryDataPath=t)}}function qI(){let e=P6(),t=process.env.FAMILIAR_HTTP_PORT,r=I6.safeParse({wsHost:process.env.FAMILIAR_WS_HOST??Sy,wsPort:process.env.FAMILIAR_WS_PORT??3005,logLevel:process.env.FAMILIAR_LOG_LEVEL??"info",httpHost:process.env.FAMILIAR_HTTP_HOST??xy,httpPort:e??t,httpSecret:process.env.FAMILIAR_HTTP_SECRET,corsOrigins:process.env.FAMILIAR_CORS_ORIGIN,wsAllowedOrigins:process.env.FAMILIAR_WS_ALLOWED_ORIGINS,wsSecret:process.env.FAMILIAR_WS_SECRET,polarWebhookSecret:process.env.POLAR_WEBHOOK_SECRET,polarOrganizationId:process.env.POLAR_ORGANIZATION_ID});if(!r.success){let i=r.error.issues.map(n=>` - ${n.path.join(".")}: ${n.message}`);throw new Error(`Invalid server configuration:
77
+ ${i.join(`
78
+ `)}`)}return z6(r.data),r.data}import{randomUUID as xL}from"node:crypto";var KU=Bt(CE(),1),QU=Bt(Bd(),1),YU=Bt(Qi(),1),XU=Bt(Ny(),1),eL=Bt(My(),1),tL=Bt(Vy(),1),ss=Bt(Gd(),1),Hy=Bt(VE(),1);function Xt(e){return e===void 0?"Unknown error":typeof e=="string"?e:e.error}function Or(e){if(!(e===void 0||typeof e=="string"))return e.code}function BE(e){if(!(e===void 0||typeof e=="string"))return e.retryable}function HE(e,t){throw new Error(t??`Unexpected value: ${e}`)}function jr(e){return e instanceof Error?e.message:String(e)}function hr(e,t,r){return{success:!1,error:{error:e,code:t,...r?.retryable!==void 0&&{retryable:r.retryable},...r?.retryAfterMs!==void 0&&{retryAfterMs:r.retryAfterMs}}}}var Ce={QUERY:"mcp-query",RESPONSE:"mcp-response",PING:"ping",PONG:"pong",CLIENT_UPDATE:"mcp-client-update",AUTH:"auth",AUTH_RESULT:"auth-result"},rL=l.object({type:l.literal(Ce.QUERY),id:l.string(),data:l.object({method:l.string().max(256),params:l.record(l.string(),l.unknown()).optional()})}),nL=l.object({type:l.literal(Ce.RESPONSE),id:l.string(),data:l.object({success:l.boolean(),result:l.unknown().optional(),error:l.union([l.string(),l.object({error:l.string(),code:l.string().optional(),retryable:l.boolean().optional(),retryAfterMs:l.number().optional()})]).optional()})}),iL=l.object({type:l.literal(Ce.PING),id:l.string()}),oL=l.object({type:l.literal(Ce.PONG),id:l.string()}),aL=l.object({name:l.string(),version:l.string(),transport:l.enum(["stdio","http"]),sessionId:l.string().optional(),connectedAt:l.string()}),sL=l.object({valid:l.boolean(),status:l.enum(["active","trial","expired","cancelled","unknown"]),daysRemaining:l.number().optional()}),cL=l.object({type:l.literal(Ce.CLIENT_UPDATE),clients:l.array(aL),license:sL.optional()}),Wy=l.object({type:l.literal(Ce.AUTH),secret:l.string().optional(),licenseKey:l.string().optional()}),lL=l.object({type:l.literal(Ce.AUTH_RESULT),success:l.boolean(),error:l.string().optional()}),WE=l.discriminatedUnion("type",[rL,nL,iL,oL,cL,Wy,lL]);var Dr=class{constructor(t,r){this.maxTokens=t;this.refillRate=r;this.tokens=t,this.lastRefill=Date.now()}tokens;lastRefill;consume(){return this.refill(),this.tokens<1?!1:(this.tokens--,!0)}msUntilNextToken(){return this.refill(),this.tokens>=1?0:Math.ceil((1-this.tokens)/this.refillRate*1e3)}reset(){this.tokens=this.maxTokens,this.lastRefill=Date.now()}refill(){let t=Date.now(),r=t-this.lastRefill;this.tokens=Math.min(this.maxTokens,this.tokens+r*this.refillRate/1e3),this.lastRefill=t}};import{Buffer as uL}from"node:buffer";function Qd(e){return e instanceof uL?e.toString("utf8"):typeof e=="string"?e:void 0}function dL(e){let t=e.searchParams.get("v");if(t!==null){let r=Number.parseInt(t,10);r!==1&&T.warn({serverVersion:1,clientVersion:r},"Protocol version mismatch \u2014 server and module may be incompatible. Update both to the same version.")}}function GE(e,t){let r=`http://${e.req.headers.host??"localhost"}`,i=new URL(e.req.url??"",r);dL(i);let n=e.origin!==""?e.origin:e.req.headers.origin;return n===void 0||n===""?!0:t.size>0&&!t.has(n)?(T.warn({origin:n},"WebSocket connection rejected: origin not allowed"),!1):!0}import{randomUUID as mL}from"node:crypto";var fL=3;function KE(e,t){let r=Qd(e);if(r===void 0){T.warn("Received non-text WebSocket message, ignoring");return}let i;try{i=JSON.parse(r)}catch{T.warn("Received invalid JSON, ignoring");return}let n=WE.safeParse(i);if(!n.success){T.warn({errors:n.error.issues},"Received invalid message");return}let o=n.data;if(o.type!==Ce.PONG&&!t.rateLimiter.consume()){gL(o,t);return}switch(o.type){case Ce.RESPONSE:{hL(o,t);break}case Ce.PONG:{o.id===t.lastPingId?(t.missedPongs=0,T.trace({id:o.id},"Pong received")):T.debug({expected:t.lastPingId,received:o.id},"Stale pong ignored");break}case Ce.QUERY:case Ce.PING:case Ce.CLIENT_UPDATE:case Ce.AUTH:case Ce.AUTH_RESULT:{T.warn({type:o.type},"Unexpected message type from client");break}default:HE(o)}}function hL(e,t){let r=t.pendingQueries.get(e.id);if(!r){T.warn({id:e.id},"Received response for unknown query");return}clearTimeout(r.timer),t.pendingQueries.delete(e.id);let i=Date.now()-r.sentAt;r.resolve(e.data.success?{success:!0,result:e.data.result}:{success:!1,error:e.data.error??"Unknown error"}),T.info({id:e.id,method:r.method,durationMs:i,success:e.data.success},"Query completed")}function gL(e,t){if(e.type===Ce.RESPONSE&&e.id!==void 0){let r=t.pendingQueries.get(e.id);r?(clearTimeout(r.timer),t.pendingQueries.delete(e.id),r.resolve(hr("Response dropped \u2014 WebSocket rate limit exceeded","RATE_LIMITED",{retryable:!0,retryAfterMs:t.rateLimiter.msUntilNextToken()})),T.warn({id:e.id,method:r.method},"Rate-limited RESPONSE \u2014 rejected pending query")):T.warn({id:e.id},"Rate-limited RESPONSE for unknown query")}else T.warn({type:e.type},"WebSocket rate limit exceeded \u2014 dropping message")}function QE(e,t,r){e.pingTimer=setInterval(()=>{if(t()){if(e.missedPongs++,e.missedPongs>fL){T.warn({missedPongs:e.missedPongs},"Client unresponsive \u2014 terminating dead connection"),e.client?.terminate();return}e.lastPingId=mL();let i=JSON.stringify({type:Ce.PING,id:e.lastPingId});r(i)}},3e4)}function cs(e){e.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=null)}function ls(e,t){e.pendingQueries.size>0&&T.warn({count:e.pendingQueries.size,reason:t},"Dropping pending queries");for(let[r,i]of e.pendingQueries)clearTimeout(i.timer),i.resolve({success:!1,error:t}),e.pendingQueries.delete(r)}import{timingSafeEqual as yL}from"node:crypto";import{Buffer as YE}from"node:buffer";var vL=5e3;function XE(e,t,r){if(r.state.client?.readyState===ss.default.OPEN){T.warn("Rejected new WebSocket connection: existing healthy client is connected"),e.close(4002,"Another client is already connected");return}r.state.client&&(cs(r.state),ls(r.state,hr("Stale client replaced by new connection","FOUNDRY_DISCONNECTED",{retryable:!0}).error),r.state.client=null),r.state.client=e,r.state.missedPongs=0,r.state.rateLimiter.reset(),T.info("Foundry module connected, awaiting auth...");let i=setTimeout(()=>{T.warn("WebSocket connection closed: auth timeout"),e.close(4001,"Authentication timeout")},vL);e.on("message",function n(o){e.off("message",n),clearTimeout(i),bL(e,o,r)}),e.on("close",(n,o)=>{clearTimeout(i),_L(n,o,r.state)}),e.on("error",n=>T.error({err:n},"WebSocket client error"))}function bL(e,t,r){let i=Qd(t);if(i===void 0){Yd(e,"Invalid auth message");return}let n;try{n=JSON.parse(i)}catch{Yd(e,"Invalid auth JSON");return}let o=Wy.safeParse(n);if(!o.success){Yd(e,"Invalid auth message format");return}if(r.secret!==void 0&&r.secret!==""){let s=o.data.secret??"";if(s.length!==r.secret.length||!yL(YE.from(s),YE.from(r.secret))){Yd(e,"Invalid secret");return}}e.send(JSON.stringify({type:Ce.AUTH_RESULT,success:!0})),T.info("Foundry module authenticated");let a=o.data.licenseKey??void 0;QE(r.state,r.isConnected,s=>r.safeSend(s));try{r.moduleConnectCallback?.(a)}catch(s){T.error({err:s},"moduleConnectCallback threw during connection setup")}e.on("message",s=>KE(s,r.state))}function _L(e,t,r){e===1009&&T.error({maxPayload:3145728},"WebSocket closed: message exceeded maxPayload (1009)"),T.info({code:e,reason:t.toString("utf8")},"Foundry module disconnected"),r.client=null,r.missedPongs=0,cs(r),ls(r,hr("Foundry module disconnected","FOUNDRY_DISCONNECTED").error)}function Yd(e,t){let r=JSON.stringify({type:Ce.AUTH_RESULT,success:!1,error:t});e.send(r),T.warn(`WebSocket auth failed: ${t}`),e.close(4001,t)}var Xd=class e{wss=null;state={client:null,pendingQueries:new Map,missedPongs:0,lastPingId:null,rateLimiter:new Dr(100,100/6e4*1e3),pingTimer:null};moduleConnectCallback=null;get ws(){if(!this.state.client)throw new Error("No WebSocket client connected");return this.state.client}get isConnected(){return this.state.client?.readyState===ss.default.OPEN}onModuleConnect(t){this.moduleConnectCallback=t}start(t,r,i,n){let o=new Set(i);this.wss=new Hy.default({host:r,port:t,maxPayload:3145728,perMessageDeflate:{threshold:1024},verifyClient:a=>GE(a,o)}),this.wss.on("connection",(a,s)=>{XE(a,s,{state:this.state,isConnected:()=>this.isConnected,safeSend:c=>this.safeSend(c),moduleConnectCallback:this.moduleConnectCallback,secret:n})}),this.wss.on("error",a=>T.error({err:a},"WebSocket server error")),n!==void 0&&n!==""?T.info("WebSocket shared secret authentication enabled"):T.warn("WebSocket has no authentication \u2014 set FAMILIAR_WS_SECRET to secure it"),T.info({host:r,port:t},"WebSocket server listening")}static RETRY_DELAY_MS=500;static RETRYABLE_CODES=new Set(["QUERY_TIMEOUT"]);async query(t,r,i){let n=await this.queryOnce(t,r,i);if(!n.success){let o=Or(n.error);if(o!==void 0&&e.RETRYABLE_CODES.has(o)&&this.isConnected)return T.info({method:t,code:o},"Retrying transient query failure"),await new Promise(a=>{setTimeout(a,e.RETRY_DELAY_MS)}),this.queryOnce(t,r,i)}return n}async queryOnce(t,r,i){if(!this.isConnected)return hr("Foundry module is not connected","FOUNDRY_DISCONNECTED");if(this.state.pendingQueries.size>=50)return T.warn({pending:this.state.pendingQueries.size,max:50},"Too many pending queries \u2014 server is overloaded"),hr("Too many pending queries \u2014 server is overloaded","QUERY_OVERLOADED",{retryable:!0,retryAfterMs:1e3});let n=xL(),o={type:Ce.QUERY,id:n,data:{method:t,params:r}},a=i??1e4;return new Promise(s=>{let c=setTimeout(()=>{this.state.pendingQueries.delete(n),T.warn({method:t,timeoutMs:a,id:n},"Query timed out \u2014 possible hung Foundry module"),s(hr(`Query timed out after ${a}ms: ${t}`,"QUERY_TIMEOUT",{retryable:!0}))},a);if(this.state.pendingQueries.set(n,{resolve:s,timer:c,sentAt:Date.now(),method:t}),!this.safeSend(JSON.stringify(o))){clearTimeout(c),this.state.pendingQueries.delete(n),s(hr("Failed to send message to Foundry module","SEND_FAILED"));return}T.debug({id:n,method:t},"Query sent")})}pushClientUpdate(t,r){if(!this.isConnected)return;let i=JSON.stringify({type:Ce.CLIENT_UPDATE,clients:t,license:r});this.safeSend(i)&&T.debug({clientCount:t.length},"Pushed client update to module")}async shutdown(){return cs(this.state),ls(this.state,"Server shutting down"),this.state.client&&(this.state.client.close(1e3,"Server shutting down"),this.state.client=null),new Promise(t=>{this.wss?this.wss.close(()=>{T.info("WebSocket server closed"),t()}):t()})}static BUFFER_HIGH_WATER_MARK=256*1024;safeSend(t){try{let r=this.ws.bufferedAmount;return r>e.BUFFER_HIGH_WATER_MARK&&T.warn({bufferedAmount:r,highWaterMark:e.BUFFER_HIGH_WATER_MARK},"WebSocket send buffer backpressure \u2014 outgoing data is accumulating"),this.ws.send(t),!0}catch(r){return T.warn({err:r},"Failed to send WebSocket message"),!1}}};function wL(e){return e?.valid===!0&&e.status==="active"}function $L(){return`${["Li","cen","se is ","not ac","tive."].join("")} Please check your Familiar subscription status.`}function rP(e,t){return{query:(r,i,n)=>wL(t())?e.query(r,i,n):Promise.resolve({success:!1,error:$L()})}}import{createHash as TL}from"node:crypto";var IL="https://api.polar.sh/v1/customer-portal/license-keys/validate",EL=1e4;function gr(e){return e.length>8?`${e.slice(0,8)}...`:"***"}var PL=256,zL=/^[\w-]+$/;function nP(e){return e.length>0&&e.length<=PL&&zL.test(e)}function Ky(e){return TL("sha256").update(e).digest("hex")}function RL(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function OL(e){return e==="granted"?{valid:!0,status:"active"}:e==="revoked"?{valid:!1,status:"cancelled"}:e==="disabled"?{valid:!1,status:"expired"}:{valid:!1,status:"unknown"}}function jL(e){let t,r=1/0;for(let[i,n]of e)n.expiresAt<r&&(r=n.expiresAt,t=i);t!==void 0&&e.delete(t)}function ep(e,t,r){let i=e.get(t);if(i){let n=i.expiresAt-6048e5;return Date.now()-n>6048e5?(T.warn({key:gr(r)},"Cached license fallback too stale, rejecting"),{valid:!1,status:"unknown"}):(T.debug({key:gr(r)},"Returning expired cached license result as fallback"),i.result)}return{valid:!1,status:"unknown"}}async function DL(e,t,r){let i=Date.now(),n=Ky(t),o=e.get(n);if(o&&o.expiresAt>i)return T.debug({key:gr(t)},"License cache hit"),o.result;T.info({key:gr(t)},"Validating license key with Polar");let a=new AbortController,s=setTimeout(()=>a.abort(),1e4),c;try{c=await fetch(IL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:t,organization_id:r}),signal:a.signal})}catch(f){return T.warn({key:gr(t),error:jr(f)},"License validation fetch failed"),ep(e,n,t)}finally{clearTimeout(s)}if(c.status===429)return T.warn({key:gr(t)},"License validation rate limited (429)"),ep(e,n,t);if(!c.ok)return T.warn({key:gr(t),status:c.status},"License validation returned non-2xx"),ep(e,n,t);let u;try{u=await c.json()}catch(f){return T.warn({key:gr(t),error:jr(f)},"Failed to parse license validation response"),ep(e,n,t)}let d=RL(u)?u.status:void 0,p=OL(d);return e.size>=EL&&jL(e),e.set(n,{result:p,expiresAt:i+6048e5}),T.info({key:gr(t),valid:p.valid,status:p.status},"License validation complete"),p}function oP(e){let t=new Map,r=new Map;return{validate:async i=>{if(!nP(i))return T.warn({key:gr(i)},"Rejected malformed license key"),{valid:!1,status:"unknown"};let n=Ky(i),o=r.get(n);if(o)return o;let a=DL(t,i,e);r.set(n,a);try{return await a}finally{r.delete(n)}},invalidate:i=>{nP(i)&&t.delete(Ky(i))},invalidateAll:()=>t.clear()}}import{createHmac as BL,timingSafeEqual as HL}from"node:crypto";import{timingSafeEqual as NL}from"node:crypto";import{gzip as CL}from"node:zlib";import{promisify as AL}from"node:util";var ML=AL(CL),UL=1024;function Oe(e,t,r,i){let n={"Content-Type":"application/json",...i};e.writeHead(t,n),e.end(JSON.stringify({error:r}))}function tp(e,t,r){let i=e.headers.origin;i!==void 0&&i!==""&&r.has(i)&&(t.setHeader("Access-Control-Allow-Origin",i),t.setHeader("Vary","Origin"),t.setHeader("Access-Control-Allow-Methods","GET, POST, DELETE, OPTIONS"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Accept, Authorization, Mcp-Session-Id, MCP-Protocol-Version"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id, Retry-After")),t.setHeader("X-Content-Type-Options","nosniff"),t.setHeader("X-Frame-Options","DENY"),t.setHeader("Referrer-Policy","no-referrer"),t.setHeader("Cache-Control","no-store"),t.setHeader("Content-Security-Policy","default-src 'none'")}function aP(e,t,r){if(r===void 0||r===""||e.method==="OPTIONS")return!0;let i=e.headers.authorization;if(!i?.startsWith("Bearer "))return T.warn({method:e.method,pathname:(e.url??"/").split("?")[0]},"Missing or malformed Authorization header"),Oe(t,401,"Authentication required",{"WWW-Authenticate":"Bearer"}),!1;let n=Buffer.from(i.slice(7)),o=Buffer.from(r);return n.length!==o.length||!NL(n,o)?(T.warn({method:e.method,pathname:(e.url??"/").split("?")[0]},"Invalid bearer token"),Oe(t,401,"Invalid token",{"WWW-Authenticate":"Bearer"}),!1):!0}function sP(e,t,r,i){let n=e.headers.origin;if(n!==void 0&&n!==""&&!r.has(n))return T.warn({origin:n},"Rejected request from disallowed origin"),Oe(t,403,"Origin not allowed"),!1;if(e.method==="OPTIONS")return t.writeHead(204),t.end(),!1;if(e.method===void 0||!LL.has(e.method))return Oe(t,405,"Method not allowed"),!1;if(e.method==="POST"&&!(e.headers["content-type"]?.toLowerCase()??"").startsWith("application/json"))return T.warn({contentType:e.headers["content-type"]},"Rejected POST with unsupported Content-Type"),Oe(t,415,"Unsupported Media Type \u2014 Content-Type must be application/json"),!1;let o=e.headers["content-length"];return o!==void 0&&Number.parseInt(o,10)>i?(Oe(t,413,"Request body too large"),!1):!0}var LL=new Set(["GET","POST","DELETE","OPTIONS"]);function cP(e,t,r){if(e.method!=="POST")return;let i=0,n=e.emit.bind(e);e.emit=function(o,...a){return o==="data"&&Buffer.isBuffer(a[0])&&(i+=a[0].length,i>r)?(Oe(t,413,"Request body too large"),e.destroy(),!1):n(o,...a)}}function qL(e){let t=e.headers["accept-encoding"];return typeof t=="string"&&t.includes("gzip")}function ZL(e,t){let r=e.getHeader("content-type");return typeof r=="string"&&r.includes("text/event-stream")||e.getHeader("content-encoding")!==void 0?!1:t.length>=UL}function lP(e,t){if(!qL(e))return;let r=t.end.bind(t);t.end=((i,n,o)=>{let a=i,s="utf8",c;typeof i=="function"?(c=i,a=void 0):typeof n=="function"?c=n:typeof n=="string"&&(s=n,c=o);let u;return Buffer.isBuffer(a)?u=a:typeof a=="string"&&(u=Buffer.from(a,s)),u?ZL(t,u)?((async()=>{try{let d=await ML(u);t.setHeader("Content-Encoding","gzip"),t.setHeader("Vary","Accept-Encoding"),t.removeHeader("Content-Length"),r(d,void 0,c)}catch{r(u,void 0,c)}})(),t):r(u,void 0,c):r(a,s,c)})}var WL=512*1024,us=new Set;function JL(e,t){return new Promise((r,i)=>{let n=!1,o=[],a=0;e.on("data",s=>{if(!n){if(a+=s.length,a>t){n=!0,e.destroy(),i(new Error("Request body too large"));return}o.push(s)}}),e.on("end",()=>{n||(n=!0,r(Buffer.concat(o).toString("utf8")))}),e.on("error",s=>{n||(n=!0,i(s))})})}function GL(e){let{secret:t,webhookId:r,timestamp:i,body:n,signatureHeader:o}=e,a=t.startsWith("whsec_")?t.slice(6):t,s=Buffer.from(a,"base64"),c=`${r}.${i}.${n}`,u=BL("sha256",s).update(c).digest("base64"),d=Buffer.from(u),p=o.split(" ");for(let f of p){let h=f.split(",");if(h.length<2||h[0]!=="v1")continue;let m=h.slice(1).join(","),g=Buffer.from(m);if(g.length===d.length&&HL(g,d))return!0}return!1}function KL(e){let t=Number.parseInt(e,10);if(Number.isNaN(t))return!1;let r=Math.floor(Date.now()/1e3);return Math.abs(r-t)<=300}function QL(e){if(us.has(e))return!0;if(us.size>=1e4){let t=us.values().next();t.done||us.delete(t.value)}return us.add(e),!1}function uP(e){e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({received:!0}))}function YL(e){return typeof e!="object"||e===null?!1:"type"in e&&typeof e.type=="string"}function Qy(e,t){let r=e.headers[t];return typeof r=="string"?r:void 0}function XL(e){let t=Qy(e,"webhook-id"),r=Qy(e,"webhook-timestamp"),i=Qy(e,"webhook-signature");if(!(t===void 0||t===""||r===void 0||r===""||i===void 0||i===""))return{webhookId:t,timestamp:r,signature:i}}function eq(e,t,r){switch(e){case"subscription.revoked":case"subscription.canceled":case"subscription.updated":case"order.refunded":case"benefit_grant.revoked":{T.warn({type:e},"Polar webhook: revoking all cached licenses"),t.invalidateAll(),r?.();break}case"subscription.active":case"order.paid":case"benefit_grant.created":{T.info({type:e},"Polar webhook: subscription/order event");break}default:{T.debug({type:e},"Polar webhook: unhandled event type");break}}}function dP(e,t,r){return(i,n)=>{(async()=>{try{if(i.method!=="POST"){Oe(n,405,"Method not allowed");return}if(!i.headers["content-type"]?.startsWith("application/json")){Oe(n,415,"Unsupported Media Type");return}let o;try{o=await JL(i,WL)}catch{Oe(n,413,"Request body too large");return}let a=XL(i);if(!a){Oe(n,400,"Missing required webhook headers");return}let{webhookId:s,timestamp:c,signature:u}=a;if(!KL(c)){Oe(n,401,"Webhook timestamp outside tolerance");return}if(!GL({secret:e,webhookId:s,timestamp:c,body:o,signatureHeader:u})){Oe(n,401,"Invalid webhook signature");return}if(QL(s)){uP(n);return}let d;try{d=JSON.parse(o)}catch{Oe(n,400,"Invalid JSON body");return}if(!YL(d)){Oe(n,400,"Missing or invalid event type");return}eq(d.type,t,r),uP(n)}catch(o){T.error({error:jr(o)},"Polar webhook handler error"),Oe(n,500,"Internal server error")}})()}}function pP(){return!0}async function Yy(e){try{await e.shutdown()}catch(t){T.warn({err:t},`Error during connector shutdown: ${jr(t)}`)}}function Xy(e){let t=!1,r=async()=>{t||(t=!0,T.info("Shutting down..."),await e(),process.exit(0))};process.on("SIGINT",()=>{r()}),process.on("SIGTERM",()=>{r()})}function mP(e){if(e.polarOrganizationId!=null&&e.polarOrganizationId!=="")return T.info("Polar license validation enabled"),oP(e.polarOrganizationId);if(!pP()&&process.env.NODE_ENV!=="production"){T.warn("POLAR_ORGANIZATION_ID not set \u2014 license validation disabled (dev mode)");return}return T.fatal("POLAR_ORGANIZATION_ID is required \u2014 refusing to start without license validation"),process.exit(1)}function fP(e,t,r){if(!t||e.polarWebhookSecret==null||e.polarWebhookSecret==="")return;let i=dP(e.polarWebhookSecret,t,r);return e.polarWebhookSecret.startsWith("whsec_")||T.warn('POLAR_WEBHOOK_SECRET does not start with "whsec_" \u2014 verify this is a Standard Webhooks secret'),T.info("Polar webhook handler enabled"),i}function hP(e){e.httpPort!=null&&(e.httpSecret===void 0||e.httpSecret==="")&&(T.fatal("FAMILIAR_HTTP_SECRET is required when HTTP transport is enabled \u2014 refusing to start without authentication"),process.exit(1)),pP()&&(e.wsSecret===void 0||e.wsSecret==="")&&(T.fatal("FAMILIAR_WS_SECRET is required \u2014 refusing to start without WebSocket authentication"),process.exit(1))}var pe;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},e.getValidEnumValues=n=>{let o=e.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(let s of o)a[s]=n[s];return e.objectValues(a)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},e.find=(n,o)=>{for(let a of n)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(pe||(pe={}));var gP;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(gP||(gP={}));var q=pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nr=e=>{switch(typeof e){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(e)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(e)?q.array:e===null?q.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?q.promise:typeof Map<"u"&&e instanceof Map?q.map:typeof Set<"u"&&e instanceof Set?q.set:typeof Date<"u"&&e instanceof Date?q.date:q.object;default:return q.unknown}};var R=pe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Pt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},i={_errors:[]},n=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let s=i,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return n(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),i=[];for(let n of this.issues)if(n.path.length>0){let o=n.path[0];r[o]=r[o]||[],r[o].push(t(n))}else i.push(t(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Pt.create=e=>new Pt(e);var tq=(e,t)=>{let r;switch(e.code){case R.invalid_type:e.received===q.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case R.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,pe.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:r=`Unrecognized key(s) in object: ${pe.joinValues(e.keys,", ")}`;break;case R.invalid_union:r="Invalid input";break;case R.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${pe.joinValues(e.options)}`;break;case R.invalid_enum_value:r=`Invalid enum value. Expected ${pe.joinValues(e.options)}, received '${e.received}'`;break;case R.invalid_arguments:r="Invalid function arguments";break;case R.invalid_return_type:r="Invalid function return type";break;case R.invalid_date:r="Invalid date";break;case R.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:pe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case R.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case R.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case R.custom:r="Invalid input";break;case R.invalid_intersection_types:r="Intersection results could not be merged";break;case R.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case R.not_finite:r="Number must be finite";break;default:r=t.defaultError,pe.assertNever(e)}return{message:r}},un=tq;var rq=un;function ds(){return rq}var rp=e=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,o=[...r,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let s="",c=i.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...n,path:o,message:s}};function M(e,t){let r=ds(),i=rp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===un?void 0:un].filter(n=>!!n)});e.common.issues.push(i)}var it=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let i=[];for(let n of r){if(n.status==="aborted")return J;n.status==="dirty"&&t.dirty(),i.push(n.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,r){let i=[];for(let n of r){let o=await n.key,a=await n.value;i.push({key:o,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,r){let i={};for(let n of r){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return J;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}},J=Object.freeze({status:"aborted"}),no=e=>({status:"dirty",value:e}),dt=e=>({status:"valid",value:e}),ev=e=>e.status==="aborted",tv=e=>e.status==="dirty",ti=e=>e.status==="valid",ps=e=>typeof Promise<"u"&&e instanceof Promise;var Z;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Z||(Z={}));var At=class{constructor(t,r,i,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},yP=(e,t)=>{if(ti(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Pt(e.common.issues);return this._error=r,this._error}}};function ne(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:n}}var ce=class{get description(){return this._def.description}_getType(t){return Nr(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Nr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new it,ctx:{common:t.parent.common,data:t.data,parsedType:Nr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ps(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Nr(t)},n=this._parseSync({data:t,path:i.path,parent:i});return yP(i,n)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Nr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:r});return ti(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>ti(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){let i=await this.safeParseAsync(t,r);if(i.success)return i.data;throw i.error}async safeParseAsync(t,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Nr(t)},n=this._parse({data:t,path:i.path,parent:i}),o=await(ps(n)?n:Promise.resolve(n));return yP(i,o)}refine(t,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let a=t(n),s=()=>o.addIssue({code:R.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((i,n)=>t(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(t){return new tr({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return er.create(this,this._def)}nullable(){return Mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pn.create(this)}promise(){return ri.create(this,this._def)}or(t){return co.create([this,t],this._def)}and(t){return lo.create(this,t,this._def)}transform(t){return new tr({...ne(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ho({...ne(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new np({typeName:D.ZodBranded,type:this,...ne(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new go({...ne(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ip.create(this,t)}readonly(){return yo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},nq=/^c[^\s-]{8,}$/i,iq=/^[0-9a-z]+$/,oq=/^[0-9A-HJKMNP-TV-Z]{26}$/i,aq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sq=/^[a-z0-9_-]{21}$/i,cq=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lq=/^[-+]?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)?)??$/,uq=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",rv,pq=/^(?:(?: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])$/,mq=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,fq=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,hq=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yq=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vP="((\\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])))",vq=new RegExp(`^${vP}$`);function bP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function bq(e){return new RegExp(`^${bP(e)}$`)}function _q(e){let t=`${vP}T${bP(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Sq(e,t){return!!((t==="v4"||!t)&&pq.test(e)||(t==="v6"||!t)&&fq.test(e))}function xq(e,t){if(!cq.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||t&&n.alg!==t)}catch{return!1}}function wq(e,t){return!!((t==="v4"||!t)&&mq.test(e)||(t==="v6"||!t)&&hq.test(e))}var oo=class e extends ce{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==q.string){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_type,expected:q.string,received:o.parsedType}),J}let i=new it,n;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(n=this._getOrReturnCtx(t,n),a?M(n,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&M(n,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")uq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"email",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")rv||(rv=new RegExp(dq,"u")),rv.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"emoji",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")aq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"uuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")sq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"nanoid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")nq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"cuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")iq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"cuid2",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")oq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"ulid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),M(n,{validation:"url",code:R.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"regex",code:R.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?_q(o).test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?vq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?bq(o).test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:R.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?lq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"duration",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?Sq(t.data,o.version)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"ip",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?xq(t.data,o.alg)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"jwt",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?wq(t.data,o.version)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"cidr",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?gq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"base64",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?yq.test(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{validation:"base64url",code:R.invalid_string,message:o.message}),i.dirty()):pe.assertNever(o);return{status:i.value,value:t.data}}_regex(t,r,i){return this.refinement(n=>t.test(n),{validation:r,code:R.invalid_string,...Z.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Z.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Z.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Z.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Z.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Z.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Z.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Z.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Z.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Z.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Z.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Z.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Z.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Z.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Z.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Z.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Z.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Z.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Z.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Z.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Z.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Z.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Z.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Z.errToObj(r)})}nonempty(t){return this.min(1,Z.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};oo.create=e=>new oo({checks:[],typeName:D.ZodString,coerce:e?.coerce??!1,...ne(e)});function $q(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),a=Number.parseInt(t.toFixed(n).replace(".",""));return o%a/10**n}var ms=class e extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==q.number){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_type,expected:q.number,received:o.parsedType}),J}let i,n=new it;for(let o of this._def.checks)o.kind==="int"?pe.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:R.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?$q(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:R.not_finite,message:o.message}),n.dirty()):pe.assertNever(o);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Z.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Z.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Z.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Z.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Z.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Z.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Z.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Z.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&pe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ms.create=e=>new ms({checks:[],typeName:D.ZodNumber,coerce:e?.coerce||!1,...ne(e)});var fs=class e extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==q.bigint)return this._getInvalidInput(t);let i,n=new it;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),M(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):pe.assertNever(o);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return M(r,{code:R.invalid_type,expected:q.bigint,received:r.parsedType}),J}gte(t,r){return this.setLimit("min",t,!0,Z.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Z.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Z.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Z.toString(r))}setLimit(t,r,i,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:i,message:Z.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Z.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Z.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};fs.create=e=>new fs({checks:[],typeName:D.ZodBigInt,coerce:e?.coerce??!1,...ne(e)});var hs=class extends ce{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==q.boolean){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:q.boolean,received:i.parsedType}),J}return dt(t.data)}};hs.create=e=>new hs({typeName:D.ZodBoolean,coerce:e?.coerce||!1,...ne(e)});var gs=class e extends ce{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==q.date){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_type,expected:q.date,received:o.parsedType}),J}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return M(o,{code:R.invalid_date}),J}let i=new it,n;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),M(n,{code:R.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):pe.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Z.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Z.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};gs.create=e=>new gs({checks:[],coerce:e?.coerce||!1,typeName:D.ZodDate,...ne(e)});var ys=class extends ce{_parse(t){if(this._getType(t)!==q.symbol){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:q.symbol,received:i.parsedType}),J}return dt(t.data)}};ys.create=e=>new ys({typeName:D.ZodSymbol,...ne(e)});var ao=class extends ce{_parse(t){if(this._getType(t)!==q.undefined){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:q.undefined,received:i.parsedType}),J}return dt(t.data)}};ao.create=e=>new ao({typeName:D.ZodUndefined,...ne(e)});var so=class extends ce{_parse(t){if(this._getType(t)!==q.null){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:q.null,received:i.parsedType}),J}return dt(t.data)}};so.create=e=>new so({typeName:D.ZodNull,...ne(e)});var vs=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(t){return dt(t.data)}};vs.create=e=>new vs({typeName:D.ZodAny,...ne(e)});var dn=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(t){return dt(t.data)}};dn.create=e=>new dn({typeName:D.ZodUnknown,...ne(e)});var yr=class extends ce{_parse(t){let r=this._getOrReturnCtx(t);return M(r,{code:R.invalid_type,expected:q.never,received:r.parsedType}),J}};yr.create=e=>new yr({typeName:D.ZodNever,...ne(e)});var bs=class extends ce{_parse(t){if(this._getType(t)!==q.undefined){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:q.void,received:i.parsedType}),J}return dt(t.data)}};bs.create=e=>new bs({typeName:D.ZodVoid,...ne(e)});var pn=class e extends ce{_parse(t){let{ctx:r,status:i}=this._processInputParams(t),n=this._def;if(r.parsedType!==q.array)return M(r,{code:R.invalid_type,expected:q.array,received:r.parsedType}),J;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,s=r.data.length<n.exactLength.value;(a||s)&&(M(r,{code:a?R.too_big:R.too_small,minimum:s?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(M(r,{code:R.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(M(r,{code:R.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>n.type._parseAsync(new At(r,a,r.path,s)))).then(a=>it.mergeArray(i,a));let o=[...r.data].map((a,s)=>n.type._parseSync(new At(r,a,r.path,s)));return it.mergeArray(i,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Z.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Z.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Z.toString(r)}})}nonempty(t){return this.min(1,t)}};pn.create=(e,t)=>new pn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...ne(t)});function io(e){if(e instanceof zt){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=er.create(io(i))}return new zt({...e._def,shape:()=>t})}else return e instanceof pn?new pn({...e._def,type:io(e.element)}):e instanceof er?er.create(io(e.unwrap())):e instanceof Mr?Mr.create(io(e.unwrap())):e instanceof Ar?Ar.create(e.items.map(t=>io(t))):e}var zt=class e extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=pe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==q.object){let u=this._getOrReturnCtx(t);return M(u,{code:R.invalid_type,expected:q.object,received:u.parsedType}),J}let{status:i,ctx:n}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yr&&this._def.unknownKeys==="strip"))for(let u in n.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let d=o[u],p=n.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new At(n,p,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof yr){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of s)c.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")s.length>0&&(M(n,{code:R.unrecognized_keys,keys:s}),i.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of s){let p=n.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new At(n,p,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let p=await d.key,f=await d.value;u.push({key:p,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>it.mergeObjectSync(i,u)):it.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return Z.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,i)=>{let n=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:Z.errToObj(t).message??n}:{message:n}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:D.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let i of pe.objectKeys(t))t[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let i of pe.objectKeys(this.shape))t[i]||(r[i]=this.shape[i]);return new e({...this._def,shape:()=>r})}deepPartial(){return io(this)}partial(t){let r={};for(let i of pe.objectKeys(this.shape)){let n=this.shape[i];t&&!t[i]?r[i]=n:r[i]=n.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let i of pe.objectKeys(this.shape))if(t&&!t[i])r[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof er;)o=o._def.innerType;r[i]=o}return new e({...this._def,shape:()=>r})}keyof(){return _P(pe.objectKeys(this.shape))}};zt.create=(e,t)=>new zt({shape:()=>e,unknownKeys:"strip",catchall:yr.create(),typeName:D.ZodObject,...ne(t)});zt.strictCreate=(e,t)=>new zt({shape:()=>e,unknownKeys:"strict",catchall:yr.create(),typeName:D.ZodObject,...ne(t)});zt.lazycreate=(e,t)=>new zt({shape:e,unknownKeys:"strip",catchall:yr.create(),typeName:D.ZodObject,...ne(t)});var co=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Pt(s.ctx.common.issues));return M(r,{code:R.invalid_union,unionErrors:a}),J}if(r.common.async)return Promise.all(i.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let c of i){let u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new Pt(c));return M(r,{code:R.invalid_union,unionErrors:s}),J}}get options(){return this._def.options}};co.create=(e,t)=>new co({options:e,typeName:D.ZodUnion,...ne(t)});var Cr=e=>e instanceof uo?Cr(e.schema):e instanceof tr?Cr(e.innerType()):e instanceof po?[e.value]:e instanceof mo?e.options:e instanceof fo?pe.objectValues(e.enum):e instanceof ho?Cr(e._def.innerType):e instanceof ao?[void 0]:e instanceof so?[null]:e instanceof er?[void 0,...Cr(e.unwrap())]:e instanceof Mr?[null,...Cr(e.unwrap())]:e instanceof np||e instanceof yo?Cr(e.unwrap()):e instanceof go?Cr(e._def.innerType):[],nv=class e extends ce{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.object)return M(r,{code:R.invalid_type,expected:q.object,received:r.parsedType}),J;let i=this.discriminator,n=r.data[i],o=this.optionsMap.get(n);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){let n=new Map;for(let o of r){let a=Cr(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(n.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);n.set(s,o)}}return new e({typeName:D.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...ne(i)})}};function iv(e,t){let r=Nr(e),i=Nr(t);if(e===t)return{valid:!0,data:e};if(r===q.object&&i===q.object){let n=pe.objectKeys(t),o=pe.objectKeys(e).filter(s=>n.indexOf(s)!==-1),a={...e,...t};for(let s of o){let c=iv(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===q.array&&i===q.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],c=iv(a,s);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===q.date&&i===q.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var lo=class extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=(o,a)=>{if(ev(o)||ev(a))return J;let s=iv(o.value,a.value);return s.valid?((tv(o)||tv(a))&&r.dirty(),{status:r.value,value:s.data}):(M(i,{code:R.invalid_intersection_types}),J)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};lo.create=(e,t,r)=>new lo({left:e,right:t,typeName:D.ZodIntersection,...ne(r)});var Ar=class e extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.array)return M(i,{code:R.invalid_type,expected:q.array,received:i.parsedType}),J;if(i.data.length<this._def.items.length)return M(i,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&i.data.length>this._def.items.length&&(M(i,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...i.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new At(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>it.mergeArray(r,a)):it.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ar.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ar({items:e,typeName:D.ZodTuple,rest:null,...ne(t)})};var ov=class e extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.object)return M(i,{code:R.invalid_type,expected:q.object,received:i.parsedType}),J;let n=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)n.push({key:o._parse(new At(i,s,i.path,s)),value:a._parse(new At(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?it.mergeObjectAsync(r,n):it.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,i){return r instanceof ce?new e({keyType:t,valueType:r,typeName:D.ZodRecord,...ne(i)}):new e({keyType:oo.create(),valueType:t,typeName:D.ZodRecord,...ne(r)})}},_s=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.map)return M(i,{code:R.invalid_type,expected:q.map,received:i.parsedType}),J;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,c],u)=>({key:n._parse(new At(i,s,i.path,[u,"key"])),value:o._parse(new At(i,c,i.path,[u,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return J;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of a){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return J;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}}}};_s.create=(e,t,r)=>new _s({valueType:t,keyType:e,typeName:D.ZodMap,...ne(r)});var Ss=class e extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==q.set)return M(i,{code:R.invalid_type,expected:q.set,received:i.parsedType}),J;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(M(i,{code:R.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(M(i,{code:R.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function a(c){let u=new Set;for(let d of c){if(d.status==="aborted")return J;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let s=[...i.data.values()].map((c,u)=>o._parse(new At(i,c,i.path,u)));return i.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:Z.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Z.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ss.create=(e,t)=>new Ss({valueType:e,minSize:null,maxSize:null,typeName:D.ZodSet,...ne(t)});var av=class e extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.function)return M(r,{code:R.invalid_type,expected:q.function,received:r.parsedType}),J;function i(s,c){return rp({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ds(),un].filter(u=>!!u),issueData:{code:R.invalid_arguments,argumentsError:c}})}function n(s,c){return rp({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ds(),un].filter(u=>!!u),issueData:{code:R.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof ri){let s=this;return dt(async function(...c){let u=new Pt([]),d=await s._def.args.parseAsync(c,o).catch(h=>{throw u.addIssue(i(c,h)),u}),p=await Reflect.apply(a,this,d);return await s._def.returns._def.type.parseAsync(p,o).catch(h=>{throw u.addIssue(n(p,h)),u})})}else{let s=this;return dt(function(...c){let u=s._def.args.safeParse(c,o);if(!u.success)throw new Pt([i(c,u.error)]);let d=Reflect.apply(a,this,u.data),p=s._def.returns.safeParse(d,o);if(!p.success)throw new Pt([n(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ar.create(t).rest(dn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new e({args:t||Ar.create([]).rest(dn.create()),returns:r||dn.create(),typeName:D.ZodFunction,...ne(i)})}},uo=class extends ce{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};uo.create=(e,t)=>new uo({getter:e,typeName:D.ZodLazy,...ne(t)});var po=class extends ce{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return M(r,{received:r.data,code:R.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:t.data}}get value(){return this._def.value}};po.create=(e,t)=>new po({value:e,typeName:D.ZodLiteral,...ne(t)});function _P(e,t){return new mo({values:e,typeName:D.ZodEnum,...ne(t)})}var mo=class e extends ce{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),i=this._def.values;return M(r,{expected:pe.joinValues(i),received:r.parsedType,code:R.invalid_type}),J}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),i=this._def.values;return M(r,{received:r.data,code:R.invalid_enum_value,options:i}),J}return dt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}};mo.create=_P;var fo=class extends ce{_parse(t){let r=pe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==q.string&&i.parsedType!==q.number){let n=pe.objectValues(r);return M(i,{expected:pe.joinValues(n),received:i.parsedType,code:R.invalid_type}),J}if(this._cache||(this._cache=new Set(pe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let n=pe.objectValues(r);return M(i,{received:i.data,code:R.invalid_enum_value,options:n}),J}return dt(t.data)}get enum(){return this._def.values}};fo.create=(e,t)=>new fo({values:e,typeName:D.ZodNativeEnum,...ne(t)});var ri=class extends ce{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.promise&&r.common.async===!1)return M(r,{code:R.invalid_type,expected:q.promise,received:r.parsedType}),J;let i=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return dt(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ri.create=(e,t)=>new ri({type:e,typeName:D.ZodPromise,...ne(t)});var tr=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:i}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:a=>{M(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let a=n.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return J;let c=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return c.status==="aborted"?J:c.status==="dirty"?no(c.value):r.value==="dirty"?no(c.value):c});{if(r.value==="aborted")return J;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?J:s.status==="dirty"?no(s.value):r.value==="dirty"?no(s.value):s}}if(n.type==="refinement"){let a=s=>{let c=n.refinement(s,o);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?J:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?J:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ti(a))return J;let s=n.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>ti(a)?Promise.resolve(n.transform(a.value,o)).then(s=>({status:r.value,value:s})):J);pe.assertNever(n)}};tr.create=(e,t,r)=>new tr({schema:e,typeName:D.ZodEffects,effect:t,...ne(r)});tr.createWithPreprocess=(e,t,r)=>new tr({schema:t,effect:{type:"preprocess",transform:e},typeName:D.ZodEffects,...ne(r)});var er=class extends ce{_parse(t){return this._getType(t)===q.undefined?dt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};er.create=(e,t)=>new er({innerType:e,typeName:D.ZodOptional,...ne(t)});var Mr=class extends ce{_parse(t){return this._getType(t)===q.null?dt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Mr.create=(e,t)=>new Mr({innerType:e,typeName:D.ZodNullable,...ne(t)});var ho=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return r.parsedType===q.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ho.create=(e,t)=>new ho({innerType:e,typeName:D.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ne(t)});var go=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ps(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Pt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Pt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};go.create=(e,t)=>new go({innerType:e,typeName:D.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ne(t)});var xs=class extends ce{_parse(t){if(this._getType(t)!==q.nan){let i=this._getOrReturnCtx(t);return M(i,{code:R.invalid_type,expected:q.nan,received:i.parsedType}),J}return{status:"valid",value:t.data}}};xs.create=e=>new xs({typeName:D.ZodNaN,...ne(e)});var np=class extends ce{_parse(t){let{ctx:r}=this._processInputParams(t),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},ip=class e extends ce{_parse(t){let{status:r,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?J:o.status==="dirty"?(r.dirty(),no(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?J:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(t,r){return new e({in:t,out:r,typeName:D.ZodPipeline})}},yo=class extends ce{_parse(t){let r=this._def.innerType._parse(t),i=n=>(ti(n)&&(n.value=Object.freeze(n.value)),n);return ps(r)?r.then(n=>i(n)):i(r)}unwrap(){return this._def.innerType}};yo.create=(e,t)=>new yo({innerType:e,typeName:D.ZodReadonly,...ne(t)});var RQ={object:zt.lazycreate},D;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(D||(D={}));var OQ=oo.create,jQ=ms.create,DQ=xs.create,NQ=fs.create,CQ=hs.create,AQ=gs.create,MQ=ys.create,UQ=ao.create,LQ=so.create,qQ=vs.create,ZQ=dn.create,FQ=yr.create,VQ=bs.create,BQ=pn.create,SP=zt.create,HQ=zt.strictCreate,WQ=co.create,JQ=nv.create,GQ=lo.create,KQ=Ar.create,QQ=ov.create,YQ=_s.create,XQ=Ss.create,eY=av.create,tY=uo.create,rY=po.create,nY=mo.create,iY=fo.create,oY=ri.create,aY=tr.create,sY=er.create,cY=Mr.create,lY=tr.createWithPreprocess,uY=ip.create;var Eq=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>jn(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Qr(e,r,i),e.parseAsync=async(r,i)=>Dn(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Yr(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>He(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.apply=r=>r(e)});var Pq=b("ZodMiniObject",(e,t)=>{ql.init(e,t),Eq.init(e,t),te(e,"shape",()=>t.shape)});function sv(e,t){let r={type:"object",shape:e??{},...j(t)};return new Pq(r)}function Mt(e){return!!e._zod}function ni(e){let t=Object.values(e);if(t.length===0)return sv({});let r=t.every(Mt),i=t.every(n=>!Mt(n));if(r)return sv(e);if(i)return SP(e);throw new Error("Mixed Zod versions detected in object shape.")}function mn(e,t){return Mt(e)?Qr(e,t):e.safeParse(t)}async function op(e,t){return Mt(e)?await Yr(e,t):await e.safeParseAsync(t)}function fn(e){if(!e)return;let t;if(Mt(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function vo(e){if(e){if(typeof e=="object"){let t=e,r=e;if(!t._def&&!r._zod){let i=Object.values(e);if(i.length>0&&i.every(n=>typeof n=="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse=="function")))return ni(e)}}if(Mt(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function ap(e){if(e&&typeof e=="object"){if("message"in e&&typeof e.message=="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t=="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function $P(e){return e.description}function kP(e){if(Mt(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function sp(e){if(Mt(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.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 i=e.value;if(i!==void 0)return i}var lv="2025-11-25",TP="2025-03-26",_o=[lv,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],hn="io.modelcontextprotocol/related-task",lp="2.0",Ye=Cd(e=>e!==null&&(typeof e=="object"||typeof e=="function")),IP=xe([x(),ve().int()]),EP=x(),BY=Ke({ttl:xe([ve(),Hi()]).optional(),pollInterval:ve().optional()}),Dq=L({ttl:ve().optional()}),Nq=L({taskId:x()}),uv=Ke({progressToken:IP.optional(),[hn]:Nq.optional()}),Rt=L({_meta:uv.optional()}),ws=Rt.extend({task:Dq.optional()}),PP=e=>ws.safeParse(e).success,Xe=L({method:x(),params:Rt.loose().optional()}),Ut=L({_meta:uv.optional()}),Lt=L({method:x(),params:Ut.loose().optional()}),et=Ke({_meta:uv.optional()}),up=xe([x(),ve().int()]),zP=L({jsonrpc:F(lp),id:up,...Xe.shape}).strict(),gn=e=>zP.safeParse(e).success,RP=L({jsonrpc:F(lp),...Lt.shape}).strict(),OP=e=>RP.safeParse(e).success,dv=L({jsonrpc:F(lp),id:up,result:et}).strict(),Ur=e=>dv.safeParse(e).success;var H;(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"})(H||(H={}));var pv=L({jsonrpc:F(lp),id:up.optional(),error:L({code:ve().int(),message:x(),data:ke().optional()})}).strict();var So=e=>pv.safeParse(e).success;var $s=xe([zP,RP,dv,pv]),HY=xe([dv,pv]),dp=et.strict(),Cq=Ut.extend({requestId:up.optional(),reason:x().optional()}),pp=Lt.extend({method:F("notifications/cancelled"),params:Cq}),Aq=L({src:x(),mimeType:x().optional(),sizes:se(x()).optional(),theme:Qe(["light","dark"]).optional()}),ks=L({icons:se(Aq).optional()}),bo=L({name:x(),title:x().optional()}),jP=bo.extend({...bo.shape,...ks.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),Mq=Wi(L({applyDefaults:qe().optional()}),Ie(x(),ke())),Uq=Xa(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Wi(L({form:Mq.optional(),url:Ye.optional()}),Ie(x(),ke()).optional())),Lq=Ke({list:Ye.optional(),cancel:Ye.optional(),requests:Ke({sampling:Ke({createMessage:Ye.optional()}).optional(),elicitation:Ke({create:Ye.optional()}).optional()}).optional()}),qq=Ke({list:Ye.optional(),cancel:Ye.optional(),requests:Ke({tools:Ke({call:Ye.optional()}).optional()}).optional()}),Zq=L({experimental:Ie(x(),Ye).optional(),sampling:L({context:Ye.optional(),tools:Ye.optional()}).optional(),elicitation:Uq.optional(),roots:L({listChanged:qe().optional()}).optional(),tasks:Lq.optional()}),Fq=Rt.extend({protocolVersion:x(),capabilities:Zq,clientInfo:jP}),mp=Xe.extend({method:F("initialize"),params:Fq}),mv=e=>mp.safeParse(e).success,Vq=L({experimental:Ie(x(),Ye).optional(),logging:Ye.optional(),completions:Ye.optional(),prompts:L({listChanged:qe().optional()}).optional(),resources:L({subscribe:qe().optional(),listChanged:qe().optional()}).optional(),tools:L({listChanged:qe().optional()}).optional(),tasks:qq.optional()}),Bq=et.extend({protocolVersion:x(),capabilities:Vq,serverInfo:jP,instructions:x().optional()}),fv=Lt.extend({method:F("notifications/initialized"),params:Ut.optional()});var fp=Xe.extend({method:F("ping"),params:Rt.optional()}),Hq=L({progress:ve(),total:ze(ve()),message:ze(x())}),Wq=L({...Ut.shape,...Hq.shape,progressToken:IP}),hp=Lt.extend({method:F("notifications/progress"),params:Wq}),Jq=Rt.extend({cursor:EP.optional()}),Ts=Xe.extend({params:Jq.optional()}),Is=et.extend({nextCursor:EP.optional()}),Gq=Qe(["working","input_required","completed","failed","cancelled"]),Es=L({taskId:x(),status:Gq,ttl:xe([ve(),Hi()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:ze(ve()),statusMessage:ze(x())}),xo=et.extend({task:Es}),Kq=Ut.merge(Es),Ps=Lt.extend({method:F("notifications/tasks/status"),params:Kq}),gp=Xe.extend({method:F("tasks/get"),params:Rt.extend({taskId:x()})}),yp=et.merge(Es),vp=Xe.extend({method:F("tasks/result"),params:Rt.extend({taskId:x()})}),WY=et.loose(),bp=Ts.extend({method:F("tasks/list")}),_p=Is.extend({tasks:se(Es)}),Sp=Xe.extend({method:F("tasks/cancel"),params:Rt.extend({taskId:x()})}),DP=et.merge(Es),NP=L({uri:x(),mimeType:ze(x()),_meta:Ie(x(),ke()).optional()}),CP=NP.extend({text:x()}),hv=x().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),AP=NP.extend({blob:hv}),zs=Qe(["user","assistant"]),wo=L({audience:se(zs).optional(),priority:ve().min(0).max(1).optional(),lastModified:sn.datetime({offset:!0}).optional()}),MP=L({...bo.shape,...ks.shape,uri:x(),description:ze(x()),mimeType:ze(x()),annotations:wo.optional(),_meta:ze(Ke({}))}),Qq=L({...bo.shape,...ks.shape,uriTemplate:x(),description:ze(x()),mimeType:ze(x()),annotations:wo.optional(),_meta:ze(Ke({}))}),xp=Ts.extend({method:F("resources/list")}),Yq=Is.extend({resources:se(MP)}),wp=Ts.extend({method:F("resources/templates/list")}),Xq=Is.extend({resourceTemplates:se(Qq)}),gv=Rt.extend({uri:x()}),eZ=gv,$p=Xe.extend({method:F("resources/read"),params:eZ}),tZ=et.extend({contents:se(xe([CP,AP]))}),rZ=Lt.extend({method:F("notifications/resources/list_changed"),params:Ut.optional()}),nZ=gv,iZ=Xe.extend({method:F("resources/subscribe"),params:nZ}),oZ=gv,aZ=Xe.extend({method:F("resources/unsubscribe"),params:oZ}),sZ=Ut.extend({uri:x()}),cZ=Lt.extend({method:F("notifications/resources/updated"),params:sZ}),lZ=L({name:x(),description:ze(x()),required:ze(qe())}),uZ=L({...bo.shape,...ks.shape,description:ze(x()),arguments:ze(se(lZ)),_meta:ze(Ke({}))}),kp=Ts.extend({method:F("prompts/list")}),dZ=Is.extend({prompts:se(uZ)}),pZ=Rt.extend({name:x(),arguments:Ie(x(),x()).optional()}),Tp=Xe.extend({method:F("prompts/get"),params:pZ}),yv=L({type:F("text"),text:x(),annotations:wo.optional(),_meta:Ie(x(),ke()).optional()}),vv=L({type:F("image"),data:hv,mimeType:x(),annotations:wo.optional(),_meta:Ie(x(),ke()).optional()}),bv=L({type:F("audio"),data:hv,mimeType:x(),annotations:wo.optional(),_meta:Ie(x(),ke()).optional()}),mZ=L({type:F("tool_use"),name:x(),id:x(),input:Ie(x(),ke()),_meta:Ie(x(),ke()).optional()}),fZ=L({type:F("resource"),resource:xe([CP,AP]),annotations:wo.optional(),_meta:Ie(x(),ke()).optional()}),hZ=MP.extend({type:F("resource_link")}),_v=xe([yv,vv,bv,hZ,fZ]),gZ=L({role:zs,content:_v}),yZ=et.extend({description:x().optional(),messages:se(gZ)}),vZ=Lt.extend({method:F("notifications/prompts/list_changed"),params:Ut.optional()}),bZ=L({title:x().optional(),readOnlyHint:qe().optional(),destructiveHint:qe().optional(),idempotentHint:qe().optional(),openWorldHint:qe().optional()}),_Z=L({taskSupport:Qe(["required","optional","forbidden"]).optional()}),UP=L({...bo.shape,...ks.shape,description:x().optional(),inputSchema:L({type:F("object"),properties:Ie(x(),Ye).optional(),required:se(x()).optional()}).catchall(ke()),outputSchema:L({type:F("object"),properties:Ie(x(),Ye).optional(),required:se(x()).optional()}).catchall(ke()).optional(),annotations:bZ.optional(),execution:_Z.optional(),_meta:Ie(x(),ke()).optional()}),Ip=Ts.extend({method:F("tools/list")}),SZ=Is.extend({tools:se(UP)}),Ep=et.extend({content:se(_v).default([]),structuredContent:Ie(x(),ke()).optional(),isError:qe().optional()}),JY=Ep.or(et.extend({toolResult:ke()})),xZ=ws.extend({name:x(),arguments:Ie(x(),ke()).optional()}),$o=Xe.extend({method:F("tools/call"),params:xZ}),wZ=Lt.extend({method:F("notifications/tools/list_changed"),params:Ut.optional()}),GY=L({autoRefresh:qe().default(!0),debounceMs:ve().int().nonnegative().default(300)}),Rs=Qe(["debug","info","notice","warning","error","critical","alert","emergency"]),$Z=Rt.extend({level:Rs}),Sv=Xe.extend({method:F("logging/setLevel"),params:$Z}),kZ=Ut.extend({level:Rs,logger:x().optional(),data:ke()}),TZ=Lt.extend({method:F("notifications/message"),params:kZ}),IZ=L({name:x().optional()}),EZ=L({hints:se(IZ).optional(),costPriority:ve().min(0).max(1).optional(),speedPriority:ve().min(0).max(1).optional(),intelligencePriority:ve().min(0).max(1).optional()}),PZ=L({mode:Qe(["auto","required","none"]).optional()}),zZ=L({type:F("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:se(_v).default([]),structuredContent:L({}).loose().optional(),isError:qe().optional(),_meta:Ie(x(),ke()).optional()}),RZ=Ka("type",[yv,vv,bv]),cp=Ka("type",[yv,vv,bv,mZ,zZ]),OZ=L({role:zs,content:xe([cp,se(cp)]),_meta:Ie(x(),ke()).optional()}),jZ=ws.extend({messages:se(OZ),modelPreferences:EZ.optional(),systemPrompt:x().optional(),includeContext:Qe(["none","thisServer","allServers"]).optional(),temperature:ve().optional(),maxTokens:ve().int(),stopSequences:se(x()).optional(),metadata:Ye.optional(),tools:se(UP).optional(),toolChoice:PZ.optional()}),DZ=Xe.extend({method:F("sampling/createMessage"),params:jZ}),Os=et.extend({model:x(),stopReason:ze(Qe(["endTurn","stopSequence","maxTokens"]).or(x())),role:zs,content:RZ}),xv=et.extend({model:x(),stopReason:ze(Qe(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:zs,content:xe([cp,se(cp)])}),NZ=L({type:F("boolean"),title:x().optional(),description:x().optional(),default:qe().optional()}),CZ=L({type:F("string"),title:x().optional(),description:x().optional(),minLength:ve().optional(),maxLength:ve().optional(),format:Qe(["email","uri","date","date-time"]).optional(),default:x().optional()}),AZ=L({type:Qe(["number","integer"]),title:x().optional(),description:x().optional(),minimum:ve().optional(),maximum:ve().optional(),default:ve().optional()}),MZ=L({type:F("string"),title:x().optional(),description:x().optional(),enum:se(x()),default:x().optional()}),UZ=L({type:F("string"),title:x().optional(),description:x().optional(),oneOf:se(L({const:x(),title:x()})),default:x().optional()}),LZ=L({type:F("string"),title:x().optional(),description:x().optional(),enum:se(x()),enumNames:se(x()).optional(),default:x().optional()}),qZ=xe([MZ,UZ]),ZZ=L({type:F("array"),title:x().optional(),description:x().optional(),minItems:ve().optional(),maxItems:ve().optional(),items:L({type:F("string"),enum:se(x())}),default:se(x()).optional()}),FZ=L({type:F("array"),title:x().optional(),description:x().optional(),minItems:ve().optional(),maxItems:ve().optional(),items:L({anyOf:se(L({const:x(),title:x()}))}),default:se(x()).optional()}),VZ=xe([ZZ,FZ]),BZ=xe([LZ,qZ,VZ]),HZ=xe([BZ,NZ,CZ,AZ]),WZ=ws.extend({mode:F("form").optional(),message:x(),requestedSchema:L({type:F("object"),properties:Ie(x(),HZ),required:se(x()).optional()})}),JZ=ws.extend({mode:F("url"),message:x(),elicitationId:x(),url:x().url()}),GZ=xe([WZ,JZ]),KZ=Xe.extend({method:F("elicitation/create"),params:GZ}),QZ=Ut.extend({elicitationId:x()}),YZ=Lt.extend({method:F("notifications/elicitation/complete"),params:QZ}),ko=et.extend({action:Qe(["accept","decline","cancel"]),content:Xa(e=>e===null?void 0:e,Ie(x(),xe([x(),ve(),qe(),se(x())])).optional())}),XZ=L({type:F("ref/resource"),uri:x()});var eF=L({type:F("ref/prompt"),name:x()}),tF=Rt.extend({ref:xe([eF,XZ]),argument:L({name:x(),value:x()}),context:L({arguments:Ie(x(),x()).optional()}).optional()}),Pp=Xe.extend({method:F("completion/complete"),params:tF});function LP(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function qP(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var rF=et.extend({completion:Ke({values:se(x()).max(100),total:ze(ve().int()),hasMore:ze(qe())})}),nF=L({uri:x().startsWith("file://"),name:x().optional(),_meta:Ie(x(),ke()).optional()}),iF=Xe.extend({method:F("roots/list"),params:Rt.optional()}),wv=et.extend({roots:se(nF)}),oF=Lt.extend({method:F("notifications/roots/list_changed"),params:Ut.optional()}),KY=xe([fp,mp,Pp,Sv,Tp,kp,xp,wp,$p,iZ,aZ,$o,Ip,gp,vp,bp,Sp]),QY=xe([pp,hp,fv,oF,Ps]),YY=xe([dp,Os,xv,ko,wv,yp,_p,xo]),XY=xe([fp,DZ,KZ,iF,gp,vp,bp,Sp]),eX=xe([pp,hp,TZ,cZ,rZ,wZ,vZ,Ps,YZ]),tX=xe([dp,Bq,rF,yZ,dZ,Yq,Xq,tZ,Ep,SZ,yp,_p,xo]),V=class e extends Error{constructor(t,r,i){super(`MCP error ${t}: ${r}`),this.code=t,this.data=i,this.name="McpError"}static fromError(t,r,i){if(t===H.UrlElicitationRequired&&i){let n=i;if(n.elicitations)return new cv(n.elicitations,r)}return new e(t,r,i)}},cv=class extends V{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(H.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function yn(e){return e==="completed"||e==="failed"||e==="cancelled"}var FP=Symbol("Let zodToJsonSchema decide on which parser to use");var ZP={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},VP=e=>typeof e=="string"?{...ZP,name:e}:{...ZP,...e};var BP=e=>{let t=VP(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function $v(e,t,r,i){i?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function me(e,t,r,i,n){e[t]=r,$v(e,t,i,n)}var zp=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function Ae(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?zp(t,e.currentPath):t.join("/")}}function HP(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==D.ZodAny&&(r.items=G(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&me(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&me(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(me(r,"minItems",e.exactLength.value,e.exactLength.message,t),me(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function WP(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"min":t.target==="jsonSchema7"?i.inclusive?me(r,"minimum",i.value,i.message,t):me(r,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(r.exclusiveMinimum=!0),me(r,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?me(r,"maximum",i.value,i.message,t):me(r,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(r.exclusiveMaximum=!0),me(r,"maximum",i.value,i.message,t));break;case"multipleOf":me(r,"multipleOf",i.value,i.message,t);break}return r}function JP(){return{type:"boolean"}}function Rp(e,t){return G(e.type._def,t)}var GP=(e,t)=>G(e.innerType._def,t);function kv(e,t,r){let i=r??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>kv(e,t,n))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return aF(e,t)}}var aF=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let i of e.checks)switch(i.kind){case"min":me(r,"minimum",i.value,i.message,t);break;case"max":me(r,"maximum",i.value,i.message,t);break}return r};function KP(e,t){return{...G(e.innerType._def,t),default:e.defaultValue()}}function QP(e,t){return t.effectStrategy==="input"?G(e.schema._def,t):Ae(t)}function YP(e){return{type:"string",enum:Array.from(e.values)}}var sF=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function XP(e,t){let r=[G(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),G(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(o=>{if(sF(o))n.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let a=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:s,...c}=o;a=c}else i=void 0;n.push(a)}}),n.length?{allOf:n,...i}:void 0}function ez(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var Tv,rr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Tv===void 0&&(Tv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Tv),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Op(e,t){let r={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":me(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,t);break;case"max":me(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":nr(r,"email",i.message,t);break;case"format:idn-email":nr(r,"idn-email",i.message,t);break;case"pattern:zod":pt(r,rr.email,i.message,t);break}break;case"url":nr(r,"uri",i.message,t);break;case"uuid":nr(r,"uuid",i.message,t);break;case"regex":pt(r,i.regex,i.message,t);break;case"cuid":pt(r,rr.cuid,i.message,t);break;case"cuid2":pt(r,rr.cuid2,i.message,t);break;case"startsWith":pt(r,RegExp(`^${Iv(i.value,t)}`),i.message,t);break;case"endsWith":pt(r,RegExp(`${Iv(i.value,t)}$`),i.message,t);break;case"datetime":nr(r,"date-time",i.message,t);break;case"date":nr(r,"date",i.message,t);break;case"time":nr(r,"time",i.message,t);break;case"duration":nr(r,"duration",i.message,t);break;case"length":me(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,t),me(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"includes":{pt(r,RegExp(Iv(i.value,t)),i.message,t);break}case"ip":{i.version!=="v6"&&nr(r,"ipv4",i.message,t),i.version!=="v4"&&nr(r,"ipv6",i.message,t);break}case"base64url":pt(r,rr.base64url,i.message,t);break;case"jwt":pt(r,rr.jwt,i.message,t);break;case"cidr":{i.version!=="v6"&&pt(r,rr.ipv4Cidr,i.message,t),i.version!=="v4"&&pt(r,rr.ipv6Cidr,i.message,t);break}case"emoji":pt(r,rr.emoji(),i.message,t);break;case"ulid":{pt(r,rr.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{nr(r,"binary",i.message,t);break}case"contentEncoding:base64":{me(r,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{pt(r,rr.base64,i.message,t);break}}break}case"nanoid":pt(r,rr.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Iv(e,t){return t.patternStrategy==="escape"?lF(e):e}var cF=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function lF(e){let t="";for(let r=0;r<e.length;r++)cF.has(e[r])||(t+="\\"),t+=e[r];return t}function nr(e,t,r,i){e.format||e.anyOf?.some(n=>n.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&i.errorMessages&&{errorMessage:{format:r}}})):me(e,"format",t,r,i)}function pt(e,t,r,i){e.pattern||e.allOf?.some(n=>n.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:tz(t,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):me(e,"pattern",tz(t,i),r,i)}function tz(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source,n="",o=!1,a=!1,s=!1;for(let c=0;c<i.length;c++){if(o){n+=i[c],o=!1;continue}if(r.i){if(a){if(i[c].match(/[a-z]/)){s?(n+=i[c],n+=`${i[c-2]}-${i[c]}`.toUpperCase(),s=!1):i[c+1]==="-"&&i[c+2]?.match(/[a-z]/)?(n+=i[c],s=!0):n+=`${i[c]}${i[c].toUpperCase()}`;continue}}else if(i[c].match(/[a-z]/)){n+=`[${i[c]}${i[c].toUpperCase()}]`;continue}}if(r.m){if(i[c]==="^"){n+=`(^|(?<=[\r
79
+ ]))`;continue}else if(i[c]==="$"){n+=`($|(?=[\r
80
+ ]))`;continue}}if(r.s&&i[c]==="."){n+=a?`${i[c]}\r
81
+ `:`[${i[c]}\r
82
+ ]`;continue}n+=i[c],i[c]==="\\"?o=!0:a&&i[c]==="]"?a=!1:!a&&i[c]==="["&&(a=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function jp(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===D.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((i,n)=>({...i,[n]:G(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??Ae(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:G(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===D.ZodString&&e.keyType._def.checks?.length){let{type:i,...n}=Op(e.keyType._def,t);return{...r,propertyNames:n}}else{if(e.keyType?._def.typeName===D.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===D.ZodBranded&&e.keyType._def.type._def.typeName===D.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...n}=Rp(e.keyType._def,t);return{...r,propertyNames:n}}}return r}function rz(e,t){if(t.mapStrategy==="record")return jp(e,t);let r=G(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Ae(t),i=G(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Ae(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}function nz(e){let t=e.values,i=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),n=Array.from(new Set(i.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:i}}function iz(e){return e.target==="openAi"?void 0:{not:Ae({...e,currentPath:[...e.currentPath,"not"]})}}function oz(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var js={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function sz(e,t){if(t.target==="openApi3")return az(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(i=>i._def.typeName in js&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let a=js[o._def.typeName];return a&&!n.includes(a)?[...n,a]:n},[]);return{type:i.length>1?i:i[0]}}else if(r.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=r.reduce((n,o)=>{let a=typeof o._def.value;switch(a){case"string":case"number":case"boolean":return[...n,a];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];default:return n}},[]);if(i.length===r.length){let n=i.filter((o,a,s)=>s.indexOf(o)===a);return{type:n.length>1?n:n[0],enum:r.reduce((o,a)=>o.includes(a._def.value)?o:[...o,a._def.value],[])}}}else if(r.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((i,n)=>[...i,...n._def.values.filter(o=>!i.includes(o))],[])};return az(e,t)}var az=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,n)=>G(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(i=>!!i&&(!t.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0};function cz(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:js[e.innerType._def.typeName],nullable:!0}:{type:[js[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let i=G(e.innerType._def,{...t,currentPath:[...t.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let r=G(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function lz(e,t){let r={type:"number"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"int":r.type="integer",$v(r,"type",i.message,t);break;case"min":t.target==="jsonSchema7"?i.inclusive?me(r,"minimum",i.value,i.message,t):me(r,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(r.exclusiveMinimum=!0),me(r,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?me(r,"maximum",i.value,i.message,t):me(r,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(r.exclusiveMaximum=!0),me(r,"maximum",i.value,i.message,t));break;case"multipleOf":me(r,"multipleOf",i.value,i.message,t);break}return r}function uz(e,t){let r=t.target==="openAi",i={type:"object",properties:{}},n=[],o=e.shape();for(let s in o){let c=o[s];if(c===void 0||c._def===void 0)continue;let u=dF(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let d=G(c._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});d!==void 0&&(i.properties[s]=d,u||n.push(s))}n.length&&(i.required=n);let a=uF(e,t);return a!==void 0&&(i.additionalProperties=a),i}function uF(e,t){if(e.catchall._def.typeName!=="ZodNever")return G(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function dF(e){try{return e.isOptional()}catch{return!0}}var dz=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return G(e.innerType._def,t);let r=G(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ae(t)},r]}:Ae(t)};var pz=(e,t)=>{if(t.pipeStrategy==="input")return G(e.in._def,t);if(t.pipeStrategy==="output")return G(e.out._def,t);let r=G(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=G(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter(n=>n!==void 0)}};function mz(e,t){return G(e.type._def,t)}function fz(e,t){let i={type:"array",uniqueItems:!0,items:G(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&me(i,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&me(i,"maxItems",e.maxSize.value,e.maxSize.message,t),i}function hz(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,i)=>G(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:G(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,i)=>G(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}function gz(e){return{not:Ae(e)}}function yz(e){return Ae(e)}var vz=(e,t)=>G(e.innerType._def,t);var bz=(e,t,r)=>{switch(t){case D.ZodString:return Op(e,r);case D.ZodNumber:return lz(e,r);case D.ZodObject:return uz(e,r);case D.ZodBigInt:return WP(e,r);case D.ZodBoolean:return JP();case D.ZodDate:return kv(e,r);case D.ZodUndefined:return gz(r);case D.ZodNull:return oz(r);case D.ZodArray:return HP(e,r);case D.ZodUnion:case D.ZodDiscriminatedUnion:return sz(e,r);case D.ZodIntersection:return XP(e,r);case D.ZodTuple:return hz(e,r);case D.ZodRecord:return jp(e,r);case D.ZodLiteral:return ez(e,r);case D.ZodEnum:return YP(e);case D.ZodNativeEnum:return nz(e);case D.ZodNullable:return cz(e,r);case D.ZodOptional:return dz(e,r);case D.ZodMap:return rz(e,r);case D.ZodSet:return fz(e,r);case D.ZodLazy:return()=>e.getter()._def;case D.ZodPromise:return mz(e,r);case D.ZodNaN:case D.ZodNever:return iz(r);case D.ZodEffects:return QP(e,r);case D.ZodAny:return Ae(r);case D.ZodUnknown:return yz(r);case D.ZodDefault:return KP(e,r);case D.ZodBranded:return Rp(e,r);case D.ZodReadonly:return vz(e,r);case D.ZodCatch:return GP(e,r);case D.ZodPipeline:return pz(e,r);case D.ZodFunction:case D.ZodVoid:case D.ZodSymbol:return;default:return(i=>{})(t)}};function G(e,t,r=!1){let i=t.seen.get(e);if(t.override){let s=t.override?.(e,t,i,r);if(s!==FP)return s}if(i&&!r){let s=pF(i,t);if(s!==void 0)return s}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let o=bz(e,e.typeName,t),a=typeof o=="function"?G(o(),t):o;if(a&&mF(e,t,a),t.postProcess){let s=t.postProcess(a,e,t);return n.jsonSchema=a,s}return n.jsonSchema=a,a}var pF=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:zp(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,i)=>t.currentPath[i]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Ae(t)):t.$refStrategy==="seen"?Ae(t):void 0}},mF=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var Ev=(e,t)=>{let r=BP(t),i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[u,d])=>({...c,[u]:G(d._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??Ae(r)}),{}):void 0,n=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=G(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Ae(r),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(o.title=a),r.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[r.openAiAnyTypeName]||(i[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let s=n===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...i,[n]:o}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s};function fF(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function Pv(e,t){return Mt(e)?Jn(e,{target:fF(t?.target),io:t?.pipeStrategy??"input"}):Ev(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function zv(e){let r=fn(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=sp(r);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function Rv(e,t){let r=mn(e,t);if(!r.success)throw r.error;return r.data}var hF=6e4,Dp=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(pp,r=>{this._oncancel(r)}),this.setNotificationHandler(hp,r=>{this._onprogress(r)}),this.setRequestHandler(fp,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(gp,async(r,i)=>{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new V(H.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(vp,async(r,i)=>{let n=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,u=c.id,d=this._requestResolvers.get(u);if(d)if(this._requestResolvers.delete(u),s.type==="response")d(c);else{let p=c,f=new V(p.error.code,p.error.message,p.error.data);d(f)}else{let p=s.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${u}`))}continue}await this._transport?.send(s.message,{relatedRequestId:i.requestId})}}let a=await this._taskStore.getTask(o,i.sessionId);if(!a)throw new V(H.InvalidParams,`Task not found: ${o}`);if(!yn(a.status))return await this._waitForTaskUpdate(o,i.signal),await n();if(yn(a.status)){let s=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...s,_meta:{...s._meta,[hn]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(bp,async(r,i)=>{try{let{tasks:n,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,i.sessionId);return{tasks:n,nextCursor:o,_meta:{}}}catch(n){throw new V(H.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Sp,async(r,i)=>{try{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new V(H.InvalidParams,`Task not found: ${r.params.taskId}`);if(yn(n.status))throw new V(H.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!o)throw new V(H.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof V?n:new V(H.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,i,n,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let i=Date.now()-r.startTime;if(r.maxTotalTimeout&&i>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),V.fromError(H.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:i});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 i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let n=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{n?.(o,a),Ur(o)||So(o)?this._onresponse(o):gn(o)?this._onrequest(o,a):OP(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let r=V.fromError(H.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of t.values())i(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(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(t,r){let i=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,n=this._transport,o=t.params?._meta?.[hn]?.taskId;if(i===void 0){let d={jsonrpc:"2.0",id:t.id,error:{code:H.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},n?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):n?.send(d).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);let s=PP(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,n?.sessionId):void 0,u={signal:a.signal,sessionId:n?.sessionId,_meta:t.params?._meta,sendNotification:async d=>{if(a.signal.aborted)return;let p={relatedRequestId:t.id};o&&(p.relatedTask={taskId:o}),await this.notification(d,p)},sendRequest:async(d,p,f)=>{if(a.signal.aborted)throw new V(H.ConnectionClosed,"Request was cancelled");let h={...f,relatedRequestId:t.id};o&&!h.relatedTask&&(h.relatedTask={taskId:o});let m=h.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(d,p,h)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(t.method)}).then(()=>i(t,u)).then(async d=>{if(a.signal.aborted)return;let p={result:d,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:p,timestamp:Date.now()},n?.sessionId):await n?.send(p)},async d=>{if(a.signal.aborted)return;let p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(d.code)?d.code:H.InternalError,message:d.message??"Internal error",...d.data!==void 0&&{data:d.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},n?.sessionId):await n?.send(p)}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...i}=t.params,n=Number(r),o=this._progressHandlers.get(n);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let a=this._responseHandlers.get(n),s=this._timeoutInfo.get(n);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),a(c);return}o(i)}_onresponse(t){let r=Number(t.id),i=this._requestResolvers.get(r);if(i){if(this._requestResolvers.delete(r),Ur(t))i(t);else{let a=new V(t.error.code,t.error.message,t.error.data);i(a)}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 o=!1;if(Ur(t)&&t.result&&typeof t.result=="object"){let a=t.result;if(a.task&&typeof a.task=="object"){let s=a.task;typeof s.taskId=="string"&&(o=!0,this._taskProgressTokens.set(s.taskId,r))}}if(o||this._progressHandlers.delete(r),Ur(t))n(t);else{let a=V.fromError(t.error.code,t.error.message,t.error.data);n(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,i){let{task:n}=i??{};if(!n){try{yield{type:"result",result:await this.request(t,r,i)}}catch(a){yield{type:"error",error:a instanceof V?a:new V(H.InternalError,String(a))}}return}let o;try{let a=await this.request(t,xo,i);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new V(H.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:s},yn(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)}:s.status==="failed"?yield{type:"error",error:new V(H.InternalError,`Task ${o} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new V(H.InternalError,`Task ${o} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),i?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof V?a:new V(H.InternalError,String(a))}}}request(t,r,i){let{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a,task:s,relatedTask:c}=i??{};return new Promise((u,d)=>{let p=w=>{d(w)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(w){p(w);return}i?.signal?.throwIfAborted();let f=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:f};i?.onprogress&&(this._progressHandlers.set(f,i.onprogress),h.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),s&&(h.params={...h.params,task:s}),c&&(h.params={...h.params,_meta:{...h.params?._meta||{},[hn]:c}});let m=w=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(w)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a}).catch(E=>this._onerror(new Error(`Failed to send cancellation: ${E}`)));let $=w instanceof V?w:new V(H.RequestTimeout,String(w));d($)};this._responseHandlers.set(f,w=>{if(!i?.signal?.aborted){if(w instanceof Error)return d(w);try{let $=mn(r,w.result);$.success?u($.data):d($.error)}catch($){d($)}}}),i?.signal?.addEventListener("abort",()=>{m(i?.signal?.reason)});let g=i?.timeout??hF,v=()=>m(V.fromError(H.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(f,g,i?.maxTotalTimeout,v,i?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let w=$=>{let E=this._responseHandlers.get(f);E?E($):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,w),this._enqueueTaskMessage(_,{type:"request",message:h,timestamp:Date.now()}).catch($=>{this._cleanupTimeout(f),d($)})}else this._transport.send(h,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:a}).catch(w=>{this._cleanupTimeout(f),d(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},yp,r)}async getTaskResult(t,r,i){return this.request({method:"tasks/result",params:t},r,i)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},_p,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},DP,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let i=r?.relatedTask?.taskId;if(i){let s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[hn]:r.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:s,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 s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[hn]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[hn]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(t,r){let i=zv(t);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(n,o)=>{let a=Rv(t,n);return Promise.resolve(r(a,o))})}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 i=zv(t);this._notificationHandlers.set(i,n=>{let o=Rv(t,n);return Promise.resolve(r(o))})}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,i){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,i,n)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(t,r);for(let n of i)if(n.type==="request"&&gn(n.message)){let o=n.message.id,a=this._requestResolvers.get(o);a?(a(new V(H.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let i=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(t);n?.pollInterval&&(i=n.pollInterval)}catch{}return new Promise((n,o)=>{if(r.aborted){o(new V(H.InvalidRequest,"Request cancelled"));return}let a=setTimeout(n,i);r.addEventListener("abort",()=>{clearTimeout(a),o(new V(H.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async n=>{if(!t)throw new Error("No request provided");return await i.createTask(n,t.id,{method:t.method,params:t.params},r)},getTask:async n=>{let o=await i.getTask(n,r);if(!o)throw new V(H.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,a)=>{await i.storeTaskResult(n,o,a,r);let s=await i.getTask(n,r);if(s){let c=Ps.parse({method:"notifications/tasks/status",params:s});await this.notification(c),yn(s.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>i.getTaskResult(n,r),updateTaskStatus:async(n,o,a)=>{let s=await i.getTask(n,r);if(!s)throw new V(H.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(yn(s.status))throw new V(H.InvalidParams,`Cannot update task "${n}" from terminal status "${s.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(n,o,a,r);let c=await i.getTask(n,r);if(c){let u=Ps.parse({method:"notifications/tasks/status",params:c});await this.notification(u),yn(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>i.listTasks(n,r)}}};function _z(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Sz(e,t){let r={...e};for(let i in t){let n=i,o=t[n];if(o===void 0)continue;let a=r[n];_z(a)&&_z(o)?r[n]={...a,...o}:r[n]=o}return r}var sO=Bt(g_(),1),cO=Bt(aO(),1);function aH(){let e=new sO.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,cO.default)(e),e}var gm=class{constructor(t){this._ajv=t??aH()}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 i=>r(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var ym=class{constructor(t){this._server=t}requestStream(t,r,i){return this._server.requestStream(t,r,i)}createMessageStream(t,r){let i=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],a=o.some(d=>d.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(d=>d.type==="tool_use");if(a){if(o.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),p=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(d.size!==p.size||![...d].every(f=>p.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},Os,r)}elicitInputStream(t,r){let i=this._server.getClientCapabilities(),n=t.mode??"form";switch(n){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=n==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:o},ko,r)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,i){return this._server.getTaskResult({taskId:t},r,i)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function lO(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 uO(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}}var vm=class extends Dp{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Rs.options.map((i,n)=>[i,n])),this.isMessageIgnored=(i,n)=>{let o=this._loggingLevels.get(n);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new gm,this.setRequestHandler(mp,i=>this._oninitialize(i)),this.setNotificationHandler(fv,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Sv,async(i,n)=>{let o=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=i.params,s=Rs.safeParse(a);return s.success&&this._loggingLevels.set(o,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new ym(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Sz(this._capabilities,t)}setRequestHandler(t,r){let n=fn(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let o;if(Mt(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let s=async(c,u)=>{let d=mn($o,c);if(!d.success){let m=d.error instanceof Error?d.error.message:String(d.error);throw new V(H.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:p}=d.data,f=await Promise.resolve(r(c,u));if(p.task){let m=mn(xo,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new V(H.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=mn(Ep,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new V(H.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){uO(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&lO(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:_o.includes(r)?r:lv,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},dp)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let i=t.messages[t.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some(u=>u.type==="tool_result"),a=t.messages.length>1?t.messages[t.messages.length-2]:void 0,s=a?Array.isArray(a.content)?a.content:[a.content]:[],c=s.some(u=>u.type==="tool_use");if(o){if(n.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(s.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(n.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(u.size!==d.size||![...u].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},xv,r):this.request({method:"sampling/createMessage",params:t},Os,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=t;return this.request({method:"elicitation/create",params:n},ko,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:n},ko,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new V(H.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof V?a:new V(H.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},wv,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var pO=Symbol.for("mcp.completable");function $_(e){return!!e&&typeof e=="object"&&pO in e}function mO(e){return e[pO]?.complete}var dO;(function(e){e.Completable="McpCompletable"})(dO||(dO={}));var sH=/^[A-Za-z0-9._-]{1,128}$/;function cH(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!sH.test(e)){let r=e.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return t.push(`Tool name contains invalid characters: ${r.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function lH(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function k_(e){let t=cH(e);return lH(e,t.warnings),t.isValid}var bm=class{constructor(t){this._mcpServer=t}registerToolTask(t,r,i){let n={taskSupport:"required",...r.execution};if(n.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,n,r._meta,i)}};var uc=class{constructor(t,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new vm(t,r)}get experimental(){return this._experimental||(this._experimental={tasks:new bm(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Tn(Ip)),this.server.assertCanSetRequestHandler(Tn($o)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Ip,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,r])=>{let i={name:t,title:r.title,description:r.description,inputSchema:(()=>{let n=vo(r.inputSchema);return n?Pv(n,{strictUnions:!0,pipeStrategy:"input"}):uH})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let n=vo(r.outputSchema);n&&(i.outputSchema=Pv(n,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler($o,async(t,r)=>{try{let i=this._registeredTools[t.params.name];if(!i)throw new V(H.InvalidParams,`Tool ${t.params.name} not found`);if(!i.enabled)throw new V(H.InvalidParams,`Tool ${t.params.name} disabled`);let n=!!t.params.task,o=i.execution?.taskSupport,a="createTask"in i.handler;if((o==="required"||o==="optional")&&!a)throw new V(H.InternalError,`Tool ${t.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!n)throw new V(H.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!n&&a)return await this.handleAutomaticTaskPolling(i,t,r);let s=await this.validateToolInput(i,t.params.arguments,t.params.name),c=await this.executeToolHandler(i,s,r);return n||await this.validateToolOutput(i,c,t.params.name),c}catch(i){if(i instanceof V&&i.code===H.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,r,i){if(!t.inputSchema)return;let o=vo(t.inputSchema)??t.inputSchema,a=await op(o,r);if(!a.success){let s="error"in a?a.error:"Unknown error",c=ap(s);throw new V(H.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${c}`)}return a.data}async validateToolOutput(t,r,i){if(!t.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new V(H.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let n=vo(t.outputSchema),o=await op(n,r.structuredContent);if(!o.success){let a="error"in o?o.error:"Unknown error",s=ap(a);throw new V(H.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${s}`)}}async executeToolHandler(t,r,i){let n=t.handler;if("createTask"in n){if(!i.taskStore)throw new Error("No task store provided.");let a={...i,taskStore:i.taskStore};if(t.inputSchema){let s=n;return await Promise.resolve(s.createTask(r,a))}else{let s=n;return await Promise.resolve(s.createTask(a))}}if(t.inputSchema){let a=n;return await Promise.resolve(a(r,i))}else{let a=n;return await Promise.resolve(a(i))}}async handleAutomaticTaskPolling(t,r,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let n=await this.validateToolInput(t,r.params.arguments,r.params.name),o=t.handler,a={...i,taskStore:i.taskStore},s=n?await Promise.resolve(o.createTask(n,a)):await Promise.resolve(o.createTask(a)),c=s.task.taskId,u=s.task,d=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(f=>setTimeout(f,d));let p=await i.taskStore.getTask(c);if(!p)throw new V(H.InternalError,`Task ${c} not found during polling`);u=p}return await i.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Tn(Pp)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Pp,async t=>{switch(t.params.ref.type){case"ref/prompt":return LP(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return qP(t),this.handleResourceCompletion(t,t.params.ref);default:throw new V(H.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,r){let i=this._registeredPrompts[r.name];if(!i)throw new V(H.InvalidParams,`Prompt ${r.name} not found`);if(!i.enabled)throw new V(H.InvalidParams,`Prompt ${r.name} disabled`);if(!i.argsSchema)return lc;let o=fn(i.argsSchema)?.[t.params.argument.name];if(!$_(o))return lc;let a=mO(o);if(!a)return lc;let s=await a(t.params.argument.value,t.params.context);return hO(s)}async handleResourceCompletion(t,r){let i=Object.values(this._registeredResourceTemplates).find(a=>a.resourceTemplate.uriTemplate.toString()===r.uri);if(!i){if(this._registeredResources[r.uri])return lc;throw new V(H.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let n=i.resourceTemplate.completeCallback(t.params.argument.name);if(!n)return lc;let o=await n(t.params.argument.value,t.params.context);return hO(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Tn(xp)),this.server.assertCanSetRequestHandler(Tn(wp)),this.server.assertCanSetRequestHandler(Tn($p)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(xp,async(t,r)=>{let i=Object.entries(this._registeredResources).filter(([o,a])=>a.enabled).map(([o,a])=>({uri:o,name:a.name,...a.metadata})),n=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let a=await o.resourceTemplate.listCallback(r);for(let s of a.resources)n.push({...o.metadata,...s})}return{resources:[...i,...n]}}),this.server.setRequestHandler(wp,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,i])=>({name:r,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler($p,async(t,r)=>{let i=new URL(t.params.uri),n=this._registeredResources[i.toString()];if(n){if(!n.enabled)throw new V(H.InvalidParams,`Resource ${i} disabled`);return n.readCallback(i,r)}for(let o of Object.values(this._registeredResourceTemplates)){let a=o.resourceTemplate.uriTemplate.match(i.toString());if(a)return o.readCallback(i,a,r)}throw new V(H.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Tn(kp)),this.server.assertCanSetRequestHandler(Tn(Tp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(kp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,r])=>({name:t,title:r.title,description:r.description,arguments:r.argsSchema?pH(r.argsSchema):void 0}))})),this.server.setRequestHandler(Tp,async(t,r)=>{let i=this._registeredPrompts[t.params.name];if(!i)throw new V(H.InvalidParams,`Prompt ${t.params.name} not found`);if(!i.enabled)throw new V(H.InvalidParams,`Prompt ${t.params.name} disabled`);if(i.argsSchema){let n=vo(i.argsSchema),o=await op(n,t.params.arguments);if(!o.success){let c="error"in o?o.error:"Unknown error",u=ap(c);throw new V(H.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${u}`)}let a=o.data,s=i.callback;return await Promise.resolve(s(a,r))}else{let n=i.callback;return await Promise.resolve(n(r))}}),this._promptHandlersInitialized=!0)}resource(t,r,...i){let n;typeof i[0]=="object"&&(n=i.shift());let o=i[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let a=this._createRegisteredResource(t,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let a=this._createRegisteredResourceTemplate(t,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}registerResource(t,r,i,n){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(t,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let o=this._createRegisteredResourceTemplate(t,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(t,r,i,n,o){let a={name:t,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:s=>{typeof s.uri<"u"&&s.uri!==i&&(delete this._registeredResources[i],s.uri&&(this._registeredResources[s.uri]=a)),typeof s.name<"u"&&(a.name=s.name),typeof s.title<"u"&&(a.title=s.title),typeof s.metadata<"u"&&(a.metadata=s.metadata),typeof s.callback<"u"&&(a.readCallback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=a,a}_createRegisteredResourceTemplate(t,r,i,n,o){let a={resourceTemplate:i,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==t&&(delete this._registeredResourceTemplates[t],u.name&&(this._registeredResourceTemplates[u.name]=a)),typeof u.title<"u"&&(a.title=u.title),typeof u.template<"u"&&(a.resourceTemplate=u.template),typeof u.metadata<"u"&&(a.metadata=u.metadata),typeof u.callback<"u"&&(a.readCallback=u.callback),typeof u.enabled<"u"&&(a.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=a;let s=i.uriTemplate.variableNames;return Array.isArray(s)&&s.some(u=>!!i.completeCallback(u))&&this.setCompletionRequestHandler(),a}_createRegisteredPrompt(t,r,i,n,o){let a={title:r,description:i,argsSchema:n===void 0?void 0:ni(n),callback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:s=>{typeof s.name<"u"&&s.name!==t&&(delete this._registeredPrompts[t],s.name&&(this._registeredPrompts[s.name]=a)),typeof s.title<"u"&&(a.title=s.title),typeof s.description<"u"&&(a.description=s.description),typeof s.argsSchema<"u"&&(a.argsSchema=ni(s.argsSchema)),typeof s.callback<"u"&&(a.callback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=a,n&&Object.values(n).some(c=>{let u=c instanceof Ji?c._def?.innerType:c;return $_(u)})&&this.setCompletionRequestHandler(),a}_createRegisteredTool(t,r,i,n,o,a,s,c,u){k_(t);let d={title:r,description:i,inputSchema:fO(n),outputSchema:fO(o),annotations:a,execution:s,_meta:c,handler:u,enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:p=>{typeof p.name<"u"&&p.name!==t&&(typeof p.name=="string"&&k_(p.name),delete this._registeredTools[t],p.name&&(this._registeredTools[p.name]=d)),typeof p.title<"u"&&(d.title=p.title),typeof p.description<"u"&&(d.description=p.description),typeof p.paramsSchema<"u"&&(d.inputSchema=ni(p.paramsSchema)),typeof p.outputSchema<"u"&&(d.outputSchema=ni(p.outputSchema)),typeof p.callback<"u"&&(d.handler=p.callback),typeof p.annotations<"u"&&(d.annotations=p.annotations),typeof p._meta<"u"&&(d._meta=p._meta),typeof p.enabled<"u"&&(d.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}tool(t,...r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let i,n,o,a;if(typeof r[0]=="string"&&(i=r.shift()),r.length>1){let c=r[0];T_(c)?(n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!T_(r[0])&&(a=r.shift())):typeof c=="object"&&c!==null&&(a=r.shift())}let s=r[0];return this._createRegisteredTool(t,void 0,i,n,o,a,{taskSupport:"forbidden"},void 0,s)}registerTool(t,r,i){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:n,description:o,inputSchema:a,outputSchema:s,annotations:c,_meta:u}=r;return this._createRegisteredTool(t,n,o,a,s,c,{taskSupport:"forbidden"},u,i)}prompt(t,...r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let i;typeof r[0]=="string"&&(i=r.shift());let n;r.length>1&&(n=r.shift());let o=r[0],a=this._createRegisteredPrompt(t,void 0,i,n,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}registerPrompt(t,r,i){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:n,description:o,argsSchema:a}=r,s=this._createRegisteredPrompt(t,n,o,a,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,r){return this.server.sendLoggingMessage(t,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var uH={type:"object",properties:{}};function gO(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function dH(e){return"_def"in e||"_zod"in e||gO(e)}function T_(e){return typeof e!="object"||e===null||dH(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(gO)}function fO(e){if(e)return T_(e)?ni(e):e}function pH(e){let t=fn(e);return t?Object.entries(t).map(([r,i])=>{let n=$P(i),o=kP(i);return{name:r,description:n,required:!o}}):[]}function Tn(e){let r=fn(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=sp(r);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function hO(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var lc={completion:{values:[],hasMore:!1}};import vO from"node:process";var _m=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
83
+ `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),mH(r)}clear(){this._buffer=void 0}};function mH(e){return $s.parse(JSON.parse(e))}function yO(e){return JSON.stringify(e)+`
84
+ `}var Sm=class{constructor(t=vO.stdin,r=vO.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new _m,this._started=!1,this._ondata=i=>{this._readBuffer.append(i),this.processReadBuffer()},this._onerror=i=>{this.onerror?.(i)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let i=yO(t);this._stdout.write(i)?r():this._stdout.once("drain",r)})}};import{createServer as ZH}from"node:http";import{randomUUID as RH}from"node:crypto";import{Http2ServerRequest as fH}from"http2";import{Http2ServerRequest as I_}from"http2";import{Readable as bO}from"stream";import TH from"crypto";var fi=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},hH=e=>e instanceof fi?e:new fi(e.message,{cause:e}),gH=global.Request,dc=class extends gH{constructor(e,t){typeof e=="object"&&Bo in e&&(e=e[Bo]()),typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},yH=e=>{let t=[],r=e.rawHeaders;for(let i=0;i<r.length;i+=2){let{[i]:n,[i+1]:o}=r;n.charCodeAt(0)!==58&&t.push([n,o])}return new Headers(t)},SO=Symbol("wrapBodyStream"),vH=(e,t,r,i,n)=>{let o={method:e,headers:r,signal:n.signal};if(e==="TRACE"){o.method="GET";let a=new dc(t,o);return Object.defineProperty(a,"method",{get(){return"TRACE"}}),a}if(!(e==="GET"||e==="HEAD"))if("rawBody"in i&&i.rawBody instanceof Buffer)o.body=new ReadableStream({start(a){a.enqueue(i.rawBody),a.close()}});else if(i[SO]){let a;o.body=new ReadableStream({async pull(s){try{a||=bO.toWeb(i).getReader();let{done:c,value:u}=await a.read();c?s.close():s.enqueue(u)}catch(c){s.error(c)}}})}else o.body=bO.toWeb(i);return new dc(t,o)},Bo=Symbol("getRequestCache"),bH=Symbol("requestCache"),xm=Symbol("incomingKey"),wm=Symbol("urlKey"),_H=Symbol("headersKey"),Vo=Symbol("abortControllerKey"),SH=Symbol("getAbortController"),$m={get method(){return this[xm].method||"GET"},get url(){return this[wm]},get headers(){return this[_H]||=yH(this[xm])},[SH](){return this[Bo](),this[Vo]},[Bo](){return this[Vo]||=new AbortController,this[bH]||=vH(this.method,this[wm],this.headers,this[xm],this[Vo])}};["body","bodyUsed","cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","signal","keepalive"].forEach(e=>{Object.defineProperty($m,e,{get(){return this[Bo]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty($m,e,{value:function(){return this[Bo]()[e]()}})});Object.setPrototypeOf($m,dc.prototype);var xH=(e,t)=>{let r=Object.create($m);r[xm]=e;let i=e.url||"";if(i[0]!=="/"&&(i.startsWith("http://")||i.startsWith("https://"))){if(e instanceof I_)throw new fi("Absolute URL for :path is not allowed in HTTP/2");try{let s=new URL(i);r[wm]=s.href}catch(s){throw new fi("Invalid absolute URL",{cause:s})}return r}let n=(e instanceof I_?e.authority:e.headers.host)||t;if(!n)throw new fi("Missing host header");let o;if(e instanceof I_){if(o=e.scheme,!(o==="http"||o==="https"))throw new fi("Unsupported scheme")}else o=e.socket&&e.socket.encrypted?"https":"http";let a=new URL(`${o}://${n}${i}`);if(a.hostname.length!==n.length&&a.hostname!==n.replace(/:\d+$/,""))throw new fi("Invalid host header");return r[wm]=a.href,r},_O=Symbol("responseCache"),Fo=Symbol("getResponseCache"),hi=Symbol("cache"),z_=global.Response,pc=class xO{#t;#e;[Fo](){return delete this[hi],this[_O]||=new z_(this.#t,this.#e)}constructor(t,r){let i;if(this.#t=t,r instanceof xO){let n=r[_O];if(n){this.#e=n,this[Fo]();return}else this.#e=r.#e,i=new Headers(r.#e.headers)}else this.#e=r;(typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[hi]=[r?.status||200,t,i||r?.headers])}get headers(){let t=this[hi];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||{"content-type":"text/plain; charset=UTF-8"})),t[2]):this[Fo]().headers}get status(){return this[hi]?.[0]??this[Fo]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(pc.prototype,e,{get(){return this[Fo]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(pc.prototype,e,{value:function(){return this[Fo]()[e]()}})});Object.setPrototypeOf(pc,z_);Object.setPrototypeOf(pc.prototype,z_.prototype);async function wH(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function wO(e,t,r){let i=s=>{e.cancel(s).catch(()=>{})};return t.on("close",i),t.on("error",i),(r??e.read()).then(a,n),e.closed.finally(()=>{t.off("close",i),t.off("error",i)});function n(s){s&&t.destroy(s)}function o(){e.read().then(a,n)}function a({done:s,value:c}){try{if(s)t.end();else if(!t.write(c))t.once("drain",o);else return e.read().then(a,n)}catch(u){n(u)}}}function $H(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:wO(e.getReader(),t)}var E_=e=>{let t={};e instanceof Headers||(e=new Headers(e??void 0));let r=[];for(let[i,n]of e)i==="set-cookie"?r.push(n):t[i]=n;return r.length>0&&(t["set-cookie"]=r),t["content-type"]??="text/plain; charset=UTF-8",t},kH="x-hono-already-sent";typeof global.crypto>"u"&&(global.crypto=TH);var R_=Symbol("outgoingEnded"),IH=()=>new Response(null,{status:400}),$O=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),P_=(e,t)=>{let r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},kO=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},TO=async(e,t)=>{let[r,i,n]=e[hi],o=!1;if(!n)n={"content-type":"text/plain; charset=UTF-8"};else if(n instanceof Headers)o=n.has("content-length"),n=E_(n);else if(Array.isArray(n)){let a=new Headers(n);o=a.has("content-length"),n=E_(a)}else for(let a in n)if(a.length===14&&a.toLowerCase()==="content-length"){o=!0;break}o||(typeof i=="string"?n["Content-Length"]=Buffer.byteLength(i):i instanceof Uint8Array?n["Content-Length"]=i.byteLength:i instanceof Blob&&(n["Content-Length"]=i.size)),t.writeHead(r,n),typeof i=="string"||i instanceof Uint8Array?t.end(i):i instanceof Blob?t.end(new Uint8Array(await i.arrayBuffer())):(kO(t),await $H(i,t)?.catch(a=>P_(a,t))),t[R_]?.()},EH=e=>typeof e.then=="function",PH=async(e,t,r={})=>{if(EH(e))if(r.errorHandler)try{e=await e}catch(n){let o=await r.errorHandler(n);if(!o)return;e=o}else e=await e.catch($O);if(hi in e)return TO(e,t);let i=E_(e.headers);if(e.body){let n=e.body.getReader(),o=[],a=!1,s;if(i["transfer-encoding"]!=="chunked"){let c=2;for(let u=0;u<c;u++){s||=n.read();let d=await wH(s).catch(p=>{console.error(p),a=!0});if(!d){if(u===1){await new Promise(p=>setTimeout(p)),c=3;continue}break}if(s=void 0,d.value&&o.push(d.value),d.done){a=!0;break}}a&&!("content-length"in i)&&(i["content-length"]=o.reduce((u,d)=>u+d.length,0))}t.writeHead(e.status,i),o.forEach(c=>{t.write(c)}),a?t.end():(o.length===0&&kO(t),await wO(n,t,s))}else i[kH]||(t.writeHead(e.status,i),t.end());t[R_]?.()},O_=(e,t={})=>{let r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==dc&&(Object.defineProperty(global,"Request",{value:dc}),Object.defineProperty(global,"Response",{value:pc})),async(i,n)=>{let o,a;try{a=xH(i,t.hostname);let s=!r||i.method==="GET"||i.method==="HEAD";if(s||(i[SO]=!0,i.on("end",()=>{s=!0}),i instanceof fH&&(n[R_]=()=>{s||setTimeout(()=>{s||setTimeout(()=>{i.destroy(),n.destroy()})})})),n.on("close",()=>{a[Vo]&&(i.errored?a[Vo].abort(i.errored.toString()):n.writableFinished||a[Vo].abort("Client connection prematurely closed.")),s||setTimeout(()=>{s||setTimeout(()=>{i.destroy()})})}),o=e(a,{incoming:i,outgoing:n}),hi in o)return TO(o,n)}catch(s){if(o)return P_(s,n);if(t.errorHandler){if(o=await t.errorHandler(a?s:hH(s)),!o)return}else a?o=$O(s):o=IH()}try{return await PH(o,n,t)}catch(s){return P_(s,n)}}};var km=class{constructor(t={}){this._started=!1,this._hasHandledRequest=!1,this._streamMapping=new Map,this._requestToStreamMapping=new Map,this._requestResponseMap=new Map,this._initialized=!1,this._enableJsonResponse=!1,this._standaloneSseStreamId="_GET_stream",this.sessionIdGenerator=t.sessionIdGenerator,this._enableJsonResponse=t.enableJsonResponse??!1,this._eventStore=t.eventStore,this._onsessioninitialized=t.onsessioninitialized,this._onsessionclosed=t.onsessionclosed,this._allowedHosts=t.allowedHosts,this._allowedOrigins=t.allowedOrigins,this._enableDnsRebindingProtection=t.enableDnsRebindingProtection??!1,this._retryInterval=t.retryInterval}async start(){if(this._started)throw new Error("Transport already started");this._started=!0}createJsonErrorResponse(t,r,i,n){let o={code:r,message:i};return n?.data!==void 0&&(o.data=n.data),new Response(JSON.stringify({jsonrpc:"2.0",error:o,id:null}),{status:t,headers:{"Content-Type":"application/json",...n?.headers}})}validateRequestHeaders(t){if(this._enableDnsRebindingProtection){if(this._allowedHosts&&this._allowedHosts.length>0){let r=t.headers.get("host");if(!r||!this._allowedHosts.includes(r)){let i=`Invalid Host header: ${r}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let r=t.headers.get("origin");if(r&&!this._allowedOrigins.includes(r)){let i=`Invalid Origin header: ${r}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}}}async handleRequest(t,r){if(!this.sessionIdGenerator&&this._hasHandledRequest)throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let i=this.validateRequestHeaders(t);if(i)return i;switch(t.method){case"POST":return this.handlePostRequest(t,r);case"GET":return this.handleGetRequest(t);case"DELETE":return this.handleDeleteRequest(t);default:return this.handleUnsupportedRequest()}}async writePrimingEvent(t,r,i,n){if(!this._eventStore||n<"2025-11-25")return;let o=await this._eventStore.storeEvent(i,{}),a=`id: ${o}
85
85
  data:
86
86
 
87
87
  `;this._retryInterval!==void 0&&(a=`id: ${o}
88
88
  retry: ${this._retryInterval}
89
89
  data:
90
90
 
91
- `),t.enqueue(r.encode(a))}async handleGetRequest(t){if(!t.headers.get("accept")?.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept text/event-stream");let i=this.validateSession(t);if(i)return i;let n=this.validateProtocolVersion(t);if(n)return n;if(this._eventStore){let u=t.headers.get("last-event-id");if(u)return this.replayEvents(u)}if(this._streamMapping.get(this._standaloneSseStreamId)!==void 0)return this.onerror?.(new Error("Conflict: Only one SSE stream is allowed per session")),this.createJsonErrorResponse(409,-32e3,"Conflict: Only one SSE stream is allowed per session");let o=new TextEncoder,a,s=new ReadableStream({start:u=>{a=u},cancel:()=>{this._streamMapping.delete(this._standaloneSseStreamId)}}),l={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};return this.sessionId!==void 0&&(l["mcp-session-id"]=this.sessionId),this._streamMapping.set(this._standaloneSseStreamId,{controller:a,encoder:o,cleanup:()=>{this._streamMapping.delete(this._standaloneSseStreamId);try{a.close()}catch{}}}),new Response(s,{headers:l})}async replayEvents(t){if(!this._eventStore)return this.onerror?.(new Error("Event store not configured")),this.createJsonErrorResponse(400,-32e3,"Event store not configured");try{let r;if(this._eventStore.getStreamIdForEventId){if(r=await this._eventStore.getStreamIdForEventId(t),!r)return this.onerror?.(new Error("Invalid event ID format")),this.createJsonErrorResponse(400,-32e3,"Invalid event ID format");if(this._streamMapping.get(r)!==void 0)return this.onerror?.(new Error("Conflict: Stream already has an active connection")),this.createJsonErrorResponse(409,-32e3,"Conflict: Stream already has an active connection")}let i={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};this.sessionId!==void 0&&(i["mcp-session-id"]=this.sessionId);let n=new TextEncoder,o,a=new ReadableStream({start:l=>{o=l},cancel:()=>{}}),s=await this._eventStore.replayEventsAfter(t,{send:async(l,u)=>{if(!this.writeSSEEvent(o,n,u,l)){this.onerror?.(new Error("Failed replay events"));try{o.close()}catch{}}}});return this._streamMapping.set(s,{controller:o,encoder:n,cleanup:()=>{this._streamMapping.delete(s);try{o.close()}catch{}}}),new Response(a,{headers:i})}catch(r){return this.onerror?.(r),this.createJsonErrorResponse(500,-32e3,"Error replaying events")}}writeSSEEvent(t,r,i,n){try{let o=`event: message
91
+ `),t.enqueue(r.encode(a))}async handleGetRequest(t){if(!t.headers.get("accept")?.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept text/event-stream");let i=this.validateSession(t);if(i)return i;let n=this.validateProtocolVersion(t);if(n)return n;if(this._eventStore){let u=t.headers.get("last-event-id");if(u)return this.replayEvents(u)}if(this._streamMapping.get(this._standaloneSseStreamId)!==void 0)return this.onerror?.(new Error("Conflict: Only one SSE stream is allowed per session")),this.createJsonErrorResponse(409,-32e3,"Conflict: Only one SSE stream is allowed per session");let o=new TextEncoder,a,s=new ReadableStream({start:u=>{a=u},cancel:()=>{this._streamMapping.delete(this._standaloneSseStreamId)}}),c={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};return this.sessionId!==void 0&&(c["mcp-session-id"]=this.sessionId),this._streamMapping.set(this._standaloneSseStreamId,{controller:a,encoder:o,cleanup:()=>{this._streamMapping.delete(this._standaloneSseStreamId);try{a.close()}catch{}}}),new Response(s,{headers:c})}async replayEvents(t){if(!this._eventStore)return this.onerror?.(new Error("Event store not configured")),this.createJsonErrorResponse(400,-32e3,"Event store not configured");try{let r;if(this._eventStore.getStreamIdForEventId){if(r=await this._eventStore.getStreamIdForEventId(t),!r)return this.onerror?.(new Error("Invalid event ID format")),this.createJsonErrorResponse(400,-32e3,"Invalid event ID format");if(this._streamMapping.get(r)!==void 0)return this.onerror?.(new Error("Conflict: Stream already has an active connection")),this.createJsonErrorResponse(409,-32e3,"Conflict: Stream already has an active connection")}let i={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"};this.sessionId!==void 0&&(i["mcp-session-id"]=this.sessionId);let n=new TextEncoder,o,a=new ReadableStream({start:c=>{o=c},cancel:()=>{}}),s=await this._eventStore.replayEventsAfter(t,{send:async(c,u)=>{if(!this.writeSSEEvent(o,n,u,c)){this.onerror?.(new Error("Failed replay events"));try{o.close()}catch{}}}});return this._streamMapping.set(s,{controller:o,encoder:n,cleanup:()=>{this._streamMapping.delete(s);try{o.close()}catch{}}}),new Response(a,{headers:i})}catch(r){return this.onerror?.(r),this.createJsonErrorResponse(500,-32e3,"Error replaying events")}}writeSSEEvent(t,r,i,n){try{let o=`event: message
92
92
  `;return n&&(o+=`id: ${n}
93
93
  `),o+=`data: ${JSON.stringify(i)}
94
94
 
95
- `,t.enqueue(r.encode(o)),!0}catch(o){return this.onerror?.(o),!1}}handleUnsupportedRequest(){return this.onerror?.(new Error("Method not allowed.")),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(t,r){try{let i=t.headers.get("accept");if(!i?.includes("application/json")||!i.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");let n=t.headers.get("content-type");if(!n||!n.includes("application/json"))return this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let o={headers:Object.fromEntries(t.headers.entries()),url:new URL(t.url)},a;if(r?.parsedBody!==void 0)a=r.parsedBody;else try{a=await t.json()}catch{return this.onerror?.(new Error("Parse error: Invalid JSON")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}let s;try{Array.isArray(a)?s=a.map(_=>ws.parse(_)):s=[ws.parse(a)]}catch{return this.onerror?.(new Error("Parse error: Invalid JSON-RPC message")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}let l=s.some(lv);if(l){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(new Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(s.length>1)return this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!l){let _=this.validateSession(t);if(_)return _;let w=this.validateProtocolVersion(t);if(w)return w}if(!s.some(fn)){for(let _ of s)this.onmessage?.(_,{authInfo:r?.authInfo,requestInfo:o});return new Response(null,{status:202})}let d=crypto.randomUUID(),p=s.find(_=>lv(_)),f=p?p.params.protocolVersion:t.headers.get("mcp-protocol-version")??uP;if(this._enableJsonResponse)return new Promise(_=>{this._streamMapping.set(d,{resolveJson:_,cleanup:()=>{this._streamMapping.delete(d)}});for(let w of s)fn(w)&&this._requestToStreamMapping.set(w.id,d);for(let w of s)this.onmessage?.(w,{authInfo:r?.authInfo,requestInfo:o})});let h=new TextEncoder,m,g=new ReadableStream({start:_=>{m=_},cancel:()=>{this._streamMapping.delete(d)}}),v={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};this.sessionId!==void 0&&(v["mcp-session-id"]=this.sessionId);for(let _ of s)fn(_)&&(this._streamMapping.set(d,{controller:m,encoder:h,cleanup:()=>{this._streamMapping.delete(d);try{m.close()}catch{}}}),this._requestToStreamMapping.set(_.id,d));await this.writePrimingEvent(m,h,d,f);for(let _ of s){let w,$;fn(_)&&this._eventStore&&f>="2025-11-25"&&(w=()=>{this.closeSSEStream(_.id)},$=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(_,{authInfo:r?.authInfo,requestInfo:o,closeSSEStream:w,closeStandaloneSSEStream:$})}return new Response(g,{status:200,headers:v})}catch(i){return this.onerror?.(i),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(i)})}}async handleDeleteRequest(t){let r=this.validateSession(t);if(r)return r;let i=this.validateProtocolVersion(t);return i||(await Promise.resolve(this._onsessionclosed?.(this.sessionId)),await this.close(),new Response(null,{status:200}))}validateSession(t){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(new Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let r=t.headers.get("mcp-session-id");if(!r)return this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required");if(r!==this.sessionId)return this.onerror?.(new Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(t){let r=t.headers.get("mcp-protocol-version");if(r!==null&&!bo.includes(r))return this.onerror?.(new Error(`Bad Request: Unsupported protocol version: ${r} (supported versions: ${bo.join(", ")})`)),this.createJsonErrorResponse(400,-32e3,`Bad Request: Unsupported protocol version: ${r} (supported versions: ${bo.join(", ")})`)}async close(){this._streamMapping.forEach(({cleanup:t})=>{t()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream(t){let r=this._requestToStreamMapping.get(t);if(!r)return;let i=this._streamMapping.get(r);i&&i.cleanup()}closeStandaloneSSEStream(){let t=this._streamMapping.get(this._standaloneSseStreamId);t&&t.cleanup()}async send(t,r){let i=r?.relatedRequestId;if((Ar(t)||_o(t))&&(i=t.id),i===void 0){if(Ar(t)||_o(t))throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let a;this._eventStore&&(a=await this._eventStore.storeEvent(this._standaloneSseStreamId,t));let s=this._streamMapping.get(this._standaloneSseStreamId);if(s===void 0)return;s.controller&&s.encoder&&this.writeSSEEvent(s.controller,s.encoder,t,a);return}let n=this._requestToStreamMapping.get(i);if(!n)throw new Error(`No connection established for request ID: ${String(i)}`);let o=this._streamMapping.get(n);if(!this._enableJsonResponse&&o?.controller&&o?.encoder){let a;this._eventStore&&(a=await this._eventStore.storeEvent(n,t)),this.writeSSEEvent(o.controller,o.encoder,t,a)}if(Ar(t)||_o(t)){this._requestResponseMap.set(i,t);let a=Array.from(this._requestToStreamMapping.entries()).filter(([l,u])=>u===n).map(([l])=>l);if(a.every(l=>this._requestResponseMap.has(l))){if(!o)throw new Error(`No connection established for request ID: ${String(i)}`);if(this._enableJsonResponse&&o.resolveJson){let l={"Content-Type":"application/json"};this.sessionId!==void 0&&(l["mcp-session-id"]=this.sessionId);let u=a.map(d=>this._requestResponseMap.get(d));u.length===1?o.resolveJson(new Response(JSON.stringify(u[0]),{status:200,headers:l})):o.resolveJson(new Response(JSON.stringify(u),{status:200,headers:l}))}else o.cleanup();for(let l of a)this._requestResponseMap.delete(l),this._requestToStreamMapping.delete(l)}}}};var xm=class{constructor(t={}){this._requestContext=new WeakMap,this._webStandardTransport=new Sm(t),this._requestListener=E_(async r=>{let i=this._requestContext.get(r);return this._webStandardTransport.handleRequest(r,{authInfo:i?.authInfo,parsedBody:i?.parsedBody})},{overrideGlobalObjects:!1})}get sessionId(){return this._webStandardTransport.sessionId}set onclose(t){this._webStandardTransport.onclose=t}get onclose(){return this._webStandardTransport.onclose}set onerror(t){this._webStandardTransport.onerror=t}get onerror(){return this._webStandardTransport.onerror}set onmessage(t){this._webStandardTransport.onmessage=t}get onmessage(){return this._webStandardTransport.onmessage}async start(){return this._webStandardTransport.start()}async close(){return this._webStandardTransport.close()}async send(t,r){return this._webStandardTransport.send(t,r)}async handleRequest(t,r,i){let n=t.auth;await E_(async a=>this._webStandardTransport.handleRequest(a,{authInfo:n,parsedBody:i}),{overrideGlobalObjects:!1})(t,r)}closeSSEStream(t){this._webStandardTransport.closeSSEStream(t)}closeStandaloneSSEStream(){this._webStandardTransport.closeStandaloneSSEStream()}};var dO=100,dH=dO/60,pH=50;async function hi(e,t){try{await t.close()}catch(r){I.warn({sessionId:e,err:r},"Error closing expired transport")}}function mH(e){let t,r=1/0;for(let[i,n]of e)n.lastActivity<r&&(r=n.lastActivity,t=i);if(t!==void 0){let i=e.get(t);I.warn({evictedSessionId:t,idleMs:Date.now()-r,activeSessions:e.size},"Max concurrent sessions reached \u2014 evicting least-recently-active session"),e.delete(t),i&&hi(t,i.transport)}}function pO(e,t,r,i){let n=e.headers["mcp-session-id"],o=typeof n=="string"?n:void 0,a=o!==void 0&&o!==""?r.get(o):void 0;if(a){let s=a;if(!s.rateLimiter.consume()){let l=String(Math.ceil(s.rateLimiter.msUntilNextToken()/1e3));Oe(t,429,"Too many requests",{"Retry-After":l});return}s.lastActivity=Date.now(),I.debug({sessionId:o},"Routing to existing session"),(async()=>{try{await s.transport.handleRequest(e,t)}catch(l){I.error({sessionId:o,err:l},"handleRequest failed for existing session")}})();return}if(e.method!=="POST"){Oe(t,400,"Session required");return}r.size>=pH&&mH(r),fH(e,t,r,i)}async function fH(e,t,r,i){let n,o=new xm({sessionIdGenerator:()=>(n=uH(),n)});I.info("New POST without session ID \u2014 creating new session");try{await Promise.race([i(o),new Promise((s,l)=>{setTimeout(()=>{l(new Error("Transport setup timed out"))},3e4).unref()})])}catch(s){I.error({err:s},"Transport setup failed"),Oe(t,503,"Session setup failed"),hi(n??"unknown",o);return}let a=o.onclose;o.onclose=()=>{a?.(),n!==void 0&&n!==""&&r.has(n)&&(I.info({sessionId:n},"Transport closed \u2014 removing session from map"),r.delete(n))};try{await o.handleRequest(e,t)}catch(s){I.error({sessionId:n,err:s},"handleRequest failed for new session"),hi(n??"unknown",o),n!==void 0&&n!==""&&r.delete(n);return}if(n!==void 0&&n!==""){let s=Date.now();r.set(n,{transport:o,lastActivity:s,rateLimiter:new Or(dO,dH)}),I.info({sessionId:n,activeSessions:r.size},"Session registered")}else I.warn("New session POST completed but no session ID was generated \u2014 closing transport"),hi("no-id",o)}var hO=1048576,xH=3600*1e3,wH=300*1e3;function $H(e,t,r,i){let n=e.socket.remoteAddress;if(n===void 0)return!0;let o=r.get(n);if(o)r.delete(n),r.set(n,o);else{if(r.size>=1e3){let a=r.keys().next().value;a!==void 0&&r.delete(a)}o=new Or(200,200/6e4*1e3),r.set(n,o)}if(!o.consume()){Qd(e,t,i);let a=String(Math.ceil(o.msUntilNextToken()/1e3));return Oe(t,429,"Rate limit exceeded for your IP \u2014 try again later",{"Retry-After":a}),!1}return!0}function kH(e){let{port:t,sessions:r,setup:i,allowedOrigins:n,globalLimiter:o,ipLimiters:a,secret:s,webhookHandler:l}=e;return(u,d)=>{if(!$H(u,d,a,n))return;if(!o.consume()){Qd(u,d,n);let f=String(Math.ceil(o.msUntilNextToken()/1e3));Oe(d,429,"Server rate limit exceeded \u2014 try again later",{"Retry-After":f});return}Qd(u,d,n);let p=new URL(u.url??"/",`http://localhost:${String(t)}`);if(I.debug({method:u.method,path:p.pathname},"HTTP request received"),p.pathname==="/webhook/polar"&&l){l(u,d);return}if(VE(u,d,s)&&BE(u,d,n,hO)){if(HE(u,d,hO),WE(u,d),p.pathname!=="/mcp"&&p.pathname!=="/"){Oe(d,404,"Not found");return}p.pathname==="/"&&(u.url="/mcp"),pO(u,d,r,i)}}}async function gO(e,t,r,i){let n=i?.host??"127.0.0.1",o=i?.secret,a=i?.webhookHandler,s=new Map,l=new Set(r),u=new Map,d=new Or(500,500/6e4*1e3);I.info({corsOrigins:r,host:n},"HTTP transport CORS allowed origins"),o!==void 0&&o!==""?I.info("HTTP transport bearer token authentication enabled"):I.warn("HTTP transport has no authentication \u2014 set FAMILIAR_HTTP_SECRET to secure it");let p=setInterval(()=>{let m=Date.now();for(let[g,v]of s)m-v.lastActivity>=xH&&(I.info({sessionId:g},"Session expired (idle timeout)"),s.delete(g),hi(g,v.transport))},wH);p.unref();let f=SH(kH({port:e,sessions:s,setup:t,allowedOrigins:l,globalLimiter:d,ipLimiters:u,secret:o,webhookHandler:a}));f.headersTimeout=1e4,f.requestTimeout=3e4,f.maxConnections=100,f.on("clientError",(m,g)=>{I.debug({err:m},"HTTP client error (malformed request or connection reset)"),g.destroy()});let h=async()=>{clearInterval(p);let m=[...s.entries()];s.clear(),await Promise.all(m.map(([g,v])=>hi(g,v.transport))),I.info({closedSessions:m.length},"All HTTP sessions closed")};return f.on("error",m=>{I.error({err:m},"HTTP server runtime error")}),new Promise((m,g)=>{let v=_=>{_.code==="EADDRINUSE"?g(new Error(`Port ${String(e)} is already in use`)):g(_)};f.on("error",v),f.listen(e,n,()=>{f.removeListener("error",v),I.info({port:e,host:n},"Streamable HTTP transport listening"),m({server:f,closeAllSessions:h})})})}var P_=new Set(["dice","world","chat","combat","characters"]),z_=[{id:"dice",name:"Dice",description:"Roll dice with standard notation (1d20+5, 4d6kh3, 2d8+1d6, etc.). Always enabled.",toolCount:1},{id:"world",name:"World & System",description:"World metadata, game pause, in-game calendar, and user management. Get world name, system, module list, advance time, and list/inspect users. Always enabled.",toolCount:6},{id:"chat",name:"Chat Messages",description:"Send messages to the Foundry chat log and retrieve recent message history. Supports whispers and in-character speech. Always enabled.",toolCount:2},{id:"combat",name:"Combat & Initiative",description:"Core combat flow: start/end encounters, roll initiative, advance turns/rounds, toggle/apply conditions, track HP, batch damage/healing, and party rests. Enable when: running any combat encounter. See also: combat-ai for automated NPC turns, effects for custom buffs/debuffs.",toolCount:13},{id:"characters",name:"Characters & Actors",description:"Full actor management: get/create/update/delete/duplicate actors, manage inventory, HP, abilities, and player ownership. Enable when: working with PCs, NPCs, or creatures. For character inventory use this bundle, not items. See also: compendium for importing entries, effects for buffs/debuffs.",toolCount:14},{id:"combat-ai",name:"Combat AI",description:"Automated NPC combat: get combat snapshots, resolve attacks/spells/saving throws/death saves, and move tokens. Enable when: running NPC turns automatically or resolving complex combat actions. Requires: combat bundle.",toolCount:6},{id:"scenes",name:"Scenes & Tokens",description:"Scene and token management: get/search/create/switch/update/delete scenes, place/move/update/delete tokens, batch token updates, set darkness and weather, reset fog, pan canvas, take screenshots. Enable when: setting up maps, moving tokens, or changing scene properties. For conditions (prone, stunned, etc.), use the combat bundle. See also: canvas for tiles/drawings, canvas-environment for walls/lights.",toolCount:19},{id:"compendium",name:"Compendium & Rules",description:"Search and look up SRD/compendium content (spells, monsters, items, classes), list packs, and import actors from compendiums into the world. Enable when: looking up rules, finding stat blocks, or importing compendium entries. See also: characters for adding compendium items to character inventory.",toolCount:4},{id:"journals",name:"Journals & Notes",description:"Journal entry and page management: list, search, create, read, update, and delete journal entries and their pages. Enable when: managing session notes, lore, handouts, or quest logs. See also: folders for organizing journal hierarchies.",toolCount:10},{id:"canvas",name:"Canvas Drawing",description:"Map tiles and freeform drawings on the game canvas. Enable when: adding map overlays, decorating scenes, or drawing on the battle map. See also: scenes for tokens, canvas-environment for walls/lights, regions for trigger zones.",toolCount:8},{id:"canvas-environment",name:"Canvas Environment",description:"Walls, doors, lights, ambient sounds, and map notes that define the scene environment. Controls vision blocking, movement barriers, lighting, and ambient audio. Enable when: building or modifying map layouts, placing lights, or adding environmental sounds. See also: scenes for scene-level properties, canvas for tiles/drawings.",toolCount:18},{id:"playlists",name:"Audio & Playlists",description:"Background music and sound effects: search/create/update/delete playlists and tracks, play/stop individual tracks or entire playlists, stop all audio. Enable when: managing session audio, playing background music, or triggering sound effects. See also: voice-generation for AI-generated audio.",toolCount:14},{id:"tables",name:"Rollable Tables",description:"Random rollable tables: list, search, get, roll, create, update, and delete tables for loot, encounters, random names, or custom generators. Enable when: rolling on random tables or managing table content. See also: macros for roll automation, cards for alternative randomization.",toolCount:7},{id:"cards",name:"Card Decks",description:"Card stack management: list, search, get, create, update, and delete card stacks, draw cards, shuffle and reset decks. Enable when: using card decks, drawing cards, or managing card-based game mechanics. See also: tables for alternative randomization, macros for automation.",toolCount:9},{id:"macros",name:"Macros",description:"Automation scripts: list, get, search, create, update, execute, and delete macros. Enable when: running or managing Foundry macros for automation. See also: tables for roll triggering, playlists for audio control.",toolCount:7},{id:"effects",name:"Active Effects",description:"Buffs, debuffs, and status effects on actors: list, get, create, update, and delete active effects. Enable when: applying or managing temporary stat modifications. See also: combat for conditions (prone, stunned, etc.).",toolCount:5},{id:"items",name:"Standalone Items",description:"World-level item management (not character inventory). List, search, get, create, update, and delete standalone items, treasures, and rewards. Enable when: creating loot, managing shop inventory, or building item catalogs. For character inventory, use the characters bundle instead.",toolCount:6},{id:"folders",name:"Folders",description:"Organize documents into folder hierarchies: list, get, create, update, and delete folders for any document type (actors, scenes, journals, items, etc.). Enable when: organizing the sidebar or managing folder structure. See also: any document bundle for organizing its content.",toolCount:5},{id:"regions",name:"Regions",description:"Scene trigger zones (Foundry v13+): list, get, create, update, and delete regions for scene automation behaviors. Enable when: setting up area triggers, teleporters, or scene automation. See also: scenes for scene-level properties.",toolCount:5},{id:"ember-events",name:"Ember Events",description:"Quest and event tracking via the Ember module: list, get, begin, complete events, and set outcomes. Enable when: managing quests or story events. Requires: Ember module installed in Foundry.",toolCount:5},{id:"image-generation",name:"Image Generation",description:"Generate images from text prompts using configured AI providers (DALL-E, Stability AI, fal.ai, Leonardo, Replicate). Enable when: creating character portraits, scene art, or item illustrations.",toolCount:1},{id:"voice-generation",name:"Voice Generation",description:"Generate speech audio from text using configured TTS providers (ElevenLabs, Cartesia, OpenAI TTS, PlayHT). Assign unique voices to individual characters/NPCs. Enable when: creating NPC voice lines, narration audio, or managing per-character voice assignments.",toolCount:4},{id:"knowledge",name:"Knowledge & Memory",description:"Search campaign lore in the knowledge base and manage persistent campaign memories. Enable when: looking up campaign history, searching for specific lore, or saving important story developments.",toolCount:5},{id:"scene-generator",name:"Scene Generator",description:"Generate complete scenes from structured blueprints: rooms with walls, doors, lights, sounds, and tokens. Provide room dimensions and types, connections between rooms, and optional token placements. Room coordinates are optional \u2014 the compiler auto-places rooms when omitted. Room types trigger automatic furnishing. Enable when: creating new battle maps, dungeons, taverns, or any scene from a description.",toolCount:1}];var $m="1.27.1",wm="_registeredTools";function TH(e){return typeof e=="object"&&e!==null}async function IH(){try{let{createRequire:e}=await import("node:module"),r=e(import.meta.url)("@modelcontextprotocol/sdk/package.json");return typeof r=="object"&&r!==null&&"version"in r&&typeof r.version=="string"?r.version:void 0}catch{return}}function yO(e){let t=e.split(".");return`${t[0]}.${t[1]}`}function Bo(e){let t=e;if(!(wm in t)||!TH(t[wm]))throw new Error(`McpServer is missing the internal '${wm}' property. This adapter was validated against @modelcontextprotocol/sdk ${$m}. The installed SDK version may have changed its internals. Update the SDK adapter for the new SDK version.`);return t[wm]}async function vO(e,t){Bo(e);let r=await IH();r!==void 0&&yO(r)!==yO($m)&&t.warn({installedVersion:r,validatedVersion:$m},`MCP SDK version ${r} differs from validated version ${$m}. The tool bundle system accesses SDK internals \u2014 verify compatibility and update the validated SDK version constant in the SDK adapter.`)}var EH={content_policy:" Try rephrasing your prompt.",auth_error:" Check your API key in Foundry module settings.",quota_exceeded:" Check your billing at the provider dashboard.",rate_limit:" Wait a moment and try again.",FOUNDRY_DISCONNECTED:" Ensure Foundry VTT is running and the Familiar module is enabled.",QUERY_TIMEOUT:" The Foundry module took too long to respond. Try a simpler query.",QUERY_OVERLOADED:" Too many concurrent requests. Wait a moment and try again.",SEND_FAILED:" Connection to Foundry was lost. Check the connection.",RATE_LIMITED:" Too many requests. Wait a moment before trying again.",NOT_FOUND:" The requested entity was not found in the game world.",INVALID_INPUT:" Check the tool parameters and try again.",PERMISSION_DENIED:" This action requires GM-level permissions.",LICENSE_INVALID:" Check your Familiar subscription status."};function Ho(e){return e===void 0?"":EH[e]??""}var q={readOnlyHint:!0,openWorldHint:!1},C={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},X={readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1},W={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},Ze={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},km={readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1};function PH(e,t){if(!Array.isArray(e))return`${JSON.stringify(e).slice(0,204800)}
95
+ `,t.enqueue(r.encode(o)),!0}catch(o){return this.onerror?.(o),!1}}handleUnsupportedRequest(){return this.onerror?.(new Error("Method not allowed.")),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(t,r){try{let i=t.headers.get("accept");if(!i?.includes("application/json")||!i.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");let n=t.headers.get("content-type");if(!n||!n.includes("application/json"))return this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let o={headers:Object.fromEntries(t.headers.entries()),url:new URL(t.url)},a;if(r?.parsedBody!==void 0)a=r.parsedBody;else try{a=await t.json()}catch{return this.onerror?.(new Error("Parse error: Invalid JSON")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}let s;try{Array.isArray(a)?s=a.map(_=>$s.parse(_)):s=[$s.parse(a)]}catch{return this.onerror?.(new Error("Parse error: Invalid JSON-RPC message")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}let c=s.some(mv);if(c){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(new Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(s.length>1)return this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!c){let _=this.validateSession(t);if(_)return _;let w=this.validateProtocolVersion(t);if(w)return w}if(!s.some(gn)){for(let _ of s)this.onmessage?.(_,{authInfo:r?.authInfo,requestInfo:o});return new Response(null,{status:202})}let d=crypto.randomUUID(),p=s.find(_=>mv(_)),f=p?p.params.protocolVersion:t.headers.get("mcp-protocol-version")??TP;if(this._enableJsonResponse)return new Promise(_=>{this._streamMapping.set(d,{resolveJson:_,cleanup:()=>{this._streamMapping.delete(d)}});for(let w of s)gn(w)&&this._requestToStreamMapping.set(w.id,d);for(let w of s)this.onmessage?.(w,{authInfo:r?.authInfo,requestInfo:o})});let h=new TextEncoder,m,g=new ReadableStream({start:_=>{m=_},cancel:()=>{this._streamMapping.delete(d)}}),v={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};this.sessionId!==void 0&&(v["mcp-session-id"]=this.sessionId);for(let _ of s)gn(_)&&(this._streamMapping.set(d,{controller:m,encoder:h,cleanup:()=>{this._streamMapping.delete(d);try{m.close()}catch{}}}),this._requestToStreamMapping.set(_.id,d));await this.writePrimingEvent(m,h,d,f);for(let _ of s){let w,$;gn(_)&&this._eventStore&&f>="2025-11-25"&&(w=()=>{this.closeSSEStream(_.id)},$=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(_,{authInfo:r?.authInfo,requestInfo:o,closeSSEStream:w,closeStandaloneSSEStream:$})}return new Response(g,{status:200,headers:v})}catch(i){return this.onerror?.(i),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(i)})}}async handleDeleteRequest(t){let r=this.validateSession(t);if(r)return r;let i=this.validateProtocolVersion(t);return i||(await Promise.resolve(this._onsessionclosed?.(this.sessionId)),await this.close(),new Response(null,{status:200}))}validateSession(t){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(new Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let r=t.headers.get("mcp-session-id");if(!r)return this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required");if(r!==this.sessionId)return this.onerror?.(new Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(t){let r=t.headers.get("mcp-protocol-version");if(r!==null&&!_o.includes(r))return this.onerror?.(new Error(`Bad Request: Unsupported protocol version: ${r} (supported versions: ${_o.join(", ")})`)),this.createJsonErrorResponse(400,-32e3,`Bad Request: Unsupported protocol version: ${r} (supported versions: ${_o.join(", ")})`)}async close(){this._streamMapping.forEach(({cleanup:t})=>{t()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream(t){let r=this._requestToStreamMapping.get(t);if(!r)return;let i=this._streamMapping.get(r);i&&i.cleanup()}closeStandaloneSSEStream(){let t=this._streamMapping.get(this._standaloneSseStreamId);t&&t.cleanup()}async send(t,r){let i=r?.relatedRequestId;if((Ur(t)||So(t))&&(i=t.id),i===void 0){if(Ur(t)||So(t))throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let a;this._eventStore&&(a=await this._eventStore.storeEvent(this._standaloneSseStreamId,t));let s=this._streamMapping.get(this._standaloneSseStreamId);if(s===void 0)return;s.controller&&s.encoder&&this.writeSSEEvent(s.controller,s.encoder,t,a);return}let n=this._requestToStreamMapping.get(i);if(!n)throw new Error(`No connection established for request ID: ${String(i)}`);let o=this._streamMapping.get(n);if(!this._enableJsonResponse&&o?.controller&&o?.encoder){let a;this._eventStore&&(a=await this._eventStore.storeEvent(n,t)),this.writeSSEEvent(o.controller,o.encoder,t,a)}if(Ur(t)||So(t)){this._requestResponseMap.set(i,t);let a=Array.from(this._requestToStreamMapping.entries()).filter(([c,u])=>u===n).map(([c])=>c);if(a.every(c=>this._requestResponseMap.has(c))){if(!o)throw new Error(`No connection established for request ID: ${String(i)}`);if(this._enableJsonResponse&&o.resolveJson){let c={"Content-Type":"application/json"};this.sessionId!==void 0&&(c["mcp-session-id"]=this.sessionId);let u=a.map(d=>this._requestResponseMap.get(d));u.length===1?o.resolveJson(new Response(JSON.stringify(u[0]),{status:200,headers:c})):o.resolveJson(new Response(JSON.stringify(u),{status:200,headers:c}))}else o.cleanup();for(let c of a)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c)}}}};var Tm=class{constructor(t={}){this._requestContext=new WeakMap,this._webStandardTransport=new km(t),this._requestListener=O_(async r=>{let i=this._requestContext.get(r);return this._webStandardTransport.handleRequest(r,{authInfo:i?.authInfo,parsedBody:i?.parsedBody})},{overrideGlobalObjects:!1})}get sessionId(){return this._webStandardTransport.sessionId}set onclose(t){this._webStandardTransport.onclose=t}get onclose(){return this._webStandardTransport.onclose}set onerror(t){this._webStandardTransport.onerror=t}get onerror(){return this._webStandardTransport.onerror}set onmessage(t){this._webStandardTransport.onmessage=t}get onmessage(){return this._webStandardTransport.onmessage}async start(){return this._webStandardTransport.start()}async close(){return this._webStandardTransport.close()}async send(t,r){return this._webStandardTransport.send(t,r)}async handleRequest(t,r,i){let n=t.auth;await O_(async a=>this._webStandardTransport.handleRequest(a,{authInfo:n,parsedBody:i}),{overrideGlobalObjects:!1})(t,r)}closeSSEStream(t){this._webStandardTransport.closeSSEStream(t)}closeStandaloneSSEStream(){this._webStandardTransport.closeStandaloneSSEStream()}};var IO=100,OH=IO/60,jH=50;async function gi(e,t){try{await t.close()}catch(r){T.warn({sessionId:e,err:r},"Error closing expired transport")}}function DH(e){let t,r=1/0;for(let[i,n]of e)n.lastActivity<r&&(r=n.lastActivity,t=i);if(t!==void 0){let i=e.get(t);T.warn({evictedSessionId:t,idleMs:Date.now()-r,activeSessions:e.size},"Max concurrent sessions reached \u2014 evicting least-recently-active session"),e.delete(t),i&&gi(t,i.transport)}}function EO(e,t,r,i){let n=e.headers["mcp-session-id"],o=typeof n=="string"?n:void 0,a=o!==void 0&&o!==""?r.get(o):void 0;if(a){let s=a;if(!s.rateLimiter.consume()){let c=String(Math.ceil(s.rateLimiter.msUntilNextToken()/1e3));Oe(t,429,"Too many requests",{"Retry-After":c});return}s.lastActivity=Date.now(),T.debug({sessionId:o},"Routing to existing session"),(async()=>{try{await s.transport.handleRequest(e,t)}catch(c){T.error({sessionId:o,err:c},"handleRequest failed for existing session")}})();return}if(e.method!=="POST"){Oe(t,400,"Session required");return}r.size>=jH&&DH(r),NH(e,t,r,i)}async function NH(e,t,r,i){let n,o=new Tm({sessionIdGenerator:()=>(n=RH(),n)});T.info("New POST without session ID \u2014 creating new session");try{await Promise.race([i(o),new Promise((s,c)=>{setTimeout(()=>{c(new Error("Transport setup timed out"))},3e4).unref()})])}catch(s){T.error({err:s},"Transport setup failed"),Oe(t,503,"Session setup failed"),gi(n??"unknown",o);return}let a=o.onclose;o.onclose=()=>{a?.(),n!==void 0&&n!==""&&r.has(n)&&(T.info({sessionId:n},"Transport closed \u2014 removing session from map"),r.delete(n))};try{await o.handleRequest(e,t)}catch(s){T.error({sessionId:n,err:s},"handleRequest failed for new session"),gi(n??"unknown",o),n!==void 0&&n!==""&&r.delete(n);return}if(n!==void 0&&n!==""){let s=Date.now();r.set(n,{transport:o,lastActivity:s,rateLimiter:new Dr(IO,OH)}),T.info({sessionId:n,activeSessions:r.size},"Session registered")}else T.warn("New session POST completed but no session ID was generated \u2014 closing transport"),gi("no-id",o)}var RO=1048576,FH=3600*1e3,VH=300*1e3;function BH(e,t,r,i){let n=e.socket.remoteAddress;if(n===void 0)return!0;let o=r.get(n);if(o)r.delete(n),r.set(n,o);else{if(r.size>=1e3){let a=r.keys().next().value;a!==void 0&&r.delete(a)}o=new Dr(200,200/6e4*1e3),r.set(n,o)}if(!o.consume()){tp(e,t,i);let a=String(Math.ceil(o.msUntilNextToken()/1e3));return Oe(t,429,"Rate limit exceeded for your IP \u2014 try again later",{"Retry-After":a}),!1}return!0}function HH(e){let{port:t,sessions:r,setup:i,allowedOrigins:n,globalLimiter:o,ipLimiters:a,secret:s,webhookHandler:c}=e;return(u,d)=>{if(!BH(u,d,a,n))return;if(!o.consume()){tp(u,d,n);let f=String(Math.ceil(o.msUntilNextToken()/1e3));Oe(d,429,"Server rate limit exceeded \u2014 try again later",{"Retry-After":f});return}tp(u,d,n);let p=new URL(u.url??"/",`http://localhost:${String(t)}`);if(T.debug({method:u.method,path:p.pathname},"HTTP request received"),p.pathname==="/webhook/polar"&&c){c(u,d);return}if(aP(u,d,s)&&sP(u,d,n,RO)){if(cP(u,d,RO),lP(u,d),p.pathname!=="/mcp"&&p.pathname!=="/"){Oe(d,404,"Not found");return}p.pathname==="/"&&(u.url="/mcp"),EO(u,d,r,i)}}}async function OO(e,t,r,i){let n=i?.host??"127.0.0.1",o=i?.secret,a=i?.webhookHandler,s=new Map,c=new Set(r),u=new Map,d=new Dr(500,500/6e4*1e3);T.info({corsOrigins:r,host:n},"HTTP transport CORS allowed origins"),o!==void 0&&o!==""?T.info("HTTP transport bearer token authentication enabled"):T.warn("HTTP transport has no authentication \u2014 set FAMILIAR_HTTP_SECRET to secure it");let p=setInterval(()=>{let m=Date.now();for(let[g,v]of s)m-v.lastActivity>=FH&&(T.info({sessionId:g},"Session expired (idle timeout)"),s.delete(g),gi(g,v.transport))},VH);p.unref();let f=ZH(HH({port:e,sessions:s,setup:t,allowedOrigins:c,globalLimiter:d,ipLimiters:u,secret:o,webhookHandler:a}));f.headersTimeout=1e4,f.requestTimeout=3e4,f.maxConnections=100,f.on("clientError",(m,g)=>{T.debug({err:m},"HTTP client error (malformed request or connection reset)"),g.destroy()});let h=async()=>{clearInterval(p);let m=[...s.entries()];s.clear(),await Promise.all(m.map(([g,v])=>gi(g,v.transport))),T.info({closedSessions:m.length},"All HTTP sessions closed")};return f.on("error",m=>{T.error({err:m},"HTTP server runtime error")}),new Promise((m,g)=>{let v=_=>{_.code==="EADDRINUSE"?g(new Error(`Port ${String(e)} is already in use`)):g(_)};f.on("error",v),f.listen(e,n,()=>{f.removeListener("error",v),T.info({port:e,host:n},"Streamable HTTP transport listening"),m({server:f,closeAllSessions:h})})})}var j_=new Set(["dice","world","chat","combat","characters"]),D_=[{id:"dice",name:"Dice",description:"Roll dice with standard notation (1d20+5, 4d6kh3, 2d8+1d6, etc.). Always enabled.",toolCount:1},{id:"world",name:"World & System",description:"World metadata, game pause, in-game calendar, and user management. Get world name, system, module list, advance time, and list/inspect users. Always enabled.",toolCount:6},{id:"chat",name:"Chat Messages",description:"Send messages to the Foundry chat log and retrieve recent message history. Supports whispers and in-character speech. Always enabled.",toolCount:2},{id:"combat",name:"Combat & Initiative",description:"Core combat flow: start/end encounters, roll initiative, advance turns/rounds, toggle/apply conditions, track HP, batch damage/healing, and party rests. Enable when: running any combat encounter. See also: combat-ai for automated NPC turns, effects for custom buffs/debuffs.",toolCount:17},{id:"characters",name:"Characters & Actors",description:"Full actor management: get/create/update/delete/duplicate actors, manage inventory, HP, abilities, and player ownership. Enable when: working with PCs, NPCs, or creatures. For character inventory use this bundle, not items. See also: compendium for importing entries, effects for buffs/debuffs.",toolCount:14},{id:"combat-ai",name:"Combat AI",description:"Automated NPC combat: get combat snapshots, resolve attacks/spells/saving throws/death saves/ability checks, multiattack, legendary actions, AoE targeting, and move tokens. Enable when: running NPC turns automatically or resolving complex combat actions. Requires: combat bundle.",toolCount:12},{id:"scenes",name:"Scenes & Tokens",description:"Scene and token management: get/search/create/switch/update/delete scenes, place/move/update/delete tokens, batch token updates, set darkness and weather, reset fog, pan canvas, take screenshots. Enable when: setting up maps, moving tokens, or changing scene properties. For conditions (prone, stunned, etc.), use the combat bundle. See also: canvas for tiles/drawings, canvas-environment for walls/lights.",toolCount:19},{id:"compendium",name:"Compendium & Rules",description:"Search and look up SRD/compendium content (spells, monsters, items, classes), list packs, and import actors from compendiums into the world. Enable when: looking up rules, finding stat blocks, or importing compendium entries. See also: characters for adding compendium items to character inventory.",toolCount:4},{id:"journals",name:"Journals & Notes",description:"Journal entry and page management: list, search, create, read, update, and delete journal entries and their pages. Enable when: managing session notes, lore, handouts, or quest logs. See also: folders for organizing journal hierarchies.",toolCount:10},{id:"canvas",name:"Canvas Drawing",description:"Map tiles and freeform drawings on the game canvas. Enable when: adding map overlays, decorating scenes, or drawing on the battle map. See also: scenes for tokens, canvas-environment for walls/lights, regions for trigger zones.",toolCount:8},{id:"canvas-environment",name:"Canvas Environment",description:"Walls, doors, lights, ambient sounds, and map notes that define the scene environment. Controls vision blocking, movement barriers, lighting, and ambient audio. Enable when: building or modifying map layouts, placing lights, or adding environmental sounds. See also: scenes for scene-level properties, canvas for tiles/drawings.",toolCount:18},{id:"playlists",name:"Audio & Playlists",description:"Background music and sound effects: search/create/update/delete playlists and tracks, play/stop individual tracks or entire playlists, stop all audio. Enable when: managing session audio, playing background music, or triggering sound effects. See also: voice-generation for AI-generated audio.",toolCount:14},{id:"tables",name:"Rollable Tables",description:"Random rollable tables: list, search, get, roll, create, update, and delete tables for loot, encounters, random names, or custom generators. Enable when: rolling on random tables or managing table content. See also: macros for roll automation, cards for alternative randomization.",toolCount:7},{id:"cards",name:"Card Decks",description:"Card stack management: list, search, get, create, update, and delete card stacks, draw cards, shuffle and reset decks. Enable when: using card decks, drawing cards, or managing card-based game mechanics. See also: tables for alternative randomization, macros for automation.",toolCount:9},{id:"macros",name:"Macros",description:"Automation scripts: list, get, search, create, update, execute, and delete macros. Enable when: running or managing Foundry macros for automation. See also: tables for roll triggering, playlists for audio control.",toolCount:7},{id:"effects",name:"Active Effects",description:"Buffs, debuffs, and status effects on actors: list, get, create, update, and delete active effects. Enable when: applying or managing temporary stat modifications. See also: combat for conditions (prone, stunned, etc.).",toolCount:5},{id:"items",name:"Standalone Items",description:"World-level item management (not character inventory). List, search, get, create, update, and delete standalone items, treasures, and rewards. Enable when: creating loot, managing shop inventory, or building item catalogs. For character inventory, use the characters bundle instead.",toolCount:6},{id:"folders",name:"Folders",description:"Organize documents into folder hierarchies: list, get, create, update, and delete folders for any document type (actors, scenes, journals, items, etc.). Enable when: organizing the sidebar or managing folder structure. See also: any document bundle for organizing its content.",toolCount:5},{id:"regions",name:"Regions",description:"Scene trigger zones (Foundry v13+): list, get, create, update, and delete regions for scene automation behaviors. Enable when: setting up area triggers, teleporters, or scene automation. See also: scenes for scene-level properties.",toolCount:5},{id:"ember-events",name:"Ember Events",description:"Quest and event tracking via the Ember module: list, get, begin, complete events, and set outcomes. Enable when: managing quests or story events. Requires: Ember module installed in Foundry.",toolCount:5},{id:"image-generation",name:"Image Generation",description:"Generate images from text prompts using configured AI providers (OpenAI GPT Image, fal.ai Flux, Leonardo AI). Enable when: creating character portraits, scene art, or item illustrations.",toolCount:1},{id:"voice-generation",name:"Voice Generation",description:"Generate speech audio from text using configured TTS providers (ElevenLabs, Cartesia, OpenAI TTS, PlayHT). Assign unique voices to individual characters/NPCs. Enable when: creating NPC voice lines, narration audio, or managing per-character voice assignments.",toolCount:4},{id:"knowledge",name:"Knowledge & Memory",description:"Search campaign lore in the knowledge base and manage persistent campaign memories. Enable when: looking up campaign history, searching for specific lore, or saving important story developments.",toolCount:5},{id:"scene-generator",name:"Scene Generator",description:"Generate scenes with AI battle map backgrounds. Provide rooms and connections to set grid dimensions and enrich the image prompt with spatial context. Enable when: creating new battle maps, dungeons, taverns, or any scene from a description.",toolCount:1}];var Em="1.27.1",Im="_registeredTools";function WH(e){return typeof e=="object"&&e!==null}async function JH(){try{let{createRequire:e}=await import("node:module"),r=e(import.meta.url)("@modelcontextprotocol/sdk/package.json");return typeof r=="object"&&r!==null&&"version"in r&&typeof r.version=="string"?r.version:void 0}catch{return}}function jO(e){let t=e.split(".");return`${t[0]}.${t[1]}`}function Ho(e){let t=e;if(!(Im in t)||!WH(t[Im]))throw new Error(`McpServer is missing the internal '${Im}' property. This adapter was validated against @modelcontextprotocol/sdk ${Em}. The installed SDK version may have changed its internals. Update the SDK adapter for the new SDK version.`);return t[Im]}async function DO(e,t){Ho(e);let r=await JH();r!==void 0&&jO(r)!==jO(Em)&&t.warn({installedVersion:r,validatedVersion:Em},`MCP SDK version ${r} differs from validated version ${Em}. The tool bundle system accesses SDK internals \u2014 verify compatibility and update the validated SDK version constant in the SDK adapter.`)}var GH={content_policy:" Try rephrasing your prompt.",auth_error:" Check your API key in Foundry module settings.",quota_exceeded:" Check your billing at the provider dashboard.",rate_limit:" Wait a moment and try again.",FOUNDRY_DISCONNECTED:" Ensure Foundry VTT is running and the Familiar module is enabled.",QUERY_TIMEOUT:" The Foundry module took too long to respond. Try a simpler query.",QUERY_OVERLOADED:" Too many concurrent requests. Wait a moment and try again.",SEND_FAILED:" Connection to Foundry was lost. Check the connection.",RATE_LIMITED:" Too many requests. Wait a moment before trying again.",NOT_FOUND:" The requested entity was not found in the game world.",INVALID_INPUT:" Check the tool parameters and try again.",PERMISSION_DENIED:" This action requires GM-level permissions.",LICENSE_INVALID:" Check your Familiar subscription status."};function Wo(e){return e===void 0?"":GH[e]??""}var U={readOnlyHint:!0,openWorldHint:!1},C={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},X={readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1},W={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},Ve={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},mc={readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1};function KH(e,t){if(!Array.isArray(e))return`${JSON.stringify(e).slice(0,512e3)}
96
96
 
97
- [Response truncated \u2014 exceeded 200KB. Use more specific queries or filters.]`;let r=0,i=e.length;for(;r<i;){let n=Math.ceil((r+i)/2);JSON.stringify({truncated:!0,totalItems:e.length,items:e.slice(0,n)}).length<=204800?r=n:i=n-1}return JSON.stringify({truncated:!0,totalItems:e.length,items:e.slice(0,Math.max(1,r))})}function y(e){if(e.success){let s=JSON.stringify(e.result);return s.length<=204800?{content:[{type:"text",text:s}]}:{content:[{type:"text",text:PH(e.result,s.length)}]}}let t=Yt(e.error),r=Rr(e.error),i=Ho(r),o=PE(e.error)===!0?" (retryable)":"";return{content:[{type:"text",text:`${r!==void 0&&r!==""?`Error [${r}]${o}`:"Error"}: ${t}${i}`}],isError:!0}}var Tm=class{constructor(t){this.server=t}bundles=new Map;enabledBundles=new Set;toolRegistry={};initialize(t,r=!1){this.toolRegistry=Bo(this.server);for(let n of z_){let o=t.get(n.id)??[],a={...n,toolNames:o};if(this.bundles.set(n.id,a),r||P_.has(n.id))this.enabledBundles.add(n.id);else for(let s of o)this.toolRegistry[s]?.disable()}let i=[...this.enabledBundles].reduce((n,o)=>n+(this.bundles.get(o)?.toolNames.length??0),0);I.info({coreBundles:[...this.enabledBundles],coreToolCount:i,totalBundles:this.bundles.size},r?"Tool bundles initialized (all enabled for HTTP)":"Tool bundles initialized (lazy loading enabled)")}enableBundle(t){let r=this.bundles.get(t);if(!r)return{enabled:!1,toolNames:[],error:`Unknown bundle: ${t}`};if(this.enabledBundles.has(t))return{enabled:!0,toolNames:r.toolNames,error:"Bundle already enabled"};for(let i of r.toolNames)this.toolRegistry[i]?.enable();return this.enabledBundles.add(t),I.info({bundleId:t,toolCount:r.toolNames.length},"Tool bundle enabled"),{enabled:!0,toolNames:r.toolNames}}disableBundle(t){let r=this.bundles.get(t);if(!r)return{disabled:!1,toolNames:[],error:`Unknown bundle: ${t}`};if(P_.has(t))return{disabled:!1,toolNames:r.toolNames,error:`Core bundle "${t}" cannot be disabled`};if(!this.enabledBundles.has(t))return{disabled:!0,toolNames:r.toolNames};for(let i of r.toolNames)this.toolRegistry[i]?.disable();return this.enabledBundles.delete(t),I.info({bundleId:t,toolCount:r.toolNames.length},"Tool bundle disabled"),{disabled:!0,toolNames:r.toolNames}}listBundles(){return z_.map(t=>{let r=this.bundles.get(t.id);return{id:t.id,name:t.name,description:t.description,toolCount:r?r.toolNames.length:t.toolCount,enabled:this.enabledBundles.has(t.id)}})}isEnabled(t){return this.enabledBundles.has(t)}};function bO(e,t,r){zH(e,t),RH(e,t,r)}function zH(e,t){e.registerTool("list-tool-bundles",{description:"List available tool bundles. Tools are organized into domain bundles that can be enabled on demand. Core bundles (dice, world, chat, combat, characters) are always enabled. Enable additional bundles with enable-tool-bundle when you need their capabilities.",annotations:q},()=>({content:[{type:"text",text:JSON.stringify(t.listBundles())}]})),e.registerTool("enable-tool-bundle",{description:"Enable a tool bundle to access its tools. Call list-tool-bundles first to see available bundles. You can enable multiple bundles. Once enabled, the tools become available for use.",annotations:W,inputSchema:{bundleId:c.string().describe('Bundle ID to enable (e.g., "scenes", "compendium", "playlists")')}},({bundleId:r})=>{let i=t.enableBundle(r);return{content:[{type:"text",text:JSON.stringify(i)}],...i.enabled?{}:{isError:!0}}}),e.registerTool("disable-tool-bundle",{description:"Disable a previously enabled tool bundle to reduce active tool count. Core bundles (dice, world, chat, combat, characters) cannot be disabled. Call list-tool-bundles to see which bundles are currently enabled.",annotations:C,inputSchema:{bundleId:c.string().describe('Bundle ID to disable (e.g., "scenes", "compendium", "playlists")')}},({bundleId:r})=>{let i=t.disableBundle(r);return{content:[{type:"text",text:JSON.stringify(i)}],...i.disabled?{}:{isError:!0}}})}function RH(e,t,r){e.registerTool("get-server-diagnostics",{description:"Get Familiar server diagnostics: tool call metrics (counts, durations, errors) and bundle status. Use for troubleshooting performance or checking which bundles are active.",annotations:q},()=>({content:[{type:"text",text:JSON.stringify({bundles:t.listBundles(),metrics:r?.getSummary()??null})}]}))}var pc=[{name:"get-character",description:"Get a character's full stat block. Returns ability scores, HP, AC, skills, saves, items, spells, features, and biography. For a quick overview of all characters, use list-characters instead. Accepts character name (exact match) or Foundry actor ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID")})},{name:"list-characters",description:"List actors in the world with summary info (name, type, HP, AC, level). Returns a paginated list without full stat blocks. Filter by type: 'character' for PCs, 'npc' for NPCs, or 'all'. Response includes total count and hasMore flag. For full details on one character, use get-character instead.",inputSchema:c.object({type:c.enum(["all","character","npc"]).optional().describe("Filter by actor type (default: all)"),limit:c.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"list-party-members",description:"Get all player-owned characters (the adventuring party). Returns a lightweight summary (name, HP, AC, level) by default. Set detailed:true for full character sheets including abilities, items, and effects. Use to quickly see party composition without listing all NPCs.",inputSchema:c.object({detailed:c.boolean().optional().describe("Return full character sheets instead of summaries (default: false)")})},{name:"update-character",description:'Update character data using Foundry dot-notation paths (e.g., {"system.attributes.hp.value": 25}). Use get-character first to see current values and valid paths. Accepts character name (exact match) or Foundry actor ID. Returns the updated actor name and ID.',inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),updates:c.record(c.string(),c.unknown()).describe('Foundry update data (e.g., {"system.attributes.hp.value": 25})')})},{name:"search-character-items",description:"Search a character's inventory, spells, and features. Returns a compact list of matching items (max 50) with IDs, names, and types. Use to find an item before calling get-character-item for full details. Filter by name substring, item type, or both.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),query:c.string().max(256).optional().describe('Filter by name substring (e.g., "sword", "fire")'),type:c.enum(["weapon","spell","feat","equipment","consumable","tool","loot","class","subclass","background","race"]).optional().describe("Filter by item type")})},{name:"get-character-item",description:"Get full details of a specific item, spell, or feature on a character. Returns description, properties, damage, range, and all game mechanics. Use the item ID from search-character-items results.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),itemId:c.string().max(256).describe("Item ID (from search-character-items results)")})},{name:"import-compendium-to-character",description:"Import an item or spell from a compendium pack onto a character's sheet. Copies the compendium entry as a new owned item. Use search-compendium (compendium bundle) first to find the pack key and entry ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),pack:c.string().max(256).describe('Compendium pack key (e.g., "dnd5e.spells")'),entryId:c.string().max(256).describe("Entry ID from search-compendium results")})},{name:"delete-character-items",description:"Remove items, spells, or features from a character permanently. Accepts item names or Foundry document IDs. This is destructive and irreversible. Returns the actor name, count of deleted items, and their IDs.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),itemIds:c.array(c.string().max(256)).min(1).max(100).describe("Item names or Foundry document IDs to remove")})},{name:"rename-character",description:"Rename an actor and update its prototype token name to match. Returns the updated name. Accepts character name (exact match) or Foundry actor ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),name:c.string().max(256).describe("New name for the character")})},{name:"create-character",description:"Create a new blank character (NPC or PC) from scratch. Returns the new actor's ID. For creating variants of existing characters, use duplicate-character instead. To import a compendium creature, use the compendium bundle.",inputSchema:c.object({name:c.string().max(256).describe("Character name"),type:c.enum(["character","npc"]).optional().describe("Character type (default: npc)"),system:c.record(c.string(),c.unknown()).optional().describe("System data (e.g., ability scores, HP)"),img:c.string().max(256).optional().describe("Token/portrait image path"),folderId:c.string().max(256).optional().describe("Folder name or ID")})},{name:"delete-character",description:"Delete a character from the world permanently. Removes the actor and all its owned items, spells, and features. This is irreversible. Tokens on scenes will become unlinked. Returns the deleted character name and ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID")})},{name:"duplicate-character",description:"Clone an existing character to create a copy with all items, spells, and features. Returns the new actor's ID. Use for creating NPC variants (e.g., 'Goblin Archer' from 'Goblin'). For creating characters from scratch, use create-character instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID to clone"),name:c.string().max(256).optional().describe('Name for the copy (default: "<original> (Copy)")')})},{name:"assign-character-ownership",description:"Give a player ownership or limited access to a character. Permission levels: 0=NONE, 1=LIMITED (basic info), 2=OBSERVER (full view), 3=OWNER (full control). Use OWNER (3) to assign a character to a player. Use list-users to find valid user names/IDs. Returns the character name, user name, and applied permission level.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),user:c.string().max(256).describe("Player name or user ID"),level:c.number().int().min(0).max(3).describe("Permission level: 0=NONE, 1=LIMITED, 2=OBSERVER, 3=OWNER")})},{name:"revoke-character-ownership",description:"Remove a player's access to a character by setting their permission to NONE. The character becomes invisible to that player unless default permissions allow it. Use list-users to find valid user names/IDs. Returns the character and user names.",inputSchema:c.object({identifier:c.string().max(256).describe("Character name or Foundry actor ID"),user:c.string().max(256).describe("Player name or user ID")})}];var O_=pc[12],j_=pc[13];function _O(e,t){e.registerTool(O_.name,{description:O_.description,annotations:W,inputSchema:O_.inputSchema.shape},async({identifier:r,user:i,level:n})=>y(await t.query("assign-character-ownership",{identifier:r,userIdentifier:i,level:n}))),e.registerTool(j_.name,{description:j_.description,annotations:W,inputSchema:j_.inputSchema.shape},async({identifier:r,user:i})=>y(await t.query("revoke-character-ownership",{identifier:r,userIdentifier:i})))}var[D_,N_,C_,A_,M_,U_,L_,q_,Z_,F_,V_,B_]=pc;function OH(e,t){e.registerTool(D_.name,{description:D_.description,annotations:q,inputSchema:D_.inputSchema.shape},async({identifier:r})=>y(await t.query("get-character",{identifier:r}))),e.registerTool(N_.name,{description:N_.description,annotations:q,inputSchema:N_.inputSchema.shape},async({type:r,limit:i,offset:n})=>y(await t.query("list-characters",{type:r,limit:i,offset:n}))),e.registerTool(C_.name,{description:C_.description,annotations:q,inputSchema:C_.inputSchema.shape},async({detailed:r})=>y(await t.query("list-party-members",{detailed:r})))}function jH(e,t){e.registerTool(M_.name,{description:M_.description,annotations:q,inputSchema:M_.inputSchema.shape},async({identifier:r,query:i,type:n})=>y(await t.query("search-character-items",{identifier:r,query:i,type:n}))),e.registerTool(U_.name,{description:U_.description,annotations:q,inputSchema:U_.inputSchema.shape},async({identifier:r,itemId:i})=>y(await t.query("get-character-item",{identifier:r,itemId:i})))}function DH(e,t){e.registerTool(L_.name,{description:L_.description,annotations:C,inputSchema:L_.inputSchema.shape},async({identifier:r,pack:i,entryId:n})=>y(await t.query("import-compendium-to-character",{identifier:r,pack:i,entryId:n}))),e.registerTool(q_.name,{description:q_.description,annotations:X,inputSchema:q_.inputSchema.shape},async({identifier:r,itemIds:i})=>y(await t.query("delete-character-items",{identifier:r,itemIds:i})))}function NH(e,t){jH(e,t),DH(e,t)}function CH(e,t){e.registerTool(A_.name,{description:A_.description,annotations:W,inputSchema:A_.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-character",{identifier:r,updates:i}))),e.registerTool(Z_.name,{description:Z_.description,annotations:W,inputSchema:Z_.inputSchema.shape},async({identifier:r,name:i})=>y(await t.query("rename-character",{identifier:r,name:i})))}function AH(e,t){e.registerTool(F_.name,{description:F_.description,annotations:C,inputSchema:F_.inputSchema.shape},async({name:r,type:i,system:n,img:o,folderId:a})=>y(await t.query("create-character",{name:r,type:i,system:n,img:o,folderId:a}))),e.registerTool(V_.name,{description:V_.description,annotations:X,inputSchema:V_.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-character",{identifier:r}))),e.registerTool(B_.name,{description:B_.description,annotations:C,inputSchema:B_.inputSchema.shape},async({identifier:r,name:i})=>y(await t.query("duplicate-character",{identifier:r,name:i})))}function MH(e,t){CH(e,t),AH(e,t),_O(e,t)}function SO(e,t){OH(e,t),NH(e,t),MH(e,t)}var xO=[{name:"toggle-condition",description:"Toggle a status condition on a token (e.g., prone, poisoned, blinded). Adds the condition if absent, removes it if present. Use get-available-conditions first to see valid condition names. Returns the token name and toggled condition.",inputSchema:c.object({identifier:c.string().max(256).describe("Token name or ID"),condition:c.string().max(256).describe('Condition name (e.g., "prone", "poisoned", "blinded")')})},{name:"apply-condition-to-group",description:"Toggle a status condition on multiple tokens at once. Adds the condition if absent, removes it if present (per token). Use for AoE effects like mass Prone, Frightened, or Poisoned. Use get-available-conditions first to see valid condition names. Returns per-token toggle results.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(50).describe("Token names or IDs to apply the condition to"),condition:c.string().max(256).describe('Condition name (e.g., "prone", "poisoned", "frightened")')})},{name:"start-combat",description:"Create a new combat encounter and add combatants from the current scene. If no identifiers are provided, all tokens on the active scene are added automatically. Returns the combat tracker with all added combatants. After starting, use roll-initiative to set turn order.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).max(100).describe("Token names or Foundry IDs to add as combatants. Omit to add all tokens on the current scene.").optional()})},{name:"end-combat",description:"End the current combat encounter. Removes all combatants from the tracker and resets initiative order. Use when a fight ends or to clean up before starting a new encounter. Combat data (rounds, turns) is lost \u2014 check get-combat first if you need to record results."},{name:"get-combat",description:"Get the current combat tracker state. Returns round number, active turn, and all combatants with initiative order, HP, AC, and conditions. For a richer snapshot with positions and abilities for AI decision-making, use get-combat-snapshot (combat-ai bundle) instead."},{name:"roll-initiative",description:"Roll initiative for combatants in the active encounter. Returns rolled values and updated turn order. Omit combatantIds to roll for all combatants. For rolling only NPCs (letting players roll their own), use roll-npc-initiative instead.",inputSchema:c.object({combatantIds:c.array(c.string().max(256)).max(50).optional().describe("Specific combatant IDs to roll for (omit to roll for all)")})},{name:"roll-npc-initiative",description:"Roll initiative for all NPC combatants only, skipping player characters. Returns rolled values and updated turn order. Use when players prefer to roll their own initiative. For rolling everyone at once, use roll-initiative instead."},{name:"next-turn",description:"Advance combat to the next combatant's turn. Returns the new active combatant. If combat hasn't started yet, this begins the first turn. Automatically wraps to the next round after the last combatant."},{name:"next-round",description:"Advance combat to the next round, resetting to the top of initiative order. Returns the new round number and active combatant. Use to skip remaining turns in the current round."},{name:"get-available-conditions",description:"List all status conditions available in the game system (e.g., prone, poisoned, blinded, stunned). Returns every condition (no pagination) with ID and label. Named get-* rather than list-* because conditions are static system data, not user-created documents. Use to find valid condition IDs before applying them with toggle-condition or apply-condition-to-group."},{name:"apply-damage",description:"Apply damage to multiple targets in a single batch. Handles temp HP absorption automatically. Returns per-target results with HP before/after. Use during combat to resolve AoE effects, multi-attack actions, or lair actions that hit several creatures at once.",inputSchema:c.object({targets:c.array(c.object({identifier:c.string().max(256).describe("Token name or ID on the active scene"),amount:c.number().min(0).describe("Damage amount to apply"),type:c.string().max(256).optional().describe('Damage type (e.g., "fire", "slashing") \u2014 informational only')})).min(1).max(50).describe("Array of damage targets")})},{name:"heal-party",description:"Heal all party members or a specific character. Healing is capped at max HP. Omit identifier to heal the entire party. Use after combat, during a rest, or when applying healing spells/potions to multiple characters.",inputSchema:c.object({amount:c.number().min(1).describe("Amount of HP to restore"),identifier:c.string().max(256).optional().describe("Character name or actor ID (omit to heal all party members)")})},{name:"rest-party",description:"Apply short or long rest to all party members. Long rest: restores full HP, resets all resources, and restores spell slots. Short rest: allows hit dice recovery and resets short-rest resources. Triggers rest dialogs in chat. Returns per-character results with success/failure and HP recovery details.",inputSchema:c.object({type:c.enum(["short","long"]).describe('Rest type: "short" or "long"')})}];var[H_,W_,J_,wO,$O,G_,kO,TO,IO,EO,K_,Q_,Y_]=xO;function UH(e,t){e.registerTool(H_.name,{description:H_.description,annotations:C,inputSchema:H_.inputSchema.shape},async({identifier:r,condition:i})=>y(await t.query("toggle-condition",{identifier:r,condition:i}))),e.registerTool(W_.name,{description:W_.description,annotations:C,inputSchema:W_.inputSchema.shape},async({identifiers:r,condition:i})=>y(await t.query("apply-condition-to-group",{identifiers:r,condition:i})))}function LH(e,t){e.registerTool(J_.name,{description:J_.description,annotations:C,inputSchema:J_.inputSchema.shape},async({identifiers:r})=>y(await t.query("start-combat",{identifiers:r}))),e.registerTool(wO.name,{description:wO.description,annotations:km},async()=>y(await t.query("end-combat"))),e.registerTool($O.name,{description:$O.description,annotations:q},async()=>y(await t.query("get-combat"))),e.registerTool(G_.name,{description:G_.description,annotations:C,inputSchema:G_.inputSchema.shape},async({combatantIds:r})=>y(await t.query("roll-initiative",{combatantIds:r}))),e.registerTool(kO.name,{description:kO.description,annotations:C},async()=>y(await t.query("roll-npc-initiative")))}function qH(e,t){e.registerTool(TO.name,{description:TO.description,annotations:C},async()=>y(await t.query("next-turn"))),e.registerTool(IO.name,{description:IO.description,annotations:C},async()=>y(await t.query("next-round"))),e.registerTool(EO.name,{description:EO.description,annotations:q},async()=>y(await t.query("get-available-conditions")))}function ZH(e,t){LH(e,t),qH(e,t)}function FH(e,t){e.registerTool(K_.name,{description:K_.description,annotations:C,inputSchema:K_.inputSchema.shape},async({targets:r})=>y(await t.query("apply-damage",{targets:r}))),e.registerTool(Q_.name,{description:Q_.description,annotations:C,inputSchema:Q_.inputSchema.shape},async({amount:r,identifier:i})=>y(await t.query("heal-party",{amount:r,identifier:i}))),e.registerTool(Y_.name,{description:Y_.description,annotations:C,inputSchema:Y_.inputSchema.shape},async({type:r})=>y(await t.query("rest-party",{type:r})))}function PO(e,t){UH(e,t),ZH(e,t),FH(e,t)}var zO=[{name:"get-combat-snapshot",description:"Get a comprehensive combat snapshot for AI decision-making. Returns the current combatant's full stat block, all combatants with HP/AC/conditions, battlefield token positions with distances, and available weapons/spells/features. Designed to give an AI everything needed to decide an NPC's turn in a single call."},{name:"resolve-attack",description:"Resolve an NPC weapon attack against a target. Rolls the attack (with optional advantage/disadvantage), compares against target AC, rolls damage on hit (doubled dice on critical), applies damage to the target, and posts the result to chat.",inputSchema:c.object({attacker:c.string().max(256).describe("Name or Foundry token ID of the attacking NPC"),target:c.string().max(256).describe("Name or Foundry token ID of the target"),weapon:c.string().max(256).describe("Weapon name or item ID on the attacker"),advantage:c.boolean().optional().describe("Roll with advantage (2d20 keep highest)"),disadvantage:c.boolean().optional().describe("Roll with disadvantage (2d20 keep lowest)")})},{name:"resolve-movement",description:"Move a token to a new position on the battlefield during combat. Coordinates are in pixels (from scene top-left). Calculates distance moved in game units (feet), compares against the actor's walk speed, updates the token position, and reports movement remaining. Use this during combat turns instead of move-token \u2014 it enforces movement speed limits.",inputSchema:c.object({identifier:c.string().max(256).describe("Token name or Foundry ID to move"),x:c.number().describe("Target X position in pixels (from scene top-left)"),y:c.number().describe("Target Y position in pixels (from scene top-left)")})},{name:"resolve-spell",description:"Cast a spell from an NPC. Consumes a spell slot (if not a cantrip), resolves spell attacks or saving throws per target, rolls and applies damage, handles concentration, and posts results to chat.",inputSchema:c.object({caster:c.string().max(256).describe("Name or Foundry token ID of the caster"),spell:c.string().max(256).describe("Spell name or item ID on the caster"),targets:c.array(c.string().max(256)).max(50).describe("Token names or Foundry IDs of the targets"),upcastLevel:c.number().int().min(1).max(9).optional().describe("Cast at a higher spell level (upcasting)")})},{name:"resolve-saving-throw",description:"Force a saving throw on a target. Rolls d20 + save modifier against a DC and reports success or failure.",inputSchema:c.object({target:c.string().max(256).describe("Name or Foundry token ID of the target"),ability:c.string().max(256).describe("Ability for the save (str, dex, con, int, wis, cha)"),dc:c.number().int().min(1).describe("Difficulty class for the saving throw")})},{name:"resolve-death-save",description:"Resolve a death saving throw for a target at 0 HP. Rolls 1d20: natural 20 revives with 1 HP, natural 1 counts as two failures, >= 10 is a success, < 10 is a failure. 3 successes stabilize, 3 failures kill.",inputSchema:c.object({target:c.string().max(256).describe("Name or Foundry token ID of the target at 0 HP")})}];var[RO,X_,eS,tS,rS,nS]=zO;function VH(e,t){e.registerTool(RO.name,{description:RO.description,annotations:q},async()=>y(await t.query("get-combat-snapshot"))),e.registerTool(X_.name,{description:X_.description,annotations:C,inputSchema:X_.inputSchema.shape},async({attacker:r,target:i,weapon:n,advantage:o,disadvantage:a})=>y(await t.query("resolve-attack",{attacker:r,target:i,weapon:n,advantage:o,disadvantage:a}))),e.registerTool(eS.name,{description:eS.description,annotations:C,inputSchema:eS.inputSchema.shape},async({identifier:r,x:i,y:n})=>y(await t.query("resolve-movement",{identifier:r,x:i,y:n})))}function BH(e,t){e.registerTool(tS.name,{description:tS.description,annotations:C,inputSchema:tS.inputSchema.shape},async({caster:r,spell:i,targets:n,upcastLevel:o})=>y(await t.query("resolve-spell",{caster:r,spell:i,targets:n,upcastLevel:o}))),e.registerTool(rS.name,{description:rS.description,annotations:C,inputSchema:rS.inputSchema.shape},async({target:r,ability:i,dc:n})=>y(await t.query("resolve-saving-throw",{target:r,ability:i,dc:n}))),e.registerTool(nS.name,{description:nS.description,annotations:C,inputSchema:nS.inputSchema.shape},async({target:r})=>y(await t.query("resolve-death-save",{target:r})))}function OO(e,t){VH(e,t),BH(e,t)}var jO=[{name:"search-compendium",description:"Search compendium packs for items, creatures, spells, or journal entries by name. Returns matching entries with names, pack keys, and IDs. For Actor packs, supports filtering by CR, creature type (beast/undead/fiend/etc.), and size. Use get-compendium-entry to read full stat blocks or descriptions of a result.",inputSchema:c.object({query:c.string().max(256).describe('Search term (e.g., "fireball", "goblin", "longsword")'),type:c.string().max(256).optional().describe('Filter by pack type: "Actor", "Item", "JournalEntry", etc.'),cr:c.number().min(0).optional().describe("Filter creatures by Challenge Rating (e.g., 0.25, 1, 5)"),creatureType:c.string().max(256).optional().describe('Filter creatures by type (e.g., "beast", "undead", "fiend")'),size:c.enum(["tiny","sm","med","lg","huge","grg"]).optional().describe("Filter creatures by size")})},{name:"get-compendium-entry",description:"Get full details of a compendium entry. Returns complete stat blocks for creatures, spell descriptions with mechanics, or item properties. Use the pack key and ID from search-compendium results.",inputSchema:c.object({pack:c.string().max(256).describe('Pack collection key (e.g., "dnd5e.monsters")'),entryId:c.string().max(256).describe("Entry ID from search results")})},{name:"list-compendium-packs",description:"List all available compendium packs. Returns each pack's ID (collection key, e.g., 'dnd5e.spells'), document type (Actor, Item, JournalEntry, Scene, etc.), human-readable label, and entry count. Use the returned pack IDs with search-compendium and get-compendium-entry to find and retrieve specific entries."},{name:"create-character-from-compendium",description:"Import a creature or NPC from a compendium pack into the world as a new actor with its full stat block, items, spells, and features. Returns the new actor ID. Use search-compendium first to find the pack key and entry ID. For creating a blank character from scratch, use create-character (characters bundle) instead.",inputSchema:c.object({pack:c.string().max(256).describe('Pack collection key (e.g., "dnd5e.monsters")'),entryId:c.string().max(256).describe("Entry ID from search results"),name:c.string().max(256).optional().describe('Override actor name (e.g., "Goblin Archer")')})}];var[iS,oS,DO,aS]=jO;function NO(e,t){e.registerTool(iS.name,{description:iS.description,annotations:q,inputSchema:iS.inputSchema.shape},async({query:r,type:i,cr:n,creatureType:o,size:a})=>y(await t.query("search-compendium",{query:r,type:i,cr:n,creatureType:o,size:a}))),e.registerTool(oS.name,{description:oS.description,annotations:q,inputSchema:oS.inputSchema.shape},async({pack:r,entryId:i})=>y(await t.query("get-compendium-entry",{pack:r,entryId:i}))),e.registerTool(DO.name,{description:DO.description,annotations:q},async()=>y(await t.query("list-compendium-packs"))),e.registerTool(aS.name,{description:aS.description,annotations:C,inputSchema:aS.inputSchema.shape},async({pack:r,entryId:i,name:n})=>y(await t.query("create-character-from-compendium",{pack:r,entryId:i,name:n})))}var CO=[{name:"roll-dice",description:"Roll a dice formula and return the numeric result. Supports standard notation (1d20+5, 2d6+3) and advanced syntax (4d6kh3 keep highest, 2d20kl1 keep lowest). Result is posted to Foundry chat by default. For attack rolls or spell damage during combat, prefer resolve-attack or resolve-spell (combat-ai bundle) instead.",inputSchema:c.object({formula:c.string().max(256).describe('Dice formula (e.g., "1d20+5", "2d6+3", "4d6kh3")'),showInChat:c.boolean().optional().describe("Show the roll result in Foundry chat (default: true)")})}];function AO(e,t){let[r]=CO;e.registerTool(r.name,{description:r.description,annotations:C,inputSchema:r.inputSchema.shape},async({formula:i,showInChat:n})=>y(await t.query("roll-dice",{formula:i,showInChat:n})))}var MO=[{name:"list-journals",description:"List journal entries in the world with pagination. Returns each entry's name, ID, page count with page names/IDs, and folder path. Response includes total count and hasMore flag. Filter by folder name for organized worlds. For searching journal content, use search-journals instead.",inputSchema:c.object({folder:c.string().max(256).optional().describe("Filter by folder name (substring match)"),limit:c.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-journals",description:"Search journal entries by title and page content text. Returns matching entries with names, IDs, and text snippets showing where the search term appears. Use to find specific lore, notes, or session records. For browsing all journals, use list-journals instead.",inputSchema:c.object({query:c.string().max(256).describe("Search term to find in journal titles and page content")})},{name:"get-journal",description:"Get a full journal entry with all page content rendered as plain text (HTML stripped). Returns the entry name and all pages with their names, IDs, types, and full content. For reading a single page, use get-journal-page instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Journal entry name or Foundry ID")})},{name:"get-journal-page",description:"Get a single page from a journal entry with full content. Use the page ID from list-journals or get-journal results. For reading all pages at once, use get-journal instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Journal entry name or Foundry ID"),pageId:c.string().max(256).describe("Page ID (from list-journals or get-journal results)")})},{name:"create-journal",description:"Create a new journal entry, optionally with initial pages of content. Returns the new journal ID and page IDs. Pages support HTML formatting. Use for session notes, lore, NPC details, handouts, or quest tracking.",inputSchema:c.object({name:c.string().max(256).describe("Journal entry name"),folderId:c.string().max(256).optional().describe("Folder name or ID to place the journal in"),pages:c.array(c.object({name:c.string().max(256),content:c.string().max(5e4)})).max(100).optional().describe("Initial pages to create (each with name and HTML/text content)")})},{name:"create-journal-page",description:"Add a new page to an existing journal entry. Returns the new page ID. Supports text (HTML or plain text), image, video, and PDF page types. Default type is text.",inputSchema:c.object({identifier:c.string().max(256).describe("Journal entry name or Foundry ID"),name:c.string().max(256).describe("Page name"),content:c.string().max(5e4).describe("Page content (HTML or plain text)"),type:c.enum(["text","image","video","pdf"]).optional().describe("Page type (default: text)")})},{name:"update-journal",description:"Update a journal entry's properties. Rename it, move it to a different folder, or change ownership. For updating page content, use update-journal-page instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Journal entry name or Foundry ID"),name:c.string().max(256).optional().describe("New journal entry name"),folderId:c.string().max(256).optional().describe("Folder name or ID to move the journal to"),ownership:c.record(c.string(),c.number().int().min(-1).max(3)).optional().describe('Ownership levels by user ID or "default" (0=None, 1=Limited, 2=Observer, 3=Owner)')})},{name:"update-journal-page",description:"Replace the content of an existing journal page. Accepts HTML or plain text. Use get-journal first to read the current content before overwriting.",inputSchema:c.object({identifier:c.string().max(256).describe("Journal entry name or Foundry ID"),pageId:c.string().max(256).describe("Page ID (from get-journal results)"),content:c.string().max(5e4).describe("New page content (HTML or plain text)")})},{name:"delete-journal",description:"Delete a journal entry and all its pages permanently. This is irreversible. Map pins linked to this journal will lose their link. Returns the deleted journal name and ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Journal entry name or Foundry ID")})},{name:"delete-journal-page",description:"Delete a single page from a journal entry. The journal entry itself and other pages are preserved. This is irreversible. Returns the journal name and deleted page ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Journal entry name or Foundry ID"),pageId:c.string().max(256).describe("Page ID to delete")})}];var[sS,cS,lS,uS,dS,pS,mS,fS,hS,gS]=MO;function HH(e,t){e.registerTool(sS.name,{description:sS.description,annotations:q,inputSchema:sS.inputSchema.shape},async({folder:r,limit:i,offset:n})=>y(await t.query("list-journals",{folder:r,limit:i,offset:n}))),e.registerTool(cS.name,{description:cS.description,annotations:q,inputSchema:cS.inputSchema.shape},async({query:r})=>y(await t.query("search-journals",{query:r}))),e.registerTool(lS.name,{description:lS.description,annotations:q,inputSchema:lS.inputSchema.shape},async({identifier:r})=>y(await t.query("get-journal",{identifier:r}))),e.registerTool(uS.name,{description:uS.description,annotations:q,inputSchema:uS.inputSchema.shape},async({identifier:r,pageId:i})=>y(await t.query("get-journal-page",{identifier:r,pageId:i})))}function WH(e,t){e.registerTool(dS.name,{description:dS.description,annotations:C,inputSchema:dS.inputSchema.shape},async({name:r,folderId:i,pages:n})=>y(await t.query("create-journal",{name:r,folderId:i,pages:n}))),e.registerTool(pS.name,{description:pS.description,annotations:C,inputSchema:pS.inputSchema.shape},async({identifier:r,name:i,content:n,type:o})=>y(await t.query("create-journal-page",{identifier:r,name:i,content:n,type:o}))),e.registerTool(mS.name,{description:mS.description,annotations:W,inputSchema:mS.inputSchema.shape},async({identifier:r,name:i,folderId:n,ownership:o})=>{let a={};return i!==void 0&&(a.name=i),n!==void 0&&(a.folderId=n),o!==void 0&&(a.ownership=o),y(await t.query("update-journal",{identifier:r,updates:a}))}),e.registerTool(fS.name,{description:fS.description,annotations:W,inputSchema:fS.inputSchema.shape},async({identifier:r,pageId:i,content:n})=>y(await t.query("update-journal-page",{identifier:r,pageId:i,content:n}))),e.registerTool(hS.name,{description:hS.description,annotations:X,inputSchema:hS.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-journal",{identifier:r}))),e.registerTool(gS.name,{description:gS.description,annotations:X,inputSchema:gS.inputSchema.shape},async({identifier:r,pageId:i})=>y(await t.query("delete-journal-page",{identifier:r,pageId:i})))}function UO(e,t){HH(e,t),WH(e,t)}var LO=[{name:"move-token",description:"Move a token to x,y pixel coordinates on the current scene. Use for general repositioning outside of combat. During combat turns, use resolve-movement (combat-ai bundle) instead \u2014 it tracks movement speed and remaining distance.",inputSchema:c.object({identifier:c.string().max(256).describe("Token name or ID"),x:c.number().min(-5e4).max(5e4).describe("Target X position in pixels (from scene top-left)"),y:c.number().min(-5e4).max(5e4).describe("Target Y position in pixels (from scene top-left)")})},{name:"update-token",description:"Update token visual properties on the current scene. Supports hidden, elevation, size, rotation, and disposition. For moving a token to new coordinates, use move-token instead. For applying status conditions, use toggle-condition.",inputSchema:c.object({identifier:c.string().max(256).describe("Token name or ID"),hidden:c.boolean().optional().describe("Hide/show the token"),elevation:c.number().optional().describe("Token elevation in feet"),width:c.number().min(.5).optional().describe("Token width in grid units"),height:c.number().min(.5).optional().describe("Token height in grid units"),rotation:c.number().min(0).max(360).optional().describe("Token rotation in degrees (0-360)"),disposition:c.number().int().min(-2).max(1).optional().describe("Token disposition: -2=secret, -1=hostile, 0=neutral, 1=friendly")})},{name:"update-tokens",description:"Batch update properties on multiple tokens at once. Supports hidden, elevation, size, rotation, and disposition. Returns per-token results. Use to hide/reveal a group of tokens, change dispositions for multiple NPCs, or adjust elevation for a flying group.",inputSchema:c.object({updates:c.array(c.object({identifier:c.string().max(256).describe("Token name or ID"),hidden:c.boolean().optional().describe("Hide/show the token"),elevation:c.number().optional().describe("Token elevation in feet"),width:c.number().min(.5).optional().describe("Token width in grid units"),height:c.number().min(.5).optional().describe("Token height in grid units"),rotation:c.number().min(0).max(360).optional().describe("Token rotation in degrees (0-360)"),disposition:c.number().int().min(-2).max(1).optional().describe("Token disposition: -2=secret, -1=hostile, 0=neutral, 1=friendly")})).min(1).max(100).describe("Array of token updates")})},{name:"create-tokens",description:"Place one or more tokens on the active scene from world actors. Supports batch placement for encounter setup. Returns the created token IDs. Use start-combat afterward to begin a combat encounter with the placed tokens.",inputSchema:c.object({tokens:c.array(c.object({actorId:c.string().max(256).describe("World actor ID"),x:c.number().min(-5e4).max(5e4).describe("X position in pixels (from scene top-left)"),y:c.number().min(-5e4).max(5e4).describe("Y position in pixels (from scene top-left)"),hidden:c.boolean().optional().describe("Hidden from players (default: false)"),disposition:c.number().int().min(-2).max(1).optional().describe("-2=secret, -1=hostile, 0=neutral, 1=friendly"),name:c.string().max(256).optional().describe("Override token name")})).max(100).describe("Array of tokens to place")})},{name:"delete-tokens",description:"Remove tokens from the active scene permanently. Accepts token names or IDs. This does not delete the underlying actor \u2014 only the token placement on this scene. Returns the count of deleted tokens, their IDs, and any errors for tokens not found.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Token names or IDs to delete")})}];var qe=[{name:"get-current-scene",description:"Get the active scene with paginated token data. Returns scene name, dimensions (width/height in pixels), grid settings (size, distance), darkness level, and tokens with name, position (x,y in pixels), HP, AC, conditions, and vision range. Token list includes total count and hasMore flag. Use at the start of combat or when you need to understand the current battlefield layout.",inputSchema:c.object({limit:c.number().int().min(1).max(500).optional().describe("Max tokens to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of tokens to skip (default: 0)")})},{name:"get-scene",description:"Get full details of any scene by name or ID, including dimensions, grid settings, darkness level, weather, background image, folder, and paginated token list. Unlike get-current-scene (which only returns the active scene), this works for any scene in the world.",inputSchema:c.object({identifier:c.string().max(256).describe("Scene name or Foundry ID"),limit:c.number().int().min(1).max(500).optional().describe("Max tokens to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of tokens to skip (default: 0)")})},{name:"list-scenes",description:"List scenes in the world with pagination. Returns each scene's name, ID, active/viewed status, and thumbnail. Response includes total count and hasMore flag. Use to find a scene before switching to it with switch-scene.",inputSchema:c.object({limit:c.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-scenes",description:"Search scenes by name. Returns matching scenes with names, IDs, and active status. Use to find a scene when you only know part of the name.",inputSchema:c.object({query:c.string().max(256).describe("Search text to match against scene name")})},{name:"switch-scene",description:"Switch the active scene by name or ID. All players are pulled to the new scene. Returns the new active scene data. Use pan-canvas afterward to focus on a specific area.",inputSchema:c.object({identifier:c.string().max(256).describe("Scene name or ID")})},...LO,{name:"create-scene",description:"Create a new blank scene with configurable dimensions and grid. Returns the new scene ID. The scene is not activated automatically \u2014 use switch-scene to make it active. Default size is 4000\xD73000 pixels with 100px grid squares (5ft per square).",inputSchema:c.object({name:c.string().max(256).describe("Scene name"),width:c.number().min(1).optional().describe("Scene width in pixels (default: 4000)"),height:c.number().min(1).optional().describe("Scene height in pixels (default: 3000)"),gridSize:c.number().min(1).optional().describe("Grid square size in pixels (default: 100)"),gridDistance:c.number().min(1).optional().describe("Grid distance per square in feet (default: 5)"),background:c.string().max(256).optional().describe("Background image path")})},{name:"update-scene",description:"Update scene properties using Foundry dot-notation paths. Supports name, grid, dimensions, background image, navigation visibility, and more. Use get-current-scene first to see current values.",inputSchema:c.object({identifier:c.string().max(256).describe("Scene name or ID"),updates:c.record(c.string(),c.unknown()).describe('Foundry update data (e.g., {"name": "New Name", "navigation": true, "background.src": "path"})')})},{name:"delete-scene",description:"Delete a scene from the world permanently. Removes all tokens, walls, lights, and sounds on the scene. This is irreversible. Returns the deleted scene name and ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Scene name or ID")})},{name:"pan-canvas",description:"Pan and zoom the GM canvas camera to a position. Animates smoothly over the specified duration. Use after switch-scene to focus on a specific area, or to draw attention to a location during gameplay.",inputSchema:c.object({x:c.number().optional().describe("Target X position in pixels (from scene top-left)"),y:c.number().optional().describe("Target Y position in pixels (from scene top-left)"),scale:c.number().min(.1).max(3).optional().describe("Zoom level (0.3=far, 1.0=normal, 2.0=close)"),duration:c.number().min(0).optional().describe("Animation duration in ms (default: 1000)")})},{name:"set-darkness",description:"Set the scene darkness level (0=bright daylight, 0.5=twilight, 1=pitch black). Returns the new darkness value. Use animate:true for smooth day/night transitions. Affects token vision and light source visibility.",inputSchema:c.object({darkness:c.number().min(0).max(1).describe("Darkness level: 0=daylight, 0.5=twilight, 1=full darkness"),animate:c.boolean().optional().describe("Smoothly animate the transition (default: false)")})},{name:"reset-fog",description:"Reset fog of war exploration for the active scene, hiding all previously revealed areas. This is irreversible \u2014 players will need to re-explore. Use when resetting a dungeon or starting a new exploration phase. Returns the scene name."},{name:"get-weather-effects",description:"List all available weather effect IDs that can be applied with set-weather. Returns effect names and IDs. Use to discover valid weather options before applying one."},{name:"set-weather",description:"Set a weather particle effect on the active scene (rain, fog, snow, etc.). Use get-weather-effects to see valid IDs. Pass an empty string to clear the current weather. Only one weather effect can be active at a time.",inputSchema:c.object({effect:c.string().max(256).describe('Weather effect ID (e.g., "rain", "fog", "snow") or empty string to clear')})},{name:"get-screenshot",description:"Capture an annotated JPEG screenshot of the GM's current Foundry VTT canvas view. Tokens are overlaid with numbered colored badges (green=friendly, red=hostile, yellow=neutral). Returns the image and a text legend mapping badge numbers to token name, disposition, HP, and AC. Use to verify token positions, inspect the battlefield, or reference tokens by number in conversation.",inputSchema:c.object({maxWidth:c.number().min(1).max(3840).optional().describe("Max image width in pixels (default: 1280)"),maxHeight:c.number().min(1).max(2160).optional().describe("Max image height in pixels (default: 720)"),quality:c.number().min(.1).max(1).optional().describe("JPEG quality 0.1-1.0 (default: 0.80)"),annotate:c.boolean().optional().describe("Overlay numbered token badges with legend (default: true)")})}];var JH=c.object({imageData:c.string(),mimeType:c.string(),width:c.number(),height:c.number(),legend:c.string()}),yS=qe[8],vS=qe[9],bS=qe[13],_S=qe[14],qO=qe[15],ZO=qe[16],SS=qe[17],xS=qe[18];function FO(e,t){e.registerTool(yS.name,{description:yS.description,annotations:C,inputSchema:yS.inputSchema.shape},async({tokens:r})=>y(await t.query("create-tokens",{tokens:r}))),e.registerTool(vS.name,{description:vS.description,annotations:X,inputSchema:vS.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-tokens",{identifiers:r})))}function VO(e,t){e.registerTool(bS.name,{description:bS.description,annotations:W,inputSchema:bS.inputSchema.shape},async({x:r,y:i,scale:n,duration:o})=>y(await t.query("pan-canvas",{x:r,y:i,scale:n,duration:o}))),e.registerTool(_S.name,{description:_S.description,annotations:W,inputSchema:_S.inputSchema.shape},async({darkness:r,animate:i})=>y(await t.query("set-darkness",{darkness:r,animate:i}))),e.registerTool(qO.name,{description:qO.description,annotations:km},async()=>y(await t.query("reset-fog")))}function BO(e,t){e.registerTool(ZO.name,{description:ZO.description,annotations:q},async()=>y(await t.query("get-weather-effects"))),e.registerTool(SS.name,{description:SS.description,annotations:W,inputSchema:SS.inputSchema.shape},async({effect:r})=>y(await t.query("set-weather",{effect:r}))),e.registerTool(xS.name,{description:xS.description,annotations:q,inputSchema:xS.inputSchema.shape},async({maxWidth:r,maxHeight:i,quality:n})=>{let o=await t.query("get-screenshot",{maxWidth:r,maxHeight:i,quality:n});if(!o.success)return{content:[{type:"text",text:`Error: ${Yt(o.error)}`}],isError:!0};let a=JH.safeParse(o.result);return a.success?{content:[{type:"image",data:a.data.imageData,mimeType:a.data.mimeType},{type:"text",text:a.data.legend!==""?a.data.legend:`Screenshot: ${a.data.width}x${a.data.height}`}]}:{content:[{type:"text",text:`Screenshot failed: unexpected response format \u2014 ${a.error.message}`}],isError:!0}})}var wS=qe[0],$S=qe[1],kS=qe[2],TS=qe[3],IS=qe[4],ES=qe[5],PS=qe[6],zS=qe[7],RS=qe[10],OS=qe[11],jS=qe[12];function GH(e,t){e.registerTool(wS.name,{description:wS.description,annotations:q,inputSchema:wS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("get-current-scene",{limit:r,offset:i}))),e.registerTool($S.name,{description:$S.description,annotations:Ze,inputSchema:$S.inputSchema.shape},async({identifier:r,limit:i,offset:n})=>y(await t.query("get-scene",{identifier:r,limit:i,offset:n}))),e.registerTool(kS.name,{description:kS.description,annotations:q,inputSchema:kS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-scenes",{limit:r,offset:i}))),e.registerTool(TS.name,{description:TS.description,annotations:Ze,inputSchema:TS.inputSchema.shape},async({query:r})=>y(await t.query("search-scenes",{query:r}))),e.registerTool(IS.name,{description:IS.description,annotations:W,inputSchema:IS.inputSchema.shape},async({identifier:r})=>y(await t.query("switch-scene",{identifier:r})))}function KH(e,t){e.registerTool(ES.name,{description:ES.description,annotations:W,inputSchema:ES.inputSchema.shape},async({identifier:r,x:i,y:n})=>y(await t.query("move-token",{identifier:r,x:i,y:n})))}function QH(e,t){e.registerTool(PS.name,{description:PS.description,annotations:W,inputSchema:PS.inputSchema.shape},async({identifier:r,...i})=>y(await t.query("update-token",{identifier:r,updates:i}))),e.registerTool(zS.name,{description:zS.description,annotations:C,inputSchema:zS.inputSchema.shape},async({updates:r})=>{let i=r.map(({identifier:n,...o})=>({identifier:n,changes:o}));return y(await t.query("update-tokens",{updates:i}))})}function YH(e,t){KH(e,t),QH(e,t)}function XH(e,t){e.registerTool(RS.name,{description:RS.description,annotations:C,inputSchema:RS.inputSchema.shape},async({name:r,width:i,height:n,gridSize:o,gridDistance:a,background:s})=>y(await t.query("create-scene",{name:r,width:i,height:n,gridSize:o,gridDistance:a,background:s}))),e.registerTool(OS.name,{description:OS.description,annotations:W,inputSchema:OS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-scene",{identifier:r,updates:i}))),e.registerTool(jS.name,{description:jS.description,annotations:X,inputSchema:jS.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-scene",{identifier:r})))}function eW(e,t){VO(e,t),BO(e,t)}function HO(e,t){GH(e,t),YH(e,t),FO(e,t),XH(e,t),eW(e,t)}var WO=[{name:"get-world-info",description:"Get Foundry VTT world metadata. Returns game system, world name, Foundry version, and all connected players with their roles. Use at the start of a session to orient yourself."},{name:"toggle-pause",description:"Pause or unpause the game. Returns the new pause state. Players cannot take actions while the game is paused. Omit the paused parameter to toggle.",inputSchema:c.object({paused:c.boolean().optional().describe("true to pause, false to unpause, omit to toggle")})},{name:"get-time",description:"Get the current in-game date and time. Returns year, month, day, hour, minute, and second in the game world's calendar. Use before advance-time to check the current time and plan time skips."},{name:"advance-time",description:"Advance the in-game clock by a specified duration. Returns the new in-game time. Use for long rests (8 hours), short rests (1 hour), travel montages, or narrative time skips. Specify at least one time unit.",inputSchema:c.object({seconds:c.number().optional().describe("Seconds to advance"),minutes:c.number().optional().describe("Minutes to advance"),hours:c.number().optional().describe("Hours to advance (e.g., 8 for long rest)"),days:c.number().optional().describe("Days to advance")})},{name:"list-users",description:"List all users in the game world. Returns each user's name, ID, role (Gamemaster/Player/Trusted/Assistant/None), online status, assigned character, and color. Use to find valid user names before assign-ownership, revoke-ownership, or send-chat-message with whisperTo."},{name:"get-user",description:"Get detailed information about a specific user. Returns name, ID, role, online status, assigned character, color, and a list of all actors they own. Accepts user name (exact match) or Foundry user ID.",inputSchema:c.object({identifier:c.string().max(256).describe("User name or Foundry user ID")})}];function JO(e,t){let[r,i,n,o,a,s]=WO;e.registerTool(r.name,{description:r.description,annotations:q},async()=>y(await t.query("get-world-info"))),e.registerTool(i.name,{description:i.description,annotations:C,inputSchema:i.inputSchema.shape},async({paused:l})=>y(await t.query("toggle-pause",{paused:l}))),e.registerTool(n.name,{description:n.description,annotations:q},async()=>y(await t.query("get-time"))),e.registerTool(o.name,{description:o.description,annotations:C,inputSchema:o.inputSchema.shape},async({seconds:l,minutes:u,hours:d,days:p})=>y(await t.query("advance-time",{seconds:l,minutes:u,hours:d,days:p}))),e.registerTool(a.name,{description:a.description,annotations:q},async()=>y(await t.query("list-users"))),e.registerTool(s.name,{description:s.description,annotations:q,inputSchema:s.inputSchema.shape},async({identifier:l})=>y(await t.query("get-user",{identifier:l})))}var gi=[{name:"list-tiles",description:"List tiles on the active scene (paginated). Returns each tile's ID, position (x,y in pixels), dimensions (width/height in pixels), image path, opacity, rotation, overhead status, and visibility. Use to find tile IDs before updating or deleting them.",inputSchema:c.object({limit:c.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-tile",description:"Place a tile image on the active scene for decoration, overlays, or roof tiles. Set overhead:true to render above tokens (useful for building roofs that hide interiors). The image file must exist in Foundry data.",inputSchema:c.object({src:c.string().max(256).describe('Image file path (relative to Foundry data, e.g., "tiles/floor.webp")'),x:c.number().describe("X position in pixels (from scene top-left)"),y:c.number().describe("Y position in pixels (from scene top-left)"),width:c.number().min(1).describe("Tile width in pixels"),height:c.number().min(1).describe("Tile height in pixels"),overhead:c.boolean().optional().describe("Render above tokens (default: false)"),hidden:c.boolean().optional().describe("Hidden from players (default: false)"),alpha:c.number().min(0).max(1).optional().describe("Opacity 0-1 (default: 1)"),rotation:c.number().min(0).max(360).optional().describe("Rotation in degrees")})},{name:"update-tile",description:"Update a tile on the scene. Move, resize, change opacity, toggle overhead, or swap the image. Use list-tiles to find the tile ID first.",inputSchema:c.object({identifier:c.string().max(256).describe("Foundry document ID of the tile to update"),updates:c.record(c.string(),c.unknown()).describe("Properties to update (x, y, width, height, alpha, rotation, hidden, overhead, etc.)")})},{name:"delete-tiles",description:"Remove tiles from the active scene permanently. The image files on disk are not deleted. Returns the count of deleted tiles and their IDs.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Tile IDs to delete")})},{name:"list-drawings",description:"List drawings on the active scene (paginated). Returns each drawing's ID, shape type (r=rectangle, e=ellipse, p=polygon, f=freehand), position (x,y in pixels), dimensions, colors, and text content. Use to find drawing IDs before updating or deleting them.",inputSchema:c.object({limit:c.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-drawing",description:"Draw a shape on the canvas for marking areas, annotations, or visual effects. All coordinates and dimensions are in pixels. Supports rectangles (r), ellipses (e), polygons (p), and freehand (f). Add text labels with the text parameter. For spell area markers, prefer create-region instead \u2014 it uses game units (feet) and integrates with the combat system.",inputSchema:c.object({type:c.enum(["r","e","p","f"]).describe("Shape type: r=rectangle, e=ellipse, p=polygon, f=freehand"),x:c.number().describe("X position in pixels (from scene top-left)"),y:c.number().describe("Y position in pixels (from scene top-left)"),width:c.number().min(1).describe("Width in pixels"),height:c.number().min(1).describe("Height in pixels"),strokeColor:c.string().max(256).optional().describe('Stroke hex color (e.g., "#FF0000")'),fillColor:c.string().max(256).optional().describe("Fill hex color"),fillAlpha:c.number().min(0).max(1).optional().describe("Fill opacity 0-1"),strokeWidth:c.number().min(0).optional().describe("Stroke width in pixels"),text:c.string().max(5e4).optional().describe("Text content (for text drawings)"),fontSize:c.number().min(1).optional().describe("Font size in pixels"),textColor:c.string().max(256).optional().describe("Text hex color")})},{name:"update-drawing",description:"Update a drawing on the scene. Move, resize, recolor, or change text content. Use list-drawings to find the drawing ID first.",inputSchema:c.object({identifier:c.string().max(256).describe("Foundry document ID of the drawing to update"),updates:c.record(c.string(),c.unknown()).describe("Properties to update")})},{name:"delete-drawings",description:"Remove drawings from the active scene permanently. Returns the count of deleted drawings and their IDs.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Drawing IDs to delete")})}];var DS=gi[4],NS=gi[5],CS=gi[6],AS=gi[7];function GO(e,t){e.registerTool(DS.name,{description:DS.description,annotations:q,inputSchema:DS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-drawings",{limit:r,offset:i}))),e.registerTool(NS.name,{description:NS.description,annotations:C,inputSchema:NS.inputSchema.shape},async({type:r,x:i,y:n,width:o,height:a,strokeColor:s,fillColor:l,fillAlpha:u,strokeWidth:d,text:p,fontSize:f,textColor:h})=>y(await t.query("create-drawing",{type:r,x:i,y:n,width:o,height:a,strokeColor:s,fillColor:l,fillAlpha:u,strokeWidth:d,text:p,fontSize:f,textColor:h}))),e.registerTool(CS.name,{description:CS.description,annotations:W,inputSchema:CS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-drawing",{identifier:r,updates:i}))),e.registerTool(AS.name,{description:AS.description,annotations:X,inputSchema:AS.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-drawings",{identifiers:r})))}var[MS,US,LS,qS]=gi;function tW(e,t){e.registerTool(MS.name,{description:MS.description,annotations:q,inputSchema:MS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-tiles",{limit:r,offset:i}))),e.registerTool(US.name,{description:US.description,annotations:C,inputSchema:US.inputSchema.shape},async({src:r,x:i,y:n,width:o,height:a,overhead:s,hidden:l,alpha:u,rotation:d})=>y(await t.query("create-tile",{src:r,x:i,y:n,width:o,height:a,overhead:s,hidden:l,alpha:u,rotation:d}))),e.registerTool(LS.name,{description:LS.description,annotations:W,inputSchema:LS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-tile",{identifier:r,updates:i}))),e.registerTool(qS.name,{description:qS.description,annotations:X,inputSchema:qS.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-tiles",{identifiers:r})))}function KO(e,t){tW(e,t),GO(e,t)}var QO=[{name:"list-sounds",description:"List ambient sounds on the active scene (paginated). Returns each sound's ID, position (in pixels), audio path, hearing radius (in feet), volume, and easing. For playlist/music control, use the playlists bundle.",inputSchema:c.object({limit:c.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-sound",description:"Place a positional ambient sound on the scene (e.g., waterfall, tavern noise). Tokens hear it louder when nearby. For background music, use the playlists bundle.",inputSchema:c.object({x:c.number().describe("X position in pixels (from scene top-left)"),y:c.number().describe("Y position in pixels (from scene top-left)"),path:c.string().max(256).describe("Audio file path (relative to Foundry data)"),radius:c.number().min(0).describe("Hearing radius in feet (how far tokens can hear the sound)"),volume:c.number().min(0).max(1).optional().describe("Volume 0-1 (default: 1)"),easing:c.boolean().optional().describe("Volume eases with distance (default: true)"),hidden:c.boolean().optional().describe("Hidden from players")})},{name:"update-sound",description:"Update an ambient sound source on the scene. Move, change volume, radius, audio path, or easing. Use list-sounds to find the sound ID first.",inputSchema:c.object({identifier:c.string().max(256).describe("Foundry document ID of the sound to update"),updates:c.record(c.string(),c.unknown()).describe("Properties to update (x, y, path, radius, volume, easing)")})},{name:"delete-sounds",description:"Remove ambient sound sources from the active scene permanently. Accepts sound IDs from list-sounds. Returns the count of deleted sounds and their IDs.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Sound IDs to delete")})},{name:"list-notes",description:"List map pins/notes on the active scene (paginated). Returns each note's ID, position (in pixels), label, linked journal entry/page IDs, and visibility.",inputSchema:c.object({limit:c.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-note",description:"Place a map pin on the scene, optionally linked to a journal entry. Use for points of interest, quest locations, or NPC markers.",inputSchema:c.object({x:c.number().describe("X position in pixels (from scene top-left)"),y:c.number().describe("Y position in pixels (from scene top-left)"),label:c.string().max(256).optional().describe("Pin label text"),entryId:c.string().max(256).optional().describe("Journal entry ID to link"),pageId:c.string().max(256).optional().describe("Journal page ID to link"),iconSize:c.number().min(1).optional().describe("Icon size in pixels (default: 40)"),textColor:c.string().max(256).optional().describe("Label text hex color"),hidden:c.boolean().optional().describe("Hidden from players")})},{name:"update-note",description:"Update a map pin on the scene. Move, change label, or link to a different journal entry. Use list-notes to find the note ID first.",inputSchema:c.object({identifier:c.string().max(256).describe("Foundry document ID of the note to update"),updates:c.record(c.string(),c.unknown()).describe("Properties to update (x, y, label, entryId, pageId)")})},{name:"delete-notes",description:"Remove map pins from the active scene permanently. Does not delete the linked journal entries \u2014 only the pins themselves. Returns the count of deleted notes and their IDs.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Note IDs to delete")})}];var cr=[{name:"list-walls",description:"List wall segments on the active scene (paginated). Returns each wall's ID, endpoints (in pixels), blocking levels for light/movement/sight/sound, and door type/state. Use before creating or modifying walls.",inputSchema:c.object({limit:c.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"toggle-door",description:"Open, close, or lock a door on the active scene. Omit state to toggle open/closed. Returns the new door state. Use list-walls to find door IDs.",inputSchema:c.object({identifier:c.string().max(256).describe("Foundry document ID of the wall/door"),state:c.number().int().min(0).max(2).optional().describe("Door state: 0=closed, 1=open, 2=locked. Omit to toggle open/closed.")})},{name:"close-all-doors",description:"Force close every door on the active scene at once. Returns the count of doors closed. Use for resetting a dungeon between runs. For individual door control, use toggle-door instead."},{name:"create-walls",description:"Create wall segments on the active scene (batch supported). Walls block vision, movement, light, and sound \u2014 blocking levels: 0=none, 10=limited (partial), 20=normal (full). Use presets: basic (blocks all), terrain (limited sight), door, window (see-through), secret, invisible (movement only), ethereal (vision only). Returns wall IDs.",inputSchema:c.object({walls:c.array(c.object({c:c.array(c.number()).length(4).describe("Wall endpoints [x1, y1, x2, y2] in pixels (from scene top-left)"),preset:c.enum(["basic","terrain","invisible","ethereal","window","door","secret"]).optional().describe("Wall type preset (overridden by explicit values below)"),light:c.number().min(0).max(20).optional().describe("Light blocking: 0=none, 10=limited, 20=normal"),move:c.number().min(0).max(20).optional().describe("Movement blocking: 0=none, 10=limited, 20=normal"),sight:c.number().min(0).max(20).optional().describe("Sight blocking: 0=none, 10=limited, 20=normal"),sound:c.number().min(0).max(20).optional().describe("Sound blocking: 0=none, 10=limited, 20=normal"),door:c.number().int().min(0).max(2).optional().describe("Door type: 0=none, 1=door, 2=secret"),ds:c.number().int().min(0).max(2).optional().describe("Door state: 0=closed, 1=open, 2=locked")})).max(100).describe("Array of walls to create")})},{name:"update-wall",description:"Update a wall segment's properties. Change blocking levels, convert to a door, move endpoints, or adjust light/sound penetration. Use list-walls to find the wall ID first.",inputSchema:c.object({identifier:c.string().max(256).describe("Foundry document ID of the wall to update"),updates:c.record(c.string(),c.unknown()).describe("Properties to update (light, move, sight, sound, door, ds, c)")})},{name:"delete-walls",description:"Remove wall segments from the active scene permanently. Accepts wall IDs from list-walls. This affects vision, movement, and sound blocking immediately. Returns the count of deleted walls and their IDs.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Wall IDs to delete")})},{name:"list-lights",description:"List ambient lights on the active scene (paginated). Returns each light's ID, position (in pixels), bright/dim radius (in feet), color, animation, and visibility.",inputSchema:c.object({limit:c.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-light",description:"Place an ambient light on the scene. Configure bright/dim radius, color, animations (torch, pulse, ghostly), and emission angle. Set negative:true for a darkness source.",inputSchema:c.object({x:c.number().describe("X position in pixels (from scene top-left)"),y:c.number().describe("Y position in pixels (from scene top-left)"),dim:c.number().min(0).describe("Dim light radius in feet (e.g., 40 for a torch)"),bright:c.number().min(0).describe("Bright light radius in feet (e.g., 20 for a torch)"),color:c.string().max(256).optional().describe('Light hex color (e.g., "#ff9329" for torchlight)'),alpha:c.number().min(0).max(1).optional().describe("Color intensity 0-1 (default: 0.5)"),angle:c.number().min(0).max(360).optional().describe("Emission angle in degrees (360=omnidirectional)"),negative:c.boolean().optional().describe("Creates darkness instead of light"),animationType:c.string().max(256).optional().describe("Animation: torch, pulse, chroma, wave, fog, sunburst, dome, emanation, ghostly, energy, roiling, hole, vortex"),animationSpeed:c.number().int().min(1).max(10).optional().describe("Animation speed 1-10 (default: 5)"),animationIntensity:c.number().int().min(1).max(10).optional().describe("Animation intensity 1-10 (default: 5)"),hidden:c.boolean().optional().describe("Hidden from players")})},{name:"update-light",description:"Update an ambient light source on the active scene. Supports x/y position (in pixels from top-left), config.bright and config.dim (radius in feet), config.color (hex), config.angle (0-360), config.animation.type and config.animation.speed, and hidden (visibility toggle). Use list-lights to find the light identifier first.",inputSchema:c.object({identifier:c.string().max(256).describe("Foundry document ID of the light to update"),updates:c.record(c.string(),c.unknown()).describe("Properties to update (x, y, config.dim, config.bright, config.color)")})},{name:"delete-lights",description:"Remove ambient light sources from the active scene permanently. Accepts light IDs from list-lights. Returns the count of deleted lights and their IDs.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Light IDs to delete")})},...QO];var ZS=cr[10],FS=cr[11],VS=cr[12],BS=cr[13],HS=cr[14],WS=cr[15],JS=cr[16],GS=cr[17];function YO(e,t){e.registerTool(ZS.name,{description:ZS.description,annotations:q,inputSchema:ZS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-sounds",{limit:r,offset:i}))),e.registerTool(FS.name,{description:FS.description,annotations:C,inputSchema:FS.inputSchema.shape},async({x:r,y:i,path:n,radius:o,volume:a,easing:s,hidden:l})=>y(await t.query("create-sound",{x:r,y:i,path:n,radius:o,volume:a,easing:s,hidden:l}))),e.registerTool(VS.name,{description:VS.description,annotations:W,inputSchema:VS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-sound",{identifier:r,updates:i}))),e.registerTool(BS.name,{description:BS.description,annotations:X,inputSchema:BS.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-sounds",{identifiers:r})))}function XO(e,t){e.registerTool(HS.name,{description:HS.description,annotations:q,inputSchema:HS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-notes",{limit:r,offset:i}))),e.registerTool(WS.name,{description:WS.description,annotations:C,inputSchema:WS.inputSchema.shape},async({x:r,y:i,label:n,entryId:o,pageId:a,iconSize:s,textColor:l,hidden:u})=>y(await t.query("create-note",{x:r,y:i,label:n,entryId:o,pageId:a,iconSize:s,textColor:l,hidden:u}))),e.registerTool(JS.name,{description:JS.description,annotations:W,inputSchema:JS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-note",{identifier:r,updates:i}))),e.registerTool(GS.name,{description:GS.description,annotations:X,inputSchema:GS.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-notes",{identifiers:r})))}var[KS,QS,ej,YS,XS,ex,tx,rx,nx,ix]=cr;function rW(e,t){e.registerTool(KS.name,{description:KS.description,annotations:q,inputSchema:KS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-walls",{limit:r,offset:i}))),e.registerTool(QS.name,{description:QS.description,annotations:C,inputSchema:QS.inputSchema.shape},async({identifier:r,state:i})=>y(await t.query("toggle-door",{identifier:r,state:i}))),e.registerTool(ej.name,{description:ej.description,annotations:W},async()=>y(await t.query("close-all-doors"))),e.registerTool(YS.name,{description:YS.description,annotations:C,inputSchema:YS.inputSchema.shape},async({walls:r})=>y(await t.query("create-walls",{walls:r}))),e.registerTool(XS.name,{description:XS.description,annotations:W,inputSchema:XS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-wall",{identifier:r,updates:i}))),e.registerTool(ex.name,{description:ex.description,annotations:X,inputSchema:ex.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-walls",{identifiers:r})))}function nW(e,t){e.registerTool(tx.name,{description:tx.description,annotations:q,inputSchema:tx.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-lights",{limit:r,offset:i}))),e.registerTool(rx.name,{description:rx.description,annotations:C,inputSchema:rx.inputSchema.shape},async r=>y(await t.query("create-light",r))),e.registerTool(nx.name,{description:nx.description,annotations:W,inputSchema:nx.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-light",{identifier:r,updates:i}))),e.registerTool(ix.name,{description:ix.description,annotations:X,inputSchema:ix.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-lights",{identifiers:r})))}function tj(e,t){rW(e,t),nW(e,t),YO(e,t),XO(e,t)}var rj=[{name:"send-chat-message",description:"Send a message to the Foundry chat log. Supports HTML formatting, speaker attribution, whispers to specific players, and emote actions. Use for narrative text, NPC dialogue, GM announcements, or private messages. For dice results, use roll-dice instead. Returns the sent content and speaker name.",inputSchema:c.object({content:c.string().max(5e4).describe("Message content (supports HTML)"),speaker:c.string().max(256).optional().describe("Speaker name or character name (default: GM)"),whisperTo:c.array(c.string().max(256)).max(50).optional().describe("Player names to whisper to (private message). Omit for public message."),isEmote:c.boolean().optional().describe("Send as an emote/action message (default: false)")})},{name:"get-recent-messages",description:"Retrieve recent messages from the Foundry chat log. Returns the most recent N messages (default 20, max 100) with content, speaker, timestamp, type, and whisper recipients. Also returns the total message count in the log. Named get-* rather than list-* because it fetches a tail slice of the log, not a paginated collection.",inputSchema:c.object({count:c.number().int().min(1).max(100).optional().describe("Number of recent messages to retrieve (default: 20, max: 100)")})}];function nj(e,t){let[r,i]=rj;e.registerTool(r.name,{description:r.description,annotations:C,inputSchema:r.inputSchema.shape},async({content:n,speaker:o,whisperTo:a,isEmote:s})=>y(await t.query("send-chat-message",{content:n,speaker:o,whisperTo:a,isEmote:s}))),e.registerTool(i.name,{description:i.description,annotations:q,inputSchema:i.inputSchema.shape},async({count:n})=>y(await t.query("get-recent-messages",{count:n})))}var Wo=[{name:"list-playlists",description:"List playlists in the world with pagination. Returns each playlist's name, ID, playback mode (sequential/shuffle/simultaneous), playing status, and track count with names. Response includes total count and hasMore flag. Use to find a playlist before playing it or to check what's currently playing.",inputSchema:c.object({limit:c.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-playlists",description:"Search playlists by name or track name. Returns matching playlists with names, IDs, playing status, and track count. Use to find a playlist when you only know part of the name or a track title.",inputSchema:c.object({query:c.string().max(256).describe("Search text to match against playlist or track name")})},{name:"get-playlist",description:"Get full details of a playlist including all tracks with names, paths, volume, and playing status. Returns playback mode and fade settings. Use to find track names before playing them with play-track.",inputSchema:c.object({identifier:c.string().max(256).describe("Playlist name or Foundry ID")})},{name:"play-playlist",description:"Start playing an entire playlist by name or ID. Plays according to the playlist mode (sequential, shuffle, or simultaneous). For playing a single track, use play-track instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Playlist name or Foundry ID")})},{name:"play-track",description:"Play a specific track within a playlist by name or ID. For playing an entire playlist, use play-playlist instead. Use get-playlist to see available tracks.",inputSchema:c.object({playlist:c.string().max(256).describe("Playlist name or ID"),trackId:c.string().max(256).describe("Track name or ID")})},{name:"stop-playlist",description:"Stop a specific playing playlist by name or ID. For stopping everything at once, use stop-all-playlists instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Playlist name or Foundry ID")})},{name:"stop-track",description:"Stop a specific track within a playlist. Other tracks in the playlist continue playing. Returns the playlist and track names.",inputSchema:c.object({playlist:c.string().max(256).describe("Playlist name or ID"),trackId:c.string().max(256).describe("Track name or ID")})},{name:"stop-all-playlists",description:"Stop all currently playing playlists and tracks at once. Use for scene transitions or when silence is needed. For stopping a single playlist, use stop-playlist instead."},{name:"create-playlist",description:"Create a new empty playlist with a playback mode. Returns the new playlist ID. Add tracks afterward with create-track. Modes: 0=Sequential (plays tracks in order), 1=Shuffle (random order), 2=Simultaneous (all tracks play at once, ideal for ambient soundscapes).",inputSchema:c.object({name:c.string().max(256).describe("Playlist name"),description:c.string().max(5e4).optional().describe("Playlist description"),mode:c.number().int().min(0).max(2).optional().describe("Playback mode: 0 = Sequential, 1 = Shuffle, 2 = Simultaneous"),fade:c.number().min(0).optional().describe("Default fade duration in milliseconds"),folderId:c.string().max(256).optional().describe("Folder name or ID to place the playlist in")})},{name:"update-playlist",description:"Update a playlist's properties. Change name, description, playback mode (0=Sequential, 1=Shuffle, 2=Simultaneous), or fade duration. For modifying individual tracks, use update-track instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Playlist name or Foundry ID"),name:c.string().max(256).optional().describe("New playlist name"),description:c.string().max(5e4).optional().describe("New description"),mode:c.number().int().min(0).max(2).optional().describe("Playback mode: 0 = Sequential, 1 = Shuffle, 2 = Simultaneous"),fade:c.number().min(0).optional().describe("Default fade duration in milliseconds")})},{name:"delete-playlist",description:"Delete a playlist and all its tracks permanently. This is irreversible. Stops playback if the playlist is currently playing. Returns the deleted playlist name and ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Playlist name or Foundry ID")})},{name:"create-track",description:'Add a new audio track to an existing playlist. The audio file must already exist in the Foundry data directory (e.g., "music/tavern.mp3"). Returns the new track ID. Use list-playlists or get-playlist to find the playlist first.',inputSchema:c.object({playlist:c.string().max(256).describe("Playlist name or ID"),name:c.string().max(256).describe("Track name"),path:c.string().max(256).describe('Audio file path (relative to Foundry data, e.g. "music/tavern.mp3")'),volume:c.number().min(0).max(1).optional().describe("Volume level (0 to 1, default: 0.5)"),repeat:c.boolean().optional().describe("Loop the track (default: false)"),fade:c.number().min(0).optional().describe("Fade duration in milliseconds")})},{name:"update-track",description:"Update a track's properties within a playlist. Change name, volume, loop setting, or fade duration. For updating the playlist itself, use update-playlist instead.",inputSchema:c.object({playlist:c.string().max(256).describe("Playlist name or ID"),trackId:c.string().max(256).describe("Track name or ID"),name:c.string().max(256).optional().describe("New track name"),volume:c.number().min(0).max(1).optional().describe("Volume level (0 to 1)"),repeat:c.boolean().optional().describe("Loop the track"),fade:c.number().min(0).optional().describe("Fade duration in milliseconds")})},{name:"delete-track",description:"Remove a track from a playlist permanently. The audio file on disk is not deleted. For deleting the entire playlist, use delete-playlist instead. Returns the playlist and deleted track names.",inputSchema:c.object({playlist:c.string().max(256).describe("Playlist name or ID"),trackId:c.string().max(256).describe("Track name or ID")})}];var ox=Wo[11],ax=Wo[12],sx=Wo[13];function ij(e,t){e.registerTool(ox.name,{description:ox.description,annotations:C,inputSchema:ox.inputSchema.shape},async({playlist:r,name:i,path:n,volume:o,repeat:a,fade:s})=>y(await t.query("create-track",{playlist:r,name:i,path:n,volume:o,repeat:a,fade:s}))),e.registerTool(ax.name,{description:ax.description,annotations:W,inputSchema:ax.inputSchema.shape},async({playlist:r,trackId:i,name:n,volume:o,repeat:a,fade:s})=>{let l={};return n!==void 0&&(l.name=n),o!==void 0&&(l.volume=o),a!==void 0&&(l.repeat=a),s!==void 0&&(l.fade=s),y(await t.query("update-track",{playlist:r,trackId:i,updates:l}))})}function oj(e,t){e.registerTool(sx.name,{description:sx.description,annotations:X,inputSchema:sx.inputSchema.shape},async({playlist:r,trackId:i})=>y(await t.query("delete-track",{playlist:r,trackId:i})))}var[cx,lx,ux,dx,px,mx,fx,aj,hx,gx,yx]=Wo;function iW(e,t){e.registerTool(cx.name,{description:cx.description,annotations:q,inputSchema:cx.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-playlists",{limit:r,offset:i}))),e.registerTool(lx.name,{description:lx.description,annotations:Ze,inputSchema:lx.inputSchema.shape},async({query:r})=>y(await t.query("search-playlists",{query:r}))),e.registerTool(ux.name,{description:ux.description,annotations:q,inputSchema:ux.inputSchema.shape},async({identifier:r})=>y(await t.query("get-playlist",{identifier:r})))}function oW(e,t){e.registerTool(dx.name,{description:dx.description,annotations:W,inputSchema:dx.inputSchema.shape},async({identifier:r})=>y(await t.query("play-playlist",{identifier:r}))),e.registerTool(px.name,{description:px.description,annotations:W,inputSchema:px.inputSchema.shape},async({playlist:r,trackId:i})=>y(await t.query("play-track",{playlist:r,trackId:i})))}function aW(e,t){e.registerTool(mx.name,{description:mx.description,annotations:W,inputSchema:mx.inputSchema.shape},async({identifier:r})=>y(await t.query("stop-playlist",{identifier:r}))),e.registerTool(fx.name,{description:fx.description,annotations:W,inputSchema:fx.inputSchema.shape},async({playlist:r,trackId:i})=>y(await t.query("stop-track",{playlist:r,trackId:i}))),e.registerTool(aj.name,{description:aj.description,annotations:W,inputSchema:{}},async()=>y(await t.query("stop-all-playlists",{})))}function sW(e,t){e.registerTool(hx.name,{description:hx.description,annotations:C,inputSchema:hx.inputSchema.shape},async({name:r,description:i,mode:n,fade:o,folderId:a})=>y(await t.query("create-playlist",{name:r,description:i,mode:n,fade:o,folderId:a}))),e.registerTool(gx.name,{description:gx.description,annotations:W,inputSchema:gx.inputSchema.shape},async({identifier:r,name:i,description:n,mode:o,fade:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.description=n),o!==void 0&&(s.mode=o),a!==void 0&&(s.fade=a),y(await t.query("update-playlist",{identifier:r,updates:s}))})}function cW(e,t){e.registerTool(yx.name,{description:yx.description,annotations:X,inputSchema:yx.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-playlist",{identifier:r})))}function sj(e,t){iW(e,t),oW(e,t),aW(e,t),sW(e,t),cW(e,t),ij(e,t),oj(e,t)}var cj=[{name:"list-tables",description:`List rollable tables in the world with pagination. Returns each table's name, ID, dice formula (e.g., "1d6"), result count, and description. Response includes total count and hasMore flag. Use to find a table before rolling on it with roll-table.`,inputSchema:c.object({limit:c.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-tables",description:"Search rollable tables by name or description text. Returns matching tables with names, IDs, dice formulas, result counts, and description previews. Use to find a specific table when you don't know its exact name.",inputSchema:c.object({query:c.string().max(256).describe("Search text to match against table name or description")})},{name:"get-table",description:"Get a rollable table with its dice formula and all result entries. Returns the full table content. Use to review table contents before rolling with roll-table.",inputSchema:c.object({identifier:c.string().max(256).describe("Table name or Foundry ID")})},{name:"roll-table",description:"Roll on a rollable table using its dice formula and return the randomly selected result. Posts the roll and result to Foundry chat by default. For simple dice rolls without a table, use roll-dice (dice bundle) instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Table name or Foundry ID"),showInChat:c.boolean().optional().describe("Show the roll result in Foundry chat (default: true)")})},{name:"create-table",description:"Create a new rollable table with a dice formula and result entries. Returns the new table ID. Each result has text and an optional weight or explicit dice range. Use for random encounters, loot tables, weather, NPC names, or any randomized content. If no formula is specified, it auto-generates based on result count.",inputSchema:c.object({name:c.string().max(256).describe("Table name"),formula:c.string().max(256).optional().describe('Dice formula (e.g. "1d6", "1d20", "2d10")'),description:c.string().max(5e4).optional().describe("Table description"),replacement:c.boolean().optional().describe("Draw with replacement (default: true)"),folderId:c.string().max(256).optional().describe("Folder name or ID to place the table in"),results:c.array(c.object({text:c.string().max(5e4).describe("Result text"),weight:c.number().optional().describe("Result weight (default: 1)"),rangeStart:c.number().optional().describe("Range start (auto-assigned if omitted)"),rangeEnd:c.number().optional().describe("Range end (auto-assigned if omitted)")})).max(100).optional().describe("Table results/entries")})},{name:"update-table",description:"Update a rollable table's properties. Change name, dice formula, description, or draw-with-replacement mode. Does not modify individual results \u2014 use Foundry UI for that.",inputSchema:c.object({identifier:c.string().max(256).describe("Table name or Foundry ID"),name:c.string().max(256).optional().describe("New table name"),formula:c.string().max(256).optional().describe("New dice formula"),description:c.string().max(5e4).optional().describe("New description"),replacement:c.boolean().optional().describe("Draw with replacement")})},{name:"delete-table",description:"Delete a rollable table and all its result entries permanently. This is irreversible. Returns the deleted table name and ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Table name or Foundry ID")})}];var[vx,bx,_x,Sx,xx,wx,$x]=cj;function lW(e,t){e.registerTool(vx.name,{description:vx.description,annotations:q,inputSchema:vx.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-tables",{limit:r,offset:i}))),e.registerTool(bx.name,{description:bx.description,annotations:Ze,inputSchema:bx.inputSchema.shape},async({query:r})=>y(await t.query("search-tables",{query:r}))),e.registerTool(_x.name,{description:_x.description,annotations:q,inputSchema:_x.inputSchema.shape},async({identifier:r})=>y(await t.query("get-table",{identifier:r}))),e.registerTool(Sx.name,{description:Sx.description,annotations:C,inputSchema:Sx.inputSchema.shape},async({identifier:r,showInChat:i})=>y(await t.query("roll-table",{identifier:r,showInChat:i})))}function uW(e,t){e.registerTool(xx.name,{description:xx.description,annotations:C,inputSchema:xx.inputSchema.shape},async({name:r,formula:i,description:n,replacement:o,folderId:a,results:s})=>y(await t.query("create-table",{name:r,formula:i,description:n,replacement:o,folderId:a,results:s}))),e.registerTool(wx.name,{description:wx.description,annotations:W,inputSchema:wx.inputSchema.shape},async({identifier:r,name:i,formula:n,description:o,replacement:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.formula=n),o!==void 0&&(s.description=o),a!==void 0&&(s.replacement=a),y(await t.query("update-table",{identifier:r,updates:s}))}),e.registerTool($x.name,{description:$x.description,annotations:X,inputSchema:$x.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-table",{identifier:r})))}function lj(e,t){lW(e,t),uW(e,t)}var uj=[{name:"list-card-stacks",description:"List all card stacks in the world. Returns every stack (no pagination) with name, ID, type (deck/hand/pile), card count, and description. Use to find a stack before drawing cards or checking a player's hand."},{name:"search-card-stacks",description:"Search card stacks by name or card name. Returns matching stacks with names, IDs, types, and card counts. Use to find a deck or hand when you only know part of the name.",inputSchema:c.object({query:c.string().max(256).describe("Search text to match against stack or card name")})},{name:"get-card-stack",description:"Get a card stack with all its cards, including card names, faces, and drawn status. Use to see the full deck contents or a player's hand.",inputSchema:c.object({identifier:c.string().max(256).describe("Card stack name or Foundry ID")})},{name:"create-card-stack",description:`Create a new card stack. Use type "deck" for a draw pile, "hand" for a player's hand, or "pile" for a discard/community pile. Returns the new stack ID.`,inputSchema:c.object({name:c.string().max(256).describe("Card stack name"),type:c.enum(["deck","hand","pile"]).describe("Stack type"),description:c.string().max(5e4).optional().describe("Stack description")})},{name:"update-card-stack",description:"Update a card stack's properties. Change the name, description, or type. For drawing or shuffling cards, use draw-cards or shuffle-deck instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Card stack name or Foundry ID"),name:c.string().max(256).optional().describe("New stack name"),description:c.string().max(5e4).optional().describe("New stack description"),type:c.enum(["deck","hand","pile"]).optional().describe("New stack type")})},{name:"delete-card-stack",description:"Delete a card stack and all its cards permanently. This is irreversible. Returns the deleted stack name and ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Card stack name or Foundry ID")})},{name:"draw-cards",description:"Draw or deal cards from one stack to another (e.g., deck \u2192 hand, deck \u2192 discard pile). Cards are moved, not copied \u2014 they leave the source stack. Returns the drawn card names and IDs. Use get-card-stack to see available cards first.",inputSchema:c.object({source:c.string().max(256).describe("Source stack name or ID (e.g., the deck)"),destination:c.string().max(256).describe("Destination stack name or ID (e.g., a hand or pile)"),count:c.number().int().min(1).describe("Number of cards to draw")})},{name:"shuffle-deck",description:"Shuffle a card stack to randomize the card order. Use before dealing or drawing from a deck. Does not recall cards from other stacks \u2014 use reset-deck for that.",inputSchema:c.object({identifier:c.string().max(256).describe("Card stack name or Foundry ID")})},{name:"reset-deck",description:"Reset a deck by recalling all dealt cards from hands and piles back into it, restoring it to its original state. Use to start a new round or game. Does not shuffle \u2014 use shuffle-deck afterward to randomize the order.",inputSchema:c.object({identifier:c.string().max(256).describe("Card stack name or Foundry ID")})}];var[dj,kx,Tx,Ix,Ex,Px,zx,Rx,Ox]=uj;function dW(e,t){e.registerTool(dj.name,{description:dj.description,annotations:q,inputSchema:{}},async()=>y(await t.query("list-card-stacks",{}))),e.registerTool(kx.name,{description:kx.description,annotations:Ze,inputSchema:kx.inputSchema.shape},async({query:r})=>y(await t.query("search-card-stacks",{query:r}))),e.registerTool(Tx.name,{description:Tx.description,annotations:q,inputSchema:Tx.inputSchema.shape},async({identifier:r})=>y(await t.query("get-card-stack",{identifier:r}))),e.registerTool(Ix.name,{description:Ix.description,annotations:C,inputSchema:Ix.inputSchema.shape},async({name:r,type:i,description:n})=>y(await t.query("create-card-stack",{name:r,type:i,description:n}))),e.registerTool(Ex.name,{description:Ex.description,annotations:W,inputSchema:Ex.inputSchema.shape},async({identifier:r,name:i,description:n,type:o})=>{let a={};return i!==void 0&&(a.name=i),n!==void 0&&(a.description=n),o!==void 0&&(a.type=o),y(await t.query("update-card-stack",{identifier:r,updates:a}))}),e.registerTool(Px.name,{description:Px.description,annotations:X,inputSchema:Px.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-card-stack",{identifier:r})))}function pW(e,t){e.registerTool(zx.name,{description:zx.description,annotations:C,inputSchema:zx.inputSchema.shape},async({source:r,destination:i,count:n})=>y(await t.query("draw-cards",{source:r,destination:i,count:n}))),e.registerTool(Rx.name,{description:Rx.description,annotations:C,inputSchema:Rx.inputSchema.shape},async({identifier:r})=>y(await t.query("shuffle-deck",{identifier:r}))),e.registerTool(Ox.name,{description:Ox.description,annotations:W,inputSchema:Ox.inputSchema.shape},async({identifier:r})=>y(await t.query("reset-deck",{identifier:r})))}function pj(e,t){dW(e,t),pW(e,t)}var mj=[{name:"list-macros",description:"List all macros in the world. Returns every macro (no pagination) with name, ID, type (script or chat), and command preview. Use to find a macro before executing or deleting it."},{name:"get-macro",description:"Get the full details of a macro including its complete command/code, type, author, and folder. Use when you need to read or review a macro's full source code.",inputSchema:c.object({identifier:c.string().max(256).describe("Macro name or Foundry ID")})},{name:"search-macros",description:"Search macros by name or command text. Returns matching macros with names, IDs, types, and match location. Use to find macros related to a topic or containing specific code.",inputSchema:c.object({query:c.string().max(256).describe("Search text to match against macro name or command")})},{name:"execute-macro",description:'Execute a macro by name or ID. Script macros run arbitrary JavaScript with full Foundry API access \u2014 use with caution as they can modify any game data. Chat macros send chat commands (e.g., "/roll 1d20"). Returns the macro name and type.',inputSchema:c.object({identifier:c.string().max(256).describe("Macro name or Foundry ID")})},{name:"create-macro",description:'Create a new macro. Default type is "chat" (safe \u2014 runs chat commands like /roll 1d20, /whisper GM Hello). Set type to "script" ONLY when the user explicitly requests JavaScript execution \u2014 script macros have full Foundry API access and can modify any game data. Never create script macros from untrusted input.',inputSchema:c.object({name:c.string().max(256).describe("Macro name"),command:c.string().max(1e4).describe("Macro command/code to execute"),type:c.enum(["script","chat"]).optional().describe('Macro type: "chat" for chat commands (default, safe), "script" for JS code (dangerous \u2014 full API access, requires explicit user request)')})},{name:"update-macro",description:"Update a macro's properties. Change the name, type (script/chat), command code, or icon. For executing a macro, use execute-macro instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Macro name or Foundry ID"),name:c.string().max(256).optional().describe("New macro name"),type:c.enum(["script","chat"]).optional().describe('New macro type: "chat" for chat commands (safe), "script" for JS code (dangerous \u2014 full API access)'),command:c.string().max(1e4).optional().describe("New macro command/code"),img:c.string().max(256).optional().describe("New macro icon image path")})},{name:"delete-macro",description:"Delete a macro from the world permanently. This is irreversible. Returns the deleted macro name.",inputSchema:c.object({identifier:c.string().max(256).describe("Macro name or Foundry ID")})}];var[fj,jx,Dx,Nx,Cx,Ax,Mx]=mj;function hj(e,t){e.registerTool(fj.name,{description:fj.description,annotations:q,inputSchema:{}},async()=>y(await t.query("list-macros",{}))),e.registerTool(jx.name,{description:jx.description,annotations:Ze,inputSchema:jx.inputSchema.shape},async({identifier:r})=>y(await t.query("get-macro",{identifier:r}))),e.registerTool(Dx.name,{description:Dx.description,annotations:Ze,inputSchema:Dx.inputSchema.shape},async({query:r})=>y(await t.query("search-macros",{query:r}))),e.registerTool(Nx.name,{description:Nx.description,annotations:X,inputSchema:Nx.inputSchema.shape},async({identifier:r})=>y(await t.query("execute-macro",{identifier:r}))),e.registerTool(Cx.name,{description:Cx.description,annotations:X,inputSchema:Cx.inputSchema.shape},async({name:r,command:i,type:n})=>y(await t.query("create-macro",{name:r,command:i,type:n}))),e.registerTool(Ax.name,{description:Ax.description,annotations:W,inputSchema:Ax.inputSchema.shape},async({identifier:r,name:i,type:n,command:o,img:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.type=n),o!==void 0&&(s.command=o),a!==void 0&&(s.img=a),y(await t.query("update-macro",{identifier:r,updates:s}))}),e.registerTool(Mx.name,{description:Mx.description,annotations:X,inputSchema:Mx.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-macro",{identifier:r})))}var gj=[{name:"list-events",description:"List all Ember campaign quest events with their current status (none/available/active/complete). Returns every event (no pagination) with name, ID, type, step, and active/complete flags, plus the currently active event. Use get-event for full details. Requires the Ember module."},{name:"get-event",description:"Get full details of a specific Ember quest event including scene, NPCs, music, journal page, and outcomes. Supports partial name matching. Requires the Ember module.",inputSchema:c.object({identifier:c.string().max(256).describe("Event ID or name (partial match supported)")})},{name:"begin-event",description:"Begin an Ember quest event, triggering its full lifecycle: switches to the event scene, spawns NPC tokens, starts music/soundscape, and opens the journal page. Use list-events to find available events. Requires the Ember module.",inputSchema:c.object({identifier:c.string().max(256).describe("Event ID or name (partial match supported)")})},{name:"complete-event",description:"Complete an Ember quest event, triggering its onEnd lifecycle hook. Omit identifier to complete the currently active event. Use after the party finishes the encounter. Requires the Ember module.",inputSchema:c.object({identifier:c.string().max(256).optional().describe("Event ID or name. Omit to complete the currently active event.")})},{name:"set-event-outcome",description:"Set outcomes on an Ember quest event to record party choices and decisions. Outcomes are key-value pairs tracked by the narrative system for branching storylines. Requires the Ember module.",inputSchema:c.object({identifier:c.string().max(256).describe("Event ID or name"),outcomes:c.record(c.string(),c.unknown()).describe("Outcome key-value pairs to set on the event")})}];var[yj,Ux,Lx,qx,Zx]=gj;function mW(e,t){e.registerTool(yj.name,{description:yj.description,annotations:q,inputSchema:{}},async()=>y(await t.query("list-events",{}))),e.registerTool(Ux.name,{description:Ux.description,annotations:q,inputSchema:Ux.inputSchema.shape},async({identifier:r})=>y(await t.query("get-event",{identifier:r})))}function fW(e,t){e.registerTool(Lx.name,{description:Lx.description,annotations:C,inputSchema:Lx.inputSchema.shape},async({identifier:r})=>y(await t.query("begin-event",{identifier:r}))),e.registerTool(qx.name,{description:qx.description,annotations:C,inputSchema:qx.inputSchema.shape},async({identifier:r})=>y(await t.query("complete-event",{identifier:r}))),e.registerTool(Zx.name,{description:Zx.description,annotations:W,inputSchema:Zx.inputSchema.shape},async({identifier:r,outcomes:i})=>y(await t.query("set-event-outcome",{identifier:r,outcomes:i})))}function vj(e,t){mW(e,t),fW(e,t)}var bj=[{name:"list-effects",description:"List all active effects (buffs, debuffs, spell effects) on an actor. Returns each effect's name, ID, enabled/disabled status, icon, remaining duration, and attribute changes (e.g., +2 AC, 1d4 to attacks). For token-level status icons (prone, poisoned), use toggle-condition (combat bundle) instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Actor name or Foundry actor ID")})},{name:"get-effect",description:"Get full details of a single active effect on an actor, including all attribute changes, duration, origin, and status. Use when you need to inspect one specific effect's details rather than listing all effects.",inputSchema:c.object({identifier:c.string().max(256).describe("Actor name or Foundry actor ID"),effectId:c.string().max(256).describe("Effect ID (from list-effects)")})},{name:"create-effect",description:"Add a custom active effect to an actor that modifies its attributes. Effects use Foundry change modes: 0=CUSTOM (no automatic effect), 1=MULTIPLY (multiply attribute by value), 2=ADD (add value to attribute, e.g., +2 AC), 3=DOWNGRADE (apply only if lower than current), 4=UPGRADE (apply only if higher than current), 5=OVERRIDE (replace attribute value entirely). Supports timed duration in combat rounds, turns, or real-time seconds. For simple status icons (prone, poisoned), use toggle-condition (combat bundle) instead. Returns the actor name and created effect ID and name.",inputSchema:c.object({identifier:c.string().max(256).describe("Actor name or Foundry actor ID"),name:c.string().max(256).describe('Effect name (e.g., "Bless", "Rage", "Shield of Faith")'),changes:c.array(c.object({key:c.string().max(256).describe('System data path (e.g., "system.attributes.ac.bonus")'),mode:c.number().int().min(0).max(5).describe("Change mode: 0=CUSTOM, 1=MULTIPLY, 2=ADD, 3=DOWNGRADE, 4=UPGRADE, 5=OVERRIDE"),value:c.string().max(256).describe('Value to apply (e.g., "2", "1d4")')})).max(100).optional().describe("Attribute changes this effect applies"),icon:c.string().max(256).optional().describe("Effect icon path"),disabled:c.boolean().optional().describe("Create in disabled state (default: false)"),duration:c.object({rounds:c.number().int().min(0).optional(),turns:c.number().int().min(0).optional(),seconds:c.number().min(0).optional()}).optional().describe("Effect duration")})},{name:"update-effect",description:"Update an active effect on an actor. Change name, enable/disable, modify attribute changes, or adjust duration. Use list-effects to find the effect ID first.",inputSchema:c.object({identifier:c.string().max(256).describe("Actor name or Foundry actor ID"),effectId:c.string().max(256).describe("Effect ID (from list-effects)"),updates:c.record(c.string(),c.unknown()).describe('Update data (e.g., {disabled: true, name: "New Name"})')})},{name:"delete-effect",description:"Remove an active effect from an actor permanently. Use when a spell or ability effect ends. Use list-effects to find the effect ID first. Returns the actor name and deleted effect ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Actor name or Foundry actor ID"),effectId:c.string().max(256).describe("Effect ID (from list-effects)")})}];var[Fx,Vx,Bx,Hx,Wx]=bj;function hW(e,t){e.registerTool(Fx.name,{description:Fx.description,annotations:q,inputSchema:Fx.inputSchema.shape},async({identifier:r})=>y(await t.query("list-effects",{identifier:r}))),e.registerTool(Vx.name,{description:Vx.description,annotations:Ze,inputSchema:Vx.inputSchema.shape},async({identifier:r,effectId:i})=>y(await t.query("get-effect",{identifier:r,effectId:i})))}function gW(e,t){e.registerTool(Bx.name,{description:Bx.description,annotations:C,inputSchema:Bx.inputSchema.shape},async({identifier:r,name:i,changes:n,icon:o,disabled:a,duration:s})=>y(await t.query("create-effect",{identifier:r,effectData:{name:i,changes:n,icon:o,disabled:a,duration:s}}))),e.registerTool(Hx.name,{description:Hx.description,annotations:W,inputSchema:Hx.inputSchema.shape},async({identifier:r,effectId:i,updates:n})=>y(await t.query("update-effect",{identifier:r,effectId:i,updates:n}))),e.registerTool(Wx.name,{description:Wx.description,annotations:X,inputSchema:Wx.inputSchema.shape},async({identifier:r,effectId:i})=>y(await t.query("delete-effect",{identifier:r,effectId:i})))}function _j(e,t){hW(e,t),gW(e,t)}var Sj=[{name:"list-items",description:"List standalone world items (not owned by any actor) with pagination. Returns each item's name, ID, type (weapon/spell/equipment/etc.), and folder. Response includes total count and hasMore flag. Filter by item type or folder name. For items on a character's sheet, use search-character-items (characters bundle) instead.",inputSchema:c.object({type:c.string().max(256).optional().describe("Filter by item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background)"),folder:c.string().max(256).optional().describe("Filter by folder name (substring match)"),limit:c.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:c.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-items",description:"Search standalone world items by name or description text. Returns matching items with names, IDs, types, and relevance. For searching items on a character, use search-character-items (characters bundle). For compendium items, use search-compendium (compendium bundle).",inputSchema:c.object({query:c.string().max(256).describe("Search text to match against item name or description"),type:c.string().max(256).optional().describe("Filter by item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background)")})},{name:"get-item",description:"Get full details of a standalone world item including name, type, description (HTML), system-specific properties (damage, weight, rarity, etc.), and image path. For items owned by a character, use get-character-item (characters bundle) instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Item name or Foundry ID")})},{name:"update-item",description:"Update a standalone world item using Foundry dot-notation paths. Change name, system data, image, or other properties. Use get-item first to see current values.",inputSchema:c.object({identifier:c.string().max(256).describe("Item name or Foundry ID"),updates:c.record(c.string(),c.unknown()).describe("Foundry update data (e.g. { name, system, img })")})},{name:"create-item",description:"Create a standalone world item (not owned by any actor). Returns the new item ID. Specify the item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background) and optional system data. For adding items directly to a character, use import-compendium-to-character (characters bundle) instead.",inputSchema:c.object({name:c.string().max(256).describe("Item name"),type:c.string().max(256).describe("Item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background)"),system:c.record(c.string(),c.unknown()).optional().describe("System-specific data"),img:c.string().max(256).optional().describe("Item image path"),folderId:c.string().max(256).optional().describe("Folder name or ID")})},{name:"delete-item",description:"Delete a standalone world item permanently. This is irreversible. Returns the deleted item name and ID. For removing items from a character, use delete-character-items (characters bundle) instead.",inputSchema:c.object({identifier:c.string().max(256).describe("Item name or Foundry ID")})}];var[Jx,Gx,Kx,Qx,Yx,Xx]=Sj;function yW(e,t){e.registerTool(Jx.name,{description:Jx.description,annotations:Ze,inputSchema:Jx.inputSchema.shape},async({type:r,folder:i,limit:n,offset:o})=>y(await t.query("list-items",{type:r,folder:i,limit:n,offset:o}))),e.registerTool(Gx.name,{description:Gx.description,annotations:Ze,inputSchema:Gx.inputSchema.shape},async({query:r,type:i})=>y(await t.query("search-items",{query:r,type:i}))),e.registerTool(Kx.name,{description:Kx.description,annotations:Ze,inputSchema:Kx.inputSchema.shape},async({identifier:r})=>y(await t.query("get-item",{identifier:r})))}function vW(e,t){e.registerTool(Qx.name,{description:Qx.description,annotations:W,inputSchema:Qx.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-item",{identifier:r,updates:i}))),e.registerTool(Yx.name,{description:Yx.description,annotations:C,inputSchema:Yx.inputSchema.shape},async({name:r,type:i,system:n,img:o,folderId:a})=>y(await t.query("create-item",{name:r,type:i,system:n,img:o,folderId:a}))),e.registerTool(Xx.name,{description:Xx.description,annotations:X,inputSchema:Xx.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-item",{identifier:r})))}function xj(e,t){yW(e,t),vW(e,t)}var wj=c.enum(["Actor","Item","Scene","JournalEntry","RollableTable","Macro","Cards","Playlist"]),$j=[{name:"list-folders",description:"List all folders in the world organized by nesting hierarchy. Returns each folder's name, ID, type, parent folder, color, and document count. Filter by document type (Actor, Item, Scene, JournalEntry, etc.) to see only relevant folders.",inputSchema:c.object({type:wj.optional().describe("Filter by document type")})},{name:"get-folder",description:"Get full details of a folder including its name, type, parent, color, depth, and a list of all documents it contains. Use to inspect a folder's contents or metadata.",inputSchema:c.object({identifier:c.string().max(256).describe("Folder name or Foundry ID")})},{name:"create-folder",description:"Create a new folder for organizing documents in the sidebar. Specify the document type this folder holds (Actor, Item, Scene, JournalEntry, RollableTable, Macro, Cards, Playlist) and an optional parent folder for nesting. Returns the new folder ID.",inputSchema:c.object({name:c.string().max(256).describe("Folder name"),type:wj.describe("Document type this folder holds"),parentId:c.string().max(256).optional().describe("Parent folder name or ID for nesting")})},{name:"update-folder",description:"Update a folder \u2014 rename, change parent (for re-nesting), or set a display color. Use list-folders to find the folder ID first.",inputSchema:c.object({identifier:c.string().max(256).describe("Folder name or Foundry ID"),name:c.string().max(256).optional().describe("New folder name"),parentId:c.string().max(256).optional().describe("New parent folder name or ID (use null to move to root)"),color:c.string().max(256).optional().describe('Folder color (hex, e.g., "#ff0000")')})},{name:"delete-folder",description:"Delete a folder from the world permanently. Documents inside the folder are moved to root level, not deleted. Only the folder organization is removed. Returns the deleted folder name and ID.",inputSchema:c.object({identifier:c.string().max(256).describe("Folder name or Foundry ID")})}];var[ew,tw,rw,nw,iw]=$j;function bW(e,t){e.registerTool(ew.name,{description:ew.description,annotations:q,inputSchema:ew.inputSchema.shape},async({type:r})=>y(await t.query("list-folders",{type:r}))),e.registerTool(tw.name,{description:tw.description,annotations:Ze,inputSchema:tw.inputSchema.shape},async({identifier:r})=>y(await t.query("get-folder",{identifier:r}))),e.registerTool(rw.name,{description:rw.description,annotations:C,inputSchema:rw.inputSchema.shape},async({name:r,type:i,parentId:n})=>y(await t.query("create-folder",{name:r,type:i,parentId:n})))}function _W(e,t){e.registerTool(nw.name,{description:nw.description,annotations:W,inputSchema:nw.inputSchema.shape},async({identifier:r,name:i,parentId:n,color:o})=>{let a={};return i!==void 0&&(a.name=i),n!==void 0&&(a.parentId=n),o!==void 0&&(a.color=o),y(await t.query("update-folder",{identifier:r,updates:a}))}),e.registerTool(iw.name,{description:iw.description,annotations:X,inputSchema:iw.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-folder",{identifier:r})))}function kj(e,t){bW(e,t),_W(e,t)}var Tj=c.discriminatedUnion("type",[c.object({type:c.literal("rectangle"),x:c.number().describe("X position in pixels (from scene top-left)"),y:c.number().describe("Y position in pixels (from scene top-left)"),width:c.number().min(1).describe("Width in pixels"),height:c.number().min(1).describe("Height in pixels"),rotation:c.number().min(0).max(360).optional().describe("Rotation in degrees"),hole:c.boolean().optional().describe("Cut out this shape (default: false)")}),c.object({type:c.literal("circle"),x:c.number().describe("Center X in pixels (from scene top-left)"),y:c.number().describe("Center Y in pixels (from scene top-left)"),radius:c.number().min(1).describe("Radius in pixels"),hole:c.boolean().optional().describe("Cut out this shape (default: false)")}),c.object({type:c.literal("ellipse"),x:c.number().describe("Center X in pixels (from scene top-left)"),y:c.number().describe("Center Y in pixels (from scene top-left)"),radiusX:c.number().min(1).describe("Horizontal radius in pixels"),radiusY:c.number().min(1).describe("Vertical radius in pixels"),rotation:c.number().min(0).max(360).optional().describe("Rotation in degrees"),hole:c.boolean().optional().describe("Cut out this shape (default: false)")}),c.object({type:c.literal("polygon"),points:c.array(c.number()).min(6).max(100).describe("Flat array of x,y pairs: [x1,y1,x2,y2,...] (min 3 points)"),hole:c.boolean().optional().describe("Cut out this shape (default: false)")})]),Ij=c.object({name:c.string().max(256).optional(),type:c.string().max(256).describe("Behavior type: adjustDarknessLevel, displayScrollingText, executeMacro, executeScript, pauseGame, suppressWeather, teleportToken, toggleBehavior"),disabled:c.boolean().optional(),system:c.record(c.string(),c.unknown()).optional().describe("Behavior-specific configuration")}),Ej=[{name:"list-regions",description:"List all regions (Foundry v13 trigger zones) on the active scene. Returns every region (no pagination) with name, ID, shape summary (type, position in pixels, dimensions), behavior types, and color. Use to find region IDs before inspecting or modifying them."},{name:"get-region",description:"Get a region with full details including all shapes (rectangle, circle, ellipse, polygon) with positions in pixels, attached behaviors with their configuration, elevation range, and display color. Use for inspecting region setup before modifying it.",inputSchema:c.object({identifier:c.string().max(256).describe("Region name or Foundry ID")})},{name:"update-region",description:"Update a region on the active scene. Modify name, display color, shapes, or behaviors. Shapes and behaviors are replaced entirely when provided \u2014 include all desired entries, not just changes.",inputSchema:c.object({identifier:c.string().max(256).describe("Region name or Foundry ID"),name:c.string().max(256).optional().describe("New region name"),color:c.string().max(256).optional().describe('New display color (hex, e.g., "#ff0000")'),shapes:c.array(Tj).max(100).optional().describe("Replace region shapes"),behaviors:c.array(Ij).max(100).optional().describe("Replace region behaviors")})},{name:"create-region",description:"Create a trigger region on the active scene (Foundry v13+). Regions trigger behaviors when tokens enter, exit, or move within the defined area. All shape coordinates are in pixels (from scene top-left). Attach behaviors like executeMacro (run code on enter/exit), teleportToken (portal), displayScrollingText (area labels), pauseGame, or suppressWeather.",inputSchema:c.object({name:c.string().max(256).describe("Region name"),shapes:c.array(Tj).max(100).describe("Region shapes (rectangle, circle, ellipse, or polygon)"),color:c.string().max(256).optional().describe('Display color (hex, e.g., "#ff0000")'),behaviors:c.array(Ij).max(100).optional().describe("Behaviors to attach to the region")})},{name:"delete-regions",description:"Delete regions from the active scene permanently. Removes the trigger zones, all shapes, and all attached behaviors. Does not affect tokens currently inside the region. Returns the count of deleted regions, their IDs, and the scene name.",inputSchema:c.object({identifiers:c.array(c.string().max(256)).min(1).max(100).describe("Region IDs to delete")})}];var[Pj,ow,aw,sw,cw]=Ej;function SW(e,t){e.registerTool(Pj.name,{description:Pj.description,annotations:q},async()=>y(await t.query("list-regions"))),e.registerTool(ow.name,{description:ow.description,annotations:q,inputSchema:ow.inputSchema.shape},async({identifier:r})=>y(await t.query("get-region",{identifier:r})))}function xW(e,t){e.registerTool(aw.name,{description:aw.description,annotations:X,inputSchema:aw.inputSchema.shape},async({identifier:r,name:i,color:n,shapes:o,behaviors:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.color=n),o!==void 0&&(s.shapes=o),a!==void 0&&(s.behaviors=a),y(await t.query("update-region",{identifier:r,updates:s}))})}function wW(e,t){e.registerTool(sw.name,{description:sw.description,annotations:X,inputSchema:sw.inputSchema.shape},async({name:r,shapes:i,color:n,behaviors:o})=>y(await t.query("create-region",{name:r,shapes:i,color:n,behaviors:o}))),e.registerTool(cw.name,{description:cw.description,annotations:X,inputSchema:cw.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-regions",{identifiers:r})))}function zj(e,t){SW(e,t),xW(e,t),wW(e,t)}var Rj=[{name:"generate-image",description:"Generate an image from a text description using the configured AI image provider (OpenAI/DALL-E, Stability AI, fal.ai, Leonardo AI, or Replicate). Returns the generated image inline as base64. Be specific in prompts about subject, style, composition, lighting, and mood. Requires image generation to be enabled and an image provider configured in Foundry module settings.",inputSchema:c.object({prompt:c.string().max(1e4).describe("Detailed image generation prompt. Be specific about subject, style, composition, lighting, and mood. For fantasy RPG content, include relevant details like setting, character features, and atmosphere."),size:c.enum(["square","landscape","portrait"]).optional().describe("Image aspect ratio (default: square). Use landscape for wide scenes, portrait for characters."),style:c.string().max(256).optional().describe('Optional style modifier (e.g., "oil painting", "watercolor", "pixel art", "photorealistic"). Appended to the prompt to influence the visual style.')})}];var $W=9e4,kW=c.object({imageData:c.string(),mimeType:c.string(),provider:c.string(),model:c.string()}),[lw]=Rj;function TW(e){let t=Yt(e),r=Rr(e),i=Ho(r);return{content:[{type:"text",text:`Image generation failed: ${t}${i}`}],isError:!0}}function Oj(e,t){e.registerTool(lw.name,{description:lw.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},inputSchema:lw.inputSchema.shape},async({prompt:r,size:i,style:n})=>{let o=await t.query("generate-image",{prompt:r,size:i,style:n},$W);if(!o.success)return TW(o.error);let a=kW.safeParse(o.result);return a.success?{content:[{type:"image",data:a.data.imageData,mimeType:a.data.mimeType},{type:"text",text:`Image generated by ${a.data.provider} (${a.data.model})`}]}:{content:[{type:"text",text:`Image generation failed: unexpected response format \u2014 ${a.error.message}`}],isError:!0}})}var jj=[{name:"generate-voice",description:"Generate speech audio (text-to-speech) from text using the configured TTS provider (ElevenLabs, Cartesia, OpenAI TTS, or PlayHT). Returns audio that plays in Foundry for all connected players. Use for NPC dialogue, dramatic narration, or reading text aloud. Keep text under 500 characters for best results. Requires voice generation to be enabled and a voice provider configured in Foundry module settings.",inputSchema:c.object({text:c.string().max(1e4).describe("The text to convert to speech. Keep it concise for best results \u2014 under 500 characters."),voice:c.string().max(256).optional().describe("Optional voice ID to use instead of the configured default. Each provider has different voice IDs \u2014 check provider documentation."),characterId:c.string().max(256).optional().describe("Optional actor name or ID. Resolves the voice from the character\u2019s stored voice (set via set-character-voice). Ignored if voice is explicitly provided.")})},{name:"generate-dialogue",description:"Generate multi-voice dialogue with different voices for DM narration and character speech. Each segment specifies text and a role (dm or character) to select the corresponding voice provider from settings. All segments generate in parallel for speed, then play sequentially as an audio queue with no gaps between lines. Use this instead of multiple generate-voice calls when you have a conversation between the DM and characters. Max 20 segments per call.",inputSchema:c.object({segments:c.array(c.object({text:c.string().max(1e4).describe("The text to speak."),role:c.enum(["dm","character"]).describe('Voice slot: "dm" uses DM/Narrator voice settings, "character" uses Character voice settings.'),voice:c.string().max(256).optional().describe("Optional voice ID override for this segment."),characterId:c.string().max(256).optional().describe("Optional actor name or ID. Resolves the voice from the character\u2019s stored voice (set via set-character-voice). Ignored if voice is explicitly provided."),instructions:c.string().max(1e3).optional().describe('Tone/style instructions for this segment (OpenAI TTS only). E.g. "Speak in a menacing whisper".'),speed:c.number().min(.25).max(4).optional().describe("Speech speed for this segment (OpenAI TTS only). 0.25\u20134.0, default 1.0."),stability:c.number().min(0).max(1).optional().describe("Voice stability for this segment (ElevenLabs only). Lower = more expressive."),similarityBoost:c.number().min(0).max(1).optional().describe("Similarity boost for this segment (ElevenLabs only). Higher = closer to original voice.")})).min(1).max(20).describe("Dialogue segments in playback order. Each uses the DM or character voice slot.")})},{name:"set-character-voice",description:"Assign a TTS voice to a specific character or NPC. The voice ID is stored on the actor and automatically used when that character speaks via generate-voice or generate-dialogue. Voice IDs are provider-specific (e.g. ElevenLabs voice_id, OpenAI voice name). Pass an empty voiceId to clear the assignment.",inputSchema:c.object({identifier:c.string().max(256).describe("Actor name or ID to assign the voice to."),voiceId:c.string().max(256).describe("Provider-specific voice ID to assign. Pass empty string to clear the voice assignment.")})},{name:"get-character-voice",description:"Get the TTS voice ID assigned to a specific character or NPC. Returns the voice ID if one is configured, or null if the character uses the default voice slot.",inputSchema:c.object({identifier:c.string().max(256).describe("Actor name or ID to look up.")})}];var Im=6e4,IW=c.object({provider:c.string(),model:c.string(),text:c.string()}),EW=c.object({successCount:c.number(),failureCount:c.number(),segments:c.array(c.object({text:c.string(),role:c.string(),index:c.number(),provider:c.string(),model:c.string(),error:c.string().optional()}))}),[uw,dw,pw,mw]=jj;function PW(e,t){e.registerTool(uw.name,{description:uw.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:uw.inputSchema.shape},async({text:r,voice:i,characterId:n})=>{let o=await t.query("generate-voice",{text:r,voice:i,characterId:n},Im);if(!o.success){let s=Yt(o.error),l=Rr(o.error),u=Ho(l);return{content:[{type:"text",text:`Voice generation failed: ${s}${u}`}],isError:!0}}let a=IW.safeParse(o.result);return a.success?{content:[{type:"text",text:`Audio generated by ${a.data.provider} (${a.data.model}) and playing in Foundry VTT. Spoken text: "${a.data.text}"`}]}:{content:[{type:"text",text:`Voice generation failed: unexpected response format \u2014 ${a.error.message}`}],isError:!0}})}function zW(e,t){e.registerTool(dw.name,{description:dw.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:dw.inputSchema.shape},async({segments:r})=>{let i=await t.query("generate-dialogue",{segments:r},Im*2);if(!i.success){let a=Yt(i.error),s=Rr(i.error),l=Ho(s);return{content:[{type:"text",text:`Dialogue generation failed: ${a}${l}`}],isError:!0}}let n=EW.safeParse(i.result);if(!n.success)return{content:[{type:"text",text:`Dialogue generation failed: unexpected response format \u2014 ${n.error.message}`}],isError:!0};let o=n.data.segments.map(a=>a.error!=null&&a.error!==""?` [${a.role}] FAILED: ${a.error}`:` [${a.role}] "${a.text}" \u2014 ${a.provider}`);return{content:[{type:"text",text:`Dialogue (${String(n.data.successCount)}/${String(n.data.segments.length)} segments) playing sequentially in Foundry:
97
+ [Response truncated \u2014 exceeded 200KB. Use more specific queries or filters.]`;let r=0,i=e.length;for(;r<i;){let n=Math.ceil((r+i)/2);JSON.stringify({truncated:!0,totalItems:e.length,items:e.slice(0,n)}).length<=512e3?r=n:i=n-1}return JSON.stringify({truncated:!0,totalItems:e.length,items:e.slice(0,Math.max(1,r))})}function y(e){if(e.success){let s=JSON.stringify(e.result);return s.length<=512e3?{content:[{type:"text",text:s}]}:{content:[{type:"text",text:KH(e.result,s.length)}]}}let t=Xt(e.error),r=Or(e.error),i=Wo(r),o=BE(e.error)===!0?" (retryable)":"";return{content:[{type:"text",text:`${r!==void 0&&r!==""?`Error [${r}]${o}`:"Error"}: ${t}${i}`}],isError:!0}}var Pm=class{constructor(t){this.server=t}bundles=new Map;enabledBundles=new Set;toolRegistry={};initialize(t,r=!1){this.toolRegistry=Ho(this.server);for(let n of D_){let o=t.get(n.id)??[],a={...n,toolNames:o};if(this.bundles.set(n.id,a),r||j_.has(n.id))this.enabledBundles.add(n.id);else for(let s of o)this.toolRegistry[s]?.disable()}let i=[...this.enabledBundles].reduce((n,o)=>n+(this.bundles.get(o)?.toolNames.length??0),0);T.info({coreBundles:[...this.enabledBundles],coreToolCount:i,totalBundles:this.bundles.size},r?"Tool bundles initialized (all enabled for HTTP)":"Tool bundles initialized (lazy loading enabled)")}enableBundle(t){let r=this.bundles.get(t);if(!r)return{enabled:!1,toolNames:[],error:`Unknown bundle: ${t}`};if(this.enabledBundles.has(t))return{enabled:!0,toolNames:r.toolNames,error:"Bundle already enabled"};for(let i of r.toolNames)this.toolRegistry[i]?.enable();return this.enabledBundles.add(t),T.info({bundleId:t,toolCount:r.toolNames.length},"Tool bundle enabled"),{enabled:!0,toolNames:r.toolNames}}disableBundle(t){let r=this.bundles.get(t);if(!r)return{disabled:!1,toolNames:[],error:`Unknown bundle: ${t}`};if(j_.has(t))return{disabled:!1,toolNames:r.toolNames,error:`Core bundle "${t}" cannot be disabled`};if(!this.enabledBundles.has(t))return{disabled:!0,toolNames:r.toolNames};for(let i of r.toolNames)this.toolRegistry[i]?.disable();return this.enabledBundles.delete(t),T.info({bundleId:t,toolCount:r.toolNames.length},"Tool bundle disabled"),{disabled:!0,toolNames:r.toolNames}}listBundles(){return D_.map(t=>{let r=this.bundles.get(t.id);return{id:t.id,name:t.name,description:t.description,toolCount:r?r.toolNames.length:t.toolCount,enabled:this.enabledBundles.has(t.id)}})}isEnabled(t){return this.enabledBundles.has(t)}};function NO(e,t,r){QH(e,t),YH(e,t,r)}function QH(e,t){e.registerTool("list-tool-bundles",{description:"List available tool bundles. Tools are organized into domain bundles that can be enabled on demand. Core bundles (dice, world, chat, combat, characters) are always enabled. Enable additional bundles with enable-tool-bundle when you need their capabilities.",annotations:U},()=>({content:[{type:"text",text:JSON.stringify(t.listBundles())}]})),e.registerTool("enable-tool-bundle",{description:"Enable a tool bundle to access its tools. Call list-tool-bundles first to see available bundles. You can enable multiple bundles. Once enabled, the tools become available for use.",annotations:W,inputSchema:{bundleId:l.string().describe('Bundle ID to enable (e.g., "scenes", "compendium", "playlists")')}},({bundleId:r})=>{let i=t.enableBundle(r);return{content:[{type:"text",text:JSON.stringify(i)}],...i.enabled?{}:{isError:!0}}}),e.registerTool("disable-tool-bundle",{description:"Disable a previously enabled tool bundle to reduce active tool count. Core bundles (dice, world, chat, combat, characters) cannot be disabled. Call list-tool-bundles to see which bundles are currently enabled.",annotations:C,inputSchema:{bundleId:l.string().describe('Bundle ID to disable (e.g., "scenes", "compendium", "playlists")')}},({bundleId:r})=>{let i=t.disableBundle(r);return{content:[{type:"text",text:JSON.stringify(i)}],...i.disabled?{}:{isError:!0}}})}function YH(e,t,r){e.registerTool("get-server-diagnostics",{description:"Get Familiar server diagnostics: tool call metrics (counts, durations, errors) and bundle status. Use for troubleshooting performance or checking which bundles are active.",annotations:U},()=>({content:[{type:"text",text:JSON.stringify({bundles:t.listBundles(),metrics:r?.getSummary()??null})}]}))}var XH=new Set(["__proto__","constructor","prototype"]);function eW(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).filter(([t])=>!XH.has(t))):e}var Ue=l.preprocess(eW,l.record(l.string(),l.unknown()));var fc=[{name:"get-character",description:"Get a character's full stat block. Returns ability scores, HP, AC, skills, saves, items, spells, features, and biography. For a quick overview of all characters, use list-characters instead. Accepts character name (exact match) or Foundry actor ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID")})},{name:"list-characters",description:"List actors in the world with summary info (name, type, HP, AC, level). Returns a paginated list without full stat blocks. Filter by type: 'character' for PCs, 'npc' for NPCs, or 'all'. Response includes total count and hasMore flag. For full details on one character, use get-character instead.",inputSchema:l.object({type:l.enum(["all","character","npc"]).optional().describe("Filter by actor type (default: all)"),limit:l.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"list-party-members",description:"Get all player-owned characters (the adventuring party). Returns a lightweight summary (name, HP, AC, level) by default. Set detailed:true for full character sheets including abilities, items, and effects. Use to quickly see party composition without listing all NPCs.",inputSchema:l.object({detailed:l.boolean().optional().describe("Return full character sheets instead of summaries (default: false)")})},{name:"update-character",description:'Update character data using Foundry dot-notation paths (e.g., {"system.attributes.hp.value": 25}). Use get-character first to see current values and valid paths. Accepts character name (exact match) or Foundry actor ID. Returns the updated actor name and ID.',inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),updates:Ue.describe('Foundry update data (e.g., {"system.attributes.hp.value": 25})')})},{name:"search-character-items",description:"Search a character's inventory, spells, and features. Returns a compact list of matching items (max 50) with IDs, names, and types. Use to find an item before calling get-character-item for full details. Filter by name substring, item type, or both.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),query:l.string().max(256).optional().describe('Filter by name substring (e.g., "sword", "fire")'),type:l.enum(["weapon","spell","feat","equipment","consumable","tool","loot","class","subclass","background","race"]).optional().describe("Filter by item type")})},{name:"get-character-item",description:"Get full details of a specific item, spell, or feature on a character. Returns description, properties, damage, range, and all game mechanics. Use the item ID from search-character-items results.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),itemId:l.string().max(256).describe("Item ID (from search-character-items results)")})},{name:"import-compendium-to-character",description:"Import an item or spell from a compendium pack onto a character's sheet. Copies the compendium entry as a new owned item. Use search-compendium (compendium bundle) first to find the pack key and entry ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),pack:l.string().max(256).describe('Compendium pack key (e.g., "dnd5e.spells")'),entryId:l.string().max(256).describe("Entry ID from search-compendium results")})},{name:"delete-character-items",description:"Remove items, spells, or features from a character permanently. Accepts item names or Foundry document IDs. This is destructive and irreversible. Returns the actor name, count of deleted items, and their IDs.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),itemIds:l.array(l.string().max(256)).min(1).max(100).describe("Item names or Foundry document IDs to remove")})},{name:"rename-character",description:"Rename an actor and update its prototype token name to match. Returns the updated name. Accepts character name (exact match) or Foundry actor ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),name:l.string().max(256).describe("New name for the character")})},{name:"create-character",description:"Create a new blank character (NPC or PC) from scratch. Returns the new actor's ID. For creating variants of existing characters, use duplicate-character instead. To import a compendium creature, use the compendium bundle.",inputSchema:l.object({name:l.string().max(256).describe("Character name"),type:l.enum(["character","npc"]).optional().describe("Character type (default: npc)"),system:Ue.optional().describe("System data (e.g., ability scores, HP)"),img:l.string().max(256).optional().describe("Token/portrait image path"),folderId:l.string().max(256).optional().describe("Folder name or ID")})},{name:"delete-character",description:"Delete a character from the world permanently. Removes the actor and all its owned items, spells, and features. This is irreversible. Tokens on scenes will become unlinked. Returns the deleted character name and ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID")})},{name:"duplicate-character",description:"Clone an existing character to create a copy with all items, spells, and features. Returns the new actor's ID. Use for creating NPC variants (e.g., 'Goblin Archer' from 'Goblin'). For creating characters from scratch, use create-character instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID to clone"),name:l.string().max(256).optional().describe('Name for the copy (default: "<original> (Copy)")')})},{name:"assign-character-ownership",description:"Give a player ownership or limited access to a character. Permission levels: 0=NONE, 1=LIMITED (basic info), 2=OBSERVER (full view), 3=OWNER (full control). Use OWNER (3) to assign a character to a player. Use list-users to find valid user names/IDs. Returns the character name, user name, and applied permission level.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),user:l.string().max(256).describe("Player name or user ID"),level:l.number().int().min(0).max(3).describe("Permission level: 0=NONE, 1=LIMITED, 2=OBSERVER, 3=OWNER")})},{name:"revoke-character-ownership",description:"Remove a player's access to a character by setting their permission to NONE. The character becomes invisible to that player unless default permissions allow it. Use list-users to find valid user names/IDs. Returns the character and user names.",inputSchema:l.object({identifier:l.string().max(256).describe("Character name or Foundry actor ID"),user:l.string().max(256).describe("Player name or user ID")})}];var C_=fc[12],A_=fc[13];function CO(e,t){e.registerTool(C_.name,{description:C_.description,annotations:W,inputSchema:C_.inputSchema.shape},async({identifier:r,user:i,level:n})=>y(await t.query("assign-character-ownership",{identifier:r,userIdentifier:i,level:n}))),e.registerTool(A_.name,{description:A_.description,annotations:W,inputSchema:A_.inputSchema.shape},async({identifier:r,user:i})=>y(await t.query("revoke-character-ownership",{identifier:r,userIdentifier:i})))}var[M_,U_,L_,q_,Z_,F_,V_,B_,H_,W_,J_,G_]=fc;function tW(e,t){e.registerTool(M_.name,{description:M_.description,annotations:U,inputSchema:M_.inputSchema.shape},async({identifier:r})=>y(await t.query("get-character",{identifier:r}))),e.registerTool(U_.name,{description:U_.description,annotations:U,inputSchema:U_.inputSchema.shape},async({type:r,limit:i,offset:n})=>y(await t.query("list-characters",{type:r,limit:i,offset:n}))),e.registerTool(L_.name,{description:L_.description,annotations:U,inputSchema:L_.inputSchema.shape},async({detailed:r})=>y(await t.query("list-party-members",{detailed:r})))}function rW(e,t){e.registerTool(Z_.name,{description:Z_.description,annotations:U,inputSchema:Z_.inputSchema.shape},async({identifier:r,query:i,type:n})=>y(await t.query("search-character-items",{identifier:r,query:i,type:n}))),e.registerTool(F_.name,{description:F_.description,annotations:U,inputSchema:F_.inputSchema.shape},async({identifier:r,itemId:i})=>y(await t.query("get-character-item",{identifier:r,itemId:i})))}function nW(e,t){e.registerTool(V_.name,{description:V_.description,annotations:C,inputSchema:V_.inputSchema.shape},async({identifier:r,pack:i,entryId:n})=>y(await t.query("import-compendium-to-character",{identifier:r,pack:i,entryId:n}))),e.registerTool(B_.name,{description:B_.description,annotations:X,inputSchema:B_.inputSchema.shape},async({identifier:r,itemIds:i})=>y(await t.query("delete-character-items",{identifier:r,itemIds:i})))}function iW(e,t){rW(e,t),nW(e,t)}function oW(e,t){e.registerTool(q_.name,{description:q_.description,annotations:W,inputSchema:q_.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-character",{identifier:r,updates:i}))),e.registerTool(H_.name,{description:H_.description,annotations:W,inputSchema:H_.inputSchema.shape},async({identifier:r,name:i})=>y(await t.query("rename-character",{identifier:r,name:i})))}function aW(e,t){e.registerTool(W_.name,{description:W_.description,annotations:C,inputSchema:W_.inputSchema.shape},async({name:r,type:i,system:n,img:o,folderId:a})=>y(await t.query("create-character",{name:r,type:i,system:n,img:o,folderId:a}))),e.registerTool(J_.name,{description:J_.description,annotations:X,inputSchema:J_.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-character",{identifier:r}))),e.registerTool(G_.name,{description:G_.description,annotations:C,inputSchema:G_.inputSchema.shape},async({identifier:r,name:i})=>y(await t.query("duplicate-character",{identifier:r,name:i})))}function sW(e,t){oW(e,t),aW(e,t),CO(e,t)}function AO(e,t){tW(e,t),iW(e,t),sW(e,t)}var MO=[{name:"toggle-condition",description:"Toggle a status condition on a token (e.g., prone, poisoned, blinded). Adds the condition if absent, removes it if present. Use get-available-conditions first to see valid condition names. Returns the token name and toggled condition.",inputSchema:l.object({identifier:l.string().max(256).describe("Token name or ID"),condition:l.string().max(256).describe('Condition name (e.g., "prone", "poisoned", "blinded")')})},{name:"apply-condition-to-group",description:"Toggle a status condition on multiple tokens at once. Adds the condition if absent, removes it if present (per token). Use for AoE effects like mass Prone, Frightened, or Poisoned. Use get-available-conditions first to see valid condition names. Returns per-token toggle results.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(50).describe("Token names or IDs to apply the condition to"),condition:l.string().max(256).describe('Condition name (e.g., "prone", "poisoned", "frightened")')})},{name:"start-combat",description:"Create a new combat encounter and add combatants from the current scene. If no identifiers are provided, all tokens on the active scene are added automatically. Returns the combat tracker with all added combatants. After starting, use roll-initiative to set turn order.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).max(100).describe("Token names or Foundry IDs to add as combatants. Omit to add all tokens on the current scene.").optional()})},{name:"end-combat",description:"End the current combat encounter. Removes all combatants from the tracker and resets initiative order. Use when a fight ends or to clean up before starting a new encounter. Combat data (rounds, turns) is lost \u2014 check get-combat first if you need to record results."},{name:"get-combat",description:"Get the current combat tracker state. Returns round number, active turn, and all combatants with initiative order, HP, AC, and conditions. For a richer snapshot with positions and abilities for AI decision-making, use get-combat-snapshot (combat-ai bundle) instead."},{name:"roll-initiative",description:"Roll initiative for combatants in the active encounter. Returns rolled values and updated turn order. Omit combatantIds to roll for all combatants. For rolling only NPCs (letting players roll their own), use roll-npc-initiative instead.",inputSchema:l.object({combatantIds:l.array(l.string().max(256)).max(50).optional().describe("Specific combatant IDs to roll for (omit to roll for all)")})},{name:"roll-npc-initiative",description:"Roll initiative for all NPC combatants only, skipping player characters. Returns rolled values and updated turn order. Use when players prefer to roll their own initiative. For rolling everyone at once, use roll-initiative instead."},{name:"next-turn",description:"Advance combat to the next combatant's turn. Returns the new active combatant. If combat hasn't started yet, this begins the first turn. Automatically wraps to the next round after the last combatant."},{name:"next-round",description:"Advance combat to the next round, resetting to the top of initiative order. Returns the new round number and active combatant. Use to skip remaining turns in the current round."},{name:"get-available-conditions",description:"List all status conditions available in the game system (e.g., prone, poisoned, blinded, stunned). Returns every condition (no pagination) with ID and label. Named get-* rather than list-* because conditions are static system data, not user-created documents. Use to find valid condition IDs before applying them with toggle-condition or apply-condition-to-group."},{name:"apply-damage",description:"Apply damage to multiple targets in a single batch. Handles temp HP absorption automatically. Returns per-target results with HP before/after. Use during combat to resolve AoE effects, multi-attack actions, or lair actions that hit several creatures at once.",inputSchema:l.object({targets:l.array(l.object({identifier:l.string().max(256).describe("Token name or ID on the active scene"),amount:l.number().min(0).describe("Damage amount to apply"),type:l.string().max(256).optional().describe('Damage type (e.g., "fire", "slashing") \u2014 informational only')})).min(1).max(50).describe("Array of damage targets")})},{name:"heal-party",description:"Heal all party members or a specific character. Healing is capped at max HP. Omit identifier to heal the entire party. Use after combat, during a rest, or when applying healing spells/potions to multiple characters.",inputSchema:l.object({amount:l.number().min(1).describe("Amount of HP to restore"),identifier:l.string().max(256).optional().describe("Character name or actor ID (omit to heal all party members)")})},{name:"rest-party",description:"Apply short or long rest to all party members. Long rest: restores full HP, resets all resources, and restores spell slots. Short rest: allows hit dice recovery and resets short-rest resources. Triggers rest dialogs in chat. Returns per-character results with success/failure and HP recovery details.",inputSchema:l.object({type:l.enum(["short","long"]).describe('Rest type: "short" or "long"')})},{name:"add-combatant",description:"Add tokens to an active combat encounter as new combatants. Use for mid-combat reinforcements. Requires an active combat.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(50).describe("Token names or IDs to add to the active combat")})},{name:"remove-combatant",description:"Remove combatants from the active combat encounter. Use for creatures that fled, were banished, or otherwise left combat. Use combatant IDs from get-combat.",inputSchema:l.object({combatantIds:l.array(l.string().max(256)).min(1).max(50).describe("Combatant IDs to remove (from get-combat results, not token IDs)")})},{name:"award-xp",description:"Award experience points to party members. Divides the total XP evenly among recipients. Use after combat or for milestone rewards.",inputSchema:l.object({amount:l.number().int().min(1).describe("Total XP to award (divided among recipients)"),identifiers:l.array(l.string().max(256)).max(20).optional().describe("Specific character names/IDs to award XP to (defaults to all party members)"),reason:l.string().max(512).optional().describe("Reason for the XP award (shown in chat)")})},{name:"quick-start-combat",description:"Create a combat encounter, add combatants, and roll initiative in one step. Omit identifiers to add all scene tokens. Set rollNpcOnly to let players roll their own initiative.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).max(100).optional().describe("Token names or IDs to add (defaults to all scene tokens)"),rollNpcOnly:l.boolean().optional().describe("Only roll initiative for NPCs (default: false)")})}];var[K_,Q_,Y_,UO,LO,X_,qO,ZO,FO,VO,eS,tS,rS,nS,iS,oS,aS]=MO;function cW(e,t){e.registerTool(K_.name,{description:K_.description,annotations:C,inputSchema:K_.inputSchema.shape},async({identifier:r,condition:i})=>y(await t.query("toggle-condition",{identifier:r,condition:i}))),e.registerTool(Q_.name,{description:Q_.description,annotations:C,inputSchema:Q_.inputSchema.shape},async({identifiers:r,condition:i})=>y(await t.query("apply-condition-to-group",{identifiers:r,condition:i})))}function lW(e,t){e.registerTool(Y_.name,{description:Y_.description,annotations:C,inputSchema:Y_.inputSchema.shape},async({identifiers:r})=>y(await t.query("start-combat",{identifiers:r}))),e.registerTool(UO.name,{description:UO.description,annotations:mc},async()=>y(await t.query("end-combat"))),e.registerTool(LO.name,{description:LO.description,annotations:U},async()=>y(await t.query("get-combat"))),e.registerTool(X_.name,{description:X_.description,annotations:C,inputSchema:X_.inputSchema.shape},async({combatantIds:r})=>y(await t.query("roll-initiative",{combatantIds:r}))),e.registerTool(qO.name,{description:qO.description,annotations:C},async()=>y(await t.query("roll-npc-initiative"))),e.registerTool(aS.name,{description:aS.description,annotations:C,inputSchema:aS.inputSchema.shape},async({identifiers:r,rollNpcOnly:i})=>y(await t.query("quick-start-combat",{identifiers:r,rollNpcOnly:i})))}function uW(e,t){e.registerTool(ZO.name,{description:ZO.description,annotations:C},async()=>y(await t.query("next-turn"))),e.registerTool(FO.name,{description:FO.description,annotations:C},async()=>y(await t.query("next-round"))),e.registerTool(VO.name,{description:VO.description,annotations:U},async()=>y(await t.query("get-available-conditions")))}function dW(e,t){lW(e,t),uW(e,t)}function pW(e,t){e.registerTool(eS.name,{description:eS.description,annotations:C,inputSchema:eS.inputSchema.shape},async({targets:r})=>y(await t.query("apply-damage",{targets:r}))),e.registerTool(tS.name,{description:tS.description,annotations:C,inputSchema:tS.inputSchema.shape},async({amount:r,identifier:i})=>y(await t.query("heal-party",{amount:r,identifier:i}))),e.registerTool(rS.name,{description:rS.description,annotations:C,inputSchema:rS.inputSchema.shape},async({type:r})=>y(await t.query("rest-party",{type:r})))}function mW(e,t){e.registerTool(nS.name,{description:nS.description,annotations:C,inputSchema:nS.inputSchema.shape},async({identifiers:r})=>y(await t.query("add-combatant",{identifiers:r}))),e.registerTool(iS.name,{description:iS.description,annotations:mc,inputSchema:iS.inputSchema.shape},async({combatantIds:r})=>y(await t.query("remove-combatant",{combatantIds:r}))),e.registerTool(oS.name,{description:oS.description,annotations:C,inputSchema:oS.inputSchema.shape},async({amount:r,identifiers:i,reason:n})=>y(await t.query("award-xp",{amount:r,identifiers:i,reason:n})))}function BO(e,t){cW(e,t),dW(e,t),pW(e,t),mW(e,t)}var HO=[{name:"get-combat-snapshot",description:"Get a comprehensive combat snapshot for AI decision-making. Returns the current combatant's full stat block, all combatants with HP/AC/conditions, battlefield token positions with distances, and available weapons/spells/features. Designed to give an AI everything needed to decide an NPC's turn in a single call."},{name:"resolve-attack",description:"Resolve an NPC weapon attack against a target. Rolls the attack (with optional advantage/disadvantage), compares against target AC, rolls damage on hit (doubled dice on critical), applies damage to the target, and posts the result to chat.",inputSchema:l.object({attacker:l.string().max(256).describe("Name or Foundry token ID of the attacking NPC"),target:l.string().max(256).describe("Name or Foundry token ID of the target"),weapon:l.string().max(256).describe("Weapon name or item ID on the attacker"),advantage:l.boolean().optional().describe("Roll with advantage (2d20 keep highest)"),disadvantage:l.boolean().optional().describe("Roll with disadvantage (2d20 keep lowest)"),smiteLevel:l.number().int().min(1).max(5).optional().describe("Divine Smite: expend a spell slot at this level for bonus radiant damage (2d8 + 1d8/level above 1st)")})},{name:"resolve-movement",description:"Move a token to a new position on the battlefield during combat. Coordinates are in pixels (from scene top-left). Calculates distance moved in game units (feet), compares against the actor's walk speed, updates the token position, and reports movement remaining. Use this during combat turns instead of move-token \u2014 it enforces movement speed limits.",inputSchema:l.object({identifier:l.string().max(256).describe("Token name or Foundry ID to move"),x:l.number().int().describe("Target X position in pixels (from scene top-left)"),y:l.number().int().describe("Target Y position in pixels (from scene top-left)")})},{name:"resolve-spell",description:"Cast a spell from an NPC. Consumes a spell slot (if not a cantrip), resolves spell attacks or saving throws per target, rolls and applies damage, handles concentration, and posts results to chat.",inputSchema:l.object({caster:l.string().max(256).describe("Name or Foundry token ID of the caster"),spell:l.string().max(256).describe("Spell name or item ID on the caster"),targets:l.array(l.string().max(256)).max(50).describe("Token names or Foundry IDs of the targets"),upcastLevel:l.number().int().min(1).max(9).optional().describe("Cast at a higher spell level (upcasting)")})},{name:"resolve-saving-throw",description:"Force a saving throw on a target. Rolls d20 + save modifier against a DC and reports success or failure.",inputSchema:l.object({target:l.string().max(256).describe("Name or Foundry token ID of the target"),ability:l.enum(["str","dex","con","int","wis","cha"]).describe("Ability for the save (str, dex, con, int, wis, cha)"),dc:l.number().int().min(1).max(99).describe("Difficulty class for the saving throw")})},{name:"resolve-death-save",description:"Resolve a death saving throw for a target at 0 HP. Rolls 1d20: natural 20 revives with 1 HP, natural 1 counts as two failures, >= 10 is a success, < 10 is a failure. 3 successes stabilize, 3 failures kill.",inputSchema:l.object({target:l.string().max(256).describe("Name or Foundry token ID of the target at 0 HP")})},{name:"resolve-ability-check",description:"Roll an ability check or skill check against a DC. Use for contested checks (grapple, shove), skill checks in combat (Athletics, Acrobatics), and Counterspell level contests. Unlike saving throws, ability checks use the raw ability modifier (or skill total if proficient).",inputSchema:l.object({target:l.string().max(256).describe("Token name or ID of the creature making the check"),ability:l.enum(["str","dex","con","int","wis","cha"]).describe("Ability to check (str, dex, con, int, wis, cha)"),dc:l.number().int().min(1).max(99).describe("Difficulty class to beat"),skill:l.enum(["acr","ani","arc","ath","dec","his","ins","itm","inv","med","nat","prc","prf","per","rel","sle","ste","sur"]).optional().describe("Skill to use (e.g. athletics, acrobatics) \u2014 adds proficiency bonus if proficient"),advantage:l.boolean().optional().describe("Force advantage on the roll"),disadvantage:l.boolean().optional().describe("Force disadvantage on the roll")})},{name:"resolve-multiattack",description:"Resolve a Multiattack action for an NPC. Parses the Multiattack feature description, identifies component attacks, and resolves each. Returns all attack results plus a damage summary. Falls back with an error message if parsing fails \u2014 use individual resolve-attack calls instead.",inputSchema:l.object({attacker:l.string().max(256).describe("Token name or ID of the attacker with Multiattack"),target:l.string().max(256).describe("Token name or ID of the target")})},{name:"resolve-action",description:"Use the Dash, Dodge, or Disengage action. Dash doubles movement speed for the turn. Dodge gives disadvantage on incoming attacks until next turn. Disengage prevents opportunity attacks. Consumes the action for the turn.",inputSchema:l.object({identifier:l.string().max(256).describe("Token name or ID"),action:l.enum(["dash","dodge","disengage"]).describe("Action to take")})},{name:"resolve-legendary-action",description:"Use a legendary action between other creatures' turns. Validates charges, deducts the cost, and executes the action. Cannot be used on the creature's own turn. Legendary actions recharge at the start of the creature's turn.",inputSchema:l.object({actor:l.string().max(256).describe("Token name or ID of the creature with legendary actions"),feature:l.string().max(256).describe("Name of the legendary action feature to use")})},{name:"query-aoe-targets",description:"Find tokens within a circular area of effect. Pass center coordinates (pixels, from battlefield token positions) and radius in feet. Returns all tokens within range sorted by distance. Use this to plan AoE spell targeting before casting.",inputSchema:l.object({x:l.number().int().describe("Center X coordinate in pixels"),y:l.number().int().describe("Center Y coordinate in pixels"),radius:l.number().min(1).max(1e3).describe("Radius in game distance units (feet)")})},{name:"get-movement-options",description:"Get pre-scored tactical movement options for the current combatant. Returns up to 5 positions within walk speed, each scored and categorized (advance, retreat, flank, hold, approach-ally). Includes opportunity attack risk warnings and cover analysis. Scores factor in combat role (melee/ranged/caster), HP-based retreat urgency, and creature intelligence. Coordinates are in pixels for resolve-movement. Call this before deciding where to move.",inputSchema:l.object({identifier:l.string().max(256).describe("Token name or Foundry ID of the moving token")})}];var[WO,sS,cS,lS,uS,dS,pS,mS,fS,hS,gS,yS]=HO;function fW(e,t){e.registerTool(WO.name,{description:WO.description,annotations:U},async()=>y(await t.query("get-combat-snapshot"))),e.registerTool(sS.name,{description:sS.description,annotations:C,inputSchema:sS.inputSchema.shape},async({attacker:r,target:i,weapon:n,advantage:o,disadvantage:a,smiteLevel:s})=>y(await t.query("resolve-attack",{attacker:r,target:i,weapon:n,advantage:o,disadvantage:a,smiteLevel:s}))),e.registerTool(cS.name,{description:cS.description,annotations:C,inputSchema:cS.inputSchema.shape},async({identifier:r,x:i,y:n})=>y(await t.query("resolve-movement",{identifier:r,x:i,y:n})))}function hW(e,t){e.registerTool(lS.name,{description:lS.description,annotations:C,inputSchema:lS.inputSchema.shape},async({caster:r,spell:i,targets:n,upcastLevel:o})=>y(await t.query("resolve-spell",{caster:r,spell:i,targets:n,upcastLevel:o}))),e.registerTool(uS.name,{description:uS.description,annotations:C,inputSchema:uS.inputSchema.shape},async({target:r,ability:i,dc:n})=>y(await t.query("resolve-saving-throw",{target:r,ability:i,dc:n}))),e.registerTool(dS.name,{description:dS.description,annotations:C,inputSchema:dS.inputSchema.shape},async({target:r})=>y(await t.query("resolve-death-save",{target:r}))),e.registerTool(pS.name,{description:pS.description,annotations:C,inputSchema:pS.inputSchema.shape},async({target:r,ability:i,dc:n,skill:o,advantage:a,disadvantage:s})=>y(await t.query("resolve-ability-check",{target:r,ability:i,dc:n,skill:o,advantage:a,disadvantage:s}))),e.registerTool(mS.name,{description:mS.description,annotations:C,inputSchema:mS.inputSchema.shape},async({attacker:r,target:i})=>y(await t.query("resolve-multiattack",{attacker:r,target:i}))),e.registerTool(fS.name,{description:fS.description,annotations:C,inputSchema:fS.inputSchema.shape},async({identifier:r,action:i})=>y(await t.query("resolve-action",{identifier:r,action:i})))}function gW(e,t){e.registerTool(hS.name,{description:hS.description,annotations:C,inputSchema:hS.inputSchema.shape},async({actor:r,feature:i})=>y(await t.query("resolve-legendary-action",{actor:r,feature:i}))),e.registerTool(gS.name,{description:gS.description,annotations:U,inputSchema:gS.inputSchema.shape},async({x:r,y:i,radius:n})=>y(await t.query("query-aoe-targets",{x:r,y:i,radius:n}))),e.registerTool(yS.name,{description:yS.description,annotations:U,inputSchema:yS.inputSchema.shape},async({identifier:r})=>y(await t.query("get-movement-options",{identifier:r})))}function JO(e,t){fW(e,t),hW(e,t),gW(e,t)}var GO=[{name:"search-compendium",description:"Search compendium packs for items, creatures, spells, or journal entries by name. Returns matching entries with names, pack keys, and IDs. For Actor packs, supports filtering by CR, creature type (beast/undead/fiend/etc.), and size. Use get-compendium-entry to read full stat blocks or descriptions of a result.",inputSchema:l.object({query:l.string().max(256).describe('Search term (e.g., "fireball", "goblin", "longsword")'),type:l.string().max(256).optional().describe('Filter by pack type: "Actor", "Item", "JournalEntry", etc.'),cr:l.number().min(0).optional().describe("Filter creatures by Challenge Rating (e.g., 0.25, 1, 5)"),creatureType:l.string().max(256).optional().describe('Filter creatures by type (e.g., "beast", "undead", "fiend")'),size:l.enum(["tiny","sm","med","lg","huge","grg"]).optional().describe("Filter creatures by size")})},{name:"get-compendium-entry",description:"Get full details of a compendium entry. Returns complete stat blocks for creatures, spell descriptions with mechanics, or item properties. Use the pack key and ID from search-compendium results.",inputSchema:l.object({pack:l.string().max(256).describe('Pack collection key (e.g., "dnd5e.monsters")'),entryId:l.string().max(256).describe("Entry ID from search results")})},{name:"list-compendium-packs",description:"List all available compendium packs. Returns each pack's ID (collection key, e.g., 'dnd5e.spells'), document type (Actor, Item, JournalEntry, Scene, etc.), human-readable label, and entry count. Use the returned pack IDs with search-compendium and get-compendium-entry to find and retrieve specific entries."},{name:"create-character-from-compendium",description:"Import a creature or NPC from a compendium pack into the world as a new actor with its full stat block, items, spells, and features. Returns the new actor ID. Use search-compendium first to find the pack key and entry ID. For creating a blank character from scratch, use create-character (characters bundle) instead.",inputSchema:l.object({pack:l.string().max(256).describe('Pack collection key (e.g., "dnd5e.monsters")'),entryId:l.string().max(256).describe("Entry ID from search results"),name:l.string().max(256).optional().describe('Override actor name (e.g., "Goblin Archer")')})}];var[vS,bS,KO,_S]=GO;function QO(e,t){e.registerTool(vS.name,{description:vS.description,annotations:U,inputSchema:vS.inputSchema.shape},async({query:r,type:i,cr:n,creatureType:o,size:a})=>y(await t.query("search-compendium",{query:r,type:i,cr:n,creatureType:o,size:a}))),e.registerTool(bS.name,{description:bS.description,annotations:U,inputSchema:bS.inputSchema.shape},async({pack:r,entryId:i})=>y(await t.query("get-compendium-entry",{pack:r,entryId:i}))),e.registerTool(KO.name,{description:KO.description,annotations:U},async()=>y(await t.query("list-compendium-packs"))),e.registerTool(_S.name,{description:_S.description,annotations:C,inputSchema:_S.inputSchema.shape},async({pack:r,entryId:i,name:n})=>y(await t.query("create-character-from-compendium",{pack:r,entryId:i,name:n})))}var YO=[{name:"roll-dice",description:"Roll a dice formula and return the numeric result. Supports standard notation (1d20+5, 2d6+3) and advanced syntax (4d6kh3 keep highest, 2d20kl1 keep lowest). Result is posted to Foundry chat by default. For attack rolls or spell damage during combat, prefer resolve-attack or resolve-spell (combat-ai bundle) instead.",inputSchema:l.object({formula:l.string().max(256).describe('Dice formula (e.g., "1d20+5", "2d6+3", "4d6kh3")'),showInChat:l.boolean().optional().describe("Show the roll result in Foundry chat (default: true)")})}];function XO(e,t){let[r]=YO;e.registerTool(r.name,{description:r.description,annotations:C,inputSchema:r.inputSchema.shape},async({formula:i,showInChat:n})=>y(await t.query("roll-dice",{formula:i,showInChat:n})))}var ej=[{name:"list-journals",description:"List journal entries in the world with pagination. Returns each entry's name, ID, page count with page names/IDs, and folder path. Response includes total count and hasMore flag. Filter by folder name for organized worlds. For searching journal content, use search-journals instead.",inputSchema:l.object({folder:l.string().max(256).optional().describe("Filter by folder name (substring match)"),limit:l.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-journals",description:"Search journal entries by title and page content text. Returns matching entries with names, IDs, and text snippets showing where the search term appears. Use to find specific lore, notes, or session records. For browsing all journals, use list-journals instead.",inputSchema:l.object({query:l.string().max(256).describe("Search term to find in journal titles and page content")})},{name:"get-journal",description:"Get a full journal entry with all page content rendered as plain text (HTML stripped). Returns the entry name and all pages with their names, IDs, types, and full content. For reading a single page, use get-journal-page instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Journal entry name or Foundry ID")})},{name:"get-journal-page",description:"Get a single page from a journal entry with full content. Use the page ID from list-journals or get-journal results. For reading all pages at once, use get-journal instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Journal entry name or Foundry ID"),pageId:l.string().max(256).describe("Page ID (from list-journals or get-journal results)")})},{name:"create-journal",description:"Create a new journal entry, optionally with initial pages of content. Returns the new journal ID and page IDs. Pages support HTML formatting. Use for session notes, lore, NPC details, handouts, or quest tracking.",inputSchema:l.object({name:l.string().max(256).describe("Journal entry name"),folderId:l.string().max(256).optional().describe("Folder name or ID to place the journal in"),pages:l.array(l.object({name:l.string().max(256),content:l.string().max(5e4)})).max(100).optional().describe("Initial pages to create (each with name and HTML/text content)")})},{name:"create-journal-page",description:"Add a new page to an existing journal entry. Returns the new page ID. Supports text (HTML or plain text), image, video, and PDF page types. Default type is text.",inputSchema:l.object({identifier:l.string().max(256).describe("Journal entry name or Foundry ID"),name:l.string().max(256).describe("Page name"),content:l.string().max(5e4).describe("Page content (HTML or plain text)"),type:l.enum(["text","image","video","pdf"]).optional().describe("Page type (default: text)")})},{name:"update-journal",description:"Update a journal entry's properties. Rename it, move it to a different folder, or change ownership. For updating page content, use update-journal-page instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Journal entry name or Foundry ID"),name:l.string().max(256).optional().describe("New journal entry name"),folderId:l.string().max(256).optional().describe("Folder name or ID to move the journal to"),ownership:l.record(l.string(),l.number().int().min(-1).max(3)).optional().describe('Ownership levels by user ID or "default" (0=None, 1=Limited, 2=Observer, 3=Owner)')})},{name:"update-journal-page",description:"Replace the content of an existing journal page. Accepts HTML or plain text. Use get-journal first to read the current content before overwriting.",inputSchema:l.object({identifier:l.string().max(256).describe("Journal entry name or Foundry ID"),pageId:l.string().max(256).describe("Page ID (from get-journal results)"),content:l.string().max(5e4).describe("New page content (HTML or plain text)")})},{name:"delete-journal",description:"Delete a journal entry and all its pages permanently. This is irreversible. Map pins linked to this journal will lose their link. Returns the deleted journal name and ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Journal entry name or Foundry ID")})},{name:"delete-journal-page",description:"Delete a single page from a journal entry. The journal entry itself and other pages are preserved. This is irreversible. Returns the journal name and deleted page ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Journal entry name or Foundry ID"),pageId:l.string().max(256).describe("Page ID to delete")})}];var[SS,xS,wS,$S,kS,TS,IS,ES,PS,zS]=ej;function yW(e,t){e.registerTool(SS.name,{description:SS.description,annotations:U,inputSchema:SS.inputSchema.shape},async({folder:r,limit:i,offset:n})=>y(await t.query("list-journals",{folder:r,limit:i,offset:n}))),e.registerTool(xS.name,{description:xS.description,annotations:U,inputSchema:xS.inputSchema.shape},async({query:r})=>y(await t.query("search-journals",{query:r}))),e.registerTool(wS.name,{description:wS.description,annotations:U,inputSchema:wS.inputSchema.shape},async({identifier:r})=>y(await t.query("get-journal",{identifier:r}))),e.registerTool($S.name,{description:$S.description,annotations:U,inputSchema:$S.inputSchema.shape},async({identifier:r,pageId:i})=>y(await t.query("get-journal-page",{identifier:r,pageId:i})))}function vW(e,t){e.registerTool(kS.name,{description:kS.description,annotations:C,inputSchema:kS.inputSchema.shape},async({name:r,folderId:i,pages:n})=>y(await t.query("create-journal",{name:r,folderId:i,pages:n}))),e.registerTool(TS.name,{description:TS.description,annotations:C,inputSchema:TS.inputSchema.shape},async({identifier:r,name:i,content:n,type:o})=>y(await t.query("create-journal-page",{identifier:r,name:i,content:n,type:o}))),e.registerTool(IS.name,{description:IS.description,annotations:W,inputSchema:IS.inputSchema.shape},async({identifier:r,name:i,folderId:n,ownership:o})=>{let a={};return i!==void 0&&(a.name=i),n!==void 0&&(a.folderId=n),o!==void 0&&(a.ownership=o),y(await t.query("update-journal",{identifier:r,updates:a}))}),e.registerTool(ES.name,{description:ES.description,annotations:W,inputSchema:ES.inputSchema.shape},async({identifier:r,pageId:i,content:n})=>y(await t.query("update-journal-page",{identifier:r,pageId:i,content:n}))),e.registerTool(PS.name,{description:PS.description,annotations:X,inputSchema:PS.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-journal",{identifier:r}))),e.registerTool(zS.name,{description:zS.description,annotations:X,inputSchema:zS.inputSchema.shape},async({identifier:r,pageId:i})=>y(await t.query("delete-journal-page",{identifier:r,pageId:i})))}function tj(e,t){yW(e,t),vW(e,t)}var rj=[{name:"move-token",description:"Move a token to x,y pixel coordinates on the current scene. Use for general repositioning outside of combat. During combat turns, use resolve-movement (combat-ai bundle) instead \u2014 it tracks movement speed and remaining distance.",inputSchema:l.object({identifier:l.string().max(256).describe("Token name or ID"),x:l.number().min(-5e4).max(5e4).describe("Target X position in pixels (from scene top-left)"),y:l.number().min(-5e4).max(5e4).describe("Target Y position in pixels (from scene top-left)")})},{name:"update-token",description:"Update token visual properties on the current scene. Supports hidden, elevation, size, rotation, and disposition. For moving a token to new coordinates, use move-token instead. For applying status conditions, use toggle-condition.",inputSchema:l.object({identifier:l.string().max(256).describe("Token name or ID"),hidden:l.boolean().optional().describe("Hide/show the token"),elevation:l.number().optional().describe("Token elevation in feet"),width:l.number().min(.5).optional().describe("Token width in grid units"),height:l.number().min(.5).optional().describe("Token height in grid units"),rotation:l.number().min(0).max(360).optional().describe("Token rotation in degrees (0-360)"),disposition:l.number().int().min(-2).max(1).optional().describe("Token disposition: -2=secret, -1=hostile, 0=neutral, 1=friendly")})},{name:"update-tokens",description:"Batch update properties on multiple tokens at once. Supports hidden, elevation, size, rotation, and disposition. Returns per-token results. Use to hide/reveal a group of tokens, change dispositions for multiple NPCs, or adjust elevation for a flying group.",inputSchema:l.object({updates:l.array(l.object({identifier:l.string().max(256).describe("Token name or ID"),hidden:l.boolean().optional().describe("Hide/show the token"),elevation:l.number().optional().describe("Token elevation in feet"),width:l.number().min(.5).optional().describe("Token width in grid units"),height:l.number().min(.5).optional().describe("Token height in grid units"),rotation:l.number().min(0).max(360).optional().describe("Token rotation in degrees (0-360)"),disposition:l.number().int().min(-2).max(1).optional().describe("Token disposition: -2=secret, -1=hostile, 0=neutral, 1=friendly")})).min(1).max(100).describe("Array of token updates")})},{name:"create-tokens",description:"Place one or more tokens on the active scene from world actors. Supports batch placement for encounter setup. Returns the created token IDs. Use start-combat afterward to begin a combat encounter with the placed tokens.",inputSchema:l.object({tokens:l.array(l.object({actorId:l.string().max(256).describe("World actor ID"),x:l.number().min(-5e4).max(5e4).describe("X position in pixels (from scene top-left)"),y:l.number().min(-5e4).max(5e4).describe("Y position in pixels (from scene top-left)"),hidden:l.boolean().optional().describe("Hidden from players (default: false)"),disposition:l.number().int().min(-2).max(1).optional().describe("-2=secret, -1=hostile, 0=neutral, 1=friendly"),name:l.string().max(256).optional().describe("Override token name")})).max(100).describe("Array of tokens to place")})},{name:"delete-tokens",description:"Remove tokens from the active scene permanently. Accepts token names or IDs. This does not delete the underlying actor \u2014 only the token placement on this scene. Returns the count of deleted tokens, their IDs, and any errors for tokens not found.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Token names or IDs to delete")})}];var Fe=[{name:"get-current-scene",description:"Get the active scene with paginated token data. Returns scene name, dimensions (width/height in pixels), grid settings (size, distance), darkness level, and tokens with name, position (x,y in pixels), HP, AC, conditions, and vision range. Token list includes total count and hasMore flag. Use at the start of combat or when you need to understand the current battlefield layout.",inputSchema:l.object({limit:l.number().int().min(1).max(500).optional().describe("Max tokens to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of tokens to skip (default: 0)")})},{name:"get-scene",description:"Get full details of any scene by name or ID, including dimensions, grid settings, darkness level, weather, background image, folder, and paginated token list. Unlike get-current-scene (which only returns the active scene), this works for any scene in the world.",inputSchema:l.object({identifier:l.string().max(256).describe("Scene name or Foundry ID"),limit:l.number().int().min(1).max(500).optional().describe("Max tokens to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of tokens to skip (default: 0)")})},{name:"list-scenes",description:"List scenes in the world with pagination. Returns each scene's name, ID, active/viewed status, and thumbnail. Response includes total count and hasMore flag. Use to find a scene before switching to it with switch-scene.",inputSchema:l.object({limit:l.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-scenes",description:"Search scenes by name. Returns matching scenes with names, IDs, and active status. Use to find a scene when you only know part of the name.",inputSchema:l.object({query:l.string().max(256).describe("Search text to match against scene name")})},{name:"switch-scene",description:"Switch the active scene by name or ID. All players are pulled to the new scene. Returns the new active scene data. Use pan-canvas afterward to focus on a specific area.",inputSchema:l.object({identifier:l.string().max(256).describe("Scene name or ID")})},...rj,{name:"create-scene",description:"Create a blank scene with NO background image. Only use this for empty grids or technical scenes \u2014 if the user wants a battle map, dungeon, tavern, or any scene with a background image, ALWAYS use generate-scene instead (it creates the scene AND generates + applies the background in one step). Returns the new scene ID. The scene is not activated automatically \u2014 use switch-scene to make it active. Default size is 4000\xD73000 pixels with 100px grid squares (5ft per square).",inputSchema:l.object({name:l.string().max(256).describe("Scene name"),width:l.number().min(1).optional().describe("Scene width in pixels (default: 4000)"),height:l.number().min(1).optional().describe("Scene height in pixels (default: 3000)"),gridSize:l.number().min(1).optional().describe("Grid square size in pixels (default: 100)"),gridDistance:l.number().min(1).optional().describe("Grid distance per square in feet (default: 5)"),background:l.string().max(256).optional().describe("Background image path")})},{name:"update-scene",description:"Update scene properties using Foundry dot-notation paths. Supports name, grid, dimensions, background image, navigation visibility, and more. Use get-current-scene first to see current values.",inputSchema:l.object({identifier:l.string().max(256).describe("Scene name or ID"),updates:Ue.describe('Foundry update data (e.g., {"name": "New Name", "navigation": true, "background.src": "path"})')})},{name:"delete-scene",description:"Delete a scene from the world permanently. Removes all tokens, walls, lights, and sounds on the scene. This is irreversible. Returns the deleted scene name and ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Scene name or ID")})},{name:"pan-canvas",description:"Pan and zoom the GM canvas camera to a position. Animates smoothly over the specified duration. Use after switch-scene to focus on a specific area, or to draw attention to a location during gameplay.",inputSchema:l.object({x:l.number().optional().describe("Target X position in pixels (from scene top-left)"),y:l.number().optional().describe("Target Y position in pixels (from scene top-left)"),scale:l.number().min(.1).max(3).optional().describe("Zoom level (0.3=far, 1.0=normal, 2.0=close)"),duration:l.number().min(0).optional().describe("Animation duration in ms (default: 1000)")})},{name:"set-darkness",description:"Set the scene darkness level (0=bright daylight, 0.5=twilight, 1=pitch black). Returns the new darkness value. Use animate:true for smooth day/night transitions. Affects token vision and light source visibility.",inputSchema:l.object({darkness:l.number().min(0).max(1).describe("Darkness level: 0=daylight, 0.5=twilight, 1=full darkness"),animate:l.boolean().optional().describe("Smoothly animate the transition (default: false)")})},{name:"reset-fog",description:"Reset fog of war exploration for the active scene, hiding all previously revealed areas. This is irreversible \u2014 players will need to re-explore. Use when resetting a dungeon or starting a new exploration phase. Returns the scene name."},{name:"get-weather-effects",description:"List all available weather effect IDs that can be applied with set-weather. Returns effect names and IDs. Use to discover valid weather options before applying one."},{name:"set-weather",description:"Set a weather particle effect on the active scene (rain, fog, snow, etc.). Use get-weather-effects to see valid IDs. Pass an empty string to clear the current weather. Only one weather effect can be active at a time.",inputSchema:l.object({effect:l.string().max(256).describe('Weather effect ID (e.g., "rain", "fog", "snow") or empty string to clear')})},{name:"get-screenshot",description:"Capture an annotated JPEG screenshot of the GM's current Foundry VTT canvas view. Tokens are overlaid with numbered colored badges (green=friendly, red=hostile, yellow=neutral). Returns the image and a text legend mapping badge numbers to token name, disposition, HP, and AC. Use to verify token positions, inspect the battlefield, or reference tokens by number in conversation.",inputSchema:l.object({maxWidth:l.number().min(1).max(3840).optional().describe("Max image width in pixels (default: 1280)"),maxHeight:l.number().min(1).max(2160).optional().describe("Max image height in pixels (default: 720)"),quality:l.number().min(.1).max(1).optional().describe("JPEG quality 0.1-1.0 (default: 0.80)"),annotate:l.boolean().optional().describe("Overlay numbered token badges with legend (default: true)")})}];var bW=l.object({imageData:l.string(),mimeType:l.string(),width:l.number(),height:l.number(),legend:l.string()}),RS=Fe[8],OS=Fe[9],jS=Fe[13],DS=Fe[14],nj=Fe[15],ij=Fe[16],NS=Fe[17],CS=Fe[18];function oj(e,t){e.registerTool(RS.name,{description:RS.description,annotations:C,inputSchema:RS.inputSchema.shape},async({tokens:r})=>y(await t.query("create-tokens",{tokens:r}))),e.registerTool(OS.name,{description:OS.description,annotations:X,inputSchema:OS.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-tokens",{identifiers:r})))}function aj(e,t){e.registerTool(jS.name,{description:jS.description,annotations:W,inputSchema:jS.inputSchema.shape},async({x:r,y:i,scale:n,duration:o})=>y(await t.query("pan-canvas",{x:r,y:i,scale:n,duration:o}))),e.registerTool(DS.name,{description:DS.description,annotations:W,inputSchema:DS.inputSchema.shape},async({darkness:r,animate:i})=>y(await t.query("set-darkness",{darkness:r,animate:i}))),e.registerTool(nj.name,{description:nj.description,annotations:mc},async()=>y(await t.query("reset-fog")))}function sj(e,t){e.registerTool(ij.name,{description:ij.description,annotations:U},async()=>y(await t.query("get-weather-effects"))),e.registerTool(NS.name,{description:NS.description,annotations:W,inputSchema:NS.inputSchema.shape},async({effect:r})=>y(await t.query("set-weather",{effect:r}))),e.registerTool(CS.name,{description:CS.description,annotations:U,inputSchema:CS.inputSchema.shape},async({maxWidth:r,maxHeight:i,quality:n})=>{let o=await t.query("get-screenshot",{maxWidth:r,maxHeight:i,quality:n});if(!o.success)return{content:[{type:"text",text:`Error: ${Xt(o.error)}`}],isError:!0};let a=bW.safeParse(o.result);return a.success?{content:[{type:"image",data:a.data.imageData,mimeType:a.data.mimeType},{type:"text",text:a.data.legend!==""?a.data.legend:`Screenshot: ${a.data.width}x${a.data.height}`}]}:{content:[{type:"text",text:`Screenshot failed: unexpected response format \u2014 ${a.error.message}`}],isError:!0}})}var AS=Fe[0],MS=Fe[1],US=Fe[2],LS=Fe[3],qS=Fe[4],ZS=Fe[5],FS=Fe[6],VS=Fe[7],BS=Fe[10],HS=Fe[11],WS=Fe[12];function _W(e,t){e.registerTool(AS.name,{description:AS.description,annotations:U,inputSchema:AS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("get-current-scene",{limit:r,offset:i}))),e.registerTool(MS.name,{description:MS.description,annotations:Ve,inputSchema:MS.inputSchema.shape},async({identifier:r,limit:i,offset:n})=>y(await t.query("get-scene",{identifier:r,limit:i,offset:n}))),e.registerTool(US.name,{description:US.description,annotations:U,inputSchema:US.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-scenes",{limit:r,offset:i}))),e.registerTool(LS.name,{description:LS.description,annotations:Ve,inputSchema:LS.inputSchema.shape},async({query:r})=>y(await t.query("search-scenes",{query:r}))),e.registerTool(qS.name,{description:qS.description,annotations:W,inputSchema:qS.inputSchema.shape},async({identifier:r})=>y(await t.query("switch-scene",{identifier:r})))}function SW(e,t){e.registerTool(ZS.name,{description:ZS.description,annotations:W,inputSchema:ZS.inputSchema.shape},async({identifier:r,x:i,y:n})=>y(await t.query("move-token",{identifier:r,x:i,y:n})))}function xW(e,t){e.registerTool(FS.name,{description:FS.description,annotations:W,inputSchema:FS.inputSchema.shape},async({identifier:r,...i})=>y(await t.query("update-token",{identifier:r,updates:i}))),e.registerTool(VS.name,{description:VS.description,annotations:C,inputSchema:VS.inputSchema.shape},async({updates:r})=>{let i=r.map(({identifier:n,...o})=>({identifier:n,changes:o}));return y(await t.query("update-tokens",{updates:i}))})}function wW(e,t){SW(e,t),xW(e,t)}function $W(e,t){e.registerTool(BS.name,{description:BS.description,annotations:C,inputSchema:BS.inputSchema.shape},async({name:r,width:i,height:n,gridSize:o,gridDistance:a,background:s})=>y(await t.query("create-scene",{name:r,width:i,height:n,gridSize:o,gridDistance:a,background:s}))),e.registerTool(HS.name,{description:HS.description,annotations:W,inputSchema:HS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-scene",{identifier:r,updates:i}))),e.registerTool(WS.name,{description:WS.description,annotations:X,inputSchema:WS.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-scene",{identifier:r})))}function kW(e,t){aj(e,t),sj(e,t)}function cj(e,t){_W(e,t),wW(e,t),oj(e,t),$W(e,t),kW(e,t)}var lj=[{name:"get-world-info",description:"Get Foundry VTT world metadata. Returns game system, world name, Foundry version, and all connected players with their roles. Use at the start of a session to orient yourself."},{name:"toggle-pause",description:"Pause or unpause the game. Returns the new pause state. Players cannot take actions while the game is paused. Omit the paused parameter to toggle.",inputSchema:l.object({paused:l.boolean().optional().describe("true to pause, false to unpause, omit to toggle")})},{name:"get-time",description:"Get the current in-game date and time. Returns year, month, day, hour, minute, and second in the game world's calendar. Use before advance-time to check the current time and plan time skips."},{name:"advance-time",description:"Advance the in-game clock by a specified duration. Returns the new in-game time. Use for long rests (8 hours), short rests (1 hour), travel montages, or narrative time skips. Specify at least one time unit.",inputSchema:l.object({seconds:l.number().optional().describe("Seconds to advance"),minutes:l.number().optional().describe("Minutes to advance"),hours:l.number().optional().describe("Hours to advance (e.g., 8 for long rest)"),days:l.number().optional().describe("Days to advance")})},{name:"list-users",description:"List all users in the game world. Returns each user's name, ID, role (Gamemaster/Player/Trusted/Assistant/None), online status, assigned character, and color. Use to find valid user names before assign-ownership, revoke-ownership, or send-chat-message with whisperTo."},{name:"get-user",description:"Get detailed information about a specific user. Returns name, ID, role, online status, assigned character, color, and a list of all actors they own. Accepts user name (exact match) or Foundry user ID.",inputSchema:l.object({identifier:l.string().max(256).describe("User name or Foundry user ID")})}];function uj(e,t){let[r,i,n,o,a,s]=lj;e.registerTool(r.name,{description:r.description,annotations:U},async()=>y(await t.query("get-world-info"))),e.registerTool(i.name,{description:i.description,annotations:C,inputSchema:i.inputSchema.shape},async({paused:c})=>y(await t.query("toggle-pause",{paused:c}))),e.registerTool(n.name,{description:n.description,annotations:U},async()=>y(await t.query("get-time"))),e.registerTool(o.name,{description:o.description,annotations:C,inputSchema:o.inputSchema.shape},async({seconds:c,minutes:u,hours:d,days:p})=>y(await t.query("advance-time",{seconds:c,minutes:u,hours:d,days:p}))),e.registerTool(a.name,{description:a.description,annotations:U},async()=>y(await t.query("list-users"))),e.registerTool(s.name,{description:s.description,annotations:U,inputSchema:s.inputSchema.shape},async({identifier:c})=>y(await t.query("get-user",{identifier:c})))}var yi=[{name:"list-tiles",description:"List tiles on the active scene (paginated). Returns each tile's ID, position (x,y in pixels), dimensions (width/height in pixels), image path, opacity, rotation, overhead status, and visibility. Use to find tile IDs before updating or deleting them.",inputSchema:l.object({limit:l.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-tile",description:"Place a tile image on the active scene for decoration, overlays, or roof tiles. Set overhead:true to render above tokens (useful for building roofs that hide interiors). The image file must exist in Foundry data.",inputSchema:l.object({src:l.string().max(256).describe('Image file path (relative to Foundry data, e.g., "tiles/floor.webp")'),x:l.number().describe("X position in pixels (from scene top-left)"),y:l.number().describe("Y position in pixels (from scene top-left)"),width:l.number().min(1).describe("Tile width in pixels"),height:l.number().min(1).describe("Tile height in pixels"),overhead:l.boolean().optional().describe("Render above tokens (default: false)"),hidden:l.boolean().optional().describe("Hidden from players (default: false)"),alpha:l.number().min(0).max(1).optional().describe("Opacity 0-1 (default: 1)"),rotation:l.number().min(0).max(360).optional().describe("Rotation in degrees")})},{name:"update-tile",description:"Update a tile on the scene. Move, resize, change opacity, toggle overhead, or swap the image. Use list-tiles to find the tile ID first.",inputSchema:l.object({identifier:l.string().max(256).describe("Foundry document ID of the tile to update"),updates:Ue.describe("Properties to update (x, y, width, height, alpha, rotation, hidden, overhead, etc.)")})},{name:"delete-tiles",description:"Remove tiles from the active scene permanently. The image files on disk are not deleted. Returns the count of deleted tiles and their IDs.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Tile IDs to delete")})},{name:"list-drawings",description:"List drawings on the active scene (paginated). Returns each drawing's ID, shape type (r=rectangle, e=ellipse, p=polygon, f=freehand), position (x,y in pixels), dimensions, colors, and text content. Use to find drawing IDs before updating or deleting them.",inputSchema:l.object({limit:l.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-drawing",description:"Draw a shape on the canvas for marking areas, annotations, or visual effects. All coordinates and dimensions are in pixels. Supports rectangles (r), ellipses (e), polygons (p), and freehand (f). Add text labels with the text parameter. For spell area markers, prefer create-region instead \u2014 it uses game units (feet) and integrates with the combat system.",inputSchema:l.object({type:l.enum(["r","e","p","f"]).describe("Shape type: r=rectangle, e=ellipse, p=polygon, f=freehand"),x:l.number().describe("X position in pixels (from scene top-left)"),y:l.number().describe("Y position in pixels (from scene top-left)"),width:l.number().min(1).describe("Width in pixels"),height:l.number().min(1).describe("Height in pixels"),strokeColor:l.string().max(256).optional().describe('Stroke hex color (e.g., "#FF0000")'),fillColor:l.string().max(256).optional().describe("Fill hex color"),fillAlpha:l.number().min(0).max(1).optional().describe("Fill opacity 0-1"),strokeWidth:l.number().min(0).optional().describe("Stroke width in pixels"),text:l.string().max(5e4).optional().describe("Text content (for text drawings)"),fontSize:l.number().min(1).optional().describe("Font size in pixels"),textColor:l.string().max(256).optional().describe("Text hex color")})},{name:"update-drawing",description:"Update a drawing on the scene. Move, resize, recolor, or change text content. Use list-drawings to find the drawing ID first.",inputSchema:l.object({identifier:l.string().max(256).describe("Foundry document ID of the drawing to update"),updates:Ue.describe("Properties to update")})},{name:"delete-drawings",description:"Remove drawings from the active scene permanently. Returns the count of deleted drawings and their IDs.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Drawing IDs to delete")})}];var JS=yi[4],GS=yi[5],KS=yi[6],QS=yi[7];function dj(e,t){e.registerTool(JS.name,{description:JS.description,annotations:U,inputSchema:JS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-drawings",{limit:r,offset:i}))),e.registerTool(GS.name,{description:GS.description,annotations:C,inputSchema:GS.inputSchema.shape},async({type:r,x:i,y:n,width:o,height:a,strokeColor:s,fillColor:c,fillAlpha:u,strokeWidth:d,text:p,fontSize:f,textColor:h})=>y(await t.query("create-drawing",{type:r,x:i,y:n,width:o,height:a,strokeColor:s,fillColor:c,fillAlpha:u,strokeWidth:d,text:p,fontSize:f,textColor:h}))),e.registerTool(KS.name,{description:KS.description,annotations:W,inputSchema:KS.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-drawing",{identifier:r,updates:i}))),e.registerTool(QS.name,{description:QS.description,annotations:X,inputSchema:QS.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-drawings",{identifiers:r})))}var[YS,XS,ex,tx]=yi;function TW(e,t){e.registerTool(YS.name,{description:YS.description,annotations:U,inputSchema:YS.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-tiles",{limit:r,offset:i}))),e.registerTool(XS.name,{description:XS.description,annotations:C,inputSchema:XS.inputSchema.shape},async({src:r,x:i,y:n,width:o,height:a,overhead:s,hidden:c,alpha:u,rotation:d})=>y(await t.query("create-tile",{src:r,x:i,y:n,width:o,height:a,overhead:s,hidden:c,alpha:u,rotation:d}))),e.registerTool(ex.name,{description:ex.description,annotations:W,inputSchema:ex.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-tile",{identifier:r,updates:i}))),e.registerTool(tx.name,{description:tx.description,annotations:X,inputSchema:tx.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-tiles",{identifiers:r})))}function pj(e,t){TW(e,t),dj(e,t)}var mj=[{name:"list-sounds",description:"List ambient sounds on the active scene (paginated). Returns each sound's ID, position (in pixels), audio path, hearing radius (in feet), volume, and easing. For playlist/music control, use the playlists bundle.",inputSchema:l.object({limit:l.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-sound",description:"Place a positional ambient sound on the scene (e.g., waterfall, tavern noise). Tokens hear it louder when nearby. For background music, use the playlists bundle.",inputSchema:l.object({x:l.number().describe("X position in pixels (from scene top-left)"),y:l.number().describe("Y position in pixels (from scene top-left)"),path:l.string().max(256).describe("Audio file path (relative to Foundry data)"),radius:l.number().min(0).describe("Hearing radius in feet (how far tokens can hear the sound)"),volume:l.number().min(0).max(1).optional().describe("Volume 0-1 (default: 1)"),easing:l.boolean().optional().describe("Volume eases with distance (default: true)"),hidden:l.boolean().optional().describe("Hidden from players")})},{name:"update-sound",description:"Update an ambient sound source on the scene. Move, change volume, radius, audio path, or easing. Use list-sounds to find the sound ID first.",inputSchema:l.object({identifier:l.string().max(256).describe("Foundry document ID of the sound to update"),updates:Ue.describe("Properties to update (x, y, path, radius, volume, easing)")})},{name:"delete-sounds",description:"Remove ambient sound sources from the active scene permanently. Accepts sound IDs from list-sounds. Returns the count of deleted sounds and their IDs.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Sound IDs to delete")})},{name:"list-notes",description:"List map pins/notes on the active scene (paginated). Returns each note's ID, position (in pixels), label, linked journal entry/page IDs, and visibility.",inputSchema:l.object({limit:l.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-note",description:"Place a map pin on the scene, optionally linked to a journal entry. Use for points of interest, quest locations, or NPC markers.",inputSchema:l.object({x:l.number().describe("X position in pixels (from scene top-left)"),y:l.number().describe("Y position in pixels (from scene top-left)"),label:l.string().max(256).optional().describe("Pin label text"),entryId:l.string().max(256).optional().describe("Journal entry ID to link"),pageId:l.string().max(256).optional().describe("Journal page ID to link"),iconSize:l.number().min(1).optional().describe("Icon size in pixels (default: 40)"),textColor:l.string().max(256).optional().describe("Label text hex color"),hidden:l.boolean().optional().describe("Hidden from players")})},{name:"update-note",description:"Update a map pin on the scene. Move, change label, or link to a different journal entry. Use list-notes to find the note ID first.",inputSchema:l.object({identifier:l.string().max(256).describe("Foundry document ID of the note to update"),updates:Ue.describe("Properties to update (x, y, label, entryId, pageId)")})},{name:"delete-notes",description:"Remove map pins from the active scene permanently. Does not delete the linked journal entries \u2014 only the pins themselves. Returns the count of deleted notes and their IDs.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Note IDs to delete")})}];var lr=[{name:"list-walls",description:"List wall segments on the active scene (paginated). Returns each wall's ID, endpoints (in pixels), blocking levels for light/movement/sight/sound, and door type/state. Use before creating or modifying walls.",inputSchema:l.object({limit:l.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"toggle-door",description:"Open, close, or lock a door on the active scene. Omit state to toggle open/closed. Returns the new door state. Use list-walls to find door IDs.",inputSchema:l.object({identifier:l.string().max(256).describe("Foundry document ID of the wall/door"),state:l.number().int().min(0).max(2).optional().describe("Door state: 0=closed, 1=open, 2=locked. Omit to toggle open/closed.")})},{name:"close-all-doors",description:"Force close every door on the active scene at once. Returns the count of doors closed. Use for resetting a dungeon between runs. For individual door control, use toggle-door instead."},{name:"create-walls",description:"Create wall segments on the active scene (batch supported). Walls block vision, movement, light, and sound \u2014 blocking levels: 0=none, 10=limited (partial), 20=normal (full). Use presets: basic (blocks all), terrain (limited sight), door, window (see-through), secret, invisible (movement only), ethereal (vision only). Returns wall IDs.",inputSchema:l.object({walls:l.array(l.object({c:l.array(l.number()).length(4).describe("Wall endpoints [x1, y1, x2, y2] in pixels (from scene top-left)"),preset:l.enum(["basic","terrain","invisible","ethereal","window","door","secret"]).optional().describe("Wall type preset (overridden by explicit values below)"),light:l.number().min(0).max(20).optional().describe("Light blocking: 0=none, 10=limited, 20=normal"),move:l.number().min(0).max(20).optional().describe("Movement blocking: 0=none, 10=limited, 20=normal"),sight:l.number().min(0).max(20).optional().describe("Sight blocking: 0=none, 10=limited, 20=normal"),sound:l.number().min(0).max(20).optional().describe("Sound blocking: 0=none, 10=limited, 20=normal"),door:l.number().int().min(0).max(2).optional().describe("Door type: 0=none, 1=door, 2=secret"),ds:l.number().int().min(0).max(2).optional().describe("Door state: 0=closed, 1=open, 2=locked")})).max(100).describe("Array of walls to create")})},{name:"update-wall",description:"Update a wall segment's properties. Change blocking levels, convert to a door, move endpoints, or adjust light/sound penetration. Use list-walls to find the wall ID first.",inputSchema:l.object({identifier:l.string().max(256).describe("Foundry document ID of the wall to update"),updates:Ue.describe("Properties to update (light, move, sight, sound, door, ds, c)")})},{name:"delete-walls",description:"Remove wall segments from the active scene permanently. Accepts wall IDs from list-walls. This affects vision, movement, and sound blocking immediately. Returns the count of deleted walls and their IDs.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Wall IDs to delete")})},{name:"list-lights",description:"List ambient lights on the active scene (paginated). Returns each light's ID, position (in pixels), bright/dim radius (in feet), color, animation, and visibility.",inputSchema:l.object({limit:l.number().int().min(1).max(500).optional().describe("Max results to return (default: 100)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"create-light",description:"Place an ambient light on the scene. Configure bright/dim radius, color, animations (torch, pulse, ghostly), and emission angle. Set negative:true for a darkness source.",inputSchema:l.object({x:l.number().describe("X position in pixels (from scene top-left)"),y:l.number().describe("Y position in pixels (from scene top-left)"),dim:l.number().min(0).describe("Dim light radius in feet (e.g., 40 for a torch)"),bright:l.number().min(0).describe("Bright light radius in feet (e.g., 20 for a torch)"),color:l.string().max(256).optional().describe('Light hex color (e.g., "#ff9329" for torchlight)'),alpha:l.number().min(0).max(1).optional().describe("Color intensity 0-1 (default: 0.5)"),angle:l.number().min(0).max(360).optional().describe("Emission angle in degrees (360=omnidirectional)"),negative:l.boolean().optional().describe("Creates darkness instead of light"),animationType:l.string().max(256).optional().describe("Animation: torch, pulse, chroma, wave, fog, sunburst, dome, emanation, ghostly, energy, roiling, hole, vortex"),animationSpeed:l.number().int().min(1).max(10).optional().describe("Animation speed 1-10 (default: 5)"),animationIntensity:l.number().int().min(1).max(10).optional().describe("Animation intensity 1-10 (default: 5)"),hidden:l.boolean().optional().describe("Hidden from players")})},{name:"update-light",description:"Update an ambient light source on the active scene. Supports x/y position (in pixels from top-left), config.bright and config.dim (radius in feet), config.color (hex), config.angle (0-360), config.animation.type and config.animation.speed, and hidden (visibility toggle). Use list-lights to find the light identifier first.",inputSchema:l.object({identifier:l.string().max(256).describe("Foundry document ID of the light to update"),updates:Ue.describe("Properties to update (x, y, config.dim, config.bright, config.color)")})},{name:"delete-lights",description:"Remove ambient light sources from the active scene permanently. Accepts light IDs from list-lights. Returns the count of deleted lights and their IDs.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Light IDs to delete")})},...mj];var rx=lr[10],nx=lr[11],ix=lr[12],ox=lr[13],ax=lr[14],sx=lr[15],cx=lr[16],lx=lr[17];function fj(e,t){e.registerTool(rx.name,{description:rx.description,annotations:U,inputSchema:rx.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-sounds",{limit:r,offset:i}))),e.registerTool(nx.name,{description:nx.description,annotations:C,inputSchema:nx.inputSchema.shape},async({x:r,y:i,path:n,radius:o,volume:a,easing:s,hidden:c})=>y(await t.query("create-sound",{x:r,y:i,path:n,radius:o,volume:a,easing:s,hidden:c}))),e.registerTool(ix.name,{description:ix.description,annotations:W,inputSchema:ix.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-sound",{identifier:r,updates:i}))),e.registerTool(ox.name,{description:ox.description,annotations:X,inputSchema:ox.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-sounds",{identifiers:r})))}function hj(e,t){e.registerTool(ax.name,{description:ax.description,annotations:U,inputSchema:ax.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-notes",{limit:r,offset:i}))),e.registerTool(sx.name,{description:sx.description,annotations:C,inputSchema:sx.inputSchema.shape},async({x:r,y:i,label:n,entryId:o,pageId:a,iconSize:s,textColor:c,hidden:u})=>y(await t.query("create-note",{x:r,y:i,label:n,entryId:o,pageId:a,iconSize:s,textColor:c,hidden:u}))),e.registerTool(cx.name,{description:cx.description,annotations:W,inputSchema:cx.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-note",{identifier:r,updates:i}))),e.registerTool(lx.name,{description:lx.description,annotations:X,inputSchema:lx.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-notes",{identifiers:r})))}var[ux,dx,gj,px,mx,fx,hx,gx,yx,vx]=lr;function IW(e,t){e.registerTool(ux.name,{description:ux.description,annotations:U,inputSchema:ux.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-walls",{limit:r,offset:i}))),e.registerTool(dx.name,{description:dx.description,annotations:C,inputSchema:dx.inputSchema.shape},async({identifier:r,state:i})=>y(await t.query("toggle-door",{identifier:r,state:i}))),e.registerTool(gj.name,{description:gj.description,annotations:W},async()=>y(await t.query("close-all-doors"))),e.registerTool(px.name,{description:px.description,annotations:C,inputSchema:px.inputSchema.shape},async({walls:r})=>y(await t.query("create-walls",{walls:r}))),e.registerTool(mx.name,{description:mx.description,annotations:W,inputSchema:mx.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-wall",{identifier:r,updates:i}))),e.registerTool(fx.name,{description:fx.description,annotations:X,inputSchema:fx.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-walls",{identifiers:r})))}function EW(e,t){e.registerTool(hx.name,{description:hx.description,annotations:U,inputSchema:hx.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-lights",{limit:r,offset:i}))),e.registerTool(gx.name,{description:gx.description,annotations:C,inputSchema:gx.inputSchema.shape},async r=>y(await t.query("create-light",r))),e.registerTool(yx.name,{description:yx.description,annotations:W,inputSchema:yx.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-light",{identifier:r,updates:i}))),e.registerTool(vx.name,{description:vx.description,annotations:X,inputSchema:vx.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-lights",{identifiers:r})))}function yj(e,t){IW(e,t),EW(e,t),fj(e,t),hj(e,t)}var vj=[{name:"send-chat-message",description:"Send a message to the Foundry chat log. Supports HTML formatting, speaker attribution, whispers to specific players, and emote actions. Use for narrative text, NPC dialogue, GM announcements, or private messages. For dice results, use roll-dice instead. Returns the sent content and speaker name.",inputSchema:l.object({content:l.string().max(5e4).describe("Message content (supports HTML)"),speaker:l.string().max(256).optional().describe("Speaker name or character name (default: GM)"),whisperTo:l.array(l.string().max(256)).max(50).optional().describe("Player names to whisper to (private message). Omit for public message."),isEmote:l.boolean().optional().describe("Send as an emote/action message (default: false)")})},{name:"get-recent-messages",description:"Retrieve recent messages from the Foundry chat log. Returns the most recent N messages (default 20, max 100) with content, speaker, timestamp, type, and whisper recipients. Also returns the total message count in the log. Named get-* rather than list-* because it fetches a tail slice of the log, not a paginated collection.",inputSchema:l.object({count:l.number().int().min(1).max(100).optional().describe("Number of recent messages to retrieve (default: 20, max: 100)")})}];function bj(e,t){let[r,i]=vj;e.registerTool(r.name,{description:r.description,annotations:C,inputSchema:r.inputSchema.shape},async({content:n,speaker:o,whisperTo:a,isEmote:s})=>y(await t.query("send-chat-message",{content:n,speaker:o,whisperTo:a,isEmote:s}))),e.registerTool(i.name,{description:i.description,annotations:U,inputSchema:i.inputSchema.shape},async({count:n})=>y(await t.query("get-recent-messages",{count:n})))}var Jo=[{name:"list-playlists",description:"List playlists in the world with pagination. Returns each playlist's name, ID, playback mode (sequential/shuffle/simultaneous), playing status, and track count with names. Response includes total count and hasMore flag. Use to find a playlist before playing it or to check what's currently playing.",inputSchema:l.object({limit:l.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-playlists",description:"Search playlists by name or track name. Returns matching playlists with names, IDs, playing status, and track count. Use to find a playlist when you only know part of the name or a track title.",inputSchema:l.object({query:l.string().max(256).describe("Search text to match against playlist or track name")})},{name:"get-playlist",description:"Get full details of a playlist including all tracks with names, paths, volume, and playing status. Returns playback mode and fade settings. Use to find track names before playing them with play-track.",inputSchema:l.object({identifier:l.string().max(256).describe("Playlist name or Foundry ID")})},{name:"play-playlist",description:"Start playing an entire playlist by name or ID. Plays according to the playlist mode (sequential, shuffle, or simultaneous). For playing a single track, use play-track instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Playlist name or Foundry ID")})},{name:"play-track",description:"Play a specific track within a playlist by name or ID. For playing an entire playlist, use play-playlist instead. Use get-playlist to see available tracks.",inputSchema:l.object({playlist:l.string().max(256).describe("Playlist name or ID"),trackId:l.string().max(256).describe("Track name or ID")})},{name:"stop-playlist",description:"Stop a specific playing playlist by name or ID. For stopping everything at once, use stop-all-playlists instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Playlist name or Foundry ID")})},{name:"stop-track",description:"Stop a specific track within a playlist. Other tracks in the playlist continue playing. Returns the playlist and track names.",inputSchema:l.object({playlist:l.string().max(256).describe("Playlist name or ID"),trackId:l.string().max(256).describe("Track name or ID")})},{name:"stop-all-playlists",description:"Stop all currently playing playlists and tracks at once. Use for scene transitions or when silence is needed. For stopping a single playlist, use stop-playlist instead."},{name:"create-playlist",description:"Create a new empty playlist with a playback mode. Returns the new playlist ID. Add tracks afterward with create-track. Modes: 0=Sequential (plays tracks in order), 1=Shuffle (random order), 2=Simultaneous (all tracks play at once, ideal for ambient soundscapes).",inputSchema:l.object({name:l.string().max(256).describe("Playlist name"),description:l.string().max(5e4).optional().describe("Playlist description"),mode:l.number().int().min(0).max(2).optional().describe("Playback mode: 0 = Sequential, 1 = Shuffle, 2 = Simultaneous"),fade:l.number().min(0).optional().describe("Default fade duration in milliseconds"),folderId:l.string().max(256).optional().describe("Folder name or ID to place the playlist in")})},{name:"update-playlist",description:"Update a playlist's properties. Change name, description, playback mode (0=Sequential, 1=Shuffle, 2=Simultaneous), or fade duration. For modifying individual tracks, use update-track instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Playlist name or Foundry ID"),name:l.string().max(256).optional().describe("New playlist name"),description:l.string().max(5e4).optional().describe("New description"),mode:l.number().int().min(0).max(2).optional().describe("Playback mode: 0 = Sequential, 1 = Shuffle, 2 = Simultaneous"),fade:l.number().min(0).optional().describe("Default fade duration in milliseconds")})},{name:"delete-playlist",description:"Delete a playlist and all its tracks permanently. This is irreversible. Stops playback if the playlist is currently playing. Returns the deleted playlist name and ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Playlist name or Foundry ID")})},{name:"create-track",description:'Add a new audio track to an existing playlist. The audio file must already exist in the Foundry data directory (e.g., "music/tavern.mp3"). Returns the new track ID. Use list-playlists or get-playlist to find the playlist first.',inputSchema:l.object({playlist:l.string().max(256).describe("Playlist name or ID"),name:l.string().max(256).describe("Track name"),path:l.string().max(256).describe('Audio file path (relative to Foundry data, e.g. "music/tavern.mp3")'),volume:l.number().min(0).max(1).optional().describe("Volume level (0 to 1, default: 0.5)"),repeat:l.boolean().optional().describe("Loop the track (default: false)"),fade:l.number().min(0).optional().describe("Fade duration in milliseconds")})},{name:"update-track",description:"Update a track's properties within a playlist. Change name, volume, loop setting, or fade duration. For updating the playlist itself, use update-playlist instead.",inputSchema:l.object({playlist:l.string().max(256).describe("Playlist name or ID"),trackId:l.string().max(256).describe("Track name or ID"),name:l.string().max(256).optional().describe("New track name"),volume:l.number().min(0).max(1).optional().describe("Volume level (0 to 1)"),repeat:l.boolean().optional().describe("Loop the track"),fade:l.number().min(0).optional().describe("Fade duration in milliseconds")})},{name:"delete-track",description:"Remove a track from a playlist permanently. The audio file on disk is not deleted. For deleting the entire playlist, use delete-playlist instead. Returns the playlist and deleted track names.",inputSchema:l.object({playlist:l.string().max(256).describe("Playlist name or ID"),trackId:l.string().max(256).describe("Track name or ID")})}];var bx=Jo[11],_x=Jo[12],Sx=Jo[13];function _j(e,t){e.registerTool(bx.name,{description:bx.description,annotations:C,inputSchema:bx.inputSchema.shape},async({playlist:r,name:i,path:n,volume:o,repeat:a,fade:s})=>y(await t.query("create-track",{playlist:r,name:i,path:n,volume:o,repeat:a,fade:s}))),e.registerTool(_x.name,{description:_x.description,annotations:W,inputSchema:_x.inputSchema.shape},async({playlist:r,trackId:i,name:n,volume:o,repeat:a,fade:s})=>{let c={};return n!==void 0&&(c.name=n),o!==void 0&&(c.volume=o),a!==void 0&&(c.repeat=a),s!==void 0&&(c.fade=s),y(await t.query("update-track",{playlist:r,trackId:i,updates:c}))})}function Sj(e,t){e.registerTool(Sx.name,{description:Sx.description,annotations:X,inputSchema:Sx.inputSchema.shape},async({playlist:r,trackId:i})=>y(await t.query("delete-track",{playlist:r,trackId:i})))}var[xx,wx,$x,kx,Tx,Ix,Ex,xj,Px,zx,Rx]=Jo;function PW(e,t){e.registerTool(xx.name,{description:xx.description,annotations:U,inputSchema:xx.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-playlists",{limit:r,offset:i}))),e.registerTool(wx.name,{description:wx.description,annotations:Ve,inputSchema:wx.inputSchema.shape},async({query:r})=>y(await t.query("search-playlists",{query:r}))),e.registerTool($x.name,{description:$x.description,annotations:U,inputSchema:$x.inputSchema.shape},async({identifier:r})=>y(await t.query("get-playlist",{identifier:r})))}function zW(e,t){e.registerTool(kx.name,{description:kx.description,annotations:W,inputSchema:kx.inputSchema.shape},async({identifier:r})=>y(await t.query("play-playlist",{identifier:r}))),e.registerTool(Tx.name,{description:Tx.description,annotations:W,inputSchema:Tx.inputSchema.shape},async({playlist:r,trackId:i})=>y(await t.query("play-track",{playlist:r,trackId:i})))}function RW(e,t){e.registerTool(Ix.name,{description:Ix.description,annotations:W,inputSchema:Ix.inputSchema.shape},async({identifier:r})=>y(await t.query("stop-playlist",{identifier:r}))),e.registerTool(Ex.name,{description:Ex.description,annotations:W,inputSchema:Ex.inputSchema.shape},async({playlist:r,trackId:i})=>y(await t.query("stop-track",{playlist:r,trackId:i}))),e.registerTool(xj.name,{description:xj.description,annotations:W,inputSchema:{}},async()=>y(await t.query("stop-all-playlists",{})))}function OW(e,t){e.registerTool(Px.name,{description:Px.description,annotations:C,inputSchema:Px.inputSchema.shape},async({name:r,description:i,mode:n,fade:o,folderId:a})=>y(await t.query("create-playlist",{name:r,description:i,mode:n,fade:o,folderId:a}))),e.registerTool(zx.name,{description:zx.description,annotations:W,inputSchema:zx.inputSchema.shape},async({identifier:r,name:i,description:n,mode:o,fade:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.description=n),o!==void 0&&(s.mode=o),a!==void 0&&(s.fade=a),y(await t.query("update-playlist",{identifier:r,updates:s}))})}function jW(e,t){e.registerTool(Rx.name,{description:Rx.description,annotations:X,inputSchema:Rx.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-playlist",{identifier:r})))}function wj(e,t){PW(e,t),zW(e,t),RW(e,t),OW(e,t),jW(e,t),_j(e,t),Sj(e,t)}var $j=[{name:"list-tables",description:`List rollable tables in the world with pagination. Returns each table's name, ID, dice formula (e.g., "1d6"), result count, and description. Response includes total count and hasMore flag. Use to find a table before rolling on it with roll-table.`,inputSchema:l.object({limit:l.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-tables",description:"Search rollable tables by name or description text. Returns matching tables with names, IDs, dice formulas, result counts, and description previews. Use to find a specific table when you don't know its exact name.",inputSchema:l.object({query:l.string().max(256).describe("Search text to match against table name or description")})},{name:"get-table",description:"Get a rollable table with its dice formula and all result entries. Returns the full table content. Use to review table contents before rolling with roll-table.",inputSchema:l.object({identifier:l.string().max(256).describe("Table name or Foundry ID")})},{name:"roll-table",description:"Roll on a rollable table using its dice formula and return the randomly selected result. Posts the roll and result to Foundry chat by default. For simple dice rolls without a table, use roll-dice (dice bundle) instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Table name or Foundry ID"),showInChat:l.boolean().optional().describe("Show the roll result in Foundry chat (default: true)")})},{name:"create-table",description:"Create a new rollable table with a dice formula and result entries. Returns the new table ID. Each result has text and an optional weight or explicit dice range. Use for random encounters, loot tables, weather, NPC names, or any randomized content. If no formula is specified, it auto-generates based on result count.",inputSchema:l.object({name:l.string().max(256).describe("Table name"),formula:l.string().max(256).optional().describe('Dice formula (e.g. "1d6", "1d20", "2d10")'),description:l.string().max(5e4).optional().describe("Table description"),replacement:l.boolean().optional().describe("Draw with replacement (default: true)"),folderId:l.string().max(256).optional().describe("Folder name or ID to place the table in"),results:l.array(l.object({text:l.string().max(5e4).describe("Result text"),weight:l.number().optional().describe("Result weight (default: 1)"),rangeStart:l.number().optional().describe("Range start (auto-assigned if omitted)"),rangeEnd:l.number().optional().describe("Range end (auto-assigned if omitted)")})).max(100).optional().describe("Table results/entries")})},{name:"update-table",description:"Update a rollable table's properties. Change name, dice formula, description, or draw-with-replacement mode. Does not modify individual results \u2014 use Foundry UI for that.",inputSchema:l.object({identifier:l.string().max(256).describe("Table name or Foundry ID"),name:l.string().max(256).optional().describe("New table name"),formula:l.string().max(256).optional().describe("New dice formula"),description:l.string().max(5e4).optional().describe("New description"),replacement:l.boolean().optional().describe("Draw with replacement")})},{name:"delete-table",description:"Delete a rollable table and all its result entries permanently. This is irreversible. Returns the deleted table name and ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Table name or Foundry ID")})}];var[Ox,jx,Dx,Nx,Cx,Ax,Mx]=$j;function DW(e,t){e.registerTool(Ox.name,{description:Ox.description,annotations:U,inputSchema:Ox.inputSchema.shape},async({limit:r,offset:i})=>y(await t.query("list-tables",{limit:r,offset:i}))),e.registerTool(jx.name,{description:jx.description,annotations:Ve,inputSchema:jx.inputSchema.shape},async({query:r})=>y(await t.query("search-tables",{query:r}))),e.registerTool(Dx.name,{description:Dx.description,annotations:U,inputSchema:Dx.inputSchema.shape},async({identifier:r})=>y(await t.query("get-table",{identifier:r}))),e.registerTool(Nx.name,{description:Nx.description,annotations:C,inputSchema:Nx.inputSchema.shape},async({identifier:r,showInChat:i})=>y(await t.query("roll-table",{identifier:r,showInChat:i})))}function NW(e,t){e.registerTool(Cx.name,{description:Cx.description,annotations:C,inputSchema:Cx.inputSchema.shape},async({name:r,formula:i,description:n,replacement:o,folderId:a,results:s})=>y(await t.query("create-table",{name:r,formula:i,description:n,replacement:o,folderId:a,results:s}))),e.registerTool(Ax.name,{description:Ax.description,annotations:W,inputSchema:Ax.inputSchema.shape},async({identifier:r,name:i,formula:n,description:o,replacement:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.formula=n),o!==void 0&&(s.description=o),a!==void 0&&(s.replacement=a),y(await t.query("update-table",{identifier:r,updates:s}))}),e.registerTool(Mx.name,{description:Mx.description,annotations:X,inputSchema:Mx.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-table",{identifier:r})))}function kj(e,t){DW(e,t),NW(e,t)}var Tj=[{name:"list-card-stacks",description:"List all card stacks in the world. Returns every stack (no pagination) with name, ID, type (deck/hand/pile), card count, and description. Use to find a stack before drawing cards or checking a player's hand."},{name:"search-card-stacks",description:"Search card stacks by name or card name. Returns matching stacks with names, IDs, types, and card counts. Use to find a deck or hand when you only know part of the name.",inputSchema:l.object({query:l.string().max(256).describe("Search text to match against stack or card name")})},{name:"get-card-stack",description:"Get a card stack with all its cards, including card names, faces, and drawn status. Use to see the full deck contents or a player's hand.",inputSchema:l.object({identifier:l.string().max(256).describe("Card stack name or Foundry ID")})},{name:"create-card-stack",description:`Create a new card stack. Use type "deck" for a draw pile, "hand" for a player's hand, or "pile" for a discard/community pile. Returns the new stack ID.`,inputSchema:l.object({name:l.string().max(256).describe("Card stack name"),type:l.enum(["deck","hand","pile"]).describe("Stack type"),description:l.string().max(5e4).optional().describe("Stack description")})},{name:"update-card-stack",description:"Update a card stack's properties. Change the name, description, or type. For drawing or shuffling cards, use draw-cards or shuffle-deck instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Card stack name or Foundry ID"),name:l.string().max(256).optional().describe("New stack name"),description:l.string().max(5e4).optional().describe("New stack description"),type:l.enum(["deck","hand","pile"]).optional().describe("New stack type")})},{name:"delete-card-stack",description:"Delete a card stack and all its cards permanently. This is irreversible. Returns the deleted stack name and ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Card stack name or Foundry ID")})},{name:"draw-cards",description:"Draw or deal cards from one stack to another (e.g., deck \u2192 hand, deck \u2192 discard pile). Cards are moved, not copied \u2014 they leave the source stack. Returns the drawn card names and IDs. Use get-card-stack to see available cards first.",inputSchema:l.object({source:l.string().max(256).describe("Source stack name or ID (e.g., the deck)"),destination:l.string().max(256).describe("Destination stack name or ID (e.g., a hand or pile)"),count:l.number().int().min(1).describe("Number of cards to draw")})},{name:"shuffle-deck",description:"Shuffle a card stack to randomize the card order. Use before dealing or drawing from a deck. Does not recall cards from other stacks \u2014 use reset-deck for that.",inputSchema:l.object({identifier:l.string().max(256).describe("Card stack name or Foundry ID")})},{name:"reset-deck",description:"Reset a deck by recalling all dealt cards from hands and piles back into it, restoring it to its original state. Use to start a new round or game. Does not shuffle \u2014 use shuffle-deck afterward to randomize the order.",inputSchema:l.object({identifier:l.string().max(256).describe("Card stack name or Foundry ID")})}];var[Ij,Ux,Lx,qx,Zx,Fx,Vx,Bx,Hx]=Tj;function CW(e,t){e.registerTool(Ij.name,{description:Ij.description,annotations:U,inputSchema:{}},async()=>y(await t.query("list-card-stacks",{}))),e.registerTool(Ux.name,{description:Ux.description,annotations:Ve,inputSchema:Ux.inputSchema.shape},async({query:r})=>y(await t.query("search-card-stacks",{query:r}))),e.registerTool(Lx.name,{description:Lx.description,annotations:U,inputSchema:Lx.inputSchema.shape},async({identifier:r})=>y(await t.query("get-card-stack",{identifier:r}))),e.registerTool(qx.name,{description:qx.description,annotations:C,inputSchema:qx.inputSchema.shape},async({name:r,type:i,description:n})=>y(await t.query("create-card-stack",{name:r,type:i,description:n}))),e.registerTool(Zx.name,{description:Zx.description,annotations:W,inputSchema:Zx.inputSchema.shape},async({identifier:r,name:i,description:n,type:o})=>{let a={};return i!==void 0&&(a.name=i),n!==void 0&&(a.description=n),o!==void 0&&(a.type=o),y(await t.query("update-card-stack",{identifier:r,updates:a}))}),e.registerTool(Fx.name,{description:Fx.description,annotations:X,inputSchema:Fx.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-card-stack",{identifier:r})))}function AW(e,t){e.registerTool(Vx.name,{description:Vx.description,annotations:C,inputSchema:Vx.inputSchema.shape},async({source:r,destination:i,count:n})=>y(await t.query("draw-cards",{source:r,destination:i,count:n}))),e.registerTool(Bx.name,{description:Bx.description,annotations:C,inputSchema:Bx.inputSchema.shape},async({identifier:r})=>y(await t.query("shuffle-deck",{identifier:r}))),e.registerTool(Hx.name,{description:Hx.description,annotations:W,inputSchema:Hx.inputSchema.shape},async({identifier:r})=>y(await t.query("reset-deck",{identifier:r})))}function Ej(e,t){CW(e,t),AW(e,t)}var Pj=[{name:"list-macros",description:"List all macros in the world. Returns every macro (no pagination) with name, ID, type (script or chat), and command preview. Use to find a macro before executing or deleting it."},{name:"get-macro",description:"Get the full details of a macro including its complete command/code, type, author, and folder. Use when you need to read or review a macro's full source code.",inputSchema:l.object({identifier:l.string().max(256).describe("Macro name or Foundry ID")})},{name:"search-macros",description:"Search macros by name or command text. Returns matching macros with names, IDs, types, and match location. Use to find macros related to a topic or containing specific code.",inputSchema:l.object({query:l.string().max(256).describe("Search text to match against macro name or command")})},{name:"execute-macro",description:'Execute a macro by name or ID. Script macros run arbitrary JavaScript with full Foundry API access \u2014 use with caution as they can modify any game data. Chat macros send chat commands (e.g., "/roll 1d20"). Returns the macro name and type.',inputSchema:l.object({identifier:l.string().max(256).describe("Macro name or Foundry ID")})},{name:"create-macro",description:'Create a new macro. Default type is "chat" (safe \u2014 runs chat commands like /roll 1d20, /whisper GM Hello). Set type to "script" ONLY when the user explicitly requests JavaScript execution \u2014 script macros have full Foundry API access and can modify any game data. Never create script macros from untrusted input.',inputSchema:l.object({name:l.string().max(256).describe("Macro name"),command:l.string().max(1e4).describe("Macro command/code to execute"),type:l.enum(["script","chat"]).optional().describe('Macro type: "chat" for chat commands (default, safe), "script" for JS code (dangerous \u2014 full API access, requires explicit user request)')})},{name:"update-macro",description:"Update a macro's properties. Change the name, type (script/chat), command code, or icon. For executing a macro, use execute-macro instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Macro name or Foundry ID"),name:l.string().max(256).optional().describe("New macro name"),type:l.enum(["script","chat"]).optional().describe('New macro type: "chat" for chat commands (safe), "script" for JS code (dangerous \u2014 full API access)'),command:l.string().max(1e4).optional().describe("New macro command/code"),img:l.string().max(256).optional().describe("New macro icon image path")})},{name:"delete-macro",description:"Delete a macro from the world permanently. This is irreversible. Returns the deleted macro name.",inputSchema:l.object({identifier:l.string().max(256).describe("Macro name or Foundry ID")})}];var[zj,Wx,Jx,Gx,Kx,Qx,Yx]=Pj;function Rj(e,t){e.registerTool(zj.name,{description:zj.description,annotations:U,inputSchema:{}},async()=>y(await t.query("list-macros",{}))),e.registerTool(Wx.name,{description:Wx.description,annotations:Ve,inputSchema:Wx.inputSchema.shape},async({identifier:r})=>y(await t.query("get-macro",{identifier:r}))),e.registerTool(Jx.name,{description:Jx.description,annotations:Ve,inputSchema:Jx.inputSchema.shape},async({query:r})=>y(await t.query("search-macros",{query:r}))),e.registerTool(Gx.name,{description:Gx.description,annotations:X,inputSchema:Gx.inputSchema.shape},async({identifier:r})=>y(await t.query("execute-macro",{identifier:r}))),e.registerTool(Kx.name,{description:Kx.description,annotations:X,inputSchema:Kx.inputSchema.shape},async({name:r,command:i,type:n})=>y(await t.query("create-macro",{name:r,command:i,type:n}))),e.registerTool(Qx.name,{description:Qx.description,annotations:W,inputSchema:Qx.inputSchema.shape},async({identifier:r,name:i,type:n,command:o,img:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.type=n),o!==void 0&&(s.command=o),a!==void 0&&(s.img=a),y(await t.query("update-macro",{identifier:r,updates:s}))}),e.registerTool(Yx.name,{description:Yx.description,annotations:X,inputSchema:Yx.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-macro",{identifier:r})))}var Oj=[{name:"list-events",description:"List all Ember campaign quest events with their current status (none/available/active/complete). Returns every event (no pagination) with name, ID, type, step, and active/complete flags, plus the currently active event. Use get-event for full details. Requires the Ember module."},{name:"get-event",description:"Get full details of a specific Ember quest event including scene, NPCs, music, journal page, and outcomes. Supports partial name matching. Requires the Ember module.",inputSchema:l.object({identifier:l.string().max(256).describe("Event ID or name (partial match supported)")})},{name:"begin-event",description:"Begin an Ember quest event, triggering its full lifecycle: switches to the event scene, spawns NPC tokens, starts music/soundscape, and opens the journal page. Use list-events to find available events. Requires the Ember module.",inputSchema:l.object({identifier:l.string().max(256).describe("Event ID or name (partial match supported)")})},{name:"complete-event",description:"Complete an Ember quest event, triggering its onEnd lifecycle hook. Omit identifier to complete the currently active event. Use after the party finishes the encounter. Requires the Ember module.",inputSchema:l.object({identifier:l.string().max(256).optional().describe("Event ID or name. Omit to complete the currently active event.")})},{name:"set-event-outcome",description:"Set outcomes on an Ember quest event to record party choices and decisions. Outcomes are key-value pairs tracked by the narrative system for branching storylines. Requires the Ember module.",inputSchema:l.object({identifier:l.string().max(256).describe("Event ID or name"),outcomes:Ue.describe("Outcome key-value pairs to set on the event")})}];var[jj,Xx,ew,tw,rw]=Oj;function MW(e,t){e.registerTool(jj.name,{description:jj.description,annotations:U,inputSchema:{}},async()=>y(await t.query("list-events",{}))),e.registerTool(Xx.name,{description:Xx.description,annotations:U,inputSchema:Xx.inputSchema.shape},async({identifier:r})=>y(await t.query("get-event",{identifier:r})))}function UW(e,t){e.registerTool(ew.name,{description:ew.description,annotations:C,inputSchema:ew.inputSchema.shape},async({identifier:r})=>y(await t.query("begin-event",{identifier:r}))),e.registerTool(tw.name,{description:tw.description,annotations:C,inputSchema:tw.inputSchema.shape},async({identifier:r})=>y(await t.query("complete-event",{identifier:r}))),e.registerTool(rw.name,{description:rw.description,annotations:W,inputSchema:rw.inputSchema.shape},async({identifier:r,outcomes:i})=>y(await t.query("set-event-outcome",{identifier:r,outcomes:i})))}function Dj(e,t){MW(e,t),UW(e,t)}var Nj=[{name:"list-effects",description:"List all active effects (buffs, debuffs, spell effects) on an actor. Returns each effect's name, ID, enabled/disabled status, icon, remaining duration, and attribute changes (e.g., +2 AC, 1d4 to attacks). For token-level status icons (prone, poisoned), use toggle-condition (combat bundle) instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Actor name or Foundry actor ID")})},{name:"get-effect",description:"Get full details of a single active effect on an actor, including all attribute changes, duration, origin, and status. Use when you need to inspect one specific effect's details rather than listing all effects.",inputSchema:l.object({identifier:l.string().max(256).describe("Actor name or Foundry actor ID"),effectId:l.string().max(256).describe("Effect ID (from list-effects)")})},{name:"create-effect",description:"Add a custom active effect to an actor that modifies its attributes. Effects use Foundry change modes: 0=CUSTOM (no automatic effect), 1=MULTIPLY (multiply attribute by value), 2=ADD (add value to attribute, e.g., +2 AC), 3=DOWNGRADE (apply only if lower than current), 4=UPGRADE (apply only if higher than current), 5=OVERRIDE (replace attribute value entirely). Supports timed duration in combat rounds, turns, or real-time seconds. For simple status icons (prone, poisoned), use toggle-condition (combat bundle) instead. Returns the actor name and created effect ID and name.",inputSchema:l.object({identifier:l.string().max(256).describe("Actor name or Foundry actor ID"),name:l.string().max(256).describe('Effect name (e.g., "Bless", "Rage", "Shield of Faith")'),changes:l.array(l.object({key:l.string().max(256).describe('System data path (e.g., "system.attributes.ac.bonus")'),mode:l.number().int().min(0).max(5).describe("Change mode: 0=CUSTOM, 1=MULTIPLY, 2=ADD, 3=DOWNGRADE, 4=UPGRADE, 5=OVERRIDE"),value:l.string().max(256).describe('Value to apply (e.g., "2", "1d4")')})).max(100).optional().describe("Attribute changes this effect applies"),icon:l.string().max(256).optional().describe("Effect icon path"),disabled:l.boolean().optional().describe("Create in disabled state (default: false)"),duration:l.object({rounds:l.number().int().min(0).optional(),turns:l.number().int().min(0).optional(),seconds:l.number().min(0).optional()}).optional().describe("Effect duration")})},{name:"update-effect",description:"Update an active effect on an actor. Change name, enable/disable, modify attribute changes, or adjust duration. Use list-effects to find the effect ID first.",inputSchema:l.object({identifier:l.string().max(256).describe("Actor name or Foundry actor ID"),effectId:l.string().max(256).describe("Effect ID (from list-effects)"),updates:Ue.describe('Update data (e.g., {disabled: true, name: "New Name"})')})},{name:"delete-effect",description:"Remove an active effect from an actor permanently. Use when a spell or ability effect ends. Use list-effects to find the effect ID first. Returns the actor name and deleted effect ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Actor name or Foundry actor ID"),effectId:l.string().max(256).describe("Effect ID (from list-effects)")})}];var[nw,iw,ow,aw,sw]=Nj;function LW(e,t){e.registerTool(nw.name,{description:nw.description,annotations:U,inputSchema:nw.inputSchema.shape},async({identifier:r})=>y(await t.query("list-effects",{identifier:r}))),e.registerTool(iw.name,{description:iw.description,annotations:Ve,inputSchema:iw.inputSchema.shape},async({identifier:r,effectId:i})=>y(await t.query("get-effect",{identifier:r,effectId:i})))}function qW(e,t){e.registerTool(ow.name,{description:ow.description,annotations:C,inputSchema:ow.inputSchema.shape},async({identifier:r,name:i,changes:n,icon:o,disabled:a,duration:s})=>y(await t.query("create-effect",{identifier:r,effectData:{name:i,changes:n,icon:o,disabled:a,duration:s}}))),e.registerTool(aw.name,{description:aw.description,annotations:W,inputSchema:aw.inputSchema.shape},async({identifier:r,effectId:i,updates:n})=>y(await t.query("update-effect",{identifier:r,effectId:i,updates:n}))),e.registerTool(sw.name,{description:sw.description,annotations:X,inputSchema:sw.inputSchema.shape},async({identifier:r,effectId:i})=>y(await t.query("delete-effect",{identifier:r,effectId:i})))}function Cj(e,t){LW(e,t),qW(e,t)}var Aj=[{name:"list-items",description:"List standalone world items (not owned by any actor) with pagination. Returns each item's name, ID, type (weapon/spell/equipment/etc.), and folder. Response includes total count and hasMore flag. Filter by item type or folder name. For items on a character's sheet, use search-character-items (characters bundle) instead.",inputSchema:l.object({type:l.string().max(256).optional().describe("Filter by item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background)"),folder:l.string().max(256).optional().describe("Filter by folder name (substring match)"),limit:l.number().int().min(1).max(200).optional().describe("Max results to return (default: 50)"),offset:l.number().int().min(0).optional().describe("Number of results to skip (default: 0)")})},{name:"search-items",description:"Search standalone world items by name or description text. Returns matching items with names, IDs, types, and relevance. For searching items on a character, use search-character-items (characters bundle). For compendium items, use search-compendium (compendium bundle).",inputSchema:l.object({query:l.string().max(256).describe("Search text to match against item name or description"),type:l.string().max(256).optional().describe("Filter by item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background)")})},{name:"get-item",description:"Get full details of a standalone world item including name, type, description (HTML), system-specific properties (damage, weight, rarity, etc.), and image path. For items owned by a character, use get-character-item (characters bundle) instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Item name or Foundry ID")})},{name:"update-item",description:"Update a standalone world item using Foundry dot-notation paths. Change name, system data, image, or other properties. Use get-item first to see current values.",inputSchema:l.object({identifier:l.string().max(256).describe("Item name or Foundry ID"),updates:Ue.describe("Foundry update data (e.g. { name, system, img })")})},{name:"create-item",description:"Create a standalone world item (not owned by any actor). Returns the new item ID. Specify the item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background) and optional system data. For adding items directly to a character, use import-compendium-to-character (characters bundle) instead.",inputSchema:l.object({name:l.string().max(256).describe("Item name"),type:l.string().max(256).describe("Item type (weapon, spell, equipment, consumable, tool, loot, feat, class, subclass, background)"),system:Ue.optional().describe("System-specific data"),img:l.string().max(256).optional().describe("Item image path"),folderId:l.string().max(256).optional().describe("Folder name or ID")})},{name:"delete-item",description:"Delete a standalone world item permanently. This is irreversible. Returns the deleted item name and ID. For removing items from a character, use delete-character-items (characters bundle) instead.",inputSchema:l.object({identifier:l.string().max(256).describe("Item name or Foundry ID")})}];var[cw,lw,uw,dw,pw,mw]=Aj;function ZW(e,t){e.registerTool(cw.name,{description:cw.description,annotations:Ve,inputSchema:cw.inputSchema.shape},async({type:r,folder:i,limit:n,offset:o})=>y(await t.query("list-items",{type:r,folder:i,limit:n,offset:o}))),e.registerTool(lw.name,{description:lw.description,annotations:Ve,inputSchema:lw.inputSchema.shape},async({query:r,type:i})=>y(await t.query("search-items",{query:r,type:i}))),e.registerTool(uw.name,{description:uw.description,annotations:Ve,inputSchema:uw.inputSchema.shape},async({identifier:r})=>y(await t.query("get-item",{identifier:r})))}function FW(e,t){e.registerTool(dw.name,{description:dw.description,annotations:W,inputSchema:dw.inputSchema.shape},async({identifier:r,updates:i})=>y(await t.query("update-item",{identifier:r,updates:i}))),e.registerTool(pw.name,{description:pw.description,annotations:C,inputSchema:pw.inputSchema.shape},async({name:r,type:i,system:n,img:o,folderId:a})=>y(await t.query("create-item",{name:r,type:i,system:n,img:o,folderId:a}))),e.registerTool(mw.name,{description:mw.description,annotations:X,inputSchema:mw.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-item",{identifier:r})))}function Mj(e,t){ZW(e,t),FW(e,t)}var Uj=l.enum(["Actor","Item","Scene","JournalEntry","RollableTable","Macro","Cards","Playlist"]),Lj=[{name:"list-folders",description:"List all folders in the world organized by nesting hierarchy. Returns each folder's name, ID, type, parent folder, color, and document count. Filter by document type (Actor, Item, Scene, JournalEntry, etc.) to see only relevant folders.",inputSchema:l.object({type:Uj.optional().describe("Filter by document type")})},{name:"get-folder",description:"Get full details of a folder including its name, type, parent, color, depth, and a list of all documents it contains. Use to inspect a folder's contents or metadata.",inputSchema:l.object({identifier:l.string().max(256).describe("Folder name or Foundry ID")})},{name:"create-folder",description:"Create a new folder for organizing documents in the sidebar. Specify the document type this folder holds (Actor, Item, Scene, JournalEntry, RollableTable, Macro, Cards, Playlist) and an optional parent folder for nesting. Returns the new folder ID.",inputSchema:l.object({name:l.string().max(256).describe("Folder name"),type:Uj.describe("Document type this folder holds"),parentId:l.string().max(256).optional().describe("Parent folder name or ID for nesting")})},{name:"update-folder",description:"Update a folder \u2014 rename, change parent (for re-nesting), or set a display color. Use list-folders to find the folder ID first.",inputSchema:l.object({identifier:l.string().max(256).describe("Folder name or Foundry ID"),name:l.string().max(256).optional().describe("New folder name"),parentId:l.string().max(256).optional().describe("New parent folder name or ID (use null to move to root)"),color:l.string().max(256).optional().describe('Folder color (hex, e.g., "#ff0000")')})},{name:"delete-folder",description:"Delete a folder from the world permanently. Documents inside the folder are moved to root level, not deleted. Only the folder organization is removed. Returns the deleted folder name and ID.",inputSchema:l.object({identifier:l.string().max(256).describe("Folder name or Foundry ID")})}];var[fw,hw,gw,yw,vw]=Lj;function VW(e,t){e.registerTool(fw.name,{description:fw.description,annotations:U,inputSchema:fw.inputSchema.shape},async({type:r})=>y(await t.query("list-folders",{type:r}))),e.registerTool(hw.name,{description:hw.description,annotations:Ve,inputSchema:hw.inputSchema.shape},async({identifier:r})=>y(await t.query("get-folder",{identifier:r}))),e.registerTool(gw.name,{description:gw.description,annotations:C,inputSchema:gw.inputSchema.shape},async({name:r,type:i,parentId:n})=>y(await t.query("create-folder",{name:r,type:i,parentId:n})))}function BW(e,t){e.registerTool(yw.name,{description:yw.description,annotations:W,inputSchema:yw.inputSchema.shape},async({identifier:r,name:i,parentId:n,color:o})=>{let a={};return i!==void 0&&(a.name=i),n!==void 0&&(a.parentId=n),o!==void 0&&(a.color=o),y(await t.query("update-folder",{identifier:r,updates:a}))}),e.registerTool(vw.name,{description:vw.description,annotations:X,inputSchema:vw.inputSchema.shape},async({identifier:r})=>y(await t.query("delete-folder",{identifier:r})))}function qj(e,t){VW(e,t),BW(e,t)}var Zj=l.discriminatedUnion("type",[l.object({type:l.literal("rectangle"),x:l.number().describe("X position in pixels (from scene top-left)"),y:l.number().describe("Y position in pixels (from scene top-left)"),width:l.number().min(1).describe("Width in pixels"),height:l.number().min(1).describe("Height in pixels"),rotation:l.number().min(0).max(360).optional().describe("Rotation in degrees"),hole:l.boolean().optional().describe("Cut out this shape (default: false)")}),l.object({type:l.literal("circle"),x:l.number().describe("Center X in pixels (from scene top-left)"),y:l.number().describe("Center Y in pixels (from scene top-left)"),radius:l.number().min(1).describe("Radius in pixels"),hole:l.boolean().optional().describe("Cut out this shape (default: false)")}),l.object({type:l.literal("ellipse"),x:l.number().describe("Center X in pixels (from scene top-left)"),y:l.number().describe("Center Y in pixels (from scene top-left)"),radiusX:l.number().min(1).describe("Horizontal radius in pixels"),radiusY:l.number().min(1).describe("Vertical radius in pixels"),rotation:l.number().min(0).max(360).optional().describe("Rotation in degrees"),hole:l.boolean().optional().describe("Cut out this shape (default: false)")}),l.object({type:l.literal("polygon"),points:l.array(l.number()).min(6).max(100).describe("Flat array of x,y pairs: [x1,y1,x2,y2,...] (min 3 points)"),hole:l.boolean().optional().describe("Cut out this shape (default: false)")})]),Fj=l.object({name:l.string().max(256).optional(),type:l.string().max(256).describe("Behavior type: adjustDarknessLevel, displayScrollingText, executeMacro, executeScript, pauseGame, suppressWeather, teleportToken, toggleBehavior"),disabled:l.boolean().optional(),system:Ue.optional().describe("Behavior-specific configuration")}),Vj=[{name:"list-regions",description:"List all regions (Foundry v13 trigger zones) on the active scene. Returns every region (no pagination) with name, ID, shape summary (type, position in pixels, dimensions), behavior types, and color. Use to find region IDs before inspecting or modifying them."},{name:"get-region",description:"Get a region with full details including all shapes (rectangle, circle, ellipse, polygon) with positions in pixels, attached behaviors with their configuration, elevation range, and display color. Use for inspecting region setup before modifying it.",inputSchema:l.object({identifier:l.string().max(256).describe("Region name or Foundry ID")})},{name:"update-region",description:"Update a region on the active scene. Modify name, display color, shapes, or behaviors. Shapes and behaviors are replaced entirely when provided \u2014 include all desired entries, not just changes.",inputSchema:l.object({identifier:l.string().max(256).describe("Region name or Foundry ID"),name:l.string().max(256).optional().describe("New region name"),color:l.string().max(256).optional().describe('New display color (hex, e.g., "#ff0000")'),shapes:l.array(Zj).max(100).optional().describe("Replace region shapes"),behaviors:l.array(Fj).max(100).optional().describe("Replace region behaviors")})},{name:"create-region",description:"Create a trigger region on the active scene (Foundry v13+). Regions trigger behaviors when tokens enter, exit, or move within the defined area. All shape coordinates are in pixels (from scene top-left). Attach behaviors like executeMacro (run code on enter/exit), teleportToken (portal), displayScrollingText (area labels), pauseGame, or suppressWeather.",inputSchema:l.object({name:l.string().max(256).describe("Region name"),shapes:l.array(Zj).max(100).describe("Region shapes (rectangle, circle, ellipse, or polygon)"),color:l.string().max(256).optional().describe('Display color (hex, e.g., "#ff0000")'),behaviors:l.array(Fj).max(100).optional().describe("Behaviors to attach to the region")})},{name:"delete-regions",description:"Delete regions from the active scene permanently. Removes the trigger zones, all shapes, and all attached behaviors. Does not affect tokens currently inside the region. Returns the count of deleted regions, their IDs, and the scene name.",inputSchema:l.object({identifiers:l.array(l.string().max(256)).min(1).max(100).describe("Region IDs to delete")})}];var[Bj,bw,_w,Sw,xw]=Vj;function HW(e,t){e.registerTool(Bj.name,{description:Bj.description,annotations:U},async()=>y(await t.query("list-regions"))),e.registerTool(bw.name,{description:bw.description,annotations:U,inputSchema:bw.inputSchema.shape},async({identifier:r})=>y(await t.query("get-region",{identifier:r})))}function WW(e,t){e.registerTool(_w.name,{description:_w.description,annotations:X,inputSchema:_w.inputSchema.shape},async({identifier:r,name:i,color:n,shapes:o,behaviors:a})=>{let s={};return i!==void 0&&(s.name=i),n!==void 0&&(s.color=n),o!==void 0&&(s.shapes=o),a!==void 0&&(s.behaviors=a),y(await t.query("update-region",{identifier:r,updates:s}))})}function JW(e,t){e.registerTool(Sw.name,{description:Sw.description,annotations:X,inputSchema:Sw.inputSchema.shape},async({name:r,shapes:i,color:n,behaviors:o})=>y(await t.query("create-region",{name:r,shapes:i,color:n,behaviors:o}))),e.registerTool(xw.name,{description:xw.description,annotations:X,inputSchema:xw.inputSchema.shape},async({identifiers:r})=>y(await t.query("delete-regions",{identifiers:r})))}function Hj(e,t){HW(e,t),WW(e,t),JW(e,t)}import{readFile as GW}from"node:fs/promises";import KW from"node:path";var Wj=[{name:"generate-image",description:"Generate an image and display it in the chat. Use for character portraits, item illustrations, concept art, or any visual the user wants to SEE in conversation. Does NOT create or modify scenes \u2014 for battle maps and scene backgrounds, use generate-scene instead. Returns the image inline as base64. Be specific in prompts about subject, style, composition, lighting, and mood. Requires image generation to be enabled with a valid API key.",inputSchema:l.object({prompt:l.string().max(1e4).describe("Detailed image generation prompt. Be specific about subject, style, composition, lighting, and mood. For fantasy RPG content, include relevant details like setting, character features, and atmosphere."),size:l.enum(["square","landscape","portrait"]).optional().describe("Image aspect ratio (default: square). Use landscape for wide scenes, portrait for characters."),style:l.string().max(256).optional().describe('Optional style modifier (e.g., "oil painting", "watercolor", "pixel art", "photorealistic"). Appended to the prompt to influence the visual style.')})}];var QW=9e4,YW=l.object({imagePath:l.string(),mimeType:l.string(),provider:l.string(),model:l.string()}),[ww]=Wj;function Jj(e){let t=Xt(e),r=Or(e),i=Wo(r);return{content:[{type:"text",text:`Image generation failed: ${t}${i}`}],isError:!0}}function XW(e){if(e.includes("\0")||e.includes("\\"))return!1;let t=e.split("/");return t.includes("..")?!1:t[0]==="familiar"}async function eJ(e){let{imagePath:t,mimeType:r,provider:i,model:n,foundryDataPath:o}=e;if(!XW(t))return{content:[{type:"text",text:"Image generation failed: invalid image path"}],isError:!0};try{let a=KW.join(o,t);return{content:[{type:"image",data:(await GW(a)).toString("base64"),mimeType:r},{type:"text",text:`Image generated by ${i} (${n})`}]}}catch(a){return{content:[{type:"text",text:`Image saved to Foundry (${t}) but could not be read: ${jr(a)}`}],isError:!0}}}function $w(e,t,r){e.registerTool(ww.name,{description:ww.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},inputSchema:ww.inputSchema.shape},async({prompt:i,size:n,style:o})=>{let a=await t.query("generate-image",{prompt:i,size:n,style:o},QW);if(!a.success)return Jj(a.error);let s=YW.safeParse(a.result);return s.success?r==null?{content:[{type:"text",text:`Image saved to Foundry (${s.data.imagePath}) but cannot be returned \u2014 set FAMILIAR_FOUNDRY_DATA env var`}],isError:!0}:eJ({imagePath:s.data.imagePath,mimeType:s.data.mimeType,provider:s.data.provider,model:s.data.model,foundryDataPath:r}):Jj(`unexpected response format \u2014 ${s.error.message}`)})}var Gj=[{name:"generate-voice",description:"Generate speech audio (text-to-speech) from text using the configured TTS provider (ElevenLabs, Cartesia, OpenAI TTS, or PlayHT). Returns audio that plays in Foundry for all connected players. Use for NPC dialogue, dramatic narration, or reading text aloud. Keep text under 500 characters for best results. Requires voice generation to be enabled and a voice provider configured in Foundry module settings.",inputSchema:l.object({text:l.string().max(1e4).describe("The text to convert to speech. Keep it concise for best results \u2014 under 500 characters."),voice:l.string().max(256).optional().describe("Optional voice ID to use instead of the configured default. Each provider has different voice IDs \u2014 check provider documentation."),characterId:l.string().max(256).optional().describe("Optional actor name or ID. Resolves the voice from the character\u2019s stored voice (set via set-character-voice). Ignored if voice is explicitly provided.")})},{name:"generate-dialogue",description:"Generate multi-voice dialogue with different voices for DM narration and character speech. Each segment specifies text and a role (dm or character) to select the corresponding voice provider from settings. All segments generate in parallel for speed, then play sequentially as an audio queue with no gaps between lines. Use this instead of multiple generate-voice calls when you have a conversation between the DM and characters. Max 20 segments per call.",inputSchema:l.object({segments:l.array(l.object({text:l.string().max(1e4).describe("The text to speak."),role:l.enum(["dm","character"]).describe('Voice slot: "dm" uses DM/Narrator voice settings, "character" uses Character voice settings.'),voice:l.string().max(256).optional().describe("Optional voice ID override for this segment."),characterId:l.string().max(256).optional().describe("Optional actor name or ID. Resolves the voice from the character\u2019s stored voice (set via set-character-voice). Ignored if voice is explicitly provided."),instructions:l.string().max(1e3).optional().describe('Tone/style instructions for this segment (OpenAI TTS only). E.g. "Speak in a menacing whisper".'),speed:l.number().min(.25).max(4).optional().describe("Speech speed for this segment (OpenAI TTS only). 0.25\u20134.0, default 1.0."),stability:l.number().min(0).max(1).optional().describe("Voice stability for this segment (ElevenLabs only). Lower = more expressive."),similarityBoost:l.number().min(0).max(1).optional().describe("Similarity boost for this segment (ElevenLabs only). Higher = closer to original voice.")})).min(1).max(20).describe("Dialogue segments in playback order. Each uses the DM or character voice slot.")})},{name:"set-character-voice",description:"Assign a TTS voice to a specific character or NPC. The voice ID is stored on the actor and automatically used when that character speaks via generate-voice or generate-dialogue. Voice IDs are provider-specific (e.g. ElevenLabs voice_id, OpenAI voice name). Pass an empty voiceId to clear the assignment.",inputSchema:l.object({identifier:l.string().max(256).describe("Actor name or ID to assign the voice to."),voiceId:l.string().max(256).describe("Provider-specific voice ID to assign. Pass empty string to clear the voice assignment.")})},{name:"get-character-voice",description:"Get the TTS voice ID assigned to a specific character or NPC. Returns the voice ID if one is configured, or null if the character uses the default voice slot.",inputSchema:l.object({identifier:l.string().max(256).describe("Actor name or ID to look up.")})}];var zm=6e4,tJ=l.object({provider:l.string(),model:l.string(),text:l.string()}),rJ=l.object({successCount:l.number(),failureCount:l.number(),segments:l.array(l.object({text:l.string(),role:l.string(),index:l.number(),provider:l.string(),model:l.string(),error:l.string().optional()}))}),[kw,Tw,Iw,Ew]=Gj;function nJ(e,t){e.registerTool(kw.name,{description:kw.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:kw.inputSchema.shape},async({text:r,voice:i,characterId:n})=>{let o=await t.query("generate-voice",{text:r,voice:i,characterId:n},zm);if(!o.success){let s=Xt(o.error),c=Or(o.error),u=Wo(c);return{content:[{type:"text",text:`Voice generation failed: ${s}${u}`}],isError:!0}}let a=tJ.safeParse(o.result);return a.success?{content:[{type:"text",text:`Audio generated by ${a.data.provider} (${a.data.model}) and playing in Foundry VTT. Spoken text: "${a.data.text}"`}]}:{content:[{type:"text",text:`Voice generation failed: unexpected response format \u2014 ${a.error.message}`}],isError:!0}})}function iJ(e,t){e.registerTool(Tw.name,{description:Tw.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:Tw.inputSchema.shape},async({segments:r})=>{let i=await t.query("generate-dialogue",{segments:r},zm*2);if(!i.success){let a=Xt(i.error),s=Or(i.error),c=Wo(s);return{content:[{type:"text",text:`Dialogue generation failed: ${a}${c}`}],isError:!0}}let n=rJ.safeParse(i.result);if(!n.success)return{content:[{type:"text",text:`Dialogue generation failed: unexpected response format \u2014 ${n.error.message}`}],isError:!0};let o=n.data.segments.map(a=>a.error!=null&&a.error!==""?` [${a.role}] FAILED: ${a.error}`:` [${a.role}] "${a.text}" \u2014 ${a.provider}`);return{content:[{type:"text",text:`Dialogue (${String(n.data.successCount)}/${String(n.data.segments.length)} segments) playing sequentially in Foundry:
98
98
  ${o.join(`
99
- `)}`}]}})}function RW(e,t){e.registerTool(pw.name,{description:pw.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:pw.inputSchema.shape},async({identifier:r,voiceId:i})=>{let n=await t.query("set-character-voice",{identifier:r,voiceId:i},Im);return n.success?{content:[{type:"text",text:`Voice ${i===""?"cleared":`set to "${i}"`} for character "${r}".`}]}:{content:[{type:"text",text:`Failed to set character voice: ${Yt(n.error)}`}],isError:!0}})}function OW(e,t){e.registerTool(mw.name,{description:mw.description,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:mw.inputSchema.shape},async({identifier:r})=>{let i=await t.query("get-character-voice",{identifier:r},Im);if(!i.success)return{content:[{type:"text",text:`Failed to get character voice: ${Yt(i.error)}`}],isError:!0};let n=typeof i.result=="object"&&i.result!==null?i.result:{},o="voiceId"in n&&typeof n.voiceId=="string"?n.voiceId:null;return{content:[{type:"text",text:o!=null&&o!==""?`Character "${r}" has voice ID: "${o}"`:`Character "${r}" has no custom voice assigned (uses default voice slot).`}]}})}function Dj(e,t){PW(e,t),zW(e,t),RW(e,t),OW(e,t)}var Nj=[{name:"search-lore",description:"Search the campaign knowledge base (journals, characters, scenes, items) using semantic search. Returns relevant text chunks with source references.",inputSchema:c.object({query:c.string().max(256).describe("Search query to find relevant campaign lore"),type:c.enum(["journal","character","scene","item"]).optional().describe("Filter results to a specific document type"),limit:c.number().int().min(1).max(20).optional().describe("Maximum number of results to return (default: 5)")})},{name:"get-campaign-memories",description:"Retrieve stored campaign memories \u2014 persistent facts about characters, quests, NPCs, world state, and items that persist across sessions.",inputSchema:c.object({category:c.enum(["character","quest","npc","world_state","item","combat","effect","location","relationship"]).optional().describe("Filter memories by category"),query:c.string().max(256).optional().describe("Search term to filter memories by content")})},{name:"save-campaign-memory",description:"Save a new fact to persistent campaign memory. Facts persist across sessions and are automatically injected into future conversations. Only save facts useful in FUTURE sessions \u2014 not dice rolls, temporary combat state, or data Foundry already tracks (HP, conditions, inventory). Use for important plot developments, character changes, NPC interactions, locations, and relationships.",inputSchema:c.object({category:c.enum(["character","quest","npc","world_state","item","combat","effect","location","relationship"]).describe("Category for this memory"),content:c.string().max(1e3).describe("The fact to remember \u2014 one atomic piece of information per call"),relatedEntities:c.array(c.string().max(100)).max(5).optional().describe("Names of related characters, locations, or items")})},{name:"update-campaign-memory",description:"Update an existing campaign memory fact. Use when correcting or refining a previously stored fact. Provide the memory ID and the updated content.",inputSchema:c.object({id:c.string().max(100).describe("The ID of the memory fact to update"),content:c.string().min(20).max(1e3).describe("The updated fact content"),relatedEntities:c.array(c.string().max(100)).max(5).optional().describe("Character, NPC, location, or item names related to this fact")})},{name:"delete-campaign-memory",description:"Soft-delete a campaign memory fact. The fact is marked as superseded but kept in history. Use when a fact is outdated or incorrect.",inputSchema:c.object({id:c.string().max(100).describe("The ID of the memory fact to delete"),reason:c.string().max(256).optional().describe("Brief reason for deletion")})}];var[fw,hw,gw,yw,vw]=Nj;function Cj(e,t){e.registerTool(fw.name,{description:fw.description,annotations:q,inputSchema:fw.inputSchema.shape},async({query:r,type:i,limit:n})=>y(await t.query("search-lore",{query:r,type:i,limit:n}))),e.registerTool(hw.name,{description:hw.description,annotations:q,inputSchema:hw.inputSchema.shape},async({category:r,query:i})=>y(await t.query("get-campaign-memories",{category:r,query:i}))),e.registerTool(gw.name,{description:gw.description,annotations:C,inputSchema:gw.inputSchema.shape},async({category:r,content:i,relatedEntities:n})=>y(await t.query("save-campaign-memory",{category:r,content:i,relatedEntities:n}))),e.registerTool(yw.name,{description:yw.description,annotations:C,inputSchema:yw.inputSchema.shape},async({id:r,content:i,relatedEntities:n})=>y(await t.query("update-campaign-memory",{id:r,content:i,relatedEntities:n}))),e.registerTool(vw.name,{description:vw.description,annotations:X,inputSchema:vw.inputSchema.shape},async({id:r,reason:i})=>y(await t.query("delete-campaign-memory",{id:r,reason:i})))}var jW=c.enum(["tavern_common","kitchen","bedroom","corridor","storage","cellar","throne_room","library","temple_nave","temple_chancel","crypt","prison_cell","guard_room","armory","smithy","shop","stable","natural_cavern","mine_shaft","sewer","wizard_study","great_hall","barracks","treasury","apothecary","torture_chamber","clearing","campsite","road","dense_forest"]),DW=c.enum(["pillars","raised_platform","pit","water","rubble","lava","altar_dais","balcony","collapsed_wall"]),Aj=c.object({id:c.string().max(64).describe("Unique room identifier"),name:c.string().max(128).describe("Display name for the room"),type:jW.optional().describe("Room type \u2014 drives auto-furnishing when fixtures are not specified"),x:c.number().int().min(0).max(200).optional().describe("Grid column (top-left). Optional \u2014 compiler auto-places rooms when omitted"),y:c.number().int().min(0).max(200).optional().describe("Grid row (top-left). Optional \u2014 compiler auto-places rooms when omitted"),width:c.number().int().min(2).max(50).describe("Room width in grid squares"),height:c.number().int().min(2).max(50).describe("Room height in grid squares"),shape:c.enum(["rectangle","L","T","cross","circle","octagon","cave"]).optional().default("rectangle").describe("Room shape. Rectangle is the only shape supported in Phase 1"),wallType:c.enum(["stone","wood","cave","none","hedge","fence","cliff"]).optional().describe("Wall material \u2014 affects visual style. Default: stone"),wallRestriction:c.enum(["normal","terrain","ethereal","invisible"]).optional().describe("Wall restriction preset. Default: normal (blocks everything)"),elevation:c.number().min(-100).max(500).optional().describe("Room elevation in feet relative to ground. Default: 0"),features:c.array(DW).optional().describe("Terrain features placed inside the room (pillars, pits, water, etc.)")}),Mj=c.object({from:c.string().max(64).describe("Source room ID"),to:c.string().max(64).describe("Target room ID"),type:c.enum(["door","secret_door","archway","stairs_down","stairs_up","trapdoor","window","passage"]).describe("Connection type"),side:c.enum(["north","south","east","west"]).optional().describe("Which wall of the source room"),locked:c.boolean().optional().describe("Door starts locked"),open:c.boolean().optional().describe("Door starts open (archways are always open)"),offset:c.number().min(0).max(1).optional().describe("Position along shared wall. 0.5 = center (default)")}),Uj=c.object({actor:c.string().max(256).describe("Actor name or compendium reference"),room:c.string().max(64).describe("Room ID where the token is placed"),position:c.union([c.enum(["center","near_door","corner","random","wall_north","wall_south","wall_east","wall_west"]),c.object({gridX:c.number(),gridY:c.number()})]).describe("Position within the room"),hidden:c.boolean().optional().describe("Token hidden from players"),disposition:c.enum(["friendly","neutral","hostile","secret"]).optional().describe("Token disposition"),rotation:c.number().min(0).max(360).optional().describe("Token rotation in degrees")}),Lj=c.object({type:c.string().max(64).describe("Fixture type. Known types (torch, fireplace, chandelier, etc.) generate lights/sounds. Unknown types become map notes"),room:c.string().max(64).describe("Room ID"),position:c.union([c.enum(["north_wall","south_wall","east_wall","west_wall","center","corner_nw","corner_ne","corner_sw","corner_se","random"]),c.object({gridX:c.number(),gridY:c.number()})]).describe("Position within the room"),count:c.number().int().min(1).max(8).optional().describe("Number to place (default: 1)")}),qj=c.object({text:c.string().max(1024).describe("Note content"),room:c.string().max(64).describe("Room ID"),position:c.union([c.enum(["center","near_door","entrance"]),c.object({gridX:c.number(),gridY:c.number()})]).optional().describe("Position within the room"),icon:c.string().max(256).optional().describe("Foundry icon path")}),Zj=c.object({name:c.string().max(128).describe("Zone display name"),room:c.string().max(64).describe("Room ID"),type:c.enum(["difficult_terrain","hazard","darkness","silence","antimagic","trigger"]).describe("Zone type"),coverage:c.enum(["full","half","quarter"]).optional().describe("How much of the room the zone covers (default: quarter)"),position:c.union([c.enum(["center","entrance","random"]),c.object({gridX:c.number(),gridY:c.number(),width:c.number(),height:c.number()})]).optional().describe("Zone position within room"),color:c.string().max(7).optional().describe("Hex color for region visualization")});var Fj=[{name:"generate-scene",description:"Generate a complete Foundry VTT scene from a structured blueprint. Provide rooms with dimensions and types, connections between rooms, and optionally token placements and fixtures. Room coordinates are optional \u2014 the compiler auto-places rooms when x/y are omitted. Room types (tavern_common, kitchen, bedroom, etc.) trigger automatic furnishing with appropriate lights and sounds. Returns the created scene ID and a summary of all placed elements.",inputSchema:c.object({name:c.string().max(128).describe("Scene name"),gridWidth:c.number().int().min(10).max(200).optional().describe("Scene width in grid squares. Auto-calculated from rooms when omitted"),gridHeight:c.number().int().min(10).max(200).optional().describe("Scene height in grid squares. Auto-calculated from rooms when omitted"),environment:c.enum(["indoor","outdoor","underground","mixed"]).optional().describe("Scene environment type. Default: indoor"),layout:c.enum(["linear","branching","hub_and_spoke","grid","freeform"]).optional().describe("Layout hint for auto-placement when room coordinates are omitted"),gridDistance:c.number().min(1).max(100).optional().describe("Feet per grid square (default: 5)"),darkness:c.number().min(0).max(1).optional().describe("Scene darkness level. 0=daylight, 1=pitch black"),weather:c.enum(["none","rain","fog","snow","leaves","rainStorm"]).optional().describe("Weather particle effect"),backgroundColor:c.string().max(7).optional().describe("Hex color for scene background"),rooms:c.array(Aj).min(1).max(50).describe("Room definitions"),connections:c.array(Mj).min(0).max(100).optional().describe("Connections between rooms (doors, passages, stairs)"),tokens:c.array(Uj).max(100).optional().describe("Token placements"),fixtures:c.array(Lj).max(200).optional().describe("Explicit fixture placements (override auto-furnishing)"),notes:c.array(qj).max(50).optional().describe("Map pin notes"),zones:c.array(Zj).max(50).optional().describe("Region zones (difficult terrain, hazards)"),backgroundPrompt:c.string().max(1024).optional().describe("AI image generation prompt for scene background. Generates a top-down battlemap image using the configured image provider and applies it as the scene background. Requires image generation to be enabled in settings with a valid API key.")})}];var NW=12e4,[bw]=Fj;function Vj(e,t){e.registerTool(bw.name,{description:bw.description,annotations:C,inputSchema:bw.inputSchema.shape},async r=>y(await t.query("compile-scene",r,NW)))}var CW=[["dice",AO],["world",JO],["chat",nj],["combat",PO],["combat-ai",OO],["characters",SO],["scenes",HO],["compendium",NO],["journals",UO],["canvas",KO],["canvas-environment",tj],["playlists",sj],["tables",lj],["cards",pj],["macros",hj],["effects",_j],["items",xj],["folders",kj],["regions",zj],["ember-events",vj],["image-generation",Oj],["voice-generation",Dj],["knowledge",Cj],["scene-generator",Vj]];function AW(e,t,r){let i=Bo(e),n=new Set(Object.keys(i));return t(e,r),Object.keys(i).filter(o=>!n.has(o))}function _w(e,t,r=!1,i){vO(e,I);let n=new Tm(e),o=new Map;for(let[a,s]of CW)try{let l=AW(e,s,t);o.set(a,l)}catch(l){I.error({bundleId:a,error:l},`Failed to register tool bundle: ${a}`)}return bO(e,n,i),n.initialize(o,r),n}async function Bj(e){let{connector:t,queryable:r,clientTracker:i,httpPort:n,httpHost:o,httpSecret:a,corsOrigins:s,webhookHandler:l,metrics:u}=e,d=new Map,p=async m=>{let g=new lc({name:"familiar",version:"0.1.0"});_w(g,r,!0,u),await g.connect(m);let v=m.sessionId;v!==void 0&&v!==""&&d.set(v,g),g.server.oninitialized=()=>{let _=g.server.getClientVersion();i.add({name:_?.name??"Unknown HTTP client",version:_?.version??"unknown",transport:"http",sessionId:v??void 0,connectedAt:new Date().toISOString()})},m.onclose=()=>{v!==void 0&&v!==""&&(i.removeBySessionId(v),d.delete(v))},I.info("New MCP server instance connected to transport")},{server:f,closeAllSessions:h}=await gO(n,p,s,{webhookHandler:l,secret:a,host:o});I.info("MCP Streamable HTTP transport ready (multi-session)"),Gy(async()=>{f.close();let m=[...d.values()].map(async g=>{try{await g.close()}catch(v){I.warn({err:v},"Error closing MCP server instance")}});await Promise.all(m),d.clear(),await h(),await new Promise(g=>{setTimeout(g,3e3).unref()}),await Jy(t)})}async function Hj(e,t,r,i){let n=new lc({name:"familiar",version:"0.1.0"});_w(n,t,!1,i);let o=new ym;await n.connect(o),n.server.oninitialized=()=>{let a=n.server.getClientVersion();r.add({name:a?.name??"Unknown stdio client",version:a?.version??"unknown",transport:"stdio",connectedAt:new Date().toISOString()})},o.onclose=()=>{r.removeByTransport("stdio")},I.info("MCP stdio transport connected"),Gy(async()=>{await Jy(e),await n.close()})}var Em=class{stats=new Map;record(t,r,i){let n=this.stats.get(t);n||(n={calls:0,errors:0,totalMs:0,maxMs:0,lastCallAt:0},this.stats.set(t,n)),n.calls++,i||n.errors++,n.totalMs+=r,r>n.maxMs&&(n.maxMs=r),n.lastCallAt=Date.now()}getStats(){return Object.fromEntries(this.stats)}getSummary(){let t=0,r=0;for(let i of this.stats.values())t+=i.calls,r+=i.errors;return{totalCalls:t,totalErrors:r,methods:this.getStats()}}reset(){this.stats.clear()}};function Wj(e,t){return{query:async(r,i,n)=>{let o=Date.now(),a=await e.query(r,i,n);return t.record(r,Date.now()-o,a.success),a}}}process.on("uncaughtException",e=>{I.fatal({err:e},"Uncaught exception"),process.exit(1)});process.on("unhandledRejection",e=>{I.fatal({err:e},"Unhandled rejection"),process.exit(1)});async function MW(){let e=kI();XE(e);let t=QE(e),r=new Gd,i,n,o=LE(r,()=>i),a=new Em,s=Wj(o,a),l=new jc(p=>{r.pushClientUpdate(p,i)}),d=YE(e,t,()=>{if(n==null||n===""||!t)return;i=void 0;let p=n;(async()=>{try{i=await t.validate(p)}catch(f){I.error({err:f},"License re-validation after webhook failed"),i={valid:!1,status:"unknown"}}l.broadcastNow()})()});r.onModuleConnect(p=>{if(n=p,i=void 0,!t){i={valid:!0,status:"active"},l.broadcastNow();return}if(p==null||p===""){i={valid:!1,status:"unknown"},l.broadcastNow();return}(async()=>{try{i=await t.validate(p)}catch(f){I.error({err:f},"License validation failed during module connect"),i={valid:!1,status:"unknown"}}l.broadcastNow()})()}),r.start(e.wsPort,e.wsHost,e.wsAllowedOrigins,e.wsSecret),I.info({host:e.wsHost,port:e.wsPort},"Familiar server starting"),e.httpPort!=null?await Bj({connector:r,queryable:s,clientTracker:l,httpPort:e.httpPort,httpHost:e.httpHost,httpSecret:e.httpSecret,corsOrigins:e.corsOrigins??[],webhookHandler:d,metrics:a}):await Hj(r,s,l,a)}try{await MW()}catch(e){I.fatal({err:e},"Fatal error"),process.exit(1)}
99
+ `)}`}]}})}function oJ(e,t){e.registerTool(Iw.name,{description:Iw.description,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:Iw.inputSchema.shape},async({identifier:r,voiceId:i})=>{let n=await t.query("set-character-voice",{identifier:r,voiceId:i},zm);return n.success?{content:[{type:"text",text:`Voice ${i===""?"cleared":`set to "${i}"`} for character "${r}".`}]}:{content:[{type:"text",text:`Failed to set character voice: ${Xt(n.error)}`}],isError:!0}})}function aJ(e,t){e.registerTool(Ew.name,{description:Ew.description,annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:Ew.inputSchema.shape},async({identifier:r})=>{let i=await t.query("get-character-voice",{identifier:r},zm);if(!i.success)return{content:[{type:"text",text:`Failed to get character voice: ${Xt(i.error)}`}],isError:!0};let n=typeof i.result=="object"&&i.result!==null?i.result:{},o="voiceId"in n&&typeof n.voiceId=="string"?n.voiceId:null;return{content:[{type:"text",text:o!=null&&o!==""?`Character "${r}" has voice ID: "${o}"`:`Character "${r}" has no custom voice assigned (uses default voice slot).`}]}})}function Kj(e,t){nJ(e,t),iJ(e,t),oJ(e,t),aJ(e,t)}var Qj=[{name:"search-lore",description:"Search the campaign knowledge base (journals, characters, scenes, items) using semantic search. Returns relevant text chunks with source references.",inputSchema:l.object({query:l.string().max(256).describe("Search query to find relevant campaign lore"),type:l.enum(["journal","character","scene","item"]).optional().describe("Filter results to a specific document type"),limit:l.number().int().min(1).max(20).optional().describe("Maximum number of results to return (default: 5)")})},{name:"get-campaign-memories",description:"Retrieve stored campaign memories \u2014 persistent facts about characters, quests, NPCs, world state, and items that persist across sessions.",inputSchema:l.object({category:l.enum(["character","quest","npc","world_state","item","combat","effect","location","relationship"]).optional().describe("Filter memories by category"),query:l.string().max(256).optional().describe("Search term to filter memories by content")})},{name:"save-campaign-memory",description:"Save a new fact to persistent campaign memory. Facts persist across sessions and are automatically injected into future conversations. Only save facts useful in FUTURE sessions \u2014 not dice rolls, temporary combat state, or data Foundry already tracks (HP, conditions, inventory). Use for important plot developments, character changes, NPC interactions, locations, and relationships.",inputSchema:l.object({category:l.enum(["character","quest","npc","world_state","item","combat","effect","location","relationship"]).describe("Category for this memory"),content:l.string().max(1e3).describe("The fact to remember \u2014 one atomic piece of information per call"),relatedEntities:l.array(l.string().max(100)).max(5).optional().describe("Names of related characters, locations, or items")})},{name:"update-campaign-memory",description:"Update an existing campaign memory fact. Use when correcting or refining a previously stored fact. Provide the memory ID and the updated content.",inputSchema:l.object({id:l.string().max(100).describe("The ID of the memory fact to update"),content:l.string().min(20).max(1e3).describe("The updated fact content"),relatedEntities:l.array(l.string().max(100)).max(5).optional().describe("Character, NPC, location, or item names related to this fact")})},{name:"delete-campaign-memory",description:"Soft-delete a campaign memory fact. The fact is marked as superseded but kept in history. Use when a fact is outdated or incorrect.",inputSchema:l.object({id:l.string().max(100).describe("The ID of the memory fact to delete"),reason:l.string().max(256).optional().describe("Brief reason for deletion")})}];var[Pw,zw,Rw,Ow,jw]=Qj;function Yj(e,t){e.registerTool(Pw.name,{description:Pw.description,annotations:U,inputSchema:Pw.inputSchema.shape},async({query:r,type:i,limit:n})=>y(await t.query("search-lore",{query:r,type:i,limit:n}))),e.registerTool(zw.name,{description:zw.description,annotations:U,inputSchema:zw.inputSchema.shape},async({category:r,query:i})=>y(await t.query("get-campaign-memories",{category:r,query:i}))),e.registerTool(Rw.name,{description:Rw.description,annotations:C,inputSchema:Rw.inputSchema.shape},async({category:r,content:i,relatedEntities:n})=>y(await t.query("save-campaign-memory",{category:r,content:i,relatedEntities:n}))),e.registerTool(Ow.name,{description:Ow.description,annotations:C,inputSchema:Ow.inputSchema.shape},async({id:r,content:i,relatedEntities:n})=>y(await t.query("update-campaign-memory",{id:r,content:i,relatedEntities:n}))),e.registerTool(jw.name,{description:jw.description,annotations:X,inputSchema:jw.inputSchema.shape},async({id:r,reason:i})=>y(await t.query("delete-campaign-memory",{id:r,reason:i})))}var sJ=l.enum(["tavern_common","kitchen","bedroom","corridor","storage","cellar","throne_room","library","temple_nave","temple_chancel","crypt","prison_cell","guard_room","armory","smithy","shop","stable","natural_cavern","mine_shaft","sewer","wizard_study","great_hall","barracks","treasury","apothecary","torture_chamber","clearing","campsite","road","dense_forest"]),Xj=l.object({id:l.string().max(64).describe("Unique room identifier"),name:l.string().max(128).describe("Display name for the room"),type:sJ.optional().describe("Room type \u2014 enriches the AI image generation prompt with spatial context"),x:l.number().int().min(0).max(200).optional().describe("Grid column (top-left). Optional \u2014 auto-placed linearly when omitted"),y:l.number().int().min(0).max(200).optional().describe("Grid row (top-left). Optional \u2014 auto-placed linearly when omitted"),width:l.number().int().min(2).max(50).describe("Room width in grid squares"),height:l.number().int().min(2).max(50).describe("Room height in grid squares")}),eD=l.object({from:l.string().max(64).describe("Source room ID"),to:l.string().max(64).describe("Target room ID"),type:l.enum(["door","secret_door","archway","stairs_down","stairs_up","trapdoor","window","passage"]).describe("Connection type \u2014 used for prompt enrichment")});var tD=[{name:"generate-scene",description:"Create a scene with an AI-generated battle map background image. ALWAYS use this instead of create-scene when the user wants a battle map, dungeon, tavern, or any scene with a background \u2014 never combine create-scene + generate-image separately. Provide rooms with dimensions to set grid size and enrich the image prompt. The backgroundPrompt drives AI image generation \u2014 room names, types, and connections are woven into the prompt automatically. If no backgroundPrompt is given, one is auto-generated from the scene name, rooms, and environment. The generated image is automatically uploaded and applied as the scene background. Returns the created scene ID with background status.",inputSchema:l.object({name:l.string().max(128).describe("Scene name"),gridWidth:l.number().int().min(10).max(200).optional().describe("Scene width in grid squares. Auto-calculated from rooms when omitted"),gridHeight:l.number().int().min(10).max(200).optional().describe("Scene height in grid squares. Auto-calculated from rooms when omitted"),environment:l.enum(["indoor","outdoor","underground","mixed"]).optional().describe("Scene environment type \u2014 added to the image prompt"),gridDistance:l.number().min(1).max(100).optional().describe("Feet per grid square (default: 5)"),weather:l.enum(["none","rain","fog","snow","leaves","rainStorm"]).optional().describe("Weather particle effect"),backgroundColor:l.string().max(7).optional().describe("Hex color for scene background"),rooms:l.array(Xj).min(1).max(50).describe("Room definitions \u2014 used for grid sizing and prompt enrichment"),connections:l.array(eD).min(0).max(100).optional().describe("Connections between rooms \u2014 used for prompt enrichment"),backgroundPrompt:l.string().max(1024).optional().describe("AI image generation prompt for scene background. Generates a top-down battlemap image using the configured image provider and applies it as the scene background. Requires image generation to be enabled in settings with a valid API key.")})}];var cJ=12e4,[Dw]=tD;function rD(e,t){e.registerTool(Dw.name,{description:Dw.description,annotations:C,inputSchema:Dw.inputSchema.shape},async r=>y(await t.query("generate-scene",r,cJ)))}var lJ=[["dice",XO],["world",uj],["chat",bj],["combat",BO],["combat-ai",JO],["characters",AO],["scenes",cj],["compendium",QO],["journals",tj],["canvas",pj],["canvas-environment",yj],["playlists",wj],["tables",kj],["cards",Ej],["macros",Rj],["effects",Cj],["items",Mj],["folders",qj],["regions",Hj],["ember-events",Dj],["image-generation",$w],["voice-generation",Kj],["knowledge",Yj],["scene-generator",rD]];function uJ(e,t,r){let i=Ho(e),n=new Set(Object.keys(i));return t(e,r),Object.keys(i).filter(o=>!n.has(o))}function Nw(e,t,r){let{eagerLoadAll:i=!1,metrics:n,foundryDataPath:o}=r??{};DO(e,T);let a=new Pm(e),s=new Map;for(let[c,u]of lJ)try{let p=uJ(e,c==="image-generation"?(f,h)=>$w(f,h,o):u,t);s.set(c,p)}catch(d){T.error({bundleId:c,error:d},`Failed to register tool bundle: ${c}`)}return NO(e,a,n),a.initialize(s,i),a}async function nD(e){let{connector:t,queryable:r,clientTracker:i,httpPort:n,httpHost:o,httpSecret:a,corsOrigins:s,webhookHandler:c,metrics:u,foundryDataPath:d}=e,p=new Map,f=async g=>{let v=new uc({name:"familiar",version:"0.1.0"});Nw(v,r,{eagerLoadAll:!0,metrics:u,foundryDataPath:d}),await v.connect(g);let _=g.sessionId;_!==void 0&&_!==""&&p.set(_,v),v.server.oninitialized=()=>{let w=v.server.getClientVersion();i.add({name:w?.name??"Unknown HTTP client",version:w?.version??"unknown",transport:"http",sessionId:_??void 0,connectedAt:new Date().toISOString()})},g.onclose=()=>{_!==void 0&&_!==""&&(i.removeBySessionId(_),p.delete(_))},T.info("New MCP server instance connected to transport")},{server:h,closeAllSessions:m}=await OO(n,f,s,{webhookHandler:c,secret:a,host:o});T.info("MCP Streamable HTTP transport ready (multi-session)"),Xy(async()=>{h.close();let g=[...p.values()].map(async v=>{try{await v.close()}catch(_){T.warn({err:_},"Error closing MCP server instance")}});await Promise.all(g),p.clear(),await m(),await new Promise(v=>{setTimeout(v,3e3).unref()}),await Yy(t)})}async function iD(e){let{connector:t,queryable:r,clientTracker:i,metrics:n,foundryDataPath:o}=e,a=new uc({name:"familiar",version:"0.1.0"});Nw(a,r,{metrics:n,foundryDataPath:o});let s=new Sm;await a.connect(s),a.server.oninitialized=()=>{let c=a.server.getClientVersion();i.add({name:c?.name??"Unknown stdio client",version:c?.version??"unknown",transport:"stdio",connectedAt:new Date().toISOString()})},s.onclose=()=>{i.removeByTransport("stdio")},T.info("MCP stdio transport connected"),Xy(async()=>{await Yy(t),await a.close()})}var Rm=class{stats=new Map;record(t,r,i){let n=this.stats.get(t);n||(n={calls:0,errors:0,totalMs:0,maxMs:0,lastCallAt:0},this.stats.set(t,n)),n.calls++,i||n.errors++,n.totalMs+=r,r>n.maxMs&&(n.maxMs=r),n.lastCallAt=Date.now()}getStats(){return Object.fromEntries(this.stats)}getSummary(){let t=0,r=0;for(let i of this.stats.values())t+=i.calls,r+=i.errors;return{totalCalls:t,totalErrors:r,methods:this.getStats()}}reset(){this.stats.clear()}};function oD(e,t){return{query:async(r,i,n)=>{let o=Date.now(),a=await e.query(r,i,n);return t.record(r,Date.now()-o,a.success),a}}}process.on("uncaughtException",e=>{T.fatal({err:e},"Uncaught exception"),process.exit(1)});process.on("unhandledRejection",e=>{T.fatal({err:e},"Unhandled rejection"),process.exit(1)});async function dJ(){let e=qI();hP(e);let t=mP(e),r=new Xd,i,n,o=rP(r,()=>i),a=new Rm,s=oD(o,a),c=new Nc(p=>{r.pushClientUpdate(p,i)}),d=fP(e,t,()=>{if(n==null||n===""||!t)return;i=void 0;let p=n;(async()=>{try{i=await t.validate(p)}catch(f){T.error({err:f},"License re-validation after webhook failed"),i={valid:!1,status:"unknown"}}c.broadcastNow()})()});r.onModuleConnect(p=>{if(n=p,i=void 0,!t){i={valid:!0,status:"active"},c.broadcastNow();return}if(p==null||p===""){i={valid:!1,status:"unknown"},c.broadcastNow();return}(async()=>{try{i=await t.validate(p)}catch(f){T.error({err:f},"License validation failed during module connect"),i={valid:!1,status:"unknown"}}c.broadcastNow()})()}),r.start(e.wsPort,e.wsHost,e.wsAllowedOrigins,e.wsSecret),T.info({host:e.wsHost,port:e.wsPort},"Familiar server starting"),e.httpPort!=null?await nD({connector:r,queryable:s,clientTracker:c,httpPort:e.httpPort,httpHost:e.httpHost,httpSecret:e.httpSecret,corsOrigins:e.corsOrigins??[],webhookHandler:d,metrics:a,foundryDataPath:e.foundryDataPath}):await iD({connector:r,queryable:s,clientTracker:c,metrics:a,foundryDataPath:e.foundryDataPath})}try{await dJ()}catch(e){T.fatal({err:e},"Fatal error"),process.exit(1)}