@gigabuddy/agent 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-cli.js +84 -84
- package/package.json +1 -1
package/agent-cli.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var FC=Object.create;var Xf=Object.defineProperty;var qC=Object.getOwnPropertyDescriptor;var VC=Object.getOwnPropertyNames;var HC=Object.getPrototypeOf,WC=Object.prototype.hasOwnProperty;var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zr=(t,e)=>{for(var r in e)Xf(t,r,{get:e[r],enumerable:!0})},BC=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of VC(e))!WC.call(t,n)&&n!==r&&Xf(t,n,{get:()=>e[n],enumerable:!(i=qC(e,n))||i.enumerable});return t};var Uc=(t,e,r)=>(r=t!=null?FC(HC(t)):{},BC(e||!t||!t.__esModule?Xf(r,"default",{value:t,enumerable:!0}):r,t));var im=D((VF,Uw)=>{"use strict";var rm="\x1B",De=`${rm}[`,aR="\x07",nm={to(t,e){return e?`${De}${e+1};${t+1}H`:`${De}${t+1}G`},move(t,e){let r="";return t<0?r+=`${De}${-t}D`:t>0&&(r+=`${De}${t}C`),e<0?r+=`${De}${-e}A`:e>0&&(r+=`${De}${e}B`),r},up:(t=1)=>`${De}${t}A`,down:(t=1)=>`${De}${t}B`,forward:(t=1)=>`${De}${t}C`,backward:(t=1)=>`${De}${t}D`,nextLine:(t=1)=>`${De}E`.repeat(t),prevLine:(t=1)=>`${De}F`.repeat(t),left:`${De}G`,hide:`${De}?25l`,show:`${De}?25h`,save:`${rm}7`,restore:`${rm}8`},cR={up:(t=1)=>`${De}S`.repeat(t),down:(t=1)=>`${De}T`.repeat(t)},lR={screen:`${De}2J`,up:(t=1)=>`${De}1J`.repeat(t),down:(t=1)=>`${De}J`.repeat(t),line:`${De}2K`,lineEnd:`${De}K`,lineStart:`${De}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?nm.up():"");return t&&(e+=nm.left),e}};Uw.exports={cursor:nm,scroll:cR,erase:lR,beep:aR}});var Ea=D(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 Ra=class{};ye._CodeOrName=Ra;ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Xn=class extends Ra{constructor(e){if(super(),!ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ye.Name=Xn;var Ht=class extends Ra{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,i)=>`${r}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,i)=>(i instanceof Xn&&(r[i.str]=(r[i.str]||0)+1),r),{})}};ye._Code=Ht;ye.nil=new Ht("");function p0(t,...e){let r=[t[0]],i=0;for(;i<e.length;)_v(r,e[i]),r.push(t[++i]);return new Ht(r)}ye._=p0;var bv=new Ht("+");function f0(t,...e){let r=[Aa(t[0])],i=0;for(;i<e.length;)r.push(bv),_v(r,e[i]),r.push(bv,Aa(t[++i]));return rN(r),new Ht(r)}ye.str=f0;function _v(t,e){e instanceof Ht?t.push(...e._items):e instanceof Xn?t.push(e):t.push(oN(e))}ye.addCodeArg=_v;function rN(t){let e=1;for(;e<t.length-1;){if(t[e]===bv){let r=nN(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function nN(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Xn||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Xn))return`"${t}${e.slice(1)}`}function iN(t,e){return e.emptyStr()?t:t.emptyStr()?e:f0`${t}${e}`}ye.strConcat=iN;function oN(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Aa(Array.isArray(t)?t.join(","):t)}function sN(t){return new Ht(Aa(t))}ye.stringify=sN;function Aa(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ye.safeStringify=Aa;function aN(t){return typeof t=="string"&&ye.IDENTIFIER.test(t)?new Ht(`.${t}`):p0`[${t}]`}ye.getProperty=aN;function cN(t){if(typeof t=="string"&&ye.IDENTIFIER.test(t))return new Ht(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ye.getEsmExportName=cN;function lN(t){return new Ht(t.toString())}ye.regexpCode=lN});var kv=D(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ValueScope=Ct.ValueScopeName=Ct.Scope=Ct.varKinds=Ct.UsedValueState=void 0;var zt=Ea(),wv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},up;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(up||(Ct.UsedValueState=up={}));Ct.varKinds={const:new zt.Name("const"),let:new zt.Name("let"),var:new zt.Name("var")};var dp=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof zt.Name?e:this.name(e)}name(e){return new zt.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Ct.Scope=dp;var pp=class extends zt.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:i}){this.value=e,this.scopePath=(0,zt._)`.${new zt.Name(r)}[${i}]`}};Ct.ValueScopeName=pp;var uN=(0,zt._)`\n`,$v=class extends dp{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?uN:zt.nil}}get(){return this._scope}name(e){return new pp(e,this._newName(e))}value(e,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:o}=n,s=(i=r.key)!==null&&i!==void 0?i:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,n);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,n.setValue(r,{property:o,itemIndex:l}),n}getValue(e,r){let i=this._values[e];if(i)return i.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,zt._)`${e}${i.scopePath}`})}scopeCode(e=this._values,r,i){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,i)}_reduceValues(e,r,i={},n){let o=zt.nil;for(let s in e){let a=e[s];if(!a)continue;let c=i[s]=i[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,up.Started);let u=r(l);if(u){let d=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const;o=(0,zt._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=n?.(l))o=(0,zt._)`${o}${u}${this.opts._n}`;else throw new wv(l);c.set(l,up.Completed)})}return o}};Ct.ValueScope=$v});var te=D(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.or=ne.and=ne.not=ne.CodeGen=ne.operators=ne.varKinds=ne.ValueScopeName=ne.ValueScope=ne.Scope=ne.Name=ne.regexpCode=ne.stringify=ne.getProperty=ne.nil=ne.strConcat=ne.str=ne._=void 0;var me=Ea(),or=kv(),_n=Ea();Object.defineProperty(ne,"_",{enumerable:!0,get:function(){return _n._}});Object.defineProperty(ne,"str",{enumerable:!0,get:function(){return _n.str}});Object.defineProperty(ne,"strConcat",{enumerable:!0,get:function(){return _n.strConcat}});Object.defineProperty(ne,"nil",{enumerable:!0,get:function(){return _n.nil}});Object.defineProperty(ne,"getProperty",{enumerable:!0,get:function(){return _n.getProperty}});Object.defineProperty(ne,"stringify",{enumerable:!0,get:function(){return _n.stringify}});Object.defineProperty(ne,"regexpCode",{enumerable:!0,get:function(){return _n.regexpCode}});Object.defineProperty(ne,"Name",{enumerable:!0,get:function(){return _n.Name}});var gp=kv();Object.defineProperty(ne,"Scope",{enumerable:!0,get:function(){return gp.Scope}});Object.defineProperty(ne,"ValueScope",{enumerable:!0,get:function(){return gp.ValueScope}});Object.defineProperty(ne,"ValueScopeName",{enumerable:!0,get:function(){return gp.ValueScopeName}});Object.defineProperty(ne,"varKinds",{enumerable:!0,get:function(){return gp.varKinds}});ne.operators={GT:new me._Code(">"),GTE:new me._Code(">="),LT:new me._Code("<"),LTE:new me._Code("<="),EQ:new me._Code("==="),NEQ:new me._Code("!=="),NOT:new me._Code("!"),OR:new me._Code("||"),AND:new me._Code("&&"),ADD:new me._Code("+")};var Ur=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},xv=class extends Ur{constructor(e,r,i){super(),this.varKind=e,this.name=r,this.rhs=i}render({es5:e,_n:r}){let i=e?or.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Co(this.rhs,e,r)),this}get names(){return this.rhs instanceof me._CodeOrName?this.rhs.names:{}}},fp=class extends Ur{constructor(e,r,i){super(),this.lhs=e,this.rhs=r,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof me.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Co(this.rhs,e,r),this}get names(){let e=this.lhs instanceof me.Name?{}:{...this.lhs.names};return hp(e,this.rhs)}},Sv=class extends fp{constructor(e,r,i,n){super(e,i,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Iv=class extends Ur{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Tv=class extends Ur{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Pv=class extends Ur{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},zv=class extends Ur{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Co(this.code,e,r),this}get names(){return this.code instanceof me._CodeOrName?this.code.names:{}}},Oa=class extends Ur{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,i)=>r+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let i=e[r].optimizeNodes();Array.isArray(i)?e.splice(r,1,...i):i?e[r]=i:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:i}=this,n=i.length;for(;n--;){let o=i[n];o.optimizeNames(e,r)||(dN(e,o.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ti(e,r.names),{})}},Lr=class extends Oa{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Cv=class extends Oa{},zo=class extends Lr{};zo.kind="else";var Qn=class t extends Lr{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let i=r.optimizeNodes();r=this.else=Array.isArray(i)?new zo(i):i}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(m0(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Co(this.condition,e,r),this}get names(){let e=super.names;return hp(e,this.condition),this.else&&ti(e,this.else.names),e}};Qn.kind="if";var ei=class extends Lr{};ei.kind="for";var Rv=class extends ei{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Co(this.iteration,e,r),this}get names(){return ti(super.names,this.iteration.names)}},Av=class extends ei{constructor(e,r,i,n){super(),this.varKind=e,this.name=r,this.from=i,this.to=n}render(e){let r=e.es5?or.varKinds.var:this.varKind,{name:i,from:n,to:o}=this;return`for(${r} ${i}=${n}; ${i}<${o}; ${i}++)`+super.render(e)}get names(){let e=hp(super.names,this.from);return hp(e,this.to)}},mp=class extends ei{constructor(e,r,i,n){super(),this.loop=e,this.varKind=r,this.name=i,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Co(this.iterable,e,r),this}get names(){return ti(super.names,this.iterable.names)}},Na=class extends Lr{constructor(e,r,i){super(),this.name=e,this.args=r,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Na.kind="func";var Ma=class extends Oa{render(e){return"return "+super.render(e)}};Ma.kind="return";var Ev=class extends Lr{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var i,n;return super.optimizeNames(e,r),(i=this.catch)===null||i===void 0||i.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ti(e,this.catch.names),this.finally&&ti(e,this.finally.names),e}},ja=class extends Lr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ja.kind="catch";var Da=class extends Lr{render(e){return"finally"+super.render(e)}};Da.kind="finally";var Ov=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
-
`:""},this._extScope=e,this._scope=new or.Scope({parent:e}),this._nodes=[new Cv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let i=this._extScope.value(e,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,i,n){let o=this._scope.toName(r);return i!==void 0&&n&&(this._constants[o.str]=i),this._leafNode(new xv(e,o,i)),o}const(e,r,i){return this._def(or.varKinds.const,e,r,i)}let(e,r,i){return this._def(or.varKinds.let,e,r,i)}var(e,r,i){return this._def(or.varKinds.var,e,r,i)}assign(e,r,i){return this._leafNode(new fp(e,r,i))}add(e,r){return this._leafNode(new Sv(e,ne.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==me.nil&&this._leafNode(new zv(e)),this}object(...e){let r=["{"];for(let[i,n]of e)r.length>1&&r.push(","),r.push(i),(i!==n||this.opts.es5)&&(r.push(":"),(0,me.addCodeArg)(r,n));return r.push("}"),new me._Code(r)}if(e,r,i){if(this._blockNode(new Qn(e)),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(e){return this._elseNode(new Qn(e))}else(){return this._elseNode(new zo)}endIf(){return this._endBlockNode(Qn,zo)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Rv(e),r)}forRange(e,r,i,n,o=this.opts.es5?or.varKinds.var:or.varKinds.let){let s=this._scope.toName(e);return this._for(new Av(o,s,r,i),()=>n(s))}forOf(e,r,i,n=or.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof me.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,me._)`${s}.length`,a=>{this.var(o,(0,me._)`${s}[${a}]`),i(o)})}return this._for(new mp("of",n,o,r),()=>i(o))}forIn(e,r,i,n=this.opts.es5?or.varKinds.var:or.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,me._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new mp("in",n,o,r),()=>i(o))}endFor(){return this._endBlockNode(ei)}label(e){return this._leafNode(new Iv(e))}break(e){return this._leafNode(new Tv(e))}return(e){let r=new Ma;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ma)}try(e,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Ev;if(this._blockNode(n),this.code(e),r){let o=this.name("e");this._currNode=n.catch=new ja(o),r(o)}return i&&(this._currNode=n.finally=new Da,this.code(i)),this._endBlockNode(ja,Da)}throw(e){return this._leafNode(new Pv(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){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||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=me.nil,i,n){return this._blockNode(new Na(e,r,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Na)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let i=this._currNode;if(i instanceof e||r&&i instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Qn))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};ne.CodeGen=Ov;function ti(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function hp(t,e){return e instanceof me._CodeOrName?ti(t,e.names):t}function Co(t,e,r){if(t instanceof me.Name)return i(t);if(!n(t))return t;return new me._Code(t._items.reduce((o,s)=>(s instanceof me.Name&&(s=i(s)),s instanceof me._Code?o.push(...s._items):o.push(s),o),[]));function i(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function n(o){return o instanceof me._Code&&o._items.some(s=>s instanceof me.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function dN(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function m0(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,me._)`!${Nv(t)}`}ne.not=m0;var pN=h0(ne.operators.AND);function fN(...t){return t.reduce(pN)}ne.and=fN;var mN=h0(ne.operators.OR);function hN(...t){return t.reduce(mN)}ne.or=hN;function h0(t){return(e,r)=>e===me.nil?r:r===me.nil?e:(0,me._)`${Nv(e)} ${t} ${Nv(r)}`}function Nv(t){return t instanceof me.Name?t:(0,me._)`(${t})`}});var he=D(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.checkStrictMode=oe.getErrorPath=oe.Type=oe.useFunc=oe.setEvaluated=oe.evaluatedPropsToName=oe.mergeEvaluated=oe.eachItem=oe.unescapeJsonPointer=oe.escapeJsonPointer=oe.escapeFragment=oe.unescapeFragment=oe.schemaRefOrVal=oe.schemaHasRulesButRef=oe.schemaHasRules=oe.checkUnknownRules=oe.alwaysValidSchema=oe.toHash=void 0;var Re=te(),gN=Ea();function yN(t){let e={};for(let r of t)e[r]=!0;return e}oe.toHash=yN;function vN(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(v0(t,e),!b0(e,t.self.RULES.all))}oe.alwaysValidSchema=vN;function v0(t,e=t.schema){let{opts:r,self:i}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=i.RULES.keywords;for(let o in e)n[o]||$0(t,`unknown keyword: "${o}"`)}oe.checkUnknownRules=v0;function b0(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}oe.schemaHasRules=b0;function bN(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}oe.schemaHasRulesButRef=bN;function _N({topSchemaRef:t,schemaPath:e},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Re._)`${r}`}return(0,Re._)`${t}${e}${(0,Re.getProperty)(i)}`}oe.schemaRefOrVal=_N;function wN(t){return _0(decodeURIComponent(t))}oe.unescapeFragment=wN;function $N(t){return encodeURIComponent(jv(t))}oe.escapeFragment=$N;function jv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}oe.escapeJsonPointer=jv;function _0(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}oe.unescapeJsonPointer=_0;function kN(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}oe.eachItem=kN;function g0({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:i}){return(n,o,s,a)=>{let c=s===void 0?o:s instanceof Re.Name?(o instanceof Re.Name?t(n,o,s):e(n,o,s),s):o instanceof Re.Name?(e(n,s,o),o):r(o,s);return a===Re.Name&&!(c instanceof Re.Name)?i(n,c):c}}oe.mergeEvaluated={props:g0({mergeNames:(t,e,r)=>t.if((0,Re._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Re._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Re._)`${r} || {}`).code((0,Re._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Re._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Re._)`${r} || {}`),Dv(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:w0}),items:g0({mergeNames:(t,e,r)=>t.if((0,Re._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Re._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Re._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Re._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function w0(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Re._)`{}`);return e!==void 0&&Dv(t,r,e),r}oe.evaluatedPropsToName=w0;function Dv(t,e,r){Object.keys(r).forEach(i=>t.assign((0,Re._)`${e}${(0,Re.getProperty)(i)}`,!0))}oe.setEvaluated=Dv;var y0={};function xN(t,e){return t.scopeValue("func",{ref:e,code:y0[e.code]||(y0[e.code]=new gN._Code(e.code))})}oe.useFunc=xN;var Mv;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Mv||(oe.Type=Mv={}));function SN(t,e,r){if(t instanceof Re.Name){let i=e===Mv.Num;return r?i?(0,Re._)`"[" + ${t} + "]"`:(0,Re._)`"['" + ${t} + "']"`:i?(0,Re._)`"/" + ${t}`:(0,Re._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Re.getProperty)(t).toString():"/"+jv(t)}oe.getErrorPath=SN;function $0(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}oe.checkStrictMode=$0});var Zr=D(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var lt=te(),IN={data:new lt.Name("data"),valCxt:new lt.Name("valCxt"),instancePath:new lt.Name("instancePath"),parentData:new lt.Name("parentData"),parentDataProperty:new lt.Name("parentDataProperty"),rootData:new lt.Name("rootData"),dynamicAnchors:new lt.Name("dynamicAnchors"),vErrors:new lt.Name("vErrors"),errors:new lt.Name("errors"),this:new lt.Name("this"),self:new lt.Name("self"),scope:new lt.Name("scope"),json:new lt.Name("json"),jsonPos:new lt.Name("jsonPos"),jsonLen:new lt.Name("jsonLen"),jsonPart:new lt.Name("jsonPart")};Uv.default=IN});var Ua=D(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.extendErrors=ut.resetErrorsCount=ut.reportExtraError=ut.reportError=ut.keyword$DataError=ut.keywordError=void 0;var ge=te(),yp=he(),bt=Zr();ut.keywordError={message:({keyword:t})=>(0,ge.str)`must pass "${t}" keyword validation`};ut.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ge.str)`"${t}" keyword must be ${e} ($data)`:(0,ge.str)`"${t}" keyword is invalid ($data)`};function TN(t,e=ut.keywordError,r,i){let{it:n}=t,{gen:o,compositeRule:s,allErrors:a}=n,c=S0(t,e,r);i??(s||a)?k0(o,c):x0(n,(0,ge._)`[${c}]`)}ut.reportError=TN;function PN(t,e=ut.keywordError,r){let{it:i}=t,{gen:n,compositeRule:o,allErrors:s}=i,a=S0(t,e,r);k0(n,a),o||s||x0(i,bt.default.vErrors)}ut.reportExtraError=PN;function zN(t,e){t.assign(bt.default.errors,e),t.if((0,ge._)`${bt.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ge._)`${bt.default.vErrors}.length`,e),()=>t.assign(bt.default.vErrors,null)))}ut.resetErrorsCount=zN;function CN({gen:t,keyword:e,schemaValue:r,data:i,errsCount:n,it:o}){if(n===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",n,bt.default.errors,a=>{t.const(s,(0,ge._)`${bt.default.vErrors}[${a}]`),t.if((0,ge._)`${s}.instancePath === undefined`,()=>t.assign((0,ge._)`${s}.instancePath`,(0,ge.strConcat)(bt.default.instancePath,o.errorPath))),t.assign((0,ge._)`${s}.schemaPath`,(0,ge.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ge._)`${s}.schema`,r),t.assign((0,ge._)`${s}.data`,i))})}ut.extendErrors=CN;function k0(t,e){let r=t.const("err",e);t.if((0,ge._)`${bt.default.vErrors} === null`,()=>t.assign(bt.default.vErrors,(0,ge._)`[${r}]`),(0,ge._)`${bt.default.vErrors}.push(${r})`),t.code((0,ge._)`${bt.default.errors}++`)}function x0(t,e){let{gen:r,validateName:i,schemaEnv:n}=t;n.$async?r.throw((0,ge._)`new ${t.ValidationError}(${e})`):(r.assign((0,ge._)`${i}.errors`,e),r.return(!1))}var ri={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 S0(t,e,r){let{createErrors:i}=t.it;return i===!1?(0,ge._)`{}`:RN(t,e,r)}function RN(t,e,r={}){let{gen:i,it:n}=t,o=[AN(n,r),EN(t,r)];return ON(t,e,o),i.object(...o)}function AN({errorPath:t},{instancePath:e}){let r=e?(0,ge.str)`${t}${(0,yp.getErrorPath)(e,yp.Type.Str)}`:t;return[bt.default.instancePath,(0,ge.strConcat)(bt.default.instancePath,r)]}function EN({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:i}){let n=i?e:(0,ge.str)`${e}/${t}`;return r&&(n=(0,ge.str)`${n}${(0,yp.getErrorPath)(r,yp.Type.Str)}`),[ri.schemaPath,n]}function ON(t,{params:e,message:r},i){let{keyword:n,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;i.push([ri.keyword,n],[ri.params,typeof e=="function"?e(t):e||(0,ge._)`{}`]),c.messages&&i.push([ri.message,typeof r=="function"?r(t):r]),c.verbose&&i.push([ri.schema,s],[ri.parentSchema,(0,ge._)`${u}${d}`],[bt.default.data,o]),l&&i.push([ri.propertyName,l])}});var T0=D(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.boolOrEmptySchema=Ro.topBoolOrEmptySchema=void 0;var NN=Ua(),MN=te(),jN=Zr(),DN={message:"boolean schema is false"};function UN(t){let{gen:e,schema:r,validateName:i}=t;r===!1?I0(t,!1):typeof r=="object"&&r.$async===!0?e.return(jN.default.data):(e.assign((0,MN._)`${i}.errors`,null),e.return(!0))}Ro.topBoolOrEmptySchema=UN;function LN(t,e){let{gen:r,schema:i}=t;i===!1?(r.var(e,!1),I0(t)):r.var(e,!0)}Ro.boolOrEmptySchema=LN;function I0(t,e){let{gen:r,data:i}=t,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,NN.reportError)(n,DN,void 0,e)}});var Lv=D(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.getRules=Ao.isJSONType=void 0;var ZN=["string","number","integer","boolean","null","object","array"],FN=new Set(ZN);function qN(t){return typeof t=="string"&&FN.has(t)}Ao.isJSONType=qN;function VN(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Ao.getRules=VN});var Zv=D(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.shouldUseRule=wn.shouldUseGroup=wn.schemaHasRulesForType=void 0;function HN({schema:t,self:e},r){let i=e.RULES.types[r];return i&&i!==!0&&P0(t,i)}wn.schemaHasRulesForType=HN;function P0(t,e){return e.rules.some(r=>z0(t,r))}wn.shouldUseGroup=P0;function z0(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(i=>t[i]!==void 0))}wn.shouldUseRule=z0});var La=D(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.reportTypeError=dt.checkDataTypes=dt.checkDataType=dt.coerceAndCheckDataType=dt.getJSONTypes=dt.getSchemaTypes=dt.DataType=void 0;var WN=Lv(),BN=Zv(),GN=Ua(),ee=te(),C0=he(),Eo;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Eo||(dt.DataType=Eo={}));function JN(t){let e=R0(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}dt.getSchemaTypes=JN;function R0(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(WN.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}dt.getJSONTypes=R0;function KN(t,e){let{gen:r,data:i,opts:n}=t,o=YN(e,n.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,BN.schemaHasRulesForType)(t,e[0]));if(s){let a=qv(e,i,n.strictNumbers,Eo.Wrong);r.if(a,()=>{o.length?XN(t,e,o):Vv(t)})}return s}dt.coerceAndCheckDataType=KN;var A0=new Set(["string","number","integer","boolean","null"]);function YN(t,e){return e?t.filter(r=>A0.has(r)||e==="array"&&r==="array"):[]}function XN(t,e,r){let{gen:i,data:n,opts:o}=t,s=i.let("dataType",(0,ee._)`typeof ${n}`),a=i.let("coerced",(0,ee._)`undefined`);o.coerceTypes==="array"&&i.if((0,ee._)`${s} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,ee._)`${n}[0]`).assign(s,(0,ee._)`typeof ${n}`).if(qv(e,n,o.strictNumbers),()=>i.assign(a,n))),i.if((0,ee._)`${a} !== undefined`);for(let l of r)(A0.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);i.else(),Vv(t),i.endIf(),i.if((0,ee._)`${a} !== undefined`,()=>{i.assign(n,a),QN(t,a)});function c(l){switch(l){case"string":i.elseIf((0,ee._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,ee._)`"" + ${n}`).elseIf((0,ee._)`${n} === null`).assign(a,(0,ee._)`""`);return;case"number":i.elseIf((0,ee._)`${s} == "boolean" || ${n} === null
|
|
2
|
+
var qC=Object.create;var Xf=Object.defineProperty;var VC=Object.getOwnPropertyDescriptor;var HC=Object.getOwnPropertyNames;var WC=Object.getPrototypeOf,BC=Object.prototype.hasOwnProperty;var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zr=(t,e)=>{for(var r in e)Xf(t,r,{get:e[r],enumerable:!0})},GC=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of HC(e))!BC.call(t,n)&&n!==r&&Xf(t,n,{get:()=>e[n],enumerable:!(i=VC(e,n))||i.enumerable});return t};var Lc=(t,e,r)=>(r=t!=null?qC(WC(t)):{},GC(e||!t||!t.__esModule?Xf(r,"default",{value:t,enumerable:!0}):r,t));var im=D((WF,Uw)=>{"use strict";var rm="\x1B",De=`${rm}[`,cA="\x07",nm={to(t,e){return e?`${De}${e+1};${t+1}H`:`${De}${t+1}G`},move(t,e){let r="";return t<0?r+=`${De}${-t}D`:t>0&&(r+=`${De}${t}C`),e<0?r+=`${De}${-e}A`:e>0&&(r+=`${De}${e}B`),r},up:(t=1)=>`${De}${t}A`,down:(t=1)=>`${De}${t}B`,forward:(t=1)=>`${De}${t}C`,backward:(t=1)=>`${De}${t}D`,nextLine:(t=1)=>`${De}E`.repeat(t),prevLine:(t=1)=>`${De}F`.repeat(t),left:`${De}G`,hide:`${De}?25l`,show:`${De}?25h`,save:`${rm}7`,restore:`${rm}8`},lA={up:(t=1)=>`${De}S`.repeat(t),down:(t=1)=>`${De}T`.repeat(t)},uA={screen:`${De}2J`,up:(t=1)=>`${De}1J`.repeat(t),down:(t=1)=>`${De}J`.repeat(t),line:`${De}2K`,lineEnd:`${De}K`,lineStart:`${De}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?nm.up():"");return t&&(e+=nm.left),e}};Uw.exports={cursor:nm,scroll:lA,erase:uA,beep:cA}});var Ea=D(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 Aa=class{};ye._CodeOrName=Aa;ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Xn=class extends Aa{constructor(e){if(super(),!ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ye.Name=Xn;var Ht=class extends Aa{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,i)=>`${r}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,i)=>(i instanceof Xn&&(r[i.str]=(r[i.str]||0)+1),r),{})}};ye._Code=Ht;ye.nil=new Ht("");function p0(t,...e){let r=[t[0]],i=0;for(;i<e.length;)_v(r,e[i]),r.push(t[++i]);return new Ht(r)}ye._=p0;var bv=new Ht("+");function f0(t,...e){let r=[Ra(t[0])],i=0;for(;i<e.length;)r.push(bv),_v(r,e[i]),r.push(bv,Ra(t[++i]));return nN(r),new Ht(r)}ye.str=f0;function _v(t,e){e instanceof Ht?t.push(...e._items):e instanceof Xn?t.push(e):t.push(sN(e))}ye.addCodeArg=_v;function nN(t){let e=1;for(;e<t.length-1;){if(t[e]===bv){let r=iN(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function iN(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Xn||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Xn))return`"${t}${e.slice(1)}`}function oN(t,e){return e.emptyStr()?t:t.emptyStr()?e:f0`${t}${e}`}ye.strConcat=oN;function sN(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ra(Array.isArray(t)?t.join(","):t)}function aN(t){return new Ht(Ra(t))}ye.stringify=aN;function Ra(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ye.safeStringify=Ra;function cN(t){return typeof t=="string"&&ye.IDENTIFIER.test(t)?new Ht(`.${t}`):p0`[${t}]`}ye.getProperty=cN;function lN(t){if(typeof t=="string"&&ye.IDENTIFIER.test(t))return new Ht(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ye.getEsmExportName=lN;function uN(t){return new Ht(t.toString())}ye.regexpCode=uN});var kv=D(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ValueScope=Ct.ValueScopeName=Ct.Scope=Ct.varKinds=Ct.UsedValueState=void 0;var zt=Ea(),wv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},dp;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(dp||(Ct.UsedValueState=dp={}));Ct.varKinds={const:new zt.Name("const"),let:new zt.Name("let"),var:new zt.Name("var")};var pp=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof zt.Name?e:this.name(e)}name(e){return new zt.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Ct.Scope=pp;var fp=class extends zt.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:i}){this.value=e,this.scopePath=(0,zt._)`.${new zt.Name(r)}[${i}]`}};Ct.ValueScopeName=fp;var dN=(0,zt._)`\n`,$v=class extends pp{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?dN:zt.nil}}get(){return this._scope}name(e){return new fp(e,this._newName(e))}value(e,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:o}=n,s=(i=r.key)!==null&&i!==void 0?i:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,n);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,n.setValue(r,{property:o,itemIndex:l}),n}getValue(e,r){let i=this._values[e];if(i)return i.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,zt._)`${e}${i.scopePath}`})}scopeCode(e=this._values,r,i){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,i)}_reduceValues(e,r,i={},n){let o=zt.nil;for(let s in e){let a=e[s];if(!a)continue;let c=i[s]=i[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,dp.Started);let u=r(l);if(u){let d=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const;o=(0,zt._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=n?.(l))o=(0,zt._)`${o}${u}${this.opts._n}`;else throw new wv(l);c.set(l,dp.Completed)})}return o}};Ct.ValueScope=$v});var te=D(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.or=ne.and=ne.not=ne.CodeGen=ne.operators=ne.varKinds=ne.ValueScopeName=ne.ValueScope=ne.Scope=ne.Name=ne.regexpCode=ne.stringify=ne.getProperty=ne.nil=ne.strConcat=ne.str=ne._=void 0;var me=Ea(),or=kv(),_n=Ea();Object.defineProperty(ne,"_",{enumerable:!0,get:function(){return _n._}});Object.defineProperty(ne,"str",{enumerable:!0,get:function(){return _n.str}});Object.defineProperty(ne,"strConcat",{enumerable:!0,get:function(){return _n.strConcat}});Object.defineProperty(ne,"nil",{enumerable:!0,get:function(){return _n.nil}});Object.defineProperty(ne,"getProperty",{enumerable:!0,get:function(){return _n.getProperty}});Object.defineProperty(ne,"stringify",{enumerable:!0,get:function(){return _n.stringify}});Object.defineProperty(ne,"regexpCode",{enumerable:!0,get:function(){return _n.regexpCode}});Object.defineProperty(ne,"Name",{enumerable:!0,get:function(){return _n.Name}});var yp=kv();Object.defineProperty(ne,"Scope",{enumerable:!0,get:function(){return yp.Scope}});Object.defineProperty(ne,"ValueScope",{enumerable:!0,get:function(){return yp.ValueScope}});Object.defineProperty(ne,"ValueScopeName",{enumerable:!0,get:function(){return yp.ValueScopeName}});Object.defineProperty(ne,"varKinds",{enumerable:!0,get:function(){return yp.varKinds}});ne.operators={GT:new me._Code(">"),GTE:new me._Code(">="),LT:new me._Code("<"),LTE:new me._Code("<="),EQ:new me._Code("==="),NEQ:new me._Code("!=="),NOT:new me._Code("!"),OR:new me._Code("||"),AND:new me._Code("&&"),ADD:new me._Code("+")};var Ur=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},xv=class extends Ur{constructor(e,r,i){super(),this.varKind=e,this.name=r,this.rhs=i}render({es5:e,_n:r}){let i=e?or.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Co(this.rhs,e,r)),this}get names(){return this.rhs instanceof me._CodeOrName?this.rhs.names:{}}},mp=class extends Ur{constructor(e,r,i){super(),this.lhs=e,this.rhs=r,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof me.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Co(this.rhs,e,r),this}get names(){let e=this.lhs instanceof me.Name?{}:{...this.lhs.names};return gp(e,this.rhs)}},Sv=class extends mp{constructor(e,r,i,n){super(e,i,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Iv=class extends Ur{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Tv=class extends Ur{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Pv=class extends Ur{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},zv=class extends Ur{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Co(this.code,e,r),this}get names(){return this.code instanceof me._CodeOrName?this.code.names:{}}},Oa=class extends Ur{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,i)=>r+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let i=e[r].optimizeNodes();Array.isArray(i)?e.splice(r,1,...i):i?e[r]=i:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:i}=this,n=i.length;for(;n--;){let o=i[n];o.optimizeNames(e,r)||(pN(e,o.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ti(e,r.names),{})}},Lr=class extends Oa{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Cv=class extends Oa{},zo=class extends Lr{};zo.kind="else";var Qn=class t extends Lr{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let i=r.optimizeNodes();r=this.else=Array.isArray(i)?new zo(i):i}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(m0(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Co(this.condition,e,r),this}get names(){let e=super.names;return gp(e,this.condition),this.else&&ti(e,this.else.names),e}};Qn.kind="if";var ei=class extends Lr{};ei.kind="for";var Av=class extends ei{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Co(this.iteration,e,r),this}get names(){return ti(super.names,this.iteration.names)}},Rv=class extends ei{constructor(e,r,i,n){super(),this.varKind=e,this.name=r,this.from=i,this.to=n}render(e){let r=e.es5?or.varKinds.var:this.varKind,{name:i,from:n,to:o}=this;return`for(${r} ${i}=${n}; ${i}<${o}; ${i}++)`+super.render(e)}get names(){let e=gp(super.names,this.from);return gp(e,this.to)}},hp=class extends ei{constructor(e,r,i,n){super(),this.loop=e,this.varKind=r,this.name=i,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Co(this.iterable,e,r),this}get names(){return ti(super.names,this.iterable.names)}},Na=class extends Lr{constructor(e,r,i){super(),this.name=e,this.args=r,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Na.kind="func";var Ma=class extends Oa{render(e){return"return "+super.render(e)}};Ma.kind="return";var Ev=class extends Lr{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var i,n;return super.optimizeNames(e,r),(i=this.catch)===null||i===void 0||i.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ti(e,this.catch.names),this.finally&&ti(e,this.finally.names),e}},ja=class extends Lr{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ja.kind="catch";var Da=class extends Lr{render(e){return"finally"+super.render(e)}};Da.kind="finally";var Ov=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
+
`:""},this._extScope=e,this._scope=new or.Scope({parent:e}),this._nodes=[new Cv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let i=this._extScope.value(e,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,i,n){let o=this._scope.toName(r);return i!==void 0&&n&&(this._constants[o.str]=i),this._leafNode(new xv(e,o,i)),o}const(e,r,i){return this._def(or.varKinds.const,e,r,i)}let(e,r,i){return this._def(or.varKinds.let,e,r,i)}var(e,r,i){return this._def(or.varKinds.var,e,r,i)}assign(e,r,i){return this._leafNode(new mp(e,r,i))}add(e,r){return this._leafNode(new Sv(e,ne.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==me.nil&&this._leafNode(new zv(e)),this}object(...e){let r=["{"];for(let[i,n]of e)r.length>1&&r.push(","),r.push(i),(i!==n||this.opts.es5)&&(r.push(":"),(0,me.addCodeArg)(r,n));return r.push("}"),new me._Code(r)}if(e,r,i){if(this._blockNode(new Qn(e)),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(e){return this._elseNode(new Qn(e))}else(){return this._elseNode(new zo)}endIf(){return this._endBlockNode(Qn,zo)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Av(e),r)}forRange(e,r,i,n,o=this.opts.es5?or.varKinds.var:or.varKinds.let){let s=this._scope.toName(e);return this._for(new Rv(o,s,r,i),()=>n(s))}forOf(e,r,i,n=or.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof me.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,me._)`${s}.length`,a=>{this.var(o,(0,me._)`${s}[${a}]`),i(o)})}return this._for(new hp("of",n,o,r),()=>i(o))}forIn(e,r,i,n=this.opts.es5?or.varKinds.var:or.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,me._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new hp("in",n,o,r),()=>i(o))}endFor(){return this._endBlockNode(ei)}label(e){return this._leafNode(new Iv(e))}break(e){return this._leafNode(new Tv(e))}return(e){let r=new Ma;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ma)}try(e,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Ev;if(this._blockNode(n),this.code(e),r){let o=this.name("e");this._currNode=n.catch=new ja(o),r(o)}return i&&(this._currNode=n.finally=new Da,this.code(i)),this._endBlockNode(ja,Da)}throw(e){return this._leafNode(new Pv(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){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||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=me.nil,i,n){return this._blockNode(new Na(e,r,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Na)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let i=this._currNode;if(i instanceof e||r&&i instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Qn))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};ne.CodeGen=Ov;function ti(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function gp(t,e){return e instanceof me._CodeOrName?ti(t,e.names):t}function Co(t,e,r){if(t instanceof me.Name)return i(t);if(!n(t))return t;return new me._Code(t._items.reduce((o,s)=>(s instanceof me.Name&&(s=i(s)),s instanceof me._Code?o.push(...s._items):o.push(s),o),[]));function i(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function n(o){return o instanceof me._Code&&o._items.some(s=>s instanceof me.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function pN(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function m0(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,me._)`!${Nv(t)}`}ne.not=m0;var fN=h0(ne.operators.AND);function mN(...t){return t.reduce(fN)}ne.and=mN;var hN=h0(ne.operators.OR);function gN(...t){return t.reduce(hN)}ne.or=gN;function h0(t){return(e,r)=>e===me.nil?r:r===me.nil?e:(0,me._)`${Nv(e)} ${t} ${Nv(r)}`}function Nv(t){return t instanceof me.Name?t:(0,me._)`(${t})`}});var he=D(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.checkStrictMode=oe.getErrorPath=oe.Type=oe.useFunc=oe.setEvaluated=oe.evaluatedPropsToName=oe.mergeEvaluated=oe.eachItem=oe.unescapeJsonPointer=oe.escapeJsonPointer=oe.escapeFragment=oe.unescapeFragment=oe.schemaRefOrVal=oe.schemaHasRulesButRef=oe.schemaHasRules=oe.checkUnknownRules=oe.alwaysValidSchema=oe.toHash=void 0;var Ae=te(),yN=Ea();function vN(t){let e={};for(let r of t)e[r]=!0;return e}oe.toHash=vN;function bN(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(v0(t,e),!b0(e,t.self.RULES.all))}oe.alwaysValidSchema=bN;function v0(t,e=t.schema){let{opts:r,self:i}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=i.RULES.keywords;for(let o in e)n[o]||$0(t,`unknown keyword: "${o}"`)}oe.checkUnknownRules=v0;function b0(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}oe.schemaHasRules=b0;function _N(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}oe.schemaHasRulesButRef=_N;function wN({topSchemaRef:t,schemaPath:e},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ae._)`${r}`}return(0,Ae._)`${t}${e}${(0,Ae.getProperty)(i)}`}oe.schemaRefOrVal=wN;function $N(t){return _0(decodeURIComponent(t))}oe.unescapeFragment=$N;function kN(t){return encodeURIComponent(jv(t))}oe.escapeFragment=kN;function jv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}oe.escapeJsonPointer=jv;function _0(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}oe.unescapeJsonPointer=_0;function xN(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}oe.eachItem=xN;function g0({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:i}){return(n,o,s,a)=>{let c=s===void 0?o:s instanceof Ae.Name?(o instanceof Ae.Name?t(n,o,s):e(n,o,s),s):o instanceof Ae.Name?(e(n,s,o),o):r(o,s);return a===Ae.Name&&!(c instanceof Ae.Name)?i(n,c):c}}oe.mergeEvaluated={props:g0({mergeNames:(t,e,r)=>t.if((0,Ae._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Ae._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Ae._)`${r} || {}`).code((0,Ae._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Ae._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Ae._)`${r} || {}`),Dv(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:w0}),items:g0({mergeNames:(t,e,r)=>t.if((0,Ae._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Ae._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Ae._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Ae._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function w0(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Ae._)`{}`);return e!==void 0&&Dv(t,r,e),r}oe.evaluatedPropsToName=w0;function Dv(t,e,r){Object.keys(r).forEach(i=>t.assign((0,Ae._)`${e}${(0,Ae.getProperty)(i)}`,!0))}oe.setEvaluated=Dv;var y0={};function SN(t,e){return t.scopeValue("func",{ref:e,code:y0[e.code]||(y0[e.code]=new yN._Code(e.code))})}oe.useFunc=SN;var Mv;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Mv||(oe.Type=Mv={}));function IN(t,e,r){if(t instanceof Ae.Name){let i=e===Mv.Num;return r?i?(0,Ae._)`"[" + ${t} + "]"`:(0,Ae._)`"['" + ${t} + "']"`:i?(0,Ae._)`"/" + ${t}`:(0,Ae._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ae.getProperty)(t).toString():"/"+jv(t)}oe.getErrorPath=IN;function $0(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}oe.checkStrictMode=$0});var Zr=D(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var lt=te(),TN={data:new lt.Name("data"),valCxt:new lt.Name("valCxt"),instancePath:new lt.Name("instancePath"),parentData:new lt.Name("parentData"),parentDataProperty:new lt.Name("parentDataProperty"),rootData:new lt.Name("rootData"),dynamicAnchors:new lt.Name("dynamicAnchors"),vErrors:new lt.Name("vErrors"),errors:new lt.Name("errors"),this:new lt.Name("this"),self:new lt.Name("self"),scope:new lt.Name("scope"),json:new lt.Name("json"),jsonPos:new lt.Name("jsonPos"),jsonLen:new lt.Name("jsonLen"),jsonPart:new lt.Name("jsonPart")};Uv.default=TN});var Ua=D(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.extendErrors=ut.resetErrorsCount=ut.reportExtraError=ut.reportError=ut.keyword$DataError=ut.keywordError=void 0;var ge=te(),vp=he(),bt=Zr();ut.keywordError={message:({keyword:t})=>(0,ge.str)`must pass "${t}" keyword validation`};ut.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ge.str)`"${t}" keyword must be ${e} ($data)`:(0,ge.str)`"${t}" keyword is invalid ($data)`};function PN(t,e=ut.keywordError,r,i){let{it:n}=t,{gen:o,compositeRule:s,allErrors:a}=n,c=S0(t,e,r);i??(s||a)?k0(o,c):x0(n,(0,ge._)`[${c}]`)}ut.reportError=PN;function zN(t,e=ut.keywordError,r){let{it:i}=t,{gen:n,compositeRule:o,allErrors:s}=i,a=S0(t,e,r);k0(n,a),o||s||x0(i,bt.default.vErrors)}ut.reportExtraError=zN;function CN(t,e){t.assign(bt.default.errors,e),t.if((0,ge._)`${bt.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ge._)`${bt.default.vErrors}.length`,e),()=>t.assign(bt.default.vErrors,null)))}ut.resetErrorsCount=CN;function AN({gen:t,keyword:e,schemaValue:r,data:i,errsCount:n,it:o}){if(n===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",n,bt.default.errors,a=>{t.const(s,(0,ge._)`${bt.default.vErrors}[${a}]`),t.if((0,ge._)`${s}.instancePath === undefined`,()=>t.assign((0,ge._)`${s}.instancePath`,(0,ge.strConcat)(bt.default.instancePath,o.errorPath))),t.assign((0,ge._)`${s}.schemaPath`,(0,ge.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ge._)`${s}.schema`,r),t.assign((0,ge._)`${s}.data`,i))})}ut.extendErrors=AN;function k0(t,e){let r=t.const("err",e);t.if((0,ge._)`${bt.default.vErrors} === null`,()=>t.assign(bt.default.vErrors,(0,ge._)`[${r}]`),(0,ge._)`${bt.default.vErrors}.push(${r})`),t.code((0,ge._)`${bt.default.errors}++`)}function x0(t,e){let{gen:r,validateName:i,schemaEnv:n}=t;n.$async?r.throw((0,ge._)`new ${t.ValidationError}(${e})`):(r.assign((0,ge._)`${i}.errors`,e),r.return(!1))}var ri={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 S0(t,e,r){let{createErrors:i}=t.it;return i===!1?(0,ge._)`{}`:RN(t,e,r)}function RN(t,e,r={}){let{gen:i,it:n}=t,o=[EN(n,r),ON(t,r)];return NN(t,e,o),i.object(...o)}function EN({errorPath:t},{instancePath:e}){let r=e?(0,ge.str)`${t}${(0,vp.getErrorPath)(e,vp.Type.Str)}`:t;return[bt.default.instancePath,(0,ge.strConcat)(bt.default.instancePath,r)]}function ON({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:i}){let n=i?e:(0,ge.str)`${e}/${t}`;return r&&(n=(0,ge.str)`${n}${(0,vp.getErrorPath)(r,vp.Type.Str)}`),[ri.schemaPath,n]}function NN(t,{params:e,message:r},i){let{keyword:n,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;i.push([ri.keyword,n],[ri.params,typeof e=="function"?e(t):e||(0,ge._)`{}`]),c.messages&&i.push([ri.message,typeof r=="function"?r(t):r]),c.verbose&&i.push([ri.schema,s],[ri.parentSchema,(0,ge._)`${u}${d}`],[bt.default.data,o]),l&&i.push([ri.propertyName,l])}});var T0=D(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.boolOrEmptySchema=Ao.topBoolOrEmptySchema=void 0;var MN=Ua(),jN=te(),DN=Zr(),UN={message:"boolean schema is false"};function LN(t){let{gen:e,schema:r,validateName:i}=t;r===!1?I0(t,!1):typeof r=="object"&&r.$async===!0?e.return(DN.default.data):(e.assign((0,jN._)`${i}.errors`,null),e.return(!0))}Ao.topBoolOrEmptySchema=LN;function ZN(t,e){let{gen:r,schema:i}=t;i===!1?(r.var(e,!1),I0(t)):r.var(e,!0)}Ao.boolOrEmptySchema=ZN;function I0(t,e){let{gen:r,data:i}=t,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,MN.reportError)(n,UN,void 0,e)}});var Lv=D(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.getRules=Ro.isJSONType=void 0;var FN=["string","number","integer","boolean","null","object","array"],qN=new Set(FN);function VN(t){return typeof t=="string"&&qN.has(t)}Ro.isJSONType=VN;function HN(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Ro.getRules=HN});var Zv=D(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.shouldUseRule=wn.shouldUseGroup=wn.schemaHasRulesForType=void 0;function WN({schema:t,self:e},r){let i=e.RULES.types[r];return i&&i!==!0&&P0(t,i)}wn.schemaHasRulesForType=WN;function P0(t,e){return e.rules.some(r=>z0(t,r))}wn.shouldUseGroup=P0;function z0(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(i=>t[i]!==void 0))}wn.shouldUseRule=z0});var La=D(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.reportTypeError=dt.checkDataTypes=dt.checkDataType=dt.coerceAndCheckDataType=dt.getJSONTypes=dt.getSchemaTypes=dt.DataType=void 0;var BN=Lv(),GN=Zv(),JN=Ua(),ee=te(),C0=he(),Eo;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Eo||(dt.DataType=Eo={}));function KN(t){let e=A0(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}dt.getSchemaTypes=KN;function A0(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(BN.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}dt.getJSONTypes=A0;function YN(t,e){let{gen:r,data:i,opts:n}=t,o=XN(e,n.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,GN.schemaHasRulesForType)(t,e[0]));if(s){let a=qv(e,i,n.strictNumbers,Eo.Wrong);r.if(a,()=>{o.length?QN(t,e,o):Vv(t)})}return s}dt.coerceAndCheckDataType=YN;var R0=new Set(["string","number","integer","boolean","null"]);function XN(t,e){return e?t.filter(r=>R0.has(r)||e==="array"&&r==="array"):[]}function QN(t,e,r){let{gen:i,data:n,opts:o}=t,s=i.let("dataType",(0,ee._)`typeof ${n}`),a=i.let("coerced",(0,ee._)`undefined`);o.coerceTypes==="array"&&i.if((0,ee._)`${s} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,ee._)`${n}[0]`).assign(s,(0,ee._)`typeof ${n}`).if(qv(e,n,o.strictNumbers),()=>i.assign(a,n))),i.if((0,ee._)`${a} !== undefined`);for(let l of r)(R0.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);i.else(),Vv(t),i.endIf(),i.if((0,ee._)`${a} !== undefined`,()=>{i.assign(n,a),eM(t,a)});function c(l){switch(l){case"string":i.elseIf((0,ee._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,ee._)`"" + ${n}`).elseIf((0,ee._)`${n} === null`).assign(a,(0,ee._)`""`);return;case"number":i.elseIf((0,ee._)`${s} == "boolean" || ${n} === null
|
|
4
4
|
|| (${s} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,ee._)`+${n}`);return;case"integer":i.elseIf((0,ee._)`${s} === "boolean" || ${n} === null
|
|
5
5
|
|| (${s} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,ee._)`+${n}`);return;case"boolean":i.elseIf((0,ee._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,ee._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":i.elseIf((0,ee._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(a,null);return;case"array":i.elseIf((0,ee._)`${s} === "string" || ${s} === "number"
|
|
6
|
-
|| ${s} === "boolean" || ${n} === null`).assign(a,(0,ee._)`[${n}]`)}}}function QN({gen:t,parentData:e,parentDataProperty:r},i){t.if((0,ee._)`${e} !== undefined`,()=>t.assign((0,ee._)`${e}[${r}]`,i))}function Fv(t,e,r,i=Eo.Correct){let n=i===Eo.Correct?ee.operators.EQ:ee.operators.NEQ,o;switch(t){case"null":return(0,ee._)`${e} ${n} null`;case"array":o=(0,ee._)`Array.isArray(${e})`;break;case"object":o=(0,ee._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,ee._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,ee._)`typeof ${e} ${n} ${t}`}return i===Eo.Correct?o:(0,ee.not)(o);function s(a=ee.nil){return(0,ee.and)((0,ee._)`typeof ${e} == "number"`,a,r?(0,ee._)`isFinite(${e})`:ee.nil)}}dt.checkDataType=Fv;function qv(t,e,r,i){if(t.length===1)return Fv(t[0],e,r,i);let n,o=(0,C0.toHash)(t);if(o.array&&o.object){let s=(0,ee._)`typeof ${e} != "object"`;n=o.null?s:(0,ee._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else n=ee.nil;o.number&&delete o.integer;for(let s in o)n=(0,ee.and)(n,Fv(s,e,r,i));return n}dt.checkDataTypes=qv;var eM={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ee._)`{type: ${t}}`:(0,ee._)`{type: ${e}}`};function Vv(t){let e=tM(t);(0,GN.reportError)(e,eM)}dt.reportTypeError=Vv;function tM(t){let{gen:e,data:r,schema:i}=t,n=(0,C0.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:t}}});var O0=D(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.assignDefaults=void 0;var Oo=te(),rM=he();function nM(t,e){let{properties:r,items:i}=t.schema;if(e==="object"&&r)for(let n in r)E0(t,n,r[n].default);else e==="array"&&Array.isArray(i)&&i.forEach((n,o)=>E0(t,o,n.default))}vp.assignDefaults=nM;function E0(t,e,r){let{gen:i,compositeRule:n,data:o,opts:s}=t;if(r===void 0)return;let a=(0,Oo._)`${o}${(0,Oo.getProperty)(e)}`;if(n){(0,rM.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Oo._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Oo._)`${c} || ${a} === null || ${a} === ""`),i.if(c,(0,Oo._)`${a} = ${(0,Oo.stringify)(r)}`)}});var Wt=D(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.validateUnion=Pe.validateArray=Pe.usePattern=Pe.callValidateCode=Pe.schemaProperties=Pe.allSchemaProperties=Pe.noPropertyInData=Pe.propertyInData=Pe.isOwnProperty=Pe.hasPropFunc=Pe.reportMissingProp=Pe.checkMissingProp=Pe.checkReportMissingProp=void 0;var Ee=te(),Hv=he(),$n=Zr(),iM=he();function oM(t,e){let{gen:r,data:i,it:n}=t;r.if(Bv(r,i,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ee._)`${e}`},!0),t.error()})}Pe.checkReportMissingProp=oM;function sM({gen:t,data:e,it:{opts:r}},i,n){return(0,Ee.or)(...i.map(o=>(0,Ee.and)(Bv(t,e,o,r.ownProperties),(0,Ee._)`${n} = ${o}`)))}Pe.checkMissingProp=sM;function aM(t,e){t.setParams({missingProperty:e},!0),t.error()}Pe.reportMissingProp=aM;function N0(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ee._)`Object.prototype.hasOwnProperty`})}Pe.hasPropFunc=N0;function Wv(t,e,r){return(0,Ee._)`${N0(t)}.call(${e}, ${r})`}Pe.isOwnProperty=Wv;function cM(t,e,r,i){let n=(0,Ee._)`${e}${(0,Ee.getProperty)(r)} !== undefined`;return i?(0,Ee._)`${n} && ${Wv(t,e,r)}`:n}Pe.propertyInData=cM;function Bv(t,e,r,i){let n=(0,Ee._)`${e}${(0,Ee.getProperty)(r)} === undefined`;return i?(0,Ee.or)(n,(0,Ee.not)(Wv(t,e,r))):n}Pe.noPropertyInData=Bv;function M0(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Pe.allSchemaProperties=M0;function lM(t,e){return M0(e).filter(r=>!(0,Hv.alwaysValidSchema)(t,e[r]))}Pe.schemaProperties=lM;function uM({schemaCode:t,data:e,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:s},a,c,l){let u=l?(0,Ee._)`${t}, ${e}, ${i}${n}`:e,d=[[$n.default.instancePath,(0,Ee.strConcat)($n.default.instancePath,o)],[$n.default.parentData,s.parentData],[$n.default.parentDataProperty,s.parentDataProperty],[$n.default.rootData,$n.default.rootData]];s.opts.dynamicRef&&d.push([$n.default.dynamicAnchors,$n.default.dynamicAnchors]);let p=(0,Ee._)`${u}, ${r.object(...d)}`;return c!==Ee.nil?(0,Ee._)`${a}.call(${c}, ${p})`:(0,Ee._)`${a}(${p})`}Pe.callValidateCode=uM;var dM=(0,Ee._)`new RegExp`;function pM({gen:t,it:{opts:e}},r){let i=e.unicodeRegExp?"u":"",{regExp:n}=e.code,o=n(r,i);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ee._)`${n.code==="new RegExp"?dM:(0,iM.useFunc)(t,n)}(${r}, ${i})`})}Pe.usePattern=pM;function fM(t){let{gen:e,data:r,keyword:i,it:n}=t,o=e.name("valid");if(n.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,Ee._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:Hv.Type.Num},o),e.if((0,Ee.not)(o),a)})}}Pe.validateArray=fM;function mM(t){let{gen:e,schema:r,keyword:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Hv.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:i,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,Ee._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Ee.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}Pe.validateUnion=mM});var U0=D(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.validateKeywordUsage=_r.validSchemaType=_r.funcKeywordCode=_r.macroKeywordCode=void 0;var _t=te(),ni=Zr(),hM=Wt(),gM=Ua();function yM(t,e){let{gen:r,keyword:i,schema:n,parentSchema:o,it:s}=t,a=e.macro.call(s.self,n,o,s),c=D0(r,i,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:_t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}_r.macroKeywordCode=yM;function vM(t,e){var r;let{gen:i,keyword:n,schema:o,parentSchema:s,$data:a,it:c}=t;_M(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=D0(i,n,l),d=i.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)h(),e.modifying&&j0(t),y(()=>t.error());else{let _=e.async?f():m();e.modifying&&j0(t),y(()=>bM(t,_))}}function f(){let _=i.let("ruleErrs",null);return i.try(()=>h((0,_t._)`await `),k=>i.assign(d,!1).if((0,_t._)`${k} instanceof ${c.ValidationError}`,()=>i.assign(_,(0,_t._)`${k}.errors`),()=>i.throw(k))),_}function m(){let _=(0,_t._)`${u}.errors`;return i.assign(_,null),h(_t.nil),_}function h(_=e.async?(0,_t._)`await `:_t.nil){let k=c.opts.passContext?ni.default.this:ni.default.self,w=!("compile"in e&&!a||e.schema===!1);i.assign(d,(0,_t._)`${_}${(0,hM.callValidateCode)(t,u,k,w)}`,e.modifying)}function y(_){var k;i.if((0,_t.not)((k=e.valid)!==null&&k!==void 0?k:d),_)}}_r.funcKeywordCode=vM;function j0(t){let{gen:e,data:r,it:i}=t;e.if(i.parentData,()=>e.assign(r,(0,_t._)`${i.parentData}[${i.parentDataProperty}]`))}function bM(t,e){let{gen:r}=t;r.if((0,_t._)`Array.isArray(${e})`,()=>{r.assign(ni.default.vErrors,(0,_t._)`${ni.default.vErrors} === null ? ${e} : ${ni.default.vErrors}.concat(${e})`).assign(ni.default.errors,(0,_t._)`${ni.default.vErrors}.length`),(0,gM.extendErrors)(t)},()=>t.error())}function _M({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function D0(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,_t.stringify)(r)})}function wM(t,e,r=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||r&&typeof t>"u")}_r.validSchemaType=wM;function $M({schema:t,opts:e,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 s=n.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}_r.validateKeywordUsage=$M});var Z0=D(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.extendSubschemaMode=kn.extendSubschemaData=kn.getSubschema=void 0;var wr=te(),L0=he();function kM(t,{keyword:e,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,wr._)`${t.schemaPath}${(0,wr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,wr._)`${t.schemaPath}${(0,wr.getProperty)(e)}${(0,wr.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,L0.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}kn.getSubschema=kM;function xM(t,e,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:s}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,p=a.let("data",(0,wr._)`${e.data}${(0,wr.getProperty)(r)}`,!0);c(p),t.errorPath=(0,wr.str)`${l}${(0,L0.getErrorPath)(r,i,d.jsPropertySyntax)}`,t.parentDataProperty=(0,wr._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(n!==void 0){let l=n instanceof wr.Name?n:a.let("data",n,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}kn.extendSubschemaData=xM;function SM(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){i!==void 0&&(t.compositeRule=i),n!==void 0&&(t.createErrors=n),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}kn.extendSubschemaMode=SM});var Gv=D((pJ,F0)=>{"use strict";F0.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),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 s=o[n];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var V0=D((fJ,q0)=>{"use strict";var xn=q0.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};bp(e,i,n,t,"",t)};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 bp(t,e,r,i,n,o,s,a,c,l){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,n,o,s,a,c,l);for(var u in i){var d=i[u];if(Array.isArray(d)){if(u in xn.arrayKeywords)for(var p=0;p<d.length;p++)bp(t,e,r,d[p],n+"/"+u+"/"+p,o,n,u,i,p)}else if(u in xn.propsKeywords){if(d&&typeof d=="object")for(var f in d)bp(t,e,r,d[f],n+"/"+u+"/"+IM(f),o,n,u,i,f)}else(u in xn.keywords||t.allKeys&&!(u in xn.skipKeywords))&&bp(t,e,r,d,n+"/"+u,o,n,u,i)}r(i,n,o,s,a,c,l)}}function IM(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Za=D(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.getSchemaRefs=Rt.resolveUrl=Rt.normalizeId=Rt._getFullPath=Rt.getFullPath=Rt.inlineRef=void 0;var TM=he(),PM=Gv(),zM=V0(),CM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function RM(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Jv(t):e?H0(t)<=e:!1}Rt.inlineRef=RM;var AM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Jv(t){for(let e in t){if(AM.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Jv)||typeof r=="object"&&Jv(r))return!0}return!1}function H0(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!CM.has(r)&&(typeof t[r]=="object"&&(0,TM.eachItem)(t[r],i=>e+=H0(i)),e===1/0))return 1/0}return e}function W0(t,e="",r){r!==!1&&(e=No(e));let i=t.parse(e);return B0(t,i)}Rt.getFullPath=W0;function B0(t,e){return t.serialize(e).split("#")[0]+"#"}Rt._getFullPath=B0;var EM=/#\/?$/;function No(t){return t?t.replace(EM,""):""}Rt.normalizeId=No;function OM(t,e,r){return r=No(r),t.resolve(e,r)}Rt.resolveUrl=OM;var NM=/^[a-z_][-a-z0-9._]*$/i;function MM(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=No(t[r]||e),o={"":n},s=W0(i,n,!1),a={},c=new Set;return zM(t,{allKeys:!0},(d,p,f,m)=>{if(m===void 0)return;let h=s+p,y=o[m];typeof d[r]=="string"&&(y=_.call(this,d[r])),k.call(this,d.$anchor),k.call(this,d.$dynamicAnchor),o[p]=y;function _(w){let $=this.opts.uriResolver.resolve;if(w=No(y?$(y,w):w),c.has(w))throw u(w);c.add(w);let S=this.refs[w];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?l(d,S.schema,w):w!==No(h)&&(w[0]==="#"?(l(d,a[w],w),a[w]=d):this.refs[w]=h),w}function k(w){if(typeof w=="string"){if(!NM.test(w))throw new Error(`invalid anchor "${w}"`);_.call(this,`#${w}`)}}}),a;function l(d,p,f){if(p!==void 0&&!PM(d,p))throw u(f)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Rt.getSchemaRefs=MM});var Va=D(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getData=Sn.KeywordCxt=Sn.validateFunctionCode=void 0;var X0=T0(),G0=La(),Yv=Zv(),_p=La(),jM=O0(),qa=U0(),Kv=Z0(),H=te(),K=Zr(),DM=Za(),Fr=he(),Fa=Ua();function UM(t){if(tI(t)&&(rI(t),eI(t))){FM(t);return}Q0(t,()=>(0,X0.topBoolOrEmptySchema)(t))}Sn.validateFunctionCode=UM;function Q0({gen:t,validateName:e,schema:r,schemaEnv:i,opts:n},o){n.code.es5?t.func(e,(0,H._)`${K.default.data}, ${K.default.valCxt}`,i.$async,()=>{t.code((0,H._)`"use strict"; ${J0(r,n)}`),ZM(t,n),t.code(o)}):t.func(e,(0,H._)`${K.default.data}, ${LM(n)}`,i.$async,()=>t.code(J0(r,n)).code(o))}function LM(t){return(0,H._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,H._)`, ${K.default.dynamicAnchors}={}`:H.nil}}={}`}function ZM(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,H._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,H._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,H._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,H._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,H._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,H._)`""`),t.var(K.default.parentData,(0,H._)`undefined`),t.var(K.default.parentDataProperty,(0,H._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,H._)`{}`)})}function FM(t){let{schema:e,opts:r,gen:i}=t;Q0(t,()=>{r.$comment&&e.$comment&&iI(t),BM(t),i.let(K.default.vErrors,null),i.let(K.default.errors,0),r.unevaluated&&qM(t),nI(t),KM(t)})}function qM(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,H._)`${r}.evaluated`),e.if((0,H._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,H._)`${t.evaluated}.props`,(0,H._)`undefined`)),e.if((0,H._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,H._)`${t.evaluated}.items`,(0,H._)`undefined`))}function J0(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,H._)`/*# sourceURL=${r} */`:H.nil}function VM(t,e){if(tI(t)&&(rI(t),eI(t))){HM(t,e);return}(0,X0.boolOrEmptySchema)(t,e)}function eI({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function tI(t){return typeof t.schema!="boolean"}function HM(t,e){let{schema:r,gen:i,opts:n}=t;n.$comment&&r.$comment&&iI(t),GM(t),JM(t);let o=i.const("_errs",K.default.errors);nI(t,o),i.var(e,(0,H._)`${o} === ${K.default.errors}`)}function rI(t){(0,Fr.checkUnknownRules)(t),WM(t)}function nI(t,e){if(t.opts.jtd)return K0(t,[],!1,e);let r=(0,G0.getSchemaTypes)(t.schema),i=(0,G0.coerceAndCheckDataType)(t,r);K0(t,r,!i,e)}function WM(t){let{schema:e,errSchemaPath:r,opts:i,self:n}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,Fr.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function BM(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Fr.checkStrictMode)(t,"default is ignored in the schema root")}function GM(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,DM.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function JM(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function iI({gen:t,schemaEnv:e,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)t.code((0,H._)`${K.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let s=(0,H.str)`${i}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,H._)`${K.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function KM(t){let{gen:e,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=t;r.$async?e.if((0,H._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,H._)`new ${n}(${K.default.vErrors})`)):(e.assign((0,H._)`${i}.errors`,K.default.vErrors),o.unevaluated&&YM(t),e.return((0,H._)`${K.default.errors} === 0`))}function YM({gen:t,evaluated:e,props:r,items:i}){r instanceof H.Name&&t.assign((0,H._)`${e}.props`,r),i instanceof H.Name&&t.assign((0,H._)`${e}.items`,i)}function K0(t,e,r,i){let{gen:n,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Fr.schemaHasRulesButRef)(o,u))){n.block(()=>sI(t,"$ref",u.all.$ref.definition));return}c.jtd||XM(t,e),n.block(()=>{for(let p of u.rules)d(p);d(u.post)});function d(p){(0,Yv.shouldUseGroup)(o,p)&&(p.type?(n.if((0,_p.checkDataType)(p.type,s,c.strictNumbers)),Y0(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,_p.reportTypeError)(t)),n.endIf()):Y0(t,p),a||n.if((0,H._)`${K.default.errors} === ${i||0}`))}}function Y0(t,e){let{gen:r,schema:i,opts:{useDefaults:n}}=t;n&&(0,jM.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,Yv.shouldUseRule)(i,o)&&sI(t,o.keyword,o.definition,e.type)})}function XM(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(QM(t,e),t.opts.allowUnionTypes||ej(t,e),tj(t,t.dataTypes))}function QM(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{oI(t.dataTypes,r)||Xv(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),nj(t,e)}}function ej(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Xv(t,"use allowUnionTypes to allow union type keyword")}function tj(t,e){let r=t.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,Yv.shouldUseRule)(t.schema,n)){let{type:o}=n.definition;o.length&&!o.some(s=>rj(e,s))&&Xv(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function rj(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function oI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function nj(t,e){let r=[];for(let i of t.dataTypes)oI(e,i)?r.push(i):e.includes("integer")&&i==="number"&&r.push("integer");t.dataTypes=r}function Xv(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Fr.checkStrictMode)(t,e,t.opts.strictTypes)}var wp=class{constructor(e,r,i){if((0,qa.validateKeywordUsage)(e,r,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Fr.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",aI(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,qa.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=e.gen.const("_errs",K.default.errors))}result(e,r,i){this.failResult((0,H.not)(e),r,i)}failResult(e,r,i){this.gen.if(e),i?i():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,H.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,H._)`${r} !== undefined && (${(0,H.or)(this.invalid$data(),e)})`)}error(e,r,i){if(r){this.setParams(r),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,r){(e?Fa.reportExtraError:Fa.reportError)(this,this.def.error,r)}$dataError(){(0,Fa.reportError)(this,this.def.$dataError||Fa.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Fa.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,i=H.nil){this.gen.block(()=>{this.check$data(e,i),r()})}check$data(e=H.nil,r=H.nil){if(!this.$data)return;let{gen:i,schemaCode:n,schemaType:o,def:s}=this;i.if((0,H.or)((0,H._)`${n} === undefined`,r)),e!==H.nil&&i.assign(e,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==H.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:i,def:n,it:o}=this;return(0,H.or)(s(),a());function s(){if(i.length){if(!(r instanceof H.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,H._)`${(0,_p.checkDataTypes)(c,r,o.opts.strictNumbers,_p.DataType.Wrong)}`}return H.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,H._)`!${c}(${r})`}return H.nil}}subschema(e,r){let i=(0,Kv.getSubschema)(this.it,e);(0,Kv.extendSubschemaData)(i,this.it,e),(0,Kv.extendSubschemaMode)(i,e);let n={...this.it,...i,items:void 0,props:void 0};return VM(n,r),n}mergeEvaluated(e,r){let{it:i,gen:n}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=Fr.mergeEvaluated.props(n,e.props,i.props,r)),i.items!==!0&&e.items!==void 0&&(i.items=Fr.mergeEvaluated.items(n,e.items,i.items,r)))}mergeValidEvaluated(e,r){let{it:i,gen:n}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,H.Name)),!0}};Sn.KeywordCxt=wp;function sI(t,e,r,i){let n=new wp(t,r,e);"code"in r?r.code(n,i):n.$data&&r.validate?(0,qa.funcKeywordCode)(n,r):"macro"in r?(0,qa.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,qa.funcKeywordCode)(n,r)}var ij=/^\/(?:[^~]|~0|~1)*$/,oj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function aI(t,{dataLevel:e,dataNames:r,dataPathArr:i}){let n,o;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!ij.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,o=K.default.rootData}else{let l=oj.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(n=l[2],n==="#"){if(u>=e)throw new Error(c("property/index",u));return i[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!n)return o}let s=o,a=n.split("/");for(let l of a)l&&(o=(0,H._)`${o}${(0,H.getProperty)((0,Fr.unescapeJsonPointer)(l))}`,s=(0,H._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Sn.getData=aI});var $p=D(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var Qv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};eb.default=Qv});var Ha=D(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var tb=Za(),rb=class extends Error{constructor(e,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,tb.resolveUrl)(e,r,i),this.missingSchema=(0,tb.normalizeId)((0,tb.getFullPath)(e,this.missingRef))}};nb.default=rb});var xp=D(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.resolveSchema=Bt.getCompilingSchema=Bt.resolveRef=Bt.compileSchema=Bt.SchemaEnv=void 0;var sr=te(),sj=$p(),ii=Zr(),ar=Za(),cI=he(),aj=Va(),Mo=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,ar.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};Bt.SchemaEnv=Mo;function ob(t){let e=lI.call(this,t);if(e)return e;let r=(0,ar.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,s=new sr.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:sj.default,code:(0,sr._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:ii.default.data,parentData:ii.default.parentData,parentDataProperty:ii.default.parentDataProperty,dataNames:[ii.default.data],dataPathArr:[sr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,sr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:sr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,sr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,aj.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(ii.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let f=new Function(`${ii.default.self}`,`${ii.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=l;f.evaluated={props:m instanceof sr.Name?void 0:m,items:h instanceof sr.Name?void 0:h,dynamicProps:m instanceof sr.Name,dynamicItems:h instanceof sr.Name},f.source&&(f.source.evaluated=(0,sr.stringify)(f.evaluated))}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}Bt.compileSchema=ob;function cj(t,e,r){var i;r=(0,ar.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let o=dj.call(this,t,r);if(o===void 0){let s=(i=t.localRefs)===null||i===void 0?void 0:i[r],{schemaId:a}=this.opts;s&&(o=new Mo({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=lj.call(this,o)}Bt.resolveRef=cj;function lj(t){return(0,ar.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ob.call(this,t)}function lI(t){for(let e of this._compilations)if(uj(e,t))return e}Bt.getCompilingSchema=lI;function uj(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function dj(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||kp.call(this,t,e)}function kp(t,e){let r=this.opts.uriResolver.parse(e),i=(0,ar._getFullPath)(this.opts.uriResolver,r),n=(0,ar.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===n)return ib.call(this,r,t);let o=(0,ar.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=kp.call(this,t,s);return typeof a?.schema!="object"?void 0:ib.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||ob.call(this,s),o===(0,ar.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(n=(0,ar.resolveUrl)(this.opts.uriResolver,n,l)),new Mo({schema:a,schemaId:c,root:t,baseId:n})}return ib.call(this,r,s)}}Bt.resolveSchema=kp;var pj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ib(t,{baseId:e,schema:r,root:i}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,cI.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!pj.has(a)&&l&&(e=(0,ar.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,cI.schemaHasRulesButRef)(r,this.RULES)){let a=(0,ar.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=kp.call(this,i,a)}let{schemaId:s}=this.opts;if(o=o||new Mo({schema:r,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}});var uI=D((bJ,fj)=>{fj.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 ab=D((_J,mI)=>{"use strict";var mj=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),pI=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 sb(t){let e="",r=0,i=0;for(i=0;i<t.length;i++)if(r=t[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(r=t[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i]}return e}var hj=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function dI(t){return t.length=0,!0}function gj(t,e,r){if(t.length){let i=sb(t);if(i!=="")e.push(i);else return r.error=!0,!1;t.length=0}return!0}function yj(t){let e=0,r={error:!1,address:"",zone:""},i=[],n=[],o=!1,s=!1,a=gj;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(o===!0&&(s=!0),!a(n,i,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),i.push(":");continue}else if(l==="%"){if(!a(n,i,r))break;a=dI}else{n.push(l);continue}}return n.length&&(a===dI?r.zone=n.join(""):s?i.push(n.join("")):i.push(sb(n))),r.address=i.join(""),r}function fI(t){if(vj(t,":")<2)return{host:t,isIPV6:!1};let e=yj(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,i=e.address;return e.zone&&(r+="%"+e.zone,i+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:i}}}function vj(t,e){let r=0;for(let i=0;i<t.length;i++)t[i]===e&&r++;return r}function bj(t){let e=t,r=[],i=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((i=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,i)),e=e.slice(i)}return r.join("")}function _j(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function wj(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!pI(r)){let i=fI(r);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}mI.exports={nonSimpleDomain:hj,recomposeAuthority:wj,normalizeComponentEncoding:_j,removeDotSegments:bj,isIPv4:pI,isUUID:mj,normalizeIPv6:fI,stringArrayToHexStripped:sb}});var bI=D((wJ,vI)=>{"use strict";var{isUUID:$j}=ab(),kj=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xj=["http","https","ws","wss","urn","urn:uuid"];function Sj(t){return xj.indexOf(t)!==-1}function cb(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function hI(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function gI(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Ij(t){return t.secure=cb(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Tj(t){if((t.port===(cb(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function Pj(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(kj);if(r){let i=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${i}:${e.nid||t.nid}`,o=lb(n);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function zj(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),n=`${r}:${e.nid||i}`,o=lb(n);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${i||e.nid}:${a}`,e.skipEscape=!0,s}function Cj(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!$j(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Rj(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var yI={scheme:"http",domainHost:!0,parse:hI,serialize:gI},Aj={scheme:"https",domainHost:yI.domainHost,parse:hI,serialize:gI},Sp={scheme:"ws",domainHost:!0,parse:Ij,serialize:Tj},Ej={scheme:"wss",domainHost:Sp.domainHost,parse:Sp.parse,serialize:Sp.serialize},Oj={scheme:"urn",parse:Pj,serialize:zj,skipNormalize:!0},Nj={scheme:"urn:uuid",parse:Cj,serialize:Rj,skipNormalize:!0},Ip={http:yI,https:Aj,ws:Sp,wss:Ej,urn:Oj,"urn:uuid":Nj};Object.setPrototypeOf(Ip,null);function lb(t){return t&&(Ip[t]||Ip[t.toLowerCase()])||void 0}vI.exports={wsIsSecure:cb,SCHEMES:Ip,isValidSchemeName:Sj,getSchemeHandler:lb}});var $I=D(($J,Pp)=>{"use strict";var{normalizeIPv6:Mj,removeDotSegments:Wa,recomposeAuthority:jj,normalizeComponentEncoding:Tp,isIPv4:Dj,nonSimpleDomain:Uj}=ab(),{SCHEMES:Lj,getSchemeHandler:_I}=bI();function Zj(t,e){return typeof t=="string"?t=$r(qr(t,e),e):typeof t=="object"&&(t=qr($r(t,e),e)),t}function Fj(t,e,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=wI(qr(t,i),qr(e,i),i,!0);return i.skipEscape=!0,$r(n,i)}function wI(t,e,r,i){let n={};return i||(t=qr($r(t,r),r),e=qr($r(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Wa(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Wa(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Wa(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Wa(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function qj(t,e,r){return typeof t=="string"?(t=unescape(t),t=$r(Tp(qr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=$r(Tp(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=$r(Tp(qr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=$r(Tp(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function $r(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),n=[],o=_I(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 s=jj(r);if(s!==void 0&&(i.reference!=="suffix"&&n.push("//"),n.push(s),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!i.absolutePath&&(!o||!o.absolutePath)&&(a=Wa(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var Vj=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function qr(t,e){let r=Object.assign({},e),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?t=r.scheme+":"+t:t="//"+t);let o=t.match(Vj);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(Dj(i.host)===!1){let c=Mj(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 s=_I(r.scheme||i.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&i.host&&(r.domainHost||s&&s.domainHost)&&n===!1&&Uj(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(a){i.error=i.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(t.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)))),s&&s.parse&&s.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}var ub={SCHEMES:Lj,normalize:Zj,resolve:Fj,resolveComponent:wI,equal:qj,serialize:$r,parse:qr};Pp.exports=ub;Pp.exports.default=ub;Pp.exports.fastUri=ub});var xI=D(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var kI=$I();kI.code='require("ajv/dist/runtime/uri").default';db.default=kI});var AI=D(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.CodeGen=it.Name=it.nil=it.stringify=it.str=it._=it.KeywordCxt=void 0;var Hj=Va();Object.defineProperty(it,"KeywordCxt",{enumerable:!0,get:function(){return Hj.KeywordCxt}});var jo=te();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return jo._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return jo.str}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return jo.stringify}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return jo.nil}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return jo.Name}});Object.defineProperty(it,"CodeGen",{enumerable:!0,get:function(){return jo.CodeGen}});var Wj=$p(),zI=Ha(),Bj=Lv(),Ba=xp(),Gj=te(),Ga=Za(),zp=La(),fb=he(),SI=uI(),Jj=xI(),CI=(t,e)=>new RegExp(t,e);CI.code="new RegExp";var Kj=["removeAdditional","useDefaults","coerceTypes"],Yj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Xj={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."},Qj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},II=200;function eD(t){var e,r,i,n,o,s,a,c,l,u,d,p,f,m,h,y,_,k,w,$,S,G,q,I,se;let ue=t.strict,ae=(e=t.code)===null||e===void 0?void 0:e.optimize,Me=ae===!0||ae===void 0?1:ae||0,je=(i=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:CI,ie=(n=t.uriResolver)!==null&&n!==void 0?n:Jj.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:ue)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ue)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:ue)!==null&&u!==void 0?u:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:ue)!==null&&p!==void 0?p:"log",strictRequired:(m=(f=t.strictRequired)!==null&&f!==void 0?f:ue)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:Me,regExp:je}:{optimize:Me,regExp:je},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:II,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:II,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(k=t.messages)!==null&&k!==void 0?k:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(S=t.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(q=t.validateFormats)!==null&&q!==void 0?q:!0,unicodeRegExp:(I=t.unicodeRegExp)!==null&&I!==void 0?I:!0,int32range:(se=t.int32range)!==null&&se!==void 0?se:!0,uriResolver:ie}}var Ja=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...eD(e)};let{es5:r,lines:i}=this.opts.code;this.scope=new Gj.ValueScope({scope:{},prefixes:Yj,es5:r,lines:i}),this.logger=sD(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Bj.getRules)(),TI.call(this,Xj,e,"NOT SUPPORTED"),TI.call(this,Qj,e,"DEPRECATED","warn"),this._metaOpts=iD.call(this),e.formats&&rD.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&nD.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),tD.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:i}=this.opts,n=SI;i==="id"&&(n={...SI},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let n=i(r);return"$async"in i||(this.errors=i.errors),n}compile(e,r){let i=this._addSchema(e,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,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,e,r);async function n(u,d){await o.call(this,u.$schema);let p=this._addSchema(u,d);return p.validate||s.call(this,p)}async function o(u){u&&!this.getSchema(u)&&await n.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof zI.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=i(u))}finally{delete this._loading[u]}}}addSchema(e,r,i,n=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,i,n);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Ga.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,i,r,n,!0),this}addMetaSchema(e,r,i=this.opts.validateSchema){return this.addSchema(e,r,!0,i),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let i;if(i=e.$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,e);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(e){let r;for(;typeof(r=PI.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Ba.SchemaEnv({schema:{},schemaId:i});if(r=Ba.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=PI.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let i=e[this.opts.schemaId];return i&&(i=(0,Ga.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let i;if(typeof e=="string")i=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof e=="object"&&r===void 0){if(r=e,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(cD.call(this,i,r),!r)return(0,fb.eachItem)(i,o=>pb.call(this,o)),this;uD.call(this,r);let n={...r,type:(0,zp.getJSONTypes)(r.type),schemaType:(0,zp.getJSONTypes)(r.schemaType)};return(0,fb.eachItem)(i,n.type.length===0?o=>pb.call(this,o,n):o=>n.type.forEach(s=>pb.call(this,o,n,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let i of r.rules){let n=i.rules.findIndex(o=>o.keyword===e);n>=0&&i.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${i}${n.instancePath} ${n.message}`).reduce((n,o)=>n+r+o)}$dataMetaSchema(e,r){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let o=n.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in i){let c=i[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=RI(u))}}return e}_removeAllSchemas(e,r){for(let i in e){let n=e[i];(!r||r.test(i))&&(typeof n=="string"?delete e[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[i]))}}_addSchema(e,r,i,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;i=(0,Ga.normalizeId)(s||i);let l=Ga.getSchemaRefs.call(this,e,i);return c=new Ba.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:i,localRefs:l}),this._cache.set(c.schema,c),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Ba.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Ba.compileSchema.call(this,e)}finally{this.opts=r}}};Ja.ValidationError=Wj.default;Ja.MissingRefError=zI.default;it.default=Ja;function TI(t,e,r,i="error"){for(let n in t){let o=n;o in e&&this.logger[i](`${r}: option ${n}. ${t[o]}`)}}function PI(t){return t=(0,Ga.normalizeId)(t),this.schemas[t]||this.refs[t]}function tD(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function rD(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function nD(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function iD(){let t={...this.opts};for(let e of Kj)delete t[e];return t}var oD={log(){},warn(){},error(){}};function sD(t){if(t===!1)return oD;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var aD=/^[a-z_$][a-z0-9_$:-]*$/i;function cD(t,e){let{RULES:r}=this;if((0,fb.eachItem)(t,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!aD.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function pb(t,e,r){var i;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=n?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,zp.getJSONTypes)(e.type),schemaType:(0,zp.getJSONTypes)(e.schemaType)}};e.before?lD.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(i=e.implements)===null||i===void 0||i.forEach(c=>this.addKeyword(c))}function lD(t,e,r){let i=t.rules.findIndex(n=>n.keyword===r);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function uD(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=RI(e)),t.validateSchema=this.compile(e,!0))}var dD={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function RI(t){return{anyOf:[t,dD]}}});var EI=D(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var pD={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};mb.default=pD});var jI=D(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.callRef=oi.getValidate=void 0;var fD=Ha(),OI=Wt(),At=te(),Do=Zr(),NI=xp(),Cp=he(),mD={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:i}=t,{baseId:n,schemaEnv:o,validateName:s,opts:a,self:c}=i,{root:l}=o;if((r==="#"||r==="#/")&&n===l.baseId)return d();let u=NI.resolveRef.call(c,l,n,r);if(u===void 0)throw new fD.default(i.opts.uriResolver,n,r);if(u instanceof NI.SchemaEnv)return p(u);return f(u);function d(){if(o===l)return Rp(t,s,o,o.$async);let m=e.scopeValue("root",{ref:l});return Rp(t,(0,At._)`${m}.validate`,l,l.$async)}function p(m){let h=MI(t,m);Rp(t,h,m,m.$async)}function f(m){let h=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,At.stringify)(m)}:{ref:m}),y=e.name("valid"),_=t.subschema({schema:m,dataTypes:[],schemaPath:At.nil,topSchemaRef:h,errSchemaPath:r},y);t.mergeEvaluated(_),t.ok(y)}}};function MI(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,At._)`${r.scopeValue("wrapper",{ref:e})}.validate`}oi.getValidate=MI;function Rp(t,e,r,i){let{gen:n,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Do.default.this:At.nil;i?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,At._)`await ${(0,OI.callValidateCode)(t,e,l)}`),f(e),s||n.assign(m,!0)},h=>{n.if((0,At._)`!(${h} instanceof ${o.ValidationError})`,()=>n.throw(h)),p(h),s||n.assign(m,!1)}),t.ok(m)}function d(){t.result((0,OI.callValidateCode)(t,e,l),()=>f(e),()=>p(e))}function p(m){let h=(0,At._)`${m}.errors`;n.assign(Do.default.vErrors,(0,At._)`${Do.default.vErrors} === null ? ${h} : ${Do.default.vErrors}.concat(${h})`),n.assign(Do.default.errors,(0,At._)`${Do.default.vErrors}.length`)}function f(m){var h;if(!o.opts.unevaluated)return;let y=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(o.props=Cp.mergeEvaluated.props(n,y.props,o.props));else{let _=n.var("props",(0,At._)`${m}.evaluated.props`);o.props=Cp.mergeEvaluated.props(n,_,o.props,At.Name)}if(o.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(o.items=Cp.mergeEvaluated.items(n,y.items,o.items));else{let _=n.var("items",(0,At._)`${m}.evaluated.items`);o.items=Cp.mergeEvaluated.items(n,_,o.items,At.Name)}}}oi.callRef=Rp;oi.default=mD});var DI=D(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var hD=EI(),gD=jI(),yD=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",hD.default,gD.default];hb.default=yD});var UI=D(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var Ap=te(),In=Ap.operators,Ep={maximum:{okStr:"<=",ok:In.LTE,fail:In.GT},minimum:{okStr:">=",ok:In.GTE,fail:In.LT},exclusiveMaximum:{okStr:"<",ok:In.LT,fail:In.GTE},exclusiveMinimum:{okStr:">",ok:In.GT,fail:In.LTE}},vD={message:({keyword:t,schemaCode:e})=>(0,Ap.str)`must be ${Ep[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ap._)`{comparison: ${Ep[t].okStr}, limit: ${e}}`},bD={keyword:Object.keys(Ep),type:"number",schemaType:"number",$data:!0,error:vD,code(t){let{keyword:e,data:r,schemaCode:i}=t;t.fail$data((0,Ap._)`${r} ${Ep[e].fail} ${i} || isNaN(${r})`)}};gb.default=bD});var LI=D(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var Ka=te(),_D={message:({schemaCode:t})=>(0,Ka.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Ka._)`{multipleOf: ${t}}`},wD={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_D,code(t){let{gen:e,data:r,schemaCode:i,it:n}=t,o=n.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Ka._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Ka._)`${s} !== parseInt(${s})`;t.fail$data((0,Ka._)`(${i} === 0 || (${s} = ${r}/${i}, ${a}))`)}};yb.default=wD});var FI=D(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});function ZI(t){let e=t.length,r=0,i=0,n;for(;i<e;)r++,n=t.charCodeAt(i++),n>=55296&&n<=56319&&i<e&&(n=t.charCodeAt(i),(n&64512)===56320&&i++);return r}vb.default=ZI;ZI.code='require("ajv/dist/runtime/ucs2length").default'});var qI=D(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var si=te(),$D=he(),kD=FI(),xD={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,si.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,si._)`{limit: ${t}}`},SD={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xD,code(t){let{keyword:e,data:r,schemaCode:i,it:n}=t,o=e==="maxLength"?si.operators.GT:si.operators.LT,s=n.opts.unicode===!1?(0,si._)`${r}.length`:(0,si._)`${(0,$D.useFunc)(t.gen,kD.default)}(${r})`;t.fail$data((0,si._)`${s} ${o} ${i}`)}};bb.default=SD});var VI=D(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var ID=Wt(),TD=he(),Uo=te(),PD={message:({schemaCode:t})=>(0,Uo.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Uo._)`{pattern: ${t}}`},zD={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:PD,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Uo._)`new RegExp`:(0,TD.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Uo._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Uo._)`!${u}`)}else{let c=(0,ID.usePattern)(t,n);t.fail$data((0,Uo._)`!${c}.test(${r})`)}}};_b.default=zD});var HI=D(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var Ya=te(),CD={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Ya.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Ya._)`{limit: ${t}}`},RD={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:CD,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxProperties"?Ya.operators.GT:Ya.operators.LT;t.fail$data((0,Ya._)`Object.keys(${r}).length ${n} ${i}`)}};wb.default=RD});var WI=D($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Xa=Wt(),Qa=te(),AD=he(),ED={message:({params:{missingProperty:t}})=>(0,Qa.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Qa._)`{missingProperty: ${t}}`},OD={keyword:"required",type:"object",schemaType:"array",$data:!0,error:ED,code(t){let{gen:e,schema:r,schemaCode:i,data:n,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let f=t.parentSchema.properties,{definedProperties:m}=t.it;for(let h of r)if(f?.[h]===void 0&&!m.has(h)){let y=s.schemaEnv.baseId+s.errSchemaPath,_=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,AD.checkStrictMode)(s,_,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(Qa.nil,d);else for(let f of r)(0,Xa.checkReportMissingProp)(t,f)}function u(){let f=e.let("missing");if(c||o){let m=e.let("valid",!0);t.block$data(m,()=>p(f,m)),t.ok(m)}else e.if((0,Xa.checkMissingProp)(t,r,f)),(0,Xa.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",i,f=>{t.setParams({missingProperty:f}),e.if((0,Xa.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,m){t.setParams({missingProperty:f}),e.forOf(f,i,()=>{e.assign(m,(0,Xa.propertyInData)(e,n,f,a.ownProperties)),e.if((0,Qa.not)(m),()=>{t.error(),e.break()})},Qa.nil)}}};$b.default=OD});var BI=D(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var ec=te(),ND={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ec.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ec._)`{limit: ${t}}`},MD={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ND,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxItems"?ec.operators.GT:ec.operators.LT;t.fail$data((0,ec._)`${r}.length ${n} ${i}`)}};kb.default=MD});var Op=D(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var GI=Gv();GI.code='require("ajv/dist/runtime/equal").default';xb.default=GI});var JI=D(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var Sb=La(),ot=te(),jD=he(),DD=Op(),UD={message:({params:{i:t,j:e}})=>(0,ot.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ot._)`{i: ${t}, j: ${e}}`},LD={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:UD,code(t){let{gen:e,data:r,$data:i,schema:n,parentSchema:o,schemaCode:s,it:a}=t;if(!i&&!n)return;let c=e.let("valid"),l=o.items?(0,Sb.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,ot._)`${s} === false`),t.ok(c);function u(){let m=e.let("i",(0,ot._)`${r}.length`),h=e.let("j");t.setParams({i:m,j:h}),e.assign(c,!0),e.if((0,ot._)`${m} > 1`,()=>(d()?p:f)(m,h))}function d(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function p(m,h){let y=e.name("item"),_=(0,Sb.checkDataTypes)(l,y,a.opts.strictNumbers,Sb.DataType.Wrong),k=e.const("indices",(0,ot._)`{}`);e.for((0,ot._)`;${m}--;`,()=>{e.let(y,(0,ot._)`${r}[${m}]`),e.if(_,(0,ot._)`continue`),l.length>1&&e.if((0,ot._)`typeof ${y} == "string"`,(0,ot._)`${y} += "_"`),e.if((0,ot._)`typeof ${k}[${y}] == "number"`,()=>{e.assign(h,(0,ot._)`${k}[${y}]`),t.error(),e.assign(c,!1).break()}).code((0,ot._)`${k}[${y}] = ${m}`)})}function f(m,h){let y=(0,jD.useFunc)(e,DD.default),_=e.name("outer");e.label(_).for((0,ot._)`;${m}--;`,()=>e.for((0,ot._)`${h} = ${m}; ${h}--;`,()=>e.if((0,ot._)`${y}(${r}[${m}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};Ib.default=LD});var KI=D(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var Tb=te(),ZD=he(),FD=Op(),qD={message:"must be equal to constant",params:({schemaCode:t})=>(0,Tb._)`{allowedValue: ${t}}`},VD={keyword:"const",$data:!0,error:qD,code(t){let{gen:e,data:r,$data:i,schemaCode:n,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,Tb._)`!${(0,ZD.useFunc)(e,FD.default)}(${r}, ${n})`):t.fail((0,Tb._)`${o} !== ${r}`)}};Pb.default=VD});var YI=D(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var tc=te(),HD=he(),WD=Op(),BD={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,tc._)`{allowedValues: ${t}}`},GD={keyword:"enum",schemaType:"array",$data:!0,error:BD,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:o,it:s}=t;if(!i&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,HD.useFunc)(e,WD.default)),u;if(a||i)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let f=e.const("vSchema",o);u=(0,tc.or)(...n.map((m,h)=>p(f,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,f=>e.if((0,tc._)`${l()}(${r}, ${f})`,()=>e.assign(u,!0).break()))}function p(f,m){let h=n[m];return typeof h=="object"&&h!==null?(0,tc._)`${l()}(${r}, ${f}[${m}])`:(0,tc._)`${r} === ${h}`}}};zb.default=GD});var XI=D(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var JD=UI(),KD=LI(),YD=qI(),XD=VI(),QD=HI(),eU=WI(),tU=BI(),rU=JI(),nU=KI(),iU=YI(),oU=[JD.default,KD.default,YD.default,XD.default,QD.default,eU.default,tU.default,rU.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nU.default,iU.default];Cb.default=oU});var Ab=D(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.validateAdditionalItems=void 0;var ai=te(),Rb=he(),sU={message:({params:{len:t}})=>(0,ai.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ai._)`{limit: ${t}}`},aU={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:sU,code(t){let{parentSchema:e,it:r}=t,{items:i}=e;if(!Array.isArray(i)){(0,Rb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}QI(t,i)}};function QI(t,e){let{gen:r,schema:i,data:n,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,ai._)`${n}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,ai._)`${a} <= ${e.length}`);else if(typeof i=="object"&&!(0,Rb.alwaysValidSchema)(s,i)){let l=r.var("valid",(0,ai._)`${a} <= ${e.length}`);r.if((0,ai.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:Rb.Type.Num},l),s.allErrors||r.if((0,ai.not)(l),()=>r.break())})}}rc.validateAdditionalItems=QI;rc.default=aU});var Eb=D(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.validateTuple=void 0;var eT=te(),Np=he(),cU=Wt(),lU={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return tT(t,"additionalItems",e);r.items=!0,!(0,Np.alwaysValidSchema)(r,e)&&t.ok((0,cU.validateArray)(t))}};function tT(t,e,r=t.schema){let{gen:i,parentSchema:n,data:o,keyword:s,it:a}=t;u(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Np.mergeEvaluated.items(i,r.length,a.items));let c=i.name("valid"),l=i.const("len",(0,eT._)`${o}.length`);r.forEach((d,p)=>{(0,Np.alwaysValidSchema)(a,d)||(i.if((0,eT._)`${l} > ${p}`,()=>t.subschema({keyword:s,schemaProp:p,dataProp:p},c)),t.ok(c))});function u(d){let{opts:p,errSchemaPath:f}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(p.strictTuples&&!h){let y=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,Np.checkStrictMode)(a,y,p.strictTuples)}}}nc.validateTuple=tT;nc.default=lU});var rT=D(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var uU=Eb(),dU={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,uU.validateTuple)(t,"items")};Ob.default=dU});var iT=D(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var nT=te(),pU=he(),fU=Wt(),mU=Ab(),hU={message:({params:{len:t}})=>(0,nT.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,nT._)`{limit: ${t}}`},gU={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:hU,code(t){let{schema:e,parentSchema:r,it:i}=t,{prefixItems:n}=r;i.items=!0,!(0,pU.alwaysValidSchema)(i,e)&&(n?(0,mU.validateAdditionalItems)(t,n):t.ok((0,fU.validateArray)(t)))}};Nb.default=gU});var oT=D(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var Gt=te(),Mp=he(),yU={message:({params:{min:t,max:e}})=>e===void 0?(0,Gt.str)`must contain at least ${t} valid item(s)`:(0,Gt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Gt._)`{minContains: ${t}}`:(0,Gt._)`{minContains: ${t}, maxContains: ${e}}`},vU={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yU,code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:o}=t,s,a,{minContains:c,maxContains:l}=i;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,Gt._)`${n}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,Mp.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Mp.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Mp.alwaysValidSchema)(o,r)){let h=(0,Gt._)`${u} >= ${s}`;a!==void 0&&(h=(0,Gt._)`${h} && ${u} <= ${a}`),t.pass(h);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?f(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Gt._)`${n}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let h=e.name("_valid"),y=e.let("count",0);f(h,()=>e.if(h,()=>m(y)))}function f(h,y){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:Mp.Type.Num,compositeRule:!0},h),y()})}function m(h){e.code((0,Gt._)`${h}++`),a===void 0?e.if((0,Gt._)`${h} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Gt._)`${h} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Gt._)`${h} >= ${s}`,()=>e.assign(d,!0)))}}};Mb.default=vU});var cT=D(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.validateSchemaDeps=kr.validatePropertyDeps=kr.error=void 0;var jb=te(),bU=he(),ic=Wt();kr.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let i=e===1?"property":"properties";return(0,jb.str)`must have ${i} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:i}})=>(0,jb._)`{property: ${t},
|
|
6
|
+
|| ${s} === "boolean" || ${n} === null`).assign(a,(0,ee._)`[${n}]`)}}}function eM({gen:t,parentData:e,parentDataProperty:r},i){t.if((0,ee._)`${e} !== undefined`,()=>t.assign((0,ee._)`${e}[${r}]`,i))}function Fv(t,e,r,i=Eo.Correct){let n=i===Eo.Correct?ee.operators.EQ:ee.operators.NEQ,o;switch(t){case"null":return(0,ee._)`${e} ${n} null`;case"array":o=(0,ee._)`Array.isArray(${e})`;break;case"object":o=(0,ee._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,ee._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,ee._)`typeof ${e} ${n} ${t}`}return i===Eo.Correct?o:(0,ee.not)(o);function s(a=ee.nil){return(0,ee.and)((0,ee._)`typeof ${e} == "number"`,a,r?(0,ee._)`isFinite(${e})`:ee.nil)}}dt.checkDataType=Fv;function qv(t,e,r,i){if(t.length===1)return Fv(t[0],e,r,i);let n,o=(0,C0.toHash)(t);if(o.array&&o.object){let s=(0,ee._)`typeof ${e} != "object"`;n=o.null?s:(0,ee._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else n=ee.nil;o.number&&delete o.integer;for(let s in o)n=(0,ee.and)(n,Fv(s,e,r,i));return n}dt.checkDataTypes=qv;var tM={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ee._)`{type: ${t}}`:(0,ee._)`{type: ${e}}`};function Vv(t){let e=rM(t);(0,JN.reportError)(e,tM)}dt.reportTypeError=Vv;function rM(t){let{gen:e,data:r,schema:i}=t,n=(0,C0.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:t}}});var O0=D(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.assignDefaults=void 0;var Oo=te(),nM=he();function iM(t,e){let{properties:r,items:i}=t.schema;if(e==="object"&&r)for(let n in r)E0(t,n,r[n].default);else e==="array"&&Array.isArray(i)&&i.forEach((n,o)=>E0(t,o,n.default))}bp.assignDefaults=iM;function E0(t,e,r){let{gen:i,compositeRule:n,data:o,opts:s}=t;if(r===void 0)return;let a=(0,Oo._)`${o}${(0,Oo.getProperty)(e)}`;if(n){(0,nM.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Oo._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Oo._)`${c} || ${a} === null || ${a} === ""`),i.if(c,(0,Oo._)`${a} = ${(0,Oo.stringify)(r)}`)}});var Wt=D(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.validateUnion=Pe.validateArray=Pe.usePattern=Pe.callValidateCode=Pe.schemaProperties=Pe.allSchemaProperties=Pe.noPropertyInData=Pe.propertyInData=Pe.isOwnProperty=Pe.hasPropFunc=Pe.reportMissingProp=Pe.checkMissingProp=Pe.checkReportMissingProp=void 0;var Ee=te(),Hv=he(),$n=Zr(),oM=he();function sM(t,e){let{gen:r,data:i,it:n}=t;r.if(Bv(r,i,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ee._)`${e}`},!0),t.error()})}Pe.checkReportMissingProp=sM;function aM({gen:t,data:e,it:{opts:r}},i,n){return(0,Ee.or)(...i.map(o=>(0,Ee.and)(Bv(t,e,o,r.ownProperties),(0,Ee._)`${n} = ${o}`)))}Pe.checkMissingProp=aM;function cM(t,e){t.setParams({missingProperty:e},!0),t.error()}Pe.reportMissingProp=cM;function N0(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ee._)`Object.prototype.hasOwnProperty`})}Pe.hasPropFunc=N0;function Wv(t,e,r){return(0,Ee._)`${N0(t)}.call(${e}, ${r})`}Pe.isOwnProperty=Wv;function lM(t,e,r,i){let n=(0,Ee._)`${e}${(0,Ee.getProperty)(r)} !== undefined`;return i?(0,Ee._)`${n} && ${Wv(t,e,r)}`:n}Pe.propertyInData=lM;function Bv(t,e,r,i){let n=(0,Ee._)`${e}${(0,Ee.getProperty)(r)} === undefined`;return i?(0,Ee.or)(n,(0,Ee.not)(Wv(t,e,r))):n}Pe.noPropertyInData=Bv;function M0(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Pe.allSchemaProperties=M0;function uM(t,e){return M0(e).filter(r=>!(0,Hv.alwaysValidSchema)(t,e[r]))}Pe.schemaProperties=uM;function dM({schemaCode:t,data:e,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:s},a,c,l){let u=l?(0,Ee._)`${t}, ${e}, ${i}${n}`:e,d=[[$n.default.instancePath,(0,Ee.strConcat)($n.default.instancePath,o)],[$n.default.parentData,s.parentData],[$n.default.parentDataProperty,s.parentDataProperty],[$n.default.rootData,$n.default.rootData]];s.opts.dynamicRef&&d.push([$n.default.dynamicAnchors,$n.default.dynamicAnchors]);let p=(0,Ee._)`${u}, ${r.object(...d)}`;return c!==Ee.nil?(0,Ee._)`${a}.call(${c}, ${p})`:(0,Ee._)`${a}(${p})`}Pe.callValidateCode=dM;var pM=(0,Ee._)`new RegExp`;function fM({gen:t,it:{opts:e}},r){let i=e.unicodeRegExp?"u":"",{regExp:n}=e.code,o=n(r,i);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ee._)`${n.code==="new RegExp"?pM:(0,oM.useFunc)(t,n)}(${r}, ${i})`})}Pe.usePattern=fM;function mM(t){let{gen:e,data:r,keyword:i,it:n}=t,o=e.name("valid");if(n.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,Ee._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:Hv.Type.Num},o),e.if((0,Ee.not)(o),a)})}}Pe.validateArray=mM;function hM(t){let{gen:e,schema:r,keyword:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Hv.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:i,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,Ee._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Ee.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}Pe.validateUnion=hM});var U0=D(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.validateKeywordUsage=_r.validSchemaType=_r.funcKeywordCode=_r.macroKeywordCode=void 0;var _t=te(),ni=Zr(),gM=Wt(),yM=Ua();function vM(t,e){let{gen:r,keyword:i,schema:n,parentSchema:o,it:s}=t,a=e.macro.call(s.self,n,o,s),c=D0(r,i,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:_t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}_r.macroKeywordCode=vM;function bM(t,e){var r;let{gen:i,keyword:n,schema:o,parentSchema:s,$data:a,it:c}=t;wM(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=D0(i,n,l),d=i.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)h(),e.modifying&&j0(t),y(()=>t.error());else{let _=e.async?f():m();e.modifying&&j0(t),y(()=>_M(t,_))}}function f(){let _=i.let("ruleErrs",null);return i.try(()=>h((0,_t._)`await `),k=>i.assign(d,!1).if((0,_t._)`${k} instanceof ${c.ValidationError}`,()=>i.assign(_,(0,_t._)`${k}.errors`),()=>i.throw(k))),_}function m(){let _=(0,_t._)`${u}.errors`;return i.assign(_,null),h(_t.nil),_}function h(_=e.async?(0,_t._)`await `:_t.nil){let k=c.opts.passContext?ni.default.this:ni.default.self,w=!("compile"in e&&!a||e.schema===!1);i.assign(d,(0,_t._)`${_}${(0,gM.callValidateCode)(t,u,k,w)}`,e.modifying)}function y(_){var k;i.if((0,_t.not)((k=e.valid)!==null&&k!==void 0?k:d),_)}}_r.funcKeywordCode=bM;function j0(t){let{gen:e,data:r,it:i}=t;e.if(i.parentData,()=>e.assign(r,(0,_t._)`${i.parentData}[${i.parentDataProperty}]`))}function _M(t,e){let{gen:r}=t;r.if((0,_t._)`Array.isArray(${e})`,()=>{r.assign(ni.default.vErrors,(0,_t._)`${ni.default.vErrors} === null ? ${e} : ${ni.default.vErrors}.concat(${e})`).assign(ni.default.errors,(0,_t._)`${ni.default.vErrors}.length`),(0,yM.extendErrors)(t)},()=>t.error())}function wM({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function D0(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,_t.stringify)(r)})}function $M(t,e,r=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||r&&typeof t>"u")}_r.validSchemaType=$M;function kM({schema:t,opts:e,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 s=n.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}_r.validateKeywordUsage=kM});var Z0=D(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.extendSubschemaMode=kn.extendSubschemaData=kn.getSubschema=void 0;var wr=te(),L0=he();function xM(t,{keyword:e,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,wr._)`${t.schemaPath}${(0,wr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,wr._)`${t.schemaPath}${(0,wr.getProperty)(e)}${(0,wr.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,L0.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}kn.getSubschema=xM;function SM(t,e,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:s}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,p=a.let("data",(0,wr._)`${e.data}${(0,wr.getProperty)(r)}`,!0);c(p),t.errorPath=(0,wr.str)`${l}${(0,L0.getErrorPath)(r,i,d.jsPropertySyntax)}`,t.parentDataProperty=(0,wr._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(n!==void 0){let l=n instanceof wr.Name?n:a.let("data",n,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}kn.extendSubschemaData=SM;function IM(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){i!==void 0&&(t.compositeRule=i),n!==void 0&&(t.createErrors=n),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}kn.extendSubschemaMode=IM});var Gv=D((mJ,F0)=>{"use strict";F0.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),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 s=o[n];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var V0=D((hJ,q0)=>{"use strict";var xn=q0.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};_p(e,i,n,t,"",t)};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 _p(t,e,r,i,n,o,s,a,c,l){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,n,o,s,a,c,l);for(var u in i){var d=i[u];if(Array.isArray(d)){if(u in xn.arrayKeywords)for(var p=0;p<d.length;p++)_p(t,e,r,d[p],n+"/"+u+"/"+p,o,n,u,i,p)}else if(u in xn.propsKeywords){if(d&&typeof d=="object")for(var f in d)_p(t,e,r,d[f],n+"/"+u+"/"+TM(f),o,n,u,i,f)}else(u in xn.keywords||t.allKeys&&!(u in xn.skipKeywords))&&_p(t,e,r,d,n+"/"+u,o,n,u,i)}r(i,n,o,s,a,c,l)}}function TM(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Za=D(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.getSchemaRefs=At.resolveUrl=At.normalizeId=At._getFullPath=At.getFullPath=At.inlineRef=void 0;var PM=he(),zM=Gv(),CM=V0(),AM=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function RM(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Jv(t):e?H0(t)<=e:!1}At.inlineRef=RM;var EM=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Jv(t){for(let e in t){if(EM.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Jv)||typeof r=="object"&&Jv(r))return!0}return!1}function H0(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!AM.has(r)&&(typeof t[r]=="object"&&(0,PM.eachItem)(t[r],i=>e+=H0(i)),e===1/0))return 1/0}return e}function W0(t,e="",r){r!==!1&&(e=No(e));let i=t.parse(e);return B0(t,i)}At.getFullPath=W0;function B0(t,e){return t.serialize(e).split("#")[0]+"#"}At._getFullPath=B0;var OM=/#\/?$/;function No(t){return t?t.replace(OM,""):""}At.normalizeId=No;function NM(t,e,r){return r=No(r),t.resolve(e,r)}At.resolveUrl=NM;var MM=/^[a-z_][-a-z0-9._]*$/i;function jM(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=No(t[r]||e),o={"":n},s=W0(i,n,!1),a={},c=new Set;return CM(t,{allKeys:!0},(d,p,f,m)=>{if(m===void 0)return;let h=s+p,y=o[m];typeof d[r]=="string"&&(y=_.call(this,d[r])),k.call(this,d.$anchor),k.call(this,d.$dynamicAnchor),o[p]=y;function _(w){let $=this.opts.uriResolver.resolve;if(w=No(y?$(y,w):w),c.has(w))throw u(w);c.add(w);let S=this.refs[w];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?l(d,S.schema,w):w!==No(h)&&(w[0]==="#"?(l(d,a[w],w),a[w]=d):this.refs[w]=h),w}function k(w){if(typeof w=="string"){if(!MM.test(w))throw new Error(`invalid anchor "${w}"`);_.call(this,`#${w}`)}}}),a;function l(d,p,f){if(p!==void 0&&!zM(d,p))throw u(f)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}At.getSchemaRefs=jM});var Va=D(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getData=Sn.KeywordCxt=Sn.validateFunctionCode=void 0;var X0=T0(),G0=La(),Yv=Zv(),wp=La(),DM=O0(),qa=U0(),Kv=Z0(),H=te(),K=Zr(),UM=Za(),Fr=he(),Fa=Ua();function LM(t){if(tI(t)&&(rI(t),eI(t))){qM(t);return}Q0(t,()=>(0,X0.topBoolOrEmptySchema)(t))}Sn.validateFunctionCode=LM;function Q0({gen:t,validateName:e,schema:r,schemaEnv:i,opts:n},o){n.code.es5?t.func(e,(0,H._)`${K.default.data}, ${K.default.valCxt}`,i.$async,()=>{t.code((0,H._)`"use strict"; ${J0(r,n)}`),FM(t,n),t.code(o)}):t.func(e,(0,H._)`${K.default.data}, ${ZM(n)}`,i.$async,()=>t.code(J0(r,n)).code(o))}function ZM(t){return(0,H._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,H._)`, ${K.default.dynamicAnchors}={}`:H.nil}}={}`}function FM(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,H._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,H._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,H._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,H._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,H._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,H._)`""`),t.var(K.default.parentData,(0,H._)`undefined`),t.var(K.default.parentDataProperty,(0,H._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,H._)`{}`)})}function qM(t){let{schema:e,opts:r,gen:i}=t;Q0(t,()=>{r.$comment&&e.$comment&&iI(t),GM(t),i.let(K.default.vErrors,null),i.let(K.default.errors,0),r.unevaluated&&VM(t),nI(t),YM(t)})}function VM(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,H._)`${r}.evaluated`),e.if((0,H._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,H._)`${t.evaluated}.props`,(0,H._)`undefined`)),e.if((0,H._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,H._)`${t.evaluated}.items`,(0,H._)`undefined`))}function J0(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,H._)`/*# sourceURL=${r} */`:H.nil}function HM(t,e){if(tI(t)&&(rI(t),eI(t))){WM(t,e);return}(0,X0.boolOrEmptySchema)(t,e)}function eI({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function tI(t){return typeof t.schema!="boolean"}function WM(t,e){let{schema:r,gen:i,opts:n}=t;n.$comment&&r.$comment&&iI(t),JM(t),KM(t);let o=i.const("_errs",K.default.errors);nI(t,o),i.var(e,(0,H._)`${o} === ${K.default.errors}`)}function rI(t){(0,Fr.checkUnknownRules)(t),BM(t)}function nI(t,e){if(t.opts.jtd)return K0(t,[],!1,e);let r=(0,G0.getSchemaTypes)(t.schema),i=(0,G0.coerceAndCheckDataType)(t,r);K0(t,r,!i,e)}function BM(t){let{schema:e,errSchemaPath:r,opts:i,self:n}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,Fr.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function GM(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Fr.checkStrictMode)(t,"default is ignored in the schema root")}function JM(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,UM.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function KM(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function iI({gen:t,schemaEnv:e,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)t.code((0,H._)`${K.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let s=(0,H.str)`${i}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,H._)`${K.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function YM(t){let{gen:e,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=t;r.$async?e.if((0,H._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,H._)`new ${n}(${K.default.vErrors})`)):(e.assign((0,H._)`${i}.errors`,K.default.vErrors),o.unevaluated&&XM(t),e.return((0,H._)`${K.default.errors} === 0`))}function XM({gen:t,evaluated:e,props:r,items:i}){r instanceof H.Name&&t.assign((0,H._)`${e}.props`,r),i instanceof H.Name&&t.assign((0,H._)`${e}.items`,i)}function K0(t,e,r,i){let{gen:n,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Fr.schemaHasRulesButRef)(o,u))){n.block(()=>sI(t,"$ref",u.all.$ref.definition));return}c.jtd||QM(t,e),n.block(()=>{for(let p of u.rules)d(p);d(u.post)});function d(p){(0,Yv.shouldUseGroup)(o,p)&&(p.type?(n.if((0,wp.checkDataType)(p.type,s,c.strictNumbers)),Y0(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,wp.reportTypeError)(t)),n.endIf()):Y0(t,p),a||n.if((0,H._)`${K.default.errors} === ${i||0}`))}}function Y0(t,e){let{gen:r,schema:i,opts:{useDefaults:n}}=t;n&&(0,DM.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,Yv.shouldUseRule)(i,o)&&sI(t,o.keyword,o.definition,e.type)})}function QM(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(ej(t,e),t.opts.allowUnionTypes||tj(t,e),rj(t,t.dataTypes))}function ej(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{oI(t.dataTypes,r)||Xv(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),ij(t,e)}}function tj(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Xv(t,"use allowUnionTypes to allow union type keyword")}function rj(t,e){let r=t.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,Yv.shouldUseRule)(t.schema,n)){let{type:o}=n.definition;o.length&&!o.some(s=>nj(e,s))&&Xv(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function nj(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function oI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function ij(t,e){let r=[];for(let i of t.dataTypes)oI(e,i)?r.push(i):e.includes("integer")&&i==="number"&&r.push("integer");t.dataTypes=r}function Xv(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Fr.checkStrictMode)(t,e,t.opts.strictTypes)}var $p=class{constructor(e,r,i){if((0,qa.validateKeywordUsage)(e,r,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Fr.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",aI(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,qa.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=e.gen.const("_errs",K.default.errors))}result(e,r,i){this.failResult((0,H.not)(e),r,i)}failResult(e,r,i){this.gen.if(e),i?i():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,H.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,H._)`${r} !== undefined && (${(0,H.or)(this.invalid$data(),e)})`)}error(e,r,i){if(r){this.setParams(r),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,r){(e?Fa.reportExtraError:Fa.reportError)(this,this.def.error,r)}$dataError(){(0,Fa.reportError)(this,this.def.$dataError||Fa.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Fa.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,i=H.nil){this.gen.block(()=>{this.check$data(e,i),r()})}check$data(e=H.nil,r=H.nil){if(!this.$data)return;let{gen:i,schemaCode:n,schemaType:o,def:s}=this;i.if((0,H.or)((0,H._)`${n} === undefined`,r)),e!==H.nil&&i.assign(e,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==H.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:i,def:n,it:o}=this;return(0,H.or)(s(),a());function s(){if(i.length){if(!(r instanceof H.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,H._)`${(0,wp.checkDataTypes)(c,r,o.opts.strictNumbers,wp.DataType.Wrong)}`}return H.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,H._)`!${c}(${r})`}return H.nil}}subschema(e,r){let i=(0,Kv.getSubschema)(this.it,e);(0,Kv.extendSubschemaData)(i,this.it,e),(0,Kv.extendSubschemaMode)(i,e);let n={...this.it,...i,items:void 0,props:void 0};return HM(n,r),n}mergeEvaluated(e,r){let{it:i,gen:n}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=Fr.mergeEvaluated.props(n,e.props,i.props,r)),i.items!==!0&&e.items!==void 0&&(i.items=Fr.mergeEvaluated.items(n,e.items,i.items,r)))}mergeValidEvaluated(e,r){let{it:i,gen:n}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,H.Name)),!0}};Sn.KeywordCxt=$p;function sI(t,e,r,i){let n=new $p(t,r,e);"code"in r?r.code(n,i):n.$data&&r.validate?(0,qa.funcKeywordCode)(n,r):"macro"in r?(0,qa.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,qa.funcKeywordCode)(n,r)}var oj=/^\/(?:[^~]|~0|~1)*$/,sj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function aI(t,{dataLevel:e,dataNames:r,dataPathArr:i}){let n,o;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!oj.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,o=K.default.rootData}else{let l=sj.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(n=l[2],n==="#"){if(u>=e)throw new Error(c("property/index",u));return i[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!n)return o}let s=o,a=n.split("/");for(let l of a)l&&(o=(0,H._)`${o}${(0,H.getProperty)((0,Fr.unescapeJsonPointer)(l))}`,s=(0,H._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Sn.getData=aI});var kp=D(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var Qv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};eb.default=Qv});var Ha=D(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var tb=Za(),rb=class extends Error{constructor(e,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,tb.resolveUrl)(e,r,i),this.missingSchema=(0,tb.normalizeId)((0,tb.getFullPath)(e,this.missingRef))}};nb.default=rb});var Sp=D(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.resolveSchema=Bt.getCompilingSchema=Bt.resolveRef=Bt.compileSchema=Bt.SchemaEnv=void 0;var sr=te(),aj=kp(),ii=Zr(),ar=Za(),cI=he(),cj=Va(),Mo=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,ar.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};Bt.SchemaEnv=Mo;function ob(t){let e=lI.call(this,t);if(e)return e;let r=(0,ar.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,s=new sr.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:aj.default,code:(0,sr._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:ii.default.data,parentData:ii.default.parentData,parentDataProperty:ii.default.parentDataProperty,dataNames:[ii.default.data],dataPathArr:[sr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,sr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:sr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,sr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,cj.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(ii.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let f=new Function(`${ii.default.self}`,`${ii.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=l;f.evaluated={props:m instanceof sr.Name?void 0:m,items:h instanceof sr.Name?void 0:h,dynamicProps:m instanceof sr.Name,dynamicItems:h instanceof sr.Name},f.source&&(f.source.evaluated=(0,sr.stringify)(f.evaluated))}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}Bt.compileSchema=ob;function lj(t,e,r){var i;r=(0,ar.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let o=pj.call(this,t,r);if(o===void 0){let s=(i=t.localRefs)===null||i===void 0?void 0:i[r],{schemaId:a}=this.opts;s&&(o=new Mo({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=uj.call(this,o)}Bt.resolveRef=lj;function uj(t){return(0,ar.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ob.call(this,t)}function lI(t){for(let e of this._compilations)if(dj(e,t))return e}Bt.getCompilingSchema=lI;function dj(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function pj(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||xp.call(this,t,e)}function xp(t,e){let r=this.opts.uriResolver.parse(e),i=(0,ar._getFullPath)(this.opts.uriResolver,r),n=(0,ar.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===n)return ib.call(this,r,t);let o=(0,ar.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=xp.call(this,t,s);return typeof a?.schema!="object"?void 0:ib.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||ob.call(this,s),o===(0,ar.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(n=(0,ar.resolveUrl)(this.opts.uriResolver,n,l)),new Mo({schema:a,schemaId:c,root:t,baseId:n})}return ib.call(this,r,s)}}Bt.resolveSchema=xp;var fj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ib(t,{baseId:e,schema:r,root:i}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,cI.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!fj.has(a)&&l&&(e=(0,ar.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,cI.schemaHasRulesButRef)(r,this.RULES)){let a=(0,ar.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=xp.call(this,i,a)}let{schemaId:s}=this.opts;if(o=o||new Mo({schema:r,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}});var uI=D((wJ,mj)=>{mj.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 ab=D(($J,mI)=>{"use strict";var hj=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),pI=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 sb(t){let e="",r=0,i=0;for(i=0;i<t.length;i++)if(r=t[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(r=t[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i]}return e}var gj=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function dI(t){return t.length=0,!0}function yj(t,e,r){if(t.length){let i=sb(t);if(i!=="")e.push(i);else return r.error=!0,!1;t.length=0}return!0}function vj(t){let e=0,r={error:!1,address:"",zone:""},i=[],n=[],o=!1,s=!1,a=yj;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(o===!0&&(s=!0),!a(n,i,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),i.push(":");continue}else if(l==="%"){if(!a(n,i,r))break;a=dI}else{n.push(l);continue}}return n.length&&(a===dI?r.zone=n.join(""):s?i.push(n.join("")):i.push(sb(n))),r.address=i.join(""),r}function fI(t){if(bj(t,":")<2)return{host:t,isIPV6:!1};let e=vj(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,i=e.address;return e.zone&&(r+="%"+e.zone,i+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:i}}}function bj(t,e){let r=0;for(let i=0;i<t.length;i++)t[i]===e&&r++;return r}function _j(t){let e=t,r=[],i=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((i=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,i)),e=e.slice(i)}return r.join("")}function wj(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function $j(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!pI(r)){let i=fI(r);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}mI.exports={nonSimpleDomain:gj,recomposeAuthority:$j,normalizeComponentEncoding:wj,removeDotSegments:_j,isIPv4:pI,isUUID:hj,normalizeIPv6:fI,stringArrayToHexStripped:sb}});var bI=D((kJ,vI)=>{"use strict";var{isUUID:kj}=ab(),xj=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Sj=["http","https","ws","wss","urn","urn:uuid"];function Ij(t){return Sj.indexOf(t)!==-1}function cb(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function hI(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function gI(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Tj(t){return t.secure=cb(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Pj(t){if((t.port===(cb(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function zj(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(xj);if(r){let i=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${i}:${e.nid||t.nid}`,o=lb(n);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Cj(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),n=`${r}:${e.nid||i}`,o=lb(n);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${i||e.nid}:${a}`,e.skipEscape=!0,s}function Aj(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!kj(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Rj(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var yI={scheme:"http",domainHost:!0,parse:hI,serialize:gI},Ej={scheme:"https",domainHost:yI.domainHost,parse:hI,serialize:gI},Ip={scheme:"ws",domainHost:!0,parse:Tj,serialize:Pj},Oj={scheme:"wss",domainHost:Ip.domainHost,parse:Ip.parse,serialize:Ip.serialize},Nj={scheme:"urn",parse:zj,serialize:Cj,skipNormalize:!0},Mj={scheme:"urn:uuid",parse:Aj,serialize:Rj,skipNormalize:!0},Tp={http:yI,https:Ej,ws:Ip,wss:Oj,urn:Nj,"urn:uuid":Mj};Object.setPrototypeOf(Tp,null);function lb(t){return t&&(Tp[t]||Tp[t.toLowerCase()])||void 0}vI.exports={wsIsSecure:cb,SCHEMES:Tp,isValidSchemeName:Ij,getSchemeHandler:lb}});var $I=D((xJ,zp)=>{"use strict";var{normalizeIPv6:jj,removeDotSegments:Wa,recomposeAuthority:Dj,normalizeComponentEncoding:Pp,isIPv4:Uj,nonSimpleDomain:Lj}=ab(),{SCHEMES:Zj,getSchemeHandler:_I}=bI();function Fj(t,e){return typeof t=="string"?t=$r(qr(t,e),e):typeof t=="object"&&(t=qr($r(t,e),e)),t}function qj(t,e,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=wI(qr(t,i),qr(e,i),i,!0);return i.skipEscape=!0,$r(n,i)}function wI(t,e,r,i){let n={};return i||(t=qr($r(t,r),r),e=qr($r(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Wa(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Wa(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Wa(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Wa(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function Vj(t,e,r){return typeof t=="string"?(t=unescape(t),t=$r(Pp(qr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=$r(Pp(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=$r(Pp(qr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=$r(Pp(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function $r(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),n=[],o=_I(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 s=Dj(r);if(s!==void 0&&(i.reference!=="suffix"&&n.push("//"),n.push(s),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!i.absolutePath&&(!o||!o.absolutePath)&&(a=Wa(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var Hj=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function qr(t,e){let r=Object.assign({},e),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?t=r.scheme+":"+t:t="//"+t);let o=t.match(Hj);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(Uj(i.host)===!1){let c=jj(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 s=_I(r.scheme||i.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&i.host&&(r.domainHost||s&&s.domainHost)&&n===!1&&Lj(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(a){i.error=i.error||"Host's domain name can not be converted to ASCII: "+a}(!s||s&&!s.skipNormalize)&&(t.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)))),s&&s.parse&&s.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}var ub={SCHEMES:Zj,normalize:Fj,resolve:qj,resolveComponent:wI,equal:Vj,serialize:$r,parse:qr};zp.exports=ub;zp.exports.default=ub;zp.exports.fastUri=ub});var xI=D(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var kI=$I();kI.code='require("ajv/dist/runtime/uri").default';db.default=kI});var RI=D(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.CodeGen=it.Name=it.nil=it.stringify=it.str=it._=it.KeywordCxt=void 0;var Wj=Va();Object.defineProperty(it,"KeywordCxt",{enumerable:!0,get:function(){return Wj.KeywordCxt}});var jo=te();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return jo._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return jo.str}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return jo.stringify}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return jo.nil}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return jo.Name}});Object.defineProperty(it,"CodeGen",{enumerable:!0,get:function(){return jo.CodeGen}});var Bj=kp(),zI=Ha(),Gj=Lv(),Ba=Sp(),Jj=te(),Ga=Za(),Cp=La(),fb=he(),SI=uI(),Kj=xI(),CI=(t,e)=>new RegExp(t,e);CI.code="new RegExp";var Yj=["removeAdditional","useDefaults","coerceTypes"],Xj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Qj={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."},eD={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},II=200;function tD(t){var e,r,i,n,o,s,a,c,l,u,d,p,f,m,h,y,_,k,w,$,S,G,q,I,se;let ue=t.strict,ae=(e=t.code)===null||e===void 0?void 0:e.optimize,Me=ae===!0||ae===void 0?1:ae||0,je=(i=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:CI,ie=(n=t.uriResolver)!==null&&n!==void 0?n:Kj.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:ue)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ue)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:ue)!==null&&u!==void 0?u:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:ue)!==null&&p!==void 0?p:"log",strictRequired:(m=(f=t.strictRequired)!==null&&f!==void 0?f:ue)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:Me,regExp:je}:{optimize:Me,regExp:je},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:II,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:II,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(k=t.messages)!==null&&k!==void 0?k:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(S=t.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(q=t.validateFormats)!==null&&q!==void 0?q:!0,unicodeRegExp:(I=t.unicodeRegExp)!==null&&I!==void 0?I:!0,int32range:(se=t.int32range)!==null&&se!==void 0?se:!0,uriResolver:ie}}var Ja=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...tD(e)};let{es5:r,lines:i}=this.opts.code;this.scope=new Jj.ValueScope({scope:{},prefixes:Xj,es5:r,lines:i}),this.logger=aD(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Gj.getRules)(),TI.call(this,Qj,e,"NOT SUPPORTED"),TI.call(this,eD,e,"DEPRECATED","warn"),this._metaOpts=oD.call(this),e.formats&&nD.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&iD.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),rD.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:i}=this.opts,n=SI;i==="id"&&(n={...SI},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let n=i(r);return"$async"in i||(this.errors=i.errors),n}compile(e,r){let i=this._addSchema(e,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,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,e,r);async function n(u,d){await o.call(this,u.$schema);let p=this._addSchema(u,d);return p.validate||s.call(this,p)}async function o(u){u&&!this.getSchema(u)&&await n.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof zI.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=i(u))}finally{delete this._loading[u]}}}addSchema(e,r,i,n=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,i,n);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Ga.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,i,r,n,!0),this}addMetaSchema(e,r,i=this.opts.validateSchema){return this.addSchema(e,r,!0,i),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let i;if(i=e.$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,e);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(e){let r;for(;typeof(r=PI.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Ba.SchemaEnv({schema:{},schemaId:i});if(r=Ba.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=PI.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let i=e[this.opts.schemaId];return i&&(i=(0,Ga.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let i;if(typeof e=="string")i=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof e=="object"&&r===void 0){if(r=e,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(lD.call(this,i,r),!r)return(0,fb.eachItem)(i,o=>pb.call(this,o)),this;dD.call(this,r);let n={...r,type:(0,Cp.getJSONTypes)(r.type),schemaType:(0,Cp.getJSONTypes)(r.schemaType)};return(0,fb.eachItem)(i,n.type.length===0?o=>pb.call(this,o,n):o=>n.type.forEach(s=>pb.call(this,o,n,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let i of r.rules){let n=i.rules.findIndex(o=>o.keyword===e);n>=0&&i.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${i}${n.instancePath} ${n.message}`).reduce((n,o)=>n+r+o)}$dataMetaSchema(e,r){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let o=n.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in i){let c=i[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=AI(u))}}return e}_removeAllSchemas(e,r){for(let i in e){let n=e[i];(!r||r.test(i))&&(typeof n=="string"?delete e[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[i]))}}_addSchema(e,r,i,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;i=(0,Ga.normalizeId)(s||i);let l=Ga.getSchemaRefs.call(this,e,i);return c=new Ba.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:i,localRefs:l}),this._cache.set(c.schema,c),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=c),n&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Ba.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Ba.compileSchema.call(this,e)}finally{this.opts=r}}};Ja.ValidationError=Bj.default;Ja.MissingRefError=zI.default;it.default=Ja;function TI(t,e,r,i="error"){for(let n in t){let o=n;o in e&&this.logger[i](`${r}: option ${n}. ${t[o]}`)}}function PI(t){return t=(0,Ga.normalizeId)(t),this.schemas[t]||this.refs[t]}function rD(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function nD(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function iD(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function oD(){let t={...this.opts};for(let e of Yj)delete t[e];return t}var sD={log(){},warn(){},error(){}};function aD(t){if(t===!1)return sD;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var cD=/^[a-z_$][a-z0-9_$:-]*$/i;function lD(t,e){let{RULES:r}=this;if((0,fb.eachItem)(t,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!cD.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function pb(t,e,r){var i;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=n?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,Cp.getJSONTypes)(e.type),schemaType:(0,Cp.getJSONTypes)(e.schemaType)}};e.before?uD.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(i=e.implements)===null||i===void 0||i.forEach(c=>this.addKeyword(c))}function uD(t,e,r){let i=t.rules.findIndex(n=>n.keyword===r);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function dD(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=AI(e)),t.validateSchema=this.compile(e,!0))}var pD={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function AI(t){return{anyOf:[t,pD]}}});var EI=D(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var fD={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};mb.default=fD});var jI=D(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.callRef=oi.getValidate=void 0;var mD=Ha(),OI=Wt(),Rt=te(),Do=Zr(),NI=Sp(),Ap=he(),hD={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:i}=t,{baseId:n,schemaEnv:o,validateName:s,opts:a,self:c}=i,{root:l}=o;if((r==="#"||r==="#/")&&n===l.baseId)return d();let u=NI.resolveRef.call(c,l,n,r);if(u===void 0)throw new mD.default(i.opts.uriResolver,n,r);if(u instanceof NI.SchemaEnv)return p(u);return f(u);function d(){if(o===l)return Rp(t,s,o,o.$async);let m=e.scopeValue("root",{ref:l});return Rp(t,(0,Rt._)`${m}.validate`,l,l.$async)}function p(m){let h=MI(t,m);Rp(t,h,m,m.$async)}function f(m){let h=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Rt.stringify)(m)}:{ref:m}),y=e.name("valid"),_=t.subschema({schema:m,dataTypes:[],schemaPath:Rt.nil,topSchemaRef:h,errSchemaPath:r},y);t.mergeEvaluated(_),t.ok(y)}}};function MI(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Rt._)`${r.scopeValue("wrapper",{ref:e})}.validate`}oi.getValidate=MI;function Rp(t,e,r,i){let{gen:n,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Do.default.this:Rt.nil;i?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,Rt._)`await ${(0,OI.callValidateCode)(t,e,l)}`),f(e),s||n.assign(m,!0)},h=>{n.if((0,Rt._)`!(${h} instanceof ${o.ValidationError})`,()=>n.throw(h)),p(h),s||n.assign(m,!1)}),t.ok(m)}function d(){t.result((0,OI.callValidateCode)(t,e,l),()=>f(e),()=>p(e))}function p(m){let h=(0,Rt._)`${m}.errors`;n.assign(Do.default.vErrors,(0,Rt._)`${Do.default.vErrors} === null ? ${h} : ${Do.default.vErrors}.concat(${h})`),n.assign(Do.default.errors,(0,Rt._)`${Do.default.vErrors}.length`)}function f(m){var h;if(!o.opts.unevaluated)return;let y=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(o.props=Ap.mergeEvaluated.props(n,y.props,o.props));else{let _=n.var("props",(0,Rt._)`${m}.evaluated.props`);o.props=Ap.mergeEvaluated.props(n,_,o.props,Rt.Name)}if(o.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(o.items=Ap.mergeEvaluated.items(n,y.items,o.items));else{let _=n.var("items",(0,Rt._)`${m}.evaluated.items`);o.items=Ap.mergeEvaluated.items(n,_,o.items,Rt.Name)}}}oi.callRef=Rp;oi.default=hD});var DI=D(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var gD=EI(),yD=jI(),vD=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",gD.default,yD.default];hb.default=vD});var UI=D(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var Ep=te(),In=Ep.operators,Op={maximum:{okStr:"<=",ok:In.LTE,fail:In.GT},minimum:{okStr:">=",ok:In.GTE,fail:In.LT},exclusiveMaximum:{okStr:"<",ok:In.LT,fail:In.GTE},exclusiveMinimum:{okStr:">",ok:In.GT,fail:In.LTE}},bD={message:({keyword:t,schemaCode:e})=>(0,Ep.str)`must be ${Op[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ep._)`{comparison: ${Op[t].okStr}, limit: ${e}}`},_D={keyword:Object.keys(Op),type:"number",schemaType:"number",$data:!0,error:bD,code(t){let{keyword:e,data:r,schemaCode:i}=t;t.fail$data((0,Ep._)`${r} ${Op[e].fail} ${i} || isNaN(${r})`)}};gb.default=_D});var LI=D(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var Ka=te(),wD={message:({schemaCode:t})=>(0,Ka.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Ka._)`{multipleOf: ${t}}`},$D={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wD,code(t){let{gen:e,data:r,schemaCode:i,it:n}=t,o=n.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Ka._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Ka._)`${s} !== parseInt(${s})`;t.fail$data((0,Ka._)`(${i} === 0 || (${s} = ${r}/${i}, ${a}))`)}};yb.default=$D});var FI=D(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});function ZI(t){let e=t.length,r=0,i=0,n;for(;i<e;)r++,n=t.charCodeAt(i++),n>=55296&&n<=56319&&i<e&&(n=t.charCodeAt(i),(n&64512)===56320&&i++);return r}vb.default=ZI;ZI.code='require("ajv/dist/runtime/ucs2length").default'});var qI=D(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var si=te(),kD=he(),xD=FI(),SD={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,si.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,si._)`{limit: ${t}}`},ID={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:SD,code(t){let{keyword:e,data:r,schemaCode:i,it:n}=t,o=e==="maxLength"?si.operators.GT:si.operators.LT,s=n.opts.unicode===!1?(0,si._)`${r}.length`:(0,si._)`${(0,kD.useFunc)(t.gen,xD.default)}(${r})`;t.fail$data((0,si._)`${s} ${o} ${i}`)}};bb.default=ID});var VI=D(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var TD=Wt(),PD=he(),Uo=te(),zD={message:({schemaCode:t})=>(0,Uo.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Uo._)`{pattern: ${t}}`},CD={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:zD,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Uo._)`new RegExp`:(0,PD.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Uo._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Uo._)`!${u}`)}else{let c=(0,TD.usePattern)(t,n);t.fail$data((0,Uo._)`!${c}.test(${r})`)}}};_b.default=CD});var HI=D(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var Ya=te(),AD={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Ya.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Ya._)`{limit: ${t}}`},RD={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:AD,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxProperties"?Ya.operators.GT:Ya.operators.LT;t.fail$data((0,Ya._)`Object.keys(${r}).length ${n} ${i}`)}};wb.default=RD});var WI=D($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Xa=Wt(),Qa=te(),ED=he(),OD={message:({params:{missingProperty:t}})=>(0,Qa.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Qa._)`{missingProperty: ${t}}`},ND={keyword:"required",type:"object",schemaType:"array",$data:!0,error:OD,code(t){let{gen:e,schema:r,schemaCode:i,data:n,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let f=t.parentSchema.properties,{definedProperties:m}=t.it;for(let h of r)if(f?.[h]===void 0&&!m.has(h)){let y=s.schemaEnv.baseId+s.errSchemaPath,_=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,ED.checkStrictMode)(s,_,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(Qa.nil,d);else for(let f of r)(0,Xa.checkReportMissingProp)(t,f)}function u(){let f=e.let("missing");if(c||o){let m=e.let("valid",!0);t.block$data(m,()=>p(f,m)),t.ok(m)}else e.if((0,Xa.checkMissingProp)(t,r,f)),(0,Xa.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",i,f=>{t.setParams({missingProperty:f}),e.if((0,Xa.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,m){t.setParams({missingProperty:f}),e.forOf(f,i,()=>{e.assign(m,(0,Xa.propertyInData)(e,n,f,a.ownProperties)),e.if((0,Qa.not)(m),()=>{t.error(),e.break()})},Qa.nil)}}};$b.default=ND});var BI=D(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var ec=te(),MD={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ec.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ec._)`{limit: ${t}}`},jD={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:MD,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxItems"?ec.operators.GT:ec.operators.LT;t.fail$data((0,ec._)`${r}.length ${n} ${i}`)}};kb.default=jD});var Np=D(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var GI=Gv();GI.code='require("ajv/dist/runtime/equal").default';xb.default=GI});var JI=D(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var Sb=La(),ot=te(),DD=he(),UD=Np(),LD={message:({params:{i:t,j:e}})=>(0,ot.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ot._)`{i: ${t}, j: ${e}}`},ZD={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:LD,code(t){let{gen:e,data:r,$data:i,schema:n,parentSchema:o,schemaCode:s,it:a}=t;if(!i&&!n)return;let c=e.let("valid"),l=o.items?(0,Sb.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,ot._)`${s} === false`),t.ok(c);function u(){let m=e.let("i",(0,ot._)`${r}.length`),h=e.let("j");t.setParams({i:m,j:h}),e.assign(c,!0),e.if((0,ot._)`${m} > 1`,()=>(d()?p:f)(m,h))}function d(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function p(m,h){let y=e.name("item"),_=(0,Sb.checkDataTypes)(l,y,a.opts.strictNumbers,Sb.DataType.Wrong),k=e.const("indices",(0,ot._)`{}`);e.for((0,ot._)`;${m}--;`,()=>{e.let(y,(0,ot._)`${r}[${m}]`),e.if(_,(0,ot._)`continue`),l.length>1&&e.if((0,ot._)`typeof ${y} == "string"`,(0,ot._)`${y} += "_"`),e.if((0,ot._)`typeof ${k}[${y}] == "number"`,()=>{e.assign(h,(0,ot._)`${k}[${y}]`),t.error(),e.assign(c,!1).break()}).code((0,ot._)`${k}[${y}] = ${m}`)})}function f(m,h){let y=(0,DD.useFunc)(e,UD.default),_=e.name("outer");e.label(_).for((0,ot._)`;${m}--;`,()=>e.for((0,ot._)`${h} = ${m}; ${h}--;`,()=>e.if((0,ot._)`${y}(${r}[${m}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};Ib.default=ZD});var KI=D(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var Tb=te(),FD=he(),qD=Np(),VD={message:"must be equal to constant",params:({schemaCode:t})=>(0,Tb._)`{allowedValue: ${t}}`},HD={keyword:"const",$data:!0,error:VD,code(t){let{gen:e,data:r,$data:i,schemaCode:n,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,Tb._)`!${(0,FD.useFunc)(e,qD.default)}(${r}, ${n})`):t.fail((0,Tb._)`${o} !== ${r}`)}};Pb.default=HD});var YI=D(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var tc=te(),WD=he(),BD=Np(),GD={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,tc._)`{allowedValues: ${t}}`},JD={keyword:"enum",schemaType:"array",$data:!0,error:GD,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:o,it:s}=t;if(!i&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,WD.useFunc)(e,BD.default)),u;if(a||i)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let f=e.const("vSchema",o);u=(0,tc.or)(...n.map((m,h)=>p(f,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,f=>e.if((0,tc._)`${l()}(${r}, ${f})`,()=>e.assign(u,!0).break()))}function p(f,m){let h=n[m];return typeof h=="object"&&h!==null?(0,tc._)`${l()}(${r}, ${f}[${m}])`:(0,tc._)`${r} === ${h}`}}};zb.default=JD});var XI=D(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var KD=UI(),YD=LI(),XD=qI(),QD=VI(),eU=HI(),tU=WI(),rU=BI(),nU=JI(),iU=KI(),oU=YI(),sU=[KD.default,YD.default,XD.default,QD.default,eU.default,tU.default,rU.default,nU.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},iU.default,oU.default];Cb.default=sU});var Rb=D(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.validateAdditionalItems=void 0;var ai=te(),Ab=he(),aU={message:({params:{len:t}})=>(0,ai.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ai._)`{limit: ${t}}`},cU={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aU,code(t){let{parentSchema:e,it:r}=t,{items:i}=e;if(!Array.isArray(i)){(0,Ab.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}QI(t,i)}};function QI(t,e){let{gen:r,schema:i,data:n,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,ai._)`${n}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,ai._)`${a} <= ${e.length}`);else if(typeof i=="object"&&!(0,Ab.alwaysValidSchema)(s,i)){let l=r.var("valid",(0,ai._)`${a} <= ${e.length}`);r.if((0,ai.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:Ab.Type.Num},l),s.allErrors||r.if((0,ai.not)(l),()=>r.break())})}}rc.validateAdditionalItems=QI;rc.default=cU});var Eb=D(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.validateTuple=void 0;var eT=te(),Mp=he(),lU=Wt(),uU={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return tT(t,"additionalItems",e);r.items=!0,!(0,Mp.alwaysValidSchema)(r,e)&&t.ok((0,lU.validateArray)(t))}};function tT(t,e,r=t.schema){let{gen:i,parentSchema:n,data:o,keyword:s,it:a}=t;u(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Mp.mergeEvaluated.items(i,r.length,a.items));let c=i.name("valid"),l=i.const("len",(0,eT._)`${o}.length`);r.forEach((d,p)=>{(0,Mp.alwaysValidSchema)(a,d)||(i.if((0,eT._)`${l} > ${p}`,()=>t.subschema({keyword:s,schemaProp:p,dataProp:p},c)),t.ok(c))});function u(d){let{opts:p,errSchemaPath:f}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(p.strictTuples&&!h){let y=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,Mp.checkStrictMode)(a,y,p.strictTuples)}}}nc.validateTuple=tT;nc.default=uU});var rT=D(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var dU=Eb(),pU={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,dU.validateTuple)(t,"items")};Ob.default=pU});var iT=D(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var nT=te(),fU=he(),mU=Wt(),hU=Rb(),gU={message:({params:{len:t}})=>(0,nT.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,nT._)`{limit: ${t}}`},yU={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:gU,code(t){let{schema:e,parentSchema:r,it:i}=t,{prefixItems:n}=r;i.items=!0,!(0,fU.alwaysValidSchema)(i,e)&&(n?(0,hU.validateAdditionalItems)(t,n):t.ok((0,mU.validateArray)(t)))}};Nb.default=yU});var oT=D(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var Gt=te(),jp=he(),vU={message:({params:{min:t,max:e}})=>e===void 0?(0,Gt.str)`must contain at least ${t} valid item(s)`:(0,Gt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Gt._)`{minContains: ${t}}`:(0,Gt._)`{minContains: ${t}, maxContains: ${e}}`},bU={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vU,code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:o}=t,s,a,{minContains:c,maxContains:l}=i;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,Gt._)`${n}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,jp.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,jp.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,jp.alwaysValidSchema)(o,r)){let h=(0,Gt._)`${u} >= ${s}`;a!==void 0&&(h=(0,Gt._)`${h} && ${u} <= ${a}`),t.pass(h);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?f(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Gt._)`${n}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let h=e.name("_valid"),y=e.let("count",0);f(h,()=>e.if(h,()=>m(y)))}function f(h,y){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:jp.Type.Num,compositeRule:!0},h),y()})}function m(h){e.code((0,Gt._)`${h}++`),a===void 0?e.if((0,Gt._)`${h} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Gt._)`${h} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Gt._)`${h} >= ${s}`,()=>e.assign(d,!0)))}}};Mb.default=bU});var cT=D(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.validateSchemaDeps=kr.validatePropertyDeps=kr.error=void 0;var jb=te(),_U=he(),ic=Wt();kr.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let i=e===1?"property":"properties";return(0,jb.str)`must have ${i} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:i}})=>(0,jb._)`{property: ${t},
|
|
7
7
|
missingProperty: ${i},
|
|
8
8
|
depsCount: ${e},
|
|
9
|
-
deps: ${r}}`};var _U={keyword:"dependencies",type:"object",schemaType:"object",error:kr.error,code(t){let[e,r]=wU(t);sT(t,e),aT(t,r)}};function wU({schema:t}){let e={},r={};for(let i in t){if(i==="__proto__")continue;let n=Array.isArray(t[i])?e:r;n[i]=t[i]}return[e,r]}function sT(t,e=t.schema){let{gen:r,data:i,it:n}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,ic.propertyInData)(r,i,s,n.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let l of a)(0,ic.checkReportMissingProp)(t,l)}):(r.if((0,jb._)`${c} && (${(0,ic.checkMissingProp)(t,a,o)})`),(0,ic.reportMissingProp)(t,o),r.else())}}kr.validatePropertyDeps=sT;function aT(t,e=t.schema){let{gen:r,data:i,keyword:n,it:o}=t,s=r.name("valid");for(let a in e)(0,bU.alwaysValidSchema)(o,e[a])||(r.if((0,ic.propertyInData)(r,i,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}kr.validateSchemaDeps=aT;kr.default=_U});var uT=D(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var lT=te(),$U=he(),kU={message:"property name must be valid",params:({params:t})=>(0,lT._)`{propertyName: ${t.propertyName}}`},xU={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:kU,code(t){let{gen:e,schema:r,data:i,it:n}=t;if((0,$U.alwaysValidSchema)(n,r))return;let o=e.name("valid");e.forIn("key",i,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,lT.not)(o),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(o)}};Db.default=xU});var Lb=D(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var jp=Wt(),cr=te(),SU=Zr(),Dp=he(),IU={message:"must NOT have additional properties",params:({params:t})=>(0,cr._)`{additionalProperty: ${t.additionalProperty}}`},TU={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:IU,code(t){let{gen:e,schema:r,parentSchema:i,data:n,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Dp.alwaysValidSchema)(s,r))return;let l=(0,jp.allSchemaProperties)(i.properties),u=(0,jp.allSchemaProperties)(i.patternProperties);d(),t.ok((0,cr._)`${o} === ${SU.default.errors}`);function d(){e.forIn("key",n,y=>{!l.length&&!u.length?m(y):e.if(p(y),()=>m(y))})}function p(y){let _;if(l.length>8){let k=(0,Dp.schemaRefOrVal)(s,i.properties,"properties");_=(0,jp.isOwnProperty)(e,k,y)}else l.length?_=(0,cr.or)(...l.map(k=>(0,cr._)`${y} === ${k}`)):_=cr.nil;return u.length&&(_=(0,cr.or)(_,...u.map(k=>(0,cr._)`${(0,jp.usePattern)(t,k)}.test(${y})`))),(0,cr.not)(_)}function f(y){e.code((0,cr._)`delete ${n}[${y}]`)}function m(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Dp.alwaysValidSchema)(s,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(y,_,!1),e.if((0,cr.not)(_),()=>{t.reset(),f(y)})):(h(y,_),a||e.if((0,cr.not)(_),()=>e.break()))}}function h(y,_,k){let w={keyword:"additionalProperties",dataProp:y,dataPropType:Dp.Type.Str};k===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,_)}}};Ub.default=TU});var fT=D(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var PU=Va(),dT=Wt(),Zb=he(),pT=Lb(),zU={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:o}=t;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&pT.default.code(new PU.KeywordCxt(o,pT.default,"additionalProperties"));let s=(0,dT.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=Zb.mergeEvaluated.props(e,(0,Zb.toHash)(s),o.props));let a=s.filter(d=>!(0,Zb.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,dT.propertyInData)(e,n,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Fb.default=zU});var yT=D(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var mT=Wt(),Up=te(),hT=he(),gT=he(),CU={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:i,parentSchema:n,it:o}=t,{opts:s}=o,a=(0,mT.allSchemaProperties)(r),c=a.filter(h=>(0,hT.alwaysValidSchema)(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&n.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof Up.Name)&&(o.props=(0,gT.evaluatedPropsToName)(e,o.props));let{props:d}=o;p();function p(){for(let h of a)l&&f(h),o.allErrors?m(h):(e.var(u,!0),m(h),e.if(u))}function f(h){for(let y in l)new RegExp(h).test(y)&&(0,hT.checkStrictMode)(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){e.forIn("key",i,y=>{e.if((0,Up._)`${(0,mT.usePattern)(t,h)}.test(${y})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:gT.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,Up._)`${d}[${y}]`,!0):!_&&!o.allErrors&&e.if((0,Up.not)(u),()=>e.break())})})}}};qb.default=CU});var vT=D(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});var RU=he(),AU={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:i}=t;if((0,RU.alwaysValidSchema)(i,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Vb.default=AU});var bT=D(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var EU=Wt(),OU={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:EU.validateUnion,error:{message:"must match a schema in anyOf"}};Hb.default=OU});var _T=D(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var Lp=te(),NU=he(),MU={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Lp._)`{passingSchemas: ${t.passing}}`},jU={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:MU,code(t){let{gen:e,schema:r,parentSchema:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let p;(0,NU.alwaysValidSchema)(n,u)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Lp._)`${c} && ${s}`).assign(s,!1).assign(a,(0,Lp._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Lp.Name)})})}}};Wb.default=jU});var wT=D(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var DU=he(),UU={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((o,s)=>{if((0,DU.alwaysValidSchema)(i,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},n);t.ok(n),t.mergeEvaluated(a)})}};Bb.default=UU});var xT=D(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var Zp=te(),kT=he(),LU={message:({params:t})=>(0,Zp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Zp._)`{failingKeyword: ${t.ifClause}}`},ZU={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:LU,code(t){let{gen:e,parentSchema:r,it:i}=t;r.then===void 0&&r.else===void 0&&(0,kT.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=$T(i,"then"),o=$T(i,"else");if(!n&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else n?e.if(a,l("then")):e.if((0,Zp.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let p=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(p,s),d?e.assign(d,(0,Zp._)`${u}`):t.setParams({ifClause:u})}}}};function $T(t,e){let r=t.schema[e];return r!==void 0&&!(0,kT.alwaysValidSchema)(t,r)}Gb.default=ZU});var ST=D(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var FU=he(),qU={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,FU.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Jb.default=qU});var IT=D(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var VU=Ab(),HU=rT(),WU=Eb(),BU=iT(),GU=oT(),JU=cT(),KU=uT(),YU=Lb(),XU=fT(),QU=yT(),e4=vT(),t4=bT(),r4=_T(),n4=wT(),i4=xT(),o4=ST();function s4(t=!1){let e=[e4.default,t4.default,r4.default,n4.default,i4.default,o4.default,KU.default,YU.default,JU.default,XU.default,QU.default];return t?e.push(HU.default,BU.default):e.push(VU.default,WU.default),e.push(GU.default),e}Kb.default=s4});var TT=D(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var Ze=te(),a4={message:({schemaCode:t})=>(0,Ze.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ze._)`{format: ${t}}`},c4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:a4,code(t,e){let{gen:r,data:i,$data:n,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;n?p():f();function p(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Ze._)`${m}[${s}]`),y=r.let("fType"),_=r.let("format");r.if((0,Ze._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,(0,Ze._)`${h}.type || "string"`).assign(_,(0,Ze._)`${h}.validate`),()=>r.assign(y,(0,Ze._)`"string"`).assign(_,h)),t.fail$data((0,Ze.or)(k(),w()));function k(){return c.strictSchema===!1?Ze.nil:(0,Ze._)`${s} && !${_}`}function w(){let $=u.$async?(0,Ze._)`(${h}.async ? await ${_}(${i}) : ${_}(${i}))`:(0,Ze._)`${_}(${i})`,S=(0,Ze._)`(typeof ${_} == "function" ? ${$} : ${_}.test(${i}))`;return(0,Ze._)`${_} && ${_} !== true && ${y} === ${e} && !${S}`}}function f(){let m=d.formats[o];if(!m){k();return}if(m===!0)return;let[h,y,_]=w(m);h===e&&t.pass($());function k(){if(c.strictSchema===!1){d.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function w(S){let G=S instanceof RegExp?(0,Ze.regexpCode)(S):c.code.formats?(0,Ze._)`${c.code.formats}${(0,Ze.getProperty)(o)}`:void 0,q=r.scopeValue("formats",{key:o,ref:S,code:G});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,Ze._)`${q}.validate`]:["string",S,q]}function $(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Ze._)`await ${_}(${i})`}return typeof y=="function"?(0,Ze._)`${_}(${i})`:(0,Ze._)`${_}.test(${i})`}}}};Yb.default=c4});var PT=D(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var l4=TT(),u4=[l4.default];Xb.default=u4});var zT=D(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.contentVocabulary=Lo.metadataVocabulary=void 0;Lo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Lo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var RT=D(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var d4=DI(),p4=XI(),f4=IT(),m4=PT(),CT=zT(),h4=[d4.default,p4.default,(0,f4.default)(),m4.default,CT.metadataVocabulary,CT.contentVocabulary];Qb.default=h4});var ET=D(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.DiscrError=void 0;var AT;(function(t){t.Tag="tag",t.Mapping="mapping"})(AT||(Fp.DiscrError=AT={}))});var NT=D(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});var Zo=te(),e_=ET(),OT=xp(),g4=Ha(),y4=he(),v4={message:({params:{discrError:t,tagName:e}})=>t===e_.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Zo._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},b4={keyword:"discriminator",type:"object",schemaType:"object",error:v4,code(t){let{gen:e,data:r,schema:i,parentSchema:n,it:o}=t,{oneOf:s}=n;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=i.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Zo._)`${r}${(0,Zo.getProperty)(a)}`);e.if((0,Zo._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:e_.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let f=p();e.if(!1);for(let m in f)e.elseIf((0,Zo._)`${l} === ${m}`),e.assign(c,d(f[m]));e.else(),t.error(!1,{discrError:e_.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(f){let m=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:f},m);return t.mergeEvaluated(h,Zo.Name),m}function p(){var f;let m={},h=_(n),y=!0;for(let $=0;$<s.length;$++){let S=s[$];if(S?.$ref&&!(0,y4.schemaHasRulesButRef)(S,o.self.RULES)){let q=S.$ref;if(S=OT.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,q),S instanceof OT.SchemaEnv&&(S=S.schema),S===void 0)throw new g4.default(o.opts.uriResolver,o.baseId,q)}let G=(f=S?.properties)===null||f===void 0?void 0:f[a];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(h||_(S)),k(G,$)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return m;function _({required:$}){return Array.isArray($)&&$.includes(a)}function k($,S){if($.const)w($.const,S);else if($.enum)for(let G of $.enum)w(G,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w($,S){if(typeof $!="string"||$ in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[$]=S}}}};t_.default=b4});var MT=D((uK,_4)=>{_4.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 n_=D((Oe,r_)=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.MissingRefError=Oe.ValidationError=Oe.CodeGen=Oe.Name=Oe.nil=Oe.stringify=Oe.str=Oe._=Oe.KeywordCxt=Oe.Ajv=void 0;var w4=AI(),$4=RT(),k4=NT(),jT=MT(),x4=["/properties"],qp="http://json-schema.org/draft-07/schema",Fo=class extends w4.default{_addVocabularies(){super._addVocabularies(),$4.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(k4.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(jT,x4):jT;this.addMetaSchema(e,qp,!1),this.refs["http://json-schema.org/schema"]=qp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(qp)?qp:void 0)}};Oe.Ajv=Fo;r_.exports=Oe=Fo;r_.exports.Ajv=Fo;Object.defineProperty(Oe,"__esModule",{value:!0});Oe.default=Fo;var S4=Va();Object.defineProperty(Oe,"KeywordCxt",{enumerable:!0,get:function(){return S4.KeywordCxt}});var qo=te();Object.defineProperty(Oe,"_",{enumerable:!0,get:function(){return qo._}});Object.defineProperty(Oe,"str",{enumerable:!0,get:function(){return qo.str}});Object.defineProperty(Oe,"stringify",{enumerable:!0,get:function(){return qo.stringify}});Object.defineProperty(Oe,"nil",{enumerable:!0,get:function(){return qo.nil}});Object.defineProperty(Oe,"Name",{enumerable:!0,get:function(){return qo.Name}});Object.defineProperty(Oe,"CodeGen",{enumerable:!0,get:function(){return qo.CodeGen}});var I4=$p();Object.defineProperty(Oe,"ValidationError",{enumerable:!0,get:function(){return I4.default}});var T4=Ha();Object.defineProperty(Oe,"MissingRefError",{enumerable:!0,get:function(){return T4.default}})});var HT=D(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.formatNames=Sr.fastFormats=Sr.fullFormats=void 0;function xr(t,e){return{validate:t,compare:e}}Sr.fullFormats={date:xr(ZT,a_),time:xr(o_(!0),c_),"date-time":xr(DT(!0),qT),"iso-time":xr(o_(),FT),"iso-date-time":xr(DT(),VT),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:E4,"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:L4,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:O4,int32:{type:"number",validate:j4},int64:{type:"number",validate:D4},float:{type:"number",validate:LT},double:{type:"number",validate:LT},password:!0,binary:!0};Sr.fastFormats={...Sr.fullFormats,date:xr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a_),time:xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c_),"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,qT),"iso-time":xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,FT),"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,VT),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};Sr.formatNames=Object.keys(Sr.fullFormats);function P4(t){return t%4===0&&(t%100!==0||t%400===0)}var z4=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,C4=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ZT(t){let e=z4.exec(t);if(!e)return!1;let r=+e[1],i=+e[2],n=+e[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&P4(r)?29:C4[i])}function a_(t,e){if(t&&e)return t>e?1:t<e?-1:0}var i_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function o_(t){return function(r){let i=i_.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],s=+i[3],a=i[4],c=i[5]==="-"?-1:1,l=+(i[6]||0),u=+(i[7]||0);if(l>23||u>59||t&&!a)return!1;if(n<=23&&o<=59&&s<60)return!0;let d=o-u*c,p=n-l*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&s<61}}function c_(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(r&&i)return r-i}function FT(t,e){if(!(t&&e))return;let r=i_.exec(t),i=i_.exec(e);if(r&&i)return t=r[1]+r[2]+r[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}var s_=/t|\s/i;function DT(t){let e=o_(t);return function(i){let n=i.split(s_);return n.length===2&&ZT(n[0])&&e(n[1])}}function qT(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),i=new Date(e).valueOf();if(r&&i)return r-i}function VT(t,e){if(!(t&&e))return;let[r,i]=t.split(s_),[n,o]=e.split(s_),s=a_(r,n);if(s!==void 0)return s||c_(i,o)}var R4=/\/|:/,A4=/^(?:[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 E4(t){return R4.test(t)&&A4.test(t)}var UT=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function O4(t){return UT.lastIndex=0,UT.test(t)}var N4=-(2**31),M4=2**31-1;function j4(t){return Number.isInteger(t)&&t<=M4&&t>=N4}function D4(t){return Number.isInteger(t)}function LT(){return!0}var U4=/[^\\]\\Z/;function L4(t){if(U4.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var WT=D(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.formatLimitDefinition=void 0;var Z4=n_(),lr=te(),Tn=lr.operators,Vp={formatMaximum:{okStr:"<=",ok:Tn.LTE,fail:Tn.GT},formatMinimum:{okStr:">=",ok:Tn.GTE,fail:Tn.LT},formatExclusiveMaximum:{okStr:"<",ok:Tn.LT,fail:Tn.GTE},formatExclusiveMinimum:{okStr:">",ok:Tn.GT,fail:Tn.LTE}},F4={message:({keyword:t,schemaCode:e})=>(0,lr.str)`should be ${Vp[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,lr._)`{comparison: ${Vp[t].okStr}, limit: ${e}}`};Vo.formatLimitDefinition={keyword:Object.keys(Vp),type:"string",schemaType:"string",$data:!0,error:F4,code(t){let{gen:e,data:r,schemaCode:i,keyword:n,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new Z4.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let p=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=e.const("fmt",(0,lr._)`${p}[${c.schemaCode}]`);t.fail$data((0,lr.or)((0,lr._)`typeof ${f} != "object"`,(0,lr._)`${f} instanceof RegExp`,(0,lr._)`typeof ${f}.compare != "function"`,d(f)))}function u(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${n}": format "${p}" does not define "compare" function`);let m=e.scopeValue("formats",{key:p,ref:f,code:s.code.formats?(0,lr._)`${s.code.formats}${(0,lr.getProperty)(p)}`:void 0});t.fail$data(d(m))}function d(p){return(0,lr._)`${p}.compare(${r}, ${i}) ${Vp[n].fail} 0`}},dependencies:["format"]};var q4=t=>(t.addKeyword(Vo.formatLimitDefinition),t);Vo.default=q4});var KT=D((oc,JT)=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var Ho=HT(),V4=WT(),l_=te(),BT=new l_.Name("fullFormats"),H4=new l_.Name("fastFormats"),u_=(t,e={keywords:!0})=>{if(Array.isArray(e))return GT(t,e,Ho.fullFormats,BT),t;let[r,i]=e.mode==="fast"?[Ho.fastFormats,H4]:[Ho.fullFormats,BT],n=e.formats||Ho.formatNames;return GT(t,n,r,i),e.keywords&&(0,V4.default)(t),t};u_.get=(t,e="full")=>{let i=(e==="fast"?Ho.fastFormats:Ho.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function GT(t,e,r,i){var n,o;(n=(o=t.opts.code).formats)!==null&&n!==void 0||(o.formats=(0,l_._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,r[s])}JT.exports=oc=u_;Object.defineProperty(oc,"__esModule",{value:!0});oc.default=u_});import*as UC from"node:fs";import*as Mc from"node:path";import{fileURLToPath as IF}from"node:url";import{parseArgs as TF}from"node:util";import{stdout as uR,stdin as dR}from"node:process";import*as Kr from"node:readline";var Sw=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let r=0;for(t.lastIndex=0;t.test(e);)r+=1;return e.length-r}})(),Iw=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,Tw=t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141;var GC=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,JC=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Pw=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,KC=/\t{1,1000}/y,zw=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,YC=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,XC=/\p{M}+/gu,QC={limit:1/0,ellipsis:""},Cw=(t,e={},r={})=>{let i=e.limit??1/0,n=e.ellipsis??"",o=e?.ellipsisWidth??(n?Cw(n,QC,r).width:0),s=0,a=r.controlWidth??0,c=r.tabWidth??8,l=r.emojiWidth??2,u=2,d=r.regularWidth??1,p=r.wideWidth??u,f=[[YC,d],[GC,s],[JC,a],[KC,c],[zw,l],[Pw,p]],m=0,h=0,y=t.length,_=0,k=!1,w=y,$=Math.max(0,i-o),S=0,G=0,q=0,I=0;e:for(;;){if(G>S||h>=y&&h>m){let se=t.slice(S,G)||t.slice(m,h);_=0;for(let ue of se.replaceAll(XC,"")){let ae=ue.codePointAt(0)||0;if(Iw(ae)?I=u:Tw(ae)?I=p:I=d,q+I>$&&(w=Math.min(w,Math.max(S,m)+_)),q+I>i){k=!0;break e}_+=ue.length,q+=I}S=G=0}if(h>=y)break e;for(let se=0,ue=f.length;se<ue;se++){let[ae,Me]=f[se];if(ae.lastIndex=h,ae.test(t)){if(_=ae===Pw?Sw(t.slice(h,ae.lastIndex)):ae===zw?1:ae.lastIndex-h,I=_*Me,q+I>$&&(w=Math.min(w,h+Math.floor(($-q)/Me))),q+I>i){k=!0;break e}q+=I,S=m,G=h,h=m=ae.lastIndex;continue e}}h+=1}return{width:k?$:q,index:k?w:y,truncated:k,ellipsed:k&&i>=o}},Rw=Cw;var eR={limit:1/0,ellipsis:"",ellipsisWidth:0},tR=(t,e={})=>Rw(t,eR,e).width,pt=tR;var Lc="\x1B",Mw="\x9B",rR=39,em="\x07",jw="[",nR="]",Dw="m",tm=`${nR}8;;`,Aw=new RegExp(`(?:\\${jw}(?<code>\\d+)m|\\${tm}(?<uri>.*)${em})`,"y"),Ew=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},Ow=t=>`${Lc}${jw}${t}${Dw}`,Nw=t=>`${Lc}${tm}${t}${em}`,Qf=(t,e,r)=>{let i=e[Symbol.iterator](),n=!1,o=!1,s=t.at(-1),a=s===void 0?0:pt(s),c=i.next(),l=i.next(),u=0;for(;!c.done;){let d=c.value,p=pt(d);a+p<=r?t[t.length-1]+=d:(t.push(d),a=0),(d===Lc||d===Mw)&&(n=!0,o=e.startsWith(tm,u+1)),n?o?d===em&&(n=!1,o=!1):d===Dw&&(n=!1):(a+=p,a===r&&!l.done&&(t.push(""),a=0)),c=l,l=i.next(),u+=d.length}s=t.at(-1),!a&&s!==void 0&&s.length&&t.length>1&&(t[t.length-2]+=t.pop())},iR=t=>{let e=t.split(" "),r=e.length;for(;r&&!pt(e[r-1]);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},oR=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let i="",n,o,s=t.split(" "),a=[""],c=0;for(let d=0;d<s.length;d++){let p=s[d];if(r.trim!==!1){let m=a.at(-1)??"",h=m.trimStart();m.length!==h.length&&(a[a.length-1]=h,c=pt(h))}d!==0&&(c>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),c=0),(c||r.trim===!1)&&(a[a.length-1]+=" ",c++));let f=pt(p);if(r.hard&&f>e){let m=e-c,h=1+Math.floor((f-m-1)/e);Math.floor((f-1)/e)<h&&a.push(""),Qf(a,p,e),c=pt(a.at(-1)??"");continue}if(c+f>e&&c&&f){if(r.wordWrap===!1&&c<e){Qf(a,p,e),c=pt(a.at(-1)??"");continue}a.push(""),c=0}if(c+f>e&&r.wordWrap===!1){Qf(a,p,e),c=pt(a.at(-1)??"");continue}a[a.length-1]+=p,c+=f}r.trim!==!1&&(a=a.map(d=>iR(d)));let l=a.join(`
|
|
10
|
-
`),u=!1;for(let d=0;d<l.length;d++){let p=l[d];if(i+=p,u)u=!1;else if(u=p>="\uD800"&&p<="\uDBFF",u)continue;if(p===
|
|
9
|
+
deps: ${r}}`};var wU={keyword:"dependencies",type:"object",schemaType:"object",error:kr.error,code(t){let[e,r]=$U(t);sT(t,e),aT(t,r)}};function $U({schema:t}){let e={},r={};for(let i in t){if(i==="__proto__")continue;let n=Array.isArray(t[i])?e:r;n[i]=t[i]}return[e,r]}function sT(t,e=t.schema){let{gen:r,data:i,it:n}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,ic.propertyInData)(r,i,s,n.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let l of a)(0,ic.checkReportMissingProp)(t,l)}):(r.if((0,jb._)`${c} && (${(0,ic.checkMissingProp)(t,a,o)})`),(0,ic.reportMissingProp)(t,o),r.else())}}kr.validatePropertyDeps=sT;function aT(t,e=t.schema){let{gen:r,data:i,keyword:n,it:o}=t,s=r.name("valid");for(let a in e)(0,_U.alwaysValidSchema)(o,e[a])||(r.if((0,ic.propertyInData)(r,i,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}kr.validateSchemaDeps=aT;kr.default=wU});var uT=D(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var lT=te(),kU=he(),xU={message:"property name must be valid",params:({params:t})=>(0,lT._)`{propertyName: ${t.propertyName}}`},SU={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xU,code(t){let{gen:e,schema:r,data:i,it:n}=t;if((0,kU.alwaysValidSchema)(n,r))return;let o=e.name("valid");e.forIn("key",i,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,lT.not)(o),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(o)}};Db.default=SU});var Lb=D(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var Dp=Wt(),cr=te(),IU=Zr(),Up=he(),TU={message:"must NOT have additional properties",params:({params:t})=>(0,cr._)`{additionalProperty: ${t.additionalProperty}}`},PU={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:TU,code(t){let{gen:e,schema:r,parentSchema:i,data:n,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,Up.alwaysValidSchema)(s,r))return;let l=(0,Dp.allSchemaProperties)(i.properties),u=(0,Dp.allSchemaProperties)(i.patternProperties);d(),t.ok((0,cr._)`${o} === ${IU.default.errors}`);function d(){e.forIn("key",n,y=>{!l.length&&!u.length?m(y):e.if(p(y),()=>m(y))})}function p(y){let _;if(l.length>8){let k=(0,Up.schemaRefOrVal)(s,i.properties,"properties");_=(0,Dp.isOwnProperty)(e,k,y)}else l.length?_=(0,cr.or)(...l.map(k=>(0,cr._)`${y} === ${k}`)):_=cr.nil;return u.length&&(_=(0,cr.or)(_,...u.map(k=>(0,cr._)`${(0,Dp.usePattern)(t,k)}.test(${y})`))),(0,cr.not)(_)}function f(y){e.code((0,cr._)`delete ${n}[${y}]`)}function m(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Up.alwaysValidSchema)(s,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(y,_,!1),e.if((0,cr.not)(_),()=>{t.reset(),f(y)})):(h(y,_),a||e.if((0,cr.not)(_),()=>e.break()))}}function h(y,_,k){let w={keyword:"additionalProperties",dataProp:y,dataPropType:Up.Type.Str};k===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,_)}}};Ub.default=PU});var fT=D(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var zU=Va(),dT=Wt(),Zb=he(),pT=Lb(),CU={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:o}=t;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&pT.default.code(new zU.KeywordCxt(o,pT.default,"additionalProperties"));let s=(0,dT.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=Zb.mergeEvaluated.props(e,(0,Zb.toHash)(s),o.props));let a=s.filter(d=>!(0,Zb.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,dT.propertyInData)(e,n,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Fb.default=CU});var yT=D(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var mT=Wt(),Lp=te(),hT=he(),gT=he(),AU={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:i,parentSchema:n,it:o}=t,{opts:s}=o,a=(0,mT.allSchemaProperties)(r),c=a.filter(h=>(0,hT.alwaysValidSchema)(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&n.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof Lp.Name)&&(o.props=(0,gT.evaluatedPropsToName)(e,o.props));let{props:d}=o;p();function p(){for(let h of a)l&&f(h),o.allErrors?m(h):(e.var(u,!0),m(h),e.if(u))}function f(h){for(let y in l)new RegExp(h).test(y)&&(0,hT.checkStrictMode)(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){e.forIn("key",i,y=>{e.if((0,Lp._)`${(0,mT.usePattern)(t,h)}.test(${y})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:gT.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,Lp._)`${d}[${y}]`,!0):!_&&!o.allErrors&&e.if((0,Lp.not)(u),()=>e.break())})})}}};qb.default=AU});var vT=D(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});var RU=he(),EU={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:i}=t;if((0,RU.alwaysValidSchema)(i,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Vb.default=EU});var bT=D(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var OU=Wt(),NU={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:OU.validateUnion,error:{message:"must match a schema in anyOf"}};Hb.default=NU});var _T=D(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var Zp=te(),MU=he(),jU={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Zp._)`{passingSchemas: ${t.passing}}`},DU={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:jU,code(t){let{gen:e,schema:r,parentSchema:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let p;(0,MU.alwaysValidSchema)(n,u)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Zp._)`${c} && ${s}`).assign(s,!1).assign(a,(0,Zp._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),p&&t.mergeEvaluated(p,Zp.Name)})})}}};Wb.default=DU});var wT=D(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var UU=he(),LU={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((o,s)=>{if((0,UU.alwaysValidSchema)(i,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},n);t.ok(n),t.mergeEvaluated(a)})}};Bb.default=LU});var xT=D(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var Fp=te(),kT=he(),ZU={message:({params:t})=>(0,Fp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Fp._)`{failingKeyword: ${t.ifClause}}`},FU={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ZU,code(t){let{gen:e,parentSchema:r,it:i}=t;r.then===void 0&&r.else===void 0&&(0,kT.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=$T(i,"then"),o=$T(i,"else");if(!n&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else n?e.if(a,l("then")):e.if((0,Fp.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let p=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(p,s),d?e.assign(d,(0,Fp._)`${u}`):t.setParams({ifClause:u})}}}};function $T(t,e){let r=t.schema[e];return r!==void 0&&!(0,kT.alwaysValidSchema)(t,r)}Gb.default=FU});var ST=D(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var qU=he(),VU={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,qU.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Jb.default=VU});var IT=D(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var HU=Rb(),WU=rT(),BU=Eb(),GU=iT(),JU=oT(),KU=cT(),YU=uT(),XU=Lb(),QU=fT(),e4=yT(),t4=vT(),r4=bT(),n4=_T(),i4=wT(),o4=xT(),s4=ST();function a4(t=!1){let e=[t4.default,r4.default,n4.default,i4.default,o4.default,s4.default,YU.default,XU.default,KU.default,QU.default,e4.default];return t?e.push(WU.default,GU.default):e.push(HU.default,BU.default),e.push(JU.default),e}Kb.default=a4});var TT=D(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});var Ze=te(),c4={message:({schemaCode:t})=>(0,Ze.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ze._)`{format: ${t}}`},l4={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:c4,code(t,e){let{gen:r,data:i,$data:n,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;n?p():f();function p(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Ze._)`${m}[${s}]`),y=r.let("fType"),_=r.let("format");r.if((0,Ze._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,(0,Ze._)`${h}.type || "string"`).assign(_,(0,Ze._)`${h}.validate`),()=>r.assign(y,(0,Ze._)`"string"`).assign(_,h)),t.fail$data((0,Ze.or)(k(),w()));function k(){return c.strictSchema===!1?Ze.nil:(0,Ze._)`${s} && !${_}`}function w(){let $=u.$async?(0,Ze._)`(${h}.async ? await ${_}(${i}) : ${_}(${i}))`:(0,Ze._)`${_}(${i})`,S=(0,Ze._)`(typeof ${_} == "function" ? ${$} : ${_}.test(${i}))`;return(0,Ze._)`${_} && ${_} !== true && ${y} === ${e} && !${S}`}}function f(){let m=d.formats[o];if(!m){k();return}if(m===!0)return;let[h,y,_]=w(m);h===e&&t.pass($());function k(){if(c.strictSchema===!1){d.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function w(S){let G=S instanceof RegExp?(0,Ze.regexpCode)(S):c.code.formats?(0,Ze._)`${c.code.formats}${(0,Ze.getProperty)(o)}`:void 0,q=r.scopeValue("formats",{key:o,ref:S,code:G});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,Ze._)`${q}.validate`]:["string",S,q]}function $(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Ze._)`await ${_}(${i})`}return typeof y=="function"?(0,Ze._)`${_}(${i})`:(0,Ze._)`${_}.test(${i})`}}}};Yb.default=l4});var PT=D(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var u4=TT(),d4=[u4.default];Xb.default=d4});var zT=D(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.contentVocabulary=Lo.metadataVocabulary=void 0;Lo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Lo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var AT=D(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var p4=DI(),f4=XI(),m4=IT(),h4=PT(),CT=zT(),g4=[p4.default,f4.default,(0,m4.default)(),h4.default,CT.metadataVocabulary,CT.contentVocabulary];Qb.default=g4});var ET=D(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.DiscrError=void 0;var RT;(function(t){t.Tag="tag",t.Mapping="mapping"})(RT||(qp.DiscrError=RT={}))});var NT=D(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});var Zo=te(),e_=ET(),OT=Sp(),y4=Ha(),v4=he(),b4={message:({params:{discrError:t,tagName:e}})=>t===e_.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Zo._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},_4={keyword:"discriminator",type:"object",schemaType:"object",error:b4,code(t){let{gen:e,data:r,schema:i,parentSchema:n,it:o}=t,{oneOf:s}=n;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=i.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Zo._)`${r}${(0,Zo.getProperty)(a)}`);e.if((0,Zo._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:e_.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let f=p();e.if(!1);for(let m in f)e.elseIf((0,Zo._)`${l} === ${m}`),e.assign(c,d(f[m]));e.else(),t.error(!1,{discrError:e_.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(f){let m=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:f},m);return t.mergeEvaluated(h,Zo.Name),m}function p(){var f;let m={},h=_(n),y=!0;for(let $=0;$<s.length;$++){let S=s[$];if(S?.$ref&&!(0,v4.schemaHasRulesButRef)(S,o.self.RULES)){let q=S.$ref;if(S=OT.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,q),S instanceof OT.SchemaEnv&&(S=S.schema),S===void 0)throw new y4.default(o.opts.uriResolver,o.baseId,q)}let G=(f=S?.properties)===null||f===void 0?void 0:f[a];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(h||_(S)),k(G,$)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return m;function _({required:$}){return Array.isArray($)&&$.includes(a)}function k($,S){if($.const)w($.const,S);else if($.enum)for(let G of $.enum)w(G,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w($,S){if(typeof $!="string"||$ in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[$]=S}}}};t_.default=_4});var MT=D((pK,w4)=>{w4.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 n_=D((Oe,r_)=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.MissingRefError=Oe.ValidationError=Oe.CodeGen=Oe.Name=Oe.nil=Oe.stringify=Oe.str=Oe._=Oe.KeywordCxt=Oe.Ajv=void 0;var $4=RI(),k4=AT(),x4=NT(),jT=MT(),S4=["/properties"],Vp="http://json-schema.org/draft-07/schema",Fo=class extends $4.default{_addVocabularies(){super._addVocabularies(),k4.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(x4.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(jT,S4):jT;this.addMetaSchema(e,Vp,!1),this.refs["http://json-schema.org/schema"]=Vp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Vp)?Vp:void 0)}};Oe.Ajv=Fo;r_.exports=Oe=Fo;r_.exports.Ajv=Fo;Object.defineProperty(Oe,"__esModule",{value:!0});Oe.default=Fo;var I4=Va();Object.defineProperty(Oe,"KeywordCxt",{enumerable:!0,get:function(){return I4.KeywordCxt}});var qo=te();Object.defineProperty(Oe,"_",{enumerable:!0,get:function(){return qo._}});Object.defineProperty(Oe,"str",{enumerable:!0,get:function(){return qo.str}});Object.defineProperty(Oe,"stringify",{enumerable:!0,get:function(){return qo.stringify}});Object.defineProperty(Oe,"nil",{enumerable:!0,get:function(){return qo.nil}});Object.defineProperty(Oe,"Name",{enumerable:!0,get:function(){return qo.Name}});Object.defineProperty(Oe,"CodeGen",{enumerable:!0,get:function(){return qo.CodeGen}});var T4=kp();Object.defineProperty(Oe,"ValidationError",{enumerable:!0,get:function(){return T4.default}});var P4=Ha();Object.defineProperty(Oe,"MissingRefError",{enumerable:!0,get:function(){return P4.default}})});var HT=D(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.formatNames=Sr.fastFormats=Sr.fullFormats=void 0;function xr(t,e){return{validate:t,compare:e}}Sr.fullFormats={date:xr(ZT,a_),time:xr(o_(!0),c_),"date-time":xr(DT(!0),qT),"iso-time":xr(o_(),FT),"iso-date-time":xr(DT(),VT),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:O4,"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:Z4,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:N4,int32:{type:"number",validate:D4},int64:{type:"number",validate:U4},float:{type:"number",validate:LT},double:{type:"number",validate:LT},password:!0,binary:!0};Sr.fastFormats={...Sr.fullFormats,date:xr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a_),time:xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c_),"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,qT),"iso-time":xr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,FT),"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,VT),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};Sr.formatNames=Object.keys(Sr.fullFormats);function z4(t){return t%4===0&&(t%100!==0||t%400===0)}var C4=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,A4=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ZT(t){let e=C4.exec(t);if(!e)return!1;let r=+e[1],i=+e[2],n=+e[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&z4(r)?29:A4[i])}function a_(t,e){if(t&&e)return t>e?1:t<e?-1:0}var i_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function o_(t){return function(r){let i=i_.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],s=+i[3],a=i[4],c=i[5]==="-"?-1:1,l=+(i[6]||0),u=+(i[7]||0);if(l>23||u>59||t&&!a)return!1;if(n<=23&&o<=59&&s<60)return!0;let d=o-u*c,p=n-l*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&s<61}}function c_(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(r&&i)return r-i}function FT(t,e){if(!(t&&e))return;let r=i_.exec(t),i=i_.exec(e);if(r&&i)return t=r[1]+r[2]+r[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}var s_=/t|\s/i;function DT(t){let e=o_(t);return function(i){let n=i.split(s_);return n.length===2&&ZT(n[0])&&e(n[1])}}function qT(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),i=new Date(e).valueOf();if(r&&i)return r-i}function VT(t,e){if(!(t&&e))return;let[r,i]=t.split(s_),[n,o]=e.split(s_),s=a_(r,n);if(s!==void 0)return s||c_(i,o)}var R4=/\/|:/,E4=/^(?:[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 O4(t){return R4.test(t)&&E4.test(t)}var UT=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function N4(t){return UT.lastIndex=0,UT.test(t)}var M4=-(2**31),j4=2**31-1;function D4(t){return Number.isInteger(t)&&t<=j4&&t>=M4}function U4(t){return Number.isInteger(t)}function LT(){return!0}var L4=/[^\\]\\Z/;function Z4(t){if(L4.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var WT=D(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.formatLimitDefinition=void 0;var F4=n_(),lr=te(),Tn=lr.operators,Hp={formatMaximum:{okStr:"<=",ok:Tn.LTE,fail:Tn.GT},formatMinimum:{okStr:">=",ok:Tn.GTE,fail:Tn.LT},formatExclusiveMaximum:{okStr:"<",ok:Tn.LT,fail:Tn.GTE},formatExclusiveMinimum:{okStr:">",ok:Tn.GT,fail:Tn.LTE}},q4={message:({keyword:t,schemaCode:e})=>(0,lr.str)`should be ${Hp[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,lr._)`{comparison: ${Hp[t].okStr}, limit: ${e}}`};Vo.formatLimitDefinition={keyword:Object.keys(Hp),type:"string",schemaType:"string",$data:!0,error:q4,code(t){let{gen:e,data:r,schemaCode:i,keyword:n,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new F4.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let p=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),f=e.const("fmt",(0,lr._)`${p}[${c.schemaCode}]`);t.fail$data((0,lr.or)((0,lr._)`typeof ${f} != "object"`,(0,lr._)`${f} instanceof RegExp`,(0,lr._)`typeof ${f}.compare != "function"`,d(f)))}function u(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${n}": format "${p}" does not define "compare" function`);let m=e.scopeValue("formats",{key:p,ref:f,code:s.code.formats?(0,lr._)`${s.code.formats}${(0,lr.getProperty)(p)}`:void 0});t.fail$data(d(m))}function d(p){return(0,lr._)`${p}.compare(${r}, ${i}) ${Hp[n].fail} 0`}},dependencies:["format"]};var V4=t=>(t.addKeyword(Vo.formatLimitDefinition),t);Vo.default=V4});var KT=D((oc,JT)=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});var Ho=HT(),H4=WT(),l_=te(),BT=new l_.Name("fullFormats"),W4=new l_.Name("fastFormats"),u_=(t,e={keywords:!0})=>{if(Array.isArray(e))return GT(t,e,Ho.fullFormats,BT),t;let[r,i]=e.mode==="fast"?[Ho.fastFormats,W4]:[Ho.fullFormats,BT],n=e.formats||Ho.formatNames;return GT(t,n,r,i),e.keywords&&(0,H4.default)(t),t};u_.get=(t,e="full")=>{let i=(e==="fast"?Ho.fastFormats:Ho.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function GT(t,e,r,i){var n,o;(n=(o=t.opts.code).formats)!==null&&n!==void 0||(o.formats=(0,l_._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,r[s])}JT.exports=oc=u_;Object.defineProperty(oc,"__esModule",{value:!0});oc.default=u_});import*as LC from"node:fs";import*as jc from"node:path";import{fileURLToPath as PF}from"node:url";import{parseArgs as zF}from"node:util";import{stdout as dA,stdin as pA}from"node:process";import*as Kr from"node:readline";var Sw=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let r=0;for(t.lastIndex=0;t.test(e);)r+=1;return e.length-r}})(),Iw=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,Tw=t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141;var JC=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,KC=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Pw=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,YC=/\t{1,1000}/y,zw=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,XC=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,QC=/\p{M}+/gu,eA={limit:1/0,ellipsis:""},Cw=(t,e={},r={})=>{let i=e.limit??1/0,n=e.ellipsis??"",o=e?.ellipsisWidth??(n?Cw(n,eA,r).width:0),s=0,a=r.controlWidth??0,c=r.tabWidth??8,l=r.emojiWidth??2,u=2,d=r.regularWidth??1,p=r.wideWidth??u,f=[[XC,d],[JC,s],[KC,a],[YC,c],[zw,l],[Pw,p]],m=0,h=0,y=t.length,_=0,k=!1,w=y,$=Math.max(0,i-o),S=0,G=0,q=0,I=0;e:for(;;){if(G>S||h>=y&&h>m){let se=t.slice(S,G)||t.slice(m,h);_=0;for(let ue of se.replaceAll(QC,"")){let ae=ue.codePointAt(0)||0;if(Iw(ae)?I=u:Tw(ae)?I=p:I=d,q+I>$&&(w=Math.min(w,Math.max(S,m)+_)),q+I>i){k=!0;break e}_+=ue.length,q+=I}S=G=0}if(h>=y)break e;for(let se=0,ue=f.length;se<ue;se++){let[ae,Me]=f[se];if(ae.lastIndex=h,ae.test(t)){if(_=ae===Pw?Sw(t.slice(h,ae.lastIndex)):ae===zw?1:ae.lastIndex-h,I=_*Me,q+I>$&&(w=Math.min(w,h+Math.floor(($-q)/Me))),q+I>i){k=!0;break e}q+=I,S=m,G=h,h=m=ae.lastIndex;continue e}}h+=1}return{width:k?$:q,index:k?w:y,truncated:k,ellipsed:k&&i>=o}},Aw=Cw;var tA={limit:1/0,ellipsis:"",ellipsisWidth:0},rA=(t,e={})=>Aw(t,tA,e).width,pt=rA;var Zc="\x1B",Mw="\x9B",nA=39,em="\x07",jw="[",iA="]",Dw="m",tm=`${iA}8;;`,Rw=new RegExp(`(?:\\${jw}(?<code>\\d+)m|\\${tm}(?<uri>.*)${em})`,"y"),Ew=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},Ow=t=>`${Zc}${jw}${t}${Dw}`,Nw=t=>`${Zc}${tm}${t}${em}`,Qf=(t,e,r)=>{let i=e[Symbol.iterator](),n=!1,o=!1,s=t.at(-1),a=s===void 0?0:pt(s),c=i.next(),l=i.next(),u=0;for(;!c.done;){let d=c.value,p=pt(d);a+p<=r?t[t.length-1]+=d:(t.push(d),a=0),(d===Zc||d===Mw)&&(n=!0,o=e.startsWith(tm,u+1)),n?o?d===em&&(n=!1,o=!1):d===Dw&&(n=!1):(a+=p,a===r&&!l.done&&(t.push(""),a=0)),c=l,l=i.next(),u+=d.length}s=t.at(-1),!a&&s!==void 0&&s.length&&t.length>1&&(t[t.length-2]+=t.pop())},oA=t=>{let e=t.split(" "),r=e.length;for(;r&&!pt(e[r-1]);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},sA=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let i="",n,o,s=t.split(" "),a=[""],c=0;for(let d=0;d<s.length;d++){let p=s[d];if(r.trim!==!1){let m=a.at(-1)??"",h=m.trimStart();m.length!==h.length&&(a[a.length-1]=h,c=pt(h))}d!==0&&(c>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),c=0),(c||r.trim===!1)&&(a[a.length-1]+=" ",c++));let f=pt(p);if(r.hard&&f>e){let m=e-c,h=1+Math.floor((f-m-1)/e);Math.floor((f-1)/e)<h&&a.push(""),Qf(a,p,e),c=pt(a.at(-1)??"");continue}if(c+f>e&&c&&f){if(r.wordWrap===!1&&c<e){Qf(a,p,e),c=pt(a.at(-1)??"");continue}a.push(""),c=0}if(c+f>e&&r.wordWrap===!1){Qf(a,p,e),c=pt(a.at(-1)??"");continue}a[a.length-1]+=p,c+=f}r.trim!==!1&&(a=a.map(d=>oA(d)));let l=a.join(`
|
|
10
|
+
`),u=!1;for(let d=0;d<l.length;d++){let p=l[d];if(i+=p,u)u=!1;else if(u=p>="\uD800"&&p<="\uDBFF",u)continue;if(p===Zc||p===Mw){Rw.lastIndex=d+1;let m=Rw.exec(l)?.groups;if(m?.code!==void 0){let h=Number.parseFloat(m.code);n=h===nA?void 0:h}else m?.uri!==void 0&&(o=m.uri.length===0?void 0:m.uri)}if(l[d+1]===`
|
|
11
11
|
`){o&&(i+=Nw(""));let f=n?Ew(n):void 0;n&&f&&(i+=Ow(f))}else p===`
|
|
12
|
-
`&&(n&&Ew(n)&&(i+=Ow(n)),o&&(i+=Nw(o)))}return i},
|
|
13
|
-
`)}var is=
|
|
12
|
+
`&&(n&&Ew(n)&&(i+=Ow(n)),o&&(i+=Nw(o)))}return i},aA=/\r?\n/;function $i(t,e,r){return String(t).normalize().split(aA).map(i=>sA(i,e,r)).join(`
|
|
13
|
+
`)}var is=Lc(im(),1);import{ReadStream as Lw}from"node:tty";var fA=["up","down","left","right","space","enter","cancel"],mA=["January","February","March","April","May","June","July","August","September","October","November","December"],pr={actions:new Set(fA),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...mA],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(t,e)=>`There are only ${t} days in ${e}`,afterMin:t=>`Date must be on or after ${t.toISOString().slice(0,10)}`,beforeMax:t=>`Date must be on or before ${t.toISOString().slice(0,10)}`}}};function Zw(t,e){if(typeof t=="string")return pr.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Zw(r,e))return!0;return!1}var hA=globalThis.process.platform.startsWith("win"),KF=Symbol("clack:cancel");function Fw({input:t=pA,output:e=dA,overwrite:r=!0,hideCursor:i=!0}={}){let n=Kr.createInterface({input:t,output:e,prompt:"",tabSize:1});Kr.emitKeypressEvents(t,n),t instanceof Lw&&t.isTTY&&t.setRawMode(!0);let o=(s,{name:a,sequence:c})=>{let l=String(s);if(Zw([l,a,c],"cancel")){i&&e.write(is.cursor.show),process.exit(0);return}if(!r)return;Kr.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Kr.clearLine(e,1,()=>{t.once("keypress",o)})})};return i&&e.write(is.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),i&&e.write(is.cursor.show),t instanceof Lw&&t.isTTY&&!hA&&t.setRawMode(!1),n.terminal=!1,n.close()}}var om=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80;import{styleText as We,stripVTControlCharacters as mq}from"node:util";import Lt from"node:process";var os=Lc(im(),1);function yA(){return Lt.platform!=="win32"?Lt.env.TERM!=="linux":!!Lt.env.CI||!!Lt.env.WT_SESSION||!!Lt.env.TERMINUS_SUBLIME||Lt.env.ConEmuTask==="{cmd::Cmder}"||Lt.env.TERM_PROGRAM==="Terminus-Sublime"||Lt.env.TERM_PROGRAM==="vscode"||Lt.env.TERM==="xterm-256color"||Lt.env.TERM==="alacritty"||Lt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var sm=yA(),vA=()=>process.env.CI==="true";var xe=(t,e)=>sm?t:e,vq=xe("\u25C6","*"),bA=xe("\u25A0","x"),_A=xe("\u25B2","x"),Vw=xe("\u25C7","o"),wA=xe("\u250C","T"),ki=xe("\u2502","|"),Hw=xe("\u2514","\u2014"),bq=xe("\u2510","T"),_q=xe("\u2518","\u2014"),wq=xe("\u25CF",">"),$q=xe("\u25CB"," "),kq=xe("\u25FB","[\u2022]"),xq=xe("\u25FC","[+]"),Sq=xe("\u25FB","[ ]"),Iq=xe("\u25AA","\u2022"),qw=xe("\u2500","-"),$A=xe("\u256E","+"),kA=xe("\u251C","+"),xA=xe("\u256F","+"),SA=xe("\u2570","+"),Tq=xe("\u256D","+"),Pq=xe("\u25CF","\u2022"),zq=xe("\u25C6","*"),Cq=xe("\u25B2","!"),Aq=xe("\u25A0","x");var am=(t="",e)=>{let r=e?.output??process.stdout,i=e?.withGuide??pr.withGuide?`${We("gray",Hw)} `:"";r.write(`${i}${We("red",t)}
|
|
14
14
|
|
|
15
|
-
`)},Ww=(t="",e)=>{let r=e?.output??process.stdout,i=e?.withGuide??pr.withGuide?`${We("gray",
|
|
15
|
+
`)},Ww=(t="",e)=>{let r=e?.output??process.stdout,i=e?.withGuide??pr.withGuide?`${We("gray",wA)} `:"";r.write(`${i}${t}
|
|
16
16
|
`)},Bw=(t="",e)=>{let r=e?.output??process.stdout,i=e?.withGuide??pr.withGuide?`${We("gray",ki)}
|
|
17
17
|
${We("gray",Hw)} `:"";r.write(`${i}${t}
|
|
18
18
|
|
|
19
|
-
`)};var
|
|
20
|
-
`),o=n.reduce((c,l)=>Math.max(pt(l),c),0),s=n.map(r).reduce((c,l)=>Math.max(pt(l),c),0),a=e-(s-o);return $i(t,a,i)},Gw=(t="",e="",r)=>{let i=r?.output??Lt.stdout,n=r?.withGuide??pr.withGuide,o=r?.format??
|
|
19
|
+
`)};var IA=t=>We("dim",t),TA=(t,e,r)=>{let i={hard:!0,trim:!1},n=$i(t,e,i).split(`
|
|
20
|
+
`),o=n.reduce((c,l)=>Math.max(pt(l),c),0),s=n.map(r).reduce((c,l)=>Math.max(pt(l),c),0),a=e-(s-o);return $i(t,a,i)},Gw=(t="",e="",r)=>{let i=r?.output??Lt.stdout,n=r?.withGuide??pr.withGuide,o=r?.format??IA,s=["",...TA(t,om(i)-6,o).split(`
|
|
21
21
|
`).map(o),""],a=pt(e),c=Math.max(s.reduce((p,f)=>{let m=pt(f);return m>p?m:p},0),a)+2,l=s.map(p=>`${We("gray",ki)} ${p}${" ".repeat(c-pt(p))}${We("gray",ki)}`).join(`
|
|
22
22
|
`),u=n?`${We("gray",ki)}
|
|
23
|
-
`:"",d=n
|
|
23
|
+
`:"",d=n?kA:SA;i.write(`${u}${We("green",Vw)} ${We("reset",e)} ${We("gray",qw.repeat(Math.max(c-a-1,1))+$A)}
|
|
24
24
|
${l}
|
|
25
|
-
${We("gray",d+qw.repeat(c+2)+
|
|
26
|
-
`)};var
|
|
25
|
+
${We("gray",d+qw.repeat(c+2)+xA)}
|
|
26
|
+
`)};var PA=t=>We("magenta",t),Jw=({indicator:t="dots",onCancel:e,output:r=process.stdout,cancelMessage:i,errorMessage:n,frames:o=sm?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:s=sm?80:120,signal:a,...c}={})=>{let l=vA(),u,d,p=!1,f=!1,m="",h,y=performance.now(),_=om(r),k=c?.styleFrame??PA,w=ie=>{let qe=ie>1?n??pr.messages.error:i??pr.messages.cancel;f=ie===1,p&&(je(qe,ie),f&&typeof e=="function"&&e())},$=()=>w(2),S=()=>w(1),G=()=>{process.on("uncaughtExceptionMonitor",$),process.on("unhandledRejection",$),process.on("SIGINT",S),process.on("SIGTERM",S),process.on("exit",w),a&&a.addEventListener("abort",S)},q=()=>{process.removeListener("uncaughtExceptionMonitor",$),process.removeListener("unhandledRejection",$),process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S),process.removeListener("exit",w),a&&a.removeEventListener("abort",S)},I=()=>{if(h===void 0)return;l&&r.write(`
|
|
27
27
|
`);let ie=$i(h,_,{hard:!0,trim:!1}).split(`
|
|
28
28
|
`);ie.length>1&&r.write(os.cursor.up(ie.length-1)),r.write(os.cursor.to(0)),r.write(os.erase.down())},se=ie=>ie.replace(/\.+$/,""),ue=ie=>{let qe=(performance.now()-ie)/1e3,He=Math.floor(qe/60),Je=Math.floor(qe%60);return He>0?`[${He}m ${Je}s]`:`[${Je}s]`},ae=c.withGuide??pr.withGuide,Me=(ie="")=>{p=!0,u=Fw({output:r}),m=se(ie),y=performance.now(),ae&&r.write(`${We("gray",ki)}
|
|
29
|
-
`);let qe=0,He=0;G(),d=setInterval(()=>{if(l&&m===h)return;I(),h=m;let Je=k(o[qe]),Ot;if(l)Ot=`${Je} ${m}...`;else if(t==="timer")Ot=`${Je} ${m} ${ue(y)}`;else{let de=".".repeat(Math.floor(He)).slice(0,3);Ot=`${Je} ${m}${de}`}let j=$i(Ot,_,{hard:!0,trim:!1});r.write(j),qe=qe+1<o.length?qe+1:0,He=He<4?He+.125:0},s)},je=(ie="",qe=0,He=!1)=>{if(!p)return;p=!1,clearInterval(d),I();let Je=qe===0?We("green",Vw):qe===1?We("red",
|
|
29
|
+
`);let qe=0,He=0;G(),d=setInterval(()=>{if(l&&m===h)return;I(),h=m;let Je=k(o[qe]),Ot;if(l)Ot=`${Je} ${m}...`;else if(t==="timer")Ot=`${Je} ${m} ${ue(y)}`;else{let de=".".repeat(Math.floor(He)).slice(0,3);Ot=`${Je} ${m}${de}`}let j=$i(Ot,_,{hard:!0,trim:!1});r.write(j),qe=qe+1<o.length?qe+1:0,He=He<4?He+.125:0},s)},je=(ie="",qe=0,He=!1)=>{if(!p)return;p=!1,clearInterval(d),I();let Je=qe===0?We("green",Vw):qe===1?We("red",bA):We("red",_A);m=ie??m,He||(t==="timer"?r.write(`${Je} ${m} ${ue(y)}
|
|
30
30
|
`):r.write(`${Je} ${m}
|
|
31
|
-
`)),q(),u()};return{start:Me,stop:(ie="")=>je(ie,0),message:(ie="")=>{m=se(ie??m)},cancel:(ie="")=>je(ie,1),error:(ie="")=>je(ie,2),clear:()=>je("",0,!0),get isCancelled(){return f}}},
|
|
32
|
-
`,{mode:384})}function pm(t){cm(t);let e=Zc();e.defaultAccount=t,dm(e)}function fm(t,e){cm(e);let r=Zc();r.pins={...r.pins,[Ke.resolve(t)]:e},dm(r)}function mm(t){let e=Zc(),r=Ke.resolve(t);return e.pins?.[r]?(delete e.pins[r],dm(e),!0):!1}function Fc(t){let e=Ke.resolve(t);for(;;){if(Yt.existsSync(Ke.join(e,".git")))return e;let r=Ke.dirname(e);if(r===e)return Ke.resolve(t);e=r}}function PR(t,e){let r=Ke.relative(t,e);return r===""||!r.startsWith("..")&&!Ke.isAbsolute(r)}function fr(t=process.cwd()){let e=process.env.GIGABUDDY_ACCOUNT;if(e&&Cr(e))return{name:e,source:"env"};let r=Zc(),i=Ke.resolve(t),n;for(let[o,s]of Object.entries(r.pins??{}))Cr(s)&&PR(o,i)&&(!n||o.length>n.dir.length)&&(n={dir:o,account:s});return n?{name:n.account,source:"pin",pinnedAt:n.dir}:r.defaultAccount&&Cr(r.defaultAccount)?{name:r.defaultAccount,source:"config-default"}:{name:Nn,source:"fallback"}}import*as Nt from"node:fs";import*as Qw from"node:path";var zR={shared:{prod:"credentials.json",staging:"credentials.staging.json"},user:{prod:"user-credentials.json",staging:"user-credentials.staging.json"},agent:{prod:"agent-credentials.json",staging:"agent-credentials.staging.json"}};function as(t=!1,e="shared",r){let i=zR[e];return Qw.join(lm(r??fr().name),t?i.staging:i.prod)}function qc(t=!1,e="shared",r){try{let i=Nt.readFileSync(as(t,e,r),"utf-8"),n=JSON.parse(i);return n.refreshToken?n:null}catch{return null}}function Vc(t,e=!1,r="shared",i){let n=lm(i??fr().name);Nt.existsSync(n)||Nt.mkdirSync(n,{recursive:!0,mode:448}),r$(as(e,r,i),JSON.stringify(t,null,2))}function e$(t=!1,e="shared",r){let i=as(t,e,r);Nt.existsSync(i)&&Nt.unlinkSync(i)}function t$(t,e=!1,r="shared",i){let n=qc(e,r,i);n&&(n.refreshToken=t,Vc(n,e,r,i))}function r$(t,e){Nt.writeFileSync(t,e,{mode:384});try{Nt.chmodSync(t,384)}catch{}}async function n$(t){let r=await(t.fetchImpl??fetch)(`${t.authUrl}/api/token/derive`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t.refreshToken,clientId:t.clientId,scopes:t.scopes})});if(!r.ok){let n=await r.json().catch(()=>null);throw new Error(n?.error_description??n?.error??`Derive failed (${r.status})`)}let i=await r.json();if(!i.refreshToken||!i.userId)throw new Error("Derive response missing refreshToken/userId");return i}var le;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let o={};for(let s of n)o[s]=s;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of o)s[a]=n[a];return t.objectValues(s)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&o.push(s);return o},t.find=(n,o)=>{for(let s of n)if(o(s))return s},t.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(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(le||(le={}));var i$;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(i$||(i$={}));var L=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Rr=t=>{switch(typeof t){case"undefined":return L.undefined;case"string":return L.string;case"number":return Number.isNaN(t)?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(t)?L.array:t===null?L.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?L.promise:typeof Map<"u"&&t instanceof Map?L.map:typeof Set<"u"&&t instanceof Set?L.set:typeof Date<"u"&&t instanceof Date?L.date:L.object;default:return L.unknown}};var z=le.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 Mt=class t extends Error{get errors(){return this.issues}constructor(e){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=e}format(e){let r=e||function(o){return o.message},i={_errors:[]},n=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)i._errors.push(r(s));else{let a=i,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return n(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=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(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Mt.create=t=>new Mt(t);var CR=(t,e)=>{let r;switch(t.code){case z.invalid_type:t.received===L.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,le.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:r=`Unrecognized key(s) in object: ${le.joinValues(t.keys,", ")}`;break;case z.invalid_union:r="Invalid input";break;case z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${le.joinValues(t.options)}`;break;case z.invalid_enum_value:r=`Invalid enum value. Expected ${le.joinValues(t.options)}, received '${t.received}'`;break;case z.invalid_arguments:r="Invalid function arguments";break;case z.invalid_return_type:r="Invalid function return type";break;case z.invalid_date:r="Invalid date";break;case z.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:le.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case z.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case z.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case z.custom:r="Invalid input";break;case z.invalid_intersection_types:r="Intersection results could not be merged";break;case z.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case z.not_finite:r="Number must be finite";break;default:r=e.defaultError,le.assertNever(t)}return{message:r}},Yr=CR;var RR=Yr;function cs(){return RR}var Hc=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,o=[...r,...n.path||[]],s={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let a="",c=i.filter(l=>!!l).slice().reverse();for(let l of c)a=l(s,{data:e,defaultError:a}).message;return{...n,path:o,message:a}};function N(t,e){let r=cs(),i=Hc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Yr?void 0:Yr].filter(n=>!!n)});t.common.issues.push(i)}var at=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return W;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r){let o=await n.key,s=await n.value;i.push({key:o,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:o,value:s}=n;if(o.status==="aborted"||s.status==="aborted")return W;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}},W=Object.freeze({status:"aborted"}),xi=t=>({status:"dirty",value:t}),ft=t=>({status:"valid",value:t}),hm=t=>t.status==="aborted",gm=t=>t.status==="dirty",Mn=t=>t.status==="valid",ls=t=>typeof Promise<"u"&&t instanceof Promise;var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var Zt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,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}},o$=(t,e)=>{if(Mn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Mt(t.common.issues);return this._error=r,this._error}}};function Y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:n}}var re=class{get description(){return this._def.description}_getType(e){return Rr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new at,ctx:{common:e.parent.common,data:e.data,parsedType:Rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(ls(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Rr(e)},n=this._parseSync({data:e,path:i.path,parent:i});return o$(i,n)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Rr(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return Mn(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:e,path:[],parent:r}).then(i=>Mn(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Rr(e)},n=this._parse({data:e,path:i.path,parent:i}),o=await(ls(n)?n:Promise.resolve(n));return o$(i,o)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let s=e(n),a=()=>o.addIssue({code:z.custom,...i(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Qt({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Xt.create(this,this._def)}nullable(){return Or.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return jn.create(this,this._def)}or(e){return zi.create([this,e],this._def)}and(e){return Ci.create(this,e,this._def)}transform(e){return new Qt({...Y(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ni({...Y(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new Wc({typeName:C.ZodBranded,type:this,...Y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mi({...Y(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Bc.create(this,e)}readonly(){return ji.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},AR=/^c[^\s-]{8,}$/i,ER=/^[0-9a-z]+$/,OR=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NR=/^[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,MR=/^[a-z0-9_-]{21}$/i,jR=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DR=/^[-+]?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)?)??$/,UR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,LR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ym,ZR=/^(?:(?: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])$/,FR=/^(?:(?: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])$/,qR=/^(([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]))$/,VR=/^(([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])$/,HR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,WR=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,s$="((\\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])))",BR=new RegExp(`^${s$}$`);function a$(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function GR(t){return new RegExp(`^${a$(t)}$`)}function JR(t){let e=`${s$}T${a$(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function KR(t,e){return!!((e==="v4"||!e)&&ZR.test(t)||(e==="v6"||!e)&&qR.test(t))}function YR(t,e){if(!jR.test(t))return!1;try{let[r]=t.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||e&&n.alg!==e)}catch{return!1}}function XR(t,e){return!!((e==="v4"||!e)&&FR.test(t)||(e==="v6"||!e)&&VR.test(t))}var Ii=class t extends re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.string){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_type,expected:L.string,received:o.parsedType}),W}let i=new at,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(n=this._getOrReturnCtx(e,n),s?N(n,{code:z.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&N(n,{code:z.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")UR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"email",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")ym||(ym=new RegExp(LR,"u")),ym.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"emoji",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")NR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"uuid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")MR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"nanoid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")AR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"cuid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")ER.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"cuid2",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")OR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"ulid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),N(n,{validation:"url",code:z.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"regex",code:z.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?JR(o).test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?BR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?GR(o).test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?DR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"duration",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?KR(e.data,o.version)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"ip",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?YR(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"jwt",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?XR(e.data,o.version)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"cidr",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?HR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"base64",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?WR.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"base64url",code:z.invalid_string,message:o.message}),i.dirty()):le.assertNever(o);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:z.invalid_string,...V.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...V.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...V.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...V.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...V.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...V.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...V.errToObj(r)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Ii.create=t=>new Ii({checks:[],typeName:C.ZodString,coerce:t?.coerce??!1,...Y(t)});function QR(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(t.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return o%s/10**n}var us=class t extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.number){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_type,expected:L.number,received:o.parsedType}),W}let i,n=new at;for(let o of this._def.checks)o.kind==="int"?le.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{code:z.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?QR(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{code:z.not_finite,message:o.message}),n.dirty()):le.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:V.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&le.isInteger(e.value))}get isFinite(){let e=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"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};us.create=t=>new us({checks:[],typeName:C.ZodNumber,coerce:t?.coerce||!1,...Y(t)});var ds=class t extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.bigint)return this._getInvalidInput(e);let i,n=new at;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):le.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return N(r,{code:z.invalid_type,expected:L.bigint,received:r.parsedType}),W}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:V.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ds.create=t=>new ds({checks:[],typeName:C.ZodBigInt,coerce:t?.coerce??!1,...Y(t)});var ps=class extends re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.boolean){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.boolean,received:i.parsedType}),W}return ft(e.data)}};ps.create=t=>new ps({typeName:C.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});var fs=class t extends re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.date){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_type,expected:L.date,received:o.parsedType}),W}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_date}),W}let i=new at,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):le.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};fs.create=t=>new fs({checks:[],coerce:t?.coerce||!1,typeName:C.ZodDate,...Y(t)});var ms=class extends re{_parse(e){if(this._getType(e)!==L.symbol){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.symbol,received:i.parsedType}),W}return ft(e.data)}};ms.create=t=>new ms({typeName:C.ZodSymbol,...Y(t)});var Ti=class extends re{_parse(e){if(this._getType(e)!==L.undefined){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.undefined,received:i.parsedType}),W}return ft(e.data)}};Ti.create=t=>new Ti({typeName:C.ZodUndefined,...Y(t)});var Pi=class extends re{_parse(e){if(this._getType(e)!==L.null){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.null,received:i.parsedType}),W}return ft(e.data)}};Pi.create=t=>new Pi({typeName:C.ZodNull,...Y(t)});var hs=class extends re{constructor(){super(...arguments),this._any=!0}_parse(e){return ft(e.data)}};hs.create=t=>new hs({typeName:C.ZodAny,...Y(t)});var Xr=class extends re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ft(e.data)}};Xr.create=t=>new Xr({typeName:C.ZodUnknown,...Y(t)});var mr=class extends re{_parse(e){let r=this._getOrReturnCtx(e);return N(r,{code:z.invalid_type,expected:L.never,received:r.parsedType}),W}};mr.create=t=>new mr({typeName:C.ZodNever,...Y(t)});var gs=class extends re{_parse(e){if(this._getType(e)!==L.undefined){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.void,received:i.parsedType}),W}return ft(e.data)}};gs.create=t=>new gs({typeName:C.ZodVoid,...Y(t)});var Qr=class t extends re{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==L.array)return N(r,{code:z.invalid_type,expected:L.array,received:r.parsedType}),W;if(n.exactLength!==null){let s=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(s||a)&&(N(r,{code:s?z.too_big:z.too_small,minimum:a?n.exactLength.value:void 0,maximum:s?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&&(N(r,{code:z.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&&(N(r,{code:z.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((s,a)=>n.type._parseAsync(new Zt(r,s,r.path,a)))).then(s=>at.mergeArray(i,s));let o=[...r.data].map((s,a)=>n.type._parseSync(new Zt(r,s,r.path,a)));return at.mergeArray(i,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:V.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:V.toString(r)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...Y(e)});function Si(t){if(t instanceof jt){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=Xt.create(Si(i))}return new jt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Si(t.element)}):t instanceof Xt?Xt.create(Si(t.unwrap())):t instanceof Or?Or.create(Si(t.unwrap())):t instanceof Er?Er.create(t.items.map(e=>Si(e))):t}var jt=class t extends re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=le.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==L.object){let l=this._getOrReturnCtx(e);return N(l,{code:z.invalid_type,expected:L.object,received:l.parsedType}),W}let{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mr&&this._def.unknownKeys==="strip"))for(let l in n.data)s.includes(l)||a.push(l);let c=[];for(let l of s){let u=o[l],d=n.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Zt(n,d,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof mr){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(l==="strict")a.length>0&&(N(n,{code:z.unrecognized_keys,keys:a}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let d=n.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Zt(n,d,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>at.mergeObjectSync(i,l)):at.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{let n=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:V.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:C.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let i of le.objectKeys(e))e[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let i of le.objectKeys(this.shape))e[i]||(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}deepPartial(){return Si(this)}partial(e){let r={};for(let i of le.objectKeys(this.shape)){let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let i of le.objectKeys(this.shape))if(e&&!e[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 t({...this._def,shape:()=>r})}keyof(){return c$(le.objectKeys(this.shape))}};jt.create=(t,e)=>new jt({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:C.ZodObject,...Y(e)});jt.strictCreate=(t,e)=>new jt({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:C.ZodObject,...Y(e)});jt.lazycreate=(t,e)=>new jt({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:C.ZodObject,...Y(e)});var zi=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Mt(a.ctx.common.issues));return N(r,{code:z.invalid_union,unionErrors:s}),W}if(r.common.async)return Promise.all(i.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(n);{let o,s=[];for(let c of i){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new Mt(c));return N(r,{code:z.invalid_union,unionErrors:a}),W}}get options(){return this._def.options}};zi.create=(t,e)=>new zi({options:t,typeName:C.ZodUnion,...Y(e)});var Ar=t=>t instanceof Ri?Ar(t.schema):t instanceof Qt?Ar(t.innerType()):t instanceof Ai?[t.value]:t instanceof Ei?t.options:t instanceof Oi?le.objectValues(t.enum):t instanceof Ni?Ar(t._def.innerType):t instanceof Ti?[void 0]:t instanceof Pi?[null]:t instanceof Xt?[void 0,...Ar(t.unwrap())]:t instanceof Or?[null,...Ar(t.unwrap())]:t instanceof Wc||t instanceof ji?Ar(t.unwrap()):t instanceof Mi?Ar(t._def.innerType):[],vm=class t extends re{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.object)return N(r,{code:z.invalid_type,expected:L.object,received:r.parsedType}),W;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}):(N(r,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let o of r){let s=Ar(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,o)}}return new t({typeName:C.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Y(i)})}};function bm(t,e){let r=Rr(t),i=Rr(e);if(t===e)return{valid:!0,data:t};if(r===L.object&&i===L.object){let n=le.objectKeys(e),o=le.objectKeys(t).filter(a=>n.indexOf(a)!==-1),s={...t,...e};for(let a of o){let c=bm(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===L.array&&i===L.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],c=bm(s,a);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===L.date&&i===L.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ci=class extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(o,s)=>{if(hm(o)||hm(s))return W;let a=bm(o.value,s.value);return a.valid?((gm(o)||gm(s))&&r.dirty(),{status:r.value,value:a.data}):(N(i,{code:z.invalid_intersection_types}),W)};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,s])=>n(o,s)):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}))}};Ci.create=(t,e,r)=>new Ci({left:t,right:e,typeName:C.ZodIntersection,...Y(r)});var Er=class t extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.array)return N(i,{code:z.invalid_type,expected:L.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return N(i,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(N(i,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...i.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Zt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>at.mergeArray(r,s)):at.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Er.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Er({items:t,typeName:C.ZodTuple,rest:null,...Y(e)})};var _m=class t extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.object)return N(i,{code:z.invalid_type,expected:L.object,received:i.parsedType}),W;let n=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)n.push({key:o._parse(new Zt(i,a,i.path,a)),value:s._parse(new Zt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?at.mergeObjectAsync(r,n):at.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof re?new t({keyType:e,valueType:r,typeName:C.ZodRecord,...Y(i)}):new t({keyType:Ii.create(),valueType:e,typeName:C.ZodRecord,...Y(r)})}},ys=class extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.map)return N(i,{code:z.invalid_type,expected:L.map,received:i.parsedType}),W;let n=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,c],l)=>({key:n._parse(new Zt(i,a,i.path,[l,"key"])),value:o._parse(new Zt(i,c,i.path,[l,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return W;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return W;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}}}};ys.create=(t,e,r)=>new ys({valueType:e,keyType:t,typeName:C.ZodMap,...Y(r)});var vs=class t extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.set)return N(i,{code:z.invalid_type,expected:L.set,received:i.parsedType}),W;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(N(i,{code:z.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&&(N(i,{code:z.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let l=new Set;for(let u of c){if(u.status==="aborted")return W;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let a=[...i.data.values()].map((c,l)=>o._parse(new Zt(i,c,i.path,l)));return i.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:V.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};vs.create=(t,e)=>new vs({valueType:t,minSize:null,maxSize:null,typeName:C.ZodSet,...Y(e)});var wm=class t extends re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.function)return N(r,{code:z.invalid_type,expected:L.function,received:r.parsedType}),W;function i(a,c){return Hc({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,cs(),Yr].filter(l=>!!l),issueData:{code:z.invalid_arguments,argumentsError:c}})}function n(a,c){return Hc({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,cs(),Yr].filter(l=>!!l),issueData:{code:z.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof jn){let a=this;return ft(async function(...c){let l=new Mt([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(i(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(n(d,f)),l})})}else{let a=this;return ft(function(...c){let l=a._def.args.safeParse(c,o);if(!l.success)throw new Mt([i(c,l.error)]);let u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Mt([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Er.create(e).rest(Xr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||Er.create([]).rest(Xr.create()),returns:r||Xr.create(),typeName:C.ZodFunction,...Y(i)})}},Ri=class extends re{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ri.create=(t,e)=>new Ri({getter:t,typeName:C.ZodLazy,...Y(e)});var Ai=class extends re{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return N(r,{received:r.data,code:z.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ai.create=(t,e)=>new Ai({value:t,typeName:C.ZodLiteral,...Y(e)});function c$(t,e){return new Ei({values:t,typeName:C.ZodEnum,...Y(e)})}var Ei=class t extends re{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return N(r,{expected:le.joinValues(i),received:r.parsedType,code:z.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),i=this._def.values;return N(r,{received:r.data,code:z.invalid_enum_value,options:i}),W}return ft(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...r})}};Ei.create=c$;var Oi=class extends re{_parse(e){let r=le.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==L.string&&i.parsedType!==L.number){let n=le.objectValues(r);return N(i,{expected:le.joinValues(n),received:i.parsedType,code:z.invalid_type}),W}if(this._cache||(this._cache=new Set(le.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=le.objectValues(r);return N(i,{received:i.data,code:z.invalid_enum_value,options:n}),W}return ft(e.data)}get enum(){return this._def.values}};Oi.create=(t,e)=>new Oi({values:t,typeName:C.ZodNativeEnum,...Y(e)});var jn=class extends re{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.promise&&r.common.async===!1)return N(r,{code:z.invalid_type,expected:L.promise,received:r.parsedType}),W;let i=r.parsedType===L.promise?r.data:Promise.resolve(r.data);return ft(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};jn.create=(t,e)=>new jn({type:t,typeName:C.ZodPromise,...Y(e)});var Qt=class extends re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:s=>{N(i,s),s.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let s=n.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return W;let c=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return c.status==="aborted"?W:c.status==="dirty"?xi(c.value):r.value==="dirty"?xi(c.value):c});{if(r.value==="aborted")return W;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?W:a.status==="dirty"?xi(a.value):r.value==="dirty"?xi(a.value):a}}if(n.type==="refinement"){let s=a=>{let c=n.refinement(a,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 a};if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?W:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?W:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Mn(s))return W;let a=n.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>Mn(s)?Promise.resolve(n.transform(s.value,o)).then(a=>({status:r.value,value:a})):W);le.assertNever(n)}};Qt.create=(t,e,r)=>new Qt({schema:t,typeName:C.ZodEffects,effect:e,...Y(r)});Qt.createWithPreprocess=(t,e,r)=>new Qt({schema:e,effect:{type:"preprocess",transform:t},typeName:C.ZodEffects,...Y(r)});var Xt=class extends re{_parse(e){return this._getType(e)===L.undefined?ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xt.create=(t,e)=>new Xt({innerType:t,typeName:C.ZodOptional,...Y(e)});var Or=class extends re{_parse(e){return this._getType(e)===L.null?ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Or.create=(t,e)=>new Or({innerType:t,typeName:C.ZodNullable,...Y(e)});var Ni=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),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}};Ni.create=(t,e)=>new Ni({innerType:t,typeName:C.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});var Mi=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ls(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Mt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Mt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Mi.create=(t,e)=>new Mi({innerType:t,typeName:C.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});var bs=class extends re{_parse(e){if(this._getType(e)!==L.nan){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}};bs.create=t=>new bs({typeName:C.ZodNaN,...Y(t)});var tV=Symbol("zod_brand"),Wc=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},Bc=class t extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);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"?W:o.status==="dirty"?(r.dirty(),xi(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"?W:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:C.ZodPipeline})}},ji=class extends re{_parse(e){let r=this._def.innerType._parse(e),i=n=>(Mn(n)&&(n.value=Object.freeze(n.value)),n);return ls(r)?r.then(n=>i(n)):i(r)}unwrap(){return this._def.innerType}};ji.create=(t,e)=>new ji({innerType:t,typeName:C.ZodReadonly,...Y(e)});var rV={object:jt.lazycreate},C;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(C||(C={}));var nV=Ii.create,iV=us.create,oV=bs.create,sV=ds.create,aV=ps.create,cV=fs.create,lV=ms.create,uV=Ti.create,dV=Pi.create,pV=hs.create,fV=Xr.create,mV=mr.create,hV=gs.create,gV=Qr.create,l$=jt.create,yV=jt.strictCreate,vV=zi.create,bV=vm.create,_V=Ci.create,wV=Er.create,$V=_m.create,kV=ys.create,xV=vs.create,SV=wm.create,IV=Ri.create,TV=Ai.create,PV=Ei.create,zV=Oi.create,CV=jn.create,RV=Qt.create,AV=Xt.create,EV=Or.create,OV=Qt.createWithPreprocess,NV=Bc.create;var rr={};zr(rr,{$ZodAny:()=>Ul,$ZodArray:()=>Vl,$ZodAsyncError:()=>er,$ZodBase64:()=>zl,$ZodBase64URL:()=>Cl,$ZodBigInt:()=>Os,$ZodBigIntFormat:()=>Nl,$ZodBoolean:()=>Wi,$ZodCIDRv4:()=>Tl,$ZodCIDRv6:()=>Pl,$ZodCUID:()=>bl,$ZodCUID2:()=>_l,$ZodCatch:()=>cu,$ZodCheck:()=>Se,$ZodCheckBigIntFormat:()=>ph,$ZodCheckEndsWith:()=>xh,$ZodCheckGreaterThan:()=>cl,$ZodCheckIncludes:()=>$h,$ZodCheckLengthEquals:()=>vh,$ZodCheckLessThan:()=>al,$ZodCheckLowerCase:()=>_h,$ZodCheckMaxLength:()=>gh,$ZodCheckMaxSize:()=>fh,$ZodCheckMimeType:()=>Ih,$ZodCheckMinLength:()=>yh,$ZodCheckMinSize:()=>mh,$ZodCheckMultipleOf:()=>uh,$ZodCheckNumberFormat:()=>dh,$ZodCheckOverwrite:()=>Th,$ZodCheckProperty:()=>Sh,$ZodCheckRegex:()=>bh,$ZodCheckSizeEquals:()=>hh,$ZodCheckStartsWith:()=>kh,$ZodCheckStringFormat:()=>Hi,$ZodCheckUpperCase:()=>wh,$ZodCodec:()=>Gi,$ZodCustom:()=>hu,$ZodCustomStringFormat:()=>El,$ZodDate:()=>ql,$ZodDefault:()=>iu,$ZodDiscriminatedUnion:()=>Bl,$ZodE164:()=>Rl,$ZodEmail:()=>hl,$ZodEmoji:()=>yl,$ZodEncodeError:()=>en,$ZodEnum:()=>Xl,$ZodError:()=>Ts,$ZodExactOptional:()=>ru,$ZodFile:()=>eu,$ZodFunction:()=>pu,$ZodGUID:()=>fl,$ZodIPv4:()=>xl,$ZodIPv6:()=>Sl,$ZodISODate:()=>Rh,$ZodISODateTime:()=>Ch,$ZodISODuration:()=>Eh,$ZodISOTime:()=>Ah,$ZodIntersection:()=>Gl,$ZodJWT:()=>Al,$ZodKSUID:()=>kl,$ZodLazy:()=>mu,$ZodLiteral:()=>Ql,$ZodMAC:()=>Il,$ZodMap:()=>Kl,$ZodNaN:()=>lu,$ZodNanoID:()=>vl,$ZodNever:()=>Zl,$ZodNonOptional:()=>su,$ZodNull:()=>Dl,$ZodNullable:()=>nu,$ZodNumber:()=>Es,$ZodNumberFormat:()=>Ol,$ZodObject:()=>Hl,$ZodObjectJIT:()=>Nh,$ZodOptional:()=>Ms,$ZodPipe:()=>js,$ZodPrefault:()=>ou,$ZodPreprocess:()=>Mh,$ZodPromise:()=>fu,$ZodReadonly:()=>uu,$ZodRealError:()=>St,$ZodRecord:()=>Jl,$ZodRegistry:()=>bu,$ZodSet:()=>Yl,$ZodString:()=>cn,$ZodStringFormat:()=>$e,$ZodSuccess:()=>au,$ZodSymbol:()=>Ml,$ZodTemplateLiteral:()=>du,$ZodTransform:()=>tu,$ZodTuple:()=>Ns,$ZodType:()=>J,$ZodULID:()=>wl,$ZodURL:()=>gl,$ZodUUID:()=>ml,$ZodUndefined:()=>jl,$ZodUnion:()=>Bi,$ZodUnknown:()=>Ll,$ZodVoid:()=>Fl,$ZodXID:()=>$l,$ZodXor:()=>Wl,$brand:()=>$m,$constructor:()=>v,$input:()=>Dh,$output:()=>jh,Doc:()=>As,JSONSchema:()=>tx,JSONSchemaGenerator:()=>nd,NEVER:()=>_s,TimePrecision:()=>Lh,_any:()=>Mu,_array:()=>Jh,_base64:()=>ta,_base64url:()=>ra,_bigint:()=>Cu,_boolean:()=>zu,_catch:()=>c1,_check:()=>ex,_cidrv4:()=>Qs,_cidrv6:()=>ea,_coercedBigint:()=>Bh,_coercedBoolean:()=>Wh,_coercedDate:()=>Gh,_coercedNumber:()=>Hh,_coercedString:()=>Uh,_cuid:()=>Ws,_cuid2:()=>Bs,_custom:()=>Gu,_date:()=>Lu,_decode:()=>Xc,_decodeAsync:()=>el,_default:()=>o1,_discriminatedUnion:()=>BE,_e164:()=>na,_email:()=>Us,_emoji:()=>Vs,_encode:()=>Yc,_encodeAsync:()=>Qc,_endsWith:()=>io,_enum:()=>QE,_file:()=>Bu,_float32:()=>Su,_float64:()=>Iu,_gt:()=>gr,_gte:()=>ht,_guid:()=>Yi,_includes:()=>ro,_int:()=>xu,_int32:()=>Tu,_int64:()=>Ru,_intersection:()=>GE,_ipv4:()=>Ys,_ipv6:()=>Xs,_isoDate:()=>Fh,_isoDateTime:()=>Zh,_isoDuration:()=>Vh,_isoTime:()=>qh,_jwt:()=>ia,_ksuid:()=>Ks,_lazy:()=>p1,_length:()=>Hn,_literal:()=>t1,_lowercase:()=>eo,_lt:()=>hr,_lte:()=>Dt,_mac:()=>$u,_map:()=>YE,_max:()=>Dt,_maxLength:()=>Vn,_maxSize:()=>un,_mime:()=>oo,_min:()=>ht,_minLength:()=>Mr,_minSize:()=>yr,_multipleOf:()=>ln,_nan:()=>Zu,_nanoid:()=>Hs,_nativeEnum:()=>e1,_negative:()=>qu,_never:()=>Du,_nonnegative:()=>Hu,_nonoptional:()=>s1,_nonpositive:()=>Vu,_normalize:()=>so,_null:()=>Nu,_nullable:()=>i1,_number:()=>ku,_optional:()=>n1,_overwrite:()=>tr,_parse:()=>Zi,_parseAsync:()=>Fi,_pipe:()=>l1,_positive:()=>Fu,_promise:()=>f1,_property:()=>Wu,_readonly:()=>u1,_record:()=>KE,_refine:()=>Ju,_regex:()=>Qi,_safeDecode:()=>rl,_safeDecodeAsync:()=>il,_safeEncode:()=>tl,_safeEncodeAsync:()=>nl,_safeParse:()=>qi,_safeParseAsync:()=>Vi,_set:()=>XE,_size:()=>qn,_slugify:()=>uo,_startsWith:()=>no,_string:()=>wu,_stringFormat:()=>Wn,_stringbool:()=>Qu,_success:()=>a1,_superRefine:()=>Ku,_symbol:()=>Eu,_templateLiteral:()=>d1,_toLowerCase:()=>co,_toUpperCase:()=>lo,_transform:()=>r1,_trim:()=>ao,_tuple:()=>JE,_uint32:()=>Pu,_uint64:()=>Au,_ulid:()=>Gs,_undefined:()=>Ou,_union:()=>HE,_unknown:()=>ju,_uppercase:()=>to,_url:()=>Xi,_uuid:()=>Ls,_uuidv4:()=>Zs,_uuidv6:()=>Fs,_uuidv7:()=>qs,_void:()=>Uu,_xid:()=>Js,_xor:()=>WE,clone:()=>Xe,config:()=>Ue,createStandardJSONSchemaMethod:()=>po,createToJSONSchemaMethod:()=>Kh,decode:()=>k$,decodeAsync:()=>S$,describe:()=>Yu,encode:()=>$$,encodeAsync:()=>x$,extractDefs:()=>pn,finalize:()=>fn,flattenError:()=>Ps,formatError:()=>zs,globalConfig:()=>Dn,globalRegistry:()=>Qe,initializeContext:()=>dn,isValidBase64:()=>Oh,isValidBase64URL:()=>K$,isValidJWT:()=>Y$,locales:()=>Ki,meta:()=>Xu,parse:()=>Ln,parseAsync:()=>Zn,prettifyError:()=>Om,process:()=>be,regexes:()=>It,registry:()=>_u,safeDecode:()=>T$,safeDecodeAsync:()=>z$,safeEncode:()=>I$,safeEncodeAsync:()=>P$,safeParse:()=>sn,safeParseAsync:()=>an,toDotPath:()=>w$,toJSONSchema:()=>Bn,treeifyError:()=>Em,util:()=>P,version:()=>Ph});var u$,_s=Object.freeze({status:"aborted"});function v(t,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let l=s.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){let p=u[d];p in a||(a[p]=l[p].bind(a))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function s(a){var c;let l=r?.Parent?new o:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var $m=Symbol("zod_brand"),er=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},en=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(u$=globalThis).__zod_globalConfig??(u$.__zod_globalConfig={});var Dn=globalThis.__zod_globalConfig;function Ue(t){return t&&Object.assign(Dn,t),Dn}var P={};zr(P,{BIGINT_FORMAT_RANGES:()=>Rm,Class:()=>xm,NUMBER_FORMAT_RANGES:()=>Cm,aborted:()=>on,allowsEval:()=>Tm,assert:()=>iA,assertEqual:()=>eA,assertIs:()=>rA,assertNever:()=>nA,assertNotEqual:()=>tA,assignProp:()=>rn,base64ToUint8Array:()=>v$,base64urlToUint8Array:()=>hA,cached:()=>Ui,captureStackTrace:()=>Jc,cleanEnum:()=>mA,cleanRegex:()=>ks,clone:()=>Xe,cloneDef:()=>sA,createTransparentProxy:()=>pA,defineLazy:()=>Q,esc:()=>Gc,escapeRegex:()=>Ft,explicitlyAborted:()=>Am,extend:()=>m$,finalizeIssue:()=>mt,floatSafeRemainder:()=>Sm,getElementAtPath:()=>aA,getEnumValues:()=>$s,getLengthableOrigin:()=>Is,getParsedType:()=>dA,getSizableOrigin:()=>Ss,hexToUint8Array:()=>yA,isObject:()=>Un,isPlainObject:()=>nn,issue:()=>Li,joinValues:()=>b,jsonStringifyReplacer:()=>Di,merge:()=>fA,mergeDefs:()=>Nr,normalizeParams:()=>R,nullish:()=>tn,numKeys:()=>uA,objectClone:()=>oA,omit:()=>f$,optionalKeys:()=>zm,parsedType:()=>T,partial:()=>g$,pick:()=>p$,prefixIssues:()=>xt,primitiveTypes:()=>Pm,promiseAllObject:()=>cA,propertyKeyTypes:()=>xs,randomString:()=>lA,required:()=>y$,safeExtend:()=>h$,shallowClone:()=>Kc,slugify:()=>Im,stringifyPrimitive:()=>x,uint8ArrayToBase64:()=>b$,uint8ArrayToBase64url:()=>gA,uint8ArrayToHex:()=>vA,unwrapMessage:()=>ws});function eA(t){return t}function tA(t){return t}function rA(t){}function nA(t){throw new Error("Unexpected value in exhaustive check")}function iA(t){}function $s(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function b(t,e="|"){return t.map(r=>x(r)).join(e)}function Di(t,e){return typeof e=="bigint"?e.toString():e}function Ui(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function tn(t){return t==null}function ks(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Sm(t,e){let r=t/e,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var d$=Symbol("evaluating");function Q(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==d$)return i===void 0&&(i=d$,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function oA(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function rn(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Nr(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function sA(t){return Nr(t._zod.def)}function aA(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function cA(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function lA(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function Gc(t){return JSON.stringify(t)}function Im(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Jc="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Un(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Tm=Ui(()=>{if(Dn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function nn(t){if(Un(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Un(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Kc(t){return nn(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function uA(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var dA=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},xs=new Set(["string","number","symbol"]),Pm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ft(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function R(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function pA(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function x(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function zm(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Cm={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]},Rm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function p$(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Nr(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return rn(this,"shape",s),s},checks:[]});return Xe(t,o)}function f$(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Nr(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return rn(this,"shape",s),s},checks:[]});return Xe(t,o)}function m$(t,e){if(!nn(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Nr(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return rn(this,"shape",o),o}});return Xe(t,n)}function h$(t,e){if(!nn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Nr(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return rn(this,"shape",i),i}});return Xe(t,r)}function fA(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Nr(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return rn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Xe(t,r)}function g$(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Nr(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=t?new t({type:"optional",innerType:a[l]}):a[l])}else for(let l in a)c[l]=t?new t({type:"optional",innerType:a[l]}):a[l];return rn(this,"shape",c),c},checks:[]});return Xe(e,s)}function y$(t,e,r){let i=Nr(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return rn(this,"shape",o),o}});return Xe(e,i)}function on(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Am(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function xt(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function ws(t){return typeof t=="string"?t:t?.message}function mt(t,e,r){let i=t.message?t.message:ws(t.inst?._zod.def?.error?.(t))??ws(e?.error?.(t))??ws(r.customError?.(t))??ws(r.localeError?.(t))??"Invalid input",{inst:n,continue:o,input:s,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function Ss(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Is(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function T(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Li(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function mA(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function v$(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function b$(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function hA(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return v$(e+r)}function gA(t){return b$(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function yA(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function vA(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var xm=class{constructor(...e){}};var _$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Di,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ts=v("$ZodError",_$),St=v("$ZodError",_$,{Parent:Error});function Ps(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}function zs(t,e=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)r._errors.push(e(s));else{let c=r,l=0;for(;l<a.length;){let u=a[l];l===a.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(e(s))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return i(t),r}function Em(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,d=0;for(;d<l.length;){let p=l[d],f=d===l.length-1;typeof p=="string"?(u.properties??(u.properties={}),(s=u.properties)[p]??(s[p]={errors:[]}),u=u.properties[p]):(u.items??(u.items=[]),(a=u.items)[p]??(a[p]={errors:[]}),u=u.items[p]),f&&u.errors.push(e(c)),d++}}};return i(t),r}function w$(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Om(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${w$(i.path)}`);return e.join(`
|
|
33
|
-
`)}var Zi=t=>(e,r,i,n)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new er;if(s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>mt(c,o,Ue())));throw Jc(a,n?.callee),a}return s.value},Ln=Zi(St),Fi=t=>async(e,r,i,n)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>mt(c,o,Ue())));throw Jc(a,n?.callee),a}return s.value},Zn=Fi(St),qi=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new er;return o.issues.length?{success:!1,error:new(t??Ts)(o.issues.map(s=>mt(s,n,Ue())))}:{success:!0,data:o.value}},sn=qi(St),Vi=t=>async(e,r,i)=>{let n=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>mt(s,n,Ue())))}:{success:!0,data:o.value}},an=Vi(St),Yc=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Zi(t)(e,r,n)},$$=Yc(St),Xc=t=>(e,r,i)=>Zi(t)(e,r,i),k$=Xc(St),Qc=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Fi(t)(e,r,n)},x$=Qc(St),el=t=>async(e,r,i)=>Fi(t)(e,r,i),S$=el(St),tl=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return qi(t)(e,r,n)},I$=tl(St),rl=t=>(e,r,i)=>qi(t)(e,r,i),T$=rl(St),nl=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Vi(t)(e,r,n)},P$=nl(St),il=t=>async(e,r,i)=>Vi(t)(e,r,i),z$=il(St);var It={};zr(It,{base64:()=>Km,base64url:()=>ol,bigint:()=>nh,boolean:()=>oh,browserEmail:()=>TA,cidrv4:()=>Gm,cidrv6:()=>Jm,cuid:()=>Nm,cuid2:()=>Mm,date:()=>Qm,datetime:()=>th,domain:()=>CA,duration:()=>Zm,e164:()=>Xm,email:()=>qm,emoji:()=>Vm,extendedDuration:()=>_A,guid:()=>Fm,hex:()=>RA,hostname:()=>zA,html5Email:()=>xA,httpProtocol:()=>Ym,idnEmail:()=>IA,integer:()=>ih,ipv4:()=>Hm,ipv6:()=>Wm,ksuid:()=>Um,lowercase:()=>ch,mac:()=>Bm,md5_base64:()=>EA,md5_base64url:()=>OA,md5_hex:()=>AA,nanoid:()=>Lm,null:()=>sh,number:()=>sl,rfc5322Email:()=>SA,sha1_base64:()=>MA,sha1_base64url:()=>jA,sha1_hex:()=>NA,sha256_base64:()=>UA,sha256_base64url:()=>LA,sha256_hex:()=>DA,sha384_base64:()=>FA,sha384_base64url:()=>qA,sha384_hex:()=>ZA,sha512_base64:()=>HA,sha512_base64url:()=>WA,sha512_hex:()=>VA,string:()=>rh,time:()=>eh,ulid:()=>jm,undefined:()=>ah,unicodeEmail:()=>C$,uppercase:()=>lh,uuid:()=>Fn,uuid4:()=>wA,uuid6:()=>$A,uuid7:()=>kA,xid:()=>Dm});var Nm=/^[cC][0-9a-z]{6,}$/,Mm=/^[0-9a-z]+$/,jm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dm=/^[0-9a-vA-V]{20}$/,Um=/^[A-Za-z0-9]{27}$/,Lm=/^[a-zA-Z0-9_-]{21}$/,Zm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_A=/^[-+]?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)?)??$/,Fm=/^([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})$/,Fn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,wA=Fn(4),$A=Fn(6),kA=Fn(7),qm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xA=/^[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])?)*$/,SA=/^(([^<>()\[\]\\.,;:\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,}))$/,C$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,IA=C$,TA=/^[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])?)*$/,PA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Vm(){return new RegExp(PA,"u")}var Hm=/^(?:(?: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])$/,Wm=/^(([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}|:))$/,Bm=t=>{let e=Ft(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Gm=/^((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])$/,Jm=/^(([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])$/,Km=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ol=/^[A-Za-z0-9_-]*$/,zA=/^(?=.{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])?)*\.?$/,CA=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ym=/^https?$/,Xm=/^\+[1-9]\d{6,14}$/,R$="(?:(?:\\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])))",Qm=new RegExp(`^${R$}$`);function A$(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eh(t){return new RegExp(`^${A$(t)}$`)}function th(t){let e=A$({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${R$}T(?:${i})$`)}var rh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},nh=/^-?\d+n?$/,ih=/^-?\d+$/,sl=/^-?\d+(?:\.\d+)?$/,oh=/^(?:true|false)$/i,sh=/^null$/i;var ah=/^undefined$/i;var ch=/^[^A-Z]*$/,lh=/^[^a-z]*$/,RA=/^[0-9a-fA-F]*$/;function Cs(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Rs(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var AA=/^[0-9a-fA-F]{32}$/,EA=Cs(22,"=="),OA=Rs(22),NA=/^[0-9a-fA-F]{40}$/,MA=Cs(27,"="),jA=Rs(27),DA=/^[0-9a-fA-F]{64}$/,UA=Cs(43,"="),LA=Rs(43),ZA=/^[0-9a-fA-F]{96}$/,FA=Cs(64,""),qA=Rs(64),VA=/^[0-9a-fA-F]{128}$/,HA=Cs(86,"=="),WA=Rs(86);var Se=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),O$={number:"number",bigint:"bigint",object:"date"},al=v("$ZodCheckLessThan",(t,e)=>{Se.init(t,e);let r=O$[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),cl=v("$ZodCheckGreaterThan",(t,e)=>{Se.init(t,e);let r=O$[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),uh=v("$ZodCheckMultipleOf",(t,e)=>{Se.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Sm(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),dh=v("$ZodCheckNumberFormat",(t,e)=>{Se.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=Cm[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=n,a.maximum=o,r&&(a.pattern=ih)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),ph=v("$ZodCheckBigIntFormat",(t,e)=>{Se.init(t,e);let[r,i]=Rm[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),fh=v("$ZodCheckMaxSize",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Ss(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),mh=v("$ZodCheckMinSize",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Ss(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),hh=v("$ZodCheckSizeEquals",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:Ss(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),gh=v("$ZodCheckMaxLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let s=Is(n);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),yh=v("$ZodCheckMinLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let s=Is(n);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),vh=v("$ZodCheckLengthEquals",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let s=Is(n),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Hi=v("$ZodCheckStringFormat",(t,e)=>{var r,i;Se.init(t,e),t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),bh=v("$ZodCheckRegex",(t,e)=>{Hi.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),_h=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ch),Hi.init(t,e)}),wh=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=lh),Hi.init(t,e)}),$h=v("$ZodCheckIncludes",(t,e)=>{Se.init(t,e);let r=Ft(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),kh=v("$ZodCheckStartsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`^${Ft(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),xh=v("$ZodCheckEndsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`.*${Ft(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function E$(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues))}var Sh=v("$ZodCheckProperty",(t,e)=>{Se.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>E$(n,r,e.property));E$(i,r,e.property)}}),Ih=v("$ZodCheckMimeType",(t,e)=>{Se.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),Th=v("$ZodCheckOverwrite",(t,e)=>{Se.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var As=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
31
|
+
`)),q(),u()};return{start:Me,stop:(ie="")=>je(ie,0),message:(ie="")=>{m=se(ie??m)},cancel:(ie="")=>je(ie,1),error:(ie="")=>je(ie,2),clear:()=>je("",0,!0),get isCancelled(){return f}}},Rq={light:xe("\u2500","-"),heavy:xe("\u2501","="),block:xe("\u2588","#")};var Eq=`${We("gray",ki)} `;import*as Yt from"node:fs";import*as Kw from"node:os";import*as Ke from"node:path";var ss=process.env.GIGABUDDY_HOME??Ke.join(Kw.homedir(),".gigabuddy"),Nn="default",Yw=Ke.join(ss,"accounts"),Xw=Ke.join(ss,"config.json");function Cr(t){return/^[a-z0-9][a-z0-9._-]{0,63}$/i.test(t)&&t!=="accounts"}function cm(t){if(!Cr(t))throw new Error(`Invalid account name "${t}" \u2014 use letters, digits, dots, dashes or underscores (max 64 chars).`)}function lm(t){return cm(t),t===Nn?ss:Ke.join(Yw,t)}function um(){let t=[];try{for(let e of Yt.readdirSync(Yw,{withFileTypes:!0}))e.isDirectory()&&Cr(e.name)&&t.push(e.name)}catch{}return[Nn,...t.sort()]}function Fc(){try{return JSON.parse(Yt.readFileSync(Xw,"utf-8"))}catch{return{}}}function dm(t){Yt.existsSync(ss)||Yt.mkdirSync(ss,{recursive:!0,mode:448}),Yt.writeFileSync(Xw,JSON.stringify(t,null,2)+`
|
|
32
|
+
`,{mode:384})}function pm(t){cm(t);let e=Fc();e.defaultAccount=t,dm(e)}function fm(t,e){cm(e);let r=Fc();r.pins={...r.pins,[Ke.resolve(t)]:e},dm(r)}function mm(t){let e=Fc(),r=Ke.resolve(t);return e.pins?.[r]?(delete e.pins[r],dm(e),!0):!1}function qc(t){let e=Ke.resolve(t);for(;;){if(Yt.existsSync(Ke.join(e,".git")))return e;let r=Ke.dirname(e);if(r===e)return Ke.resolve(t);e=r}}function zA(t,e){let r=Ke.relative(t,e);return r===""||!r.startsWith("..")&&!Ke.isAbsolute(r)}function fr(t=process.cwd()){let e=process.env.GIGABUDDY_ACCOUNT;if(e&&Cr(e))return{name:e,source:"env"};let r=Fc(),i=Ke.resolve(t),n;for(let[o,s]of Object.entries(r.pins??{}))Cr(s)&&zA(o,i)&&(!n||o.length>n.dir.length)&&(n={dir:o,account:s});return n?{name:n.account,source:"pin",pinnedAt:n.dir}:r.defaultAccount&&Cr(r.defaultAccount)?{name:r.defaultAccount,source:"config-default"}:{name:Nn,source:"fallback"}}import*as Nt from"node:fs";import*as Qw from"node:path";var CA={shared:{prod:"credentials.json",staging:"credentials.staging.json"},user:{prod:"user-credentials.json",staging:"user-credentials.staging.json"},agent:{prod:"agent-credentials.json",staging:"agent-credentials.staging.json"}};function as(t=!1,e="shared",r){let i=CA[e];return Qw.join(lm(r??fr().name),t?i.staging:i.prod)}function Vc(t=!1,e="shared",r){try{let i=Nt.readFileSync(as(t,e,r),"utf-8"),n=JSON.parse(i);return n.refreshToken?n:null}catch{return null}}function Hc(t,e=!1,r="shared",i){let n=lm(i??fr().name);Nt.existsSync(n)||Nt.mkdirSync(n,{recursive:!0,mode:448}),r$(as(e,r,i),JSON.stringify(t,null,2))}function e$(t=!1,e="shared",r){let i=as(t,e,r);Nt.existsSync(i)&&Nt.unlinkSync(i)}function t$(t,e=!1,r="shared",i){let n=Vc(e,r,i);n&&(n.refreshToken=t,Hc(n,e,r,i))}function r$(t,e){Nt.writeFileSync(t,e,{mode:384});try{Nt.chmodSync(t,384)}catch{}}async function n$(t){let r=await(t.fetchImpl??fetch)(`${t.authUrl}/api/token/derive`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t.refreshToken,clientId:t.clientId,scopes:t.scopes})});if(!r.ok){let n=await r.json().catch(()=>null);throw new Error(n?.error_description??n?.error??`Derive failed (${r.status})`)}let i=await r.json();if(!i.refreshToken||!i.userId)throw new Error("Derive response missing refreshToken/userId");return i}var le;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let o={};for(let s of n)o[s]=s;return o},t.getValidEnumValues=n=>{let o=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),s={};for(let a of o)s[a]=n[a];return t.objectValues(s)},t.objectValues=n=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&o.push(s);return o},t.find=(n,o)=>{for(let s of n)if(o(s))return s},t.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(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(le||(le={}));var i$;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(i$||(i$={}));var L=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ar=t=>{switch(typeof t){case"undefined":return L.undefined;case"string":return L.string;case"number":return Number.isNaN(t)?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(t)?L.array:t===null?L.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?L.promise:typeof Map<"u"&&t instanceof Map?L.map:typeof Set<"u"&&t instanceof Set?L.set:typeof Date<"u"&&t instanceof Date?L.date:L.object;default:return L.unknown}};var z=le.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 Mt=class t extends Error{get errors(){return this.issues}constructor(e){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=e}format(e){let r=e||function(o){return o.message},i={_errors:[]},n=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)i._errors.push(r(s));else{let a=i,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return n(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=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(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Mt.create=t=>new Mt(t);var AA=(t,e)=>{let r;switch(t.code){case z.invalid_type:t.received===L.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,le.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:r=`Unrecognized key(s) in object: ${le.joinValues(t.keys,", ")}`;break;case z.invalid_union:r="Invalid input";break;case z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${le.joinValues(t.options)}`;break;case z.invalid_enum_value:r=`Invalid enum value. Expected ${le.joinValues(t.options)}, received '${t.received}'`;break;case z.invalid_arguments:r="Invalid function arguments";break;case z.invalid_return_type:r="Invalid function return type";break;case z.invalid_date:r="Invalid date";break;case z.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:le.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case z.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case z.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case z.custom:r="Invalid input";break;case z.invalid_intersection_types:r="Intersection results could not be merged";break;case z.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case z.not_finite:r="Number must be finite";break;default:r=e.defaultError,le.assertNever(t)}return{message:r}},Yr=AA;var RA=Yr;function cs(){return RA}var Wc=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,o=[...r,...n.path||[]],s={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let a="",c=i.filter(l=>!!l).slice().reverse();for(let l of c)a=l(s,{data:e,defaultError:a}).message;return{...n,path:o,message:a}};function N(t,e){let r=cs(),i=Wc({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Yr?void 0:Yr].filter(n=>!!n)});t.common.issues.push(i)}var at=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return W;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r){let o=await n.key,s=await n.value;i.push({key:o,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:o,value:s}=n;if(o.status==="aborted"||s.status==="aborted")return W;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}},W=Object.freeze({status:"aborted"}),xi=t=>({status:"dirty",value:t}),ft=t=>({status:"valid",value:t}),hm=t=>t.status==="aborted",gm=t=>t.status==="dirty",Mn=t=>t.status==="valid",ls=t=>typeof Promise<"u"&&t instanceof Promise;var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var Zt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,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}},o$=(t,e)=>{if(Mn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Mt(t.common.issues);return this._error=r,this._error}}};function Y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:n}}var re=class{get description(){return this._def.description}_getType(e){return Ar(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ar(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new at,ctx:{common:e.parent.common,data:e.data,parsedType:Ar(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(ls(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ar(e)},n=this._parseSync({data:e,path:i.path,parent:i});return o$(i,n)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ar(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return Mn(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:e,path:[],parent:r}).then(i=>Mn(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ar(e)},n=this._parse({data:e,path:i.path,parent:i}),o=await(ls(n)?n:Promise.resolve(n));return o$(i,o)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let s=e(n),a=()=>o.addIssue({code:z.custom,...i(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Qt({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Xt.create(this,this._def)}nullable(){return Or.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return jn.create(this,this._def)}or(e){return zi.create([this,e],this._def)}and(e){return Ci.create(this,e,this._def)}transform(e){return new Qt({...Y(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ni({...Y(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new Bc({typeName:C.ZodBranded,type:this,...Y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mi({...Y(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Gc.create(this,e)}readonly(){return ji.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},EA=/^c[^\s-]{8,}$/i,OA=/^[0-9a-z]+$/,NA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,MA=/^[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,jA=/^[a-z0-9_-]{21}$/i,DA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,UA=/^[-+]?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)?)??$/,LA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ym,FA=/^(?:(?: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])$/,qA=/^(?:(?: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])$/,VA=/^(([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]))$/,HA=/^(([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])$/,WA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,s$="((\\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])))",GA=new RegExp(`^${s$}$`);function a$(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function JA(t){return new RegExp(`^${a$(t)}$`)}function KA(t){let e=`${s$}T${a$(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function YA(t,e){return!!((e==="v4"||!e)&&FA.test(t)||(e==="v6"||!e)&&VA.test(t))}function XA(t,e){if(!DA.test(t))return!1;try{let[r]=t.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||e&&n.alg!==e)}catch{return!1}}function QA(t,e){return!!((e==="v4"||!e)&&qA.test(t)||(e==="v6"||!e)&&HA.test(t))}var Ii=class t extends re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.string){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_type,expected:L.string,received:o.parsedType}),W}let i=new at,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(n=this._getOrReturnCtx(e,n),s?N(n,{code:z.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&N(n,{code:z.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")LA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"email",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")ym||(ym=new RegExp(ZA,"u")),ym.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"emoji",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")MA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"uuid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")jA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"nanoid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")EA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"cuid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")OA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"cuid2",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")NA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"ulid",code:z.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),N(n,{validation:"url",code:z.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"regex",code:z.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?KA(o).test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?GA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?JA(o).test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{code:z.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?UA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"duration",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?YA(e.data,o.version)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"ip",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?XA(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"jwt",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?QA(e.data,o.version)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"cidr",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?WA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"base64",code:z.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?BA.test(e.data)||(n=this._getOrReturnCtx(e,n),N(n,{validation:"base64url",code:z.invalid_string,message:o.message}),i.dirty()):le.assertNever(o);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:z.invalid_string,...V.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...V.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...V.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...V.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...V.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...V.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...V.errToObj(r)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Ii.create=t=>new Ii({checks:[],typeName:C.ZodString,coerce:t?.coerce??!1,...Y(t)});function eR(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(t.toFixed(n).replace(".","")),s=Number.parseInt(e.toFixed(n).replace(".",""));return o%s/10**n}var us=class t extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.number){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_type,expected:L.number,received:o.parsedType}),W}let i,n=new at;for(let o of this._def.checks)o.kind==="int"?le.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{code:z.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?eR(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),N(i,{code:z.not_finite,message:o.message}),n.dirty()):le.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:V.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&le.isInteger(e.value))}get isFinite(){let e=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"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};us.create=t=>new us({checks:[],typeName:C.ZodNumber,coerce:t?.coerce||!1,...Y(t)});var ds=class t extends re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.bigint)return this._getInvalidInput(e);let i,n=new at;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),N(i,{code:z.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):le.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return N(r,{code:z.invalid_type,expected:L.bigint,received:r.parsedType}),W}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:V.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ds.create=t=>new ds({checks:[],typeName:C.ZodBigInt,coerce:t?.coerce??!1,...Y(t)});var ps=class extends re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.boolean){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.boolean,received:i.parsedType}),W}return ft(e.data)}};ps.create=t=>new ps({typeName:C.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});var fs=class t extends re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.date){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_type,expected:L.date,received:o.parsedType}),W}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return N(o,{code:z.invalid_date}),W}let i=new at,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),N(n,{code:z.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):le.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};fs.create=t=>new fs({checks:[],coerce:t?.coerce||!1,typeName:C.ZodDate,...Y(t)});var ms=class extends re{_parse(e){if(this._getType(e)!==L.symbol){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.symbol,received:i.parsedType}),W}return ft(e.data)}};ms.create=t=>new ms({typeName:C.ZodSymbol,...Y(t)});var Ti=class extends re{_parse(e){if(this._getType(e)!==L.undefined){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.undefined,received:i.parsedType}),W}return ft(e.data)}};Ti.create=t=>new Ti({typeName:C.ZodUndefined,...Y(t)});var Pi=class extends re{_parse(e){if(this._getType(e)!==L.null){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.null,received:i.parsedType}),W}return ft(e.data)}};Pi.create=t=>new Pi({typeName:C.ZodNull,...Y(t)});var hs=class extends re{constructor(){super(...arguments),this._any=!0}_parse(e){return ft(e.data)}};hs.create=t=>new hs({typeName:C.ZodAny,...Y(t)});var Xr=class extends re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ft(e.data)}};Xr.create=t=>new Xr({typeName:C.ZodUnknown,...Y(t)});var mr=class extends re{_parse(e){let r=this._getOrReturnCtx(e);return N(r,{code:z.invalid_type,expected:L.never,received:r.parsedType}),W}};mr.create=t=>new mr({typeName:C.ZodNever,...Y(t)});var gs=class extends re{_parse(e){if(this._getType(e)!==L.undefined){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.void,received:i.parsedType}),W}return ft(e.data)}};gs.create=t=>new gs({typeName:C.ZodVoid,...Y(t)});var Qr=class t extends re{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==L.array)return N(r,{code:z.invalid_type,expected:L.array,received:r.parsedType}),W;if(n.exactLength!==null){let s=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(s||a)&&(N(r,{code:s?z.too_big:z.too_small,minimum:a?n.exactLength.value:void 0,maximum:s?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&&(N(r,{code:z.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&&(N(r,{code:z.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((s,a)=>n.type._parseAsync(new Zt(r,s,r.path,a)))).then(s=>at.mergeArray(i,s));let o=[...r.data].map((s,a)=>n.type._parseSync(new Zt(r,s,r.path,a)));return at.mergeArray(i,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:V.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:V.toString(r)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...Y(e)});function Si(t){if(t instanceof jt){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=Xt.create(Si(i))}return new jt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Si(t.element)}):t instanceof Xt?Xt.create(Si(t.unwrap())):t instanceof Or?Or.create(Si(t.unwrap())):t instanceof Er?Er.create(t.items.map(e=>Si(e))):t}var jt=class t extends re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=le.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==L.object){let l=this._getOrReturnCtx(e);return N(l,{code:z.invalid_type,expected:L.object,received:l.parsedType}),W}let{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mr&&this._def.unknownKeys==="strip"))for(let l in n.data)s.includes(l)||a.push(l);let c=[];for(let l of s){let u=o[l],d=n.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Zt(n,d,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof mr){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(l==="strict")a.length>0&&(N(n,{code:z.unrecognized_keys,keys:a}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let d=n.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Zt(n,d,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>at.mergeObjectSync(i,l)):at.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{let n=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:V.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:C.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let i of le.objectKeys(e))e[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let i of le.objectKeys(this.shape))e[i]||(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}deepPartial(){return Si(this)}partial(e){let r={};for(let i of le.objectKeys(this.shape)){let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let i of le.objectKeys(this.shape))if(e&&!e[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 t({...this._def,shape:()=>r})}keyof(){return c$(le.objectKeys(this.shape))}};jt.create=(t,e)=>new jt({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:C.ZodObject,...Y(e)});jt.strictCreate=(t,e)=>new jt({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:C.ZodObject,...Y(e)});jt.lazycreate=(t,e)=>new jt({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:C.ZodObject,...Y(e)});var zi=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Mt(a.ctx.common.issues));return N(r,{code:z.invalid_union,unionErrors:s}),W}if(r.common.async)return Promise.all(i.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(n);{let o,s=[];for(let c of i){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new Mt(c));return N(r,{code:z.invalid_union,unionErrors:a}),W}}get options(){return this._def.options}};zi.create=(t,e)=>new zi({options:t,typeName:C.ZodUnion,...Y(e)});var Rr=t=>t instanceof Ai?Rr(t.schema):t instanceof Qt?Rr(t.innerType()):t instanceof Ri?[t.value]:t instanceof Ei?t.options:t instanceof Oi?le.objectValues(t.enum):t instanceof Ni?Rr(t._def.innerType):t instanceof Ti?[void 0]:t instanceof Pi?[null]:t instanceof Xt?[void 0,...Rr(t.unwrap())]:t instanceof Or?[null,...Rr(t.unwrap())]:t instanceof Bc||t instanceof ji?Rr(t.unwrap()):t instanceof Mi?Rr(t._def.innerType):[],vm=class t extends re{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.object)return N(r,{code:z.invalid_type,expected:L.object,received:r.parsedType}),W;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}):(N(r,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let o of r){let s=Rr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,o)}}return new t({typeName:C.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Y(i)})}};function bm(t,e){let r=Ar(t),i=Ar(e);if(t===e)return{valid:!0,data:t};if(r===L.object&&i===L.object){let n=le.objectKeys(e),o=le.objectKeys(t).filter(a=>n.indexOf(a)!==-1),s={...t,...e};for(let a of o){let c=bm(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===L.array&&i===L.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],c=bm(s,a);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===L.date&&i===L.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ci=class extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(o,s)=>{if(hm(o)||hm(s))return W;let a=bm(o.value,s.value);return a.valid?((gm(o)||gm(s))&&r.dirty(),{status:r.value,value:a.data}):(N(i,{code:z.invalid_intersection_types}),W)};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,s])=>n(o,s)):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}))}};Ci.create=(t,e,r)=>new Ci({left:t,right:e,typeName:C.ZodIntersection,...Y(r)});var Er=class t extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.array)return N(i,{code:z.invalid_type,expected:L.array,received:i.parsedType}),W;if(i.data.length<this._def.items.length)return N(i,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&i.data.length>this._def.items.length&&(N(i,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...i.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Zt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>at.mergeArray(r,s)):at.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Er.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Er({items:t,typeName:C.ZodTuple,rest:null,...Y(e)})};var _m=class t extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.object)return N(i,{code:z.invalid_type,expected:L.object,received:i.parsedType}),W;let n=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)n.push({key:o._parse(new Zt(i,a,i.path,a)),value:s._parse(new Zt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?at.mergeObjectAsync(r,n):at.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof re?new t({keyType:e,valueType:r,typeName:C.ZodRecord,...Y(i)}):new t({keyType:Ii.create(),valueType:e,typeName:C.ZodRecord,...Y(r)})}},ys=class extends re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.map)return N(i,{code:z.invalid_type,expected:L.map,received:i.parsedType}),W;let n=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,c],l)=>({key:n._parse(new Zt(i,a,i.path,[l,"key"])),value:o._parse(new Zt(i,c,i.path,[l,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return W;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return W;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}}}};ys.create=(t,e,r)=>new ys({valueType:e,keyType:t,typeName:C.ZodMap,...Y(r)});var vs=class t extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==L.set)return N(i,{code:z.invalid_type,expected:L.set,received:i.parsedType}),W;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(N(i,{code:z.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&&(N(i,{code:z.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let l=new Set;for(let u of c){if(u.status==="aborted")return W;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let a=[...i.data.values()].map((c,l)=>o._parse(new Zt(i,c,i.path,l)));return i.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:V.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};vs.create=(t,e)=>new vs({valueType:t,minSize:null,maxSize:null,typeName:C.ZodSet,...Y(e)});var wm=class t extends re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.function)return N(r,{code:z.invalid_type,expected:L.function,received:r.parsedType}),W;function i(a,c){return Wc({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,cs(),Yr].filter(l=>!!l),issueData:{code:z.invalid_arguments,argumentsError:c}})}function n(a,c){return Wc({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,cs(),Yr].filter(l=>!!l),issueData:{code:z.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof jn){let a=this;return ft(async function(...c){let l=new Mt([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(i(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(n(d,f)),l})})}else{let a=this;return ft(function(...c){let l=a._def.args.safeParse(c,o);if(!l.success)throw new Mt([i(c,l.error)]);let u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Mt([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Er.create(e).rest(Xr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||Er.create([]).rest(Xr.create()),returns:r||Xr.create(),typeName:C.ZodFunction,...Y(i)})}},Ai=class extends re{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ai.create=(t,e)=>new Ai({getter:t,typeName:C.ZodLazy,...Y(e)});var Ri=class extends re{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return N(r,{received:r.data,code:z.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ri.create=(t,e)=>new Ri({value:t,typeName:C.ZodLiteral,...Y(e)});function c$(t,e){return new Ei({values:t,typeName:C.ZodEnum,...Y(e)})}var Ei=class t extends re{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return N(r,{expected:le.joinValues(i),received:r.parsedType,code:z.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),i=this._def.values;return N(r,{received:r.data,code:z.invalid_enum_value,options:i}),W}return ft(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...r})}};Ei.create=c$;var Oi=class extends re{_parse(e){let r=le.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==L.string&&i.parsedType!==L.number){let n=le.objectValues(r);return N(i,{expected:le.joinValues(n),received:i.parsedType,code:z.invalid_type}),W}if(this._cache||(this._cache=new Set(le.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=le.objectValues(r);return N(i,{received:i.data,code:z.invalid_enum_value,options:n}),W}return ft(e.data)}get enum(){return this._def.values}};Oi.create=(t,e)=>new Oi({values:t,typeName:C.ZodNativeEnum,...Y(e)});var jn=class extends re{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.promise&&r.common.async===!1)return N(r,{code:z.invalid_type,expected:L.promise,received:r.parsedType}),W;let i=r.parsedType===L.promise?r.data:Promise.resolve(r.data);return ft(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};jn.create=(t,e)=>new jn({type:t,typeName:C.ZodPromise,...Y(e)});var Qt=class extends re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:s=>{N(i,s),s.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let s=n.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return W;let c=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return c.status==="aborted"?W:c.status==="dirty"?xi(c.value):r.value==="dirty"?xi(c.value):c});{if(r.value==="aborted")return W;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?W:a.status==="dirty"?xi(a.value):r.value==="dirty"?xi(a.value):a}}if(n.type==="refinement"){let s=a=>{let c=n.refinement(a,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 a};if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?W:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?W:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Mn(s))return W;let a=n.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>Mn(s)?Promise.resolve(n.transform(s.value,o)).then(a=>({status:r.value,value:a})):W);le.assertNever(n)}};Qt.create=(t,e,r)=>new Qt({schema:t,typeName:C.ZodEffects,effect:e,...Y(r)});Qt.createWithPreprocess=(t,e,r)=>new Qt({schema:e,effect:{type:"preprocess",transform:t},typeName:C.ZodEffects,...Y(r)});var Xt=class extends re{_parse(e){return this._getType(e)===L.undefined?ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xt.create=(t,e)=>new Xt({innerType:t,typeName:C.ZodOptional,...Y(e)});var Or=class extends re{_parse(e){return this._getType(e)===L.null?ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Or.create=(t,e)=>new Or({innerType:t,typeName:C.ZodNullable,...Y(e)});var Ni=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),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}};Ni.create=(t,e)=>new Ni({innerType:t,typeName:C.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});var Mi=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ls(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Mt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Mt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Mi.create=(t,e)=>new Mi({innerType:t,typeName:C.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});var bs=class extends re{_parse(e){if(this._getType(e)!==L.nan){let i=this._getOrReturnCtx(e);return N(i,{code:z.invalid_type,expected:L.nan,received:i.parsedType}),W}return{status:"valid",value:e.data}}};bs.create=t=>new bs({typeName:C.ZodNaN,...Y(t)});var nV=Symbol("zod_brand"),Bc=class extends re{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},Gc=class t extends re{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);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"?W:o.status==="dirty"?(r.dirty(),xi(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"?W:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:C.ZodPipeline})}},ji=class extends re{_parse(e){let r=this._def.innerType._parse(e),i=n=>(Mn(n)&&(n.value=Object.freeze(n.value)),n);return ls(r)?r.then(n=>i(n)):i(r)}unwrap(){return this._def.innerType}};ji.create=(t,e)=>new ji({innerType:t,typeName:C.ZodReadonly,...Y(e)});var iV={object:jt.lazycreate},C;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(C||(C={}));var oV=Ii.create,sV=us.create,aV=bs.create,cV=ds.create,lV=ps.create,uV=fs.create,dV=ms.create,pV=Ti.create,fV=Pi.create,mV=hs.create,hV=Xr.create,gV=mr.create,yV=gs.create,vV=Qr.create,l$=jt.create,bV=jt.strictCreate,_V=zi.create,wV=vm.create,$V=Ci.create,kV=Er.create,xV=_m.create,SV=ys.create,IV=vs.create,TV=wm.create,PV=Ai.create,zV=Ri.create,CV=Ei.create,AV=Oi.create,RV=jn.create,EV=Qt.create,OV=Xt.create,NV=Or.create,MV=Qt.createWithPreprocess,jV=Gc.create;var rr={};zr(rr,{$ZodAny:()=>Ll,$ZodArray:()=>Hl,$ZodAsyncError:()=>er,$ZodBase64:()=>Cl,$ZodBase64URL:()=>Al,$ZodBigInt:()=>Os,$ZodBigIntFormat:()=>Ml,$ZodBoolean:()=>Wi,$ZodCIDRv4:()=>Pl,$ZodCIDRv6:()=>zl,$ZodCUID:()=>_l,$ZodCUID2:()=>wl,$ZodCatch:()=>lu,$ZodCheck:()=>Se,$ZodCheckBigIntFormat:()=>ph,$ZodCheckEndsWith:()=>xh,$ZodCheckGreaterThan:()=>ll,$ZodCheckIncludes:()=>$h,$ZodCheckLengthEquals:()=>vh,$ZodCheckLessThan:()=>cl,$ZodCheckLowerCase:()=>_h,$ZodCheckMaxLength:()=>gh,$ZodCheckMaxSize:()=>fh,$ZodCheckMimeType:()=>Ih,$ZodCheckMinLength:()=>yh,$ZodCheckMinSize:()=>mh,$ZodCheckMultipleOf:()=>uh,$ZodCheckNumberFormat:()=>dh,$ZodCheckOverwrite:()=>Th,$ZodCheckProperty:()=>Sh,$ZodCheckRegex:()=>bh,$ZodCheckSizeEquals:()=>hh,$ZodCheckStartsWith:()=>kh,$ZodCheckStringFormat:()=>Hi,$ZodCheckUpperCase:()=>wh,$ZodCodec:()=>Gi,$ZodCustom:()=>gu,$ZodCustomStringFormat:()=>Ol,$ZodDate:()=>Vl,$ZodDefault:()=>ou,$ZodDiscriminatedUnion:()=>Gl,$ZodE164:()=>Rl,$ZodEmail:()=>gl,$ZodEmoji:()=>vl,$ZodEncodeError:()=>en,$ZodEnum:()=>Ql,$ZodError:()=>Ts,$ZodExactOptional:()=>nu,$ZodFile:()=>tu,$ZodFunction:()=>fu,$ZodGUID:()=>ml,$ZodIPv4:()=>Sl,$ZodIPv6:()=>Il,$ZodISODate:()=>Ah,$ZodISODateTime:()=>Ch,$ZodISODuration:()=>Eh,$ZodISOTime:()=>Rh,$ZodIntersection:()=>Jl,$ZodJWT:()=>El,$ZodKSUID:()=>xl,$ZodLazy:()=>hu,$ZodLiteral:()=>eu,$ZodMAC:()=>Tl,$ZodMap:()=>Yl,$ZodNaN:()=>uu,$ZodNanoID:()=>bl,$ZodNever:()=>Fl,$ZodNonOptional:()=>au,$ZodNull:()=>Ul,$ZodNullable:()=>iu,$ZodNumber:()=>Es,$ZodNumberFormat:()=>Nl,$ZodObject:()=>Wl,$ZodObjectJIT:()=>Nh,$ZodOptional:()=>Ms,$ZodPipe:()=>js,$ZodPrefault:()=>su,$ZodPreprocess:()=>Mh,$ZodPromise:()=>mu,$ZodReadonly:()=>du,$ZodRealError:()=>St,$ZodRecord:()=>Kl,$ZodRegistry:()=>_u,$ZodSet:()=>Xl,$ZodString:()=>cn,$ZodStringFormat:()=>$e,$ZodSuccess:()=>cu,$ZodSymbol:()=>jl,$ZodTemplateLiteral:()=>pu,$ZodTransform:()=>ru,$ZodTuple:()=>Ns,$ZodType:()=>J,$ZodULID:()=>$l,$ZodURL:()=>yl,$ZodUUID:()=>hl,$ZodUndefined:()=>Dl,$ZodUnion:()=>Bi,$ZodUnknown:()=>Zl,$ZodVoid:()=>ql,$ZodXID:()=>kl,$ZodXor:()=>Bl,$brand:()=>$m,$constructor:()=>v,$input:()=>Dh,$output:()=>jh,Doc:()=>Rs,JSONSchema:()=>tx,JSONSchemaGenerator:()=>id,NEVER:()=>_s,TimePrecision:()=>Lh,_any:()=>ju,_array:()=>Jh,_base64:()=>ta,_base64url:()=>ra,_bigint:()=>Au,_boolean:()=>Cu,_catch:()=>l1,_check:()=>ex,_cidrv4:()=>Qs,_cidrv6:()=>ea,_coercedBigint:()=>Bh,_coercedBoolean:()=>Wh,_coercedDate:()=>Gh,_coercedNumber:()=>Hh,_coercedString:()=>Uh,_cuid:()=>Ws,_cuid2:()=>Bs,_custom:()=>Ju,_date:()=>Zu,_decode:()=>Qc,_decodeAsync:()=>tl,_default:()=>s1,_discriminatedUnion:()=>GE,_e164:()=>na,_email:()=>Us,_emoji:()=>Vs,_encode:()=>Xc,_encodeAsync:()=>el,_endsWith:()=>io,_enum:()=>e1,_file:()=>Gu,_float32:()=>Iu,_float64:()=>Tu,_gt:()=>gr,_gte:()=>ht,_guid:()=>Yi,_includes:()=>ro,_int:()=>Su,_int32:()=>Pu,_int64:()=>Ru,_intersection:()=>JE,_ipv4:()=>Ys,_ipv6:()=>Xs,_isoDate:()=>Fh,_isoDateTime:()=>Zh,_isoDuration:()=>Vh,_isoTime:()=>qh,_jwt:()=>ia,_ksuid:()=>Ks,_lazy:()=>f1,_length:()=>Hn,_literal:()=>r1,_lowercase:()=>eo,_lt:()=>hr,_lte:()=>Dt,_mac:()=>ku,_map:()=>XE,_max:()=>Dt,_maxLength:()=>Vn,_maxSize:()=>un,_mime:()=>oo,_min:()=>ht,_minLength:()=>Mr,_minSize:()=>yr,_multipleOf:()=>ln,_nan:()=>Fu,_nanoid:()=>Hs,_nativeEnum:()=>t1,_negative:()=>Vu,_never:()=>Uu,_nonnegative:()=>Wu,_nonoptional:()=>a1,_nonpositive:()=>Hu,_normalize:()=>so,_null:()=>Mu,_nullable:()=>o1,_number:()=>xu,_optional:()=>i1,_overwrite:()=>tr,_parse:()=>Zi,_parseAsync:()=>Fi,_pipe:()=>u1,_positive:()=>qu,_promise:()=>m1,_property:()=>Bu,_readonly:()=>d1,_record:()=>YE,_refine:()=>Ku,_regex:()=>Qi,_safeDecode:()=>nl,_safeDecodeAsync:()=>ol,_safeEncode:()=>rl,_safeEncodeAsync:()=>il,_safeParse:()=>qi,_safeParseAsync:()=>Vi,_set:()=>QE,_size:()=>qn,_slugify:()=>uo,_startsWith:()=>no,_string:()=>$u,_stringFormat:()=>Wn,_stringbool:()=>ed,_success:()=>c1,_superRefine:()=>Yu,_symbol:()=>Ou,_templateLiteral:()=>p1,_toLowerCase:()=>co,_toUpperCase:()=>lo,_transform:()=>n1,_trim:()=>ao,_tuple:()=>KE,_uint32:()=>zu,_uint64:()=>Eu,_ulid:()=>Gs,_undefined:()=>Nu,_union:()=>WE,_unknown:()=>Du,_uppercase:()=>to,_url:()=>Xi,_uuid:()=>Ls,_uuidv4:()=>Zs,_uuidv6:()=>Fs,_uuidv7:()=>qs,_void:()=>Lu,_xid:()=>Js,_xor:()=>BE,clone:()=>Xe,config:()=>Ue,createStandardJSONSchemaMethod:()=>po,createToJSONSchemaMethod:()=>Kh,decode:()=>k$,decodeAsync:()=>S$,describe:()=>Xu,encode:()=>$$,encodeAsync:()=>x$,extractDefs:()=>pn,finalize:()=>fn,flattenError:()=>Ps,formatError:()=>zs,globalConfig:()=>Dn,globalRegistry:()=>Qe,initializeContext:()=>dn,isValidBase64:()=>Oh,isValidBase64URL:()=>K$,isValidJWT:()=>Y$,locales:()=>Ki,meta:()=>Qu,parse:()=>Ln,parseAsync:()=>Zn,prettifyError:()=>Om,process:()=>be,regexes:()=>It,registry:()=>wu,safeDecode:()=>T$,safeDecodeAsync:()=>z$,safeEncode:()=>I$,safeEncodeAsync:()=>P$,safeParse:()=>sn,safeParseAsync:()=>an,toDotPath:()=>w$,toJSONSchema:()=>Bn,treeifyError:()=>Em,util:()=>P,version:()=>Ph});var u$,_s=Object.freeze({status:"aborted"});function v(t,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let l=s.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){let p=u[d];p in a||(a[p]=l[p].bind(a))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function s(a){var c;let l=r?.Parent?new o:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var $m=Symbol("zod_brand"),er=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},en=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(u$=globalThis).__zod_globalConfig??(u$.__zod_globalConfig={});var Dn=globalThis.__zod_globalConfig;function Ue(t){return t&&Object.assign(Dn,t),Dn}var P={};zr(P,{BIGINT_FORMAT_RANGES:()=>Am,Class:()=>xm,NUMBER_FORMAT_RANGES:()=>Cm,aborted:()=>on,allowsEval:()=>Tm,assert:()=>oR,assertEqual:()=>tR,assertIs:()=>nR,assertNever:()=>iR,assertNotEqual:()=>rR,assignProp:()=>rn,base64ToUint8Array:()=>v$,base64urlToUint8Array:()=>gR,cached:()=>Ui,captureStackTrace:()=>Kc,cleanEnum:()=>hR,cleanRegex:()=>ks,clone:()=>Xe,cloneDef:()=>aR,createTransparentProxy:()=>fR,defineLazy:()=>Q,esc:()=>Jc,escapeRegex:()=>Ft,explicitlyAborted:()=>Rm,extend:()=>m$,finalizeIssue:()=>mt,floatSafeRemainder:()=>Sm,getElementAtPath:()=>cR,getEnumValues:()=>$s,getLengthableOrigin:()=>Is,getParsedType:()=>pR,getSizableOrigin:()=>Ss,hexToUint8Array:()=>vR,isObject:()=>Un,isPlainObject:()=>nn,issue:()=>Li,joinValues:()=>b,jsonStringifyReplacer:()=>Di,merge:()=>mR,mergeDefs:()=>Nr,normalizeParams:()=>A,nullish:()=>tn,numKeys:()=>dR,objectClone:()=>sR,omit:()=>f$,optionalKeys:()=>zm,parsedType:()=>T,partial:()=>g$,pick:()=>p$,prefixIssues:()=>xt,primitiveTypes:()=>Pm,promiseAllObject:()=>lR,propertyKeyTypes:()=>xs,randomString:()=>uR,required:()=>y$,safeExtend:()=>h$,shallowClone:()=>Yc,slugify:()=>Im,stringifyPrimitive:()=>x,uint8ArrayToBase64:()=>b$,uint8ArrayToBase64url:()=>yR,uint8ArrayToHex:()=>bR,unwrapMessage:()=>ws});function tR(t){return t}function rR(t){return t}function nR(t){}function iR(t){throw new Error("Unexpected value in exhaustive check")}function oR(t){}function $s(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function b(t,e="|"){return t.map(r=>x(r)).join(e)}function Di(t,e){return typeof e=="bigint"?e.toString():e}function Ui(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function tn(t){return t==null}function ks(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Sm(t,e){let r=t/e,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var d$=Symbol("evaluating");function Q(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==d$)return i===void 0&&(i=d$,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function sR(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function rn(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Nr(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function aR(t){return Nr(t._zod.def)}function cR(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function lR(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function uR(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function Jc(t){return JSON.stringify(t)}function Im(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Kc="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Un(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Tm=Ui(()=>{if(Dn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function nn(t){if(Un(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Un(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Yc(t){return nn(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function dR(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var pR=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},xs=new Set(["string","number","symbol"]),Pm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ft(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xe(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function A(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function fR(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function x(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function zm(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Cm={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]},Am={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function p$(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Nr(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return rn(this,"shape",s),s},checks:[]});return Xe(t,o)}function f$(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Nr(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return rn(this,"shape",s),s},checks:[]});return Xe(t,o)}function m$(t,e){if(!nn(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Nr(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return rn(this,"shape",o),o}});return Xe(t,n)}function h$(t,e){if(!nn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Nr(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return rn(this,"shape",i),i}});return Xe(t,r)}function mR(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Nr(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return rn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Xe(t,r)}function g$(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Nr(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=t?new t({type:"optional",innerType:a[l]}):a[l])}else for(let l in a)c[l]=t?new t({type:"optional",innerType:a[l]}):a[l];return rn(this,"shape",c),c},checks:[]});return Xe(e,s)}function y$(t,e,r){let i=Nr(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return rn(this,"shape",o),o}});return Xe(e,i)}function on(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Rm(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function xt(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function ws(t){return typeof t=="string"?t:t?.message}function mt(t,e,r){let i=t.message?t.message:ws(t.inst?._zod.def?.error?.(t))??ws(e?.error?.(t))??ws(r.customError?.(t))??ws(r.localeError?.(t))??"Invalid input",{inst:n,continue:o,input:s,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function Ss(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Is(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function T(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Li(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function hR(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function v$(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function b$(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function gR(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return v$(e+r)}function yR(t){return b$(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function vR(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function bR(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var xm=class{constructor(...e){}};var _$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Di,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ts=v("$ZodError",_$),St=v("$ZodError",_$,{Parent:Error});function Ps(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}function zs(t,e=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)r._errors.push(e(s));else{let c=r,l=0;for(;l<a.length;){let u=a[l];l===a.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(e(s))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return i(t),r}function Em(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,d=0;for(;d<l.length;){let p=l[d],f=d===l.length-1;typeof p=="string"?(u.properties??(u.properties={}),(s=u.properties)[p]??(s[p]={errors:[]}),u=u.properties[p]):(u.items??(u.items=[]),(a=u.items)[p]??(a[p]={errors:[]}),u=u.items[p]),f&&u.errors.push(e(c)),d++}}};return i(t),r}function w$(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Om(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${w$(i.path)}`);return e.join(`
|
|
33
|
+
`)}var Zi=t=>(e,r,i,n)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new er;if(s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>mt(c,o,Ue())));throw Kc(a,n?.callee),a}return s.value},Ln=Zi(St),Fi=t=>async(e,r,i,n)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>mt(c,o,Ue())));throw Kc(a,n?.callee),a}return s.value},Zn=Fi(St),qi=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new er;return o.issues.length?{success:!1,error:new(t??Ts)(o.issues.map(s=>mt(s,n,Ue())))}:{success:!0,data:o.value}},sn=qi(St),Vi=t=>async(e,r,i)=>{let n=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>mt(s,n,Ue())))}:{success:!0,data:o.value}},an=Vi(St),Xc=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Zi(t)(e,r,n)},$$=Xc(St),Qc=t=>(e,r,i)=>Zi(t)(e,r,i),k$=Qc(St),el=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Fi(t)(e,r,n)},x$=el(St),tl=t=>async(e,r,i)=>Fi(t)(e,r,i),S$=tl(St),rl=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return qi(t)(e,r,n)},I$=rl(St),nl=t=>(e,r,i)=>qi(t)(e,r,i),T$=nl(St),il=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Vi(t)(e,r,n)},P$=il(St),ol=t=>async(e,r,i)=>Vi(t)(e,r,i),z$=ol(St);var It={};zr(It,{base64:()=>Km,base64url:()=>sl,bigint:()=>nh,boolean:()=>oh,browserEmail:()=>PR,cidrv4:()=>Gm,cidrv6:()=>Jm,cuid:()=>Nm,cuid2:()=>Mm,date:()=>Qm,datetime:()=>th,domain:()=>AR,duration:()=>Zm,e164:()=>Xm,email:()=>qm,emoji:()=>Vm,extendedDuration:()=>wR,guid:()=>Fm,hex:()=>RR,hostname:()=>CR,html5Email:()=>SR,httpProtocol:()=>Ym,idnEmail:()=>TR,integer:()=>ih,ipv4:()=>Hm,ipv6:()=>Wm,ksuid:()=>Um,lowercase:()=>ch,mac:()=>Bm,md5_base64:()=>OR,md5_base64url:()=>NR,md5_hex:()=>ER,nanoid:()=>Lm,null:()=>sh,number:()=>al,rfc5322Email:()=>IR,sha1_base64:()=>jR,sha1_base64url:()=>DR,sha1_hex:()=>MR,sha256_base64:()=>LR,sha256_base64url:()=>ZR,sha256_hex:()=>UR,sha384_base64:()=>qR,sha384_base64url:()=>VR,sha384_hex:()=>FR,sha512_base64:()=>WR,sha512_base64url:()=>BR,sha512_hex:()=>HR,string:()=>rh,time:()=>eh,ulid:()=>jm,undefined:()=>ah,unicodeEmail:()=>C$,uppercase:()=>lh,uuid:()=>Fn,uuid4:()=>$R,uuid6:()=>kR,uuid7:()=>xR,xid:()=>Dm});var Nm=/^[cC][0-9a-z]{6,}$/,Mm=/^[0-9a-z]+$/,jm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dm=/^[0-9a-vA-V]{20}$/,Um=/^[A-Za-z0-9]{27}$/,Lm=/^[a-zA-Z0-9_-]{21}$/,Zm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wR=/^[-+]?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)?)??$/,Fm=/^([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})$/,Fn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,$R=Fn(4),kR=Fn(6),xR=Fn(7),qm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,SR=/^[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])?)*$/,IR=/^(([^<>()\[\]\\.,;:\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,}))$/,C$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,TR=C$,PR=/^[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])?)*$/,zR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Vm(){return new RegExp(zR,"u")}var Hm=/^(?:(?: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])$/,Wm=/^(([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}|:))$/,Bm=t=>{let e=Ft(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Gm=/^((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])$/,Jm=/^(([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])$/,Km=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sl=/^[A-Za-z0-9_-]*$/,CR=/^(?=.{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])?)*\.?$/,AR=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ym=/^https?$/,Xm=/^\+[1-9]\d{6,14}$/,A$="(?:(?:\\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])))",Qm=new RegExp(`^${A$}$`);function R$(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eh(t){return new RegExp(`^${R$(t)}$`)}function th(t){let e=R$({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${A$}T(?:${i})$`)}var rh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},nh=/^-?\d+n?$/,ih=/^-?\d+$/,al=/^-?\d+(?:\.\d+)?$/,oh=/^(?:true|false)$/i,sh=/^null$/i;var ah=/^undefined$/i;var ch=/^[^A-Z]*$/,lh=/^[^a-z]*$/,RR=/^[0-9a-fA-F]*$/;function Cs(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function As(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var ER=/^[0-9a-fA-F]{32}$/,OR=Cs(22,"=="),NR=As(22),MR=/^[0-9a-fA-F]{40}$/,jR=Cs(27,"="),DR=As(27),UR=/^[0-9a-fA-F]{64}$/,LR=Cs(43,"="),ZR=As(43),FR=/^[0-9a-fA-F]{96}$/,qR=Cs(64,""),VR=As(64),HR=/^[0-9a-fA-F]{128}$/,WR=Cs(86,"=="),BR=As(86);var Se=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),O$={number:"number",bigint:"bigint",object:"date"},cl=v("$ZodCheckLessThan",(t,e)=>{Se.init(t,e);let r=O$[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ll=v("$ZodCheckGreaterThan",(t,e)=>{Se.init(t,e);let r=O$[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),uh=v("$ZodCheckMultipleOf",(t,e)=>{Se.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Sm(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),dh=v("$ZodCheckNumberFormat",(t,e)=>{Se.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=Cm[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=n,a.maximum=o,r&&(a.pattern=ih)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),ph=v("$ZodCheckBigIntFormat",(t,e)=>{Se.init(t,e);let[r,i]=Am[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),fh=v("$ZodCheckMaxSize",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Ss(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),mh=v("$ZodCheckMinSize",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Ss(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),hh=v("$ZodCheckSizeEquals",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:Ss(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),gh=v("$ZodCheckMaxLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let s=Is(n);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),yh=v("$ZodCheckMinLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let s=Is(n);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),vh=v("$ZodCheckLengthEquals",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!tn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let s=Is(n),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Hi=v("$ZodCheckStringFormat",(t,e)=>{var r,i;Se.init(t,e),t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),bh=v("$ZodCheckRegex",(t,e)=>{Hi.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),_h=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ch),Hi.init(t,e)}),wh=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=lh),Hi.init(t,e)}),$h=v("$ZodCheckIncludes",(t,e)=>{Se.init(t,e);let r=Ft(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),kh=v("$ZodCheckStartsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`^${Ft(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),xh=v("$ZodCheckEndsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`.*${Ft(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function E$(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues))}var Sh=v("$ZodCheckProperty",(t,e)=>{Se.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>E$(n,r,e.property));E$(i,r,e.property)}}),Ih=v("$ZodCheckMimeType",(t,e)=>{Se.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),Th=v("$ZodCheckOverwrite",(t,e)=>{Se.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var Rs=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
34
34
|
`).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(`
|
|
35
|
-
`))}};var Ph={major:4,minor:4,patch:3};var J=v("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ph;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let o of n._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(s,a,c)=>{let l=on(s),u;for(let d of a){if(d._zod.def.when){if(Am(s)||!d._zod.def.when(s))continue}else if(l)continue;let p=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new er;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(l||(l=on(s,p)))});else{if(s.issues.length===p)continue;l||(l=on(s,p))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(on(s))return s.aborted=!0,s;let l=n(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new er;return l.then(u=>t._zod.parse(u,c))}return t._zod.parse(l,c)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let l=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,s,a)):o(l,s,a)}let c=t._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new er;return c.then(l=>n(l,i,a))}return n(c,i,a)}}Q(t,"~standard",()=>({validate:n=>{try{let o=sn(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return an(t,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),cn=v("$ZodString",(t,e)=>{J.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??rh(t._zod.bag),t._zod.parse=(r,i)=>{if(e.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:t}),r}}),$e=v("$ZodStringFormat",(t,e)=>{Hi.init(t,e),cn.init(t,e)}),fl=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Fm),$e.init(t,e)}),ml=v("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Fn(i))}else e.pattern??(e.pattern=Fn());$e.init(t,e)}),hl=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=qm),$e.init(t,e)}),gl=v("$ZodURL",(t,e)=>{$e.init(t,e),t._zod.check=r=>{try{let i=r.value.trim();if(!e.normalize&&e.protocol?.source===Ym.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),yl=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Vm()),$e.init(t,e)}),vl=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Lm),$e.init(t,e)}),bl=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Nm),$e.init(t,e)}),_l=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Mm),$e.init(t,e)}),wl=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=jm),$e.init(t,e)}),$l=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Dm),$e.init(t,e)}),kl=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Um),$e.init(t,e)}),Ch=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=th(e)),$e.init(t,e)}),Rh=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Qm),$e.init(t,e)}),Ah=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=eh(e)),$e.init(t,e)}),Eh=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Zm),$e.init(t,e)}),xl=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Hm),$e.init(t,e),t._zod.bag.format="ipv4"}),Sl=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Wm),$e.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Il=v("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Bm(e.delimiter)),$e.init(t,e),t._zod.bag.format="mac"}),Tl=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Gm),$e.init(t,e)}),Pl=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Jm),$e.init(t,e),t._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 s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Oh(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var zl=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Km),$e.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Oh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function K$(t){if(!ol.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Oh(r)}var Cl=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ol),$e.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{K$(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Rl=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Xm),$e.init(t,e)});function Y$(t,e=null){try{let r=t.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||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var Al=v("$ZodJWT",(t,e)=>{$e.init(t,e),t._zod.check=r=>{Y$(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),El=v("$ZodCustomStringFormat",(t,e)=>{$e.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Es=v("$ZodNumber",(t,e)=>{J.init(t,e),t._zod.pattern=t._zod.bag.pattern??sl,t._zod.parse=(r,i)=>{if(e.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:t,...o?{received:o}:{}}),r}}),Ol=v("$ZodNumberFormat",(t,e)=>{dh.init(t,e),Es.init(t,e)}),Wi=v("$ZodBoolean",(t,e)=>{J.init(t,e),t._zod.pattern=oh,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),Os=v("$ZodBigInt",(t,e)=>{J.init(t,e),t._zod.pattern=nh,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),Nl=v("$ZodBigIntFormat",(t,e)=>{ph.init(t,e),Os.init(t,e)}),Ml=v("$ZodSymbol",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),jl=v("$ZodUndefined",(t,e)=>{J.init(t,e),t._zod.pattern=ah,t._zod.values=new Set([void 0]),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),Dl=v("$ZodNull",(t,e)=>{J.init(t,e),t._zod.pattern=sh,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),Ul=v("$ZodAny",(t,e)=>{J.init(t,e),t._zod.parse=r=>r}),Ll=v("$ZodUnknown",(t,e)=>{J.init(t,e),t._zod.parse=r=>r}),Zl=v("$ZodNever",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Fl=v("$ZodVoid",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),ql=v("$ZodDate",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{if(e.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:t}),r}});function M$(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues)),e.value[r]=t.value}var Vl=v("$ZodArray",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let a=n[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(l=>M$(l,r,s))):M$(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function pl(t,e,r,i,n,o){let s=r in i;if(t.issues.length){if(n&&o&&!s)return;e.issues.push(...xt(r,t.issues))}if(!s&&!n){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?s&&(e.value[r]=void 0):e.value[r]=t.value}function X$(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=zm(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Q$(t,e,r,i,n,o){let s=[],a=n.keySet,c=n.catchall._zod,l=c.def.type,u=c.optin==="optional",d=c.optout==="optional";for(let p in e){if(p==="__proto__"||a.has(p))continue;if(l==="never"){s.push(p);continue}let f=c.run({value:e[p],issues:[]},i);f instanceof Promise?t.push(f.then(m=>pl(m,r,p,e,u,d))):pl(f,r,p,e,u,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}var Hl=v("$ZodObject",(t,e)=>{if(J.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=Ui(()=>X$(e));Q(t._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let d of u.values)c[l].add(d)}}return c});let n=Un,o=e.catchall,s;t._zod.parse=(a,c)=>{s??(s=i.value);let l=a.value;if(!n(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};let u=[],d=s.shape;for(let p of s.keys){let f=d[p],m=f._zod.optin==="optional",h=f._zod.optout==="optional",y=f._zod.run({value:l[p],issues:[]},c);y instanceof Promise?u.push(y.then(_=>pl(_,a,p,l,m,h))):pl(y,a,p,l,m,h)}return o?Q$(u,l,a,c,i.value,t):u.length?Promise.all(u).then(()=>a):a}}),Nh=v("$ZodObjectJIT",(t,e)=>{Hl.init(t,e);let r=t._zod.parse,i=Ui(()=>X$(e)),n=p=>{let f=new As(["shape","payload","ctx"]),m=i.value,h=w=>{let $=Gc(w);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};f.write("const input = payload.value;");let y=Object.create(null),_=0;for(let w of m.keys)y[w]=`key_${_++}`;f.write("const newResult = {};");for(let w of m.keys){let $=y[w],S=Gc(w),G=p[w],q=G?._zod?.optin==="optional",I=G?._zod?.optout==="optional";f.write(`const ${$} = ${h(w)};`),q&&I?f.write(`
|
|
35
|
+
`))}};var Ph={major:4,minor:4,patch:3};var J=v("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ph;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let o of n._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(s,a,c)=>{let l=on(s),u;for(let d of a){if(d._zod.def.when){if(Rm(s)||!d._zod.def.when(s))continue}else if(l)continue;let p=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new er;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(l||(l=on(s,p)))});else{if(s.issues.length===p)continue;l||(l=on(s,p))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(on(s))return s.aborted=!0,s;let l=n(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new er;return l.then(u=>t._zod.parse(u,c))}return t._zod.parse(l,c)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let l=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,s,a)):o(l,s,a)}let c=t._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new er;return c.then(l=>n(l,i,a))}return n(c,i,a)}}Q(t,"~standard",()=>({validate:n=>{try{let o=sn(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return an(t,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),cn=v("$ZodString",(t,e)=>{J.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??rh(t._zod.bag),t._zod.parse=(r,i)=>{if(e.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:t}),r}}),$e=v("$ZodStringFormat",(t,e)=>{Hi.init(t,e),cn.init(t,e)}),ml=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Fm),$e.init(t,e)}),hl=v("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Fn(i))}else e.pattern??(e.pattern=Fn());$e.init(t,e)}),gl=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=qm),$e.init(t,e)}),yl=v("$ZodURL",(t,e)=>{$e.init(t,e),t._zod.check=r=>{try{let i=r.value.trim();if(!e.normalize&&e.protocol?.source===Ym.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),vl=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Vm()),$e.init(t,e)}),bl=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Lm),$e.init(t,e)}),_l=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Nm),$e.init(t,e)}),wl=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Mm),$e.init(t,e)}),$l=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=jm),$e.init(t,e)}),kl=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Dm),$e.init(t,e)}),xl=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Um),$e.init(t,e)}),Ch=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=th(e)),$e.init(t,e)}),Ah=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Qm),$e.init(t,e)}),Rh=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=eh(e)),$e.init(t,e)}),Eh=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Zm),$e.init(t,e)}),Sl=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Hm),$e.init(t,e),t._zod.bag.format="ipv4"}),Il=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Wm),$e.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Tl=v("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Bm(e.delimiter)),$e.init(t,e),t._zod.bag.format="mac"}),Pl=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Gm),$e.init(t,e)}),zl=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Jm),$e.init(t,e),t._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 s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Oh(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Cl=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Km),$e.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Oh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function K$(t){if(!sl.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Oh(r)}var Al=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=sl),$e.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{K$(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Rl=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Xm),$e.init(t,e)});function Y$(t,e=null){try{let r=t.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||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var El=v("$ZodJWT",(t,e)=>{$e.init(t,e),t._zod.check=r=>{Y$(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Ol=v("$ZodCustomStringFormat",(t,e)=>{$e.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Es=v("$ZodNumber",(t,e)=>{J.init(t,e),t._zod.pattern=t._zod.bag.pattern??al,t._zod.parse=(r,i)=>{if(e.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:t,...o?{received:o}:{}}),r}}),Nl=v("$ZodNumberFormat",(t,e)=>{dh.init(t,e),Es.init(t,e)}),Wi=v("$ZodBoolean",(t,e)=>{J.init(t,e),t._zod.pattern=oh,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),Os=v("$ZodBigInt",(t,e)=>{J.init(t,e),t._zod.pattern=nh,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),Ml=v("$ZodBigIntFormat",(t,e)=>{ph.init(t,e),Os.init(t,e)}),jl=v("$ZodSymbol",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),Dl=v("$ZodUndefined",(t,e)=>{J.init(t,e),t._zod.pattern=ah,t._zod.values=new Set([void 0]),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),Ul=v("$ZodNull",(t,e)=>{J.init(t,e),t._zod.pattern=sh,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),Ll=v("$ZodAny",(t,e)=>{J.init(t,e),t._zod.parse=r=>r}),Zl=v("$ZodUnknown",(t,e)=>{J.init(t,e),t._zod.parse=r=>r}),Fl=v("$ZodNever",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),ql=v("$ZodVoid",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),Vl=v("$ZodDate",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{if(e.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:t}),r}});function M$(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues)),e.value[r]=t.value}var Hl=v("$ZodArray",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let a=n[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(l=>M$(l,r,s))):M$(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function fl(t,e,r,i,n,o){let s=r in i;if(t.issues.length){if(n&&o&&!s)return;e.issues.push(...xt(r,t.issues))}if(!s&&!n){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?s&&(e.value[r]=void 0):e.value[r]=t.value}function X$(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=zm(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Q$(t,e,r,i,n,o){let s=[],a=n.keySet,c=n.catchall._zod,l=c.def.type,u=c.optin==="optional",d=c.optout==="optional";for(let p in e){if(p==="__proto__"||a.has(p))continue;if(l==="never"){s.push(p);continue}let f=c.run({value:e[p],issues:[]},i);f instanceof Promise?t.push(f.then(m=>fl(m,r,p,e,u,d))):fl(f,r,p,e,u,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}var Wl=v("$ZodObject",(t,e)=>{if(J.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=Ui(()=>X$(e));Q(t._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let d of u.values)c[l].add(d)}}return c});let n=Un,o=e.catchall,s;t._zod.parse=(a,c)=>{s??(s=i.value);let l=a.value;if(!n(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};let u=[],d=s.shape;for(let p of s.keys){let f=d[p],m=f._zod.optin==="optional",h=f._zod.optout==="optional",y=f._zod.run({value:l[p],issues:[]},c);y instanceof Promise?u.push(y.then(_=>fl(_,a,p,l,m,h))):fl(y,a,p,l,m,h)}return o?Q$(u,l,a,c,i.value,t):u.length?Promise.all(u).then(()=>a):a}}),Nh=v("$ZodObjectJIT",(t,e)=>{Wl.init(t,e);let r=t._zod.parse,i=Ui(()=>X$(e)),n=p=>{let f=new Rs(["shape","payload","ctx"]),m=i.value,h=w=>{let $=Jc(w);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};f.write("const input = payload.value;");let y=Object.create(null),_=0;for(let w of m.keys)y[w]=`key_${_++}`;f.write("const newResult = {};");for(let w of m.keys){let $=y[w],S=Jc(w),G=p[w],q=G?._zod?.optin==="optional",I=G?._zod?.optout==="optional";f.write(`const ${$} = ${h(w)};`),q&&I?f.write(`
|
|
36
36
|
if (${$}.issues.length) {
|
|
37
37
|
if (${S} in input) {
|
|
38
38
|
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
@@ -91,51 +91,51 @@ ${We("gray",d+qw.repeat(c+2)+kR)}
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let k=f.compile();return(w,$)=>k(p,w,$)},o,s=Un,a=!Dn.jitless,l=a&&Tm.value,u=e.catchall,d;t._zod.parse=(p,f)=>{d??(d=i.value);let m=p.value;return s(m)?a&&l&&f?.async===!1&&f.jitless!==!0?(o||(o=n(e.shape)),p=o(p,f),u?Q$([],m,p,f,d,t):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});function j$(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!on(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>mt(s,i,Ue())))}),e)}var Bi=v("$ZodUnion",(t,e)=>{J.init(t,e),Q(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Q(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Q(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Q(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>ks(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>j$(a,i,t,n)):j$(s,i,t,n)}});function D$(t,e,r,i){let n=t.filter(o=>o.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>mt(s,i,Ue())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Wl=v("$ZodXor",(t,e)=>{Bi.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>D$(a,i,t,n)):D$(s,i,t,n)}}),Bl=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Bi.init(t,e);let r=t._zod.parse;Q(t._zod,"propValues",()=>{let n={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){n[a]||(n[a]=new Set);for(let l of c)n[a].add(l)}}return n});let i=Ui(()=>{let n=e.options,o=new Map;for(let s of n){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});t._zod.parse=(n,o)=>{let s=n.value;if(!Un(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(n,o):e.unionFallback||o.direction==="backward"?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),n)}}),Gl=v("$ZodIntersection",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),s=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>U$(r,c,l)):U$(r,o,s)}});function zh(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(nn(t)&&nn(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};for(let o of i){let s=zh(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],s=zh(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function U$(t,e,r){let i=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else t.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&t.issues.push({...n,keys:o}),on(t))return t;let s=zh(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}var Ns=v("$ZodTuple",(t,e)=>{J.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=L$(r,"optin"),c=L$(r,"optout");if(!e.rest){if(o.length<a)return i.issues.push({code:"too_small",minimum:a,inclusive:!0,input:o,inst:t,origin:"array"}),i;o.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:t,origin:"array"})}let l=new Array(r.length);for(let u=0;u<r.length;u++){let d=r[u]._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(p=>{l[u]=p})):l[u]=d}if(e.rest){let u=r.length-1,d=o.slice(r.length);for(let p of d){u++;let f=e.rest._zod.run({value:p,issues:[]},n);f instanceof Promise?s.push(f.then(m=>Z$(m,i,u))):Z$(f,i,u)}}return s.length?Promise.all(s).then(()=>F$(l,i,r,o,c)):F$(l,i,r,o,c)}});function L$(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function Z$(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues)),e.value[r]=t.value}function F$(t,e,r,i,n){for(let o=0;o<r.length;o++){let s=t[o],a=o<i.length;if(s.issues.length){if(!a&&o>=n){e.value.length=o;break}e.issues.push(...xt(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(r[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}var Jl=v("$ZodRecord",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!nn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.keyType._zod.run({value:l,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>mt(f,i,Ue())),input:l,path:[l],inst:t});continue}let d=u.value,p=e.valueType._zod.run({value:n[l],issues:[]},i);p instanceof Promise?o.push(p.then(f=>{f.issues.length&&r.issues.push(...xt(l,f.issues)),r.value[d]=f.value})):(p.issues.length&&r.issues.push(...xt(l,p.issues)),r.value[d]=p.value)}let c;for(let l in n)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&sl.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>mt(d,i,Ue())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&r.issues.push(...xt(a,d.issues)),r.value[c.value]=d.value})):(u.issues.length&&r.issues.push(...xt(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Kl=v("$ZodMap",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of n){let c=e.keyType._zod.run({value:s,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,d])=>{q$(u,d,r,s,n,t,i)})):q$(c,l,r,s,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});function q$(t,e,r,i,n,o,s){t.issues.length&&(xs.has(typeof i)?r.issues.push(...xt(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(a=>mt(a,s,Ue()))})),e.issues.length&&(xs.has(typeof i)?r.issues.push(...xt(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(a=>mt(a,s,Ue()))})),r.value.set(t.value,e.value)}var Yl=v("$ZodSet",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>V$(c,r))):V$(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function V$(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var Xl=v("$ZodEnum",(t,e)=>{J.init(t,e);let r=$s(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>xs.has(typeof n)).map(n=>typeof n=="string"?Ft(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),Ql=v("$ZodLiteral",(t,e)=>{if(J.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ft(i):i?Ft(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),eu=v("$ZodFile",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),tu=v("$ZodTransform",(t,e)=>{J.init(t,e),t._zod.optin="optional",t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new er;return r.value=n,r.fallback=!0,r}});function H$(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Ms=v("$ZodOptional",(t,e)=>{J.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ks(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,o=e.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>H$(s,n)):H$(o,n)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),ru=v("$ZodExactOptional",(t,e)=>{Ms.init(t,e),Q(t._zod,"values",()=>e.innerType._zod.values),Q(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),nu=v("$ZodNullable",(t,e)=>{J.init(t,e),Q(t._zod,"optin",()=>e.innerType._zod.optin),Q(t._zod,"optout",()=>e.innerType._zod.optout),Q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ks(r.source)}|null)$`):void 0}),Q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),iu=v("$ZodDefault",(t,e)=>{J.init(t,e),t._zod.optin="optional",Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>W$(o,e)):W$(n,e)}});function W$(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ou=v("$ZodPrefault",(t,e)=>{J.init(t,e),t._zod.optin="optional",Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),su=v("$ZodNonOptional",(t,e)=>{J.init(t,e),Q(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>B$(o,t)):B$(n,t)}});function B$(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var au=v("$ZodSuccess",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en("ZodSuccess");let n=e.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)}}),cu=v("$ZodCatch",(t,e)=>{J.init(t,e),t._zod.optin="optional",Q(t._zod,"optout",()=>e.innerType._zod.optout),Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>mt(s,i,Ue()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(o=>mt(o,i,Ue()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),lu=v("$ZodNaN",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),js=v("$ZodPipe",(t,e)=>{J.init(t,e),Q(t._zod,"values",()=>e.in._zod.values),Q(t._zod,"optin",()=>e.in._zod.optin),Q(t._zod,"optout",()=>e.out._zod.optout),Q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>ll(s,e.in,i)):ll(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>ll(o,e.out,i)):ll(n,e.out,i)}});function ll(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var Gi=v("$ZodCodec",(t,e)=>{J.init(t,e),Q(t._zod,"values",()=>e.in._zod.values),Q(t._zod,"optin",()=>e.in._zod.optin),Q(t._zod,"optout",()=>e.out._zod.optout),Q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>ul(s,e,i)):ul(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>ul(s,e,i)):ul(o,e,i)}}});function ul(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>dl(t,o,e.out,r)):dl(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>dl(t,o,e.in,r)):dl(t,n,e.in,r)}}function dl(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}var Mh=v("$ZodPreprocess",(t,e)=>{js.init(t,e)}),uu=v("$ZodReadonly",(t,e)=>{J.init(t,e),Q(t._zod,"propValues",()=>e.innerType._zod.propValues),Q(t._zod,"values",()=>e.innerType._zod.values),Q(t._zod,"optin",()=>e.innerType?._zod?.optin),Q(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(G$):G$(n)}});function G$(t){return t.value=Object.freeze(t.value),t}var du=v("$ZodTemplateLiteral",(t,e)=>{J.init(t,e);let r=[];for(let i of e.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,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||Pm.has(typeof i))r.push(Ft(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),pu=v("$ZodFunction",(t,e)=>(J.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?Ln(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?Ln(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await Zn(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await Zn(t._def.output,o):o}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Ns({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),fu=v("$ZodPromise",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),mu=v("$ZodLazy",(t,e)=>{J.init(t,e),Q(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Q(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Q(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Q(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Q(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),hu=v("$ZodCustom",(t,e)=>{Se.init(t,e),J.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>J$(o,r,i,t));J$(n,r,i,t)}});function J$(t,e,r,i){if(!t){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),e.issues.push(Li(n))}}var Ki={};zr(Ki,{ar:()=>ek,az:()=>tk,be:()=>nk,bg:()=>ik,ca:()=>ok,cs:()=>sk,da:()=>ak,de:()=>ck,el:()=>lk,en:()=>gu,eo:()=>uk,es:()=>dk,fa:()=>pk,fi:()=>fk,fr:()=>mk,frCA:()=>hk,he:()=>gk,hr:()=>yk,hu:()=>vk,hy:()=>_k,id:()=>wk,is:()=>$k,it:()=>kk,ja:()=>xk,ka:()=>Sk,kh:()=>Ik,km:()=>yu,ko:()=>Tk,lt:()=>zk,mk:()=>Ck,ms:()=>Rk,nl:()=>Ak,no:()=>Ek,ota:()=>Ok,pl:()=>Mk,ps:()=>Nk,pt:()=>jk,ro:()=>Dk,ru:()=>Lk,sl:()=>Zk,sv:()=>Fk,ta:()=>qk,th:()=>Vk,tr:()=>Hk,ua:()=>Wk,uk:()=>vu,ur:()=>Bk,uz:()=>Gk,vi:()=>Jk,yo:()=>Xk,zhCN:()=>Kk,zhTW:()=>Yk});var GA=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${x(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: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${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":""}: ${b(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 ek(){return{localeError:GA()}}var JA=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${x(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 tk(){return{localeError:JA()}}function rk(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var KA=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=rk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${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?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=rk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${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"}: ${b(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 nk(){return{localeError:KA()}}var YA=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${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 s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${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":""}: ${b(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 ik(){return{localeError:YA()}}var XA=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${x(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.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",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.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":""}: ${b(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 ok(){return{localeError:XA()}}var QA=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${x(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.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: ${b(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 sk(){return{localeError:QA()}}var eE=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${x(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} 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"}: ${b(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 ak(){return{localeError:eE()}}var tE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${x(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.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"}: ${b(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 ck(){return{localeError:tE()}}var rE=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(n){return t[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${x(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${b(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function lk(){return{localeError:rE()}}var nE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${x(n.values[0])}`:`Invalid option: expected one of ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.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":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function gu(){return{localeError:nE()}}var iE=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${x(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 uk(){return{localeError:iE()}}var oE=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${x(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} 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":""}: ${b(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 dk(){return{localeError:oE()}}var sE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${x(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 ${b(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.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: ${b(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 pk(){return{localeError:sE()}}var aE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${x(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.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"}: ${b(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 fk(){return{localeError:aE()}}var cE=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[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={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${x(n.values[0])} attendu`:`Option invalide : une valeur parmi ${b(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${i[n.origin]??"valeur"} 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":""} : ${b(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 mk(){return{localeError:cE()}}var lE=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${x(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.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":""} : ${b(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 hk(){return{localeError:lE()}}var uE=()=>{let t={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"}},e={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=l=>l?t[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??t.unknown.label},n=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??i(u),p=T(l.input),f=c[p]??t[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.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 ${x(l.values[0])}`;let u=l.values.map(f=>x(f));if(l.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let y=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(l.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(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function gk(){return{localeError:uE()}}var dE=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(n){return t[n]??null}let r={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${x(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${n.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${n.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${r[o.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${b(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function yk(){return{localeError:dE()}}var pE=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${x(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 vk(){return{localeError:pE()}}function bk(t,e,r){return Math.abs(t)===1?e:r}function Ji(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var fE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=bk(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ji(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 ${Ji(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=bk(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ji(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 ${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":""}. ${b(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 _k(){return{localeError:fE()}}var mE=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${x(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 wk(){return{localeError:mE()}}var hE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${x(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.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"}: ${b(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 $k(){return{localeError:hE()}}var gE=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${x(n.values[0])}`:`Opzione non valida: atteso uno tra ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.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}`:`Input non valido: ${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"}: ${b(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:gE()}}var yE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${x(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(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",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.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",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.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":""}: ${b(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 xk(){return{localeError:yE()}}var vE=()=>{let t={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 e(n){return t[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 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\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:"\u10D5\u10D4\u10DA\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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${x(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 ${b(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\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 \u10D5\u10D4\u10DA\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 \u10D5\u10D4\u10DA\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 \u10D5\u10D4\u10DA\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"}: ${b(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 Sk(){return{localeError:vE()}}var bE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.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 ${b(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 yu(){return{localeError:bE()}}function Ik(){return yu()}var _E=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${x(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}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: ${b(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 Tk(){return{localeError:_E()}}var Ds=t=>t.charAt(0).toUpperCase()+t.slice(1);function Pk(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var wE=()=>{let t={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 e(n,o,s,a){let c=t[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${x(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=e(n.origin,Pk(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Ds(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ds(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=e(n.origin,Pk(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Ds(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ds(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.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"}: ${b(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`${Ds(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function zk(){return{localeError:wE()}}var $E=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${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"}: ${b(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 Ck(){return{localeError:$E()}}var kE=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${x(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.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: ${b(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 Rk(){return{localeError:kE()}}var xE=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${x(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: 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":""}: ${b(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 Ak(){return{localeError:xE()}}var SE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${x(n.values[0])}`:`Ugyldig valg: forventet en av ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Ek(){return{localeError:SE()}}var IE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${x(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 Ok(){return{localeError:IE()}}var TE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${x(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Nk(){return{localeError:TE()}}var PE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${x(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 Mk(){return{localeError:PE()}}var zE=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${x(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 jk(){return{localeError:zE()}}var CE=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(n){return t[n]??null}let r={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${x(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${r[o.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${b(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function Dk(){return{localeError:CE()}}function Uk(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var RE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=Uk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${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?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=Uk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${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":""}: ${b(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 Lk(){return{localeError:RE()}}var AE=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${x(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Zk(){return{localeError:AE()}}var EE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${x(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Fk(){return{localeError:EE()}}var OE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${x(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 ${b(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${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?">=":">",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${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":""}: ${b(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 qk(){return{localeError:OE()}}var NE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${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",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${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: ${b(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 Vk(){return{localeError:NE()}}var ME=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${x(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 Hk(){return{localeError:ME()}}var jE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${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":""}: ${b(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 vu(){return{localeError:jE()}}function Wk(){return vu()}var DE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${x(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(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?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${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":""}: ${b(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 Bk(){return{localeError:DE()}}var UE=()=>{let t={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"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${x(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.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":""}: ${b(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 Gk(){return{localeError:UE()}}var LE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.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: ${b(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 Jk(){return{localeError:LE()}}var ZE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${x(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.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): ${b(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 Kk(){return{localeError:ZE()}}var FE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${x(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.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${b(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 Yk(){return{localeError:FE()}}var qE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${x(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.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?">=":">",s=e(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.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: ${b(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 Xk(){return{localeError:qE()}}var Qk,jh=Symbol("ZodOutput"),Dh=Symbol("ZodInput"),bu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function _u(){return new bu}(Qk=globalThis).__zod_globalRegistry??(Qk.__zod_globalRegistry=_u());var Qe=globalThis.__zod_globalRegistry;function wu(t,e){return new t({type:"string",...R(e)})}function Uh(t,e){return new t({type:"string",coerce:!0,...R(e)})}function Us(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...R(e)})}function Yi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...R(e)})}function Ls(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}function Zs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}function Fs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}function qs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}function Xi(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...R(e)})}function Vs(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...R(e)})}function Hs(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}function Ws(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}function Bs(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}function Gs(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}function Js(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}function Ks(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}function Ys(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}function Xs(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}function $u(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...R(e)})}function Qs(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}function ea(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}function ta(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...R(e)})}function ra(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...R(e)})}function na(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}function ia(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}var Lh={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Zh(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(e)})}function Fh(t,e){return new t({type:"string",format:"date",check:"string_format",...R(e)})}function qh(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}function Vh(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}function ku(t,e){return new t({type:"number",checks:[],...R(e)})}function Hh(t,e){return new t({type:"number",coerce:!0,checks:[],...R(e)})}function xu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}function Su(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...R(e)})}function Iu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...R(e)})}function Tu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...R(e)})}function Pu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...R(e)})}function zu(t,e){return new t({type:"boolean",...R(e)})}function Wh(t,e){return new t({type:"boolean",coerce:!0,...R(e)})}function Cu(t,e){return new t({type:"bigint",...R(e)})}function Bh(t,e){return new t({type:"bigint",coerce:!0,...R(e)})}function Ru(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...R(e)})}function Au(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...R(e)})}function Eu(t,e){return new t({type:"symbol",...R(e)})}function Ou(t,e){return new t({type:"undefined",...R(e)})}function Nu(t,e){return new t({type:"null",...R(e)})}function Mu(t){return new t({type:"any"})}function ju(t){return new t({type:"unknown"})}function Du(t,e){return new t({type:"never",...R(e)})}function Uu(t,e){return new t({type:"void",...R(e)})}function Lu(t,e){return new t({type:"date",...R(e)})}function Gh(t,e){return new t({type:"date",coerce:!0,...R(e)})}function Zu(t,e){return new t({type:"nan",...R(e)})}function hr(t,e){return new al({check:"less_than",...R(e),value:t,inclusive:!1})}function Dt(t,e){return new al({check:"less_than",...R(e),value:t,inclusive:!0})}function gr(t,e){return new cl({check:"greater_than",...R(e),value:t,inclusive:!1})}function ht(t,e){return new cl({check:"greater_than",...R(e),value:t,inclusive:!0})}function Fu(t){return gr(0,t)}function qu(t){return hr(0,t)}function Vu(t){return Dt(0,t)}function Hu(t){return ht(0,t)}function ln(t,e){return new uh({check:"multiple_of",...R(e),value:t})}function un(t,e){return new fh({check:"max_size",...R(e),maximum:t})}function yr(t,e){return new mh({check:"min_size",...R(e),minimum:t})}function qn(t,e){return new hh({check:"size_equals",...R(e),size:t})}function Vn(t,e){return new gh({check:"max_length",...R(e),maximum:t})}function Mr(t,e){return new yh({check:"min_length",...R(e),minimum:t})}function Hn(t,e){return new vh({check:"length_equals",...R(e),length:t})}function Qi(t,e){return new bh({check:"string_format",format:"regex",...R(e),pattern:t})}function eo(t){return new _h({check:"string_format",format:"lowercase",...R(t)})}function to(t){return new wh({check:"string_format",format:"uppercase",...R(t)})}function ro(t,e){return new $h({check:"string_format",format:"includes",...R(e),includes:t})}function no(t,e){return new kh({check:"string_format",format:"starts_with",...R(e),prefix:t})}function io(t,e){return new xh({check:"string_format",format:"ends_with",...R(e),suffix:t})}function Wu(t,e,r){return new Sh({check:"property",property:t,schema:e,...R(r)})}function oo(t,e){return new Ih({check:"mime_type",mime:t,...R(e)})}function tr(t){return new Th({check:"overwrite",tx:t})}function so(t){return tr(e=>e.normalize(t))}function ao(){return tr(t=>t.trim())}function co(){return tr(t=>t.toLowerCase())}function lo(){return tr(t=>t.toUpperCase())}function uo(){return tr(t=>Im(t))}function Jh(t,e,r){return new t({type:"array",element:e,...R(r)})}function HE(t,e,r){return new t({type:"union",options:e,...R(r)})}function WE(t,e,r){return new t({type:"union",options:e,inclusive:!1,...R(r)})}function BE(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...R(i)})}function GE(t,e,r){return new t({type:"intersection",left:e,right:r})}function JE(t,e,r,i){let n=r instanceof J,o=n?i:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...R(o)})}function KE(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...R(i)})}function YE(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...R(i)})}function XE(t,e,r){return new t({type:"set",valueType:e,...R(r)})}function QE(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...R(r)})}function e1(t,e,r){return new t({type:"enum",entries:e,...R(r)})}function t1(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...R(r)})}function Bu(t,e){return new t({type:"file",...R(e)})}function r1(t,e){return new t({type:"transform",transform:e})}function n1(t,e){return new t({type:"optional",innerType:e})}function i1(t,e){return new t({type:"nullable",innerType:e})}function o1(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Kc(r)}})}function s1(t,e,r){return new t({type:"nonoptional",innerType:e,...R(r)})}function a1(t,e){return new t({type:"success",innerType:e})}function c1(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function l1(t,e,r){return new t({type:"pipe",in:e,out:r})}function u1(t,e){return new t({type:"readonly",innerType:e})}function d1(t,e,r){return new t({type:"template_literal",parts:e,...R(r)})}function p1(t,e){return new t({type:"lazy",getter:e})}function f1(t,e){return new t({type:"promise",innerType:e})}function Gu(t,e,r){let i=R(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Ju(t,e,r){return new t({type:"custom",check:"custom",fn:e,...R(r)})}function Ku(t,e){let r=ex(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(Li(n,i.value,r._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Li(o))}},t(i.value,i)),e);return r}function ex(t,e){let r=new Se({check:"custom",...R(e)});return r._zod.check=t,r}function Yu(t){let e=new Se({check:"describe"});return e._zod.onattach=[r=>{let i=Qe.get(r)??{};Qe.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function Xu(t){let e=new Se({check:"meta"});return e._zod.onattach=[r=>{let i=Qe.get(r)??{};Qe.add(r,{...i,...t})}],e._zod.check=()=>{},e}function Qu(t,e){let r=R(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(n),a=t.Codec??Gi,c=t.Boolean??Wi,l=t.String??cn,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:u,out:d,transform:(f,m)=>{let h=f;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})},reverseTransform:(f,m)=>f===!0?i[0]||"true":n[0]||"false",error:r.error});return p}function Wn(t,e,r,i={}){let n=R(i),o={...R(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}function dn(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Qe,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function be(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,u);else{let p=s.schema,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(t,e,p,u)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),be(d,e,u),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&>(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function pn(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let n=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,p=t.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${t.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=n(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
94
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let k=f.compile();return(w,$)=>k(p,w,$)},o,s=Un,a=!Dn.jitless,l=a&&Tm.value,u=e.catchall,d;t._zod.parse=(p,f)=>{d??(d=i.value);let m=p.value;return s(m)?a&&l&&f?.async===!1&&f.jitless!==!0?(o||(o=n(e.shape)),p=o(p,f),u?Q$([],m,p,f,d,t):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});function j$(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!on(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>mt(s,i,Ue())))}),e)}var Bi=v("$ZodUnion",(t,e)=>{J.init(t,e),Q(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Q(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Q(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Q(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>ks(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>j$(a,i,t,n)):j$(s,i,t,n)}});function D$(t,e,r,i){let n=t.filter(o=>o.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>mt(s,i,Ue())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Bl=v("$ZodXor",(t,e)=>{Bi.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>D$(a,i,t,n)):D$(s,i,t,n)}}),Gl=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Bi.init(t,e);let r=t._zod.parse;Q(t._zod,"propValues",()=>{let n={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){n[a]||(n[a]=new Set);for(let l of c)n[a].add(l)}}return n});let i=Ui(()=>{let n=e.options,o=new Map;for(let s of n){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});t._zod.parse=(n,o)=>{let s=n.value;if(!Un(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(n,o):e.unionFallback||o.direction==="backward"?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),n)}}),Jl=v("$ZodIntersection",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),s=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>U$(r,c,l)):U$(r,o,s)}});function zh(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(nn(t)&&nn(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};for(let o of i){let s=zh(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],s=zh(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function U$(t,e,r){let i=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else t.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&t.issues.push({...n,keys:o}),on(t))return t;let s=zh(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}var Ns=v("$ZodTuple",(t,e)=>{J.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=L$(r,"optin"),c=L$(r,"optout");if(!e.rest){if(o.length<a)return i.issues.push({code:"too_small",minimum:a,inclusive:!0,input:o,inst:t,origin:"array"}),i;o.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:t,origin:"array"})}let l=new Array(r.length);for(let u=0;u<r.length;u++){let d=r[u]._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(p=>{l[u]=p})):l[u]=d}if(e.rest){let u=r.length-1,d=o.slice(r.length);for(let p of d){u++;let f=e.rest._zod.run({value:p,issues:[]},n);f instanceof Promise?s.push(f.then(m=>Z$(m,i,u))):Z$(f,i,u)}}return s.length?Promise.all(s).then(()=>F$(l,i,r,o,c)):F$(l,i,r,o,c)}});function L$(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function Z$(t,e,r){t.issues.length&&e.issues.push(...xt(r,t.issues)),e.value[r]=t.value}function F$(t,e,r,i,n){for(let o=0;o<r.length;o++){let s=t[o],a=o<i.length;if(s.issues.length){if(!a&&o>=n){e.value.length=o;break}e.issues.push(...xt(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(r[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}var Kl=v("$ZodRecord",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!nn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.keyType._zod.run({value:l,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>mt(f,i,Ue())),input:l,path:[l],inst:t});continue}let d=u.value,p=e.valueType._zod.run({value:n[l],issues:[]},i);p instanceof Promise?o.push(p.then(f=>{f.issues.length&&r.issues.push(...xt(l,f.issues)),r.value[d]=f.value})):(p.issues.length&&r.issues.push(...xt(l,p.issues)),r.value[d]=p.value)}let c;for(let l in n)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&al.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>mt(d,i,Ue())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&r.issues.push(...xt(a,d.issues)),r.value[c.value]=d.value})):(u.issues.length&&r.issues.push(...xt(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Yl=v("$ZodMap",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of n){let c=e.keyType._zod.run({value:s,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,d])=>{q$(u,d,r,s,n,t,i)})):q$(c,l,r,s,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});function q$(t,e,r,i,n,o,s){t.issues.length&&(xs.has(typeof i)?r.issues.push(...xt(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(a=>mt(a,s,Ue()))})),e.issues.length&&(xs.has(typeof i)?r.issues.push(...xt(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(a=>mt(a,s,Ue()))})),r.value.set(t.value,e.value)}var Xl=v("$ZodSet",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>V$(c,r))):V$(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function V$(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var Ql=v("$ZodEnum",(t,e)=>{J.init(t,e);let r=$s(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>xs.has(typeof n)).map(n=>typeof n=="string"?Ft(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),eu=v("$ZodLiteral",(t,e)=>{if(J.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ft(i):i?Ft(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),tu=v("$ZodFile",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),ru=v("$ZodTransform",(t,e)=>{J.init(t,e),t._zod.optin="optional",t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new er;return r.value=n,r.fallback=!0,r}});function H$(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Ms=v("$ZodOptional",(t,e)=>{J.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ks(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,o=e.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>H$(s,n)):H$(o,n)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),nu=v("$ZodExactOptional",(t,e)=>{Ms.init(t,e),Q(t._zod,"values",()=>e.innerType._zod.values),Q(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),iu=v("$ZodNullable",(t,e)=>{J.init(t,e),Q(t._zod,"optin",()=>e.innerType._zod.optin),Q(t._zod,"optout",()=>e.innerType._zod.optout),Q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ks(r.source)}|null)$`):void 0}),Q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),ou=v("$ZodDefault",(t,e)=>{J.init(t,e),t._zod.optin="optional",Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>W$(o,e)):W$(n,e)}});function W$(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var su=v("$ZodPrefault",(t,e)=>{J.init(t,e),t._zod.optin="optional",Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),au=v("$ZodNonOptional",(t,e)=>{J.init(t,e),Q(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>B$(o,t)):B$(n,t)}});function B$(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var cu=v("$ZodSuccess",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en("ZodSuccess");let n=e.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)}}),lu=v("$ZodCatch",(t,e)=>{J.init(t,e),t._zod.optin="optional",Q(t._zod,"optout",()=>e.innerType._zod.optout),Q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>mt(s,i,Ue()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(o=>mt(o,i,Ue()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),uu=v("$ZodNaN",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),js=v("$ZodPipe",(t,e)=>{J.init(t,e),Q(t._zod,"values",()=>e.in._zod.values),Q(t._zod,"optin",()=>e.in._zod.optin),Q(t._zod,"optout",()=>e.out._zod.optout),Q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>ul(s,e.in,i)):ul(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>ul(o,e.out,i)):ul(n,e.out,i)}});function ul(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var Gi=v("$ZodCodec",(t,e)=>{J.init(t,e),Q(t._zod,"values",()=>e.in._zod.values),Q(t._zod,"optin",()=>e.in._zod.optin),Q(t._zod,"optout",()=>e.out._zod.optout),Q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>dl(s,e,i)):dl(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>dl(s,e,i)):dl(o,e,i)}}});function dl(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>pl(t,o,e.out,r)):pl(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>pl(t,o,e.in,r)):pl(t,n,e.in,r)}}function pl(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}var Mh=v("$ZodPreprocess",(t,e)=>{js.init(t,e)}),du=v("$ZodReadonly",(t,e)=>{J.init(t,e),Q(t._zod,"propValues",()=>e.innerType._zod.propValues),Q(t._zod,"values",()=>e.innerType._zod.values),Q(t._zod,"optin",()=>e.innerType?._zod?.optin),Q(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(G$):G$(n)}});function G$(t){return t.value=Object.freeze(t.value),t}var pu=v("$ZodTemplateLiteral",(t,e)=>{J.init(t,e);let r=[];for(let i of e.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,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||Pm.has(typeof i))r.push(Ft(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),fu=v("$ZodFunction",(t,e)=>(J.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?Ln(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?Ln(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await Zn(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await Zn(t._def.output,o):o}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Ns({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),mu=v("$ZodPromise",(t,e)=>{J.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),hu=v("$ZodLazy",(t,e)=>{J.init(t,e),Q(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Q(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Q(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Q(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Q(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),gu=v("$ZodCustom",(t,e)=>{Se.init(t,e),J.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>J$(o,r,i,t));J$(n,r,i,t)}});function J$(t,e,r,i){if(!t){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),e.issues.push(Li(n))}}var Ki={};zr(Ki,{ar:()=>ek,az:()=>tk,be:()=>nk,bg:()=>ik,ca:()=>ok,cs:()=>sk,da:()=>ak,de:()=>ck,el:()=>lk,en:()=>yu,eo:()=>uk,es:()=>dk,fa:()=>pk,fi:()=>fk,fr:()=>mk,frCA:()=>hk,he:()=>gk,hr:()=>yk,hu:()=>vk,hy:()=>_k,id:()=>wk,is:()=>$k,it:()=>kk,ja:()=>xk,ka:()=>Sk,kh:()=>Ik,km:()=>vu,ko:()=>Tk,lt:()=>zk,mk:()=>Ck,ms:()=>Ak,nl:()=>Rk,no:()=>Ek,ota:()=>Ok,pl:()=>Mk,ps:()=>Nk,pt:()=>jk,ro:()=>Dk,ru:()=>Lk,sl:()=>Zk,sv:()=>Fk,ta:()=>qk,th:()=>Vk,tr:()=>Hk,ua:()=>Wk,uk:()=>bu,ur:()=>Bk,uz:()=>Gk,vi:()=>Jk,yo:()=>Xk,zhCN:()=>Kk,zhTW:()=>Yk});var JR=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${x(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: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${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":""}: ${b(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 ek(){return{localeError:JR()}}var KR=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${x(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 tk(){return{localeError:KR()}}function rk(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var YR=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=rk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${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?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=rk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${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"}: ${b(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 nk(){return{localeError:YR()}}var XR=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${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 s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${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":""}: ${b(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 ik(){return{localeError:XR()}}var QR=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${x(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.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",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.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":""}: ${b(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 ok(){return{localeError:QR()}}var eE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${x(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.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: ${b(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 sk(){return{localeError:eE()}}var tE=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${x(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} 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"}: ${b(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 ak(){return{localeError:tE()}}var rE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${x(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.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"}: ${b(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 ck(){return{localeError:rE()}}var nE=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(n){return t[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${x(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${b(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function lk(){return{localeError:nE()}}var iE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${x(n.values[0])}`:`Invalid option: expected one of ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.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":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function yu(){return{localeError:iE()}}var oE=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${x(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 uk(){return{localeError:oE()}}var sE=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${x(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} 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":""}: ${b(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 dk(){return{localeError:sE()}}var aE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${x(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 ${b(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.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: ${b(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 pk(){return{localeError:aE()}}var cE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${x(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.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"}: ${b(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 fk(){return{localeError:cE()}}var lE=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[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={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${x(n.values[0])} attendu`:`Option invalide : une valeur parmi ${b(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${i[n.origin]??"valeur"} 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":""} : ${b(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 mk(){return{localeError:lE()}}var uE=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${x(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.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":""} : ${b(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 hk(){return{localeError:uE()}}var dE=()=>{let t={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"}},e={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=l=>l?t[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??t.unknown.label},n=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??i(u),p=T(l.input),f=c[p]??t[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.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 ${x(l.values[0])}`;let u=l.values.map(f=>x(f));if(l.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let y=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(l.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(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function gk(){return{localeError:dE()}}var pE=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(n){return t[n]??null}let r={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${x(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${n.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${n.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${r[o.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${b(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function yk(){return{localeError:pE()}}var fE=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${x(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 vk(){return{localeError:fE()}}function bk(t,e,r){return Math.abs(t)===1?e:r}function Ji(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var mE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=bk(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ji(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 ${Ji(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=bk(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ji(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 ${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":""}. ${b(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 _k(){return{localeError:mE()}}var hE=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${x(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 wk(){return{localeError:hE()}}var gE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${x(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.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"}: ${b(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 $k(){return{localeError:gE()}}var yE=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${x(n.values[0])}`:`Opzione non valida: atteso uno tra ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.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}`:`Input non valido: ${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"}: ${b(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:yE()}}var vE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${x(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(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",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.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",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.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":""}: ${b(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 xk(){return{localeError:vE()}}var bE=()=>{let t={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 e(n){return t[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 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\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:"\u10D5\u10D4\u10DA\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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${x(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 ${b(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\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 \u10D5\u10D4\u10DA\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 \u10D5\u10D4\u10DA\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 \u10D5\u10D4\u10DA\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"}: ${b(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 Sk(){return{localeError:bE()}}var _E=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.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 ${b(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 vu(){return{localeError:_E()}}function Ik(){return vu()}var wE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${x(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}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: ${b(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 Tk(){return{localeError:wE()}}var Ds=t=>t.charAt(0).toUpperCase()+t.slice(1);function Pk(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var $E=()=>{let t={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 e(n,o,s,a){let c=t[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${x(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=e(n.origin,Pk(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Ds(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ds(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=e(n.origin,Pk(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Ds(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ds(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.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"}: ${b(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`${Ds(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function zk(){return{localeError:$E()}}var kE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${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"}: ${b(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 Ck(){return{localeError:kE()}}var xE=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${x(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.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: ${b(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 Ak(){return{localeError:xE()}}var SE=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${x(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: 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":""}: ${b(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 Rk(){return{localeError:SE()}}var IE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${x(n.values[0])}`:`Ugyldig valg: forventet en av ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Ek(){return{localeError:IE()}}var TE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${x(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 Ok(){return{localeError:TE()}}var PE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${x(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Nk(){return{localeError:PE()}}var zE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${x(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 Mk(){return{localeError:zE()}}var CE=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${x(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 jk(){return{localeError:CE()}}var AE=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(n){return t[n]??null}let r={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=T(n.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${x(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${r[o.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${b(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function Dk(){return{localeError:AE()}}function Uk(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var RE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=Uk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${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?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=Uk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${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":""}: ${b(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 Lk(){return{localeError:RE()}}var EE=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${x(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Zk(){return{localeError:EE()}}var OE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${x(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.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"}: ${b(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 Fk(){return{localeError:OE()}}var NE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${x(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 ${b(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${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?">=":">",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${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":""}: ${b(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 qk(){return{localeError:NE()}}var ME=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${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",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${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: ${b(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 Vk(){return{localeError:ME()}}var jE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${x(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.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":""}: ${b(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 Hk(){return{localeError:jE()}}var DE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${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":""}: ${b(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 bu(){return{localeError:DE()}}function Wk(){return bu()}var UE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${x(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(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?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${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":""}: ${b(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 Bk(){return{localeError:UE()}}var LE=()=>{let t={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"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${x(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.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":""}: ${b(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 Gk(){return{localeError:LE()}}var ZE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${x(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 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.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: ${b(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 Jk(){return{localeError:ZE()}}var FE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${x(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.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): ${b(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 Kk(){return{localeError:FE()}}var qE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${x(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.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?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.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${b(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 Yk(){return{localeError:qE()}}var VE=()=>{let t={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 e(n){return t[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,s=T(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${x(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.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?">=":">",s=e(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.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: ${b(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 Xk(){return{localeError:VE()}}var Qk,jh=Symbol("ZodOutput"),Dh=Symbol("ZodInput"),_u=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function wu(){return new _u}(Qk=globalThis).__zod_globalRegistry??(Qk.__zod_globalRegistry=wu());var Qe=globalThis.__zod_globalRegistry;function $u(t,e){return new t({type:"string",...A(e)})}function Uh(t,e){return new t({type:"string",coerce:!0,...A(e)})}function Us(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...A(e)})}function Yi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...A(e)})}function Ls(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...A(e)})}function Zs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(e)})}function Fs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(e)})}function qs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(e)})}function Xi(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...A(e)})}function Vs(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...A(e)})}function Hs(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(e)})}function Ws(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...A(e)})}function Bs(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(e)})}function Gs(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...A(e)})}function Js(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...A(e)})}function Ks(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(e)})}function Ys(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(e)})}function Xs(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(e)})}function ku(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...A(e)})}function Qs(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(e)})}function ea(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(e)})}function ta(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...A(e)})}function ra(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...A(e)})}function na(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...A(e)})}function ia(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...A(e)})}var Lh={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Zh(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(e)})}function Fh(t,e){return new t({type:"string",format:"date",check:"string_format",...A(e)})}function qh(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...A(e)})}function Vh(t,e){return new t({type:"string",format:"duration",check:"string_format",...A(e)})}function xu(t,e){return new t({type:"number",checks:[],...A(e)})}function Hh(t,e){return new t({type:"number",coerce:!0,checks:[],...A(e)})}function Su(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...A(e)})}function Iu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...A(e)})}function Tu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...A(e)})}function Pu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...A(e)})}function zu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...A(e)})}function Cu(t,e){return new t({type:"boolean",...A(e)})}function Wh(t,e){return new t({type:"boolean",coerce:!0,...A(e)})}function Au(t,e){return new t({type:"bigint",...A(e)})}function Bh(t,e){return new t({type:"bigint",coerce:!0,...A(e)})}function Ru(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...A(e)})}function Eu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...A(e)})}function Ou(t,e){return new t({type:"symbol",...A(e)})}function Nu(t,e){return new t({type:"undefined",...A(e)})}function Mu(t,e){return new t({type:"null",...A(e)})}function ju(t){return new t({type:"any"})}function Du(t){return new t({type:"unknown"})}function Uu(t,e){return new t({type:"never",...A(e)})}function Lu(t,e){return new t({type:"void",...A(e)})}function Zu(t,e){return new t({type:"date",...A(e)})}function Gh(t,e){return new t({type:"date",coerce:!0,...A(e)})}function Fu(t,e){return new t({type:"nan",...A(e)})}function hr(t,e){return new cl({check:"less_than",...A(e),value:t,inclusive:!1})}function Dt(t,e){return new cl({check:"less_than",...A(e),value:t,inclusive:!0})}function gr(t,e){return new ll({check:"greater_than",...A(e),value:t,inclusive:!1})}function ht(t,e){return new ll({check:"greater_than",...A(e),value:t,inclusive:!0})}function qu(t){return gr(0,t)}function Vu(t){return hr(0,t)}function Hu(t){return Dt(0,t)}function Wu(t){return ht(0,t)}function ln(t,e){return new uh({check:"multiple_of",...A(e),value:t})}function un(t,e){return new fh({check:"max_size",...A(e),maximum:t})}function yr(t,e){return new mh({check:"min_size",...A(e),minimum:t})}function qn(t,e){return new hh({check:"size_equals",...A(e),size:t})}function Vn(t,e){return new gh({check:"max_length",...A(e),maximum:t})}function Mr(t,e){return new yh({check:"min_length",...A(e),minimum:t})}function Hn(t,e){return new vh({check:"length_equals",...A(e),length:t})}function Qi(t,e){return new bh({check:"string_format",format:"regex",...A(e),pattern:t})}function eo(t){return new _h({check:"string_format",format:"lowercase",...A(t)})}function to(t){return new wh({check:"string_format",format:"uppercase",...A(t)})}function ro(t,e){return new $h({check:"string_format",format:"includes",...A(e),includes:t})}function no(t,e){return new kh({check:"string_format",format:"starts_with",...A(e),prefix:t})}function io(t,e){return new xh({check:"string_format",format:"ends_with",...A(e),suffix:t})}function Bu(t,e,r){return new Sh({check:"property",property:t,schema:e,...A(r)})}function oo(t,e){return new Ih({check:"mime_type",mime:t,...A(e)})}function tr(t){return new Th({check:"overwrite",tx:t})}function so(t){return tr(e=>e.normalize(t))}function ao(){return tr(t=>t.trim())}function co(){return tr(t=>t.toLowerCase())}function lo(){return tr(t=>t.toUpperCase())}function uo(){return tr(t=>Im(t))}function Jh(t,e,r){return new t({type:"array",element:e,...A(r)})}function WE(t,e,r){return new t({type:"union",options:e,...A(r)})}function BE(t,e,r){return new t({type:"union",options:e,inclusive:!1,...A(r)})}function GE(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...A(i)})}function JE(t,e,r){return new t({type:"intersection",left:e,right:r})}function KE(t,e,r,i){let n=r instanceof J,o=n?i:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...A(o)})}function YE(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...A(i)})}function XE(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...A(i)})}function QE(t,e,r){return new t({type:"set",valueType:e,...A(r)})}function e1(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...A(r)})}function t1(t,e,r){return new t({type:"enum",entries:e,...A(r)})}function r1(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...A(r)})}function Gu(t,e){return new t({type:"file",...A(e)})}function n1(t,e){return new t({type:"transform",transform:e})}function i1(t,e){return new t({type:"optional",innerType:e})}function o1(t,e){return new t({type:"nullable",innerType:e})}function s1(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Yc(r)}})}function a1(t,e,r){return new t({type:"nonoptional",innerType:e,...A(r)})}function c1(t,e){return new t({type:"success",innerType:e})}function l1(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function u1(t,e,r){return new t({type:"pipe",in:e,out:r})}function d1(t,e){return new t({type:"readonly",innerType:e})}function p1(t,e,r){return new t({type:"template_literal",parts:e,...A(r)})}function f1(t,e){return new t({type:"lazy",getter:e})}function m1(t,e){return new t({type:"promise",innerType:e})}function Ju(t,e,r){let i=A(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Ku(t,e,r){return new t({type:"custom",check:"custom",fn:e,...A(r)})}function Yu(t,e){let r=ex(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(Li(n,i.value,r._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Li(o))}},t(i.value,i)),e);return r}function ex(t,e){let r=new Se({check:"custom",...A(e)});return r._zod.check=t,r}function Xu(t){let e=new Se({check:"describe"});return e._zod.onattach=[r=>{let i=Qe.get(r)??{};Qe.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function Qu(t){let e=new Se({check:"meta"});return e._zod.onattach=[r=>{let i=Qe.get(r)??{};Qe.add(r,{...i,...t})}],e._zod.check=()=>{},e}function ed(t,e){let r=A(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(n),a=t.Codec??Gi,c=t.Boolean??Wi,l=t.String??cn,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:u,out:d,transform:(f,m)=>{let h=f;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})},reverseTransform:(f,m)=>f===!0?i[0]||"true":n[0]||"false",error:r.error});return p}function Wn(t,e,r,i={}){let n=A(i),o={...A(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}function dn(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Qe,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function be(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,u);else{let p=s.schema,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(t,e,p,u)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),be(d,e,u),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&>(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function pn(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let n=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,p=t.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${t.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=n(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
95
95
|
|
|
96
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let l=t.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function fn(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let f=t.seen.get(d),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===d)for(let y in l)y==="$ref"||y==="allOf"||y in u||delete l[y];if(m.$ref&&f.def)for(let y in l)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(l[y])===JSON.stringify(f.def[y])&&delete l[y]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=t.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a)}Object.assign(n,r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&n.id===o&&delete n.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:po(e,"input",t.processors),output:po(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function gt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return gt(i.element,r);if(i.type==="set")return gt(i.valueType,r);if(i.type==="lazy")return gt(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 gt(i.innerType,r);if(i.type==="intersection")return gt(i.left,r)||gt(i.right,r);if(i.type==="record"||i.type==="map")return gt(i.keyType,r)||gt(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:gt(i.in,r)||gt(i.out,r);if(i.type==="object"){for(let n in i.shape)if(gt(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(gt(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(gt(n,r))return!0;return!!(i.rest&>(i.rest,r))}return!1}var Kh=(t,e={})=>r=>{let i=dn({...r,processors:e});return be(t,i),pn(i,t),fn(i,t)},po=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=dn({...n??{},target:o,io:e,processors:r});return be(t,s),pn(s,t),fn(s,t)};var m1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Yh=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=m1[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Xh=(t,e,r,i)=>{let n=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),p=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof o=="number"&&(n.minimum=o),p?f?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof s=="number"&&(n.maximum=s),typeof c=="number"&&(n.multipleOf=c)},Qh=(t,e,r,i)=>{r.type="boolean"},eg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},tg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},rg=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},ng=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ig=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},og=(t,e,r,i)=>{r.not={}},sg=(t,e,r,i)=>{},ag=(t,e,r,i)=>{},cg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},lg=(t,e,r,i)=>{let n=t._zod.def,o=$s(n.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},ug=(t,e,r,i)=>{let n=t._zod.def,o=[];for(let s of n.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},dg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},pg=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},fg=(t,e,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,o)},mg=(t,e,r,i)=>{r.type="boolean"},hg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},yg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},vg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},bg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},_g=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=be(o.element,e,{...i,path:[...i.path,"items"]})},wg=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object",n.properties={};let s=o.shape;for(let l in s)n.properties[l]=be(s[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.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=be(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},td=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,s=n.options.map((a,c)=>be(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},$g=(t,e,r,i)=>{let n=t._zod.def,o=be(n.left,e,{...i,path:[...i.path,"allOf",0]}),s=be(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},kg=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((p,f)=>be(p,e,{...i,path:[...i.path,s,f]})),l=o.rest?be(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):e.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d)},xg=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=be(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=be(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=be(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u)}},Sg=(t,e,r,i)=>{let n=t._zod.def,o=be(n.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Ig=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Tg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Pg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},zg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Cg=(t,e,r,i)=>{let n=t._zod.def,o=n.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?n.out:n.in:n.out;be(s,e,i);let a=e.seen.get(t);a.ref=s},Rg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},Ag=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},rd=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Eg=(t,e,r,i)=>{let n=t._zod.innerType;be(n,e,i);let o=e.seen.get(t);o.ref=n},ed={string:Yh,number:Xh,boolean:Qh,bigint:eg,symbol:tg,null:rg,undefined:ng,void:ig,never:og,any:sg,unknown:ag,date:cg,enum:lg,literal:ug,nan:dg,template_literal:pg,file:fg,success:mg,custom:hg,function:gg,transform:yg,map:vg,set:bg,array:_g,object:wg,union:td,intersection:$g,tuple:kg,record:xg,nullable:Sg,nonoptional:Ig,default:Tg,prefault:Pg,catch:zg,pipe:Cg,readonly:Rg,promise:Ag,optional:rd,lazy:Eg};function Bn(t,e){if("_idmap"in t){let i=t,n=dn({...e,processors:ed}),o={};for(let c of i._idmap.entries()){let[l,u]=c;be(u,n)}let s={},a={registry:i,uri:e?.uri,defs:o};n.external=a;for(let c of i._idmap.entries()){let[l,u]=c;pn(n,u),s[l]=fn(n,u)}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=dn({...e,processors:ed});return be(t,r),pn(r,t),fn(r,t)}var nd=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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=dn({processors:ed,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return be(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),pn(this.ctx,e);let i=fn(this.ctx,e),{"~standard":n,...o}=i;return o}};var tx={};var y1=v("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(t,e),t.def=e,t.type=e.type,t.parse=(r,i)=>Ln(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>sn(t,r,i),t.parseAsync=async(r,i)=>Zn(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>an(t,r,i),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),t.with=t.check,t.clone=(r,i)=>Xe(t,r,i),t.brand=()=>t,t.register=(r,i)=>(r.add(t,i),t),t.apply=r=>r(t)});var v1=v("ZodMiniObject",(t,e)=>{Hl.init(t,e),y1.init(t,e),Q(t,"shape",()=>e.shape)});function Og(t,e){let r={type:"object",shape:t??{},...R(e)};return new v1(r)}function Tt(t){return!!t._zod}function Gn(t){let e=Object.values(t);if(e.length===0)return Og({});let r=e.every(Tt),i=e.every(n=>!Tt(n));if(r)return Og(t);if(i)return l$(t);throw new Error("Mixed Zod versions detected in object shape.")}function yt(t,e){return Tt(t)?sn(t,e):t.safeParse(e)}async function id(t,e){return Tt(t)?await an(t,e):await t.safeParseAsync(e)}function vr(t){if(!t)return;let e;if(Tt(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function fo(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let i=Object.values(t);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 Gn(t)}}if(Tt(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function od(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function rx(t){return t.description}function nx(t){if(Tt(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function sd(t){if(Tt(t)){let o=t._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=t._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=t.value;if(i!==void 0)return i}var F={};zr(F,{$brand:()=>$m,$input:()=>Dh,$output:()=>jh,NEVER:()=>_s,TimePrecision:()=>Lh,ZodAny:()=>ty,ZodArray:()=>oy,ZodBase64:()=>Pd,ZodBase64URL:()=>zd,ZodBigInt:()=>_o,ZodBigIntFormat:()=>Ad,ZodBoolean:()=>bo,ZodCIDRv4:()=>Id,ZodCIDRv6:()=>Td,ZodCUID:()=>bd,ZodCUID2:()=>_d,ZodCatch:()=>Sy,ZodCodec:()=>ha,ZodCustom:()=>ga,ZodCustomStringFormat:()=>yo,ZodDate:()=>ua,ZodDefault:()=>by,ZodDiscriminatedUnion:()=>ay,ZodE164:()=>Cd,ZodEmail:()=>hd,ZodEmoji:()=>yd,ZodEnum:()=>ho,ZodError:()=>_1,ZodExactOptional:()=>gy,ZodFile:()=>my,ZodFirstPartyTypeKind:()=>Dy,ZodFunction:()=>Ny,ZodGUID:()=>sa,ZodIPv4:()=>xd,ZodIPv6:()=>Sd,ZodISODate:()=>ld,ZodISODateTime:()=>cd,ZodISODuration:()=>dd,ZodISOTime:()=>ud,ZodIntersection:()=>cy,ZodIssueCode:()=>Uy,ZodJWT:()=>Rd,ZodKSUID:()=>kd,ZodLazy:()=>Ay,ZodLiteral:()=>fy,ZodMAC:()=>Yg,ZodMap:()=>dy,ZodNaN:()=>Ty,ZodNanoID:()=>vd,ZodNever:()=>ny,ZodNonOptional:()=>Md,ZodNull:()=>ey,ZodNullable:()=>vy,ZodNumber:()=>vo,ZodNumberFormat:()=>Jn,ZodObject:()=>da,ZodOptional:()=>ko,ZodPipe:()=>ma,ZodPrefault:()=>wy,ZodPreprocess:()=>Py,ZodPromise:()=>Oy,ZodReadonly:()=>zy,ZodRealError:()=>Pt,ZodRecord:()=>mo,ZodSet:()=>py,ZodString:()=>go,ZodStringFormat:()=>Ie,ZodSuccess:()=>xy,ZodSymbol:()=>Xg,ZodTemplateLiteral:()=>Ry,ZodTransform:()=>hy,ZodTuple:()=>ly,ZodType:()=>X,ZodULID:()=>wd,ZodURL:()=>la,ZodUUID:()=>br,ZodUndefined:()=>Qg,ZodUnion:()=>pa,ZodUnknown:()=>ry,ZodVoid:()=>iy,ZodXID:()=>$d,ZodXor:()=>sy,_ZodString:()=>md,_default:()=>_y,_function:()=>sS,any:()=>Ed,array:()=>A,base64:()=>Sx,base64url:()=>Ix,bigint:()=>jx,boolean:()=>_e,catch:()=>Iy,check:()=>aS,cidrv4:()=>kx,cidrv6:()=>xx,clone:()=>Xe,codec:()=>rS,coerce:()=>va,config:()=>Ue,core:()=>rr,cuid:()=>hx,cuid2:()=>gx,custom:()=>jd,date:()=>qx,decode:()=>Vg,decodeAsync:()=>Wg,describe:()=>cS,discriminatedUnion:()=>fa,e164:()=>Tx,email:()=>sx,emoji:()=>fx,encode:()=>qg,encodeAsync:()=>Hg,endsWith:()=>io,enum:()=>et,exactOptional:()=>yy,file:()=>Xx,flattenError:()=>Ps,float32:()=>Ex,float64:()=>Ox,formatError:()=>zs,fromJSONSchema:()=>mS,function:()=>sS,getErrorMap:()=>k1,globalRegistry:()=>Qe,gt:()=>gr,gte:()=>ht,guid:()=>ax,hash:()=>Ax,hex:()=>Rx,hostname:()=>Cx,httpUrl:()=>px,includes:()=>ro,instanceof:()=>uS,int:()=>pd,int32:()=>Nx,int64:()=>Dx,intersection:()=>$o,invertCodec:()=>nS,ipv4:()=>_x,ipv6:()=>$x,iso:()=>mn,json:()=>pS,jwt:()=>Px,keyof:()=>Vx,ksuid:()=>bx,lazy:()=>Ey,length:()=>Hn,literal:()=>Z,locales:()=>Ki,looseObject:()=>Le,looseRecord:()=>Gx,lowercase:()=>eo,lt:()=>hr,lte:()=>Dt,mac:()=>wx,map:()=>Jx,maxLength:()=>Vn,maxSize:()=>un,meta:()=>lS,mime:()=>oo,minLength:()=>Mr,minSize:()=>yr,multipleOf:()=>ln,nan:()=>tS,nanoid:()=>mx,nativeEnum:()=>Yx,negative:()=>qu,never:()=>Od,nonnegative:()=>Hu,nonoptional:()=>ky,nonpositive:()=>Vu,normalize:()=>so,null:()=>wo,nullable:()=>aa,nullish:()=>Qx,number:()=>pe,object:()=>E,optional:()=>Ae,overwrite:()=>tr,parse:()=>Ug,parseAsync:()=>Lg,partialRecord:()=>Bx,pipe:()=>fd,positive:()=>Fu,prefault:()=>$y,preprocess:()=>ya,prettifyError:()=>Om,promise:()=>oS,property:()=>Wu,readonly:()=>Cy,record:()=>Ce,refine:()=>My,regex:()=>Qi,regexes:()=>It,registry:()=>_u,safeDecode:()=>Gg,safeDecodeAsync:()=>Kg,safeEncode:()=>Bg,safeEncodeAsync:()=>Jg,safeParse:()=>Zg,safeParseAsync:()=>Fg,set:()=>Kx,setErrorMap:()=>$1,size:()=>qn,slugify:()=>uo,startsWith:()=>no,strictObject:()=>Hx,string:()=>g,stringFormat:()=>zx,stringbool:()=>dS,success:()=>eS,superRefine:()=>jy,symbol:()=>Lx,templateLiteral:()=>iS,toJSONSchema:()=>Bn,toLowerCase:()=>co,toUpperCase:()=>lo,transform:()=>Nd,treeifyError:()=>Em,trim:()=>ao,tuple:()=>uy,uint32:()=>Mx,uint64:()=>Ux,ulid:()=>yx,undefined:()=>Zx,union:()=>ke,unknown:()=>Te,uppercase:()=>to,url:()=>gd,util:()=>P,uuid:()=>cx,uuidv4:()=>lx,uuidv6:()=>ux,uuidv7:()=>dx,void:()=>Fx,xid:()=>vx,xor:()=>Wx});var oa={};zr(oa,{ZodAny:()=>ty,ZodArray:()=>oy,ZodBase64:()=>Pd,ZodBase64URL:()=>zd,ZodBigInt:()=>_o,ZodBigIntFormat:()=>Ad,ZodBoolean:()=>bo,ZodCIDRv4:()=>Id,ZodCIDRv6:()=>Td,ZodCUID:()=>bd,ZodCUID2:()=>_d,ZodCatch:()=>Sy,ZodCodec:()=>ha,ZodCustom:()=>ga,ZodCustomStringFormat:()=>yo,ZodDate:()=>ua,ZodDefault:()=>by,ZodDiscriminatedUnion:()=>ay,ZodE164:()=>Cd,ZodEmail:()=>hd,ZodEmoji:()=>yd,ZodEnum:()=>ho,ZodExactOptional:()=>gy,ZodFile:()=>my,ZodFunction:()=>Ny,ZodGUID:()=>sa,ZodIPv4:()=>xd,ZodIPv6:()=>Sd,ZodIntersection:()=>cy,ZodJWT:()=>Rd,ZodKSUID:()=>kd,ZodLazy:()=>Ay,ZodLiteral:()=>fy,ZodMAC:()=>Yg,ZodMap:()=>dy,ZodNaN:()=>Ty,ZodNanoID:()=>vd,ZodNever:()=>ny,ZodNonOptional:()=>Md,ZodNull:()=>ey,ZodNullable:()=>vy,ZodNumber:()=>vo,ZodNumberFormat:()=>Jn,ZodObject:()=>da,ZodOptional:()=>ko,ZodPipe:()=>ma,ZodPrefault:()=>wy,ZodPreprocess:()=>Py,ZodPromise:()=>Oy,ZodReadonly:()=>zy,ZodRecord:()=>mo,ZodSet:()=>py,ZodString:()=>go,ZodStringFormat:()=>Ie,ZodSuccess:()=>xy,ZodSymbol:()=>Xg,ZodTemplateLiteral:()=>Ry,ZodTransform:()=>hy,ZodTuple:()=>ly,ZodType:()=>X,ZodULID:()=>wd,ZodURL:()=>la,ZodUUID:()=>br,ZodUndefined:()=>Qg,ZodUnion:()=>pa,ZodUnknown:()=>ry,ZodVoid:()=>iy,ZodXID:()=>$d,ZodXor:()=>sy,_ZodString:()=>md,_default:()=>_y,_function:()=>sS,any:()=>Ed,array:()=>A,base64:()=>Sx,base64url:()=>Ix,bigint:()=>jx,boolean:()=>_e,catch:()=>Iy,check:()=>aS,cidrv4:()=>kx,cidrv6:()=>xx,codec:()=>rS,cuid:()=>hx,cuid2:()=>gx,custom:()=>jd,date:()=>qx,describe:()=>cS,discriminatedUnion:()=>fa,e164:()=>Tx,email:()=>sx,emoji:()=>fx,enum:()=>et,exactOptional:()=>yy,file:()=>Xx,float32:()=>Ex,float64:()=>Ox,function:()=>sS,guid:()=>ax,hash:()=>Ax,hex:()=>Rx,hostname:()=>Cx,httpUrl:()=>px,instanceof:()=>uS,int:()=>pd,int32:()=>Nx,int64:()=>Dx,intersection:()=>$o,invertCodec:()=>nS,ipv4:()=>_x,ipv6:()=>$x,json:()=>pS,jwt:()=>Px,keyof:()=>Vx,ksuid:()=>bx,lazy:()=>Ey,literal:()=>Z,looseObject:()=>Le,looseRecord:()=>Gx,mac:()=>wx,map:()=>Jx,meta:()=>lS,nan:()=>tS,nanoid:()=>mx,nativeEnum:()=>Yx,never:()=>Od,nonoptional:()=>ky,null:()=>wo,nullable:()=>aa,nullish:()=>Qx,number:()=>pe,object:()=>E,optional:()=>Ae,partialRecord:()=>Bx,pipe:()=>fd,prefault:()=>$y,preprocess:()=>ya,promise:()=>oS,readonly:()=>Cy,record:()=>Ce,refine:()=>My,set:()=>Kx,strictObject:()=>Hx,string:()=>g,stringFormat:()=>zx,stringbool:()=>dS,success:()=>eS,superRefine:()=>jy,symbol:()=>Lx,templateLiteral:()=>iS,transform:()=>Nd,tuple:()=>uy,uint32:()=>Mx,uint64:()=>Ux,ulid:()=>yx,undefined:()=>Zx,union:()=>ke,unknown:()=>Te,url:()=>gd,uuid:()=>cx,uuidv4:()=>lx,uuidv6:()=>ux,uuidv7:()=>dx,void:()=>Fx,xid:()=>vx,xor:()=>Wx});var ad={};zr(ad,{endsWith:()=>io,gt:()=>gr,gte:()=>ht,includes:()=>ro,length:()=>Hn,lowercase:()=>eo,lt:()=>hr,lte:()=>Dt,maxLength:()=>Vn,maxSize:()=>un,mime:()=>oo,minLength:()=>Mr,minSize:()=>yr,multipleOf:()=>ln,negative:()=>qu,nonnegative:()=>Hu,nonpositive:()=>Vu,normalize:()=>so,overwrite:()=>tr,positive:()=>Fu,property:()=>Wu,regex:()=>Qi,size:()=>qn,slugify:()=>uo,startsWith:()=>no,toLowerCase:()=>co,toUpperCase:()=>lo,trim:()=>ao,uppercase:()=>to});var mn={};zr(mn,{ZodISODate:()=>ld,ZodISODateTime:()=>cd,ZodISODuration:()=>dd,ZodISOTime:()=>ud,date:()=>Mg,datetime:()=>Ng,duration:()=>Dg,time:()=>jg});var cd=v("ZodISODateTime",(t,e)=>{Ch.init(t,e),Ie.init(t,e)});function Ng(t){return Zh(cd,t)}var ld=v("ZodISODate",(t,e)=>{Rh.init(t,e),Ie.init(t,e)});function Mg(t){return Fh(ld,t)}var ud=v("ZodISOTime",(t,e)=>{Ah.init(t,e),Ie.init(t,e)});function jg(t){return qh(ud,t)}var dd=v("ZodISODuration",(t,e)=>{Eh.init(t,e),Ie.init(t,e)});function Dg(t){return Vh(dd,t)}var ix=(t,e)=>{Ts.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>zs(t,r)},flatten:{value:r=>Ps(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Di,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Di,2)}},isEmpty:{get(){return t.issues.length===0}}})},_1=v("ZodError",ix),Pt=v("ZodError",ix,{Parent:Error});var Ug=Zi(Pt),Lg=Fi(Pt),Zg=qi(Pt),Fg=Vi(Pt),qg=Yc(Pt),Vg=Xc(Pt),Hg=Qc(Pt),Wg=el(Pt),Bg=tl(Pt),Gg=rl(Pt),Jg=nl(Pt),Kg=il(Pt);var ox=new WeakMap;function ca(t,e,r){let i=Object.getPrototypeOf(t),n=ox.get(i);if(n||(n=new Set,ox.set(i,n)),!n.has(e)){n.add(e);for(let o in r){let s=r[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var X=v("ZodType",(t,e)=>(J.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:po(t,"input"),output:po(t,"output")}}),t.toJSONSchema=Kh(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,i)=>Ug(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>Zg(t,r,i),t.parseAsync=async(r,i)=>Lg(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Fg(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>qg(t,r,i),t.decode=(r,i)=>Vg(t,r,i),t.encodeAsync=async(r,i)=>Hg(t,r,i),t.decodeAsync=async(r,i)=>Wg(t,r,i),t.safeEncode=(r,i)=>Bg(t,r,i),t.safeDecode=(r,i)=>Gg(t,r,i),t.safeEncodeAsync=async(r,i)=>Jg(t,r,i),t.safeDecodeAsync=async(r,i)=>Kg(t,r,i),ca(t,"ZodType",{check(...r){let i=this.def;return this.clone(P.mergeDefs(i,{checks:[...i.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Xe(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(My(r,i))},superRefine(r,i){return this.check(jy(r,i))},overwrite(r){return this.check(tr(r))},optional(){return Ae(this)},exactOptional(){return yy(this)},nullable(){return aa(this)},nullish(){return Ae(aa(this))},nonoptional(r){return ky(this,r)},array(){return A(this)},or(r){return ke([this,r])},and(r){return $o(this,r)},transform(r){return fd(this,Nd(r))},default(r){return _y(this,r)},prefault(r){return $y(this,r)},catch(r){return Iy(this,r)},pipe(r){return fd(this,r)},readonly(){return Cy(this)},describe(r){let i=this.clone();return Qe.add(i,{description:r}),i},meta(...r){if(r.length===0)return Qe.get(this);let i=this.clone();return Qe.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Qe.get(t)?.description},configurable:!0}),t)),md=v("_ZodString",(t,e)=>{cn.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Yh(t,i,n,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,ca(t,"_ZodString",{regex(...i){return this.check(Qi(...i))},includes(...i){return this.check(ro(...i))},startsWith(...i){return this.check(no(...i))},endsWith(...i){return this.check(io(...i))},min(...i){return this.check(Mr(...i))},max(...i){return this.check(Vn(...i))},length(...i){return this.check(Hn(...i))},nonempty(...i){return this.check(Mr(1,...i))},lowercase(i){return this.check(eo(i))},uppercase(i){return this.check(to(i))},trim(){return this.check(ao())},normalize(...i){return this.check(so(...i))},toLowerCase(){return this.check(co())},toUpperCase(){return this.check(lo())},slugify(){return this.check(uo())}})}),go=v("ZodString",(t,e)=>{cn.init(t,e),md.init(t,e),t.email=r=>t.check(Us(hd,r)),t.url=r=>t.check(Xi(la,r)),t.jwt=r=>t.check(ia(Rd,r)),t.emoji=r=>t.check(Vs(yd,r)),t.guid=r=>t.check(Yi(sa,r)),t.uuid=r=>t.check(Ls(br,r)),t.uuidv4=r=>t.check(Zs(br,r)),t.uuidv6=r=>t.check(Fs(br,r)),t.uuidv7=r=>t.check(qs(br,r)),t.nanoid=r=>t.check(Hs(vd,r)),t.guid=r=>t.check(Yi(sa,r)),t.cuid=r=>t.check(Ws(bd,r)),t.cuid2=r=>t.check(Bs(_d,r)),t.ulid=r=>t.check(Gs(wd,r)),t.base64=r=>t.check(ta(Pd,r)),t.base64url=r=>t.check(ra(zd,r)),t.xid=r=>t.check(Js($d,r)),t.ksuid=r=>t.check(Ks(kd,r)),t.ipv4=r=>t.check(Ys(xd,r)),t.ipv6=r=>t.check(Xs(Sd,r)),t.cidrv4=r=>t.check(Qs(Id,r)),t.cidrv6=r=>t.check(ea(Td,r)),t.e164=r=>t.check(na(Cd,r)),t.datetime=r=>t.check(Ng(r)),t.date=r=>t.check(Mg(r)),t.time=r=>t.check(jg(r)),t.duration=r=>t.check(Dg(r))});function g(t){return wu(go,t)}var Ie=v("ZodStringFormat",(t,e)=>{$e.init(t,e),md.init(t,e)}),hd=v("ZodEmail",(t,e)=>{hl.init(t,e),Ie.init(t,e)});function sx(t){return Us(hd,t)}var sa=v("ZodGUID",(t,e)=>{fl.init(t,e),Ie.init(t,e)});function ax(t){return Yi(sa,t)}var br=v("ZodUUID",(t,e)=>{ml.init(t,e),Ie.init(t,e)});function cx(t){return Ls(br,t)}function lx(t){return Zs(br,t)}function ux(t){return Fs(br,t)}function dx(t){return qs(br,t)}var la=v("ZodURL",(t,e)=>{gl.init(t,e),Ie.init(t,e)});function gd(t){return Xi(la,t)}function px(t){return Xi(la,{protocol:It.httpProtocol,hostname:It.domain,...P.normalizeParams(t)})}var yd=v("ZodEmoji",(t,e)=>{yl.init(t,e),Ie.init(t,e)});function fx(t){return Vs(yd,t)}var vd=v("ZodNanoID",(t,e)=>{vl.init(t,e),Ie.init(t,e)});function mx(t){return Hs(vd,t)}var bd=v("ZodCUID",(t,e)=>{bl.init(t,e),Ie.init(t,e)});function hx(t){return Ws(bd,t)}var _d=v("ZodCUID2",(t,e)=>{_l.init(t,e),Ie.init(t,e)});function gx(t){return Bs(_d,t)}var wd=v("ZodULID",(t,e)=>{wl.init(t,e),Ie.init(t,e)});function yx(t){return Gs(wd,t)}var $d=v("ZodXID",(t,e)=>{$l.init(t,e),Ie.init(t,e)});function vx(t){return Js($d,t)}var kd=v("ZodKSUID",(t,e)=>{kl.init(t,e),Ie.init(t,e)});function bx(t){return Ks(kd,t)}var xd=v("ZodIPv4",(t,e)=>{xl.init(t,e),Ie.init(t,e)});function _x(t){return Ys(xd,t)}var Yg=v("ZodMAC",(t,e)=>{Il.init(t,e),Ie.init(t,e)});function wx(t){return $u(Yg,t)}var Sd=v("ZodIPv6",(t,e)=>{Sl.init(t,e),Ie.init(t,e)});function $x(t){return Xs(Sd,t)}var Id=v("ZodCIDRv4",(t,e)=>{Tl.init(t,e),Ie.init(t,e)});function kx(t){return Qs(Id,t)}var Td=v("ZodCIDRv6",(t,e)=>{Pl.init(t,e),Ie.init(t,e)});function xx(t){return ea(Td,t)}var Pd=v("ZodBase64",(t,e)=>{zl.init(t,e),Ie.init(t,e)});function Sx(t){return ta(Pd,t)}var zd=v("ZodBase64URL",(t,e)=>{Cl.init(t,e),Ie.init(t,e)});function Ix(t){return ra(zd,t)}var Cd=v("ZodE164",(t,e)=>{Rl.init(t,e),Ie.init(t,e)});function Tx(t){return na(Cd,t)}var Rd=v("ZodJWT",(t,e)=>{Al.init(t,e),Ie.init(t,e)});function Px(t){return ia(Rd,t)}var yo=v("ZodCustomStringFormat",(t,e)=>{El.init(t,e),Ie.init(t,e)});function zx(t,e,r={}){return Wn(yo,t,e,r)}function Cx(t){return Wn(yo,"hostname",It.hostname,t)}function Rx(t){return Wn(yo,"hex",It.hex,t)}function Ax(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=It[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Wn(yo,i,n,e)}var vo=v("ZodNumber",(t,e)=>{Es.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Xh(t,i,n,o),ca(t,"ZodNumber",{gt(i,n){return this.check(gr(i,n))},gte(i,n){return this.check(ht(i,n))},min(i,n){return this.check(ht(i,n))},lt(i,n){return this.check(hr(i,n))},lte(i,n){return this.check(Dt(i,n))},max(i,n){return this.check(Dt(i,n))},int(i){return this.check(pd(i))},safe(i){return this.check(pd(i))},positive(i){return this.check(gr(0,i))},nonnegative(i){return this.check(ht(0,i))},negative(i){return this.check(hr(0,i))},nonpositive(i){return this.check(Dt(0,i))},multipleOf(i,n){return this.check(ln(i,n))},step(i,n){return this.check(ln(i,n))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function pe(t){return ku(vo,t)}var Jn=v("ZodNumberFormat",(t,e)=>{Ol.init(t,e),vo.init(t,e)});function pd(t){return xu(Jn,t)}function Ex(t){return Su(Jn,t)}function Ox(t){return Iu(Jn,t)}function Nx(t){return Tu(Jn,t)}function Mx(t){return Pu(Jn,t)}var bo=v("ZodBoolean",(t,e)=>{Wi.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Qh(t,r,i,n)});function _e(t){return zu(bo,t)}var _o=v("ZodBigInt",(t,e)=>{Os.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>eg(t,i,n,o),t.gte=(i,n)=>t.check(ht(i,n)),t.min=(i,n)=>t.check(ht(i,n)),t.gt=(i,n)=>t.check(gr(i,n)),t.gte=(i,n)=>t.check(ht(i,n)),t.min=(i,n)=>t.check(ht(i,n)),t.lt=(i,n)=>t.check(hr(i,n)),t.lte=(i,n)=>t.check(Dt(i,n)),t.max=(i,n)=>t.check(Dt(i,n)),t.positive=i=>t.check(gr(BigInt(0),i)),t.negative=i=>t.check(hr(BigInt(0),i)),t.nonpositive=i=>t.check(Dt(BigInt(0),i)),t.nonnegative=i=>t.check(ht(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(ln(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function jx(t){return Cu(_o,t)}var Ad=v("ZodBigIntFormat",(t,e)=>{Nl.init(t,e),_o.init(t,e)});function Dx(t){return Ru(Ad,t)}function Ux(t){return Au(Ad,t)}var Xg=v("ZodSymbol",(t,e)=>{Ml.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tg(t,r,i,n)});function Lx(t){return Eu(Xg,t)}var Qg=v("ZodUndefined",(t,e)=>{jl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ng(t,r,i,n)});function Zx(t){return Ou(Qg,t)}var ey=v("ZodNull",(t,e)=>{Dl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rg(t,r,i,n)});function wo(t){return Nu(ey,t)}var ty=v("ZodAny",(t,e)=>{Ul.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sg(t,r,i,n)});function Ed(){return Mu(ty)}var ry=v("ZodUnknown",(t,e)=>{Ll.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ag(t,r,i,n)});function Te(){return ju(ry)}var ny=v("ZodNever",(t,e)=>{Zl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>og(t,r,i,n)});function Od(t){return Du(ny,t)}var iy=v("ZodVoid",(t,e)=>{Fl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ig(t,r,i,n)});function Fx(t){return Uu(iy,t)}var ua=v("ZodDate",(t,e)=>{ql.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>cg(t,i,n,o),t.min=(i,n)=>t.check(ht(i,n)),t.max=(i,n)=>t.check(Dt(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function qx(t){return Lu(ua,t)}var oy=v("ZodArray",(t,e)=>{Vl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_g(t,r,i,n),t.element=e.element,ca(t,"ZodArray",{min(r,i){return this.check(Mr(r,i))},nonempty(r){return this.check(Mr(1,r))},max(r,i){return this.check(Vn(r,i))},length(r,i){return this.check(Hn(r,i))},unwrap(){return this.element}})});function A(t,e){return Jh(oy,t,e)}function Vx(t){let e=t._zod.def.shape;return et(Object.keys(e))}var da=v("ZodObject",(t,e)=>{Nh.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>wg(t,r,i,n),P.defineLazy(t,"shape",()=>e.shape),ca(t,"ZodObject",{keyof(){return et(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Te()})},loose(){return this.clone({...this._zod.def,catchall:Te()})},strict(){return this.clone({...this._zod.def,catchall:Od()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return P.extend(this,r)},safeExtend(r){return P.safeExtend(this,r)},merge(r){return P.merge(this,r)},pick(r){return P.pick(this,r)},omit(r){return P.omit(this,r)},partial(...r){return P.partial(ko,this,r[0])},required(...r){return P.required(Md,this,r[0])}})});function E(t,e){let r={type:"object",shape:t??{},...P.normalizeParams(e)};return new da(r)}function Hx(t,e){return new da({type:"object",shape:t,catchall:Od(),...P.normalizeParams(e)})}function Le(t,e){return new da({type:"object",shape:t,catchall:Te(),...P.normalizeParams(e)})}var pa=v("ZodUnion",(t,e)=>{Bi.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>td(t,r,i,n),t.options=e.options});function ke(t,e){return new pa({type:"union",options:t,...P.normalizeParams(e)})}var sy=v("ZodXor",(t,e)=>{pa.init(t,e),Wl.init(t,e),t._zod.processJSONSchema=(r,i,n)=>td(t,r,i,n),t.options=e.options});function Wx(t,e){return new sy({type:"union",options:t,inclusive:!1,...P.normalizeParams(e)})}var ay=v("ZodDiscriminatedUnion",(t,e)=>{pa.init(t,e),Bl.init(t,e)});function fa(t,e,r){return new ay({type:"union",options:e,discriminator:t,...P.normalizeParams(r)})}var cy=v("ZodIntersection",(t,e)=>{Gl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$g(t,r,i,n)});function $o(t,e){return new cy({type:"intersection",left:t,right:e})}var ly=v("ZodTuple",(t,e)=>{Ns.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>kg(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r})});function uy(t,e,r){let i=e instanceof J,n=i?r:e,o=i?e:null;return new ly({type:"tuple",items:t,rest:o,...P.normalizeParams(n)})}var mo=v("ZodRecord",(t,e)=>{Jl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xg(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});function Ce(t,e,r){return!e||!e._zod?new mo({type:"record",keyType:g(),valueType:t,...P.normalizeParams(e)}):new mo({type:"record",keyType:t,valueType:e,...P.normalizeParams(r)})}function Bx(t,e,r){let i=Xe(t);return i._zod.values=void 0,new mo({type:"record",keyType:i,valueType:e,...P.normalizeParams(r)})}function Gx(t,e,r){return new mo({type:"record",keyType:t,valueType:e,mode:"loose",...P.normalizeParams(r)})}var dy=v("ZodMap",(t,e)=>{Kl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vg(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(yr(...r)),t.nonempty=r=>t.check(yr(1,r)),t.max=(...r)=>t.check(un(...r)),t.size=(...r)=>t.check(qn(...r))});function Jx(t,e,r){return new dy({type:"map",keyType:t,valueType:e,...P.normalizeParams(r)})}var py=v("ZodSet",(t,e)=>{Yl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bg(t,r,i,n),t.min=(...r)=>t.check(yr(...r)),t.nonempty=r=>t.check(yr(1,r)),t.max=(...r)=>t.check(un(...r)),t.size=(...r)=>t.check(qn(...r))});function Kx(t,e){return new py({type:"set",valueType:t,...P.normalizeParams(e)})}var ho=v("ZodEnum",(t,e)=>{Xl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>lg(t,i,n,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ho({...e,checks:[],...P.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new ho({...e,checks:[],...P.normalizeParams(n),entries:o})}});function et(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new ho({type:"enum",entries:r,...P.normalizeParams(e)})}function Yx(t,e){return new ho({type:"enum",entries:t,...P.normalizeParams(e)})}var fy=v("ZodLiteral",(t,e)=>{Ql.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ug(t,r,i,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Z(t,e){return new fy({type:"literal",values:Array.isArray(t)?t:[t],...P.normalizeParams(e)})}var my=v("ZodFile",(t,e)=>{eu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>fg(t,r,i,n),t.min=(r,i)=>t.check(yr(r,i)),t.max=(r,i)=>t.check(un(r,i)),t.mime=(r,i)=>t.check(oo(Array.isArray(r)?r:[r],i))});function Xx(t){return Bu(my,t)}var hy=v("ZodTransform",(t,e)=>{tu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yg(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(P.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(P.issue(s))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Nd(t){return new hy({type:"transform",transform:t})}var ko=v("ZodOptional",(t,e)=>{Ms.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rd(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Ae(t){return new ko({type:"optional",innerType:t})}var gy=v("ZodExactOptional",(t,e)=>{ru.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rd(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function yy(t){return new gy({type:"optional",innerType:t})}var vy=v("ZodNullable",(t,e)=>{nu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function aa(t){return new vy({type:"nullable",innerType:t})}function Qx(t){return Ae(aa(t))}var by=v("ZodDefault",(t,e)=>{iu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function _y(t,e){return new by({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():P.shallowClone(e)}})}var wy=v("ZodPrefault",(t,e)=>{ou.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function $y(t,e){return new wy({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():P.shallowClone(e)}})}var Md=v("ZodNonOptional",(t,e)=>{su.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ig(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function ky(t,e){return new Md({type:"nonoptional",innerType:t,...P.normalizeParams(e)})}var xy=v("ZodSuccess",(t,e)=>{au.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function eS(t){return new xy({type:"success",innerType:t})}var Sy=v("ZodCatch",(t,e)=>{cu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Iy(t,e){return new Sy({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Ty=v("ZodNaN",(t,e)=>{lu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dg(t,r,i,n)});function tS(t){return Zu(Ty,t)}var ma=v("ZodPipe",(t,e)=>{js.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cg(t,r,i,n),t.in=e.in,t.out=e.out});function fd(t,e){return new ma({type:"pipe",in:t,out:e})}var ha=v("ZodCodec",(t,e)=>{ma.init(t,e),Gi.init(t,e)});function rS(t,e,r){return new ha({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function nS(t){let e=t._zod.def;return new ha({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var Py=v("ZodPreprocess",(t,e)=>{ma.init(t,e),Mh.init(t,e)}),zy=v("ZodReadonly",(t,e)=>{uu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Cy(t){return new zy({type:"readonly",innerType:t})}var Ry=v("ZodTemplateLiteral",(t,e)=>{du.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pg(t,r,i,n)});function iS(t,e){return new Ry({type:"template_literal",parts:t,...P.normalizeParams(e)})}var Ay=v("ZodLazy",(t,e)=>{mu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Eg(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});function Ey(t){return new Ay({type:"lazy",getter:t})}var Oy=v("ZodPromise",(t,e)=>{fu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ag(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function oS(t){return new Oy({type:"promise",innerType:t})}var Ny=v("ZodFunction",(t,e)=>{pu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gg(t,r,i,n)});function sS(t){return new Ny({type:"function",input:Array.isArray(t?.input)?uy(t?.input):t?.input??A(Te()),output:t?.output??Te()})}var ga=v("ZodCustom",(t,e)=>{hu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hg(t,r,i,n)});function aS(t){let e=new Se({check:"custom"});return e._zod.check=t,e}function jd(t,e){return Gu(ga,t??(()=>!0),e)}function My(t,e={}){return Ju(ga,t,e)}function jy(t,e){return Ku(t,e)}var cS=Yu,lS=Xu;function uS(t,e={}){let r=new ga({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...P.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var dS=(...t)=>Qu({Codec:ha,Boolean:bo,String:go},...t);function pS(t){let e=Ey(()=>ke([g(t),pe(),_e(),wo(),A(e),Ce(g(),e)]));return e}function ya(t,e){return new Py({type:"pipe",in:Nd(t),out:e})}var Uy={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 $1(t){Ue({customError:t})}function k1(){return Ue().customError}var Dy;Dy||(Dy={});var M={...oa,...ad,iso:mn},x1=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 S1(t,e){let r=t.$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":e??"draft-2020-12"}function I1(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function fS(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return M.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return M.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=I1(n,e),s=ct(o,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return M.null();if(n.length===0)return M.never();if(n.length===1)return M.literal(n[0]);if(n.every(s=>typeof s=="string"))return M.enum(n);let o=n.map(s=>M.literal(s));return o.length<2?o[0]:M.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return M.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...t,type:o};return fS(s,e)});return n.length===0?M.never():n.length===1?n[0]:M.union(n)}if(!r)return M.any();let i;switch(r){case"string":{let n=M.string();if(t.format){let o=t.format;o==="email"?n=n.check(M.email()):o==="uri"||o==="uri-reference"?n=n.check(M.url()):o==="uuid"||o==="guid"?n=n.check(M.uuid()):o==="date-time"?n=n.check(M.iso.datetime()):o==="date"?n=n.check(M.iso.date()):o==="time"?n=n.check(M.iso.time()):o==="duration"?n=n.check(M.iso.duration()):o==="ipv4"?n=n.check(M.ipv4()):o==="ipv6"?n=n.check(M.ipv6()):o==="mac"?n=n.check(M.mac()):o==="cidr"?n=n.check(M.cidrv4()):o==="cidr-v6"?n=n.check(M.cidrv6()):o==="base64"?n=n.check(M.base64()):o==="base64url"?n=n.check(M.base64url()):o==="e164"?n=n.check(M.e164()):o==="jwt"?n=n.check(M.jwt()):o==="emoji"?n=n.check(M.emoji()):o==="nanoid"?n=n.check(M.nanoid()):o==="cuid"?n=n.check(M.cuid()):o==="cuid2"?n=n.check(M.cuid2()):o==="ulid"?n=n.check(M.ulid()):o==="xid"?n=n.check(M.xid()):o==="ksuid"&&(n=n.check(M.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?M.number().int():M.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=M.boolean();break}case"null":{i=M.null();break}case"object":{let n={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,l]of Object.entries(o)){let u=ct(l,e);n[c]=s.has(c)?u:u.optional()}if(t.propertyNames){let c=ct(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?ct(t.additionalProperties,e):M.any();if(Object.keys(n).length===0){i=M.record(c,l);break}let u=M.object(n).passthrough(),d=M.looseRecord(c,l);i=M.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let p of l){let f=ct(c[p],e),m=M.string().regex(new RegExp(p));u.push(M.looseRecord(m,f))}let d=[];if(Object.keys(n).length>0&&d.push(M.object(n).passthrough()),d.push(...u),d.length===0)i=M.object({}).passthrough();else if(d.length===1)i=d[0];else{let p=M.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)p=M.intersection(p,d[f]);i=p}break}let a=M.object(n);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(ct(t.additionalProperties,e)):i=a.passthrough();break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let s=n.map(c=>ct(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?ct(o,e):void 0;a?i=M.tuple(s).rest(a):i=M.tuple(s),typeof t.minItems=="number"&&(i=i.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(M.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>ct(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?ct(t.additionalItems,e):void 0;a?i=M.tuple(s).rest(a):i=M.tuple(s),typeof t.minItems=="number"&&(i=i.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(M.maxLength(t.maxItems)))}else if(o!==void 0){let s=ct(o,e),a=M.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=M.array(M.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}function ct(t,e){if(typeof t=="boolean")return t?M.any():M.never();let r=fS(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>ct(l,e)),c=M.union(a);r=i?M.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>ct(l,e)),c=M.xor(a);r=i?M.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:M.any();else{let a=i?r:ct(t.allOf[0],e),c=i?0:1;for(let l=c;l<t.allOf.length;l++)a=M.intersection(a,ct(t.allOf[l],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=M.nullable(r)),t.readOnly===!0&&(r=M.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(n[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))x1.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function mS(t,e){if(typeof t=="boolean")return t?M.any():M.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=S1(r,e?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Qe};return ct(r,o)}var va={};zr(va,{bigint:()=>C1,boolean:()=>z1,date:()=>R1,number:()=>P1,string:()=>T1});function T1(t){return Uh(go,t)}function P1(t){return Hh(vo,t)}function z1(t){return Wh(bo,t)}function C1(t){return Bh(_o,t)}function R1(t){return Gh(ua,t)}Ue(gu());var hn="2025-11-25";var Ud=[hn,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],gn="io.modelcontextprotocol/related-task",Ld="2.0",tt=jd(t=>t!==null&&(typeof t=="object"||typeof t=="function")),hS=ke([g(),pe().int()]),gS=g(),ZW=Le({ttl:ke([pe(),wo()]).optional(),pollInterval:pe().optional()}),E1=E({ttl:pe().optional()}),O1=E({taskId:g()}),Zy=Le({progressToken:hS.optional(),[gn]:O1.optional()}),Ut=E({_meta:Zy.optional()}),ba=Ut.extend({task:E1.optional()}),yS=t=>ba.safeParse(t).success,rt=E({method:g(),params:Ut.loose().optional()}),qt=E({_meta:Zy.optional()}),Vt=E({method:g(),params:qt.loose().optional()}),nt=Le({_meta:Zy.optional()}),Zd=ke([g(),pe().int()]),vS=E({jsonrpc:Z(Ld),id:Zd,...rt.shape}).strict(),_a=t=>vS.safeParse(t).success,bS=E({jsonrpc:Z(Ld),...Vt.shape}).strict(),_S=t=>bS.safeParse(t).success,Fy=E({jsonrpc:Z(Ld),id:Zd,result:nt}).strict(),Kn=t=>Fy.safeParse(t).success;var U;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(U||(U={}));var qy=E({jsonrpc:Z(Ld),id:Zd.optional(),error:E({code:pe().int(),message:g(),data:Te().optional()})}).strict();var wS=t=>qy.safeParse(t).success;var So=ke([vS,bS,Fy,qy]),FW=ke([Fy,qy]),jr=nt.strict(),N1=qt.extend({requestId:Zd.optional(),reason:g().optional()}),Fd=Vt.extend({method:Z("notifications/cancelled"),params:N1}),M1=E({src:g(),mimeType:g().optional(),sizes:A(g()).optional(),theme:et(["light","dark"]).optional()}),wa=E({icons:A(M1).optional()}),xo=E({name:g(),title:g().optional()}),$S=xo.extend({...xo.shape,...wa.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),j1=$o(E({applyDefaults:_e().optional()}),Ce(g(),Te())),D1=ya(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,$o(E({form:j1.optional(),url:tt.optional()}),Ce(g(),Te()).optional())),U1=Le({list:tt.optional(),cancel:tt.optional(),requests:Le({sampling:Le({createMessage:tt.optional()}).optional(),elicitation:Le({create:tt.optional()}).optional()}).optional()}),L1=Le({list:tt.optional(),cancel:tt.optional(),requests:Le({tools:Le({call:tt.optional()}).optional()}).optional()}),Z1=E({experimental:Ce(g(),tt).optional(),sampling:E({context:tt.optional(),tools:tt.optional()}).optional(),elicitation:D1.optional(),roots:E({listChanged:_e().optional()}).optional(),tasks:U1.optional()}),F1=Ut.extend({protocolVersion:g(),capabilities:Z1,clientInfo:$S}),Vy=rt.extend({method:Z("initialize"),params:F1});var q1=E({experimental:Ce(g(),tt).optional(),logging:tt.optional(),completions:tt.optional(),prompts:E({listChanged:_e().optional()}).optional(),resources:E({subscribe:_e().optional(),listChanged:_e().optional()}).optional(),tools:E({listChanged:_e().optional()}).optional(),tasks:L1.optional()}),Hy=nt.extend({protocolVersion:g(),capabilities:q1,serverInfo:$S,instructions:g().optional()}),qd=Vt.extend({method:Z("notifications/initialized"),params:qt.optional()}),kS=t=>qd.safeParse(t).success,Vd=rt.extend({method:Z("ping"),params:Ut.optional()}),V1=E({progress:pe(),total:Ae(pe()),message:Ae(g())}),H1=E({...qt.shape,...V1.shape,progressToken:hS}),Hd=Vt.extend({method:Z("notifications/progress"),params:H1}),W1=Ut.extend({cursor:gS.optional()}),$a=rt.extend({params:W1.optional()}),ka=nt.extend({nextCursor:gS.optional()}),B1=et(["working","input_required","completed","failed","cancelled"]),xa=E({taskId:g(),status:B1,ttl:ke([pe(),wo()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:Ae(pe()),statusMessage:Ae(g())}),Dr=nt.extend({task:xa}),G1=qt.merge(xa),Sa=Vt.extend({method:Z("notifications/tasks/status"),params:G1}),Wd=rt.extend({method:Z("tasks/get"),params:Ut.extend({taskId:g()})}),Bd=nt.merge(xa),Gd=rt.extend({method:Z("tasks/result"),params:Ut.extend({taskId:g()})}),qW=nt.loose(),Jd=$a.extend({method:Z("tasks/list")}),Kd=ka.extend({tasks:A(xa)}),Yd=rt.extend({method:Z("tasks/cancel"),params:Ut.extend({taskId:g()})}),xS=nt.merge(xa),SS=E({uri:g(),mimeType:Ae(g()),_meta:Ce(g(),Te()).optional()}),IS=SS.extend({text:g()}),Wy=g().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),TS=SS.extend({blob:Wy}),Ia=et(["user","assistant"]),Io=E({audience:A(Ia).optional(),priority:pe().min(0).max(1).optional(),lastModified:mn.datetime({offset:!0}).optional()}),PS=E({...xo.shape,...wa.shape,uri:g(),description:Ae(g()),mimeType:Ae(g()),annotations:Io.optional(),_meta:Ae(Le({}))}),J1=E({...xo.shape,...wa.shape,uriTemplate:g(),description:Ae(g()),mimeType:Ae(g()),annotations:Io.optional(),_meta:Ae(Le({}))}),Xd=$a.extend({method:Z("resources/list")}),By=ka.extend({resources:A(PS)}),Qd=$a.extend({method:Z("resources/templates/list")}),Gy=ka.extend({resourceTemplates:A(J1)}),Jy=Ut.extend({uri:g()}),K1=Jy,ep=rt.extend({method:Z("resources/read"),params:K1}),Ky=nt.extend({contents:A(ke([IS,TS]))}),Yy=Vt.extend({method:Z("notifications/resources/list_changed"),params:qt.optional()}),Y1=Jy,X1=rt.extend({method:Z("resources/subscribe"),params:Y1}),Q1=Jy,eO=rt.extend({method:Z("resources/unsubscribe"),params:Q1}),tO=qt.extend({uri:g()}),rO=Vt.extend({method:Z("notifications/resources/updated"),params:tO}),nO=E({name:g(),description:Ae(g()),required:Ae(_e())}),iO=E({...xo.shape,...wa.shape,description:Ae(g()),arguments:Ae(A(nO)),_meta:Ae(Le({}))}),tp=$a.extend({method:Z("prompts/list")}),Xy=ka.extend({prompts:A(iO)}),oO=Ut.extend({name:g(),arguments:Ce(g(),g()).optional()}),rp=rt.extend({method:Z("prompts/get"),params:oO}),Qy=E({type:Z("text"),text:g(),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),ev=E({type:Z("image"),data:Wy,mimeType:g(),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),tv=E({type:Z("audio"),data:Wy,mimeType:g(),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),sO=E({type:Z("tool_use"),name:g(),id:g(),input:Ce(g(),Te()),_meta:Ce(g(),Te()).optional()}),aO=E({type:Z("resource"),resource:ke([IS,TS]),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),cO=PS.extend({type:Z("resource_link")}),rv=ke([Qy,ev,tv,cO,aO]),lO=E({role:Ia,content:rv}),nv=nt.extend({description:g().optional(),messages:A(lO)}),iv=Vt.extend({method:Z("notifications/prompts/list_changed"),params:qt.optional()}),uO=E({title:g().optional(),readOnlyHint:_e().optional(),destructiveHint:_e().optional(),idempotentHint:_e().optional(),openWorldHint:_e().optional()}),dO=E({taskSupport:et(["required","optional","forbidden"]).optional()}),zS=E({...xo.shape,...wa.shape,description:g().optional(),inputSchema:E({type:Z("object"),properties:Ce(g(),tt).optional(),required:A(g()).optional()}).catchall(Te()),outputSchema:E({type:Z("object"),properties:Ce(g(),tt).optional(),required:A(g()).optional()}).catchall(Te()).optional(),annotations:uO.optional(),execution:dO.optional(),_meta:Ce(g(),Te()).optional()}),np=$a.extend({method:Z("tools/list")}),ov=ka.extend({tools:A(zS)}),yn=nt.extend({content:A(rv).default([]),structuredContent:Ce(g(),Te()).optional(),isError:_e().optional()}),VW=yn.or(nt.extend({toolResult:Te()})),pO=ba.extend({name:g(),arguments:Ce(g(),Te()).optional()}),To=rt.extend({method:Z("tools/call"),params:pO}),Ta=Vt.extend({method:Z("notifications/tools/list_changed"),params:qt.optional()}),CS=E({autoRefresh:_e().default(!0),debounceMs:pe().int().nonnegative().default(300)}),Pa=et(["debug","info","notice","warning","error","critical","alert","emergency"]),fO=Ut.extend({level:Pa}),sv=rt.extend({method:Z("logging/setLevel"),params:fO}),mO=qt.extend({level:Pa,logger:g().optional(),data:Te()}),hO=Vt.extend({method:Z("notifications/message"),params:mO}),gO=E({name:g().optional()}),yO=E({hints:A(gO).optional(),costPriority:pe().min(0).max(1).optional(),speedPriority:pe().min(0).max(1).optional(),intelligencePriority:pe().min(0).max(1).optional()}),vO=E({mode:et(["auto","required","none"]).optional()}),bO=E({type:Z("tool_result"),toolUseId:g().describe("The unique identifier for the corresponding tool call."),content:A(rv).default([]),structuredContent:E({}).loose().optional(),isError:_e().optional(),_meta:Ce(g(),Te()).optional()}),_O=fa("type",[Qy,ev,tv]),Dd=fa("type",[Qy,ev,tv,sO,bO]),wO=E({role:Ia,content:ke([Dd,A(Dd)]),_meta:Ce(g(),Te()).optional()}),$O=ba.extend({messages:A(wO),modelPreferences:yO.optional(),systemPrompt:g().optional(),includeContext:et(["none","thisServer","allServers"]).optional(),temperature:pe().optional(),maxTokens:pe().int(),stopSequences:A(g()).optional(),metadata:tt.optional(),tools:A(zS).optional(),toolChoice:vO.optional()}),av=rt.extend({method:Z("sampling/createMessage"),params:$O}),Yn=nt.extend({model:g(),stopReason:Ae(et(["endTurn","stopSequence","maxTokens"]).or(g())),role:Ia,content:_O}),za=nt.extend({model:g(),stopReason:Ae(et(["endTurn","stopSequence","maxTokens","toolUse"]).or(g())),role:Ia,content:ke([Dd,A(Dd)])}),kO=E({type:Z("boolean"),title:g().optional(),description:g().optional(),default:_e().optional()}),xO=E({type:Z("string"),title:g().optional(),description:g().optional(),minLength:pe().optional(),maxLength:pe().optional(),format:et(["email","uri","date","date-time"]).optional(),default:g().optional()}),SO=E({type:et(["number","integer"]),title:g().optional(),description:g().optional(),minimum:pe().optional(),maximum:pe().optional(),default:pe().optional()}),IO=E({type:Z("string"),title:g().optional(),description:g().optional(),enum:A(g()),default:g().optional()}),TO=E({type:Z("string"),title:g().optional(),description:g().optional(),oneOf:A(E({const:g(),title:g()})),default:g().optional()}),PO=E({type:Z("string"),title:g().optional(),description:g().optional(),enum:A(g()),enumNames:A(g()).optional(),default:g().optional()}),zO=ke([IO,TO]),CO=E({type:Z("array"),title:g().optional(),description:g().optional(),minItems:pe().optional(),maxItems:pe().optional(),items:E({type:Z("string"),enum:A(g())}),default:A(g()).optional()}),RO=E({type:Z("array"),title:g().optional(),description:g().optional(),minItems:pe().optional(),maxItems:pe().optional(),items:E({anyOf:A(E({const:g(),title:g()}))}),default:A(g()).optional()}),AO=ke([CO,RO]),EO=ke([PO,zO,AO]),OO=ke([EO,kO,xO,SO]),NO=ba.extend({mode:Z("form").optional(),message:g(),requestedSchema:E({type:Z("object"),properties:Ce(g(),OO),required:A(g()).optional()})}),MO=ba.extend({mode:Z("url"),message:g(),elicitationId:g(),url:g().url()}),jO=ke([NO,MO]),cv=rt.extend({method:Z("elicitation/create"),params:jO}),DO=qt.extend({elicitationId:g()}),UO=Vt.extend({method:Z("notifications/elicitation/complete"),params:DO}),vn=nt.extend({action:et(["accept","decline","cancel"]),content:ya(t=>t===null?void 0:t,Ce(g(),ke([g(),pe(),_e(),A(g())])).optional())}),LO=E({type:Z("ref/resource"),uri:g()});var ZO=E({type:Z("ref/prompt"),name:g()}),FO=Ut.extend({ref:ke([ZO,LO]),argument:E({name:g(),value:g()}),context:E({arguments:Ce(g(),g()).optional()}).optional()}),ip=rt.extend({method:Z("completion/complete"),params:FO});function RS(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function AS(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var lv=nt.extend({completion:Le({values:A(g()).max(100),total:Ae(pe().int()),hasMore:Ae(_e())})}),qO=E({uri:g().startsWith("file://"),name:g().optional(),_meta:Ce(g(),Te()).optional()}),VO=rt.extend({method:Z("roots/list"),params:Ut.optional()}),uv=nt.extend({roots:A(qO)}),HO=Vt.extend({method:Z("notifications/roots/list_changed"),params:qt.optional()}),HW=ke([Vd,Vy,ip,sv,rp,tp,Xd,Qd,ep,X1,eO,To,np,Wd,Gd,Jd,Yd]),WW=ke([Fd,Hd,qd,HO,Sa]),BW=ke([jr,Yn,za,vn,uv,Bd,Kd,Dr]),GW=ke([Vd,av,cv,VO,Wd,Gd,Jd,Yd]),JW=ke([Fd,Hd,hO,rO,Yy,Ta,iv,Sa,UO]),KW=ke([jr,Hy,lv,nv,Xy,By,Gy,Ky,yn,ov,Bd,Kd,Dr]),O=class t extends Error{constructor(e,r,i){super(`MCP error ${e}: ${r}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,r,i){if(e===U.UrlElicitationRequired&&i){let n=i;if(n.elicitations)return new Ly(n.elicitations,r)}return new t(e,r,i)}},Ly=class extends O{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function bn(t){return t==="completed"||t==="failed"||t==="cancelled"}var OS=Symbol("Let zodToJsonSchema decide on which parser to use");var ES={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"},NS=t=>typeof t=="string"?{...ES,name:t}:{...ES,...t};var MS=t=>{let e=NS(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...e.basePath,e.definitionPath,i],jsonSchema:void 0}]))}};function dv(t,e,r,i){i?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function fe(t,e,r,i,n){t[e]=r,dv(t,e,i,n)}var op=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")};function Ne(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?op(e,t.currentPath):e.join("/")}}function jS(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==C.ZodAny&&(r.items=B(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&fe(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&fe(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(fe(r,"minItems",t.exactLength.value,t.exactLength.message,e),fe(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function DS(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let i of t.checks)switch(i.kind){case"min":e.target==="jsonSchema7"?i.inclusive?fe(r,"minimum",i.value,i.message,e):fe(r,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(r.exclusiveMinimum=!0),fe(r,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?fe(r,"maximum",i.value,i.message,e):fe(r,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(r.exclusiveMaximum=!0),fe(r,"maximum",i.value,i.message,e));break;case"multipleOf":fe(r,"multipleOf",i.value,i.message,e);break}return r}function US(){return{type:"boolean"}}function sp(t,e){return B(t.type._def,e)}var LS=(t,e)=>B(t.innerType._def,e);function pv(t,e,r){let i=r??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>pv(t,e,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 WO(t,e)}}var WO=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let i of t.checks)switch(i.kind){case"min":fe(r,"minimum",i.value,i.message,e);break;case"max":fe(r,"maximum",i.value,i.message,e);break}return r};function ZS(t,e){return{...B(t.innerType._def,e),default:t.defaultValue()}}function FS(t,e){return e.effectStrategy==="input"?B(t.schema._def,e):Ne(e)}function qS(t){return{type:"string",enum:Array.from(t.values)}}var BO=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function VS(t,e){let r=[B(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),B(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),i=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(o=>{if(BO(o))n.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:a,...c}=o;s=c}else i=void 0;n.push(s)}}),n.length?{allOf:n,...i}:void 0}function HS(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var fv,nr={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:()=>(fv===void 0&&(fv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),fv),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 ap(t,e){let r={type:"string"};if(t.checks)for(let i of t.checks)switch(i.kind){case"min":fe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e);break;case"max":fe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":ir(r,"email",i.message,e);break;case"format:idn-email":ir(r,"idn-email",i.message,e);break;case"pattern:zod":vt(r,nr.email,i.message,e);break}break;case"url":ir(r,"uri",i.message,e);break;case"uuid":ir(r,"uuid",i.message,e);break;case"regex":vt(r,i.regex,i.message,e);break;case"cuid":vt(r,nr.cuid,i.message,e);break;case"cuid2":vt(r,nr.cuid2,i.message,e);break;case"startsWith":vt(r,RegExp(`^${mv(i.value,e)}`),i.message,e);break;case"endsWith":vt(r,RegExp(`${mv(i.value,e)}$`),i.message,e);break;case"datetime":ir(r,"date-time",i.message,e);break;case"date":ir(r,"date",i.message,e);break;case"time":ir(r,"time",i.message,e);break;case"duration":ir(r,"duration",i.message,e);break;case"length":fe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e),fe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"includes":{vt(r,RegExp(mv(i.value,e)),i.message,e);break}case"ip":{i.version!=="v6"&&ir(r,"ipv4",i.message,e),i.version!=="v4"&&ir(r,"ipv6",i.message,e);break}case"base64url":vt(r,nr.base64url,i.message,e);break;case"jwt":vt(r,nr.jwt,i.message,e);break;case"cidr":{i.version!=="v6"&&vt(r,nr.ipv4Cidr,i.message,e),i.version!=="v4"&&vt(r,nr.ipv6Cidr,i.message,e);break}case"emoji":vt(r,nr.emoji(),i.message,e);break;case"ulid":{vt(r,nr.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{ir(r,"binary",i.message,e);break}case"contentEncoding:base64":{fe(r,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{vt(r,nr.base64,i.message,e);break}}break}case"nanoid":vt(r,nr.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function mv(t,e){return e.patternStrategy==="escape"?JO(t):t}var GO=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function JO(t){let e="";for(let r=0;r<t.length;r++)GO.has(t[r])||(e+="\\"),e+=t[r];return e}function ir(t,e,r,i){t.format||t.anyOf?.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&i.errorMessages&&{errorMessage:{format:r}}})):fe(t,"format",e,r,i)}function vt(t,e,r,i){t.pattern||t.allOf?.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:WS(e,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):fe(t,"pattern",WS(e,i),r,i)}function WS(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source,n="",o=!1,s=!1,a=!1;for(let c=0;c<i.length;c++){if(o){n+=i[c],o=!1;continue}if(r.i){if(s){if(i[c].match(/[a-z]/)){a?(n+=i[c],n+=`${i[c-2]}-${i[c]}`.toUpperCase(),a=!1):i[c+1]==="-"&&i[c+2]?.match(/[a-z]/)?(n+=i[c],a=!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
|
|
96
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let l=t.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function fn(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let f=t.seen.get(d),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===d)for(let y in l)y==="$ref"||y==="allOf"||y in u||delete l[y];if(m.$ref&&f.def)for(let y in l)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(l[y])===JSON.stringify(f.def[y])&&delete l[y]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=t.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a)}Object.assign(n,r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&n.id===o&&delete n.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:po(e,"input",t.processors),output:po(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function gt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return gt(i.element,r);if(i.type==="set")return gt(i.valueType,r);if(i.type==="lazy")return gt(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 gt(i.innerType,r);if(i.type==="intersection")return gt(i.left,r)||gt(i.right,r);if(i.type==="record"||i.type==="map")return gt(i.keyType,r)||gt(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:gt(i.in,r)||gt(i.out,r);if(i.type==="object"){for(let n in i.shape)if(gt(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(gt(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(gt(n,r))return!0;return!!(i.rest&>(i.rest,r))}return!1}var Kh=(t,e={})=>r=>{let i=dn({...r,processors:e});return be(t,i),pn(i,t),fn(i,t)},po=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=dn({...n??{},target:o,io:e,processors:r});return be(t,s),pn(s,t),fn(s,t)};var h1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Yh=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=h1[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Xh=(t,e,r,i)=>{let n=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),p=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof o=="number"&&(n.minimum=o),p?f?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof s=="number"&&(n.maximum=s),typeof c=="number"&&(n.multipleOf=c)},Qh=(t,e,r,i)=>{r.type="boolean"},eg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},tg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},rg=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},ng=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ig=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},og=(t,e,r,i)=>{r.not={}},sg=(t,e,r,i)=>{},ag=(t,e,r,i)=>{},cg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},lg=(t,e,r,i)=>{let n=t._zod.def,o=$s(n.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},ug=(t,e,r,i)=>{let n=t._zod.def,o=[];for(let s of n.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},dg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},pg=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},fg=(t,e,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,o)},mg=(t,e,r,i)=>{r.type="boolean"},hg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},yg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},vg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},bg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},_g=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=be(o.element,e,{...i,path:[...i.path,"items"]})},wg=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object",n.properties={};let s=o.shape;for(let l in s)n.properties[l]=be(s[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.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=be(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},rd=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,s=n.options.map((a,c)=>be(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},$g=(t,e,r,i)=>{let n=t._zod.def,o=be(n.left,e,{...i,path:[...i.path,"allOf",0]}),s=be(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},kg=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((p,f)=>be(p,e,{...i,path:[...i.path,s,f]})),l=o.rest?be(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):e.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d)},xg=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=be(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=be(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=be(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u)}},Sg=(t,e,r,i)=>{let n=t._zod.def,o=be(n.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Ig=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Tg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Pg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},zg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Cg=(t,e,r,i)=>{let n=t._zod.def,o=n.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?n.out:n.in:n.out;be(s,e,i);let a=e.seen.get(t);a.ref=s},Ag=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},Rg=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},nd=(t,e,r,i)=>{let n=t._zod.def;be(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Eg=(t,e,r,i)=>{let n=t._zod.innerType;be(n,e,i);let o=e.seen.get(t);o.ref=n},td={string:Yh,number:Xh,boolean:Qh,bigint:eg,symbol:tg,null:rg,undefined:ng,void:ig,never:og,any:sg,unknown:ag,date:cg,enum:lg,literal:ug,nan:dg,template_literal:pg,file:fg,success:mg,custom:hg,function:gg,transform:yg,map:vg,set:bg,array:_g,object:wg,union:rd,intersection:$g,tuple:kg,record:xg,nullable:Sg,nonoptional:Ig,default:Tg,prefault:Pg,catch:zg,pipe:Cg,readonly:Ag,promise:Rg,optional:nd,lazy:Eg};function Bn(t,e){if("_idmap"in t){let i=t,n=dn({...e,processors:td}),o={};for(let c of i._idmap.entries()){let[l,u]=c;be(u,n)}let s={},a={registry:i,uri:e?.uri,defs:o};n.external=a;for(let c of i._idmap.entries()){let[l,u]=c;pn(n,u),s[l]=fn(n,u)}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=dn({...e,processors:td});return be(t,r),pn(r,t),fn(r,t)}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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=dn({processors:td,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return be(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),pn(this.ctx,e);let i=fn(this.ctx,e),{"~standard":n,...o}=i;return o}};var tx={};var v1=v("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(t,e),t.def=e,t.type=e.type,t.parse=(r,i)=>Ln(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>sn(t,r,i),t.parseAsync=async(r,i)=>Zn(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>an(t,r,i),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),t.with=t.check,t.clone=(r,i)=>Xe(t,r,i),t.brand=()=>t,t.register=(r,i)=>(r.add(t,i),t),t.apply=r=>r(t)});var b1=v("ZodMiniObject",(t,e)=>{Wl.init(t,e),v1.init(t,e),Q(t,"shape",()=>e.shape)});function Og(t,e){let r={type:"object",shape:t??{},...A(e)};return new b1(r)}function Tt(t){return!!t._zod}function Gn(t){let e=Object.values(t);if(e.length===0)return Og({});let r=e.every(Tt),i=e.every(n=>!Tt(n));if(r)return Og(t);if(i)return l$(t);throw new Error("Mixed Zod versions detected in object shape.")}function yt(t,e){return Tt(t)?sn(t,e):t.safeParse(e)}async function od(t,e){return Tt(t)?await an(t,e):await t.safeParseAsync(e)}function vr(t){if(!t)return;let e;if(Tt(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function fo(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let i=Object.values(t);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 Gn(t)}}if(Tt(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function sd(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function rx(t){return t.description}function nx(t){if(Tt(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function ad(t){if(Tt(t)){let o=t._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=t._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=t.value;if(i!==void 0)return i}var F={};zr(F,{$brand:()=>$m,$input:()=>Dh,$output:()=>jh,NEVER:()=>_s,TimePrecision:()=>Lh,ZodAny:()=>ty,ZodArray:()=>oy,ZodBase64:()=>zd,ZodBase64URL:()=>Cd,ZodBigInt:()=>_o,ZodBigIntFormat:()=>Ed,ZodBoolean:()=>bo,ZodCIDRv4:()=>Td,ZodCIDRv6:()=>Pd,ZodCUID:()=>_d,ZodCUID2:()=>wd,ZodCatch:()=>Sy,ZodCodec:()=>ha,ZodCustom:()=>ga,ZodCustomStringFormat:()=>yo,ZodDate:()=>ua,ZodDefault:()=>by,ZodDiscriminatedUnion:()=>ay,ZodE164:()=>Ad,ZodEmail:()=>gd,ZodEmoji:()=>vd,ZodEnum:()=>ho,ZodError:()=>w1,ZodExactOptional:()=>gy,ZodFile:()=>my,ZodFirstPartyTypeKind:()=>Dy,ZodFunction:()=>Ny,ZodGUID:()=>sa,ZodIPv4:()=>Sd,ZodIPv6:()=>Id,ZodISODate:()=>ud,ZodISODateTime:()=>ld,ZodISODuration:()=>pd,ZodISOTime:()=>dd,ZodIntersection:()=>cy,ZodIssueCode:()=>Uy,ZodJWT:()=>Rd,ZodKSUID:()=>xd,ZodLazy:()=>Ry,ZodLiteral:()=>fy,ZodMAC:()=>Yg,ZodMap:()=>dy,ZodNaN:()=>Ty,ZodNanoID:()=>bd,ZodNever:()=>ny,ZodNonOptional:()=>jd,ZodNull:()=>ey,ZodNullable:()=>vy,ZodNumber:()=>vo,ZodNumberFormat:()=>Jn,ZodObject:()=>da,ZodOptional:()=>ko,ZodPipe:()=>ma,ZodPrefault:()=>wy,ZodPreprocess:()=>Py,ZodPromise:()=>Oy,ZodReadonly:()=>zy,ZodRealError:()=>Pt,ZodRecord:()=>mo,ZodSet:()=>py,ZodString:()=>go,ZodStringFormat:()=>Ie,ZodSuccess:()=>xy,ZodSymbol:()=>Xg,ZodTemplateLiteral:()=>Ay,ZodTransform:()=>hy,ZodTuple:()=>ly,ZodType:()=>X,ZodULID:()=>$d,ZodURL:()=>la,ZodUUID:()=>br,ZodUndefined:()=>Qg,ZodUnion:()=>pa,ZodUnknown:()=>ry,ZodVoid:()=>iy,ZodXID:()=>kd,ZodXor:()=>sy,_ZodString:()=>hd,_default:()=>_y,_function:()=>sS,any:()=>Od,array:()=>R,base64:()=>Sx,base64url:()=>Ix,bigint:()=>jx,boolean:()=>_e,catch:()=>Iy,check:()=>aS,cidrv4:()=>kx,cidrv6:()=>xx,clone:()=>Xe,codec:()=>rS,coerce:()=>va,config:()=>Ue,core:()=>rr,cuid:()=>hx,cuid2:()=>gx,custom:()=>Dd,date:()=>qx,decode:()=>Vg,decodeAsync:()=>Wg,describe:()=>cS,discriminatedUnion:()=>fa,e164:()=>Tx,email:()=>sx,emoji:()=>fx,encode:()=>qg,encodeAsync:()=>Hg,endsWith:()=>io,enum:()=>et,exactOptional:()=>yy,file:()=>Xx,flattenError:()=>Ps,float32:()=>Ex,float64:()=>Ox,formatError:()=>zs,fromJSONSchema:()=>mS,function:()=>sS,getErrorMap:()=>x1,globalRegistry:()=>Qe,gt:()=>gr,gte:()=>ht,guid:()=>ax,hash:()=>Rx,hex:()=>Ax,hostname:()=>Cx,httpUrl:()=>px,includes:()=>ro,instanceof:()=>uS,int:()=>fd,int32:()=>Nx,int64:()=>Dx,intersection:()=>$o,invertCodec:()=>nS,ipv4:()=>_x,ipv6:()=>$x,iso:()=>mn,json:()=>pS,jwt:()=>Px,keyof:()=>Vx,ksuid:()=>bx,lazy:()=>Ey,length:()=>Hn,literal:()=>Z,locales:()=>Ki,looseObject:()=>Le,looseRecord:()=>Gx,lowercase:()=>eo,lt:()=>hr,lte:()=>Dt,mac:()=>wx,map:()=>Jx,maxLength:()=>Vn,maxSize:()=>un,meta:()=>lS,mime:()=>oo,minLength:()=>Mr,minSize:()=>yr,multipleOf:()=>ln,nan:()=>tS,nanoid:()=>mx,nativeEnum:()=>Yx,negative:()=>Vu,never:()=>Nd,nonnegative:()=>Wu,nonoptional:()=>ky,nonpositive:()=>Hu,normalize:()=>so,null:()=>wo,nullable:()=>aa,nullish:()=>Qx,number:()=>pe,object:()=>E,optional:()=>Re,overwrite:()=>tr,parse:()=>Ug,parseAsync:()=>Lg,partialRecord:()=>Bx,pipe:()=>md,positive:()=>qu,prefault:()=>$y,preprocess:()=>ya,prettifyError:()=>Om,promise:()=>oS,property:()=>Bu,readonly:()=>Cy,record:()=>Ce,refine:()=>My,regex:()=>Qi,regexes:()=>It,registry:()=>wu,safeDecode:()=>Gg,safeDecodeAsync:()=>Kg,safeEncode:()=>Bg,safeEncodeAsync:()=>Jg,safeParse:()=>Zg,safeParseAsync:()=>Fg,set:()=>Kx,setErrorMap:()=>k1,size:()=>qn,slugify:()=>uo,startsWith:()=>no,strictObject:()=>Hx,string:()=>g,stringFormat:()=>zx,stringbool:()=>dS,success:()=>eS,superRefine:()=>jy,symbol:()=>Lx,templateLiteral:()=>iS,toJSONSchema:()=>Bn,toLowerCase:()=>co,toUpperCase:()=>lo,transform:()=>Md,treeifyError:()=>Em,trim:()=>ao,tuple:()=>uy,uint32:()=>Mx,uint64:()=>Ux,ulid:()=>yx,undefined:()=>Zx,union:()=>ke,unknown:()=>Te,uppercase:()=>to,url:()=>yd,util:()=>P,uuid:()=>cx,uuidv4:()=>lx,uuidv6:()=>ux,uuidv7:()=>dx,void:()=>Fx,xid:()=>vx,xor:()=>Wx});var oa={};zr(oa,{ZodAny:()=>ty,ZodArray:()=>oy,ZodBase64:()=>zd,ZodBase64URL:()=>Cd,ZodBigInt:()=>_o,ZodBigIntFormat:()=>Ed,ZodBoolean:()=>bo,ZodCIDRv4:()=>Td,ZodCIDRv6:()=>Pd,ZodCUID:()=>_d,ZodCUID2:()=>wd,ZodCatch:()=>Sy,ZodCodec:()=>ha,ZodCustom:()=>ga,ZodCustomStringFormat:()=>yo,ZodDate:()=>ua,ZodDefault:()=>by,ZodDiscriminatedUnion:()=>ay,ZodE164:()=>Ad,ZodEmail:()=>gd,ZodEmoji:()=>vd,ZodEnum:()=>ho,ZodExactOptional:()=>gy,ZodFile:()=>my,ZodFunction:()=>Ny,ZodGUID:()=>sa,ZodIPv4:()=>Sd,ZodIPv6:()=>Id,ZodIntersection:()=>cy,ZodJWT:()=>Rd,ZodKSUID:()=>xd,ZodLazy:()=>Ry,ZodLiteral:()=>fy,ZodMAC:()=>Yg,ZodMap:()=>dy,ZodNaN:()=>Ty,ZodNanoID:()=>bd,ZodNever:()=>ny,ZodNonOptional:()=>jd,ZodNull:()=>ey,ZodNullable:()=>vy,ZodNumber:()=>vo,ZodNumberFormat:()=>Jn,ZodObject:()=>da,ZodOptional:()=>ko,ZodPipe:()=>ma,ZodPrefault:()=>wy,ZodPreprocess:()=>Py,ZodPromise:()=>Oy,ZodReadonly:()=>zy,ZodRecord:()=>mo,ZodSet:()=>py,ZodString:()=>go,ZodStringFormat:()=>Ie,ZodSuccess:()=>xy,ZodSymbol:()=>Xg,ZodTemplateLiteral:()=>Ay,ZodTransform:()=>hy,ZodTuple:()=>ly,ZodType:()=>X,ZodULID:()=>$d,ZodURL:()=>la,ZodUUID:()=>br,ZodUndefined:()=>Qg,ZodUnion:()=>pa,ZodUnknown:()=>ry,ZodVoid:()=>iy,ZodXID:()=>kd,ZodXor:()=>sy,_ZodString:()=>hd,_default:()=>_y,_function:()=>sS,any:()=>Od,array:()=>R,base64:()=>Sx,base64url:()=>Ix,bigint:()=>jx,boolean:()=>_e,catch:()=>Iy,check:()=>aS,cidrv4:()=>kx,cidrv6:()=>xx,codec:()=>rS,cuid:()=>hx,cuid2:()=>gx,custom:()=>Dd,date:()=>qx,describe:()=>cS,discriminatedUnion:()=>fa,e164:()=>Tx,email:()=>sx,emoji:()=>fx,enum:()=>et,exactOptional:()=>yy,file:()=>Xx,float32:()=>Ex,float64:()=>Ox,function:()=>sS,guid:()=>ax,hash:()=>Rx,hex:()=>Ax,hostname:()=>Cx,httpUrl:()=>px,instanceof:()=>uS,int:()=>fd,int32:()=>Nx,int64:()=>Dx,intersection:()=>$o,invertCodec:()=>nS,ipv4:()=>_x,ipv6:()=>$x,json:()=>pS,jwt:()=>Px,keyof:()=>Vx,ksuid:()=>bx,lazy:()=>Ey,literal:()=>Z,looseObject:()=>Le,looseRecord:()=>Gx,mac:()=>wx,map:()=>Jx,meta:()=>lS,nan:()=>tS,nanoid:()=>mx,nativeEnum:()=>Yx,never:()=>Nd,nonoptional:()=>ky,null:()=>wo,nullable:()=>aa,nullish:()=>Qx,number:()=>pe,object:()=>E,optional:()=>Re,partialRecord:()=>Bx,pipe:()=>md,prefault:()=>$y,preprocess:()=>ya,promise:()=>oS,readonly:()=>Cy,record:()=>Ce,refine:()=>My,set:()=>Kx,strictObject:()=>Hx,string:()=>g,stringFormat:()=>zx,stringbool:()=>dS,success:()=>eS,superRefine:()=>jy,symbol:()=>Lx,templateLiteral:()=>iS,transform:()=>Md,tuple:()=>uy,uint32:()=>Mx,uint64:()=>Ux,ulid:()=>yx,undefined:()=>Zx,union:()=>ke,unknown:()=>Te,url:()=>yd,uuid:()=>cx,uuidv4:()=>lx,uuidv6:()=>ux,uuidv7:()=>dx,void:()=>Fx,xid:()=>vx,xor:()=>Wx});var cd={};zr(cd,{endsWith:()=>io,gt:()=>gr,gte:()=>ht,includes:()=>ro,length:()=>Hn,lowercase:()=>eo,lt:()=>hr,lte:()=>Dt,maxLength:()=>Vn,maxSize:()=>un,mime:()=>oo,minLength:()=>Mr,minSize:()=>yr,multipleOf:()=>ln,negative:()=>Vu,nonnegative:()=>Wu,nonpositive:()=>Hu,normalize:()=>so,overwrite:()=>tr,positive:()=>qu,property:()=>Bu,regex:()=>Qi,size:()=>qn,slugify:()=>uo,startsWith:()=>no,toLowerCase:()=>co,toUpperCase:()=>lo,trim:()=>ao,uppercase:()=>to});var mn={};zr(mn,{ZodISODate:()=>ud,ZodISODateTime:()=>ld,ZodISODuration:()=>pd,ZodISOTime:()=>dd,date:()=>Mg,datetime:()=>Ng,duration:()=>Dg,time:()=>jg});var ld=v("ZodISODateTime",(t,e)=>{Ch.init(t,e),Ie.init(t,e)});function Ng(t){return Zh(ld,t)}var ud=v("ZodISODate",(t,e)=>{Ah.init(t,e),Ie.init(t,e)});function Mg(t){return Fh(ud,t)}var dd=v("ZodISOTime",(t,e)=>{Rh.init(t,e),Ie.init(t,e)});function jg(t){return qh(dd,t)}var pd=v("ZodISODuration",(t,e)=>{Eh.init(t,e),Ie.init(t,e)});function Dg(t){return Vh(pd,t)}var ix=(t,e)=>{Ts.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>zs(t,r)},flatten:{value:r=>Ps(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Di,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Di,2)}},isEmpty:{get(){return t.issues.length===0}}})},w1=v("ZodError",ix),Pt=v("ZodError",ix,{Parent:Error});var Ug=Zi(Pt),Lg=Fi(Pt),Zg=qi(Pt),Fg=Vi(Pt),qg=Xc(Pt),Vg=Qc(Pt),Hg=el(Pt),Wg=tl(Pt),Bg=rl(Pt),Gg=nl(Pt),Jg=il(Pt),Kg=ol(Pt);var ox=new WeakMap;function ca(t,e,r){let i=Object.getPrototypeOf(t),n=ox.get(i);if(n||(n=new Set,ox.set(i,n)),!n.has(e)){n.add(e);for(let o in r){let s=r[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var X=v("ZodType",(t,e)=>(J.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:po(t,"input"),output:po(t,"output")}}),t.toJSONSchema=Kh(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,i)=>Ug(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>Zg(t,r,i),t.parseAsync=async(r,i)=>Lg(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Fg(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>qg(t,r,i),t.decode=(r,i)=>Vg(t,r,i),t.encodeAsync=async(r,i)=>Hg(t,r,i),t.decodeAsync=async(r,i)=>Wg(t,r,i),t.safeEncode=(r,i)=>Bg(t,r,i),t.safeDecode=(r,i)=>Gg(t,r,i),t.safeEncodeAsync=async(r,i)=>Jg(t,r,i),t.safeDecodeAsync=async(r,i)=>Kg(t,r,i),ca(t,"ZodType",{check(...r){let i=this.def;return this.clone(P.mergeDefs(i,{checks:[...i.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Xe(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(My(r,i))},superRefine(r,i){return this.check(jy(r,i))},overwrite(r){return this.check(tr(r))},optional(){return Re(this)},exactOptional(){return yy(this)},nullable(){return aa(this)},nullish(){return Re(aa(this))},nonoptional(r){return ky(this,r)},array(){return R(this)},or(r){return ke([this,r])},and(r){return $o(this,r)},transform(r){return md(this,Md(r))},default(r){return _y(this,r)},prefault(r){return $y(this,r)},catch(r){return Iy(this,r)},pipe(r){return md(this,r)},readonly(){return Cy(this)},describe(r){let i=this.clone();return Qe.add(i,{description:r}),i},meta(...r){if(r.length===0)return Qe.get(this);let i=this.clone();return Qe.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Qe.get(t)?.description},configurable:!0}),t)),hd=v("_ZodString",(t,e)=>{cn.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Yh(t,i,n,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,ca(t,"_ZodString",{regex(...i){return this.check(Qi(...i))},includes(...i){return this.check(ro(...i))},startsWith(...i){return this.check(no(...i))},endsWith(...i){return this.check(io(...i))},min(...i){return this.check(Mr(...i))},max(...i){return this.check(Vn(...i))},length(...i){return this.check(Hn(...i))},nonempty(...i){return this.check(Mr(1,...i))},lowercase(i){return this.check(eo(i))},uppercase(i){return this.check(to(i))},trim(){return this.check(ao())},normalize(...i){return this.check(so(...i))},toLowerCase(){return this.check(co())},toUpperCase(){return this.check(lo())},slugify(){return this.check(uo())}})}),go=v("ZodString",(t,e)=>{cn.init(t,e),hd.init(t,e),t.email=r=>t.check(Us(gd,r)),t.url=r=>t.check(Xi(la,r)),t.jwt=r=>t.check(ia(Rd,r)),t.emoji=r=>t.check(Vs(vd,r)),t.guid=r=>t.check(Yi(sa,r)),t.uuid=r=>t.check(Ls(br,r)),t.uuidv4=r=>t.check(Zs(br,r)),t.uuidv6=r=>t.check(Fs(br,r)),t.uuidv7=r=>t.check(qs(br,r)),t.nanoid=r=>t.check(Hs(bd,r)),t.guid=r=>t.check(Yi(sa,r)),t.cuid=r=>t.check(Ws(_d,r)),t.cuid2=r=>t.check(Bs(wd,r)),t.ulid=r=>t.check(Gs($d,r)),t.base64=r=>t.check(ta(zd,r)),t.base64url=r=>t.check(ra(Cd,r)),t.xid=r=>t.check(Js(kd,r)),t.ksuid=r=>t.check(Ks(xd,r)),t.ipv4=r=>t.check(Ys(Sd,r)),t.ipv6=r=>t.check(Xs(Id,r)),t.cidrv4=r=>t.check(Qs(Td,r)),t.cidrv6=r=>t.check(ea(Pd,r)),t.e164=r=>t.check(na(Ad,r)),t.datetime=r=>t.check(Ng(r)),t.date=r=>t.check(Mg(r)),t.time=r=>t.check(jg(r)),t.duration=r=>t.check(Dg(r))});function g(t){return $u(go,t)}var Ie=v("ZodStringFormat",(t,e)=>{$e.init(t,e),hd.init(t,e)}),gd=v("ZodEmail",(t,e)=>{gl.init(t,e),Ie.init(t,e)});function sx(t){return Us(gd,t)}var sa=v("ZodGUID",(t,e)=>{ml.init(t,e),Ie.init(t,e)});function ax(t){return Yi(sa,t)}var br=v("ZodUUID",(t,e)=>{hl.init(t,e),Ie.init(t,e)});function cx(t){return Ls(br,t)}function lx(t){return Zs(br,t)}function ux(t){return Fs(br,t)}function dx(t){return qs(br,t)}var la=v("ZodURL",(t,e)=>{yl.init(t,e),Ie.init(t,e)});function yd(t){return Xi(la,t)}function px(t){return Xi(la,{protocol:It.httpProtocol,hostname:It.domain,...P.normalizeParams(t)})}var vd=v("ZodEmoji",(t,e)=>{vl.init(t,e),Ie.init(t,e)});function fx(t){return Vs(vd,t)}var bd=v("ZodNanoID",(t,e)=>{bl.init(t,e),Ie.init(t,e)});function mx(t){return Hs(bd,t)}var _d=v("ZodCUID",(t,e)=>{_l.init(t,e),Ie.init(t,e)});function hx(t){return Ws(_d,t)}var wd=v("ZodCUID2",(t,e)=>{wl.init(t,e),Ie.init(t,e)});function gx(t){return Bs(wd,t)}var $d=v("ZodULID",(t,e)=>{$l.init(t,e),Ie.init(t,e)});function yx(t){return Gs($d,t)}var kd=v("ZodXID",(t,e)=>{kl.init(t,e),Ie.init(t,e)});function vx(t){return Js(kd,t)}var xd=v("ZodKSUID",(t,e)=>{xl.init(t,e),Ie.init(t,e)});function bx(t){return Ks(xd,t)}var Sd=v("ZodIPv4",(t,e)=>{Sl.init(t,e),Ie.init(t,e)});function _x(t){return Ys(Sd,t)}var Yg=v("ZodMAC",(t,e)=>{Tl.init(t,e),Ie.init(t,e)});function wx(t){return ku(Yg,t)}var Id=v("ZodIPv6",(t,e)=>{Il.init(t,e),Ie.init(t,e)});function $x(t){return Xs(Id,t)}var Td=v("ZodCIDRv4",(t,e)=>{Pl.init(t,e),Ie.init(t,e)});function kx(t){return Qs(Td,t)}var Pd=v("ZodCIDRv6",(t,e)=>{zl.init(t,e),Ie.init(t,e)});function xx(t){return ea(Pd,t)}var zd=v("ZodBase64",(t,e)=>{Cl.init(t,e),Ie.init(t,e)});function Sx(t){return ta(zd,t)}var Cd=v("ZodBase64URL",(t,e)=>{Al.init(t,e),Ie.init(t,e)});function Ix(t){return ra(Cd,t)}var Ad=v("ZodE164",(t,e)=>{Rl.init(t,e),Ie.init(t,e)});function Tx(t){return na(Ad,t)}var Rd=v("ZodJWT",(t,e)=>{El.init(t,e),Ie.init(t,e)});function Px(t){return ia(Rd,t)}var yo=v("ZodCustomStringFormat",(t,e)=>{Ol.init(t,e),Ie.init(t,e)});function zx(t,e,r={}){return Wn(yo,t,e,r)}function Cx(t){return Wn(yo,"hostname",It.hostname,t)}function Ax(t){return Wn(yo,"hex",It.hex,t)}function Rx(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=It[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Wn(yo,i,n,e)}var vo=v("ZodNumber",(t,e)=>{Es.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Xh(t,i,n,o),ca(t,"ZodNumber",{gt(i,n){return this.check(gr(i,n))},gte(i,n){return this.check(ht(i,n))},min(i,n){return this.check(ht(i,n))},lt(i,n){return this.check(hr(i,n))},lte(i,n){return this.check(Dt(i,n))},max(i,n){return this.check(Dt(i,n))},int(i){return this.check(fd(i))},safe(i){return this.check(fd(i))},positive(i){return this.check(gr(0,i))},nonnegative(i){return this.check(ht(0,i))},negative(i){return this.check(hr(0,i))},nonpositive(i){return this.check(Dt(0,i))},multipleOf(i,n){return this.check(ln(i,n))},step(i,n){return this.check(ln(i,n))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function pe(t){return xu(vo,t)}var Jn=v("ZodNumberFormat",(t,e)=>{Nl.init(t,e),vo.init(t,e)});function fd(t){return Su(Jn,t)}function Ex(t){return Iu(Jn,t)}function Ox(t){return Tu(Jn,t)}function Nx(t){return Pu(Jn,t)}function Mx(t){return zu(Jn,t)}var bo=v("ZodBoolean",(t,e)=>{Wi.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Qh(t,r,i,n)});function _e(t){return Cu(bo,t)}var _o=v("ZodBigInt",(t,e)=>{Os.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>eg(t,i,n,o),t.gte=(i,n)=>t.check(ht(i,n)),t.min=(i,n)=>t.check(ht(i,n)),t.gt=(i,n)=>t.check(gr(i,n)),t.gte=(i,n)=>t.check(ht(i,n)),t.min=(i,n)=>t.check(ht(i,n)),t.lt=(i,n)=>t.check(hr(i,n)),t.lte=(i,n)=>t.check(Dt(i,n)),t.max=(i,n)=>t.check(Dt(i,n)),t.positive=i=>t.check(gr(BigInt(0),i)),t.negative=i=>t.check(hr(BigInt(0),i)),t.nonpositive=i=>t.check(Dt(BigInt(0),i)),t.nonnegative=i=>t.check(ht(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(ln(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function jx(t){return Au(_o,t)}var Ed=v("ZodBigIntFormat",(t,e)=>{Ml.init(t,e),_o.init(t,e)});function Dx(t){return Ru(Ed,t)}function Ux(t){return Eu(Ed,t)}var Xg=v("ZodSymbol",(t,e)=>{jl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tg(t,r,i,n)});function Lx(t){return Ou(Xg,t)}var Qg=v("ZodUndefined",(t,e)=>{Dl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ng(t,r,i,n)});function Zx(t){return Nu(Qg,t)}var ey=v("ZodNull",(t,e)=>{Ul.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rg(t,r,i,n)});function wo(t){return Mu(ey,t)}var ty=v("ZodAny",(t,e)=>{Ll.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sg(t,r,i,n)});function Od(){return ju(ty)}var ry=v("ZodUnknown",(t,e)=>{Zl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ag(t,r,i,n)});function Te(){return Du(ry)}var ny=v("ZodNever",(t,e)=>{Fl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>og(t,r,i,n)});function Nd(t){return Uu(ny,t)}var iy=v("ZodVoid",(t,e)=>{ql.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ig(t,r,i,n)});function Fx(t){return Lu(iy,t)}var ua=v("ZodDate",(t,e)=>{Vl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>cg(t,i,n,o),t.min=(i,n)=>t.check(ht(i,n)),t.max=(i,n)=>t.check(Dt(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function qx(t){return Zu(ua,t)}var oy=v("ZodArray",(t,e)=>{Hl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_g(t,r,i,n),t.element=e.element,ca(t,"ZodArray",{min(r,i){return this.check(Mr(r,i))},nonempty(r){return this.check(Mr(1,r))},max(r,i){return this.check(Vn(r,i))},length(r,i){return this.check(Hn(r,i))},unwrap(){return this.element}})});function R(t,e){return Jh(oy,t,e)}function Vx(t){let e=t._zod.def.shape;return et(Object.keys(e))}var da=v("ZodObject",(t,e)=>{Nh.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>wg(t,r,i,n),P.defineLazy(t,"shape",()=>e.shape),ca(t,"ZodObject",{keyof(){return et(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Te()})},loose(){return this.clone({...this._zod.def,catchall:Te()})},strict(){return this.clone({...this._zod.def,catchall:Nd()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return P.extend(this,r)},safeExtend(r){return P.safeExtend(this,r)},merge(r){return P.merge(this,r)},pick(r){return P.pick(this,r)},omit(r){return P.omit(this,r)},partial(...r){return P.partial(ko,this,r[0])},required(...r){return P.required(jd,this,r[0])}})});function E(t,e){let r={type:"object",shape:t??{},...P.normalizeParams(e)};return new da(r)}function Hx(t,e){return new da({type:"object",shape:t,catchall:Nd(),...P.normalizeParams(e)})}function Le(t,e){return new da({type:"object",shape:t,catchall:Te(),...P.normalizeParams(e)})}var pa=v("ZodUnion",(t,e)=>{Bi.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rd(t,r,i,n),t.options=e.options});function ke(t,e){return new pa({type:"union",options:t,...P.normalizeParams(e)})}var sy=v("ZodXor",(t,e)=>{pa.init(t,e),Bl.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rd(t,r,i,n),t.options=e.options});function Wx(t,e){return new sy({type:"union",options:t,inclusive:!1,...P.normalizeParams(e)})}var ay=v("ZodDiscriminatedUnion",(t,e)=>{pa.init(t,e),Gl.init(t,e)});function fa(t,e,r){return new ay({type:"union",options:e,discriminator:t,...P.normalizeParams(r)})}var cy=v("ZodIntersection",(t,e)=>{Jl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$g(t,r,i,n)});function $o(t,e){return new cy({type:"intersection",left:t,right:e})}var ly=v("ZodTuple",(t,e)=>{Ns.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>kg(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r})});function uy(t,e,r){let i=e instanceof J,n=i?r:e,o=i?e:null;return new ly({type:"tuple",items:t,rest:o,...P.normalizeParams(n)})}var mo=v("ZodRecord",(t,e)=>{Kl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xg(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});function Ce(t,e,r){return!e||!e._zod?new mo({type:"record",keyType:g(),valueType:t,...P.normalizeParams(e)}):new mo({type:"record",keyType:t,valueType:e,...P.normalizeParams(r)})}function Bx(t,e,r){let i=Xe(t);return i._zod.values=void 0,new mo({type:"record",keyType:i,valueType:e,...P.normalizeParams(r)})}function Gx(t,e,r){return new mo({type:"record",keyType:t,valueType:e,mode:"loose",...P.normalizeParams(r)})}var dy=v("ZodMap",(t,e)=>{Yl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vg(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(yr(...r)),t.nonempty=r=>t.check(yr(1,r)),t.max=(...r)=>t.check(un(...r)),t.size=(...r)=>t.check(qn(...r))});function Jx(t,e,r){return new dy({type:"map",keyType:t,valueType:e,...P.normalizeParams(r)})}var py=v("ZodSet",(t,e)=>{Xl.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bg(t,r,i,n),t.min=(...r)=>t.check(yr(...r)),t.nonempty=r=>t.check(yr(1,r)),t.max=(...r)=>t.check(un(...r)),t.size=(...r)=>t.check(qn(...r))});function Kx(t,e){return new py({type:"set",valueType:t,...P.normalizeParams(e)})}var ho=v("ZodEnum",(t,e)=>{Ql.init(t,e),X.init(t,e),t._zod.processJSONSchema=(i,n,o)=>lg(t,i,n,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ho({...e,checks:[],...P.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new ho({...e,checks:[],...P.normalizeParams(n),entries:o})}});function et(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new ho({type:"enum",entries:r,...P.normalizeParams(e)})}function Yx(t,e){return new ho({type:"enum",entries:t,...P.normalizeParams(e)})}var fy=v("ZodLiteral",(t,e)=>{eu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ug(t,r,i,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Z(t,e){return new fy({type:"literal",values:Array.isArray(t)?t:[t],...P.normalizeParams(e)})}var my=v("ZodFile",(t,e)=>{tu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>fg(t,r,i,n),t.min=(r,i)=>t.check(yr(r,i)),t.max=(r,i)=>t.check(un(r,i)),t.mime=(r,i)=>t.check(oo(Array.isArray(r)?r:[r],i))});function Xx(t){return Gu(my,t)}var hy=v("ZodTransform",(t,e)=>{ru.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yg(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new en(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(P.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(P.issue(s))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Md(t){return new hy({type:"transform",transform:t})}var ko=v("ZodOptional",(t,e)=>{Ms.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nd(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Re(t){return new ko({type:"optional",innerType:t})}var gy=v("ZodExactOptional",(t,e)=>{nu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nd(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function yy(t){return new gy({type:"optional",innerType:t})}var vy=v("ZodNullable",(t,e)=>{iu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function aa(t){return new vy({type:"nullable",innerType:t})}function Qx(t){return Re(aa(t))}var by=v("ZodDefault",(t,e)=>{ou.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function _y(t,e){return new by({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():P.shallowClone(e)}})}var wy=v("ZodPrefault",(t,e)=>{su.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function $y(t,e){return new wy({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():P.shallowClone(e)}})}var jd=v("ZodNonOptional",(t,e)=>{au.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ig(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function ky(t,e){return new jd({type:"nonoptional",innerType:t,...P.normalizeParams(e)})}var xy=v("ZodSuccess",(t,e)=>{cu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function eS(t){return new xy({type:"success",innerType:t})}var Sy=v("ZodCatch",(t,e)=>{lu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Iy(t,e){return new Sy({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Ty=v("ZodNaN",(t,e)=>{uu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dg(t,r,i,n)});function tS(t){return Fu(Ty,t)}var ma=v("ZodPipe",(t,e)=>{js.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cg(t,r,i,n),t.in=e.in,t.out=e.out});function md(t,e){return new ma({type:"pipe",in:t,out:e})}var ha=v("ZodCodec",(t,e)=>{ma.init(t,e),Gi.init(t,e)});function rS(t,e,r){return new ha({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function nS(t){let e=t._zod.def;return new ha({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var Py=v("ZodPreprocess",(t,e)=>{ma.init(t,e),Mh.init(t,e)}),zy=v("ZodReadonly",(t,e)=>{du.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ag(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Cy(t){return new zy({type:"readonly",innerType:t})}var Ay=v("ZodTemplateLiteral",(t,e)=>{pu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pg(t,r,i,n)});function iS(t,e){return new Ay({type:"template_literal",parts:t,...P.normalizeParams(e)})}var Ry=v("ZodLazy",(t,e)=>{hu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Eg(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});function Ey(t){return new Ry({type:"lazy",getter:t})}var Oy=v("ZodPromise",(t,e)=>{mu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function oS(t){return new Oy({type:"promise",innerType:t})}var Ny=v("ZodFunction",(t,e)=>{fu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gg(t,r,i,n)});function sS(t){return new Ny({type:"function",input:Array.isArray(t?.input)?uy(t?.input):t?.input??R(Te()),output:t?.output??Te()})}var ga=v("ZodCustom",(t,e)=>{gu.init(t,e),X.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hg(t,r,i,n)});function aS(t){let e=new Se({check:"custom"});return e._zod.check=t,e}function Dd(t,e){return Ju(ga,t??(()=>!0),e)}function My(t,e={}){return Ku(ga,t,e)}function jy(t,e){return Yu(t,e)}var cS=Xu,lS=Qu;function uS(t,e={}){let r=new ga({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...P.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var dS=(...t)=>ed({Codec:ha,Boolean:bo,String:go},...t);function pS(t){let e=Ey(()=>ke([g(t),pe(),_e(),wo(),R(e),Ce(g(),e)]));return e}function ya(t,e){return new Py({type:"pipe",in:Md(t),out:e})}var Uy={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 k1(t){Ue({customError:t})}function x1(){return Ue().customError}var Dy;Dy||(Dy={});var M={...oa,...cd,iso:mn},S1=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 I1(t,e){let r=t.$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":e??"draft-2020-12"}function T1(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function fS(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return M.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return M.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=T1(n,e),s=ct(o,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return M.null();if(n.length===0)return M.never();if(n.length===1)return M.literal(n[0]);if(n.every(s=>typeof s=="string"))return M.enum(n);let o=n.map(s=>M.literal(s));return o.length<2?o[0]:M.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return M.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...t,type:o};return fS(s,e)});return n.length===0?M.never():n.length===1?n[0]:M.union(n)}if(!r)return M.any();let i;switch(r){case"string":{let n=M.string();if(t.format){let o=t.format;o==="email"?n=n.check(M.email()):o==="uri"||o==="uri-reference"?n=n.check(M.url()):o==="uuid"||o==="guid"?n=n.check(M.uuid()):o==="date-time"?n=n.check(M.iso.datetime()):o==="date"?n=n.check(M.iso.date()):o==="time"?n=n.check(M.iso.time()):o==="duration"?n=n.check(M.iso.duration()):o==="ipv4"?n=n.check(M.ipv4()):o==="ipv6"?n=n.check(M.ipv6()):o==="mac"?n=n.check(M.mac()):o==="cidr"?n=n.check(M.cidrv4()):o==="cidr-v6"?n=n.check(M.cidrv6()):o==="base64"?n=n.check(M.base64()):o==="base64url"?n=n.check(M.base64url()):o==="e164"?n=n.check(M.e164()):o==="jwt"?n=n.check(M.jwt()):o==="emoji"?n=n.check(M.emoji()):o==="nanoid"?n=n.check(M.nanoid()):o==="cuid"?n=n.check(M.cuid()):o==="cuid2"?n=n.check(M.cuid2()):o==="ulid"?n=n.check(M.ulid()):o==="xid"?n=n.check(M.xid()):o==="ksuid"&&(n=n.check(M.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?M.number().int():M.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=M.boolean();break}case"null":{i=M.null();break}case"object":{let n={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,l]of Object.entries(o)){let u=ct(l,e);n[c]=s.has(c)?u:u.optional()}if(t.propertyNames){let c=ct(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?ct(t.additionalProperties,e):M.any();if(Object.keys(n).length===0){i=M.record(c,l);break}let u=M.object(n).passthrough(),d=M.looseRecord(c,l);i=M.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let p of l){let f=ct(c[p],e),m=M.string().regex(new RegExp(p));u.push(M.looseRecord(m,f))}let d=[];if(Object.keys(n).length>0&&d.push(M.object(n).passthrough()),d.push(...u),d.length===0)i=M.object({}).passthrough();else if(d.length===1)i=d[0];else{let p=M.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)p=M.intersection(p,d[f]);i=p}break}let a=M.object(n);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(ct(t.additionalProperties,e)):i=a.passthrough();break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let s=n.map(c=>ct(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?ct(o,e):void 0;a?i=M.tuple(s).rest(a):i=M.tuple(s),typeof t.minItems=="number"&&(i=i.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(M.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>ct(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?ct(t.additionalItems,e):void 0;a?i=M.tuple(s).rest(a):i=M.tuple(s),typeof t.minItems=="number"&&(i=i.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(M.maxLength(t.maxItems)))}else if(o!==void 0){let s=ct(o,e),a=M.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=M.array(M.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}function ct(t,e){if(typeof t=="boolean")return t?M.any():M.never();let r=fS(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>ct(l,e)),c=M.union(a);r=i?M.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>ct(l,e)),c=M.xor(a);r=i?M.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:M.any();else{let a=i?r:ct(t.allOf[0],e),c=i?0:1;for(let l=c;l<t.allOf.length;l++)a=M.intersection(a,ct(t.allOf[l],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=M.nullable(r)),t.readOnly===!0&&(r=M.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(n[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))S1.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function mS(t,e){if(typeof t=="boolean")return t?M.any():M.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=I1(r,e?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Qe};return ct(r,o)}var va={};zr(va,{bigint:()=>A1,boolean:()=>C1,date:()=>R1,number:()=>z1,string:()=>P1});function P1(t){return Uh(go,t)}function z1(t){return Hh(vo,t)}function C1(t){return Wh(bo,t)}function A1(t){return Bh(_o,t)}function R1(t){return Gh(ua,t)}Ue(yu());var hn="2025-11-25";var Ld=[hn,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],gn="io.modelcontextprotocol/related-task",Zd="2.0",tt=Dd(t=>t!==null&&(typeof t=="object"||typeof t=="function")),hS=ke([g(),pe().int()]),gS=g(),qW=Le({ttl:ke([pe(),wo()]).optional(),pollInterval:pe().optional()}),O1=E({ttl:pe().optional()}),N1=E({taskId:g()}),Zy=Le({progressToken:hS.optional(),[gn]:N1.optional()}),Ut=E({_meta:Zy.optional()}),ba=Ut.extend({task:O1.optional()}),yS=t=>ba.safeParse(t).success,rt=E({method:g(),params:Ut.loose().optional()}),qt=E({_meta:Zy.optional()}),Vt=E({method:g(),params:qt.loose().optional()}),nt=Le({_meta:Zy.optional()}),Fd=ke([g(),pe().int()]),vS=E({jsonrpc:Z(Zd),id:Fd,...rt.shape}).strict(),_a=t=>vS.safeParse(t).success,bS=E({jsonrpc:Z(Zd),...Vt.shape}).strict(),_S=t=>bS.safeParse(t).success,Fy=E({jsonrpc:Z(Zd),id:Fd,result:nt}).strict(),Kn=t=>Fy.safeParse(t).success;var U;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(U||(U={}));var qy=E({jsonrpc:Z(Zd),id:Fd.optional(),error:E({code:pe().int(),message:g(),data:Te().optional()})}).strict();var wS=t=>qy.safeParse(t).success;var So=ke([vS,bS,Fy,qy]),VW=ke([Fy,qy]),jr=nt.strict(),M1=qt.extend({requestId:Fd.optional(),reason:g().optional()}),qd=Vt.extend({method:Z("notifications/cancelled"),params:M1}),j1=E({src:g(),mimeType:g().optional(),sizes:R(g()).optional(),theme:et(["light","dark"]).optional()}),wa=E({icons:R(j1).optional()}),xo=E({name:g(),title:g().optional()}),$S=xo.extend({...xo.shape,...wa.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),D1=$o(E({applyDefaults:_e().optional()}),Ce(g(),Te())),U1=ya(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,$o(E({form:D1.optional(),url:tt.optional()}),Ce(g(),Te()).optional())),L1=Le({list:tt.optional(),cancel:tt.optional(),requests:Le({sampling:Le({createMessage:tt.optional()}).optional(),elicitation:Le({create:tt.optional()}).optional()}).optional()}),Z1=Le({list:tt.optional(),cancel:tt.optional(),requests:Le({tools:Le({call:tt.optional()}).optional()}).optional()}),F1=E({experimental:Ce(g(),tt).optional(),sampling:E({context:tt.optional(),tools:tt.optional()}).optional(),elicitation:U1.optional(),roots:E({listChanged:_e().optional()}).optional(),tasks:L1.optional()}),q1=Ut.extend({protocolVersion:g(),capabilities:F1,clientInfo:$S}),Vy=rt.extend({method:Z("initialize"),params:q1});var V1=E({experimental:Ce(g(),tt).optional(),logging:tt.optional(),completions:tt.optional(),prompts:E({listChanged:_e().optional()}).optional(),resources:E({subscribe:_e().optional(),listChanged:_e().optional()}).optional(),tools:E({listChanged:_e().optional()}).optional(),tasks:Z1.optional()}),Hy=nt.extend({protocolVersion:g(),capabilities:V1,serverInfo:$S,instructions:g().optional()}),Vd=Vt.extend({method:Z("notifications/initialized"),params:qt.optional()}),kS=t=>Vd.safeParse(t).success,Hd=rt.extend({method:Z("ping"),params:Ut.optional()}),H1=E({progress:pe(),total:Re(pe()),message:Re(g())}),W1=E({...qt.shape,...H1.shape,progressToken:hS}),Wd=Vt.extend({method:Z("notifications/progress"),params:W1}),B1=Ut.extend({cursor:gS.optional()}),$a=rt.extend({params:B1.optional()}),ka=nt.extend({nextCursor:gS.optional()}),G1=et(["working","input_required","completed","failed","cancelled"]),xa=E({taskId:g(),status:G1,ttl:ke([pe(),wo()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:Re(pe()),statusMessage:Re(g())}),Dr=nt.extend({task:xa}),J1=qt.merge(xa),Sa=Vt.extend({method:Z("notifications/tasks/status"),params:J1}),Bd=rt.extend({method:Z("tasks/get"),params:Ut.extend({taskId:g()})}),Gd=nt.merge(xa),Jd=rt.extend({method:Z("tasks/result"),params:Ut.extend({taskId:g()})}),HW=nt.loose(),Kd=$a.extend({method:Z("tasks/list")}),Yd=ka.extend({tasks:R(xa)}),Xd=rt.extend({method:Z("tasks/cancel"),params:Ut.extend({taskId:g()})}),xS=nt.merge(xa),SS=E({uri:g(),mimeType:Re(g()),_meta:Ce(g(),Te()).optional()}),IS=SS.extend({text:g()}),Wy=g().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),TS=SS.extend({blob:Wy}),Ia=et(["user","assistant"]),Io=E({audience:R(Ia).optional(),priority:pe().min(0).max(1).optional(),lastModified:mn.datetime({offset:!0}).optional()}),PS=E({...xo.shape,...wa.shape,uri:g(),description:Re(g()),mimeType:Re(g()),annotations:Io.optional(),_meta:Re(Le({}))}),K1=E({...xo.shape,...wa.shape,uriTemplate:g(),description:Re(g()),mimeType:Re(g()),annotations:Io.optional(),_meta:Re(Le({}))}),Qd=$a.extend({method:Z("resources/list")}),By=ka.extend({resources:R(PS)}),ep=$a.extend({method:Z("resources/templates/list")}),Gy=ka.extend({resourceTemplates:R(K1)}),Jy=Ut.extend({uri:g()}),Y1=Jy,tp=rt.extend({method:Z("resources/read"),params:Y1}),Ky=nt.extend({contents:R(ke([IS,TS]))}),Yy=Vt.extend({method:Z("notifications/resources/list_changed"),params:qt.optional()}),X1=Jy,Q1=rt.extend({method:Z("resources/subscribe"),params:X1}),eO=Jy,tO=rt.extend({method:Z("resources/unsubscribe"),params:eO}),rO=qt.extend({uri:g()}),nO=Vt.extend({method:Z("notifications/resources/updated"),params:rO}),iO=E({name:g(),description:Re(g()),required:Re(_e())}),oO=E({...xo.shape,...wa.shape,description:Re(g()),arguments:Re(R(iO)),_meta:Re(Le({}))}),rp=$a.extend({method:Z("prompts/list")}),Xy=ka.extend({prompts:R(oO)}),sO=Ut.extend({name:g(),arguments:Ce(g(),g()).optional()}),np=rt.extend({method:Z("prompts/get"),params:sO}),Qy=E({type:Z("text"),text:g(),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),ev=E({type:Z("image"),data:Wy,mimeType:g(),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),tv=E({type:Z("audio"),data:Wy,mimeType:g(),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),aO=E({type:Z("tool_use"),name:g(),id:g(),input:Ce(g(),Te()),_meta:Ce(g(),Te()).optional()}),cO=E({type:Z("resource"),resource:ke([IS,TS]),annotations:Io.optional(),_meta:Ce(g(),Te()).optional()}),lO=PS.extend({type:Z("resource_link")}),rv=ke([Qy,ev,tv,lO,cO]),uO=E({role:Ia,content:rv}),nv=nt.extend({description:g().optional(),messages:R(uO)}),iv=Vt.extend({method:Z("notifications/prompts/list_changed"),params:qt.optional()}),dO=E({title:g().optional(),readOnlyHint:_e().optional(),destructiveHint:_e().optional(),idempotentHint:_e().optional(),openWorldHint:_e().optional()}),pO=E({taskSupport:et(["required","optional","forbidden"]).optional()}),zS=E({...xo.shape,...wa.shape,description:g().optional(),inputSchema:E({type:Z("object"),properties:Ce(g(),tt).optional(),required:R(g()).optional()}).catchall(Te()),outputSchema:E({type:Z("object"),properties:Ce(g(),tt).optional(),required:R(g()).optional()}).catchall(Te()).optional(),annotations:dO.optional(),execution:pO.optional(),_meta:Ce(g(),Te()).optional()}),ip=$a.extend({method:Z("tools/list")}),ov=ka.extend({tools:R(zS)}),yn=nt.extend({content:R(rv).default([]),structuredContent:Ce(g(),Te()).optional(),isError:_e().optional()}),WW=yn.or(nt.extend({toolResult:Te()})),fO=ba.extend({name:g(),arguments:Ce(g(),Te()).optional()}),To=rt.extend({method:Z("tools/call"),params:fO}),Ta=Vt.extend({method:Z("notifications/tools/list_changed"),params:qt.optional()}),CS=E({autoRefresh:_e().default(!0),debounceMs:pe().int().nonnegative().default(300)}),Pa=et(["debug","info","notice","warning","error","critical","alert","emergency"]),mO=Ut.extend({level:Pa}),sv=rt.extend({method:Z("logging/setLevel"),params:mO}),hO=qt.extend({level:Pa,logger:g().optional(),data:Te()}),gO=Vt.extend({method:Z("notifications/message"),params:hO}),yO=E({name:g().optional()}),vO=E({hints:R(yO).optional(),costPriority:pe().min(0).max(1).optional(),speedPriority:pe().min(0).max(1).optional(),intelligencePriority:pe().min(0).max(1).optional()}),bO=E({mode:et(["auto","required","none"]).optional()}),_O=E({type:Z("tool_result"),toolUseId:g().describe("The unique identifier for the corresponding tool call."),content:R(rv).default([]),structuredContent:E({}).loose().optional(),isError:_e().optional(),_meta:Ce(g(),Te()).optional()}),wO=fa("type",[Qy,ev,tv]),Ud=fa("type",[Qy,ev,tv,aO,_O]),$O=E({role:Ia,content:ke([Ud,R(Ud)]),_meta:Ce(g(),Te()).optional()}),kO=ba.extend({messages:R($O),modelPreferences:vO.optional(),systemPrompt:g().optional(),includeContext:et(["none","thisServer","allServers"]).optional(),temperature:pe().optional(),maxTokens:pe().int(),stopSequences:R(g()).optional(),metadata:tt.optional(),tools:R(zS).optional(),toolChoice:bO.optional()}),av=rt.extend({method:Z("sampling/createMessage"),params:kO}),Yn=nt.extend({model:g(),stopReason:Re(et(["endTurn","stopSequence","maxTokens"]).or(g())),role:Ia,content:wO}),za=nt.extend({model:g(),stopReason:Re(et(["endTurn","stopSequence","maxTokens","toolUse"]).or(g())),role:Ia,content:ke([Ud,R(Ud)])}),xO=E({type:Z("boolean"),title:g().optional(),description:g().optional(),default:_e().optional()}),SO=E({type:Z("string"),title:g().optional(),description:g().optional(),minLength:pe().optional(),maxLength:pe().optional(),format:et(["email","uri","date","date-time"]).optional(),default:g().optional()}),IO=E({type:et(["number","integer"]),title:g().optional(),description:g().optional(),minimum:pe().optional(),maximum:pe().optional(),default:pe().optional()}),TO=E({type:Z("string"),title:g().optional(),description:g().optional(),enum:R(g()),default:g().optional()}),PO=E({type:Z("string"),title:g().optional(),description:g().optional(),oneOf:R(E({const:g(),title:g()})),default:g().optional()}),zO=E({type:Z("string"),title:g().optional(),description:g().optional(),enum:R(g()),enumNames:R(g()).optional(),default:g().optional()}),CO=ke([TO,PO]),AO=E({type:Z("array"),title:g().optional(),description:g().optional(),minItems:pe().optional(),maxItems:pe().optional(),items:E({type:Z("string"),enum:R(g())}),default:R(g()).optional()}),RO=E({type:Z("array"),title:g().optional(),description:g().optional(),minItems:pe().optional(),maxItems:pe().optional(),items:E({anyOf:R(E({const:g(),title:g()}))}),default:R(g()).optional()}),EO=ke([AO,RO]),OO=ke([zO,CO,EO]),NO=ke([OO,xO,SO,IO]),MO=ba.extend({mode:Z("form").optional(),message:g(),requestedSchema:E({type:Z("object"),properties:Ce(g(),NO),required:R(g()).optional()})}),jO=ba.extend({mode:Z("url"),message:g(),elicitationId:g(),url:g().url()}),DO=ke([MO,jO]),cv=rt.extend({method:Z("elicitation/create"),params:DO}),UO=qt.extend({elicitationId:g()}),LO=Vt.extend({method:Z("notifications/elicitation/complete"),params:UO}),vn=nt.extend({action:et(["accept","decline","cancel"]),content:ya(t=>t===null?void 0:t,Ce(g(),ke([g(),pe(),_e(),R(g())])).optional())}),ZO=E({type:Z("ref/resource"),uri:g()});var FO=E({type:Z("ref/prompt"),name:g()}),qO=Ut.extend({ref:ke([FO,ZO]),argument:E({name:g(),value:g()}),context:E({arguments:Ce(g(),g()).optional()}).optional()}),op=rt.extend({method:Z("completion/complete"),params:qO});function AS(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function RS(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var lv=nt.extend({completion:Le({values:R(g()).max(100),total:Re(pe().int()),hasMore:Re(_e())})}),VO=E({uri:g().startsWith("file://"),name:g().optional(),_meta:Ce(g(),Te()).optional()}),HO=rt.extend({method:Z("roots/list"),params:Ut.optional()}),uv=nt.extend({roots:R(VO)}),WO=Vt.extend({method:Z("notifications/roots/list_changed"),params:qt.optional()}),BW=ke([Hd,Vy,op,sv,np,rp,Qd,ep,tp,Q1,tO,To,ip,Bd,Jd,Kd,Xd]),GW=ke([qd,Wd,Vd,WO,Sa]),JW=ke([jr,Yn,za,vn,uv,Gd,Yd,Dr]),KW=ke([Hd,av,cv,HO,Bd,Jd,Kd,Xd]),YW=ke([qd,Wd,gO,nO,Yy,Ta,iv,Sa,LO]),XW=ke([jr,Hy,lv,nv,Xy,By,Gy,Ky,yn,ov,Gd,Yd,Dr]),O=class t extends Error{constructor(e,r,i){super(`MCP error ${e}: ${r}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,r,i){if(e===U.UrlElicitationRequired&&i){let n=i;if(n.elicitations)return new Ly(n.elicitations,r)}return new t(e,r,i)}},Ly=class extends O{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function bn(t){return t==="completed"||t==="failed"||t==="cancelled"}var OS=Symbol("Let zodToJsonSchema decide on which parser to use");var ES={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"},NS=t=>typeof t=="string"?{...ES,name:t}:{...ES,...t};var MS=t=>{let e=NS(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...e.basePath,e.definitionPath,i],jsonSchema:void 0}]))}};function dv(t,e,r,i){i?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function fe(t,e,r,i,n){t[e]=r,dv(t,e,i,n)}var sp=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")};function Ne(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?sp(e,t.currentPath):e.join("/")}}function jS(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==C.ZodAny&&(r.items=B(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&fe(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&fe(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(fe(r,"minItems",t.exactLength.value,t.exactLength.message,e),fe(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function DS(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let i of t.checks)switch(i.kind){case"min":e.target==="jsonSchema7"?i.inclusive?fe(r,"minimum",i.value,i.message,e):fe(r,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(r.exclusiveMinimum=!0),fe(r,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?fe(r,"maximum",i.value,i.message,e):fe(r,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(r.exclusiveMaximum=!0),fe(r,"maximum",i.value,i.message,e));break;case"multipleOf":fe(r,"multipleOf",i.value,i.message,e);break}return r}function US(){return{type:"boolean"}}function ap(t,e){return B(t.type._def,e)}var LS=(t,e)=>B(t.innerType._def,e);function pv(t,e,r){let i=r??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>pv(t,e,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 BO(t,e)}}var BO=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let i of t.checks)switch(i.kind){case"min":fe(r,"minimum",i.value,i.message,e);break;case"max":fe(r,"maximum",i.value,i.message,e);break}return r};function ZS(t,e){return{...B(t.innerType._def,e),default:t.defaultValue()}}function FS(t,e){return e.effectStrategy==="input"?B(t.schema._def,e):Ne(e)}function qS(t){return{type:"string",enum:Array.from(t.values)}}var GO=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function VS(t,e){let r=[B(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),B(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),i=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(o=>{if(GO(o))n.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:a,...c}=o;s=c}else i=void 0;n.push(s)}}),n.length?{allOf:n,...i}:void 0}function HS(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var fv,nr={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:()=>(fv===void 0&&(fv=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),fv),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 cp(t,e){let r={type:"string"};if(t.checks)for(let i of t.checks)switch(i.kind){case"min":fe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e);break;case"max":fe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":ir(r,"email",i.message,e);break;case"format:idn-email":ir(r,"idn-email",i.message,e);break;case"pattern:zod":vt(r,nr.email,i.message,e);break}break;case"url":ir(r,"uri",i.message,e);break;case"uuid":ir(r,"uuid",i.message,e);break;case"regex":vt(r,i.regex,i.message,e);break;case"cuid":vt(r,nr.cuid,i.message,e);break;case"cuid2":vt(r,nr.cuid2,i.message,e);break;case"startsWith":vt(r,RegExp(`^${mv(i.value,e)}`),i.message,e);break;case"endsWith":vt(r,RegExp(`${mv(i.value,e)}$`),i.message,e);break;case"datetime":ir(r,"date-time",i.message,e);break;case"date":ir(r,"date",i.message,e);break;case"time":ir(r,"time",i.message,e);break;case"duration":ir(r,"duration",i.message,e);break;case"length":fe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e),fe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"includes":{vt(r,RegExp(mv(i.value,e)),i.message,e);break}case"ip":{i.version!=="v6"&&ir(r,"ipv4",i.message,e),i.version!=="v4"&&ir(r,"ipv6",i.message,e);break}case"base64url":vt(r,nr.base64url,i.message,e);break;case"jwt":vt(r,nr.jwt,i.message,e);break;case"cidr":{i.version!=="v6"&&vt(r,nr.ipv4Cidr,i.message,e),i.version!=="v4"&&vt(r,nr.ipv6Cidr,i.message,e);break}case"emoji":vt(r,nr.emoji(),i.message,e);break;case"ulid":{vt(r,nr.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{ir(r,"binary",i.message,e);break}case"contentEncoding:base64":{fe(r,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{vt(r,nr.base64,i.message,e);break}}break}case"nanoid":vt(r,nr.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function mv(t,e){return e.patternStrategy==="escape"?KO(t):t}var JO=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function KO(t){let e="";for(let r=0;r<t.length;r++)JO.has(t[r])||(e+="\\"),e+=t[r];return e}function ir(t,e,r,i){t.format||t.anyOf?.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&i.errorMessages&&{errorMessage:{format:r}}})):fe(t,"format",e,r,i)}function vt(t,e,r,i){t.pattern||t.allOf?.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:WS(e,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):fe(t,"pattern",WS(e,i),r,i)}function WS(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source,n="",o=!1,s=!1,a=!1;for(let c=0;c<i.length;c++){if(o){n+=i[c],o=!1;continue}if(r.i){if(s){if(i[c].match(/[a-z]/)){a?(n+=i[c],n+=`${i[c-2]}-${i[c]}`.toUpperCase(),a=!1):i[c+1]==="-"&&i[c+2]?.match(/[a-z]/)?(n+=i[c],a=!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
|
|
97
97
|
]))`;continue}else if(i[c]==="$"){n+=`($|(?=[\r
|
|
98
98
|
]))`;continue}}if(r.s&&i[c]==="."){n+=s?`${i[c]}\r
|
|
99
99
|
`:`[${i[c]}\r
|
|
100
|
-
]`;continue}n+=i[c],i[c]==="\\"?o=!0:s&&i[c]==="]"?s=!1:!s&&i[c]==="["&&(s=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}function cp(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===C.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((i,n)=>({...i,[n]:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",n]})??Ne(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===C.ZodString&&t.keyType._def.checks?.length){let{type:i,...n}=ap(t.keyType._def,e);return{...r,propertyNames:n}}else{if(t.keyType?._def.typeName===C.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===C.ZodBranded&&t.keyType._def.type._def.typeName===C.ZodString&&t.keyType._def.type._def.checks?.length){let{type:i,...n}=sp(t.keyType._def,e);return{...r,propertyNames:n}}}return r}function BS(t,e){if(e.mapStrategy==="record")return cp(t,e);let r=B(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Ne(e),i=B(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Ne(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}function GS(t){let e=t.values,i=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[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 JS(t){return t.target==="openAi"?void 0:{not:Ne({...t,currentPath:[...t.currentPath,"not"]})}}function KS(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Ca={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function XS(t,e){if(e.target==="openApi3")return YS(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(i=>i._def.typeName in Ca&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let s=Ca[o._def.typeName];return s&&!n.includes(s)?[...n,s]: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 s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(i.length===r.length){let n=i.filter((o,s,a)=>a.indexOf(o)===s);return{type:n.length>1?n:n[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._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 YS(t,e)}var YS=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((i,n)=>B(i._def,{...e,currentPath:[...e.currentPath,"anyOf",`${n}`]})).filter(i=>!!i&&(!e.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0};function QS(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Ca[t.innerType._def.typeName],nullable:!0}:{type:[Ca[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let i=B(t.innerType._def,{...e,currentPath:[...e.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let r=B(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function e0(t,e){let r={type:"number"};if(!t.checks)return r;for(let i of t.checks)switch(i.kind){case"int":r.type="integer",dv(r,"type",i.message,e);break;case"min":e.target==="jsonSchema7"?i.inclusive?fe(r,"minimum",i.value,i.message,e):fe(r,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(r.exclusiveMinimum=!0),fe(r,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?fe(r,"maximum",i.value,i.message,e):fe(r,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(r.exclusiveMaximum=!0),fe(r,"maximum",i.value,i.message,e));break;case"multipleOf":fe(r,"multipleOf",i.value,i.message,e);break}return r}function t0(t,e){let r=e.target==="openAi",i={type:"object",properties:{}},n=[],o=t.shape();for(let a in o){let c=o[a];if(c===void 0||c._def===void 0)continue;let l=YO(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=B(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});u!==void 0&&(i.properties[a]=u,l||n.push(a))}n.length&&(i.required=n);let s=KO(t,e);return s!==void 0&&(i.additionalProperties=s),i}function KO(t,e){if(t.catchall._def.typeName!=="ZodNever")return B(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function YO(t){try{return t.isOptional()}catch{return!0}}var r0=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return B(t.innerType._def,e);let r=B(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ne(e)},r]}:Ne(e)};var n0=(t,e)=>{if(e.pipeStrategy==="input")return B(t.in._def,e);if(e.pipeStrategy==="output")return B(t.out._def,e);let r=B(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),i=B(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter(n=>n!==void 0)}};function i0(t,e){return B(t.type._def,e)}function o0(t,e){let i={type:"array",uniqueItems:!0,items:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&fe(i,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&fe(i,"maxItems",t.maxSize.value,t.maxSize.message,e),i}function s0(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,i)=>B(r._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:B(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,i)=>B(r._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}function a0(t){return{not:Ne(t)}}function c0(t){return Ne(t)}var l0=(t,e)=>B(t.innerType._def,e);var u0=(t,e,r)=>{switch(e){case C.ZodString:return ap(t,r);case C.ZodNumber:return e0(t,r);case C.ZodObject:return t0(t,r);case C.ZodBigInt:return DS(t,r);case C.ZodBoolean:return US();case C.ZodDate:return pv(t,r);case C.ZodUndefined:return a0(r);case C.ZodNull:return KS(r);case C.ZodArray:return jS(t,r);case C.ZodUnion:case C.ZodDiscriminatedUnion:return XS(t,r);case C.ZodIntersection:return VS(t,r);case C.ZodTuple:return s0(t,r);case C.ZodRecord:return cp(t,r);case C.ZodLiteral:return HS(t,r);case C.ZodEnum:return qS(t);case C.ZodNativeEnum:return GS(t);case C.ZodNullable:return QS(t,r);case C.ZodOptional:return r0(t,r);case C.ZodMap:return BS(t,r);case C.ZodSet:return o0(t,r);case C.ZodLazy:return()=>t.getter()._def;case C.ZodPromise:return i0(t,r);case C.ZodNaN:case C.ZodNever:return JS(r);case C.ZodEffects:return FS(t,r);case C.ZodAny:return Ne(r);case C.ZodUnknown:return c0(r);case C.ZodDefault:return ZS(t,r);case C.ZodBranded:return sp(t,r);case C.ZodReadonly:return l0(t,r);case C.ZodCatch:return LS(t,r);case C.ZodPipeline:return n0(t,r);case C.ZodFunction:case C.ZodVoid:case C.ZodSymbol:return;default:return(i=>{})(e)}};function B(t,e,r=!1){let i=e.seen.get(t);if(e.override){let a=e.override?.(t,e,i,r);if(a!==OS)return a}if(i&&!r){let a=XO(i,e);if(a!==void 0)return a}let n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);let o=u0(t,t.typeName,e),s=typeof o=="function"?B(o(),e):o;if(s&&QO(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return n.jsonSchema=s,a}return n.jsonSchema=s,s}var XO=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:op(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,i)=>e.currentPath[i]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Ne(e)):e.$refStrategy==="seen"?Ne(e):void 0}},QO=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r);var hv=(t,e)=>{let r=MS(e),i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[l,u])=>({...c,[l]:B(u._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??Ne(r)}),{}):void 0,n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=B(t._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Ne(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),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 a=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"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a};function eN(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function gv(t,e){return Tt(t)?Bn(t,{target:eN(e?.target),io:e?.pipeStrategy??"input"}):hv(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function yv(t){let r=vr(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=sd(r);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function vv(t,e){let r=yt(t,e);if(!r.success)throw r.error;return r.data}var tN=6e4,Po=class{constructor(e){this._options=e,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(Fd,r=>{this._oncancel(r)}),this.setNotificationHandler(Hd,r=>{this._onprogress(r)}),this.setRequestHandler(Vd,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Wd,async(r,i)=>{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new O(U.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Gd,async(r,i)=>{let n=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),a.type==="response")u(c);else{let d=c,p=new O(d.error.code,d.error.message,d.error.data);u(p)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:i.requestId})}}let s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new O(U.InvalidParams,`Task not found: ${o}`);if(!bn(s.status))return await this._waitForTaskUpdate(o,i.signal),await n();if(bn(s.status)){let a=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[gn]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(Jd,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 O(U.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Yd,async(r,i)=>{try{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new O(U.InvalidParams,`Task not found: ${r.params.taskId}`);if(bn(n.status))throw new O(U.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 O(U.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof O?n:new O(U.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,i,n,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let i=Date.now()-r.startTime;if(r.maxTotalTimeout&&i>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),O.fromError(U.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:i});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){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=e;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,s)=>{n?.(o,s),Kn(o)||wS(o)?this._onresponse(o):_a(o)?this._onrequest(o,s):_S(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=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=O.fromError(U.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of e.values())i(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,r){let i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,o=e.params?._meta?.[gn]?.taskId;if(i===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:U.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},n?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):n?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=yS(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,l={signal:s.signal,sessionId:n?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(u,d)},sendRequest:async(u,d,p)=>{if(s.signal.aborted)throw new O(U.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};o&&!f.relatedTask&&(f.relatedTask={taskId:o});let m=f.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(u,d,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,l)).then(async u=>{if(s.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)},async u=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:U.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...i}=e.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(e)}`));return}let s=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),s(c);return}o(i)}_onresponse(e){let r=Number(e.id),i=this._requestResolvers.get(r);if(i){if(this._requestResolvers.delete(r),Kn(e))i(e);else{let s=new O(e.error.code,e.error.message,e.error.data);i(s)}return}let n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(Kn(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),Kn(e))n(e);else{let s=O.fromError(e.error.code,e.error.message,e.error.data);n(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,i){let{task:n}=i??{};if(!n){try{yield{type:"result",result:await this.request(e,r,i)}}catch(s){yield{type:"error",error:s instanceof O?s:new O(U.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Dr,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new O(U.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:a},bn(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)}:a.status==="failed"?yield{type:"error",error:new O(U.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new O(U.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof O?s:new O(U.InternalError,String(s))}}}request(e,r,i){let{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=i??{};return new Promise((l,u)=>{let d=k=>{u(k)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(k){d(k);return}i?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};i?.onprogress&&(this._progressHandlers.set(p,i.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[gn]:c}});let m=k=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(k)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch($=>this._onerror(new Error(`Failed to send cancellation: ${$}`)));let w=k instanceof O?k:new O(U.RequestTimeout,String(k));u(w)};this._responseHandlers.set(p,k=>{if(!i?.signal?.aborted){if(k instanceof Error)return u(k);try{let w=yt(r,k.result);w.success?l(w.data):u(w.error)}catch(w){u(w)}}}),i?.signal?.addEventListener("abort",()=>{m(i?.signal?.reason)});let h=i?.timeout??tN,y=()=>m(O.fromError(U.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(p,h,i?.maxTotalTimeout,y,i?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let k=w=>{let $=this._responseHandlers.get(p);$?$(w):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,k),this._enqueueTaskMessage(_,{type:"request",message:f,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(p),u(w)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(k=>{this._cleanupTimeout(p),u(k)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Bd,r)}async getTaskResult(e,r,i){return this.request({method:"tasks/result",params:e},r,i)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Kd,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},xS,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let i=r?.relatedTask?.taskId;if(i){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[gn]:r.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[gn]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[gn]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let i=yv(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(n,o)=>{let s=vv(e,n);return Promise.resolve(r(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let i=yv(e);this._notificationHandlers.set(i,n=>{let o=vv(e,n);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,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(e,r,i,n)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(e,r);for(let n of i)if(n.type==="request"&&_a(n.message)){let o=n.message.id,s=this._requestResolvers.get(o);s?(s(new O(U.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let i=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(e);n?.pollInterval&&(i=n.pollInterval)}catch{}return new Promise((n,o)=>{if(r.aborted){o(new O(U.InvalidRequest,"Request cancelled"));return}let s=setTimeout(n,i);r.addEventListener("abort",()=>{clearTimeout(s),o(new O(U.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await i.createTask(n,e.id,{method:e.method,params:e.params},r)},getTask:async n=>{let o=await i.getTask(n,r);if(!o)throw new O(U.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,s)=>{await i.storeTaskResult(n,o,s,r);let a=await i.getTask(n,r);if(a){let c=Sa.parse({method:"notifications/tasks/status",params:a});await this.notification(c),bn(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>i.getTaskResult(n,r),updateTaskStatus:async(n,o,s)=>{let a=await i.getTask(n,r);if(!a)throw new O(U.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(bn(a.status))throw new O(U.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(n,o,s,r);let c=await i.getTask(n,r);if(c){let l=Sa.parse({method:"notifications/tasks/status",params:c});await this.notification(l),bn(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>i.listTasks(n,r)}}};function d0(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function lp(t,e){let r={...t};for(let i in e){let n=i,o=e[n];if(o===void 0)continue;let s=r[n];d0(s)&&d0(o)?r[n]={...s,...o}:r[n]=o}return r}var YT=Uc(n_(),1),XT=Uc(KT(),1);function W4(){let t=new YT.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,XT.default)(t),t}var Wo=class{constructor(e){this._ajv=e??W4()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return i=>r(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Hp=class{constructor(e){this._client=e}async*callToolStream(e,r=yn,i){let n=this._client,o={...i,task:i?.task??(n.isToolTask(e.name)?{}:void 0)},s=n.requestStream({method:"tools/call",params:e},r,o),a=n.getToolOutputValidator(e.name);for await(let c of s){if(c.type==="result"&&a){let l=c.result;if(!l.structuredContent&&!l.isError){yield{type:"error",error:new O(U.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(l.structuredContent)try{let u=a(l.structuredContent);if(!u.valid){yield{type:"error",error:new O(U.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)};return}}catch(u){if(u instanceof O){yield{type:"error",error:u};return}yield{type:"error",error:new O(U.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)};return}}yield c}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,i){return this._client.getTaskResult({taskId:e},r,i)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,i){return this._client.requestStream(e,r,i)}};function Wp(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Bp(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function Gp(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,i=t.properties;for(let n of Object.keys(i)){let o=i[n];r[n]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(r[n]=o.default),r[n]!==void 0&&Gp(o,r[n])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&Gp(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&Gp(r,e)}}function B4(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}var Jp=class extends Po{constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new Wo,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ta,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",iv,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Yy,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Hp(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=lp(this._capabilities,e)}setRequestHandler(e,r){let n=vr(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let o;if(Tt(n)){let a=n;o=a._zod?.def?.value??a.value}else{let a=n;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");let s=o;if(s==="elicitation/create"){let a=async(c,l)=>{let u=yt(cv,c);if(!u.success){let k=u.error instanceof Error?u.error.message:String(u.error);throw new O(U.InvalidParams,`Invalid elicitation request: ${k}`)}let{params:d}=u.data;d.mode=d.mode??"form";let{supportsFormMode:p,supportsUrlMode:f}=B4(this._capabilities.elicitation);if(d.mode==="form"&&!p)throw new O(U.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!f)throw new O(U.InvalidParams,"Client does not support URL-mode elicitation requests");let m=await Promise.resolve(r(c,l));if(d.task){let k=yt(Dr,m);if(!k.success){let w=k.error instanceof Error?k.error.message:String(k.error);throw new O(U.InvalidParams,`Invalid task creation result: ${w}`)}return k.data}let h=yt(vn,m);if(!h.success){let k=h.error instanceof Error?h.error.message:String(h.error);throw new O(U.InvalidParams,`Invalid elicitation result: ${k}`)}let y=h.data,_=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&y.action==="accept"&&y.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{Gp(_,y.content)}catch{}return y};return super.setRequestHandler(e,a)}if(s==="sampling/createMessage"){let a=async(c,l)=>{let u=yt(av,c);if(!u.success){let y=u.error instanceof Error?u.error.message:String(u.error);throw new O(U.InvalidParams,`Invalid sampling request: ${y}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let y=yt(Dr,p);if(!y.success){let _=y.error instanceof Error?y.error.message:String(y.error);throw new O(U.InvalidParams,`Invalid task creation result: ${_}`)}return y.data}let m=d.tools||d.toolChoice?za:Yn,h=yt(m,p);if(!h.success){let y=h.error instanceof Error?h.error.message:String(h.error);throw new O(U.InvalidParams,`Invalid sampling result: ${y}`)}return h.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let i=await this.request({method:"initialize",params:{protocolVersion:hn,capabilities:this._capabilities,clientInfo:this._clientInfo}},Hy,r);if(i===void 0)throw new Error(`Server sent invalid initialize result: ${i}`);if(!Ud.includes(i.protocolVersion))throw new Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(i){throw this.close(),i}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){Wp(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&Bp(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},jr,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},lv,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},jr,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},nv,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Xy,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},By,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Gy,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Ky,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},jr,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},jr,r)}async callTool(e,r=yn,i){if(this.isToolTaskRequired(e.name))throw new O(U.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let n=await this.request({method:"tools/call",params:e},r,i),o=this.getToolOutputValidator(e.name);if(o){if(!n.structuredContent&&!n.isError)throw new O(U.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(n.structuredContent)try{let s=o(n.structuredContent);if(!s.valid)throw new O(U.InvalidParams,`Structured content does not match the tool's output schema: ${s.errorMessage}`)}catch(s){throw s instanceof O?s:new O(U.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return n}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let n=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,n)}let i=r.execution?.taskSupport;(i==="required"||i==="optional")&&this._cachedKnownTaskTools.add(r.name),i==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let i=await this.request({method:"tools/list",params:e},ov,r);return this.cacheToolMetadata(i.tools),i}_setupListChangedHandler(e,r,i,n){let o=CS.safeParse(i);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof i.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:a}=o.data,{onChanged:c}=i,l=async()=>{if(!s){c(null,null);return}try{let d=await n();c(null,d)}catch(d){let p=d instanceof Error?d:new Error(String(d));c(p,null)}},u=()=>{if(a){let d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);let p=setTimeout(l,a);this._listChangedDebounceTimers.set(e,p)}else l()};this.setNotificationHandler(r,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function Kp(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}function QT(t=fetch,e){return e?async(r,i)=>{let n={...e,...i,headers:i?.headers?{...Kp(e.headers),...Kp(i.headers)}:e.headers};return t(r,n)}:t}var d_;d_=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function G4(t){return(await d_).getRandomValues(new Uint8Array(t))}async function J4(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%e.length,i="";for(;i.length<t;){let n=await G4(t-i.length);for(let o of n)o<r&&(i+=e[o%e.length])}return i}async function K4(t){return await J4(t)}async function Y4(t){let e=await(await d_).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function p_(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await K4(t),r=await Y4(e);return{code_verifier:e,code_challenge:r}}var st=gd().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:Uy.custom,message:"URL must be parseable",fatal:!0}),_s}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),tP=Le({resource:g().url(),authorization_servers:A(st).optional(),jwks_uri:g().url().optional(),scopes_supported:A(g()).optional(),bearer_methods_supported:A(g()).optional(),resource_signing_alg_values_supported:A(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:_e().optional(),authorization_details_types_supported:A(g()).optional(),dpop_signing_alg_values_supported:A(g()).optional(),dpop_bound_access_tokens_required:_e().optional()}),f_=Le({issuer:g(),authorization_endpoint:st,token_endpoint:st,registration_endpoint:st.optional(),scopes_supported:A(g()).optional(),response_types_supported:A(g()),response_modes_supported:A(g()).optional(),grant_types_supported:A(g()).optional(),token_endpoint_auth_methods_supported:A(g()).optional(),token_endpoint_auth_signing_alg_values_supported:A(g()).optional(),service_documentation:st.optional(),revocation_endpoint:st.optional(),revocation_endpoint_auth_methods_supported:A(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:A(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:A(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:A(g()).optional(),code_challenge_methods_supported:A(g()).optional(),client_id_metadata_document_supported:_e().optional()}),X4=Le({issuer:g(),authorization_endpoint:st,token_endpoint:st,userinfo_endpoint:st.optional(),jwks_uri:st,registration_endpoint:st.optional(),scopes_supported:A(g()).optional(),response_types_supported:A(g()),response_modes_supported:A(g()).optional(),grant_types_supported:A(g()).optional(),acr_values_supported:A(g()).optional(),subject_types_supported:A(g()),id_token_signing_alg_values_supported:A(g()),id_token_encryption_alg_values_supported:A(g()).optional(),id_token_encryption_enc_values_supported:A(g()).optional(),userinfo_signing_alg_values_supported:A(g()).optional(),userinfo_encryption_alg_values_supported:A(g()).optional(),userinfo_encryption_enc_values_supported:A(g()).optional(),request_object_signing_alg_values_supported:A(g()).optional(),request_object_encryption_alg_values_supported:A(g()).optional(),request_object_encryption_enc_values_supported:A(g()).optional(),token_endpoint_auth_methods_supported:A(g()).optional(),token_endpoint_auth_signing_alg_values_supported:A(g()).optional(),display_values_supported:A(g()).optional(),claim_types_supported:A(g()).optional(),claims_supported:A(g()).optional(),service_documentation:g().optional(),claims_locales_supported:A(g()).optional(),ui_locales_supported:A(g()).optional(),claims_parameter_supported:_e().optional(),request_parameter_supported:_e().optional(),request_uri_parameter_supported:_e().optional(),require_request_uri_registration:_e().optional(),op_policy_uri:st.optional(),op_tos_uri:st.optional(),client_id_metadata_document_supported:_e().optional()}),rP=E({...X4.shape,...f_.pick({code_challenge_methods_supported:!0}).shape}),nP=E({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:va.number().optional(),scope:g().optional(),refresh_token:g().optional()}).strip(),iP=E({error:g(),error_description:g().optional(),error_uri:g().optional()}),eP=st.optional().or(Z("").transform(()=>{})),Q4=E({redirect_uris:A(st),token_endpoint_auth_method:g().optional(),grant_types:A(g()).optional(),response_types:A(g()).optional(),client_name:g().optional(),client_uri:st.optional(),logo_uri:eP,scope:g().optional(),contacts:A(g()).optional(),tos_uri:eP,policy_uri:g().optional(),jwks_uri:st.optional(),jwks:Ed().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),eL=E({client_id:g(),client_secret:g().optional(),client_id_issued_at:pe().optional(),client_secret_expires_at:pe().optional()}).strip(),oP=Q4.merge(eL),IK=E({error:g(),error_description:g().optional()}).strip(),TK=E({token:g(),token_type_hint:g().optional()}).strip();function sP(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function aP({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),i=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==i.origin||r.pathname.length<i.pathname.length)return!1;let n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",o=i.pathname.endsWith("/")?i.pathname:i.pathname+"/";return n.startsWith(o)}var Fe=class extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}},sc=class extends Fe{};sc.errorCode="invalid_request";var ci=class extends Fe{};ci.errorCode="invalid_client";var li=class extends Fe{};li.errorCode="invalid_grant";var ui=class extends Fe{};ui.errorCode="unauthorized_client";var ac=class extends Fe{};ac.errorCode="unsupported_grant_type";var cc=class extends Fe{};cc.errorCode="invalid_scope";var lc=class extends Fe{};lc.errorCode="access_denied";var Vr=class extends Fe{};Vr.errorCode="server_error";var uc=class extends Fe{};uc.errorCode="temporarily_unavailable";var dc=class extends Fe{};dc.errorCode="unsupported_response_type";var pc=class extends Fe{};pc.errorCode="unsupported_token_type";var fc=class extends Fe{};fc.errorCode="invalid_token";var mc=class extends Fe{};mc.errorCode="method_not_allowed";var hc=class extends Fe{};hc.errorCode="too_many_requests";var di=class extends Fe{};di.errorCode="invalid_client_metadata";var gc=class extends Fe{};gc.errorCode="insufficient_scope";var yc=class extends Fe{};yc.errorCode="invalid_target";var cP={[sc.errorCode]:sc,[ci.errorCode]:ci,[li.errorCode]:li,[ui.errorCode]:ui,[ac.errorCode]:ac,[cc.errorCode]:cc,[lc.errorCode]:lc,[Vr.errorCode]:Vr,[uc.errorCode]:uc,[dc.errorCode]:dc,[pc.errorCode]:pc,[fc.errorCode]:fc,[mc.errorCode]:mc,[hc.errorCode]:hc,[di.errorCode]:di,[gc.errorCode]:gc,[yc.errorCode]:yc};var Hr=class extends Error{constructor(e){super(e??"Unauthorized")}};function tL(t){return["client_secret_basic","client_secret_post","none"].includes(t)}var m_="code",h_="S256";function rL(t,e){let r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in t&&t.token_endpoint_auth_method&&tL(t.token_endpoint_auth_method)&&e.includes(t.token_endpoint_auth_method)?t.token_endpoint_auth_method:r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function nL(t,e,r,i){let{client_id:n,client_secret:o}=e;switch(t){case"client_secret_basic":iL(n,o,r);return;case"client_secret_post":oL(n,o,i);return;case"none":sL(n,i);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function iL(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");let i=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${i}`)}function oL(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function sL(t,e){e.set("client_id",t)}async function uP(t){let e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{let i=iP.parse(JSON.parse(r)),{error:n,error_description:o,error_uri:s}=i,a=cP[n]||Vr;return new a(o||"",s)}catch(i){let n=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${i}. Raw body: ${r}`;return new Vr(n)}}async function vc(t,e){try{return await g_(t,e)}catch(r){if(r instanceof ci||r instanceof ui)return await t.invalidateCredentials?.("all"),await g_(t,e);if(r instanceof li)return await t.invalidateCredentials?.("tokens"),await g_(t,e);throw r}}async function g_(t,{serverUrl:e,authorizationCode:r,scope:i,resourceMetadataUrl:n,fetchFn:o}){let s=await t.discoveryState?.(),a,c,l,u=n;if(!u&&s?.resourceMetadataUrl&&(u=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,a=s.resourceMetadata,l=s.authorizationServerMetadata??await pP(c,{fetchFn:o}),!a)try{a=await dP(e,{resourceMetadataUrl:u},o)}catch{}(l!==s.authorizationServerMetadata||a!==s.resourceMetadata)&&await t.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:u?.toString(),resourceMetadata:a,authorizationServerMetadata:l})}else{let k=await fL(e,{resourceMetadataUrl:u,fetchFn:o});c=k.authorizationServerUrl,l=k.authorizationServerMetadata,a=k.resourceMetadata,await t.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:u?.toString(),resourceMetadata:a,authorizationServerMetadata:l})}let d=await cL(e,t,a),p=await Promise.resolve(t.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let k=l?.client_id_metadata_document_supported===!0,w=t.clientMetadataUrl;if(w&&!aL(w))throw new di(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(k&&w)p={client_id:w},await t.saveClientInformation?.(p);else{if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let S=await vL(c,{metadata:l,clientMetadata:t.clientMetadata,fetchFn:o});await t.saveClientInformation(S),p=S}}let f=!t.redirectUrl;if(r!==void 0||f){let k=await yL(t,c,{metadata:l,resource:d,authorizationCode:r,fetchFn:o});return await t.saveTokens(k),"AUTHORIZED"}let m=await t.tokens();if(m?.refresh_token)try{let k=await gL(c,{metadata:l,clientInformation:p,refreshToken:m.refresh_token,resource:d,addClientAuthentication:t.addClientAuthentication,fetchFn:o});return await t.saveTokens(k),"AUTHORIZED"}catch(k){if(!(!(k instanceof Fe)||k instanceof Vr))throw k}let h=t.state?await t.state():void 0,{authorizationUrl:y,codeVerifier:_}=await mL(c,{metadata:l,clientInformation:p,state:h,redirectUrl:t.redirectUrl,scope:i||a?.scopes_supported?.join(" ")||t.clientMetadata.scope,resource:d});return await t.saveCodeVerifier(_),await t.redirectToAuthorization(y),"REDIRECT"}function aL(t){if(!t)return!1;try{let e=new URL(t);return e.protocol==="https:"&&e.pathname!=="/"}catch{return!1}}async function cL(t,e,r){let i=sP(t);if(e.validateResourceURL)return await e.validateResourceURL(i,r?.resource);if(r){if(!aP({requestedResource:i,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${i} (or origin)`);return new URL(r.resource)}}function v_(t){let e=t.headers.get("WWW-Authenticate");if(!e)return{};let[r,i]=e.split(" ");if(r.toLowerCase()!=="bearer"||!i)return{};let n=y_(t,"resource_metadata")||void 0,o;if(n)try{o=new URL(n)}catch{}let s=y_(t,"scope")||void 0,a=y_(t,"error")||void 0;return{resourceMetadataUrl:o,scope:s,error:a}}function y_(t,e){let r=t.headers.get("WWW-Authenticate");if(!r)return null;let i=new RegExp(`${e}=(?:"([^"]+)"|([^\\s,]+))`),n=r.match(i);return n?n[1]||n[2]:null}async function dP(t,e,r=fetch){let i=await dL(t,"oauth-protected-resource",r,{protocolVersion:e?.protocolVersion,metadataUrl:e?.resourceMetadataUrl});if(!i||i.status===404)throw await i?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} trying to load well-known OAuth protected resource metadata.`);return tP.parse(await i.json())}async function b_(t,e,r=fetch){try{return await r(t,{headers:e})}catch(i){if(i instanceof TypeError)return e?b_(t,void 0,r):void 0;throw i}}function lL(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function lP(t,e,r=fetch){return await b_(t,{"MCP-Protocol-Version":e},r)}function uL(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function dL(t,e,r,i){let n=new URL(t),o=i?.protocolVersion??hn,s;if(i?.metadataUrl)s=new URL(i.metadataUrl);else{let c=lL(e,n.pathname);s=new URL(c,i?.metadataServerUrl??n),s.search=n.search}let a=await lP(s,o,r);if(!i?.metadataUrl&&uL(a,n.pathname)){let c=new URL(`/.well-known/${e}`,n);a=await lP(c,o,r)}return a}function pL(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",i=[];if(!r)return i.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),i.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),i;let n=e.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),i.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,e.origin),type:"oauth"}),i.push({url:new URL(`/.well-known/openid-configuration${n}`,e.origin),type:"oidc"}),i.push({url:new URL(`${n}/.well-known/openid-configuration`,e.origin),type:"oidc"}),i}async function pP(t,{fetchFn:e=fetch,protocolVersion:r=hn}={}){let i={"MCP-Protocol-Version":r,Accept:"application/json"},n=pL(t);for(let{url:o,type:s}of n){let a=await b_(o,i,e);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${o}`)}return s==="oauth"?f_.parse(await a.json()):rP.parse(await a.json())}}}async function fL(t,e){let r,i;try{r=await dP(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(i=r.authorization_servers[0])}catch{}i||(i=String(new URL("/",t)));let n=await pP(i,{fetchFn:e?.fetchFn});return{authorizationServerUrl:i,authorizationServerMetadata:n,resourceMetadata:r}}async function mL(t,{metadata:e,clientInformation:r,redirectUrl:i,scope:n,state:o,resource:s}){let a;if(e){if(a=new URL(e.authorization_endpoint),!e.response_types_supported.includes(m_))throw new Error(`Incompatible auth server: does not support response type ${m_}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(h_))throw new Error(`Incompatible auth server: does not support code challenge method ${h_}`)}else a=new URL("/authorize",t);let c=await p_(),l=c.code_verifier,u=c.code_challenge;return a.searchParams.set("response_type",m_),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",u),a.searchParams.set("code_challenge_method",h_),a.searchParams.set("redirect_uri",String(i)),o&&a.searchParams.set("state",o),n&&a.searchParams.set("scope",n),n?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:l}}function hL(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}async function fP(t,{metadata:e,tokenRequestParams:r,clientInformation:i,addClientAuthentication:n,resource:o,fetchFn:s}){let a=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(o&&r.set("resource",o.href),n)await n(c,r,a,e);else if(i){let u=e?.token_endpoint_auth_methods_supported??[],d=rL(i,u);nL(d,i,c,r)}let l=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!l.ok)throw await uP(l);return nP.parse(await l.json())}async function gL(t,{metadata:e,clientInformation:r,refreshToken:i,resource:n,addClientAuthentication:o,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:i}),c=await fP(t,{metadata:e,tokenRequestParams:a,clientInformation:r,addClientAuthentication:o,resource:n,fetchFn:s});return{refresh_token:i,...c}}async function yL(t,e,{metadata:r,resource:i,authorizationCode:n,fetchFn:o}={}){let s=t.clientMetadata.scope,a;if(t.prepareTokenRequest&&(a=await t.prepareTokenRequest(s)),!a){if(!n)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let l=await t.codeVerifier();a=hL(n,l,t.redirectUrl)}let c=await t.clientInformation();return fP(e,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:t.addClientAuthentication,resource:i,fetchFn:o})}async function vL(t,{metadata:e,clientMetadata:r,fetchFn:i}){let n;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");n=new URL(e.registration_endpoint)}else n=new URL("/register",t);let o=await(i??fetch)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok)throw await uP(o);return oP.parse(await o.json())}var Yp=class extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function __(t){}function mP(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=__,onError:r=__,onRetry:i=__,onComment:n}=t,o="",s=!0,a,c="",l="";function u(h){let y=s?h.replace(/^\xEF\xBB\xBF/,""):h,[_,k]=bL(`${o}${y}`);for(let w of _)d(w);o=k,s=!1}function d(h){if(h===""){f();return}if(h.startsWith(":")){n&&n(h.slice(h.startsWith(": ")?2:1));return}let y=h.indexOf(":");if(y!==-1){let _=h.slice(0,y),k=h[y+1]===" "?2:1,w=h.slice(y+k);p(_,w,h);return}p(h,"",h)}function p(h,y,_){switch(h){case"event":l=y;break;case"data":c=`${c}${y}
|
|
101
|
-
`;break;case"id":a=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?i(parseInt(y,10)):r(new
|
|
102
|
-
`)?c.slice(0,-1):c}),a=void 0,c="",l=""}function m(h={}){o&&h.consume&&d(o),s=!0,a=void 0,c="",l="",o=""}return{feed:u,reset:m}}function
|
|
100
|
+
]`;continue}n+=i[c],i[c]==="\\"?o=!0:s&&i[c]==="]"?s=!1:!s&&i[c]==="["&&(s=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}function lp(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===C.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((i,n)=>({...i,[n]:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",n]})??Ne(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===C.ZodString&&t.keyType._def.checks?.length){let{type:i,...n}=cp(t.keyType._def,e);return{...r,propertyNames:n}}else{if(t.keyType?._def.typeName===C.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===C.ZodBranded&&t.keyType._def.type._def.typeName===C.ZodString&&t.keyType._def.type._def.checks?.length){let{type:i,...n}=ap(t.keyType._def,e);return{...r,propertyNames:n}}}return r}function BS(t,e){if(e.mapStrategy==="record")return lp(t,e);let r=B(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Ne(e),i=B(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Ne(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}function GS(t){let e=t.values,i=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[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 JS(t){return t.target==="openAi"?void 0:{not:Ne({...t,currentPath:[...t.currentPath,"not"]})}}function KS(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Ca={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function XS(t,e){if(e.target==="openApi3")return YS(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(i=>i._def.typeName in Ca&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let s=Ca[o._def.typeName];return s&&!n.includes(s)?[...n,s]: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 s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(i.length===r.length){let n=i.filter((o,s,a)=>a.indexOf(o)===s);return{type:n.length>1?n:n[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._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 YS(t,e)}var YS=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((i,n)=>B(i._def,{...e,currentPath:[...e.currentPath,"anyOf",`${n}`]})).filter(i=>!!i&&(!e.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0};function QS(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Ca[t.innerType._def.typeName],nullable:!0}:{type:[Ca[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let i=B(t.innerType._def,{...e,currentPath:[...e.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let r=B(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function e0(t,e){let r={type:"number"};if(!t.checks)return r;for(let i of t.checks)switch(i.kind){case"int":r.type="integer",dv(r,"type",i.message,e);break;case"min":e.target==="jsonSchema7"?i.inclusive?fe(r,"minimum",i.value,i.message,e):fe(r,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(r.exclusiveMinimum=!0),fe(r,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?fe(r,"maximum",i.value,i.message,e):fe(r,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(r.exclusiveMaximum=!0),fe(r,"maximum",i.value,i.message,e));break;case"multipleOf":fe(r,"multipleOf",i.value,i.message,e);break}return r}function t0(t,e){let r=e.target==="openAi",i={type:"object",properties:{}},n=[],o=t.shape();for(let a in o){let c=o[a];if(c===void 0||c._def===void 0)continue;let l=XO(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=B(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});u!==void 0&&(i.properties[a]=u,l||n.push(a))}n.length&&(i.required=n);let s=YO(t,e);return s!==void 0&&(i.additionalProperties=s),i}function YO(t,e){if(t.catchall._def.typeName!=="ZodNever")return B(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function XO(t){try{return t.isOptional()}catch{return!0}}var r0=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return B(t.innerType._def,e);let r=B(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Ne(e)},r]}:Ne(e)};var n0=(t,e)=>{if(e.pipeStrategy==="input")return B(t.in._def,e);if(e.pipeStrategy==="output")return B(t.out._def,e);let r=B(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),i=B(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter(n=>n!==void 0)}};function i0(t,e){return B(t.type._def,e)}function o0(t,e){let i={type:"array",uniqueItems:!0,items:B(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&fe(i,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&fe(i,"maxItems",t.maxSize.value,t.maxSize.message,e),i}function s0(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,i)=>B(r._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:B(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,i)=>B(r._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}function a0(t){return{not:Ne(t)}}function c0(t){return Ne(t)}var l0=(t,e)=>B(t.innerType._def,e);var u0=(t,e,r)=>{switch(e){case C.ZodString:return cp(t,r);case C.ZodNumber:return e0(t,r);case C.ZodObject:return t0(t,r);case C.ZodBigInt:return DS(t,r);case C.ZodBoolean:return US();case C.ZodDate:return pv(t,r);case C.ZodUndefined:return a0(r);case C.ZodNull:return KS(r);case C.ZodArray:return jS(t,r);case C.ZodUnion:case C.ZodDiscriminatedUnion:return XS(t,r);case C.ZodIntersection:return VS(t,r);case C.ZodTuple:return s0(t,r);case C.ZodRecord:return lp(t,r);case C.ZodLiteral:return HS(t,r);case C.ZodEnum:return qS(t);case C.ZodNativeEnum:return GS(t);case C.ZodNullable:return QS(t,r);case C.ZodOptional:return r0(t,r);case C.ZodMap:return BS(t,r);case C.ZodSet:return o0(t,r);case C.ZodLazy:return()=>t.getter()._def;case C.ZodPromise:return i0(t,r);case C.ZodNaN:case C.ZodNever:return JS(r);case C.ZodEffects:return FS(t,r);case C.ZodAny:return Ne(r);case C.ZodUnknown:return c0(r);case C.ZodDefault:return ZS(t,r);case C.ZodBranded:return ap(t,r);case C.ZodReadonly:return l0(t,r);case C.ZodCatch:return LS(t,r);case C.ZodPipeline:return n0(t,r);case C.ZodFunction:case C.ZodVoid:case C.ZodSymbol:return;default:return(i=>{})(e)}};function B(t,e,r=!1){let i=e.seen.get(t);if(e.override){let a=e.override?.(t,e,i,r);if(a!==OS)return a}if(i&&!r){let a=QO(i,e);if(a!==void 0)return a}let n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);let o=u0(t,t.typeName,e),s=typeof o=="function"?B(o(),e):o;if(s&&eN(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return n.jsonSchema=s,a}return n.jsonSchema=s,s}var QO=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:sp(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,i)=>e.currentPath[i]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Ne(e)):e.$refStrategy==="seen"?Ne(e):void 0}},eN=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r);var hv=(t,e)=>{let r=MS(e),i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[l,u])=>({...c,[l]:B(u._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??Ne(r)}),{}):void 0,n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=B(t._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Ne(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),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 a=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"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a};function tN(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function gv(t,e){return Tt(t)?Bn(t,{target:tN(e?.target),io:e?.pipeStrategy??"input"}):hv(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function yv(t){let r=vr(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=ad(r);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function vv(t,e){let r=yt(t,e);if(!r.success)throw r.error;return r.data}var rN=6e4,Po=class{constructor(e){this._options=e,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(qd,r=>{this._oncancel(r)}),this.setNotificationHandler(Wd,r=>{this._onprogress(r)}),this.setRequestHandler(Hd,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Bd,async(r,i)=>{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new O(U.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Jd,async(r,i)=>{let n=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),a.type==="response")u(c);else{let d=c,p=new O(d.error.code,d.error.message,d.error.data);u(p)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:i.requestId})}}let s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new O(U.InvalidParams,`Task not found: ${o}`);if(!bn(s.status))return await this._waitForTaskUpdate(o,i.signal),await n();if(bn(s.status)){let a=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[gn]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(Kd,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 O(U.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Xd,async(r,i)=>{try{let n=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!n)throw new O(U.InvalidParams,`Task not found: ${r.params.taskId}`);if(bn(n.status))throw new O(U.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 O(U.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof O?n:new O(U.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,i,n,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let i=Date.now()-r.startTime;if(r.maxTotalTimeout&&i>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),O.fromError(U.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:i});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){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=e;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,s)=>{n?.(o,s),Kn(o)||wS(o)?this._onresponse(o):_a(o)?this._onrequest(o,s):_S(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=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=O.fromError(U.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of e.values())i(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,r){let i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,o=e.params?._meta?.[gn]?.taskId;if(i===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:U.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},n?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):n?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=yS(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,l={signal:s.signal,sessionId:n?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(u,d)},sendRequest:async(u,d,p)=>{if(s.signal.aborted)throw new O(U.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};o&&!f.relatedTask&&(f.relatedTask={taskId:o});let m=f.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(u,d,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,l)).then(async u=>{if(s.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)},async u=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:U.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},n?.sessionId):await n?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...i}=e.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(e)}`));return}let s=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),s(c);return}o(i)}_onresponse(e){let r=Number(e.id),i=this._requestResolvers.get(r);if(i){if(this._requestResolvers.delete(r),Kn(e))i(e);else{let s=new O(e.error.code,e.error.message,e.error.data);i(s)}return}let n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(Kn(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),Kn(e))n(e);else{let s=O.fromError(e.error.code,e.error.message,e.error.data);n(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,i){let{task:n}=i??{};if(!n){try{yield{type:"result",result:await this.request(e,r,i)}}catch(s){yield{type:"error",error:s instanceof O?s:new O(U.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Dr,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new O(U.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:a},bn(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)}:a.status==="failed"?yield{type:"error",error:new O(U.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new O(U.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,i)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof O?s:new O(U.InternalError,String(s))}}}request(e,r,i){let{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=i??{};return new Promise((l,u)=>{let d=k=>{u(k)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(k){d(k);return}i?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};i?.onprogress&&(this._progressHandlers.set(p,i.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[gn]:c}});let m=k=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(k)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch($=>this._onerror(new Error(`Failed to send cancellation: ${$}`)));let w=k instanceof O?k:new O(U.RequestTimeout,String(k));u(w)};this._responseHandlers.set(p,k=>{if(!i?.signal?.aborted){if(k instanceof Error)return u(k);try{let w=yt(r,k.result);w.success?l(w.data):u(w.error)}catch(w){u(w)}}}),i?.signal?.addEventListener("abort",()=>{m(i?.signal?.reason)});let h=i?.timeout??rN,y=()=>m(O.fromError(U.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(p,h,i?.maxTotalTimeout,y,i?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let k=w=>{let $=this._responseHandlers.get(p);$?$(w):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,k),this._enqueueTaskMessage(_,{type:"request",message:f,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(p),u(w)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(k=>{this._cleanupTimeout(p),u(k)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Gd,r)}async getTaskResult(e,r,i){return this.request({method:"tasks/result",params:e},r,i)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Yd,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},xS,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let i=r?.relatedTask?.taskId;if(i){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[gn]:r.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[gn]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[gn]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let i=yv(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(n,o)=>{let s=vv(e,n);return Promise.resolve(r(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let i=yv(e);this._notificationHandlers.set(i,n=>{let o=vv(e,n);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,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(e,r,i,n)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(e,r);for(let n of i)if(n.type==="request"&&_a(n.message)){let o=n.message.id,s=this._requestResolvers.get(o);s?(s(new O(U.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let i=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(e);n?.pollInterval&&(i=n.pollInterval)}catch{}return new Promise((n,o)=>{if(r.aborted){o(new O(U.InvalidRequest,"Request cancelled"));return}let s=setTimeout(n,i);r.addEventListener("abort",()=>{clearTimeout(s),o(new O(U.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await i.createTask(n,e.id,{method:e.method,params:e.params},r)},getTask:async n=>{let o=await i.getTask(n,r);if(!o)throw new O(U.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,s)=>{await i.storeTaskResult(n,o,s,r);let a=await i.getTask(n,r);if(a){let c=Sa.parse({method:"notifications/tasks/status",params:a});await this.notification(c),bn(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>i.getTaskResult(n,r),updateTaskStatus:async(n,o,s)=>{let a=await i.getTask(n,r);if(!a)throw new O(U.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(bn(a.status))throw new O(U.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(n,o,s,r);let c=await i.getTask(n,r);if(c){let l=Sa.parse({method:"notifications/tasks/status",params:c});await this.notification(l),bn(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>i.listTasks(n,r)}}};function d0(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function up(t,e){let r={...t};for(let i in e){let n=i,o=e[n];if(o===void 0)continue;let s=r[n];d0(s)&&d0(o)?r[n]={...s,...o}:r[n]=o}return r}var YT=Lc(n_(),1),XT=Lc(KT(),1);function B4(){let t=new YT.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,XT.default)(t),t}var Wo=class{constructor(e){this._ajv=e??B4()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return i=>r(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Wp=class{constructor(e){this._client=e}async*callToolStream(e,r=yn,i){let n=this._client,o={...i,task:i?.task??(n.isToolTask(e.name)?{}:void 0)},s=n.requestStream({method:"tools/call",params:e},r,o),a=n.getToolOutputValidator(e.name);for await(let c of s){if(c.type==="result"&&a){let l=c.result;if(!l.structuredContent&&!l.isError){yield{type:"error",error:new O(U.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(l.structuredContent)try{let u=a(l.structuredContent);if(!u.valid){yield{type:"error",error:new O(U.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)};return}}catch(u){if(u instanceof O){yield{type:"error",error:u};return}yield{type:"error",error:new O(U.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)};return}}yield c}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,i){return this._client.getTaskResult({taskId:e},r,i)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,i){return this._client.requestStream(e,r,i)}};function Bp(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Gp(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function Jp(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,i=t.properties;for(let n of Object.keys(i)){let o=i[n];r[n]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(r[n]=o.default),r[n]!==void 0&&Jp(o,r[n])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&Jp(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&Jp(r,e)}}function G4(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}var Kp=class extends Po{constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new Wo,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ta,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",iv,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Yy,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Wp(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=up(this._capabilities,e)}setRequestHandler(e,r){let n=vr(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let o;if(Tt(n)){let a=n;o=a._zod?.def?.value??a.value}else{let a=n;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");let s=o;if(s==="elicitation/create"){let a=async(c,l)=>{let u=yt(cv,c);if(!u.success){let k=u.error instanceof Error?u.error.message:String(u.error);throw new O(U.InvalidParams,`Invalid elicitation request: ${k}`)}let{params:d}=u.data;d.mode=d.mode??"form";let{supportsFormMode:p,supportsUrlMode:f}=G4(this._capabilities.elicitation);if(d.mode==="form"&&!p)throw new O(U.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!f)throw new O(U.InvalidParams,"Client does not support URL-mode elicitation requests");let m=await Promise.resolve(r(c,l));if(d.task){let k=yt(Dr,m);if(!k.success){let w=k.error instanceof Error?k.error.message:String(k.error);throw new O(U.InvalidParams,`Invalid task creation result: ${w}`)}return k.data}let h=yt(vn,m);if(!h.success){let k=h.error instanceof Error?h.error.message:String(h.error);throw new O(U.InvalidParams,`Invalid elicitation result: ${k}`)}let y=h.data,_=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&y.action==="accept"&&y.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{Jp(_,y.content)}catch{}return y};return super.setRequestHandler(e,a)}if(s==="sampling/createMessage"){let a=async(c,l)=>{let u=yt(av,c);if(!u.success){let y=u.error instanceof Error?u.error.message:String(u.error);throw new O(U.InvalidParams,`Invalid sampling request: ${y}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let y=yt(Dr,p);if(!y.success){let _=y.error instanceof Error?y.error.message:String(y.error);throw new O(U.InvalidParams,`Invalid task creation result: ${_}`)}return y.data}let m=d.tools||d.toolChoice?za:Yn,h=yt(m,p);if(!h.success){let y=h.error instanceof Error?h.error.message:String(h.error);throw new O(U.InvalidParams,`Invalid sampling result: ${y}`)}return h.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let i=await this.request({method:"initialize",params:{protocolVersion:hn,capabilities:this._capabilities,clientInfo:this._clientInfo}},Hy,r);if(i===void 0)throw new Error(`Server sent invalid initialize result: ${i}`);if(!Ld.includes(i.protocolVersion))throw new Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(i){throw this.close(),i}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){Bp(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&Gp(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},jr,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},lv,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},jr,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},nv,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Xy,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},By,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Gy,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Ky,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},jr,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},jr,r)}async callTool(e,r=yn,i){if(this.isToolTaskRequired(e.name))throw new O(U.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let n=await this.request({method:"tools/call",params:e},r,i),o=this.getToolOutputValidator(e.name);if(o){if(!n.structuredContent&&!n.isError)throw new O(U.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(n.structuredContent)try{let s=o(n.structuredContent);if(!s.valid)throw new O(U.InvalidParams,`Structured content does not match the tool's output schema: ${s.errorMessage}`)}catch(s){throw s instanceof O?s:new O(U.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return n}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let n=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,n)}let i=r.execution?.taskSupport;(i==="required"||i==="optional")&&this._cachedKnownTaskTools.add(r.name),i==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let i=await this.request({method:"tools/list",params:e},ov,r);return this.cacheToolMetadata(i.tools),i}_setupListChangedHandler(e,r,i,n){let o=CS.safeParse(i);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof i.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:a}=o.data,{onChanged:c}=i,l=async()=>{if(!s){c(null,null);return}try{let d=await n();c(null,d)}catch(d){let p=d instanceof Error?d:new Error(String(d));c(p,null)}},u=()=>{if(a){let d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);let p=setTimeout(l,a);this._listChangedDebounceTimers.set(e,p)}else l()};this.setNotificationHandler(r,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function Yp(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}function QT(t=fetch,e){return e?async(r,i)=>{let n={...e,...i,headers:i?.headers?{...Yp(e.headers),...Yp(i.headers)}:e.headers};return t(r,n)}:t}var d_;d_=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function J4(t){return(await d_).getRandomValues(new Uint8Array(t))}async function K4(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%e.length,i="";for(;i.length<t;){let n=await J4(t-i.length);for(let o of n)o<r&&(i+=e[o%e.length])}return i}async function Y4(t){return await K4(t)}async function X4(t){let e=await(await d_).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function p_(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await Y4(t),r=await X4(e);return{code_verifier:e,code_challenge:r}}var st=yd().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:Uy.custom,message:"URL must be parseable",fatal:!0}),_s}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),tP=Le({resource:g().url(),authorization_servers:R(st).optional(),jwks_uri:g().url().optional(),scopes_supported:R(g()).optional(),bearer_methods_supported:R(g()).optional(),resource_signing_alg_values_supported:R(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:_e().optional(),authorization_details_types_supported:R(g()).optional(),dpop_signing_alg_values_supported:R(g()).optional(),dpop_bound_access_tokens_required:_e().optional()}),f_=Le({issuer:g(),authorization_endpoint:st,token_endpoint:st,registration_endpoint:st.optional(),scopes_supported:R(g()).optional(),response_types_supported:R(g()),response_modes_supported:R(g()).optional(),grant_types_supported:R(g()).optional(),token_endpoint_auth_methods_supported:R(g()).optional(),token_endpoint_auth_signing_alg_values_supported:R(g()).optional(),service_documentation:st.optional(),revocation_endpoint:st.optional(),revocation_endpoint_auth_methods_supported:R(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:R(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:R(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:R(g()).optional(),code_challenge_methods_supported:R(g()).optional(),client_id_metadata_document_supported:_e().optional()}),Q4=Le({issuer:g(),authorization_endpoint:st,token_endpoint:st,userinfo_endpoint:st.optional(),jwks_uri:st,registration_endpoint:st.optional(),scopes_supported:R(g()).optional(),response_types_supported:R(g()),response_modes_supported:R(g()).optional(),grant_types_supported:R(g()).optional(),acr_values_supported:R(g()).optional(),subject_types_supported:R(g()),id_token_signing_alg_values_supported:R(g()),id_token_encryption_alg_values_supported:R(g()).optional(),id_token_encryption_enc_values_supported:R(g()).optional(),userinfo_signing_alg_values_supported:R(g()).optional(),userinfo_encryption_alg_values_supported:R(g()).optional(),userinfo_encryption_enc_values_supported:R(g()).optional(),request_object_signing_alg_values_supported:R(g()).optional(),request_object_encryption_alg_values_supported:R(g()).optional(),request_object_encryption_enc_values_supported:R(g()).optional(),token_endpoint_auth_methods_supported:R(g()).optional(),token_endpoint_auth_signing_alg_values_supported:R(g()).optional(),display_values_supported:R(g()).optional(),claim_types_supported:R(g()).optional(),claims_supported:R(g()).optional(),service_documentation:g().optional(),claims_locales_supported:R(g()).optional(),ui_locales_supported:R(g()).optional(),claims_parameter_supported:_e().optional(),request_parameter_supported:_e().optional(),request_uri_parameter_supported:_e().optional(),require_request_uri_registration:_e().optional(),op_policy_uri:st.optional(),op_tos_uri:st.optional(),client_id_metadata_document_supported:_e().optional()}),rP=E({...Q4.shape,...f_.pick({code_challenge_methods_supported:!0}).shape}),nP=E({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:va.number().optional(),scope:g().optional(),refresh_token:g().optional()}).strip(),iP=E({error:g(),error_description:g().optional(),error_uri:g().optional()}),eP=st.optional().or(Z("").transform(()=>{})),eL=E({redirect_uris:R(st),token_endpoint_auth_method:g().optional(),grant_types:R(g()).optional(),response_types:R(g()).optional(),client_name:g().optional(),client_uri:st.optional(),logo_uri:eP,scope:g().optional(),contacts:R(g()).optional(),tos_uri:eP,policy_uri:g().optional(),jwks_uri:st.optional(),jwks:Od().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),tL=E({client_id:g(),client_secret:g().optional(),client_id_issued_at:pe().optional(),client_secret_expires_at:pe().optional()}).strip(),oP=eL.merge(tL),PK=E({error:g(),error_description:g().optional()}).strip(),zK=E({token:g(),token_type_hint:g().optional()}).strip();function sP(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function aP({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),i=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==i.origin||r.pathname.length<i.pathname.length)return!1;let n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",o=i.pathname.endsWith("/")?i.pathname:i.pathname+"/";return n.startsWith(o)}var Fe=class extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}},sc=class extends Fe{};sc.errorCode="invalid_request";var ci=class extends Fe{};ci.errorCode="invalid_client";var li=class extends Fe{};li.errorCode="invalid_grant";var ui=class extends Fe{};ui.errorCode="unauthorized_client";var ac=class extends Fe{};ac.errorCode="unsupported_grant_type";var cc=class extends Fe{};cc.errorCode="invalid_scope";var lc=class extends Fe{};lc.errorCode="access_denied";var Vr=class extends Fe{};Vr.errorCode="server_error";var uc=class extends Fe{};uc.errorCode="temporarily_unavailable";var dc=class extends Fe{};dc.errorCode="unsupported_response_type";var pc=class extends Fe{};pc.errorCode="unsupported_token_type";var fc=class extends Fe{};fc.errorCode="invalid_token";var mc=class extends Fe{};mc.errorCode="method_not_allowed";var hc=class extends Fe{};hc.errorCode="too_many_requests";var di=class extends Fe{};di.errorCode="invalid_client_metadata";var gc=class extends Fe{};gc.errorCode="insufficient_scope";var yc=class extends Fe{};yc.errorCode="invalid_target";var cP={[sc.errorCode]:sc,[ci.errorCode]:ci,[li.errorCode]:li,[ui.errorCode]:ui,[ac.errorCode]:ac,[cc.errorCode]:cc,[lc.errorCode]:lc,[Vr.errorCode]:Vr,[uc.errorCode]:uc,[dc.errorCode]:dc,[pc.errorCode]:pc,[fc.errorCode]:fc,[mc.errorCode]:mc,[hc.errorCode]:hc,[di.errorCode]:di,[gc.errorCode]:gc,[yc.errorCode]:yc};var Hr=class extends Error{constructor(e){super(e??"Unauthorized")}};function rL(t){return["client_secret_basic","client_secret_post","none"].includes(t)}var m_="code",h_="S256";function nL(t,e){let r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":"token_endpoint_auth_method"in t&&t.token_endpoint_auth_method&&rL(t.token_endpoint_auth_method)&&e.includes(t.token_endpoint_auth_method)?t.token_endpoint_auth_method:r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function iL(t,e,r,i){let{client_id:n,client_secret:o}=e;switch(t){case"client_secret_basic":oL(n,o,r);return;case"client_secret_post":sL(n,o,i);return;case"none":aL(n,i);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function oL(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");let i=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${i}`)}function sL(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function aL(t,e){e.set("client_id",t)}async function uP(t){let e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{let i=iP.parse(JSON.parse(r)),{error:n,error_description:o,error_uri:s}=i,a=cP[n]||Vr;return new a(o||"",s)}catch(i){let n=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${i}. Raw body: ${r}`;return new Vr(n)}}async function vc(t,e){try{return await g_(t,e)}catch(r){if(r instanceof ci||r instanceof ui)return await t.invalidateCredentials?.("all"),await g_(t,e);if(r instanceof li)return await t.invalidateCredentials?.("tokens"),await g_(t,e);throw r}}async function g_(t,{serverUrl:e,authorizationCode:r,scope:i,resourceMetadataUrl:n,fetchFn:o}){let s=await t.discoveryState?.(),a,c,l,u=n;if(!u&&s?.resourceMetadataUrl&&(u=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,a=s.resourceMetadata,l=s.authorizationServerMetadata??await pP(c,{fetchFn:o}),!a)try{a=await dP(e,{resourceMetadataUrl:u},o)}catch{}(l!==s.authorizationServerMetadata||a!==s.resourceMetadata)&&await t.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:u?.toString(),resourceMetadata:a,authorizationServerMetadata:l})}else{let k=await mL(e,{resourceMetadataUrl:u,fetchFn:o});c=k.authorizationServerUrl,l=k.authorizationServerMetadata,a=k.resourceMetadata,await t.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:u?.toString(),resourceMetadata:a,authorizationServerMetadata:l})}let d=await lL(e,t,a),p=await Promise.resolve(t.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let k=l?.client_id_metadata_document_supported===!0,w=t.clientMetadataUrl;if(w&&!cL(w))throw new di(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(k&&w)p={client_id:w},await t.saveClientInformation?.(p);else{if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let S=await bL(c,{metadata:l,clientMetadata:t.clientMetadata,fetchFn:o});await t.saveClientInformation(S),p=S}}let f=!t.redirectUrl;if(r!==void 0||f){let k=await vL(t,c,{metadata:l,resource:d,authorizationCode:r,fetchFn:o});return await t.saveTokens(k),"AUTHORIZED"}let m=await t.tokens();if(m?.refresh_token)try{let k=await yL(c,{metadata:l,clientInformation:p,refreshToken:m.refresh_token,resource:d,addClientAuthentication:t.addClientAuthentication,fetchFn:o});return await t.saveTokens(k),"AUTHORIZED"}catch(k){if(!(!(k instanceof Fe)||k instanceof Vr))throw k}let h=t.state?await t.state():void 0,{authorizationUrl:y,codeVerifier:_}=await hL(c,{metadata:l,clientInformation:p,state:h,redirectUrl:t.redirectUrl,scope:i||a?.scopes_supported?.join(" ")||t.clientMetadata.scope,resource:d});return await t.saveCodeVerifier(_),await t.redirectToAuthorization(y),"REDIRECT"}function cL(t){if(!t)return!1;try{let e=new URL(t);return e.protocol==="https:"&&e.pathname!=="/"}catch{return!1}}async function lL(t,e,r){let i=sP(t);if(e.validateResourceURL)return await e.validateResourceURL(i,r?.resource);if(r){if(!aP({requestedResource:i,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${i} (or origin)`);return new URL(r.resource)}}function v_(t){let e=t.headers.get("WWW-Authenticate");if(!e)return{};let[r,i]=e.split(" ");if(r.toLowerCase()!=="bearer"||!i)return{};let n=y_(t,"resource_metadata")||void 0,o;if(n)try{o=new URL(n)}catch{}let s=y_(t,"scope")||void 0,a=y_(t,"error")||void 0;return{resourceMetadataUrl:o,scope:s,error:a}}function y_(t,e){let r=t.headers.get("WWW-Authenticate");if(!r)return null;let i=new RegExp(`${e}=(?:"([^"]+)"|([^\\s,]+))`),n=r.match(i);return n?n[1]||n[2]:null}async function dP(t,e,r=fetch){let i=await pL(t,"oauth-protected-resource",r,{protocolVersion:e?.protocolVersion,metadataUrl:e?.resourceMetadataUrl});if(!i||i.status===404)throw await i?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} trying to load well-known OAuth protected resource metadata.`);return tP.parse(await i.json())}async function b_(t,e,r=fetch){try{return await r(t,{headers:e})}catch(i){if(i instanceof TypeError)return e?b_(t,void 0,r):void 0;throw i}}function uL(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function lP(t,e,r=fetch){return await b_(t,{"MCP-Protocol-Version":e},r)}function dL(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function pL(t,e,r,i){let n=new URL(t),o=i?.protocolVersion??hn,s;if(i?.metadataUrl)s=new URL(i.metadataUrl);else{let c=uL(e,n.pathname);s=new URL(c,i?.metadataServerUrl??n),s.search=n.search}let a=await lP(s,o,r);if(!i?.metadataUrl&&dL(a,n.pathname)){let c=new URL(`/.well-known/${e}`,n);a=await lP(c,o,r)}return a}function fL(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",i=[];if(!r)return i.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),i.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),i;let n=e.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),i.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,e.origin),type:"oauth"}),i.push({url:new URL(`/.well-known/openid-configuration${n}`,e.origin),type:"oidc"}),i.push({url:new URL(`${n}/.well-known/openid-configuration`,e.origin),type:"oidc"}),i}async function pP(t,{fetchFn:e=fetch,protocolVersion:r=hn}={}){let i={"MCP-Protocol-Version":r,Accept:"application/json"},n=fL(t);for(let{url:o,type:s}of n){let a=await b_(o,i,e);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${o}`)}return s==="oauth"?f_.parse(await a.json()):rP.parse(await a.json())}}}async function mL(t,e){let r,i;try{r=await dP(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(i=r.authorization_servers[0])}catch{}i||(i=String(new URL("/",t)));let n=await pP(i,{fetchFn:e?.fetchFn});return{authorizationServerUrl:i,authorizationServerMetadata:n,resourceMetadata:r}}async function hL(t,{metadata:e,clientInformation:r,redirectUrl:i,scope:n,state:o,resource:s}){let a;if(e){if(a=new URL(e.authorization_endpoint),!e.response_types_supported.includes(m_))throw new Error(`Incompatible auth server: does not support response type ${m_}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(h_))throw new Error(`Incompatible auth server: does not support code challenge method ${h_}`)}else a=new URL("/authorize",t);let c=await p_(),l=c.code_verifier,u=c.code_challenge;return a.searchParams.set("response_type",m_),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",u),a.searchParams.set("code_challenge_method",h_),a.searchParams.set("redirect_uri",String(i)),o&&a.searchParams.set("state",o),n&&a.searchParams.set("scope",n),n?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",s.href),{authorizationUrl:a,codeVerifier:l}}function gL(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}async function fP(t,{metadata:e,tokenRequestParams:r,clientInformation:i,addClientAuthentication:n,resource:o,fetchFn:s}){let a=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(o&&r.set("resource",o.href),n)await n(c,r,a,e);else if(i){let u=e?.token_endpoint_auth_methods_supported??[],d=nL(i,u);iL(d,i,c,r)}let l=await(s??fetch)(a,{method:"POST",headers:c,body:r});if(!l.ok)throw await uP(l);return nP.parse(await l.json())}async function yL(t,{metadata:e,clientInformation:r,refreshToken:i,resource:n,addClientAuthentication:o,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:i}),c=await fP(t,{metadata:e,tokenRequestParams:a,clientInformation:r,addClientAuthentication:o,resource:n,fetchFn:s});return{refresh_token:i,...c}}async function vL(t,e,{metadata:r,resource:i,authorizationCode:n,fetchFn:o}={}){let s=t.clientMetadata.scope,a;if(t.prepareTokenRequest&&(a=await t.prepareTokenRequest(s)),!a){if(!n)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let l=await t.codeVerifier();a=gL(n,l,t.redirectUrl)}let c=await t.clientInformation();return fP(e,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:t.addClientAuthentication,resource:i,fetchFn:o})}async function bL(t,{metadata:e,clientMetadata:r,fetchFn:i}){let n;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");n=new URL(e.registration_endpoint)}else n=new URL("/register",t);let o=await(i??fetch)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok)throw await uP(o);return oP.parse(await o.json())}var Xp=class extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function __(t){}function mP(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=__,onError:r=__,onRetry:i=__,onComment:n}=t,o="",s=!0,a,c="",l="";function u(h){let y=s?h.replace(/^\xEF\xBB\xBF/,""):h,[_,k]=_L(`${o}${y}`);for(let w of _)d(w);o=k,s=!1}function d(h){if(h===""){f();return}if(h.startsWith(":")){n&&n(h.slice(h.startsWith(": ")?2:1));return}let y=h.indexOf(":");if(y!==-1){let _=h.slice(0,y),k=h[y+1]===" "?2:1,w=h.slice(y+k);p(_,w,h);return}p(h,"",h)}function p(h,y,_){switch(h){case"event":l=y;break;case"data":c=`${c}${y}
|
|
101
|
+
`;break;case"id":a=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?i(parseInt(y,10)):r(new Xp(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:_}));break;default:r(new Xp(`Unknown field "${h.length>20?`${h.slice(0,20)}\u2026`:h}"`,{type:"unknown-field",field:h,value:y,line:_}));break}}function f(){c.length>0&&e({id:a,event:l||void 0,data:c.endsWith(`
|
|
102
|
+
`)?c.slice(0,-1):c}),a=void 0,c="",l=""}function m(h={}){o&&h.consume&&d(o),s=!0,a=void 0,c="",l="",o=""}return{feed:u,reset:m}}function _L(t){let e=[],r="",i=0;for(;i<t.length;){let n=t.indexOf("\r",i),o=t.indexOf(`
|
|
103
103
|
`,i),s=-1;if(n!==-1&&o!==-1?s=Math.min(n,o):n!==-1?n===t.length-1?s=-1:s=n:o!==-1&&(s=o),s===-1){r=t.slice(i);break}else{let a=t.slice(i,s);e.push(a),i=s+1,t[i-1]==="\r"&&t[i]===`
|
|
104
|
-
`&&i++}}return[e,r]}var Xp=class extends TransformStream{constructor({onError:e,onRetry:r,onComment:i}={}){let n;super({start(o){n=mP({onEvent:s=>{o.enqueue(s)},onError(s){e==="terminate"?o.error(s):typeof e=="function"&&e(s)},onRetry:r,onComment:i})},transform(o){n.feed(o)}})}};var _L={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Pn=class extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},Qp=class{constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=QT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??_L}async _authThenStart(){if(!this._authProvider)throw new Hr("No auth provider");let e;try{e=await vc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new Hr;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let i=await this._authProvider.tokens();i&&(e.Authorization=`Bearer ${i.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=Kp(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let i=await this._commonHeaders();i.set("Accept","text/event-stream"),r&&i.set("last-event-id",r);let n=await(this._fetch??fetch)(this._url,{method:"GET",headers:i,signal:this._abortController?.signal});if(!n.ok){if(await n.body?.cancel(),n.status===401&&this._authProvider)return await this._authThenStart();if(n.status===405)return;throw new Pn(n.status,`Failed to open SSE stream: ${n.statusText}`)}this._handleSseStream(n.body,e,!0)}catch(i){throw this.onerror?.(i),i}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,i=this._reconnectionOptions.reconnectionDelayGrowFactor,n=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(i,e),n)}_scheduleReconnection(e,r=0){let i=this._reconnectionOptions.maxRetries;if(r>=i){this.onerror?.(new Error(`Maximum reconnection attempts (${i}) exceeded.`));return}let n=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,r+1)})},n)}_handleSseStream(e,r,i){if(!e)return;let{onresumptiontoken:n,replayMessageId:o}=r,s,a=!1,c=!1;(async()=>{try{let u=e.pipeThrough(new TextDecoderStream).pipeThrough(new Xp({onRetry:f=>{this._serverRetryMs=f}})).getReader();for(;;){let{value:f,done:m}=await u.read();if(m)break;if(f.id&&(s=f.id,a=!0,n?.(f.id)),!!f.data&&(!f.event||f.event==="message"))try{let h=So.parse(JSON.parse(f.data));Kn(h)&&(c=!0,o!==void 0&&(h.id=o)),this.onmessage?.(h)}catch(h){this.onerror?.(h)}}(i||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:n,replayMessageId:o},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(i||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:n,replayMessageId:o},0)}catch(f){this.onerror?.(new Error(`Failed to reconnect: ${f instanceof Error?f.message:String(f)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Hr("No auth provider");if(await vc(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Hr("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:i,onresumptiontoken:n}=r||{};if(i){this._startOrAuthSse({resumptionToken:i,replayMessageId:_a(e)?e.id:void 0}).catch(p=>this.onerror?.(p));return}let o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let p=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Pn(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:m}=v_(a);if(this._resourceMetadataUrl=f,this._scope=m,await vc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Hr;return this._hasCompletedAuthFlow=!0,this.send(e)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:m,error:h}=v_(a);if(h==="insufficient_scope"){let y=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===y)throw new Pn(403,"Server returned 403 after trying upscoping");if(m&&(this._scope=m),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=y??void 0,await vc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Hr;return this.send(e)}}throw new Pn(a.status,`Error POSTing to endpoint: ${p}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),kS(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(p=>this.onerror?.(p));return}let u=(Array.isArray(e)?e:[e]).filter(p=>"method"in p&&"id"in p&&p.id!==void 0).length>0,d=a.headers.get("content-type");if(u)if(d?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:n},!1);else if(d?.includes("application/json")){let p=await a.json(),f=Array.isArray(p)?p.map(m=>So.parse(m)):[So.parse(p)];for(let m of f)this.onmessage?.(m)}else throw await a.body?.cancel(),new Pn(-1,`Unexpected content type: ${d}`);else await a.body?.cancel()}catch(i){throw this.onerror?.(i),i}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,r);if(await i.body?.cancel(),!i.ok&&i.status!==405)throw new Pn(i.status,`Failed to terminate session: ${i.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var ef=class{options;client=null;connecting=null;constructor(e){this.options=e}async connect(){await this.ensureClient()}async listTools(){return(await this.ensureClient()).listTools()}async callTool(e,r={}){return await(await this.ensureClient()).callTool({name:e,arguments:r})}async close(){let e=this.client;this.client=null,this.connecting=null,e&&await e.close()}async ensureClient(){return this.client?this.client:this.connecting?this.connecting:(this.connecting=this.doConnect().finally(()=>{this.connecting=null}),this.connecting)}async doConnect(){let{url:e,getToken:r,clientInfo:i,onToolsChanged:n,fetchImpl:o}=this.options,s=o??fetch,a=async(u,d)=>{let p=await r(),f=new Headers(d?.headers);return f.set("Authorization",`Bearer ${p}`),s(u,{...d,headers:f})},c=new Qp(new URL(e),{fetch:a}),l=new Jp(i??{name:"gigabuddy-door-client",version:"0.0.1"});return n&&l.setNotificationHandler(Ta,async()=>n()),c.onclose=()=>{this.client===l&&(this.client=null)},await l.connect(c),this.client=l,l}};async function bc(t){let{exec:e}=await import("node:child_process"),{promisify:r}=await import("node:util"),i=r(e),n=process.platform,o=n==="darwin"?`open "${t}"`:n==="win32"?`start "" "${t}"`:`xdg-open "${t}"`;await i(o)}function hP(t){return new Promise(e=>setTimeout(e,t))}function wL(t){try{let e=t.split(".")[1];if(!e)return;let r=JSON.parse(Buffer.from(e,"base64url").toString("utf-8"));return typeof r.email=="string"?r.email:void 0}catch{return}}async function gP(t){let e=t.fetchImpl??fetch,r={clientId:t.clientId??"gigabuddy-cli"};t.productId!==void 0&&(r.productId=t.productId),t.scopes!==void 0&&(r.scopes=t.scopes);let i=await e(`${t.authUrl}/api/auth/device/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw new Error(`Failed to start device flow: ${await i.text()}`);let{deviceCode:n,userCode:o,verificationUrl:s,expiresIn:a,interval:c}=await i.json();return{deviceCode:n,userCode:o,verificationUrl:s,expiresIn:a,interval:c}}async function yP(t,e,r={}){let i=r.fetchImpl??fetch,n=Date.now()+e.expiresIn*1e3,o=(e.interval||5)*1e3;for(;Date.now()<n;){await hP(o);let s=await i(`${t}/api/auth/device/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e.deviceCode})});if(s.status===429){await hP(o);continue}if(!s.ok)continue;let a=await s.json();if(a.status==="complete"&&a.platformToken&&a.refreshToken&&a.userId)return{refreshToken:a.refreshToken,platformToken:a.platformToken,userId:a.userId,userEmail:a.userEmail??wL(a.platformToken)};if(a.status==="expired")throw new Error("Device code expired. Please try again.");r.onPending?.()}throw new Error("Authentication timed out. Please try again.")}var tf=class{refreshToken;authUrl;platformToken=null;tokenExpiresAt=0;refreshPromise=null;onRefreshTokenRotated;reloginHint;fetchImpl;constructor(e){this.refreshToken=e.refreshToken,this.authUrl=e.authUrl,this.onRefreshTokenRotated=e.onRefreshTokenRotated,this.reloginHint=e.reloginHint??"Sign in again with 'gigabuddy login'.",this.fetchImpl=e.fetchImpl??fetch}async getToken(){return this.platformToken&&Date.now()<this.tokenExpiresAt-6e4?this.platformToken:this.refresh()}invalidate(){this.platformToken=null,this.tokenExpiresAt=0}async refresh(){return this.refreshPromise?this.refreshPromise:(this.refreshPromise=this.doRefresh().finally(()=>{this.refreshPromise=null}),this.refreshPromise)}async doRefresh(){let e=await this.fetchImpl(`${this.authUrl}/api/token/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:this.refreshToken})});if(!e.ok){let i=await e.text();throw new Error(`Token refresh failed (${e.status}): ${i}. ${this.reloginHint}`)}let r=await e.json();return this.platformToken=r.token,this.tokenExpiresAt=Date.now()+r.expiresIn*1e3,r.refreshToken&&r.refreshToken!==this.refreshToken&&(this.refreshToken=r.refreshToken,this.onRefreshTokenRotated?.(r.refreshToken)),r.token}};var vP={mycelium:{scratchDirName:".mycelium",scratchEnvVar:"MYCELIUM_SCRATCH_DIR",harnessSessionEnvVar:"MYCELIUM_HARNESS_SESSION_ID",serverName:"mycelium",chatSenderId:"mycelium-agent",hostDirPrefix:"mycelium-host-",bridgeSocketPrefix:"mycelium-bridge-",treeIdFileName:"mycelium-tree-id",webAppKey:"mycelium"},gigabuddy:{scratchDirName:".gigabuddy",scratchEnvVar:"GIGABUDDY_SCRATCH_DIR",harnessSessionEnvVar:"GIGABUDDY_HARNESS_SESSION_ID",serverName:"gigabuddy",chatSenderId:"gigabuddy-agent",hostDirPrefix:"gigabuddy-host-",bridgeSocketPrefix:"gigabuddy-bridge-",treeIdFileName:"gigabuddy-tree-id",webAppKey:"gigabuddy"}},rf="mycelium";function bP(t){rf=t}function nf(){return rf}function Be(){return vP[rf]}function _P(){return vP[rf==="mycelium"?"gigabuddy":"mycelium"]}function wP(t){return{fileId:t.id,url:t.publicUrl??t.signedUrl??null,publicUrl:t.publicUrl??null,expiresAt:t.signedUrlExpiresAt??null,name:t.originalName,contentType:t.contentType,size:t.size}}var $L=6e4;function $P(t){let e=new URLSearchParams;return e.set("limit",String(t?.limit??50)),t?.after&&e.set("after",t.after),t?.before&&e.set("before",t.before),t?.senderId&&e.set("senderId",t.senderId),t?.senderType&&e.set("senderType",t.senderType),t?.sponsorId&&e.set("sponsorId",t.sponsorId),t?.activityId&&e.set("activityId",t.activityId),t?.activityKind&&e.set("activityKind",t.activityKind),t?.since&&e.set("since",t.since),t?.until&&e.set("until",t.until),e}function kL(t){if(t!=null){if(typeof t=="string"){let e=Date.parse(t);return Number.isNaN(e)?void 0:new Date(e).toISOString()}if(typeof t=="number"){let e=t<1e12?t*1e3:t;return new Date(e).toISOString()}if(typeof t=="object"){let e=t,r=e._seconds??e.seconds;if(typeof r=="number"){let i=e._nanoseconds??e.nanoseconds,n=r*1e3+(typeof i=="number"?Math.floor(i/1e6):0);return new Date(n).toISOString()}}}}function sf(t){let e=t??{};return{...e,id:e.id??"",content:e.content??"",createdAt:kL(e.createdAt)??""}}function of(t){let e=t??{},r=e.data??{},i=e.full??{},n=e.metadata??{},o=s=>e[s]??i[s]??n[s]??r[s];return{...r,...i,...e,id:e.id??"",label:o("label")??"",status:o("status")??"",visibility:o("visibility")??"",kind:o("kind"),conversationId:o("conversationId"),participants:o("participants"),attachments:o("attachments"),statusText:o("statusText")}}var af=class{getToken;apiUrl;authUrl;onTokenExpired=null;fileUrlCache=new Map;constructor(e){this.getToken=e.getToken,this.apiUrl=e.apiUrl,this.authUrl=e.authUrl}setTokenProvider(e){this.getToken=e}currentToken(){return this.getToken()}async withTokenProvider(e,r){let i=this.getToken;this.getToken=e;try{return await r()}finally{this.getToken=i}}setOnTokenExpired(e){this.onTokenExpired=e}async fetchRaw(e,r){let i=await this.getToken(),n=await fetch(e,{...r,headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json",...r?.headers}});if(n.status===401&&this.onTokenExpired){await this.onTokenExpired();let s=await this.getToken(),a=await fetch(e,{...r,headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json",...r?.headers}});if(!a.ok){let l=await a.text();throw new Error(`API error (${a.status}): ${l}`)}return a.headers.get("content-type")?.includes("application/json")?await a.json():void 0}if(!n.ok){let s=await n.text();throw new Error(`API error (${n.status}): ${s}`)}if(n.headers.get("content-type")?.includes("application/json"))return await n.json()}async fetchPlace(e,r){return this.fetchRaw(`${this.apiUrl}${e}`,r)}async listTenancies(){return((await this.fetchRaw(`${this.apiUrl}/api/installations/mine`)).installations??[]).map(r=>({id:r.installationId,name:r.installation?.name??r.org?.name??r.installationId,productId:r.productId}))}async listPlaces(e){return(await this.fetchRaw(`${this.apiUrl}/ext/places/boot?tenancyId=${encodeURIComponent(e)}`)).places}async getPlace(e){let i=(await this.fetchPlace(`/places/${encodeURIComponent(e)}`)).place,n=i.data??i;return{id:i.id??e,name:n.name??i.name??"Unknown",description:n.description??void 0,conversationId:n.conversationId??void 0,visibility:n.visibility??void 0,memberCount:i.memberCount??n.memberCount??void 0,tenancyId:i.tenancyId??i.installationId??i.orgId??void 0,orgId:i.orgId??void 0}}async sendMessage(e,r){return this.fetchPlace(`/places/${encodeURIComponent(e)}/messages`,{method:"POST",headers:{"X-Chat-User-Id":`${nf()}-agent`,"X-Chat-Display-Name":r.senderName??"Gigabuddy Agent"},body:JSON.stringify(r)})}async getMessages(e,r){let i=$P(r),n=await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages?${i.toString()}`);return{...n,messages:(n.messages??[]).map(sf)}}async markPlaceRead(e,r){await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages/read`,{method:"POST",body:JSON.stringify({messageId:r})})}async markThreadRead(e,r,i){await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/read`,{method:"POST",body:JSON.stringify({messageId:i})})}async getReplies(e,r,i){let n=$P(i),o=await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/replies?${n.toString()}`);return{...o,messages:(o.messages??[]).map(sf)}}async sendContentCard(e,r,i,n){let o=[];n?.text&&o.push({type:"text",text:n.text,format:"markdown"});let s={type:"content_card",instanceId:r,contextType:i};n?.contextSchemaId&&(s.contextSchemaId=n.contextSchemaId),n?.view&&(s.view=n.view),n?.snapshot&&(s.snapshot=n.snapshot),o.push(s);let a=o.length===1&&!n?.text?s:{type:"composite",blocks:o};return this.sendMessage(e,{content:a,senderName:n?.senderName,parentMessageId:n?.parentMessageId})}async uploadFile(e,r,i){let n=new FormData,o=new Uint8Array(r.data).buffer,s=r.contentType?new Blob([o],{type:r.contentType}):new Blob([o]);n.append("file",s,r.filename),n.append("placeIds",JSON.stringify([e])),n.append("category",i?.category??"chat-attachment"),i?.visibility&&n.append("visibility",i.visibility);let a=async()=>{let u=await this.getToken();return fetch(`${this.apiUrl}/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${u}`},body:n})},c=await a();if(c.status===401&&this.onTokenExpired&&(await this.onTokenExpired(),c=await a()),!c.ok){let u=await c.text();throw new Error(`Upload error (${c.status}): ${u}`)}let l=await c.json();return wP(l.file)}async getFileUrl(e){let r=this.fileUrlCache.get(e);if(r&&(r.publicUrl||r.expiresAt&&new Date(r.expiresAt).getTime()-Date.now()>$L))return r;let i=await this.fetchRaw(`${this.apiUrl}/files/${encodeURIComponent(e)}?download=true`),n=wP(i.file);return this.fileUrlCache.set(e,n),n}async downloadFile(e){let r=async()=>{let n=await this.getToken();return fetch(`${this.apiUrl}/files/${encodeURIComponent(e)}/download`,{headers:{Authorization:`Bearer ${n}`}})},i=await r();if(i.status===401&&this.onTokenExpired&&(await this.onTokenExpired(),i=await r()),!i.ok){let n=await i.text();throw new Error(`Download error (${i.status}): ${n}`)}return{data:new Uint8Array(await i.arrayBuffer()),contentType:i.headers.get("content-type")??"application/octet-stream"}}async getActivity(e,r){let i=await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}`);return of(i.activity)}async listActivities(e,r){let i=new URLSearchParams;r?.status&&i.set("status",r.status);let n=i.toString();return((await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities${n?`?${n}`:""}`)).activities??[]).map(of)}async completeActivity(e,r,i){let n=i?.allowUnpublished?"?allowUnpublished=true":"";await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}${n}`,{method:"DELETE"})}async setMyStatus(e,r,i){let n=await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}/my-status`,{method:"PUT",body:JSON.stringify(i)});return of(n.activity)}async setStakeholder(e,r,i,n){let o=await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}/stakeholders/${encodeURIComponent(i)}`,{method:"PUT",body:JSON.stringify(n)});return of(o.activity)}async attachToActivity(e,r,i){return(await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}/attachments`,{method:"POST",body:JSON.stringify(i)}))?.attachments??[]}async requestAgentToken(e){let r=await this.getToken(),i=await fetch(`${this.authUrl}/api/token/agent`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!i.ok){let n=await i.text();throw new Error(`Agent token request failed (${i.status}): ${n}`)}return await i.json()}async requestBrowserSession(e,r){let i=await fetch(`${this.authUrl}/api/auth/agent-session`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){let n=await i.text();throw new Error(`Browser session request failed (${i.status}): ${n}`)}return await i.json()}async updateAgentProfile(e,r){let i=await this.getToken(),n=await fetch(`${this.authUrl}/api/identity/agent-profile/${encodeURIComponent(e)}`,{method:"PATCH",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok){let o=await n.text();throw new Error(`Agent profile update failed (${n.status}): ${o}`)}}async createPlaceContent(e,r,i,n){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content`,{method:"POST",body:JSON.stringify({...r?{contextType:r}:{},...n?.contextSchemaId?{contextSchemaId:n.contextSchemaId}:{},...n?.relationships?{relationships:n.relationships}:{},...n?.derivedFrom?{derivedFrom:n.derivedFrom}:{},...n?.mintDecisionDiscussion?{mintDecisionDiscussion:!0}:{},...n?.sessionActivityId?{sessionActivityId:n.sessionActivityId}:{},data:i})})}async listMyAsks(e){let r=new URLSearchParams;return e.placeId&&r.set("placeId",e.placeId),e.status&&r.set("status",e.status),e.limit&&r.set("limit",String(e.limit)),this.fetchRaw(`${this.apiUrl}/me/asks?${r.toString()}`)}async getPlaceContent(e,r){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content/${encodeURIComponent(r)}`)}async updatePlaceContent(e,r,i,n){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify({data:i,...n?.relationships?{relationships:n.relationships}:{}})})}async claimWork(e,r,i){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content/${encodeURIComponent(r)}/claim`,{method:"POST",body:JSON.stringify({from:i?.from??"open",to:i?.to??"active",...i?.extraData?{extraData:i.extraData}:{}})})}async listPlaceContent(e,r){let i=new URLSearchParams;r?.contextSchemaId&&i.set("contextSchemaId",r.contextSchemaId),r?.extendsSchemaId&&i.set("extendsSchemaId",r.extendsSchemaId),r?.contextType&&i.set("contextType",r.contextType),r?.limit&&i.set("limit",String(r.limit)),r?.before&&i.set("before",r.before);let n=i.toString();return this.fetchPlace(`/places/${encodeURIComponent(e)}/content${n?`?${n}`:""}`)}async listPlaceRules(e){return this.fetchPlace(`/places/${encodeURIComponent(e)}/rules`)}async resolvePlaceRules(e,r){let i=new URLSearchParams;r.audienceIds?.length&&i.set("audience",r.audienceIds.join(",")),r.builtIns?.length&&i.set("builtIns",r.builtIns.join(",")),r.descriptor&&i.set("descriptor",r.descriptor),r.repo&&i.set("repo",r.repo),r.path&&i.set("path",r.path),r.mode&&i.set("mode",r.mode);let n=i.toString();return this.fetchPlace(`/places/${encodeURIComponent(e)}/rules/resolve${n?`?${n}`:""}`)}async getChangedContent(e,r){let i=new URLSearchParams({since:r});return((await this.fetchPlace(`/places/${encodeURIComponent(e)}/content/index?${i.toString()}`)).items??[]).map(o=>({instanceId:o.id,updatedAt:o.updatedAt??null,contextType:o.contextType}))}async*streamWork(e,r){let n=`${this.apiUrl.replace("api.","stream.")}/places/${encodeURIComponent(e)}/work/stream`;yield*this.streamSSE(n,r)}async*streamSSE(e,r){let i=await this.getToken(),n=await fetch(e,{headers:{Authorization:`Bearer ${i}`,Accept:"text/event-stream","Cache-Control":"no-cache"},signal:r?.signal});if(!n.ok){let u=await n.text();throw new Error(`SSE stream failed (${n.status}): ${u}`)}if(!n.body)throw new Error("SSE response has no body");let o=n.body.getReader(),s=new TextDecoder,a="",c="",l=[];try{for(;;){let{done:u,value:d}=await o.read();if(u)break;a+=s.decode(d,{stream:!0});let p=a.split(`
|
|
104
|
+
`&&i++}}return[e,r]}var Qp=class extends TransformStream{constructor({onError:e,onRetry:r,onComment:i}={}){let n;super({start(o){n=mP({onEvent:s=>{o.enqueue(s)},onError(s){e==="terminate"?o.error(s):typeof e=="function"&&e(s)},onRetry:r,onComment:i})},transform(o){n.feed(o)}})}};var wL={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Pn=class extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},ef=class{constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=QT(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??wL}async _authThenStart(){if(!this._authProvider)throw new Hr("No auth provider");let e;try{e=await vc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new Hr;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let i=await this._authProvider.tokens();i&&(e.Authorization=`Bearer ${i.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=Yp(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let i=await this._commonHeaders();i.set("Accept","text/event-stream"),r&&i.set("last-event-id",r);let n=await(this._fetch??fetch)(this._url,{method:"GET",headers:i,signal:this._abortController?.signal});if(!n.ok){if(await n.body?.cancel(),n.status===401&&this._authProvider)return await this._authThenStart();if(n.status===405)return;throw new Pn(n.status,`Failed to open SSE stream: ${n.statusText}`)}this._handleSseStream(n.body,e,!0)}catch(i){throw this.onerror?.(i),i}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,i=this._reconnectionOptions.reconnectionDelayGrowFactor,n=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(i,e),n)}_scheduleReconnection(e,r=0){let i=this._reconnectionOptions.maxRetries;if(r>=i){this.onerror?.(new Error(`Maximum reconnection attempts (${i}) exceeded.`));return}let n=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,r+1)})},n)}_handleSseStream(e,r,i){if(!e)return;let{onresumptiontoken:n,replayMessageId:o}=r,s,a=!1,c=!1;(async()=>{try{let u=e.pipeThrough(new TextDecoderStream).pipeThrough(new Qp({onRetry:f=>{this._serverRetryMs=f}})).getReader();for(;;){let{value:f,done:m}=await u.read();if(m)break;if(f.id&&(s=f.id,a=!0,n?.(f.id)),!!f.data&&(!f.event||f.event==="message"))try{let h=So.parse(JSON.parse(f.data));Kn(h)&&(c=!0,o!==void 0&&(h.id=o)),this.onmessage?.(h)}catch(h){this.onerror?.(h)}}(i||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:n,replayMessageId:o},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(i||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:n,replayMessageId:o},0)}catch(f){this.onerror?.(new Error(`Failed to reconnect: ${f instanceof Error?f.message:String(f)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Hr("No auth provider");if(await vc(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Hr("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:i,onresumptiontoken:n}=r||{};if(i){this._startOrAuthSse({resumptionToken:i,replayMessageId:_a(e)?e.id:void 0}).catch(p=>this.onerror?.(p));return}let o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let p=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Pn(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:m}=v_(a);if(this._resourceMetadataUrl=f,this._scope=m,await vc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Hr;return this._hasCompletedAuthFlow=!0,this.send(e)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:m,error:h}=v_(a);if(h==="insufficient_scope"){let y=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===y)throw new Pn(403,"Server returned 403 after trying upscoping");if(m&&(this._scope=m),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=y??void 0,await vc(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Hr;return this.send(e)}}throw new Pn(a.status,`Error POSTing to endpoint: ${p}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),kS(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(p=>this.onerror?.(p));return}let u=(Array.isArray(e)?e:[e]).filter(p=>"method"in p&&"id"in p&&p.id!==void 0).length>0,d=a.headers.get("content-type");if(u)if(d?.includes("text/event-stream"))this._handleSseStream(a.body,{onresumptiontoken:n},!1);else if(d?.includes("application/json")){let p=await a.json(),f=Array.isArray(p)?p.map(m=>So.parse(m)):[So.parse(p)];for(let m of f)this.onmessage?.(m)}else throw await a.body?.cancel(),new Pn(-1,`Unexpected content type: ${d}`);else await a.body?.cancel()}catch(i){throw this.onerror?.(i),i}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,r);if(await i.body?.cancel(),!i.ok&&i.status!==405)throw new Pn(i.status,`Failed to terminate session: ${i.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var tf=class{options;client=null;connecting=null;constructor(e){this.options=e}async connect(){await this.ensureClient()}async listTools(){return(await this.ensureClient()).listTools()}async callTool(e,r={}){return await(await this.ensureClient()).callTool({name:e,arguments:r})}async close(){let e=this.client;this.client=null,this.connecting=null,e&&await e.close()}async ensureClient(){return this.client?this.client:this.connecting?this.connecting:(this.connecting=this.doConnect().finally(()=>{this.connecting=null}),this.connecting)}async doConnect(){let{url:e,getToken:r,clientInfo:i,onToolsChanged:n,fetchImpl:o}=this.options,s=o??fetch,a=async(u,d)=>{let p=await r(),f=new Headers(d?.headers);return f.set("Authorization",`Bearer ${p}`),s(u,{...d,headers:f})},c=new ef(new URL(e),{fetch:a}),l=new Kp(i??{name:"gigabuddy-door-client",version:"0.0.1"});return n&&l.setNotificationHandler(Ta,async()=>n()),c.onclose=()=>{this.client===l&&(this.client=null)},await l.connect(c),this.client=l,l}};async function bc(t){let{exec:e}=await import("node:child_process"),{promisify:r}=await import("node:util"),i=r(e),n=process.platform,o=n==="darwin"?`open "${t}"`:n==="win32"?`start "" "${t}"`:`xdg-open "${t}"`;await i(o)}function hP(t){return new Promise(e=>setTimeout(e,t))}function $L(t){try{let e=t.split(".")[1];if(!e)return;let r=JSON.parse(Buffer.from(e,"base64url").toString("utf-8"));return typeof r.email=="string"?r.email:void 0}catch{return}}async function gP(t){let e=t.fetchImpl??fetch,r={clientId:t.clientId??"gigabuddy-cli"};t.productId!==void 0&&(r.productId=t.productId),t.scopes!==void 0&&(r.scopes=t.scopes);let i=await e(`${t.authUrl}/api/auth/device/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw new Error(`Failed to start device flow: ${await i.text()}`);let{deviceCode:n,userCode:o,verificationUrl:s,expiresIn:a,interval:c}=await i.json();return{deviceCode:n,userCode:o,verificationUrl:s,expiresIn:a,interval:c}}async function yP(t,e,r={}){let i=r.fetchImpl??fetch,n=Date.now()+e.expiresIn*1e3,o=(e.interval||5)*1e3;for(;Date.now()<n;){await hP(o);let s=await i(`${t}/api/auth/device/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e.deviceCode})});if(s.status===429){await hP(o);continue}if(!s.ok)continue;let a=await s.json();if(a.status==="complete"&&a.platformToken&&a.refreshToken&&a.userId)return{refreshToken:a.refreshToken,platformToken:a.platformToken,userId:a.userId,userEmail:a.userEmail??$L(a.platformToken)};if(a.status==="expired")throw new Error("Device code expired. Please try again.");r.onPending?.()}throw new Error("Authentication timed out. Please try again.")}var rf=class{refreshToken;authUrl;platformToken=null;tokenExpiresAt=0;refreshPromise=null;onRefreshTokenRotated;reloginHint;fetchImpl;constructor(e){this.refreshToken=e.refreshToken,this.authUrl=e.authUrl,this.onRefreshTokenRotated=e.onRefreshTokenRotated,this.reloginHint=e.reloginHint??"Sign in again with 'gigabuddy login'.",this.fetchImpl=e.fetchImpl??fetch}async getToken(){return this.platformToken&&Date.now()<this.tokenExpiresAt-6e4?this.platformToken:this.refresh()}invalidate(){this.platformToken=null,this.tokenExpiresAt=0}async refresh(){return this.refreshPromise?this.refreshPromise:(this.refreshPromise=this.doRefresh().finally(()=>{this.refreshPromise=null}),this.refreshPromise)}async doRefresh(){let e=await this.fetchImpl(`${this.authUrl}/api/token/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:this.refreshToken})});if(!e.ok){let i=await e.text();throw new Error(`Token refresh failed (${e.status}): ${i}. ${this.reloginHint}`)}let r=await e.json();return this.platformToken=r.token,this.tokenExpiresAt=Date.now()+r.expiresIn*1e3,r.refreshToken&&r.refreshToken!==this.refreshToken&&(this.refreshToken=r.refreshToken,this.onRefreshTokenRotated?.(r.refreshToken)),r.token}};var vP={mycelium:{scratchDirName:".mycelium",scratchEnvVar:"MYCELIUM_SCRATCH_DIR",harnessSessionEnvVar:"MYCELIUM_HARNESS_SESSION_ID",serverName:"mycelium",chatSenderId:"mycelium-agent",hostDirPrefix:"mycelium-host-",bridgeSocketPrefix:"mycelium-bridge-",treeIdFileName:"mycelium-tree-id",webAppKey:"mycelium"},gigabuddy:{scratchDirName:".gigabuddy",scratchEnvVar:"GIGABUDDY_SCRATCH_DIR",harnessSessionEnvVar:"GIGABUDDY_HARNESS_SESSION_ID",serverName:"gigabuddy",chatSenderId:"gigabuddy-agent",hostDirPrefix:"gigabuddy-host-",bridgeSocketPrefix:"gigabuddy-bridge-",treeIdFileName:"gigabuddy-tree-id",webAppKey:"gigabuddy"}},nf="mycelium";function bP(t){nf=t}function of(){return nf}function Be(){return vP[nf]}function _P(){return vP[nf==="mycelium"?"gigabuddy":"mycelium"]}function wP(t){return{fileId:t.id,url:t.publicUrl??t.signedUrl??null,publicUrl:t.publicUrl??null,expiresAt:t.signedUrlExpiresAt??null,name:t.originalName,contentType:t.contentType,size:t.size}}var kL=6e4;function $P(t){let e=new URLSearchParams;return e.set("limit",String(t?.limit??50)),t?.after&&e.set("after",t.after),t?.before&&e.set("before",t.before),t?.senderId&&e.set("senderId",t.senderId),t?.senderType&&e.set("senderType",t.senderType),t?.sponsorId&&e.set("sponsorId",t.sponsorId),t?.activityId&&e.set("activityId",t.activityId),t?.activityKind&&e.set("activityKind",t.activityKind),t?.since&&e.set("since",t.since),t?.until&&e.set("until",t.until),e}function xL(t){if(t!=null){if(typeof t=="string"){let e=Date.parse(t);return Number.isNaN(e)?void 0:new Date(e).toISOString()}if(typeof t=="number"){let e=t<1e12?t*1e3:t;return new Date(e).toISOString()}if(typeof t=="object"){let e=t,r=e._seconds??e.seconds;if(typeof r=="number"){let i=e._nanoseconds??e.nanoseconds,n=r*1e3+(typeof i=="number"?Math.floor(i/1e6):0);return new Date(n).toISOString()}}}}function sf(t){let e=t??{};return{...e,id:e.id??"",content:e.content??"",createdAt:xL(e.createdAt)??""}}var kP=200;function SL(t){return t.length<=kP?t:`${t.slice(0,kP-1).trimEnd()}\u2026`}function _c(t){let e=t??{},r=e.data??{},i=e.full??{},n=e.metadata??{},o=s=>e[s]??i[s]??n[s]??r[s];return{...r,...i,...e,id:e.id??"",label:o("label")??"",status:o("status")??"",visibility:o("visibility")??"",kind:o("kind"),conversationId:o("conversationId"),participants:o("participants"),attachments:o("attachments"),statusText:o("statusText")}}var af=class{getToken;apiUrl;authUrl;onTokenExpired=null;fileUrlCache=new Map;constructor(e){this.getToken=e.getToken,this.apiUrl=e.apiUrl,this.authUrl=e.authUrl}setTokenProvider(e){this.getToken=e}currentToken(){return this.getToken()}async withTokenProvider(e,r){let i=this.getToken;this.getToken=e;try{return await r()}finally{this.getToken=i}}setOnTokenExpired(e){this.onTokenExpired=e}async fetchRaw(e,r){let i=await this.getToken(),n=await fetch(e,{...r,headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json",...r?.headers}});if(n.status===401&&this.onTokenExpired){await this.onTokenExpired();let s=await this.getToken(),a=await fetch(e,{...r,headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json",...r?.headers}});if(!a.ok){let l=await a.text();throw new Error(`API error (${a.status}): ${l}`)}return a.headers.get("content-type")?.includes("application/json")?await a.json():void 0}if(!n.ok){let s=await n.text();throw new Error(`API error (${n.status}): ${s}`)}if(n.headers.get("content-type")?.includes("application/json"))return await n.json()}async fetchPlace(e,r){return this.fetchRaw(`${this.apiUrl}${e}`,r)}async listTenancies(){return((await this.fetchRaw(`${this.apiUrl}/api/installations/mine`)).installations??[]).map(r=>({id:r.installationId,name:r.installation?.name??r.org?.name??r.installationId,productId:r.productId}))}async listPlaces(e){return(await this.fetchRaw(`${this.apiUrl}/ext/places/boot?tenancyId=${encodeURIComponent(e)}`)).places}async getPlace(e){let i=(await this.fetchPlace(`/places/${encodeURIComponent(e)}`)).place,n=i.data??i;return{id:i.id??e,name:n.name??i.name??"Unknown",description:n.description??void 0,conversationId:n.conversationId??void 0,visibility:n.visibility??void 0,memberCount:i.memberCount??n.memberCount??void 0,tenancyId:i.tenancyId??i.installationId??i.orgId??void 0,orgId:i.orgId??void 0}}async sendMessage(e,r){return this.fetchPlace(`/places/${encodeURIComponent(e)}/messages`,{method:"POST",headers:{"X-Chat-User-Id":`${of()}-agent`,"X-Chat-Display-Name":r.senderName??"Gigabuddy Agent"},body:JSON.stringify(r)})}async getMessages(e,r){let i=$P(r),n=await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages?${i.toString()}`);return{...n,messages:(n.messages??[]).map(sf)}}async markPlaceRead(e,r){await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages/read`,{method:"POST",body:JSON.stringify({messageId:r})})}async markThreadRead(e,r,i){await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/read`,{method:"POST",body:JSON.stringify({messageId:i})})}async getReplies(e,r,i){let n=$P(i),o=await this.fetchPlace(`/places/${encodeURIComponent(e)}/messages/${encodeURIComponent(r)}/replies?${n.toString()}`);return{...o,messages:(o.messages??[]).map(sf)}}async sendContentCard(e,r,i,n){let o=[];n?.text&&o.push({type:"text",text:n.text,format:"markdown"});let s={type:"content_card",instanceId:r,contextType:i};n?.contextSchemaId&&(s.contextSchemaId=n.contextSchemaId),n?.view&&(s.view=n.view),n?.snapshot&&(s.snapshot=n.snapshot),o.push(s);let a=o.length===1&&!n?.text?s:{type:"composite",blocks:o};return this.sendMessage(e,{content:a,senderName:n?.senderName,parentMessageId:n?.parentMessageId})}async uploadFile(e,r,i){let n=new FormData,o=new Uint8Array(r.data).buffer,s=r.contentType?new Blob([o],{type:r.contentType}):new Blob([o]);n.append("file",s,r.filename),n.append("placeIds",JSON.stringify([e])),n.append("category",i?.category??"chat-attachment"),i?.visibility&&n.append("visibility",i.visibility);let a=async()=>{let u=await this.getToken();return fetch(`${this.apiUrl}/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${u}`},body:n})},c=await a();if(c.status===401&&this.onTokenExpired&&(await this.onTokenExpired(),c=await a()),!c.ok){let u=await c.text();throw new Error(`Upload error (${c.status}): ${u}`)}let l=await c.json();return wP(l.file)}async getFileUrl(e){let r=this.fileUrlCache.get(e);if(r&&(r.publicUrl||r.expiresAt&&new Date(r.expiresAt).getTime()-Date.now()>kL))return r;let i=await this.fetchRaw(`${this.apiUrl}/files/${encodeURIComponent(e)}?download=true`),n=wP(i.file);return this.fileUrlCache.set(e,n),n}async downloadFile(e){let r=async()=>{let n=await this.getToken();return fetch(`${this.apiUrl}/files/${encodeURIComponent(e)}/download`,{headers:{Authorization:`Bearer ${n}`}})},i=await r();if(i.status===401&&this.onTokenExpired&&(await this.onTokenExpired(),i=await r()),!i.ok){let n=await i.text();throw new Error(`Download error (${i.status}): ${n}`)}return{data:new Uint8Array(await i.arrayBuffer()),contentType:i.headers.get("content-type")??"application/octet-stream"}}async createActivity(e,r){let i=await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities`,{method:"POST",body:JSON.stringify({label:SL(r.label),visibility:r.visibility??"open",...r.kind?{kind:r.kind}:{},...r.subject?{subject:r.subject}:{},...r.session?{session:r.session}:{},...r.sessionActivityId?{sessionActivityId:r.sessionActivityId}:{}})});return _c(i.activity)}async getActivity(e,r){let i=await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}`);return _c(i.activity)}async listActivities(e,r){let i=new URLSearchParams;r?.status&&i.set("status",r.status);let n=i.toString();return((await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities${n?`?${n}`:""}`)).activities??[]).map(_c)}async completeActivity(e,r,i){let n=i?.allowUnpublished?"?allowUnpublished=true":"";await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}${n}`,{method:"DELETE"})}async setMyStatus(e,r,i){let n=await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}/my-status`,{method:"PUT",body:JSON.stringify(i)});return _c(n.activity)}async setStakeholder(e,r,i,n){let o=await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}/stakeholders/${encodeURIComponent(i)}`,{method:"PUT",body:JSON.stringify(n)});return _c(o.activity)}async attachToActivity(e,r,i){return(await this.fetchPlace(`/places/${encodeURIComponent(e)}/activities/${encodeURIComponent(r)}/attachments`,{method:"POST",body:JSON.stringify(i)}))?.attachments??[]}async requestAgentToken(e){let r=await this.getToken(),i=await fetch(`${this.authUrl}/api/token/agent`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!i.ok){let n=await i.text();throw new Error(`Agent token request failed (${i.status}): ${n}`)}return await i.json()}async requestBrowserSession(e,r){let i=await fetch(`${this.authUrl}/api/auth/agent-session`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){let n=await i.text();throw new Error(`Browser session request failed (${i.status}): ${n}`)}return await i.json()}async updateAgentProfile(e,r){let i=await this.getToken(),n=await fetch(`${this.authUrl}/api/identity/agent-profile/${encodeURIComponent(e)}`,{method:"PATCH",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok){let o=await n.text();throw new Error(`Agent profile update failed (${n.status}): ${o}`)}}async createPlaceContent(e,r,i,n){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content`,{method:"POST",body:JSON.stringify({...r?{contextType:r}:{},...n?.contextSchemaId?{contextSchemaId:n.contextSchemaId}:{},...n?.relationships?{relationships:n.relationships}:{},...n?.derivedFrom?{derivedFrom:n.derivedFrom}:{},...n?.mintDecisionDiscussion?{mintDecisionDiscussion:!0}:{},...n?.sessionActivityId?{sessionActivityId:n.sessionActivityId}:{},data:i})})}async listMyAsks(e){let r=new URLSearchParams;return e.placeId&&r.set("placeId",e.placeId),e.status&&r.set("status",e.status),e.limit&&r.set("limit",String(e.limit)),this.fetchRaw(`${this.apiUrl}/me/asks?${r.toString()}`)}async getPlaceContent(e,r){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content/${encodeURIComponent(r)}`)}async updatePlaceContent(e,r,i,n){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content/${encodeURIComponent(r)}`,{method:"PATCH",body:JSON.stringify({data:i,...n?.relationships?{relationships:n.relationships}:{}})})}async claimWork(e,r,i){return this.fetchPlace(`/places/${encodeURIComponent(e)}/content/${encodeURIComponent(r)}/claim`,{method:"POST",body:JSON.stringify({from:i?.from??"open",to:i?.to??"active",...i?.extraData?{extraData:i.extraData}:{}})})}async listPlaceContent(e,r){let i=new URLSearchParams;r?.contextSchemaId&&i.set("contextSchemaId",r.contextSchemaId),r?.extendsSchemaId&&i.set("extendsSchemaId",r.extendsSchemaId),r?.contextType&&i.set("contextType",r.contextType),r?.limit&&i.set("limit",String(r.limit)),r?.before&&i.set("before",r.before);let n=i.toString();return this.fetchPlace(`/places/${encodeURIComponent(e)}/content${n?`?${n}`:""}`)}async listPlaceRules(e){return this.fetchPlace(`/places/${encodeURIComponent(e)}/rules`)}async resolvePlaceRules(e,r){let i=new URLSearchParams;r.audienceIds?.length&&i.set("audience",r.audienceIds.join(",")),r.builtIns?.length&&i.set("builtIns",r.builtIns.join(",")),r.descriptor&&i.set("descriptor",r.descriptor),r.repo&&i.set("repo",r.repo),r.path&&i.set("path",r.path),r.mode&&i.set("mode",r.mode);let n=i.toString();return this.fetchPlace(`/places/${encodeURIComponent(e)}/rules/resolve${n?`?${n}`:""}`)}async getChangedContent(e,r){let i=new URLSearchParams({since:r});return((await this.fetchPlace(`/places/${encodeURIComponent(e)}/content/index?${i.toString()}`)).items??[]).map(o=>({instanceId:o.id,updatedAt:o.updatedAt??null,contextType:o.contextType}))}async*streamWork(e,r){let n=`${this.apiUrl.replace("api.","stream.")}/places/${encodeURIComponent(e)}/work/stream`;yield*this.streamSSE(n,r)}async*streamSSE(e,r){let i=await this.getToken(),n=await fetch(e,{headers:{Authorization:`Bearer ${i}`,Accept:"text/event-stream","Cache-Control":"no-cache"},signal:r?.signal});if(!n.ok){let u=await n.text();throw new Error(`SSE stream failed (${n.status}): ${u}`)}if(!n.body)throw new Error("SSE response has no body");let o=n.body.getReader(),s=new TextDecoder,a="",c="",l=[];try{for(;;){let{done:u,value:d}=await o.read();if(u)break;a+=s.decode(d,{stream:!0});let p=a.split(`
|
|
105
105
|
`);a=p.pop();for(let f of p)if(!f.startsWith(":")){if(f.startsWith("event:"))c=f.slice(6).trim();else if(f.startsWith("data:"))l.push(f.slice(5).trim());else if(f===""){if(c&&l.length>0){let m=l.join(`
|
|
106
|
-
`);try{yield{event:c,data:JSON.parse(m)}}catch{yield{event:c,data:m}}}c="",l=[]}}}}finally{o.releaseLock()}}buildAwarenessWsUrl(e){let r=this.apiUrl.replace("api.","stream.").replace(/^http/,"ws"),i=new URLSearchParams({token:e});return`${r}/ws/awareness-v2?${i.toString()}`}};import{readdir as gw,readFile as $C,stat as eF}from"node:fs/promises";import{join as Nc}from"node:path";var cf=class{constructor(e){this._server=e}requestStream(e,r,i){return this._server.requestStream(e,r,i)}createMessageStream(e,r){let i=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],l=c.some(u=>u.type==="tool_use");if(s){if(o.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(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(o.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 this.requestStream({method:"sampling/createMessage",params:e},Yn,r)}elicitInputStream(e,r){let i=this._server.getClientCapabilities(),n=e.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"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},vn,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,i){return this._server.getTaskResult({taskId:e},r,i)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};var lf=class extends Po{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Pa.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 Wo,this.setRequestHandler(Vy,i=>this._oninitialize(i)),this.setNotificationHandler(qd,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(sv,async(i,n)=>{let o=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,a=Pa.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new cf(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=lp(this._capabilities,e)}setRequestHandler(e,r){let n=vr(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let o;if(Tt(n)){let a=n;o=a._zod?.def?.value??a.value}else{let a=n;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,l)=>{let u=yt(To,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new O(U.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let m=yt(Dr,p);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new O(U.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let f=yt(yn,p);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new O(U.InvalidParams,`Invalid tools/call result: ${m}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);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 ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);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 ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);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 ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Bp(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Wp(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Ud.includes(r)?r:hn,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"},jr)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(l=>l.type==="tool_use");if(o){if(n.some(l=>l.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 l=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(n.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},za,r):this.request({method:"sampling/createMessage",params:e},Yn,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},vn,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},vn,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!a.valid)throw new O(U.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof O?s:new O(U.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,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:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},uv,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}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 xP=Symbol.for("mcp.completable");function w_(t){return!!t&&typeof t=="object"&&xP in t}function SP(t){return t[xP]?.complete}var kP;(function(t){t.Completable="McpCompletable"})(kP||(kP={}));var xL=/^[A-Za-z0-9._-]{1,128}$/;function SL(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!xL.test(t)){let r=t.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return e.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:e}}return{isValid:!0,warnings:e}}function IL(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)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 $_(t){let e=SL(t);return IL(t,e.warnings),e.isValid}var uf=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,i){let n={taskSupport:"required",...r.execution};if(n.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,n,r._meta,i)}};var df=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new lf(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new uf(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(zn(np)),this.server.assertCanSetRequestHandler(zn(To)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(np,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let i={name:e,title:r.title,description:r.description,inputSchema:(()=>{let n=fo(r.inputSchema);return n?gv(n,{strictUnions:!0,pipeStrategy:"input"}):TL})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let n=fo(r.outputSchema);n&&(i.outputSchema=gv(n,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(To,async(e,r)=>{try{let i=this._registeredTools[e.params.name];if(!i)throw new O(U.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new O(U.InvalidParams,`Tool ${e.params.name} disabled`);let n=!!e.params.task,o=i.execution?.taskSupport,s="createTask"in i.handler;if((o==="required"||o==="optional")&&!s)throw new O(U.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!n)throw new O(U.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!n&&s)return await this.handleAutomaticTaskPolling(i,e,r);let a=await this.validateToolInput(i,e.params.arguments,e.params.name),c=await this.executeToolHandler(i,a,r);return n||await this.validateToolOutput(i,c,e.params.name),c}catch(i){if(i instanceof O&&i.code===U.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,i){if(!e.inputSchema)return;let o=fo(e.inputSchema)??e.inputSchema,s=await id(o,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=od(a);throw new O(U.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${c}`)}return s.data}async validateToolOutput(e,r,i){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new O(U.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let n=fo(e.outputSchema),o=await id(n,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=od(s);throw new O(U.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${a}`)}}async executeToolHandler(e,r,i){let n=e.handler;if("createTask"in n){if(!i.taskStore)throw new Error("No task store provided.");let s={...i,taskStore:i.taskStore};if(e.inputSchema){let a=n;return await Promise.resolve(a.createTask(r,s))}else{let a=n;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=n;return await Promise.resolve(s(r,i))}else{let s=n;return await Promise.resolve(s(i))}}async handleAutomaticTaskPolling(e,r,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let n=await this.validateToolInput(e,r.params.arguments,r.params.name),o=e.handler,s={...i,taskStore:i.taskStore},a=n?await Promise.resolve(o.createTask(n,s)):await Promise.resolve(o.createTask(s)),c=a.task.taskId,l=a.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(p=>setTimeout(p,u));let d=await i.taskStore.getTask(c);if(!d)throw new O(U.InternalError,`Task ${c} not found during polling`);l=d}return await i.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(zn(ip)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(ip,async e=>{switch(e.params.ref.type){case"ref/prompt":return RS(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return AS(e),this.handleResourceCompletion(e,e.params.ref);default:throw new O(U.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let i=this._registeredPrompts[r.name];if(!i)throw new O(U.InvalidParams,`Prompt ${r.name} not found`);if(!i.enabled)throw new O(U.InvalidParams,`Prompt ${r.name} disabled`);if(!i.argsSchema)return _c;let o=vr(i.argsSchema)?.[e.params.argument.name];if(!w_(o))return _c;let s=SP(o);if(!s)return _c;let a=await s(e.params.argument.value,e.params.context);return TP(a)}async handleResourceCompletion(e,r){let i=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!i){if(this._registeredResources[r.uri])return _c;throw new O(U.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let n=i.resourceTemplate.completeCallback(e.params.argument.name);if(!n)return _c;let o=await n(e.params.argument.value,e.params.context);return TP(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(zn(Xd)),this.server.assertCanSetRequestHandler(zn(Qd)),this.server.assertCanSetRequestHandler(zn(ep)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Xd,async(e,r)=>{let i=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),n=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(r);for(let a of s.resources)n.push({...o.metadata,...a})}return{resources:[...i,...n]}}),this.server.setRequestHandler(Qd,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,i])=>({name:r,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(ep,async(e,r)=>{let i=new URL(e.params.uri),n=this._registeredResources[i.toString()];if(n){if(!n.enabled)throw new O(U.InvalidParams,`Resource ${i} disabled`);return n.readCallback(i,r)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(i.toString());if(s)return o.readCallback(i,s,r)}throw new O(U.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(zn(tp)),this.server.assertCanSetRequestHandler(zn(rp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(tp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?zL(r.argsSchema):void 0}))})),this.server.setRequestHandler(rp,async(e,r)=>{let i=this._registeredPrompts[e.params.name];if(!i)throw new O(U.InvalidParams,`Prompt ${e.params.name} not found`);if(!i.enabled)throw new O(U.InvalidParams,`Prompt ${e.params.name} disabled`);if(i.argsSchema){let n=fo(i.argsSchema),o=await id(n,e.params.arguments);if(!o.success){let c="error"in o?o.error:"Unknown error",l=od(c);throw new O(U.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,a=i.callback;return await Promise.resolve(a(s,r))}else{let n=i.callback;return await Promise.resolve(n(r))}}),this._promptHandlersInitialized=!0)}resource(e,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 s=this._createRegisteredResource(e,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,i,n){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(e,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,r,i,n,o){let s={name:e,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==i&&(delete this._registeredResources[i],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=s,s}_createRegisteredResourceTemplate(e,r,i,n,o){let s={resourceTemplate:i,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=i.uriTemplate.variableNames;return Array.isArray(a)&&a.some(l=>!!i.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,i,n,o){let s={title:r,description:i,argsSchema:n===void 0?void 0:Gn(n),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=Gn(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,n&&Object.values(n).some(c=>{let l=c instanceof ko?c._def?.innerType:c;return w_(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,i,n,o,s,a,c,l){$_(e);let u={title:r,description:i,inputSchema:IP(n),outputSchema:IP(o),annotations:s,execution:a,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&$_(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=u)),typeof d.title<"u"&&(u.title=d.title),typeof d.description<"u"&&(u.description=d.description),typeof d.paramsSchema<"u"&&(u.inputSchema=Gn(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=Gn(d.outputSchema)),typeof d.callback<"u"&&(u.handler=d.callback),typeof d.annotations<"u"&&(u.annotations=d.annotations),typeof d._meta<"u"&&(u._meta=d._meta),typeof d.enabled<"u"&&(u.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let i,n,o,s;if(typeof r[0]=="string"&&(i=r.shift()),r.length>1){let c=r[0];k_(c)?(n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!k_(r[0])&&(s=r.shift())):typeof c=="object"&&c!==null&&(s=r.shift())}let a=r[0];return this._createRegisteredTool(e,void 0,i,n,o,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,i){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:n,description:o,inputSchema:s,outputSchema:a,annotations:c,_meta:l}=r;return this._createRegisteredTool(e,n,o,s,a,c,{taskSupport:"forbidden"},l,i)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let i;typeof r[0]=="string"&&(i=r.shift());let n;r.length>1&&(n=r.shift());let o=r[0],s=this._createRegisteredPrompt(e,void 0,i,n,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,i){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:n,description:o,argsSchema:s}=r,a=this._createRegisteredPrompt(e,n,o,s,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var TL={type:"object",properties:{}};function PP(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function PL(t){return"_def"in t||"_zod"in t||PP(t)}function k_(t){return typeof t!="object"||t===null||PL(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(PP)}function IP(t){if(t)return k_(t)?Gn(t):t}function zL(t){let e=vr(t);return e?Object.entries(e).map(([r,i])=>{let n=rx(i),o=nx(i);return{name:r,description:n,required:!o}}):[]}function zn(t){let r=vr(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=sd(r);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function TP(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var _c={completion:{values:[],hasMore:!1}};import CP from"node:process";var pf=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
107
|
-
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),
|
|
108
|
-
`}var ff=class{constructor(e=CP.stdin,r=CP.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new pf,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 e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}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(e){return new Promise(r=>{let i=zP(e);this._stdout.write(i)?r():this._stdout.once("drain",r)})}};function pi(t,e){for(;e>127;)t.push(128|e&127),e>>>=7;t.push(e&127)}function fi(t,e){let r=0,i=0,n=e;for(;;){let o=t[n++];if(r|=(o&127)<<i,o<128)return{value:r>>>0,bytesRead:n-e};i+=7}}function mf(t,e,r){let i=r===null?"null":JSON.stringify(r),n=new TextEncoder().encode(i),o=[];pi(o,1);let s=[];pi(s,1),pi(s,t),pi(s,e),pi(s,n.length);for(let a=0;a<n.length;a++)s.push(n[a]);pi(o,s.length);for(let a=0;a<s.length;a++)o.push(s[a]);return new Uint8Array(o)}function hf(t){let e=0,r=fi(t,e);if(e+=r.bytesRead,r.value!==1)return[];let i=fi(t,e);e+=i.bytesRead;let n=e+i.value,o=fi(t,e);e+=o.bytesRead;let s=o.value,a=[];for(let c=0;c<s&&e<n;c++){let l=fi(t,e);e+=l.bytesRead;let u=fi(t,e);e+=u.bytesRead;let d=fi(t,e);e+=d.bytesRead;let p=t.slice(e,e+d.value);e+=d.value;try{let f=JSON.parse(new TextDecoder().decode(p));a.push({clientId:l.value,clock:u.value,state:f===null||typeof f=="object"&&Object.keys(f).length===0?null:f})}catch{}}return a}function gf(t,e){let r=new TextEncoder().encode(t),i=[];pi(i,r.length);let n=new Uint8Array(i.length+r.length+e.length);return n.set(i,0),n.set(r,i.length),n.set(e,i.length+r.length),n}function x_(t){let e=fi(t,0),r=t.slice(e.bytesRead,e.bytesRead+e.value),i=new TextDecoder().decode(r),n=t.slice(e.bytesRead+e.value);return{topic:i,awarenessBytes:n}}var RP=15,RL=1e3,AL=3e4,EL=6e4,OL=5e3,NL=3e4,ML=3,Bo=class{config;ws=null;topics=new Map;seq=0;pendingSubscribes=new Map;graceTimers=new Map;reconnectAttempt=0;reconnectTimer=null;connecting=!1;intentionalClose=!1;connectGeneration=0;_connected=!1;rawHandlers=new Map;rawReconnectHandlers=new Map;connectionListeners=new Set;placeEventListeners=new Set;_diag={binaryIn:0,binaryOut:0,topicMatch:0,topicMiss:0,peersDecoded:0,controlIn:0,selfSkip:0,nullState:0,kept:0,lastPeers:[],missedTopics:[]};constructor(e){this.config=e}get connected(){return this._connected}onConnectionChange(e){return this.connectionListeners.add(e),()=>this.connectionListeners.delete(e)}onPlaceEvent(e){return this.placeEventListeners.add(e),()=>this.placeEventListeners.delete(e)}setConnected(e){if(this._connected!==e){this._connected=e;for(let r of this.connectionListeners)r(e)}}async connect(){this.intentionalClose=!1,this.reconnectAttempt=0;let e=++this.connectGeneration,r=await this.config.getToken();if(e===this.connectGeneration)return this.doConnect(this.config.buildWsUrl(r),e)}doConnect(e,r){let i=r??this.connectGeneration;return new Promise((n,o)=>{if(i!==this.connectGeneration)return n();this.connecting=!0,this.ws=new WebSocket(e),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{if(this.connecting=!1,i!==this.connectGeneration)return this.ws?.close(),n();this.reconnectAttempt=0,this.setConnected(!0),this.flushSubscriptions(),n()},this.ws.onerror=()=>{this.connecting=!1,this.reconnectAttempt===0&&o(new Error("WebSocket error"))},this.ws.onclose=()=>{if(this.connecting=!1,this.setConnected(!1),this.intentionalClose||i!==this.connectGeneration){this.clearAllPeers();return}this.scheduleReconnect()},this.ws.onmessage=s=>{typeof s.data=="string"?(this._diag.controlIn++,this.handleControlMessage(s.data)):(this._diag.binaryIn++,this.handleBinaryMessage(new Uint8Array(s.data)))}})}disconnect(){this.intentionalClose=!0,this.connectGeneration++,this.setConnected(!1),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);for(let[,e]of this.graceTimers)clearTimeout(e);this.graceTimers.clear();for(let[,e]of this.topics)e.typingExpiryTimer&&clearTimeout(e.typingExpiryTimer);this.ws&&(this.ws.close(),this.ws=null),this.clearAllPeers(),this.topics.clear(),this.rawHandlers.clear(),this.rawReconnectHandlers.clear(),this.connectionListeners.clear()}async forceReconnect(){if(this.intentionalClose)return;let e=this.ws;this.ws=null,this.connectGeneration++,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.setConnected(!1);try{e?.close()}catch{}await this.connect()}scheduleReconnect(){if(this.intentionalClose)return;let e=this.reconnectAttempt>=RP;e&&this.reconnectAttempt===RP&&(console.error("[AwarenessManager] Max reconnect attempts reached, entering slow-poll mode (every 60s)"),this.clearAllPeers());let r=e?EL:Math.min(RL*Math.pow(2,this.reconnectAttempt),AL)*(1+Math.random()*.25);this.reconnectAttempt++;let i=this.connectGeneration;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,!(this.intentionalClose||i!==this.connectGeneration)&&(this.connecting||this._connected||this.config.getToken().then(n=>{if(i===this.connectGeneration)return this.doConnect(this.config.buildWsUrl(n),i)}).catch(n=>{e?console.error("[AwarenessManager] Slow-poll reconnect failed, will retry"):console.error("[AwarenessManager] Reconnect failed:",n),i===this.connectGeneration&&this.scheduleReconnect()}))},r)}async ensureConnected(){if(this._connected)return!0;if(this.intentionalClose||this.reconnectTimer||this.connecting)return!1;try{let e=await this.config.getToken();return this.intentionalClose?!1:(await this.doConnect(this.config.buildWsUrl(e)),this._connected)}catch(e){return console.error("[AwarenessManager] ensureConnected failed:",e),this.scheduleReconnect(),!1}}flushSubscriptions(){for(let[e,r]of this.topics){r.subscribed=!1;let i=++this.seq;this.sendControl({type:"subscribe",topic:e,seq:i}),this.pendingSubscribes.set(i,{topic:e,resolve:()=>{r.subscribed=!0,r.localState&&(r.clock++,this.sendTopicAwareness(e,r));let n=this.rawReconnectHandlers.get(e);n&&n()},reject:()=>{}})}}subscribe(e){let r=this.graceTimers.get(e);if(r&&(clearTimeout(r),this.graceTimers.delete(e),this.topics.get(e)?.subscribed))return Promise.resolve();let i=this.topics.get(e);return i?.subscribed||(i||this.topics.set(e,{clientId:this.config.clientId??Math.random()*1073741823>>>0,clock:0,localState:null,peers:new Map,subscribers:new Set,typingExpiryTimer:null,subscribed:!1}),!this._connected)?Promise.resolve():new Promise((n,o)=>{let s=++this.seq;this.sendControl({type:"subscribe",topic:e,seq:s}),this.pendingSubscribes.set(s,{topic:e,resolve:n,reject:o})})}unsubscribe(e){let r=this.topics.get(e);if(r&&!(r.subscribers.size>0)){if(this.graceTimers.size>=ML){let i=this.graceTimers.keys().next().value,n=this.graceTimers.get(i);n&&clearTimeout(n),this.graceTimers.delete(i),this.doUnsubscribe(i)}this.graceTimers.set(e,setTimeout(()=>{this.graceTimers.delete(e),this.doUnsubscribe(e)},NL))}}doUnsubscribe(e){let r=this.topics.get(e);if(r){if(r.typingExpiryTimer&&clearTimeout(r.typingExpiryTimer),r.subscribed&&this._connected){let i=++this.seq;this.sendControl({type:"unsubscribe",topic:e,seq:i})}this.topics.delete(e)}}setTopicState(e,r){let i=this.topics.get(e);i&&(i.localState=r,i.clock++,this.sendTopicAwareness(e,i))}updateTopicState(e,r){let i=this.topics.get(e);i&&this.setTopicState(e,{...i.localState,...r})}getTopicPeers(e){let r=this.topics.get(e);if(!r)return[];let i=[];for(let[n,{state:o,clock:s}]of r.peers)n!==r.clientId&&i.push({clientId:n,state:o,clock:s});return i}onTopicUpdate(e,r){let i=this.topics.get(e);return i?(i.subscribers.add(r),()=>{i.subscribers.delete(r)}):()=>{}}signalTyping(e,r=OL){let i=this.topics.get(e);i&&(i.typingExpiryTimer&&clearTimeout(i.typingExpiryTimer),i.localState?.typing||this.updateTopicState(e,{typing:!0}),i.typingExpiryTimer=setTimeout(()=>{i.typingExpiryTimer=null,i.localState?.typing&&this.updateTopicState(e,{typing:!1})},r))}stopTyping(e){let r=this.topics.get(e);r&&(r.typingExpiryTimer&&(clearTimeout(r.typingExpiryTimer),r.typingExpiryTimer=null),r.localState?.typing&&this.updateTopicState(e,{typing:!1}))}async subscribeRaw(e,r,i){this.rawHandlers.set(e,r),i&&this.rawReconnectHandlers.set(e,i),await this.subscribe(e)}sendRaw(e,r){!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(gf(e,r))}unsubscribeRaw(e){this.rawHandlers.delete(e),this.rawReconnectHandlers.delete(e),this.unsubscribe(e)}async refreshToken(){if(!this._connected||!this.ws)return;let e=await this.config.getToken(),r=++this.seq;this.sendControl({type:"token",token:e,seq:r})}handleControlMessage(e){let r;try{r=JSON.parse(e)}catch{return}let i=r.type,n=r.seq,o=r.topic;switch(i){case"subscribed":{if(n!=null){let s=this.pendingSubscribes.get(n);if(s){this.pendingSubscribes.delete(n);let a=this.topics.get(s.topic);if(a){a.subscribed=!0;let c=r.state;if(c){for(let l of c)l.clientId!==a.clientId&&a.peers.set(l.clientId,{state:l.state,clock:0});this.notifySubscribers(a)}}s.resolve()}}break}case"subscribe_error":{if(n!=null){let s=this.pendingSubscribes.get(n);s&&(this.pendingSubscribes.delete(n),s.reject(new Error(r.reason??"Subscribe failed")))}break}case"unsubscribed":{if(!o)break;if(n==null){let s=this.topics.get(o);s&&(s.subscribed=!1,s.peers.clear(),this.notifySubscribers(s),s.typingExpiryTimer&&clearTimeout(s.typingExpiryTimer),this.topics.delete(o))}break}case"token_ok":break;case"content_changed":case"activity_changed":case"message_created":case"garden_tended":case"ask_created":{if(this.placeEventListeners.size>0){let s=r;for(let a of this.placeEventListeners)try{a(s)}catch(c){console.error("[AwarenessManager] place event listener error:",c)}}break}case"error":console.error("[AwarenessManager] Server error:",r.reason);break}}handleBinaryMessage(e){let{topic:r,awarenessBytes:i}=x_(e),n=this.rawHandlers.get(r);if(n){try{n(i)}catch{}return}let o=this.topics.get(r);if(!o){this._diag.topicMiss++,this._diag.missedTopics.length<5&&this._diag.missedTopics.push(r.slice(0,60));return}this._diag.topicMatch++;let s=hf(i);this._diag.peersDecoded+=s.length,this._diag.lastPeers=s.map(c=>{let l=c.clientId===o.clientId?"self":c.state===null?"null-state":"kept";return{clientId:c.clientId,clock:c.clock,stateKeys:c.state?Object.keys(c.state).join(","):"null",skip:l}});let a=!1;for(let c of s){if(c.clientId===o.clientId){this._diag.selfSkip++;continue}if(c.state===null)this._diag.nullState++,o.peers.has(c.clientId)&&(o.peers.delete(c.clientId),a=!0);else{this._diag.kept++;let l=o.peers.get(c.clientId);(!l||l.clock<c.clock)&&(o.peers.set(c.clientId,{state:c.state,clock:c.clock}),a=!0)}}a&&this.notifySubscribers(o)}sendControl(e){!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify(e))}sendTopicAwareness(e,r){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return;this._diag.binaryOut++;let i=mf(r.clientId,r.clock,r.localState),n=gf(e,i);this.config.debug&&console.error(`[AwarenessManager] sending awareness for "${e}" clientId=${r.clientId} clock=${r.clock} (${n.length} bytes)`),this.ws.send(n)}notifySubscribers(e){for(let r of e.subscribers)try{r()}catch{}}clearAllPeers(){for(let[,e]of this.topics)e.peers.clear(),this.notifySubscribers(e)}};import{readFile as LL}from"node:fs/promises";import{basename as ZL}from"node:path";var FL={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp4:"video/mp4",mov:"video/quicktime",webm:"video/webm",pdf:"application/pdf",txt:"text/plain",md:"text/markdown",json:"application/json",csv:"text/csv",html:"text/html",zip:"application/zip"};function qL(t){let e=t.split(".").pop()?.toLowerCase()??"";return FL[e]??"application/octet-stream"}function VL(t){return t.startsWith("image/")}var S_=new Set(["image/png","image/jpeg","image/gif","image/webp"]),HL=new Set(["application/json","application/ld+json","application/xml","application/csv","application/yaml","application/x-yaml","application/javascript","application/x-ndjson","application/x-sh","application/toml"]);function OP(t){let e=t.split(";")[0].trim().toLowerCase();return e.startsWith("text/")||HL.has(e)}var I_=512*1024;function Cn(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function NP(t){return t.startsWith("file:")?t.slice(5):t}function WL(t){if(t.length<30)return null;if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71)return{width:AP(t,16),height:AP(t,20)};if(t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56)return{width:t[6]|t[7]<<8,height:t[8]|t[9]<<8};if(t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80){let e=String.fromCharCode(t[12],t[13],t[14],t[15]);if(e==="VP8 ")return{width:(t[26]|t[27]<<8)&16383,height:(t[28]|t[29]<<8)&16383};if(e==="VP8L"){let r=t[21]|t[22]<<8|t[23]<<16|t[24]<<24;return{width:(r&16383)+1,height:(r>>14&16383)+1}}return e==="VP8X"?{width:1+(t[24]|t[25]<<8|t[26]<<16),height:1+(t[27]|t[28]<<8|t[29]<<16)}:null}if(t[0]===255&&t[1]===216){let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let r=t[e+1];for(;r===255&&e+2<t.length;)e++,r=t[e+1];if(r===1||r>=208&&r<=217){e+=2;continue}let i=t[e+2]<<8|t[e+3];if(r>=192&&r<=207&&r!==196&&r!==200&&r!==204)return{width:t[e+7]<<8|t[e+8],height:t[e+5]<<8|t[e+6]};if(i<2)return null;e+=2+i}return null}return null}function AP(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}var EP=100*1024*1024;async function yf(t,e,r){let i=await Promise.all(r.map(async n=>{let o;try{o=new Uint8Array(await LL(n))}catch(a){throw new Error(`Cannot read attachment "${n}": ${a instanceof Error?a.message:String(a)}`)}if(o.length>EP)throw new Error(`Attachment "${n}" is ${Cn(o.length)} \u2014 over the ${Cn(EP)} upload limit.`);let s=qL(n);return{path:n,data:o,contentType:s}}));return Promise.all(i.map(async n=>{let o=await t.uploadFile(e,{data:n.data,filename:ZL(n.path),contentType:n.contentType});return{info:o,dims:VL(o.contentType)?WL(n.data):null}}))}function BL(t){let e=t.name||"file",r=t.contentType||"unknown type",i=typeof t.size=="number"?`, ${Cn(t.size)}`:"",n=t.fileId,o=n?` \u2014 file:${n} (use view_file to look at it)`:"";return`\u{1F4CE} ${e} (${r}${i})${o}`}function GL(t,e){let r=t.caption||"",i=Array.isArray(t.images)?t.images:[],n=i.map(c=>c.fileId?`file:${c.fileId}`:null).filter(Boolean).join(", "),o=`\u{1F5BC} ${i.length} image(s)${r?`: ${r}`:""}`,s=n?` \u2014 ${n} (use view_file to look at them)`:"",a=e?` [gallery ${e}]`:"";return`${o}${s}${a}`}function JL(t){let e=t.contextType||"content",r=t.instanceId,i=t.snapshot;if(e==="photo_gallery"&&i)return GL(i,r);let n=i?.title||i?.name||"";return`[${e} card${n?` "${n}"`:""}${r?` ${r}`:""}]`}function Wr(t){if(t==null)return"";if(typeof t=="string")return t;let e=t.type;if(e==="file")return BL(t);if(e==="content_card")return JL(t);if(e==="text")return t.text??"";if(e==="composite")return(Array.isArray(t.blocks)?t.blocks:[]).map(n=>Wr(n)).filter(Boolean).join(`
|
|
109
|
-
`);let r=JSON.stringify(t);return r.length>300?`${r.slice(0,300)}\u2026`:r}function
|
|
110
|
-
|
|
111
|
-
${s(h)}`}]};let y=i&&i.size===1?[...i][0]:void 0;y&&(t.awarenessManager?.updateTopicState(l,{waitingOnThread:{parentMessageId:y,since:Date.now()}}),t.setNarrowWait(y));let _,k=new Promise(I=>_=I),w=!1,$=async()=>{if(!w){w=!0;try{let I=await m();I&&_(I)}catch{}finally{w=!1}}},S=null,G=null,q=[];try{S=setTimeout(()=>_(null),o*1e3);let I=t.awarenessManager;I&&(await Go(t).catch(()=>!1),q.push(I.onPlaceEvent(ue=>{if(ue.type!=="message_created"||(ue.placeId??ue.topic)!==l)return;let ae=ue.message;if(!ae||typeof ae!="object")return;let Me=sf(ae);Me.id&&d(Me)&&_(Me)})),q.push(I.onConnectionChange(ue=>{ue&&$()}))),G=setInterval(()=>void $(),
|
|
112
|
-
|
|
113
|
-
${s(se)}`}]}):{content:[{type:"text",text:`No ${a} received within ${o}s timeout.`}]}}finally{S&&clearTimeout(S),G&&clearInterval(G);for(let I of q)I();y&&(t.awarenessManager?.updateTopicState(l,{waitingOnThread:null}),t.setNarrowWait(null))}}function
|
|
114
|
-
`).trim();try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:null}catch{return null}}var Ge=t=>typeof t=="string"&&t?t:void 0;function Ko(t){if(!t.placeId)throw new Error("Not connected to a place. Use the connect tool first.");return t.placeId}async function
|
|
115
|
-
|
|
116
|
-
${u}`:u)}}};var
|
|
117
|
-
`),n=/\b(activity:[A-Za-z0-9_-]+)/.exec(i)?.[1];if(!n)return;if(e==="complete_activity"){this.state.currentActivity?.activityId===n&&this.state.clearCurrentActivity(),this.state.clearOfficeHoursForActivity(n);return}let o=/\b(conv_[A-Za-z0-9_-]+)/.exec(i)?.[1]??"",s=/"([^"\n]+)"/.exec(i)?.[1]??n,a=e==="start_activity"&&/STAGED SESSION/.test(i);this.state.trackActivity({activityId:n,conversationId:o,label:s,...a?{session:{mode:"staged"}}:{}})}catch{}}async stampSession(e,r){if(e!=="raise"&&e!=="create_page"&&e!=="decide")return{args:r};if(r.sessionActivityId)return{args:r};try{let i=typeof r.title=="string"?r.title:e,n=await bf(this.state,this.client,{label:i});return n.sessionActivityId?{args:{...r,sessionActivityId:n.sessionActivityId},...n.minted&&n.note?{note:n.note}:{}}:{args:r,...n.note?{note:n.note}:{}}}catch{return{args:r}}}doorCallback(e,r){return async(i,n)=>{let o=this.door;if(o)try{let s=await this.stampSession(e,i),a=await o.callTool(e,s.args);return this.trackSessionFocus(e,a),s.note?
|
|
118
|
-
`)}}var
|
|
119
|
-
`);for(let r=e.length-1;r>=0;r--){let i=e[r]?.trim();if(!(!i||!i.includes('"usage"')))try{let n=JSON.parse(i),o=n.message?.usage;if(!o)continue;if((o.input_tokens??0)+(o.cache_read_input_tokens??0)+(o.cache_creation_input_tokens??0)>0)return n}catch{}}return null}function N_(t){return Pf(Ye(t),"window.json")}async function
|
|
120
|
-
`);for(let r=e.length-1;r>=0;r--){let i=e[r]?.trim();if(!(!i||!i.includes('"cwd"')))try{let n=JSON.parse(i).cwd;if(typeof n=="string"&&n)return n}catch{}}return null}async function
|
|
121
|
-
`)){let i=/^(\w+):\s+(\d+)\s*kB/.exec(r);i&&e.set(i[1],Number(i[2]))}return e}async function
|
|
122
|
-
`)[0].trim()}catch{return null}}async function
|
|
123
|
-
`).find(a=>a.startsWith(e));if(!r)return null;let i=a=>{let c=new RegExp(`${a}=([0-9.]+)`).exec(r);return c?Number(c[1]):NaN},n=i("avg10"),o=i("avg60"),s=i("avg300");return[n,o,s].every(Number.isFinite)?{avg10:n,avg60:o,avg300:s}:null}async function
|
|
124
|
-
`)}function
|
|
125
|
-
`)}var
|
|
106
|
+
`);try{yield{event:c,data:JSON.parse(m)}}catch{yield{event:c,data:m}}}c="",l=[]}}}}finally{o.releaseLock()}}buildAwarenessWsUrl(e){let r=this.apiUrl.replace("api.","stream.").replace(/^http/,"ws"),i=new URLSearchParams({token:e});return`${r}/ws/awareness-v2?${i.toString()}`}};import{readdir as gw,readFile as kC,stat as rF}from"node:fs/promises";import{join as Mc}from"node:path";var cf=class{constructor(e){this._server=e}requestStream(e,r,i){return this._server.requestStream(e,r,i)}createMessageStream(e,r){let i=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],l=c.some(u=>u.type==="tool_use");if(s){if(o.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(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(o.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 this.requestStream({method:"sampling/createMessage",params:e},Yn,r)}elicitInputStream(e,r){let i=this._server.getClientCapabilities(),n=e.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"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},vn,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,i){return this._server.getTaskResult({taskId:e},r,i)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};var lf=class extends Po{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Pa.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 Wo,this.setRequestHandler(Vy,i=>this._oninitialize(i)),this.setNotificationHandler(Vd,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(sv,async(i,n)=>{let o=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,a=Pa.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new cf(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=up(this._capabilities,e)}setRequestHandler(e,r){let n=vr(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let o;if(Tt(n)){let a=n;o=a._zod?.def?.value??a.value}else{let a=n;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,l)=>{let u=yt(To,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new O(U.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let m=yt(Dr,p);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new O(U.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let f=yt(yn,p);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new O(U.InvalidParams,`Invalid tools/call result: ${m}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);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 ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);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 ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);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 ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Gp(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Bp(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Ld.includes(r)?r:hn,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"},jr)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(l=>l.type==="tool_use");if(o){if(n.some(l=>l.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 l=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(n.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},za,r):this.request({method:"sampling/createMessage",params:e},Yn,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},vn,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},vn,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!a.valid)throw new O(U.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof O?s:new O(U.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,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:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},uv,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}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 SP=Symbol.for("mcp.completable");function w_(t){return!!t&&typeof t=="object"&&SP in t}function IP(t){return t[SP]?.complete}var xP;(function(t){t.Completable="McpCompletable"})(xP||(xP={}));var IL=/^[A-Za-z0-9._-]{1,128}$/;function TL(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!IL.test(t)){let r=t.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return e.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:e}}return{isValid:!0,warnings:e}}function PL(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)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 $_(t){let e=TL(t);return PL(t,e.warnings),e.isValid}var uf=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,i){let n={taskSupport:"required",...r.execution};if(n.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,n,r._meta,i)}};var df=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new lf(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new uf(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(zn(ip)),this.server.assertCanSetRequestHandler(zn(To)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(ip,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let i={name:e,title:r.title,description:r.description,inputSchema:(()=>{let n=fo(r.inputSchema);return n?gv(n,{strictUnions:!0,pipeStrategy:"input"}):zL})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let n=fo(r.outputSchema);n&&(i.outputSchema=gv(n,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(To,async(e,r)=>{try{let i=this._registeredTools[e.params.name];if(!i)throw new O(U.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new O(U.InvalidParams,`Tool ${e.params.name} disabled`);let n=!!e.params.task,o=i.execution?.taskSupport,s="createTask"in i.handler;if((o==="required"||o==="optional")&&!s)throw new O(U.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!n)throw new O(U.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!n&&s)return await this.handleAutomaticTaskPolling(i,e,r);let a=await this.validateToolInput(i,e.params.arguments,e.params.name),c=await this.executeToolHandler(i,a,r);return n||await this.validateToolOutput(i,c,e.params.name),c}catch(i){if(i instanceof O&&i.code===U.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,i){if(!e.inputSchema)return;let o=fo(e.inputSchema)??e.inputSchema,s=await od(o,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=sd(a);throw new O(U.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${c}`)}return s.data}async validateToolOutput(e,r,i){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new O(U.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let n=fo(e.outputSchema),o=await od(n,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=sd(s);throw new O(U.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${a}`)}}async executeToolHandler(e,r,i){let n=e.handler;if("createTask"in n){if(!i.taskStore)throw new Error("No task store provided.");let s={...i,taskStore:i.taskStore};if(e.inputSchema){let a=n;return await Promise.resolve(a.createTask(r,s))}else{let a=n;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=n;return await Promise.resolve(s(r,i))}else{let s=n;return await Promise.resolve(s(i))}}async handleAutomaticTaskPolling(e,r,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let n=await this.validateToolInput(e,r.params.arguments,r.params.name),o=e.handler,s={...i,taskStore:i.taskStore},a=n?await Promise.resolve(o.createTask(n,s)):await Promise.resolve(o.createTask(s)),c=a.task.taskId,l=a.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(p=>setTimeout(p,u));let d=await i.taskStore.getTask(c);if(!d)throw new O(U.InternalError,`Task ${c} not found during polling`);l=d}return await i.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(zn(op)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(op,async e=>{switch(e.params.ref.type){case"ref/prompt":return AS(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return RS(e),this.handleResourceCompletion(e,e.params.ref);default:throw new O(U.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let i=this._registeredPrompts[r.name];if(!i)throw new O(U.InvalidParams,`Prompt ${r.name} not found`);if(!i.enabled)throw new O(U.InvalidParams,`Prompt ${r.name} disabled`);if(!i.argsSchema)return wc;let o=vr(i.argsSchema)?.[e.params.argument.name];if(!w_(o))return wc;let s=IP(o);if(!s)return wc;let a=await s(e.params.argument.value,e.params.context);return PP(a)}async handleResourceCompletion(e,r){let i=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!i){if(this._registeredResources[r.uri])return wc;throw new O(U.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let n=i.resourceTemplate.completeCallback(e.params.argument.name);if(!n)return wc;let o=await n(e.params.argument.value,e.params.context);return PP(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(zn(Qd)),this.server.assertCanSetRequestHandler(zn(ep)),this.server.assertCanSetRequestHandler(zn(tp)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Qd,async(e,r)=>{let i=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),n=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(r);for(let a of s.resources)n.push({...o.metadata,...a})}return{resources:[...i,...n]}}),this.server.setRequestHandler(ep,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,i])=>({name:r,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(tp,async(e,r)=>{let i=new URL(e.params.uri),n=this._registeredResources[i.toString()];if(n){if(!n.enabled)throw new O(U.InvalidParams,`Resource ${i} disabled`);return n.readCallback(i,r)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(i.toString());if(s)return o.readCallback(i,s,r)}throw new O(U.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(zn(rp)),this.server.assertCanSetRequestHandler(zn(np)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(rp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?AL(r.argsSchema):void 0}))})),this.server.setRequestHandler(np,async(e,r)=>{let i=this._registeredPrompts[e.params.name];if(!i)throw new O(U.InvalidParams,`Prompt ${e.params.name} not found`);if(!i.enabled)throw new O(U.InvalidParams,`Prompt ${e.params.name} disabled`);if(i.argsSchema){let n=fo(i.argsSchema),o=await od(n,e.params.arguments);if(!o.success){let c="error"in o?o.error:"Unknown error",l=sd(c);throw new O(U.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,a=i.callback;return await Promise.resolve(a(s,r))}else{let n=i.callback;return await Promise.resolve(n(r))}}),this._promptHandlersInitialized=!0)}resource(e,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 s=this._createRegisteredResource(e,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,i,n){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(e,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,i.title,r,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,r,i,n,o){let s={name:e,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==i&&(delete this._registeredResources[i],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=s,s}_createRegisteredResourceTemplate(e,r,i,n,o){let s={resourceTemplate:i,title:r,metadata:n,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=i.uriTemplate.variableNames;return Array.isArray(a)&&a.some(l=>!!i.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,i,n,o){let s={title:r,description:i,argsSchema:n===void 0?void 0:Gn(n),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=Gn(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,n&&Object.values(n).some(c=>{let l=c instanceof ko?c._def?.innerType:c;return w_(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,i,n,o,s,a,c,l){$_(e);let u={title:r,description:i,inputSchema:TP(n),outputSchema:TP(o),annotations:s,execution:a,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&$_(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=u)),typeof d.title<"u"&&(u.title=d.title),typeof d.description<"u"&&(u.description=d.description),typeof d.paramsSchema<"u"&&(u.inputSchema=Gn(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=Gn(d.outputSchema)),typeof d.callback<"u"&&(u.handler=d.callback),typeof d.annotations<"u"&&(u.annotations=d.annotations),typeof d._meta<"u"&&(u._meta=d._meta),typeof d.enabled<"u"&&(u.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let i,n,o,s;if(typeof r[0]=="string"&&(i=r.shift()),r.length>1){let c=r[0];k_(c)?(n=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!k_(r[0])&&(s=r.shift())):typeof c=="object"&&c!==null&&(s=r.shift())}let a=r[0];return this._createRegisteredTool(e,void 0,i,n,o,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,i){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:n,description:o,inputSchema:s,outputSchema:a,annotations:c,_meta:l}=r;return this._createRegisteredTool(e,n,o,s,a,c,{taskSupport:"forbidden"},l,i)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let i;typeof r[0]=="string"&&(i=r.shift());let n;r.length>1&&(n=r.shift());let o=r[0],s=this._createRegisteredPrompt(e,void 0,i,n,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,i){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:n,description:o,argsSchema:s}=r,a=this._createRegisteredPrompt(e,n,o,s,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var zL={type:"object",properties:{}};function zP(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function CL(t){return"_def"in t||"_zod"in t||zP(t)}function k_(t){return typeof t!="object"||t===null||CL(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(zP)}function TP(t){if(t)return k_(t)?Gn(t):t}function AL(t){let e=vr(t);return e?Object.entries(e).map(([r,i])=>{let n=rx(i),o=nx(i);return{name:r,description:n,required:!o}}):[]}function zn(t){let r=vr(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let i=ad(r);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function PP(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var wc={completion:{values:[],hasMore:!1}};import AP from"node:process";var pf=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
107
|
+
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),RL(r)}clear(){this._buffer=void 0}};function RL(t){return So.parse(JSON.parse(t))}function CP(t){return JSON.stringify(t)+`
|
|
108
|
+
`}var ff=class{constructor(e=AP.stdin,r=AP.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new pf,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 e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}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(e){return new Promise(r=>{let i=CP(e);this._stdout.write(i)?r():this._stdout.once("drain",r)})}};function pi(t,e){for(;e>127;)t.push(128|e&127),e>>>=7;t.push(e&127)}function fi(t,e){let r=0,i=0,n=e;for(;;){let o=t[n++];if(r|=(o&127)<<i,o<128)return{value:r>>>0,bytesRead:n-e};i+=7}}function mf(t,e,r){let i=r===null?"null":JSON.stringify(r),n=new TextEncoder().encode(i),o=[];pi(o,1);let s=[];pi(s,1),pi(s,t),pi(s,e),pi(s,n.length);for(let a=0;a<n.length;a++)s.push(n[a]);pi(o,s.length);for(let a=0;a<s.length;a++)o.push(s[a]);return new Uint8Array(o)}function hf(t){let e=0,r=fi(t,e);if(e+=r.bytesRead,r.value!==1)return[];let i=fi(t,e);e+=i.bytesRead;let n=e+i.value,o=fi(t,e);e+=o.bytesRead;let s=o.value,a=[];for(let c=0;c<s&&e<n;c++){let l=fi(t,e);e+=l.bytesRead;let u=fi(t,e);e+=u.bytesRead;let d=fi(t,e);e+=d.bytesRead;let p=t.slice(e,e+d.value);e+=d.value;try{let f=JSON.parse(new TextDecoder().decode(p));a.push({clientId:l.value,clock:u.value,state:f===null||typeof f=="object"&&Object.keys(f).length===0?null:f})}catch{}}return a}function gf(t,e){let r=new TextEncoder().encode(t),i=[];pi(i,r.length);let n=new Uint8Array(i.length+r.length+e.length);return n.set(i,0),n.set(r,i.length),n.set(e,i.length+r.length),n}function x_(t){let e=fi(t,0),r=t.slice(e.bytesRead,e.bytesRead+e.value),i=new TextDecoder().decode(r),n=t.slice(e.bytesRead+e.value);return{topic:i,awarenessBytes:n}}var RP=15,EL=1e3,OL=3e4,NL=6e4,ML=5e3,jL=3e4,DL=3,Bo=class{config;ws=null;topics=new Map;seq=0;pendingSubscribes=new Map;graceTimers=new Map;reconnectAttempt=0;reconnectTimer=null;connecting=!1;intentionalClose=!1;connectGeneration=0;_connected=!1;rawHandlers=new Map;rawReconnectHandlers=new Map;connectionListeners=new Set;placeEventListeners=new Set;_diag={binaryIn:0,binaryOut:0,topicMatch:0,topicMiss:0,peersDecoded:0,controlIn:0,selfSkip:0,nullState:0,kept:0,lastPeers:[],missedTopics:[]};constructor(e){this.config=e}get connected(){return this._connected}onConnectionChange(e){return this.connectionListeners.add(e),()=>this.connectionListeners.delete(e)}onPlaceEvent(e){return this.placeEventListeners.add(e),()=>this.placeEventListeners.delete(e)}setConnected(e){if(this._connected!==e){this._connected=e;for(let r of this.connectionListeners)r(e)}}async connect(){this.intentionalClose=!1,this.reconnectAttempt=0;let e=++this.connectGeneration,r=await this.config.getToken();if(e===this.connectGeneration)return this.doConnect(this.config.buildWsUrl(r),e)}doConnect(e,r){let i=r??this.connectGeneration;return new Promise((n,o)=>{if(i!==this.connectGeneration)return n();this.connecting=!0,this.ws=new WebSocket(e),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{if(this.connecting=!1,i!==this.connectGeneration)return this.ws?.close(),n();this.reconnectAttempt=0,this.setConnected(!0),this.flushSubscriptions(),n()},this.ws.onerror=()=>{this.connecting=!1,this.reconnectAttempt===0&&o(new Error("WebSocket error"))},this.ws.onclose=()=>{if(this.connecting=!1,this.setConnected(!1),this.intentionalClose||i!==this.connectGeneration){this.clearAllPeers();return}this.scheduleReconnect()},this.ws.onmessage=s=>{typeof s.data=="string"?(this._diag.controlIn++,this.handleControlMessage(s.data)):(this._diag.binaryIn++,this.handleBinaryMessage(new Uint8Array(s.data)))}})}disconnect(){this.intentionalClose=!0,this.connectGeneration++,this.setConnected(!1),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);for(let[,e]of this.graceTimers)clearTimeout(e);this.graceTimers.clear();for(let[,e]of this.topics)e.typingExpiryTimer&&clearTimeout(e.typingExpiryTimer);this.ws&&(this.ws.close(),this.ws=null),this.clearAllPeers(),this.topics.clear(),this.rawHandlers.clear(),this.rawReconnectHandlers.clear(),this.connectionListeners.clear()}async forceReconnect(){if(this.intentionalClose)return;let e=this.ws;this.ws=null,this.connectGeneration++,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.setConnected(!1);try{e?.close()}catch{}await this.connect()}scheduleReconnect(){if(this.intentionalClose)return;let e=this.reconnectAttempt>=RP;e&&this.reconnectAttempt===RP&&(console.error("[AwarenessManager] Max reconnect attempts reached, entering slow-poll mode (every 60s)"),this.clearAllPeers());let r=e?NL:Math.min(EL*Math.pow(2,this.reconnectAttempt),OL)*(1+Math.random()*.25);this.reconnectAttempt++;let i=this.connectGeneration;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,!(this.intentionalClose||i!==this.connectGeneration)&&(this.connecting||this._connected||this.config.getToken().then(n=>{if(i===this.connectGeneration)return this.doConnect(this.config.buildWsUrl(n),i)}).catch(n=>{e?console.error("[AwarenessManager] Slow-poll reconnect failed, will retry"):console.error("[AwarenessManager] Reconnect failed:",n),i===this.connectGeneration&&this.scheduleReconnect()}))},r)}async ensureConnected(){if(this._connected)return!0;if(this.intentionalClose||this.reconnectTimer||this.connecting)return!1;try{let e=await this.config.getToken();return this.intentionalClose?!1:(await this.doConnect(this.config.buildWsUrl(e)),this._connected)}catch(e){return console.error("[AwarenessManager] ensureConnected failed:",e),this.scheduleReconnect(),!1}}flushSubscriptions(){for(let[e,r]of this.topics){r.subscribed=!1;let i=++this.seq;this.sendControl({type:"subscribe",topic:e,seq:i}),this.pendingSubscribes.set(i,{topic:e,resolve:()=>{r.subscribed=!0,r.localState&&(r.clock++,this.sendTopicAwareness(e,r));let n=this.rawReconnectHandlers.get(e);n&&n()},reject:()=>{}})}}subscribe(e){let r=this.graceTimers.get(e);if(r&&(clearTimeout(r),this.graceTimers.delete(e),this.topics.get(e)?.subscribed))return Promise.resolve();let i=this.topics.get(e);return i?.subscribed||(i||this.topics.set(e,{clientId:this.config.clientId??Math.random()*1073741823>>>0,clock:0,localState:null,peers:new Map,subscribers:new Set,typingExpiryTimer:null,subscribed:!1}),!this._connected)?Promise.resolve():new Promise((n,o)=>{let s=++this.seq;this.sendControl({type:"subscribe",topic:e,seq:s}),this.pendingSubscribes.set(s,{topic:e,resolve:n,reject:o})})}unsubscribe(e){let r=this.topics.get(e);if(r&&!(r.subscribers.size>0)){if(this.graceTimers.size>=DL){let i=this.graceTimers.keys().next().value,n=this.graceTimers.get(i);n&&clearTimeout(n),this.graceTimers.delete(i),this.doUnsubscribe(i)}this.graceTimers.set(e,setTimeout(()=>{this.graceTimers.delete(e),this.doUnsubscribe(e)},jL))}}doUnsubscribe(e){let r=this.topics.get(e);if(r){if(r.typingExpiryTimer&&clearTimeout(r.typingExpiryTimer),r.subscribed&&this._connected){let i=++this.seq;this.sendControl({type:"unsubscribe",topic:e,seq:i})}this.topics.delete(e)}}setTopicState(e,r){let i=this.topics.get(e);i&&(i.localState=r,i.clock++,this.sendTopicAwareness(e,i))}updateTopicState(e,r){let i=this.topics.get(e);i&&this.setTopicState(e,{...i.localState,...r})}getTopicPeers(e){let r=this.topics.get(e);if(!r)return[];let i=[];for(let[n,{state:o,clock:s}]of r.peers)n!==r.clientId&&i.push({clientId:n,state:o,clock:s});return i}onTopicUpdate(e,r){let i=this.topics.get(e);return i?(i.subscribers.add(r),()=>{i.subscribers.delete(r)}):()=>{}}signalTyping(e,r=ML){let i=this.topics.get(e);i&&(i.typingExpiryTimer&&clearTimeout(i.typingExpiryTimer),i.localState?.typing||this.updateTopicState(e,{typing:!0}),i.typingExpiryTimer=setTimeout(()=>{i.typingExpiryTimer=null,i.localState?.typing&&this.updateTopicState(e,{typing:!1})},r))}stopTyping(e){let r=this.topics.get(e);r&&(r.typingExpiryTimer&&(clearTimeout(r.typingExpiryTimer),r.typingExpiryTimer=null),r.localState?.typing&&this.updateTopicState(e,{typing:!1}))}async subscribeRaw(e,r,i){this.rawHandlers.set(e,r),i&&this.rawReconnectHandlers.set(e,i),await this.subscribe(e)}sendRaw(e,r){!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(gf(e,r))}unsubscribeRaw(e){this.rawHandlers.delete(e),this.rawReconnectHandlers.delete(e),this.unsubscribe(e)}async refreshToken(){if(!this._connected||!this.ws)return;let e=await this.config.getToken(),r=++this.seq;this.sendControl({type:"token",token:e,seq:r})}handleControlMessage(e){let r;try{r=JSON.parse(e)}catch{return}let i=r.type,n=r.seq,o=r.topic;switch(i){case"subscribed":{if(n!=null){let s=this.pendingSubscribes.get(n);if(s){this.pendingSubscribes.delete(n);let a=this.topics.get(s.topic);if(a){a.subscribed=!0;let c=r.state;if(c){for(let l of c)l.clientId!==a.clientId&&a.peers.set(l.clientId,{state:l.state,clock:0});this.notifySubscribers(a)}}s.resolve()}}break}case"subscribe_error":{if(n!=null){let s=this.pendingSubscribes.get(n);s&&(this.pendingSubscribes.delete(n),s.reject(new Error(r.reason??"Subscribe failed")))}break}case"unsubscribed":{if(!o)break;if(n==null){let s=this.topics.get(o);s&&(s.subscribed=!1,s.peers.clear(),this.notifySubscribers(s),s.typingExpiryTimer&&clearTimeout(s.typingExpiryTimer),this.topics.delete(o))}break}case"token_ok":break;case"content_changed":case"activity_changed":case"message_created":case"garden_tended":case"ask_created":{if(this.placeEventListeners.size>0){let s=r;for(let a of this.placeEventListeners)try{a(s)}catch(c){console.error("[AwarenessManager] place event listener error:",c)}}break}case"error":console.error("[AwarenessManager] Server error:",r.reason);break}}handleBinaryMessage(e){let{topic:r,awarenessBytes:i}=x_(e),n=this.rawHandlers.get(r);if(n){try{n(i)}catch{}return}let o=this.topics.get(r);if(!o){this._diag.topicMiss++,this._diag.missedTopics.length<5&&this._diag.missedTopics.push(r.slice(0,60));return}this._diag.topicMatch++;let s=hf(i);this._diag.peersDecoded+=s.length,this._diag.lastPeers=s.map(c=>{let l=c.clientId===o.clientId?"self":c.state===null?"null-state":"kept";return{clientId:c.clientId,clock:c.clock,stateKeys:c.state?Object.keys(c.state).join(","):"null",skip:l}});let a=!1;for(let c of s){if(c.clientId===o.clientId){this._diag.selfSkip++;continue}if(c.state===null)this._diag.nullState++,o.peers.has(c.clientId)&&(o.peers.delete(c.clientId),a=!0);else{this._diag.kept++;let l=o.peers.get(c.clientId);(!l||l.clock<c.clock)&&(o.peers.set(c.clientId,{state:c.state,clock:c.clock}),a=!0)}}a&&this.notifySubscribers(o)}sendControl(e){!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify(e))}sendTopicAwareness(e,r){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return;this._diag.binaryOut++;let i=mf(r.clientId,r.clock,r.localState),n=gf(e,i);this.config.debug&&console.error(`[AwarenessManager] sending awareness for "${e}" clientId=${r.clientId} clock=${r.clock} (${n.length} bytes)`),this.ws.send(n)}notifySubscribers(e){for(let r of e.subscribers)try{r()}catch{}}clearAllPeers(){for(let[,e]of this.topics)e.peers.clear(),this.notifySubscribers(e)}};import{readFile as FL}from"node:fs/promises";import{basename as qL}from"node:path";var VL={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp4:"video/mp4",mov:"video/quicktime",webm:"video/webm",pdf:"application/pdf",txt:"text/plain",md:"text/markdown",json:"application/json",csv:"text/csv",html:"text/html",zip:"application/zip"};function HL(t){let e=t.split(".").pop()?.toLowerCase()??"";return VL[e]??"application/octet-stream"}function WL(t){return t.startsWith("image/")}var S_=new Set(["image/png","image/jpeg","image/gif","image/webp"]),BL=new Set(["application/json","application/ld+json","application/xml","application/csv","application/yaml","application/x-yaml","application/javascript","application/x-ndjson","application/x-sh","application/toml"]);function NP(t){let e=t.split(";")[0].trim().toLowerCase();return e.startsWith("text/")||BL.has(e)}var I_=512*1024;function Cn(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function MP(t){return t.startsWith("file:")?t.slice(5):t}function GL(t){if(t.length<30)return null;if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71)return{width:EP(t,16),height:EP(t,20)};if(t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56)return{width:t[6]|t[7]<<8,height:t[8]|t[9]<<8};if(t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80){let e=String.fromCharCode(t[12],t[13],t[14],t[15]);if(e==="VP8 ")return{width:(t[26]|t[27]<<8)&16383,height:(t[28]|t[29]<<8)&16383};if(e==="VP8L"){let r=t[21]|t[22]<<8|t[23]<<16|t[24]<<24;return{width:(r&16383)+1,height:(r>>14&16383)+1}}return e==="VP8X"?{width:1+(t[24]|t[25]<<8|t[26]<<16),height:1+(t[27]|t[28]<<8|t[29]<<16)}:null}if(t[0]===255&&t[1]===216){let e=2;for(;e+9<t.length;){if(t[e]!==255)return null;let r=t[e+1];for(;r===255&&e+2<t.length;)e++,r=t[e+1];if(r===1||r>=208&&r<=217){e+=2;continue}let i=t[e+2]<<8|t[e+3];if(r>=192&&r<=207&&r!==196&&r!==200&&r!==204)return{width:t[e+7]<<8|t[e+8],height:t[e+5]<<8|t[e+6]};if(i<2)return null;e+=2+i}return null}return null}function EP(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}var OP=100*1024*1024;async function yf(t,e,r){let i=await Promise.all(r.map(async n=>{let o;try{o=new Uint8Array(await FL(n))}catch(a){throw new Error(`Cannot read attachment "${n}": ${a instanceof Error?a.message:String(a)}`)}if(o.length>OP)throw new Error(`Attachment "${n}" is ${Cn(o.length)} \u2014 over the ${Cn(OP)} upload limit.`);let s=HL(n);return{path:n,data:o,contentType:s}}));return Promise.all(i.map(async n=>{let o=await t.uploadFile(e,{data:n.data,filename:qL(n.path),contentType:n.contentType});return{info:o,dims:WL(o.contentType)?GL(n.data):null}}))}function JL(t){let e=t.name||"file",r=t.contentType||"unknown type",i=typeof t.size=="number"?`, ${Cn(t.size)}`:"",n=t.fileId,o=n?` \u2014 file:${n} (use view_file to look at it)`:"";return`\u{1F4CE} ${e} (${r}${i})${o}`}function KL(t,e){let r=t.caption||"",i=Array.isArray(t.images)?t.images:[],n=i.map(c=>c.fileId?`file:${c.fileId}`:null).filter(Boolean).join(", "),o=`\u{1F5BC} ${i.length} image(s)${r?`: ${r}`:""}`,s=n?` \u2014 ${n} (use view_file to look at them)`:"",a=e?` [gallery ${e}]`:"";return`${o}${s}${a}`}function YL(t){let e=t.contextType||"content",r=t.instanceId,i=t.snapshot;if(e==="photo_gallery"&&i)return KL(i,r);let n=i?.title||i?.name||"";return`[${e} card${n?` "${n}"`:""}${r?` ${r}`:""}]`}function Wr(t){if(t==null)return"";if(typeof t=="string")return t;let e=t.type;if(e==="file")return JL(t);if(e==="content_card")return YL(t);if(e==="text")return t.text??"";if(e==="composite")return(Array.isArray(t.blocks)?t.blocks:[]).map(n=>Wr(n)).filter(Boolean).join(`
|
|
109
|
+
`);let r=JSON.stringify(t);return r.length>300?`${r.slice(0,300)}\u2026`:r}function XL(t){return t??""}function vf(t,e,r,i){let n=t.placeId;if(!n||!i)return;let o=XL(r);if(t.serverReadCursors.get(o)===i)return;t.serverReadCursors.set(o,i);let s=()=>{t.serverReadCursors.get(o)===i&&t.serverReadCursors.delete(o)};try{let a=r?e.markThreadRead(n,r,i):e.markPlaceRead(n,i);Promise.resolve(a).catch(s)}catch{s()}}function jP(t){let e=(t??process.env.GIGABUDDY_SESSION_MODE??"").toLowerCase();return e==="staged"?"staged":e==="live"?"live":null}function QL(t){let e=t.currentActivity;return e?.session?.mode==="staged"?e.activityId:void 0}async function bf(t,e,r){let i=QL(t);if(i)return{sessionActivityId:i};if(t.currentActivity)return{};if(t.sessionIntent!=="staged"||!t.placeId)return{};let n=e;if(typeof n.createActivity!="function")return{note:"(staged session unavailable \u2014 this client cannot open activities, so this landed LIVE despite staged intent)"};try{let o=`Session: ${r.label}`.slice(0,200),s=await n.createActivity(t.placeId,{label:o,visibility:"open",session:{mode:"staged",openedBy:"agent"}});return t.trackActivity({activityId:s.id,conversationId:s.conversationId??"",label:o,session:{mode:"staged"}}),{sessionActivityId:s.id,minted:!0,note:`Opened a STAGED SESSION for this conversation (${s.id}) \u2014 what you produce stays with the session until session_publish; session_review shows the change set.`}}catch(o){return{note:`(staged session could not be opened \u2014 landing live: ${o instanceof Error?o.message:String(o)})`}}}function eZ(t){let e=new Map;for(let s of t.activeActivities.values())e.set(s.activityId,s.conversationId);let r=[];for(let s of t.officeHours.values())r.push({activityId:s.activityId,pageId:s.pageId,role:s.role,until:s.until}),e.has(s.activityId)||e.set(s.activityId,t.conversationIdForActivity(s.activityId)??"");let i=[...e.keys()],n=t.narrowWaitConvId,o=n?i.filter(s=>e.get(s)===n):i;return{stakeholderOf:i,availableFor:o,officeHours:r}}function Jt(t){let{placeId:e,awarenessManager:r}=t;!e||!r||r.updateTopicState(e,{availability:eZ(t),beatAt:Date.now()})}function $c(t,e=Date.now()){return typeof t!="number"?!0:e-t<55e3}function DP(t){let e=t.availability;if(!e||typeof e!="object")return null;let r=e;return{stakeholderOf:Array.isArray(r.stakeholderOf)?r.stakeholderOf:[],availableFor:Array.isArray(r.availableFor)?r.availableFor:[],officeHours:Array.isArray(r.officeHours)?r.officeHours:[]}}var _f=class{connected=!1;placeId=null;tenancyId=null;placeConversationId=null;houseRuleHeadlines=null;agentId=null;agentMeta=null;awarenessManager=null;livePageManager=null;livePageManagerFactory=null;workRanker=null;inboxWriter=null;statuslineRenderer=null;bridge=null;currentActivity=null;sessionIntent=null;activeActivities=new Map;lastMessageCursor=null;readCursors=new Map;serverReadCursors=new Map;workspaceInstanceId=null;sponsorTopic=null;watchedPages=new Map;subscribedThreads=new Set;narrowWaitConvId=null;autoConnectSuppressed=!1;autoConnectAmbiguity=null;officeHours=new Map;getReadCursor(e){return e?this.readCursors.get(e)??null:this.lastMessageCursor}setReadCursor(e,r){e?this.readCursors.set(e,r):this.lastMessageCursor=r}watchPage(e,r,i,n){this.watchedPages.set(e,{instanceId:e,title:r,lastKnownUpdatedAt:i??null,lastKnownDocument:n})}subscribeToThread(e){this.subscribedThreads.has(e)||(this.subscribedThreads.add(e),Jt(this))}unsubscribeFromThread(e){let r=this.subscribedThreads.delete(e);return r&&Jt(this),r}setNarrowWait(e){this.narrowWaitConvId!==e&&(this.narrowWaitConvId=e,Jt(this))}trackActivity(e,r){let i=r?.focus!==!1;i&&(this.currentActivity=e),this.activeActivities.set(e.activityId,e),e.conversationId&&this.subscribeToThread(e.conversationId),this.inboxWriter?.notePosition(),Jt(this),i&&this.placeId&&this.awarenessManager?.updateTopicState(this.placeId,{activityId:e.activityId})}clearCurrentActivity(){this.currentActivity=null,this.inboxWriter?.notePosition(),this.placeId&&this.awarenessManager?.updateTopicState(this.placeId,{activityId:null})}setOfficeHours(e){this.officeHours.set(e.pageId,e),this.inboxWriter?.noteSelfChanged?.(),Jt(this)}clearOfficeHours(e){this.officeHours.delete(e)&&(this.inboxWriter?.noteSelfChanged?.(),Jt(this))}clearOfficeHoursForActivity(e){let r=!1;for(let[i,n]of this.officeHours)n.activityId===e&&(this.officeHours.delete(i),r=!0);r&&(this.inboxWriter?.noteSelfChanged?.(),Jt(this))}conversationIdForActivity(e){return(this.activeActivities.get(e)??(this.currentActivity?.activityId===e?this.currentActivity:void 0))?.conversationId||void 0}reset(){this.connected=!1,this.statuslineRenderer?.setPlaceConnected(!1),this.placeId=null,this.tenancyId=null,this.placeConversationId=null,this.houseRuleHeadlines=null,this.agentId=null,this.agentMeta=null,this.awarenessManager=null,this.livePageManager?.closeAll(),this.livePageManager=null,this.bridge?.dispose(),this.bridge=null,this.inboxWriter=null,this.currentActivity=null,this.activeActivities.clear(),this.lastMessageCursor=null,this.readCursors.clear(),this.serverReadCursors.clear(),this.workspaceInstanceId=null,this.sponsorTopic=null,this.watchedPages.clear(),this.subscribedThreads.clear(),this.officeHours.clear(),this.narrowWaitConvId=null}};function wt(t){if(!t.connected||!t.agentMeta||!t.placeId)throw new Error("Not connected. Call 'connect' first to join a place.")}async function Go(t){if(!t.connected||!t.awarenessManager||!t.placeId)return!1;if(t.awarenessManager.connected)return!0;console.error("[gigabuddy] WebSocket dead, attempting reconnect...");let e=await t.awarenessManager.ensureConnected();if(e){console.error("[gigabuddy] WebSocket reconnected, resubscribing...");try{await t.awarenessManager.subscribe(t.placeId),t.agentMeta&&t.awarenessManager.updateTopicState(t.placeId,{displayName:t.agentMeta.displayName,status:"active"})}catch(r){return console.error("[gigabuddy] Resubscribe failed:",r),!1}}return e}var UP=new Map,tZ=5*6e4;async function mi(t,e,r){if(!r||r.startsWith("conv"))return r;if(r.startsWith("activity:")){let i=t.conversationIdForActivity(r);if(i)return i;let n=UP.get(r);if(n)return n;if(t.placeId)try{let o=await e.getActivity(t.placeId,r);if(o.conversationId)return UP.set(r,o.conversationId),o.conversationId}catch{}}return r}async function wf(t,e,r){let{threadKeys:i,afterMessageId:n,timeoutSec:o,format:s}=r,a=r.noun??"reply",c=t.agentId,l=t.placeId;if(i&&i.size===0)return{content:[{type:"text",text:"You aren't subscribed to any threads yet \u2014 reply in a thread, pick up a handover, or pass parentMessageId to wait on a specific one."}]};let u=I=>i===null?!0:!!I.parentMessageId&&i.has(I.parentMessageId),d=I=>I.senderCanonicalId!==c&&(I.contentType??"text")!=="system"&&u(I),p=I=>i===null?void 0:I.parentMessageId,f=(I,se)=>{t.setReadCursor(I,se),t.inboxWriter?.notePosition(),vf(t,e,I,se)},m=async I=>{if(i===null){let se=I??t.getReadCursor(void 0)??void 0;if(!se)return null;let ue=await e.getMessages(l,{after:se,limit:50}),ae=ue.messages.find(d);return ae||(ue.messages.length>0&&f(void 0,ue.messages[ue.messages.length-1].id),null)}for(let se of i){let ue=(i.size===1?I:void 0)??t.getReadCursor(se)??void 0,ae=await e.getReplies(l,se,{after:ue,limit:50}),Me=ae.messages.find(d);if(Me)return Me;ae.messages.length>0&&f(se,ae.messages[ae.messages.length-1].id)}return null},h=await m(n);if(h)return f(p(h),h.id),{content:[{type:"text",text:`${rZ(a)} found:
|
|
110
|
+
|
|
111
|
+
${s(h)}`}]};let y=i&&i.size===1?[...i][0]:void 0;y&&(t.awarenessManager?.updateTopicState(l,{waitingOnThread:{parentMessageId:y,since:Date.now()}}),t.setNarrowWait(y));let _,k=new Promise(I=>_=I),w=!1,$=async()=>{if(!w){w=!0;try{let I=await m();I&&_(I)}catch{}finally{w=!1}}},S=null,G=null,q=[];try{S=setTimeout(()=>_(null),o*1e3);let I=t.awarenessManager;I&&(await Go(t).catch(()=>!1),q.push(I.onPlaceEvent(ue=>{if(ue.type!=="message_created"||(ue.placeId??ue.topic)!==l)return;let ae=ue.message;if(!ae||typeof ae!="object")return;let Me=sf(ae);Me.id&&d(Me)&&_(Me)})),q.push(I.onConnectionChange(ue=>{ue&&$()}))),G=setInterval(()=>void $(),tZ);let se=await k;return se?(f(p(se),se.id),{content:[{type:"text",text:`New message received:
|
|
112
|
+
|
|
113
|
+
${s(se)}`}]}):{content:[{type:"text",text:`No ${a} received within ${o}s timeout.`}]}}finally{S&&clearTimeout(S),G&&clearInterval(G);for(let I of q)I();y&&(t.awarenessManager?.updateTopicState(l,{waitingOnThread:null}),t.setNarrowWait(null))}}function rZ(t){return t.charAt(0).toUpperCase()+t.slice(1)}async function LP(t,e,r,i){let n=new AbortController,o=setTimeout(()=>n.abort(),r*1e3);try{for await(let s of t.streamWork(e,{signal:n.signal})){if(s.event!=="work")continue;let a=i(s.data);if(a)return clearTimeout(o),a}return null}catch(s){if(s instanceof Error&&s.name==="AbortError")return null;throw s}finally{clearTimeout(o)}}var Jo=(t,e=!1)=>({content:[{type:"text",text:t}],...e?{isError:!0}:{}});function T_(t){let e=(t.content??[]).map(r=>r.type==="text"?r.text:"").join(`
|
|
114
|
+
`).trim();try{let r=JSON.parse(e);return typeof r=="object"&&r!==null?r:null}catch{return null}}var Ge=t=>typeof t=="string"&&t?t:void 0;function Ko(t){if(!t.placeId)throw new Error("Not connected to a place. Use the connect tool first.");return t.placeId}async function ZP(t,e){return(await yf(t.client,Ko(t.state),e)).map(i=>({fileId:i.info.fileId,...i.dims?{width:i.dims.width,height:i.dims.height}:{}}))}var nZ=6*60*60*1e3,P_={send_message:{async pre(t,e){let r=Array.isArray(t.attachments)?t.attachments:[],{attachments:i,...n}=t;return{args:{...n,placeId:Ko(e.state),...r.length?{attachments:await ZP(e,r)}:{}}}},async post(t,e,r,i,n){if(!t)return e;let o=Ge(t.messageId),s=Ge(t.threadId);return s&&o&&(n.state.subscribeToThread(s),n.state.setReadCursor(s,o),n.state.inboxWriter?.notePosition()),Jo(Ge(t.message)??`Message sent (${o??"unknown"})`)}},log:{async pre(t,e){let r=Ge(t.activityId)??e.state.currentActivity?.activityId;if(!r)return{refuse:Jo("No active activity. Start one with start_activity, or pass an explicit activityId.",!0)};let i=Array.isArray(t.attachments)?t.attachments:[],{attachments:n,...o}=t;return{args:{...o,activityId:r,placeId:Ko(e.state),...i.length?{attachments:await ZP(e,i)}:{}}}},async post(t,e){return t?Jo(Ge(t.message)??"Logged."):e}},decide:{async pre(t,e){let r=e.state.currentActivity?.activityId,i=await bf(e.state,e.client,{label:Ge(t.title)??"decision"}),n=i.sessionActivityId??e.state.currentActivity?.activityId;return{args:{...t,placeId:Ko(e.state),...r&&!t.activityId?{activityId:r}:{},...i.sessionActivityId&&!t.sessionActivityId?{sessionActivityId:n}:{}}}},async post(t,e){return t?Jo(Ge(t.message)??"Decided."):e}},get_messages:{async pre(t,e){if(Ge(t.messageId))return{args:{messageId:t.messageId,placeId:e.state.placeId},meta:{pointRead:!0}};let r=t.reset===!0,i=Ge(t.before),n=Ge(t.after),o=!!i,s;Ge(t.parentMessageId)&&(s=await mi(e.state,e.client,t.parentMessageId));let a=r?void 0:s?e.state.getReadCursor(s)??void 0:e.state.lastMessageCursor??void 0,c=i??n??a,l=!i&&!n&&a!=null;return{args:{placeId:Ko(e.state),...s?{parentMessageId:s}:{},...t.limit!=null?{limit:t.limit}:{},...i?{before:i}:c?{after:c}:{}},meta:{convId:s,isHistoryRead:o,usedStoredCursor:l,storedCursor:a,limit:t.limit,localParent:Ge(t.parentMessageId)}}},async post(t,e,r,i,n){if(!t||r.pointRead)return t?Jo(Ge(t.message)??""):e;let o=r.convId,s=o?`thread ${r.localParent??o}`:"the place chat",a=t,c;if(r.usedStoredCursor){let d=typeof a.count=="number"?a.count:0,p={placeId:Ko(n.state),...o?{parentMessageId:o}:{}},f=async m=>T_(await n.callDoor({...p,limit:m}));if(d===0){let m=await f(1),h=m&&Ge(m.lastId);if(h&&h!==r.storedCursor){let y=await f(Number(r.limit??50));y&&(a=y,c=`\u26A0 Your saved read position in ${s} (${r.storedCursor}) no longer resolves \u2014 it likely points at a deleted message, so "no new messages" would have been wrong. Reset to the latest window; your actual gap may be larger.`)}}else if(a.hasMore===!0){let m=Ge(a.lastCreatedAt),h=m?Date.now()-new Date(m).getTime():NaN;if(Number.isFinite(h)&&h>nZ){let y=h>=1728e5?`${Math.round(h/864e5)} days`:`${Math.round(h/36e5)}h`,_=Ge(a.firstId)??"(unknown)",k=await f(Number(r.limit??50));if(k){let w=Ge(k.firstId)??"";a=k,c=`\u26A0 Your read position in ${s} was far behind: the next-unread window ended ~${y} ago with more backlog after it. Clamped to the latest ${k.count} message(s); the skipped gap starts at ${_} \u2014 pass before: "${w}" to scroll back into it.`}}}}let l=Ge(a.lastId);!r.isHistoryRead&&l&&(o?(n.state.setReadCursor(o,l),n.state.inboxWriter?.notePosition()):(n.state.lastMessageCursor=l,vf(n.state,n.client,void 0,l)));let u=Ge(a.message)??"";return Jo(c?`${c}
|
|
115
|
+
|
|
116
|
+
${u}`:u)}}};var iZ=["raise","read_work","read_page","search","send_message","get_messages","decide","log"],FP={read_page:"get_page"},qP=new Set(["await_work","wait_for_reply","listen","subscribe","unsubscribe","connect","disconnect","login","session_status","host_status","recovery_status","upload_file","view_file","set_my_status","set_intent"]);function oZ(){let t=process.env.GIGABUDDY_REMOTE_TOOLS;return t!==void 0?t.trim()===""||t.trim()==="none"?new Set:new Set(t.split(",").map(e=>e.trim()).filter(Boolean)):new Set(iZ)}function kc(t){let e={},r=t?.properties??{},i=new Set(t?.required??[]);for(let[n,o]of Object.entries(r)){let s;Array.isArray(o.enum)&&o.enum.length>0?s=F.enum(o.enum):o.anyOf?s=F.string():o.type==="string"?s=F.string():o.type==="number"||o.type==="integer"?s=F.number():o.type==="boolean"?s=F.boolean():o.type==="array"?s=F.array(F.any()):s=F.any(),o.description&&(s=s.describe(o.description)),i.has(n)||(s=s.optional()),e[n]=s}return e}function sZ(t,e){return t.isError?t:{...t,content:[...t.content??[],{type:"text",text:e}]}}var $f=class{constructor(e,r,i,n={}){this.server=e;this.client=r;this.state=i;this.options=n}door=null;flipped=new Set;registeredDoorOnly=new Set;menuStubs=new Set;connected=!1;menuPhaseClient=!1;refreshing=null;activateMenu(){this.connected||(this.ensureDoor(),this.refresh())}activate(){if(this.connected=!0,this.door&&this.menuPhaseClient&&!this.options.doorClient){let e=this.door;this.door=null,this.menuPhaseClient=!1,e.close().catch(()=>{})}this.ensureDoor(),this.refresh()}ensureDoor(){if(!this.door&&this.options.doorClient&&(this.door=this.options.doorClient),!this.door){let e=this.options.doorUrl??process.env.GIGABUDDY_DOOR_URL??"https://mcp.gigabuddy.com";this.door=new tf({url:e,getToken:()=>this.client.currentToken(),clientInfo:{name:"gigabuddy-agent",version:this.options.version??"0.0.0"},onToolsChanged:()=>void this.refresh()}),this.menuPhaseClient=!this.connected}}async close(){let e=this.door;this.door=null,e&&await e.close().catch(()=>{})}async refresh(){return this.refreshing?this.refreshing:(this.refreshing=this.doRefresh().finally(()=>{this.refreshing=null}),this.refreshing)}async doRefresh(){let e=this.door;if(!e)return;let r;try{r=(await e.listTools()).tools}catch(o){console.error(`[gigabuddy] door proxy: tools/list failed (${o instanceof Error?o.message:o}) \u2014 local only`);return}let i=oZ(),n=this.server._registeredTools;if(!this.connected){for(let o of r){let s=FP[o.name];s&&n[s]||n[o.name]||(this.server.tool(o.name,o.description??"",kc(o.inputSchema),this.menuStubCallback()),this.menuStubs.add(o.name))}this.menuStubs.size>0&&console.error(`[${Be().serverName}] door proxy: ${this.menuStubs.size} door tool(s) on the menu (connect to use them)`);return}for(let o of[...this.menuStubs])r.some(s=>s.name===o)||(n[o]?.remove(),this.menuStubs.delete(o),console.error(`[${Be().serverName}] door proxy: menu tool '${o}' not served to this session \u2014 removed`));for(let o of r){if(this.menuStubs.has(o.name)){n[o.name]?.update({description:o.description,paramsSchema:kc(o.inputSchema),callback:this.doorCallback(o.name,null)}),this.menuStubs.delete(o.name),this.registeredDoorOnly.add(o.name);continue}let s=FP[o.name];if(s&&n[s]){let c=n[s];if(i.has(o.name)&&!qP.has(s)&&!this.flipped.has(o.name)){let l=c.handler;c.update({description:o.description,paramsSchema:kc(o.inputSchema),callback:this.doorCallback(o.name,l)}),this.flipped.add(o.name),console.error(`[gigabuddy] door proxy: '${s}' now remote-preferred via door '${o.name}' (local fallback armed)`)}continue}let a=n[o.name];if(a&&i.has(o.name)&&!qP.has(o.name)&&!this.flipped.has(o.name)){if(P_[o.name]){let u=a.handler;a.update({callback:this.wrappedCallback(o.name,u)}),this.flipped.add(o.name),console.error(`[${Be().serverName}] door proxy: '${o.name}' now remote-preferred (wrapped; local fallback armed)`);continue}let l=a.handler;a.update({description:o.description,paramsSchema:kc(o.inputSchema),callback:this.doorCallback(o.name,l)}),this.flipped.add(o.name),console.error(`[gigabuddy] door proxy: '${o.name}' now remote-preferred (local fallback armed)`);continue}!a&&!this.registeredDoorOnly.has(o.name)&&(this.server.tool(o.name,o.description??"",kc(o.inputSchema),this.doorCallback(o.name,null)),this.registeredDoorOnly.add(o.name),console.error(`[gigabuddy] door proxy: registered door tool '${o.name}'`))}}wrappedCallback(e,r){return async(i,n)=>{let o=this.door;if(!o)return r(i,n);let s=P_[e],a={client:this.client,state:this.state,callDoor:l=>o.callTool(e,l)},c;try{c=await s.pre(i,a)}catch(l){return{content:[{type:"text",text:`Failed to ${e.replace(/_/g," ")}: ${l instanceof Error?l.message:String(l)}`}],isError:!0}}if("refuse"in c)return c.refuse;try{let l=await o.callTool(e,c.args);return l.isError||!s.post?l:await s.post(T_(l),l,c.meta??{},i,a)}catch(l){return console.error(`[${Be().serverName}] door proxy: '${e}' remote call failed (${l instanceof Error?l.message:l}) \u2014 falling back to local`),r(i,n)}}}menuStubCallback(){return async()=>({content:[{type:"text",text:"Not connected to a room yet \u2014 this tool runs once you are. Call `connect` to join a room (`list_places` shows what you can reach); a room this repo has used before joins automatically on your next prompt. Then retry this call."}],isError:!0})}trackSessionFocus(e,r){if(!r.isError&&!(e!=="start_activity"&&e!=="pickup_work"&&e!=="pickup_handover"&&e!=="complete_activity"))try{let i=(r.content??[]).map(c=>c.type==="text"?c.text:"").join(`
|
|
117
|
+
`),n=/\b(activity:[A-Za-z0-9_-]+)/.exec(i)?.[1];if(!n)return;if(e==="complete_activity"){this.state.currentActivity?.activityId===n&&this.state.clearCurrentActivity(),this.state.clearOfficeHoursForActivity(n);return}let o=/\b(conv_[A-Za-z0-9_-]+)/.exec(i)?.[1]??"",s=/"([^"\n]+)"/.exec(i)?.[1]??n,a=e==="start_activity"&&/STAGED SESSION/.test(i);this.state.trackActivity({activityId:n,conversationId:o,label:s,...a?{session:{mode:"staged"}}:{}})}catch{}}async stampSession(e,r){if(e!=="raise"&&e!=="create_page"&&e!=="decide")return{args:r};if(r.sessionActivityId)return{args:r};try{let i=typeof r.title=="string"?r.title:e,n=await bf(this.state,this.client,{label:i});return n.sessionActivityId?{args:{...r,sessionActivityId:n.sessionActivityId},...n.minted&&n.note?{note:n.note}:{}}:{args:r,...n.note?{note:n.note}:{}}}catch{return{args:r}}}doorCallback(e,r){return async(i,n)=>{let o=this.door;if(o)try{let s=await this.stampSession(e,i),a=await o.callTool(e,s.args);return this.trackSessionFocus(e,a),s.note?sZ(a,s.note):a}catch(s){console.error(`[gigabuddy] door proxy: '${e}' remote call failed (${s instanceof Error?s.message:s})`+(r?" \u2014 falling back to local":""))}return r?r(i,n):{content:[{type:"text",text:`The '${e}' tool is served by the Gigabuddy door and it could not be reached. Try again shortly.`}],isError:!0}}}};import{readdir as wZ,readFile as $Z,stat as JP,unlink as O_,writeFile as kZ}from"node:fs/promises";import{join as Sc}from"node:path";import{execFile as aZ}from"node:child_process";import{readdir as cZ,readFile as VP}from"node:fs/promises";import{homedir as lZ}from"node:os";import{join as xf}from"node:path";var kf=xf(lZ(),".claude","sessions");async function xc(t){try{let e=await cZ(kf),r=null;for(let i of e)if(i.endsWith(".json"))try{let n=await VP(xf(kf,i),"utf-8"),o=JSON.parse(n);if(o.sessionId!==t||!o.name)continue;let s=o.updatedAt??0;(!r||s>r.updatedAt)&&(r={name:o.name,updatedAt:s})}catch{}return r?.name??null}catch{return null}}function HP(t){return xf(kf,`${t}.json`)}async function z_(t){try{let e=await VP(xf(kf,`${t}.json`),"utf-8"),r=JSON.parse(e);return r.sessionId?{claudePid:t,sessionId:r.sessionId,name:r.name}:null}catch{return null}}function uZ(t){return new Promise(e=>{aZ("ps",["-o","ppid=","-p",String(t)],{timeout:2e3},(r,i)=>{if(r)return e(null);let n=Number.parseInt(i.trim(),10);e(Number.isFinite(n)&&n>1?n:null)})})}async function Yo(t=8){let e=process.ppid;for(let r=0;r<t&&e&&e>1;r++){let i=await z_(e);if(i)return i;e=await uZ(e)}return null}import{existsSync as dZ,readFileSync as pZ,statSync as fZ}from"node:fs";import{access as mZ,mkdir as BP,readdir as C_,rm as hZ,stat as A_,unlink as WP,writeFile as gZ}from"node:fs/promises";import{dirname as yZ,join as An,sep as R_}from"node:path";function vZ(t){let e=t;for(;;){let r=An(e,".git");if(dZ(r))try{if(fZ(r).isDirectory())return e;let n=/^gitdir:\s*(.+)$/m.exec(pZ(r,"utf-8")),o=`${R_}.git${R_}worktrees${R_}`,s=n?.[1]?n[1].indexOf(o):-1;return s===-1?e:n[1].slice(0,s)}catch{return e}let i=yZ(e);if(i===e)return null;e=i}}function bZ(t=process.cwd()){let{scratchEnvVar:e,scratchDirName:r}=Be(),i=process.env[e];return i||An(vZ(t)??t,r)}var Sf=null;function Et(){let t=of();return(!Sf||Sf.brand!==t)&&(Sf={brand:t,dir:bZ()}),Sf.dir}function ur(){return An(Et(),"sessions")}function Ye(t){return An(ur(),t)}async function Br(t){await E_();let e=Ye(t);return await BP(e,{recursive:!0}),e}async function E_(t=Et()){await BP(t,{recursive:!0});let e=An(t,".gitignore");try{await mZ(e)}catch{await gZ(e,`*
|
|
118
|
+
`)}}var _Z=3*24*60*60*1e3;async function GP(t){let e=Date.now(),r=0,i=o=>e-o>_Z;await(async o=>{let s;try{s=await C_(o)}catch{return}for(let a of s){if(a===".gitignore"||a==="sessions"||t&&a.includes(t))continue;let c=An(o,a);try{let l=await A_(c);if(l.isDirectory())continue;i(l.mtimeMs)&&(await WP(c),r++)}catch{}}})(Et());try{let o=await C_(ur());for(let s of o){if(t&&s.includes(t))continue;let a=An(ur(),s);try{let c=await A_(a);if(!c.isDirectory()){i(c.mtimeMs)&&(await WP(a),r++);continue}let l=await C_(a),u=c.mtimeMs;for(let d of l)try{let p=await A_(An(a,d));p.mtimeMs>u&&(u=p.mtimeMs)}catch{}i(u)&&(await hZ(a,{recursive:!0,force:!0}),r++)}catch{}}}catch{}return r}var If=class{clientLabel="claude-code";defaultDisplayName="Claude Code Agent";async resolveSession(){let e=await Yo().catch(()=>null);return e?(this.lastPid=e.claudePid,{sessionId:`cc_${e.sessionId}`,hostSessionId:e.sessionId}):null}lastPid=null;async readSessionName(e){return e.hostSessionId?xc(e.hostSessionId):null}statuslineRef(e){return this.lastPid!==null&&e.hostSessionId?{kind:"claude",pid:this.lastPid,sessionId:e.hostSessionId}:{kind:"external",sessionId:e.sessionId}}async consumeConnectTrigger(e){if(!e.hostSessionId)return!1;let r=Sc(Ye(e.sessionId),"pending-connect.json");try{await JP(r)}catch{return!1}return await O_(r).catch(()=>{}),!0}async markConnected(e){e.hostSessionId&&(await Br(e.sessionId).catch(()=>{}),await kZ(Sc(Ye(e.sessionId),"active"),e.sessionId).catch(()=>{}),await O_(Sc(Ye(e.sessionId),"pending-connect.json")).catch(()=>{}))}async fallbackSession(){try{let e=await wZ(ur()),r=[];for(let i of e)try{let n=await $Z(Sc(ur(),i,"pending-connect.json"),"utf-8"),o=JSON.parse(n);o.claudeSessionId&&r.push(o.claudeSessionId)}catch{}if(r.length===1&&r[0])return{sessionId:`cc_${r[0]}`,hostSessionId:r[0]}}catch{}return null}},Tf=class{constructor(e,r="external"){this.sessionId=e;this.clientLabel=r}clientLabel;defaultDisplayName="Agent";async resolveSession(){return{sessionId:this.sessionId}}async readSessionName(){return null}statuslineRef(e){return{kind:"external",sessionId:e.sessionId}}async consumeConnectTrigger(e){let r=Sc(Ye(e.sessionId),"pending-connect.json");try{await JP(r)}catch{return!1}return await O_(r).catch(()=>{}),!0}async markConnected(){}async fallbackSession(){return null}};import{watch as Tc}from"node:fs";import{mkdir as _6,readFile as V_,rename as w6,stat as wz,unlink as vz,writeFile as $6}from"node:fs/promises";import{basename as bz,dirname as k6,isAbsolute as x6,join as yi,resolve as _z}from"node:path";import{open as xZ,readFile as YP,readdir as SZ,rename as IZ,stat as TZ,writeFile as PZ}from"node:fs/promises";import{homedir as zZ}from"node:os";import{join as Pf}from"node:path";var KP=Pf(zZ(),".claude","projects"),CZ=2e5,AZ=1e6,RZ=.85,XP=512*1024;function hi(){return process.env.CLAUDE_CODE_SESSION_ID||void 0}async function zf(t){let e;try{e=await SZ(KP)}catch{return null}let r=null;for(let i of e){let n=Pf(KP,i,`${t}.jsonl`);try{let o=await TZ(n);if(!o.isFile())continue;(!r||o.mtimeMs>r.mtime)&&(r={path:n,mtime:o.mtimeMs})}catch{}}return r?.path??null}async function QP(t,e){let r=await xZ(t,"r");try{let{size:i}=await r.stat(),n=Math.max(0,i-e),o=i-n,s=Buffer.alloc(o);return await r.read(s,0,o,n),s.toString("utf-8")}finally{await r.close()}}function EZ(t){let e=t.split(`
|
|
119
|
+
`);for(let r=e.length-1;r>=0;r--){let i=e[r]?.trim();if(!(!i||!i.includes('"usage"')))try{let n=JSON.parse(i),o=n.message?.usage;if(!o)continue;if((o.input_tokens??0)+(o.cache_read_input_tokens??0)+(o.cache_creation_input_tokens??0)>0)return n}catch{}}return null}function N_(t){return Pf(Ye(t),"window.json")}async function ez(t,e,r){await Br(t);let i={model:r??null,contextWindow:e,savedAt:new Date().toISOString()},n=N_(t)+".tmp";await PZ(n,JSON.stringify(i,null,2)),await IZ(n,N_(t))}async function OZ(t){try{let e=await YP(N_(t),"utf-8"),r=JSON.parse(e);return typeof r.contextWindow=="number"&&r.contextWindow>0?r:null}catch{return null}}function NZ(t){return Pf(Ye(`cc_${t}`),"ctxwin.txt")}async function MZ(t){try{let e=await YP(NZ(t),"utf-8"),[r,i]=e.trim().split(/\s+/);if(r!=="v1")return null;let n=Number.parseInt(i??"",10);return Number.isFinite(n)&&n>0?n:null}catch{return null}}function jZ(){let t=process.env.GIGABUDDY_CONTEXT_WINDOW;if(!t)return null;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:null}function DZ(){let t=process.env.GIGABUDDY_COMPACTION_FRACTION;if(t){let e=Number.parseFloat(t);if(Number.isFinite(e)&&e>0&&e<=1)return e}return RZ}function UZ(t,e,r){let i=jZ();return i?{window:i,source:"env"}:r&&r>0&&t<=r?{window:r,source:"harness"}:e&&e>0&&t<=e?{window:e,source:"recorded"}:t>CZ?{window:AZ,source:"observed"}:{window:null,source:"unknown"}}function LZ(t,e,r,i){let n=e.message?.usage??{},o=(n.input_tokens??0)+(n.cache_read_input_tokens??0)+(n.cache_creation_input_tokens??0),{window:s,source:a}=UZ(o,r,i);if(s==null)return{sessionId:t,model:e.message?.model??null,usedTokens:o,windowTokens:null,windowSource:a,pct:null,compactionTokens:null,pctOfCompaction:null,shouldHandoff:!1};let c=Math.round(s*DZ());return{sessionId:t,model:e.message?.model??null,usedTokens:o,windowTokens:s,windowSource:a,pct:Math.min(100,Math.round(o/s*1e3)/10),compactionTokens:c,pctOfCompaction:Math.round(o/c*1e3)/10,shouldHandoff:o>=c}}async function Gr(t){let e=t||hi();if(!e)return null;try{let r=await zf(e);if(!r)return null;let i=await QP(r,XP),n=EZ(i);if(!n)return null;let[o,s]=await Promise.all([OZ(e),MZ(e)]);return LZ(e,n,o?.contextWindow??null,s)}catch{return null}}function ZZ(t){let e=t.split(`
|
|
120
|
+
`);for(let r=e.length-1;r>=0;r--){let i=e[r]?.trim();if(!(!i||!i.includes('"cwd"')))try{let n=JSON.parse(i).cwd;if(typeof n=="string"&&n)return n}catch{}}return null}async function tz(t){let e=t||hi();if(!e)return null;try{let r=await zf(e);return r?ZZ(await QP(r,XP)):null}catch{return null}}function rz(t){let e=n=>`${Math.round(n/1e3)}k`;if(t.windowTokens==null||t.pct==null)return`Context: ~${e(t.usedTokens)} tokens used (window unknown \u2014 declare it with session_status contextWindow=<200000|1000000> to show %)`;let r=t.windowSource==="observed"?" (1M, inferred from observed usage)":t.windowSource==="env"?" (from GIGABUDDY_CONTEXT_WINDOW)":t.windowSource==="recorded"?" (declared)":"",i=t.shouldHandoff?" \u26A0 at compaction threshold \u2014 hand off":"";return`Context: ${t.pct}% of ${e(t.windowTokens)} window${r} \u2014 ${e(t.usedTokens)} used, compaction ~${e(t.compactionTokens??0)} (${t.pctOfCompaction}% there)${i}`}import{randomUUID as t6}from"node:crypto";import{watch as r6}from"node:fs";import{mkdir as n6,readFile as Af,rename as fz,stat as i6,unlink as o6,writeFile as L_}from"node:fs/promises";import{tmpdir as s6}from"node:os";import{join as Qo}from"node:path";import{execFile as FZ}from"node:child_process";import{readFile as gi,readdir as qZ}from"node:fs/promises";import{homedir as VZ,hostname as HZ}from"node:os";import{join as oz}from"node:path";var nz=oz(VZ(),".claude","sessions"),WZ=1024*1024;function iz(t){return Math.round(t/WZ)}function BZ(t){let e=new Map;for(let r of t.split(`
|
|
121
|
+
`)){let i=/^(\w+):\s+(\d+)\s*kB/.exec(r);i&&e.set(i[1],Number(i[2]))}return e}async function Ic(t){try{return(await gi(t,"utf-8")).split(`
|
|
122
|
+
`)[0].trim()}catch{return null}}async function GZ(){let t=await Ic("/sys/fs/cgroup/memory.max");if(t!==null){let r=await Ic("/sys/fs/cgroup/memory.current"),i=t==="max"?null:Number(t);return{limit:Number.isFinite(i)?i:null,current:r!=null&&Number.isFinite(Number(r))?Number(r):null}}let e=await Ic("/sys/fs/cgroup/memory/memory.limit_in_bytes");if(e!==null){let r=await Ic("/sys/fs/cgroup/memory/memory.usage_in_bytes"),i=Number(e);return{limit:!Number.isFinite(i)||i>1<<62||i>=Number.MAX_SAFE_INTEGER?null:i,current:r!=null&&Number.isFinite(Number(r))?Number(r):null}}return null}function JZ(t,e,r,i,n=null,o=null){let s=r!=null&&i!=null&&i>0&&r<256,a=t!=null&&t<512,c=e!=null&&e>=95,l=n!=null&&n>=15;if(a||c||l)return"critical";let u=e!=null&&e>=85,d=o!=null&&o>=10,p=s&&t!=null&&t<2048;return u||d||p?"warn":"ok"}var sz=100;function M_(t,e){let r=t.split(`
|
|
123
|
+
`).find(a=>a.startsWith(e));if(!r)return null;let i=a=>{let c=new RegExp(`${a}=([0-9.]+)`).exec(r);return c?Number(c[1]):NaN},n=i("avg10"),o=i("avg60"),s=i("avg300");return[n,o,s].every(Number.isFinite)?{avg10:n,avg60:o,avg300:s}:null}async function KZ(){for(let t of["/sys/fs/cgroup/cpu.pressure","/proc/pressure/cpu"]){let e=await gi(t,"utf-8").catch(()=>null);if(!e)continue;let r=M_(e,"some ");if(r)return r}return null}async function YZ(){for(let t of["/sys/fs/cgroup/memory.pressure","/proc/pressure/memory"]){let e=await gi(t,"utf-8").catch(()=>null);if(!e)continue;let r=M_(e,"some "),i=M_(e,"full ");if(r&&i)return{someAvg60:r.avg60,fullAvg10:i.avg10,fullAvg60:i.avg60}}return null}function XZ(t,e){return t!=null?t>=50?{pressure:"critical",source:"psi"}:t>=20?{pressure:"warn",source:"psi"}:{pressure:"ok",source:"psi"}:e!=null?e>=4?{pressure:"critical",source:"load"}:e>=1.5?{pressure:"warn",source:"load"}:{pressure:"ok",source:"load"}:{pressure:"ok",source:"unknown"}}var az=sz;async function Cf(t){let e=await gi(`/proc/${t}/stat`,"utf-8").catch(()=>null);if(!e)return null;let r=e.slice(e.lastIndexOf(")")+2).split(" "),i=Number(r[11]),n=Number(r[12]);return!Number.isFinite(i)||!Number.isFinite(n)?null:i+n}async function cz(t,e=500){let r=new Map;if(process.platform!=="linux"||t.length===0)return r;let i=Date.now(),n=new Map;for(let s of t){let a=await Cf(s);a!=null&&n.set(s,a)}await new Promise(s=>setTimeout(s,e));let o=(Date.now()-i)/1e3;for(let s of t){let a=n.get(s),c=await Cf(s);if(a==null||c==null)continue;let l=(c-a)/sz/o;r.set(s,Math.max(0,Math.round(l*100)/100))}return r}async function Xo(){if(process.platform!=="linux")return null;let t=await gi("/proc/meminfo","utf-8").catch(()=>null);if(!t)return null;let e=BZ(t),r=e.get("MemTotal")??null,i=e.get("MemAvailable")??null,n=e.get("SwapTotal")??null,o=e.get("SwapFree")??null,s=await GZ(),a=r!=null?Math.round(r/1024):null,c=s?.limit!=null?iz(s.limit):null,l="unknown",u=null;c!=null&&(a==null||c<a)?(u=c,l="cgroup"):a!=null&&(u=a,l="host");let d=null,p=null;l==="cgroup"&&s?.current!=null&&u!=null?(d=iz(s.current),p=Math.max(0,u-d)):a!=null&&i!=null&&(p=Math.round(i/1024),d=Math.max(0,a-p));let f=u&&d!=null?Math.round(d/u*100):null,m=n!=null?Math.round(n/1024):null,h=o!=null?Math.round(o/1024):null,y=m!=null&&h!=null?m-h:null,_=m&&y!=null?Math.round(y/m*100):null,k=await Ic("/proc/loadavg"),w=k?k.split(/\s+/).map(Number):[],$=ie=>Number.isFinite(w[ie])?w[ie]:null,S=$(0),G=$(1),q=$(2),I=null;try{let{availableParallelism:ie}=await import("node:os");I=ie()}catch{I=null}let se=S!=null&&I?Math.round(S/I*100)/100:null,ue=q!=null&&I?q/I:null,ae=await KZ(),Me=XZ(ae?.avg60??null,ue),je=await YZ();return{memLimitMb:u,memUsedMb:d,memAvailMb:p,memPct:f,swapTotalMb:m,swapUsedMb:y,swapFreeMb:h,swapPct:_,load1:S,load5:G,load15:q,nproc:I,loadPerCore:se,cpuSomeAvg10:ae?.avg10??null,cpuSomeAvg60:ae?.avg60??null,cpuSomeAvg300:ae?.avg300??null,memPsiSomeAvg60:je?.someAvg60??null,memPsiFullAvg10:je?.fullAvg10??null,memPsiFullAvg60:je?.fullAvg60??null,cpuPressure:Me.pressure,cpuPressureSource:Me.source,limitSource:l,pressure:JZ(p,f,h,_,je?.fullAvg10??null,je?.someAvg60??null)}}function U_(t){return new Promise(e=>{FZ("ps",["-o","rss=","-p",String(t)],{timeout:2e3},(r,i)=>{if(r)return e(null);let n=Number.parseInt(i.trim(),10);e(Number.isFinite(n)?Math.round(n/1024):null)})})}async function lz(){let t;try{t=await qZ(nz)}catch{return[]}let e=[];for(let r of t){if(!r.endsWith(".json"))continue;let i=Number.parseInt(r.replace(/\.json$/,""),10);if(!Number.isFinite(i))continue;let n={};try{n=JSON.parse(await gi(oz(nz,r),"utf-8"))}catch{}let o=await U_(i);e.push({pid:i,sessionId:n.sessionId??null,name:n.name??null,cwd:n.cwd??null,status:n.status??null,rssMb:o,cpuCores:null,dead:o==null})}return e.sort((r,i)=>(i.rssMb??-1)-(r.rssMb??-1)),e}async function QZ(){if(process.env.REMOTE_CONTAINERS||process.env.CODESPACES||process.env.DEVCONTAINER)return!0;try{return await gi("/.dockerenv"),!0}catch{return!1}}async function uz(t){return{machineId:t,hostname:HZ(),container:await QZ()}}var j_={ok:"\u{1F7E2}",warn:"\u{1F7E1}",critical:"\u{1F534}"};function Rn(t){return t==null?"?":`${(t/1024).toFixed(1)}Gi`}function D_(t){return t.swapFreeMb!=null&&t.swapPct!=null&&t.swapPct>0&&t.swapFreeMb<256}function e6(t){let e=`mem ${t.memPct??"?"}% (${Rn(t.memAvailMb)} free)`,r=D_(t)?", swap exhausted":"",i=t.memPsiSomeAvg60!=null&&t.memPsiSomeAvg60>=1?`, mem-stall ${t.memPsiSomeAvg60}%`:"",n=t.loadPerCore!=null?`, load ${t.loadPerCore}\xD7/core`:"",o=t.cpuPressure!=="ok"?` \xB7 cpu ${j_[t.cpuPressure]}`:"";return`${j_[t.pressure]} ${t.pressure.toUpperCase()} \u2014 ${e}${r}${i}${n}${o}`}function dz(t){let e=[`Host: ${e6(t)}`],r=t.limitSource==="cgroup"?"cgroup cap":t.limitSource==="host"?"host RAM":"unknown";if(e.push(` memory: ${Rn(t.memUsedMb)} / ${Rn(t.memLimitMb)} (${r}), ${Rn(t.memAvailMb)} free`),t.swapTotalMb){let o=D_(t)?t.memAvailMb!=null&&t.memAvailMb<2048?" \u2014 exhausted, no OOM buffer left":" \u2014 exhausted (cold residue; harmless while RAM is free)":"";e.push(` swap: ${Rn(t.swapUsedMb)} / ${Rn(t.swapTotalMb)} used (${Rn(t.swapFreeMb)} free)${o}`)}t.memPsiSomeAvg60!=null&&e.push(` mem-psi: some ${t.memPsiSomeAvg60}%/60s \xB7 full ${t.memPsiFullAvg10??"?"}%/10s \xB7 ${t.memPsiFullAvg60??"?"}%/60s (time stalled on memory; 0 = healthy)`);let i=t.load1!=null?`${t.load1}/${t.load5??"?"}/${t.load15??"?"} (1/5/15m)`:"?",n=t.cpuSomeAvg60!=null?`, PSI stall ${t.cpuSomeAvg60}%/60s \xB7 ${t.cpuSomeAvg300??"?"}%/5m`:"";return e.push(` cpu: ${j_[t.cpuPressure]} load ${i} on ${t.nproc??"?"} cores${n}`),t.pressure==="critical"?e.push(" \u26A0 near OOM \u2014 the kernel will kill the largest process. Free memory now (close idle sessions)."):t.pressure==="warn"&&e.push(D_(t)&&t.memPsiSomeAvg60!=null&&t.memPsiSomeAvg60<10&&(t.memPct??0)<85?" \u26A0 swap exhausted with headroom thinning \u2014 the next memory spike OOMs directly. Shed idle sessions.":" \u26A0 memory headroom thin \u2014 shed idle sessions before it tips into critical."),t.cpuPressure==="critical"?e.push(" \u26A0 CPU sustained-contended \u2014 everyone on this box is being slowed. Find the hog below."):t.cpuPressure==="warn"&&e.push(" \u26A0 CPU contention building (sustained, not a spike) \u2014 watch the heaviest session below."),e.join(`
|
|
124
|
+
`)}function pz(t,e){if(t.length===0)return"No Claude sessions registered on this host.";let r=t.filter(o=>!o.dead),i=r.reduce((o,s)=>o+(s.rssMb??0),0),n=[`${r.length} Claude session(s) on this host, ~${Rn(i)} total:`];for(let o of t){let s=o.pid===e?" \u2190 you":"";if(o.dead){n.push(` pid ${o.pid} [dead/stale registry entry] ${o.name??o.sessionId??""}`.trimEnd());continue}let a=o.name??o.sessionId?.slice(0,8)??"(unnamed)",c=o.status?` ${o.status}`:"",l=o.cwd?` ${o.cwd.split("/").pop()}`:"",u=o.cpuCores!=null?` ${o.cpuCores>=1?"\u{1F525}":""}${o.cpuCores.toFixed(1)}c`.padStart(8):"";n.push(` ${String(o.rssMb).padStart(5)}MB${u} pid ${o.pid} ${a}${c}${l}${s}`)}return n.join(`
|
|
125
|
+
`)}var a6=1e4,c6=45e3,l6=2e4,u6=250,Z_="host-status.json",F_="lease";function d6(t){let e=null;if(t.pressure!=="ok"){let n=t.pressure==="critical"?"\u{1F534}":"\u{1F7E1}",o=t.memAvailMb!=null&&t.memAvailMb<512||t.memPct!=null&&t.memPct>=95,s=t.memPct!=null&&t.memPct>=85,a=t.pressure==="critical"?o:s,c=t.pressure==="critical"?t.memPsiFullAvg10:t.memPsiSomeAvg60,l=t.pressure==="critical"?(c??0)>=15:(c??0)>=10;e=a?`${n} mem ${t.memPct??"?"}%`:l?`${n} mem-stall ${Math.round(c??0)}%`:`${n} swap exhausted`}let r=null;if(t.cpuPressure!=="ok"){let n=t.cpuPressure==="critical"?"\u{1F534}":"\u{1F7E1}";t.cpuPressureSource==="psi"&&t.cpuSomeAvg60!=null?r=`${n} cpu ${Math.round(t.cpuSomeAvg60)}%`:t.load15!=null&&t.nproc?r=`${n} cpu ${(t.load15/t.nproc).toFixed(1)}\xD7`:r=`${n} cpu`}let i=t.memPct!=null?`\u{1F7E2} mem ${t.memPct}%`:null;return{memSeg:e,cpuSeg:r,okSeg:i}}async function p6(){try{let e=(await Af("/proc/sys/kernel/random/boot_id","utf-8")).trim().replace(/[^a-f0-9-]/gi,"").slice(0,8);if(e)return e}catch{}return"local"}async function f6(){return Qo(s6(),`${Be().hostDirPrefix}${await p6()}`)}var Rf=class{constructor(e){this.onChange=e}token=`${process.pid}-${t6().slice(0,8)}`;dir=null;watcher=null;watchDebounce=null;takeoverTimer=null;sampleTimer=null;isLeader=!1;lastWritten=null;stopped=!1;async start(){this.dir=await f6();try{await n6(this.dir,{recursive:!0})}catch{return}await this.readAndEmit();try{this.watcher=r6(this.dir,{persistent:!1},(e,r)=>{r===Z_&&(this.watchDebounce&&clearTimeout(this.watchDebounce),this.watchDebounce=setTimeout(()=>{this.watchDebounce=null,this.readAndEmit()},u6),this.watchDebounce.unref?.())})}catch{}await this.maybeTakeOver(),this.takeoverTimer=setInterval(()=>void this.maybeTakeOver(),l6),this.takeoverTimer.unref?.()}stop(){this.stopped=!0,this.watcher?.close(),this.watcher=null,this.watchDebounce&&clearTimeout(this.watchDebounce),this.takeoverTimer&&clearInterval(this.takeoverTimer),this.sampleTimer&&clearInterval(this.sampleTimer),this.takeoverTimer=null,this.sampleTimer=null,this.isLeader&&this.dir&&(o6(Qo(this.dir,F_)).catch(()=>{}),this.isLeader=!1)}async readAndEmit(){if(this.dir)try{let e=await Af(Qo(this.dir,Z_),"utf-8"),r=JSON.parse(e);this.onChange({memSeg:r.memSeg??null,cpuSeg:r.cpuSeg??null,okSeg:r.okSeg??null})}catch{this.onChange(null)}}async maybeTakeOver(){if(!this.dir||this.stopped)return;let e=Qo(this.dir,F_);if(this.isLeader){let r=await Af(e,"utf-8").catch(()=>null);r!==null&&r.trim()!==this.token&&this.demote();return}try{let r=await i6(e);if(Date.now()-r.mtimeMs<c6)return}catch{}try{let r=`${e}.claim-${this.token}`;await L_(r,this.token),await fz(r,e),(await Af(e,"utf-8")).trim()===this.token&&this.promote()}catch{}}promote(){this.isLeader||this.stopped||(this.isLeader=!0,this.sample(),this.sampleTimer=setInterval(()=>void this.sample(),a6),this.sampleTimer.unref?.())}demote(){this.isLeader=!1,this.sampleTimer&&clearInterval(this.sampleTimer),this.sampleTimer=null}async sample(){if(!this.dir||!this.isLeader)return;await L_(Qo(this.dir,F_),this.token).catch(()=>{});let e=await Xo(),i={...e?d6(e):{memSeg:null,cpuSeg:null,okSeg:null},at:Math.floor(Date.now()/1e3)},n=JSON.stringify({memSeg:i.memSeg,cpuSeg:i.cpuSeg,okSeg:i.okSeg});if(n===this.lastWritten)return;this.lastWritten=n;let o=Qo(this.dir,Z_),s=`${o}.tmp-${this.token}`;try{await L_(s,JSON.stringify(i)),await fz(s,o)}catch{this.lastWritten=null}}};function gz(){return{displayName:null,signedIn:!0,connected:!1,placeName:null,pendingPlaceName:null,wsDown:!1,peers:[],worktreeId:null,contextTokensK:null,contextWindowK:null,shouldHandoff:!1,host:null,hostMode:"warn",lastTurnEpoch:null,coldSecs:3600,officeHours:[],conflictFile:null,messageCount:0,repo:null,branch:null,activityLabel:null}}var m6=28,h6=36,q_=14;function mz(t,e){return t.length>e?t.slice(0,e-1)+"\u2026":t}function hz(t){if(t.length<=q_)return t;let e=t.slice(0,q_-1),r=e.lastIndexOf(" ");return(r>=q_/2?e.slice(0,r):e)+"\u2026"}function g6(t){if(t.contextTokensK==null)return null;let e=`\u{1F9E0} ${t.contextTokensK}k`;return t.contextWindowK!=null&&t.contextWindowK>0&&(e+=t.contextWindowK>=1e3?`/${Math.round(t.contextWindowK/1e3)}m`:`/${t.contextWindowK}k`,t.shouldHandoff&&(e+=" \u26A0")),e}function y6(t){if(t.hostMode==="off"||!t.host)return null;let e=[];return t.host.memSeg?e.push(t.host.memSeg):t.hostMode==="always"&&t.host.okSeg&&e.push(t.host.okSeg),t.host.cpuSeg&&e.push(t.host.cpuSeg),e.length>0?e.join(" \xB7 "):null}function v6(t,e){let r=t.filter(n=>n.role==="origin"&&n.until!=null&&Date.parse(n.until)/1e3>e).sort((n,o)=>Date.parse(n.until)-Date.parse(o.until));if(r.length>0){let n=r.length>1?` (+${r.length-1})`:"";return{seg:`\u{1F91D} /pickup ${r[0].pageId} \xB7 {{OHMIN}}m left${n}`,untilEpoch:Math.floor(Date.parse(r[0].until)/1e3)}}let i=t.filter(n=>n.role==="picker");if(i.length>0){let n=i.length>1?` (+${i.length-1})`:"";return{seg:`\u{1F91D} working ${i[0].pageId}${n}`,untilEpoch:0}}return{seg:null,untilEpoch:0}}function b6(t){if(!t.worktreeId)return null;let e=t.peers.filter(i=>i.worktreeId===t.worktreeId).map(i=>i.displayName);return e.length===0?null:`\u26A0 same checkout as ${e.length>2?`${e.slice(0,2).join(", ")} (+${e.length-2} more)`:e.join(", ")}`}function yz(t,e){let r=t.connected?v6(t.officeHours,e):{seg:null,untilEpoch:0},i;t.connected?i=`\u{1F344} ${t.displayName??"agent"}${t.placeName?` @ ${hz(t.placeName)}`:""}`:t.signedIn?t.pendingPlaceName?i=`\u{1F344} ${t.displayName?`${t.displayName} \xB7 `:""}\u23F8 joins ${hz(t.pendingPlaceName)} on first message`:i=t.displayName?`\u{1F344} ${t.displayName} (offline)`:"\u{1F344} offline":i='\u{1F344} not signed in \u2014 say "log in to gigabuddy"';let n=[i,r.seg,t.connected&&t.wsDown?"\u26A1 disconnected":null,null,g6(t),y6(t)];if(t.connected&&t.peers.length>0){let p=new Set(t.peers.map(f=>f.owner).filter(Boolean)).size;n[3]=`\u{1F916}${t.peers.length}${p>0?` \u{1F9D1}${p}`:""}`}let o=t.connected?[t.conflictFile?`\u26A0 ${t.conflictFile}`:null,t.messageCount>0?`\u{1F4AC} ${t.messageCount}`:null]:[],s=n.filter(p=>p!=null).join(" \xB7 "),a=o.filter(p=>p!=null).join(" \xB7 "),c=s+"{{IDLE}}"+(a?` \xB7 ${a}`:""),l=[t.repo?`\u{1F4C1} ${t.repo}${t.branch?` (${mz(t.branch,m6)})`:""}`:null];t.connected&&(l.push(b6(t)),l.push(t.activityLabel?`\u25C6 ${mz(t.activityLabel,h6)}`:"\u25C7 no activity"));let u=l.filter(p=>p!=null).join(" \xB7 ");return`${`v1 ${e} ${t.lastTurnEpoch??0} ${t.coldSecs} ${r.untilEpoch}`}
|
|
126
126
|
${c}
|
|
127
127
|
${u}
|
|
128
|
-
`}var
|
|
128
|
+
`}var S6=300,I6=3e4,T6=1e4,P6=750;function H_(){let t=process.env.GIGABUDDY_CACHE_COLD_SECS,e=t?Number.parseInt(t,10):NaN;return Number.isFinite(e)&&e>0?e:3600}function z6(){let t=process.env.GIGABUDDY_STATUSLINE_HOST;return t==="always"||t==="off"?t:"warn"}async function C6(t){let e=_z(t);for(;;){let r=yi(e,".git");try{if((await wz(r)).isDirectory())return{headPath:yi(r,"HEAD"),repo:bz(e)};let o=await V_(r,"utf-8"),s=/^gitdir:\s*(.+)\s*$/m.exec(o);if(s){let a=x6(s[1])?s[1]:_z(e,s[1]);return{headPath:yi(a,"HEAD"),repo:bz(e)}}return null}catch{}let i=k6(e);if(i===e)return null;e=i}}function A6(t){let e=/^ref:\s*refs\/heads\/(.+)\s*$/.exec(t.trim());return e?e[1]:null}var Ef=class{constructor(e,r=Et()){this.dir=r;this.ref=e,this.model.coldSecs=H_(),this.model.hostMode=z6()}model=gz();ref;writeTimer=null;aliveTimer=null;ohTimer=null;transcriptWatcher=null;transcriptRetryTimer=null;transcriptDebounce=null;ctxwinWatcher=null;lastTranscriptPath=null;headWatcher=null;headPath=null;registryWatcher=null;hostService=null;stopped=!1;waitStampCleared=!1;get sessionKey(){return this.ref.kind==="claude"?`cc_${this.ref.sessionId}`:this.ref.sessionId}get sessionDirPath(){return yi(this.dir,"sessions",this.sessionKey)}get filePath(){return yi(this.sessionDirPath,"statusline.txt")}async start(){await _6(this.sessionDirPath,{recursive:!0});try{let e=await V_(yi(this.sessionDirPath,"session.json"),"utf-8"),r=JSON.parse(e);r.displayName&&(this.model.displayName=r.displayName)}catch{}this.watchGit().catch(()=>{}),this.ref.kind==="claude"&&(this.watchTranscript().catch(()=>{}),this.watchRegistry(),this.watchCtxWindow()),this.hostService=new Rf(e=>{let r=JSON.stringify(this.model.host);this.model.host=e,JSON.stringify(e)!==r&&this.scheduleWrite()}),this.hostService.start().catch(()=>{}),this.aliveTimer=setInterval(()=>this.writeNow().catch(()=>{}),I6),this.aliveTimer.unref?.(),this.scheduleWrite()}stop(){this.stopped=!0;for(let e of[this.writeTimer,this.ohTimer,this.transcriptRetryTimer,this.transcriptDebounce])e&&clearTimeout(e);this.aliveTimer&&clearInterval(this.aliveTimer),this.transcriptWatcher?.close(),this.headWatcher?.close(),this.registryWatcher?.close(),this.ctxwinWatcher?.close(),this.hostService?.stop()}onInbox(e){this.model.connected=!0,this.model.pendingPlaceName=null,this.model.placeName=e.placeName??this.model.placeName,this.model.displayName=e.displayName??this.model.displayName,this.model.peers=e.peers,this.model.worktreeId=e.worktreeId,this.model.officeHours=e.officeHours,this.model.activityLabel=e.activityLabel,this.model.conflictFile=e.conflictFile,this.model.messageCount=e.messageCount,this.armOfficeHoursAlarm(),this.scheduleWrite()}setWsConnected(e){this.model.wsDown!==!e&&(this.model.wsDown=!e,this.scheduleWrite())}setSignedIn(e){this.model.signedIn!==e&&(this.model.signedIn=e,this.scheduleWrite())}setPlaceConnected(e){this.model.connected!==e&&(this.model.connected=e,e||(this.model.pendingPlaceName=null),this.scheduleWrite())}setPendingPlace(e){this.model.connected||this.model.pendingPlaceName===e||(this.model.pendingPlaceName=e,this.scheduleWrite())}async watchGit(){let e=await C6(process.cwd());if(e){this.model.repo=e.repo,this.headPath=e.headPath,await this.readBranch();try{this.headWatcher=Tc(e.headPath,{persistent:!1},()=>{this.headWatcher?.close(),this.headWatcher=null,this.readBranch().then(()=>{if(!(this.stopped||!this.headPath))try{this.headWatcher=Tc(this.headPath,{persistent:!1},()=>void this.readBranch())}catch{}})})}catch{}}}async readBranch(){if(this.headPath)try{let e=A6(await V_(this.headPath,"utf-8"));e!==this.model.branch&&(this.model.branch=e,this.scheduleWrite())}catch{}}watchCtxWindow(){try{this.ctxwinWatcher=Tc(this.sessionDirPath,{persistent:!1},(e,r)=>{r==="ctxwin.txt"&&this.lastTranscriptPath&&this.refreshFromTranscript(this.lastTranscriptPath)})}catch{}}async watchTranscript(){if(this.stopped||this.ref.kind!=="claude")return;let e=await zf(this.ref.sessionId);if(!e){this.transcriptRetryTimer=setTimeout(()=>void this.watchTranscript(),T6),this.transcriptRetryTimer.unref?.();return}this.lastTranscriptPath=e,await this.refreshFromTranscript(e);try{this.transcriptWatcher=Tc(e,{persistent:!1},()=>{this.transcriptDebounce&&clearTimeout(this.transcriptDebounce),this.transcriptDebounce=setTimeout(()=>{this.transcriptDebounce=null,this.refreshFromTranscript(e)},P6),this.transcriptDebounce.unref?.()})}catch{}}async refreshFromTranscript(e){try{let i=await wz(e);this.model.lastTurnEpoch=Math.floor(i.mtimeMs/1e3)}catch{return}if(this.ref.kind!=="claude")return;let r=await Gr(this.ref.sessionId);r&&(this.model.contextTokensK=Math.round((r.usedTokens+500)/1e3),this.model.contextWindowK=r.windowTokens==null?null:Math.round(r.windowTokens/1e3),this.model.shouldHandoff=r.shouldHandoff),this.scheduleWrite()}watchRegistry(){if(this.ref.kind==="claude")try{this.registryWatcher=Tc(HP(this.ref.pid),{persistent:!1},()=>{this.onRegistryChange()})}catch{}}async onRegistryChange(){if(this.ref.kind!=="claude")return;let e=await z_(this.ref.pid);if(!e||e.sessionId===this.ref.sessionId)return;let r=this.filePath;this.ref={kind:"claude",pid:this.ref.pid,sessionId:e.sessionId},this.waitStampCleared=!1,vz(r).catch(()=>{}),this.transcriptWatcher?.close(),this.transcriptWatcher=null,this.lastTranscriptPath=null,this.model.lastTurnEpoch=null,this.model.contextTokensK=null,this.model.contextWindowK=null,this.model.shouldHandoff=!1,this.watchTranscript(),this.scheduleWrite()}armOfficeHoursAlarm(){this.ohTimer&&clearTimeout(this.ohTimer),this.ohTimer=null;let e=Date.now(),r=this.model.officeHours.filter(i=>i.role==="origin"&&i.until!=null).map(i=>Date.parse(i.until)).filter(i=>Number.isFinite(i)&&i>e);r.length!==0&&(this.ohTimer=setTimeout(()=>this.scheduleWrite(),Math.min(...r)-e+1e3),this.ohTimer.unref?.())}scheduleWrite(){this.writeTimer||this.stopped||(this.writeTimer=setTimeout(()=>{this.writeTimer=null,this.writeNow().catch(e=>console.error("[gigabuddy-statusline] write failed:",e))},S6),this.writeTimer.unref?.())}async writeNow(){if(this.stopped)return;let e=yz(this.model,Math.floor(Date.now()/1e3)),r=`${this.filePath}.tmp`;await $6(r,e),await w6(r,this.filePath),this.waitStampCleared||(this.waitStampCleared=!0,await vz(yi(this.sessionDirPath,"statusline-wait")).catch(()=>{}))}};import{readFile as Bf,writeFile as Nc}from"node:fs/promises";import{homedir as V2}from"node:os";import{join as Jr}from"node:path";import*as es from"node:fs";import*as Nf from"node:net";var Of=class{server;socket;handlers=[];buffer="";socketPath="";disposed=!1;started=!1;reconnectTimer;onMessage(e){this.handlers.push(e)}get connected(){return!!this.socket&&!this.socket.destroyed}start(e){this.started||(this.started=!0,this.socketPath=R6(e),this.disposed=!1,this.connectOrListen())}send(e){if(!(!this.socket||this.socket.destroyed))try{this.socket.write(JSON.stringify(e)+`
|
|
129
129
|
`)}catch(r){this.log(`send failed: ${r}`)}}dispose(){if(this.disposed=!0,this.started=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.socket?.destroy(),this.server?.close(),this.server)try{this.socketPath&&es.existsSync(this.socketPath)&&es.unlinkSync(this.socketPath)}catch{}}connectOrListen(){if(this.disposed)return;let e=Nf.createConnection(this.socketPath);e.once("connect",()=>{this.log(`connected as client \u2192 ${this.socketPath}`),this.attachSocket(e,!1)}),e.once("error",r=>{e.destroy(),r.code==="ENOENT"||r.code==="ECONNREFUSED"?this.listen():(this.log(`client error (${r.code}): ${r.message}`),this.scheduleReconnect())})}listen(){if(this.disposed)return;try{es.existsSync(this.socketPath)&&es.unlinkSync(this.socketPath)}catch{}let e=Nf.createServer(r=>{this.log("peer connected (we are server)"),this.attachSocket(r,!0)});e.on("error",r=>{this.log(`server error (${r.code}): ${r.message}`),this.server=void 0,this.scheduleReconnect()}),e.listen(this.socketPath,()=>{this.log(`listening as server on ${this.socketPath}`)}),this.server=e}attachSocket(e,r){this.socket=e,this.buffer="",e.setEncoding("utf8"),e.on("data",i=>this.onData(i)),e.on("error",i=>this.log(`socket error: ${i.message}`)),e.on("close",()=>{this.log("connection closed"),this.socket=void 0,r||this.scheduleReconnect()})}onData(e){this.buffer+=e;let r;for(;(r=this.buffer.indexOf(`
|
|
130
|
-
`))>=0;){let i=this.buffer.slice(0,r).trim();if(this.buffer=this.buffer.slice(r+1),!!i)try{let n=JSON.parse(i);this.log(`recv ${n.type}${n.pageId?` ${n.pageId}`:""}`);for(let o of this.handlers)o(n)}catch{this.log(`ignoring malformed message: ${i.slice(0,120)}`)}}}scheduleReconnect(){this.disposed||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,this.connectOrListen()},1500))}log(e){console.error(`[gigabuddy-bridge] ${e}`)}};function
|
|
131
|
-
`,{flag:"wx"}),i}catch{return await jf(e,"utf-8").then(o=>o.trim()).catch(()=>"")||i}}function
|
|
130
|
+
`))>=0;){let i=this.buffer.slice(0,r).trim();if(this.buffer=this.buffer.slice(r+1),!!i)try{let n=JSON.parse(i);this.log(`recv ${n.type}${n.pageId?` ${n.pageId}`:""}`);for(let o of this.handlers)o(n)}catch{this.log(`ignoring malformed message: ${i.slice(0,120)}`)}}}scheduleReconnect(){this.disposed||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=void 0,this.connectOrListen()},1500))}log(e){console.error(`[gigabuddy-bridge] ${e}`)}};function R6(t){let e=t.replace(/[^a-zA-Z0-9]/g,"_");return`/tmp/${Be().bridgeSocketPrefix}${e}.sock`}var E6="Sq3Ys1hq5bhtyGqkumZt7",kz="session";async function xz(t,e){try{let n=await t.listPlaceRules(e);if(Array.isArray(n.audiences)){let o=n.audiences.find(a=>String(a.slug)===kz&&String(a.id).startsWith("audience:base_")),s=await t.resolvePlaceRules(e,{audienceIds:o?[String(o.id)]:[],mode:"eligible"});return s.storeReadOk?{rules:O6(s.matched??[]),unreadable:!1}:{rules:[],unreadable:!0}}if(Array.isArray(n.rules))return n.storeReadOk?{rules:$z(n.rules),unreadable:!1}:{rules:[],unreadable:!0}}catch{}let r=[];try{let n;for(let o=0;o<25;o++){let s=await t.listPlaceContent(e,{contextSchemaId:E6,limit:200,before:n});if(r.push(...s.instances??[]),n=s.cursor,!s.hasMore||!n)break}}catch{return{rules:[],unreadable:!0}}let i=r.filter(n=>(n.data??{}).status==="active");return{rules:$z(i.map(n=>n.data??{})),unreadable:!1}}function O6(t){let e=[];for(let r of t){let i=String(r.title??"").trim();i&&e.push({title:i,firmness:String(r.firmness??"rule"),pageRefs:Array.isArray(r.pageRefs)?r.pageRefs.map(String).filter(Boolean):[]})}return e}function $z(t){let e=[];for(let r of t){let i=Array.isArray(r.audience)?r.audience.map(String):[];if(i.length>0&&!i.includes(kz))continue;let n=String(r.title??"").trim();n&&e.push({title:n,firmness:String(r.firmness??"rule"),pageRefs:Array.isArray(r.pageRefs)?r.pageRefs.map(String).filter(Boolean):[]})}return e.sort((r,i)=>(r.firmness==="rule"?0:1)-(i.firmness==="rule"?0:1)),e}function Sz(t){if(t.unreadable)return["\u26A0 house rules unreadable this session \u2014 do not assume there are none"];let e=t.rules.filter(i=>i.firmness==="rule"),r=e.slice(0,5).map(i=>i.title);return e.length>5&&r.push(`(+${e.length-5} more \u2014 the connect briefing has all)`),r}import{writeFile as aC,readFile as cC,rename as lC}from"node:fs/promises";import{join as uw}from"node:path";import{execFile as J6}from"node:child_process";import{createHash as L6,randomUUID as Z6}from"node:crypto";import{readFile as jf,stat as F6,writeFile as q6}from"node:fs/promises";import{hostname as V6}from"node:os";import{join as B_}from"node:path";import{readFile as Az}from"node:fs/promises";import{isAbsolute as Rz,join as Ez,resolve as Oz}from"node:path";var N6=["page","activity","activity_reflection","work_object"],M6=["idea","issue","decision","task"],j6=new Map([...M6.map(t=>[t,"work_object"]),["reflection","activity_reflection"]]),D6=[...j6.keys()],U6=8,q7=`(?<![A-Za-z0-9_])(${[...N6,...D6].sort((t,e)=>e.length-t.length).join("|")}):([A-Za-z0-9_-]{${U6},})`;function Iz(t,e){let r=t.includes(":")?t.slice(t.indexOf(":")+1):t;return`${e}:${r}`}var Mf="ZUoOR73z9HL2FKgbVjKZM",Tz="handover",Pz="f09hDI0_RdJEroyITyGr6",ts={issue:"z7ghJbwTsvJlhkF69FEnW",idea:"K8XpLh9bt_Je9sowH254Y",task:"Lsr4bZmnv-Aig_vpiWzzm",decision:"SEbdpkneopdrFXeeNuEQG"};var zz={[Mf]:"work_object",[ts.issue]:"issue",[ts.idea]:"idea",[ts.task]:"task",[ts.decision]:"decision"};function W_(t,e){let r=zz[t??""];if(r)return r;let i=t?e?.get(t):void 0;return i?i.trim().toLowerCase().replace(/\s+/g,"_"):"work_object"}function Cz(t,e){return Iz(t,W_(e))}async function Nz(t){let e=Ez(t,".git");try{let r=await Az(e,"utf-8"),i=/^gitdir:\s*(.+)$/m.exec(r);if(i){let n=i[1].trim();return Rz(n)?n:Oz(t,n)}}catch{}return e}async function Mz(t){try{let e=(await Az(Ez(t,"commondir"),"utf-8")).trim();return Rz(e)?e:Oz(t,e)}catch{return t}}async function Dz(t){try{let e=await Nz(t);await jf(B_(e,"HEAD"),"utf-8");let r=await Mz(e),i=e!==r,n=await B6(e),o=G6(n,await H6(),await W6(e));return{worktree:t,worktreeId:o,isolated:i}}catch{return null}}async function H6(){let t=await jf("/proc/sys/kernel/random/boot_id","utf-8").then(e=>e.trim()).catch(()=>"");return`${V6()}:${t}`}async function W6(t){try{let e=await F6(t);return`${e.dev}:${e.ino}`}catch{return""}}async function B6(t){let e=B_(t,Be().treeIdFileName),r=B_(t,_P().treeIdFileName);for(let n of[e,r])try{let o=(await jf(n,"utf-8")).trim();if(o)return o}catch{}let i=Z6();try{return await q6(e,`${i}
|
|
131
|
+
`,{flag:"wx"}),i}catch{return await jf(e,"utf-8").then(o=>o.trim()).catch(()=>"")||i}}function G6(t,e,r=""){return L6("sha256").update(`${t}
|
|
132
132
|
${e}
|
|
133
|
-
${r}`).digest("hex").slice(0,24)}function
|
|
134
|
-
]`).replace("lheading",
|
|
133
|
+
${r}`).digest("hex").slice(0,24)}function Uz(t,e){let r=[];for(let{agent:i,dims:n}of e){let o=!!t.worktreeId&&!!n.worktreeId&&t.worktreeId===n.worktreeId,s=!!t.branch&&!!n.branch&&t.branch===n.branch;if(!o&&!s)continue;let a=!!t.activityId&&!!n.activityId&&t.activityId===n.activityId,c;o?c=a?"tree-shared":"tree-collision":c=a?"collaborating":"branch-overlap",r.push({agent:i,level:c,branch:n.branch??null,worktree:n.worktree??null,activityId:n.activityId??null,sharedTree:o,sharedActivity:a})}return r}var jz={"tree-collision":0,"tree-shared":1,"branch-overlap":2,collaborating:3};function Lz(t){if(t.length===0)return[];let e=[...t].sort((i,n)=>jz[i.level]-jz[n.level]),r=[];for(let i of e){let n=i.worktree?` (${i.worktree})`:"";switch(i.level){case"tree-collision":r.push(`\u26D4 ${i.agent} is in the SAME working tree${n} as you, with no shared activity \u2014 two HEADs in one checkout will thrash on branch switch. Coordinate, or move to an isolated worktree.`);break;case"tree-shared":r.push(`\u26A0 ${i.agent} shares your working tree${n} (same activity) \u2014 even collaborating, a branch switch yanks the floor out from under one of you. Prefer separate worktrees.`);break;case"branch-overlap":r.push(`\u26A0 ${i.agent} is also on ${i.branch??"your branch"} (separate checkout, no shared activity) \u2014 coordinate so you don't clobber each other?`);break;case"collaborating":r.push(`\u{1F91D} ${i.agent} is on ${i.branch??"your branch"} working the same activity \u2014 they're live, reach them on it${i.activityId?`: send_message(activityId: "${i.activityId}", \u2026)`:""}.`);break}}return r}function G_(t,e){return new Promise(r=>{J6("git",["-C",t,...e],{timeout:2e3},(i,n)=>{r(i?null:n.trim()||null)})})}async function Df(t){let[e,r,i,n]=await Promise.all([G_(t,["config","user.name"]),G_(t,["rev-parse","--show-toplevel"]).then(o=>o?o.split("/").pop()??null:null),G_(t,["rev-parse","--abbrev-ref","HEAD"]),Dz(t).catch(()=>null)]);return{owner:e,repo:r,branch:i,worktree:n?.worktree??null,worktreeId:n?.worktreeId??null,isolated:n?.isolated??null}}function Zz(t,e){return t?t.repo!==e.repo||t.branch!==e.branch||t.worktree!==e.worktree||t.worktreeId!==e.worktreeId:!0}function X_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bi=X_();function Gz(t){bi=t}var Ac={exec:()=>null};function ve(t,e=""){let r=typeof t=="string"?t:t.source,i={replace:(n,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace($t.caret,"$1"),r=r.replace(n,s),i},getRegex:()=>new RegExp(r,e)};return i}var K6=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$t={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Y6=/^(?:[ \t]*(?:\n|$))+/,X6=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Q6=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,e2=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Q_=/(?:[*+-]|\d{1,9}[.)])/,Jz=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kz=ve(Jz).replace(/bull/g,Q_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),t2=ve(Jz).replace(/bull/g,Q_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ew=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,r2=/^[^\n]+/,tw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,n2=ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",tw).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),i2=ve(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Q_).getRegex(),qf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",rw=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,o2=ve("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",rw).replace("tag",qf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yz=ve(ew).replace("hr",Rc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qf).getRegex(),s2=ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Yz).getRegex(),nw={blockquote:s2,code:X6,def:n2,fences:Q6,heading:e2,hr:Rc,html:o2,lheading:Kz,list:i2,newline:Y6,paragraph:Yz,table:Ac,text:r2},Fz=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Rc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qf).getRegex(),a2={...nw,lheading:t2,table:Fz,paragraph:ve(ew).replace("hr",Rc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Fz).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qf).getRegex()},c2={...nw,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rw).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ac,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(ew).replace("hr",Rc).replace("heading",` *#{1,6} *[^
|
|
134
|
+
]`).replace("lheading",Kz).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},l2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,u2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xz=/^( {2,}|\\)\n(?!\s*$)/,d2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vf=/[\p{P}\p{S}]/u,iw=/[\s\p{P}\p{S}]/u,Qz=/[^\s\p{P}\p{S}]/u,p2=ve(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,iw).getRegex(),eC=/(?!~)[\p{P}\p{S}]/u,f2=/(?!~)[\s\p{P}\p{S}]/u,m2=/(?:[^\s\p{P}\p{S}]|~)/u,h2=ve(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",K6?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tC=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,g2=ve(tC,"u").replace(/punct/g,Vf).getRegex(),y2=ve(tC,"u").replace(/punct/g,eC).getRegex(),rC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",v2=ve(rC,"gu").replace(/notPunctSpace/g,Qz).replace(/punctSpace/g,iw).replace(/punct/g,Vf).getRegex(),b2=ve(rC,"gu").replace(/notPunctSpace/g,m2).replace(/punctSpace/g,f2).replace(/punct/g,eC).getRegex(),_2=ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qz).replace(/punctSpace/g,iw).replace(/punct/g,Vf).getRegex(),w2=ve(/\\(punct)/,"gu").replace(/punct/g,Vf).getRegex(),$2=ve(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),k2=ve(rw).replace("(?:-->|$)","-->").getRegex(),x2=ve("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",k2).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Lf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,S2=ve(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Lf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nC=ve(/^!?\[(label)\]\[(ref)\]/).replace("label",Lf).replace("ref",tw).getRegex(),iC=ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",tw).getRegex(),I2=ve("reflink|nolink(?!\\()","g").replace("reflink",nC).replace("nolink",iC).getRegex(),qz=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ow={_backpedal:Ac,anyPunctuation:w2,autolink:$2,blockSkip:h2,br:Xz,code:u2,del:Ac,emStrongLDelim:g2,emStrongRDelimAst:v2,emStrongRDelimUnd:_2,escape:l2,link:S2,nolink:iC,punctuation:p2,reflink:nC,reflinkSearch:I2,tag:x2,text:d2,url:Ac},T2={...ow,link:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",Lf).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lf).getRegex()},J_={...ow,emStrongRDelimAst:b2,emStrongLDelim:y2,url:ve(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",qz).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ve(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",qz).getRegex()},P2={...J_,br:ve(Xz).replace("{2,}","*").getRegex(),text:ve(J_.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Uf={normal:nw,gfm:a2,pedantic:c2},Pc={normal:ow,gfm:J_,breaks:P2,pedantic:T2},z2={"&":"&","<":"<",">":">",'"':""","'":"'"},Vz=t=>z2[t];function Ir(t,e){if(e){if($t.escapeTest.test(t))return t.replace($t.escapeReplace,Vz)}else if($t.escapeTestNoEncode.test(t))return t.replace($t.escapeReplaceNoEncode,Vz);return t}function Hz(t){try{t=encodeURI(t).replace($t.percentDecode,"%")}catch{return null}return t}function Wz(t,e){let r=t.replace($t.findPipe,(o,s,a)=>{let c=!1,l=s;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),i=r.split($t.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace($t.slashPipe,"|");return i}function zc(t,e,r){let i=t.length;if(i===0)return"";let n=0;for(;n<i;){let o=t.charAt(i-n-1);if(o===e&&!r)n++;else if(o!==e&&r)n++;else break}return t.slice(0,i-n)}function C2(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return r>0?-2:-1}function Bz(t,e,r,i,n){let o=e.href,s=e.title||null,a=t[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:s,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,c}function A2(t,e,r){let i=t.match(r.other.indentCodeCompensation);if(i===null)return e;let n=i[1];return e.split(`
|
|
135
135
|
`).map(o=>{let s=o.match(r.other.beginningSpace);if(s===null)return o;let[a]=s;return a.length>=n.length?o.slice(n.length):o}).join(`
|
|
136
|
-
`)}var Zf=class{options;rules;lexer;constructor(t){this.options=t||bi}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:
|
|
137
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],i=
|
|
138
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=
|
|
136
|
+
`)}var Zf=class{options;rules;lexer;constructor(t){this.options=t||bi}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:zc(r,`
|
|
137
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],i=A2(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let i=zc(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:zc(e[0],`
|
|
138
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=zc(e[0],`
|
|
139
139
|
`).split(`
|
|
140
140
|
`),i="",n="",o=[];for(;r.length>0;){let s=!1,a=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))a.push(r[c]),s=!0;else if(!s)a.push(r[c]);else break;r=r.slice(c);let l=a.join(`
|
|
141
141
|
`),u=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -153,9 +153,9 @@ ${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
153
153
|
`,1)[0],q;if(p=G,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),q=p):q=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||$.test(p)||S.test(p)||_.test(p)||k.test(p))break;if(q.search(this.rules.other.nonSpaceChar)>=m||!p.trim())u+=`
|
|
154
154
|
`+q.slice(m);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(d)||$.test(d)||k.test(d))break;u+=`
|
|
155
155
|
`+p}!f&&!p.trim()&&(f=!0),l+=G+`
|
|
156
|
-
`,t=t.substring(G.length+1),d=q.slice(m)}}n.loose||(s?n.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0));let h=null,y;this.options.gfm&&(h=this.rules.other.listIsTask.exec(u),h&&(y=h[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:l,task:!!h,checked:y,loose:!1,text:u,tokens:[]}),n.raw+=l}let a=n.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){let l=n.items[c].tokens.filter(d=>d.type==="space"),u=l.length>0&&l.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=u}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:i,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=
|
|
157
|
-
`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let s of i)this.rules.other.tableAlignRight.test(s)?o.align.push("right"):this.rules.other.tableAlignCenter.test(s)?o.align.push("center"):this.rules.other.tableAlignLeft.test(s)?o.align.push("left"):o.align.push(null);for(let s=0;s<r.length;s++)o.header.push({text:r[s],tokens:this.lexer.inline(r[s]),header:!0,align:o.align[s]});for(let s of n)o.rows.push(
|
|
158
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=
|
|
156
|
+
`,t=t.substring(G.length+1),d=q.slice(m)}}n.loose||(s?n.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0));let h=null,y;this.options.gfm&&(h=this.rules.other.listIsTask.exec(u),h&&(y=h[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:l,task:!!h,checked:y,loose:!1,text:u,tokens:[]}),n.raw+=l}let a=n.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){let l=n.items[c].tokens.filter(d=>d.type==="space"),u=l.length>0&&l.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=u}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:i,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Wz(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
157
|
+
`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let s of i)this.rules.other.tableAlignRight.test(s)?o.align.push("right"):this.rules.other.tableAlignCenter.test(s)?o.align.push("center"):this.rules.other.tableAlignLeft.test(s)?o.align.push("left"):o.align.push(null);for(let s=0;s<r.length;s++)o.header.push({text:r[s],tokens:this.lexer.inline(r[s]),header:!0,align:o.align[s]});for(let s of n)o.rows.push(Wz(s,o.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[c]})));return o}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
158
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=zc(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=C2(e[2],"()");if(o===-2)return;if(o>-1){let s=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let i=e[2],n="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],n=o[3])}else n=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),Bz(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[i.toLowerCase()];if(!n){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Bz(r,n,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!r||this.rules.inline.punctuation.exec(r))){let n=[...i[0]].length-1,o,s,a=n,c=0,l=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+n);(i=l.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(s=[...o].length,i[3]||i[4]){a+=s;continue}else if((i[5]||i[6])&&n%3&&!((n+s)%3)){c+=s;continue}if(a-=s,a>0)continue;s=Math.min(s,s+a+c);let u=[...i[0]][0].length,d=t.slice(0,n+i.index+u+s);if(Math.min(n,s)%2){let f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,i;return e[2]==="@"?(r=e[1],i="mailto:"+r):(r=e[1],i=r),{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Kt=class K_{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||bi,this.options.tokenizer=this.options.tokenizer||new Zf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$t,block:Uf.normal,inline:Pc.normal};this.options.pedantic?(r.block=Uf.pedantic,r.inline=Pc.pedantic):this.options.gfm&&(r.block=Uf.gfm,this.options.breaks?r.inline=Pc.breaks:r.inline=Pc.gfm),this.tokenizer.rules=r}static get rules(){return{block:Uf,inline:Pc}}static lex(e,r){return new K_(r).lex(e)}static lexInline(e,r){return new K_(r).inlineTokens(e)}lex(e){e=e.replace($t.carriageReturn,`
|
|
159
159
|
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],i=!1){for(this.options.pedantic&&(e=e.replace($t.tabCharGlobal," ").replace($t.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(s=>(n=s.call({lexer:this},e,r))?(e=e.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let s=r.at(-1);n.raw.length===1&&s!==void 0?s.raw+=`
|
|
160
160
|
`:r.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
|
|
161
161
|
`)?"":`
|
|
@@ -187,9 +187,9 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
187
187
|
`}tablerow({text:t}){return`<tr>
|
|
188
188
|
${t}</tr>
|
|
189
189
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
190
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ir(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let i=this.parser.parseInline(r),n=
|
|
191
|
-
`+this.renderer.text(a);r?i+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):i+=c;continue}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}parseInline(e,r=this.renderer){let i="";for(let n=0;n<e.length;n++){let o=e[n];if(this.options.extensions?.renderers?.[o.type]){let a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=a||"";continue}}let s=o;switch(s.type){case"escape":{i+=r.text(s);break}case"html":{i+=r.html(s);break}case"link":{i+=r.link(s);break}case"image":{i+=r.image(s);break}case"strong":{i+=r.strong(s);break}case"em":{i+=r.em(s);break}case"codespan":{i+=r.codespan(s);break}case"br":{i+=r.br(s);break}case"del":{i+=r.del(s);break}case"text":{i+=r.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},
|
|
192
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Ir(r.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(r);throw r}}},vi=new
|
|
190
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ir(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let i=this.parser.parseInline(r),n=Hz(t);if(n===null)return i;t=n;let o='<a href="'+t+'"';return e&&(o+=' title="'+Ir(e)+'"'),o+=">"+i+"</a>",o}image({href:t,title:e,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let n=Hz(t);if(n===null)return Ir(r);t=n;let o=`<img src="${t}" alt="${r}"`;return e&&(o+=` title="${Ir(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ir(t.text)}},sw=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},dr=class Y_{options;renderer;textRenderer;constructor(e){this.options=e||bi,this.options.renderer=this.options.renderer||new Ff,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sw}static parse(e,r){return new Y_(r).parse(e)}static parseInline(e,r){return new Y_(r).parseInline(e)}parse(e,r=!0){let i="";for(let n=0;n<e.length;n++){let o=e[n];if(this.options.extensions?.renderers?.[o.type]){let a=o,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){i+=c||"";continue}}let s=o;switch(s.type){case"space":{i+=this.renderer.space(s);continue}case"hr":{i+=this.renderer.hr(s);continue}case"heading":{i+=this.renderer.heading(s);continue}case"code":{i+=this.renderer.code(s);continue}case"table":{i+=this.renderer.table(s);continue}case"blockquote":{i+=this.renderer.blockquote(s);continue}case"list":{i+=this.renderer.list(s);continue}case"html":{i+=this.renderer.html(s);continue}case"def":{i+=this.renderer.def(s);continue}case"paragraph":{i+=this.renderer.paragraph(s);continue}case"text":{let a=s,c=this.renderer.text(a);for(;n+1<e.length&&e[n+1].type==="text";)a=e[++n],c+=`
|
|
191
|
+
`+this.renderer.text(a);r?i+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):i+=c;continue}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}parseInline(e,r=this.renderer){let i="";for(let n=0;n<e.length;n++){let o=e[n];if(this.options.extensions?.renderers?.[o.type]){let a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=a||"";continue}}let s=o;switch(s.type){case"escape":{i+=r.text(s);break}case"html":{i+=r.html(s);break}case"link":{i+=r.link(s);break}case"image":{i+=r.image(s);break}case"strong":{i+=r.strong(s);break}case"em":{i+=r.em(s);break}case"codespan":{i+=r.codespan(s);break}case"br":{i+=r.br(s);break}case"del":{i+=r.del(s);break}case"text":{i+=r.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},Cc=class{options;block;constructor(t){this.options=t||bi}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Kt.lex:Kt.lexInline}provideParser(){return this.block?dr.parse:dr.parseInline}},R2=class{defaults=X_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=dr;Renderer=Ff;TextRenderer=sw;Lexer=Kt;Tokenizer=Zf;Hooks=Cc;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let n=i;for(let o of n.header)r=r.concat(this.walkTokens(o.tokens,e));for(let o of n.rows)for(let s of o)r=r.concat(this.walkTokens(s.tokens,e));break}case"list":{let n=i;r=r.concat(this.walkTokens(n.items,e));break}default:{let n=i;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let s=n[o].flat(1/0);r=r.concat(this.walkTokens(s,e))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=e.renderers[n.name];o?e.renderers[n.name]=function(...s){let a=n.renderer.apply(this,s);return a===!1&&(a=o.apply(this,s)),a}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[n.level];o?o.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),i.extensions=e),r.renderer){let n=this.defaults.renderer||new Ff(this.defaults);for(let o in r.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,a=r.renderer[s],c=n[s];n[s]=(...l)=>{let u=a.apply(n,l);return u===!1&&(u=c.apply(n,l)),u||""}}i.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new Zf(this.defaults);for(let o in r.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,a=r.tokenizer[s],c=n[s];n[s]=(...l)=>{let u=a.apply(n,l);return u===!1&&(u=c.apply(n,l)),u}}i.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new Cc;for(let o in r.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,a=r.hooks[s],c=n[s];Cc.passThroughHooks.has(o)?n[s]=l=>{if(this.defaults.async&&Cc.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await a.call(n,l);return c.call(n,d)})();let u=a.call(n,l);return c.call(n,u)}:n[s]=(...l)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(n,l);return d===!1&&(d=await c.apply(n,l)),d})();let u=a.apply(n,l);return u===!1&&(u=c.apply(n,l)),u}}i.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(s){let a=[];return a.push(o.call(this,s)),n&&(a=a.concat(n.call(this,s))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Kt.lex(t,e??this.defaults)}parser(t,e){return dr.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let i={...r},n={...this.defaults,...i},o=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let s=n.hooks?await n.hooks.preprocess(e):e,a=await(n.hooks?await n.hooks.provideLexer():t?Kt.lex:Kt.lexInline)(s,n),c=n.hooks?await n.hooks.processAllTokens(a):a;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let l=await(n.hooks?await n.hooks.provideParser():t?dr.parse:dr.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(l):l})().catch(o);try{n.hooks&&(e=n.hooks.preprocess(e));let s=(n.hooks?n.hooks.provideLexer():t?Kt.lex:Kt.lexInline)(e,n);n.hooks&&(s=n.hooks.processAllTokens(s)),n.walkTokens&&this.walkTokens(s,n.walkTokens);let a=(n.hooks?n.hooks.provideParser():t?dr.parse:dr.parseInline)(s,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(s){return o(s)}}}onError(t,e){return r=>{if(r.message+=`
|
|
192
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Ir(r.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(r);throw r}}},vi=new R2;function ze(t,e){return vi.parse(t,e)}ze.options=ze.setOptions=function(t){return vi.setOptions(t),ze.defaults=vi.defaults,Gz(ze.defaults),ze};ze.getDefaults=X_;ze.defaults=bi;ze.use=function(...t){return vi.use(...t),ze.defaults=vi.defaults,Gz(ze.defaults),ze};ze.walkTokens=function(t,e){return vi.walkTokens(t,e)};ze.parseInline=vi.parseInline;ze.Parser=dr;ze.parser=dr.parse;ze.Renderer=Ff;ze.TextRenderer=sw;ze.Lexer=Kt;ze.lexer=Kt.lex;ze.Tokenizer=Zf;ze.Hooks=Cc;ze.parse=ze;var lY=ze.options,uY=ze.setOptions,dY=ze.use,pY=ze.walkTokens,fY=ze.parseInline;var mY=dr.parse,hY=Kt.lex;function Tr(t,e){return t?typeof t=="string"?t:Array.isArray(t)?t.map(r=>{if(r.type==="mention")return`@${r.props?.displayName??"unknown"}`;if(r.type==="contentChip"){let o=r.props?.instanceId??"",s=e?.get(o)||r.props?.contextType||o;return s?`[${s}]`:""}if(r.type==="link"){let o=Tr(r.content??[],e),s=r.href??"";return o===s?s:`[${o}](${s})`}let i=r.text??"";if(!i)return"";let n=r.styles??{};return n.code&&(i=`\`${i}\``),n.bold&&(i=`**${i}**`),n.italic&&(i=`*${i}*`),(n.strike||n.strikethrough)&&(i=`~~${i}~~`),i}).join(""):"":""}function sC(t,e,r){let{type:i,props:n,content:o,children:s}=t,{cardMap:a,refs:c}=r,l=s?.length?s.map(u=>sC(u,e+" ",r)).join(""):"";switch(i){case"paragraph":{let u=Tr(o,c);return!u&&!l?`
|
|
193
193
|
`:`${e}${u}
|
|
194
194
|
|
|
195
195
|
${l}`}case"heading":{let u=Math.min(n?.level??2,6),d=Tr(o,c);return`${e}${"#".repeat(u)} ${d}
|
|
@@ -226,55 +226,55 @@ ${f.split(`
|
|
|
226
226
|
|
|
227
227
|
`}default:{let u=Tr(o,c);return u?`${e}${u}
|
|
228
228
|
|
|
229
|
-
${l}`:l}}}function
|
|
229
|
+
${l}`:l}}}function oC(t){return t instanceof Map?t:t?new Map(Object.entries(t)):null}function aw(t,e){if(!t||!Array.isArray(t))return"";let r={cardMap:oC(e?.resolvedCards),refs:oC(e?.resolvedRefs),resolveUrl:e?.resolveUrl??(i=>i)};return t.map(i=>sC(i,"",r)).join("").replace(/\n{3,}/g,`
|
|
230
230
|
|
|
231
|
-
`).trim()}function R2(t){return!t.content||typeof t.content=="string"||!Array.isArray(t.content)?"":t.content.map(e=>e.text??"").join("")}function cw(t){if(!t||!Array.isArray(t))return[];let e=[];for(let r=0;r<t.length;r++){let i=t[r];if(!i||i.type!=="heading")continue;let n=i.props?.level??2,o=R2(i);e.push({heading:o,level:n,startIndex:r,endIndex:t.length,id:String(i.id??""),ordinal:e.length+1})}for(let r=0;r<e.length;r++){let i=e[r];for(let n=r+1;n<e.length;n++)if(e[n].level<=i.level){i.endIndex=e[n].startIndex;break}}return e}function lw(t,e){let r=cw(t),i=cw(e),n=new Map;for(let l of r){let u=t.slice(l.startIndex,l.endIndex);n.set(l.heading,aw(u))}let o=new Map;for(let l of i){let u=e.slice(l.startIndex,l.endIndex);o.set(l.heading,aw(u))}let s=[],a=[],c=[];for(let[l,u]of o){let d=n.get(l);d===void 0?s.push(l):d!==u&&c.push(l)}for(let l of n.keys())o.has(l)||a.push(l);return{added:s,removed:a,changed:c}}var dw=50,A2=300,lC=25e3,E2=5*6e4,O2=500,N2=4e3,Hf=class{constructor(e,r,i){this.state=e;this.sessionId=r;this.pageChecker=i?.pageChecker??null,this.workspaceSyncer=i?.workspaceSyncer??null,this.profileSyncer=i?.profileSyncer??null,this.messageFetcher=i?.messageFetcher??null,this.changedFetcher=i?.changedFetcher??null}seq=0;events=[];previousPeers=new Map;debounceTimer=null;unsubscribe=null;outboxAbort=null;heartbeatTimer=null;lastHeartbeatWallMs=0;mentionWatchTimer=null;placeEventUnsub=null;connectionUnsub=null;contentDebounceTimers=new Map;hasConnected=!1;lastOutboxFile=null;pageChecker=null;messageFetcher=null;changedFetcher=null;lastContentSyncTs=null;workspaceSyncer=null;lastWorkspaceSyncTs=0;profileSyncer=null;lastProfileSyncTs=0;lastMentionCursor=null;lastPersistedCursor=null;seenMessageIds=new Set;persistTimer=null;lastContextPct=null;lastContextTokens=null;lastContextWindowK=null;lastShouldHandoff=!1;lastRssMb=null;lastHostPressure=null;lastCpuCores=null;lastCpuPressure=null;lastCpuTicks=null;lastCpuSampleAt=null;lastLocation=null;lastLocationCwd=null;selfPid=null;selfPidResolved=!1;get inboxPath(){return uw(Ye(this.sessionId),"inbox.json")}get sessionStatePath(){return uw(Ye(this.sessionId),"cursor.json")}async start(){await Br(this.sessionId);let e=this.state.awarenessManager,r=this.state.placeId;!e||!r||(await this.loadSessionState(),this.snapshotPeers(e,r),await this.writeInbox(),Jt(this.state),this.unsubscribe=e.onTopicUpdate(r,()=>{this.onPeerUpdate(e,r)}),this.watchOutbox(e,r),this.lastHeartbeatWallMs=Date.now(),this.heartbeatTimer=setInterval(async()=>{let i=Date.now(),n=i-this.lastHeartbeatWallMs;if(this.lastHeartbeatWallMs=i,n>lC*3&&e.forceReconnect){console.error(`[gigabuddy-inbox] Clock jump (${Math.round(n/1e3)}s since last beat) \u2014 presuming socket dead after machine sleep, reconnecting`);try{await e.forceReconnect()}catch(o){console.error("[gigabuddy-inbox] Post-sleep reconnect failed, will retry next beat:",o);return}Jt(this.state);return}if(!e.connected){if(await e.ensureConnected())try{await e.subscribe(r),e.updateTopicState(r,{displayName:this.state.agentMeta?.displayName,status:"active"}),console.error("[gigabuddy-inbox] Heartbeat restored dead connection")}catch{}return}await this.refreshSessionName(e,r),await this.refreshContext(e,r),await this.refreshResources(e,r),await this.refreshLocation(e,r),Jt(this.state)},lC),this.placeEventUnsub=e.onPlaceEvent(i=>{this.onContentChanged(r,i).catch(n=>console.error("[gigabuddy-inbox] content_changed handler error:",n)),this.onActivityChanged(i),this.onMessageCreated(i),this.onAskCreated(i)}),this.lastContentSyncTs=new Date().toISOString(),this.connectionUnsub=e.onConnectionChange(i=>{if(!i)return;if(!this.hasConnected){this.hasConnected=!0;return}let n=this.lastContentSyncTs??new Date(Date.now()-5*6e4).toISOString();this.lastContentSyncTs=new Date().toISOString(),this.catchUpChangedContent(r,n).catch(o=>console.error("[gigabuddy-inbox] reconnect catch-up error:",o)),this.checkMentions(r).catch(o=>console.error("[gigabuddy-inbox] reconnect mention catch-up error:",o))}),this.messageFetcher&&(this.lastMentionCursor||(this.lastMentionCursor=this.state.lastMessageCursor),this.checkMentions(r).catch(i=>console.error("[gigabuddy-inbox] Mention bootstrap error:",i)),this.mentionWatchTimer=setInterval(()=>{this.checkMentions(r).catch(i=>console.error("[gigabuddy-inbox] Mention check error:",i))},E2)))}stop(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.outboxAbort&&(this.outboxAbort.abort(),this.outboxAbort=null),this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),this.placeEventUnsub&&(this.placeEventUnsub(),this.placeEventUnsub=null);for(let e of this.contentDebounceTimers.values())clearTimeout(e);this.contentDebounceTimers.clear(),this.connectionUnsub&&(this.connectionUnsub(),this.connectionUnsub=null),this.mentionWatchTimer&&(clearInterval(this.mentionWatchTimer),this.mentionWatchTimer=null),this.persistTimer&&(clearTimeout(this.persistTimer),this.persistTimer=null),this.persistSessionState().catch(()=>{})}addEvent(e){e.type==="page_updated"&&e.pageId&&(this.events=this.events.filter(r=>!(r.type==="page_updated"&&r.pageId===e.pageId))),this.events.push({...e,ts:new Date().toISOString()}),this.events.length>dw&&(this.events=this.events.slice(-dw)),this.scheduleWrite()}notePosition(){this.schedulePersist()}noteSelfChanged(){this.scheduleWrite(),this.schedulePersist()}watchOutbox(e,r){let i=uw(Ye(this.sessionId),"outbox.json");this.outboxAbort=new AbortController;let n=null,o=async()=>{try{let a=await aC(i,"utf-8"),c=JSON.parse(a);if(c.ts&&c.ts!==n){n=c.ts;let l={lastActiveAt:c.ts};c.intent&&(l.action={label:c.intent});let u=c.recentFiles?.length?c.recentFiles:c.file?[c.file]:null;u&&JSON.stringify(u)!==JSON.stringify(this.lastOutboxFile?[this.lastOutboxFile]:[])&&(this.lastOutboxFile=u[0]??null,l.focus={kind:"files",ids:u}),c.owner&&(l.owner=c.owner),c.repo&&(l.repo=c.repo),c.branch&&(l.branch=c.branch),e.updateTopicState(r,l);let d=Date.now();if(this.workspaceSyncer&&d-this.lastWorkspaceSyncTs>1e4){this.lastWorkspaceSyncTs=d;let p={last_active_at:c.ts,status:"active"};c.intent&&(p.intent=c.intent),c.owner&&(p.owner=c.owner),c.repo&&(p.repo=c.repo),c.branch&&(p.branch=c.branch),c.recentFiles&&(p.recent_files=c.recentFiles),c.editedFiles&&(p.edited_files=c.editedFiles),c.uncommittedFiles&&(p.uncommitted_files=c.uncommittedFiles),c.gitStats&&(p.git_stats=c.gitStats),c.activeTask&&(p.active_task=c.activeTask),c.taskProgress&&(p.task_progress=c.taskProgress);let f=this.state.currentActivity?.activityId;f&&(p.activity_id=f),this.lastContextPct!=null&&(p.context_pct=this.lastContextPct);let m=this.state.agentMeta?.claudeSessionId,h=m?await kc(m):null;h&&(p.session_name=h),this.workspaceSyncer(p).catch(y=>console.error("[gigabuddy-inbox] Workspace sync error:",y))}if(this.profileSyncer&&d-this.lastProfileSyncTs>3e5){this.lastProfileSyncTs=d;let p=this.state.currentActivity?.label??c.activeTask??c.intent,f={lastDoing:{...p&&{label:p},...this.state.currentActivity?.activityId&&{activityId:this.state.currentActivity.activityId},...r&&{placeId:r},at:c.ts}};c.branch&&(f.branch=c.branch),this.lastContextPct!=null&&(f.metrics={contextPct:this.lastContextPct}),this.profileSyncer(f).catch(m=>console.error("[gigabuddy-inbox] Profile sync error:",m))}}}catch{}},s=setInterval(()=>{if(this.outboxAbort?.signal.aborted){clearInterval(s);return}o()},500);this.outboxAbort.signal.addEventListener("abort",()=>{clearInterval(s)})}onPeerUpdate(e,r){let i=this.buildPeerMap(e,r),n=this.getMyFocus(e,r);if(n.size>0){for(let[o,s]of i)if(s.focus){let a=s.focus.filter(c=>n.has(c));if(a.length>0){let c;for(let u=this.events.length-1;u>=0;u--){let d=this.events[u];if(d&&d.type==="conflict"&&d.peer===o){c=d;break}}c?.files&&JSON.stringify(c.files.sort())===JSON.stringify(a.sort())||this.addEvent({type:"conflict",peer:o,files:a})}}}this.previousPeers=i,this.scheduleWrite()}snapshotPeers(e,r){this.previousPeers=this.buildPeerMap(e,r)}buildPeerMap(e,r){let i=this.state.agentMeta?.displayName,n=new Map;for(let o of e.getTopicPeers(r)){let s=o.state,a=s.displayName??"Unknown";a===i||a==="Unknown"||a.startsWith("user:")||a.startsWith("agent:")||n.set(a,{displayName:a,owner:s.owner??null,status:s.status??"unknown",action:s.action?.label??null,focus:s.focus?.ids??null,activityId:s.activityId??null,lastActiveAt:s.lastActiveAt??null,beatAt:typeof s.beatAt=="number"?s.beatAt:null,coldSecs:typeof s.coldSecs=="number"?s.coldSecs:null,repo:s.repo??null,branch:s.branch??null,worktreeId:s.worktreeId??null})}return n}myWorktreeId(){let e=this.state.placeId,r=this.state.awarenessManager;return!e||!r?null:r.topics?.get(e)?.localState?.worktreeId??null}getMyFocus(e,r){let o=e.topics?.get(r)?.localState?.focus;return new Set(o?.ids??[])}onActivityChanged(e){if(e.type!=="activity_changed"||e.change!=="attachment")return;let r=e.activityId;if(!r||!this.state.activeActivities.has(r))return;let i=e.actorId;if(i&&this.state.agentId&&i===this.state.agentId)return;let n=e.memberLabel?.trim(),o=e.memberKind??"item";this.addEvent({type:"attachment",peer:i??"someone",detail:n?`"${n}" (${o})`:`a ${o}`})}async onContentChanged(e,r){if(r.type!=="content_changed")return;let i=r.instanceId;!i||!this.state.watchedPages.has(i)||(r.ts&&(!this.lastContentSyncTs||r.ts>this.lastContentSyncTs)&&(this.lastContentSyncTs=r.ts),this.scheduleContentCheck(e,i))}scheduleContentCheck(e,r){let i=this.contentDebounceTimers.get(r);i&&clearTimeout(i);let n=setTimeout(()=>{this.contentDebounceTimers.delete(r),this.checkSingleWatchedPage(e,r).catch(o=>console.error("[gigabuddy-inbox] content check error:",o))},N2);this.contentDebounceTimers.set(r,n)}async checkSingleWatchedPage(e,r){if(!this.pageChecker)return;let i=this.state.watchedPages.get(r);if(!i)return;let n=this.state.agentId;try{let o=await this.pageChecker(e,r);if(!o)return;let{updatedAt:s,lastEditedBy:a}=o;if(!s||s===i.lastKnownUpdatedAt)return;if(a===n){i.lastKnownUpdatedAt=s,o.document&&(i.lastKnownDocument=o.document);return}let c="";if(i.lastKnownDocument&&o.document){let l=lw(i.lastKnownDocument,o.document),u=[];l.changed.length&&u.push(`changed: ${l.changed.join(", ")}`),l.added.length&&u.push(`added: ${l.added.join(", ")}`),l.removed.length&&u.push(`removed: ${l.removed.join(", ")}`),u.length&&(c=` (${u.join("; ")})`)}i.lastKnownUpdatedAt=s,o.document&&(i.lastKnownDocument=o.document),this.addEvent({type:"page_updated",peer:a??"someone",detail:`${i.title}${c}`,pageId:r,pageTitle:i.title})}catch{}}async catchUpChangedContent(e,r){if(!this.changedFetcher||this.state.watchedPages.size===0)return;let i;try{i=await this.changedFetcher(e,r)}catch{return}if(!(!i||i.length===0))for(let n of i)this.state.watchedPages.has(n.instanceId)&&await this.checkSingleWatchedPage(e,n.instanceId)}onMessageCreated(e){if(e.type!=="message_created")return;let r=e.message;r?.id&&this.processIncomingMessages([{id:r.id,content:Wr(r.content),senderName:r.senderName,senderCanonicalId:r.senderCanonicalId,createdAt:r.createdAt??new Date().toISOString(),parentMessageId:r.parentMessageId??void 0,mentionTargets:r.mentionTargets}])}onAskCreated(e){if(e.type!=="ask_created")return;let r=this.state.agentId;if(!r||e.to!==r)return;let i=typeof e.askId=="string"?e.askId:void 0;if(!i)return;let n=typeof e.title=="string"&&e.title?e.title:"(untitled ask)",o=typeof e.urgency=="string"&&e.urgency?` [${e.urgency}]`:"",s=typeof e.discussionActivityId=="string"?e.discussionActivityId:void 0,a=e.target,c=a?.id?` \xB7 about ${a.label?`"${a.label}" `:""}${a.id}`:"";this.addEvent({type:"ask",peer:typeof e.raisedByName=="string"&&e.raisedByName?e.raisedByName:"someone",detail:`${n}${o}${c} \u2014 answer with answer("${i}")`,threadId:s})}async checkMentions(e){if(!this.messageFetcher||!this.state.agentMeta?.displayName)return;let r=this.lastMentionCursor??void 0,i=await this.messageFetcher(e,r);!i||i.length===0||(this.lastMentionCursor=i[i.length-1].id,this.schedulePersist(),this.processIncomingMessages(i))}processIncomingMessages(e){let r=this.state.agentMeta?.displayName,i=this.state.agentId;if(!r)return;let n=r.toLowerCase();for(let o of e){if(this.seenMessageIds.has(o.id))continue;if(this.seenMessageIds.add(o.id),this.seenMessageIds.size>O2){let u=this.seenMessageIds.values().next().value;u!==void 0&&this.seenMessageIds.delete(u)}if(o.senderCanonicalId===i)continue;let s=Wr(o.content),a=s.toLowerCase(),c=i!=null&&(o.mentionTargets?.includes(i)??!1)||a.includes(n)||a.includes(`@${n}`),l=o.parentMessageId&&this.state.subscribedThreads.has(o.parentMessageId);if(c){let u=s.length>120?s.slice(0,120)+"...":s;this.addEvent({type:"mention",peer:o.senderName??"someone",detail:u,threadId:o.parentMessageId}),o.parentMessageId&&this.state.subscribeToThread(o.parentMessageId)}else if(l){let u=s.length>120?s.slice(0,120)+"...":s;this.addEvent({type:"thread_reply",peer:o.senderName??"someone",detail:u,threadId:o.parentMessageId})}}}async loadSessionState(){try{let e=await aC(this.sessionStatePath,"utf-8"),r=JSON.parse(e);if(r.lastMentionCursor&&(this.lastMentionCursor=r.lastMentionCursor,this.lastPersistedCursor=r.lastMentionCursor),r.subscribedThreads?.length)for(let i of r.subscribedThreads)this.state.subscribedThreads.add(i);if(r.readCursors)for(let[i,n]of Object.entries(r.readCursors))n&&this.state.readCursors.set(i,n);if(r.currentActivity&&!this.state.currentActivity&&this.state.trackActivity(r.currentActivity),r.officeHours?.length){let i=Date.now();for(let n of r.officeHours)n.role==="origin"&&n.until&&Date.parse(n.until)<=i||this.state.officeHours.has(n.pageId)||this.state.officeHours.set(n.pageId,n)}console.error(`[gigabuddy-inbox] Restored session state: cursor=${r.lastMentionCursor}, threads=${r.subscribedThreads?.length??0}, readCursors=${Object.keys(r.readCursors??{}).length}, activity=${r.currentActivity?.activityId??"none"}`)}catch{}}async persistSessionState(){let e={lastMentionCursor:this.lastMentionCursor,subscribedThreads:Array.from(this.state.subscribedThreads),readCursors:Object.fromEntries(this.state.readCursors),currentActivity:this.state.currentActivity,officeHours:Array.from(this.state.officeHours.values()),savedAt:new Date().toISOString()},r=this.sessionStatePath+".tmp";await sC(r,JSON.stringify(e,null,2)),await cC(r,this.sessionStatePath)}schedulePersist(){this.lastMentionCursor===this.lastPersistedCursor&&this.persistTimer||this.persistTimer||(this.persistTimer=setTimeout(()=>{this.persistTimer=null,this.lastPersistedCursor=this.lastMentionCursor,this.persistSessionState().catch(e=>console.error("[gigabuddy-inbox] Failed to persist session state:",e))},5e3))}scheduleWrite(){this.debounceTimer||(this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.writeInbox().catch(e=>{console.error("[gigabuddy-inbox] Failed to write inbox:",e)})},A2))}async refreshSessionName(e,r){let i=this.state.agentMeta;if(!i?.claudeSessionId)return;let n=await kc(i.claudeSessionId);n&&n!==i.sessionName&&(i.sessionName=n,e.updateTopicState(r,{sessionName:n}),this.scheduleWrite())}async refreshLocation(e,r){let i=await ez(this.state.agentMeta?.claudeSessionId);if(!i||i===this.lastLocationCwd)return;this.lastLocationCwd=i;let n=await Df(i);Lz(this.lastLocation,n)&&(this.lastLocation=n,e.updateTopicState(r,{repo:n.repo,branch:n.branch,worktree:n.worktree,worktreeId:n.worktreeId,isolated:n.isolated}),this.scheduleWrite())}async refreshContext(e,r){let i=await Gr(this.state.agentMeta?.claudeSessionId);if(!i)return;let n=Math.round(i.usedTokens/1e3),o=i.windowTokens==null?null:Math.round(i.windowTokens/1e3),s=i.pct==null?null:Math.round(i.pct);n===this.lastContextTokens&&o===this.lastContextWindowK&&s===this.lastContextPct&&i.shouldHandoff===this.lastShouldHandoff||(this.lastContextTokens=n,this.lastContextWindowK=o,this.lastContextPct=s,this.lastShouldHandoff=i.shouldHandoff,e.updateTopicState(r,{contextTokensK:n,contextWindowK:o,contextPct:s,shouldHandoff:i.shouldHandoff}),this.scheduleWrite())}async refreshResources(e,r){this.selfPidResolved||(this.selfPidResolved=!0,this.selfPid=(await Yo().catch(()=>null))?.claudePid??null);let[i,n,o]=await Promise.all([this.selfPid!=null?U_(this.selfPid):Promise.resolve(null),Xo(),this.selfPid!=null?Cf(this.selfPid):Promise.resolve(null)]),s=i==null?null:Math.round(i/25)*25,a=n?.pressure??null,c=n?.cpuPressure??null,l=Date.now(),u=null;if(o!=null&&this.lastCpuTicks!=null&&this.lastCpuSampleAt!=null){let p=(l-this.lastCpuSampleAt)/1e3;p>0&&(u=Math.max(0,Math.round((o-this.lastCpuTicks)/sz/p*10)/10))}if(o!=null&&(this.lastCpuTicks=o,this.lastCpuSampleAt=l),s===this.lastRssMb&&a===this.lastHostPressure&&c===this.lastCpuPressure&&u===this.lastCpuCores)return;this.lastRssMb=s,this.lastHostPressure=a,this.lastCpuPressure=c,this.lastCpuCores=u;let d={};s!=null&&(d.rssMb=s),a!=null&&(d.hostPressure=a),n?.memPct!=null&&(d.hostMemPct=n.memPct),u!=null&&(d.cpuCores=u),c!=null&&(d.hostCpuPressure=c),Object.keys(d).length!==0&&(e.updateTopicState(r,d),this.scheduleWrite())}async writeInbox(){this.seq++;let e=this.state.placeId;if(!e)return;let r={seq:this.seq,ts:new Date().toISOString(),self:{displayName:this.state.agentMeta?.displayName??"Unknown",agentId:this.state.agentId,placeId:e,activityId:this.state.currentActivity?.activityId??null,activityLabel:this.state.currentActivity?.label??null,sessionMode:this.state.currentActivity?.session?.mode==="staged"?"staged":null,sessionId:this.sessionId,claudeSessionId:this.state.agentMeta?.claudeSessionId??null,sessionName:this.state.agentMeta?.sessionName??null,contextTokensK:this.lastContextTokens,contextWindowK:this.lastContextWindowK,contextPct:this.lastContextPct,shouldHandoff:this.lastShouldHandoff,worktreeId:this.myWorktreeId(),officeHours:Array.from(this.state.officeHours.values())},peers:Array.from(this.previousPeers.values()),events:this.events.slice(-dw),...this.state.houseRuleHeadlines?.length?{houseRules:this.state.houseRuleHeadlines}:{}},i=this.inboxPath+".tmp";await sC(i,JSON.stringify(r,null,2)),await cC(i,this.inboxPath);let n=[...this.events].reverse().find(o=>o.type==="conflict");this.state.statuslineRenderer?.onInbox({displayName:r.self.displayName,placeName:this.state.agentMeta?.placeName??null,activityLabel:r.self.activityLabel,worktreeId:r.self.worktreeId,officeHours:r.self.officeHours,peers:r.peers.filter(o=>wc(o.beatAt)).map(o=>({displayName:o.displayName,owner:o.owner,worktreeId:o.worktreeId})),conflictFile:n?.files?.[0]??null,messageCount:this.events.filter(o=>o.type==="mention"||o.type==="thread_reply").length})}};import{randomUUID as M2}from"node:crypto";import{mkdir as j2,readFile as uC,writeFile as D2}from"node:fs/promises";import{homedir as U2}from"node:os";import{join as dC}from"node:path";var pC=dC(U2(),".gigabuddy"),pw=dC(pC,"machine-id"),_i=null;async function fw(){if(_i)return _i;try{let t=(await uC(pw,"utf-8")).trim();if(t)return _i=t,_i}catch{}try{await j2(pC,{recursive:!0}),await D2(pw,`${M2()}
|
|
232
|
-
`,{flag:"wx"})}catch{}try{_i=(await
|
|
231
|
+
`).trim()}function E2(t){return!t.content||typeof t.content=="string"||!Array.isArray(t.content)?"":t.content.map(e=>e.text??"").join("")}function cw(t){if(!t||!Array.isArray(t))return[];let e=[];for(let r=0;r<t.length;r++){let i=t[r];if(!i||i.type!=="heading")continue;let n=i.props?.level??2,o=E2(i);e.push({heading:o,level:n,startIndex:r,endIndex:t.length,id:String(i.id??""),ordinal:e.length+1})}for(let r=0;r<e.length;r++){let i=e[r];for(let n=r+1;n<e.length;n++)if(e[n].level<=i.level){i.endIndex=e[n].startIndex;break}}return e}function lw(t,e){let r=cw(t),i=cw(e),n=new Map;for(let l of r){let u=t.slice(l.startIndex,l.endIndex);n.set(l.heading,aw(u))}let o=new Map;for(let l of i){let u=e.slice(l.startIndex,l.endIndex);o.set(l.heading,aw(u))}let s=[],a=[],c=[];for(let[l,u]of o){let d=n.get(l);d===void 0?s.push(l):d!==u&&c.push(l)}for(let l of n.keys())o.has(l)||a.push(l);return{added:s,removed:a,changed:c}}var dw=50,O2=300,uC=25e3,N2=5*6e4,M2=500,j2=4e3,Hf=class{constructor(e,r,i){this.state=e;this.sessionId=r;this.pageChecker=i?.pageChecker??null,this.workspaceSyncer=i?.workspaceSyncer??null,this.profileSyncer=i?.profileSyncer??null,this.messageFetcher=i?.messageFetcher??null,this.changedFetcher=i?.changedFetcher??null}seq=0;events=[];previousPeers=new Map;debounceTimer=null;unsubscribe=null;outboxAbort=null;heartbeatTimer=null;lastHeartbeatWallMs=0;mentionWatchTimer=null;placeEventUnsub=null;connectionUnsub=null;contentDebounceTimers=new Map;hasConnected=!1;lastOutboxFile=null;pageChecker=null;messageFetcher=null;changedFetcher=null;lastContentSyncTs=null;workspaceSyncer=null;lastWorkspaceSyncTs=0;profileSyncer=null;lastProfileSyncTs=0;lastMentionCursor=null;lastPersistedCursor=null;seenMessageIds=new Set;persistTimer=null;lastContextPct=null;lastContextTokens=null;lastContextWindowK=null;lastShouldHandoff=!1;lastRssMb=null;lastHostPressure=null;lastCpuCores=null;lastCpuPressure=null;lastCpuTicks=null;lastCpuSampleAt=null;lastLocation=null;lastLocationCwd=null;selfPid=null;selfPidResolved=!1;get inboxPath(){return uw(Ye(this.sessionId),"inbox.json")}get sessionStatePath(){return uw(Ye(this.sessionId),"cursor.json")}async start(){await Br(this.sessionId);let e=this.state.awarenessManager,r=this.state.placeId;!e||!r||(await this.loadSessionState(),this.snapshotPeers(e,r),await this.writeInbox(),Jt(this.state),this.unsubscribe=e.onTopicUpdate(r,()=>{this.onPeerUpdate(e,r)}),this.watchOutbox(e,r),this.lastHeartbeatWallMs=Date.now(),this.heartbeatTimer=setInterval(async()=>{let i=Date.now(),n=i-this.lastHeartbeatWallMs;if(this.lastHeartbeatWallMs=i,n>uC*3&&e.forceReconnect){console.error(`[gigabuddy-inbox] Clock jump (${Math.round(n/1e3)}s since last beat) \u2014 presuming socket dead after machine sleep, reconnecting`);try{await e.forceReconnect()}catch(o){console.error("[gigabuddy-inbox] Post-sleep reconnect failed, will retry next beat:",o);return}Jt(this.state);return}if(!e.connected){if(await e.ensureConnected())try{await e.subscribe(r),e.updateTopicState(r,{displayName:this.state.agentMeta?.displayName,status:"active"}),console.error("[gigabuddy-inbox] Heartbeat restored dead connection")}catch{}return}await this.refreshSessionName(e,r),await this.refreshContext(e,r),await this.refreshResources(e,r),await this.refreshLocation(e,r),Jt(this.state)},uC),this.placeEventUnsub=e.onPlaceEvent(i=>{this.onContentChanged(r,i).catch(n=>console.error("[gigabuddy-inbox] content_changed handler error:",n)),this.onActivityChanged(i),this.onMessageCreated(i),this.onAskCreated(i)}),this.lastContentSyncTs=new Date().toISOString(),this.connectionUnsub=e.onConnectionChange(i=>{if(!i)return;if(!this.hasConnected){this.hasConnected=!0;return}let n=this.lastContentSyncTs??new Date(Date.now()-5*6e4).toISOString();this.lastContentSyncTs=new Date().toISOString(),this.catchUpChangedContent(r,n).catch(o=>console.error("[gigabuddy-inbox] reconnect catch-up error:",o)),this.checkMentions(r).catch(o=>console.error("[gigabuddy-inbox] reconnect mention catch-up error:",o))}),this.messageFetcher&&(this.lastMentionCursor||(this.lastMentionCursor=this.state.lastMessageCursor),this.checkMentions(r).catch(i=>console.error("[gigabuddy-inbox] Mention bootstrap error:",i)),this.mentionWatchTimer=setInterval(()=>{this.checkMentions(r).catch(i=>console.error("[gigabuddy-inbox] Mention check error:",i))},N2)))}stop(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.outboxAbort&&(this.outboxAbort.abort(),this.outboxAbort=null),this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),this.placeEventUnsub&&(this.placeEventUnsub(),this.placeEventUnsub=null);for(let e of this.contentDebounceTimers.values())clearTimeout(e);this.contentDebounceTimers.clear(),this.connectionUnsub&&(this.connectionUnsub(),this.connectionUnsub=null),this.mentionWatchTimer&&(clearInterval(this.mentionWatchTimer),this.mentionWatchTimer=null),this.persistTimer&&(clearTimeout(this.persistTimer),this.persistTimer=null),this.persistSessionState().catch(()=>{})}addEvent(e){e.type==="page_updated"&&e.pageId&&(this.events=this.events.filter(r=>!(r.type==="page_updated"&&r.pageId===e.pageId))),this.events.push({...e,ts:new Date().toISOString()}),this.events.length>dw&&(this.events=this.events.slice(-dw)),this.scheduleWrite()}notePosition(){this.schedulePersist()}noteSelfChanged(){this.scheduleWrite(),this.schedulePersist()}watchOutbox(e,r){let i=uw(Ye(this.sessionId),"outbox.json");this.outboxAbort=new AbortController;let n=null,o=async()=>{try{let a=await cC(i,"utf-8"),c=JSON.parse(a);if(c.ts&&c.ts!==n){n=c.ts;let l={lastActiveAt:c.ts};c.intent&&(l.action={label:c.intent});let u=c.recentFiles?.length?c.recentFiles:c.file?[c.file]:null;u&&JSON.stringify(u)!==JSON.stringify(this.lastOutboxFile?[this.lastOutboxFile]:[])&&(this.lastOutboxFile=u[0]??null,l.focus={kind:"files",ids:u}),c.owner&&(l.owner=c.owner),c.repo&&(l.repo=c.repo),c.branch&&(l.branch=c.branch),e.updateTopicState(r,l);let d=Date.now();if(this.workspaceSyncer&&d-this.lastWorkspaceSyncTs>1e4){this.lastWorkspaceSyncTs=d;let p={last_active_at:c.ts,status:"active"};c.intent&&(p.intent=c.intent),c.owner&&(p.owner=c.owner),c.repo&&(p.repo=c.repo),c.branch&&(p.branch=c.branch),c.recentFiles&&(p.recent_files=c.recentFiles),c.editedFiles&&(p.edited_files=c.editedFiles),c.uncommittedFiles&&(p.uncommitted_files=c.uncommittedFiles),c.gitStats&&(p.git_stats=c.gitStats),c.activeTask&&(p.active_task=c.activeTask),c.taskProgress&&(p.task_progress=c.taskProgress);let f=this.state.currentActivity?.activityId;f&&(p.activity_id=f),this.lastContextPct!=null&&(p.context_pct=this.lastContextPct);let m=this.state.agentMeta?.claudeSessionId,h=m?await xc(m):null;h&&(p.session_name=h),this.workspaceSyncer(p).catch(y=>console.error("[gigabuddy-inbox] Workspace sync error:",y))}if(this.profileSyncer&&d-this.lastProfileSyncTs>3e5){this.lastProfileSyncTs=d;let p=this.state.currentActivity?.label??c.activeTask??c.intent,f={lastDoing:{...p&&{label:p},...this.state.currentActivity?.activityId&&{activityId:this.state.currentActivity.activityId},...r&&{placeId:r},at:c.ts}};c.branch&&(f.branch=c.branch),this.lastContextPct!=null&&(f.metrics={contextPct:this.lastContextPct}),this.profileSyncer(f).catch(m=>console.error("[gigabuddy-inbox] Profile sync error:",m))}}}catch{}},s=setInterval(()=>{if(this.outboxAbort?.signal.aborted){clearInterval(s);return}o()},500);this.outboxAbort.signal.addEventListener("abort",()=>{clearInterval(s)})}onPeerUpdate(e,r){let i=this.buildPeerMap(e,r),n=this.getMyFocus(e,r);if(n.size>0){for(let[o,s]of i)if(s.focus){let a=s.focus.filter(c=>n.has(c));if(a.length>0){let c;for(let u=this.events.length-1;u>=0;u--){let d=this.events[u];if(d&&d.type==="conflict"&&d.peer===o){c=d;break}}c?.files&&JSON.stringify(c.files.sort())===JSON.stringify(a.sort())||this.addEvent({type:"conflict",peer:o,files:a})}}}this.previousPeers=i,this.scheduleWrite()}snapshotPeers(e,r){this.previousPeers=this.buildPeerMap(e,r)}buildPeerMap(e,r){let i=this.state.agentMeta?.displayName,n=new Map;for(let o of e.getTopicPeers(r)){let s=o.state,a=s.displayName??"Unknown";a===i||a==="Unknown"||a.startsWith("user:")||a.startsWith("agent:")||n.set(a,{displayName:a,owner:s.owner??null,status:s.status??"unknown",action:s.action?.label??null,focus:s.focus?.ids??null,activityId:s.activityId??null,lastActiveAt:s.lastActiveAt??null,beatAt:typeof s.beatAt=="number"?s.beatAt:null,coldSecs:typeof s.coldSecs=="number"?s.coldSecs:null,repo:s.repo??null,branch:s.branch??null,worktreeId:s.worktreeId??null})}return n}myWorktreeId(){let e=this.state.placeId,r=this.state.awarenessManager;return!e||!r?null:r.topics?.get(e)?.localState?.worktreeId??null}getMyFocus(e,r){let o=e.topics?.get(r)?.localState?.focus;return new Set(o?.ids??[])}onActivityChanged(e){if(e.type!=="activity_changed"||e.change!=="attachment")return;let r=e.activityId;if(!r||!this.state.activeActivities.has(r))return;let i=e.actorId;if(i&&this.state.agentId&&i===this.state.agentId)return;let n=e.memberLabel?.trim(),o=e.memberKind??"item";this.addEvent({type:"attachment",peer:i??"someone",detail:n?`"${n}" (${o})`:`a ${o}`})}async onContentChanged(e,r){if(r.type!=="content_changed")return;let i=r.instanceId;!i||!this.state.watchedPages.has(i)||(r.ts&&(!this.lastContentSyncTs||r.ts>this.lastContentSyncTs)&&(this.lastContentSyncTs=r.ts),this.scheduleContentCheck(e,i))}scheduleContentCheck(e,r){let i=this.contentDebounceTimers.get(r);i&&clearTimeout(i);let n=setTimeout(()=>{this.contentDebounceTimers.delete(r),this.checkSingleWatchedPage(e,r).catch(o=>console.error("[gigabuddy-inbox] content check error:",o))},j2);this.contentDebounceTimers.set(r,n)}async checkSingleWatchedPage(e,r){if(!this.pageChecker)return;let i=this.state.watchedPages.get(r);if(!i)return;let n=this.state.agentId;try{let o=await this.pageChecker(e,r);if(!o)return;let{updatedAt:s,lastEditedBy:a}=o;if(!s||s===i.lastKnownUpdatedAt)return;if(a===n){i.lastKnownUpdatedAt=s,o.document&&(i.lastKnownDocument=o.document);return}let c="";if(i.lastKnownDocument&&o.document){let l=lw(i.lastKnownDocument,o.document),u=[];l.changed.length&&u.push(`changed: ${l.changed.join(", ")}`),l.added.length&&u.push(`added: ${l.added.join(", ")}`),l.removed.length&&u.push(`removed: ${l.removed.join(", ")}`),u.length&&(c=` (${u.join("; ")})`)}i.lastKnownUpdatedAt=s,o.document&&(i.lastKnownDocument=o.document),this.addEvent({type:"page_updated",peer:a??"someone",detail:`${i.title}${c}`,pageId:r,pageTitle:i.title})}catch{}}async catchUpChangedContent(e,r){if(!this.changedFetcher||this.state.watchedPages.size===0)return;let i;try{i=await this.changedFetcher(e,r)}catch{return}if(!(!i||i.length===0))for(let n of i)this.state.watchedPages.has(n.instanceId)&&await this.checkSingleWatchedPage(e,n.instanceId)}onMessageCreated(e){if(e.type!=="message_created")return;let r=e.message;r?.id&&this.processIncomingMessages([{id:r.id,content:Wr(r.content),senderName:r.senderName,senderCanonicalId:r.senderCanonicalId,createdAt:r.createdAt??new Date().toISOString(),parentMessageId:r.parentMessageId??void 0,mentionTargets:r.mentionTargets}])}onAskCreated(e){if(e.type!=="ask_created")return;let r=this.state.agentId;if(!r||e.to!==r)return;let i=typeof e.askId=="string"?e.askId:void 0;if(!i)return;let n=typeof e.title=="string"&&e.title?e.title:"(untitled ask)",o=typeof e.urgency=="string"&&e.urgency?` [${e.urgency}]`:"",s=typeof e.discussionActivityId=="string"?e.discussionActivityId:void 0,a=e.target,c=a?.id?` \xB7 about ${a.label?`"${a.label}" `:""}${a.id}`:"";this.addEvent({type:"ask",peer:typeof e.raisedByName=="string"&&e.raisedByName?e.raisedByName:"someone",detail:`${n}${o}${c} \u2014 answer with answer("${i}")`,threadId:s})}async checkMentions(e){if(!this.messageFetcher||!this.state.agentMeta?.displayName)return;let r=this.lastMentionCursor??void 0,i=await this.messageFetcher(e,r);!i||i.length===0||(this.lastMentionCursor=i[i.length-1].id,this.schedulePersist(),this.processIncomingMessages(i))}processIncomingMessages(e){let r=this.state.agentMeta?.displayName,i=this.state.agentId;if(!r)return;let n=r.toLowerCase();for(let o of e){if(this.seenMessageIds.has(o.id))continue;if(this.seenMessageIds.add(o.id),this.seenMessageIds.size>M2){let u=this.seenMessageIds.values().next().value;u!==void 0&&this.seenMessageIds.delete(u)}if(o.senderCanonicalId===i)continue;let s=Wr(o.content),a=s.toLowerCase(),c=i!=null&&(o.mentionTargets?.includes(i)??!1)||a.includes(n)||a.includes(`@${n}`),l=o.parentMessageId&&this.state.subscribedThreads.has(o.parentMessageId);if(c){let u=s.length>120?s.slice(0,120)+"...":s;this.addEvent({type:"mention",peer:o.senderName??"someone",detail:u,threadId:o.parentMessageId}),o.parentMessageId&&this.state.subscribeToThread(o.parentMessageId)}else if(l){let u=s.length>120?s.slice(0,120)+"...":s;this.addEvent({type:"thread_reply",peer:o.senderName??"someone",detail:u,threadId:o.parentMessageId})}}}async loadSessionState(){try{let e=await cC(this.sessionStatePath,"utf-8"),r=JSON.parse(e);if(r.lastMentionCursor&&(this.lastMentionCursor=r.lastMentionCursor,this.lastPersistedCursor=r.lastMentionCursor),r.subscribedThreads?.length)for(let i of r.subscribedThreads)this.state.subscribedThreads.add(i);if(r.readCursors)for(let[i,n]of Object.entries(r.readCursors))n&&this.state.readCursors.set(i,n);if(r.currentActivity&&!this.state.currentActivity&&this.state.trackActivity(r.currentActivity),r.officeHours?.length){let i=Date.now();for(let n of r.officeHours)n.role==="origin"&&n.until&&Date.parse(n.until)<=i||this.state.officeHours.has(n.pageId)||this.state.officeHours.set(n.pageId,n)}console.error(`[gigabuddy-inbox] Restored session state: cursor=${r.lastMentionCursor}, threads=${r.subscribedThreads?.length??0}, readCursors=${Object.keys(r.readCursors??{}).length}, activity=${r.currentActivity?.activityId??"none"}`)}catch{}}async persistSessionState(){let e={lastMentionCursor:this.lastMentionCursor,subscribedThreads:Array.from(this.state.subscribedThreads),readCursors:Object.fromEntries(this.state.readCursors),currentActivity:this.state.currentActivity,officeHours:Array.from(this.state.officeHours.values()),savedAt:new Date().toISOString()},r=this.sessionStatePath+".tmp";await aC(r,JSON.stringify(e,null,2)),await lC(r,this.sessionStatePath)}schedulePersist(){this.lastMentionCursor===this.lastPersistedCursor&&this.persistTimer||this.persistTimer||(this.persistTimer=setTimeout(()=>{this.persistTimer=null,this.lastPersistedCursor=this.lastMentionCursor,this.persistSessionState().catch(e=>console.error("[gigabuddy-inbox] Failed to persist session state:",e))},5e3))}scheduleWrite(){this.debounceTimer||(this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.writeInbox().catch(e=>{console.error("[gigabuddy-inbox] Failed to write inbox:",e)})},O2))}async refreshSessionName(e,r){let i=this.state.agentMeta;if(!i?.claudeSessionId)return;let n=await xc(i.claudeSessionId);n&&n!==i.sessionName&&(i.sessionName=n,e.updateTopicState(r,{sessionName:n}),this.scheduleWrite())}async refreshLocation(e,r){let i=await tz(this.state.agentMeta?.claudeSessionId);if(!i||i===this.lastLocationCwd)return;this.lastLocationCwd=i;let n=await Df(i);Zz(this.lastLocation,n)&&(this.lastLocation=n,e.updateTopicState(r,{repo:n.repo,branch:n.branch,worktree:n.worktree,worktreeId:n.worktreeId,isolated:n.isolated}),this.scheduleWrite())}async refreshContext(e,r){let i=await Gr(this.state.agentMeta?.claudeSessionId);if(!i)return;let n=Math.round(i.usedTokens/1e3),o=i.windowTokens==null?null:Math.round(i.windowTokens/1e3),s=i.pct==null?null:Math.round(i.pct);n===this.lastContextTokens&&o===this.lastContextWindowK&&s===this.lastContextPct&&i.shouldHandoff===this.lastShouldHandoff||(this.lastContextTokens=n,this.lastContextWindowK=o,this.lastContextPct=s,this.lastShouldHandoff=i.shouldHandoff,e.updateTopicState(r,{contextTokensK:n,contextWindowK:o,contextPct:s,shouldHandoff:i.shouldHandoff}),this.scheduleWrite())}async refreshResources(e,r){this.selfPidResolved||(this.selfPidResolved=!0,this.selfPid=(await Yo().catch(()=>null))?.claudePid??null);let[i,n,o]=await Promise.all([this.selfPid!=null?U_(this.selfPid):Promise.resolve(null),Xo(),this.selfPid!=null?Cf(this.selfPid):Promise.resolve(null)]),s=i==null?null:Math.round(i/25)*25,a=n?.pressure??null,c=n?.cpuPressure??null,l=Date.now(),u=null;if(o!=null&&this.lastCpuTicks!=null&&this.lastCpuSampleAt!=null){let p=(l-this.lastCpuSampleAt)/1e3;p>0&&(u=Math.max(0,Math.round((o-this.lastCpuTicks)/az/p*10)/10))}if(o!=null&&(this.lastCpuTicks=o,this.lastCpuSampleAt=l),s===this.lastRssMb&&a===this.lastHostPressure&&c===this.lastCpuPressure&&u===this.lastCpuCores)return;this.lastRssMb=s,this.lastHostPressure=a,this.lastCpuPressure=c,this.lastCpuCores=u;let d={};s!=null&&(d.rssMb=s),a!=null&&(d.hostPressure=a),n?.memPct!=null&&(d.hostMemPct=n.memPct),u!=null&&(d.cpuCores=u),c!=null&&(d.hostCpuPressure=c),Object.keys(d).length!==0&&(e.updateTopicState(r,d),this.scheduleWrite())}async writeInbox(){this.seq++;let e=this.state.placeId;if(!e)return;let r={seq:this.seq,ts:new Date().toISOString(),self:{displayName:this.state.agentMeta?.displayName??"Unknown",agentId:this.state.agentId,placeId:e,activityId:this.state.currentActivity?.activityId??null,activityLabel:this.state.currentActivity?.label??null,sessionMode:this.state.currentActivity?.session?.mode==="staged"?"staged":null,sessionId:this.sessionId,claudeSessionId:this.state.agentMeta?.claudeSessionId??null,sessionName:this.state.agentMeta?.sessionName??null,contextTokensK:this.lastContextTokens,contextWindowK:this.lastContextWindowK,contextPct:this.lastContextPct,shouldHandoff:this.lastShouldHandoff,worktreeId:this.myWorktreeId(),officeHours:Array.from(this.state.officeHours.values())},peers:Array.from(this.previousPeers.values()),events:this.events.slice(-dw),...this.state.houseRuleHeadlines?.length?{houseRules:this.state.houseRuleHeadlines}:{}},i=this.inboxPath+".tmp";await aC(i,JSON.stringify(r,null,2)),await lC(i,this.inboxPath);let n=[...this.events].reverse().find(o=>o.type==="conflict");this.state.statuslineRenderer?.onInbox({displayName:r.self.displayName,placeName:this.state.agentMeta?.placeName??null,activityLabel:r.self.activityLabel,worktreeId:r.self.worktreeId,officeHours:r.self.officeHours,peers:r.peers.filter(o=>$c(o.beatAt)).map(o=>({displayName:o.displayName,owner:o.owner,worktreeId:o.worktreeId})),conflictFile:n?.files?.[0]??null,messageCount:this.events.filter(o=>o.type==="mention"||o.type==="thread_reply").length})}};import{randomUUID as D2}from"node:crypto";import{mkdir as U2,readFile as dC,writeFile as L2}from"node:fs/promises";import{homedir as Z2}from"node:os";import{join as pC}from"node:path";var fC=pC(Z2(),".gigabuddy"),pw=pC(fC,"machine-id"),_i=null;async function fw(){if(_i)return _i;try{let t=(await dC(pw,"utf-8")).trim();if(t)return _i=t,_i}catch{}try{await U2(fC,{recursive:!0}),await L2(pw,`${D2()}
|
|
232
|
+
`,{flag:"wx"})}catch{}try{_i=(await dC(pw,"utf-8")).trim()||null}catch{_i=null}return _i}function mC(t,e=Date.now()){let r=Date.parse(t)-e,i=Math.round(Math.abs(r)/6e4),n=i<1?"<1 min":i<90?`${i} min`:`~${Math.round(i/60)}h`;return r>=0?`~${n} left`:`${n} ago`}function F2(t){if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"){let r=Date.parse(t);return Number.isNaN(r)?null:r}let e=t;return e&&typeof e._seconds=="number"?e._seconds*1e3:e&&typeof e.seconds=="number"?e.seconds*1e3:null}function Ec(t,e=Date.now()){let r=F2(t);if(r===null)return"";let i=Math.max(0,Math.round((e-r)/1e3));if(i<45)return"just now";let n=Math.round(i/60);if(n<90)return`${Math.max(1,n)} min ago`;let o=Math.round(n/60);return o<36?`${o}h ago`:`${Math.round(o/24)} days ago`}function hC(t,e){let r={get(i,n,o){if(n!=="updateTopicState"){let s=Reflect.get(i,n,o);return typeof s=="function"?s.bind(i):s}return(s,a)=>{i.updateTopicState(s,a);let c=e.getSponsorTopic(),l=e.getPlaceId();!c||!l||s!==l||i.updateTopicState(c,{...e.getLocation(),...a})}}};return new Proxy(t,r)}async function gC(t,e,r){let i=await t.claimWork(e,r,{from:"open",to:"active"}).catch(()=>null);i&&!i.won&&(i.status==="stalled"||i.status==="parked")&&await t.claimWork(e,r,{from:i.status,to:"active"}).catch(()=>{})}async function mw(t,e,r){await t.claimWork(e,r,{from:"active",to:"open"}).catch(()=>{})}async function q2(t,e,r){let i=await t.getActivity(e,r).catch(()=>null);for(let n of i?.attachments??[]){if(n.kind!=="content")continue;let o=await t.getPlaceContent(e,n.id).catch(()=>null),s=o?.instance??o;if(s?.data?.handedOverAt)return{id:s.id??n.id,handedOverBy:s.data.handedOverBy??null}}return null}async function Wf(t,e,r){let i=await t.getActivity(e,r).catch(()=>null),n={pageId:null,title:null,handover:null,workItemId:null,workItemStatus:null,originActorId:null};for(let o of i?.attachments??[]){if(o.kind!=="page"&&o.kind!=="content")continue;let s=await t.getPlaceContent(e,o.id).catch(()=>null),a=s?.instance??s;if(a?.data){if(o.kind==="page"&&a.data.handover&&!n.pageId){n.pageId=a.id??o.id,n.title=a.data.title??null,n.handover=a.data.handover;let c=n.handover.origin??{};n.originActorId=c.actorId??n.originActorId}else o.kind==="content"&&a.data.handedOverAt&&!n.workItemId&&(n.workItemId=a.id??o.id,n.workItemStatus=a.data.status??null,n.originActorId??=a.data.handedOverBy??null);if(n.pageId&&n.workItemId)break}}return n.pageId||n.workItemId?n:null}async function yC(t,e,r,i){let n=await q2(t,e,r).catch(()=>null);!n||i!=null&&n.handedOverBy===i||await mw(t,e,n.id)}var vC="VnkEV4zbGztvjGknQwt-w";function H2(t){let e=t.sessionId??(t.claudeSessionId?`cc_${t.claudeSessionId}`:null);return e===null?{sessionId:`orient_${process.pid}`,orientOnly:!0}:{sessionId:e,orientOnly:!1}}function W2(t,e,r){if(t.some(s=>s.placeId===e.id))return null;let i=r.find(s=>s.id===e.tenancyId),n=`"${e.name}" (${e.id}) in club "${i?.name??e.tenancyId??"unknown"}"`+(e.visibility==="public"?" \u2014 a PUBLIC room":"");return`Not connecting yet: ${t.length>0?`This repo's sessions have used: ${t.map(s=>`"${s.placeName??s.placeId}"`).join(", ")} \u2014 never ${n}.`:`This repo has no sanctioned rooms yet; the first one deserves a deliberate choice \u2014 you asked for ${n}.`}
|
|
233
233
|
|
|
234
|
-
If the user really wants this session in that room, call connect again with confirm: true \u2014 it will be remembered for this repo and not asked again. Check with them first: everything this session posts will land there.`}var vC="sanctioned-places.json";async function bC(){try{let t=await Bf(Jr(Et(),vC),"utf-8"),e=JSON.parse(t);if(Array.isArray(e.places))return e.places.filter(r=>typeof r.placeId=="string")}catch{}try{let t=await Bf(Jr(Et(),"connection.json"),"utf-8"),e=JSON.parse(t);if(e.placeId)return[{placeId:e.placeId,placeName:e.placeName,tenancyId:e.tenancyId}]}catch{}return[]}async function H2(t){let e=(await bC()).filter(r=>r.placeId!==t.placeId);e.push({...t,sanctionedAt:new Date().toISOString()}),await E_(),await Oc(Jr(Et(),vC),JSON.stringify({places:e},null,2))}async function W2(t){try{let e=await Bf(Jr(Ye(t),"session.json"),"utf-8");return JSON.parse(e)}catch{return null}}async function Ec(t){await Br(t.sessionId),await Oc(Jr(Ye(t.sessionId),"session.json"),JSON.stringify(t,null,2))}async function B2(t,e){try{let r=await Bf(Jr(Ye(t),"ws.json"),"utf-8"),i=JSON.parse(r);return i.placeId===e&&i.instanceId?i.instanceId:null}catch{return null}}async function G2(t,e,r){await Br(t),await Oc(Jr(Ye(t),"ws.json"),JSON.stringify({placeId:e,instanceId:r}))}function J2(t){try{return JSON.parse(atob(t.split(".")[1])).actingAs?.sub??null}catch{return null}}function K2(t){try{return JSON.parse(atob(t.split(".")[1])).principalType==="agent"}catch{return!1}}function Y2(t){try{return JSON.parse(atob(t.split(".")[1])).sub??null}catch{return null}}function X2(t,e){return{...t.tenancyId?{tenancyId:t.tenancyId,installationId:t.tenancyId}:{},placeId:e}}function Q2(t,e){let r=e.map(c=>c.state),i=c=>r.filter(l=>l.activityId===c).map(l=>l.displayName??"Unknown"),n=c=>c.updatedAt??c.createdAt??"",o=(c,l)=>({id:c.id,label:c.label,peerName:l?i(c.id).join(", "):void 0,updatedAgo:n(c)?Ac(n(c)):void 0}),s=t.filter(c=>i(c.id).length>0),a=t.filter(c=>i(c.id).length===0&&n(c)).sort((c,l)=>n(l).localeCompare(n(c)));return[...s.slice(0,10).map(c=>o(c,!0)),...a.map(c=>o(c,!1))].slice(0,10)}async function hw(t,e,r,i){i.sessionIntent=MP(t.session)??i.sessionIntent;let n=t.sessionId?{sessionId:t.sessionId,hostSessionId:t.claudeSessionId}:t.claudeSessionId?{sessionId:`cc_${t.claudeSessionId}`,hostSessionId:t.claudeSessionId}:null;n||(n=await e.host.resolveSession()??await e.host.fallbackSession());let{sessionId:o,orientOnly:s}=q2({sessionId:n?.sessionId,claudeSessionId:n?.hostSessionId}),a;try{a=await r.withTokenProvider(e.getToken,()=>r.getPlace(t.placeId))}catch(j){throw new Error(`Place not found or not accessible: ${t.placeId} (${j instanceof Error?j.message:String(j)})`)}let c=X2(a,t.placeId),l=null,u=e.getToken,d=t.displayName,p=s?null:await W2(o);if(p&&p.placeId===t.placeId){l=p.agentId;let j=p.agentToken;u=()=>Promise.resolve(j),d=p.displayName,r.setTokenProvider(u);let de=async()=>{console.error("[gigabuddy] Cached agent token expired, re-minting..."),r.setTokenProvider(e.getToken);let ce=await r.requestAgentToken({displayName:d,sessionId:o,scope:c});j=ce.token,l=ce.agentId,u=()=>Promise.resolve(j),r.setTokenProvider(u),Ec({sessionId:o,agentId:ce.agentId,agentToken:j,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),console.error("[gigabuddy] Agent token re-minted successfully")};if((()=>{try{let ce=JSON.parse(atob(j.split(".")[1]));return ce.exp?ce.exp*1e3<Date.now():!1}catch{return!0}})())try{await de()}catch(ce){console.error(`[gigabuddy] Re-mint failed, falling back to human token: ${ce instanceof Error?ce.message:String(ce)}`),r.setTokenProvider(e.getToken),u=e.getToken}Ec({sessionId:o,agentId:l??p.agentId,agentToken:j,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),r.setOnTokenExpired(async()=>{try{await de()}catch(ce){throw console.error(`[gigabuddy] Re-mint failed: ${ce instanceof Error?ce.message:String(ce)}`),ce}}),console.error(`[gigabuddy] Reusing cached identity: ${d} (${l})`)}else if(!s&&K2(await e.getToken())){let j=await e.getToken();if(l=Y2(j),u=e.getToken,r.setTokenProvider(u),console.error("[gigabuddy] Bearer is already an agent principal \u2014 skipping /api/token/agent mint."),l)try{await r.updateAgentProfile(l,{...t.workdir&&{workdir:t.workdir},...o&&{sessionLabel:o}})}catch{}}else if(s)console.error("[gigabuddy] No resolvable session \u2014 orienting read-only (no identity minted).");else try{let j=await r.requestAgentToken({displayName:t.displayName,sessionId:o,scope:c});l=j.agentId;let de=j.token;u=()=>Promise.resolve(de),j.nickname&&(d=j.nickname),Ec({sessionId:o,agentId:l,agentToken:de,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(we=>console.error("[gigabuddy] Failed to cache session:",we)),r.setTokenProvider(u),r.setOnTokenExpired(async()=>{console.error("[gigabuddy] Agent token expired, re-minting...");try{r.setTokenProvider(e.getToken);let we=await r.requestAgentToken({displayName:d,sessionId:o,scope:c});de=we.token,u=()=>Promise.resolve(de),r.setTokenProvider(u),Ec({sessionId:o,agentId:we.agentId,agentToken:de,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),console.error("[gigabuddy] Agent token re-minted successfully")}catch(we){throw console.error(`[gigabuddy] Re-mint failed: ${we instanceof Error?we.message:String(we)}`),we}});try{await r.updateAgentProfile(l,{...t.workdir&&{workdir:t.workdir},...o&&{sessionLabel:o}})}catch{}}catch(j){console.error(`[gigabuddy] Agent token failed, using human token: ${j instanceof Error?j.message:String(j)}`)}i.placeId=t.placeId,i.tenancyId=a.tenancyId??null,i.agentId=l,r.setTokenProvider(u);let f=async()=>{if(s)return u();let j=await u();try{let de=JSON.parse(atob(j.split(".")[1]));if(de.exp&&de.exp*1e3<Date.now()){console.error("[gigabuddy] WS token expired, re-minting for reconnect..."),r.setTokenProvider(e.getToken);let we=await r.requestAgentToken({displayName:d,sessionId:o,scope:c});return u=()=>Promise.resolve(we.token),r.setTokenProvider(u),l=we.agentId,Ec({sessionId:o,agentId:we.agentId,agentToken:we.token,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),we.token}}catch{}return j},m=e.createAwarenessManager({getToken:f,buildWsUrl:j=>r.buildAwarenessWsUrl(j),user:{displayName:d,canonicalId:l??o}}),h=mC(m,{getPlaceId:()=>t.placeId,getSponsorTopic:()=>i.sponsorTopic,getLocation:()=>({agentId:l,placeId:t.placeId,placeName:a.name,activityLabel:i.currentActivity?.label})});await h.connect(),await h.subscribe(t.placeId);let y=s?null:J2(await u());y&&(i.sponsorTopic=`sponsor:${y}`,await h.subscribe(i.sponsorTopic));let _=t.workdir??process.cwd(),{owner:k,repo:w,branch:$,...S}=await Df(_),G={displayName:d,canonicalId:l??o,status:"active",typing:!1,coldSecs:H_()};k&&(G.owner=k),w&&(G.repo=w),$&&(G.branch=$),S.worktreeId&&(G.worktree=S.worktree,G.worktreeId=S.worktreeId,G.isolated=S.isolated);let q=n?.hostSessionId,I=n?await e.host.readSessionName(n):null;q&&(G.claudeSessionId=q),I&&(G.sessionName=I),G.client=e.host.clientLabel;let se=await fw().catch(()=>null),{hostname:ue,container:ae}=await lz(se);G.host=ae?`${ue} (devcontainer)`:ue,se&&(G.machineId=se),s||h.updateTopicState(t.placeId,G),i.awarenessManager=h,!s&&i.livePageManagerFactory&&(i.livePageManager=i.livePageManagerFactory(h,{name:d,canonicalId:l??o})),i.agentMeta={displayName:d,sessionId:o,claudeSessionId:q,sessionName:I??void 0,placeName:a.name,workdir:t.workdir};let Me=new Hf(i,o,{workspaceSyncer:async j=>{!i.workspaceInstanceId||!i.placeId||await r.updatePlaceContent(i.placeId,i.workspaceInstanceId,j)},profileSyncer:async j=>{l&&await r.updateAgentProfile(l,j)},pageChecker:async(j,de)=>{try{let we=await r.getPlaceContent(j,de),ce=we.instance??we,On=ce.data;return{updatedAt:ce.updatedAt??null,lastEditedBy:On?.lastEditedBy??null,document:On?.document??void 0}}catch{return null}},messageFetcher:async(j,de)=>{try{return(await r.getMessages(j,{limit:50,after:de})).messages.map(ce=>({id:ce.id,content:Wr(ce.content),senderName:ce.senderName,senderCanonicalId:ce.senderCanonicalId,createdAt:ce.createdAt,parentMessageId:ce.parentMessageId,mentionTargets:ce.mentionTargets}))}catch{return null}},changedFetcher:async(j,de)=>{try{return await r.getChangedContent(j,de)}catch{return null}}});i.inboxWriter=Me,Me.start().catch(j=>console.error("[gigabuddy] Inbox writer error:",j)),i.statuslineRenderer?.setPlaceConnected(!0),h.onConnectionChange(j=>i.statuslineRenderer?.setWsConnected(j));let je=new Of;je.onMessage(j=>{if(j.type!=="page.saved"||!j.pageId)return;let de=i.watchedPages.get(j.pageId);i.inboxWriter?.addEvent({type:"page_updated",peer:"human (VS Code)",detail:de?.title??j.pageId})}),je.start(t.placeId),i.bridge=je,!s&&n&&e.host.markConnected(n).catch(()=>{});let ie=JSON.stringify({tenancyId:a.tenancyId??null,orgId:a.orgId??null,placeId:t.placeId,placeName:a.name},null,2);Oc(Jr(Et(),"connection.json"),ie).catch(()=>{}),Oc(Jr(F2(),".gigabuddy","connection.json"),ie).catch(()=>{}),i.connected=!0,i.placeConversationId=a.conversationId??null;let qe=h.getTopicPeers(t.placeId),He={messages:[]},Je=[],Ot=null;try{[He,Je,Ot]=await Promise.all([r.getMessages(t.placeId,{limit:20}),r.listActivities(t.placeId,{status:"active"}),kz(r,t.placeId)])}catch(j){console.error(`[gigabuddy] Warmup calls failed (non-fatal): ${j instanceof Error?j.message:String(j)}`)}if(i.houseRuleHeadlines=Ot?xz(Ot):null,!s)try{let j=await fw().catch(()=>null),de={display_name:d,owner:k??void 0,repo:w??void 0,branch:$??void 0,status:"active",last_active_at:new Date().toISOString(),claude_session_id:q??void 0,session_name:I??void 0,machine_id:j??void 0,cwd:_},we=await B2(o,t.placeId);if(!we)try{let On=((await r.listPlaceContent(t.placeId,{contextSchemaId:yC,limit:200})).instances??[]).find(jc=>(jc.data??{}).session_id===o);On?.id&&(we=On.id)}catch(ce){console.error(`[gigabuddy] Workspace lookup failed (creating fresh record): ${ce instanceof Error?ce.message:String(ce)}`)}if(we)await r.updatePlaceContent(t.placeId,we,{connected_at:new Date().toISOString(),...de}),i.workspaceInstanceId=we;else{let ce=await r.createPlaceContent(t.placeId,"agent_workspace",{session_id:o,connected_at:new Date().toISOString(),...de},{contextSchemaId:yC});i.workspaceInstanceId=ce.instance?.id??null}i.workspaceInstanceId?(await G2(o,t.placeId,i.workspaceInstanceId).catch(()=>{}),console.error(`[gigabuddy] Workspace instance: ${i.workspaceInstanceId}`)):console.error("[gigabuddy] Workspace instance NOT persisted (create returned no id)")}catch(j){console.error(`[gigabuddy] Workspace instance write failed (non-fatal): ${j instanceof Error?j.message:String(j)}`)}if(He.messages.length>0){let j=He.messages[He.messages.length-1];j&&(i.lastMessageCursor=j.id)}if(!s&&e.onConnected)try{e.onConnected()}catch(j){console.error(`[gigabuddy] onConnected hook failed (non-fatal): ${j instanceof Error?j.message:j}`)}return{placeName:a.name,placeDescription:a.description?.trim()||null,houseRules:Ot,tenancyId:a.tenancyId??null,visibility:a.visibility??null,agentId:l,displayName:d,sessionId:o,peers:qe.map(j=>{let de=j.state;return{name:de.displayName??"Unknown",status:de.status??"unknown",action:de.action?.label,activityId:de.activityId??void 0}}),liveActivities:Q2(Je,qe),totalActiveActivities:Je.length,recentMessages:He.messages.slice(-5).map(j=>{let de=Wr(j.content);return{sender:j.senderName??"Unknown",time:j.createdAt?Ac(j.createdAt):"",content:de.length>100?de.slice(0,100)+"...":de}}),totalMessages:He.messages.length}}function _C(t,e,r,i){t.tool("list_places","List places you have access to. Use this to discover available places before connecting.",{},async()=>{try{return await e.withTokenProvider(i.getToken,async()=>{let n=await e.listTenancies();if(n.length===0)return{content:[{type:"text",text:"Sorry \u2014 you're not a member of a Gigabuddy club yet. Join the waitlist at gigabuddy.com, or ask a club admin for an invite."}]};let o=[];for(let s of n){o.push(`Tenancy: ${s.name} (${s.id})`);try{let a=await e.listPlaces(s.id);if(a.length===0)o.push(" No places");else for(let c of a){let l=c.description?` \u2014 ${c.description}`:"",u=c.memberCount?` (${c.memberCount} members)`:"";o.push(` - ${c.name}${u}${l}`),o.push(` id: ${c.id}`)}}catch(a){o.push(` Error listing places: ${a instanceof Error?a.message:String(a)}`)}o.push("")}return{content:[{type:"text",text:o.join(`
|
|
235
|
-
`)}]}})}catch(n){return{content:[{type:"text",text:`Failed to list places: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("open_browser_session","Open an interactive BROWSER session as yourself (this agent) so you can drive Gigabuddy or the chat-app in a real browser (e.g. via Playwright) \u2014 logged in as your own agent identity, with your human sponsor attached. Returns a one-time, short-lived URL to navigate to. You must `connect` to a place first (that establishes your identity).",{app:F.enum([Be().webAppKey,"chat-app"]).optional().describe(`Which web app to open (default: ${Be().webAppKey})`),placeId:F.string().optional().describe("Place to open after sign-in (defaults to your connected place)"),baseUrl:F.string().optional().describe("Override the app base URL for local dev / staging, e.g. http://localhost:3012")},async n=>{try{if(!r.connected||!r.agentId)return{content:[{type:"text",text:"Connect to a place first (use `connect`) \u2014 your agent identity is established on connect."}],isError:!0};let o=await i.getToken(),s=await e.requestBrowserSession(o,{agentId:r.agentId,app:n.app??Be().webAppKey,placeId:n.placeId??r.placeId??void 0,baseUrl:n.baseUrl});return{content:[{type:"text",text:`Browser session ready for ${s.nickname??s.displayName??r.agentId} (expires ${
|
|
234
|
+
If the user really wants this session in that room, call connect again with confirm: true \u2014 it will be remembered for this repo and not asked again. Check with them first: everything this session posts will land there.`}var bC="sanctioned-places.json";async function _C(){try{let t=await Bf(Jr(Et(),bC),"utf-8"),e=JSON.parse(t);if(Array.isArray(e.places))return e.places.filter(r=>typeof r.placeId=="string")}catch{}try{let t=await Bf(Jr(Et(),"connection.json"),"utf-8"),e=JSON.parse(t);if(e.placeId)return[{placeId:e.placeId,placeName:e.placeName,tenancyId:e.tenancyId}]}catch{}return[]}async function B2(t){let e=(await _C()).filter(r=>r.placeId!==t.placeId);e.push({...t,sanctionedAt:new Date().toISOString()}),await E_(),await Nc(Jr(Et(),bC),JSON.stringify({places:e},null,2))}async function G2(t){try{let e=await Bf(Jr(Ye(t),"session.json"),"utf-8");return JSON.parse(e)}catch{return null}}async function Oc(t){await Br(t.sessionId),await Nc(Jr(Ye(t.sessionId),"session.json"),JSON.stringify(t,null,2))}async function J2(t,e){try{let r=await Bf(Jr(Ye(t),"ws.json"),"utf-8"),i=JSON.parse(r);return i.placeId===e&&i.instanceId?i.instanceId:null}catch{return null}}async function K2(t,e,r){await Br(t),await Nc(Jr(Ye(t),"ws.json"),JSON.stringify({placeId:e,instanceId:r}))}function Y2(t){try{return JSON.parse(atob(t.split(".")[1])).actingAs?.sub??null}catch{return null}}function X2(t){try{return JSON.parse(atob(t.split(".")[1])).principalType==="agent"}catch{return!1}}function Q2(t){try{return JSON.parse(atob(t.split(".")[1])).sub??null}catch{return null}}function eF(t,e){return{...t.tenancyId?{tenancyId:t.tenancyId,installationId:t.tenancyId}:{},placeId:e}}function tF(t,e){let r=e.map(c=>c.state),i=c=>r.filter(l=>l.activityId===c).map(l=>l.displayName??"Unknown"),n=c=>c.updatedAt??c.createdAt??"",o=(c,l)=>({id:c.id,label:c.label,peerName:l?i(c.id).join(", "):void 0,updatedAgo:n(c)?Ec(n(c)):void 0}),s=t.filter(c=>i(c.id).length>0),a=t.filter(c=>i(c.id).length===0&&n(c)).sort((c,l)=>n(l).localeCompare(n(c)));return[...s.slice(0,10).map(c=>o(c,!0)),...a.map(c=>o(c,!1))].slice(0,10)}async function hw(t,e,r,i){i.sessionIntent=jP(t.session)??i.sessionIntent;let n=t.sessionId?{sessionId:t.sessionId,hostSessionId:t.claudeSessionId}:t.claudeSessionId?{sessionId:`cc_${t.claudeSessionId}`,hostSessionId:t.claudeSessionId}:null;n||(n=await e.host.resolveSession()??await e.host.fallbackSession());let{sessionId:o,orientOnly:s}=H2({sessionId:n?.sessionId,claudeSessionId:n?.hostSessionId}),a;try{a=await r.withTokenProvider(e.getToken,()=>r.getPlace(t.placeId))}catch(j){throw new Error(`Place not found or not accessible: ${t.placeId} (${j instanceof Error?j.message:String(j)})`)}let c=eF(a,t.placeId),l=null,u=e.getToken,d=t.displayName,p=s?null:await G2(o);if(p&&p.placeId===t.placeId){l=p.agentId;let j=p.agentToken;u=()=>Promise.resolve(j),d=p.displayName,r.setTokenProvider(u);let de=async()=>{console.error("[gigabuddy] Cached agent token expired, re-minting..."),r.setTokenProvider(e.getToken);let ce=await r.requestAgentToken({displayName:d,sessionId:o,scope:c});j=ce.token,l=ce.agentId,u=()=>Promise.resolve(j),r.setTokenProvider(u),Oc({sessionId:o,agentId:ce.agentId,agentToken:j,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),console.error("[gigabuddy] Agent token re-minted successfully")};if((()=>{try{let ce=JSON.parse(atob(j.split(".")[1]));return ce.exp?ce.exp*1e3<Date.now():!1}catch{return!0}})())try{await de()}catch(ce){console.error(`[gigabuddy] Re-mint failed, falling back to human token: ${ce instanceof Error?ce.message:String(ce)}`),r.setTokenProvider(e.getToken),u=e.getToken}Oc({sessionId:o,agentId:l??p.agentId,agentToken:j,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),r.setOnTokenExpired(async()=>{try{await de()}catch(ce){throw console.error(`[gigabuddy] Re-mint failed: ${ce instanceof Error?ce.message:String(ce)}`),ce}}),console.error(`[gigabuddy] Reusing cached identity: ${d} (${l})`)}else if(!s&&X2(await e.getToken())){let j=await e.getToken();if(l=Q2(j),u=e.getToken,r.setTokenProvider(u),console.error("[gigabuddy] Bearer is already an agent principal \u2014 skipping /api/token/agent mint."),l)try{await r.updateAgentProfile(l,{...t.workdir&&{workdir:t.workdir},...o&&{sessionLabel:o}})}catch{}}else if(s)console.error("[gigabuddy] No resolvable session \u2014 orienting read-only (no identity minted).");else try{let j=await r.requestAgentToken({displayName:t.displayName,sessionId:o,scope:c});l=j.agentId;let de=j.token;u=()=>Promise.resolve(de),j.nickname&&(d=j.nickname),Oc({sessionId:o,agentId:l,agentToken:de,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(we=>console.error("[gigabuddy] Failed to cache session:",we)),r.setTokenProvider(u),r.setOnTokenExpired(async()=>{console.error("[gigabuddy] Agent token expired, re-minting...");try{r.setTokenProvider(e.getToken);let we=await r.requestAgentToken({displayName:d,sessionId:o,scope:c});de=we.token,u=()=>Promise.resolve(de),r.setTokenProvider(u),Oc({sessionId:o,agentId:we.agentId,agentToken:de,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),console.error("[gigabuddy] Agent token re-minted successfully")}catch(we){throw console.error(`[gigabuddy] Re-mint failed: ${we instanceof Error?we.message:String(we)}`),we}});try{await r.updateAgentProfile(l,{...t.workdir&&{workdir:t.workdir},...o&&{sessionLabel:o}})}catch{}}catch(j){console.error(`[gigabuddy] Agent token failed, using human token: ${j instanceof Error?j.message:String(j)}`)}i.placeId=t.placeId,i.tenancyId=a.tenancyId??null,i.agentId=l,r.setTokenProvider(u);let f=async()=>{if(s)return u();let j=await u();try{let de=JSON.parse(atob(j.split(".")[1]));if(de.exp&&de.exp*1e3<Date.now()){console.error("[gigabuddy] WS token expired, re-minting for reconnect..."),r.setTokenProvider(e.getToken);let we=await r.requestAgentToken({displayName:d,sessionId:o,scope:c});return u=()=>Promise.resolve(we.token),r.setTokenProvider(u),l=we.agentId,Oc({sessionId:o,agentId:we.agentId,agentToken:we.token,displayName:d,placeId:t.placeId,savedAt:new Date().toISOString()}).catch(()=>{}),we.token}}catch{}return j},m=e.createAwarenessManager({getToken:f,buildWsUrl:j=>r.buildAwarenessWsUrl(j),user:{displayName:d,canonicalId:l??o}}),h=hC(m,{getPlaceId:()=>t.placeId,getSponsorTopic:()=>i.sponsorTopic,getLocation:()=>({agentId:l,placeId:t.placeId,placeName:a.name,activityLabel:i.currentActivity?.label})});await h.connect(),await h.subscribe(t.placeId);let y=s?null:Y2(await u());y&&(i.sponsorTopic=`sponsor:${y}`,await h.subscribe(i.sponsorTopic));let _=t.workdir??process.cwd(),{owner:k,repo:w,branch:$,...S}=await Df(_),G={displayName:d,canonicalId:l??o,status:"active",typing:!1,coldSecs:H_()};k&&(G.owner=k),w&&(G.repo=w),$&&(G.branch=$),S.worktreeId&&(G.worktree=S.worktree,G.worktreeId=S.worktreeId,G.isolated=S.isolated);let q=n?.hostSessionId,I=n?await e.host.readSessionName(n):null;q&&(G.claudeSessionId=q),I&&(G.sessionName=I),G.client=e.host.clientLabel;let se=await fw().catch(()=>null),{hostname:ue,container:ae}=await uz(se);G.host=ae?`${ue} (devcontainer)`:ue,se&&(G.machineId=se),s||h.updateTopicState(t.placeId,G),i.awarenessManager=h,!s&&i.livePageManagerFactory&&(i.livePageManager=i.livePageManagerFactory(h,{name:d,canonicalId:l??o})),i.agentMeta={displayName:d,sessionId:o,claudeSessionId:q,sessionName:I??void 0,placeName:a.name,workdir:t.workdir};let Me=new Hf(i,o,{workspaceSyncer:async j=>{!i.workspaceInstanceId||!i.placeId||await r.updatePlaceContent(i.placeId,i.workspaceInstanceId,j)},profileSyncer:async j=>{l&&await r.updateAgentProfile(l,j)},pageChecker:async(j,de)=>{try{let we=await r.getPlaceContent(j,de),ce=we.instance??we,On=ce.data;return{updatedAt:ce.updatedAt??null,lastEditedBy:On?.lastEditedBy??null,document:On?.document??void 0}}catch{return null}},messageFetcher:async(j,de)=>{try{return(await r.getMessages(j,{limit:50,after:de})).messages.map(ce=>({id:ce.id,content:Wr(ce.content),senderName:ce.senderName,senderCanonicalId:ce.senderCanonicalId,createdAt:ce.createdAt,parentMessageId:ce.parentMessageId,mentionTargets:ce.mentionTargets}))}catch{return null}},changedFetcher:async(j,de)=>{try{return await r.getChangedContent(j,de)}catch{return null}}});i.inboxWriter=Me,Me.start().catch(j=>console.error("[gigabuddy] Inbox writer error:",j)),i.statuslineRenderer?.setPlaceConnected(!0),h.onConnectionChange(j=>i.statuslineRenderer?.setWsConnected(j));let je=new Of;je.onMessage(j=>{if(j.type!=="page.saved"||!j.pageId)return;let de=i.watchedPages.get(j.pageId);i.inboxWriter?.addEvent({type:"page_updated",peer:"human (VS Code)",detail:de?.title??j.pageId})}),je.start(t.placeId),i.bridge=je,!s&&n&&e.host.markConnected(n).catch(()=>{});let ie=JSON.stringify({tenancyId:a.tenancyId??null,orgId:a.orgId??null,placeId:t.placeId,placeName:a.name},null,2);Nc(Jr(Et(),"connection.json"),ie).catch(()=>{}),Nc(Jr(V2(),".gigabuddy","connection.json"),ie).catch(()=>{}),i.connected=!0,i.placeConversationId=a.conversationId??null;let qe=h.getTopicPeers(t.placeId),He={messages:[]},Je=[],Ot=null;try{[He,Je,Ot]=await Promise.all([r.getMessages(t.placeId,{limit:20}),r.listActivities(t.placeId,{status:"active"}),xz(r,t.placeId)])}catch(j){console.error(`[gigabuddy] Warmup calls failed (non-fatal): ${j instanceof Error?j.message:String(j)}`)}if(i.houseRuleHeadlines=Ot?Sz(Ot):null,!s)try{let j=await fw().catch(()=>null),de={display_name:d,owner:k??void 0,repo:w??void 0,branch:$??void 0,status:"active",last_active_at:new Date().toISOString(),claude_session_id:q??void 0,session_name:I??void 0,machine_id:j??void 0,cwd:_},we=await J2(o,t.placeId);if(!we)try{let On=((await r.listPlaceContent(t.placeId,{contextSchemaId:vC,limit:200})).instances??[]).find(Dc=>(Dc.data??{}).session_id===o);On?.id&&(we=On.id)}catch(ce){console.error(`[gigabuddy] Workspace lookup failed (creating fresh record): ${ce instanceof Error?ce.message:String(ce)}`)}if(we)await r.updatePlaceContent(t.placeId,we,{connected_at:new Date().toISOString(),...de}),i.workspaceInstanceId=we;else{let ce=await r.createPlaceContent(t.placeId,"agent_workspace",{session_id:o,connected_at:new Date().toISOString(),...de},{contextSchemaId:vC});i.workspaceInstanceId=ce.instance?.id??null}i.workspaceInstanceId?(await K2(o,t.placeId,i.workspaceInstanceId).catch(()=>{}),console.error(`[gigabuddy] Workspace instance: ${i.workspaceInstanceId}`)):console.error("[gigabuddy] Workspace instance NOT persisted (create returned no id)")}catch(j){console.error(`[gigabuddy] Workspace instance write failed (non-fatal): ${j instanceof Error?j.message:String(j)}`)}if(He.messages.length>0){let j=He.messages[He.messages.length-1];j&&(i.lastMessageCursor=j.id)}if(!s&&e.onConnected)try{e.onConnected()}catch(j){console.error(`[gigabuddy] onConnected hook failed (non-fatal): ${j instanceof Error?j.message:j}`)}return{placeName:a.name,placeDescription:a.description?.trim()||null,houseRules:Ot,tenancyId:a.tenancyId??null,visibility:a.visibility??null,agentId:l,displayName:d,sessionId:o,peers:qe.map(j=>{let de=j.state;return{name:de.displayName??"Unknown",status:de.status??"unknown",action:de.action?.label,activityId:de.activityId??void 0}}),liveActivities:tF(Je,qe),totalActiveActivities:Je.length,recentMessages:He.messages.slice(-5).map(j=>{let de=Wr(j.content);return{sender:j.senderName??"Unknown",time:j.createdAt?Ec(j.createdAt):"",content:de.length>100?de.slice(0,100)+"...":de}}),totalMessages:He.messages.length}}function wC(t,e,r,i){t.tool("list_places","List places you have access to. Use this to discover available places before connecting.",{},async()=>{try{return await e.withTokenProvider(i.getToken,async()=>{let n=await e.listTenancies();if(n.length===0)return{content:[{type:"text",text:"Sorry \u2014 you're not a member of a Gigabuddy club yet. Join the waitlist at gigabuddy.com, or ask a club admin for an invite."}]};let o=[];for(let s of n){o.push(`Tenancy: ${s.name} (${s.id})`);try{let a=await e.listPlaces(s.id);if(a.length===0)o.push(" No places");else for(let c of a){let l=c.description?` \u2014 ${c.description}`:"",u=c.memberCount?` (${c.memberCount} members)`:"";o.push(` - ${c.name}${u}${l}`),o.push(` id: ${c.id}`)}}catch(a){o.push(` Error listing places: ${a instanceof Error?a.message:String(a)}`)}o.push("")}return{content:[{type:"text",text:o.join(`
|
|
235
|
+
`)}]}})}catch(n){return{content:[{type:"text",text:`Failed to list places: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("open_browser_session","Open an interactive BROWSER session as yourself (this agent) so you can drive Gigabuddy or the chat-app in a real browser (e.g. via Playwright) \u2014 logged in as your own agent identity, with your human sponsor attached. Returns a one-time, short-lived URL to navigate to. You must `connect` to a place first (that establishes your identity).",{app:F.enum([Be().webAppKey,"chat-app"]).optional().describe(`Which web app to open (default: ${Be().webAppKey})`),placeId:F.string().optional().describe("Place to open after sign-in (defaults to your connected place)"),baseUrl:F.string().optional().describe("Override the app base URL for local dev / staging, e.g. http://localhost:3012")},async n=>{try{if(!r.connected||!r.agentId)return{content:[{type:"text",text:"Connect to a place first (use `connect`) \u2014 your agent identity is established on connect."}],isError:!0};let o=await i.getToken(),s=await e.requestBrowserSession(o,{agentId:r.agentId,app:n.app??Be().webAppKey,placeId:n.placeId??r.placeId??void 0,baseUrl:n.baseUrl});return{content:[{type:"text",text:`Browser session ready for ${s.nickname??s.displayName??r.agentId} (expires ${mC(s.expiresAt)}). Open this one-time link:
|
|
236
236
|
|
|
237
237
|
${s.ticketUrl}
|
|
238
238
|
|
|
239
239
|
It signs the browser in as your agent identity with your sponsor attached. The link is single-use \u2014 re-call open_browser_session for a fresh one.`}]}}catch(o){return{content:[{type:"text",text:`Failed to open browser session: ${o instanceof Error?o.message:String(o)}`}],isError:!0}}}),t.tool("connect","Join a place. Pass a placeId to connect directly, or omit it to see available places. Bootstraps awareness and fetches recent messages and activities. SUBAGENTS: if you are a subagent (spawned inside another session via the Agent/Task tool), do not connect \u2014 the parent session owns place presence and posting; return your results to your orchestrator.",{placeId:F.string().optional().describe("Place ID to join (omit to list available places)"),confirm:F.boolean().optional().describe("Required the FIRST time this repo connects to a given room (sanctioned rooms are remembered and never re-ask). Only pass true after checking with the user \u2014 this is the guard against posting work into the wrong room."),displayName:F.string().describe("Your display name in the place"),sessionId:F.string().optional().describe("Unique session identifier (defaults to a generated ID)"),workdir:F.string().optional().describe("Current working directory (shown to other agents)"),session:F.enum(["live","staged"]).optional().describe("Session kernel: 'staged' = this conversation's first raise / create_page / decide opens a STAGED SESSION (lazily) and what you produce stays with it until session_publish lands ONE digest in the room. Omit = live (default; env GIGABUDDY_SESSION_MODE can set a default).")},async n=>{try{if(r.connected)return{content:[{type:"text",text:`Already connected to place ${r.placeId} as ${r.agentMeta?.displayName}. Call disconnect first to reconnect.`}]};if(!n.placeId)return await e.withTokenProvider(i.getToken,async()=>{let a=await e.listTenancies();if(a.length===0)return{content:[{type:"text",text:"Sorry \u2014 you're not a member of a Gigabuddy club yet. Join the waitlist at gigabuddy.com, or ask a club admin for an invite."}]};let c=["No placeId specified. Available places:",""];for(let l of a)try{let u=await e.listPlaces(l.id);for(let d of u)c.push(` - ${d.name} (${d.id})`)}catch{}return c.push(""),c.push("Call connect again with a placeId to join one."),{content:[{type:"text",text:c.join(`
|
|
240
|
-
`)}]}});if(!n.confirm){let a=await
|
|
241
|
-
`)}]}}catch(o){return e.setTokenProvider(i.getToken),r.reset(),{content:[{type:"text",text:`Failed to connect: ${o instanceof Error?o.message:String(o)}`}],isError:!0}}}),t.tool("disconnect","Leave the current place. Completes any active activity (a handover work-session is handed back and left claimable instead of completed) and cleans up awareness.",{},async()=>{if(!r.connected)return r.autoConnectSuppressed=!0,r.statuslineRenderer?.setPendingPlace(null),{content:[{type:"text",text:"Not connected \u2014 auto-connect disabled for this session. Use `connect` to join a place."}]};r.autoConnectSuppressed=!0;try{if(r.currentActivity&&r.placeId){let n=r.currentActivity.activityId,o=await Wf(e,r.placeId,n).catch(()=>null);if(o){let s=r.agentId!=null&&r.agentId===o.originActorId;if(await e.setMyStatus(r.placeId,n,{status:"handed-off",actorType:"buddy"}).catch(()=>{}),!s&&o.workItemId&&await mw(e,r.placeId,o.workItemId),s&&o.pageId&&o.handover){let a=o.handover.origin??{};await e.updatePlaceContent(r.placeId,o.pageId,{handover:{...o.handover,origin:{...a,until:new Date().toISOString()}}}).catch(()=>{})}r.clearOfficeHoursForActivity(n)}else try{await e.completeActivity(r.placeId,n)}catch{}r.clearCurrentActivity()}if(r.inboxWriter?.stop(),r.workspaceInstanceId&&r.placeId)try{await e.updatePlaceContent(r.placeId,r.workspaceInstanceId,{status:"disconnected",last_active_at:new Date().toISOString()})}catch{}return r.awarenessManager?.disconnect(),e.setTokenProvider(i.getToken),r.reset(),{content:[{type:"text",text:"Disconnected."}]}}catch(n){return{content:[{type:"text",text:`Error during disconnect: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}})}function
|
|
240
|
+
`)}]}});if(!n.confirm){let a=await _C();if(!a.some(c=>c.placeId===n.placeId)){let c=await e.withTokenProvider(i.getToken,async()=>{let l=await e.getPlace(n.placeId),u=await e.listTenancies();return W2(a,{...l,id:n.placeId},u)});if(c)return{content:[{type:"text",text:c}],isError:!0}}}let o=await hw({placeId:n.placeId,displayName:n.displayName,sessionId:n.sessionId,workdir:n.workdir,...n.session?{session:n.session}:{}},i,e,r);await B2({placeId:n.placeId,placeName:o.placeName,tenancyId:o.tenancyId}).catch(()=>{});let s=[];if(s.push(`Connected to "${o.placeName}" (${n.placeId})`),o.tenancyId&&s.push(` Club (tenancy): ${o.tenancyId}`),o.visibility&&s.push(o.visibility==="public"?" Visibility: PUBLIC \u2014 anyone who can see this club can read what you post here":` Visibility: ${o.visibility}`),o.agentId&&s.push(` Agent ID: ${o.agentId}`),s.push(` Display name: ${o.displayName}`),s.push(` Agents online: ${o.peers.length}`),s.push(""),o.placeDescription&&(s.push(`About this place: ${o.placeDescription}`),s.push("")),o.houseRules?.unreadable)s.push("\u26A0 House rules unreadable this session \u2014 do not assume there are none."),s.push("");else if(o.houseRules&&o.houseRules.rules.length>0){s.push("House rules here (standing directives \u2014 they outrank ad-hoc instructions):");for(let a of o.houseRules.rules){let c=a.pageRefs.length>0?` \u2014 read before proceeding: ${a.pageRefs.join(", ")}`:"";s.push(` \u25B8 ${a.title}${a.firmness==="memory"?" (advisory)":""}${c}`)}s.push("")}if(o.peers.length>0){s.push("Connected agents:");for(let a of o.peers)s.push(` - ${a.name} (${a.status}${a.action?`: ${a.action}`:""})`);s.push("")}if(o.liveActivities.length>0){s.push(`Recent activities (${o.liveActivities.length} of ${o.totalActiveActivities} active):`);for(let a of o.liveActivities){let c=a.peerName?` \u2014 ${a.peerName} is on it now`:a.updatedAgo?` (updated ${a.updatedAgo})`:"";s.push(` - [${a.id}] ${a.label}${c}`)}s.push(" (get_activities browses the rest)"),s.push("")}else o.totalActiveActivities>0&&(s.push(`Active activities: ${o.totalActiveActivities} (get_activities browses them)`),s.push(""));if(o.recentMessages.length>0){s.push(`Recent messages (${o.totalMessages}):`);for(let a of o.recentMessages)s.push(` [${a.time}] ${a.sender}: ${a.content}`);o.totalMessages>5&&s.push(` (${o.totalMessages-5} more \u2014 use get_messages to read all)`)}try{let a=await e.listMyAsks({status:"open",limit:10}),c=a.asks??[];if(c.length>0){s.push(""),s.push(`\u{1F4E8} ${a.count} open ask(s) addressed to you (delivered while you were away or still unanswered):`);for(let l of c.slice(0,5)){let u=l.data??{},d=(u.raisedBy??{}).name,p=u.target??{},f=typeof p.id=="string"&&p.id?` \xB7 about ${typeof p.label=="string"&&p.label?`"${p.label}" `:""}${p.id}`:"";s.push(` - ${typeof u.title=="string"?u.title:"(untitled)"}${typeof u.urgency=="string"?` [${u.urgency}]`:""}${typeof d=="string"?` \u2014 from ${d}`:""}${f} (${l.id})`)}a.count>5&&s.push(` (${a.count-5} more \u2014 list_asks for the full queue)`),s.push(" Answer with answer(<id>), commit with ack(<id>), or defer with snooze_ask.")}}catch{}return{content:[{type:"text",text:s.join(`
|
|
241
|
+
`)}]}}catch(o){return e.setTokenProvider(i.getToken),r.reset(),{content:[{type:"text",text:`Failed to connect: ${o instanceof Error?o.message:String(o)}`}],isError:!0}}}),t.tool("disconnect","Leave the current place. Completes any active activity (a handover work-session is handed back and left claimable instead of completed) and cleans up awareness.",{},async()=>{if(!r.connected)return r.autoConnectSuppressed=!0,r.statuslineRenderer?.setPendingPlace(null),{content:[{type:"text",text:"Not connected \u2014 auto-connect disabled for this session. Use `connect` to join a place."}]};r.autoConnectSuppressed=!0;try{if(r.currentActivity&&r.placeId){let n=r.currentActivity.activityId,o=await Wf(e,r.placeId,n).catch(()=>null);if(o){let s=r.agentId!=null&&r.agentId===o.originActorId;if(await e.setMyStatus(r.placeId,n,{status:"handed-off",actorType:"buddy"}).catch(()=>{}),!s&&o.workItemId&&await mw(e,r.placeId,o.workItemId),s&&o.pageId&&o.handover){let a=o.handover.origin??{};await e.updatePlaceContent(r.placeId,o.pageId,{handover:{...o.handover,origin:{...a,until:new Date().toISOString()}}}).catch(()=>{})}r.clearOfficeHoursForActivity(n)}else try{await e.completeActivity(r.placeId,n)}catch{}r.clearCurrentActivity()}if(r.inboxWriter?.stop(),r.workspaceInstanceId&&r.placeId)try{await e.updatePlaceContent(r.placeId,r.workspaceInstanceId,{status:"disconnected",last_active_at:new Date().toISOString()})}catch{}return r.awarenessManager?.disconnect(),e.setTokenProvider(i.getToken),r.reset(),{content:[{type:"text",text:"Disconnected."}]}}catch(n){return{content:[{type:"text",text:`Error during disconnect: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}})}function xC(t,e,r){let i=new _f,n=new df({name:Be().serverName,version:t.version??"0.0.0"}),o=t.host??(t.externalSessionId?new Tf(t.externalSessionId):new If),s=new $f(n,e,i,{version:t.version}),a={getToken:t.getToken,apiUrl:t.apiUrl,authUrl:t.authUrl,host:o,onConnected:()=>s.activate(),createAwarenessManager:l=>new Bo(l)},c={...t.auth,onLogin:(l,u)=>{t.auth.onLogin(l,u),i.statuslineRenderer?.setSignedIn(!0),s.activateMenu()}};return r(n,e,i,{connectConfig:a,auth:c}),{server:n,client:e,state:i,async listen(){let l=new ff;await n.connect(l),console.error("Gigabuddy agent server started"),t.auth.isAuthenticated()&&s.activateMenu(),GP().then(f=>{f>0&&console.error(`[gigabuddy] Cleaned up ${f} stale file(s)`)}).catch(()=>{});let u=await nF(),d=(f,m)=>{let h=new Ef(f);return h.setSignedIn(t.auth.isAuthenticated()),i.statuslineRenderer=h,h.start().catch(y=>console.error("[gigabuddy] statusline renderer error:",y)),t.auth.isAuthenticated()&&(async()=>{let y=t.autoConnect?.placeId?{kind:"default",placeId:t.autoConnect.placeId}:$C(u,m);if(y.kind!=="resume"&&y.kind!=="default")return;let _=y.placeId,k=null;try{let w=await kC(Mc(Et(),"connection.json"),"utf-8"),$=JSON.parse(w);$.placeId===_&&$.placeName&&(k=$.placeName)}catch{}h.setPendingPlace(k??_)})(),h},p=async()=>{if(i.statuslineRenderer)return;let f=await o.resolveSession().catch(()=>null);if(f){console.error(`[gigabuddy] Host session resolved (${o.clientLabel}): ${f.sessionId}`);let h=o.statuslineRef(f);h&&d(h,f.sessionId);return}setTimeout(()=>void p(),aF).unref?.()};p(),t.auth.isAuthenticated()?(t.autoConnect||u.length>0)&&uF(o,m=>{if(t.autoConnect)return t.autoConnect;let h=$C(u,m.sessionId);return h.kind==="resume"||h.kind==="default"?(console.error(h.kind==="resume"?`[gigabuddy] Resuming into this session's own place ${h.placeId}`:`[gigabuddy] Defaulting to this host's single known place ${h.placeId}`),{placeId:h.placeId}):h.kind==="ambiguous"?{ambiguous:h.placeIds}:null},a,e,i):console.error("[gigabuddy] Not signed in \u2014 call the `login` tool to authenticate. Skipping auto-connect."),lF(process,()=>{i.inboxWriter?.stop(),i.statuslineRenderer?.stop(),i.awarenessManager?.disconnect()})}}}async function nF(){try{let t=await gw(ur()),e=[];for(let r of t){let i,n,o=Mc(ur(),r);try{if((await rF(o)).isDirectory())i=Mc(o,"session.json"),n=r;else{if(!r.endsWith(".json")||r.startsWith("ws-"))continue;i=o,n=r.slice(0,-5)}}catch{continue}try{let s=await kC(i,"utf-8"),a=JSON.parse(s);if(!a.placeId)continue;e.push({sessionId:n,placeId:a.placeId,savedAt:a.savedAt??""})}catch{}}return e}catch{return[]}}function $C(t,e){let r=t.find(o=>o.sessionId===e);if(r)return{kind:"resume",placeId:r.placeId};let i=new Map;for(let o of t){let s=i.get(o.placeId);(s===void 0||o.savedAt>s)&&i.set(o.placeId,o.savedAt)}return i.size===0?{kind:"none"}:i.size===1?{kind:"default",placeId:[...i.keys()][0]}:{kind:"ambiguous",placeIds:[...i.entries()].sort(([,o],[,s])=>o<s?1:-1).map(([o])=>o)}}var iF=500,oF=5e3,sF=3e5,aF=1e4;function cF(t){return t<sF?iF:oF}function lF(t,e){let r=!1,i=()=>{r||(r=!0,e())},n=()=>{i(),t.exit(0)};t.on("SIGTERM",n),t.on("SIGINT",n),t.on("exit",i),t.stdin.on("end",n),t.stdin.on("close",n)}function uF(t,e,r,i,n){let o=Date.now(),s=!1,a=!1,c=!1,l=async()=>{let{stat:d,unlink:p}=await import("node:fs/promises");try{let _=[];try{for(let $ of await gw(ur()))_.push(Mc(ur(),$,"pending-connect.json"))}catch{}for(let $ of await gw(Et()))$.startsWith("pending-connect-")&&$.endsWith(".json")&&_.push(Mc(Et(),$));let k=0,w=[];for(let $ of _)try{let S=await d($);k++,S.mtimeMs<o&&w.push($)}catch{}if(k===0||w.length>0&&(await Promise.all(w.map($=>p($).catch(()=>{}))),w.length===k))return}catch{return}let f=await t.resolveSession().catch(()=>null),m="resolver";if(f){if(!await t.consumeConnectTrigger(f))return}else{if(f=await t.fallbackSession(),!f)return;m="fallback",await t.consumeConnectTrigger(f)}let h=e(f);if(h===null){a=!0;return}if("ambiguous"in h){n.autoConnectAmbiguity=h.ambiguous,a=!0,console.error(`[gigabuddy] Auto-connect skipped: recent sessions on this host used different places (${h.ambiguous.join(", ")}) and this session has none of its own yet \u2014 refusing to guess. Use the \`connect\` tool to pick one.`);return}console.error(`[gigabuddy] Identity via ${m} (${t.clientLabel}): ${f.sessionId}`);let y=await hw({placeId:h.placeId,displayName:h.displayName??t.defaultDisplayName,sessionId:f.sessionId,workdir:process.cwd(),claudeSessionId:f.hostSessionId},r,i,n);s=!0,console.error(`[gigabuddy] Connected to "${y.placeName}" as ${y.displayName} (session: ${f.sessionId})`),y.peers.length>0&&console.error(`[gigabuddy] Peers online: ${y.peers.map(_=>_.name).join(", ")}`)},u=async()=>{if(s||a||c||n.autoConnectSuppressed)return;c=!0;try{await l()}catch(p){console.error(`[gigabuddy] Auto-connect error: ${p instanceof Error?p.message:String(p)}`)}finally{c=!1}if(s||a||n.autoConnectSuppressed)return;setTimeout(u,cF(Date.now()-o)).unref?.()};u()}var rs="agent";function En(t=!1,e){return Vc(t,rs,e)}function yw(t,e=!1,r){Hc(t,e,rs,r)}function vw(t=!1,e){e$(t,rs,e)}function bw(t=!1,e){return as(t,rs,e)}function SC(t,e=!1,r){t$(t,e,rs,r)}var IC=["agent:spawn","discovery:read"];async function Gf(t){return gP({authUrl:t,clientId:"gigabuddy-agent",scopes:IC})}async function Jf(t=!1,e){let r=Vc(t,"user",e);if(!r)return null;try{let i=await n$({authUrl:r.authUrl,refreshToken:r.refreshToken,clientId:"gigabuddy-agent",scopes:IC}),n={refreshToken:i.refreshToken,userId:i.userId,userEmail:i.userEmail??r.userEmail,authUrl:r.authUrl,apiUrl:r.apiUrl,createdAt:new Date().toISOString()};return Hc(n,t,rs,e),n}catch{return null}}async function Kf(t,e,r={}){return yP(t,e,{onPending:r.onPoll})}function kt(t){return{content:[{type:"text",text:t}]}}function _w(t){let e=fr();if(e.name===t)return"";let r=qc(process.cwd());return`
|
|
242
242
|
|
|
243
|
-
This session now acts as account "${t}", but new sessions in this project would resolve "${e.name}". Ask the user: "Always use ${t} in this project (${r})?" \u2014 if yes, call \`use_account\` with account "${t}"; if they want it machine-wide, call it with makeDefault true.`}function
|
|
243
|
+
This session now acts as account "${t}", but new sessions in this project would resolve "${e.name}". Ask the user: "Always use ${t} in this project (${r})?" \u2014 if yes, call \`use_account\` with account "${t}"; if they want it machine-wide, call it with makeDefault true.`}function TC(t,e){let r=null;t.tool("login",'Sign in to Gigabuddy (one-time). Call this when a tool reports you are not authenticated. It returns a URL and a short code for the user to approve in their browser; relay them verbatim. Authentication completes in the background \u2014 re-call `login` to confirm, then retry what you were doing. Pass `account` to sign in as a named account (e.g. "work") \u2014 the way one machine holds several identities; if that account is already signed in on this machine, this switches the live session to it without a browser round-trip.',{account:F.string().optional().describe("Named account to sign in as (letters/digits/dots/dashes). Omit for the account this project resolves.")},async({account:i})=>{if(i&&!Cr(i))return kt(`"${i}" is not a valid account name \u2014 letters, digits, dots, dashes or underscores.`);let n=i??fr().name;if(i){let c=En(e.staging,i);if(c&&e.activeAccount()!==i){e.onLogin(c,i);let l=c.userEmail??c.userId;return kt(`Switched this session to account "${i}" (${l}).${_w(i)}`)}}if(e.isAuthenticated()&&e.activeAccount()===n){let c=e.currentUser();return kt(`Already signed in${c?` as ${c}`:""} (account: ${n}). No action needed.`)}if(r?.status==="complete"){let c=e.currentUser(),l=r;return r=null,kt(`Signed in${c?` as ${c}`:""} \u2713 You can use the other Gigabuddy tools now.`+_w(l.account))}if(r?.status==="error"){let c=r.error??"unknown error";return r=null,kt(`The previous sign-in attempt failed (${c}). Call \`login\` again to retry.`)}if(r?.status==="pending"&&Date.now()<r.deadline)return kt(`Still waiting for approval. Visit ${r.flow.verificationUrl} and enter code ${r.flow.userCode}, then re-call \`login\` to confirm.`);let o=await Jf(e.staging,n);if(o){e.onLogin(o,n);let c=o.userEmail??o.userId;return kt(`Signed in as ${c} via your gigabuddy CLI session \u2014 no browser approval needed.`+_w(n))}let s=await Gf(e.authUrl);r={flow:s,account:n,deadline:Date.now()+s.expiresIn*1e3,status:"pending"},bc(s.verificationUrl).catch(()=>{}),Kf(e.authUrl,s).then(c=>{e.onLogin({refreshToken:c.refreshToken,userId:c.userId,userEmail:c.userEmail,authUrl:e.authUrl,apiUrl:e.apiUrl,createdAt:new Date().toISOString()},n),r?.flow===s&&(r.status="complete")}).catch(c=>{r?.flow===s&&(r.status="error",r.error=c instanceof Error?c.message:String(c))});let a=n===Nn?"":` as account "${n}"`;return kt(`To connect Gigabuddy${a}, the user needs to sign in (one time):
|
|
244
244
|
|
|
245
245
|
1. Open ${s.verificationUrl}
|
|
246
246
|
2. Enter code: ${s.userCode}
|
|
247
247
|
|
|
248
|
-
I'll be authenticated automatically once they approve. Re-call \`login\` to confirm, then retry what you were doing.`)}),t.tool("use_account","Choose which Gigabuddy account this project uses. With `account`: pins the enclosing repository to it, so every session here signs as that identity (makeDefault true sets the machine-wide default instead; unpin true removes the pin). With no arguments: reports the accounts on this machine and which one is active here. Ask the user before pinning \u2014 a pin redirects every future session in the project.",{account:F.string().optional().describe("Account name to use for this project."),makeDefault:F.boolean().optional().describe("Set the machine-wide default instead of pinning this project."),unpin:F.boolean().optional().describe("Remove this project's pin.")},async({account:i,makeDefault:n,unpin:o})=>{let s=
|
|
248
|
+
I'll be authenticated automatically once they approve. Re-call \`login\` to confirm, then retry what you were doing.`)}),t.tool("use_account","Choose which Gigabuddy account this project uses. With `account`: pins the enclosing repository to it, so every session here signs as that identity (makeDefault true sets the machine-wide default instead; unpin true removes the pin). With no arguments: reports the accounts on this machine and which one is active here. Ask the user before pinning \u2014 a pin redirects every future session in the project.",{account:F.string().optional().describe("Account name to use for this project."),makeDefault:F.boolean().optional().describe("Set the machine-wide default instead of pinning this project."),unpin:F.boolean().optional().describe("Remove this project's pin.")},async({account:i,makeDefault:n,unpin:o})=>{let s=qc(process.cwd());if(o){let l=mm(s);return kt(l?`Unpinned ${s}.`:`No pin on ${s}.`)}if(!i){let l=fr(),u=um().map(p=>{let f=En(e.staging,p),m=f?f.userEmail??f.userId:"not signed in",h=[p===l.name?"active here":"",p===e.activeAccount()?"this session":""].filter(Boolean);return` ${p} \u2014 ${m}${h.length?` [${h.join(", ")}]`:""}`}),d=l.source==="pin"?` (pinned at ${l.pinnedAt})`:l.source==="env"?" (from GIGABUDDY_ACCOUNT)":l.source==="config-default"?" (machine default)":"";return kt(`Accounts on this machine:
|
|
249
249
|
${u.join(`
|
|
250
250
|
`)}
|
|
251
251
|
|
|
252
|
-
Active here: ${l.name}${d}`)}if(!Cr(i))return kt(`"${i}" is not a valid account name \u2014 letters, digits, dots, dashes or underscores.`);if(n)return pm(i),kt(`Default account is now "${i}" (machine-wide, wherever no pin says otherwise).`);fm(s,i);let c=En(e.staging,i)?e.activeAccount()===i?"":` To switch THIS session onto it now, call \`login\` with account "${i}".`:` It has no credential yet \u2014 call \`login\` with account "${i}" to sign it in.`;return kt(`Pinned ${s} \u2192 ${i}. New sessions in this project sign as it.${c}`)}),t.tool("logout","Sign out of Gigabuddy on this machine: removes the stored credential so no new session can act for the user until they sign in again. Session-level presence is separate \u2014 use `disconnect` to just leave the current place while staying signed in.",{},async()=>{if(!e.isAuthenticated())return kt("Not signed in \u2014 nothing to remove.");let i=e.currentUser(),n=e.activeAccount();return r=null,e.onLogout(),kt(`Signed out${i?` (was ${i}`:""}${i&&n!==Nn?`, account ${n}`:""}${i?")":""}. The stored credential is removed \u2014 new sessions will need \`login\` again. Note: other ALREADY-RUNNING sessions on this machine keep their in-memory tokens until they restart, and this session's current place connection (if any) stays up until it ends \u2014 use \`disconnect\` to drop it now.`)})}var
|
|
253
|
-
`)}]}}function
|
|
252
|
+
Active here: ${l.name}${d}`)}if(!Cr(i))return kt(`"${i}" is not a valid account name \u2014 letters, digits, dots, dashes or underscores.`);if(n)return pm(i),kt(`Default account is now "${i}" (machine-wide, wherever no pin says otherwise).`);fm(s,i);let c=En(e.staging,i)?e.activeAccount()===i?"":` To switch THIS session onto it now, call \`login\` with account "${i}".`:` It has no credential yet \u2014 call \`login\` with account "${i}" to sign it in.`;return kt(`Pinned ${s} \u2192 ${i}. New sessions in this project sign as it.${c}`)}),t.tool("logout","Sign out of Gigabuddy on this machine: removes the stored credential so no new session can act for the user until they sign in again. Session-level presence is separate \u2014 use `disconnect` to just leave the current place while staying signed in.",{},async()=>{if(!e.isAuthenticated())return kt("Not signed in \u2014 nothing to remove.");let i=e.currentUser(),n=e.activeAccount();return r=null,e.onLogout(),kt(`Signed out${i?` (was ${i}`:""}${i&&n!==Nn?`, account ${n}`:""}${i?")":""}. The stored credential is removed \u2014 new sessions will need \`login\` again. Note: other ALREADY-RUNNING sessions on this machine keep their in-memory tokens until they restart, and this session's current place connection (if any) stays up until it ends \u2014 use \`disconnect\` to drop it now.`)})}var dF=new Set([Mf,...Object.values(ts)]);function zC(t,e){let r=t.data??{},i=t.instanceId;if(!i)return null;let n=t.contextSchemaId,o=t.contextType,s=Array.isArray(r.tags)?r.tags:[],a=o==="page"&&s.includes(Tz),c=!!n&&dF.has(n);if(!a&&!c||c&&r.handedOverAt||e.requireDispatch&&r.dispatch!==!0||r.status!=="open")return null;let l=a?"handover":W_(n);if(e.kind&&e.kind!==l)return null;let u=r.title??"Untitled";if(a)return{id:i,displayId:i,kind:l,title:u,pickup:`/pickup ${i}`};let d=Cz(i,n);return{id:i,displayId:d,kind:l,title:u,pickup:`pickup_work ${d}`}}var pF=200,fF=1e3;async function mF(t,e){let r=[],i=new Map,n;for(;;){let o=await t.listPlaceContent(e,{extendsSchemaId:Mf,limit:pF,before:n});for(let a of o.schemas??[])i.set(a.id,a.name);let s=o.instances??[];if(r.push(...s),!o.hasMore||!o.cursor||s.length===0)return{instances:r,schemas:i,truncated:!1};if(r.length>=fF)return{instances:r,schemas:i,truncated:!0};n=o.cursor}}async function hF(t,e,r){let i=await mF(t,e).catch(()=>({instances:[],schemas:new Map,truncated:!1})),n=await t.listPlaceContent(e,{contextSchemaId:Pz,limit:50}).catch(()=>({instances:[]})),o=[],s=[];for(let c of[...i.instances,...n.instances??[]]){o.push(c);let l=zC({instanceId:c.id,contextSchemaId:c.contextSchemaId,contextType:c.contextType,data:c.data},r);l&&c.id&&s.push({match:l,instanceId:c.id})}if(s.length===0)return null;if(s.length===1)return s[0].match;let a=await r.ranker?.(o,e);return a&&s.sort((c,l)=>(a.get(c.instanceId)?.rank??Number.MAX_SAFE_INTEGER)-(a.get(l.instanceId)?.rank??Number.MAX_SAFE_INTEGER)),s[0].match}function PC(t,e){return{content:[{type:"text",text:[`${e==="reconciled"?"Work already waiting":"New work arrived"}: ${t.kind} "${t.title}" (${t.displayId})`,"",`Pick it up: \`${t.pickup}\``,"Then do the task and call resolve_work (or complete_activity for a handover).","Pickup CAS-claims it open\u2192active; if you LOSE the claim another picker got it first \u2014 yield and await_work again."].join(`
|
|
253
|
+
`)}]}}function gF(t){return{content:[{type:"text",text:t}],isError:!0}}function CC(t,e,r){t.tool("await_work",["Block until a dispatched work item arrives in this place's queue, then return it ready to pick up. This is the headless picker's heartbeat: a standing background session calls await_work, sleeps on the work-arrival event stream (no polling \u2014 same SSE machinery as wait_for_reply, just for work instead of replies), and wakes the instant a dispatch-flagged issue/idea/handover lands.","It reconciles anything already open+dispatched BEFORE blocking (so an item that arrived in the gap since your last call is never missed), then streams. Returns the matched item and the exact pickup command. By default it only wakes on items explicitly marked dispatch:true \u2014 human-only work is left alone; pass dispatch:false to watch every open arrival.","Loop shape: await_work \u2192 pickup_work/pickup (it CAS-claims open\u2192active; if you lose, yield) \u2192 do the task \u2192 resolve_work/complete_activity \u2192 await_work again."].join(" "),{dispatch:F.boolean().optional().describe("Only wake on dispatch-flagged items (default true). false = wake on ANY open work arrival."),kind:F.enum(["issue","idea","task","decision","handover"]).optional().describe("Restrict to one kind so a picker can specialize. Omit for all kinds."),timeout:F.number().optional().describe("Max seconds to block before returning empty (default 300, max 600).")},async i=>{try{wt(r);let n=r.placeId,o=i.dispatch!==!1,s=i.kind,a=Math.min(i.timeout??300,600),c=await hF(e,n,{requireDispatch:o,kind:s,ranker:r.workRanker});if(c)return PC(c,"reconciled");let l=await LP(e,n,a,d=>zC(d,{requireDispatch:o,kind:s}));return l?PC(l,"arrived"):{content:[{type:"text",text:`No ${o?"dispatched ":""}work arrived within ${a}s. Call await_work again to keep listening (it reconciles the gap).`}]}}catch(n){return gF(`Failed to await work: ${n instanceof Error?n.message:String(n)}`)}})}function yF(t,e,r){if(Math.abs(t.length-e.length)>r)return r+1;let i=Array.from({length:e.length+1},(n,o)=>o);for(let n=1;n<=t.length;n++){let o=[n],s=n;for(let a=1;a<=e.length;a++){let c=t[n-1]===e[a-1]?0:1,l=Math.min(i[a]+1,o[a-1]+1,i[a-1]+c);o[a]=l,l<s&&(s=l)}if(s>r)return r+1;i=o}return i[e.length]}function vF(t,e){let r=t.toLowerCase(),i=e.toLowerCase().trim();if(!i||r.includes(i))return!0;let n=r.split(/\s+/).filter(Boolean);return i.split(/\s+/).filter(Boolean).every(o=>n.some(s=>s.includes(o)||o.length>=4&&yF(o,s,1)<=1))}function AC(t,e,r){t.tool("set_intent","Update your awareness state \u2014 what you are doing, which files you are touching, your current status. Other agents see this in real-time.",{status:F.enum(["active","idle","thinking","acting"]).optional().describe("Your current status"),action:F.string().optional().describe('What you are currently doing (e.g. "refactoring auth module")'),focus:F.array(F.string()).optional().describe("Files or resources you are touching (used for conflict detection)"),activityId:F.string().optional().describe("Activity you are currently working on")},async i=>{try{if(wt(r),await Go(r),!r.awarenessManager)return{content:[{type:"text",text:"Awareness not initialized. Reconnect to fix."}],isError:!0};let n={};i.status&&(n.status=i.status),i.action!==void 0&&(n.action=i.action?{label:i.action}:null),i.focus!==void 0&&(n.focus=i.focus.length>0?{kind:"files",ids:i.focus}:null),i.activityId!==void 0&&(n.activityId=i.activityId||null),r.awarenessManager.updateTopicState(r.placeId,n);let o=["Intent updated:"];return i.status&&o.push(` status: ${i.status}`),i.action&&o.push(` action: ${i.action}`),i.focus?.length&&o.push(` focus: ${i.focus.join(", ")}`),i.activityId&&o.push(` activity: ${i.activityId}`),{content:[{type:"text",text:o.join(`
|
|
254
254
|
`)}]}}catch(n){return{content:[{type:"text",text:`Failed to set intent: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("get_awareness",'See connected agents, their current intent, the activity each is working on, and any file conflicts. Pass `name` to look up one agent (e.g. "Dusk Dace") \u2014 you get their current activity + a ready-to-use way to message them on it. This is how you reach an agent when you have something useful for them: look them up here, then send_message(activityId: \u2026) to land it in their work rather than the noisy main chat.',{name:F.string().optional().describe('Only show agents whose name matches this (case-insensitive substring), e.g. "Dusk Dace".')},async i=>{try{if(wt(r),await Go(r),!r.awarenessManager)return{content:[{type:"text",text:"Awareness not initialized. Reconnect to fix."}],isError:!0};let n=r.awarenessManager,o=n.ws?.readyState,s=n.topics?.get(r.placeId),a=n._diag,c=r.awarenessManager.getTopicPeers(r.placeId);if(c.length===0)return{content:[{type:"text",text:["No other agents connected.",` ws connected: ${n._connected}`,` ws readyState: ${o} (1=OPEN)`,` topic subscribed: ${s?.subscribed}`,` topic clientId: ${s?.clientId}`,` topic peers map size: ${s?.peers?.size}`,` local state set: ${s?.localState!=null}`,"","Message counters:",` binary in: ${a?.binaryIn}`,` binary out: ${a?.binaryOut}`,` control in: ${a?.controlIn}`,` topic match: ${a?.topicMatch}`,` topic miss: ${a?.topicMiss}`,` peers decoded: ${a?.peersDecoded}`,"","Filter results:",` self-skip: ${a?.selfSkip}`,` null-state: ${a?.nullState}`,` kept: ${a?.kept}`,"","Last decoded peers:",...a?.lastPeers?.map(I=>` cid=${I.clientId} clock=${I.clock} keys=[${I.stateKeys}] \u2192 ${I.skip}`)??[],"",...a?.missedTopics?.length?["Missed topics (sample):",...a.missedTopics.map(I=>` "${I}"`)]:[]].join(`
|
|
255
|
-
`)}]};let l=new Set,d=r.awarenessManager.topics?.get(r.placeId),p=d?.localState?.focus;if(p?.ids)for(let q of p.ids)l.add(q);let f=d?.localState??{},m={branch:f.branch??null,worktreeId:f.worktreeId??null,activityId:f.activityId??null},h=[],y=r.agentMeta?.displayName,_=i.name?.trim(),k=c.filter(q=>{let I=q.state.displayName;return!(!I||I==="Unknown"||I===y||I.startsWith("user:")||I.startsWith("agent:")||_&&!
|
|
256
|
-
`)}]}}catch(n){return{content:[{type:"text",text:`Failed to get awareness: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("session_status","Show your own Gigabuddy identity \u2014 display name, session ID, place, connection health, and live context-window utilization (how full this session is, and whether it should hand off before auto-compaction). Optionally declare your context window so the percentage becomes precise: nothing on disk records whether you are on a 200k or 1M (claude-*-8[1m]) window, but YOU can read it from your own model id \u2014 pass contextWindow to teach it once; it is persisted for this session and reused everywhere (awareness, hooks, handover origin).",{contextWindow:F.number().optional().describe("Declare your context window in tokens (e.g. 200000, or 1000000 if your model id ends in [1m]). Persisted for this session so all context-% surfaces are exact."),model:F.string().optional().describe('Your full model id including any suffix, e.g. "claude-opus-4-8[1m]".')},async i=>{let n=[];if(!r.connected||!r.agentMeta)n.push("Not connected."),r.autoConnectAmbiguity?.length&&n.push(`Auto-connect was skipped: recent sessions on this host used different places (${r.autoConnectAmbiguity.join(", ")}) and this session has no place of its own yet. Call \`connect\` with the place you want.`);else{let o=r.agentMeta.claudeSessionId??hi();i.contextWindow&&o&&await
|
|
257
|
-
`)}]}}),t.tool("host_status","Show system-resource health for the machine this session runs on: host memory/swap/load with a crash-risk verdict (ok/warn/critical), every Claude session on this host with its memory footprint (heaviest first \u2014 the kill list when the box is tight), and your own footprint + rank. When connected to a place, also lists peer agents on OTHER hosts with their published footprint, grouped by host, so you can spot a heavy/idle session anywhere and trace it back to its devcontainer + owner. Works without a place connection (the local view is read straight from /proc + the session registry).",{},async()=>{try{let i=[],o=(await Yo().catch(()=>null))?.claudePid,s=await Xo();s?(i.push(
|
|
258
|
-
`)}]}}catch(i){return{content:[{type:"text",text:`Failed to read host status: ${i instanceof Error?i.message:String(i)}`}],isError:!0}}})}var RC=3.5*1024*1024;async function
|
|
255
|
+
`)}]};let l=new Set,d=r.awarenessManager.topics?.get(r.placeId),p=d?.localState?.focus;if(p?.ids)for(let q of p.ids)l.add(q);let f=d?.localState??{},m={branch:f.branch??null,worktreeId:f.worktreeId??null,activityId:f.activityId??null},h=[],y=r.agentMeta?.displayName,_=i.name?.trim(),k=c.filter(q=>{let I=q.state.displayName;return!(!I||I==="Unknown"||I===y||I.startsWith("user:")||I.startsWith("agent:")||_&&!vF(I,_))}),w=new Map;if(k.some(q=>q.state.activityId))try{for(let q of await e.listActivities(r.placeId,{status:"active"}))w.set(q.id,q.label)}catch{}let $=[];if(_&&k.length===0)return{content:[{type:"text",text:`No connected agent matches "${i.name}".`}]};$.push(_?`${k.length} agent(s) matching "${i.name}":`:`${k.length} other agent(s) connected:`),$.push("");let S=[];for(let q of k){let I=q.state,se=I.displayName??"Unknown",ue=I.canonicalId,ae=I.status??"unknown",Me=I.action,je=I.focus,ie=I.activityId,qe=I.waitingOnThread,He=I.repo,Je=I.branch,Ot=I.worktree,j=I.worktreeId,de=I.isolated,we=I.contextPct,ce=I.contextTokensK,On=I.shouldHandoff,Dc=I.rssMb,kw=I.host,xw=I.hostPressure,Uc=I.cpuCores;$.push(` ${se}`),ue&&$.push(` id: ${ue}`),$.push(` status: ${ae}`);{let Ve=I.beatAt,Pr=I.lastActiveAt;if(!$c(Ve))$.push(` \u26A1 unreachable \u2014 last heartbeat ${Math.floor((Date.now()-Ve)/6e4)}m ago`);else if(Pr){let wi=(Date.now()-Date.parse(Pr))/1e3;if(Number.isFinite(wi)&&wi>=90){let ZC=typeof I.coldSecs=="number"?I.coldSecs:3600,FC=wi>=ZC?" \u2744 (prompt cache presumed cold)":"";$.push(` idle: ${Math.floor(wi/60)}m${FC}`)}}}if(Me?.label&&$.push(` action: ${Me.label}`),(He||Je)&&$.push(` repo: ${He??"?"}${Je?` (${Je})`:""}`),Ot&&$.push(` worktree: ${Ot}${de===!1?" (shared checkout)":""}`),je?.ids?.length&&$.push(` focus: ${je.ids.join(", ")}`),h.push({agent:se,dims:{branch:Je,worktreeId:j,activityId:ie,worktree:Ot}}),ie){let Ve=w.get(ie);$.push(` activity: ${ie}${Ve?` (${Ve})`:""}`),$.push(` \u2192 reach them: send_message(activityId: "${ie}", content: "\u2026")`)}if(qe?.parentMessageId&&(typeof qe.since!="number"||Date.now()-qe.since<7e5)&&$.push(` \u23F3 waiting for a reply on thread ${qe.parentMessageId} \u2014 reply THERE, not in main chat`),typeof ce=="number"){let Ve=typeof we=="number"?`${we}% (~${ce}k)`:`~${ce}k (window unknown)`;$.push(` context: ${Ve}${On?" \u26A0 should hand off":""}`)}if(typeof Dc=="number"){let Ve=xw==="critical"?" \u{1F534}":xw==="warn"?" \u{1F7E1}":"",Pr=typeof Uc=="number"&&Uc>0?`, ${Uc>=1?"\u{1F525}":""}${Uc}c cpu`:"";$.push(` footprint: ${Dc}MB${Pr}${kw?` on ${kw}`:""}${Ve}`)}let Yf=DP(I);if(Yf&&$c(I.beatAt))for(let Ve of Yf.officeHours){if(Ve.role!=="origin")continue;let Pr=w.get(Ve.activityId)??Ve.activityId,wi=Yf.availableFor.includes(Ve.activityId);$.push(wi?` \u{1F91D} holding office hours on ${Pr} \u2014 reachable now${Ve.until?` (intended until ${Ve.until})`:""}`:` \u{1F91D} office hours on ${Pr} \u2014 heads-down this moment, post to the thread and they'll see it`)}if($.push(""),l.size>0&&je?.ids?.length){let Ve=je.ids.filter(Pr=>l.has(Pr));Ve.length>0&&S.push({agent:se,files:Ve})}}if(S.length>0){$.push("\u26A0 CONFLICTS DETECTED:");for(let q of S)$.push(` You and ${q.agent} are both touching: ${q.files.join(", ")}`)}else $.push("All clear \u2014 no file conflicts.");let G=Lz(Uz(m,h));if(G.length>0){$.push(""),$.push("Co-occupancy:");for(let q of G)$.push(` ${q}`)}return{content:[{type:"text",text:$.join(`
|
|
256
|
+
`)}]}}catch(n){return{content:[{type:"text",text:`Failed to get awareness: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("session_status","Show your own Gigabuddy identity \u2014 display name, session ID, place, connection health, and live context-window utilization (how full this session is, and whether it should hand off before auto-compaction). Optionally declare your context window so the percentage becomes precise: nothing on disk records whether you are on a 200k or 1M (claude-*-8[1m]) window, but YOU can read it from your own model id \u2014 pass contextWindow to teach it once; it is persisted for this session and reused everywhere (awareness, hooks, handover origin).",{contextWindow:F.number().optional().describe("Declare your context window in tokens (e.g. 200000, or 1000000 if your model id ends in [1m]). Persisted for this session so all context-% surfaces are exact."),model:F.string().optional().describe('Your full model id including any suffix, e.g. "claude-opus-4-8[1m]".')},async i=>{let n=[];if(!r.connected||!r.agentMeta)n.push("Not connected."),r.autoConnectAmbiguity?.length&&n.push(`Auto-connect was skipped: recent sessions on this host used different places (${r.autoConnectAmbiguity.join(", ")}) and this session has no place of its own yet. Call \`connect\` with the place you want.`);else{let o=r.agentMeta.claudeSessionId??hi();i.contextWindow&&o&&await ez(o,i.contextWindow,i.model).catch(()=>{}),n.push(`Name: ${r.agentMeta.displayName}`),n.push(`Session: ${r.agentMeta.sessionId}`),n.push(`Place: ${r.agentMeta.placeName?`${r.agentMeta.placeName} (${r.placeId})`:r.placeId}`),n.push(`Agent ID: ${r.agentId}`),n.push(`WS connected: ${r.awarenessManager?.connected??!1}`);let a=r.awarenessManager?.topics?.get(r.placeId??"")?.localState?.waitingOnThread;a?.parentMessageId&&(typeof a.since!="number"||Date.now()-a.since<7e5)&&n.push(`Waiting for a reply on thread: ${a.parentMessageId} (replies must land in this thread)`);let c=await Gr(o);c&&n.push(rz(c))}return{content:[{type:"text",text:n.join(`
|
|
257
|
+
`)}]}}),t.tool("host_status","Show system-resource health for the machine this session runs on: host memory/swap/load with a crash-risk verdict (ok/warn/critical), every Claude session on this host with its memory footprint (heaviest first \u2014 the kill list when the box is tight), and your own footprint + rank. When connected to a place, also lists peer agents on OTHER hosts with their published footprint, grouped by host, so you can spot a heavy/idle session anywhere and trace it back to its devcontainer + owner. Works without a place connection (the local view is read straight from /proc + the session registry).",{},async()=>{try{let i=[],o=(await Yo().catch(()=>null))?.claudePid,s=await Xo();s?(i.push(dz(s)),i.push("")):(i.push("Host resources: unavailable (non-Linux host \u2014 per-session footprints still shown below)."),i.push(""));let a=await lz(),c=a.filter(u=>!u.dead).map(u=>u.pid),l=await cz(c);for(let u of a){let d=l.get(u.pid);d!=null&&(u.cpuCores=d)}if(i.push(pz(a,o)),o!=null){let u=a.filter(f=>!f.dead),d=u.findIndex(f=>f.pid===o),p=u[d];p?.rssMb!=null&&(i.push(""),i.push(`You: ${p.rssMb}MB, ranked ${d+1} of ${u.length} sessions on this host.`))}if(r.connected&&r.awarenessManager&&r.placeId){await Go(r);let u=r.awarenessManager.getTopicPeers(r.placeId),d=r.agentMeta?.displayName,p=u.map(f=>f.state).filter(f=>{let m=f.displayName;return!m||m==="Unknown"||m===d?!1:typeof f.rssMb=="number"||typeof f.hostPressure=="string"||typeof f.cpuCores=="number"});if(p.length>0){let f=new Map;for(let m of p){let h=m.host||m.machineId||"unknown host",y=f.get(h)??[];y.push(m),f.set(h,y)}i.push(""),i.push("Peer agents on other hosts (from awareness):");for(let[m,h]of f){let y=h.find(w=>w.hostPressure)?.hostPressure,_=h.find(w=>w.hostCpuPressure)?.hostCpuPressure,k=[y?`mem ${y}`:"",_&&_!=="ok"?`cpu ${_}`:""].filter(Boolean).join(", ");i.push(` ${m}${k?` \u2014 ${k}`:""}`);for(let w of h.sort(($,S)=>(S.rssMb??0)-($.rssMb??0))){let $=w.displayName??"Unknown",S=typeof w.rssMb=="number"?`${w.rssMb}MB`:"?MB",G=typeof w.cpuCores=="number"&&w.cpuCores>0?`, ${w.cpuCores>=1?"\u{1F525}":""}${w.cpuCores}c`:"",q=w.owner?` (${w.owner})`:"",I=w.sessionName||w.claudeSessionId?.slice(0,8)||"";i.push(` ${S}${G} ${$}${q}${I?` \u2014 ${I}`:""}`)}}}}return{content:[{type:"text",text:i.join(`
|
|
258
|
+
`)}]}}catch(i){return{content:[{type:"text",text:`Failed to read host status: ${i instanceof Error?i.message:String(i)}`}],isError:!0}}})}var RC=3.5*1024*1024;async function bF(t,e){let r=i=>[{type:"text",text:i}];try{let i=MP(e),n=await t.getFileUrl(i),o=`${n.name} (${n.contentType}, ${Cn(n.size)}) \u2014 file:${n.fileId}`,s=n.url?`
|
|
259
259
|
Download URL (may expire): ${n.url}`:"";if(S_.has(n.contentType)){if(n.size>RC)return r(`${o}
|
|
260
|
-
Too large to view inline (limit ${Cn(RC)}).${s}`);let{data:a,contentType:c}=await t.downloadFile(i),l=S_.has(c)?c:n.contentType;return[{type:"text",text:o},{type:"image",data:Buffer.from(a).toString("base64"),mimeType:l}]}if(
|
|
260
|
+
Too large to view inline (limit ${Cn(RC)}).${s}`);let{data:a,contentType:c}=await t.downloadFile(i),l=S_.has(c)?c:n.contentType;return[{type:"text",text:o},{type:"image",data:Buffer.from(a).toString("base64"),mimeType:l}]}if(NP(n.contentType)){if(n.size>I_)return r(`${o}
|
|
261
261
|
Too large to inline as text (limit ${Cn(I_)}).${s}`);let{data:a}=await t.downloadFile(i),c=new TextDecoder().decode(a);return r(`${o}
|
|
262
262
|
|
|
263
263
|
\`\`\`
|
|
264
264
|
${c}
|
|
265
265
|
\`\`\``)}return r(`${o}
|
|
266
|
-
Not an inline-viewable type \u2014 I can render png/jpeg/gif/webp as images and text/JSON/CSV as text.${s}`)}catch(i){return r(`Failed to view ${e}: ${i instanceof Error?i.message:String(i)}`)}}function
|
|
266
|
+
Not an inline-viewable type \u2014 I can render png/jpeg/gif/webp as images and text/JSON/CSV as text.${s}`)}catch(i){return r(`Failed to view ${e}: ${i instanceof Error?i.message:String(i)}`)}}function EC(t,e,r){t.tool("view_file","Look at file(s) shared in the place \u2014 a screenshot in the chat or an activity thread, an image on a page (file:\u2026 refs), a build log or JSON/CSV attachment, or anything surfaced by get_messages / find_messages. Images are returned so you actually SEE them; text/JSON/CSV files are decoded and returned inline (under a size cap); other types return metadata + a download URL. Pass an array of refs to look at several at once (e.g. a screenshot gallery). Access follows place membership, same as the humans reading the same chat.",{file:F.union([F.string(),F.array(F.string()).min(1)]).describe("A file reference \u2014 a `file:<id>` ref (as shown in messages/pages) or a bare id \u2014 OR an array of them to view several in one call.")},async i=>{try{wt(r);let n=Array.isArray(i.file)?i.file:[i.file],o=await Promise.all(n.map(a=>bF(e,a))),s=[];return o.forEach((a,c)=>{n.length>1&&s.push({type:"text",text:`\u2500\u2500 file ${c+1} of ${n.length} \u2500\u2500`}),s.push(...a)}),{content:s}}catch(n){return{content:[{type:"text",text:`Failed to view file: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("upload_file","Upload local file(s) into the place and get back `file:<id>` ref(s) \u2014 WITHOUT sending a message. Use this to mint an id you can then embed yourself: a screenshot on a page (``), an image in a handover, or any file you want referenced before it's posted anywhere. (To attach + post in one step, use send_message/log's `attachments` instead.) Files are private and place-scoped \u2014 readable by place members, and by agents via view_file. Pass an array to upload several at once.",{paths:F.union([F.string(),F.array(F.string()).min(1)]).describe("Local file path(s) to upload \u2014 a single path or an array of them."),attachToActivity:F.boolean().optional().describe("Also attach each uploaded file to your current activity (kind:file) so it shows up in list_activity_members. Default false; no-op if you have no current activity.")},async i=>{try{wt(r);let n=Array.isArray(i.paths)?i.paths:[i.paths],o=await yf(e,r.placeId,n),s="",a=i.attachToActivity?r.currentActivity?.activityId:void 0;if(a){let u=0;for(let d of o)await e.attachToActivity(r.placeId,a,{kind:"file",id:d.info.fileId,note:d.info.name}).then(()=>!0).catch(()=>!1)&&u++;u&&(s=`
|
|
267
267
|
Attached ${u} file(s) to activity ${a}.`)}let c=o.map(u=>`\u{1F4CE} ${u.info.name} (${u.info.contentType}, ${Cn(u.info.size)}) \u2192 file:${u.info.fileId}`),l=o.length===1?`
|
|
268
268
|
Embed it in a page, work-item body, or activity update with \`![${o[0].info.name}](file:${o[0].info.fileId})\` (NOT in plain chat messages \u2014 use send_message/log attachments there), or view it with view_file.`:"\nEmbed any of them in a page, work-item body, or activity update with `` (NOT in plain chat messages \u2014 use send_message/log attachments there), or view them with view_file.";return{content:[{type:"text",text:`Uploaded ${o.length} file(s):
|
|
269
269
|
${c.join(`
|
|
270
|
-
`)}${s}${l}`}]}}catch(n){return{content:[{type:"text",text:`Failed to upload file: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}})}function
|
|
271
|
-
`)){if(n===""){i();continue}let o=n.indexOf(" "),s=o===-1?n:n.slice(0,o),a=o===-1?"":n.slice(o+1);switch(s){case"worktree":i(),r={path:a};break;case"HEAD":r&&(r.head=a);break;case"branch":r&&(r.branch=a.replace(/^refs\/heads\//,""));break;case"detached":r&&(r.detached=!0);break;case"bare":r&&(r.bare=!0);break}}return i(),e}function
|
|
272
|
-
`)){if(!o)continue;n++;let s=o[0],a=o[1];if(s==="?"&&a==="?"){i++;continue}s!==" "&&s!==void 0&&e++,a!==" "&&a!==void 0&&r++}return{staged:e,unstaged:r,untracked:i,total:n}}function
|
|
273
|
-
`)){if(!r)continue;let[i,n,o,s]=r.split(" ");i&&e.push({name:i,head:n??"",upstream:o||null,committerDate:s||null})}return e}var ww=60;async function
|
|
274
|
-
`).filter(Boolean):[],c=!1,l=!1,u=[];if(n&&(c=!!(await ns(r,["for-each-ref","--count=1","refs/remotes"]))?.trim(),c)){let p=await ns(r,["for-each-ref","--sort=-committerdate","--format=%(refname:short) %(objectname) %(upstream:short) %(committerdate:relative)","refs/heads"]),f=p
|
|
275
|
-
`)}function
|
|
270
|
+
`)}${s}${l}`}]}}catch(n){return{content:[{type:"text",text:`Failed to upload file: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}})}function OC(t,e,r){let i=n=>n??r.currentActivity?.activityId??null;t.tool("set_my_status","Set YOUR status in an activity \u2014 the per-participant claim primitive, symmetric in both directions. 'active' = I've got this (use it to CLAIM a handover/work item instead of a global lock; as a handover's ORIGIN it instead REOPENS your office hours \u2014 the undo for a premature end_office_hours); 'handed-off'/'done' = RELEASE the claim (the item returns to 'unclaimed' in list_handovers/list_work for the next picker \u2014 claim is derived from active participants, so handing off is all it takes; no admin/participant-removal step); 'watching' = spectating (also releases an active claim); 'blocked' = stuck. Joining is implicit (writing your status auto-joins). Your context-window fullness is auto-stamped so the room sees handoff-health. Posts the transition into the activity thread.",{status:F.enum(["watching","active","blocked","done","handed-off"]).describe("Your status. 'active' claims the work."),statusText:F.string().optional().describe('Optional human one-liner (e.g. "wiring the endpoints").'),activityId:F.string().optional().describe("Activity ID (defaults to your current activity)"),contextPct:F.number().optional().describe("Override context-window fullness (auto-stamped if omitted).")},async n=>{try{wt(r);let o=i(n.activityId);if(!o)return{content:[{type:"text",text:"No active activity. Start one or pass an explicit activityId."}],isError:!0};let s=n.contextPct;if(s==null){let p=r.agentMeta.claudeSessionId??hi()??null;s=(await Gr(p).catch(()=>null))?.pct??void 0}let a=await e.setMyStatus(r.placeId,o,{status:n.status,statusText:n.statusText,contextPct:s,actorType:"buddy"});(n.status==="handed-off"||n.status==="done")&&r.clearOfficeHoursForActivity(o);let c=null;if(n.status==="active"){let p=await Wf(e,r.placeId,o).catch(()=>null);if(p&&r.agentId!=null&&p.originActorId===r.agentId){if(p.pageId&&p.handover){c=new Date(Date.now()+55*6e4).toISOString();let f=p.handover.origin??{};await e.updatePlaceContent(r.placeId,p.pageId,{handover:{...p.handover,origin:{...f,until:c}}}).catch(()=>{});let m=p.title??a.label??o;r.setOfficeHours({role:"origin",pageId:p.pageId,activityId:o,title:m,until:c})}}else p?.workItemId&&await gC(e,r.placeId,p.workItemId).catch(()=>{})}else(n.status==="watching"||n.status==="handed-off"||n.status==="done")&&await yC(e,r.placeId,o,r.agentId??null).catch(()=>{});let l=r.currentActivity?.activityId===o?r.currentActivity.conversationId:a.conversationId??"";!l&&a.conversationId&&(l=a.conversationId);let u=n.status==="watching"||n.status==="handed-off"||n.status==="done",d=!1;if(u?r.currentActivity?.activityId===o&&(r.clearCurrentActivity(),d=!0):l&&r.trackActivity({activityId:o,conversationId:l,label:a.label||o}),l){let p=s!=null?` (context ${s}%)`:"";await e.sendMessage(r.placeId,{content:`${r.agentMeta.displayName} is now **${n.status}**${n.statusText?` \u2014 ${n.statusText}`:""}${p}`,senderName:r.agentMeta.displayName,parentMessageId:l}).catch(()=>{})}return{content:[{type:"text",text:`Status set to '${n.status}' on ${o}${s!=null?` (context ${s}%)`:""}.`+(c?` Office hours REOPENED \u2014 you're listed as available again in list_handovers/list_work (advisory window until ${c}). Watch the activity thread with wait_for_reply and answer with 'log'.`:"")+(d?" Released this session's current-activity focus \u2014 you can start_activity on new work now (this one stays a valid queue item for the next picker).":"")}]}}catch(o){return{content:[{type:"text",text:`Failed to set status: ${o instanceof Error?o.message:String(o)}`}],isError:!0}}})}import{execFile as wF}from"node:child_process";function ns(t,e,r=5e3){return new Promise(i=>{wF("git",["-C",t,...e],{timeout:r,maxBuffer:8*1024*1024},(n,o)=>{i(n?null:o)})})}function $F(t){let e=[],r=null,i=()=>{r?.path&&e.push({path:r.path,branch:r.branch??null,head:r.head??null,detached:!!r.detached,bare:!!r.bare}),r=null};for(let n of t.split(`
|
|
271
|
+
`)){if(n===""){i();continue}let o=n.indexOf(" "),s=o===-1?n:n.slice(0,o),a=o===-1?"":n.slice(o+1);switch(s){case"worktree":i(),r={path:a};break;case"HEAD":r&&(r.head=a);break;case"branch":r&&(r.branch=a.replace(/^refs\/heads\//,""));break;case"detached":r&&(r.detached=!0);break;case"bare":r&&(r.bare=!0);break}}return i(),e}function kF(t){let e=0,r=0,i=0,n=0;for(let o of t.split(`
|
|
272
|
+
`)){if(!o)continue;n++;let s=o[0],a=o[1];if(s==="?"&&a==="?"){i++;continue}s!==" "&&s!==void 0&&e++,a!==" "&&a!==void 0&&r++}return{staged:e,unstaged:r,untracked:i,total:n}}function xF(t){let e=[];for(let r of t.split(`
|
|
273
|
+
`)){if(!r)continue;let[i,n,o,s]=r.split(" ");i&&e.push({name:i,head:n??"",upstream:o||null,committerDate:s||null})}return e}var ww=60;async function SF(t,e){let r=e.agentMeta?.workdir??process.cwd(),i=await ns(r,["worktree","list","--porcelain"]),n=i!=null,o=[];if(i)for(let p of $F(i)){if(p.bare){o.push({...p,dirty:null});continue}let f=await ns(p.path,["status","--porcelain"]);o.push({...p,dirty:f!=null?kF(f):null})}let s=n?await ns(r,["stash","list"]):null,a=s?s.split(`
|
|
274
|
+
`).filter(Boolean):[],c=!1,l=!1,u=[];if(n&&(c=!!(await ns(r,["for-each-ref","--count=1","refs/remotes"]))?.trim(),c)){let p=await ns(r,["for-each-ref","--sort=-committerdate","--format=%(refname:short) %(objectname) %(upstream:short) %(committerdate:relative)","refs/heads"]),f=p?xF(p):[];l=f.length>ww;for(let m of f.slice(0,ww)){let h=await ns(r,["rev-list","--count",m.head,"--not","--remotes"]),y=h?Number.parseInt(h.trim(),10):0;Number.isFinite(y)&&y>0&&u.push({name:m.name,unpushed:y,upstream:m.upstream,committerDate:m.committerDate})}}let d=null;if(e.connected&&e.placeId&&e.agentId)try{let p=await t.listActivities(e.placeId,{status:"active"});d=[];for(let f of p){let m=(f.participants??[]).find(y=>y.actorId===e.agentId&&y.status!=="done"&&y.status!=="handed-off");if(!m)continue;let h=(f.attachments??[]).filter(y=>y.note==="about").map(y=>y.id);d.push({activityId:f.id,label:f.label,about:h,myStatus:m.status??"active"})}}catch{d=null}return{cwd:r,gitAvailable:n,hasRemotes:c,worktrees:o,stashes:a,unpushedBranches:u,branchScanTruncated:l,claims:d}}function IF(t){return t.bare?"bare":t.branch?t.branch:t.detached?`detached@${(t.head??"").slice(0,8)}`:"?"}function TF(t){let e=["In-flight inventory \u2014 crash-recovery sweep",""];if(!t.gitAvailable)e.push("Working trees: not a git checkout (or git unavailable) \u2014 skipping git sweep.");else{e.push(`Working trees (${t.worktrees.length}):`);let r=!1;for(let i of t.worktrees){let n=IF(i);if(i.dirty&&i.dirty.total>0){r=!0;let o=[i.dirty.staged?`${i.dirty.staged} staged`:"",i.dirty.unstaged?`${i.dirty.unstaged} unstaged`:"",i.dirty.untracked?`${i.dirty.untracked} untracked`:""].filter(Boolean).join(", ");e.push(` \u26A0 ${i.path} [${n}] \u270E ${i.dirty.total} uncommitted file(s) \u2014 ${o}`)}else i.dirty?e.push(` ${i.path} [${n}] clean`):e.push(` ${i.path} [${n}] (status unavailable)`)}if(r||e.push(" \u2713 all working trees clean."),e.push(""),t.stashes.length>0){e.push(`Stashes (${t.stashes.length}):`);for(let i of t.stashes.slice(0,10))e.push(` ${i}`);t.stashes.length>10&&e.push(` \u2026 +${t.stashes.length-10} more`),e.push("")}if(!t.hasRemotes)e.push("Unpushed branches: no remote configured \u2014 cannot determine (skipped)."),e.push("");else if(t.unpushedBranches.length>0){e.push(`Local branches with unpushed commits (${t.unpushedBranches.length}):`);for(let i of t.unpushedBranches){let n=i.upstream?`\u2192 ${i.upstream}`:"no upstream",o=i.committerDate?` \xB7 ${i.committerDate}`:"";e.push(` \u26A0 ${i.name} \u2191${i.unpushed} unpushed (${n})${o}`)}t.branchScanTruncated&&e.push(` \u2026 only the ${ww} most-recent branches were scanned (older ones skipped).`),e.push("")}else e.push("Local branches with unpushed commits: none."),e.push("")}if(t.claims==null)e.push("Your Gigabuddy claims: not connected \u2014 connect to a place to see unresolved activities/work.");else if(t.claims.length===0)e.push("Your Gigabuddy claims: none held by your current identity."),e.push(" (A crash that minted a NEW identity won't match here \u2014 trust the git sweep above and cross-check get_awareness.)");else{e.push(`Your unresolved Gigabuddy claims (${t.claims.length}):`);for(let r of t.claims){let i=r.about.length?` about ${r.about.join(", ")}`:"";e.push(` \u26A0 ${r.activityId} "${r.label}"${i} [${r.myStatus}]`)}e.push(" \u2192 resume each, or close it with resolve_work / complete_activity.")}return e.join(`
|
|
275
|
+
`)}function NC(t,e,r){t.tool("recovery_status",`In-flight inventory for crash recovery \u2014 answers "what was I working on that isn't closed cleanly?" in one call. Sweeps EVERY git working tree for uncommitted changes (the classic crash residue: real work left dirty with zero commits), lists local branches with commits that never reached a remote, and any stashes \u2014 then, when connected, your unresolved Gigabuddy claims (activities/work your current identity picked up but never resolved). Read-only; the git sweep works with no place connection. Run it first thing in a fresh session after a crash or restart.`,{},async()=>{try{let i=await SF(e,r);return{content:[{type:"text",text:TF(i)}]}}catch(i){return{content:[{type:"text",text:`Failed to build in-flight inventory: ${i instanceof Error?i.message:String(i)}`}],isError:!0}}})}function $w(t){let e=t.senderName??"Unknown",r=t.createdAt?Ec(t.createdAt):"",i=t.threadCount?` [${t.threadCount} replies]`:"",n=t.parentMessageId?` (reply to ${t.parentMessageId})`:"";return`[${r}] ${e}${n}${i}:
|
|
276
276
|
${Wr(t.content)}
|
|
277
|
-
id: ${t.id}`}function
|
|
277
|
+
id: ${t.id}`}function MC(t,e,r){t.tool("wait_for_reply","Wait for the next reply you haven't seen yet. Pass parentMessageId to watch ONE thread \u2014 a conversation id OR an activity:\u2026 / handover id works (it's normalized to the right conversation, so you can pass whatever id you're holding). With NO argument it watches the union of every thread you're subscribed to (same as `listen`), falling back to place-wide only if you're subscribed to nothing. Reconciles anything that arrived since you last read BEFORE blocking, so a reply in the gap between two waits is never missed.",{afterMessageId:F.string().optional().describe("Override the reconcile start point (defaults to your tracked read position)."),parentMessageId:F.string().optional().describe("Watch only this thread \u2014 a conversation id or an activity:\u2026/handover id (normalized to its conversation). Omit to watch all your subscribed threads."),timeout:F.number().optional().describe("Max seconds to wait (default 300, max 600)")},async i=>{try{wt(r);let n=Math.min(i.timeout??300,600),o;return i.parentMessageId?o=new Set([await mi(r,e,i.parentMessageId)]):r.subscribedThreads.size>0?o=new Set(r.subscribedThreads):o=null,await wf(r,e,{threadKeys:o,afterMessageId:i.afterMessageId,timeoutSec:n,format:$w})}catch(n){return{content:[{type:"text",text:`Failed to wait for reply: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("listen","Your inbound loop: block until ANY reply lands in ANY thread you're a stakeholder on \u2014 every conversation you've sent into, every handover/activity you hold, and anything you `subscribe`d to \u2014 with no ids to pass by hand. This is the one tool to 'be reachable': call it after handing off work or posting questions and it surfaces whoever responds, in whichever thread. While you're in this broad listen your availability beacon advertises you as reachable across your whole subscription set. Pass `thread` to watch just ONE thread (the narrow case \u2014 same as wait_for_reply); doing so scopes your beacon to that thread only (you're marked away on the rest, because you are). Reconciles missed replies first, then blocks on live push.",{thread:F.string().optional().describe("Watch only this one thread \u2014 a conversation/activity/handover id (normalized for you). Omit to listen across your whole subscription set (the default, and what makes you broadly reachable)."),timeout:F.number().optional().describe("Max seconds to wait (default 300, max 600)")},async i=>{try{wt(r);let n=Math.min(i.timeout??300,600);if(i.thread){let s=await mi(r,e,i.thread);return await wf(r,e,{threadKeys:new Set([s]),timeoutSec:n,format:$w,noun:"message"})}let o=new Set(r.subscribedThreads);for(let s of r.activeActivities.values())s.conversationId&&o.add(s.conversationId);return await wf(r,e,{threadKeys:o,timeoutSec:n,format:$w,noun:"message"})}catch(n){return{content:[{type:"text",text:`Failed to listen: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("subscribe","Become a stakeholder on a piece of work WITHOUT having to post in it \u2014 so a question posted to that work reaches you. Pass a work/thread id (activity, conversation, or handover/page id). After subscribing, your broad `listen` covers it and your availability beacon advertises you as reachable there. This is how a co-decider or reviewer joins the stakeholder set of work they acted on (e.g. made a design call on) but never chatted in \u2014 the case plain thread-participation misses. Drop it again with `unsubscribe`.",{work:F.string().describe("What to subscribe to \u2014 an activity id, conversation id, or handover/page id (normalized for you).")},async i=>{try{wt(r);let n=await mi(r,e,i.work),o=r.subscribedThreads.has(n);r.subscribeToThread(n);let s=i.work.startsWith("activity:")?i.work:[...r.activeActivities.values()].find(c=>c.conversationId===n)?.activityId,a="";if(s&&r.agentId)try{await e.setStakeholder(r.placeId,s,r.agentId,{stakeholderRole:"participant",actorType:"buddy"}),a=" You are now recorded as a durable stakeholder on the activity (persists even when you disconnect)."}catch{}return{content:[{type:"text",text:o?`Already subscribed to ${i.work}. Your broad \`listen\` already covers it.${a}`:`Subscribed to ${i.work}. You'll receive messages posted there via \`listen\`, and your availability beacon now lists you as reachable on it.${a}`}]}}catch(n){return{content:[{type:"text",text:`Failed to subscribe: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}}),t.tool("unsubscribe","Stop being a stakeholder on a piece of work \u2014 drop it from your `listen` set and your availability beacon. Pass the same work/thread id you subscribed with (activity, conversation, or handover/page id). Use it to silence a thread you no longer need to track when the fan-in gets noisy.",{work:F.string().describe("What to unsubscribe from \u2014 an activity id, conversation id, or handover/page id.")},async i=>{try{wt(r);let n=await mi(r,e,i.work);return{content:[{type:"text",text:r.unsubscribeFromThread(n)?`Unsubscribed from ${i.work} \u2014 it's out of your \`listen\` set and your beacon.`:`You weren't subscribed to ${i.work} (nothing to drop).`}]}}catch(n){return{content:[{type:"text",text:`Failed to unsubscribe: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}})}function jC(t){let e=new af({getToken:t.getToken,apiUrl:t.apiUrl,authUrl:t.authUrl});return xC(t,e,(r,i,n,{connectConfig:o,auth:s})=>{TC(r,s),wC(r,i,n,o),MC(r,i,n),EC(r,i,n),AC(r,i,n),NC(r,i,n),OC(r,i,n),CC(r,i,n)})}bP("gigabuddy");var CF="https://api.gigabuddy.com",AF="https://auth.gigabuddy.com",RF="https://api.staging.gigabuddy.com",EF="https://auth.staging.gigabuddy.com";function DC(){let t=jc.dirname(PF(import.meta.url));for(let e of[jc.join(t,"package.json"),jc.join(t,"..","package.json")])try{let r=JSON.parse(LC.readFileSync(e,"utf-8"));if(r.version)return r.version}catch{}return"unknown"}function OF(){console.error(`
|
|
278
278
|
Gigabuddy agent \u2014 real-time awareness and collaboration for coding agents
|
|
279
279
|
|
|
280
280
|
Usage:
|
|
@@ -298,6 +298,6 @@ Options:
|
|
|
298
298
|
|
|
299
299
|
Place discovery happens at runtime via the list_places and connect tools.
|
|
300
300
|
Auto-connect is configured per-project via .mcp.json args.
|
|
301
|
-
`)}async function
|
|
302
|
-
Code: ${i.userCode}`,"Approve this device"),bc(i.verificationUrl).catch(()=>{});let n=Jw();n.start("Waiting for you to approve in the browser\u2026");try{let o=await Kf(t,i),s={refreshToken:o.refreshToken,userId:o.userId,userEmail:o.userEmail,authUrl:t,apiUrl:e,createdAt:new Date().toISOString()};yw(s,r),n.stop("Approved"),Bw(`Signed in${o.userEmail?` as ${o.userEmail}`:""}. Credentials saved to ${bw(r)}.`),process.exit(0)}catch(o){n.stop("Sign-in failed"),am(o instanceof Error?o.message:String(o)),process.exit(1)}}function
|
|
301
|
+
`)}async function NF(t,e,r=!1){Ww(r?"Gigabuddy agent login (staging)":"Gigabuddy agent login");let i;try{i=await Gf(t)}catch(o){am(`Couldn't start sign-in: ${o instanceof Error?o.message:o}`),process.exit(1)}Gw(`Open: ${i.verificationUrl}
|
|
302
|
+
Code: ${i.userCode}`,"Approve this device"),bc(i.verificationUrl).catch(()=>{});let n=Jw();n.start("Waiting for you to approve in the browser\u2026");try{let o=await Kf(t,i),s={refreshToken:o.refreshToken,userId:o.userId,userEmail:o.userEmail,authUrl:t,apiUrl:e,createdAt:new Date().toISOString()};yw(s,r),n.stop("Approved"),Bw(`Signed in${o.userEmail?` as ${o.userEmail}`:""}. Credentials saved to ${bw(r)}.`),process.exit(0)}catch(o){n.stop("Sign-in failed"),am(o instanceof Error?o.message:String(o)),process.exit(1)}}function MF(t=!1){En(t)?(vw(t),console.error("Credentials cleared")):console.error("No credentials found")}function UC(t=!1){let e=En(t);console.error("Authentication:"),e?(console.error(` User: ${e.userEmail||e.userId}`),console.error(` Auth URL: ${e.authUrl}`),console.error(` Config: ${bw(t)}`)):(console.error(" Not authenticated"),console.error(""),console.error(" To sign in, run:"),console.error(` npx -y @gigabuddy/agent login${t?" --staging":""}`)),console.error(""),console.error("Use list_places and connect tools to discover and join places at runtime.")}async function jF(){let{values:t,positionals:e}=zF({options:{staging:{type:"boolean"},"api-url":{type:"string"},"auth-url":{type:"string"},"auto-connect":{type:"boolean"},place:{type:"string"},"display-name":{type:"string"},help:{type:"boolean",short:"h"},version:{type:"boolean",short:"v"}},allowPositionals:!0});t.version&&(console.log(`gigabuddy-agent v${DC()}`),process.exit(0)),t.help&&(OF(),process.exit(0));let r=e[0],i=t.staging??!1,n=t["api-url"]||(i?RF:CF),o=t["auth-url"]||(i?EF:AF);if(r==="login"){await NF(o,n,i);return}if(r==="logout"){MF(i);return}if(r==="status"){UC(i);return}process.stdin.isTTY&&(UC(i),process.exit(0));let s=null,a=fr().name,c=En(i),l=(p,f=a)=>{c=p,a=f,s=new rf({refreshToken:p.refreshToken,authUrl:p.authUrl,reloginHint:"Call the `login` tool, or run 'npx -y @gigabuddy/agent login', to re-authenticate.",onRefreshTokenRotated:m=>{SC(m,i,f)}})};if(c&&l(c),!c){let p=await Jf(i);p&&(l(p),console.error(`[gigabuddy-agent] Signed in${p.userEmail?` as ${p.userEmail}`:""} via your gigabuddy CLI session`))}let u=t["auto-connect"]&&t.place?{placeId:t.place,displayName:t["display-name"]}:void 0;await jC({getToken:async()=>{if(!s)throw new Error("Not signed in. Call the `login` tool to authenticate (one-time).");return s.getToken()},apiUrl:n,authUrl:o,autoConnect:u,externalSessionId:process.env.GIGABUDDY_HARNESS_SESSION_ID||void 0,version:DC(),auth:{authUrl:o,apiUrl:n,staging:i,isAuthenticated:()=>s!==null,currentUser:()=>c?.userEmail??c?.userId,activeAccount:()=>a,onLogin:(p,f)=>{let m=f??a;yw(p,i,m),l(p,m),console.error(`[gigabuddy-agent] Signed in${p.userEmail?` as ${p.userEmail}`:""} (account: ${m}) via login tool`)},onLogout:()=>{vw(i,a),s=null,c=null,console.error("[gigabuddy-agent] Signed out via logout tool")}}}).listen()}jF().catch(t=>{console.error("Failed to start Gigabuddy agent:",t),process.exit(1)});
|
|
303
303
|
//# sourceMappingURL=agent-cli.js.map
|