lshed 0.7.2 → 0.7.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/CHANGELOG.md +20 -0
- package/README.md +14 -2
- package/dist/cli.js +256 -1807
- package/package.json +4 -5
package/dist/cli.js
CHANGED
|
@@ -1,1817 +1,266 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __lshedRequire } from "node:module";
|
|
3
|
+
const require = __lshedRequire(import.meta.url);
|
|
4
|
+
var Ak=Object.create;var _c=Object.defineProperty;var jk=Object.getOwnPropertyDescriptor;var Ek=Object.getOwnPropertyNames;var Dk=Object.getPrototypeOf,Ck=Object.prototype.hasOwnProperty;var Ji=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Xe=(t,e)=>{for(var r in e)_c(t,r,{get:e[r],enumerable:!0})},Tk=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ek(e))!Ck.call(t,n)&&n!==r&&_c(t,n,{get:()=>e[n],enumerable:!(i=jk(e,n))||i.enumerable});return t};var fn=(t,e,r)=>(r=t!=null?Ak(Dk(t)):{},Tk(e||!t||!t.__esModule?_c(r,"default",{value:t,enumerable:!0}):r,t));var V=N(ue=>{"use strict";var Gp=Symbol.for("yaml.alias"),tb=Symbol.for("yaml.document"),os=Symbol.for("yaml.map"),nb=Symbol.for("yaml.pair"),Hp=Symbol.for("yaml.scalar"),as=Symbol.for("yaml.seq"),rt=Symbol.for("yaml.node.type"),Nz=t=>!!t&&typeof t=="object"&&t[rt]===Gp,Az=t=>!!t&&typeof t=="object"&&t[rt]===tb,jz=t=>!!t&&typeof t=="object"&&t[rt]===os,Ez=t=>!!t&&typeof t=="object"&&t[rt]===nb,rb=t=>!!t&&typeof t=="object"&&t[rt]===Hp,Dz=t=>!!t&&typeof t=="object"&&t[rt]===as;function ib(t){if(t&&typeof t=="object")switch(t[rt]){case os:case as:return!0}return!1}function Cz(t){if(t&&typeof t=="object")switch(t[rt]){case Gp:case os:case Hp:case as:return!0}return!1}var Tz=t=>(rb(t)||ib(t))&&!!t.anchor;ue.ALIAS=Gp;ue.DOC=tb;ue.MAP=os;ue.NODE_TYPE=rt;ue.PAIR=nb;ue.SCALAR=Hp;ue.SEQ=as;ue.hasAnchor=Tz;ue.isAlias=Nz;ue.isCollection=ib;ue.isDocument=Az;ue.isMap=jz;ue.isNode=Cz;ue.isPair=Ez;ue.isScalar=rb;ue.isSeq=Dz});var ui=N(Yp=>{"use strict";var oe=V(),xe=Symbol("break visit"),ob=Symbol("skip children"),We=Symbol("remove node");function ss(t,e){let r=ab(e);oe.isDocument(t)?Yn(null,t.contents,r,Object.freeze([t]))===We&&(t.contents=null):Yn(null,t,r,Object.freeze([]))}ss.BREAK=xe;ss.SKIP=ob;ss.REMOVE=We;function Yn(t,e,r,i){let n=sb(t,e,r,i);if(oe.isNode(n)||oe.isPair(n))return cb(t,i,n),Yn(t,n,r,i);if(typeof n!="symbol"){if(oe.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let a=Yn(o,e.items[o],r,i);if(typeof a=="number")o=a-1;else{if(a===xe)return xe;a===We&&(e.items.splice(o,1),o-=1)}}}else if(oe.isPair(e)){i=Object.freeze(i.concat(e));let o=Yn("key",e.key,r,i);if(o===xe)return xe;o===We&&(e.key=null);let a=Yn("value",e.value,r,i);if(a===xe)return xe;a===We&&(e.value=null)}}return n}async function cs(t,e){let r=ab(e);oe.isDocument(t)?await Xn(null,t.contents,r,Object.freeze([t]))===We&&(t.contents=null):await Xn(null,t,r,Object.freeze([]))}cs.BREAK=xe;cs.SKIP=ob;cs.REMOVE=We;async function Xn(t,e,r,i){let n=await sb(t,e,r,i);if(oe.isNode(n)||oe.isPair(n))return cb(t,i,n),Xn(t,n,r,i);if(typeof n!="symbol"){if(oe.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let a=await Xn(o,e.items[o],r,i);if(typeof a=="number")o=a-1;else{if(a===xe)return xe;a===We&&(e.items.splice(o,1),o-=1)}}}else if(oe.isPair(e)){i=Object.freeze(i.concat(e));let o=await Xn("key",e.key,r,i);if(o===xe)return xe;o===We&&(e.key=null);let a=await Xn("value",e.value,r,i);if(a===xe)return xe;a===We&&(e.value=null)}}return n}function ab(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function sb(t,e,r,i){if(typeof r=="function")return r(t,e,i);if(oe.isMap(e))return r.Map?.(t,e,i);if(oe.isSeq(e))return r.Seq?.(t,e,i);if(oe.isPair(e))return r.Pair?.(t,e,i);if(oe.isScalar(e))return r.Scalar?.(t,e,i);if(oe.isAlias(e))return r.Alias?.(t,e,i)}function cb(t,e,r){let i=e[e.length-1];if(oe.isCollection(i))i.items[t]=r;else if(oe.isPair(i))t==="key"?i.key=r:i.value=r;else if(oe.isDocument(i))i.contents=r;else{let n=oe.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Yp.visit=ss;Yp.visitAsync=cs});var Xp=N(lb=>{"use strict";var ub=V(),Uz=ui(),Lz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Zz=t=>t.replace(/[!,[\]{}]/g,e=>Lz[e]),li=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,a]=i;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let a=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,a),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(n)}catch(a){return r(String(a)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+Zz(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&ub.isNode(e.contents)){let o={};Uz.visit(e.contents,(a,s)=>{ub.isNode(s)&&s.tag&&(o[s.tag]=!0)}),n=Object.keys(o)}else n=[];for(let[o,a]of i)o==="!!"&&a==="tag:yaml.org,2002:"||(!e||n.some(s=>s.startsWith(a)))&&r.push(`%TAG ${o} ${a}`);return r.join(`
|
|
5
|
+
`)}};li.defaultYaml={explicit:!1,version:"1.2"};li.defaultTags={"!!":"tag:yaml.org,2002:"};lb.Directives=li});var us=N(di=>{"use strict";var db=V(),Mz=ui();function Vz(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function fb(t){let e=new Set;return Mz.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function pb(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function Rz(t,e){let r=[],i=new Map,n=null;return{onAnchor:o=>{r.push(o),n??(n=fb(t));let a=pb(e,n);return n.add(a),a},setAnchors:()=>{for(let o of r){let a=i.get(o);if(typeof a=="object"&&a.anchor&&(db.isScalar(a.node)||db.isCollection(a.node)))a.node.anchor=a.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=o,s}}},sourceObjects:i}}di.anchorIsValid=Vz;di.anchorNames=fb;di.createNodeAnchors=Rz;di.findNewAnchor=pb});var Qp=N(mb=>{"use strict";function fi(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,o=i.length;n<o;++n){let a=i[n],s=fi(t,i,String(n),a);s===void 0?delete i[n]:s!==a&&(i[n]=s)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let o=i.get(n),a=fi(t,i,n,o);a===void 0?i.delete(n):a!==o&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let o=fi(t,i,n,n);o===void 0?i.delete(n):o!==n&&(i.delete(n),i.add(o))}else for(let[n,o]of Object.entries(i)){let a=fi(t,i,n,o);a===void 0?delete i[n]:a!==o&&(i[n]=a)}return t.call(e,r,i)}mb.applyReviver=fi});var kt=N(gb=>{"use strict";var Fz=V();function hb(t,e,r){if(Array.isArray(t))return t.map((i,n)=>hb(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!Fz.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=o=>{i.res=o,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}gb.toJS=hb});var ls=N(yb=>{"use strict";var qz=Qp(),vb=V(),Jz=kt(),em=class{constructor(e){Object.defineProperty(this,vb.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:i,onAnchor:n,reviver:o}={}){if(!vb.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=Jz.toJS(this,"",a);if(typeof n=="function")for(let{count:c,res:u}of a.anchors.values())n(u,c);return typeof o=="function"?qz.applyReviver(o,{"":s},"",s):s}};yb.NodeBase=em});var pi=N($b=>{"use strict";var Kz=us(),Bz=ui(),Qn=V(),Wz=ls(),Gz=kt(),tm=class extends Wz.NodeBase{constructor(e){super(Qn.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],Bz.visit(e,{Node:(o,a)=>{(Qn.isAlias(a)||Qn.hasAnchor(a))&&i.push(a)}}),r&&(r.aliasResolveCache=i));let n;for(let o of i){if(o===this)break;o.anchor===this.source&&(n=o)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:o}=r,a=this.resolve(n,r);if(!a){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(a);if(s||(Gz.toJS(a,null,r),s=i.get(a)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=ds(n,a,i)),s.count*s.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(Kz.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${n} `}return n}};function ds(t,e,r){if(Qn.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(Qn.isCollection(e)){let i=0;for(let n of e.items){let o=ds(t,n,r);o>i&&(i=o)}return i}else if(Qn.isPair(e)){let i=ds(t,e.key,r),n=ds(t,e.value,r);return Math.max(i,n)}return 1}$b.Alias=tm});var ne=N(nm=>{"use strict";var Hz=V(),Yz=ls(),Xz=kt(),Qz=t=>!t||typeof t!="function"&&typeof t!="object",St=class extends Yz.NodeBase{constructor(e){super(Hz.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Xz.toJS(this.value,e,r)}toString(){return String(this.value)}};St.BLOCK_FOLDED="BLOCK_FOLDED";St.BLOCK_LITERAL="BLOCK_LITERAL";St.PLAIN="PLAIN";St.QUOTE_DOUBLE="QUOTE_DOUBLE";St.QUOTE_SINGLE="QUOTE_SINGLE";nm.Scalar=St;nm.isScalarValue=Qz});var mi=N(_b=>{"use strict";var eP=pi(),tn=V(),bb=ne(),tP="tag:yaml.org,2002:";function nP(t,e,r){if(e){let i=r.filter(o=>o.tag===e),n=i.find(o=>!o.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function rP(t,e,r){if(tn.isDocument(t)&&(t=t.contents),tn.isNode(t))return t;if(tn.isPair(t)){let d=r.schema[tn.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:o,schema:a,sourceObjects:s}=r,c;if(i&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new eP.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=tP+e.slice(2));let u=nP(t,e,a.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new bb.Scalar(t);return c&&(c.node=d),d}u=t instanceof Map?a[tn.MAP]:Symbol.iterator in Object(t)?a[tn.SEQ]:a[tn.MAP]}o&&(o(u),delete r.onTagObj);let l=u?.createNode?u.createNode(r.schema,t,r):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(r.schema,t,r):new bb.Scalar(t);return e?l.tag=e:u.default||(l.tag=u.tag),c&&(c.node=l),l}_b.createNode=rP});var ps=N(fs=>{"use strict";var iP=mi(),Ge=V(),oP=ls();function rm(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let o=e[n];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let a=[];a[o]=i,i=a}else i=new Map([[o,i]])}return iP.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var wb=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,im=class extends oP.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(i=>Ge.isNode(i)||Ge.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(wb(e))this.add(r);else{let[i,...n]=e,o=this.get(i,!0);if(Ge.isCollection(o))o.addIn(n,r);else if(o===void 0&&this.schema)this.set(i,rm(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(Ge.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,o=this.get(i,!0);return n.length===0?!r&&Ge.isScalar(o)?o.value:o:Ge.isCollection(o)?o.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ge.isPair(r))return!1;let i=r.value;return i==null||e&&Ge.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return Ge.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let o=this.get(i,!0);if(Ge.isCollection(o))o.setIn(n,r);else if(o===void 0&&this.schema)this.set(i,rm(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};fs.Collection=im;fs.collectionFromPath=rm;fs.isEmptyPath=wb});var hi=N(ms=>{"use strict";var aP=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function om(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var sP=(t,e,r)=>t.endsWith(`
|
|
6
|
+
`)?om(r,e):r.includes(`
|
|
7
|
+
`)?`
|
|
8
|
+
`+om(r,e):(t.endsWith(" ")?"":" ")+r;ms.indentComment=om;ms.lineComment=sP;ms.stringifyComment=aP});var Sb=N(gi=>{"use strict";var cP="flow",am="block",hs="quoted";function uP(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!n||n<0)return t;n<o&&(o=0);let c=Math.max(1+o,1+n-e.length);if(t.length<=c)return t;let u=[],l={},d=n-e.length;typeof i=="number"&&(i>n-Math.max(2,o)?u.push(0):d=n-i);let f,p,m=!1,h=-1,g=-1,S=-1;r===am&&(h=kb(t,h,e.length),h!==-1&&(d=h+c));for(let x;x=t[h+=1];){if(r===hs&&x==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}S=h}if(x===`
|
|
9
|
+
`)r===am&&(h=kb(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(x===" "&&p&&p!==" "&&p!==`
|
|
10
|
+
`&&p!==" "){let z=t[h+1];z&&z!==" "&&z!==`
|
|
11
|
+
`&&z!==" "&&(f=h)}if(h>=d)if(f)u.push(f),d=f+c,f=void 0;else if(r===hs){for(;p===" "||p===" ";)p=x,x=t[h+=1],m=!0;let z=h>S+1?h-2:g-1;if(l[z])return t;u.push(z),l[z]=!0,d=z+c,f=void 0}else m=!0}p=x}if(m&&s&&s(),u.length===0)return t;a&&a();let b=t.slice(0,u[0]);for(let x=0;x<u.length;++x){let z=u[x],P=u[x+1]||t.length;z===0?b=`
|
|
12
|
+
${e}${t.slice(0,P)}`:(r===hs&&l[z]&&(b+=`${t[z]}\\`),b+=`
|
|
13
|
+
${e}${t.slice(z+1,P)}`)}return b}function kb(t,e,r){let i=e,n=e+1,o=t[n];for(;o===" "||o===" ";)if(e<n+r)o=t[++e];else{do o=t[++e];while(o&&o!==`
|
|
14
|
+
`);i=e,n=e+1,o=t[n]}return i}gi.FOLD_BLOCK=am;gi.FOLD_FLOW=cP;gi.FOLD_QUOTED=hs;gi.foldFlowLines=uP});var yi=N(xb=>{"use strict";var Ve=ne(),xt=Sb(),vs=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ys=t=>/^(%|---|\.\.\.)/m.test(t);function lP(t,e,r){if(!e||e<0)return!1;let i=e-r,n=t.length;if(n<=i)return!1;for(let o=0,a=0;o<n;++o)if(t[o]===`
|
|
15
|
+
`){if(o-a>i)return!0;if(a=o+1,n-a<=i)return!1}return!0}function vi(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(ys(t)?" ":""),a="",s=0;for(let c=0,u=r[c];u;u=r[++c])if(u===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(a+=r.slice(s,c)+"\\ ",c+=1,s=c,u="\\"),u==="\\")switch(r[c+1]){case"u":{a+=r.slice(s,c);let l=r.substr(c+2,4);switch(l){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:l.substr(0,2)==="00"?a+="\\x"+l.substr(2):a+=r.substr(c,6)}c+=5,s=c+1}break;case"n":if(i||r[c+2]==='"'||r.length<n)c+=1;else{for(a+=r.slice(s,c)+`
|
|
16
|
+
|
|
17
|
+
`;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)a+=`
|
|
18
|
+
`,c+=2;a+=o,r[c+2]===" "&&(a+="\\"),c+=1,s=c+1}break;default:c+=1}return a=s?a+r.slice(s):r,i?a:xt.foldFlowLines(a,o,xt.FOLD_QUOTED,vs(e,!1))}function sm(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
19
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return vi(t,e);let r=e.indent||(ys(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
20
|
+
${r}`)+"'";return e.implicitKey?i:xt.foldFlowLines(i,r,xt.FOLD_FLOW,vs(e,!1))}function er(t,e){let{singleQuote:r}=e.options,i;if(r===!1)i=vi;else{let n=t.includes('"'),o=t.includes("'");n&&!o?i=sm:o&&!n?i=vi:i=r?sm:vi}return i(t,e)}var cm;try{cm=new RegExp(`(^|(?<!
|
|
21
|
+
))
|
|
22
|
+
+(?!
|
|
23
|
+
|$)`,"g")}catch{cm=/\n+(?!\n|$)/g}function gs({comment:t,type:e,value:r},i,n,o){let{blockQuote:a,commentString:s,lineWidth:c}=i.options;if(!a||/\n[\t ]+$/.test(r))return er(r,i);let u=i.indent||(i.forceBlockIndent||ys(r)?" ":""),l=a==="literal"?!0:a==="folded"||e===Ve.Scalar.BLOCK_FOLDED?!1:e===Ve.Scalar.BLOCK_LITERAL?!0:!lP(r,c,u.length);if(!r)return l?`|
|
|
24
|
+
`:`>
|
|
25
|
+
`;let d,f;for(f=r.length;f>0;--f){let P=r[f-1];if(P!==`
|
|
26
|
+
`&&P!==" "&&P!==" ")break}let p=r.substring(f),m=p.indexOf(`
|
|
27
|
+
`);m===-1?d="-":r===p||m!==p.length-1?(d="+",o&&o()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===`
|
|
28
|
+
`&&(p=p.slice(0,-1)),p=p.replace(cm,`$&${u}`));let h=!1,g,S=-1;for(g=0;g<r.length;++g){let P=r[g];if(P===" ")h=!0;else if(P===`
|
|
29
|
+
`)S=g;else break}let b=r.substring(0,S<g?S+1:g);b&&(r=r.substring(b.length),b=b.replace(/\n+/g,`$&${u}`));let z=(h?u?"2":"1":"")+d;if(t&&(z+=" "+s(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!l){let P=r.replace(/\n+/g,`
|
|
30
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),O=!1,D=vs(i,!0);a!=="folded"&&e!==Ve.Scalar.BLOCK_FOLDED&&(D.onOverflow=()=>{O=!0});let w=xt.foldFlowLines(`${b}${P}${p}`,u,xt.FOLD_BLOCK,D);if(!O)return`>${z}
|
|
31
|
+
${u}${w}`}return r=r.replace(/\n+/g,`$&${u}`),`|${z}
|
|
32
|
+
${u}${b}${r}${p}`}function dP(t,e,r,i){let{type:n,value:o}=t,{actualString:a,implicitKey:s,indent:c,indentStep:u,inFlow:l}=e;if(s&&o.includes(`
|
|
33
|
+
`)||l&&/[[\]{},]/.test(o))return er(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||l||!o.includes(`
|
|
34
|
+
`)?er(o,e):gs(t,e,r,i);if(!s&&!l&&n!==Ve.Scalar.PLAIN&&o.includes(`
|
|
35
|
+
`))return gs(t,e,r,i);if(ys(o)){if(c==="")return e.forceBlockIndent=!0,gs(t,e,r,i);if(s&&c===u)return er(o,e)}let d=o.replace(/\n+/g,`$&
|
|
36
|
+
${c}`);if(a){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return er(o,e)}return s?d:xt.foldFlowLines(d,c,xt.FOLD_FLOW,vs(e,!1))}function fP(t,e,r,i){let{implicitKey:n,inFlow:o}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==Ve.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=Ve.Scalar.QUOTE_DOUBLE);let c=l=>{switch(l){case Ve.Scalar.BLOCK_FOLDED:case Ve.Scalar.BLOCK_LITERAL:return n||o?er(a.value,e):gs(a,e,r,i);case Ve.Scalar.QUOTE_DOUBLE:return vi(a.value,e);case Ve.Scalar.QUOTE_SINGLE:return sm(a.value,e);case Ve.Scalar.PLAIN:return dP(a,e,r,i);default:return null}},u=c(s);if(u===null){let{defaultKeyType:l,defaultStringType:d}=e.options,f=n&&l||d;if(u=c(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}xb.stringifyString=fP});var $i=N(um=>{"use strict";var pP=us(),It=V(),mP=hi(),hP=yi();function gP(t,e){let r=Object.assign({blockQuote:!0,commentString:mP.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function vP(t,e){if(e.tag){let n=t.filter(o=>o.tag===e.tag);if(n.length>0)return n.find(o=>o.format===e.format)??n[0]}let r,i;if(It.isScalar(e)){i=e.value;let n=t.filter(o=>o.identify?.(i));if(n.length>1){let o=n.filter(a=>a.test);o.length>0&&(n=o)}r=n.find(o=>o.format===e.format)??n.find(o=>!o.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function yP(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],o=(It.isScalar(t)||It.isCollection(t))&&t.anchor;o&&pP.anchorIsValid(o)&&(r.add(o),n.push(`&${o}`));let a=t.tag??(e.default?null:e.tag);return a&&n.push(i.directives.tagString(a)),n.join(" ")}function $P(t,e,r,i){if(It.isPair(t))return t.toString(e,r,i);if(It.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n,o=It.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=vP(e.doc.schema.tags,o));let a=yP(o,n,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let s=typeof n.stringify=="function"?n.stringify(o,e,r,i):It.isScalar(o)?hP.stringifyString(o,e,r,i):o.toString(e,r,i);return a?It.isScalar(o)||s[0]==="{"||s[0]==="["?`${a} ${s}`:`${a}
|
|
37
|
+
${e.indent}${s}`:s}um.createStringifyContext=gP;um.stringify=$P});var Pb=N(zb=>{"use strict";var it=V(),Ib=ne(),Ob=$i(),bi=hi();function bP({key:t,value:e},r,i,n){let{allNullValues:o,doc:a,indent:s,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:d}}=r,f=it.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(it.isCollection(t)||!it.isNode(t)&&typeof t=="object"){let D="With simple keys, collection cannot be used as a key value";throw new Error(D)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||it.isCollection(t)||(it.isScalar(t)?t.type===Ib.Scalar.BLOCK_FOLDED||t.type===Ib.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:s+c});let m=!1,h=!1,g=Ob.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&i&&i(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=bi.lineComment(g,r.indent,u(f)):h&&n&&n(),g;m&&(f=null),p?(f&&(g+=bi.lineComment(g,r.indent,u(f))),g=`? ${g}
|
|
38
|
+
${s}:`):(g=`${g}:`,f&&(g+=bi.lineComment(g,r.indent,u(f))));let S,b,x;it.isNode(e)?(S=!!e.spaceBefore,b=e.commentBefore,x=e.comment):(S=!1,b=null,x=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!p&&!f&&it.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!l&&c.length>=2&&!r.inFlow&&!p&&it.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let z=!1,P=Ob.stringify(e,r,()=>z=!0,()=>h=!0),O=" ";if(f||S||b){if(O=S?`
|
|
39
|
+
`:"",b){let D=u(b);O+=`
|
|
40
|
+
${bi.indentComment(D,r.indent)}`}P===""&&!r.inFlow?O===`
|
|
41
|
+
`&&x&&(O=`
|
|
42
|
+
|
|
43
|
+
`):O+=`
|
|
44
|
+
${r.indent}`}else if(!p&&it.isCollection(e)){let D=P[0],w=P.indexOf(`
|
|
45
|
+
`),L=w!==-1,Y=r.inFlow??e.flow??e.items.length===0;if(L||!Y){let re=!1;if(L&&(D==="&"||D==="!")){let G=P.indexOf(" ");D==="&"&&G!==-1&&G<w&&P[G+1]==="!"&&(G=P.indexOf(" ",G+1)),(G===-1||w<G)&&(re=!0)}re||(O=`
|
|
46
|
+
${r.indent}`)}}else(P===""||P[0]===`
|
|
47
|
+
`)&&(O="");return g+=O+P,r.inFlow?z&&i&&i():x&&!z?g+=bi.lineComment(g,r.indent,u(x)):h&&n&&n(),g}zb.stringifyPair=bP});var dm=N(lm=>{"use strict";var Nb=Ji("process");function _P(t,...e){t==="debug"&&console.log(...e)}function wP(t,e){(t==="debug"||t==="warn")&&(typeof Nb.emitWarning=="function"?Nb.emitWarning(e):console.warn(e))}lm.debug=_P;lm.warn=wP});var ks=N(ws=>{"use strict";var _s=V(),Ab=ne(),$s="<<",bs={identify:t=>t===$s||typeof t=="symbol"&&t.description===$s,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ab.Scalar(Symbol($s)),{addToJSMap:jb}),stringify:()=>$s},kP=(t,e)=>(bs.identify(e)||_s.isScalar(e)&&(!e.type||e.type===Ab.Scalar.PLAIN)&&bs.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===bs.tag&&r.default);function jb(t,e,r){let i=Eb(t,r);if(_s.isSeq(i))for(let n of i.items)fm(t,e,n);else if(Array.isArray(i))for(let n of i)fm(t,e,n);else fm(t,e,i)}function fm(t,e,r){let i=Eb(t,r);if(!_s.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[o,a]of n)e instanceof Map?e.has(o)||e.set(o,a):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function Eb(t,e){return t&&_s.isAlias(e)?e.resolve(t.doc,t):e}ws.addMergeToJSMap=jb;ws.isMergeKey=kP;ws.merge=bs});var mm=N(Tb=>{"use strict";var SP=dm(),Db=ks(),xP=$i(),Cb=V(),pm=kt();function IP(t,e,{key:r,value:i}){if(Cb.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(Db.isMergeKey(t,r))Db.addMergeToJSMap(t,e,i);else{let n=pm.toJS(r,"",t);if(e instanceof Map)e.set(n,pm.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let o=OP(r,n,t),a=pm.toJS(i,o,t);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}function OP(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Cb.isNode(t)&&r?.doc){let i=xP.createStringifyContext(r.doc,{});i.anchors=new Set;for(let o of r.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let o=JSON.stringify(n);o.length>40&&(o=o.substring(0,36)+'..."'),SP.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}Tb.addPairToJSMap=IP});var Ot=N(hm=>{"use strict";var Ub=mi(),zP=Pb(),PP=mm(),Ss=V();function NP(t,e,r){let i=Ub.createNode(t,void 0,r),n=Ub.createNode(e,void 0,r);return new xs(i,n)}var xs=class t{constructor(e,r=null){Object.defineProperty(this,Ss.NODE_TYPE,{value:Ss.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return Ss.isNode(r)&&(r=r.clone(e)),Ss.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return PP.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?zP.stringifyPair(this,e,r,i):JSON.stringify(this)}};hm.Pair=xs;hm.createPair=NP});var gm=N(Zb=>{"use strict";var nn=V(),Lb=$i(),Is=hi();function AP(t,e,r){return(e.inFlow??t.flow?EP:jP)(t,e,r)}function jP({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:o,onChompKeep:a,onComment:s}){let{indent:c,options:{commentString:u}}=r,l=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;m<e.length;++m){let h=e[m],g=null;if(nn.isNode(h))!d&&h.spaceBefore&&f.push(""),Os(r,f,h.commentBefore,d),h.comment&&(g=h.comment);else if(nn.isPair(h)){let b=nn.isNode(h.key)?h.key:null;b&&(!d&&b.spaceBefore&&f.push(""),Os(r,f,b.commentBefore,d))}d=!1;let S=Lb.stringify(h,l,()=>g=null,()=>d=!0);g&&(S+=Is.lineComment(S,o,u(g))),d&&g&&(d=!1),f.push(i+S)}let p;if(f.length===0)p=n.start+n.end;else{p=f[0];for(let m=1;m<f.length;++m){let h=f[m];p+=h?`
|
|
48
|
+
${c}${h}`:`
|
|
49
|
+
`}}return t?(p+=`
|
|
50
|
+
`+Is.indentComment(u(t),c),s&&s()):d&&a&&a(),p}function EP({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:o,flowCollectionPadding:a,options:{commentString:s}}=e;i+=o;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),u=!1,l=0,d=[];for(let m=0;m<t.length;++m){let h=t[m],g=null;if(nn.isNode(h))h.spaceBefore&&d.push(""),Os(e,d,h.commentBefore,!1),h.comment&&(g=h.comment);else if(nn.isPair(h)){let b=nn.isNode(h.key)?h.key:null;b&&(b.spaceBefore&&d.push(""),Os(e,d,b.commentBefore,!1),b.comment&&(u=!0));let x=nn.isNode(h.value)?h.value:null;x?(x.comment&&(g=x.comment),x.commentBefore&&(u=!0)):h.value==null&&b?.comment&&(g=b.comment)}g&&(u=!0);let S=Lb.stringify(h,c,()=>g=null);u||(u=d.length>l||S.includes(`
|
|
51
|
+
`)),m<t.length-1?S+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(u||(u=d.reduce((b,x)=>b+x.length+2,2)+(S.length+2)>e.options.lineWidth)),u&&(S+=",")),g&&(S+=Is.lineComment(S,i,s(g))),d.push(S),l=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!u){let m=d.reduce((h,g)=>h+g.length+2,2);u=e.options.lineWidth>0&&m>e.options.lineWidth}if(u){let m=f;for(let h of d)m+=h?`
|
|
52
|
+
${o}${n}${h}`:`
|
|
53
|
+
`;return`${m}
|
|
54
|
+
${n}${p}`}else return`${f}${a}${d.join(" ")}${a}${p}`}function Os({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let o=Is.indentComment(e(i),t);r.push(o.trimStart())}}Zb.stringifyCollection=AP});var Pt=N(ym=>{"use strict";var DP=gm(),CP=mm(),TP=ps(),zt=V(),zs=Ot(),UP=ne();function _i(t,e){let r=zt.isScalar(e)?e.value:e;for(let i of t)if(zt.isPair(i)&&(i.key===e||i.key===r||zt.isScalar(i.key)&&i.key.value===r))return i}var vm=class extends TP.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(zt.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:o}=i,a=new this(e),s=(c,u)=>{if(typeof o=="function")u=o.call(r,c,u);else if(Array.isArray(o)&&!o.includes(c))return;(u!==void 0||n)&&a.items.push(zs.createPair(c,u,i))};if(r instanceof Map)for(let[c,u]of r)s(c,u);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){let i;zt.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new zs.Pair(e,e?.value):i=new zs.Pair(e.key,e.value);let n=_i(this.items,i.key),o=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);zt.isScalar(n.value)&&UP.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(o){let a=this.items.findIndex(s=>o(i,s)<0);a===-1?this.items.push(i):this.items.splice(a,0,i)}else this.items.push(i)}delete(e){let r=_i(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=_i(this.items,e)?.value;return(!r&&zt.isScalar(n)?n.value:n)??void 0}has(e){return!!_i(this.items,e)}set(e,r){this.add(new zs.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let o of this.items)CP.addPairToJSMap(r,n,o);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!zt.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),DP.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};ym.YAMLMap=vm;ym.findPair=_i});var tr=N(Vb=>{"use strict";var LP=V(),Mb=Pt(),ZP={collection:"map",default:!0,nodeClass:Mb.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return LP.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Mb.YAMLMap.from(t,e,r)};Vb.map=ZP});var Nt=N(Rb=>{"use strict";var MP=mi(),VP=gm(),RP=ps(),Ns=V(),FP=ne(),qP=kt(),$m=class extends RP.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ns.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Ps(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=Ps(e);if(typeof i!="number")return;let n=this.items[i];return!r&&Ns.isScalar(n)?n.value:n}has(e){let r=Ps(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=Ps(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];Ns.isScalar(n)&&FP.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let o of this.items)i.push(qP.toJS(o,String(n++),r));return i}toString(e,r,i){return e?VP.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,o=new this(e);if(r&&Symbol.iterator in Object(r)){let a=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(a++);s=n.call(r,c,s)}o.items.push(MP.createNode(s,void 0,i))}}return o}};function Ps(t){let e=Ns.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Rb.YAMLSeq=$m});var nr=N(qb=>{"use strict";var JP=V(),Fb=Nt(),KP={collection:"seq",default:!0,nodeClass:Fb.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return JP.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Fb.YAMLSeq.from(t,e,r)};qb.seq=KP});var wi=N(Jb=>{"use strict";var BP=yi(),WP={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),BP.stringifyString(t,e,r,i)}};Jb.string=WP});var As=N(Wb=>{"use strict";var Kb=ne(),Bb={identify:t=>t==null,createNode:()=>new Kb.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Kb.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Bb.test.test(t)?t:e.options.nullStr};Wb.nullTag=Bb});var bm=N(Hb=>{"use strict";var GP=ne(),Gb={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new GP.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Gb.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Hb.boolTag=Gb});var rr=N(Yb=>{"use strict";function HP({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let a=o.indexOf(".");a<0&&(a=o.length,o+=".");let s=e-(o.length-a-1);for(;s-- >0;)o+="0"}return o}Yb.stringifyNumber=HP});var wm=N(js=>{"use strict";var YP=ne(),_m=rr(),XP={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_m.stringifyNumber},QP={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():_m.stringifyNumber(t)}},eN={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new YP.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:_m.stringifyNumber};js.float=eN;js.floatExp=QP;js.floatNaN=XP});var Sm=N(Ds=>{"use strict";var Xb=rr(),Es=t=>typeof t=="bigint"||Number.isInteger(t),km=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Qb(t,e,r){let{value:i}=t;return Es(i)&&i>=0?r+i.toString(e):Xb.stringifyNumber(t)}var tN={identify:t=>Es(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>km(t,2,8,r),stringify:t=>Qb(t,8,"0o")},nN={identify:Es,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>km(t,0,10,r),stringify:Xb.stringifyNumber},rN={identify:t=>Es(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>km(t,2,16,r),stringify:t=>Qb(t,16,"0x")};Ds.int=nN;Ds.intHex=rN;Ds.intOct=tN});var t_=N(e_=>{"use strict";var iN=tr(),oN=As(),aN=nr(),sN=wi(),cN=bm(),xm=wm(),Im=Sm(),uN=[iN.map,aN.seq,sN.string,oN.nullTag,cN.boolTag,Im.intOct,Im.int,Im.intHex,xm.floatNaN,xm.floatExp,xm.float];e_.schema=uN});var i_=N(r_=>{"use strict";var lN=ne(),dN=tr(),fN=nr();function n_(t){return typeof t=="bigint"||Number.isInteger(t)}var Cs=({value:t})=>JSON.stringify(t),pN=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Cs},{identify:t=>t==null,createNode:()=>new lN.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Cs},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Cs},{identify:n_,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>n_(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Cs}],mN={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},hN=[dN.map,fN.seq].concat(pN,mN);r_.schema=hN});var zm=N(o_=>{"use strict";var ki=Ji("buffer"),Om=ne(),gN=yi(),vN={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof ki.Buffer=="function")return ki.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},i,n,o){if(!r)return"";let a=r,s;if(typeof ki.Buffer=="function")s=a instanceof ki.Buffer?a.toString("base64"):ki.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let u=0;u<a.length;++u)c+=String.fromCharCode(a[u]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Om.Scalar.BLOCK_LITERAL),e!==Om.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),u=Math.ceil(s.length/c),l=new Array(u);for(let d=0,f=0;d<u;++d,f+=c)l[d]=s.substr(f,c);s=l.join(e===Om.Scalar.BLOCK_LITERAL?`
|
|
55
|
+
`:" ")}return gN.stringifyString({comment:t,type:e,value:s},i,n,o)}};o_.binary=vN});var Ls=N(Us=>{"use strict";var Ts=V(),Pm=Ot(),yN=ne(),$N=Nt();function a_(t,e){if(Ts.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!Ts.isPair(i)){if(Ts.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Pm.Pair(new yN.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
|
|
56
|
+
${n.key.commentBefore}`:i.commentBefore),i.comment){let o=n.value??n.key;o.comment=o.comment?`${i.comment}
|
|
57
|
+
${o.comment}`:i.comment}i=n}t.items[r]=Ts.isPair(i)?i:new Pm.Pair(i)}}else e("Expected a sequence for this tag");return t}function s_(t,e,r){let{replacer:i}=r,n=new $N.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof i=="function"&&(a=i.call(e,String(o++),a));let s,c;if(Array.isArray(a))if(a.length===2)s=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let u=Object.keys(a);if(u.length===1)s=u[0],c=a[s];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else s=a;n.items.push(Pm.createPair(s,c,r))}return n}var bN={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:a_,createNode:s_};Us.createPairs=s_;Us.pairs=bN;Us.resolvePairs=a_});var jm=N(Am=>{"use strict";var c_=V(),Nm=kt(),Si=Pt(),_N=Nt(),u_=Ls(),rn=class t extends _N.YAMLSeq{constructor(){super(),this.add=Si.YAMLMap.prototype.add.bind(this),this.delete=Si.YAMLMap.prototype.delete.bind(this),this.get=Si.YAMLMap.prototype.get.bind(this),this.has=Si.YAMLMap.prototype.has.bind(this),this.set=Si.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let o,a;if(c_.isPair(n)?(o=Nm.toJS(n.key,"",r),a=Nm.toJS(n.value,o,r)):o=Nm.toJS(n,"",r),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,a)}return i}static from(e,r,i){let n=u_.createPairs(e,r,i),o=new this;return o.items=n.items,o}};rn.tag="tag:yaml.org,2002:omap";var wN={collection:"seq",identify:t=>t instanceof Map,nodeClass:rn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=u_.resolvePairs(t,e),i=[];for(let{key:n}of r.items)c_.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new rn,r)},createNode:(t,e,r)=>rn.from(t,e,r)};Am.YAMLOMap=rn;Am.omap=wN});var m_=N(Em=>{"use strict";var l_=ne();function d_({value:t,source:e},r){return e&&(t?f_:p_).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var f_={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new l_.Scalar(!0),stringify:d_},p_={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new l_.Scalar(!1),stringify:d_};Em.falseTag=p_;Em.trueTag=f_});var h_=N(Zs=>{"use strict";var kN=ne(),Dm=rr(),SN={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Dm.stringifyNumber},xN={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Dm.stringifyNumber(t)}},IN={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new kN.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Dm.stringifyNumber};Zs.float=IN;Zs.floatExp=xN;Zs.floatNaN=SN});var v_=N(Ii=>{"use strict";var g_=rr(),xi=t=>typeof t=="bigint"||Number.isInteger(t);function Ms(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return n==="-"?BigInt(-1)*a:a}let o=parseInt(t,r);return n==="-"?-1*o:o}function Cm(t,e,r){let{value:i}=t;if(xi(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return g_.stringifyNumber(t)}var ON={identify:xi,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Ms(t,2,2,r),stringify:t=>Cm(t,2,"0b")},zN={identify:xi,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Ms(t,1,8,r),stringify:t=>Cm(t,8,"0")},PN={identify:xi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Ms(t,0,10,r),stringify:g_.stringifyNumber},NN={identify:xi,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Ms(t,2,16,r),stringify:t=>Cm(t,16,"0x")};Ii.int=PN;Ii.intBin=ON;Ii.intHex=NN;Ii.intOct=zN});var Um=N(Tm=>{"use strict";var Fs=V(),Vs=Ot(),Rs=Pt(),on=class t extends Rs.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Fs.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Vs.Pair(e.key,null):r=new Vs.Pair(e,null),Rs.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=Rs.findPair(this.items,e);return!r&&Fs.isPair(i)?Fs.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=Rs.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new Vs.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof n=="function"&&(a=n.call(r,a,a)),o.items.push(Vs.createPair(a,null,i));return o}};on.tag="tag:yaml.org,2002:set";var AN={collection:"map",identify:t=>t instanceof Set,nodeClass:on,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>on.from(t,e,r),resolve(t,e){if(Fs.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new on,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Tm.YAMLSet=on;Tm.set=AN});var Zm=N(qs=>{"use strict";var jN=rr();function Lm(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=a=>e?BigInt(a):Number(a),o=i.replace(/_/g,"").split(":").reduce((a,s)=>a*n(60)+n(s),n(0));return r==="-"?n(-1)*o:o}function y_(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return jN.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),o=[e%n];return e<60?o.unshift(0):(e=(e-o[0])/n,o.unshift(e%n),e>=60&&(e=(e-o[0])/n,o.unshift(e))),i+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var EN={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>Lm(t,r),stringify:y_},DN={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Lm(t,!1),stringify:y_},$_={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match($_.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,o,a,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(r,i-1,n,o||0,a||0,s||0,c),l=e[8];if(l&&l!=="Z"){let d=Lm(l,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};qs.floatTime=DN;qs.intTime=EN;qs.timestamp=$_});var w_=N(__=>{"use strict";var CN=tr(),TN=As(),UN=nr(),LN=wi(),ZN=zm(),b_=m_(),Mm=h_(),Js=v_(),MN=ks(),VN=jm(),RN=Ls(),FN=Um(),Vm=Zm(),qN=[CN.map,UN.seq,LN.string,TN.nullTag,b_.trueTag,b_.falseTag,Js.intBin,Js.intOct,Js.int,Js.intHex,Mm.floatNaN,Mm.floatExp,Mm.float,ZN.binary,MN.merge,VN.omap,RN.pairs,FN.set,Vm.intTime,Vm.floatTime,Vm.timestamp];__.schema=qN});var j_=N(qm=>{"use strict";var I_=tr(),JN=As(),O_=nr(),KN=wi(),BN=bm(),Rm=wm(),Fm=Sm(),WN=t_(),GN=i_(),z_=zm(),Oi=ks(),P_=jm(),N_=Ls(),k_=w_(),A_=Um(),Ks=Zm(),S_=new Map([["core",WN.schema],["failsafe",[I_.map,O_.seq,KN.string]],["json",GN.schema],["yaml11",k_.schema],["yaml-1.1",k_.schema]]),x_={binary:z_.binary,bool:BN.boolTag,float:Rm.float,floatExp:Rm.floatExp,floatNaN:Rm.floatNaN,floatTime:Ks.floatTime,int:Fm.int,intHex:Fm.intHex,intOct:Fm.intOct,intTime:Ks.intTime,map:I_.map,merge:Oi.merge,null:JN.nullTag,omap:P_.omap,pairs:N_.pairs,seq:O_.seq,set:A_.set,timestamp:Ks.timestamp},HN={"tag:yaml.org,2002:binary":z_.binary,"tag:yaml.org,2002:merge":Oi.merge,"tag:yaml.org,2002:omap":P_.omap,"tag:yaml.org,2002:pairs":N_.pairs,"tag:yaml.org,2002:set":A_.set,"tag:yaml.org,2002:timestamp":Ks.timestamp};function YN(t,e,r){let i=S_.get(e);if(i&&!t)return r&&!i.includes(Oi.merge)?i.concat(Oi.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let o=Array.from(S_.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)n=n.concat(o);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(Oi.merge)),n.reduce((o,a)=>{let s=typeof a=="string"?x_[a]:a;if(!s){let c=JSON.stringify(a),u=Object.keys(x_).map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return o.includes(s)||o.push(s),o},[])}qm.coreKnownTags=HN;qm.getTags=YN});var Bm=N(E_=>{"use strict";var Jm=V(),XN=tr(),QN=nr(),eA=wi(),Bs=j_(),tA=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Km=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:o,sortMapEntries:a,toStringDefaults:s}){this.compat=Array.isArray(e)?Bs.getTags(e,"compat"):e?Bs.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=n?Bs.coreKnownTags:{},this.tags=Bs.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,Jm.MAP,{value:XN.map}),Object.defineProperty(this,Jm.SCALAR,{value:eA.string}),Object.defineProperty(this,Jm.SEQ,{value:QN.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?tA:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};E_.Schema=Km});var C_=N(D_=>{"use strict";var nA=V(),Wm=$i(),zi=hi();function rA(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=Wm.createStringifyContext(t,e),{commentString:o}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(zi.indentComment(c,""))}let a=!1,s=null;if(t.contents){if(nA.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let l=o(t.contents.commentBefore);r.push(zi.indentComment(l,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>a=!0,u=Wm.stringify(t.contents,n,()=>s=null,c);s&&(u+=zi.lineComment(u,"",o(s))),(u[0]==="|"||u[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${u}`:r.push(u)}else r.push(Wm.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
|
|
58
|
+
`)?(r.push("..."),r.push(zi.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||s)&&r[r.length-1]!==""&&r.push(""),r.push(zi.indentComment(o(c),"")))}return r.join(`
|
|
59
|
+
`)+`
|
|
60
|
+
`}D_.stringifyDocument=rA});var Pi=N(T_=>{"use strict";var iA=pi(),ir=ps(),Ce=V(),oA=Ot(),aA=kt(),sA=Bm(),cA=C_(),Gm=us(),uA=Qp(),lA=mi(),Hm=Xp(),Ym=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ce.NODE_TYPE,{value:Ce.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:a}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Hm.Directives({version:a}),this.setSchema(a,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[Ce.NODE_TYPE]:{value:Ce.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Ce.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){or(this.contents)&&this.contents.add(e)}addIn(e,r){or(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let i=Gm.anchorNames(this);e.anchor=!r||i.has(r)?Gm.findNewAnchor(r||"a",i):r}return new iA.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let g=b=>typeof b=="number"||b instanceof String||b instanceof Number,S=r.filter(g).map(String);S.length>0&&(r=r.concat(S)),n=r}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:a,flow:s,keepUndefined:c,onTagObj:u,tag:l}=i??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=Gm.createNodeAnchors(this,a||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:n,schema:this.schema,sourceObjects:p},h=lA.createNode(e,l,m);return s&&Ce.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,i={}){let n=this.createNode(e,null,i),o=this.createNode(r,null,i);return new oA.Pair(n,o)}delete(e){return or(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ir.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):or(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Ce.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return ir.isEmptyPath(e)?!r&&Ce.isScalar(this.contents)?this.contents.value:this.contents:Ce.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Ce.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return ir.isEmptyPath(e)?this.contents!==void 0:Ce.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=ir.collectionFromPath(this.schema,[e],r):or(this.contents)&&this.contents.set(e,r)}setIn(e,r){ir.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=ir.collectionFromPath(this.schema,Array.from(e),r):or(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Hm.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Hm.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new sA.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:o,reviver:a}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},c=aA.toJS(this.contents,r??"",s);if(typeof o=="function")for(let{count:u,res:l}of s.anchors.values())o(l,u);return typeof a=="function"?uA.applyReviver(a,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return cA.stringifyDocument(this,e)}};function or(t){if(Ce.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}T_.Document=Ym});var ji=N(Ai=>{"use strict";var Ni=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r}},Xm=class extends Ni{constructor(e,r,i){super("YAMLParseError",e,r,i)}},Qm=class extends Ni{constructor(e,r,i){super("YAMLWarning",e,r,i)}},dA=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(s=>e.linePos(s));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let o=n-1,a=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){let s=Math.min(o-39,a.length-79);a="\u2026"+a.substring(s),o-=s-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(a.substring(0,o))){let s=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);s.length>80&&(s=s.substring(0,79)+`\u2026
|
|
61
|
+
`),a=s+a}if(/[^ ]/.test(a)){let s=1,c=r.linePos[1];c?.line===i&&c.col>n&&(s=Math.max(1,Math.min(c.col-n,80-o)));let u=" ".repeat(o)+"^".repeat(s);r.message+=`:
|
|
62
|
+
|
|
63
|
+
${a}
|
|
64
|
+
${u}
|
|
65
|
+
`}};Ai.YAMLError=Ni;Ai.YAMLParseError=Xm;Ai.YAMLWarning=Qm;Ai.prettifyError=dA});var Ei=N(U_=>{"use strict";function fA(t,{flow:e,indicator:r,next:i,offset:n,onError:o,parentIndent:a,startOnNewline:s}){let c=!1,u=s,l=s,d="",f="",p=!1,m=!1,h=null,g=null,S=null,b=null,x=null,z=null,P=null;for(let w of t)switch(m&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&o(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(u&&w.type!=="comment"&&w.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),w.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&w.source.includes(" ")&&(h=w),l=!0;break;case"comment":{l||o(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=w.source.substring(1)||" ";d?d+=f+L:d=L,f="",u=!1;break}case"newline":u?d?d+=w.source:(!z||r!=="seq-item-ind")&&(c=!0):f+=w.source,u=!0,p=!0,(g||S)&&(b=w),l=!0;break;case"anchor":g&&o(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&o(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=w,P??(P=w.offset),u=!1,l=!1,m=!0;break;case"tag":{S&&o(w,"MULTIPLE_TAGS","A node can have at most one tag"),S=w,P??(P=w.offset),u=!1,l=!1,m=!0;break}case r:(g||S)&&o(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),z&&o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),z=w,u=r==="seq-item-ind"||r==="explicit-key-ind",l=!1;break;case"comma":if(e){x&&o(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),x=w,u=!1,l=!1;break}default:o(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),u=!1,l=!1}let O=t[t.length-1],D=O?O.offset+O.source.length:n;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(u&&h.indent<=a||i?.type==="block-map"||i?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:z,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:S,newlineAfterProp:b,end:D,start:P??D}}U_.resolveProps=fA});var Ws=N(L_=>{"use strict";function eh(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
66
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(eh(e.key)||eh(e.value))return!0}return!1;default:return!0}}L_.containsNewline=eh});var th=N(Z_=>{"use strict";var pA=Ws();function mA(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&pA.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Z_.flowIndentCheck=mA});var nh=N(V_=>{"use strict";var M_=V();function hA(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(o,a)=>o===a||M_.isScalar(o)&&M_.isScalar(a)&&o.value===a.value;return e.some(o=>n(o.key,r))}V_.mapIncludes=hA});var B_=N(K_=>{"use strict";var R_=Ot(),gA=Pt(),F_=Ei(),vA=Ws(),q_=th(),yA=nh(),J_="All mapping items must start at the same column";function $A({composeNode:t,composeEmptyNode:e},r,i,n,o){let a=o?.nodeClass??gA.YAMLMap,s=new a(r.schema);r.atRoot&&(r.atRoot=!1);let c=i.offset,u=null;for(let l of i.items){let{start:d,key:f,sep:p,value:m}=l,h=F_.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&n(c,"BAD_INDENT",J_)),!h.anchor&&!h.tag&&!p){u=h.end,h.comment&&(s.comment?s.comment+=`
|
|
67
|
+
`+h.comment:s.comment=h.comment);continue}(h.newlineAfterProp||vA.containsNewline(f))&&n(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==i.indent&&n(c,"BAD_INDENT",J_);r.atKey=!0;let S=h.end,b=f?t(r,f,h,n):e(r,S,d,null,h,n);r.schema.compat&&q_.flowIndentCheck(i.indent,f,n),r.atKey=!1,yA.mapIncludes(r,s.items,b)&&n(S,"DUPLICATE_KEY","Map keys must be unique");let x=F_.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:b.range[2],onError:n,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=x.end,x.found){g&&(m?.type==="block-map"&&!x.hasNewline&&n(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<x.found.offset-1024&&n(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let z=m?t(r,m,x,n):e(r,c,p,null,x,n);r.schema.compat&&q_.flowIndentCheck(i.indent,m,n),c=z.range[2];let P=new R_.Pair(b,z);r.options.keepSourceTokens&&(P.srcToken=l),s.items.push(P)}else{g&&n(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),x.comment&&(b.comment?b.comment+=`
|
|
68
|
+
`+x.comment:b.comment=x.comment);let z=new R_.Pair(b);r.options.keepSourceTokens&&(z.srcToken=l),s.items.push(z)}}return u&&u<c&&n(u,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,u??c],s}K_.resolveBlockMap=$A});var G_=N(W_=>{"use strict";var bA=Nt(),_A=Ei(),wA=th();function kA({composeNode:t,composeEmptyNode:e},r,i,n,o){let a=o?.nodeClass??bA.YAMLSeq,s=new a(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=i.offset,u=null;for(let{start:l,value:d}of i.items){let f=_A.resolveProps(l,{indicator:"seq-item-ind",next:d,offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?n(f.end,"BAD_INDENT","All sequence items must start at the same column"):n(c,"MISSING_CHAR","Sequence item without - indicator");else{u=f.end,f.comment&&(s.comment=f.comment);continue}let p=d?t(r,d,f,n):e(r,f.end,l,null,f,n);r.schema.compat&&wA.flowIndentCheck(i.indent,d,n),c=p.range[2],s.items.push(p)}return s.range=[i.offset,c,u??c],s}W_.resolveBlockSeq=kA});var ar=N(H_=>{"use strict";function SA(t,e,r,i){let n="";if(t){let o=!1,a="";for(let s of t){let{source:c,type:u}=s;switch(u){case"space":o=!0;break;case"comment":{r&&!o&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let l=c.substring(1)||" ";n?n+=a+l:n=l,a="";break}case"newline":n&&(a+=c),o=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=c.length}}return{comment:n,offset:e}}H_.resolveEnd=SA});var ew=N(Q_=>{"use strict";var xA=V(),IA=Ot(),Y_=Pt(),OA=Nt(),zA=ar(),X_=Ei(),PA=Ws(),NA=nh(),rh="Block collections are not allowed within flow collections",ih=t=>t&&(t.type==="block-map"||t.type==="block-seq");function AA({composeNode:t,composeEmptyNode:e},r,i,n,o){let a=i.start.source==="{",s=a?"flow map":"flow sequence",c=o?.nodeClass??(a?Y_.YAMLMap:OA.YAMLSeq),u=new c(r.schema);u.flow=!0;let l=r.atRoot;l&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=i.offset+i.start.source.length;for(let g=0;g<i.items.length;++g){let S=i.items[g],{start:b,key:x,sep:z,value:P}=S,O=X_.resolveProps(b,{flow:s,indicator:"explicit-key-ind",next:x??z?.[0],offset:d,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!z&&!P){g===0&&O.comma?n(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):g<i.items.length-1&&n(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),O.comment&&(u.comment?u.comment+=`
|
|
69
|
+
`+O.comment:u.comment=O.comment),d=O.end;continue}!a&&r.options.strict&&PA.containsNewline(x)&&n(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)O.comma&&n(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(O.comma||n(O.start,"MISSING_CHAR",`Missing , between ${s} items`),O.comment){let D="";e:for(let w of b)switch(w.type){case"comma":case"space":break;case"comment":D=w.source.substring(1);break e;default:break e}if(D){let w=u.items[u.items.length-1];xA.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
|
|
70
|
+
`+D:w.comment=D,O.comment=O.comment.substring(D.length+1)}}if(!a&&!z&&!O.found){let D=P?t(r,P,O,n):e(r,O.end,z,null,O,n);u.items.push(D),d=D.range[2],ih(P)&&n(D.range,"BLOCK_IN_FLOW",rh)}else{r.atKey=!0;let D=O.end,w=x?t(r,x,O,n):e(r,D,b,null,O,n);ih(x)&&n(w.range,"BLOCK_IN_FLOW",rh),r.atKey=!1;let L=X_.resolveProps(z??[],{flow:s,indicator:"map-value-ind",next:P,offset:w.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(L.found){if(!a&&!O.found&&r.options.strict){if(z)for(let G of z){if(G===L.found)break;if(G.type==="newline"){n(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<L.found.offset-1024&&n(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else P&&("source"in P&&P.source?.[0]===":"?n(P,"MISSING_CHAR",`Missing space after : in ${s}`):n(L.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let Y=P?t(r,P,L,n):L.found?e(r,L.end,z,null,L,n):null;Y?ih(P)&&n(Y.range,"BLOCK_IN_FLOW",rh):L.comment&&(w.comment?w.comment+=`
|
|
71
|
+
`+L.comment:w.comment=L.comment);let re=new IA.Pair(w,Y);if(r.options.keepSourceTokens&&(re.srcToken=S),a){let G=u;NA.mapIncludes(r,G.items,w)&&n(D,"DUPLICATE_KEY","Map keys must be unique"),G.items.push(re)}else{let G=new Y_.YAMLMap(r.schema);G.flow=!0,G.items.push(re);let Ye=(Y??w).range;G.range=[w.range[0],Ye[1],Ye[2]],u.items.push(G)}d=Y?Y.range[2]:L.end}}let f=a?"}":"]",[p,...m]=i.end,h=d;if(p?.source===f)h=p.offset+p.source.length;else{let g=s[0].toUpperCase()+s.substring(1),S=l?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;n(d,l?"MISSING_CHAR":"BAD_INDENT",S),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){let g=zA.resolveEnd(m,h,r.options.strict,n);g.comment&&(u.comment?u.comment+=`
|
|
72
|
+
`+g.comment:u.comment=g.comment),u.range=[i.offset,h,g.offset]}else u.range=[i.offset,h,h];return u}Q_.resolveFlowCollection=AA});var nw=N(tw=>{"use strict";var jA=V(),EA=ne(),DA=Pt(),CA=Nt(),TA=B_(),UA=G_(),LA=ew();function oh(t,e,r,i,n,o){let a=r.type==="block-map"?TA.resolveBlockMap(t,e,r,i,o):r.type==="block-seq"?UA.resolveBlockSeq(t,e,r,i,o):LA.resolveFlowCollection(t,e,r,i,o),s=a.constructor;return n==="!"||n===s.tagName?(a.tag=s.tagName,a):(n&&(a.tag=n),a)}function ZA(t,e,r,i,n){let o=i.tag,a=o?e.directives.tagName(o.source,f=>n(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=i,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offset<m.offset)&&n(m,"MISSING_CHAR","Missing newline after block sequence props")}let s=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!a||a==="!"||a===DA.YAMLMap.tagName&&s==="map"||a===CA.YAMLSeq.tagName&&s==="seq")return oh(t,e,r,n,a);let c=e.schema.tags.find(f=>f.tag===a&&f.collection===s);if(!c){let f=e.schema.knownTags[a];if(f?.collection===s)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?n(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${s} collection, but expects ${f.collection??"scalar"}`,!0):n(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),oh(t,e,r,n,a)}let u=oh(t,e,r,n,a,c),l=c.resolve?.(u,f=>n(o,"TAG_RESOLVE_FAILED",f),e.options)??u,d=jA.isNode(l)?l:new EA.Scalar(l);return d.range=u.range,d.tag=a,c?.format&&(d.format=c.format),d}tw.composeCollection=ZA});var sh=N(rw=>{"use strict";var ah=ne();function MA(t,e,r){let i=e.offset,n=VA(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let o=n.mode===">"?ah.Scalar.BLOCK_FOLDED:ah.Scalar.BLOCK_LITERAL,a=e.source?RA(e.source):[],s=a.length;for(let h=a.length-1;h>=0;--h){let g=a[h][1];if(g===""||g==="\r")s=h;else break}if(s===0){let h=n.chomp==="+"&&a.length>0?`
|
|
73
|
+
`.repeat(Math.max(1,a.length-1)):"",g=i+n.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:n.comment,range:[i,g,g]}}let c=e.indent+n.indent,u=e.offset+n.length,l=0;for(let h=0;h<s;++h){let[g,S]=a[h];if(S===""||S==="\r")n.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&r(u+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(c=g.length),l=h,c===0&&!t.atRoot&&r(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=g.length+S.length+1}for(let h=a.length-1;h>=s;--h)a[h][0].length>c&&(s=h+1);let d="",f="",p=!1;for(let h=0;h<l;++h)d+=a[h][0].slice(c)+`
|
|
74
|
+
`;for(let h=l;h<s;++h){let[g,S]=a[h];u+=g.length+S.length+1;let b=S[S.length-1]==="\r";if(b&&(S=S.slice(0,-1)),S&&g.length<c){let z=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(u-S.length-(b?2:1),"BAD_INDENT",z),g=""}o===ah.Scalar.BLOCK_LITERAL?(d+=f+g.slice(c)+S,f=`
|
|
75
|
+
`):g.length>c||S[0]===" "?(f===" "?f=`
|
|
76
|
+
`:!p&&f===`
|
|
77
|
+
`&&(f=`
|
|
78
|
+
|
|
79
|
+
`),d+=f+g.slice(c)+S,f=`
|
|
80
|
+
`,p=!0):S===""?f===`
|
|
81
|
+
`?d+=`
|
|
82
|
+
`:f=`
|
|
83
|
+
`:(d+=f+S,f=" ",p=!1)}switch(n.chomp){case"-":break;case"+":for(let h=s;h<a.length;++h)d+=`
|
|
84
|
+
`+a[h][0].slice(c);d[d.length-1]!==`
|
|
85
|
+
`&&(d+=`
|
|
86
|
+
`);break;default:d+=`
|
|
87
|
+
`}let m=i+n.length+e.source.length;return{value:d,type:o,comment:n.comment,range:[i,m,m]}}function VA({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],o=n[0],a=0,s="",c=-1;for(let f=1;f<n.length;++f){let p=n[f];if(!s&&(p==="-"||p==="+"))s=p;else{let m=Number(p);!a&&m?a=m:c===-1&&(c=t+f)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let u=!1,l="",d=n.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":u=!0;case"newline":d+=p.source.length;break;case"comment":r&&!u&&i(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=p.source.length,l=p.source.substring(1);break;case"error":i(p,"UNEXPECTED_TOKEN",p.message),d+=p.source.length;break;default:{let m=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",m);let h=p.source;h&&typeof h=="string"&&(d+=h.length)}}}return{mode:o,indent:a,chomp:s,comment:l,length:d}}function RA(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),o=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let a=1;a<e.length;a+=2)o.push([e[a],e[a+1]]);return o}rw.resolveBlockScalar=MA});var uh=N(ow=>{"use strict";var ch=ne(),FA=ar();function qA(t,e,r){let{offset:i,type:n,source:o,end:a}=t,s,c,u=(f,p,m)=>r(i+f,p,m);switch(n){case"scalar":s=ch.Scalar.PLAIN,c=JA(o,u);break;case"single-quoted-scalar":s=ch.Scalar.QUOTE_SINGLE,c=KA(o,u);break;case"double-quoted-scalar":s=ch.Scalar.QUOTE_DOUBLE,c=BA(o,u);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let l=i+o.length,d=FA.resolveEnd(a,l,e,r);return{value:c,type:s,comment:d.comment,range:[i,l,d.offset]}}function JA(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),iw(t)}function KA(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),iw(t.slice(1,-1)).replace(/''/g,"'")}function iw(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
88
|
+
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
89
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let n=i[1],o=" ",a=e.lastIndex;for(r.lastIndex=a;i=r.exec(t);)i[1]===""?o===`
|
|
90
|
+
`?n+=o:o=`
|
|
91
|
+
`:(n+=o+i[1],o=" "),a=r.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=a,i=s.exec(t),n+o+(i?.[1]??"")}function BA(t,e){let r="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
|
|
92
|
+
`))if(n===`
|
|
93
|
+
`){let{fold:o,offset:a}=WA(t,i);r+=o,i=a}else if(n==="\\"){let o=t[++i],a=GA[o];if(a)r+=a;else if(o===`
|
|
94
|
+
`)for(o=t[i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="\r"&&t[i+1]===`
|
|
95
|
+
`)for(o=t[++i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="x"||o==="u"||o==="U"){let s=o==="x"?2:o==="u"?4:8;r+=HA(t,i+1,s,e),i+=s}else{let s=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),r+=s}}else if(n===" "||n===" "){let o=i,a=t[i+1];for(;a===" "||a===" ";)a=t[++i+1];a!==`
|
|
96
|
+
`&&!(a==="\r"&&t[i+2]===`
|
|
97
|
+
`)&&(r+=i>o?t.slice(o,i+1):n)}else r+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function WA(t,e){let r="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
98
|
+
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
99
|
+
`);)i===`
|
|
100
|
+
`&&(r+=`
|
|
101
|
+
`),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var GA={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function HA(t,e,r,i){let n=t.substr(e,r),a=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(a)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}ow.resolveFlowScalar=qA});var cw=N(sw=>{"use strict";var an=V(),aw=ne(),YA=sh(),XA=uh();function QA(t,e,r,i){let{value:n,type:o,comment:a,range:s}=e.type==="block-scalar"?YA.resolveBlockScalar(t,e,i):XA.resolveFlowScalar(e,t.options.strict,i),c=r?t.directives.tagName(r.source,d=>i(r,"TAG_RESOLVE_FAILED",d)):null,u;t.options.stringKeys&&t.atKey?u=t.schema[an.SCALAR]:c?u=e0(t.schema,n,c,r,i):e.type==="scalar"?u=t0(t,n,e,i):u=t.schema[an.SCALAR];let l;try{let d=u.resolve(n,f=>i(r??e,"TAG_RESOLVE_FAILED",f),t.options);l=an.isScalar(d)?d:new aw.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);i(r??e,"TAG_RESOLVE_FAILED",f),l=new aw.Scalar(n)}return l.range=s,l.source=n,o&&(l.type=o),c&&(l.tag=c),u.format&&(l.format=u.format),a&&(l.comment=a),l}function e0(t,e,r,i,n){if(r==="!")return t[an.SCALAR];let o=[];for(let s of t.tags)if(!s.collection&&s.tag===r)if(s.default&&s.test)o.push(s);else return s;for(let s of o)if(s.test?.test(e))return s;let a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[an.SCALAR])}function t0({atKey:t,directives:e,schema:r},i,n,o){let a=r.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(i))||r[an.SCALAR];if(r.compat){let s=r.compat.find(c=>c.default&&c.test?.test(i))??r[an.SCALAR];if(a.tag!==s.tag){let c=e.tagString(a.tag),u=e.tagString(s.tag),l=`Value may be parsed as either ${c} or ${u}`;o(n,"TAG_RESOLVE_FAILED",l,!0)}}return a}sw.composeScalar=QA});var lw=N(uw=>{"use strict";function n0(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}uw.emptyScalarPosition=n0});var pw=N(dh=>{"use strict";var r0=pi(),i0=V(),o0=nw(),dw=cw(),a0=ar(),s0=lw(),c0={composeNode:fw,composeEmptyNode:lh};function fw(t,e,r,i){let n=t.atKey,{spaceBefore:o,comment:a,anchor:s,tag:c}=r,u,l=!0;switch(e.type){case"alias":u=u0(t,e,i),(s||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=dw.composeScalar(t,e,c,i),s&&(u.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=o0.composeCollection(c0,t,e,r,i),s&&(u.anchor=s.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);i(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",d),l=!1}}return u??(u=lh(t,e.offset,void 0,null,r,i)),s&&u.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!i0.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(u.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?u.comment=a:u.commentBefore=a),t.options.keepSourceTokens&&l&&(u.srcToken=e),u}function lh(t,e,r,i,{spaceBefore:n,comment:o,anchor:a,tag:s,end:c},u){let l={type:"scalar",offset:s0.emptyScalarPosition(e,r,i),indent:-1,source:""},d=dw.composeScalar(t,l,s,u);return a&&(d.anchor=a.source.substring(1),d.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function u0({options:t},{offset:e,source:r,end:i},n){let o=new r0.Alias(r.substring(1));o.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+r.length,s=a0.resolveEnd(i,a,t.strict,n);return o.range=[e,a,s.offset],s.comment&&(o.comment=s.comment),o}dh.composeEmptyNode=lh;dh.composeNode=fw});var gw=N(hw=>{"use strict";var l0=Pi(),mw=pw(),d0=ar(),f0=Ei();function p0(t,e,{offset:r,start:i,value:n,end:o},a){let s=Object.assign({_directives:e},t),c=new l0.Document(void 0,s),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},l=f0.resolveProps(i,{indicator:"doc-start",next:n??o?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});l.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!l.hasNewline&&a(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?mw.composeNode(u,n,l,a):mw.composeEmptyNode(u,l.end,i,null,l,a);let d=c.contents.range[2],f=d0.resolveEnd(o,d,!1,a);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}hw.composeDoc=p0});var ph=N($w=>{"use strict";var m0=Ji("process"),h0=Xp(),g0=Pi(),Di=ji(),vw=V(),v0=gw(),y0=ar();function Ci(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function yw(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let o=t[n];switch(o[0]){case"#":e+=(e===""?"":i?`
|
|
103
|
+
|
|
104
|
+
`:`
|
|
105
|
+
`)+(o.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var fh=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,o)=>{let a=Ci(r);o?this.warnings.push(new Di.YAMLWarning(a,i,n)):this.errors.push(new Di.YAMLParseError(a,i,n))},this.directives=new h0.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:i,afterEmptyLine:n}=yw(this.prelude);if(i){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
106
|
+
${i}`:i;else if(n||e.directives.docStart||!o)e.commentBefore=i;else if(vw.isCollection(o)&&!o.flow&&o.items.length>0){let a=o.items[0];vw.isPair(a)&&(a=a.key);let s=a.commentBefore;a.commentBefore=s?`${i}
|
|
107
|
+
${s}`:i}else{let a=o.commentBefore;o.commentBefore=a?`${i}
|
|
108
|
+
${a}`:i}}if(r){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:yw(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(m0.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let o=Ci(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=v0.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Di.YAMLParseError(Ci(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Di.YAMLParseError(Ci(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let r=y0.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
109
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Di.YAMLParseError(Ci(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new g0.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};$w.Composer=fh});var ww=N(Gs=>{"use strict";var $0=sh(),b0=uh(),_0=ji(),bw=yi();function w0(t,e=!0,r){if(t){let i=(n,o,a)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(s,o,a);else throw new _0.YAMLParseError([s,s+1],o,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return b0.resolveFlowScalar(t,e,i);case"block-scalar":return $0.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function k0(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:o=-1,type:a="PLAIN"}=e,s=bw.stringifyString({type:a,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
110
|
+
`}];switch(s[0]){case"|":case">":{let u=s.indexOf(`
|
|
111
|
+
`),l=s.substring(0,u),d=s.substring(u+1)+`
|
|
112
|
+
`,f=[{type:"block-scalar-header",offset:o,indent:i,source:l}];return _w(f,c)||f.push({type:"newline",offset:-1,indent:i,source:`
|
|
113
|
+
`}),{type:"block-scalar",offset:o,indent:i,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:s,end:c};default:return{type:"scalar",offset:o,indent:i,source:s,end:c}}}function S0(t,e,r={}){let{afterKey:i=!1,implicitKey:n=!1,inFlow:o=!1,type:a}=r,s="indent"in t?t.indent:null;if(i&&typeof s=="number"&&(s+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=bw.stringifyString({type:a,value:e},{implicitKey:n||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":x0(t,c);break;case'"':mh(t,c,"double-quoted-scalar");break;case"'":mh(t,c,"single-quoted-scalar");break;default:mh(t,c,"scalar")}}function x0(t,e){let r=e.indexOf(`
|
|
114
|
+
`),i=e.substring(0,r),n=e.substring(r+1)+`
|
|
115
|
+
`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,t.source=n}else{let{offset:o}=t,a="indent"in t?t.indent:-1,s=[{type:"block-scalar-header",offset:o,indent:a,source:i}];_w(s,"end"in t?t.end:void 0)||s.push({type:"newline",offset:-1,indent:a,source:`
|
|
116
|
+
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:a,props:s,source:n})}}function _w(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function mh(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let o of i)o.offset+=n;delete t.props,Object.assign(t,{type:r,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
117
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}Gs.createScalarToken=k0;Gs.resolveAsScalar=w0;Gs.setScalarValue=S0});var Sw=N(kw=>{"use strict";var I0=t=>"type"in t?Ys(t):Hs(t);function Ys(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Ys(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Hs(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Hs(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Hs(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Hs({start:t,key:e,sep:r,value:i}){let n="";for(let o of t)n+=o.source;if(e&&(n+=Ys(e)),r)for(let o of r)n+=o.source;return i&&(n+=Ys(i)),n}kw.stringify=I0});var zw=N(Ow=>{"use strict";var hh=Symbol("break visit"),O0=Symbol("skip children"),xw=Symbol("remove item");function sn(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Iw(Object.freeze([]),t,e)}sn.BREAK=hh;sn.SKIP=O0;sn.REMOVE=xw;sn.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let o=r?.[i];if(o&&"items"in o)r=o.items[n];else return}return r};sn.parentCollection=(t,e)=>{let r=sn.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function Iw(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let o=e[n];if(o&&"items"in o){for(let a=0;a<o.items.length;++a){let s=Iw(Object.freeze(t.concat([[n,a]])),o.items[a],r);if(typeof s=="number")a=s-1;else{if(s===hh)return hh;s===xw&&(o.items.splice(a,1),a-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Ow.visit=sn});var Xs=N(Ie=>{"use strict";var gh=ww(),z0=Sw(),P0=zw(),vh="\uFEFF",yh="",$h="",bh="",N0=t=>!!t&&"items"in t,A0=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function j0(t){switch(t){case vh:return"<BOM>";case yh:return"<DOC>";case $h:return"<FLOW_END>";case bh:return"<SCALAR>";default:return JSON.stringify(t)}}function E0(t){switch(t){case vh:return"byte-order-mark";case yh:return"doc-mode";case $h:return"flow-error-end";case bh:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
118
|
+
`:case`\r
|
|
119
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Ie.createScalarToken=gh.createScalarToken;Ie.resolveAsScalar=gh.resolveAsScalar;Ie.setScalarValue=gh.setScalarValue;Ie.stringify=z0.stringify;Ie.visit=P0.visit;Ie.BOM=vh;Ie.DOCUMENT=yh;Ie.FLOW_END=$h;Ie.SCALAR=bh;Ie.isCollection=N0;Ie.isScalar=A0;Ie.prettyToken=j0;Ie.tokenType=E0});var kh=N(Nw=>{"use strict";var Ti=Xs();function Re(t){switch(t){case void 0:case" ":case`
|
|
120
|
+
`:case"\r":case" ":return!0;default:return!1}}var Pw=new Set("0123456789ABCDEFabcdef"),D0=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qs=new Set(",[]{}"),C0=new Set(` ,[]{}
|
|
121
|
+
\r `),_h=t=>!t||C0.has(t),wh=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let i=this.next??"stream";for(;i&&(r||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
122
|
+
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
123
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let i=0;for(;r===" ";)r=this.buffer[++i+e];if(r==="\r"){let n=this.buffer[i+e+1];if(n===`
|
|
124
|
+
`||!n&&!this.atEnd)return e+i+1}return r===`
|
|
125
|
+
`||i>=this.indentNext||!r&&!this.atEnd?e+i:-1}if(r==="-"||r==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&Re(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
126
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ti.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,i=e.indexOf("#");for(;i!==-1;){let o=e[i-1];if(o===" "||o===" "){r=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let n=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Ti.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Re(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Re(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Re(r)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(_h),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,i=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&Re(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Ti.FLOW_END,yield*this.parseLineStart();let o=0;for(;n[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),n[o]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(_h),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Re(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}let i=this.buffer.substring(0,r),n=i.indexOf(`
|
|
127
|
+
`,this.pos);if(n!==-1){for(;n!==-1;){let o=this.continueScalar(n+1);if(o===-1)break;n=i.indexOf(`
|
|
128
|
+
`,o)}n!==-1&&(r=n-(i[n-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Re(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":r+=1;break;case`
|
|
129
|
+
`:e=o,r=0;break;case"\r":{let a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
130
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
|
|
131
|
+
`,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(i=this.buffer[n];i===" ";)i=this.buffer[++n];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
132
|
+
`;)i=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let o=e-1,a=this.buffer[o];a==="\r"&&(a=this.buffer[--o]);let s=o;for(;a===" ";)a=this.buffer[--o];if(a===`
|
|
133
|
+
`&&o>=this.pos&&o+1+r>s)e=o;else break}while(!0);return yield Ti.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let o=this.buffer[i+1];if(Re(o)||e&&Qs.has(o))break;r=i}else if(Re(n)){let o=this.buffer[i+1];if(n==="\r"&&(o===`
|
|
134
|
+
`?(i+=1,n=`
|
|
135
|
+
`,o=this.buffer[i+1]):r=i),o==="#"||e&&Qs.has(o))break;if(n===`
|
|
136
|
+
`){let a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(e&&Qs.has(n))break;r=i}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield Ti.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(_h),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,i=this.charAt(1);if(Re(i)||r&&Qs.has(i)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Re(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(D0.has(r))r=this.buffer[++e];else if(r==="%"&&Pw.has(this.buffer[e+1])&&Pw.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
137
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
138
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,i;do i=this.buffer[++r];while(i===" "||e&&i===" ");let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let r=this.pos,i=this.buffer[r];for(;!e(i);)i=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};Nw.Lexer=wh});var xh=N(Aw=>{"use strict";var Sh=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,i=this.lineStarts.length;for(;r<i;){let o=r+i>>1;this.lineStarts[o]<e?r=o+1:i=o}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let n=this.lineStarts[r-1];return{line:r,col:e-n+1}}}};Aw.LineCounter=Sh});var Oh=N(Tw=>{"use strict";var T0=Ji("process"),jw=Xs(),U0=kh();function At(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function Ew(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Cw(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ec(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function sr(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function tc(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function Dw(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!At(e.start,"explicit-key-ind")&&!At(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Cw(e.value)?e.value.end?tc(e.value.end,e.sep):e.value.end=e.sep:tc(e.start,e.sep),delete e.sep)}var Ih=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new U0.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,r))yield*this.next(i);r||(yield*this.end())}*next(e){if(this.source=e,T0.env.LOG_TOKENS&&console.log("|",jw.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=jw.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let i=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in i?i.indent:0:r.type==="flow-collection"&&i.type==="document"&&(r.indent=0),r.type==="flow-collection"&&Dw(r),i.type){case"document":i.value=r;break;case"block-scalar":i.props.push(r);break;case"block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=r;else{Object.assign(n,{key:r,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:r}):n.value=r;break}case"flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:r,sep:[]}):n.sep?n.value=r:Object.assign(n,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let n=r.items[r.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Ew(n.start)===-1&&(r.indent===0||n.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Ew(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=ec(this.peek(2)),i=sr(r),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
139
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
140
|
+
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tc(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(n&&r.sep&&!r.value){let a=[];for(let s=0;s<r.sep.length;++s){let c=r.sep[s];switch(c.type){case"newline":a.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=r.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":n||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):n||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(At(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Cw(r.key)&&!At(r.sep,"newline")){let a=sr(r.start),s=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:s,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(At(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=sr(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||n?e.items.push({start:o,key:null,sep:[this.sourceToken]}):At(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);n||r.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(a):(Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!r.explicitKey&&r.sep&&!At(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tc(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||At(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=ec(i),o=sr(n);Dw(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
141
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
142
|
+
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=ec(e),i=sr(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=ec(e),i=sr(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Tw.Parser=Ih});var Vw=N(Li=>{"use strict";var Uw=ph(),L0=Pi(),Ui=ji(),Z0=dm(),M0=V(),V0=xh(),Lw=Oh();function Zw(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new V0.LineCounter||null,prettyErrors:e}}function R0(t,e={}){let{lineCounter:r,prettyErrors:i}=Zw(e),n=new Lw.Parser(r?.addNewLine),o=new Uw.Composer(e),a=Array.from(o.compose(n.parse(t)));if(i&&r)for(let s of a)s.errors.forEach(Ui.prettifyError(t,r)),s.warnings.forEach(Ui.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},o.streamInfo())}function Mw(t,e={}){let{lineCounter:r,prettyErrors:i}=Zw(e),n=new Lw.Parser(r?.addNewLine),o=new Uw.Composer(e),a=null;for(let s of o.compose(n.parse(t),!0,t.length))if(!a)a=s;else if(a.options.logLevel!=="silent"){a.errors.push(new Ui.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(a.errors.forEach(Ui.prettifyError(t,r)),a.warnings.forEach(Ui.prettifyError(t,r))),a}function F0(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=Mw(t,r);if(!n)return null;if(n.warnings.forEach(o=>Z0.warn(n.options.logLevel,o)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},r))}function q0(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return M0.isDocument(t)&&!i?t.toString(r):new L0.Document(t,i,r).toString(r)}Li.parse=F0;Li.parseAllDocuments=R0;Li.parseDocument=Mw;Li.stringify=q0});var cn=N(J=>{"use strict";var J0=ph(),K0=Pi(),B0=Bm(),zh=ji(),W0=pi(),jt=V(),G0=Ot(),H0=ne(),Y0=Pt(),X0=Nt(),Q0=Xs(),ej=kh(),tj=xh(),nj=Oh(),nc=Vw(),Rw=ui();J.Composer=J0.Composer;J.Document=K0.Document;J.Schema=B0.Schema;J.YAMLError=zh.YAMLError;J.YAMLParseError=zh.YAMLParseError;J.YAMLWarning=zh.YAMLWarning;J.Alias=W0.Alias;J.isAlias=jt.isAlias;J.isCollection=jt.isCollection;J.isDocument=jt.isDocument;J.isMap=jt.isMap;J.isNode=jt.isNode;J.isPair=jt.isPair;J.isScalar=jt.isScalar;J.isSeq=jt.isSeq;J.Pair=G0.Pair;J.Scalar=H0.Scalar;J.YAMLMap=Y0.YAMLMap;J.YAMLSeq=X0.YAMLSeq;J.CST=Q0;J.Lexer=ej.Lexer;J.LineCounter=tj.LineCounter;J.Parser=nj.Parser;J.parse=nc.parse;J.parseAllDocuments=nc.parseAllDocuments;J.parseDocument=nc.parseDocument;J.stringify=nc.stringify;J.visit=Rw.visit;J.visitAsync=Rw.visitAsync});var ct=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Ut=class extends ct{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var mr=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Ki(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}import{EventEmitter as Mk}from"events";import kc from"child_process";import Qe from"path";import Wi from"fs";import R from"process";import{stripVTControlCharacters as Vk}from"util";import{stripVTControlCharacters as Uk}from"util";var hr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,o)=>n.name().localeCompare(o.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),o=i.long&&e._findOption(i.long);!n&&!o?r.push(i):i.long&&!o?r.push(e.createOption(i.long,i.description)):i.short&&!n&&r.push(e.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(o=>!o.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>Ki(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let n=new Map;return e.forEach(o=>{let a=i(o);n.has(a)||n.set(a,[])}),r.forEach(o=>{let a=i(o);n.has(a)||n.set(a,[]),n.get(a).push(o)}),n}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth??80;function o(d,f){return r.formatItem(d,i,f,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],s=r.commandDescription(e);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(a=a.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));a=a.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));a=a.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));a=a.concat(this.formatItemList(f,p,r))}),a.join(`
|
|
143
|
+
`)}displayWidth(e){return Uk(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,i,n){let a=" ".repeat(2);if(!i)return a+e;let s=e.padEnd(r+e.length-n.displayWidth(e)),c=2,l=(this.helpWidth??80)-r-c-2,d;return l<this.minWidthToWrap||n.preformatted(i)?d=i:d=n.boxWrap(i,l).replace(/\n/g,`
|
|
144
|
+
`+" ".repeat(r+c)),a+s+" ".repeat(c)+d.replace(/\n/g,`
|
|
145
|
+
${a}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return i.forEach(a=>{let s=a.match(n);if(s===null){o.push("");return}let c=[s.shift()],u=this.displayWidth(c[0]);s.forEach(l=>{let d=this.displayWidth(l);if(u+d<=r){c.push(l),u+=d;return}o.push(c.join(""));let f=l.trimStart();c=[f],u=this.displayWidth(f)}),o.push(c.join(""))}),o.join(`
|
|
146
|
+
`)}};var pn=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=Lk(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?eg(this.name().replace(/^no-/,"")):eg(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Bi=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,o=n!==void 0?n:!1;return r.negate===(o===e)}};function eg(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Lk(t){let e,r,i=/^-[^-]$/,n=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),n.test(o[0])&&(r=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&n.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let a=o[0],s=`option creation failed due to '${a}' in option flags '${t}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
|
|
147
|
+
- a short flag is a single dash and a single character
|
|
148
|
+
- either use a single dash and a single character (for a short flag)
|
|
149
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(a)?new Error(`${s}
|
|
150
|
+
- too many short flags`):n.test(a)?new Error(`${s}
|
|
151
|
+
- too many long flags`):new Error(`${s}
|
|
152
|
+
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}function Zk(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let o;t[n-1]===e[i-1]?o=0:o=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+o),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[t.length][e.length]}function wc(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(a=>a.slice(2)));let i=[],n=3,o=.4;return e.forEach(a=>{if(a.length<=1)return;let s=Zk(t,a),c=Math.max(t.length,a.length);(c-s)/c>o&&(s<n?(n=s,i=[a]):s===n&&i.push(a))}),i.sort((a,s)=>a.localeCompare(s)),r&&(i=i.map(a=>`--${a}`)),i.length>1?`
|
|
153
|
+
(Did you mean one of ${i.join(", ")}?)`:i.length===1?`
|
|
154
|
+
(Did you mean ${i[0]}?)`:""}var mn=class t extends Mk{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>R.stdout.write(r),writeErr:r=>R.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>R.stdout.isTTY?R.stdout.columns:void 0,getErrHelpWidth:()=>R.stderr.isTTY?R.stderr.columns:void 0,getOutHasColors:()=>ng()??(R.stdout.isTTY&&R.stdout.hasColors?.()),getErrHasColors:()=>ng()??(R.stderr.isTTY&&R.stderr.hasColors?.()),stripColor:r=>Vk(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,o=i;typeof n=="object"&&n!==null&&(o=n,n=null),o=o||{};let[,a,s]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(a);return n&&(c.description(n),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,s&&c.arguments(s),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new hr,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
155
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new mr(e,r)}argument(e,r,i,n){let o=this.createArgument(e,r);return typeof i=="function"?o.default(n).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,n,o]=i.match(/([^ ]+) *(.*)/),a=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),o&&s.arguments(o),a&&s.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=s,(e||r)&&this._initCommandGroup(s),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
156
|
+
Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new ct(e,r,i)),R.exit(e)}action(e){let r=i=>{let n=this.registeredArguments.length,o=i.slice(0,n);return this._storeOptionsAsProperties?o[n]=this:o[n]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new pn(e,r)}_callParseArg(e,r,i,n){try{return e.parseArg(r,i)}catch(o){if(o.code==="commander.invalidArgument"){let a=`${n} ${o.message}`;this.error(a,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
|
|
157
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=n=>[n.name()].concat(n.aliases()),i=r(e).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(o,a,s)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(i);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,a):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(i,o,s)};return this.on("option:"+r,o=>{let a=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,a,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let a=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,a,"env")}),this}_optionEx(e,r,i,n,o){if(typeof r=="object"&&r instanceof pn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,i);if(a.makeOptionMandatory(!!e.mandatory),typeof n=="function")a.default(o).argParser(n);else if(n instanceof RegExp){let s=n;n=(c,u)=>{let l=s.exec(c);return l?l[0]:u},a.default(o).argParser(n)}else a.default(n);return this.addOption(a)}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:!0},e,r,i,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){R.versions?.electron&&(r.from="electron");let n=R.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}e===void 0&&(e=R.argv),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":R.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let r=e.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
158
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,i){if(Wi.existsSync(e))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
|
|
159
|
+
- if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
160
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
161
|
+
- ${n}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,d){let f=Qe.resolve(l,d);if(Wi.existsSync(f))return f;if(i.includes(Qe.extname(d)))return;let p=i.find(m=>Wi.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Wi.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=Qe.resolve(Qe.dirname(l),a)}if(a){let l=n(a,o);if(!l&&!e._executableFile&&this._scriptPath){let d=Qe.basename(this._scriptPath,Qe.extname(this._scriptPath));d!==this._name&&(l=n(a,`${d}-${e._name}`))}o=l||o}let s=i.includes(Qe.extname(o)),c;R.platform!=="win32"?s?(r.unshift(o),r=tg(R.execArgv).concat(r),c=kc.spawn(R.argv[0],r,{stdio:"inherit"})):c=kc.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),r.unshift(o),r=tg(R.execArgv).concat(r),c=kc.spawn(R.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{R.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new ct(l,"commander.executeSubCommandAsync","(close)")):R.exit(l)}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)R.exit(1);else{let d=new ct(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:!0}),n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,n,o)=>{let a=n;if(n!==null&&i.parseArg){let s=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;a=this._callParseArg(i,n,o,s)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let o=i.defaultValue;i.variadic?n<this.args.length?(o=this.args.slice(n),i.parseArg&&(o=o.reduce((a,s)=>e(i,s,a),i.defaultValue))):o===void 0&&(o=[]):n<this.args.length&&(o=this.args[n],i.parseArg&&(o=e(i,o,i.defaultValue))),r[n]=o}),this.processedArgs=r}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:o,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{n=this._chainOrCall(n,()=>o(this,r))}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(o,e,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(o=>i.conflictsWith.includes(o.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],i=[],n=r;function o(l){return l.length>1&&l[0]==="-"}let a=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,s=null,c=null,u=0;for(;u<e.length||c;){let l=c??e[u++];if(c=null,l==="--"){n===i&&n.push(l),n.push(...e.slice(u));break}if(s&&(!o(l)||a(l))){this.emit(`option:${s.name()}`,l);continue}if(s=null,o(l)){let d=this._findOption(l);if(d){if(d.required){let f=e[u++];f===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,f)}else if(d.optional){let f=null;u<e.length&&(!o(e[u])||a(e[u]))&&(f=e[u++]),this.emit(`option:${d.name()}`,f)}else this.emit(`option:${d.name()}`);s=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),f=this._findOption(l.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,l.slice(d+1));continue}}if(n===r&&o(l)&&!(this.commands.length===0&&a(l))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(u));break}else if(this._defaultCommandName){i.push(l,...e.slice(u));break}}if(this._passThroughOptions){n.push(l,...e.slice(u));break}n.push(l)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
162
|
+
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
163
|
+
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
164
|
+
`),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,o=i.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in R.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,R.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Bi(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let i=a=>{let s=a.attributeName(),c=this.getOptionValue(s),u=this.options.find(d=>d.negate&&s===d.attributeName()),l=this.options.find(d=>!d.negate&&s===d.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:l||a},n=a=>{let s=i(a),c=s.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},o=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let a=o.createHelp().visibleOptions(o).filter(s=>s.long).map(s=>s.long);n=n.concat(a),o=o.parent}while(o&&!o._enablePositionalOptions);r=wc(e,n)}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=e.length,o=this.parent?` for '${this.name()}'`:"",a=e.join(", "),s=`error: too many arguments${o}. Expected ${r} argument${i} but got ${n}: ${a}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(o=>{n.push(o.name()),o.alias()&&n.push(o.alias())}),r=wc(e,n)}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
165
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>Ki(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Qe.basename(e,Qe.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),i=this._getOutputContext(e);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let r=!!e.error,i,n,o;return r?(i=s=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=s=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(n||(s=this._outputConfiguration.stripColor(s)),i(s)),hasColors:n,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getOutputContext(e),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:i.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(R.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
166
|
+
Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,o=>{let a;typeof r=="function"?a=r({error:o.error,command:o.command}):a=r,a&&o.write(`${a}
|
|
167
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function tg(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}function ng(){if(R.env.NO_COLOR||R.env.FORCE_COLOR==="0"||R.env.FORCE_COLOR==="false")return!1;if(R.env.FORCE_COLOR||R.env.CLICOLOR_FORCE!==void 0)return!0}var eE=new mn;import xj from"os";import Hh from"path";import{promises as hg}from"fs";import vr from"path";import Bk from"os";import{promises as Fk}from"fs";import cg from"path";var Rk=/^([\w.-]+)\/([\w.-]+)(?:@([^#]+))?(?:#(.+))?$/;function ze(t){let e=t.indexOf(":");if(e<=0)throw new Error(`source\uC5D0 \uC2A4\uD0B4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4: "${t}" (\uC608: file:./skills/x, github:user/repo@v1)`);let r=t.slice(0,e),i=t.slice(e+1);switch(r){case"file":if(!i)throw new Error(`file: \uB4A4\uC5D0 \uACBD\uB85C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4: "${t}"`);return{scheme:r,path:i};case"github":{let n=Rk.exec(i);if(!n)throw new Error(`github: \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4: "${t}" (\uC608: github:user/repo@v1.0#sub/path)`);let[,o,a,s,c]=n;return{scheme:r,owner:o,repo:a,ref:s,subpath:c}}case"git":{let n=i.lastIndexOf("#"),o=n>=0?i.slice(0,n):i,a=n>=0?i.slice(n+1):void 0;if(!o)throw new Error(`git: \uB4A4\uC5D0 URL \uC774 \uC5C6\uC2B5\uB2C8\uB2E4: "${t}"`);return{scheme:r,url:o,ref:a||void 0}}default:if(!/^[a-z][\w-]*$/.test(r))throw new Error(`\uC54C \uC218 \uC5C6\uB294 \uC2A4\uD0B4 "${r}": "${t}"`);return{scheme:"other",name:r,rest:i}}}function ig(t){return t.scheme==="file"||t.scheme==="github"||t.scheme==="git"}function rg(t){switch(t.scheme){case"file":return`file:${t.path}`;case"github":return`github:${t.owner}/${t.repo}${t.ref?`@${t.ref}`:""}${t.subpath?`#${t.subpath}`:""}`;case"git":return`git:${t.url}${t.ref?`#${t.ref}`:""}`;case"other":return`${t.name}:${t.rest}`}}function Sc(t){if(t.scheme==="github")return{url:`https://github.com/${t.owner}/${t.repo}.git`,ref:t.ref};if(t.scheme==="git")return{url:t.url,ref:t.ref};throw new Error("file: \uCD9C\uCC98\uB294 clone \uB300\uC0C1\uC774 \uC544\uB2D9\uB2C8\uB2E4")}function og(t,e){let r=/^(?:https?:\/\/github\.com\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(t);return rg(r?{scheme:"github",owner:r[1],repo:r[2],ref:e}:{scheme:"git",url:t,ref:e})}async function Gi(t,e){try{return JSON.parse(await Fk.readFile(t,"utf8"))}catch{return e}}var ag=t=>cg.join(t.adapter.root,"plugins","installed_plugins.json"),sg=t=>cg.join(t.adapter.root,"plugins","known_marketplaces.json");function Lt(t){let e=ze(t.source);if(e.scheme!=="other")throw new Error(`package ${t.id}: ${t.source} \uB294 \uD50C\uB7EC\uADF8\uC778 \uCD9C\uCC98\uAC00 \uC544\uB2D9\uB2C8\uB2E4`);return e.rest}async function Hi(t,e){try{await t.exec("claude",e)}catch(r){throw r.code==="ENOENT"?new Error("claude CLI \uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. Claude Code \uAC00 \uC124\uCE58\uB418\uC5B4 \uC788\uC5B4\uC57C \uD50C\uB7EC\uADF8\uC778\uC744 \uBCF5\uC6D0\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."):r}}var ug={name:"claude-marketplace",schemes:["claude-marketplace"],priority:10,async detect(t){let e=await Gi(sg(t),{}),r=[];for(let[i,n]of Object.entries(e)){let o=n.source;o.source==="github"&&o.repo?r.push({id:i,source:`claude-marketplace:${o.repo}`,rev:o.repo}):t.log(` ! marketplace ${i}: ${o.source} \uCD9C\uCC98\uB294 \uC544\uC9C1 \uAE30\uB85D\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4 (\uAC74\uB108\uB700)`)}return r},async status(t,e){let i=(await Gi(sg(t),{}))[e.id];return{present:!!i,rev:i?.source.repo}},async install(t,e,r,i){let n=Lt(e);return await Hi(t,["plugin","marketplace","add",n,"--scope","user"]),n},async update(t,e){return await Hi(t,["plugin","marketplace","update",e.id]),Lt(e)},describe(t){return`claude plugin marketplace add ${Lt(t)}`},cwd(t){return t.adapter.root}},lg={name:"claude-plugin",schemes:["claude-plugin"],priority:20,async detect(t){let e=await Gi(ag(t),{version:2,plugins:{}}),r=[];for(let[i,n]of Object.entries(e.plugins)){let o=n.find(s=>s.scope==="user");if(!o)continue;let[a]=i.split("@");r.push({id:a,source:`claude-plugin:${i}`,rev:o.version})}return r},async status(t,e){let i=(await Gi(ag(t),{version:2,plugins:{}})).plugins[Lt(e)]?.find(n=>n.scope==="user");return{present:!!i,rev:i?.version}},async install(t,e,r,i){return await Hi(t,["plugin","install",Lt(e),"--scope","user",...i.yes?["-y"]:[]]),(await this.status(t,e)).rev??"?"},async update(t,e){return await Hi(t,["plugin","update",Lt(e)]),(await this.status(t,e)).rev??"?"},describe(t,e){return`claude plugin install ${Lt(t)}${e?` (\uC804\uC5D0 ${e}; \uACE0\uC815\uC740 \uC548 \uB428)`:""}`},cwd(t){return t.adapter.root}};import{promises as Yi}from"fs";import qk from"path";var gr=class{constructor(e){this.spec=e;this.name=e.name,this.secretKeys=e.secretKeys,this.secretRootIds=e.secretRootIds,this.expandsEnv=e.expandsEnv}spec;kind="entry";name;secretKeys;secretRootIds;expandsEnv;file(){return this.spec.file()}async load(){let e=await this.file();try{return JSON.parse(await Yi.readFile(e,"utf8"))}catch(r){if(r.code==="ENOENT")return{};throw new Error(`${e} \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${r.message}`)}}section(e){let r=this.spec.under?e[this.spec.under]:e;return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}async read(){let e={...this.section(await this.load())};for(let r of this.spec.skip??[])delete e[r];return e}async write(e,r){let i=await this.file(),n=await this.load(),o={...this.section(n)};r===null?delete o[e]:o[e]=r;let a=this.spec.under?{...n,[this.spec.under]:o}:o;await Yi.mkdir(qk.dirname(i),{recursive:!0});let s=`${i}.lshed-${process.pid}.tmp`;await Yi.writeFile(s,JSON.stringify(a,null,2)+`
|
|
168
|
+
`),await Yi.rename(s,i)}};import{promises as Pe}from"fs";import{createHash as pg}from"crypto";import se from"path";var ut=["node_modules",".git","__pycache__",".venv",".mypy_cache",".pytest_cache",".DS_Store","*.log"];function Jk(t,e){return e.startsWith("*.")?t.endsWith(e.slice(1)):t===e}function xc(t,e){return t?t.split("/").some(r=>e.some(i=>Jk(r,i))):!1}function dg(t){let e=se.resolve(t.replace(/^\\\\\?\\/,""));return process.platform==="win32"?e.toLowerCase():e}async function Oc(t){let e=se.resolve(t),r=[];for(;;)try{return se.join(await Pe.realpath(e),...r.reverse())}catch{let i=se.dirname(e);if(i===e)return se.resolve(t);r.push(se.basename(e)),e=i}}function Xi(t,e){let r=dg(t),i=dg(e);return r===i||i.startsWith(r.endsWith(se.sep)?r:r+se.sep)}async function ee(t){try{return await Pe.access(t),!0}catch{return!1}}async function Kk(t){try{return(await Pe.stat(t)).isDirectory()}catch{return!1}}async function Ic(t,e=ut){if(!await ee(t))return[];if(!await Kk(t))return[""];let r=[];async function i(n,o){let a=await Pe.readdir(n,{withFileTypes:!0});for(let s of a){let c=o?`${o}/${s.name}`:s.name;if(xc(c,e))continue;let u=se.join(n,s.name),l;try{l=await Pe.stat(u)}catch{continue}l.isDirectory()?await i(u,c):l.isFile()&&r.push(c)}}return await i(t,""),r.sort()}async function fg(t){return pg("sha256").update(await Pe.readFile(t)).digest("hex")}async function hn(t,e=ut){if(!await ee(t))return null;let r=pg("sha256");for(let i of await Ic(t,e))r.update(i).update("\0").update(await Pe.readFile(i?se.join(t,i):t)).update("\0");return r.digest("hex")}async function et(t,e,r=ut){await Pe.rm(e,{recursive:!0,force:!0}),await Pe.mkdir(se.dirname(e),{recursive:!0});let i=se.resolve(t);await Pe.cp(t,e,{recursive:!0,dereference:!0,filter:async n=>{let o=se.relative(i,se.resolve(n)).split(se.sep).join("/");if(xc(o,r))return!1;try{(await Pe.lstat(n)).isSymbolicLink()&&await Pe.stat(n)}catch{return!1}return!0}})}async function Qi(t){await Pe.rm(t,{recursive:!0,force:!0})}async function mg(t,e,r=ut){let i=new Set(await Ic(t,r)),n=new Set(await Ic(e,r)),o=[];for(let a of[...new Set([...i,...n])].sort()){let s=a?se.join(t,a):t,c=a?se.join(e,a):e;i.has(a)&&!n.has(a)?o.push({status:"A",file:a}):!i.has(a)&&n.has(a)?o.push({status:"D",file:a}):await fg(s)!==await fg(c)&&o.push({status:"M",file:a})}return o}var gg=[{name:"skills",root:"skills",kind:"dir"},{name:"agents",root:"agents",kind:"file"},{name:"commands",root:"commands",kind:"file"}],eo=class{name="claude-code";root;entryCats;constructor(e){this.root=e??process.env.CLAUDE_CONFIG_DIR??vr.join(Bk.homedir(),".claude");let r=this.root;this.entryCats=[new gr({name:"mcp",file:async()=>{let i=vr.join(r,".claude.json");return await ee(i)?i:`${r}.json`},under:"mcpServers",secretKeys:["env","headers"],expandsEnv:!0}),new gr({name:"settings",file:async()=>vr.join(r,"settings.json"),secretKeys:[],secretRootIds:["env"],expandsEnv:!1,skip:["enabledPlugins"]})]}entries(){return this.entryCats}categories(){return gg}instructionsStrategy(){return"import"}instructionsFileName(){return"CLAUDE.md"}installers(){return[ug,lg]}async scan(){let e=[];for(let r of gg){let i=vr.join(this.root,r.root),n;try{n=await hg.readdir(i,{withFileTypes:!0})}catch{continue}for(let o of n){if(o.name.startsWith("."))continue;let a=vr.join(i,o.name),s;try{s=await hg.stat(a)}catch{continue}r.kind==="dir"&&s.isDirectory()?e.push({category:r.name,id:o.name,path:a}):r.kind==="file"&&s.isFile()&&o.name.endsWith(".md")&&e.push({category:r.name,id:o.name.slice(0,-3),path:a})}}return e}};import{promises as lj}from"fs";import Bw from"path";import{spawn as dj}from"child_process";import{promises as eS}from"fs";import no from"path";import{execFile as Wk,spawn as Gk}from"child_process";import{promisify as Hk}from"util";import Yk from"path";var Xk=Hk(Wk);async function te(t,e){let{stdout:r}=await Xk("git",t,{cwd:e,maxBuffer:16777216});return r.trim()}var yr=t=>ee(Yk.join(t,".git")),vg=t=>te(["remote","get-url","origin"],t).catch(()=>null),$r=t=>te(["rev-parse","HEAD"],t),yg=async t=>{let e=await te(["rev-parse","--abbrev-ref","HEAD"],t);return e==="HEAD"?void 0:e},$g=(t,e,r)=>te(["clone","--quiet",...r?["--branch",r]:[],t,e]),bg=(t,e)=>te(["reset","--hard","--quiet",e],t),_g=t=>te(["pull","--ff-only","--quiet"],t);function wg(t,e){return new Promise((r,i)=>{let n=Gk(t,{cwd:e,stdio:"inherit",shell:!0});n.on("error",i),n.on("close",o=>o===0?r():i(new Error(`\uBA85\uB839\uC774 ${o} \uB85C \uB05D\uB0AC\uC2B5\uB2C8\uB2E4: ${t}`)))})}function to(t,e){if(!e.into)throw new Error(`package ${e.id}: git \uACC4\uC5F4 \uD328\uD0A4\uC9C0\uB294 into \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4`);return no.join(t.adapter.root,...e.into.split("/"))}var kg={name:"git",schemes:["github","git"],priority:0,async detect(t,e){let r=[];for(let i of e){if(!await yr(i.path))continue;let n=await vg(i.path);if(!n)continue;let o=no.relative(t.adapter.root,i.path).split(no.sep).join("/");r.push({id:i.id,into:o,source:og(n,await yg(i.path)),rev:await $r(i.path),path:i.path})}return r},async status(t,e){let r=to(t,e),i=await yr(r);return{present:i,rev:i?await $r(r):void 0}},async install(t,e,r,i){let n=to(t,e);if(await ee(n))throw new Error(`package ${e.id}: ${n} \uAC00 \uC788\uC9C0\uB9CC git \uC800\uC7A5\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4. \uCE58\uC6B0\uAC70\uB098 into \uB97C \uBC14\uAFB8\uC138\uC694.`);let{url:o,ref:a}=Sc(ze(e.source));return await eS.mkdir(no.dirname(n),{recursive:!0}),await $g(o,n,a),r&&await bg(n,r).catch(()=>{throw new Error(`package ${e.id}: \uB77D\uC758 \uCEE4\uBC0B ${r.slice(0,7)} \uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 'lshed update ${e.id}' \uB85C \uB77D\uC744 \uAC31\uC2E0\uD558\uC138\uC694.`)}),$r(n)},async update(t,e){let r=to(t,e);return await _g(r),$r(r)},describe(t,e){let{url:r,ref:i}=Sc(ze(t.source));return`clone ${r}${i?` @${i}`:""}${e?` \u2192 ${e.slice(0,7)}`:""}`},cwd:to};var T={};Xe(T,{$brand:()=>Fc,$input:()=>fd,$output:()=>dd,NEVER:()=>Rc,TimePrecision:()=>wd,ZodAny:()=>up,ZodArray:()=>pp,ZodBase64:()=>Ga,ZodBase64URL:()=>Ha,ZodBigInt:()=>Wn,ZodBigIntFormat:()=>Qa,ZodBoolean:()=>Bn,ZodCIDRv4:()=>Ba,ZodCIDRv6:()=>Wa,ZodCUID:()=>Ma,ZodCUID2:()=>Va,ZodCatch:()=>Dp,ZodCodec:()=>oi,ZodCompileAsyncError:()=>Ze,ZodCompileUnsupportedError:()=>M,ZodCreditCard:()=>np,ZodCustom:()=>ai,ZodCustomStringFormat:()=>Jn,ZodDate:()=>Qr,ZodDefault:()=>zp,ZodDiscriminatedUnion:()=>hp,ZodE164:()=>Ya,ZodEmail:()=>Ta,ZodEmoji:()=>La,ZodEnum:()=>Fn,ZodError:()=>sz,ZodExactOptional:()=>rs,ZodFile:()=>Sp,ZodFirstPartyTypeKind:()=>Bp,ZodFunction:()=>qp,ZodGUID:()=>Ua,ZodIPv4:()=>Ja,ZodIPv6:()=>Ka,ZodISODate:()=>bt,ZodISODateTime:()=>$t,ZodISODuration:()=>wt,ZodISOTime:()=>_t,ZodIntersection:()=>gp,ZodIssueCode:()=>lz,ZodJWT:()=>Xa,ZodKSUID:()=>qa,ZodLazy:()=>Vp,ZodLiteral:()=>kp,ZodMAC:()=>tp,ZodMap:()=>_p,ZodNaN:()=>Tp,ZodNanoID:()=>Za,ZodNever:()=>dp,ZodNonOptional:()=>is,ZodNull:()=>sp,ZodNullable:()=>Op,ZodNumber:()=>Kn,ZodNumberFormat:()=>en,ZodObject:()=>ti,ZodOptional:()=>ri,ZodPipe:()=>ii,ZodPrefault:()=>Np,ZodPreprocess:()=>Up,ZodPromise:()=>Fp,ZodReadonly:()=>Lp,ZodRealError:()=>ke,ZodRecord:()=>Rn,ZodSet:()=>wp,ZodString:()=>qn,ZodStringFormat:()=>B,ZodSuccess:()=>Ep,ZodSymbol:()=>op,ZodTemplateLiteral:()=>Mp,ZodTransform:()=>xp,ZodTuple:()=>yp,ZodType:()=>U,ZodULID:()=>Ra,ZodURL:()=>Xr,ZodUUID:()=>Be,ZodUndefined:()=>ap,ZodUnion:()=>ni,ZodUnknown:()=>lp,ZodVoid:()=>fp,ZodXID:()=>Fa,ZodXor:()=>mp,_ZodString:()=>Ca,_default:()=>Pp,_function:()=>U$,any:()=>m$,array:()=>ei,base64:()=>Hy,base64url:()=>Yy,bigint:()=>u$,boolean:()=>ip,catch:()=>Cp,check:()=>L$,cidrv4:()=>Wy,cidrv6:()=>Gy,clone:()=>F,codec:()=>E$,coerce:()=>Wp,compile:()=>gd,config:()=>Q,core:()=>nt,creditCard:()=>Qy,cuid:()=>My,cuid2:()=>Vy,custom:()=>Z$,date:()=>g$,decode:()=>Wf,decodeAsync:()=>Hf,deepPartial:()=>Y$,describe:()=>M$,discriminatedUnion:()=>w$,e164:()=>Xy,email:()=>Ny,emoji:()=>Ly,encode:()=>Bf,encodeAsync:()=>Gf,endsWith:()=>En,enum:()=>ts,exactOptional:()=>Ip,file:()=>P$,flattenError:()=>Pr,float32:()=>o$,float64:()=>a$,formatError:()=>Nr,fromJSONSchema:()=>G$,function:()=>U$,getDiscriminatedOption:()=>Ul,getErrorMap:()=>fz,globalRegistry:()=>ce,gt:()=>Je,gte:()=>je,guid:()=>Ay,hash:()=>i$,hex:()=>r$,hostname:()=>n$,httpUrl:()=>Uy,includes:()=>An,input:()=>Q$,instanceof:()=>R$,int:()=>Ea,int32:()=>s$,int64:()=>l$,intersection:()=>vp,invertCodec:()=>D$,ipv4:()=>Jy,ipv6:()=>By,iso:()=>si,json:()=>q$,jwt:()=>e$,keyof:()=>v$,ksuid:()=>qy,lazy:()=>Rp,length:()=>Ht,literal:()=>z$,locales:()=>Rr,looseObject:()=>b$,looseRecord:()=>S$,lowercase:()=>Pn,lt:()=>qe,lte:()=>Ae,mac:()=>Ky,map:()=>x$,maxLength:()=>Gt,maxSize:()=>ht,memoizer:()=>Mr,meta:()=>V$,mime:()=>Dn,minLength:()=>tt,minSize:()=>Ke,multipleOf:()=>mt,nan:()=>j$,nanoid:()=>Zy,nativeEnum:()=>O$,negative:()=>_a,never:()=>es,nonnegative:()=>ka,nonoptional:()=>jp,nonpositive:()=>wa,normalize:()=>Cn,null:()=>cp,nullable:()=>Yr,nullish:()=>N$,number:()=>rp,object:()=>y$,optional:()=>Xt,output:()=>eb,overwrite:()=>Me,parse:()=>Ff,parseAsync:()=>qf,partialRecord:()=>k$,pipe:()=>Da,positive:()=>ba,prefault:()=>Ap,preprocess:()=>J$,prettifyError:()=>Wc,promise:()=>T$,properties:()=>xa,property:()=>Sa,readonly:()=>Zp,record:()=>bp,refine:()=>Jp,regex:()=>zn,regexes:()=>pe,registry:()=>Yo,safeDecode:()=>Xf,safeDecodeAsync:()=>ep,safeEncode:()=>Yf,safeEncodeAsync:()=>Qf,safeParse:()=>Jf,safeParseAsync:()=>Kf,set:()=>I$,setErrorMap:()=>dz,size:()=>Wt,slugify:()=>Zn,startsWith:()=>jn,strictObject:()=>$$,string:()=>Hr,stringFormat:()=>t$,stringbool:()=>F$,success:()=>A$,superRefine:()=>Kp,symbol:()=>f$,templateLiteral:()=>C$,toJSONSchema:()=>Pa,toLowerCase:()=>Un,toUpperCase:()=>Ln,toZod:()=>br,transform:()=>ns,treeifyError:()=>Bc,trim:()=>Tn,tuple:()=>$p,uint32:()=>c$,uint64:()=>d$,ulid:()=>Ry,undefined:()=>p$,union:()=>Gn,unknown:()=>Yt,uppercase:()=>Nn,url:()=>Ty,util:()=>k,uuid:()=>jy,uuidv4:()=>Ey,uuidv6:()=>Dy,uuidv7:()=>Cy,validate:()=>Yc,validateAsync:()=>Xc,void:()=>h$,xid:()=>Fy,xor:()=>_$});var nt={};Xe(nt,{$ZodAny:()=>Pl,$ZodArray:()=>Dl,$ZodAsyncError:()=>_e,$ZodBase64:()=>yl,$ZodBase64URL:()=>$l,$ZodBigInt:()=>Zo,$ZodBigIntFormat:()=>xl,$ZodBoolean:()=>Tr,$ZodCIDRv4:()=>gl,$ZodCIDRv6:()=>vl,$ZodCUID:()=>il,$ZodCUID2:()=>ol,$ZodCatch:()=>Ql,$ZodCheck:()=>W,$ZodCheckBigIntFormat:()=>Eu,$ZodCheckEndsWith:()=>Ju,$ZodCheckGreaterThan:()=>ko,$ZodCheckIncludes:()=>Fu,$ZodCheckLengthEquals:()=>Zu,$ZodCheckLessThan:()=>wo,$ZodCheckLowerCase:()=>Vu,$ZodCheckMaxLength:()=>Uu,$ZodCheckMaxSize:()=>Du,$ZodCheckMimeType:()=>Ku,$ZodCheckMinLength:()=>Lu,$ZodCheckMinSize:()=>Cu,$ZodCheckMultipleOf:()=>Au,$ZodCheckNumberFormat:()=>ju,$ZodCheckOverwrite:()=>Bu,$ZodCheckProperty:()=>So,$ZodCheckRegex:()=>Mu,$ZodCheckSizeEquals:()=>Tu,$ZodCheckStartsWith:()=>qu,$ZodCheckStringFormat:()=>xn,$ZodCheckUpperCase:()=>Ru,$ZodCodec:()=>Lr,$ZodCreditCard:()=>_l,$ZodCustom:()=>ad,$ZodCustomStringFormat:()=>kl,$ZodCyclicError:()=>Jo,$ZodDate:()=>El,$ZodDefault:()=>Gl,$ZodDiscriminatedUnion:()=>Ll,$ZodE164:()=>bl,$ZodEmail:()=>Xu,$ZodEmoji:()=>nl,$ZodEncodeError:()=>ft,$ZodEnum:()=>Fl,$ZodError:()=>zr,$ZodExactOptional:()=>Bl,$ZodFile:()=>Jl,$ZodFunction:()=>id,$ZodGUID:()=>Hu,$ZodIPv4:()=>pl,$ZodIPv6:()=>ml,$ZodISODate:()=>ll,$ZodISODateTime:()=>ul,$ZodISODuration:()=>fl,$ZodISOTime:()=>dl,$ZodIntersection:()=>Zl,$ZodJWT:()=>wl,$ZodKSUID:()=>cl,$ZodLazy:()=>Zr,$ZodLiteral:()=>ql,$ZodMAC:()=>hl,$ZodMap:()=>Vl,$ZodNaN:()=>ed,$ZodNanoID:()=>rl,$ZodNever:()=>Al,$ZodNonOptional:()=>Yl,$ZodNull:()=>zl,$ZodNullable:()=>Wl,$ZodNumber:()=>Lo,$ZodNumberFormat:()=>Sl,$ZodObject:()=>ev,$ZodObjectJIT:()=>Cl,$ZodOptional:()=>Vo,$ZodPipe:()=>Ro,$ZodPrefault:()=>Hl,$ZodPreprocess:()=>td,$ZodPromise:()=>od,$ZodReadonly:()=>nd,$ZodRealError:()=>we,$ZodRecord:()=>Ml,$ZodRegistry:()=>Ho,$ZodSet:()=>Rl,$ZodString:()=>Ft,$ZodStringFormat:()=>K,$ZodSuccess:()=>Xl,$ZodSymbol:()=>Il,$ZodTemplateLiteral:()=>rd,$ZodTransform:()=>Kl,$ZodTuple:()=>Mo,$ZodType:()=>C,$ZodULID:()=>al,$ZodURL:()=>tl,$ZodUUID:()=>Yu,$ZodUndefined:()=>Ol,$ZodUnion:()=>Ur,$ZodUnknown:()=>Nl,$ZodVoid:()=>jl,$ZodXID:()=>sl,$ZodXor:()=>Tl,$brand:()=>Fc,$constructor:()=>v,$input:()=>fd,$output:()=>dd,Doc:()=>Rt,INVALID:()=>Ne,JSONSchema:()=>Oy,JSONSchemaGenerator:()=>Na,NEVER:()=>Rc,TimePrecision:()=>wd,URL_BAD_FORMAT:()=>Qu,URL_UNPARSEABLE:()=>el,ZodCompileAsyncError:()=>Ze,ZodCompileUnsupportedError:()=>M,_any:()=>Zd,_array:()=>Kd,_base64:()=>ga,_base64url:()=>va,_bigint:()=>jd,_boolean:()=>Nd,_catch:()=>YO,_check:()=>by,_cidrv4:()=>ma,_cidrv6:()=>ha,_coercedBigint:()=>Ed,_coercedBoolean:()=>Ad,_coercedDate:()=>qd,_coercedNumber:()=>Sd,_coercedString:()=>$d,_creditCard:()=>_d,_cuid:()=>sa,_cuid2:()=>ca,_custom:()=>Wd,_date:()=>Fd,_decode:()=>fo,_decodeAsync:()=>mo,_default:()=>WO,_discriminatedUnion:()=>TO,_e164:()=>ya,_email:()=>Qo,_emoji:()=>oa,_encode:()=>lo,_encodeAsync:()=>po,_endsWith:()=>En,_enum:()=>RO,_file:()=>Bd,_float32:()=>Id,_float64:()=>Od,_gt:()=>Je,_gte:()=>je,_guid:()=>ea,_includes:()=>An,_int:()=>xd,_int32:()=>zd,_int64:()=>Dd,_intersection:()=>UO,_ipv4:()=>fa,_ipv6:()=>pa,_isoDate:()=>Jr,_isoDateTime:()=>qr,_isoDuration:()=>Br,_isoTime:()=>Kr,_jwt:()=>$a,_ksuid:()=>da,_lazy:()=>tz,_length:()=>Ht,_literal:()=>qO,_lowercase:()=>Pn,_lt:()=>qe,_lte:()=>Ae,_mac:()=>bd,_map:()=>MO,_max:()=>Ae,_maxLength:()=>Gt,_maxSize:()=>ht,_mime:()=>Dn,_min:()=>je,_minLength:()=>tt,_minSize:()=>Ke,_multipleOf:()=>mt,_nan:()=>Jd,_nanoid:()=>aa,_nativeEnum:()=>FO,_negative:()=>_a,_never:()=>Vd,_nonnegative:()=>ka,_nonoptional:()=>GO,_nonpositive:()=>wa,_normalize:()=>Cn,_null:()=>Ld,_nullable:()=>BO,_number:()=>kd,_optional:()=>KO,_overwrite:()=>Me,_parse:()=>_n,_parseAsync:()=>wn,_pipe:()=>XO,_positive:()=>ba,_promise:()=>nz,_properties:()=>xa,_property:()=>Sa,_readonly:()=>QO,_record:()=>ZO,_refine:()=>Gd,_regex:()=>zn,_safeDecode:()=>go,_safeDecodeAsync:()=>yo,_safeEncode:()=>ho,_safeEncodeAsync:()=>vo,_safeParse:()=>kn,_safeParseAsync:()=>Sn,_set:()=>VO,_size:()=>Wt,_slugify:()=>Zn,_startsWith:()=>jn,_string:()=>yd,_stringFormat:()=>Mn,_stringbool:()=>Qd,_success:()=>HO,_superRefine:()=>Hd,_symbol:()=>Td,_templateLiteral:()=>ez,_toLowerCase:()=>Un,_toUpperCase:()=>Ln,_transform:()=>JO,_trim:()=>Tn,_tuple:()=>LO,_uint32:()=>Pd,_uint64:()=>Cd,_ulid:()=>ua,_undefined:()=>Ud,_union:()=>DO,_unknown:()=>Md,_uppercase:()=>Nn,_url:()=>Fr,_uuid:()=>ta,_uuidv4:()=>na,_uuidv6:()=>ra,_uuidv7:()=>ia,_void:()=>Rd,_xid:()=>la,_xor:()=>CO,clone:()=>F,compile:()=>gd,compileFn:()=>Xo,config:()=>Q,createStandardJSONSchemaMethod:()=>Vn,createToJSONSchemaMethod:()=>tf,decode:()=>VS,decodeAsync:()=>FS,describe:()=>Yd,encode:()=>MS,encodeAsync:()=>RS,extractDefs:()=>vt,finalize:()=>yt,flattenError:()=>Pr,formatError:()=>Nr,getDiscriminatedOption:()=>Ul,globalConfig:()=>ae,globalRegistry:()=>ce,handleUnrepresentable:()=>ie,initializeContext:()=>gt,isBackEdge:()=>Ko,isRecursiveSchema:()=>ld,isValidBase64:()=>Cr,isValidBase64URL:()=>Co,isValidCIDRv6:()=>Do,isValidCreditCard:()=>To,isValidIPv6:()=>Dr,isValidJWT:()=>Uo,locales:()=>Rr,memoizer:()=>Mr,mergeValues:()=>In,meta:()=>Xd,parse:()=>co,parseAsync:()=>uo,parseURLObject:()=>No,prettifyError:()=>Wc,process:()=>q,regexes:()=>pe,registry:()=>Yo,safeDecode:()=>JS,safeDecodeAsync:()=>BS,safeEncode:()=>qS,safeEncodeAsync:()=>KS,safeParse:()=>Gc,safeParseAsync:()=>Hc,standardProps:()=>Po,stripTabAndNewline:()=>Ao,toDotPath:()=>Ag,toJSONSchema:()=>Pa,toZod:()=>br,treeifyError:()=>Bc,urlHostnameOk:()=>jo,urlProtocolOk:()=>Eo,util:()=>k,validate:()=>Yc,validateAsync:()=>Xc,version:()=>Wu});var k={};Xe(k,{BIGINT_FORMAT_RANGES:()=>Tc,CONSTANT_CATCH:()=>ao,Class:()=>Pc,NUMBER_FORMAT_RANGES:()=>Cc,aborted:()=>dt,allowsEval:()=>jc,assert:()=>oS,assertEqual:()=>tS,assertIs:()=>rS,assertNever:()=>iS,assertNotEqual:()=>nS,assignProp:()=>X,attachSchema:()=>oo,base64ToUint8Array:()=>xg,base64urlToUint8Array:()=>kS,cached:()=>$n,captureStackTrace:()=>io,cleanEnum:()=>wS,cleanRegex:()=>wr,clone:()=>F,cloneDef:()=>sS,codePointLength:()=>Mt,constantCatch:()=>Mc,createTransparentProxy:()=>pS,defineLazy:()=>Nc,defineLazyInternal:()=>Z,esc:()=>ye,escapeRegex:()=>De,explicitlyAborted:()=>Uc,extend:()=>gS,finalizeIssue:()=>be,floatSafeRemainder:()=>kr,getElementAtPath:()=>cS,getEnumValues:()=>_r,getLengthableOrigin:()=>Or,getParsedType:()=>fS,getSizableOrigin:()=>Ir,hexToUint8Array:()=>xS,hide:()=>Zc,installLazyProp:()=>NS,isObject:()=>Zt,isPlainObject:()=>Ee,issue:()=>bn,joinValues:()=>y,jsonStringifyReplacer:()=>yn,members:()=>Lc,merge:()=>yS,mergeDefs:()=>Le,normalizeParams:()=>I,nullish:()=>ro,numKeys:()=>dS,objectClone:()=>aS,omit:()=>hS,optionalKeys:()=>Dc,own:()=>vn,parsedType:()=>_,partial:()=>$S,pick:()=>mS,prefixIssues:()=>$e,primitiveTypes:()=>Ec,promiseAllObject:()=>uS,propertyKeyTypes:()=>xr,randomString:()=>lS,required:()=>bS,safeExtend:()=>vS,shallowClone:()=>Sr,slugify:()=>Ac,stringifyPrimitive:()=>$,toZod:()=>br,uint8ArrayToBase64:()=>Ig,uint8ArrayToBase64url:()=>SS,uint8ArrayToHex:()=>IS,unwrapMessage:()=>gn});function tS(t){return t}function nS(t){return t}function br(){return t=>t}function rS(t){}function iS(t){throw new Error("Unexpected value in exhaustive check")}function oS(t){}function _r(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 y(t,e="|"){return t.map(r=>$(r)).join(e)}function yn(t,e){return typeof e=="bigint"?e.toString():e}function $n(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function ro(t){return t==null}function wr(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function kr(t,e){let r=t/e,i=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var Sg=Symbol("evaluating");function Nc(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==Sg)return i===void 0&&(i=Sg,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function aS(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function X(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Le(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function sS(t){return Le(t._zod.def)}function cS(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function uS(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 lS(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function ye(t){return JSON.stringify(t)}function Ac(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var io="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Zt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var jc=$n(()=>{if(ae.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Ee(t){if(Zt(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Zt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sr(t){return Ee(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function dS(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var fS=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}`)}},xr=new Set(["string","number","symbol"]),Ec=new Set(["string","number","bigint","boolean","symbol","undefined"]);function De(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function I(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 pS(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 $(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Dc(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}var Cc={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]},Tc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function mS(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=Le(t._zod.def,{get shape(){let a={};for(let s of Reflect.ownKeys(e)){if(!Object.prototype.hasOwnProperty.call(r.shape,s))throw new Error(`Unrecognized key: "${String(s)}"`);e[s]&&X(a,s,r.shape[s])}return X(this,"shape",a),a},checks:[]});return F(t,o)}function hS(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=Le(t._zod.def,{get shape(){let a={...t._zod.def.shape};for(let s of Reflect.ownKeys(e)){if(!Object.prototype.hasOwnProperty.call(r.shape,s))throw new Error(`Unrecognized key: "${String(s)}"`);e[s]&&delete a[s]}return X(this,"shape",a),a},checks:[]});return F(t,o)}function gS(t,e){if(!Ee(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 a of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Le(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return X(this,"shape",o),o}});return F(t,n)}function vS(t,e){if(!Ee(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Le(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return X(this,"shape",i),i}});return F(t,r)}function yS(t,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Le(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return X(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return F(t,r)}function $S(t,e,r,i="partial"){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=Le(e._zod.def,{get shape(){let c=e._zod.def.shape,u={...c};if(r)for(let l of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(c,l))throw new Error(`Unrecognized key: "${String(l)}"`);r[l]&&(u[l]=t?new t({type:"optional",innerType:c[l]}):c[l])}else for(let l of Reflect.ownKeys(c))u[l]=t?new t({type:"optional",innerType:c[l]}):c[l];return X(this,"shape",u),u},checks:[]});return F(e,s)}function bS(t,e,r){let i=Le(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let a of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(o,a))throw new Error(`Unrecognized key: "${String(a)}"`);r[a]&&(o[a]=new t({type:"nonoptional",innerType:n[a]}))}else for(let a of Reflect.ownKeys(n))o[a]=new t({type:"nonoptional",innerType:n[a]});return X(this,"shape",o),o}});return F(e,i)}function dt(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 Uc(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 $e(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function gn(t){return typeof t=="string"?t:t?.message}function oo(t,e,r){var i;for(let n=e;n<t.length;n++)(i=t[n]).schema??(i.schema=r)}function be(t,e,r){var i;let n=t.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(i=t).schema??(i.schema=t.inst):t.schema=t.inst);let o=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,a=t.message?t.message:gn(t.inst?._zod.def?.error?.(t))??gn(o?.(t))??gn(e?.error?.(t))??gn(r.customError?.(t))??gn(r.localeError?.(t))??"Invalid input",{inst:s,schema:c,continue:u,input:l,...d}=t;return d.path??(d.path=[]),d.message=a,e?.reportInput&&(d.input=l),d}function Ir(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}var _S=/[\uD800-\uDBFF]/;function Mt(t){let e=t.length;if(!_S.test(t))return e;let r=e;for(let i=0;i<e-1;i++)(t.charCodeAt(i)&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320&&(r--,i++);return r}function Or(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function _(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 bn(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function wS(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function xg(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 Ig(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function kS(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return xg(e+r)}function SS(t){return Ig(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xS(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 IS(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Pc=class{constructor(...e){}};function Lc(t,e){for(let r in e){let i=Object.getOwnPropertyDescriptor(e,r);i.get?Object.defineProperty(t,r,{...i,enumerable:!1}):OS(t,r,i.value)}}function vn(t,e,r,i=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:i,value:r}),r}function Zc(t,e,r){return vn(t,e,r,!1)}function OS(t,e,r){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?r:vn(this,e,r.bind(this))},set(i){vn(this,e,i)}})}function zS(t,e){let r=Object.getPrototypeOf(t);return e in r?void 0:r}var zc,lt=!1,PS={configurable:!0,get(){lt=!0}};function Z(t,e,r){let i=Object.getPrototypeOf(t._zod);if(e in i&&zc!==t._zod){zc=void 0;return}zc=t._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,PS);let n=lt;lt=!1;try{let o=r(this);return lt?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o}),lt=lt||n,o}catch(o){throw delete this[e],lt=lt||n,o}},set(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})}function NS(t,e,r,i){let n=zS(t,e);n&&Object.defineProperty(n,e,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,e,o),o.value=r(this),Object.defineProperty(this,e,o),o.value},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var ao="~constantCatch";function Mc(t){let e=()=>t;return e[ao]=!0,e}var Og,Rc=Object.freeze({status:"aborted"}),Vc={value:void 0,enumerable:!1},zg="captureStackTrace"in Error?Error:null;function AS(t){let e=zg;if(e){let r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return zg=null,new t}try{return new t}finally{e.stackTraceLimit=r}}}return new t}function v(t,e,r,i){let n={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=n;let a=r,s=a&&new WeakSet;function c(f,p){if(!f._zod){Vc.value=new o(p);try{Object.defineProperty(f,"_zod",Vc)}finally{Vc.value=void 0}}if(f._zod.traits.has(t))return;if(f._zod.traits.add(t),e(f,p),s){let h=Object.getPrototypeOf(f),g=f._zod.constr.prototype,S=h;for(;S&&S!==g;)S=Object.getPrototypeOf(S);let b=S??h;s.has(b)||(s.add(b),Lc(b,a))}let m=d.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in f||(f[h]=m[h].bind(f)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:t});function d(f){let p=i?.Parent?AS(l):this;c(p,f);let m=p._zod.deferred;if(m){for(let g of m)g();p._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(t)}),Object.defineProperty(d,"name",{value:t}),d}var Fc=Symbol("zod_brand"),_e=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ft=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Og=globalThis).__zod_globalConfig??(Og.__zod_globalConfig={});var ae=globalThis.__zod_globalConfig;function Q(t){return t&&Object.assign(ae,t),ae}function jS(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,yn,2)),t.message}function ES(t){this._zod.message=t}var DS={get:jS,set:ES,enumerable:!0,configurable:!0},Jc={value:void 0,enumerable:!1},Kc={value:void 0,enumerable:!1},Pg=new WeakSet([Object.prototype,Error.prototype]),Ng=(t,e)=>{t.name="$ZodError",Jc.value=t._zod,Object.defineProperty(t,"_zod",Jc),Kc.value=e,Object.defineProperty(t,"issues",Kc),Jc.value=void 0,Kc.value=void 0,Object.defineProperty(t,"message",DS);let r=Object.getPrototypeOf(t);Pg.has(r)||(Pg.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},zr=v("$ZodError",Ng),we=v("$ZodError",Ng,void 0,{Parent:Error});function CS(t,e,r){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):t[e]=r()),t[e]}function Pr(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?CS(r,n.path[0],()=>[]).push(e(n)):i.push(e(n));return{formErrors:i,fieldErrors:r}}function Nr(t,e=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)r._errors.push(e(a));else{let c=r,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(e(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(e(a)),c=f,u++}}}};return i(t),r}function Bc(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var a;for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...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 c=[...o,...s.path];if(c.length===0){r.errors.push(e(s));continue}let u=r,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(e(s)),l++}}};return i(t),r}function Ag(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 Wc(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 ${Ag(i.path)}`);return e.join(`
|
|
169
|
+
`)}function so(t,e){return{callee:e?.callee??t,Err:e?.Err}}var _n=t=>{let e=(r,i,n,o)=>{let a=n?{...n,async:!1}:{async:!1},s=r._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw new _e;if(s.issues.length){let c=new(o?.Err??t)(s.issues.map(u=>be(u,a,Q())));throw io(c,o?.callee??e),c}return s.value};return e},co=_n(we),wn=t=>{let e=async(r,i,n,o)=>{let a=n?{...n,async:!0}:{async:!0},s=r._zod.run({value:i,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(o?.Err??t)(s.issues.map(u=>be(u,a,Q())));throw io(c,o?.callee??e),c}return s.value};return e},uo=wn(we),kn=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 _e;return o.issues.length?{success:!1,error:new(t??zr)(o.issues.map(a=>be(a,n,Q())))}:{success:!0,data:o.value}},Gc=kn(we),Sn=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(a=>be(a,n,Q())))}:{success:!0,data:o.value}},Hc=Sn(we),US=Symbol.for("zod.compile.invalid"),LS=Symbol.for("zod.compile.fallback"),Yc=((t,e,r)=>{let i=t._zod.bag.validator;return i!==void 0&&i(e)!==US?!0:ZS(t,e,r)});function ZS(t,e,r){let i=r?{...r,async:!1}:{async:!1},n=t._zod.bag.fallbackRun,o;if(n?(i[LS]=!0,o=n({value:e,issues:[]},i)):o=t._zod.run({value:e,issues:[]},i),o instanceof Promise)throw new _e;return o.issues.length===0}var Xc=async(t,e,r)=>{let i=r?{...r,async:!0}:{async:!0},n=t._zod.run({value:e,issues:[]},i);return n instanceof Promise&&(n=await n),n.issues.length===0},lo=t=>{let e=_n(t),r=(i,n,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return e(i,n,s,so(r,a))};return r},MS=lo(we),fo=t=>{let e=_n(t),r=(i,n,o,a)=>e(i,n,o,so(r,a));return r},VS=fo(we),po=t=>{let e=wn(t),r=async(i,n,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return await e(i,n,s,so(r,a))};return r},RS=po(we),mo=t=>{let e=wn(t),r=async(i,n,o,a)=>await e(i,n,o,so(r,a));return r},FS=mo(we),ho=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return kn(t)(e,r,n)},qS=ho(we),go=t=>(e,r,i)=>kn(t)(e,r,i),JS=go(we),vo=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Sn(t)(e,r,n)},KS=vo(we),yo=t=>async(e,r,i)=>Sn(t)(e,r,i),BS=yo(we);var pe={};Xe(pe,{base64:()=>gu,base64url:()=>$o,bigint:()=>ku,boolean:()=>Su,browserEmail:()=>tx,cidrv4:()=>mu,cidrv6:()=>hu,creditCard:()=>bo,cuid:()=>eu,cuid2:()=>tu,date:()=>$u,datetime:()=>_u,domain:()=>ix,duration:()=>su,e164:()=>yu,email:()=>uu,emoji:()=>lu,extendedDuration:()=>WS,guid:()=>cu,hex:()=>ax,hostname:()=>rx,html5Email:()=>XS,httpProtocol:()=>vu,idnEmail:()=>ex,integer:()=>Ar,ipv4:()=>du,ipv6:()=>fu,ksuid:()=>iu,lowercase:()=>Ou,mac:()=>pu,md5_base64:()=>cx,md5_base64url:()=>ux,md5_hex:()=>sx,nanoid:()=>ou,nanoidOfLength:()=>au,null:()=>xu,number:()=>pt,rfc5322Email:()=>QS,sha1_base64:()=>dx,sha1_base64url:()=>fx,sha1_hex:()=>lx,sha256_base64:()=>mx,sha256_base64url:()=>hx,sha256_hex:()=>px,sha384_base64:()=>vx,sha384_base64url:()=>yx,sha384_hex:()=>gx,sha512_base64:()=>bx,sha512_base64url:()=>_x,sha512_hex:()=>$x,string:()=>wu,time:()=>bu,ulid:()=>nu,undefined:()=>Iu,unicodeEmail:()=>jg,uppercase:()=>zu,uuid:()=>Vt,uuid4:()=>GS,uuid6:()=>HS,uuid7:()=>YS,xid:()=>ru});var eu=/^[cC][0-9a-z]{6,}$/,tu=/^[0-9a-z]+$/,nu=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ru=/^[0-9a-vA-V]{20}$/,iu=/^[A-Za-z0-9]{27}$/,ou=/^[a-zA-Z0-9_-]{21}$/;function au(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}var su=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WS=/^[-+]?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)?)??$/,cu=/^([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})$/,Vt=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)$/,GS=Vt(4),HS=Vt(6),YS=Vt(7),uu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,XS=/^[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])?)*$/,QS=/^(([^<>()\[\]\\.,;:\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,}))$/,jg=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ex=jg,tx=/^[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])?)*$/,nx="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function lu(){return new RegExp(nx,"u")}var du=/^(?:(?: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])$/,fu=/^(([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}|:))$/,pu=t=>{let e=De(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},mu=/^((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])$/,hu=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$o=/^[A-Za-z0-9_-]*$/,rx=/^(?=.{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])?)*\.?$/,ix=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,vu=/^https?$/,yu=/^\+[1-9]\d{6,14}$/,bo=/^\d(?:[ -]?\d){11,18}$/,Eg="(?:(?:\\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])))";function ox(t){return new RegExp(`^${t}$`)}var $u=ox(Eg);function Qc(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}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bu(t){return new RegExp(`^${Qc(t)}$`)}function _u(t){let e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Qc({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,i=t.local?`${r}|${Qc({precision:t.precision})}`:r;return new RegExp(`^${Eg}T(?:${i})$`)}var wu=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},ku=/^-?\d+n?$/,Ar=/^-?\d+$/,pt=/^-?\d+(?:\.\d+)?$/,Su=/^(?:true|false)$/i,xu=/^null$/i;var Iu=/^undefined$/i;var Ou=/^[^A-Z]*$/,zu=/^[^a-z]*$/,ax=/^[0-9a-fA-F]*$/;function jr(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Er(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var sx=/^[0-9a-fA-F]{32}$/,cx=jr(22,"=="),ux=Er(22),lx=/^[0-9a-fA-F]{40}$/,dx=jr(27,"="),fx=Er(27),px=/^[0-9a-fA-F]{64}$/,mx=jr(43,"="),hx=Er(43),gx=/^[0-9a-fA-F]{96}$/,vx=jr(64,""),yx=Er(64),$x=/^[0-9a-fA-F]{128}$/,bx=jr(86,"=="),_x=Er(86);var W=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Pu=t=>{let e=t.value;return!ro(e)&&e.size!==void 0},Nu=t=>{let e=t.value;return!ro(e)&&e.length!==void 0},_o={number:"number",bigint:"bigint",object:"date"},wo=v("$ZodCheckLessThan",(t,e)=>{W.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:_o[typeof i.value]??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})}}),ko=v("$ZodCheckGreaterThan",(t,e)=>{W.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:_o[typeof i.value]??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})}}),Au=v("$ZodCheckMultipleOf",(t,e)=>{W.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"?e.value!==BigInt(0)&&r.value%e.value===BigInt(0):kr(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})}}),ju=v("$ZodCheckNumberFormat",(t,e)=>{W.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=Cc[e.format];t._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=n,s.maximum=o,r&&(s.pattern=Ar)}),t._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):a.issues.push({input:s,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}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),Eu=v("$ZodCheckBigIntFormat",(t,e)=>{W.init(t,e);let[r,i]=Tc[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})}}),Du=v("$ZodCheckMaxSize",(t,e)=>{var r;W.init(t,e),(r=t._zod.def).when??(r.when=Pu),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:Ir(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Cu=v("$ZodCheckMinSize",(t,e)=>{var r;W.init(t,e),(r=t._zod.def).when??(r.when=Pu),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:Ir(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Tu=v("$ZodCheckSizeEquals",(t,e)=>{var r;W.init(t,e),(r=t._zod.def).when??(r.when=Pu),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 a=o>e.size;i.issues.push({origin:Ir(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Uu=v("$ZodCheckMaxLength",(t,e)=>{var r;W.init(t,e),(r=t._zod.def).when??(r.when=Nu),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,o=n.length;if((typeof n=="string"&&o>e.maximum?Mt(n):o)<=e.maximum)return;let s=Or(n);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Lu=v("$ZodCheckMinLength",(t,e)=>{var r;W.init(t,e),(r=t._zod.def).when??(r.when=Nu),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,o=n.length;if((typeof n=="string"&&o>=e.minimum&&o<e.minimum*2?Mt(n):o)>=e.minimum)return;let s=Or(n);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Zu=v("$ZodCheckLengthEquals",(t,e)=>{var r;W.init(t,e),(r=t._zod.def).when??(r.when=Nu),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,a=typeof n=="string"&&o>=e.length&&o<=e.length*2?Mt(n):o;if(a===e.length)return;let s=Or(n),c=a>e.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),xn=v("$ZodCheckStringFormat",(t,e)=>{var r,i;W.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=()=>{})}),Mu=v("$ZodCheckRegex",(t,e)=>{xn.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})}}),Vu=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Ou),xn.init(t,e)}),Ru=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=zu),xn.init(t,e)}),Fu=v("$ZodCheckIncludes",(t,e)=>{W.init(t,e);let r=De(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})}}),qu=v("$ZodCheckStartsWith",(t,e)=>{W.init(t,e);let r=new RegExp(`^${De(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})}}),Ju=v("$ZodCheckEndsWith",(t,e)=>{W.init(t,e);let r=new RegExp(`.*${De(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 Dg(t,e,r){t.issues.length&&e.issues.push(...$e(r,t.issues))}var So=v("$ZodCheckProperty",(t,e)=>{W.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=>Dg(n,r,e.property));Dg(i,r,e.property)}}),Ku=v("$ZodCheckMimeType",(t,e)=>{W.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})}}),Bu=v("$ZodCheckOverwrite",(t,e)=>{W.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var Rt=class{constructor(e=[],r={}){this.content=[],this.indent=0,this.args=e,this.closed=r}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(`
|
|
170
|
+
`).filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,r=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
171
|
+
${r.join(`
|
|
172
|
+
`)}
|
|
173
|
+
};`)(...Object.values(this.closed))}};var Wu={major:4,minor:5,patch:4};var C=v("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Wu;let i=t._zod.def.checks,n=t._zod.traits.has("$ZodCheck")?[t,...i??[]]:i?.length?[...i]:[];for(let o of n)for(let a of o._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(s,c,u)=>{if(s.memo)return s;let l=dt(s),d;for(let f of c){if(f._zod.def.when){if(Uc(s)||!f._zod.def.when(s))continue}else if(l)continue;let p=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&u?.async===!1)throw new _e;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==p&&(oo(s.issues,p,t),l||(l=dt(s,p)))});else{if(s.issues.length===p)continue;oo(s.issues,p,t),l||(l=dt(s,p))}}return d?d.then(()=>s):s},a=(s,c,u)=>{if(dt(s))return s.aborted=!0,s;let l=o(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new _e;return l.then(d=>t._zod.parse(d,u))}return t._zod.parse(l,u)};t._zod.run=(s,c)=>{if(c.skipChecks)return t._zod.parse(s,c);if(c.direction==="backward"){let l=t._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(d=>a(d,s,c)):a(l,s,c)}let u=t._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new _e;return u.then(l=>o(l,n,c))}return o(u,n,c)}}},{get"~standard"(){return Zc(this,"~standard",Po(this))},set"~standard"(t){vn(this,"~standard",t)}}),Tg=t=>t.success?{value:t.data}:{issues:t.error?.issues};function Po(t){return{validate:e=>{try{return Tg(Gc(t,e))}catch{return Hc(t,e).then(Tg)}},vendor:"zod",version:1}}var Ft=v("$ZodString",(t,e)=>{C.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??wu(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}}),K=v("$ZodStringFormat",(t,e)=>{xn.init(t,e),Ft.init(t,e)}),Hu=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=cu),K.init(t,e)}),Yu=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=Vt(i))}else e.pattern??(e.pattern=Vt());K.init(t,e)}),Xu=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=uu),K.init(t,e)}),Qu=1,el=2;function No(t,e){if(!e.normalize&&e.protocol?.source===vu.source&&!/^https?:\/\//i.test(t))return Qu;try{return new URL(t)}catch{return el}}var wx=/[\t\n\r]/g;function Ao(t){return t.replace(wx,"")}function jo(t,e){return e.lastIndex=0,e.test(t.hostname)}function Eo(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}var tl=v("$ZodURL",(t,e)=>{K.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=No(i,e);if(n===Qu){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}if(n===el){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});return}e.hostname&&!jo(n,e.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&&!Eo(n,e.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort}),r.value=e.normalize?n.href:Ao(i);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),nl=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=lu()),K.init(t,e)}),rl=v("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?ou:au(e.length)),K.init(t,e)}),il=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=eu),K.init(t,e)}),ol=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=tu),K.init(t,e)}),al=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=nu),K.init(t,e)}),sl=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=ru),K.init(t,e)}),cl=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=iu),K.init(t,e)}),ul=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=_u(e)),K.init(t,e),(e.local||e.precision===-1)&&(t._zod.bag.laxFormat=!0,t._zod.onattach.push(r=>{r._zod.bag.laxFormat=!0}))}),ll=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=$u),K.init(t,e)}),dl=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=bu(e)),K.init(t,e)}),fl=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=su),K.init(t,e)}),pl=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=du),K.init(t,e),t._zod.bag.format="ipv4"}),kx=/^[0-9a-fA-F:.]+$/;function Dr(t){if(!kx.test(t))return!1;try{return new URL(`http://[${t}]`),!0}catch{return!1}}var ml=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=fu),K.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{Dr(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}),hl=v("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=pu(e.delimiter)),K.init(t,e),t._zod.bag.format="mac"}),gl=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=mu),K.init(t,e)});function Do(t){let e=t.split("/");if(e.length!==2)return!1;let[r,i]=e;if(!i)return!1;let n=Number(i);return`${n}`!==i||n<0||n>128?!1:Dr(r)}var vl=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=hu),K.init(t,e),t._zod.check=r=>{Do(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}});function Cr(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var yl=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=gu),K.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Cr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Co(t){if(!$o.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Cr(r)}var $l=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=$o),K.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{Co(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),bl=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=yu),K.init(t,e)}),Sx=/[- ]/g;function xx(t){let e=t.length,r=1,i=0;for(;e;){let n=+t[--e];r^=1,i+=r?[0,2,4,6,8,1,3,5,7,9][n]:n}return i%10===0}function To(t){return bo.test(t)?xx(t.replace(Sx,"")):!1}var _l=v("$ZodCreditCard",(t,e)=>{e.pattern??(e.pattern=bo),K.init(t,e),t._zod.check=r=>{To(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:t,continue:!e.abort})}});function Uo(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 wl=v("$ZodJWT",(t,e)=>{K.init(t,e),t._zod.check=r=>{Uo(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),kl=v("$ZodCustomStringFormat",(t,e)=>{K.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})}}),Lo=v("$ZodNumber",(t,e)=>{C.init(t,e),t._zod.pattern=t._zod.bag.pattern??pt,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:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...o?{received:o}:{}}),r}}),Sl=v("$ZodNumberFormat",(t,e)=>{ju.init(t,e),Lo.init(t,e)}),Tr=v("$ZodBoolean",(t,e)=>{C.init(t,e),t._zod.pattern=Su,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}}),Zo=v("$ZodBigInt",(t,e)=>{C.init(t,e),t._zod.pattern=ku,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}}),xl=v("$ZodBigIntFormat",(t,e)=>{Eu.init(t,e),Zo.init(t,e)}),Il=v("$ZodSymbol",(t,e)=>{C.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}}),Ol=v("$ZodUndefined",(t,e)=>{C.init(t,e),t._zod.pattern=Iu,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}}),zl=v("$ZodNull",(t,e)=>{C.init(t,e),t._zod.pattern=xu,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}}),Pl=v("$ZodAny",(t,e)=>{C.init(t,e),t._zod.parse=r=>r}),Nl=v("$ZodUnknown",(t,e)=>{C.init(t,e),t._zod.parse=r=>r}),Al=v("$ZodNever",(t,e)=>{C.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),jl=v("$ZodVoid",(t,e)=>{C.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}}),El=v("$ZodDate",(t,e)=>{C.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 Ug(t,e,r){t.issues.length&&e.issues.push(...$e(r,t.issues)),e.value[r]=t.value}var Dl=v("$ZodArray",(t,e)=>{C.init(t,e);let r=ae.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),i;i.value=r?r.alloc(t,i,Array(o.length),n):Array(o.length);let a=[];for(let s=0;s<o.length;s++){let c=o[s],u=e.element._zod.run({value:c,issues:[]},n);u instanceof Promise?a.push(u.then(l=>Ug(l,i,s))):Ug(u,i,s)}return a.length?Promise.all(a).then(()=>i):i}});function zo(t,e,r,i,n,o){let a=r in i,s=o==="optional";if(!(!a&&s&&n==="optional")){if(t.issues.length){if(n!==void 0&&s&&!a)return;e.issues.push(...$e(r,t.issues))}if(!a&&n===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?a&&(e.value[r]=void 0):e.value[r]=t.value}}var Ix=[];function Xg(t){let e=Object.keys(t.shape),r=Object.getOwnPropertySymbols(t.shape),i=r.length?r:Ix,n=i.length?[...e,...i]:e;for(let a of n)if(!t.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let o=Dc(t.shape);return{...t,allKeys:n,symbolKeys:i,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(o)}}function Qg(t,e,r,i,n,o){let a=[],s=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin,d=c.optout;for(let f in e){if(s.has(f))continue;if(f==="__proto__"){u==="never"&&a.push(f);continue}if(u==="never"){a.push(f);continue}let p=c.run({value:e[f],issues:[]},i);p instanceof Promise?t.push(p.then(m=>zo(m,r,f,e,l,d))):zo(p,r,f,e,l,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o,continue:!0}),t.length?Promise.all(t).then(()=>r):r}var Gu=new WeakMap,ev=v("$ZodObject",(t,e)=>{if(C.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let c=e.shape;Gu.set(e,c),Object.defineProperty(e,"shape",{get:()=>{let u={...c};return Object.defineProperty(e,"shape",{value:u}),Gu.set(e,u),u}})}let i=$n(()=>Xg(e));Z(t,"propValues",c=>{let u=c.def.shape,l={};for(let d in u){let f=u[d]._zod;if(f.values){Object.prototype.hasOwnProperty.call(l,d)||X(l,d,new Set);for(let p of f.values)l[d].add(p);f.optin!==void 0&&l[d].add(void 0)}}return l});let n=Zt,o=e.catchall,a,s=ae.memoizer;s?.attach(t),t._zod.parse=(c,u)=>{a??(a=i.value);let l=c.value;if(!n(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),c;c.value=s?s.alloc(t,c,{},u):{};let d=[],f=a.shape;for(let p of a.allKeys){if(p==="__proto__")continue;let m=f[p],h=m._zod.optin,g=m._zod.optout,S=m._zod.run({value:l[p],issues:[]},u);S instanceof Promise?d.push(S.then(b=>zo(b,c,p,l,h,g))):zo(S,c,p,l,h,g)}return o?Qg(d,l,c,u,i.value,t):d.length?Promise.all(d).then(()=>c):c}}),Cl=v("$ZodObjectJIT",(t,e)=>{ev.init(t,e);let r=t._zod.parse,i=$n(()=>Xg(e)),n=ae.memoizer,o=p=>{let m=i.value,h=m.symbolKeys,g=new Rt(["payload","ctx"],{shape:p,inst:t,memo:n,syms:h}),S=P=>`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`,b=(P,O)=>`
|
|
174
|
+
for (let i = 0; i < ${P}.issues.length; i++) {
|
|
175
|
+
const iss = ${P}.issues[i];
|
|
176
|
+
iss.path = iss.path ? [${O}, ...iss.path] : [${O}];
|
|
177
|
+
payload.issues.push(iss);
|
|
178
|
+
}`;g.write("const input = payload.value;");let x=Object.create(null),z=0;for(let P of m.allKeys)x[P]=`key_${z++}`;g.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let P of m.allKeys){if(P==="__proto__")continue;let O=x[P],D=typeof P=="symbol"?`syms[${h.indexOf(P)}]`:ye(P),w=`${D} in input`,L=p[P],Y=L?._zod?.optin,re=Y!==void 0,G=L?._zod?.optout==="optional";if(g.write(`const ${O} = ${S(D)};`),re&&G){let Ye=Y==="optional"?`${O}_present`:`${O}.value !== undefined || ${O}_present`;g.write(`
|
|
179
|
+
const ${O}_present = ${w};
|
|
180
|
+
if (!${O}.issues.length || ${O}_present) {
|
|
181
|
+
if (${O}.issues.length) {${b(O,D)}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (${Ye}) {
|
|
185
|
+
newResult[${D}] = ${O}.value;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
2
188
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { createRequire } from "module";
|
|
6
|
-
import os4 from "os";
|
|
7
|
-
import path19 from "path";
|
|
8
|
-
|
|
9
|
-
// src/adapters/claude-code.ts
|
|
10
|
-
import { promises as fs4 } from "fs";
|
|
11
|
-
import path4 from "path";
|
|
12
|
-
import os from "os";
|
|
13
|
-
|
|
14
|
-
// src/installers/claude-plugin.ts
|
|
15
|
-
import { promises as fs } from "fs";
|
|
16
|
-
import path from "path";
|
|
17
|
-
|
|
18
|
-
// src/source.ts
|
|
19
|
-
var GITHUB_RE = /^([\w.-]+)\/([\w.-]+)(?:@([^#]+))?(?:#(.+))?$/;
|
|
20
|
-
function parseSource(raw) {
|
|
21
|
-
const idx = raw.indexOf(":");
|
|
22
|
-
if (idx <= 0) {
|
|
23
|
-
throw new Error(`source\uC5D0 \uC2A4\uD0B4\uC774 \uC5C6\uC2B5\uB2C8\uB2E4: "${raw}" (\uC608: file:./skills/x, github:user/repo@v1)`);
|
|
24
|
-
}
|
|
25
|
-
const scheme = raw.slice(0, idx);
|
|
26
|
-
const rest2 = raw.slice(idx + 1);
|
|
27
|
-
switch (scheme) {
|
|
28
|
-
case "file":
|
|
29
|
-
if (!rest2) throw new Error(`file: \uB4A4\uC5D0 \uACBD\uB85C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4: "${raw}"`);
|
|
30
|
-
return { scheme, path: rest2 };
|
|
31
|
-
case "github": {
|
|
32
|
-
const m = GITHUB_RE.exec(rest2);
|
|
33
|
-
if (!m) throw new Error(`github: \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4: "${raw}" (\uC608: github:user/repo@v1.0#sub/path)`);
|
|
34
|
-
const [, owner, repo, ref, subpath] = m;
|
|
35
|
-
return { scheme, owner, repo, ref, subpath };
|
|
36
|
-
}
|
|
37
|
-
case "git": {
|
|
38
|
-
const hash = rest2.lastIndexOf("#");
|
|
39
|
-
const url = hash >= 0 ? rest2.slice(0, hash) : rest2;
|
|
40
|
-
const ref = hash >= 0 ? rest2.slice(hash + 1) : void 0;
|
|
41
|
-
if (!url) throw new Error(`git: \uB4A4\uC5D0 URL \uC774 \uC5C6\uC2B5\uB2C8\uB2E4: "${raw}"`);
|
|
42
|
-
return { scheme, url, ref: ref || void 0 };
|
|
43
|
-
}
|
|
44
|
-
default:
|
|
45
|
-
if (!/^[a-z][\w-]*$/.test(scheme)) throw new Error(`\uC54C \uC218 \uC5C6\uB294 \uC2A4\uD0B4 "${scheme}": "${raw}"`);
|
|
46
|
-
return { scheme: "other", name: scheme, rest: rest2 };
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function isComponentSource(s) {
|
|
50
|
-
return s.scheme === "file" || s.scheme === "github" || s.scheme === "git";
|
|
51
|
-
}
|
|
52
|
-
function formatSource(s) {
|
|
53
|
-
switch (s.scheme) {
|
|
54
|
-
case "file":
|
|
55
|
-
return `file:${s.path}`;
|
|
56
|
-
case "github":
|
|
57
|
-
return `github:${s.owner}/${s.repo}${s.ref ? `@${s.ref}` : ""}${s.subpath ? `#${s.subpath}` : ""}`;
|
|
58
|
-
case "git":
|
|
59
|
-
return `git:${s.url}${s.ref ? `#${s.ref}` : ""}`;
|
|
60
|
-
case "other":
|
|
61
|
-
return `${s.name}:${s.rest}`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function cloneTarget(s) {
|
|
65
|
-
if (s.scheme === "github") return { url: `https://github.com/${s.owner}/${s.repo}.git`, ref: s.ref };
|
|
66
|
-
if (s.scheme === "git") return { url: s.url, ref: s.ref };
|
|
67
|
-
throw new Error(`file: \uCD9C\uCC98\uB294 clone \uB300\uC0C1\uC774 \uC544\uB2D9\uB2C8\uB2E4`);
|
|
68
|
-
}
|
|
69
|
-
function sourceFromRemote(url, ref) {
|
|
70
|
-
const m = /^(?:https?:\/\/github\.com\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(url);
|
|
71
|
-
if (m) return formatSource({ scheme: "github", owner: m[1], repo: m[2], ref });
|
|
72
|
-
return formatSource({ scheme: "git", url, ref });
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// src/installers/claude-plugin.ts
|
|
76
|
-
async function readJson(p, fallback) {
|
|
77
|
-
try {
|
|
78
|
-
return JSON.parse(await fs.readFile(p, "utf8"));
|
|
79
|
-
} catch {
|
|
80
|
-
return fallback;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
var installedPath = (ctx) => path.join(ctx.adapter.root, "plugins", "installed_plugins.json");
|
|
84
|
-
var marketplacesPath = (ctx) => path.join(ctx.adapter.root, "plugins", "known_marketplaces.json");
|
|
85
|
-
function rest(pkg) {
|
|
86
|
-
const s = parseSource(pkg.source);
|
|
87
|
-
if (s.scheme !== "other") throw new Error(`package ${pkg.id}: ${pkg.source} \uB294 \uD50C\uB7EC\uADF8\uC778 \uCD9C\uCC98\uAC00 \uC544\uB2D9\uB2C8\uB2E4`);
|
|
88
|
-
return s.rest;
|
|
89
|
-
}
|
|
90
|
-
async function claude(ctx, args) {
|
|
91
|
-
try {
|
|
92
|
-
await ctx.exec("claude", args);
|
|
93
|
-
} catch (e) {
|
|
94
|
-
if (e.code === "ENOENT") throw new Error("claude CLI \uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. Claude Code \uAC00 \uC124\uCE58\uB418\uC5B4 \uC788\uC5B4\uC57C \uD50C\uB7EC\uADF8\uC778\uC744 \uBCF5\uC6D0\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
|
|
95
|
-
throw e;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
var marketplaceInstaller = {
|
|
99
|
-
name: "claude-marketplace",
|
|
100
|
-
schemes: ["claude-marketplace"],
|
|
101
|
-
priority: 10,
|
|
102
|
-
async detect(ctx) {
|
|
103
|
-
const m = await readJson(marketplacesPath(ctx), {});
|
|
104
|
-
const out = [];
|
|
105
|
-
for (const [name, v] of Object.entries(m)) {
|
|
106
|
-
const src = v.source;
|
|
107
|
-
if (src.source === "github" && src.repo) out.push({ id: name, source: `claude-marketplace:${src.repo}`, rev: src.repo });
|
|
108
|
-
else ctx.log(` ! marketplace ${name}: ${src.source} \uCD9C\uCC98\uB294 \uC544\uC9C1 \uAE30\uB85D\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4 (\uAC74\uB108\uB700)`);
|
|
109
|
-
}
|
|
110
|
-
return out;
|
|
111
|
-
},
|
|
112
|
-
async status(ctx, pkg) {
|
|
113
|
-
const m = await readJson(marketplacesPath(ctx), {});
|
|
114
|
-
const v = m[pkg.id];
|
|
115
|
-
return { present: !!v, rev: v?.source.repo };
|
|
116
|
-
},
|
|
117
|
-
async install(ctx, pkg, _locked, _opts) {
|
|
118
|
-
const repo = rest(pkg);
|
|
119
|
-
await claude(ctx, ["plugin", "marketplace", "add", repo, "--scope", "user"]);
|
|
120
|
-
return repo;
|
|
121
|
-
},
|
|
122
|
-
async update(ctx, pkg) {
|
|
123
|
-
await claude(ctx, ["plugin", "marketplace", "update", pkg.id]);
|
|
124
|
-
return rest(pkg);
|
|
125
|
-
},
|
|
126
|
-
describe(pkg) {
|
|
127
|
-
return `claude plugin marketplace add ${rest(pkg)}`;
|
|
128
|
-
},
|
|
129
|
-
cwd(ctx) {
|
|
130
|
-
return ctx.adapter.root;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
var pluginInstaller = {
|
|
134
|
-
name: "claude-plugin",
|
|
135
|
-
schemes: ["claude-plugin"],
|
|
136
|
-
priority: 20,
|
|
137
|
-
async detect(ctx) {
|
|
138
|
-
const f = await readJson(installedPath(ctx), { version: 2, plugins: {} });
|
|
139
|
-
const out = [];
|
|
140
|
-
for (const [key, entries] of Object.entries(f.plugins)) {
|
|
141
|
-
const e = entries.find((x2) => x2.scope === "user");
|
|
142
|
-
if (!e) continue;
|
|
143
|
-
const [name] = key.split("@");
|
|
144
|
-
out.push({ id: name, source: `claude-plugin:${key}`, rev: e.version });
|
|
145
|
-
}
|
|
146
|
-
return out;
|
|
147
|
-
},
|
|
148
|
-
async status(ctx, pkg) {
|
|
149
|
-
const f = await readJson(installedPath(ctx), { version: 2, plugins: {} });
|
|
150
|
-
const e = f.plugins[rest(pkg)]?.find((x2) => x2.scope === "user");
|
|
151
|
-
return { present: !!e, rev: e?.version };
|
|
152
|
-
},
|
|
153
|
-
async install(ctx, pkg, _locked, opts) {
|
|
154
|
-
await claude(ctx, ["plugin", "install", rest(pkg), "--scope", "user", ...opts.yes ? ["-y"] : []]);
|
|
155
|
-
return (await this.status(ctx, pkg)).rev ?? "?";
|
|
156
|
-
},
|
|
157
|
-
async update(ctx, pkg) {
|
|
158
|
-
await claude(ctx, ["plugin", "update", rest(pkg)]);
|
|
159
|
-
return (await this.status(ctx, pkg)).rev ?? "?";
|
|
160
|
-
},
|
|
161
|
-
describe(pkg, locked) {
|
|
162
|
-
return `claude plugin install ${rest(pkg)}${locked ? ` (\uC804\uC5D0 ${locked}; \uACE0\uC815\uC740 \uC548 \uB428)` : ""}`;
|
|
163
|
-
},
|
|
164
|
-
cwd(ctx) {
|
|
165
|
-
return ctx.adapter.root;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
// src/adapters/json-entries.ts
|
|
170
|
-
import { promises as fs2 } from "fs";
|
|
171
|
-
import path2 from "path";
|
|
172
|
-
var JsonEntries = class {
|
|
173
|
-
constructor(spec) {
|
|
174
|
-
this.spec = spec;
|
|
175
|
-
this.name = spec.name;
|
|
176
|
-
this.secretKeys = spec.secretKeys;
|
|
177
|
-
this.secretRootIds = spec.secretRootIds;
|
|
178
|
-
this.expandsEnv = spec.expandsEnv;
|
|
179
|
-
}
|
|
180
|
-
spec;
|
|
181
|
-
kind = "entry";
|
|
182
|
-
name;
|
|
183
|
-
secretKeys;
|
|
184
|
-
secretRootIds;
|
|
185
|
-
expandsEnv;
|
|
186
|
-
file() {
|
|
187
|
-
return this.spec.file();
|
|
188
|
-
}
|
|
189
|
-
async load() {
|
|
190
|
-
const p = await this.file();
|
|
191
|
-
try {
|
|
192
|
-
return JSON.parse(await fs2.readFile(p, "utf8"));
|
|
193
|
-
} catch (e) {
|
|
194
|
-
if (e.code === "ENOENT") return {};
|
|
195
|
-
throw new Error(`${p} \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${e.message}`);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
section(all) {
|
|
199
|
-
const s = this.spec.under ? all[this.spec.under] : all;
|
|
200
|
-
return s && typeof s === "object" && !Array.isArray(s) ? s : {};
|
|
201
|
-
}
|
|
202
|
-
async read() {
|
|
203
|
-
const out = { ...this.section(await this.load()) };
|
|
204
|
-
for (const k of this.spec.skip ?? []) delete out[k];
|
|
205
|
-
return out;
|
|
206
|
-
}
|
|
207
|
-
async write(id, value) {
|
|
208
|
-
const p = await this.file();
|
|
209
|
-
const all = await this.load();
|
|
210
|
-
const sect = { ...this.section(all) };
|
|
211
|
-
if (value === null) delete sect[id];
|
|
212
|
-
else sect[id] = value;
|
|
213
|
-
const next = this.spec.under ? { ...all, [this.spec.under]: sect } : sect;
|
|
214
|
-
await fs2.mkdir(path2.dirname(p), { recursive: true });
|
|
215
|
-
const tmp = `${p}.lshed-${process.pid}.tmp`;
|
|
216
|
-
await fs2.writeFile(tmp, JSON.stringify(next, null, 2) + "\n");
|
|
217
|
-
await fs2.rename(tmp, p);
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
// src/fsutil.ts
|
|
222
|
-
import { promises as fs3 } from "fs";
|
|
223
|
-
import { createHash } from "crypto";
|
|
224
|
-
import path3 from "path";
|
|
225
|
-
|
|
226
|
-
// src/ignore.ts
|
|
227
|
-
var DEFAULT_IGNORE = [
|
|
228
|
-
"node_modules",
|
|
229
|
-
".git",
|
|
230
|
-
"__pycache__",
|
|
231
|
-
".venv",
|
|
232
|
-
".mypy_cache",
|
|
233
|
-
".pytest_cache",
|
|
234
|
-
".DS_Store",
|
|
235
|
-
"*.log"
|
|
236
|
-
];
|
|
237
|
-
function matches(name, pattern) {
|
|
238
|
-
if (pattern.startsWith("*.")) return name.endsWith(pattern.slice(1));
|
|
239
|
-
return name === pattern;
|
|
240
|
-
}
|
|
241
|
-
function isIgnored(rel, patterns) {
|
|
242
|
-
if (!rel) return false;
|
|
243
|
-
return rel.split("/").some((seg) => patterns.some((p) => matches(seg, p)));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// src/fsutil.ts
|
|
247
|
-
async function exists(p) {
|
|
248
|
-
try {
|
|
249
|
-
await fs3.access(p);
|
|
250
|
-
return true;
|
|
251
|
-
} catch {
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
async function isDir(p) {
|
|
256
|
-
try {
|
|
257
|
-
return (await fs3.stat(p)).isDirectory();
|
|
258
|
-
} catch {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
async function listFiles(root, ignore = DEFAULT_IGNORE) {
|
|
263
|
-
if (!await exists(root)) return [];
|
|
264
|
-
if (!await isDir(root)) return [""];
|
|
265
|
-
const out = [];
|
|
266
|
-
async function walk2(dir, rel) {
|
|
267
|
-
const entries = await fs3.readdir(dir, { withFileTypes: true });
|
|
268
|
-
for (const e of entries) {
|
|
269
|
-
const r = rel ? `${rel}/${e.name}` : e.name;
|
|
270
|
-
if (isIgnored(r, ignore)) continue;
|
|
271
|
-
const full = path3.join(dir, e.name);
|
|
272
|
-
let st;
|
|
273
|
-
try {
|
|
274
|
-
st = await fs3.stat(full);
|
|
275
|
-
} catch {
|
|
276
|
-
continue;
|
|
277
|
-
}
|
|
278
|
-
if (st.isDirectory()) await walk2(full, r);
|
|
279
|
-
else if (st.isFile()) out.push(r);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
await walk2(root, "");
|
|
283
|
-
return out.sort();
|
|
284
|
-
}
|
|
285
|
-
async function hashFile(p) {
|
|
286
|
-
return createHash("sha256").update(await fs3.readFile(p)).digest("hex");
|
|
287
|
-
}
|
|
288
|
-
async function hashTree(root, ignore = DEFAULT_IGNORE) {
|
|
289
|
-
if (!await exists(root)) return null;
|
|
290
|
-
const h = createHash("sha256");
|
|
291
|
-
for (const rel of await listFiles(root, ignore)) {
|
|
292
|
-
h.update(rel).update("\0").update(await fs3.readFile(rel ? path3.join(root, rel) : root)).update("\0");
|
|
293
|
-
}
|
|
294
|
-
return h.digest("hex");
|
|
295
|
-
}
|
|
296
|
-
async function copyTree(src, dst, ignore = DEFAULT_IGNORE) {
|
|
297
|
-
await fs3.rm(dst, { recursive: true, force: true });
|
|
298
|
-
await fs3.mkdir(path3.dirname(dst), { recursive: true });
|
|
299
|
-
const srcRoot = path3.resolve(src);
|
|
300
|
-
await fs3.cp(src, dst, {
|
|
301
|
-
recursive: true,
|
|
302
|
-
dereference: true,
|
|
303
|
-
filter: async (from) => {
|
|
304
|
-
const rel = path3.relative(srcRoot, path3.resolve(from)).split(path3.sep).join("/");
|
|
305
|
-
if (isIgnored(rel, ignore)) return false;
|
|
306
|
-
try {
|
|
307
|
-
if ((await fs3.lstat(from)).isSymbolicLink()) await fs3.stat(from);
|
|
308
|
-
} catch {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
return true;
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
async function removeTree(p) {
|
|
316
|
-
await fs3.rm(p, { recursive: true, force: true });
|
|
317
|
-
}
|
|
318
|
-
async function diffTrees(local, shed, ignore = DEFAULT_IGNORE) {
|
|
319
|
-
const l = new Set(await listFiles(local, ignore));
|
|
320
|
-
const s = new Set(await listFiles(shed, ignore));
|
|
321
|
-
const out = [];
|
|
322
|
-
for (const f of [.../* @__PURE__ */ new Set([...l, ...s])].sort()) {
|
|
323
|
-
const lp = f ? path3.join(local, f) : local;
|
|
324
|
-
const sp = f ? path3.join(shed, f) : shed;
|
|
325
|
-
if (l.has(f) && !s.has(f)) out.push({ status: "A", file: f });
|
|
326
|
-
else if (!l.has(f) && s.has(f)) out.push({ status: "D", file: f });
|
|
327
|
-
else if (await hashFile(lp) !== await hashFile(sp)) out.push({ status: "M", file: f });
|
|
328
|
-
}
|
|
329
|
-
return out;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// src/adapters/claude-code.ts
|
|
333
|
-
var CATEGORIES = [
|
|
334
|
-
{ name: "skills", root: "skills", kind: "dir" },
|
|
335
|
-
{ name: "agents", root: "agents", kind: "file" },
|
|
336
|
-
{ name: "commands", root: "commands", kind: "file" }
|
|
337
|
-
// instructions 는 단일 파일(CLAUDE.md)이라 스캔 대상이 아니라 생성 대상이다 (§3.3)
|
|
338
|
-
];
|
|
339
|
-
var ClaudeCodeAdapter = class {
|
|
340
|
-
name = "claude-code";
|
|
341
|
-
root;
|
|
342
|
-
entryCats;
|
|
343
|
-
constructor(root) {
|
|
344
|
-
this.root = root ?? process.env.CLAUDE_CONFIG_DIR ?? path4.join(os.homedir(), ".claude");
|
|
345
|
-
const root_ = this.root;
|
|
346
|
-
this.entryCats = [
|
|
347
|
-
/**
|
|
348
|
-
* 사용자 범위 MCP (§7.4): ~/.claude 의 형제 ~/.claude.json 의 mcpServers. CLAUDE_CONFIG_DIR 처럼 루트 안에 있으면 그것.
|
|
349
|
-
* Claude Code 가 ${VAR} 를 모든 범위에서 스스로 확장하므로 자리표시자를 그대로 둔다.
|
|
350
|
-
*/
|
|
351
|
-
new JsonEntries({
|
|
352
|
-
name: "mcp",
|
|
353
|
-
file: async () => {
|
|
354
|
-
const inside = path4.join(root_, ".claude.json");
|
|
355
|
-
return await exists(inside) ? inside : `${root_}.json`;
|
|
356
|
-
},
|
|
357
|
-
under: "mcpServers",
|
|
358
|
-
secretKeys: ["env", "headers"],
|
|
359
|
-
expandsEnv: true
|
|
360
|
-
}),
|
|
361
|
-
/**
|
|
362
|
-
* settings.json (§7.6): 최상위 키 하나 = 항목 하나 (hooks, permissions, env, model, ...).
|
|
363
|
-
* 병합하지 않는다. 키를 통째로 소유하고, 로컬 편집은 diff/save 로 되가져온다.
|
|
364
|
-
* enabledPlugins 는 플러그인 설치기가 만드는 상태라 담지 않는다. ${VAR} 는 Claude Code 가 안 채우므로 restore 가 채운다.
|
|
365
|
-
*/
|
|
366
|
-
new JsonEntries({
|
|
367
|
-
name: "settings",
|
|
368
|
-
file: async () => path4.join(root_, "settings.json"),
|
|
369
|
-
secretKeys: [],
|
|
370
|
-
secretRootIds: ["env"],
|
|
371
|
-
expandsEnv: false,
|
|
372
|
-
skip: ["enabledPlugins"]
|
|
373
|
-
})
|
|
374
|
-
];
|
|
375
|
-
}
|
|
376
|
-
entries() {
|
|
377
|
-
return this.entryCats;
|
|
378
|
-
}
|
|
379
|
-
categories() {
|
|
380
|
-
return CATEGORIES;
|
|
381
|
-
}
|
|
382
|
-
instructionsStrategy() {
|
|
383
|
-
return "import";
|
|
384
|
-
}
|
|
385
|
-
instructionsFileName() {
|
|
386
|
-
return "CLAUDE.md";
|
|
387
|
-
}
|
|
388
|
-
installers() {
|
|
389
|
-
return [marketplaceInstaller, pluginInstaller];
|
|
390
|
-
}
|
|
391
|
-
async scan() {
|
|
392
|
-
const out = [];
|
|
393
|
-
for (const cat of CATEGORIES) {
|
|
394
|
-
const dir = path4.join(this.root, cat.root);
|
|
395
|
-
let entries;
|
|
396
|
-
try {
|
|
397
|
-
entries = await fs4.readdir(dir, { withFileTypes: true });
|
|
398
|
-
} catch {
|
|
399
|
-
continue;
|
|
400
|
-
}
|
|
401
|
-
for (const e of entries) {
|
|
402
|
-
if (e.name.startsWith(".")) continue;
|
|
403
|
-
const full = path4.join(dir, e.name);
|
|
404
|
-
let st;
|
|
405
|
-
try {
|
|
406
|
-
st = await fs4.stat(full);
|
|
407
|
-
} catch {
|
|
408
|
-
continue;
|
|
189
|
+
`)}else re?g.write(`
|
|
190
|
+
if (${O}.issues.length) {${b(O,D)}
|
|
409
191
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
192
|
+
|
|
193
|
+
if (${O}.value === undefined) {
|
|
194
|
+
if (${w}) {
|
|
195
|
+
newResult[${D}] = undefined;
|
|
196
|
+
}
|
|
197
|
+
} else {
|
|
198
|
+
newResult[${D}] = ${O}.value;
|
|
414
199
|
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
return out;
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
200
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
import path5 from "path";
|
|
434
|
-
var x = promisify(execFile);
|
|
435
|
-
async function git(args, cwd) {
|
|
436
|
-
const { stdout } = await x("git", args, { cwd, maxBuffer: 1 << 24 });
|
|
437
|
-
return stdout.trim();
|
|
438
|
-
}
|
|
439
|
-
var isRepo = (dir) => exists(path5.join(dir, ".git"));
|
|
440
|
-
var remoteUrl = (dir) => git(["remote", "get-url", "origin"], dir).catch(() => null);
|
|
441
|
-
var head = (dir) => git(["rev-parse", "HEAD"], dir);
|
|
442
|
-
var branch = async (dir) => {
|
|
443
|
-
const b = await git(["rev-parse", "--abbrev-ref", "HEAD"], dir);
|
|
444
|
-
return b === "HEAD" ? void 0 : b;
|
|
445
|
-
};
|
|
446
|
-
var clone = (url, dir, ref) => git(["clone", "--quiet", ...ref ? ["--branch", ref] : [], url, dir]);
|
|
447
|
-
var resetHard = (dir, sha) => git(["reset", "--hard", "--quiet", sha], dir);
|
|
448
|
-
var pullFf = (dir) => git(["pull", "--ff-only", "--quiet"], dir);
|
|
449
|
-
function runShell(cmd, cwd) {
|
|
450
|
-
return new Promise((resolve, reject) => {
|
|
451
|
-
const p = spawn(cmd, { cwd, stdio: "inherit", shell: true });
|
|
452
|
-
p.on("error", reject);
|
|
453
|
-
p.on("close", (code) => code === 0 ? resolve() : reject(new Error(`\uBA85\uB839\uC774 ${code} \uB85C \uB05D\uB0AC\uC2B5\uB2C8\uB2E4: ${cmd}`)));
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// src/installers/git.ts
|
|
458
|
-
function dirOf(ctx, pkg) {
|
|
459
|
-
if (!pkg.into) throw new Error(`package ${pkg.id}: git \uACC4\uC5F4 \uD328\uD0A4\uC9C0\uB294 into \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4`);
|
|
460
|
-
return path6.join(ctx.adapter.root, ...pkg.into.split("/"));
|
|
461
|
-
}
|
|
462
|
-
var gitInstaller = {
|
|
463
|
-
name: "git",
|
|
464
|
-
schemes: ["github", "git"],
|
|
465
|
-
priority: 0,
|
|
466
|
-
async detect(ctx, found) {
|
|
467
|
-
const out = [];
|
|
468
|
-
for (const f of found) {
|
|
469
|
-
if (!await isRepo(f.path)) continue;
|
|
470
|
-
const url = await remoteUrl(f.path);
|
|
471
|
-
if (!url) continue;
|
|
472
|
-
const into = path6.relative(ctx.adapter.root, f.path).split(path6.sep).join("/");
|
|
473
|
-
out.push({ id: f.id, into, source: sourceFromRemote(url, await branch(f.path)), rev: await head(f.path), path: f.path });
|
|
474
|
-
}
|
|
475
|
-
return out;
|
|
476
|
-
},
|
|
477
|
-
async status(ctx, pkg) {
|
|
478
|
-
const dir = dirOf(ctx, pkg);
|
|
479
|
-
const present = await isRepo(dir);
|
|
480
|
-
return { present, rev: present ? await head(dir) : void 0 };
|
|
481
|
-
},
|
|
482
|
-
async install(ctx, pkg, locked, _opts) {
|
|
483
|
-
const dir = dirOf(ctx, pkg);
|
|
484
|
-
if (await exists(dir)) throw new Error(`package ${pkg.id}: ${dir} \uAC00 \uC788\uC9C0\uB9CC git \uC800\uC7A5\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4. \uCE58\uC6B0\uAC70\uB098 into \uB97C \uBC14\uAFB8\uC138\uC694.`);
|
|
485
|
-
const { url, ref } = cloneTarget(parseSource(pkg.source));
|
|
486
|
-
await fs5.mkdir(path6.dirname(dir), { recursive: true });
|
|
487
|
-
await clone(url, dir, ref);
|
|
488
|
-
if (locked) {
|
|
489
|
-
await resetHard(dir, locked).catch(() => {
|
|
490
|
-
throw new Error(`package ${pkg.id}: \uB77D\uC758 \uCEE4\uBC0B ${locked.slice(0, 7)} \uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. 'lshed update ${pkg.id}' \uB85C \uB77D\uC744 \uAC31\uC2E0\uD558\uC138\uC694.`);
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
return head(dir);
|
|
494
|
-
},
|
|
495
|
-
async update(ctx, pkg) {
|
|
496
|
-
const dir = dirOf(ctx, pkg);
|
|
497
|
-
await pullFf(dir);
|
|
498
|
-
return head(dir);
|
|
499
|
-
},
|
|
500
|
-
describe(pkg, locked) {
|
|
501
|
-
const { url, ref } = cloneTarget(parseSource(pkg.source));
|
|
502
|
-
return `clone ${url}${ref ? ` @${ref}` : ""}${locked ? ` \u2192 ${locked.slice(0, 7)}` : ""}`;
|
|
503
|
-
},
|
|
504
|
-
cwd: dirOf
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
// src/manifest.ts
|
|
508
|
-
import { z } from "zod";
|
|
509
|
-
import YAML from "yaml";
|
|
510
|
-
var ComponentSchema = z.object({
|
|
511
|
-
id: z.string().regex(/^[\w.-]+$/, "id\uB294 \uC601\uBB38\xB7\uC22B\uC790\xB7._- \uB9CC \uD5C8\uC6A9"),
|
|
512
|
-
source: z.string().optional(),
|
|
513
|
-
tags: z.array(z.string()).optional()
|
|
514
|
-
});
|
|
515
|
-
var PackageSchema = z.object({
|
|
516
|
-
id: z.string().regex(/^[\w.-]+$/, "id\uB294 \uC601\uBB38\xB7\uC22B\uC790\xB7._- \uB9CC \uD5C8\uC6A9"),
|
|
517
|
-
source: z.string(),
|
|
518
|
-
/** git 계열 패키지의 위치 (어댑터 루트 기준). 어댑터 설치기 스킴은 필요 없다 */
|
|
519
|
-
into: z.string().regex(/^[^/\\][^\\]*$/, "into \uB294 \uB8E8\uD2B8 \uAE30\uC900 \uC0C1\uB300 \uACBD\uB85C (POSIX)").optional(),
|
|
520
|
-
/** 설치 후 실행할 셸 명령. --yes 일 때만 실행 */
|
|
521
|
-
install: z.string().optional()
|
|
522
|
-
});
|
|
523
|
-
var PACKAGES = "packages";
|
|
524
|
-
var ComponentsSchema = z.record(z.string(), z.array(ComponentSchema));
|
|
525
|
-
var ProfileSchema = z.record(z.string(), z.array(z.string()));
|
|
526
|
-
var ManifestSchema = z.object({
|
|
527
|
-
version: z.literal(1),
|
|
528
|
-
agent: z.string().default("claude-code"),
|
|
529
|
-
/** 창고에 담지 않을 이름들. 기본값(DEFAULT_IGNORE)에 더해진다. */
|
|
530
|
-
ignore: z.array(z.string()).optional(),
|
|
531
|
-
/** 로컬에 있어도 창고에 넣지 않을 부품 ("id" 또는 "category/id"). init --exclude 가 적고 add/status 가 따른다. */
|
|
532
|
-
exclude: z.array(z.string()).optional(),
|
|
533
|
-
components: ComponentsSchema.default({}),
|
|
534
|
-
packages: z.array(PackageSchema).default([]),
|
|
535
|
-
profiles: z.record(z.string(), ProfileSchema).default({})
|
|
536
|
-
});
|
|
537
|
-
var ManifestError = class extends Error {
|
|
538
|
-
};
|
|
539
|
-
function parseManifest(text, knownCategories2, knownSchemes) {
|
|
540
|
-
const raw = YAML.parse(text);
|
|
541
|
-
const result = ManifestSchema.safeParse(raw);
|
|
542
|
-
if (!result.success) {
|
|
543
|
-
const lines = result.error.issues.map((i) => ` ${i.path.join(".") || "(root)"}: ${i.message}`);
|
|
544
|
-
throw new ManifestError(`lshed.yaml \uD615\uC2DD \uC624\uB958:
|
|
545
|
-
${lines.join("\n")}`);
|
|
546
|
-
}
|
|
547
|
-
const m = result.data;
|
|
548
|
-
const problems = [];
|
|
549
|
-
for (const [cat, comps] of Object.entries(m.components)) {
|
|
550
|
-
if (knownCategories2 && !knownCategories2.includes(cat)) {
|
|
551
|
-
problems.push(`\uC54C \uC218 \uC5C6\uB294 \uCE74\uD14C\uACE0\uB9AC "${cat}" (\uC5B4\uB311\uD130 ${m.agent}: ${knownCategories2.join(", ")})`);
|
|
552
|
-
}
|
|
553
|
-
const seen = /* @__PURE__ */ new Set();
|
|
554
|
-
for (const c of comps) {
|
|
555
|
-
if (seen.has(c.id)) problems.push(`${cat}: id "${c.id}" \uC911\uBCF5`);
|
|
556
|
-
seen.add(c.id);
|
|
557
|
-
try {
|
|
558
|
-
if (!isComponentSource(parseSource(effectiveSource(cat, c)))) problems.push(`${cat}/${c.id}: \uBD80\uD488 \uCD9C\uCC98\uB294 file:/github:/git: \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`);
|
|
559
|
-
} catch (e) {
|
|
560
|
-
problems.push(`${cat}/${c.id}: ${e.message}`);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
const pkgIds = /* @__PURE__ */ new Set();
|
|
565
|
-
for (const p of m.packages) {
|
|
566
|
-
if (pkgIds.has(p.id)) problems.push(`packages: id "${p.id}" \uC911\uBCF5`);
|
|
567
|
-
pkgIds.add(p.id);
|
|
568
|
-
try {
|
|
569
|
-
const src = parseSource(p.source);
|
|
570
|
-
const scheme = src.scheme === "other" ? src.name : src.scheme;
|
|
571
|
-
if (scheme === "file") problems.push(`packages/${p.id}: \uD328\uD0A4\uC9C0 \uCD9C\uCC98\uB294 file: \uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
572
|
-
else if (knownSchemes && !knownSchemes.includes(scheme)) problems.push(`packages/${p.id}: \uC2A4\uD0B4 "${scheme}" \uC744 \uB2E4\uB8F0 \uC124\uCE58\uAE30\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 (${knownSchemes.join(", ")})`);
|
|
573
|
-
if ((scheme === "github" || scheme === "git") && !p.into) problems.push(`packages/${p.id}: ${scheme}: \uD328\uD0A4\uC9C0\uB294 into \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4`);
|
|
574
|
-
} catch (e) {
|
|
575
|
-
problems.push(`packages/${p.id}: ${e.message}`);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
for (const [profile, cats] of Object.entries(m.profiles)) {
|
|
579
|
-
for (const [cat, ids] of Object.entries(cats)) {
|
|
580
|
-
if (cat === PACKAGES) {
|
|
581
|
-
for (const id of ids) if (!pkgIds.has(id)) problems.push(`profiles.${profile}.packages: "${id}" \uB294 packages \uC5D0 \uC5C6\uC74C`);
|
|
582
|
-
continue;
|
|
583
|
-
}
|
|
584
|
-
const available = new Set((m.components[cat] ?? []).map((c) => c.id));
|
|
585
|
-
for (const id of ids) {
|
|
586
|
-
if (!available.has(id)) problems.push(`profiles.${profile}.${cat}: "${id}" \uB294 components\uC5D0 \uC5C6\uC74C`);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
if (problems.length) throw new ManifestError(`lshed.yaml \uCC38\uC870 \uC624\uB958:
|
|
591
|
-
${problems.map((p) => " " + p).join("\n")}`);
|
|
592
|
-
return m;
|
|
593
|
-
}
|
|
594
|
-
function effectiveSource(category, c, kind = "dir") {
|
|
595
|
-
const ext = kind === "file" ? ".md" : kind === "entry" ? ".json" : "";
|
|
596
|
-
return c.source ?? `file:./${category}/${c.id}${ext}`;
|
|
597
|
-
}
|
|
598
|
-
function packagesOf(m, profile) {
|
|
599
|
-
const ids = m.profiles[profile]?.[PACKAGES] ?? [];
|
|
600
|
-
return ids.map((id) => m.packages.find((p) => p.id === id));
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
// src/resolvers/file.ts
|
|
604
|
-
import path7 from "path";
|
|
605
|
-
function resolveSource(shed, raw) {
|
|
606
|
-
const s = parseSource(raw);
|
|
607
|
-
if (s.scheme === "file") return path7.resolve(shed, s.path);
|
|
608
|
-
throw new Error(`"${raw}": ${s.scheme}: \uCD9C\uCC98\uB294 v0.2\uC5D0\uC11C \uC9C0\uC6D0\uB429\uB2C8\uB2E4. \uC9C0\uAE08\uC740 file: \uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);
|
|
609
|
-
}
|
|
610
|
-
function isSaveable(raw) {
|
|
611
|
-
return parseSource(raw).scheme === "file";
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
// src/state.ts
|
|
615
|
-
import { promises as fs6 } from "fs";
|
|
616
|
-
import path8 from "path";
|
|
617
|
-
import { z as z2 } from "zod";
|
|
618
|
-
var StateSchema = z2.object({
|
|
619
|
-
profile: z2.string(),
|
|
620
|
-
shed: z2.string(),
|
|
621
|
-
/** 어댑터 루트 기준 상대 경로 (POSIX 구분자). lshed가 놓은 것만. */
|
|
622
|
-
managed: z2.array(z2.string()),
|
|
623
|
-
appliedAt: z2.string()
|
|
624
|
-
});
|
|
625
|
-
var LSHED_DIR = "lshed";
|
|
626
|
-
function statePath(adapter) {
|
|
627
|
-
return path8.join(adapter.root, LSHED_DIR, "state.json");
|
|
628
|
-
}
|
|
629
|
-
async function readState(adapter) {
|
|
630
|
-
try {
|
|
631
|
-
const raw = JSON.parse(await fs6.readFile(statePath(adapter), "utf8"));
|
|
632
|
-
return StateSchema.parse(raw);
|
|
633
|
-
} catch (e) {
|
|
634
|
-
if (e.code === "ENOENT") return null;
|
|
635
|
-
throw new Error(`state.json \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (${statePath(adapter)}): ${e.message}`);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
async function writeState(adapter, state) {
|
|
639
|
-
const p = statePath(adapter);
|
|
640
|
-
await fs6.mkdir(path8.dirname(p), { recursive: true });
|
|
641
|
-
await fs6.writeFile(p, JSON.stringify(state, null, 2) + "\n");
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
// src/core/context.ts
|
|
645
|
-
function spawnExec(cmd, args, cwd) {
|
|
646
|
-
return new Promise((resolve, reject) => {
|
|
647
|
-
const p = spawn2(cmd, args, { cwd, stdio: "inherit", shell: process.platform === "win32" });
|
|
648
|
-
p.on("error", reject);
|
|
649
|
-
p.on("close", (code) => code === 0 ? resolve() : reject(new Error(`${cmd} ${args.join(" ")} \uAC00 ${code} \uB85C \uB05D\uB0AC\uC2B5\uB2C8\uB2E4`)));
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
function installersFor(ctx) {
|
|
653
|
-
return [gitInstaller, ...ctx.adapter.installers()].sort((a, b) => a.priority - b.priority);
|
|
654
|
-
}
|
|
655
|
-
function installerFor(ctx, source) {
|
|
656
|
-
const s = parseSource(source);
|
|
657
|
-
const scheme = s.scheme === "other" ? s.name : s.scheme;
|
|
658
|
-
const inst = installersFor(ctx).find((i) => i.schemes.includes(scheme));
|
|
659
|
-
if (!inst) throw new Error(`"${source}": \uC2A4\uD0B4 ${scheme} \uC744 \uB2E4\uB8F0 \uC124\uCE58\uAE30\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
660
|
-
return inst;
|
|
661
|
-
}
|
|
662
|
-
var MANIFEST_FILE = "lshed.yaml";
|
|
663
|
-
var INSTRUCTIONS = "instructions";
|
|
664
|
-
var FRAGMENTS_DIR = `${LSHED_DIR}/instructions`;
|
|
665
|
-
function manifestPath(ctx) {
|
|
666
|
-
return path9.join(ctx.shed, MANIFEST_FILE);
|
|
667
|
-
}
|
|
668
|
-
function knownCategories(adapter) {
|
|
669
|
-
return [...adapter.categories().map((c) => c.name), ...adapter.entries().map((e) => e.name), INSTRUCTIONS];
|
|
670
|
-
}
|
|
671
|
-
async function loadManifest(ctx) {
|
|
672
|
-
let text;
|
|
673
|
-
try {
|
|
674
|
-
text = await fs7.readFile(manifestPath(ctx), "utf8");
|
|
675
|
-
} catch {
|
|
676
|
-
throw new Error(`\uCC3D\uACE0\uC5D0 ${MANIFEST_FILE} \uC774 \uC5C6\uC2B5\uB2C8\uB2E4: ${ctx.shed}
|
|
677
|
-
\uBA3C\uC800 'lshed init --shed ${ctx.shed}' \uB97C \uC2E4\uD589\uD558\uC138\uC694.`);
|
|
678
|
-
}
|
|
679
|
-
const m = parseManifest(text, knownCategories(ctx.adapter), installersFor(ctx).flatMap((i) => [...i.schemes]));
|
|
680
|
-
ctx.ignore = [...DEFAULT_IGNORE, ...m.ignore ?? []];
|
|
681
|
-
return m;
|
|
682
|
-
}
|
|
683
|
-
function ignoreOf(ctx) {
|
|
684
|
-
return ctx.ignore ?? DEFAULT_IGNORE;
|
|
685
|
-
}
|
|
686
|
-
function targetRel(cat, id) {
|
|
687
|
-
if (cat === INSTRUCTIONS) return `${FRAGMENTS_DIR}/${id}.md`;
|
|
688
|
-
if (cat.kind === "entry") return `${cat.name}:${id}`;
|
|
689
|
-
return cat.kind === "dir" ? `${cat.root}/${id}` : `${cat.root}/${id}.md`;
|
|
690
|
-
}
|
|
691
|
-
function entryOf(ctx, rel) {
|
|
692
|
-
const i = rel.indexOf(":");
|
|
693
|
-
if (i <= 0) return void 0;
|
|
694
|
-
const cat = ctx.adapter.entries().find((e) => e.name === rel.slice(0, i));
|
|
695
|
-
return cat ? { cat, id: rel.slice(i + 1) } : void 0;
|
|
696
|
-
}
|
|
697
|
-
function kindOf(ctx, category) {
|
|
698
|
-
if (category === INSTRUCTIONS) return "file";
|
|
699
|
-
if (ctx.adapter.entries().some((e) => e.name === category)) return "entry";
|
|
700
|
-
return ctx.adapter.categories().find((k) => k.name === category)?.kind ?? "dir";
|
|
701
|
-
}
|
|
702
|
-
function sourcePath(ctx, category, c) {
|
|
703
|
-
return resolveSource(ctx.shed, effectiveSource(category, c, kindOf(ctx, category)));
|
|
704
|
-
}
|
|
705
|
-
function findComponent(m, category, id) {
|
|
706
|
-
const c = (m.components[category] ?? []).find((x2) => x2.id === id);
|
|
707
|
-
if (!c) throw new Error(`${category}/${id} \uB294 components \uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
708
|
-
return c;
|
|
709
|
-
}
|
|
710
|
-
function planProfile(ctx, m, profile) {
|
|
711
|
-
const p = m.profiles[profile];
|
|
712
|
-
if (!p) {
|
|
713
|
-
const names = Object.keys(m.profiles);
|
|
714
|
-
throw new Error(`\uD504\uB85C\uD544 "${profile}" \uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uC788\uB294 \uD504\uB85C\uD544: ${names.length ? names.join(", ") : "(\uC5C6\uC74C)"}`);
|
|
715
|
-
}
|
|
716
|
-
const items = [];
|
|
717
|
-
for (const [category, ids] of Object.entries(p)) {
|
|
718
|
-
if (category === PACKAGES) continue;
|
|
719
|
-
const cat = category === INSTRUCTIONS ? INSTRUCTIONS : ctx.adapter.categories().find((k) => k.name === category) ?? ctx.adapter.entries().find((e) => e.name === category);
|
|
720
|
-
if (!cat) throw new Error(`\uD504\uB85C\uD544 "${profile}": \uC5B4\uB311\uD130 ${ctx.adapter.name} \uC740 \uCE74\uD14C\uACE0\uB9AC "${category}" \uB97C \uBAA8\uB985\uB2C8\uB2E4`);
|
|
721
|
-
const entry = cat !== INSTRUCTIONS && cat.kind === "entry" ? cat : void 0;
|
|
722
|
-
for (const id of ids) {
|
|
723
|
-
const component = findComponent(m, category, id);
|
|
724
|
-
items.push({ category, id, rel: targetRel(cat, id), src: sourcePath(ctx, category, component), component, entry });
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
return items;
|
|
728
|
-
}
|
|
729
|
-
function abs(ctx, rel) {
|
|
730
|
-
return path9.join(ctx.adapter.root, ...rel.split("/"));
|
|
731
|
-
}
|
|
201
|
+
`):g.write(`
|
|
202
|
+
const ${O}_present = ${w};
|
|
203
|
+
if (${O}.issues.length) {${b(O,D)}
|
|
204
|
+
}
|
|
205
|
+
if (!${O}_present && !${O}.issues.length) {
|
|
206
|
+
payload.issues.push({
|
|
207
|
+
code: "invalid_type",
|
|
208
|
+
expected: "nonoptional",
|
|
209
|
+
input: undefined,
|
|
210
|
+
path: [${D}]
|
|
211
|
+
});
|
|
212
|
+
}
|
|
732
213
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
import YAML4 from "yaml";
|
|
214
|
+
if (${O}_present) {
|
|
215
|
+
newResult[${D}] = ${O}.value;
|
|
216
|
+
}
|
|
737
217
|
|
|
738
|
-
// src/core/instructions.ts
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
return path10.join(ctx.adapter.root, ctx.adapter.instructionsFileName());
|
|
743
|
-
|
|
744
|
-
function isGenerated(text) {
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
|
|
218
|
+
`)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},a,s=Zt,c=!ae.jitless,l=c&&jc.value,d=e.catchall,f;t._zod.parse=(p,m)=>{f??(f=i.value);let h=p.value;return s(h)?c&&l&&m?.async===!1&&m.jitless!==!0?(a||(a=o(e.shape)),p=a(p,m),d?Qg([],h,p,m,f,t):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),p)}});function Lg(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=>!dt(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(a=>be(a,i,Q())))}),e)}var Ur=v("$ZodUnion",(t,e)=>{C.init(t,e),Z(t,"optin",i=>i.def.options.some(n=>n._zod.optin==="defaulted")?"defaulted":i.def.options.some(n=>n._zod.optin!==void 0)?"optional":void 0),Z(t,"optout",i=>i.def.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Z(t,"values",i=>{if(i.def.options.every(n=>n._zod.values))return new Set(i.def.options.flatMap(n=>Array.from(n._zod.values)))}),Z(t,"pattern",i=>{if(i.def.options.every(n=>n._zod.pattern)){let n=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>wr(o.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,a=[];for(let s of e.options){let c=s._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)a.push(c),o=!0;else{if(c.issues.length===0)return c;a.push(c)}}return o?Promise.all(a).then(s=>Lg(s,i,t,n)):Lg(a,i,t,n)}});function Zg(t,e,r,i){let n=[];for(let o=0;o<t.length;o++)t[o].issues.length===0&&n.push(o);return n.length===1?(e.value=t[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(a=>be(a,i,Q())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1,matches:n}),e)}var Tl=v("$ZodXor",(t,e)=>{Ur.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,a=[];for(let s of e.options){let c=s._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(a.push(c),o=!0):a.push(c)}return o?Promise.all(a).then(s=>Zg(s,i,t,n)):Zg(a,i,t,n)}});function Ul(t,e){let r=t._zod,i=r.bag.optionsMap;if(!i){i=new Map;let{options:n,discriminator:o}=r.def;for(let a of n)for(let s of a._zod.propValues?.[o]??[])i.has(s)||i.set(s,a);r.bag.optionsMap=i}return i.get(e)}var Ll=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ur.init(t,e);let r=t._zod.parse;Z(t,"propValues",n=>{let o={};for(let a of n.def.options){let s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);for(let[c,u]of Object.entries(s)){Object.prototype.hasOwnProperty.call(o,c)||X(o,c,new Set);for(let l of u)o[c].add(l)}}return o}),e.options.forEach((n,o)=>{let a=Gu.get(n._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,e.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=$n(()=>{let n=e.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,a)}}return o});t._zod.parse=(n,o)=>{let a=n.value;if(!Zt(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),n;let s=i.value.get(a?.[e.discriminator]);return s?s._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:a,path:[e.discriminator],inst:t}),n)}}),Zl=v("$ZodIntersection",(t,e)=>{C.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,u])=>Mg(r,c,u)):Mg(r,o,a)}});function In(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(Ee(t)&&Ee(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};Object.prototype.hasOwnProperty.call(n,"__proto__")&&delete n.__proto__;for(let o of i){if(o==="__proto__")continue;let a=In(t[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.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],a=In(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Mg(t,e,r){let i=new Map,n,o=new Map,a=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let f=String(u.path[0]);o.has(f)||o.set(f,u),d=[f]}else return!1;for(let f of d)i.has(f)||i.set(f,{}),i.get(f)[l]=!0;return!0};for(let u of e.issues)a(u,"l")||t.issues.push(u);for(let u of r.issues)a(u,"r")||t.issues.push(u);let s=[...i].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(s.length){let u=n?s.filter(l=>n.keys.includes(l)):[];u.length&&t.issues.push({...n,keys:u});for(let l of s)!u.includes(l)&&o.has(l)&&t.issues.push(o.get(l))}let c=In(e.value,r.value);if(!c.valid){if(dt(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return t.value=c.data,t}var Mo=v("$ZodTuple",(t,e)=>{C.init(t,e);let r=e.items,i=ae.memoizer;i?.attach(t),t._zod.parse=(n,o)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=i?i.alloc(t,n,[],o):[];let s=[],c=Vg(r,"optin"),u=Vg(r,"optout");if(!e.rest){if(a.length<c)return n.issues.push({code:"too_small",minimum:c,inclusive:!0,input:a,inst:t,origin:"array"}),n;a.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:t,origin:"array"})}let l=new Array(r.length);for(let d=0;d<r.length;d++){let f=r[d]._zod.run({value:a[d],issues:[]},o);f instanceof Promise?s.push(f.then(p=>{l[d]=p})):l[d]=f}if(e.rest){let d=r.length-1,f=a.slice(r.length);for(let p of f){d++;let m=e.rest._zod.run({value:p,issues:[]},o);m instanceof Promise?s.push(m.then(h=>Rg(h,n,d))):Rg(m,n,d)}}return s.length?Promise.all(s).then(()=>Fg(l,n,r,a,u)):Fg(l,n,r,a,u)}});function Vg(t,e){for(let r=t.length-1;r>=0;r--)if(!(e==="optin"?t[r]._zod.optin!==void 0:t[r]._zod.optout==="optional"))return r+1;return 0}function Rg(t,e,r){t.issues.length&&e.issues.push(...$e(r,t.issues)),e.value[r]=t.value}function Fg(t,e,r,i,n){for(let o=0;o<r.length;o++){let a=t[o],s=o<i.length;if(!s&&o>=n&&r[o]._zod.optin==="optional"){e.value.length=o;break}if(a.issues.length){if(!s&&o>=n){e.value.length=o;break}e.issues.push(...$e(o,a.issues))}e.value[o]=a.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 Ml=v("$ZodRecord",(t,e)=>{C.init(t,e);let r=ae.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!Ee(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),i;let a=[],s=e.keyType._zod.values;if(s&&!e.partial){i.value=r?r.alloc(t,i,{},n):{};let c=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let d=e.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>be(m,n,Q())),input:l,path:[l],inst:t});continue}let f=d.value;if(f==="__proto__")continue;let p=e.valueType._zod.run({value:o[l],issues:[]},n);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&i.issues.push(...$e(l,m.issues)),i.value[f]=m.value})):(p.issues.length&&i.issues.push(...$e(l,p.issues)),i.value[f]=p.value)}let u;for(let l in o)if(!c.has(l))if(e.mode==="loose"){if(l==="__proto__")continue;i.value[l]=o[l]}else u=u??[],u.push(l);u&&u.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:u,continue:!0})}else{i.value=r?r.alloc(t,i,{},n):{};let c;for(let u of Reflect.ownKeys(o)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,u))continue;let l=e.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&pt.test(u)&&l.issues.length){let m=e.keyType._zod.run({value:Number(u),issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(l=m)}if(l.issues.length){e.mode==="loose"?i.value[u]=o[u]:s?(c=c??[],c.push(u)):i.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>be(m,n,Q())),input:u,path:[u],inst:t});continue}let f=l.value;if(f==="__proto__")continue;let p=e.valueType._zod.run({value:o[u],issues:[]},n);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&i.issues.push(...$e(u,m.issues)),i.value[f]=m.value})):(p.issues.length&&i.issues.push(...$e(u,p.issues)),i.value[f]=p.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:c,continue:!0})}return a.length?Promise.all(a).then(()=>i):i}}),Vl=v("$ZodMap",(t,e)=>{C.init(t,e);let r=ae.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),i;let a=[];i.value=r?r.alloc(t,i,new Map,n):new Map;for(let[s,c]of o){let u=e.keyType._zod.run({value:s,issues:[]},n),l=e.valueType._zod.run({value:c,issues:[]},n);u instanceof Promise||l instanceof Promise?a.push(Promise.all([u,l]).then(([d,f])=>{qg(d,f,i,s,o,t,n)})):qg(u,l,i,s,o,t,n)}return a.length?Promise.all(a).then(()=>i):i}});function qg(t,e,r,i,n,o,a){t.issues.length&&(xr.has(typeof i)?r.issues.push(...$e(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(s=>be(s,a,Q()))})),e.issues.length&&(xr.has(typeof i)?r.issues.push(...$e(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(s=>be(s,a,Q()))})),r.value.set(t.value,e.value)}var Rl=v("$ZodSet",(t,e)=>{C.init(t,e);let r=ae.memoizer;r?.attach(t),t._zod.parse=(i,n)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),i;let a=[];i.value=r?r.alloc(t,i,new Set,n):new Set;for(let s of o){let c=e.valueType._zod.run({value:s,issues:[]},n);c instanceof Promise?a.push(c.then(u=>Jg(u,i))):Jg(c,i)}return a.length?Promise.all(a).then(()=>i):i}});function Jg(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var Fl=v("$ZodEnum",(t,e)=>{C.init(t,e);let r=_r(e.entries),i=new Set(r);t._zod.values=i;let n=r.filter(o=>xr.has(typeof o));t._zod.pattern=new RegExp(n.length?`^(${n.map(o=>De(o.toString())).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(o,a)=>{let s=o.value;return i.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:t}),o}}),ql=v("$ZodLiteral",(t,e)=>{C.init(t,e);let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(e.values.length?`^(${e.values.map(i=>typeof i=="string"?De(i):i?De(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$"),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}}),Jl=v("$ZodFile",(t,e)=>{C.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}}),Kl=v("$ZodTransform",(t,e)=>{C.init(t,e),t._zod.optin="optional",ae.memoizer?.guard(t),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new ft(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new _e;return r.value=n,r}});function Kg(t,e){return t.value=e.issues.length?void 0:e.value,t}var Vo=v("$ZodOptional",(t,e)=>{C.init(t,e),Z(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",Z(t,"values",r=>{let i=r.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Z(t,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${wr(i.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(r.value===void 0){if(e.innerType._zod.optin!=="defaulted")return r;let n=e.innerType._zod.run({value:r.value,issues:[]},i);return n instanceof Promise?n.then(o=>Kg(r,o)):Kg(r,n)}return e.innerType._zod.run(r,i)}}),Bl=v("$ZodExactOptional",(t,e)=>{Vo.init(t,e),Z(t,"values",r=>r.def.innerType._zod.values),Z(t,"pattern",r=>r.def.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),Wl=v("$ZodNullable",(t,e)=>{C.init(t,e),Z(t,"optin",r=>r.def.innerType._zod.optin),Z(t,"optout",r=>r.def.innerType._zod.optout),Z(t,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${wr(i.source)}|null)$`):void 0}),Z(t,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),Gl=v("$ZodDefault",(t,e)=>{C.init(t,e),t._zod.optin="defaulted",Z(t,"values",r=>r.def.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=>Bg(o,e)):Bg(n,e)}});function Bg(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var Hl=v("$ZodPrefault",(t,e)=>{C.init(t,e),t._zod.optin="defaulted",Z(t,"values",r=>r.def.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))}),Yl=v("$ZodNonOptional",(t,e)=>{C.init(t,e),Z(t,"values",r=>{let i=r.def.innerType._zod.values;return i?new Set([...i].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Wg(o,t)):Wg(n,t)}});function Wg(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 Xl=v("$ZodSuccess",(t,e)=>{C.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new ft("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)}});function Gg(t,e,r,i){return e.issues.length?(t.value=r.catchValue({...e,value:t.value,error:{issues:e.issues.map(n=>be(n,i,Q()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}var Ql=v("$ZodCatch",(t,e)=>{C.init(t,e),Z(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Z(t,"optout",r=>r.def.innerType._zod.optout),Z(t,"values",r=>r.def.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({value:r.value,issues:[]},i);return n instanceof Promise?n.then(o=>Gg(r,o,e,i)):Gg(r,n,e,i)}}),ed=v("$ZodNaN",(t,e)=>{C.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)}),Ro=v("$ZodPipe",(t,e)=>{C.init(t,e),Z(t,"values",r=>r.def.in._zod.values),Z(t,"optin",r=>r.def.in._zod.optin),Z(t,"optout",r=>r.def.out._zod.optout),Z(t,"propValues",r=>r.def.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(a=>xo(a,e.in,i)):xo(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>xo(o,e.out,i)):xo(n,e.out,i)}});function xo(t,e,r){return t.issues.some(i=>i.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}var Lr=v("$ZodCodec",(t,e)=>{C.init(t,e),Z(t,"values",r=>r.def.in._zod.values),Z(t,"optin",r=>r.def.in._zod.optin),Z(t,"optout",r=>r.def.out._zod.optout),Z(t,"propValues",r=>r.def.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(a=>Io(a,e,i)):Io(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(a=>Io(a,e,i)):Io(o,e,i)}}});function Io(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=>Oo(t,o,e.out,r)):Oo(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>Oo(t,o,e.in,r)):Oo(t,n,e.in,r)}}function Oo(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}var td=v("$ZodPreprocess",(t,e)=>{Ro.init(t,e)}),nd=v("$ZodReadonly",(t,e)=>{C.init(t,e),Z(t,"propValues",r=>r.def.innerType._zod.propValues),Z(t,"values",r=>r.def.innerType._zod.values),Z(t,"optin",r=>r.def.innerType?._zod?.optin),Z(t,"optout",r=>r.def.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(Hg):Hg(n)}});function Hg(t){return t.memo||(t.value=Object.freeze(t.value)),t}var rd=v("$ZodTemplateLiteral",(t,e)=>{C.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,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,a))}else if(i===null||Ec.has(typeof i))r.push(De(`${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)}),id=v("$ZodFunction",(t,e)=>(C.init(t,e),Object.defineProperty(t,"_def",{value:e}),t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let n=t._def.input?co(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?co(t._def.output,o):o},"_zod",{value:t._zod,enumerable:!1})},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let n=t._def.input?await uo(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await uo(t._def.output,o):o},"_zod",{value:t._zod,enumerable:!1})},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 Mo({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)),od=v("$ZodPromise",(t,e)=>{C.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),Zr=v("$ZodLazy",(t,e)=>{C.init(t,e),Nc(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Z(t,"pattern",r=>r.innerType?._zod?.pattern),Z(t,"propValues",r=>r.innerType?._zod?.propValues),Z(t,"optin",r=>r.innerType?._zod?.optin??void 0),Z(t,"optout",r=>r.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),ad=v("$ZodCustom",(t,e)=>{W.init(t,e),C.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=>Yg(o,r,i,t));Yg(n,r,i,t)}});function Yg(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(bn(n))}}var Jo=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},cd="~memo",nv=[];function sd(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var rv=new WeakMap;function ud(t,e){let r=rv.get(t);if(r!==void 0)return r;if(e.has(t))return!0;e.add(t);let i=!1,n=s=>{!i&&s?._zod&&ud(s,e)&&(i=!0)},o=t._zod.def,a=o.type;switch(a){case"object":{for(let s of Reflect.ownKeys(o.shape))n(o.shape[s]);n(o.catchall);break}case"array":n(o.element);break;case"tuple":for(let s of o.items)n(s);n(o.rest);break;case"record":case"map":n(o.keyType),n(o.valueType);break;case"set":n(o.valueType);break;case"union":for(let s of o.options)n(s);break;case"intersection":n(o.left),n(o.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":n(o.innerType);break;case"pipe":n(o.in),n(o.out);break;case"function":n(o.input),n(o.output);break;case"lazy":n(t._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let s in o){let c=Object.getOwnPropertyDescriptor(o,s);if(!c||c.get)continue;let u=c.value;if(!(!u||typeof u!="object")){if(u._zod)n(u);else if(Array.isArray(u))for(let l of u)n(l)}}}return e.delete(t),rv.set(t,i),i}function ld(t){return ud(t,new Set)}function Ox(t,e){let r=t.buckets.get(e);return r||(r=new Map,t.buckets.set(e,r)),r}var Fo,qo=[],zx={alloc(t,e,r){let i=Fo;if(!i)return r;Fo=void 0;let n={value:r,issues:null};return i.set(e.value,n),qo.push(n),r},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let r=t._zod.parse,i=(n,o)=>{if(o.direction!=="backward"&&Ko(o,n.value))throw new Jo;return r(n,o)};t._zod.parse=i,t._zod.run===r&&(t._zod.run=i)})},attach(t){var e;let r,i,n;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let o=t._zod.parse,a=(s,c)=>{if(r===void 0&&(r=ud(t,new Set),!r))return t._zod.parse=o,t._zod.run===a&&(t._zod.run=o),o(s,c);let u=s.value;if(u===null||typeof u!="object")return o(s,c);let l=c[cd];l||(l={buckets:new Map,backEdges:void 0},c[cd]=l);let d;i===c?d=n:(d=Ox(l,t),i=c,n=d);let f=d.get(u);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...sd(f.issues)):(s.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(f.value)),s;Fo=d;let p=qo.length,m=o(s,c);Fo=void 0;let h=qo.length>p?qo.pop():void 0;return m instanceof Promise?m.then(g=>(h&&(h.issues=g.issues.length?sd(g.issues):nv),g)):(h&&(h.issues=m.issues.length?sd(m.issues):nv),m)};t._zod.parse=a,t._zod.run===o&&(t._zod.run=a)})}};function Mr(){return zx}function Ko(t,e){let r=t[cd]?.backEdges;return r!==void 0&&e!==null&&typeof e=="object"&&r.has(e)}var Rr={};Xe(Rr,{ar:()=>iv,az:()=>ov,be:()=>sv,bg:()=>cv,bn:()=>uv,ca:()=>lv,ckb:()=>dv,cs:()=>fv,da:()=>pv,de:()=>mv,el:()=>hv,en:()=>Bo,eo:()=>gv,es:()=>vv,fa:()=>yv,fi:()=>$v,fr:()=>bv,frCA:()=>_v,gu:()=>wv,he:()=>kv,hi:()=>Sv,hr:()=>xv,hu:()=>Iv,hy:()=>zv,id:()=>Pv,is:()=>Nv,it:()=>Av,ja:()=>jv,ka:()=>Ev,kh:()=>Dv,km:()=>Wo,kn:()=>Cv,ko:()=>Tv,lt:()=>Lv,mk:()=>Zv,ms:()=>Mv,ne:()=>Vv,nl:()=>Rv,nn:()=>Fv,no:()=>qv,ota:()=>Jv,pl:()=>Bv,ps:()=>Kv,pt:()=>Wv,ptBR:()=>Gv,ro:()=>Hv,ru:()=>Xv,sk:()=>Qv,sl:()=>ey,sv:()=>ty,ta:()=>ny,th:()=>ry,tk:()=>iy,tr:()=>oy,ua:()=>ay,uk:()=>Go,ur:()=>sy,uz:()=>cy,vi:()=>uy,yo:()=>fy,zhCN:()=>ly,zhTW:()=>dy});var Px=()=>{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"},map:{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",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",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",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${$(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: ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${y(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 iv(){return{localeError:Px()}}var Nx=()=>{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"},map:{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",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",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${$(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${y(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 ov(){return{localeError:Nx()}}function av(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}var Ax=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),c=av(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),c=av(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${y(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 sv(){return{localeError:Ax()}}var jx=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${y(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 cv(){return{localeError:jx()}}var Ex=()=>{let t={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function e(n){return t[n]??null}let r={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${s}`}case"invalid_value":return n.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${$(n.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${y(n.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${n.origin??"\u09AE\u09BE\u09A8"} ${o}${n.maximum.toString()} ${a.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${n.origin??"\u09AE\u09BE\u09A8"} ${o}${n.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${n.origin} ${o}${n.minimum.toString()} ${a.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${n.origin} ${o}${n.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${n.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${n.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${n.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function uv(){return{localeError:Ex()}}var Dx=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{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",mac:"adre\xE7a MAC",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",credit_card:"n\xFAmero de targeta de cr\xE8dit",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${$(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${y(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=e(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${y(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 lv(){return{localeError:Dx()}}var Cx=()=>{let t={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function e(n){return t[n]??null}let r={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(l=>s.endsWith(l))?"\u06CC\u06D5":"\u06D5",u=/^[a-zA-Z]+$/.test(s);return a==="null"||a==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${s}${u?"":c}`}case"invalid_value":return n.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${$(n.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${y(n.values,"|")}`;case"too_big":{let o=e(n.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${n.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${n.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=e(n.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${n.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${n.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${r[o.format]??n.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${n.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${y(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${n.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function dv(){return{localeError:Cx()}}var Tx=()=>{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"},map:{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",mac:"MAC 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",credit_card:"\u010D\xEDslo kreditn\xED karty",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${$(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${y(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 fv(){return{localeError:Tx()}}var Ux=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${$(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin),s=i[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin),s=i[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${y(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 pv(){return{localeError:Ux()}}var Lx=()=>{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"},map:{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",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${$(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${y(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 mv(){return{localeError:Lx()}}var Zx=()=>{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",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",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,a=_(n.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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()} ${a.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?">=":">",a=e(n.origin);return a?`\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()} ${a.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"}: ${y(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 hv(){return{localeError:Zx()}}var Mx=()=>{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(o){return t[o]??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",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function n(o,a){return o==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):i[o]??o}return o=>{switch(o.code){case"invalid_type":{let a=n(o.expected),s=_(o.input),c=n(s,o.input);return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${$(o.values[0])}`:`Invalid option: expected one of ${y(o.values,"|")}`;case"too_big":{let a=o.exact?"exactly ":o.inclusive?"<=":"<",s=e(o.origin);return s?`Too big: expected ${o.origin??"value"} to have ${a}${o.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${a}${o.maximum.toString()}`}case"too_small":{let a=o.exact?"exactly ":o.inclusive?">=":">",s=e(o.origin);return s?`Too small: expected ${o.origin} to have ${a}${o.minimum.toString()} ${s.unit}`:`Too small: expected ${o.origin} to be ${a}${o.minimum.toString()}`}case"invalid_format":{let a=o;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${y(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(s=>`'${s}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Bo(){return{localeError:Mx()}}var Vx=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{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",mac:"MAC-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",credit_card:"kreditkarta numero",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${$(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${y(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 gv(){return{localeError:Vx()}}var Rx=()=>{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",mac:"direcci\xF3n MAC",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",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${$(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin),s=i[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${o}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${y(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 vv(){return{localeError:Rx()}}var Fx=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${$(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 ${y(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${y(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 yv(){return{localeError:Fx()}}var qx=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},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",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${$(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${y(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 $v(){return{localeError:qx()}}var Jx=()=>{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:"expression r\xE9guli\xE8re",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",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",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:"record",map:"map",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,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instance de ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${$(n.values[0])} attendu`:`Option invalide : une valeur parmi ${y(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Trop grand : ${i[n.origin]??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Trop petit : ${i[n.origin]??"valeur"} doit ${a.verb} ${o}${n.minimum.toString()} ${a.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 de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res 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":""} : ${y(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 bv(){return{localeError:Jx()}}var Kx=()=>{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"},map:{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",mac:"adresse MAC",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",credit_card:"num\xE9ro de carte de cr\xE9dit",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${$(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=e(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=e(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${y(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 _v(){return{localeError:Kx()}}var Bx=()=>{let t={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function e(n){return t[n]??null}let r={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${s}`}case"invalid_value":return n.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${$(n.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${y(n.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${n.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${n.maximum.toString()} ${a.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${n.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${n.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${n.origin} ${o}${n.minimum.toString()} ${a.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${n.origin} ${o}${n.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${n.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${n.keys.length>1?"\u0A93":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${n.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function wv(){return{localeError:Bx()}}var Wx=()=>{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=u=>u?t[u]:void 0,i=u=>{let l=r(u);return l?l.label:u??t.unknown.label},n=u=>`\u05D4${i(u)}`,o=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?e[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",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"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",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"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let l=u.expected,d=c[l??""]??i(l),f=_(u.input),p=c[f]??t[f]?.label??f;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${$(u.values[0])}`;let l=u.values.map(p=>$(p));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;let d=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let l=a(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=u.inclusive?`${u.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=u.inclusive?"<=":"<",p=o(u.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${u.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${u.maximum.toString()}`}case"too_small":{let l=a(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let m=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(u.origin==="array"||u.origin==="set"){let m=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let g=(u.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 ${g}`}let h=u.inclusive?`${u.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=u.inclusive?">=":">",p=o(u.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${u.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${u.minimum.toString()}`}case"invalid_format":{let l=u;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;let d=s[l.format],f=d?.label??l.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${y(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function kv(){return{localeError:Wx()}}var Gx=()=>{let t={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function e(n){return t[n]??null}let r={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${s}`}case"invalid_value":return n.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${$(n.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${n.maximum} ${a.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin??"\u092E\u093E\u0928"} ${o}${n.maximum} \u0939\u094B`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin} \u092E\u0947\u0902 ${o}${n.minimum} ${a.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin} ${o}${n.minimum} \u0939\u094B`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${n.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${n.keys.length>1?"\u092F\u093E\u0901":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${n.origin} \u092E\u0947\u0902`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${n.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function Sv(){return{localeError:Gx()}}var Hx=()=>{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",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",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,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${$(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin),s=i[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${o}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin),s=i[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${o}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} 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"}: ${y(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 xv(){return{localeError:Hx()}}var Yx=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{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",mac:"MAC 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",credit_card:"hitelk\xE1rtyasz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${$(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${y(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 Iv(){return{localeError:Yx()}}function Ov(t,e,r){return Math.abs(t)===1?e:r}function On(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 Xx=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),c=Ov(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${On(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 ${On(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),c=Ov(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${On(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 ${On(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":""}. ${y(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${On(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 ${On(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function zv(){return{localeError:Xx()}}var Qx=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{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",mac:"alamat MAC",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",credit_card:"nomor kartu kredit",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${$(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${y(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 Pv(){return{localeError:Qx()}}var eI=()=>{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"},map:{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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${$(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${y(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 Nv(){return{localeError:eI()}}var tI=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{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",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${$(n.values[0])}`:`Opzione non valida: atteso uno tra ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`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"}: ${y(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 Av(){return{localeError:tI()}}var nI=()=>{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"},map:{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",mac:"MAC\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",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${$(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${y(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${y(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 jv(){return{localeError:nI()}}var rI=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \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,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${$(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 ${y(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \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"}: ${y(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 Ev(){return{localeError:rI()}}var iI=()=>{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"},map:{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",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",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",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${y(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 Wo(){return{localeError:iI()}}function Dv(){return Wo()}var oI=()=>{let t={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function e(n){return t[n]??null}let r={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",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 \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${$(n.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${n.maximum.toString()} ${a.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${n.minimum.toString()} ${a.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${n.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${n.keys.length>1?"s":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${n.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function Cv(){return{localeError:oI()}}var aI=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${$(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${y(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${y(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 Tv(){return{localeError:aI()}}var Vr=t=>t.charAt(0).toUpperCase()+t.slice(1);function Uv(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 sI=()=>{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,a,s){let c=t[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC 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",credit_card:"kredito kortel\u0117s numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${$(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${y(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,a=e(n.origin,Uv(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Vr(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Vr(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,a=e(n.origin,Uv(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Vr(o??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Vr(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${y(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`${Vr(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Lv(){return{localeError:sI()}}var cI=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${y(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 Zv(){return{localeError:cI()}}var uI=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{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",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${$(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${y(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 Mv(){return{localeError:uI()}}var lI=()=>{let t={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function e(n){return t[n]??null}let r={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${s}`}case"invalid_value":return n.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${$(n.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${n.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${n.maximum.toString()} ${a.unit} ${a.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${n.origin??"\u092E\u093E\u0928"} ${o}${n.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${n.origin} \u092E\u093E ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${n.origin} ${o}${n.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${n.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${n.keys.length>1?"\u0939\u0930\u0942":""}: ${y(n.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${n.origin} \u092E\u093E`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${n.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function Vv(){return{localeError:lI()}}var dI=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{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",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${$(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${y(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 Rv(){return{localeError:dI()}}var fI=()=>{let t={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};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-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventa instanceof ${n.expected}, fekk ${s}`:`Ugyldig input: forventa ${o}, fekk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventa ${$(n.values[0])}`:`Ugyldig val: forventa eitt av ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventa ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`For stor(t): forventa ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventa ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventa ${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 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${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 tal: m\xE5 vere eit multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${y(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 Fv(){return{localeError:fI()}}var pI=()=>{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"},map:{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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${$(n.values[0])}`:`Ugyldig valg: forventet en av ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${y(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 qv(){return{localeError:pI()}}var mI=()=>{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"},map:{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",mac:"MAC 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",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${$(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${y(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 Jv(){return{localeError:mI()}}var hI=()=>{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"},map:{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",mac:"\u062F MAC \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",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${$(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${y(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${y(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 Kv(){return{localeError:hI()}}var gI=()=>{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"},map:{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",mac:"adres MAC",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",credit_card:"numer karty kredytowej",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${$(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${y(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 Bv(){return{localeError:gI()}}var vI=()=>{let t={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function e(a){return t[a]??null}let r={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},n={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(a,s){let c=n[a]??{name:`valor "${a}"`,articles:i.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=o(a.expected,"indefinite"),c=_(a.input),u=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${s}, recebeu ${u}`}case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: esperava ${$(a.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${y(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=e(a.origin);return c?`Demasiado grande: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=e(a.origin);return c?`Demasiado pequeno: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`Formato d${r[s.format]??a.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inv\xE1lida${s}: ${y(a.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function Wv(){return{localeError:vI()}}var yI=()=>{let t={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function e(a){return t[a]??null}let r={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},n={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(a,s){let c=n[a]??{name:`valor "${a}"`,articles:i.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=o(a.expected,"indefinite"),c=_(a.input),u=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${s}, recebeu ${u}`}case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: esperava ${$(a.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${y(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=e(a.origin);return c?`Grande demais: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=e(a.origin);return c?`Pequeno demais: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`Formato d${r[s.format]??a.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inv\xE1lida${s}: ${y(a.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function Gv(){return{localeError:yI()}}var $I=()=>{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",credit_card:"num\u0103r de card de credit",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,a=_(n.input),s=i[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${$(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.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: ${y(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 Hv(){return{localeError:$I()}}function Yv(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}var bI=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),c=Yv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),c=Yv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${y(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 Xv(){return{localeError:bI()}}var _I=()=>{let t={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function e(n){return t[n]??null}let r={regex:"regul\xE1rny 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:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${n.expected}, obdr\u017Ean\xE9 ${s}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${$(n.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${n.origin??"hodnota"} mus\xED ma\u0165 ${o}${n.maximum.toString()} ${a.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${n.origin??"hodnota"} mus\xED by\u0165 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Hodnota je pr\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED ma\u0165 ${o}${n.minimum.toString()} ${a.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED by\u0165 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${y(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\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 Qv(){return{localeError:_I()}}var wI=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{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",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${$(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${y(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 ey(){return{localeError:wI()}}var kI=()=>{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"},map:{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-adress",ipv6:"IPv6-adress",mac:"MAC-adress",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",credit_card:"kreditkortsnummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${$(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${y(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 ty(){return{localeError:kI()}}var SI=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${$(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 ${y(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${y(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 ny(){return{localeError:SI()}}var xI=()=>{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"},map:{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",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",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)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${y(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 ry(){return{localeError:xI()}}var II=()=>{let t={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function e(n){return t[n]??null}let r={regex:"giri\u015F",email:"e-po\xE7ta salgysy",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 sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${s} alyndy`}case"invalid_value":return n.values.length===1?`N\xE4dogry baha: ${$(n.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Has uly: gara\u015Fyl\xFDan ${n.origin??"baha"} ${o} ${n.maximum.toString()} ${a.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${n.origin??"baha"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Has ki\xE7i: gara\u015Fyl\xFDan ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xE4dogry san: ${n.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${n.keys.length>1?"lar":""}: ${y(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${n.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function iy(){return{localeError:II()}}var OI=()=>{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"},map:{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",mac:"MAC 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",credit_card:"kredi kart\u0131 numaras\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${$(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${y(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 oy(){return{localeError:OI()}}var zI=()=>{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"},map:{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",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${y(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 Go(){return{localeError:zI()}}function ay(){return Go()}var PI=()=>{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"},map:{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",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \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",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${$(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${y(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${y(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 sy(){return{localeError:PI()}}var NI=()=>{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",credit_card:"kredit karta raqami",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${$(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${y(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 cy(){return{localeError:NI()}}var AI=()=>{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"},map:{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",mac:"\u0111\u1ECBa ch\u1EC9 MAC",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",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${$(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 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${y(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 uy(){return{localeError:AI()}}var jI=()=>{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"},map:{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",mac:"MAC\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",credit_card:"\u4FE1\u7528\u5361\u53F7",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${$(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${y(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 ly(){return{localeError:jI()}}var EI=()=>{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"},map:{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",mac:"MAC \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",credit_card:"\u4FE1\u7528\u5361\u865F",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${$(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${y(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 dy(){return{localeError:EI()}}var DI=()=>{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"},map:{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",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",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",credit_card:"n\u1ECDmba kaadi gbese",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,a=_(n.input),s=i[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${$(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${y(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${y(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 fy(){return{localeError:DI()}}var py,dd=Symbol("ZodOutput"),fd=Symbol("ZodInput"),Ho=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 Yo(){return new Ho}(py=globalThis).__zod_globalRegistry??(py.__zod_globalRegistry=Yo());var ce=globalThis.__zod_globalRegistry;var Ne=Symbol.for("zod.compile.invalid"),my=Symbol.for("zod.compile.fallback"),Ze=class extends Error{constructor(e="z.compile does not support async refinements, transforms, or checks"){super(e),this.name="ZodCompileAsyncError"}},M=class extends Error{constructor(e,r=!0){super(`z.compile does not support ${e}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};function TI(t,e){try{return Xo(t,{assertOnly:!0})}catch{return e}}function gd(t,e){try{let r=Xo(t),i=F(t),n=t._zod.run,o=n.__originalRun??n,a=(s,c)=>{if(c?.async||c?.direction==="backward"||c?.skipChecks||c?.[my]||c&&Ko(c,s.value))return o(s,c);let u=r(s.value);return u!==Ne?(s.value=u,s):(c&&(c[my]=!0),o(s,c))};return a.__originalRun=o,i._zod.bag.fallbackRun=o,i._zod.bag.validator=TI(t,r),i._zod.run=a,n.__originalRun||UI(i,t,r),i}catch(r){if(e?.strict)throw r;return t}}function UI(t,e,r){let i=t,n=e;if(typeof n.safeParse=="function"){let o=n.safeParse;i.safeParse=(a,s)=>{let c=r(a);return c!==Ne?{success:!0,data:c}:o(a,s)}}if(typeof n.parse=="function"){let o=n.parse;i.parse=(a,s)=>{let c=r(a);return c!==Ne?c:o(a,s)}}}function Xo(t,e){let r=!0;try{r=ld(t)}catch{}if(r)throw new M("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0},n=new Rt(["input"]),o=H(n,i,t,"input",!e?.assertOnly);n.write(o===null?"return true;":`return ${o};`);let a=["INVALID",...i.constants.keys()],s=[Ne,...i.constants.values()],c=n.content.join(`
|
|
219
|
+
`),u=e?.debug?a.length>0?`// Constants: ${a.join(", ")}
|
|
220
|
+
${c}`:c:"",l=Function,d=`return (input) => {
|
|
221
|
+
${c}
|
|
222
|
+
}`,f;try{f=new l(...a,d)(...s)}catch(p){throw new M(`this schema (generated code failed to evaluate: ${p.message})`)}return e?.debug&&(f.code=u),f}function j(t,e){for(let[i,n]of t.constants)if(n===e)return i;let r=`c${t.constantCounter++}`;return t.constants.set(r,e),r}function E(t){return`v${t.varCounter++}`}function LI(t,e){let r=t._zod.run({value:e,issues:[]},{});if(r&&typeof r.then=="function")return Ne;let i=r;return i.issues.length===0?i.value:Ne}function me(t,e,r,i,n=!0){let o=t.content.length,a=e.constants.size,s=e.constantCounter,c=e.varCounter;try{return H(t,e,r,i,n)}catch(u){if(!(u instanceof M)||!u.islandable)throw u;if(t.content.length=o,e.constants.size>a){let l=Array.from(e.constants.keys()).slice(a);for(let d of l)e.constants.delete(d)}return e.constantCounter=s,e.varCounter=c,ZI(t,e,r,i)}}function ZI(t,e,r,i){let n=j(e,r),o=j(e,LI),a=E(e);return t.write(`const ${a} = ${o}(${n}, ${i});`),t.write(`if (${a} === INVALID) return INVALID;`),a}var MI=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function VI(t,e,r,i){let n=r._zod.def.checks;if(!n||n.length===0)return i;let o=i;for(let a of n){let s=a._zod.def;if(s.when&&!MI.has(s.check))throw new M('check with a custom "when" condition');switch(s.check){case"greater_than":RI(t,e,s,o);break;case"less_than":FI(t,e,s,o);break;case"multiple_of":qI(t,e,s,o);break;case"number_format":yy(t,s,o);break;case"min_length":{let c=qt(s.minimum,"min_length"),u=pd(t,e,o,`${o}.length >= ${c} && ${o}.length < ${s.minimum*2}`);t.write(`if (${u} < ${c}) return INVALID;`);break}case"max_length":{let c=qt(s.maximum,"max_length"),u=pd(t,e,o,`${o}.length > ${c}`);t.write(`if (${u} > ${c}) return INVALID;`);break}case"length_equals":{let c=qt(s.length,"length_equals"),u=pd(t,e,o,`${o}.length >= ${c} && ${o}.length <= ${s.length*2}`);t.write(`if (${u} !== ${c}) return INVALID;`);break}case"min_size":t.write(`if (${o}.size < ${qt(s.minimum,"min_size")}) return INVALID;`);break;case"max_size":t.write(`if (${o}.size > ${qt(s.maximum,"max_size")}) return INVALID;`);break;case"size_equals":t.write(`if (${o}.size !== ${qt(s.size,"size_equals")}) return INVALID;`);break;case"string_format":o=$y(t,e,s,o);break;case"custom":o=GI(t,e,a,o);break;case"bigint_format":JI(t,s,o);break;case"mime_type":KI(t,e,s,o);break;case"property":BI(t,e,s,o);break;case"overwrite":{let c=E(e);WI(t,e,a,o,c),o=c;break}default:throw new M(`check type ${s.check}`)}}return o}function pd(t,e,r,i){let n=j(e,Mt),o=E(e);return t.write(`const ${o} = typeof ${r} === "string" && ${i} ? ${n}(${r}) : ${r}.length;`),o}function qt(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new M(`${e} bound of type ${typeof t}`);return`${t}`}function vy(t,e){if(typeof e=="bigint")return`${e}n`;if(typeof e=="number"){if(Number.isNaN(e))throw new M("comparison check with NaN bound");return`${e}`}if(e instanceof Date){if(Number.isNaN(e.getTime()))throw new M("comparison check with Invalid Date bound");return j(t,e)}throw new M(`comparison check bound of type ${typeof e}`)}function RI(t,e,r,i){let n=r.inclusive?"<":"<=";t.write(`if (${i} ${n} ${vy(e,r.value)}) return INVALID;`)}function FI(t,e,r,i){let n=r.inclusive?">":">=";t.write(`if (${i} ${n} ${vy(e,r.value)}) return INVALID;`)}function qI(t,e,r,i){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new M("multiple_of check with a zero divisor");t.write(`if (${i} % ${r.value}n !== 0n) return INVALID;`)}else{let n=j(e,kr);t.write(`if (${n}(${i}, ${qt(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function yy(t,e,r){let i=e.format;switch(i){case"safeint":t.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":t.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":t.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":t.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":t.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new M(`number format ${i}`)}}function JI(t,e,r){let i=e.format;if(i)switch(i){case"int64":t.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new M(`bigint format ${i}`)}}function KI(t,e,r,i){let n=r.mime;if(n&&n.length>0){let o=j(e,new Set(n));t.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function BI(t,e,r,i){let n=`${i}[${JSON.stringify(r.property)}]`;H(t,e,r.schema,n)}function WI(t,e,r,i,n){let o=r._zod.def.tx;if(!o)throw new M("overwrite check without a transform function");if(Bt(o))throw new Ze("z.compile: async overwrite transforms are not supported");let a=j(e,o);t.write(`const ${n} = ${a}(${i});`)}function md(){throw new _e}function vd(t){this.issues.push(t)}function GI(t,e,r,i){let n=r._zod.def;if(n.fn){if(Bt(n.fn))throw new Ze("z.compile: async .refine() predicates are not supported");let o=j(e,n.fn),a=j(e,md),s=E(e);return t.write(`const ${s} = ${o}(${i});`),t.write(`if (${s} instanceof Promise) ${a}();`),t.write(`if (!${s}) return INVALID;`),i}if(r._zod.check){if(Bt(r._zod.check))throw new Ze("z.compile: async .superRefine() / check functions are not supported");let o=r._zod.check,s=j(e,u=>{let l={value:u,issues:[],addIssue:vd};return o(l)instanceof Promise&&md(),l.issues.length===0?l.value:Ne}),c=E(e);return t.write(`const ${c} = ${s}(${i});`),t.write(`if (${c} === INVALID) return INVALID;`),c}throw new M("custom check without a predicate or check function")}var HI=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function $y(t,e,r,i){let n=r.format;if(n==="base64"){let c=j(e,Cr);return t.write(`if (!${c}(${i})) return INVALID;`),i}if(n==="base64url"){let c=j(e,Co);return t.write(`if (!${c}(${i})) return INVALID;`),i}if(n==="jwt"){let c=j(e,Uo),u=j(e,r.alg??null);return t.write(`if (!${c}(${i}, ${u})) return INVALID;`),i}if(n==="ipv6"){let c=j(e,Dr);return t.write(`if (!${c}(${i})) return INVALID;`),i}if(n==="cidrv6"){let c=j(e,Do);return t.write(`if (!${c}(${i})) return INVALID;`),i}if(n==="credit_card"){let c=j(e,To);return t.write(`if (!${c}(${i})) return INVALID;`),i}let o=r;if(n==="url"||n==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let c=j(e,No),u=j(e,r),l=E(e),d=E(e);if(t.write(`const ${l} = ${i}.trim();`),t.write(`const ${d} = ${c}(${l}, ${u});`),t.write(`if (typeof ${d} === "number") return INVALID;`),o.hostname!==void 0){let m=j(e,jo);t.write(`if (!${m}(${d}, ${u}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=j(e,Eo);t.write(`if (!${m}(${d}, ${u}.protocol)) return INVALID;`)}let f=E(e),p=o.normalize?`${d}.href`:`${j(e,Ao)}(${l})`;return t.write(`const ${f} = ${p};`),f}let a=r.fn;if(a){if(Bt(a))throw new M(`async string format ${n}`);let c=j(e,a);return t.write(`if (!${c}(${i})) return INVALID;`),i}if(HI.has(n)&&r.pattern){let c=j(e,r.pattern);return t.write(`${c}.lastIndex = 0;`),t.write(`if (!${c}.test(${i})) return INVALID;`),i}let s=r.format;switch(s){case"regex":throw new M("regex format without a pattern");case"lowercase":t.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":t.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":t.write(`if (!${i}.includes(${ye(r.includes)})) return INVALID;`);break;case"starts_with":{let c=r.prefix;t.write(`if (${i}.slice(0, ${c.length}) !== ${ye(c)}) return INVALID;`);break}case"ends_with":{let c=r.suffix;t.write(`if (${i}.slice(-${c.length}) !== ${ye(c)}) return INVALID;`);break}default:throw new M(`string format ${s}`)}return i}function H(t,e,r,i,n=!0){let o=r._zod.def,a=o.type;if(o.coerce)throw new M(`coercion (z.coerce.${a}())`);let s=n||!!o.checks?.length,c;switch(a){case"string":c=YI(t,e,r,i);break;case"number":c=XI(t,r,i);break;case"boolean":c=QI(t,i);break;case"bigint":c=eO(t,r,i);break;case"symbol":c=tO(t,i);break;case"undefined":c=nO(t,i);break;case"null":c=rO(t,i);break;case"any":case"unknown":c=i;break;case"never":t.write("return INVALID;"),c=i;break;case"void":c=iO(t,i);break;case"nan":c=oO(t,i);break;case"date":c=aO(t,i);break;case"object":c=sO(t,e,r,i,s);break;case"optional":c=cO(t,e,r,i,s);break;case"nullable":c=dO(t,e,r,i,s);break;case"array":c=fO(t,e,r,i,s);break;case"literal":c=pO(t,e,r,i);break;case"enum":c=mO(t,e,r,i);break;case"readonly":{let u=hy(t,e,r,i),l=E(e);t.write(`const ${l} = Object.freeze(${u});`),c=l;break}case"success":hy(t,e,r,i),c="true";break;case"default":case"prefault":c=hO(t,e,r,i);break;case"nonoptional":c=gO(t,e,r,i);break;case"tuple":c=vO(t,e,r,i);break;case"union":c=yO(t,e,r,i);break;case"intersection":c=_O(t,e,r,i);break;case"record":c=wO(t,e,r,i);break;case"map":c=SO(t,e,r,i);break;case"set":c=xO(t,e,r,i);break;case"file":c=IO(t,i);break;case"template_literal":c=OO(t,e,r,i);break;case"lazy":c=zO(t,e,r,i);break;case"pipe":c=PO(t,e,r,i);break;case"custom":c=NO(t,e,r,i);break;case"transform":c=EO(t,e,r,i);break;case"catch":c=jO(t,e,r,i);break;default:throw new M(`schema type ${a}`)}return c===null?null:VI(t,e,r,c)}function YI(t,e,r,i){t.write(`if (typeof ${i} !== "string") return INVALID;`);let n=r._zod.def;return n.format===void 0?i:$y(t,e,n,i)}function XI(t,e,r){t.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let i=e._zod.def;return i.check==="number_format"&&i.format&&yy(t,{format:i.format},r),r}function QI(t,e){return t.write(`if (typeof ${e} !== "boolean") return INVALID;`),e}function eO(t,e,r){t.write(`if (typeof ${r} !== "bigint") return INVALID;`);let i=e._zod.def;if(i.format)switch(i.format){case"int64":t.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function tO(t,e){return t.write(`if (typeof ${e} !== "symbol") return INVALID;`),e}function nO(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function rO(t,e){return t.write(`if (${e} !== null) return INVALID;`),e}function iO(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}function oO(t,e){return t.write(`if (typeof ${e} !== "number" || !Number.isNaN(${e})) return INVALID;`),e}function aO(t,e){return t.write(`if (!(${e} instanceof Date) || Number.isNaN(${e}.getTime())) return INVALID;`),e}function sO(t,e,r,i,n=!0){let o=r._zod.def;t.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let a=o.shape,s=Object.keys(a),c=Object.getOwnPropertySymbols(a),u=c.length?[...s,...c]:s,l=b=>typeof b=="symbol"?j(e,b):ye(b),d=b=>typeof b=="symbol"?`[${l(b)}]`:ye(b),f=a;if(s.includes("__proto__"))throw new M('object shape key "__proto__"');let p=new Map;for(let b of u){let x=f[b],z=l(b),P=E(e);if(t.write(`const ${P} = ${i}[${z}];`),x._zod.optin!==void 0){let O=E(e);t.write(`let ${O} = (() => {`),t.indented(D=>{let w=me(D,e,x,P);D.write(`return ${w};`)}),t.write("})();"),x._zod.optout==="optional"?(t.write(`if (${O} === INVALID) {`),t.indented(D=>{D.write(`if (${z} in ${i}) return INVALID;`),D.write(`${O} = undefined;`)}),t.write("}")):t.write(`if (${O} === INVALID) return INVALID;`),p.set(b,O)}else{lO(x)&&t.write(`if (!(${z} in ${i})) return INVALID;`);let O=me(t,e,x,P,n);O!==null&&p.set(b,O)}}let m=o.catchall,h="none";if(m){let b=m._zod.def.type;if(b==="never"){let x=s.map(z=>`k !== ${ye(z)}`).join(" && ")||"true";t.write(`for (const k in ${i}) {`),t.indented(z=>{z.write(`if (${x}) return INVALID;`)}),t.write("}")}else(b==="unknown"||b==="any")&&!m._zod.def.checks?.length?h="passthrough":h="schema"}let g=E(e),S=u.some(b=>Kt(f[b])||hd(f[b]));if(!n){if(h==="schema"){let b=s.length>0?j(e,new Set(s)):null;t.write(`for (const k in ${i}) {`),t.indented(x=>{x.write('if (k === "__proto__") continue;'),b&&x.write(`if (${b}.has(k)) continue;`);let z=E(e);x.write(`const ${z} = ${i}[k];`),me(x,e,m,z,!1)}),t.write("}")}return null}if(S){t.write(`const ${g} = {};`);for(let b of u){let x=l(b),z=p.get(b);hd(f[b])?t.write(`if (${x} in ${i}) ${g}[${x}] = ${z};`):Kt(f[b])?t.write(`if (${z} !== undefined || ${x} in ${i}) ${g}[${x}] = ${z};`):t.write(`${g}[${x}] = ${z};`)}}else{let b=u.map(x=>`${d(x)}: ${p.get(x)}`).join(", ");t.write(`const ${g} = { ${b} };`)}if(h!=="none"){let b=s.length>0?j(e,new Set(s)):null;t.write(`for (const k in ${i}) {`),t.indented(x=>{if(x.write('if (k === "__proto__") continue;'),b&&x.write(`if (${b}.has(k)) continue;`),h==="passthrough")x.write(`${g}[k] = ${i}[k];`);else{let z=E(e);x.write(`const ${z} = ${i}[k];`);let P=me(x,e,m,z);x.write(`${g}[k] = ${P};`)}}),t.write("}")}return g}function cO(t,e,r,i,n=!0){let o=r._zod.def;if(uO(r))return H(t,e,o.innerType,i,n);if(o.innerType._zod.optin==="defaulted"){let s=E(e),c=E(e);return t.write(`let ${s};`),t.write(`if (${i} === undefined) {`),t.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let d=H(l,e,o.innerType,i);l.write(`return ${d};`)}),u.write("})();"),u.write(`if (${c} !== INVALID) ${s} = ${c};`)}),t.write("} else {"),t.indented(u=>{let l=H(u,e,o.innerType,i);u.write(`${s} = ${l};`)}),t.write("}"),s}let a=n?E(e):null;return a&&t.write(`let ${a};`),t.write(`if (${i} !== undefined) {`),t.indented(s=>{let c=H(s,e,o.innerType,i,n);a&&c!==null&&s.write(`${a} = ${c};`)}),t.write("}"),a}function uO(t){return t._zod.traits?.has("$ZodExactOptional")===!0}function lO(t){return t._zod.optin===void 0&&Jt(t)}function Jt(t){if(t._zod.def.coerce)return!0;let e=t._zod.def;switch(e.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return e.innerType?Jt(e.innerType):!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return e.innerType?Jt(e.innerType):!0;case"catch":return!0;case"union":return e.options?e.options.some(Jt):!0;case"intersection":return!e.left||!e.right?!0:Jt(e.left)&&Jt(e.right);case"pipe":return e.in?Jt(e.in):!0;default:return!0}}function hd(t){return t._zod.optin==="optional"&&t._zod.optout==="optional"}function Kt(t){let e=t._zod.def;switch(e.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return e.innerType?Kt(e.innerType):!0;case"union":return e.options?e.options.some(Kt):!0;case"intersection":return!e.left||!e.right||Kt(e.left)||Kt(e.right);case"pipe":return e.out?Kt(e.out):!0;default:return!0}}function dO(t,e,r,i,n=!0){let o=r._zod.def,a=n?E(e):null;return a&&t.write(`let ${a} = null;`),t.write(`if (${i} !== null) {`),t.indented(s=>{let c=H(s,e,o.innerType,i,n);a&&c!==null&&s.write(`${a} = ${c};`)}),t.write("}"),a}function fO(t,e,r,i,n=!0){let o=r._zod.def;t.write(`if (!Array.isArray(${i})) return INVALID;`);let a=n?E(e):null,s=E(e),c=E(e);return a&&t.write(`const ${a} = new Array(${i}.length);`),t.write(`for (let ${s} = 0; ${s} < ${i}.length; ${s}++) {`),t.indented(u=>{u.write(`const ${c} = ${i}[${s}];`);let l=me(u,e,o.element,c,n);a&&l!==null&&u.write(`${a}[${s}] = ${l};`)}),t.write("}"),a}function pO(t,e,r,i){let o=r._zod.def.values;if(o.length!==1){let s=j(e,new Set(o));return t.write(`if (!${s}.has(${i})) return INVALID;`),i}let a=o[0];if(typeof a=="number"&&Number.isNaN(a)){let s=j(e,new Set(o));return t.write(`if (!${s}.has(${i})) return INVALID;`),i}if(typeof a=="string")t.write(`if (${i} !== ${ye(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")t.write(`if (${i} !== ${a}) return INVALID;`);else if(a===null)t.write(`if (${i} !== null) return INVALID;`);else if(a===void 0)t.write(`if (${i} !== undefined) return INVALID;`);else if(typeof a=="bigint")t.write(`if (${i} !== ${a}n) return INVALID;`);else throw new M(`literal type ${typeof a}`);return i}function mO(t,e,r,i){let n=r._zod.values;if(!n)throw new M("enum schema without enumerated values");let o=j(e,n);return t.write(`if (!${o}.has(${i})) return INVALID;`),i}function hy(t,e,r,i){let n=r._zod.def;return H(t,e,n.innerType,i)}function hO(t,e,r,i){let n=r._zod.def,a=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!a)return H(t,e,n.innerType,i);let c=j(e,a),u=E(e);return t.write(`let ${u} = ${i};`),t.write(`if (${i} === undefined) ${u} = ${c}();`),H(t,e,n.innerType,u)}let s=E(e);if(a){let c=j(e,a),u=j(e,Sr);t.write(`let ${s};`),t.write(`if (${i} === undefined) {`),t.indented(l=>{l.write(`${s} = ${u}(${c}());`)}),t.write("} else {"),t.indented(l=>{let d=H(l,e,n.innerType,i);l.write(`${s} = ${d} === undefined ? ${u}(${c}()) : ${d};`)}),t.write("}")}else t.write(`let ${s};`),t.write(`if (${i} !== undefined) {`),t.indented(c=>{let u=H(c,e,n.innerType,i);c.write(`${s} = ${u};`)}),t.write("}");return s}function gO(t,e,r,i){let n=r._zod.def,o=H(t,e,n.innerType,i),a=E(e);return t.write(`const ${a} = ${o};`),t.write(`if (${a} === undefined) return INVALID;`),a}function vO(t,e,r,i){let n=r._zod.def,o=n.items,a=n.rest;t.write(`if (!Array.isArray(${i})) return INVALID;`);let s=gy(o,"optin"),c=gy(o,"optout");a?t.write(`if (${i}.length < ${s}) return INVALID;`):t.write(`if (${i}.length < ${s} || ${i}.length > ${o.length}) return INVALID;`);let u=E(e);t.write(`const ${u} = [];`);for(let l=0;l<o.length;l++){let d=o[l];if(l>=c)t.write(`if (${u}.length === ${l}) {`),t.indented(f=>{f.write(`if (${l} < ${i}.length) {`),f.indented(p=>{let m=E(e);p.write(`const ${m} = ${i}[${l}];`);let h=me(p,e,d,m);p.write(`${u}[${l}] = ${h};`)}),f.write("} else {"),f.indented(p=>{if(hd(d)){p.write(`${u}.length = ${l};`);return}let m=E(e),h=E(e);p.write(`const ${m} = undefined;`),p.write(`const ${h} = (() => {`),p.indented(g=>{let S=me(g,e,d,m);g.write(`return ${S};`)}),p.write("})();"),p.write(`if (${h} === INVALID || ${h} === undefined) ${u}.length = ${l};`),p.write(`else ${u}[${l}] = ${h};`)}),f.write("}")}),t.write("}");else{let f=E(e);t.write(`const ${f} = ${i}[${l}];`);let p=me(t,e,d,f);t.write(`${u}[${l}] = ${p};`)}}if(a){let l=E(e),d=E(e);t.write(`for (let ${l} = ${o.length}; ${l} < ${i}.length; ${l}++) {`),t.indented(f=>{f.write(`const ${d} = ${i}[${l}];`);let p=me(f,e,a,d);f.write(`${u}[${l}] = ${p};`)}),t.write("}")}return u}function gy(t,e){for(let r=t.length-1;r>=0;r--)if(!(e==="optin"?t[r]._zod.optin!==void 0:t[r]._zod.optout==="optional"))return r+1;return 0}function yO(t,e,r,i){let n=r._zod.def,o=n.options;if(n.discriminator)return $O(t,e,n,i);if(n.inclusive===!1)throw new M("exclusive unions (z.xor)");if(o.length===0)return t.write("return INVALID;"),i;if(o.length===1)return H(t,e,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(l=>l._zod.def.values)),u=j(e,c);return t.write(`if (!${u}.has(${i})) return INVALID;`),i}let s=E(e);t.write(`let ${s};`);for(let c=0;c<o.length;c++){let u=o[c];c===0?t.write(`${s} = (() => {`):t.write(`if (${s} === INVALID) ${s} = (() => {`),t.indented(l=>{let d=H(l,e,u,i);l.write(`return ${d};`)}),t.write("})();")}return t.write(`if (${s} === INVALID) return INVALID;`),s}function $O(t,e,r,i){if(r.unionFallback)throw new M("discriminated union with unionFallback");if(r.options.length===0)return t.write("return INVALID;"),i;let n=E(e),o=E(e);t.write(`const ${n} = ${i}?.[${ye(r.discriminator)}];`),t.write(`let ${o};`);let a=!0,s=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new M("discriminated union option without static discriminator values");for(let f of u){if(s.has(f))throw new M(`duplicate discriminator value ${String(f)}`);s.add(f)}let l=Array.from(u,f=>bO(e,n,f)),d=a?"if":"else if";t.write(`${d} (${l.join(" || ")}) {`),t.indented(f=>{let p=H(f,e,c,i);f.write(`${o} = ${p};`)}),t.write("}"),a=!1}return t.write("else { return INVALID; }"),o}function bO(t,e,r){if(typeof r=="string")return`${e} === ${ye(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${e})`:`${e} === ${r}`;if(typeof r=="boolean")return`${e} === ${r}`;if(r===null)return`${e} === null`;if(r===void 0)return`${e} === undefined`;if(typeof r=="bigint")return`${e} === ${r}n`;if(typeof r=="symbol"){let i=j(t,r);return`${e} === ${i}`}throw new M(`literal discriminator value ${String(r)}`)}function _O(t,e,r,i){let n=r._zod.def,o=me(t,e,n.left,i),a=me(t,e,n.right,i),s=j(e,In),c=E(e);return t.write(`const ${c} = ${s}(${o}, ${a});`),t.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function wO(t,e,r,i){let n=r._zod.def,o=j(e,Ee);t.write(`if (!${o}(${i})) return INVALID;`);let a=E(e),s=E(e),c=E(e);t.write(`const ${a} = {};`);let u=n,l=u.partial?void 0:n.keyType._zod.values;if(l){let m=[];for(let g of l){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new M(`record key value ${String(g)}`);let S=typeof g=="number"?g.toString():g;if(S==="__proto__")throw new M('record key "__proto__"');m.push(S);let b=j(e,g),x=H(t,e,n.keyType,b),z=E(e);t.write(`const ${z} = ${i}[${kO(e,S)}];`);let P=me(t,e,n.valueType,z);t.write(`${a}[${x}] = ${P};`)}let h=j(e,new Set(m));return t.write(`for (const ${s} in ${i}) {`),t.indented(g=>{g.write(`if (${h}.has(${s})) continue;`),u.mode==="loose"?g.write(`if (${s} !== "__proto__") ${a}[${s}] = ${i}[${s}];`):g.write("return INVALID;")}),t.write("}"),a}let d=n.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let m=n.mode==="loose",h=j(e,Xo(n.keyType)),g=j(e,pt),S=j(e,Object.prototype.propertyIsEnumerable),b=E(e);return t.write(`for (const ${s} of Reflect.ownKeys(${i})) {`),t.indented(x=>{x.write(`if (${s} === "__proto__") continue;`),x.write(`if (!${S}.call(${i}, ${s})) continue;`),x.write(`let ${b} = ${h}(${s});`),x.write(`if (${b} === INVALID && typeof ${s} === "string" && ${g}.test(${s})) ${b} = ${h}(Number(${s}));`),m?x.write(`if (${b} === INVALID) { ${a}[${s}] = ${i}[${s}]; continue; }`):x.write(`if (${b} === INVALID) return INVALID;`),x.write(`if (${b} === "__proto__") continue;`);let z=E(e);x.write(`const ${z} = ${i}[${s}];`);let P=me(x,e,n.valueType,z);x.write(`${a}[${b}] = ${P};`)}),t.write("}"),a}let p=j(e,Object.prototype.propertyIsEnumerable);return t.write(`for (const ${s} of Reflect.ownKeys(${i})) {`),t.indented(m=>{m.write(`if (${s} === "__proto__") continue;`),m.write(`if (!${p}.call(${i}, ${s})) continue;`),m.write(`if (typeof ${s} !== "string") return INVALID;`),m.write(`const ${c} = ${i}[${s}];`);let h=me(m,e,n.valueType,c);m.write(`${a}[${s}] = ${h};`)}),t.write("}"),a}function kO(t,e){return typeof e=="string"?ye(e):j(t,e)}function SO(t,e,r,i){let n=r._zod.def;t.write(`if (!(${i} instanceof Map)) return INVALID;`);let o=E(e),a=E(e),s=E(e);return t.write(`const ${o} = new Map();`),t.write(`for (const [${a}, ${s}] of ${i}) {`),t.indented(c=>{let u=H(c,e,n.keyType,a),l=H(c,e,n.valueType,s);c.write(`${o}.set(${u}, ${l});`)}),t.write("}"),o}function xO(t,e,r,i){let n=r._zod.def;t.write(`if (!(${i} instanceof Set)) return INVALID;`);let o=E(e),a=E(e);return t.write(`const ${o} = new Set();`),t.write(`for (const ${a} of ${i}) {`),t.indented(s=>{let c=H(s,e,n.valueType,a);s.write(`${o}.add(${c});`)}),t.write("}"),o}function IO(t,e){return t.write(`if (!(${e} instanceof File)) return INVALID;`),e}function OO(t,e,r,i){t.write(`if (typeof ${i} !== "string") return INVALID;`);let n=r._zod.pattern;if(n){let o=j(e,n);t.write(`${o}.lastIndex = 0;`),t.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function zO(t,e,r,i){let n=r._zod.def,o=j(e,n.getter),a=j(e,{parser:null});t.write(`if (!${a}.parser) {`),t.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${a}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),t.write("}");let s=E(e);return t.write(`const ${s} = ${a}.parser(${i});`),t.write(`if (${s} === INVALID) return INVALID;`),s}function PO(t,e,r,i){let n=r._zod.def,o=H(t,e,n.in,i);if(n.transform){if(Bt(n.transform))throw new Ze("z.compile: async transforms in pipes are not supported");let a=n.transform,c=j(e,l=>{let d={value:l,issues:[],addIssue:vd},f=a(l,d);return f instanceof Promise?Ne:d.issues.length===0?f:Ne}),u=E(e);return t.write(`const ${u} = ${c}(${o});`),t.write(`if (${u} === INVALID) return INVALID;`),H(t,e,n.out,u)}else return H(t,e,n.out,o)}function Bt(t){return typeof t=="function"&&(t.constructor.name==="AsyncFunction"||t[Symbol.toStringTag]==="AsyncFunction")}function NO(t,e,r,i){let n=r._zod.def;if(n.fn){if(Bt(n.fn))throw new Ze("z.compile: async custom predicates are not supported");let o=j(e,n.fn),a=j(e,md),s=E(e);t.write(`const ${s} = ${o}(${i});`),t.write(`if (${s} instanceof Promise) ${a}();`),t.write(`if (!${s}) return INVALID;`)}else throw new M("custom schema without a predicate function");return i}function AO(t,e,r){let i=t._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return Ne;let n=i;return n.issues.length===0?n.value:e()}function jO(t,e,r,i){let n=r._zod.def;if(!n.catchValue[ao])throw new M("catch with a callback (only a constant catch value compiles)",!1);let o=E(e);t.write(`let ${o} = (() => {`),t.indented(u=>{let l=me(u,e,n.innerType,i);u.write(`return ${l};`)}),t.write("})();");let a=j(e,n.innerType),s=j(e,n.catchValue),c=j(e,AO);return t.write(`if (${o} === INVALID) {`),t.indented(u=>{u.write(`${o} = ${c}(${a}, ${s}, ${i});`),u.write(`if (${o} === INVALID) return INVALID;`)}),t.write("}"),o}function EO(t,e,r,i){let n=r._zod.def;if(n.transform){if(Bt(n.transform))throw new Ze("z.compile: async transforms are not supported");let o=n.transform,s=j(e,u=>{let l={value:u,issues:[],addIssue:vd},d=o(u,l);return d instanceof Promise?Ne:l.issues.length===0?d:Ne}),c=E(e);return t.write(`const ${c} = ${s}(${i});`),t.write(`if (${c} === INVALID) return INVALID;`),c}return i}function yd(t,e){return new t({type:"string",...I(e)})}function $d(t,e){return new t({type:"string",coerce:!0,...I(e)})}function Qo(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...I(e)})}function ea(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...I(e)})}function ta(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...I(e)})}function na(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(e)})}function ra(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(e)})}function ia(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(e)})}function Fr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...I(e)})}function oa(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...I(e)})}function aa(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(e)})}function sa(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...I(e)})}function ca(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(e)})}function ua(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...I(e)})}function la(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...I(e)})}function da(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(e)})}function fa(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(e)})}function pa(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(e)})}function bd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...I(e)})}function ma(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(e)})}function ha(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(e)})}function ga(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...I(e)})}function va(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...I(e)})}function ya(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...I(e)})}function _d(t,e){return new t({type:"string",format:"credit_card",check:"string_format",abort:!1,...I(e)})}function $a(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...I(e)})}var wd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function qr(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(e)})}function Jr(t,e){return new t({type:"string",format:"date",check:"string_format",...I(e)})}function Kr(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...I(e)})}function Br(t,e){return new t({type:"string",format:"duration",check:"string_format",...I(e)})}function kd(t,e){return new t({type:"number",checks:[],...I(e)})}function Sd(t,e){return new t({type:"number",coerce:!0,checks:[],...I(e)})}function xd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...I(e)})}function Id(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...I(e)})}function Od(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...I(e)})}function zd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...I(e)})}function Pd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...I(e)})}function Nd(t,e){return new t({type:"boolean",...I(e)})}function Ad(t,e){return new t({type:"boolean",coerce:!0,...I(e)})}function jd(t,e){return new t({type:"bigint",...I(e)})}function Ed(t,e){return new t({type:"bigint",coerce:!0,...I(e)})}function Dd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(e)})}function Cd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(e)})}function Td(t,e){return new t({type:"symbol",...I(e)})}function Ud(t,e){return new t({type:"undefined",...I(e)})}function Ld(t,e){return new t({type:"null",...I(e)})}function Zd(t){return new t({type:"any"})}function Md(t){return new t({type:"unknown"})}function Vd(t,e){return new t({type:"never",...I(e)})}function Rd(t,e){return new t({type:"void",...I(e)})}function Fd(t,e){return new t({type:"date",...I(e)})}function qd(t,e){return new t({type:"date",coerce:!0,...I(e)})}function Jd(t,e){return new t({type:"nan",...I(e)})}function qe(t,e){return new wo({check:"less_than",...I(e),value:t,inclusive:!1})}function Ae(t,e){return new wo({check:"less_than",...I(e),value:t,inclusive:!0})}function Je(t,e){return new ko({check:"greater_than",...I(e),value:t,inclusive:!1})}function je(t,e){return new ko({check:"greater_than",...I(e),value:t,inclusive:!0})}function ba(t){return Je(0,t)}function _a(t){return qe(0,t)}function wa(t){return Ae(0,t)}function ka(t){return je(0,t)}function mt(t,e){return new Au({check:"multiple_of",...I(e),value:t})}function ht(t,e){return new Du({check:"max_size",...I(e),maximum:t})}function Ke(t,e){return new Cu({check:"min_size",...I(e),minimum:t})}function Wt(t,e){return new Tu({check:"size_equals",...I(e),size:t})}function Gt(t,e){return new Uu({check:"max_length",...I(e),maximum:t})}function tt(t,e){return new Lu({check:"min_length",...I(e),minimum:t})}function Ht(t,e){return new Zu({check:"length_equals",...I(e),length:t})}function zn(t,e){return new Mu({check:"string_format",format:"regex",...I(e),pattern:t})}function Pn(t){return new Vu({check:"string_format",format:"lowercase",...I(t)})}function Nn(t){return new Ru({check:"string_format",format:"uppercase",...I(t)})}function An(t,e){return new Fu({check:"string_format",format:"includes",...I(e),includes:t})}function jn(t,e){return new qu({check:"string_format",format:"starts_with",...I(e),prefix:t})}function En(t,e){return new Ju({check:"string_format",format:"ends_with",...I(e),suffix:t})}function Sa(t,e,r){return new So({check:"property",property:t,schema:e,...I(r)})}function xa(t){return Object.entries(t).map(([e,r])=>new So({check:"property",property:e,schema:r}))}function Dn(t,e){return new Ku({check:"mime_type",mime:t,...I(e)})}function Me(t){return new Bu({check:"overwrite",tx:t})}function Cn(t){return Me(e=>e.normalize(t))}function Tn(){return Me(t=>t.trim())}function Un(){return Me(t=>t.toLowerCase())}function Ln(){return Me(t=>t.toUpperCase())}function Zn(){return Me(t=>Ac(t))}function Kd(t,e,r){return new t({type:"array",element:e,...I(r)})}function DO(t,e,r){return new t({type:"union",options:e,...I(r)})}function CO(t,e,r){return new t({type:"union",options:e,inclusive:!1,...I(r)})}function TO(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...I(i)})}function UO(t,e,r){return new t({type:"intersection",left:e,right:r})}function LO(t,e,r,i){let n=r instanceof C,o=n?i:r,a=n?r:null;return new t({type:"tuple",items:e,rest:a,...I(o)})}function ZO(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...I(i)})}function MO(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...I(i)})}function VO(t,e,r){return new t({type:"set",valueType:e,...I(r)})}function RO(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...I(r)})}function FO(t,e,r){return new t({type:"enum",entries:e,...I(r)})}function qO(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...I(r)})}function Bd(t,e){return new t({type:"file",...I(e)})}function JO(t,e){return new t({type:"transform",transform:e})}function KO(t,e){return new t({type:"optional",innerType:e})}function BO(t,e){return new t({type:"nullable",innerType:e})}function WO(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Sr(r)}})}function GO(t,e,r){return new t({type:"nonoptional",innerType:e,...I(r)})}function HO(t,e){return new t({type:"success",innerType:e})}function YO(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:Mc(r)})}function XO(t,e,r){return new t({type:"pipe",in:e,out:r})}function QO(t,e){return new t({type:"readonly",innerType:e})}function ez(t,e,r){return new t({type:"template_literal",parts:e,...I(r)})}function tz(t,e){return new t({type:"lazy",getter:e})}function nz(t,e){return new t({type:"promise",innerType:e})}function Wd(t,e,r){let i=I(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Gd(t,e,r){return new t({type:"custom",check:"custom",fn:e,...I(r)})}function Hd(t,e){let r=by(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(bn(n,i.value,r._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(bn(o))}},t(i.value,i)),e);return r}function by(t,e){let r=new W({check:"custom",...I(e)});return r._zod.check=t,r}function Yd(t){let e=new W({check:"describe"});return e._zod.onattach=[r=>{let i=ce.get(r)??{};ce.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function Xd(t){let e=new W({check:"meta"});return e._zod.onattach=[r=>{let i=ce.get(r)??{};ce.add(r,{...i,...t})}],e._zod.check=()=>{},e}function Qd(t,e){let r=I(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(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(i),a=new Set(n),s=t.Codec??Lr,c=t.Boolean??Tr,u=t.String??Ft,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new s({type:"pipe",in:l,out:d,transform:((p,m)=>{let h=p;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:a.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?i[0]||"true":n[0]||"false"),error:r.error});return f._zod.bag.truthy=i,f._zod.bag.falsy=n,f._zod.bag.case=r.case??"insensitive",f}function Mn(t,e,r,i={}){let n=I(i),o={check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}function Wr(t,...e){for(let r of e)for(let i of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,i)&&X(t,i,r[i]);return t}function gt(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??ce,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function ie(t,e,r,i,n){let o=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:i.path,message:n}):e.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(n);return Object.assign(r,o),!0}function q(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 a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;let s=t._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,l);else{let f=a.schema,p=e.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(t,e,f,l)}let d=t._zod.parent;d&&(a.ref||(a.ref=d),q(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Wr(a.schema,c),e.io==="input"&&he(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function _y(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function vt(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let i=new Map;for(let a of t.seen.entries()){let s=t.metadataRegistry.get(a[0])?.id;if(s){let c=i.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let n=a=>{let s=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(a[0])?.id,f=t.external.uri??(m=>m);if(d)return{ref:f(d)};let p=a[1].defId??a[1].schema.id??`schema${t.counter++}`;return a[1].defId=p,{defId:p,ref:`${f("__shared")}#/${s}/${_y(p)}`}}let c="#",u=`${c}/${s}/`;if(a[1]===r&&!a[1].schema.id)return{ref:c};let l=a[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+_y(l)}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);let l=s.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let a of t.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
223
|
+
|
|
224
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of t.seen.entries()){let s=a[1];if(e===a[0]){o(a);continue}if(t.external){let u=t.external.registry.get(a[0])?.id;if(e!==a[0]&&u){o(a);continue}}if(t.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&t.reused==="ref"){o(a);continue}}t.external&&(t.sharedDefsExtractedFor=t.external)}function Sy(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let r=[];for(let i of e){if(!i||typeof i!="object")return;Sy(i);let n=Object.keys(i);if(n.length!==1||n[0]!=="type")return;let o=i.type;for(let a of Array.isArray(o)?o:[o]){if(typeof a!="string")return;r.includes(a)||r.push(a)}}delete t.anyOf,t.type=r.length===1?r[0]:r}var xy=new Set(["type","properties","required","additionalProperties"]),wy=["oneOf","anyOf"];function ky(t){let e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function ef(t){let e=[];for(let o of t){if(typeof o!="object"||o.type!=="object")return null;for(let a in o)if(!xy.has(a))return null;e.push(o)}let r={},i=new Set;for(let o of e){for(let a in o.properties){if(Object.prototype.hasOwnProperty.call(r,a))continue;let s=[];for(let u of e){let l=u.properties?.[a]??ky(u);l!=null&&(s.some(d=>JSON.stringify(d)===JSON.stringify(l))||s.push(l))}let c=s.length===1?s[0]:ef(s)??{allOf:s};X(r,a,c)}for(let a of o.required??[])i.add(a)}let n={type:"object",properties:r};if(i.size&&(n.required=[...i]),e.every(o=>o.additionalProperties===!1))n.additionalProperties=!1;else{let o=[];for(let a of e){let s=ky(a);s&&!o.some(c=>JSON.stringify(c)===JSON.stringify(s))&&o.push(s)}o.length===1?n.additionalProperties=o[0]:o.length>1&&(n.additionalProperties={allOf:o})}return n}function rz(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let n of xy)if(n in t)return;let r=e.filter(n=>wy.some(o=>Array.isArray(n[o]))),i=null;if(!r.length)i=ef(e);else{let n=r[0],o=wy.find(c=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let a=e.filter(c=>c!==n),s=n[o].map(c=>ef([...a,c]));if(s.some(c=>!c))return;i={[o]:s}}i&&(delete t.allOf,Wr(t,i))}function yt(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let c=t.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){i(d);let p=t.seen.get(d),m=p.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Wr(u,m),Wr(u,l),s._zod.parent===d)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(m.$ref&&p.def)for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}let f=s._zod.parent;if(f&&f!==d){i(f);let p=t.seen.get(f);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.def[m])&&delete u[m]}t.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let s of[...t.seen.entries()].reverse())i(s[0]);if(t.target!=="openapi-3.0")for(let s of t.seen.entries())Sy(s[1].def??s[1].schema);for(let s of t.deferred)s();if(t.intersections.length){let s=new Map;for(let c of t.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=s.get(l);d?d.push(u):s.set(l,[u])}for(let c of t.intersections)for(let u of s.get(c)??[])rz(u)}}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 s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(s)}Wr(n,r.defId?r.schema:r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&n.id===o&&delete n.id;let a=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let s of t.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,X(a,c.defId,c.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Vn(e,"input",t.processors),output:Vn(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function he(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 he(i.element,r);if(i.type==="set")return he(i.valueType,r);if(i.type==="lazy")return he(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"||i.type==="catch")return he(i.innerType,r);if(i.type==="intersection")return he(i.left,r)||he(i.right,r);if(i.type==="record"||i.type==="map")return he(i.keyType,r)||he(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:he(i.in,r)||he(i.out,r);if(i.type==="object"){for(let n in i.shape)if(he(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(he(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(he(n,r))return!0;return!!(i.rest&&he(i.rest,r))}return!1}var tf=(t,e={})=>r=>{let i=gt({...r,processors:e});return q(t,i),vt(i,t),yt(i,t)},Vn=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},a=gt({...n??{},target:o,io:e,processors:r});return q(t,a),vt(a,t),yt(a,t)};var iz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},of=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:u,laxFormat:l}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof a=="number"&&(n.maxLength=a),s&&(n.format=iz[s]??s,n.format===""&&delete n.format,(s==="time"||l)&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let d=[...c];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(f=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},af=(t,e,r,i)=>{let n=r,{minimum:o,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof o=="number"&&(n.minimum=o),f?p?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof a=="number"&&(n.maximum=a),typeof c=="number"&&(Number.isFinite(c)&&c!==0?n.multipleOf=Math.abs(c):ie(t,e,n,i,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},sf=(t,e,r,i)=>{r.type="boolean"},cf=(t,e,r,i)=>{ie(t,e,r,i,"BigInt cannot be represented in JSON Schema")},uf=(t,e,r,i)=>{ie(t,e,r,i,"Symbols cannot be represented in JSON Schema")},lf=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},df=(t,e,r,i)=>{ie(t,e,r,i,"Undefined cannot be represented in JSON Schema")},ff=(t,e,r,i)=>{ie(t,e,r,i,"Void cannot be represented in JSON Schema")},pf=(t,e,r,i)=>{r.not={}},mf=(t,e,r,i)=>{},hf=(t,e,r,i)=>{},gf=(t,e,r,i)=>{ie(t,e,r,i,"Date cannot be represented in JSON Schema")},vf=(t,e,r,i)=>{let n=t._zod.def,o=_r(n.entries);if(o.length===0){r.not={};return}o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},yf=(t,e,r,i)=>{let n=t._zod.def;if(n.values.length===0){r.not={};return}let o=[];for(let a of n.values)if(a===void 0){if(ie(t,e,r,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(ie(t,e,r,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},$f=(t,e,r,i)=>{ie(t,e,r,i,"NaN cannot be represented in JSON Schema")},bf=(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},_f=(t,e,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=t._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,o)},wf=(t,e,r,i)=>{r.type="boolean"},kf=(t,e,r,i)=>{ie(t,e,r,i,"Custom types cannot be represented in JSON Schema")},Sf=(t,e,r,i)=>{ie(t,e,r,i,"Function types cannot be represented in JSON Schema")},xf=(t,e,r,i)=>{ie(t,e,r,i,"Transforms cannot be represented in JSON Schema")},If=(t,e,r,i)=>{ie(t,e,r,i,"Map cannot be represented in JSON Schema")},Of=(t,e,r,i)=>{ie(t,e,r,i,"Set cannot be represented in JSON Schema")},zf=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:a,maximum:s}=t._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=q(o.element,e,{...i,path:[...i.path,"items"]})};function Gr(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?Gr(e.out):e.type==="catch"?Gr(e.innerType):t._zod.optin}var Pf=(t,e,r,i)=>{let n=r,o=t._zod.def,a=o.shape;if(Object.getOwnPropertySymbols(a).length&&ie(t,e,n,i,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let l in a)X(n.properties,l,q(a[l],e,{...i,path:[...i.path,"properties",l]}));let c=new Set(Object.keys(a)),u=new Set([...c].filter(l=>{let d=o.shape[l];return e.io==="input"?Gr(d)===void 0:d._zod.optout===void 0}));u.size>0&&(n.required=Array.from(u)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=q(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},Oa=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,a=n.options.map((s,c)=>q(s,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=a:r.anyOf=a},Nf=(t,e,r,i)=>{let n=t._zod.def,o=q(n.left,e,{...i,path:[...i.path,"allOf",0]}),a=q(n.right,e,{...i,path:[...i.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=c,e.intersections.push(c)},Af=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let a=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((h,g)=>q(h,e,{...i,path:[...i.path,a,g]})),u=o.rest?q(o.rest,e,{...i,path:[...i.path,s,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null,l=o.items.length;for(;l>0;){let h=o.items[l-1];if(!(e.io==="input"?Gr(h)!==void 0:h._zod.optout==="optional"))break;l--}let d=o.items.length,f=!o.rest;e.target==="draft-2020-12"?(n.prefixItems=c,f?n.items=!1:u&&(n.items=u),l>0&&(n.minItems=l),f&&(n.maxItems=d)):e.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),l>0&&(n.minItems=l),f&&(n.maxItems=d)):(n.items=c,f?n.additionalItems=!1:u&&(n.additionalItems=u),l>0&&(n.minItems=l),f&&(n.maxItems=d));let{minimum:p,maximum:m}=t._zod.bag;typeof p=="number"&&(n.minItems=p),typeof m=="number"&&(n.maxItems=m)};function nf(t,e,r){if(e.$ref){if(r.has(e))return e;r.add(e);let m=t.get(e)?.def;if(!m)return e;let h=nf(t,m,r);return h===m?e:h}for(let m of["anyOf","oneOf"]){let h=e[m];if(!Array.isArray(h))continue;let g=h.map(S=>nf(t,S,r));g.some((S,b)=>S!==h[b])&&(e={...e,[m]:g})}let i=Array.isArray(e.type)?e.type:[e.type],n=!i.includes("string")&&i.some(m=>m==="number"||m==="integer"),o=e.enum??(e.const!==void 0?[e.const]:void 0);if(!n&&!o?.some(m=>typeof m=="number"))return e;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:f,...p}=e;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),n&&(p.type="string",o||(p.pattern=(i.includes("number")?pt:Ar).source)),p}var rf=new WeakMap;function oz(t){let e=new Map;for(let i of t.seen.values())i.def&&!e.has(i.schema)&&e.set(i.schema,i);let r=new Map;for(let i of rf.get(t)??[]){let n=t.seen.get(i),o=(n?.def??n?.schema)?.propertyNames;if(!o||o===!0||r.has(o))continue;let a=nf(e,o,new Set);a!==o&&r.set(o,a)}if(r.size)for(let i of t.seen.values())for(let n of[i.schema,i.def]){let o=n&&r.get(n.propertyNames);o&&(n.propertyNames=o)}}var jf=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let a=o.keyType,c=a._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let d=q(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let f of c)X(n.patternProperties,f.source,d)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){n.propertyNames=q(o.keyType,e,{...i,path:[...i.path,"propertyNames"]});let d=rf.get(e);d||(d=[],rf.set(e,d),e.deferred.push(()=>oz(e))),d.push(t)}n.additionalProperties=q(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]})}let u=a._zod.values,l=e.io==="input"&&Gr(o.valueType)!==void 0;if(u&&!o.partial&&!l){let d=[...u].filter(f=>typeof f=="string"||typeof f=="number");d.length>0&&(n.required=d.map(String))}},Ef=(t,e,r,i)=>{let n=t._zod.def,o=q(n.innerType,e,i),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Df=(t,e,r,i)=>{let n=t._zod.def;q(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Cf=Symbol();function Iy(t,e,r,i,n){let o=!1,a=JSON.stringify(t,(s,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(ie(e,r,i,n,"BigInt defaults cannot be represented in JSON Schema"),Cf):JSON.parse(a)}var Tf=(t,e,r,i)=>{let n=t._zod.def;q(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let a=Iy(n.defaultValue,t,e,r,i);a!==Cf&&(r.default=a)},Uf=(t,e,r,i)=>{let n=t._zod.def;q(n.innerType,e,i);let o=e.seen.get(t);if(o.ref=n.innerType,e.io!=="input")return;let a=Iy(n.defaultValue,t,e,r,i);a!==Cf&&(r._prefault=a)},Lf=(t,e,r,i)=>{let n=t._zod.def;q(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{ie(t,e,r,i,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},Zf=(t,e,r,i)=>{let n=t._zod.def,o=n.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?o?n.out:n.in:n.out;q(a,e,i);let s=e.seen.get(t);s.ref=a},Mf=(t,e,r,i)=>{let n=t._zod.def;q(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},Vf=(t,e,r,i)=>{let n=t._zod.def;q(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},za=(t,e,r,i)=>{let n=t._zod.def;q(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Rf=(t,e,r,i)=>{let n=t._zod.innerType;q(n,e,i);let o=e.seen.get(t);o.ref=n},Ia={string:of,number:af,boolean:sf,bigint:cf,symbol:uf,null:lf,undefined:df,void:ff,never:pf,any:mf,unknown:hf,date:gf,enum:vf,literal:yf,nan:$f,template_literal:bf,file:_f,success:wf,custom:kf,function:Sf,transform:xf,map:If,set:Of,array:zf,object:Pf,union:Oa,intersection:Nf,tuple:Af,record:jf,nullable:Ef,nonoptional:Df,default:Tf,prefault:Uf,catch:Lf,pipe:Zf,readonly:Mf,promise:Vf,optional:za,lazy:Rf};function Pa(t,e){if("_idmap"in t){let i=t,n=gt({...e,processors:Ia}),o={};for(let c of i._idmap.entries()){let[u,l]=c;q(l,n)}let a={},s={registry:i,uri:e?.uri,defs:o};n.external=s;for(let c of i._idmap.entries()){let[u,l]=c;vt(n,l),X(a,u,yt(n,l))}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let r=gt({...e,processors:Ia});return q(t,r),vt(r,t),yt(r,t)}var Na=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=gt({processors:Ia,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 q(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)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,vt(this.ctx,e);let i=yt(this.ctx,e),{"~standard":n,...o}=i;return o}};var Oy={};var Hn={};Xe(Hn,{ZodAny:()=>up,ZodArray:()=>pp,ZodBase64:()=>Ga,ZodBase64URL:()=>Ha,ZodBigInt:()=>Wn,ZodBigIntFormat:()=>Qa,ZodBoolean:()=>Bn,ZodCIDRv4:()=>Ba,ZodCIDRv6:()=>Wa,ZodCUID:()=>Ma,ZodCUID2:()=>Va,ZodCatch:()=>Dp,ZodCodec:()=>oi,ZodCreditCard:()=>np,ZodCustom:()=>ai,ZodCustomStringFormat:()=>Jn,ZodDate:()=>Qr,ZodDefault:()=>zp,ZodDiscriminatedUnion:()=>hp,ZodE164:()=>Ya,ZodEmail:()=>Ta,ZodEmoji:()=>La,ZodEnum:()=>Fn,ZodExactOptional:()=>rs,ZodFile:()=>Sp,ZodFunction:()=>qp,ZodGUID:()=>Ua,ZodIPv4:()=>Ja,ZodIPv6:()=>Ka,ZodISODate:()=>bt,ZodISODateTime:()=>$t,ZodISODuration:()=>wt,ZodISOTime:()=>_t,ZodIntersection:()=>gp,ZodJWT:()=>Xa,ZodKSUID:()=>qa,ZodLazy:()=>Vp,ZodLiteral:()=>kp,ZodMAC:()=>tp,ZodMap:()=>_p,ZodNaN:()=>Tp,ZodNanoID:()=>Za,ZodNever:()=>dp,ZodNonOptional:()=>is,ZodNull:()=>sp,ZodNullable:()=>Op,ZodNumber:()=>Kn,ZodNumberFormat:()=>en,ZodObject:()=>ti,ZodOptional:()=>ri,ZodPipe:()=>ii,ZodPrefault:()=>Np,ZodPreprocess:()=>Up,ZodPromise:()=>Fp,ZodReadonly:()=>Lp,ZodRecord:()=>Rn,ZodSet:()=>wp,ZodString:()=>qn,ZodStringFormat:()=>B,ZodSuccess:()=>Ep,ZodSymbol:()=>op,ZodTemplateLiteral:()=>Mp,ZodTransform:()=>xp,ZodTuple:()=>yp,ZodType:()=>U,ZodULID:()=>Ra,ZodURL:()=>Xr,ZodUUID:()=>Be,ZodUndefined:()=>ap,ZodUnion:()=>ni,ZodUnknown:()=>lp,ZodVoid:()=>fp,ZodXID:()=>Fa,ZodXor:()=>mp,_ZodString:()=>Ca,_default:()=>Pp,_function:()=>U$,any:()=>m$,array:()=>ei,base64:()=>Hy,base64url:()=>Yy,bigint:()=>u$,boolean:()=>ip,catch:()=>Cp,check:()=>L$,cidrv4:()=>Wy,cidrv6:()=>Gy,codec:()=>E$,creditCard:()=>Qy,cuid:()=>My,cuid2:()=>Vy,custom:()=>Z$,date:()=>g$,describe:()=>M$,discriminatedUnion:()=>w$,e164:()=>Xy,email:()=>Ny,emoji:()=>Ly,enum:()=>ts,exactOptional:()=>Ip,file:()=>P$,float32:()=>o$,float64:()=>a$,function:()=>U$,guid:()=>Ay,hash:()=>i$,hex:()=>r$,hostname:()=>n$,httpUrl:()=>Uy,instanceof:()=>R$,int:()=>Ea,int32:()=>s$,int64:()=>l$,intersection:()=>vp,invertCodec:()=>D$,ipv4:()=>Jy,ipv6:()=>By,json:()=>q$,jwt:()=>e$,keyof:()=>v$,ksuid:()=>qy,lazy:()=>Rp,literal:()=>z$,looseObject:()=>b$,looseRecord:()=>S$,mac:()=>Ky,map:()=>x$,meta:()=>V$,nan:()=>j$,nanoid:()=>Zy,nativeEnum:()=>O$,never:()=>es,nonoptional:()=>jp,null:()=>cp,nullable:()=>Yr,nullish:()=>N$,number:()=>rp,object:()=>y$,optional:()=>Xt,partialRecord:()=>k$,pipe:()=>Da,prefault:()=>Ap,preprocess:()=>J$,promise:()=>T$,readonly:()=>Zp,record:()=>bp,refine:()=>Jp,set:()=>I$,strictObject:()=>$$,string:()=>Hr,stringFormat:()=>t$,stringbool:()=>F$,success:()=>A$,superRefine:()=>Kp,symbol:()=>f$,templateLiteral:()=>C$,transform:()=>ns,tuple:()=>$p,uint32:()=>c$,uint64:()=>d$,ulid:()=>Ry,undefined:()=>p$,union:()=>Gn,unknown:()=>Yt,url:()=>Ty,uuid:()=>jy,uuidv4:()=>Ey,uuidv6:()=>Dy,uuidv7:()=>Cy,void:()=>h$,xid:()=>Fy,xor:()=>_$});var Aa={};Xe(Aa,{endsWith:()=>En,gt:()=>Je,gte:()=>je,includes:()=>An,length:()=>Ht,lowercase:()=>Pn,lt:()=>qe,lte:()=>Ae,maxLength:()=>Gt,maxSize:()=>ht,mime:()=>Dn,minLength:()=>tt,minSize:()=>Ke,multipleOf:()=>mt,negative:()=>_a,nonnegative:()=>ka,nonpositive:()=>wa,normalize:()=>Cn,overwrite:()=>Me,positive:()=>ba,properties:()=>xa,property:()=>Sa,regex:()=>zn,size:()=>Wt,slugify:()=>Zn,startsWith:()=>jn,toLowerCase:()=>Un,toUpperCase:()=>Ln,trim:()=>Tn,uppercase:()=>Nn});var zy=new WeakSet([Object.prototype,Error.prototype]);function ja(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){let i=r(this);return Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0})}})}var Py=(t,e)=>{zr.init(t,e),t.name="ZodError";let r=Object.getPrototypeOf(t);zy.has(r)||(zy.add(r),ja(r,"format",i=>n=>Nr(i,n)),ja(r,"flatten",i=>n=>Pr(i,n)),ja(r,"addIssue",i=>n=>{i.issues.push(n),i.message=JSON.stringify(i.issues,yn,2)}),ja(r,"addIssues",i=>n=>{i.issues.push(...n),i.message=JSON.stringify(i.issues,yn,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},sz=v("ZodError",Py),ke=v("ZodError",Py,void 0,{Parent:Error});var Ff=_n(ke),qf=wn(ke),Jf=kn(ke),Kf=Sn(ke),Bf=lo(ke),Wf=fo(ke),Gf=po(ke),Hf=mo(ke),Yf=ho(ke),Xf=go(ke),Qf=vo(ke),ep=yo(ke);function uz(){ae.localeError||Q(Bo())}function Qt(){ae.memoizer||Q({memoizer:Mr()})}var U=v("ZodType",(t,e)=>(uz(),C.init(t,e),t.def=e,t.type=e.type,t),{check(...t){let e=this.def;return this.clone(k.mergeDefs(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return F(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(Jp(t,e))},superRefine(t,e){return this.check(Kp(t,e))},overwrite(t){return this.check(Me(t))},optional(){return Xt(this)},exactOptional(){return Ip(this)},nullable(){return Yr(this)},nullish(){return Xt(Yr(this))},nonoptional(t){return jp(this,t)},array(){return ei(this)},or(t){return Gn([this,t])},and(t){return vp(this,t)},transform(t){return Da(this,ns(t))},default(t){return Pp(this,t)},prefault(t){return Ap(this,t)},catch(t){return Cp(this,t)},pipe(t){return Da(this,t)},readonly(){return Zp(this)},describe(t){let e=this.clone();return ce.add(e,{description:t}),e},meta(...t){if(t.length===0)return ce.get(this);let e=this.clone();return ce.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return k.hide(this,"~standard",{...Po(this),jsonSchema:{input:Vn(this,"input"),output:Vn(this,"output")}})},set"~standard"(t){k.own(this,"~standard",t)},parse:function t(e,r){return Ff(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await qf(this,e,r,{callee:t})},safeParse(t,e){return Jf(this,t,e)},async safeParseAsync(t,e){return Kf(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){k.own(this,"spa",t)},encode:function t(e,r){return Bf(this,e,r,{callee:t})},decode:function t(e,r){return Wf(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await Gf(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await Hf(this,e,r,{callee:t})},safeEncode(t,e){return Yf(this,t,e)},safeDecode(t,e){return Xf(this,t,e)},async safeEncodeAsync(t,e){return Qf(this,t,e)},async safeDecodeAsync(t,e){return ep(this,t,e)},toJSONSchema(t){return tf(this,{})(t)},get description(){return ce.get(this)?.description},get _def(){return this._zod.def}}),Ca=v("_ZodString",(t,e)=>{Ft.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>of(t,i,n,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null},{regex(...t){return this.check(zn(...t))},includes(...t){return this.check(An(...t))},startsWith(...t){return this.check(jn(...t))},endsWith(...t){return this.check(En(...t))},min(...t){return this.check(tt(...t))},max(...t){return this.check(Gt(...t))},length(...t){return this.check(Ht(...t))},nonempty(...t){return this.check(tt(1,...t))},lowercase(t){return this.check(Pn(t))},uppercase(t){return this.check(Nn(t))},trim(){return this.check(Tn())},normalize(...t){return this.check(Cn(...t))},toLowerCase(){return this.check(Un())},toUpperCase(){return this.check(Ln())},slugify(){return this.check(Zn())}}),qn=v("ZodString",(t,e)=>{Ft.init(t,e),Ca.init(t,e)},{email(t){return this.check(Qo(Ta,t))},url(t){return this.check(Fr(Xr,t))},jwt(t){return this.check($a(Xa,t))},emoji(t){return this.check(oa(La,t))},guid(t){return this.check(ea(Ua,t))},uuid(t){return this.check(ta(Be,t))},uuidv4(t){return this.check(na(Be,t))},uuidv6(t){return this.check(ra(Be,t))},uuidv7(t){return this.check(ia(Be,t))},nanoid(t){return this.check(aa(Za,t))},cuid(t){return this.check(sa(Ma,t))},cuid2(t){return this.check(ca(Va,t))},ulid(t){return this.check(ua(Ra,t))},base64(t){return this.check(ga(Ga,t))},base64url(t){return this.check(va(Ha,t))},xid(t){return this.check(la(Fa,t))},ksuid(t){return this.check(da(qa,t))},ipv4(t){return this.check(fa(Ja,t))},ipv6(t){return this.check(pa(Ka,t))},cidrv4(t){return this.check(ma(Ba,t))},cidrv6(t){return this.check(ha(Wa,t))},e164(t){return this.check(ya(Ya,t))},datetime(t){return this.check(qr($t,t))},date(t){return this.check(Jr(bt,t))},time(t){return this.check(Kr(_t,t))},duration(t){return this.check(Br(wt,t))}});function Hr(t){return yd(qn,t)}var B=v("ZodStringFormat",(t,e)=>{K.init(t,e),Ca.init(t,e)}),$t=v("ZodISODateTime",(t,e)=>{ul.init(t,e),B.init(t,e)}),bt=v("ZodISODate",(t,e)=>{ll.init(t,e),B.init(t,e)}),_t=v("ZodISOTime",(t,e)=>{dl.init(t,e),B.init(t,e)}),wt=v("ZodISODuration",(t,e)=>{fl.init(t,e),B.init(t,e)}),Ta=v("ZodEmail",(t,e)=>{Xu.init(t,e),B.init(t,e)});function Ny(t){return Qo(Ta,t)}var Ua=v("ZodGUID",(t,e)=>{Hu.init(t,e),B.init(t,e)});function Ay(t){return ea(Ua,t)}var Be=v("ZodUUID",(t,e)=>{Yu.init(t,e),B.init(t,e)});function jy(t){return ta(Be,t)}function Ey(t){return na(Be,t)}function Dy(t){return ra(Be,t)}function Cy(t){return ia(Be,t)}var Xr=v("ZodURL",(t,e)=>{tl.init(t,e),B.init(t,e)});function Ty(t){return Fr(Xr,t)}function Uy(t){return Fr(Xr,{protocol:pe.httpProtocol,hostname:pe.domain,...k.normalizeParams(t)})}var La=v("ZodEmoji",(t,e)=>{nl.init(t,e),B.init(t,e)});function Ly(t){return oa(La,t)}var Za=v("ZodNanoID",(t,e)=>{rl.init(t,e),B.init(t,e)});function Zy(t){return aa(Za,t)}var Ma=v("ZodCUID",(t,e)=>{il.init(t,e),B.init(t,e)});function My(t){return sa(Ma,t)}var Va=v("ZodCUID2",(t,e)=>{ol.init(t,e),B.init(t,e)});function Vy(t){return ca(Va,t)}var Ra=v("ZodULID",(t,e)=>{al.init(t,e),B.init(t,e)});function Ry(t){return ua(Ra,t)}var Fa=v("ZodXID",(t,e)=>{sl.init(t,e),B.init(t,e)});function Fy(t){return la(Fa,t)}var qa=v("ZodKSUID",(t,e)=>{cl.init(t,e),B.init(t,e)});function qy(t){return da(qa,t)}var Ja=v("ZodIPv4",(t,e)=>{pl.init(t,e),B.init(t,e)});function Jy(t){return fa(Ja,t)}var tp=v("ZodMAC",(t,e)=>{hl.init(t,e),B.init(t,e)});function Ky(t){return bd(tp,t)}var Ka=v("ZodIPv6",(t,e)=>{ml.init(t,e),B.init(t,e)});function By(t){return pa(Ka,t)}var Ba=v("ZodCIDRv4",(t,e)=>{gl.init(t,e),B.init(t,e)});function Wy(t){return ma(Ba,t)}var Wa=v("ZodCIDRv6",(t,e)=>{vl.init(t,e),B.init(t,e)});function Gy(t){return ha(Wa,t)}var Ga=v("ZodBase64",(t,e)=>{yl.init(t,e),B.init(t,e)});function Hy(t){return ga(Ga,t)}var Ha=v("ZodBase64URL",(t,e)=>{$l.init(t,e),B.init(t,e)});function Yy(t){return va(Ha,t)}var Ya=v("ZodE164",(t,e)=>{bl.init(t,e),B.init(t,e)});function Xy(t){return ya(Ya,t)}var np=v("ZodCreditCard",(t,e)=>{_l.init(t,e),B.init(t,e)});function Qy(t){return _d(np,t)}var Xa=v("ZodJWT",(t,e)=>{wl.init(t,e),B.init(t,e)});function e$(t){return $a(Xa,t)}var Jn=v("ZodCustomStringFormat",(t,e)=>{kl.init(t,e),B.init(t,e)});function t$(t,e,r={}){return Mn(Jn,t,e,r)}function n$(t){return Mn(Jn,"hostname",pe.hostname,t)}function r$(t){return Mn(Jn,"hex",pe.hex,t)}function i$(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=pe[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return Mn(Jn,i,n,e)}var Kn=v("ZodNumber",(t,e)=>{Lo.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>af(t,i,n,o);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},{gt(t,e){return this.check(Je(t,e))},gte(t,e){return this.check(je(t,e))},min(t,e){return this.check(je(t,e))},lt(t,e){return this.check(qe(t,e))},lte(t,e){return this.check(Ae(t,e))},max(t,e){return this.check(Ae(t,e))},int(t){return this.check(Ea(t))},safe(t){return this.check(Ea(t))},positive(t){return this.check(Je(0,t))},nonnegative(t){return this.check(je(0,t))},negative(t){return this.check(qe(0,t))},nonpositive(t){return this.check(Ae(0,t))},multipleOf(t,e){return this.check(mt(t,e))},step(t,e){return this.check(mt(t,e))},finite(){return this}});function rp(t){return kd(Kn,t)}var en=v("ZodNumberFormat",(t,e)=>{Sl.init(t,e),Kn.init(t,e)});function Ea(t){return xd(en,t)}function o$(t){return Id(en,t)}function a$(t){return Od(en,t)}function s$(t){return zd(en,t)}function c$(t){return Pd(en,t)}var Bn=v("ZodBoolean",(t,e)=>{Tr.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sf(t,r,i,n)});function ip(t){return Nd(Bn,t)}var Wn=v("ZodBigInt",(t,e)=>{Zo.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>cf(t,i,n,o);let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null},{gte(t,e){return this.check(je(t,e))},min(t,e){return this.check(je(t,e))},gt(t,e){return this.check(Je(t,e))},lt(t,e){return this.check(qe(t,e))},lte(t,e){return this.check(Ae(t,e))},max(t,e){return this.check(Ae(t,e))},positive(t){return this.check(Je(BigInt(0),t))},negative(t){return this.check(qe(BigInt(0),t))},nonpositive(t){return this.check(Ae(BigInt(0),t))},nonnegative(t){return this.check(je(BigInt(0),t))},multipleOf(t,e){return this.check(mt(t,e))}});function u$(t){return jd(Wn,t)}var Qa=v("ZodBigIntFormat",(t,e)=>{xl.init(t,e),Wn.init(t,e)});function l$(t){return Dd(Qa,t)}function d$(t){return Cd(Qa,t)}var op=v("ZodSymbol",(t,e)=>{Il.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>uf(t,r,i,n)});function f$(t){return Td(op,t)}var ap=v("ZodUndefined",(t,e)=>{Ol.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>df(t,r,i,n)});function p$(t){return Ud(ap,t)}var sp=v("ZodNull",(t,e)=>{zl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lf(t,r,i,n)});function cp(t){return Ld(sp,t)}var up=v("ZodAny",(t,e)=>{Pl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mf(t,r,i,n)});function m$(){return Zd(up)}var lp=v("ZodUnknown",(t,e)=>{Nl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hf(t,r,i,n)});function Yt(){return Md(lp)}var dp=v("ZodNever",(t,e)=>{Al.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pf(t,r,i,n)});function es(t){return Vd(dp,t)}var fp=v("ZodVoid",(t,e)=>{jl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ff(t,r,i,n)});function h$(t){return Rd(fp,t)}var Qr=v("ZodDate",(t,e)=>{El.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>gf(t,i,n,o),t.min=(i,n)=>t.check(je(i,n)),t.max=(i,n)=>t.check(Ae(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 g$(t){return Fd(Qr,t)}var pp=v("ZodArray",(t,e)=>{Qt(),Dl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zf(t,r,i,n),t.element=e.element},{min(t,e){return this.check(tt(t,e))},nonempty(t){return this.check(tt(1,t))},max(t,e){return this.check(Gt(t,e))},length(t,e){return this.check(Ht(t,e))},unwrap(){return this.element}});function ei(t,e){return Kd(pp,t,e)}function v$(t){let e=t._zod.def.shape;return ts(Object.keys(e))}var ti=v("ZodObject",(t,e)=>{Qt(),Cl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pf(t,r,i,n),k.installLazyProp(t,"shape",r=>r._zod.def.shape,!1)},{keyof(){return ts(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:Yt()})},loose(){return this.clone({...this._zod.def,catchall:Yt()})},strict(){return this.clone({...this._zod.def,catchall:es()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return k.extend(this,t)},safeExtend(t){return k.safeExtend(this,t)},merge(t){return k.merge(this,t)},pick(t){return k.pick(this,t)},omit(t){return k.omit(this,t)},partial(...t){return k.partial(ri,this,t[0])},exactPartial(...t){return k.partial(rs,this,t[0],"exactPartial")},required(...t){return k.required(is,this,t[0])}});function y$(t,e){let r={type:"object",shape:t??{},...k.normalizeParams(e)};return new ti(r)}function $$(t,e){return new ti({type:"object",shape:t,catchall:es(),...k.normalizeParams(e)})}function b$(t,e){return new ti({type:"object",shape:t,catchall:Yt(),...k.normalizeParams(e)})}var ni=v("ZodUnion",(t,e)=>{Ur.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Oa(t,r,i,n),t.options=e.options});function Gn(t,e){return new ni({type:"union",options:t,...k.normalizeParams(e)})}var mp=v("ZodXor",(t,e)=>{ni.init(t,e),Tl.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Oa(t,r,i,n),t.options=e.options});function _$(t,e){return new mp({type:"union",options:t,inclusive:!1,...k.normalizeParams(e)})}var hp=v("ZodDiscriminatedUnion",(t,e)=>{ni.init(t,e),Ll.init(t,e)});function w$(t,e,r){return new hp({type:"union",options:e,discriminator:t,...k.normalizeParams(r)})}var gp=v("ZodIntersection",(t,e)=>{Zl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Nf(t,r,i,n)});function vp(t,e){return new gp({type:"intersection",left:t,right:e})}var yp=v("ZodTuple",(t,e)=>{Qt(),Mo.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Af(t,r,i,n)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map(e=>new ri({type:"optional",innerType:e}))})}});function $p(t,e,r){let i=e instanceof C,n=i?r:e,o=i?e:null;return new yp({type:"tuple",items:t,rest:o,...k.normalizeParams(n)})}var Rn=v("ZodRecord",(t,e)=>{Qt(),Ml.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>jf(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});function bp(t,e,r){return!e||!e._zod?new Rn({type:"record",keyType:Hr(),valueType:t,...k.normalizeParams(e)}):new Rn({type:"record",keyType:t,valueType:e,...k.normalizeParams(r)})}function k$(t,e,r){return new Rn({type:"record",keyType:t,valueType:e,...k.normalizeParams(r),partial:!0})}function S$(t,e,r){return new Rn({type:"record",keyType:t,valueType:e,mode:"loose",...k.normalizeParams(r)})}var _p=v("ZodMap",(t,e)=>{Qt(),Vl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>If(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(Ke(...r)),t.nonempty=r=>t.check(Ke(1,r)),t.max=(...r)=>t.check(ht(...r)),t.size=(...r)=>t.check(Wt(...r))});function x$(t,e,r){return new _p({type:"map",keyType:t,valueType:e,...k.normalizeParams(r)})}var wp=v("ZodSet",(t,e)=>{Qt(),Rl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Of(t,r,i,n),t.min=(...r)=>t.check(Ke(...r)),t.nonempty=r=>t.check(Ke(1,r)),t.max=(...r)=>t.check(ht(...r)),t.size=(...r)=>t.check(Wt(...r))});function I$(t,e){return new wp({type:"set",valueType:t,...k.normalizeParams(e)})}var Fn=v("ZodEnum",(t,e)=>{Fl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>vf(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 a of i)if(r.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Fn({...e,checks:[],...k.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Fn({...e,checks:[],...k.normalizeParams(n),entries:o})}});function ts(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Fn({type:"enum",entries:r,...k.normalizeParams(e)})}function O$(t,e){return new Fn({type:"enum",entries:t,...k.normalizeParams(e)})}var kp=v("ZodLiteral",(t,e)=>{ql.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yf(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 kp({type:"literal",values:Array.isArray(t)?t:[t],...k.normalizeParams(e)})}var Sp=v("ZodFile",(t,e)=>{Jl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_f(t,r,i,n),t.min=(r,i)=>t.check(Ke(r,i)),t.max=(r,i)=>t.check(ht(r,i)),t.mime=(r,i)=>t.check(Dn(Array.isArray(r)?r:[r],i))});function P$(t){return Bd(Sp,t)}var xp=v("ZodTransform",(t,e)=>{Qt(),Kl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xf(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new ft(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(k.issue(o,r.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=r.value),a.inst??(a.inst=t),r.issues.push(k.issue(a))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function ns(t){return new xp({type:"transform",transform:t})}var ri=v("ZodOptional",(t,e)=>{Vo.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>za(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Xt(t){return new ri({type:"optional",innerType:t})}var rs=v("ZodExactOptional",(t,e)=>{Bl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>za(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Ip(t){return new rs({type:"optional",innerType:t})}var Op=v("ZodNullable",(t,e)=>{Wl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ef(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Yr(t){return new Op({type:"nullable",innerType:t})}function N$(t){return Xt(Yr(t))}var zp=v("ZodDefault",(t,e)=>{Gl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Pp(t,e){return new zp({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():k.shallowClone(e)}})}var Np=v("ZodPrefault",(t,e)=>{Hl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Uf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Ap(t,e){return new Np({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():k.shallowClone(e)}})}var is=v("ZodNonOptional",(t,e)=>{Yl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Df(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function jp(t,e){return new is({type:"nonoptional",innerType:t,...k.normalizeParams(e)})}var Ep=v("ZodSuccess",(t,e)=>{Xl.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>wf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function A$(t){return new Ep({type:"success",innerType:t})}var Dp=v("ZodCatch",(t,e)=>{Ql.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Lf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Cp(t,e){return new Dp({type:"catch",innerType:t,catchValue:typeof e=="function"?e:k.constantCatch(e)})}var Tp=v("ZodNaN",(t,e)=>{ed.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$f(t,r,i,n)});function j$(t){return Jd(Tp,t)}var ii=v("ZodPipe",(t,e)=>{Ro.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zf(t,r,i,n),t.in=e.in,t.out=e.out});function Da(t,e){return new ii({type:"pipe",in:t,out:e})}var oi=v("ZodCodec",(t,e)=>{ii.init(t,e),Lr.init(t,e)});function E$(t,e,r){return new oi({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function D$(t){let e=t._zod.def;return new oi({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var Up=v("ZodPreprocess",(t,e)=>{ii.init(t,e),td.init(t,e)}),Lp=v("ZodReadonly",(t,e)=>{nd.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Zp(t){return new Lp({type:"readonly",innerType:t})}var Mp=v("ZodTemplateLiteral",(t,e)=>{rd.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bf(t,r,i,n)});function C$(t,e){return new Mp({type:"template_literal",parts:t,...k.normalizeParams(e)})}var Vp=v("ZodLazy",(t,e)=>{Zr.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rf(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});function Rp(t){return new Vp({type:"lazy",getter:t})}var Fp=v("ZodPromise",(t,e)=>{od.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function T$(t){return new Fp({type:"promise",innerType:t})}var qp=v("ZodFunction",(t,e)=>{id.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sf(t,r,i,n)});function U$(t){return new qp({type:"function",input:Array.isArray(t?.input)?$p(t?.input):t?.input??ei(Yt()),output:t?.output??Yt()})}var ai=v("ZodCustom",(t,e)=>{ad.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>kf(t,r,i,n)});function L$(t){let e=new W({check:"custom"});return e._zod.check=t,e}function Z$(t,e){return Wd(ai,t??(()=>!0),e)}function Jp(t,e={}){return Gd(ai,t,e)}function Kp(t,e){return Hd(t,e)}var M$=Yd,V$=Xd;function R$(t,e={}){let r=new ai({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...k.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 F$=(...t)=>Qd({Codec:oi,Boolean:Bn,String:qn},...t);function q$(t){let e=Rp(()=>Gn([Hr(t),rp(),ip(),cp(),ei(e),bp(Hr(),e)]));return e}function J$(t,e){return new Up({type:"pipe",in:ns(t),out:e})}var lz={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 dz(t){Q({customError:t})}function fz(){return Q().customError}var Bp;Bp||(Bp={});var si={};Xe(si,{ZodISODate:()=>bt,ZodISODateTime:()=>$t,ZodISODuration:()=>wt,ZodISOTime:()=>_t,date:()=>mz,datetime:()=>pz,duration:()=>gz,time:()=>hz});function pz(t){return qr($t,t)}function mz(t){return Jr(bt,t)}function hz(t){return Kr(_t,t)}function gz(t){return Br(wt,t)}var A={...Hn,...Aa,iso:si},vz=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 yz(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 K$(t,e){return t.map((r,i)=>i<e?r:r.optional())}function $z(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function bz(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]===void 0?void 0:$z(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 _z(t,e){return A.transform(i=>i).check(i=>{let n=i.value;if(!(typeof n!="object"||n===null||Array.isArray(n)))for(let o of Object.getOwnPropertyNames(n)){let a=e.safeParse(o);a.success||i.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:o,path:[o],continue:!0})}}).pipe(t)}function B$(t,e){if(t!==!1)return t===void 0||t===!0?A.any():Se(t,e)}var wz=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function W$(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return A.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 A.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=bz(n,e),a=Se(o,e);return e.refs.set(n,a),e.processing.delete(n),a}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 A.null();if(n.length===0)return A.never();if(n.length===1)return A.literal(n[0]);if(n.every(a=>typeof a=="string"))return A.enum(n);let o=n.map(a=>A.literal(a));return o.length<2?o[0]:A.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return A.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let a={...t,type:o};return W$(a,e)});return n.length===0?A.never():n.length===1?n[0]:A.union(n)}if(!r)return A.any();let i;switch(r){case"string":{let n=A.string();if(t.format){let o=t.format;o==="email"?n=n.check(A.email()):o==="uri"||o==="uri-reference"?n=n.check(A.url()):o==="uuid"||o==="guid"?n=n.check(A.uuid()):o==="date-time"?n=n.check(A.iso.datetime({offset:!0})):o==="date"?n=n.check(A.iso.date()):o==="time"?n=n.check(A.regex(wz)):o==="duration"?n=n.check(A.iso.duration()):o==="hostname"?n=n.check(A.hostname()):o==="ipv4"?n=n.check(A.ipv4()):o==="ipv6"?n=n.check(A.ipv6()):o==="mac"?n=n.check(A.mac()):o==="cidr"?n=n.check(A.cidrv4()):o==="cidr-v6"?n=n.check(A.cidrv6()):o==="base64"?n=n.check(A.base64()):o==="base64url"?n=n.check(A.base64url()):o==="e164"?n=n.check(A.e164()):o==="credit_card"?n=n.check(A.creditCard()):o==="jwt"?n=n.check(A.jwt()):o==="emoji"?n=n.check(A.emoji()):o==="nanoid"?n=n.check(A.nanoid()):o==="cuid"?n=n.check(A.cuid()):o==="cuid2"?n=n.check(A.cuid2()):o==="ulid"?n=n.check(A.ulid()):o==="xid"?n=n.check(A.xid()):o==="ksuid"&&(n=n.check(A.ksuid()))}typeof 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"?A.number().int():A.number();typeof t.minimum=="number"&&t.exclusiveMinimum!==!0&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&t.exclusiveMaximum!==!0&&(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=A.boolean();break}case"null":{i=A.null();break}case"object":{let n={},o=t.properties||{},a=new Set(t.required||[]),s=typeof t.additionalProperties=="object"?Se(t.additionalProperties,e):void 0;for(let[c,u]of Object.entries(o)){let l=Se(u,e);X(n,c,a.has(c)?l:l.optional())}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),l=[];for(let f of u){let p=Se(c[f],e),m=A.string().regex(new RegExp(f));l.push(A.looseRecord(m,p))}let d=[];if(Object.keys(n).length>0&&d.push(A.object(n).passthrough()),d.push(...l),d.length===0)i=A.object({}).passthrough();else if(d.length===1)i=d[0];else{let f=A.intersection(d[0],d[1]);for(let p=2;p<d.length;p++)f=A.intersection(f,d[p]);i=f}if(t.additionalProperties===!1){let f=Object.keys(n),p=u.map(h=>new RegExp(h)),m=i;i=i.check(h=>{if(!Ee(h.value))return;let g=[];for(let S of Object.keys(h.value))f.includes(S)||p.some(b=>b.test(S))||g.push(S);g.length&&h.issues.push({code:"unrecognized_keys",keys:g,input:h.value,inst:m})})}}else{let c=A.object(n);t.additionalProperties===!1?i=c.strict():s?i=c.catchall(s):i=c.passthrough()}if(t.propertyNames!==void 0&&t.propertyNames!==!0){let c=typeof t.propertyNames=="object"&&t.propertyNames.type===void 0?{type:"string",...t.propertyNames}:t.propertyNames;i=_z(i,Se(c,e))}break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let a=typeof t.minItems=="number"?t.minItems:0,s=n.map(d=>Se(d,e)),c=K$(s,a),u=Array.isArray(o)?void 0:B$(o,e),l=A.tuple(c);i=u?l.rest(u):l,typeof t.minItems=="number"&&(i=i.check(A.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(A.maxLength(t.maxItems)))}else if(Array.isArray(o)){let a=typeof t.minItems=="number"?t.minItems:0,s=o.map(d=>Se(d,e)),c=K$(s,a),u=B$(t.additionalItems,e),l=A.tuple(c);i=u?l.rest(u):l,typeof t.minItems=="number"&&(i=i.check(A.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(A.maxLength(t.maxItems)))}else if(o!==void 0){let a=Se(o,e),s=A.array(a);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),i=s}else i=A.array(A.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}function Se(t,e){if(typeof t=="boolean")return t?A.any():A.never();let r=W$(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(u=>Se(u,e)),c=A.union(s);r=i?A.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(u=>Se(u,e)),c=A.xor(s);r=i?A.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:A.any();else{let s=i?r:Se(t.allOf[0],e),c=i?0:1;for(let u=c;u<t.allOf.length;u++)s=A.intersection(s,Se(t.allOf[u],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=A.nullable(r)),t.readOnly===!0&&(r=A.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in t&&(n[s]=t[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in t&&(n[s]=t[s]);t.propertyNames!==void 0&&t.type==="object"&&t.$ref===void 0&&(n.propertyNames=t.propertyNames);for(let s of Object.keys(t))vz.has(s)||X(n,s,t[s]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function G$(t,e){if(typeof t=="boolean")return t?A.any():A.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=yz(r,e?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ce};return Se(r,o)}var H$=Symbol("z.visit/resolving");function ci(t,e){let r=typeof e=="function"?e:(a,s)=>{let c=e[a._zod.def.type];return c?c(a,s):a},i=new Map;function n(a){let s=i.get(a);if(s===H$)return new Zr({type:"lazy",getter:()=>i.get(a)});if(s!==void 0)return s;i.set(a,H$);let c=o(a),u=r(c,c!==a);return i.set(a,u),u}function o(a){let s=a._zod.def,c=s.type;switch(c){case"object":{let u=s.shape,l=Object.keys(u),d=!1,f={};for(let m of l){let h=n(u[m]);h!==u[m]&&(d=!0),f[m]=h}let p=s.catchall;return s.catchall&&(p=n(s.catchall),p!==s.catchall&&(d=!0)),d?F(a,{...s,shape:f,catchall:p}):a}case"array":{let u=n(s.element);return u===s.element?a:F(a,{...s,element:u})}case"tuple":{let u=s.items,l=!1,d=[];for(let p of u){let m=n(p);m!==p&&(l=!0),d.push(m)}let f=s.rest;return s.rest&&(f=n(s.rest),f!==s.rest&&(l=!0)),l?F(a,{...s,items:d,rest:f}):a}case"record":case"map":{let u=n(s.keyType),l=n(s.valueType);return u===s.keyType&&l===s.valueType?a:F(a,{...s,keyType:u,valueType:l})}case"set":{let u=n(s.valueType);return u===s.valueType?a:F(a,{...s,valueType:u})}case"union":{let u=s.options,l=!1,d=[];for(let f of u){let p=n(f);p!==f&&(l=!0),d.push(p)}return l?F(a,{...s,options:d}):a}case"intersection":{let u=n(s.left),l=n(s.right);return u===s.left&&l===s.right?a:F(a,{...s,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=n(s.innerType);return u===s.innerType?a:F(a,{...s,innerType:u})}case"pipe":{let u=n(s.in),l=n(s.out);return u===s.in&&l===s.out?a:F(a,{...s,in:u,out:l})}case"function":{let u=n(s.input),l=n(s.output);return u===s.input&&l===s.output?a:F(a,{...s,input:u,output:l})}case"lazy":{let u=s.getter,{_cachedInner:l,...d}=s;return F(a,{...d,getter:()=>n(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return n(t)}function Y$(t){return ci(t,{object:e=>e.partial(),union:e=>{let r=e._zod.def;return r.discriminator===void 0?e:Gn(r.options)}})}function kz(t,e){if(!e?.length)return t;let r=t._zod.def;return F(t,Le(r,{checks:[...r.checks??[],...e]}),{parent:!0})}function X$(t){return kz(t.out,t.checks)}function Sz(t){return t.in._zod.traits.has("$ZodTransform")?X$(t):t.in}function Q$(t){return ci(t,{pipe:e=>Sz(e._zod.def),default:(e,r)=>r?Xt(e._zod.def.innerType):e,catch:(e,r)=>r?e._zod.def.innerType:e})}function eb(t){return ci(t,{pipe:e=>X$(e._zod.def),prefault:(e,r)=>r?e._zod.def.innerType:e})}var Wp={};Xe(Wp,{bigint:()=>zz,boolean:()=>Oz,date:()=>Pz,number:()=>Iz,string:()=>xz});function xz(t){return $d(qn,t)}function Iz(t){return Sd(Kn,t)}function Oz(t){return Ad(Bn,t)}function zz(t){return Ed(Wn,t)}function Pz(t){return qd(Qr,t)}var Fw=fn(cn(),1);var rj=T.object({id:T.string().regex(/^[\w.-]+$/,"id\uB294 \uC601\uBB38\xB7\uC22B\uC790\xB7._- \uB9CC \uD5C8\uC6A9"),source:T.string().optional(),tags:T.array(T.string()).optional()}),ij=T.object({id:T.string().regex(/^[\w.-]+$/,"id\uB294 \uC601\uBB38\xB7\uC22B\uC790\xB7._- \uB9CC \uD5C8\uC6A9"),source:T.string(),into:T.string().regex(/^[^/\\][^\\]*$/,"into \uB294 \uB8E8\uD2B8 \uAE30\uC900 \uC0C1\uB300 \uACBD\uB85C (POSIX)").optional(),install:T.string().optional()}),de="packages",oj=T.record(T.string(),T.array(rj)),aj=T.record(T.string(),T.array(T.string())),sj=T.object({version:T.literal(1),agent:T.string().default("claude-code"),ignore:T.array(T.string()).optional(),exclude:T.array(T.string()).optional(),components:oj.default({}),packages:T.array(ij).default([]),profiles:T.record(T.string(),aj).default({})}),rc=class extends Error{};function ic(t,e,r){let i=Fw.default.parse(t),n=sj.safeParse(i);if(!n.success){let c=n.error.issues.map(u=>` ${u.path.join(".")||"(root)"}: ${u.message}`);throw new rc(`lshed.yaml \uD615\uC2DD \uC624\uB958:
|
|
225
|
+
${c.join(`
|
|
226
|
+
`)}`)}let o=n.data,a=[];for(let[c,u]of Object.entries(o.components)){e&&!e.includes(c)&&a.push(`\uC54C \uC218 \uC5C6\uB294 \uCE74\uD14C\uACE0\uB9AC "${c}" (\uC5B4\uB311\uD130 ${o.agent}: ${e.join(", ")})`);let l=new Set;for(let d of u){l.has(d.id)&&a.push(`${c}: id "${d.id}" \uC911\uBCF5`),l.add(d.id);try{ig(ze(Zi(c,d)))||a.push(`${c}/${d.id}: \uBD80\uD488 \uCD9C\uCC98\uB294 file:/github:/git: \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`)}catch(f){a.push(`${c}/${d.id}: ${f.message}`)}}}let s=new Set;for(let c of o.packages){s.has(c.id)&&a.push(`packages: id "${c.id}" \uC911\uBCF5`),s.add(c.id);try{let u=ze(c.source),l=u.scheme==="other"?u.name:u.scheme;l==="file"?a.push(`packages/${c.id}: \uD328\uD0A4\uC9C0 \uCD9C\uCC98\uB294 file: \uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4`):r&&!r.includes(l)&&a.push(`packages/${c.id}: \uC2A4\uD0B4 "${l}" \uC744 \uB2E4\uB8F0 \uC124\uCE58\uAE30\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 (${r.join(", ")})`),(l==="github"||l==="git")&&!c.into&&a.push(`packages/${c.id}: ${l}: \uD328\uD0A4\uC9C0\uB294 into \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4`)}catch(u){a.push(`packages/${c.id}: ${u.message}`)}}for(let[c,u]of Object.entries(o.profiles))for(let[l,d]of Object.entries(u)){if(l===de){for(let p of d)s.has(p)||a.push(`profiles.${c}.packages: "${p}" \uB294 packages \uC5D0 \uC5C6\uC74C`);continue}let f=new Set((o.components[l]??[]).map(p=>p.id));for(let p of d)f.has(p)||a.push(`profiles.${c}.${l}: "${p}" \uB294 components\uC5D0 \uC5C6\uC74C`)}if(a.length)throw new rc(`lshed.yaml \uCC38\uC870 \uC624\uB958:
|
|
227
|
+
${a.map(c=>" "+c).join(`
|
|
228
|
+
`)}`);return o}function Zi(t,e,r="dir"){let i=r==="file"?".md":r==="entry"?".json":"";return e.source??`file:./${t}/${e.id}${i}`}function cr(t,e){return(t.profiles[e]?.[de]??[]).map(i=>t.packages.find(n=>n.id===i))}import cj from"path";function qw(t,e){let r=ze(e);if(r.scheme==="file")return cj.resolve(t,r.path);throw new Error(`"${e}": ${r.scheme}: \uCD9C\uCC98\uB294 v0.2\uC5D0\uC11C \uC9C0\uC6D0\uB429\uB2C8\uB2E4. \uC9C0\uAE08\uC740 file: \uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`)}function Jw(t){return ze(t).scheme==="file"}import{promises as Ph}from"fs";import Kw from"path";var uj=T.object({profile:T.string(),shed:T.string(),managed:T.array(T.string()),appliedAt:T.string()}),Mi="lshed";function Nh(t){return Kw.join(t.root,Mi,"state.json")}async function le(t){try{let e=JSON.parse(await Ph.readFile(Nh(t),"utf8"));return uj.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw new Error(`state.json \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (${Nh(t)}): ${e.message}`)}}async function ur(t,e){let r=Nh(t);await Ph.mkdir(Kw.dirname(r),{recursive:!0}),await Ph.writeFile(r,JSON.stringify(e,null,2)+`
|
|
229
|
+
`)}function Ww(t,e,r){return new Promise((i,n)=>{let o=dj(t,e,{cwd:r,stdio:"inherit",shell:process.platform==="win32"});o.on("error",n),o.on("close",a=>a===0?i():n(new Error(`${t} ${e.join(" ")} \uAC00 ${a} \uB85C \uB05D\uB0AC\uC2B5\uB2C8\uB2E4`)))})}function oc(t){return[kg,...t.adapter.installers()].sort((e,r)=>e.priority-r.priority)}function Vi(t,e){let r=ze(e),i=r.scheme==="other"?r.name:r.scheme,n=oc(t).find(o=>o.schemes.includes(i));if(!n)throw new Error(`"${e}": \uC2A4\uD0B4 ${i} \uC744 \uB2E4\uB8F0 \uC124\uCE58\uAE30\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4`);return n}var ac="lshed.yaml",Oe="instructions",Ah=`${Mi}/instructions`;function Te(t){return Bw.join(t.shed,ac)}function fj(t){return[...t.categories().map(e=>e.name),...t.entries().map(e=>e.name),Oe]}async function fe(t){let e;try{e=await lj.readFile(Te(t),"utf8")}catch{throw new Error(`\uCC3D\uACE0\uC5D0 ${ac} \uC774 \uC5C6\uC2B5\uB2C8\uB2E4: ${t.shed}
|
|
230
|
+
\uBA3C\uC800 'lshed init --shed ${t.shed}' \uB97C \uC2E4\uD589\uD558\uC138\uC694.`)}let r=ic(e,fj(t.adapter),oc(t).flatMap(i=>[...i.schemes]));return t.ignore=[...ut,...r.ignore??[]],r}function ge(t){return t.ignore??ut}function Ri(t,e){return t===Oe?`${Ah}/${e}.md`:t.kind==="entry"?`${t.name}:${e}`:t.kind==="dir"?`${t.root}/${e}`:`${t.root}/${e}.md`}function jh(t,e){let r=e.indexOf(":");if(r<=0)return;let i=t.adapter.entries().find(n=>n.name===e.slice(0,r));return i?{cat:i,id:e.slice(r+1)}:void 0}function Eh(t,e){return e===Oe?"file":t.adapter.entries().some(r=>r.name===e)?"entry":t.adapter.categories().find(r=>r.name===e)?.kind??"dir"}function Dh(t,e,r){return qw(t.shed,Zi(e,r,Eh(t,e)))}function Ch(t,e,r){let i=(t.components[e]??[]).find(n=>n.id===r);if(!i)throw new Error(`${e}/${r} \uB294 components \uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4`);return i}function Et(t,e,r){let i=e.profiles[r];if(!i){let o=Object.keys(e.profiles);throw new Error(`\uD504\uB85C\uD544 "${r}" \uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uC788\uB294 \uD504\uB85C\uD544: ${o.length?o.join(", "):"(\uC5C6\uC74C)"}`)}let n=[];for(let[o,a]of Object.entries(i)){if(o===de)continue;let s=o===Oe?Oe:t.adapter.categories().find(u=>u.name===o)??t.adapter.entries().find(u=>u.name===o);if(!s)throw new Error(`\uD504\uB85C\uD544 "${r}": \uC5B4\uB311\uD130 ${t.adapter.name} \uC740 \uCE74\uD14C\uACE0\uB9AC "${o}" \uB97C \uBAA8\uB985\uB2C8\uB2E4`);let c=s!==Oe&&s.kind==="entry"?s:void 0;for(let u of a){let l=Ch(e,o,u);n.push({category:o,id:u,rel:Ri(s,u),src:Dh(t,o,l),component:l,entry:c})}}return n}function He(t,e){return Bw.join(t.adapter.root,...e.split("/"))}var hk=fn(cn(),1);import{promises as qi}from"fs";import Fh from"path";import pj from"path";var Gw="<!-- generated by lshed";function sc(t){return pj.join(t.adapter.root,t.adapter.instructionsFileName())}function cc(t){return t.trimStart().startsWith(Gw)}function Hw(t,e,r){let i=`${Gw}; profile: ${e} -->
|
|
749
231
|
<!-- Do not edit this file. Edit the fragments in your shed and run 'lshed restore'. -->
|
|
750
232
|
|
|
751
|
-
`;
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
${
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
import
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
var
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
});
|
|
770
|
-
|
|
771
|
-
async function
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
} catch (
|
|
775
|
-
|
|
776
|
-
throw new Error(`${LOCK_FILE} \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${e.message}`);
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
async function writeLock(shed, lock) {
|
|
780
|
-
const sorted = { version: 1, packages: Object.fromEntries(Object.entries(lock.packages).sort()) };
|
|
781
|
-
await fs8.writeFile(path11.join(shed, LOCK_FILE), "# generated by lshed \u2014 do not edit; 'lshed update' refreshes it\n" + YAML2.stringify(sorted));
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
// src/core/discover.ts
|
|
785
|
-
import path13 from "path";
|
|
786
|
-
|
|
787
|
-
// src/core/packages.ts
|
|
788
|
-
import { promises as fs9 } from "fs";
|
|
789
|
-
import path12 from "path";
|
|
790
|
-
async function detectPackages(ctx, found) {
|
|
791
|
-
const out = [];
|
|
792
|
-
for (const inst of installersFor(ctx)) out.push(...await inst.detect(ctx, found));
|
|
793
|
-
return out;
|
|
794
|
-
}
|
|
795
|
-
async function detectGenerated(found, pkgs) {
|
|
796
|
-
const out = /* @__PURE__ */ new Map();
|
|
797
|
-
const located = pkgs.filter((p) => p.path);
|
|
798
|
-
if (!located.length) return out;
|
|
799
|
-
const roots = await Promise.all(located.map(async (p) => ({ id: p.id, real: await fs9.realpath(p.path) })));
|
|
800
|
-
for (const f of found) {
|
|
801
|
-
if (located.some((p) => p.path === f.path)) continue;
|
|
802
|
-
let entries;
|
|
803
|
-
try {
|
|
804
|
-
if (!(await fs9.stat(f.path)).isDirectory()) continue;
|
|
805
|
-
entries = await fs9.readdir(f.path);
|
|
806
|
-
} catch {
|
|
807
|
-
continue;
|
|
808
|
-
}
|
|
809
|
-
for (const name of entries) {
|
|
810
|
-
const p = path12.join(f.path, name);
|
|
811
|
-
let target;
|
|
812
|
-
try {
|
|
813
|
-
if (!(await fs9.lstat(p)).isSymbolicLink()) continue;
|
|
814
|
-
target = await fs9.realpath(p).catch(async () => path12.resolve(f.path, await fs9.readlink(p)));
|
|
815
|
-
} catch {
|
|
816
|
-
continue;
|
|
817
|
-
}
|
|
818
|
-
const owner = roots.find((r) => target === r.real || target.startsWith(r.real + path12.sep));
|
|
819
|
-
if (owner) {
|
|
820
|
-
out.set(`${f.category}/${f.id}`, owner.id);
|
|
821
|
-
break;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
return out;
|
|
826
|
-
}
|
|
827
|
-
async function packageStatus(ctx, pkg, lock) {
|
|
828
|
-
const st = await installerFor(ctx, pkg.source).status(ctx, pkg);
|
|
829
|
-
return { pkg, ...st, locked: lock.packages[pkg.id]?.rev || void 0 };
|
|
830
|
-
}
|
|
831
|
-
var short = (r) => r && /^[0-9a-f]{40}$/.test(r) ? r.slice(0, 7) : r;
|
|
832
|
-
function ordered(ctx, pkgs) {
|
|
833
|
-
return pkgs.map((p, i) => ({ p, i, pr: installerFor(ctx, p.source).priority })).sort((a, b) => a.pr - b.pr || a.i - b.i).map((x2) => x2.p);
|
|
834
|
-
}
|
|
835
|
-
async function ensurePackages(ctx, pkgs, opts = {}) {
|
|
836
|
-
const lock = await readLock(ctx.shed);
|
|
837
|
-
const res = { installed: [], pendingInstalls: [], lockChanged: false };
|
|
838
|
-
for (const pkg of ordered(ctx, pkgs)) {
|
|
839
|
-
const inst = installerFor(ctx, pkg.source);
|
|
840
|
-
const st = await packageStatus(ctx, pkg, lock);
|
|
841
|
-
if (st.present) {
|
|
842
|
-
const note = st.locked && st.rev !== st.locked ? ` (${short(st.rev)} \u2260 lock ${short(st.locked)})` : "";
|
|
843
|
-
ctx.log(` = package ${pkg.id}${note}`);
|
|
844
|
-
continue;
|
|
845
|
-
}
|
|
846
|
-
ctx.log(` + package ${pkg.id} (${inst.describe(pkg, st.locked)})`);
|
|
847
|
-
if (opts.dryRun) continue;
|
|
848
|
-
const rev = await inst.install(ctx, pkg, st.locked, opts);
|
|
849
|
-
if (rev !== st.locked) {
|
|
850
|
-
if (st.locked) ctx.log(` \uB77D\uC740 ${short(st.locked)} \uC774\uC9C0\uB9CC ${short(rev)} \uC774 \uC124\uCE58\uB428. \uB77D\uC744 \uB530\uB77C\uAC00\uAC8C \uAC31\uC2E0`);
|
|
851
|
-
lock.packages[pkg.id] = { source: pkg.source, rev };
|
|
852
|
-
res.lockChanged = true;
|
|
853
|
-
}
|
|
854
|
-
res.installed.push(pkg.id);
|
|
855
|
-
await maybeInstall(ctx, pkg, inst.cwd(ctx, pkg), opts, res);
|
|
856
|
-
}
|
|
857
|
-
if (res.lockChanged) await writeLock(ctx.shed, lock);
|
|
858
|
-
return res;
|
|
859
|
-
}
|
|
860
|
-
async function maybeInstall(ctx, pkg, dir, opts, res) {
|
|
861
|
-
if (!pkg.install) return;
|
|
862
|
-
if (opts.yes) {
|
|
863
|
-
ctx.log(` $ (${path12.relative(ctx.adapter.root, dir) || "."}) ${pkg.install}`);
|
|
864
|
-
await runShell(pkg.install, dir);
|
|
865
|
-
} else {
|
|
866
|
-
res.pendingInstalls.push({ id: pkg.id, dir, cmd: pkg.install });
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
function reportPending(ctx, res) {
|
|
870
|
-
if (!res.pendingInstalls.length) return;
|
|
871
|
-
ctx.log(`
|
|
872
|
-
\uC124\uCE58 \uBA85\uB839 ${res.pendingInstalls.length}\uAC1C\uB97C \uC2E4\uD589\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uD655\uC778 \uD6C4 '--yes' \uB85C \uB2E4\uC2DC \uC2E4\uD589\uD558\uAC70\uB098 \uC9C1\uC811 \uB3CC\uB9AC\uC138\uC694:`);
|
|
873
|
-
for (const p of res.pendingInstalls) ctx.log(` cd ${p.dir} && ${p.cmd}`);
|
|
874
|
-
}
|
|
875
|
-
async function updatePackages(ctx, pkgs, opts = {}) {
|
|
876
|
-
const lock = await readLock(ctx.shed);
|
|
877
|
-
const res = { installed: [], pendingInstalls: [], lockChanged: false };
|
|
878
|
-
for (const pkg of ordered(ctx, pkgs)) {
|
|
879
|
-
const inst = installerFor(ctx, pkg.source);
|
|
880
|
-
const st = await packageStatus(ctx, pkg, lock);
|
|
881
|
-
if (!st.present) {
|
|
882
|
-
ctx.log(` ! package ${pkg.id}: \uC124\uCE58\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC74C. \uBA3C\uC800 restore \uD558\uC138\uC694`);
|
|
883
|
-
continue;
|
|
884
|
-
}
|
|
885
|
-
if (opts.dryRun) {
|
|
886
|
-
ctx.log(` ~ package ${pkg.id} (${inst.name} update)`);
|
|
887
|
-
continue;
|
|
888
|
-
}
|
|
889
|
-
const now = await inst.update(ctx, pkg, opts);
|
|
890
|
-
const before = lock.packages[pkg.id]?.rev;
|
|
891
|
-
if (now !== before) {
|
|
892
|
-
lock.packages[pkg.id] = { source: pkg.source, rev: now };
|
|
893
|
-
res.lockChanged = true;
|
|
894
|
-
ctx.log(` \u2191 package ${pkg.id} ${before ? short(before) : "(\uC5C6\uC74C)"} \u2192 ${short(now)}`);
|
|
895
|
-
await maybeInstall(ctx, pkg, inst.cwd(ctx, pkg), opts, res);
|
|
896
|
-
} else {
|
|
897
|
-
ctx.log(` = package ${pkg.id} ${short(now)} (\uCD5C\uC2E0)`);
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
if (res.lockChanged) await writeLock(ctx.shed, lock);
|
|
901
|
-
return res;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
// src/core/discover.ts
|
|
905
|
-
var keyOf = (f) => `${f.category}/${f.id}`;
|
|
906
|
-
async function discover(ctx, exclude = []) {
|
|
907
|
-
const isExcluded = (cat, id) => exclude.some((e) => e === id || e === `${cat}/${id}`);
|
|
908
|
-
const excluded = [];
|
|
909
|
-
const items = [];
|
|
910
|
-
const all = await ctx.adapter.scan();
|
|
911
|
-
const pkgs = await detectPackages(ctx, all);
|
|
912
|
-
const kept = pkgs.filter((p) => {
|
|
913
|
-
if (isExcluded("packages", p.id)) {
|
|
914
|
-
excluded.push(`packages/${p.id}`);
|
|
915
|
-
return false;
|
|
916
|
-
}
|
|
917
|
-
return true;
|
|
918
|
-
});
|
|
919
|
-
const generated = await detectGenerated(all, kept);
|
|
920
|
-
for (const p of kept) items.push({ kind: "package", category: "packages", id: p.id, pkg: p });
|
|
921
|
-
for (const cat of ctx.adapter.categories()) {
|
|
922
|
-
for (const f of all.filter((f2) => f2.category === cat.name)) {
|
|
923
|
-
if (pkgs.some((p) => p.path === f.path) || generated.has(keyOf(f))) continue;
|
|
924
|
-
if (isExcluded(f.category, f.id)) {
|
|
925
|
-
excluded.push(keyOf(f));
|
|
926
|
-
continue;
|
|
927
|
-
}
|
|
928
|
-
items.push({ kind: "component", category: cat.name, id: f.id, path: f.path, cat });
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
for (const cat of ctx.adapter.entries()) {
|
|
932
|
-
const all2 = await cat.read();
|
|
933
|
-
for (const id of Object.keys(all2).sort()) {
|
|
934
|
-
if (isExcluded(cat.name, id)) {
|
|
935
|
-
excluded.push(`${cat.name}/${id}`);
|
|
936
|
-
continue;
|
|
937
|
-
}
|
|
938
|
-
if (!/^[\w.-]+$/.test(id)) {
|
|
939
|
-
ctx.log(` ! ${cat.name}/${id}: \uC774\uB984\uC5D0 \uC4F8 \uC218 \uC5C6\uB294 \uBB38\uC790\uAC00 \uC788\uC5B4 \uAC74\uB108\uB700`);
|
|
940
|
-
continue;
|
|
941
|
-
}
|
|
942
|
-
const owner = kept.find((p) => p.path && JSON.stringify(all2[id]).includes(p.path));
|
|
943
|
-
const warn = owner ? `\uD328\uD0A4\uC9C0 ${owner.id} \uC548\uC744 \uAC00\uB9AC\uD0B5\uB2C8\uB2E4. \uADF8 \uC124\uCE58\uAC00 \uB9CC\uB4E0 \uAC83\uC774\uBA74 exclude \uD558\uC138\uC694: ${cat.name}/${id}` : void 0;
|
|
944
|
-
items.push({ kind: "entry", category: cat.name, id, value: all2[id], cat, warn });
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
return { items, generated, excluded };
|
|
948
|
-
}
|
|
949
|
-
function notInManifest(m, d) {
|
|
950
|
-
return d.items.filter(
|
|
951
|
-
(f) => f.kind === "package" ? !m.packages.some((p) => p.id === f.id) : !(m.components[f.category] ?? []).some((c) => c.id === f.id)
|
|
952
|
-
);
|
|
953
|
-
}
|
|
954
|
-
function inManifestNotInProfile(m, profile, d) {
|
|
955
|
-
const p = m.profiles[profile] ?? {};
|
|
956
|
-
return d.items.filter((f) => !notInManifest(m, d).includes(f)).filter((f) => !(p[f.category] ?? []).includes(f.id)).map(keyOf);
|
|
957
|
-
}
|
|
958
|
-
function shortRev(rev) {
|
|
959
|
-
return /^[0-9a-f]{40}$/.test(rev) ? rev.slice(0, 7) : rev;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
// src/core/ingest.ts
|
|
963
|
-
import path15 from "path";
|
|
964
|
-
import { isSeq, isMap } from "yaml";
|
|
965
|
-
|
|
966
|
-
// src/core/entries.ts
|
|
967
|
-
import { promises as fs10 } from "fs";
|
|
968
|
-
import os2 from "os";
|
|
969
|
-
import path14 from "path";
|
|
970
|
-
var SECRET_WORDS = /* @__PURE__ */ new Set(["key", "apikey", "token", "secret", "password", "passwd", "auth", "authorization", "credential", "credentials", "cookie", "session"]);
|
|
971
|
-
function isSecretKey(k) {
|
|
972
|
-
return k.split(/[^A-Za-z0-9]+|(?<=[a-z0-9])(?=[A-Z])/).some((w) => SECRET_WORDS.has(w.toLowerCase()));
|
|
973
|
-
}
|
|
974
|
-
var PLACEHOLDER_RE = /\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-([^}]*))?\}/g;
|
|
975
|
-
function placeholdersIn(v) {
|
|
976
|
-
const out = /* @__PURE__ */ new Set();
|
|
977
|
-
walk(v, (s) => {
|
|
978
|
-
for (const m of s.matchAll(PLACEHOLDER_RE)) out.add(m[1]);
|
|
979
|
-
return s;
|
|
980
|
-
});
|
|
981
|
-
return [...out];
|
|
982
|
-
}
|
|
983
|
-
function walk(v, onString, keyPath = []) {
|
|
984
|
-
if (typeof v === "string") return onString(v, keyPath);
|
|
985
|
-
if (Array.isArray(v)) return v.map((x2, i) => walk(x2, onString, [...keyPath, String(i)]));
|
|
986
|
-
if (v && typeof v === "object") return Object.fromEntries(Object.entries(v).map(([k, x2]) => [k, walk(x2, onString, [...keyPath, k])]));
|
|
987
|
-
return v;
|
|
988
|
-
}
|
|
989
|
-
var envName = (...parts) => parts.join("_").replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
|
|
990
|
-
function mask(id, entry, cat, home = os2.homedir()) {
|
|
991
|
-
entry = portable(entry, home);
|
|
992
|
-
if (!entry || typeof entry !== "object" || Array.isArray(entry)) return entry;
|
|
993
|
-
const maskSection = (sect, envLike) => {
|
|
994
|
-
const masked = {};
|
|
995
|
-
for (const [k, v] of Object.entries(sect)) {
|
|
996
|
-
if (typeof v !== "string" || !isSecretKey(k) || PLACEHOLDER_RE.test(v)) {
|
|
997
|
-
masked[k] = v;
|
|
998
|
-
PLACEHOLDER_RE.lastIndex = 0;
|
|
999
|
-
continue;
|
|
1000
|
-
}
|
|
1001
|
-
const name = envLike ? envName(k) : envName(id, k);
|
|
1002
|
-
const scheme = /^(\w+) \S+$/.exec(v);
|
|
1003
|
-
masked[k] = scheme ? `${scheme[1]} \${${name}}` : `\${${name}}`;
|
|
1004
|
-
}
|
|
1005
|
-
return masked;
|
|
1006
|
-
};
|
|
1007
|
-
if (cat.secretRootIds?.includes(id)) return maskSection(entry, true);
|
|
1008
|
-
const out = { ...entry };
|
|
1009
|
-
for (const sk of cat.secretKeys) {
|
|
1010
|
-
const sect = out[sk];
|
|
1011
|
-
if (!sect || typeof sect !== "object" || Array.isArray(sect)) continue;
|
|
1012
|
-
out[sk] = maskSection(sect, sk === "env");
|
|
1013
|
-
}
|
|
1014
|
-
return out;
|
|
1015
|
-
}
|
|
1016
|
-
function portable(entry, home = os2.homedir()) {
|
|
1017
|
-
if (!home || home === "/") return entry;
|
|
1018
|
-
return walk(entry, (s) => s === home || s.startsWith(home + "/") || s.startsWith(home + "\\") ? "${HOME}" + s.slice(home.length) : s);
|
|
1019
|
-
}
|
|
1020
|
-
function envWithHome(env = process.env) {
|
|
1021
|
-
return { HOME: os2.homedir(), ...env };
|
|
1022
|
-
}
|
|
1023
|
-
function suspiciousStrings(entry) {
|
|
1024
|
-
const out = [];
|
|
1025
|
-
walk(entry, (s, kp) => {
|
|
1026
|
-
if (/^(sk-|ghp_|github_pat_|xox[abp]-|AKIA|glpat-|ntn_|secret_)[A-Za-z0-9_-]{8,}/.test(s)) out.push(kp.join("."));
|
|
1027
|
-
return s;
|
|
1028
|
-
});
|
|
1029
|
-
return out;
|
|
1030
|
-
}
|
|
1031
|
-
function expand(entry, env = process.env) {
|
|
1032
|
-
const missing = /* @__PURE__ */ new Set();
|
|
1033
|
-
const value = walk(
|
|
1034
|
-
entry,
|
|
1035
|
-
(s) => s.replace(PLACEHOLDER_RE, (whole, name, def) => {
|
|
1036
|
-
if (env[name] !== void 0) return env[name];
|
|
1037
|
-
if (def !== void 0) return def;
|
|
1038
|
-
missing.add(name);
|
|
1039
|
-
return whole;
|
|
1040
|
-
})
|
|
1041
|
-
);
|
|
1042
|
-
return { value, missing: [...missing] };
|
|
1043
|
-
}
|
|
1044
|
-
function stringMatches(shed, local) {
|
|
1045
|
-
if (shed === local) return true;
|
|
1046
|
-
if (!PLACEHOLDER_RE.test(shed)) {
|
|
1047
|
-
PLACEHOLDER_RE.lastIndex = 0;
|
|
1048
|
-
return false;
|
|
1049
|
-
}
|
|
1050
|
-
PLACEHOLDER_RE.lastIndex = 0;
|
|
1051
|
-
const re = "^" + shed.split(PLACEHOLDER_RE).map((part, i) => i % 3 === 0 ? part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") : i % 3 === 1 ? ".+" : "").join("") + "$";
|
|
1052
|
-
return new RegExp(re).test(local);
|
|
1053
|
-
}
|
|
1054
|
-
function matches2(shed, local) {
|
|
1055
|
-
if (typeof shed === "string" && typeof local === "string") return stringMatches(shed, local);
|
|
1056
|
-
if (Array.isArray(shed) && Array.isArray(local)) return shed.length === local.length && shed.every((x2, i) => matches2(x2, local[i]));
|
|
1057
|
-
if (shed && local && typeof shed === "object" && typeof local === "object" && !Array.isArray(shed) && !Array.isArray(local)) {
|
|
1058
|
-
const a = Object.keys(shed).sort(), b = Object.keys(local).sort();
|
|
1059
|
-
return a.length === b.length && a.every((k, i) => k === b[i] && matches2(shed[k], local[k]));
|
|
1060
|
-
}
|
|
1061
|
-
return shed === local;
|
|
1062
|
-
}
|
|
1063
|
-
function remask(id, local, shed, cat, home = os2.homedir()) {
|
|
1064
|
-
const keep = (l, s) => {
|
|
1065
|
-
if (typeof l === "string" && typeof s === "string" && stringMatches(s, l)) return s;
|
|
1066
|
-
if (Array.isArray(l) && Array.isArray(s)) return l.map((x2, i) => keep(x2, s[i]));
|
|
1067
|
-
if (l && s && typeof l === "object" && typeof s === "object" && !Array.isArray(l) && !Array.isArray(s)) {
|
|
1068
|
-
return Object.fromEntries(Object.entries(l).map(([k, x2]) => [k, keep(x2, s[k])]));
|
|
1069
|
-
}
|
|
1070
|
-
return l;
|
|
1071
|
-
};
|
|
1072
|
-
return mask(id, shed === null ? local : keep(local, portable(shed, home)), cat, home);
|
|
1073
|
-
}
|
|
1074
|
-
function diffEntry(shed, local) {
|
|
1075
|
-
const out = [];
|
|
1076
|
-
const go = (s, l, kp) => {
|
|
1077
|
-
if (s === void 0) {
|
|
1078
|
-
out.push({ status: "A", file: kp || "(entry)" });
|
|
1079
|
-
return;
|
|
1080
|
-
}
|
|
1081
|
-
if (l === void 0) {
|
|
1082
|
-
out.push({ status: "D", file: kp || "(entry)" });
|
|
1083
|
-
return;
|
|
1084
|
-
}
|
|
1085
|
-
const objs = s && l && typeof s === "object" && typeof l === "object" && !Array.isArray(s) && !Array.isArray(l);
|
|
1086
|
-
if (objs) {
|
|
1087
|
-
for (const k of (/* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(l)])).values()) go(s[k], l[k], kp ? `${kp}.${k}` : k);
|
|
1088
|
-
return;
|
|
1089
|
-
}
|
|
1090
|
-
if (!matches2(s, l)) out.push({ status: "M", file: kp || "(entry)" });
|
|
1091
|
-
};
|
|
1092
|
-
go(shed, local, "");
|
|
1093
|
-
return out.sort((a, b) => a.file.localeCompare(b.file));
|
|
1094
|
-
}
|
|
1095
|
-
async function readEntryFile(p) {
|
|
1096
|
-
try {
|
|
1097
|
-
return JSON.parse(await fs10.readFile(p, "utf8"));
|
|
1098
|
-
} catch (e) {
|
|
1099
|
-
if (e.code === "ENOENT") return null;
|
|
1100
|
-
throw new Error(`${p}: JSON \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${e.message}`);
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
async function writeEntryFile(p, v) {
|
|
1104
|
-
await fs10.mkdir(path14.dirname(p), { recursive: true });
|
|
1105
|
-
await fs10.writeFile(p, JSON.stringify(v, null, 2) + "\n");
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
// src/core/ingest.ts
|
|
1109
|
-
function seqAt(doc, p) {
|
|
1110
|
-
let node = doc.getIn(p);
|
|
1111
|
-
if (!isSeq(node)) {
|
|
1112
|
-
node = doc.createNode([]);
|
|
1113
|
-
doc.setIn(p, node);
|
|
1114
|
-
}
|
|
1115
|
-
return node;
|
|
1116
|
-
}
|
|
1117
|
-
function pushUnique(seq, value) {
|
|
1118
|
-
if (!seq.items.some((it) => (isMap(it) ? it.get("id") : String(it)) === value)) seq.add(value);
|
|
1119
|
-
}
|
|
1120
|
-
async function ingest(ctx, doc, profile, items, lock) {
|
|
1121
|
-
const out = { managed: [], copied: 0, packages: [] };
|
|
1122
|
-
for (const f of items) {
|
|
1123
|
-
if (f.kind === "package") {
|
|
1124
|
-
const p = f.pkg;
|
|
1125
|
-
const node = doc.createNode(p.into ? { id: p.id, source: p.source, into: p.into } : { id: p.id, source: p.source });
|
|
1126
|
-
if (p.into) node.comment = " install: ./setup # \u2190 \uBCF5\uC6D0 \uD6C4 \uC2E4\uD589\uD560 \uBA85\uB839\uC774 \uC788\uC73C\uBA74 \uCC44\uC6B0\uC138\uC694 (--yes \uB85C \uC2E4\uD589)";
|
|
1127
|
-
const seq = seqAt(doc, [PACKAGES]);
|
|
1128
|
-
if (!seq.items.some((it) => isMap(it) && it.get("id") === p.id)) seq.add(node);
|
|
1129
|
-
pushUnique(seqAt(doc, ["profiles", profile, PACKAGES]), p.id);
|
|
1130
|
-
lock.packages[p.id] = { source: p.source, rev: p.rev };
|
|
1131
|
-
out.packages.push(p.id);
|
|
1132
|
-
ctx.log(` \u2261 package ${p.id} ${p.source} @${shortRev(p.rev)} (\uCC38\uC870\uB9CC \uAE30\uB85D)`);
|
|
1133
|
-
continue;
|
|
1134
|
-
}
|
|
1135
|
-
if (f.kind === "component") {
|
|
1136
|
-
const dst = path15.join(ctx.shed, f.cat.root, f.cat.kind === "dir" ? f.id : `${f.id}.md`);
|
|
1137
|
-
await copyTree(f.path, dst, ignoreOf(ctx));
|
|
1138
|
-
ctx.log(` + ${f.category}/${f.id}`);
|
|
1139
|
-
} else {
|
|
1140
|
-
const masked = mask(f.id, f.value, f.cat);
|
|
1141
|
-
await writeEntryFile(path15.join(ctx.shed, f.category, `${f.id}.json`), masked);
|
|
1142
|
-
const vars = placeholdersIn(masked).filter((v) => v !== "HOME");
|
|
1143
|
-
ctx.log(` + ${f.category}/${f.id}${vars.length ? ` (\uC2DC\uD06C\uB9BF \u2192 ${vars.map((v) => "${" + v + "}").join(", ")})` : ""}`);
|
|
1144
|
-
for (const where of suspiciousStrings(masked)) ctx.log(` ! ${where} \uAC00 \uC2DC\uD06C\uB9BF\uCC98\uB7FC \uBCF4\uC785\uB2C8\uB2E4. \uCC3D\uACE0\uC758 ${f.category}/${f.id}.json \uC5D0\uC11C \${VAR} \uB85C \uBC14\uAFB8\uC138\uC694`);
|
|
1145
|
-
if (f.warn) ctx.log(` ! ${f.warn}`);
|
|
1146
|
-
}
|
|
1147
|
-
const comps = seqAt(doc, ["components", f.category]);
|
|
1148
|
-
if (!comps.items.some((it) => isMap(it) && it.get("id") === f.id)) comps.add(doc.createNode({ id: f.id }));
|
|
1149
|
-
pushUnique(seqAt(doc, ["profiles", profile, f.category]), f.id);
|
|
1150
|
-
out.managed.push(targetRel(f.cat, f.id));
|
|
1151
|
-
out.copied++;
|
|
1152
|
-
}
|
|
1153
|
-
return out;
|
|
1154
|
-
}
|
|
1155
|
-
function tidy(doc) {
|
|
1156
|
-
const pk = doc.get(PACKAGES);
|
|
1157
|
-
if (isSeq(pk) && !pk.items.length) doc.delete(PACKAGES);
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
// src/core/init.ts
|
|
1161
|
-
var MANIFEST_HEADER = "# lshed manifest \u2014 edit freely. Reference: https://github.com/LeeSongHeon-LSH/lshed\n";
|
|
1162
|
-
async function init(ctx, opts = {}) {
|
|
1163
|
-
const profileName = opts.profile ?? "default";
|
|
1164
|
-
if (await exists(manifestPath(ctx))) {
|
|
1165
|
-
throw new Error(`\uC774\uBBF8 \uCD08\uAE30\uD654\uB41C \uCC3D\uACE0\uC785\uB2C8\uB2E4: ${manifestPath(ctx)}
|
|
1166
|
-
\uC774 \uD658\uACBD\uC5D0 \uC0C8\uB85C \uC0DD\uAE34 \uAC83\uC744 \uAE30\uC874 \uCC3D\uACE0\uC5D0 \uB123\uC73C\uB824\uBA74 'lshed add' \uB97C, \uB2E4\uB978 \uD658\uACBD\uC758 \uC124\uC815\uC744 \uAC00\uC838\uC624\uB824\uBA74 'lshed restore' \uD6C4 'lshed save' \uB97C \uC4F0\uC138\uC694.`);
|
|
1167
|
-
}
|
|
1168
|
-
const d = await discover(ctx, opts.exclude);
|
|
1169
|
-
for (const [key, by] of d.generated) ctx.log(` \xB7 ${key} (${by} \uAC00 \uC0DD\uC131\uD55C \uAC83 \u2192 \uAC74\uB108\uB700)`);
|
|
1170
|
-
for (const key of d.excluded) ctx.log(` - ${key} (--exclude)`);
|
|
1171
|
-
const exclude = opts.exclude?.length ? { exclude: [...opts.exclude] } : {};
|
|
1172
|
-
const doc = new YAML4.Document({ version: 1, agent: ctx.adapter.name, ...exclude, components: {}, packages: [], profiles: { [profileName]: {} } });
|
|
1173
|
-
const lock = { version: 1, packages: {} };
|
|
1174
|
-
await fs11.mkdir(ctx.shed, { recursive: true });
|
|
1175
|
-
const res = await ingest(ctx, doc, profileName, d.items, lock);
|
|
1176
|
-
const managed = [...res.managed];
|
|
1177
|
-
let copied = res.copied;
|
|
1178
|
-
const instr = instructionsFile(ctx);
|
|
1179
|
-
if (await exists(instr)) {
|
|
1180
|
-
const text = await fs11.readFile(instr, "utf8");
|
|
1181
|
-
if (!isGenerated(text)) {
|
|
1182
|
-
const dst = path16.join(ctx.shed, INSTRUCTIONS, "main.md");
|
|
1183
|
-
await fs11.mkdir(path16.dirname(dst), { recursive: true });
|
|
1184
|
-
await fs11.writeFile(dst, text);
|
|
1185
|
-
const fragRel = targetRel(INSTRUCTIONS, "main");
|
|
1186
|
-
await copyTree(dst, abs(ctx, fragRel), ignoreOf(ctx));
|
|
1187
|
-
managed.push(fragRel);
|
|
1188
|
-
doc.setIn(["components", INSTRUCTIONS], [{ id: "main" }]);
|
|
1189
|
-
doc.setIn(["profiles", profileName, INSTRUCTIONS], ["main"]);
|
|
1190
|
-
copied++;
|
|
1191
|
-
ctx.log(` + ${INSTRUCTIONS}/main (${path16.basename(instr)})`);
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
tidy(doc);
|
|
1195
|
-
const yamlText = MANIFEST_HEADER + doc.toString({ lineWidth: 0 });
|
|
1196
|
-
await fs11.writeFile(manifestPath(ctx), yamlText);
|
|
1197
|
-
if (res.packages.length) await writeLock(ctx.shed, lock);
|
|
1198
|
-
await writeState(ctx.adapter, { profile: profileName, shed: ctx.shed, managed, appliedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
1199
|
-
const parts = [`\uBD80\uD488 ${copied}\uAC1C`];
|
|
1200
|
-
if (res.packages.length) parts.push(`\uD328\uD0A4\uC9C0 ${res.packages.length}\uAC1C`);
|
|
1201
|
-
if (d.generated.size) parts.push(`\uC0DD\uC131\uBB3C ${d.generated.size}\uAC1C \uAC74\uB108\uB700`);
|
|
1202
|
-
if (d.excluded.length) parts.push(`\uC81C\uC678 ${d.excluded.length}\uAC1C`);
|
|
1203
|
-
ctx.log(`
|
|
1204
|
-
${MANIFEST_FILE} \uC0DD\uC131: ${manifestPath(ctx)} (${parts.join(", ")}, \uD504\uB85C\uD544 "${profileName}")`);
|
|
1205
|
-
if (d.items.some((f) => f.kind === "package" && f.pkg.into)) ctx.log(`git \uD328\uD0A4\uC9C0\uC758 \uC124\uCE58 \uBA85\uB839(install:)\uC740 lshed.yaml \uC5D0\uC11C \uC9C1\uC811 \uCC44\uC6B0\uC138\uC694.`);
|
|
1206
|
-
const manifest = parseManifest(yamlText);
|
|
1207
|
-
return { manifest, copied, skipped: d.excluded, packages: res.packages, generated: [...d.generated.keys()] };
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
// src/core/restore.ts
|
|
1211
|
-
import { promises as fs12 } from "fs";
|
|
1212
|
-
import path17 from "path";
|
|
1213
|
-
async function restore(ctx, profileArg, opts = {}) {
|
|
1214
|
-
const backup = opts.backup ?? true;
|
|
1215
|
-
const state = await readState(ctx.adapter);
|
|
1216
|
-
const profile = profileArg ?? state?.profile;
|
|
1217
|
-
if (!profile) throw new Error("\uD504\uB85C\uD544\uC744 \uC9C0\uC815\uD558\uC138\uC694: lshed restore <profile> (\uC774\uC804\uC5D0 \uC801\uC6A9\uD55C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4)");
|
|
1218
|
-
const m = await loadManifest(ctx);
|
|
1219
|
-
const plan = planProfile(ctx, m, profile);
|
|
1220
|
-
for (const it of plan) {
|
|
1221
|
-
if (!await exists(it.src)) throw new Error(`${it.category}/${it.id}: \uCC3D\uACE0\uC5D0 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4: ${it.src}`);
|
|
1222
|
-
}
|
|
1223
|
-
const pkgRes = await ensurePackages(ctx, packagesOf(m, profile), { dryRun: opts.dryRun, yes: opts.yes });
|
|
1224
|
-
const instrRel = ctx.adapter.instructionsFileName();
|
|
1225
|
-
const fragments = plan.filter((p) => p.category === INSTRUCTIONS);
|
|
1226
|
-
const newManaged = new Set(plan.map((p) => p.rel));
|
|
1227
|
-
if (fragments.length) newManaged.add(instrRel);
|
|
1228
|
-
const oldManaged = new Set(state?.managed ?? []);
|
|
1229
|
-
const toRemove = [...oldManaged].filter((r) => !newManaged.has(r)).sort();
|
|
1230
|
-
if (state && state.shed !== ctx.shed && toRemove.length) {
|
|
1231
|
-
ctx.log(`! \uB9C8\uC9C0\uB9C9\uC73C\uB85C \uC801\uC6A9\uD55C \uCC3D\uACE0\uAC00 \uB2E4\uB985\uB2C8\uB2E4: ${state.shed}`);
|
|
1232
|
-
ctx.log(` \uC544\uB798 ${toRemove.length}\uAC1C\uB294 \uADF8 \uCC3D\uACE0\uC758 \uAD00\uB9AC \uBAA9\uB85D\uC5D0 \uC788\uC5B4 \uC81C\uAC70 \uB300\uC0C1\uC785\uB2C8\uB2E4 (\uBC31\uC5C5\uB428). \uC774 \uAE30\uAE30\uC758 \uAC83\uC744 \uC9C0\uD0A4\uB824\uBA74 \uBA3C\uC800 'lshed add' \uB85C \uCC3D\uACE0\uC5D0 \uB123\uC73C\uC138\uC694.`);
|
|
1233
|
-
}
|
|
1234
|
-
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
1235
|
-
const backupDir = path17.join(ctx.adapter.root, LSHED_DIR, "backups", stamp);
|
|
1236
|
-
const backedUp = [];
|
|
1237
|
-
const placed = [];
|
|
1238
|
-
const missingEnv = [];
|
|
1239
|
-
const localEntries = /* @__PURE__ */ new Map();
|
|
1240
|
-
const entriesOf = async (cat) => {
|
|
1241
|
-
if (!localEntries.has(cat.name)) localEntries.set(cat.name, await cat.read());
|
|
1242
|
-
return localEntries.get(cat.name);
|
|
1243
|
-
};
|
|
1244
|
-
async function backUp(rel) {
|
|
1245
|
-
const en = entryOf(ctx, rel);
|
|
1246
|
-
if (en) {
|
|
1247
|
-
const cur = (await entriesOf(en.cat))[en.id];
|
|
1248
|
-
if (cur === void 0) return;
|
|
1249
|
-
backedUp.push(rel);
|
|
1250
|
-
if (opts.dryRun || !backup) return;
|
|
1251
|
-
await writeEntryFile(path17.join(backupDir, en.cat.name, `${en.id}.json`), cur);
|
|
1252
|
-
return;
|
|
1253
|
-
}
|
|
1254
|
-
const from = abs(ctx, rel);
|
|
1255
|
-
if (!await exists(from)) return;
|
|
1256
|
-
backedUp.push(rel);
|
|
1257
|
-
if (opts.dryRun || !backup) return;
|
|
1258
|
-
await copyTree(from, path17.join(backupDir, ...rel.split("/")), ignoreOf(ctx));
|
|
1259
|
-
}
|
|
1260
|
-
for (const rel of toRemove) {
|
|
1261
|
-
ctx.log(` - ${rel}`);
|
|
1262
|
-
await backUp(rel);
|
|
1263
|
-
if (opts.dryRun) continue;
|
|
1264
|
-
const en = entryOf(ctx, rel);
|
|
1265
|
-
if (en) await en.cat.write(en.id, null);
|
|
1266
|
-
else await removeTree(abs(ctx, rel));
|
|
1267
|
-
}
|
|
1268
|
-
for (const it of plan) {
|
|
1269
|
-
if (it.entry) {
|
|
1270
|
-
const shed = await readEntryFile(it.src);
|
|
1271
|
-
const local = (await entriesOf(it.entry))[it.id];
|
|
1272
|
-
const vars = placeholdersIn(shed).filter((v) => v !== "HOME");
|
|
1273
|
-
const ex = expand(shed, envWithHome());
|
|
1274
|
-
if (ex.missing.length) missingEnv.push({ rel: it.rel, vars: ex.missing });
|
|
1275
|
-
const value = it.entry.expandsEnv ? shed : ex.value;
|
|
1276
|
-
const same2 = local !== void 0 && matches2(shed, local);
|
|
1277
|
-
const mark2 = same2 ? "=" : local !== void 0 ? "~" : "+";
|
|
1278
|
-
ctx.log(` ${mark2} ${it.rel}${vars.length ? ` (${vars.map((v) => "${" + v + "}").join(", ")})` : ""}`);
|
|
1279
|
-
if (same2) {
|
|
1280
|
-
placed.push(it.rel);
|
|
1281
|
-
continue;
|
|
1282
|
-
}
|
|
1283
|
-
if (local !== void 0) await backUp(it.rel);
|
|
1284
|
-
if (!opts.dryRun) await it.entry.write(it.id, value);
|
|
1285
|
-
placed.push(it.rel);
|
|
1286
|
-
continue;
|
|
1287
|
-
}
|
|
1288
|
-
const target = abs(ctx, it.rel);
|
|
1289
|
-
const same = await hashTree(target, ignoreOf(ctx)) === await hashTree(it.src, ignoreOf(ctx));
|
|
1290
|
-
const mark = same ? "=" : await exists(target) ? "~" : "+";
|
|
1291
|
-
ctx.log(` ${mark} ${it.rel}`);
|
|
1292
|
-
if (same) {
|
|
1293
|
-
placed.push(it.rel);
|
|
1294
|
-
continue;
|
|
1295
|
-
}
|
|
1296
|
-
if (await exists(target)) await backUp(it.rel);
|
|
1297
|
-
if (!opts.dryRun) await copyTree(it.src, target, ignoreOf(ctx));
|
|
1298
|
-
placed.push(it.rel);
|
|
1299
|
-
}
|
|
1300
|
-
const instrPath = instructionsFile(ctx);
|
|
1301
|
-
if (fragments.length) {
|
|
1302
|
-
const contents = [];
|
|
1303
|
-
for (const f of fragments) contents.push({ id: f.id, content: await fs12.readFile(f.src, "utf8") });
|
|
1304
|
-
const rendered = renderInstructions(ctx, profile, contents);
|
|
1305
|
-
const existing = await exists(instrPath) ? await fs12.readFile(instrPath, "utf8") : null;
|
|
1306
|
-
if (existing !== rendered) {
|
|
1307
|
-
const mark = existing === null ? "+" : "~";
|
|
1308
|
-
ctx.log(` ${mark} ${instrRel}${existing !== null && !isGenerated(existing) ? " (\uAE30\uC874 \uD30C\uC77C\uC740 lshed \uC0DD\uC131\uBB3C\uC774 \uC544\uB2D8 \u2192 \uBC31\uC5C5)" : ""}`);
|
|
1309
|
-
if (existing !== null) await backUp(instrRel);
|
|
1310
|
-
if (!opts.dryRun) await fs12.writeFile(instrPath, rendered);
|
|
1311
|
-
} else {
|
|
1312
|
-
ctx.log(` = ${instrRel}`);
|
|
1313
|
-
}
|
|
1314
|
-
placed.push(instrRel);
|
|
1315
|
-
}
|
|
1316
|
-
if (opts.dryRun) {
|
|
1317
|
-
ctx.log(`
|
|
1318
|
-
(dry-run) \uBCC0\uACBD \uC5C6\uC74C. \uBC30\uCE58 ${placed.length}, \uC81C\uAC70 ${toRemove.length}, \uBC31\uC5C5 \uC608\uC815 ${backedUp.length}`);
|
|
1319
|
-
reportPending(ctx, pkgRes);
|
|
1320
|
-
reportMissingEnv(ctx, missingEnv);
|
|
1321
|
-
return { profile, placed, removed: toRemove, backedUp, backupDir: null, missingEnv };
|
|
1322
|
-
}
|
|
1323
|
-
await writeState(ctx.adapter, { profile, shed: ctx.shed, managed: [...newManaged].sort(), appliedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
1324
|
-
const bdir = backup && backedUp.length ? backupDir : null;
|
|
1325
|
-
ctx.log(`
|
|
1326
|
-
\uD504\uB85C\uD544 "${profile}" \uC801\uC6A9: \uBC30\uCE58 ${placed.length}, \uC81C\uAC70 ${toRemove.length}${pkgRes.installed.length ? `, \uD328\uD0A4\uC9C0 \uC124\uCE58 ${pkgRes.installed.length}` : ""}${bdir ? `, \uBC31\uC5C5 ${backedUp.length} \u2192 ${bdir}` : ""}`);
|
|
1327
|
-
reportPending(ctx, pkgRes);
|
|
1328
|
-
reportMissingEnv(ctx, missingEnv);
|
|
1329
|
-
return { profile, placed, removed: toRemove, backedUp, backupDir: bdir, missingEnv };
|
|
1330
|
-
}
|
|
1331
|
-
function reportMissingEnv(ctx, missing) {
|
|
1332
|
-
if (!missing.length) return;
|
|
1333
|
-
ctx.log(`
|
|
1334
|
-
\uD658\uACBD\uBCC0\uC218\uAC00 \uC5C6\uB294 \uD56D\uBAA9\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uC2DC\uD06C\uB9BF \uAC12\uC740 \uCC3D\uACE0\uC5D0 \uB2F4\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC774 \uAE30\uAE30\uC758 \uC178 \uD658\uACBD\uC5D0 \uB123\uC73C\uC138\uC694 (\uC608: ~/.zshrc \uC758 export):`);
|
|
1335
|
-
for (const m of missing) ctx.log(` ${m.rel}: ${m.vars.join(", ")}`);
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
// src/core/diff.ts
|
|
1339
|
-
async function diff(ctx) {
|
|
1340
|
-
const state = await readState(ctx.adapter);
|
|
1341
|
-
if (!state) throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");
|
|
1342
|
-
const m = await loadManifest(ctx);
|
|
1343
|
-
const out = [];
|
|
1344
|
-
const localEntries = /* @__PURE__ */ new Map();
|
|
1345
|
-
for (const item of planProfile(ctx, m, state.profile)) {
|
|
1346
|
-
let changes;
|
|
1347
|
-
if (item.entry) {
|
|
1348
|
-
if (!localEntries.has(item.category)) localEntries.set(item.category, await item.entry.read());
|
|
1349
|
-
const shed = await readEntryFile(item.src);
|
|
1350
|
-
changes = shed === null ? [{ status: "A", file: "(entry)" }] : diffEntry(shed, localEntries.get(item.category)[item.id]);
|
|
1351
|
-
} else {
|
|
1352
|
-
changes = await diffTrees(abs(ctx, item.rel), item.src, ignoreOf(ctx));
|
|
1353
|
-
}
|
|
1354
|
-
if (changes.length) out.push({ item, changes });
|
|
1355
|
-
}
|
|
1356
|
-
return out;
|
|
1357
|
-
}
|
|
1358
|
-
function formatDiff(diffs) {
|
|
1359
|
-
if (!diffs.length) return "\uB85C\uCEEC\uACFC \uCC3D\uACE0\uAC00 \uC77C\uCE58\uD569\uB2C8\uB2E4.";
|
|
1360
|
-
const lines = [];
|
|
1361
|
-
for (const d of diffs) {
|
|
1362
|
-
lines.push(`${d.item.category}/${d.item.id}`);
|
|
1363
|
-
for (const c of d.changes) lines.push(` ${c.status} ${c.file || "(file)"}`);
|
|
1364
|
-
}
|
|
1365
|
-
lines.push("", "A: \uB85C\uCEEC\uC5D0\uB9CC \uC788\uC74C M: \uB0B4\uC6A9 \uB2E4\uB984 D: \uCC3D\uACE0\uC5D0\uB9CC \uC788\uC74C", "\uB85C\uCEEC \uD3B8\uC9D1\uC744 \uCC3D\uACE0\uC5D0 \uBC18\uC601\uD558\uB824\uBA74: lshed save");
|
|
1366
|
-
return lines.join("\n");
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
// src/core/add.ts
|
|
1370
|
-
import { promises as fs13 } from "fs";
|
|
1371
|
-
import YAML5 from "yaml";
|
|
1372
|
-
async function candidates(ctx, m, profile, d) {
|
|
1373
|
-
d ??= await discover(ctx, m.exclude);
|
|
1374
|
-
return { fresh: notInManifest(m, d), notInProfile: inManifestNotInProfile(m, profile, d), generated: d.generated };
|
|
1375
|
-
}
|
|
1376
|
-
async function add(ctx, keys = [], opts = {}) {
|
|
1377
|
-
const state = await readState(ctx.adapter);
|
|
1378
|
-
if (!state) throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed init' \uB610\uB294 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");
|
|
1379
|
-
const m = await loadManifest(ctx);
|
|
1380
|
-
const c = await candidates(ctx, m, state.profile);
|
|
1381
|
-
if (!keys.length && !opts.all) {
|
|
1382
|
-
if (!c.fresh.length) ctx.log("\uCC3D\uACE0\uC5D0 \uC5C6\uB294 \uC0C8 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
1383
|
-
else {
|
|
1384
|
-
ctx.log(`\uCC3D\uACE0\uC5D0 \uC5C6\uB294 \uD56D\uBAA9 ${c.fresh.length}\uAC1C (\uB123\uC73C\uB824\uBA74 lshed add <key...> \uB610\uB294 --all):`);
|
|
1385
|
-
for (const f of c.fresh) ctx.log(` ${f.kind === "package" ? "\u2261" : " "} ${keyOf(f)}${f.kind === "package" ? ` ${f.pkg.source}` : f.kind === "entry" && f.warn ? ` ! ${f.warn}` : ""}`);
|
|
1386
|
-
}
|
|
1387
|
-
hint(ctx, c, state.profile);
|
|
1388
|
-
return [];
|
|
1389
|
-
}
|
|
1390
|
-
let chosen = c.fresh;
|
|
1391
|
-
if (keys.length) {
|
|
1392
|
-
chosen = keys.map((raw) => {
|
|
1393
|
-
const [a, b] = raw.includes("/") ? raw.split("/", 2) : [void 0, raw];
|
|
1394
|
-
const hits = c.fresh.filter((f) => f.id === b && (a === void 0 || f.category === a));
|
|
1395
|
-
if (!hits.length) {
|
|
1396
|
-
const known = (m.components[a ?? ""] ?? []).some((x2) => x2.id === b) || Object.values(m.components).some((cs) => cs.some((x2) => x2.id === b)) || m.packages.some((p) => p.id === b);
|
|
1397
|
-
throw new Error(known ? `"${raw}" \uB294 \uC774\uBBF8 \uCC3D\uACE0\uC5D0 \uC788\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uD544\uC5D0 \uB123\uC73C\uB824\uBA74 lshed.yaml \uC758 profiles \uB97C \uACE0\uCE58\uC138\uC694.` : `"${raw}" \uB294 \uB85C\uCEEC\uC5D0\uC11C \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. 'lshed add' \uB85C \uD6C4\uBCF4\uB97C \uBCF4\uC138\uC694.`);
|
|
1398
|
-
}
|
|
1399
|
-
if (hits.length > 1) throw new Error(`"${raw}" \uAC00 \uBAA8\uD638\uD569\uB2C8\uB2E4: ${hits.map(keyOf).join(", ")}`);
|
|
1400
|
-
return hits[0];
|
|
1401
|
-
});
|
|
1402
|
-
}
|
|
1403
|
-
if (!chosen.length) {
|
|
1404
|
-
ctx.log("\uCC3D\uACE0\uC5D0 \uC5C6\uB294 \uC0C8 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
1405
|
-
hint(ctx, c, state.profile);
|
|
1406
|
-
return [];
|
|
1407
|
-
}
|
|
1408
|
-
const doc = YAML5.parseDocument(await fs13.readFile(manifestPath(ctx), "utf8"));
|
|
1409
|
-
const lock = await readLock(ctx.shed);
|
|
1410
|
-
const res = await ingest(ctx, doc, state.profile, chosen, lock);
|
|
1411
|
-
tidy(doc);
|
|
1412
|
-
await fs13.writeFile(manifestPath(ctx), doc.toString({ lineWidth: 0 }));
|
|
1413
|
-
if (res.packages.length) await writeLock(ctx.shed, lock);
|
|
1414
|
-
const managed = [.../* @__PURE__ */ new Set([...state.managed, ...res.managed])].sort();
|
|
1415
|
-
await writeState(ctx.adapter, { ...state, managed, appliedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
1416
|
-
const added = chosen.map(keyOf);
|
|
1417
|
-
ctx.log(`
|
|
1418
|
-
${added.length}\uAC1C\uB97C \uCC3D\uACE0\uC5D0 \uB123\uACE0 \uD504\uB85C\uD544 "${state.profile}" \uC5D0 \uCD94\uAC00\uD588\uC2B5\uB2C8\uB2E4. \uCC3D\uACE0\uB97C \uCEE4\uBC0B\uD558\uC138\uC694: ${ctx.shed}`);
|
|
1419
|
-
if (res.packages.some((id) => chosen.find((f) => f.id === id && f.kind === "package" && f.pkg.into))) ctx.log(`git \uD328\uD0A4\uC9C0\uC758 \uC124\uCE58 \uBA85\uB839(install:)\uC740 lshed.yaml \uC5D0\uC11C \uC9C1\uC811 \uCC44\uC6B0\uC138\uC694.`);
|
|
1420
|
-
hint(ctx, { ...c, fresh: c.fresh.filter((f) => !chosen.includes(f)) }, state.profile);
|
|
1421
|
-
return added;
|
|
1422
|
-
}
|
|
1423
|
-
function hint(ctx, c, profile) {
|
|
1424
|
-
const byPkg = /* @__PURE__ */ new Map();
|
|
1425
|
-
for (const by of c.generated.values()) byPkg.set(by, (byPkg.get(by) ?? 0) + 1);
|
|
1426
|
-
for (const [by, n] of byPkg) ctx.log(` \xB7 \uD328\uD0A4\uC9C0 ${by} \uAC00 \uC0DD\uC131\uD55C \uAC83 ${n}\uAC1C\uB294 \uB2F4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4`);
|
|
1427
|
-
if (c.notInProfile.length) ctx.log(`\uCC3D\uACE0\uC5D0\uB294 \uC788\uC9C0\uB9CC \uD504\uB85C\uD544 "${profile}" \uC774 \uC548 \uC4F0\uB294 \uAC83 ${c.notInProfile.length}\uAC1C: ${c.notInProfile.join(", ")} \u2192 lshed.yaml \uC758 profiles \uC5D0 \uCD94\uAC00`);
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
// src/core/status.ts
|
|
1431
|
-
async function status(ctx) {
|
|
1432
|
-
const state = await readState(ctx.adapter);
|
|
1433
|
-
if (!state) return { state: null, drifted: [], packages: [], missingEnv: [], fresh: [] };
|
|
1434
|
-
const d = await diff(ctx);
|
|
1435
|
-
const m = await loadManifest(ctx);
|
|
1436
|
-
const lock = await readLock(ctx.shed);
|
|
1437
|
-
const packages = await Promise.all(packagesOf(m, state.profile).map((p) => packageStatus(ctx, p, lock)));
|
|
1438
|
-
const missingEnv = [];
|
|
1439
|
-
for (const it of planProfile(ctx, m, state.profile).filter((p) => p.entry)) {
|
|
1440
|
-
const shed = await readEntryFile(it.src);
|
|
1441
|
-
const missing = shed === null ? [] : expand(shed, envWithHome()).missing;
|
|
1442
|
-
if (missing.length) missingEnv.push({ rel: it.rel, vars: missing });
|
|
1443
|
-
}
|
|
1444
|
-
const fresh = (await candidates(ctx, m, state.profile)).fresh.map(keyOf);
|
|
1445
|
-
return { state, drifted: d.map((x2) => `${x2.item.category}/${x2.item.id}`), packages, missingEnv, fresh };
|
|
1446
|
-
}
|
|
1447
|
-
function formatStatus(s, adapterRoot) {
|
|
1448
|
-
if (!s.state) return `\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 (${adapterRoot}).
|
|
1449
|
-
lshed init --shed <dir> \uB610\uB294 lshed restore <profile>`;
|
|
1450
|
-
const lines = [
|
|
1451
|
-
`\uD504\uB85C\uD544 ${s.state.profile}`,
|
|
1452
|
-
`\uCC3D\uACE0 ${s.state.shed}`,
|
|
1453
|
-
`\uC801\uC6A9 ${s.state.appliedAt}`,
|
|
1454
|
-
`\uAD00\uB9AC \uC911 ${s.state.managed.length}\uAC1C \uACBD\uB85C (${adapterRoot})`
|
|
1455
|
-
];
|
|
1456
|
-
lines.push(s.drifted.length ? `\uB4DC\uB9AC\uD504\uD2B8 ${s.drifted.length}\uAC1C: ${s.drifted.join(", ")} \u2192 lshed diff` : "\uB4DC\uB9AC\uD504\uD2B8 \uC5C6\uC74C");
|
|
1457
|
-
const short2 = (r) => r && /^[0-9a-f]{40}$/.test(r) ? r.slice(0, 7) : r;
|
|
1458
|
-
for (const p of s.packages) {
|
|
1459
|
-
const where = !p.present ? "\uC124\uCE58 \uC548 \uB428 \u2192 lshed restore" : !p.locked ? `${short2(p.rev)} (\uB77D \uC5C6\uC74C)` : p.rev === p.locked ? `${short2(p.rev)} = lock` : `${short2(p.rev)} \u2260 lock ${short2(p.locked)} \u2192 lshed update`;
|
|
1460
|
-
lines.push(`\uD328\uD0A4\uC9C0 ${p.pkg.id} ${where}`);
|
|
1461
|
-
}
|
|
1462
|
-
for (const m of s.missingEnv) lines.push(`\uD658\uACBD\uBCC0\uC218 ${m.rel}: ${m.vars.join(", ")} \uC5C6\uC74C \u2192 \uC178\uC5D0\uC11C export \uD558\uC138\uC694`);
|
|
1463
|
-
if (s.fresh.length) lines.push(`\uCC3D\uACE0 \uBC16 ${s.fresh.length}\uAC1C: ${s.fresh.join(", ")} \u2192 lshed add`);
|
|
1464
|
-
return lines.join("\n");
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
// src/core/save.ts
|
|
1468
|
-
async function save(ctx, ids = []) {
|
|
1469
|
-
const state = await readState(ctx.adapter);
|
|
1470
|
-
if (!state) throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");
|
|
1471
|
-
const m = await loadManifest(ctx);
|
|
1472
|
-
let plan = planProfile(ctx, m, state.profile);
|
|
1473
|
-
if (ids.length) {
|
|
1474
|
-
plan = ids.map((raw) => {
|
|
1475
|
-
const [a, b] = raw.includes("/") ? raw.split("/", 2) : [void 0, raw];
|
|
1476
|
-
const hits = plan.filter((p) => p.id === b && (a === void 0 || p.category === a));
|
|
1477
|
-
if (!hits.length) throw new Error(`"${raw}" \uB294 \uD604\uC7AC \uD504\uB85C\uD544(${state.profile})\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
1478
|
-
if (hits.length > 1) throw new Error(`"${raw}" \uAC00 \uBAA8\uD638\uD569\uB2C8\uB2E4: ${hits.map((h) => `${h.category}/${h.id}`).join(", ")}`);
|
|
1479
|
-
return hits[0];
|
|
1480
|
-
});
|
|
1481
|
-
}
|
|
1482
|
-
const saved = [];
|
|
1483
|
-
const localEntries = /* @__PURE__ */ new Map();
|
|
1484
|
-
for (const it of plan) {
|
|
1485
|
-
const src = effectiveSource(it.category, it.component, kindOf(ctx, it.category));
|
|
1486
|
-
if (!isSaveable(src)) {
|
|
1487
|
-
ctx.log(` ! ${it.category}/${it.id}: \uC6D0\uACA9 \uCD9C\uCC98(${src})\uB294 save \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
1488
|
-
continue;
|
|
1489
|
-
}
|
|
1490
|
-
if (it.entry) {
|
|
1491
|
-
if (!localEntries.has(it.category)) localEntries.set(it.category, await it.entry.read());
|
|
1492
|
-
const local2 = localEntries.get(it.category)[it.id];
|
|
1493
|
-
if (local2 === void 0) {
|
|
1494
|
-
ctx.log(` ! ${it.category}/${it.id}: \uB85C\uCEEC\uC5D0 \uC5C6\uC74C (\uAC74\uB108\uB700)`);
|
|
1495
|
-
continue;
|
|
1496
|
-
}
|
|
1497
|
-
const shed = await readEntryFile(it.src);
|
|
1498
|
-
if (shed !== null && matches2(shed, local2)) continue;
|
|
1499
|
-
await writeEntryFile(it.src, remask(it.id, local2, shed, it.entry));
|
|
1500
|
-
saved.push(`${it.category}/${it.id}`);
|
|
1501
|
-
ctx.log(` \u2713 ${it.category}/${it.id} \u2192 \uCC3D\uACE0 (\uC2DC\uD06C\uB9BF\uC740 \uC790\uB9AC\uD45C\uC2DC\uC790\uB85C)`);
|
|
1502
|
-
continue;
|
|
1503
|
-
}
|
|
1504
|
-
const local = abs(ctx, it.rel);
|
|
1505
|
-
if (!await exists(local)) {
|
|
1506
|
-
ctx.log(` ! ${it.category}/${it.id}: \uB85C\uCEEC\uC5D0 \uC5C6\uC74C (\uAC74\uB108\uB700)`);
|
|
1507
|
-
continue;
|
|
1508
|
-
}
|
|
1509
|
-
if (await hashTree(local, ignoreOf(ctx)) === await hashTree(it.src, ignoreOf(ctx))) continue;
|
|
1510
|
-
await copyTree(local, it.src, ignoreOf(ctx));
|
|
1511
|
-
saved.push(`${it.category}/${it.id}`);
|
|
1512
|
-
ctx.log(` \u2713 ${it.category}/${it.id} \u2192 \uCC3D\uACE0`);
|
|
1513
|
-
}
|
|
1514
|
-
ctx.log(saved.length ? `
|
|
1515
|
-
${saved.length}\uAC1C \uBC18\uC601. \uCC3D\uACE0\uB97C \uCEE4\uBC0B/\uB3D9\uAE30\uD654\uD558\uC138\uC694: ${ctx.shed}` : "\uBC18\uC601\uD560 \uBCC0\uACBD\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
1516
|
-
return saved;
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
// src/core/list.ts
|
|
1520
|
-
function listRows(m) {
|
|
1521
|
-
const usedBy = (cat, id) => Object.entries(m.profiles).filter(([, cats]) => (cats[cat] ?? []).includes(id)).map(([name]) => name);
|
|
1522
|
-
const rows = [];
|
|
1523
|
-
for (const [cat, comps] of Object.entries(m.components)) {
|
|
1524
|
-
for (const c of comps) rows.push({ kind: "component", category: cat, id: c.id, usedBy: usedBy(cat, c.id) });
|
|
1525
|
-
}
|
|
1526
|
-
for (const p of m.packages) rows.push({ kind: "package", category: PACKAGES, id: p.id, usedBy: usedBy(PACKAGES, p.id) });
|
|
1527
|
-
return rows;
|
|
1528
|
-
}
|
|
1529
|
-
function formatRows(rows, m) {
|
|
1530
|
-
if (!rows.length) return "(\uBE44\uC5B4 \uC788\uC74C)";
|
|
1531
|
-
const w = Math.max(...rows.map((r) => `${r.category}/${r.id}`.length));
|
|
1532
|
-
const lines = rows.map((r) => {
|
|
1533
|
-
const key = `${r.category}/${r.id}`.padEnd(w);
|
|
1534
|
-
const use = r.usedBy.length ? r.usedBy.join(", ") : "(\uBBF8\uC0AC\uC6A9)";
|
|
1535
|
-
return `${r.kind === "package" ? "\u2261" : " "} ${key} ${use}`;
|
|
1536
|
-
});
|
|
1537
|
-
const unused = rows.filter((r) => !r.usedBy.length).length;
|
|
1538
|
-
lines.push("", `${rows.length}\uAC1C, \uD504\uB85C\uD544 ${Object.keys(m.profiles).length}\uAC1C${unused ? `, \uBBF8\uC0AC\uC6A9 ${unused}\uAC1C \u2192 lshed prune` : ""}`);
|
|
1539
|
-
return lines.join("\n");
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
// src/core/remove.ts
|
|
1543
|
-
import { promises as fs14 } from "fs";
|
|
1544
|
-
import path18 from "path";
|
|
1545
|
-
import YAML6, { isSeq as isSeq2, isMap as isMap2 } from "yaml";
|
|
1546
|
-
function resolveKey(m, raw) {
|
|
1547
|
-
const rows = listRows(m);
|
|
1548
|
-
const [a, b] = raw.includes("/") ? raw.split("/", 2) : [void 0, raw];
|
|
1549
|
-
const hits = rows.filter((r) => r.id === b && (a === void 0 || r.category === a));
|
|
1550
|
-
if (!hits.length) throw new Error(`"${raw}" \uB294 \uCC3D\uACE0\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
1551
|
-
if (hits.length > 1) throw new Error(`"${raw}" \uAC00 \uBAA8\uD638\uD569\uB2C8\uB2E4: ${hits.map((h) => `${h.category}/${h.id}`).join(", ")}`);
|
|
1552
|
-
return { category: hits[0].category, id: hits[0].id };
|
|
1553
|
-
}
|
|
1554
|
-
async function remove(ctx, raw) {
|
|
1555
|
-
const m = await loadManifest(ctx);
|
|
1556
|
-
const { category, id } = resolveKey(m, raw);
|
|
1557
|
-
const users = listRows(m).find((r) => r.category === category && r.id === id).usedBy;
|
|
1558
|
-
if (users.length) throw new Error(`${category}/${id} \uB294 \uD504\uB85C\uD544 ${users.join(", ")} \uC774 \uC4F0\uACE0 \uC788\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 \uD504\uB85C\uD544\uC5D0\uC11C \uBE7C\uC138\uC694.`);
|
|
1559
|
-
const text = await fs14.readFile(manifestPath(ctx), "utf8");
|
|
1560
|
-
const doc = YAML6.parseDocument(text);
|
|
1561
|
-
let deleted;
|
|
1562
|
-
if (category === PACKAGES) {
|
|
1563
|
-
const seq = doc.get(PACKAGES);
|
|
1564
|
-
if (!isSeq2(seq)) throw new Error("packages \uAC00 \uBAA9\uB85D\uC774 \uC544\uB2D9\uB2C8\uB2E4");
|
|
1565
|
-
const idx = seq.items.findIndex((it) => isMap2(it) && it.get("id") === id);
|
|
1566
|
-
seq.delete(idx);
|
|
1567
|
-
if (!seq.items.length) doc.delete(PACKAGES);
|
|
1568
|
-
const lock = await readLock(ctx.shed);
|
|
1569
|
-
if (lock.packages[id]) {
|
|
1570
|
-
delete lock.packages[id];
|
|
1571
|
-
await writeLock(ctx.shed, lock);
|
|
1572
|
-
}
|
|
1573
|
-
ctx.log(` - package ${id} (\uB9E4\uB2C8\uD398\uC2A4\uD2B8\xB7\uB77D\uC5D0\uC11C \uC81C\uAC70. \uB85C\uCEEC clone \uC740 \uADF8\uB300\uB85C)`);
|
|
1574
|
-
} else {
|
|
1575
|
-
const seq = doc.getIn(["components", category]);
|
|
1576
|
-
if (!isSeq2(seq)) throw new Error(`components.${category} \uAC00 \uBAA9\uB85D\uC774 \uC544\uB2D9\uB2C8\uB2E4`);
|
|
1577
|
-
const idx = seq.items.findIndex((it) => isMap2(it) && it.get("id") === id);
|
|
1578
|
-
seq.delete(idx);
|
|
1579
|
-
if (!seq.items.length) doc.deleteIn(["components", category]);
|
|
1580
|
-
const src = sourcePath(ctx, category, findComponent(m, category, id));
|
|
1581
|
-
const inside = !path18.relative(ctx.shed, src).startsWith("..");
|
|
1582
|
-
if (inside && await exists(src)) {
|
|
1583
|
-
await removeTree(src);
|
|
1584
|
-
deleted = src;
|
|
1585
|
-
}
|
|
1586
|
-
ctx.log(` - ${category}/${id}${deleted ? "" : " (\uCC3D\uACE0 \uBC16 \uACBD\uB85C\uB77C \uD30C\uC77C\uC740 \uB450\uC5C8\uC74C)"}`);
|
|
1587
|
-
}
|
|
1588
|
-
await fs14.writeFile(manifestPath(ctx), doc.toString());
|
|
1589
|
-
return { category, id, deleted };
|
|
1590
|
-
}
|
|
1591
|
-
async function prune(ctx, opts = {}) {
|
|
1592
|
-
const m = await loadManifest(ctx);
|
|
1593
|
-
const unused = listRows(m).filter((r) => !r.usedBy.length);
|
|
1594
|
-
if (!unused.length) {
|
|
1595
|
-
ctx.log("\uBBF8\uC0AC\uC6A9 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
1596
|
-
return [];
|
|
1597
|
-
}
|
|
1598
|
-
if (!opts.yes) {
|
|
1599
|
-
ctx.log(`\uBBF8\uC0AC\uC6A9 ${unused.length}\uAC1C (\uC9C0\uC6B0\uB824\uBA74 --yes):`);
|
|
1600
|
-
for (const r of unused) ctx.log(` ${r.category}/${r.id}`);
|
|
1601
|
-
return [];
|
|
1602
|
-
}
|
|
1603
|
-
const removed = [];
|
|
1604
|
-
for (const r of unused) {
|
|
1605
|
-
await remove(ctx, `${r.category}/${r.id}`);
|
|
1606
|
-
removed.push(`${r.category}/${r.id}`);
|
|
1607
|
-
}
|
|
1608
|
-
ctx.log(`
|
|
1609
|
-
${removed.length}\uAC1C \uC81C\uAC70. \uCC3D\uACE0\uB97C \uCEE4\uBC0B\uD558\uC138\uC694: ${ctx.shed}`);
|
|
1610
|
-
return removed;
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
// src/core/sync.ts
|
|
1614
|
-
import os3 from "os";
|
|
1615
|
-
async function sync(ctx, opts = {}) {
|
|
1616
|
-
const shed = ctx.shed;
|
|
1617
|
-
const push = opts.push ?? true;
|
|
1618
|
-
if (!await isRepo(shed)) {
|
|
1619
|
-
throw new Error(`\uCC3D\uACE0\uAC00 git \uC800\uC7A5\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4: ${shed}
|
|
1620
|
-
cd ${shed} && git init && git add -A && git commit -m "my harness"
|
|
1621
|
-
\uC6D0\uACA9\uC5D0 \uB450\uB824\uBA74: git remote add origin <url> && git push -u origin HEAD`);
|
|
1622
|
-
}
|
|
1623
|
-
const res = { committed: [], pulled: 0, pushed: false, unsaved: [] };
|
|
1624
|
-
if (await readState(ctx.adapter)) {
|
|
1625
|
-
try {
|
|
1626
|
-
res.unsaved = (await diff(ctx)).map((d) => `${d.item.category}/${d.item.id}`);
|
|
1627
|
-
} catch {
|
|
1628
|
-
}
|
|
1629
|
-
if (res.unsaved.length) ctx.log(` ! \uB85C\uCEEC \uD3B8\uC9D1 ${res.unsaved.length}\uAC1C\uAC00 \uCC3D\uACE0\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4: ${res.unsaved.join(", ")} \u2192 lshed save \uD6C4 \uB2E4\uC2DC sync`);
|
|
1630
|
-
}
|
|
1631
|
-
const dirty = (await git(["status", "--porcelain", "--untracked-files=all"], shed)).split("\n").filter(Boolean).map((l) => l.slice(3).trim());
|
|
1632
|
-
if (dirty.length) {
|
|
1633
|
-
const msg = opts.message ?? defaultMessage(dirty, (await readState(ctx.adapter))?.profile);
|
|
1634
|
-
ctx.log(` ${opts.dryRun ? "(dry-run) " : ""}commit ${dirty.length}\uAC1C: ${dirty.slice(0, 5).join(", ")}${dirty.length > 5 ? ` \uC678 ${dirty.length - 5}` : ""}`);
|
|
1635
|
-
if (!opts.dryRun) {
|
|
1636
|
-
await git(["add", "-A"], shed);
|
|
1637
|
-
try {
|
|
1638
|
-
await git(["commit", "--quiet", "-m", msg], shed);
|
|
1639
|
-
} catch (e) {
|
|
1640
|
-
if (/Author identity unknown|Please tell me who you are/.test(e.message)) {
|
|
1641
|
-
throw new Error(`git \uC0AC\uC6A9\uC790 \uC815\uBCF4\uAC00 \uC5C6\uC5B4 \uCEE4\uBC0B\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD55C \uBC88\uB9CC \uC124\uC815\uD558\uC138\uC694:
|
|
233
|
+
`;return t.adapter.instructionsStrategy()==="import"?i+r.map(n=>`@${Ah}/${n.id}.md`).join(`
|
|
234
|
+
`)+`
|
|
235
|
+
`:i+r.map(n=>`<!-- ${n.id} -->
|
|
236
|
+
${n.content.trimEnd()}
|
|
237
|
+
`).join(`
|
|
238
|
+
`)}var Uh=fn(cn(),1);import{promises as Yw}from"fs";import Xw from"path";var mj=T.object({source:T.string(),rev:T.string().optional(),commit:T.string().optional()}).transform(t=>({source:t.source,rev:t.rev??t.commit??""})),hj=T.object({version:T.literal(1),packages:T.record(T.string(),mj).default({})}),Th="lshed.lock";async function ot(t){try{return hj.parse(Uh.default.parse(await Yw.readFile(Xw.join(t,Th),"utf8")))}catch(e){if(e.code==="ENOENT")return{version:1,packages:{}};throw new Error(`${Th} \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${e.message}`)}}async function at(t,e){let r={version:1,packages:Object.fromEntries(Object.entries(e.packages).sort())};await Yw.writeFile(Xw.join(t,Th),`# generated by lshed \u2014 do not edit; 'lshed update' refreshes it
|
|
239
|
+
`+Uh.default.stringify(r))}import h6 from"path";import{promises as uc}from"fs";import Lh from"path";async function Qw(t,e){let r=[];for(let i of oc(t))r.push(...await i.detect(t,e));return r}async function ek(t,e){let r=new Map,i=e.filter(o=>o.path);if(!i.length)return r;let n=await Promise.all(i.map(async o=>({id:o.id,real:await Oc(o.path)})));for(let o of t){if(i.some(s=>s.path===o.path))continue;let a;try{if(!(await uc.stat(o.path)).isDirectory())continue;a=await uc.readdir(o.path)}catch{continue}for(let s of a){let c=Lh.join(o.path,s),u;try{if(!(await uc.lstat(c)).isSymbolicLink())continue;u=await Oc(Lh.resolve(o.path,await uc.readlink(c)))}catch{continue}let l=n.find(d=>Xi(d.real,u));if(l){r.set(`${o.category}/${o.id}`,l.id);break}}}return r}async function lc(t,e,r){let i=await Vi(t,e.source).status(t,e);return{pkg:e,...i,locked:r.packages[e.id]?.rev||void 0}}var un=t=>t&&/^[0-9a-f]{40}$/.test(t)?t.slice(0,7):t;function tk(t,e){return e.map((r,i)=>({p:r,i,pr:Vi(t,r.source).priority})).sort((r,i)=>r.pr-i.pr||r.i-i.i).map(r=>r.p)}async function nk(t,e,r={}){let i=await ot(t.shed),n={installed:[],pendingInstalls:[],lockChanged:!1};for(let o of tk(t,e)){let a=Vi(t,o.source),s=await lc(t,o,i);if(s.present){let u=s.locked&&s.rev!==s.locked?` (${un(s.rev)} \u2260 lock ${un(s.locked)})`:"";t.log(` = package ${o.id}${u}`);continue}if(t.log(` + package ${o.id} (${a.describe(o,s.locked)})`),r.dryRun)continue;let c=await a.install(t,o,s.locked,r);c!==s.locked&&(s.locked&&t.log(` \uB77D\uC740 ${un(s.locked)} \uC774\uC9C0\uB9CC ${un(c)} \uC774 \uC124\uCE58\uB428. \uB77D\uC744 \uB530\uB77C\uAC00\uAC8C \uAC31\uC2E0`),i.packages[o.id]={source:o.source,rev:c},n.lockChanged=!0),n.installed.push(o.id),await rk(t,o,a.cwd(t,o),r,n)}return n.lockChanged&&await at(t.shed,i),n}async function rk(t,e,r,i,n){e.install&&(i.yes?(t.log(` $ (${Lh.relative(t.adapter.root,r)||"."}) ${e.install}`),await wg(e.install,r)):n.pendingInstalls.push({id:e.id,dir:r,cmd:e.install}))}function Fi(t,e){if(e.pendingInstalls.length){t.log(`
|
|
240
|
+
\uC124\uCE58 \uBA85\uB839 ${e.pendingInstalls.length}\uAC1C\uB97C \uC2E4\uD589\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uD655\uC778 \uD6C4 '--yes' \uB85C \uB2E4\uC2DC \uC2E4\uD589\uD558\uAC70\uB098 \uC9C1\uC811 \uB3CC\uB9AC\uC138\uC694:`);for(let r of e.pendingInstalls)t.log(` cd ${r.dir} && ${r.cmd}`)}}async function ik(t,e,r={}){let i=await ot(t.shed),n={installed:[],pendingInstalls:[],lockChanged:!1};for(let o of tk(t,e)){let a=Vi(t,o.source);if(!(await lc(t,o,i)).present){t.log(` ! package ${o.id}: \uC124\uCE58\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC74C. \uBA3C\uC800 restore \uD558\uC138\uC694`);continue}if(r.dryRun){t.log(` ~ package ${o.id} (${a.name} update)`);continue}let c=await a.update(t,o,r),u=i.packages[o.id]?.rev;c!==u?(i.packages[o.id]={source:o.source,rev:c},n.lockChanged=!0,t.log(` \u2191 package ${o.id} ${u?un(u):"(\uC5C6\uC74C)"} \u2192 ${un(c)}`),await rk(t,o,a.cwd(t,o),r,n)):t.log(` = package ${o.id} ${un(c)} (\uCD5C\uC2E0)`)}return n.lockChanged&&await at(t.shed,i),n}var st=t=>`${t.category}/${t.id}`;function Zh(t,e=[]){if(typeof t=="string")e.push(t);else if(Array.isArray(t))for(let r of t)Zh(r,e);else if(t&&typeof t=="object")for(let r of Object.values(t))Zh(r,e);return e}async function dc(t,e=[]){let r=(u,l)=>e.some(d=>d===l||d===`${u}/${l}`),i=[],n=[],o=await t.adapter.scan(),a=await Qw(t,o),s=a.filter(u=>r("packages",u.id)?(i.push(`packages/${u.id}`),!1):!0),c=await ek(o,s);for(let u of s)n.push({kind:"package",category:"packages",id:u.id,pkg:u});for(let u of t.adapter.categories())for(let l of o.filter(d=>d.category===u.name))if(!(a.some(d=>d.path===l.path)||c.has(st(l)))){if(r(l.category,l.id)){i.push(st(l));continue}n.push({kind:"component",category:u.name,id:l.id,path:l.path,cat:u})}for(let u of t.adapter.entries()){let l=await u.read();for(let d of Object.keys(l).sort()){if(r(u.name,d)){i.push(`${u.name}/${d}`);continue}if(!/^[\w.-]+$/.test(d)){t.log(` ! ${u.name}/${d}: \uC774\uB984\uC5D0 \uC4F8 \uC218 \uC5C6\uB294 \uBB38\uC790\uAC00 \uC788\uC5B4 \uAC74\uB108\uB700`);continue}let f=s.find(m=>m.path&&Zh(l[d]).some(h=>Xi(m.path,h))),p=f?`\uD328\uD0A4\uC9C0 ${f.id} \uC548\uC744 \uAC00\uB9AC\uD0B5\uB2C8\uB2E4. \uADF8 \uC124\uCE58\uAC00 \uB9CC\uB4E0 \uAC83\uC774\uBA74 exclude \uD558\uC138\uC694: ${u.name}/${d}`:void 0;n.push({kind:"entry",category:u.name,id:d,value:l[d],cat:u,warn:p})}}return{items:n,generated:c,excluded:i}}function Mh(t,e){return e.items.filter(r=>r.kind==="package"?!t.packages.some(i=>i.id===r.id):!(t.components[r.category]??[]).some(i=>i.id===r.id))}function ok(t,e,r){let i=t.profiles[e]??{};return r.items.filter(n=>!Mh(t,r).includes(n)).filter(n=>!(i[n.category]??[]).includes(n.id)).map(st)}function ak(t){return/^[0-9a-f]{40}$/.test(t)?t.slice(0,7):t}var dn=fn(cn(),1);import pk from"path";import{promises as Vh}from"fs";import fc from"os";import gj from"path";var vj=new Set(["key","apikey","token","secret","password","passwd","auth","authorization","credential","credentials","cookie","session"]);function yj(t){return t.split(/[^A-Za-z0-9]+|(?<=[a-z0-9])(?=[A-Z])/).some(e=>vj.has(e.toLowerCase()))}var Dt=/\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-([^}]*))?\}/g;function pc(t){let e=new Set;return lr(t,r=>{for(let i of r.matchAll(Dt))e.add(i[1]);return r}),[...e]}function lr(t,e,r=[]){return typeof t=="string"?e(t,r):Array.isArray(t)?t.map((i,n)=>lr(i,e,[...r,String(n)])):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([i,n])=>[i,lr(n,e,[...r,i])])):t}var sk=(...t)=>t.join("_").replace(/[^A-Za-z0-9]+/g,"_").replace(/^_+|_+$/g,"").toUpperCase();function Rh(t,e,r,i=fc.homedir()){if(e=ck(e,i),!e||typeof e!="object"||Array.isArray(e))return e;let n=(a,s)=>{let c={};for(let[u,l]of Object.entries(a)){if(typeof l!="string"||!yj(u)||Dt.test(l)){c[u]=l,Dt.lastIndex=0;continue}let d=s?sk(u):sk(t,u),f=/^(\w+) \S+$/.exec(l);c[u]=f?`${f[1]} \${${d}}`:`\${${d}}`}return c};if(r.secretRootIds?.includes(t))return n(e,!0);let o={...e};for(let a of r.secretKeys){let s=o[a];!s||typeof s!="object"||Array.isArray(s)||(o[a]=n(s,a==="env"))}return o}function ck(t,e=fc.homedir()){return!e||e==="/"?t:lr(t,r=>r===e||r.startsWith(e+"/")||r.startsWith(e+"\\")?"${HOME}"+r.slice(e.length):r)}function mc(t=process.env){return{HOME:fc.homedir(),...t}}function uk(t){let e=[];return lr(t,(r,i)=>(/^(sk-|ghp_|github_pat_|xox[abp]-|AKIA|glpat-|ntn_|secret_)[A-Za-z0-9_-]{8,}/.test(r)&&e.push(i.join(".")),r)),e}function hc(t,e=process.env){let r=new Set;return{value:lr(t,n=>n.replace(Dt,(o,a,s)=>e[a]!==void 0?e[a]:s!==void 0?s:(r.add(a),o))),missing:[...r]}}function lk(t,e){if(t===e)return!0;if(!Dt.test(t))return Dt.lastIndex=0,!1;Dt.lastIndex=0;let r="^"+t.split(Dt).map((i,n)=>n%3===0?i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):n%3===1?".+":"").join("")+"$";return new RegExp(r).test(e)}function ln(t,e){if(typeof t=="string"&&typeof e=="string")return lk(t,e);if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every((r,i)=>ln(r,e[i]));if(t&&e&&typeof t=="object"&&typeof e=="object"&&!Array.isArray(t)&&!Array.isArray(e)){let r=Object.keys(t).sort(),i=Object.keys(e).sort();return r.length===i.length&&r.every((n,o)=>n===i[o]&&ln(t[n],e[n]))}return t===e}function dk(t,e,r,i,n=fc.homedir()){let o=(a,s)=>typeof a=="string"&&typeof s=="string"&&lk(s,a)?s:Array.isArray(a)&&Array.isArray(s)?a.map((c,u)=>o(c,s[u])):a&&s&&typeof a=="object"&&typeof s=="object"&&!Array.isArray(a)&&!Array.isArray(s)?Object.fromEntries(Object.entries(a).map(([c,u])=>[c,o(u,s[c])])):a;return Rh(t,r===null?e:o(e,ck(r,n)),i,n)}function fk(t,e){let r=[],i=(n,o,a)=>{if(n===void 0){r.push({status:"A",file:a||"(entry)"});return}if(o===void 0){r.push({status:"D",file:a||"(entry)"});return}if(n&&o&&typeof n=="object"&&typeof o=="object"&&!Array.isArray(n)&&!Array.isArray(o)){for(let c of new Set([...Object.keys(n),...Object.keys(o)]).values())i(n[c],o[c],a?`${a}.${c}`:c);return}ln(n,o)||r.push({status:"M",file:a||"(entry)"})};return i(t,e,""),r.sort((n,o)=>n.file.localeCompare(o.file))}async function Ct(t){try{return JSON.parse(await Vh.readFile(t,"utf8"))}catch(e){if(e.code==="ENOENT")return null;throw new Error(`${t}: JSON \uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${e.message}`)}}async function dr(t,e){await Vh.mkdir(gj.dirname(t),{recursive:!0}),await Vh.writeFile(t,JSON.stringify(e,null,2)+`
|
|
241
|
+
`)}function gc(t,e){let r=t.getIn(e);return(0,dn.isSeq)(r)||(r=t.createNode([]),t.setIn(e,r)),r}function mk(t,e){t.items.some(r=>((0,dn.isMap)(r)?r.get("id"):String(r))===e)||t.add(e)}async function vc(t,e,r,i,n){let o={managed:[],copied:0,packages:[]};for(let a of i){if(a.kind==="package"){let c=a.pkg,u=e.createNode(c.into?{id:c.id,source:c.source,into:c.into}:{id:c.id,source:c.source});c.into&&(u.comment=" install: ./setup # \u2190 \uBCF5\uC6D0 \uD6C4 \uC2E4\uD589\uD560 \uBA85\uB839\uC774 \uC788\uC73C\uBA74 \uCC44\uC6B0\uC138\uC694 (--yes \uB85C \uC2E4\uD589)");let l=gc(e,[de]);l.items.some(d=>(0,dn.isMap)(d)&&d.get("id")===c.id)||l.add(u),mk(gc(e,["profiles",r,de]),c.id),n.packages[c.id]={source:c.source,rev:c.rev},o.packages.push(c.id),t.log(` \u2261 package ${c.id} ${c.source} @${ak(c.rev)} (\uCC38\uC870\uB9CC \uAE30\uB85D)`);continue}if(a.kind==="component"){let c=pk.join(t.shed,a.cat.root,a.cat.kind==="dir"?a.id:`${a.id}.md`);await et(a.path,c,ge(t)),t.log(` + ${a.category}/${a.id}`)}else{let c=Rh(a.id,a.value,a.cat);await dr(pk.join(t.shed,a.category,`${a.id}.json`),c);let u=pc(c).filter(l=>l!=="HOME");t.log(` + ${a.category}/${a.id}${u.length?` (\uC2DC\uD06C\uB9BF \u2192 ${u.map(l=>"${"+l+"}").join(", ")})`:""}`);for(let l of uk(c))t.log(` ! ${l} \uAC00 \uC2DC\uD06C\uB9BF\uCC98\uB7FC \uBCF4\uC785\uB2C8\uB2E4. \uCC3D\uACE0\uC758 ${a.category}/${a.id}.json \uC5D0\uC11C \${VAR} \uB85C \uBC14\uAFB8\uC138\uC694`);a.warn&&t.log(` ! ${a.warn}`)}let s=gc(e,["components",a.category]);s.items.some(c=>(0,dn.isMap)(c)&&c.get("id")===a.id)||s.add(e.createNode({id:a.id})),mk(gc(e,["profiles",r,a.category]),a.id),o.managed.push(Ri(a.cat,a.id)),o.copied++}return o}function yc(t){let e=t.get(de);(0,dn.isSeq)(e)&&!e.items.length&&t.delete(de)}var $j=`# lshed manifest \u2014 edit freely. Reference: https://github.com/LeeSongHeon-LSH/lshed
|
|
242
|
+
`;async function gk(t,e={}){let r=e.profile??"default";if(await ee(Te(t)))throw new Error(`\uC774\uBBF8 \uCD08\uAE30\uD654\uB41C \uCC3D\uACE0\uC785\uB2C8\uB2E4: ${Te(t)}
|
|
243
|
+
\uC774 \uD658\uACBD\uC5D0 \uC0C8\uB85C \uC0DD\uAE34 \uAC83\uC744 \uAE30\uC874 \uCC3D\uACE0\uC5D0 \uB123\uC73C\uB824\uBA74 'lshed add' \uB97C, \uB2E4\uB978 \uD658\uACBD\uC758 \uC124\uC815\uC744 \uAC00\uC838\uC624\uB824\uBA74 'lshed restore' \uD6C4 'lshed save' \uB97C \uC4F0\uC138\uC694.`);let i=await dc(t,e.exclude);for(let[m,h]of i.generated)t.log(` \xB7 ${m} (${h} \uAC00 \uC0DD\uC131\uD55C \uAC83 \u2192 \uAC74\uB108\uB700)`);for(let m of i.excluded)t.log(` - ${m} (--exclude)`);let n=e.exclude?.length?{exclude:[...e.exclude]}:{},o=new hk.default.Document({version:1,agent:t.adapter.name,...n,components:{},packages:[],profiles:{[r]:{}}}),a={version:1,packages:{}};await qi.mkdir(t.shed,{recursive:!0});let s=await vc(t,o,r,i.items,a),c=[...s.managed],u=s.copied,l=sc(t);if(await ee(l)){let m=await qi.readFile(l,"utf8");if(!cc(m)){let h=Fh.join(t.shed,Oe,"main.md");await qi.mkdir(Fh.dirname(h),{recursive:!0}),await qi.writeFile(h,m);let g=Ri(Oe,"main");await et(h,He(t,g),ge(t)),c.push(g),o.setIn(["components",Oe],[{id:"main"}]),o.setIn(["profiles",r,Oe],["main"]),u++,t.log(` + ${Oe}/main (${Fh.basename(l)})`)}}yc(o);let d=$j+o.toString({lineWidth:0});await qi.writeFile(Te(t),d),s.packages.length&&await at(t.shed,a),await ur(t.adapter,{profile:r,shed:t.shed,managed:c,appliedAt:new Date().toISOString()});let f=[`\uBD80\uD488 ${u}\uAC1C`];return s.packages.length&&f.push(`\uD328\uD0A4\uC9C0 ${s.packages.length}\uAC1C`),i.generated.size&&f.push(`\uC0DD\uC131\uBB3C ${i.generated.size}\uAC1C \uAC74\uB108\uB700`),i.excluded.length&&f.push(`\uC81C\uC678 ${i.excluded.length}\uAC1C`),t.log(`
|
|
244
|
+
${ac} \uC0DD\uC131: ${Te(t)} (${f.join(", ")}, \uD504\uB85C\uD544 "${r}")`),i.items.some(m=>m.kind==="package"&&m.pkg.into)&&t.log("git \uD328\uD0A4\uC9C0\uC758 \uC124\uCE58 \uBA85\uB839(install:)\uC740 lshed.yaml \uC5D0\uC11C \uC9C1\uC811 \uCC44\uC6B0\uC138\uC694."),{manifest:ic(d),copied:u,skipped:i.excluded,packages:s.packages,generated:[...i.generated.keys()]}}import{promises as qh}from"fs";import Jh from"path";async function yk(t,e,r={}){let i=r.backup??!0,n=await le(t.adapter),o=e??n?.profile;if(!o)throw new Error("\uD504\uB85C\uD544\uC744 \uC9C0\uC815\uD558\uC138\uC694: lshed restore <profile> (\uC774\uC804\uC5D0 \uC801\uC6A9\uD55C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4)");let a=await fe(t),s=Et(t,a,o);for(let w of s)if(!await ee(w.src))throw new Error(`${w.category}/${w.id}: \uCC3D\uACE0\uC5D0 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4: ${w.src}`);let c=await nk(t,cr(a,o),{dryRun:r.dryRun,yes:r.yes}),u=t.adapter.instructionsFileName(),l=s.filter(w=>w.category===Oe),d=new Set(s.map(w=>w.rel));l.length&&d.add(u);let p=[...new Set(n?.managed??[])].filter(w=>!d.has(w)).sort();n&&n.shed!==t.shed&&p.length&&(t.log(`! \uB9C8\uC9C0\uB9C9\uC73C\uB85C \uC801\uC6A9\uD55C \uCC3D\uACE0\uAC00 \uB2E4\uB985\uB2C8\uB2E4: ${n.shed}`),t.log(` \uC544\uB798 ${p.length}\uAC1C\uB294 \uADF8 \uCC3D\uACE0\uC758 \uAD00\uB9AC \uBAA9\uB85D\uC5D0 \uC788\uC5B4 \uC81C\uAC70 \uB300\uC0C1\uC785\uB2C8\uB2E4 (\uBC31\uC5C5\uB428). \uC774 \uAE30\uAE30\uC758 \uAC83\uC744 \uC9C0\uD0A4\uB824\uBA74 \uBA3C\uC800 'lshed add' \uB85C \uCC3D\uACE0\uC5D0 \uB123\uC73C\uC138\uC694.`));let m=new Date().toISOString().replace(/[:.]/g,"-"),h=Jh.join(t.adapter.root,Mi,"backups",m),g=[],S=[],b=[],x=new Map,z=async w=>(x.has(w.name)||x.set(w.name,await w.read()),x.get(w.name));async function P(w){let L=jh(t,w);if(L){let re=(await z(L.cat))[L.id];if(re===void 0||(g.push(w),r.dryRun||!i))return;await dr(Jh.join(h,L.cat.name,`${L.id}.json`),re);return}let Y=He(t,w);await ee(Y)&&(g.push(w),!(r.dryRun||!i)&&await et(Y,Jh.join(h,...w.split("/")),ge(t)))}for(let w of p){if(t.log(` - ${w}`),await P(w),r.dryRun)continue;let L=jh(t,w);L?await L.cat.write(L.id,null):await Qi(He(t,w))}for(let w of s){if(w.entry){let G=await Ct(w.src),Ye=(await z(w.entry))[w.id],Xh=pc(G).filter(bc=>bc!=="HOME"),$c=hc(G,mc());$c.missing.length&&b.push({rel:w.rel,vars:$c.missing});let Pk=w.entry.expandsEnv?G:$c.value,Qh=Ye!==void 0&&ln(G,Ye),Nk=Qh?"=":Ye!==void 0?"~":"+";if(t.log(` ${Nk} ${w.rel}${Xh.length?` (${Xh.map(bc=>"${"+bc+"}").join(", ")})`:""}`),Qh){S.push(w.rel);continue}Ye!==void 0&&await P(w.rel),r.dryRun||await w.entry.write(w.id,Pk),S.push(w.rel);continue}let L=He(t,w.rel),Y=await hn(L,ge(t))===await hn(w.src,ge(t)),re=Y?"=":await ee(L)?"~":"+";if(t.log(` ${re} ${w.rel}`),Y){S.push(w.rel);continue}await ee(L)&&await P(w.rel),r.dryRun||await et(w.src,L,ge(t)),S.push(w.rel)}let O=sc(t);if(l.length){let w=[];for(let re of l)w.push({id:re.id,content:await qh.readFile(re.src,"utf8")});let L=Hw(t,o,w),Y=await ee(O)?await qh.readFile(O,"utf8"):null;if(Y!==L){let re=Y===null?"+":"~";t.log(` ${re} ${u}${Y!==null&&!cc(Y)?" (\uAE30\uC874 \uD30C\uC77C\uC740 lshed \uC0DD\uC131\uBB3C\uC774 \uC544\uB2D8 \u2192 \uBC31\uC5C5)":""}`),Y!==null&&await P(u),r.dryRun||await qh.writeFile(O,L)}else t.log(` = ${u}`);S.push(u)}if(r.dryRun)return t.log(`
|
|
245
|
+
(dry-run) \uBCC0\uACBD \uC5C6\uC74C. \uBC30\uCE58 ${S.length}, \uC81C\uAC70 ${p.length}, \uBC31\uC5C5 \uC608\uC815 ${g.length}`),Fi(t,c),vk(t,b),{profile:o,placed:S,removed:p,backedUp:g,backupDir:null,missingEnv:b};await ur(t.adapter,{profile:o,shed:t.shed,managed:[...d].sort(),appliedAt:new Date().toISOString()});let D=i&&g.length?h:null;return t.log(`
|
|
246
|
+
\uD504\uB85C\uD544 "${o}" \uC801\uC6A9: \uBC30\uCE58 ${S.length}, \uC81C\uAC70 ${p.length}${c.installed.length?`, \uD328\uD0A4\uC9C0 \uC124\uCE58 ${c.installed.length}`:""}${D?`, \uBC31\uC5C5 ${g.length} \u2192 ${D}`:""}`),Fi(t,c),vk(t,b),{profile:o,placed:S,removed:p,backedUp:g,backupDir:D,missingEnv:b}}function vk(t,e){if(e.length){t.log(`
|
|
247
|
+
\uD658\uACBD\uBCC0\uC218\uAC00 \uC5C6\uB294 \uD56D\uBAA9\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uC2DC\uD06C\uB9BF \uAC12\uC740 \uCC3D\uACE0\uC5D0 \uB2F4\uC9C0 \uC54A\uC73C\uBBC0\uB85C \uC774 \uAE30\uAE30\uC758 \uC178 \uD658\uACBD\uC5D0 \uB123\uC73C\uC138\uC694 (\uC608: ~/.zshrc \uC758 export):`);for(let r of e)t.log(` ${r.rel}: ${r.vars.join(", ")}`)}}async function fr(t){let e=await le(t.adapter);if(!e)throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");let r=await fe(t),i=[],n=new Map;for(let o of Et(t,r,e.profile)){let a;if(o.entry){n.has(o.category)||n.set(o.category,await o.entry.read());let s=await Ct(o.src);a=s===null?[{status:"A",file:"(entry)"}]:fk(s,n.get(o.category)[o.id])}else a=await mg(He(t,o.rel),o.src,ge(t));a.length&&i.push({item:o,changes:a})}return i}function $k(t){if(!t.length)return"\uB85C\uCEEC\uACFC \uCC3D\uACE0\uAC00 \uC77C\uCE58\uD569\uB2C8\uB2E4.";let e=[];for(let r of t){e.push(`${r.item.category}/${r.item.id}`);for(let i of r.changes)e.push(` ${i.status} ${i.file||"(file)"}`)}return e.push("","A: \uB85C\uCEEC\uC5D0\uB9CC \uC788\uC74C M: \uB0B4\uC6A9 \uB2E4\uB984 D: \uCC3D\uACE0\uC5D0\uB9CC \uC788\uC74C","\uB85C\uCEEC \uD3B8\uC9D1\uC744 \uCC3D\uACE0\uC5D0 \uBC18\uC601\uD558\uB824\uBA74: lshed save"),e.join(`
|
|
248
|
+
`)}var _k=fn(cn(),1);import{promises as bk}from"fs";async function Bh(t,e,r,i){return i??=await dc(t,e.exclude),{fresh:Mh(e,i),notInProfile:ok(e,r,i),generated:i.generated}}async function wk(t,e=[],r={}){let i=await le(t.adapter);if(!i)throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed init' \uB610\uB294 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");let n=await fe(t),o=await Bh(t,n,i.profile);if(!e.length&&!r.all){if(!o.fresh.length)t.log("\uCC3D\uACE0\uC5D0 \uC5C6\uB294 \uC0C8 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");else{t.log(`\uCC3D\uACE0\uC5D0 \uC5C6\uB294 \uD56D\uBAA9 ${o.fresh.length}\uAC1C (\uB123\uC73C\uB824\uBA74 lshed add <key...> \uB610\uB294 --all):`);for(let f of o.fresh)t.log(` ${f.kind==="package"?"\u2261":" "} ${st(f)}${f.kind==="package"?` ${f.pkg.source}`:f.kind==="entry"&&f.warn?` ! ${f.warn}`:""}`)}return Kh(t,o,i.profile),[]}let a=o.fresh;if(e.length&&(a=e.map(f=>{let[p,m]=f.includes("/")?f.split("/",2):[void 0,f],h=o.fresh.filter(g=>g.id===m&&(p===void 0||g.category===p));if(!h.length){let g=(n.components[p??""]??[]).some(S=>S.id===m)||Object.values(n.components).some(S=>S.some(b=>b.id===m))||n.packages.some(S=>S.id===m);throw new Error(g?`"${f}" \uB294 \uC774\uBBF8 \uCC3D\uACE0\uC5D0 \uC788\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uD544\uC5D0 \uB123\uC73C\uB824\uBA74 lshed.yaml \uC758 profiles \uB97C \uACE0\uCE58\uC138\uC694.`:`"${f}" \uB294 \uB85C\uCEEC\uC5D0\uC11C \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. 'lshed add' \uB85C \uD6C4\uBCF4\uB97C \uBCF4\uC138\uC694.`)}if(h.length>1)throw new Error(`"${f}" \uAC00 \uBAA8\uD638\uD569\uB2C8\uB2E4: ${h.map(st).join(", ")}`);return h[0]})),!a.length)return t.log("\uCC3D\uACE0\uC5D0 \uC5C6\uB294 \uC0C8 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),Kh(t,o,i.profile),[];let s=_k.default.parseDocument(await bk.readFile(Te(t),"utf8")),c=await ot(t.shed),u=await vc(t,s,i.profile,a,c);yc(s),await bk.writeFile(Te(t),s.toString({lineWidth:0})),u.packages.length&&await at(t.shed,c);let l=[...new Set([...i.managed,...u.managed])].sort();await ur(t.adapter,{...i,managed:l,appliedAt:new Date().toISOString()});let d=a.map(st);return t.log(`
|
|
249
|
+
${d.length}\uAC1C\uB97C \uCC3D\uACE0\uC5D0 \uB123\uACE0 \uD504\uB85C\uD544 "${i.profile}" \uC5D0 \uCD94\uAC00\uD588\uC2B5\uB2C8\uB2E4. \uCC3D\uACE0\uB97C \uCEE4\uBC0B\uD558\uC138\uC694: ${t.shed}`),u.packages.some(f=>a.find(p=>p.id===f&&p.kind==="package"&&p.pkg.into))&&t.log("git \uD328\uD0A4\uC9C0\uC758 \uC124\uCE58 \uBA85\uB839(install:)\uC740 lshed.yaml \uC5D0\uC11C \uC9C1\uC811 \uCC44\uC6B0\uC138\uC694."),Kh(t,{...o,fresh:o.fresh.filter(f=>!a.includes(f))},i.profile),d}function Kh(t,e,r){let i=new Map;for(let n of e.generated.values())i.set(n,(i.get(n)??0)+1);for(let[n,o]of i)t.log(` \xB7 \uD328\uD0A4\uC9C0 ${n} \uAC00 \uC0DD\uC131\uD55C \uAC83 ${o}\uAC1C\uB294 \uB2F4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4`);e.notInProfile.length&&t.log(`\uCC3D\uACE0\uC5D0\uB294 \uC788\uC9C0\uB9CC \uD504\uB85C\uD544 "${r}" \uC774 \uC548 \uC4F0\uB294 \uAC83 ${e.notInProfile.length}\uAC1C: ${e.notInProfile.join(", ")} \u2192 lshed.yaml \uC758 profiles \uC5D0 \uCD94\uAC00`)}async function kk(t){let e=await le(t.adapter);if(!e)return{state:null,drifted:[],packages:[],missingEnv:[],fresh:[]};let r=await fr(t),i=await fe(t),n=await ot(t.shed),o=await Promise.all(cr(i,e.profile).map(c=>lc(t,c,n))),a=[];for(let c of Et(t,i,e.profile).filter(u=>u.entry)){let u=await Ct(c.src),l=u===null?[]:hc(u,mc()).missing;l.length&&a.push({rel:c.rel,vars:l})}let s=(await Bh(t,i,e.profile)).fresh.map(st);return{state:e,drifted:r.map(c=>`${c.item.category}/${c.item.id}`),packages:o,missingEnv:a,fresh:s}}function Wh(t,e){if(!t.state)return`\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 (${e}).
|
|
250
|
+
lshed init --shed <dir> \uB610\uB294 lshed restore <profile>`;let r=[`\uD504\uB85C\uD544 ${t.state.profile}`,`\uCC3D\uACE0 ${t.state.shed}`,`\uC801\uC6A9 ${t.state.appliedAt}`,`\uAD00\uB9AC \uC911 ${t.state.managed.length}\uAC1C \uACBD\uB85C (${e})`];r.push(t.drifted.length?`\uB4DC\uB9AC\uD504\uD2B8 ${t.drifted.length}\uAC1C: ${t.drifted.join(", ")} \u2192 lshed diff`:"\uB4DC\uB9AC\uD504\uD2B8 \uC5C6\uC74C");let i=n=>n&&/^[0-9a-f]{40}$/.test(n)?n.slice(0,7):n;for(let n of t.packages){let o=n.present?n.locked?n.rev===n.locked?`${i(n.rev)} = lock`:`${i(n.rev)} \u2260 lock ${i(n.locked)} \u2192 lshed update`:`${i(n.rev)} (\uB77D \uC5C6\uC74C)`:"\uC124\uCE58 \uC548 \uB428 \u2192 lshed restore";r.push(`\uD328\uD0A4\uC9C0 ${n.pkg.id} ${o}`)}for(let n of t.missingEnv)r.push(`\uD658\uACBD\uBCC0\uC218 ${n.rel}: ${n.vars.join(", ")} \uC5C6\uC74C \u2192 \uC178\uC5D0\uC11C export \uD558\uC138\uC694`);return t.fresh.length&&r.push(`\uCC3D\uACE0 \uBC16 ${t.fresh.length}\uAC1C: ${t.fresh.join(", ")} \u2192 lshed add`),r.join(`
|
|
251
|
+
`)}async function Sk(t,e=[]){let r=await le(t.adapter);if(!r)throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");let i=await fe(t),n=Et(t,i,r.profile);e.length&&(n=e.map(s=>{let[c,u]=s.includes("/")?s.split("/",2):[void 0,s],l=n.filter(d=>d.id===u&&(c===void 0||d.category===c));if(!l.length)throw new Error(`"${s}" \uB294 \uD604\uC7AC \uD504\uB85C\uD544(${r.profile})\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4`);if(l.length>1)throw new Error(`"${s}" \uAC00 \uBAA8\uD638\uD569\uB2C8\uB2E4: ${l.map(d=>`${d.category}/${d.id}`).join(", ")}`);return l[0]}));let o=[],a=new Map;for(let s of n){let c=Zi(s.category,s.component,Eh(t,s.category));if(!Jw(c)){t.log(` ! ${s.category}/${s.id}: \uC6D0\uACA9 \uCD9C\uCC98(${c})\uB294 save \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4`);continue}if(s.entry){a.has(s.category)||a.set(s.category,await s.entry.read());let l=a.get(s.category)[s.id];if(l===void 0){t.log(` ! ${s.category}/${s.id}: \uB85C\uCEEC\uC5D0 \uC5C6\uC74C (\uAC74\uB108\uB700)`);continue}let d=await Ct(s.src);if(d!==null&&ln(d,l))continue;await dr(s.src,dk(s.id,l,d,s.entry)),o.push(`${s.category}/${s.id}`),t.log(` \u2713 ${s.category}/${s.id} \u2192 \uCC3D\uACE0 (\uC2DC\uD06C\uB9BF\uC740 \uC790\uB9AC\uD45C\uC2DC\uC790\uB85C)`);continue}let u=He(t,s.rel);if(!await ee(u)){t.log(` ! ${s.category}/${s.id}: \uB85C\uCEEC\uC5D0 \uC5C6\uC74C (\uAC74\uB108\uB700)`);continue}await hn(u,ge(t))!==await hn(s.src,ge(t))&&(await et(u,s.src,ge(t)),o.push(`${s.category}/${s.id}`),t.log(` \u2713 ${s.category}/${s.id} \u2192 \uCC3D\uACE0`))}return t.log(o.length?`
|
|
252
|
+
${o.length}\uAC1C \uBC18\uC601. \uCC3D\uACE0\uB97C \uCEE4\uBC0B/\uB3D9\uAE30\uD654\uD558\uC138\uC694: ${t.shed}`:"\uBC18\uC601\uD560 \uBCC0\uACBD\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),o}function pr(t){let e=(i,n)=>Object.entries(t.profiles).filter(([,o])=>(o[i]??[]).includes(n)).map(([o])=>o),r=[];for(let[i,n]of Object.entries(t.components))for(let o of n)r.push({kind:"component",category:i,id:o.id,usedBy:e(i,o.id)});for(let i of t.packages)r.push({kind:"package",category:de,id:i.id,usedBy:e(de,i.id)});return r}function xk(t,e){if(!t.length)return"(\uBE44\uC5B4 \uC788\uC74C)";let r=Math.max(...t.map(o=>`${o.category}/${o.id}`.length)),i=t.map(o=>{let a=`${o.category}/${o.id}`.padEnd(r),s=o.usedBy.length?o.usedBy.join(", "):"(\uBBF8\uC0AC\uC6A9)";return`${o.kind==="package"?"\u2261":" "} ${a} ${s}`}),n=t.filter(o=>!o.usedBy.length).length;return i.push("",`${t.length}\uAC1C, \uD504\uB85C\uD544 ${Object.keys(e.profiles).length}\uAC1C${n?`, \uBBF8\uC0AC\uC6A9 ${n}\uAC1C \u2192 lshed prune`:""}`),i.join(`
|
|
253
|
+
`)}var Tt=fn(cn(),1);import{promises as Ik}from"fs";import bj from"path";function _j(t,e){let r=pr(t),[i,n]=e.includes("/")?e.split("/",2):[void 0,e],o=r.filter(a=>a.id===n&&(i===void 0||a.category===i));if(!o.length)throw new Error(`"${e}" \uB294 \uCC3D\uACE0\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4`);if(o.length>1)throw new Error(`"${e}" \uAC00 \uBAA8\uD638\uD569\uB2C8\uB2E4: ${o.map(a=>`${a.category}/${a.id}`).join(", ")}`);return{category:o[0].category,id:o[0].id}}async function Gh(t,e){let r=await fe(t),{category:i,id:n}=_j(r,e),o=pr(r).find(u=>u.category===i&&u.id===n).usedBy;if(o.length)throw new Error(`${i}/${n} \uB294 \uD504\uB85C\uD544 ${o.join(", ")} \uC774 \uC4F0\uACE0 \uC788\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 \uD504\uB85C\uD544\uC5D0\uC11C \uBE7C\uC138\uC694.`);let a=await Ik.readFile(Te(t),"utf8"),s=Tt.default.parseDocument(a),c;if(i===de){let u=s.get(de);if(!(0,Tt.isSeq)(u))throw new Error("packages \uAC00 \uBAA9\uB85D\uC774 \uC544\uB2D9\uB2C8\uB2E4");let l=u.items.findIndex(f=>(0,Tt.isMap)(f)&&f.get("id")===n);u.delete(l),u.items.length||s.delete(de);let d=await ot(t.shed);d.packages[n]&&(delete d.packages[n],await at(t.shed,d)),t.log(` - package ${n} (\uB9E4\uB2C8\uD398\uC2A4\uD2B8\xB7\uB77D\uC5D0\uC11C \uC81C\uAC70. \uB85C\uCEEC clone \uC740 \uADF8\uB300\uB85C)`)}else{let u=s.getIn(["components",i]);if(!(0,Tt.isSeq)(u))throw new Error(`components.${i} \uAC00 \uBAA9\uB85D\uC774 \uC544\uB2D9\uB2C8\uB2E4`);let l=u.items.findIndex(p=>(0,Tt.isMap)(p)&&p.get("id")===n);u.delete(l),u.items.length||s.deleteIn(["components",i]);let d=Dh(t,i,Ch(r,i,n));!bj.relative(t.shed,d).startsWith("..")&&await ee(d)&&(await Qi(d),c=d),t.log(` - ${i}/${n}${c?"":" (\uCC3D\uACE0 \uBC16 \uACBD\uB85C\uB77C \uD30C\uC77C\uC740 \uB450\uC5C8\uC74C)"}`)}return await Ik.writeFile(Te(t),s.toString()),{category:i,id:n,deleted:c}}async function Ok(t,e={}){let r=await fe(t),i=pr(r).filter(o=>!o.usedBy.length);if(!i.length)return t.log("\uBBF8\uC0AC\uC6A9 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),[];if(!e.yes){t.log(`\uBBF8\uC0AC\uC6A9 ${i.length}\uAC1C (\uC9C0\uC6B0\uB824\uBA74 --yes):`);for(let o of i)t.log(` ${o.category}/${o.id}`);return[]}let n=[];for(let o of i)await Gh(t,`${o.category}/${o.id}`),n.push(`${o.category}/${o.id}`);return t.log(`
|
|
254
|
+
${n.length}\uAC1C \uC81C\uAC70. \uCC3D\uACE0\uB97C \uCEE4\uBC0B\uD558\uC138\uC694: ${t.shed}`),n}import wj from"os";async function zk(t,e={}){let r=t.shed,i=e.push??!0;if(!await yr(r))throw new Error(`\uCC3D\uACE0\uAC00 git \uC800\uC7A5\uC18C\uAC00 \uC544\uB2D9\uB2C8\uB2E4: ${r}
|
|
255
|
+
cd ${r} && git init && git add -A && git commit -m "my harness"
|
|
256
|
+
\uC6D0\uACA9\uC5D0 \uB450\uB824\uBA74: git remote add origin <url> && git push -u origin HEAD`);let n={committed:[],pulled:0,pushed:!1,unsaved:[]};if(await le(t.adapter)){try{n.unsaved=(await fr(t)).map(l=>`${l.item.category}/${l.item.id}`)}catch{}n.unsaved.length&&t.log(` ! \uB85C\uCEEC \uD3B8\uC9D1 ${n.unsaved.length}\uAC1C\uAC00 \uCC3D\uACE0\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4: ${n.unsaved.join(", ")} \u2192 lshed save \uD6C4 \uB2E4\uC2DC sync`)}let o=(await te(["status","--porcelain","--untracked-files=all"],r)).split(`
|
|
257
|
+
`).filter(Boolean).map(l=>l.slice(3).trim());if(o.length){let l=e.message??kj(o,(await le(t.adapter))?.profile);if(t.log(` ${e.dryRun?"(dry-run) ":""}commit ${o.length}\uAC1C: ${o.slice(0,5).join(", ")}${o.length>5?` \uC678 ${o.length-5}`:""}`),!e.dryRun){await te(["add","-A"],r);try{await te(["commit","--quiet","-m",l],r)}catch(d){throw/Author identity unknown|Please tell me who you are/.test(d.message)?new Error(`git \uC0AC\uC6A9\uC790 \uC815\uBCF4\uAC00 \uC5C6\uC5B4 \uCEE4\uBC0B\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uD55C \uBC88\uB9CC \uC124\uC815\uD558\uC138\uC694:
|
|
1642
258
|
git config --global user.name "\uC774\uB984"
|
|
1643
|
-
git config --global user.email "\uBA54\uC77C"`);
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
}
|
|
1652
|
-
const remote = await git(["remote", "get-url", "origin"], shed).catch(() => null);
|
|
1653
|
-
if (!remote) {
|
|
1654
|
-
ctx.log(" \xB7 origin \uC774 \uC5C6\uC5B4 pull/push \uB294 \uAC74\uB108\uB700 (git remote add origin <url>)");
|
|
1655
|
-
return res;
|
|
1656
|
-
}
|
|
1657
|
-
if (opts.dryRun) {
|
|
1658
|
-
ctx.log(` (dry-run) pull --rebase, push \u2192 ${remote}`);
|
|
1659
|
-
return res;
|
|
1660
|
-
}
|
|
1661
|
-
const before = await git(["rev-parse", "HEAD"], shed);
|
|
1662
|
-
const branch2 = await git(["rev-parse", "--abbrev-ref", "HEAD"], shed);
|
|
1663
|
-
const hasUpstream = await git(["rev-parse", "--abbrev-ref", "@{upstream}"], shed).then(() => true, () => false);
|
|
1664
|
-
if (hasUpstream) {
|
|
1665
|
-
try {
|
|
1666
|
-
await git(["pull", "--rebase", "--quiet"], shed);
|
|
1667
|
-
} catch (e) {
|
|
1668
|
-
await git(["rebase", "--abort"], shed).catch(() => {
|
|
1669
|
-
});
|
|
1670
|
-
throw new Error(`pull \uC911 \uCDA9\uB3CC\uC774 \uB098\uC11C \uB418\uB3CC\uB838\uC2B5\uB2C8\uB2E4. \uCC3D\uACE0\uC5D0\uC11C \uC9C1\uC811 \uD574\uACB0\uD558\uC138\uC694:
|
|
1671
|
-
cd ${shed} && git pull --rebase
|
|
1672
|
-
(${firstLine(e.message)})`);
|
|
1673
|
-
}
|
|
1674
|
-
const after = await git(["rev-parse", "HEAD"], shed);
|
|
1675
|
-
if (after !== before) {
|
|
1676
|
-
const n = Number(await git(["rev-list", "--count", `${before}..${after}`], shed).catch(() => "0"));
|
|
1677
|
-
res.pulled = Math.max(0, n - (res.committed.length ? 1 : 0));
|
|
1678
|
-
if (res.pulled) ctx.log(` \u2193 \uC6D0\uACA9 \uCEE4\uBC0B ${res.pulled}\uAC1C \uBC1B\uC74C`);
|
|
1679
|
-
}
|
|
1680
|
-
} else {
|
|
1681
|
-
ctx.log(` \xB7 \uBE0C\uB79C\uCE58 ${branch2} \uC5D0 upstream \uC774 \uC5C6\uC5B4 pull \uC740 \uAC74\uB108\uB700`);
|
|
1682
|
-
}
|
|
1683
|
-
if (push) {
|
|
1684
|
-
const ahead = hasUpstream ? Number(await git(["rev-list", "--count", "@{upstream}..HEAD"], shed)) : 1;
|
|
1685
|
-
if (ahead > 0) {
|
|
1686
|
-
await git(hasUpstream ? ["push", "--quiet"] : ["push", "--quiet", "-u", "origin", branch2], shed);
|
|
1687
|
-
res.pushed = true;
|
|
1688
|
-
ctx.log(` \u2191 push ${hasUpstream ? `${ahead}\uAC1C \uCEE4\uBC0B` : `(upstream \uC124\uC815: origin/${branch2})`}`);
|
|
1689
|
-
} else {
|
|
1690
|
-
ctx.log(" = \uC6D0\uACA9\uACFC \uAC19\uC74C");
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
if (res.pulled) ctx.log(`
|
|
1694
|
-
\uCC3D\uACE0\uAC00 \uBC14\uB00C\uC5C8\uC2B5\uB2C8\uB2E4. \uC774 \uAE30\uAE30\uC5D0 \uC801\uC6A9\uD558\uB824\uBA74: lshed restore`);
|
|
1695
|
-
return res;
|
|
1696
|
-
}
|
|
1697
|
-
function defaultMessage(paths, profile) {
|
|
1698
|
-
const parts = [...new Set(paths.map((p) => p.split("/").slice(0, 2).join("/")))];
|
|
1699
|
-
const head2 = parts.slice(0, 3).join(", ") + (parts.length > 3 ? ` +${parts.length - 3}` : "");
|
|
1700
|
-
return `lshed sync: ${head2}
|
|
1701
|
-
|
|
1702
|
-
${os3.hostname()}${profile ? ` \xB7 profile ${profile}` : ""}`;
|
|
1703
|
-
}
|
|
1704
|
-
var firstLine = (s) => s.split("\n").find((l) => l.trim() && !l.startsWith("Command failed")) ?? s;
|
|
1705
|
-
|
|
1706
|
-
// src/cli.ts
|
|
1707
|
-
var { version } = createRequire(import.meta.url)("../package.json");
|
|
1708
|
-
for (const s of [process.stdout, process.stderr]) {
|
|
1709
|
-
s.on("error", (e) => {
|
|
1710
|
-
if (e.code === "EPIPE") process.exit(0);
|
|
1711
|
-
});
|
|
1712
|
-
}
|
|
1713
|
-
var program = new Command().name("lshed").description("Keep your coding-agent harness (skills, agents, commands, instructions) in a shed and restore it anywhere by profile.").version(version).option("--shed <dir>", "shed directory (default: $LSHED_HOME, then the shed recorded by the last restore)").option("--root <dir>", "agent config root (default: ~/.claude)");
|
|
1714
|
-
function adapterFromOpts() {
|
|
1715
|
-
const { root } = program.opts();
|
|
1716
|
-
return new ClaudeCodeAdapter(root ? path19.resolve(root) : void 0);
|
|
1717
|
-
}
|
|
1718
|
-
async function ctxFor(cmd) {
|
|
1719
|
-
const adapter = adapterFromOpts();
|
|
1720
|
-
const { shed: flag } = program.opts();
|
|
1721
|
-
let shed = flag ?? process.env.LSHED_HOME;
|
|
1722
|
-
if (!shed && cmd === "other") shed = (await readState(adapter))?.shed;
|
|
1723
|
-
if (!shed && cmd === "init") shed = path19.join(os4.homedir(), "lshed");
|
|
1724
|
-
if (!shed) throw new Error("\uCC3D\uACE0 \uC704\uCE58\uB97C \uBAA8\uB985\uB2C8\uB2E4. --shed <dir> \uB610\uB294 LSHED_HOME \uC744 \uC9C0\uC815\uD558\uC138\uC694.");
|
|
1725
|
-
return { adapter, shed: path19.resolve(shed), log: (l) => console.log(l), exec: spawnExec };
|
|
1726
|
-
}
|
|
1727
|
-
async function run(fn) {
|
|
1728
|
-
try {
|
|
1729
|
-
await fn();
|
|
1730
|
-
} catch (e) {
|
|
1731
|
-
console.error(`\uC624\uB958: ${e.message}`);
|
|
1732
|
-
process.exitCode = 1;
|
|
1733
|
-
}
|
|
1734
|
-
}
|
|
1735
|
-
program.command("init").description("scan the current environment into a shed and write lshed.yaml").option("--profile <name>", "name of the initial profile", "default").option("--exclude <id...>", "components to leave out (id or category/id)").action((o) => run(async () => {
|
|
1736
|
-
const ctx = await ctxFor("init");
|
|
1737
|
-
console.log(`\uC2A4\uCE94: ${ctx.adapter.root} \u2192 \uCC3D\uACE0: ${ctx.shed}`);
|
|
1738
|
-
await init(ctx, { profile: o.profile, exclude: o.exclude });
|
|
1739
|
-
console.log(`
|
|
1740
|
-
\uB2E4\uC74C: \uCC3D\uACE0\uB97C git \uC73C\uB85C \uAD00\uB9AC\uD558\uC138\uC694. cd ${ctx.shed} && git init`);
|
|
1741
|
-
}));
|
|
1742
|
-
program.command("restore [profile]").description("apply a profile (defaults to the last applied one)").option("--dry-run", "print what would change without touching anything").option("--no-backup", "skip backing up files that get replaced or removed").option("--yes", "run package install commands (they are shown, not run, without this)").action((profile, o) => run(async () => {
|
|
1743
|
-
const ctx = await ctxFor("other");
|
|
1744
|
-
await restore(ctx, profile, { dryRun: o.dryRun, backup: o.backup, yes: o.yes });
|
|
1745
|
-
}));
|
|
1746
|
-
program.command("update [ids...]").description("pull packages to their latest upstream and refresh lshed.lock").option("--dry-run", "show what would be updated").option("--yes", "run package install commands after updating").action((ids, o) => run(async () => {
|
|
1747
|
-
const ctx = await ctxFor("other");
|
|
1748
|
-
const state = await readState(ctx.adapter);
|
|
1749
|
-
if (!state) throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");
|
|
1750
|
-
const m = await loadManifest(ctx);
|
|
1751
|
-
let pkgs = packagesOf(m, state.profile);
|
|
1752
|
-
if (ids.length) {
|
|
1753
|
-
pkgs = ids.map((id) => {
|
|
1754
|
-
const p = m.packages.find((x2) => x2.id === id);
|
|
1755
|
-
if (!p) throw new Error(`\uD328\uD0A4\uC9C0 "${id}" \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4`);
|
|
1756
|
-
return p;
|
|
1757
|
-
});
|
|
1758
|
-
}
|
|
1759
|
-
if (!pkgs.length) {
|
|
1760
|
-
console.log("\uAC31\uC2E0\uD560 \uD328\uD0A4\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
1761
|
-
return;
|
|
1762
|
-
}
|
|
1763
|
-
const res = await updatePackages(ctx, pkgs, { dryRun: o.dryRun, yes: o.yes });
|
|
1764
|
-
reportPending(ctx, res);
|
|
1765
|
-
}));
|
|
1766
|
-
program.command("status").description("show the applied profile, managed paths and drift").action(() => run(async () => {
|
|
1767
|
-
const adapter = adapterFromOpts();
|
|
1768
|
-
const state = await readState(adapter);
|
|
1769
|
-
if (!state) {
|
|
1770
|
-
console.log(formatStatus({ state: null, drifted: [], packages: [], missingEnv: [], fresh: [] }, adapter.root));
|
|
1771
|
-
return;
|
|
1772
|
-
}
|
|
1773
|
-
const ctx = await ctxFor("other");
|
|
1774
|
-
console.log(formatStatus(await status(ctx), adapter.root));
|
|
1775
|
-
}));
|
|
1776
|
-
program.command("diff").description("list files that differ between the local harness and the shed").action(() => run(async () => {
|
|
1777
|
-
const ctx = await ctxFor("other");
|
|
1778
|
-
console.log(formatDiff(await diff(ctx)));
|
|
1779
|
-
}));
|
|
1780
|
-
program.command("save [ids...]").description("copy local edits back into the shed (file: sources only)").action((ids) => run(async () => {
|
|
1781
|
-
const ctx = await ctxFor("other");
|
|
1782
|
-
await save(ctx, ids);
|
|
1783
|
-
}));
|
|
1784
|
-
program.command("add [keys...]").description("put things that appeared locally since init into the shed and the current profile (lists candidates without keys)").option("--all", "add every candidate").action((keys, o) => run(async () => {
|
|
1785
|
-
const ctx = await ctxFor("other");
|
|
1786
|
-
await add(ctx, keys, { all: o.all });
|
|
1787
|
-
}));
|
|
1788
|
-
program.command("sync").description("commit the shed, pull --rebase and push (the shed must be a git repo with origin)").option("-m, --message <msg>", "commit message (default: names the changed parts)").option("--no-push", "commit and pull only").option("--dry-run", "show what would be committed and pushed").action((o) => run(async () => {
|
|
1789
|
-
const ctx = await ctxFor("other");
|
|
1790
|
-
await sync(ctx, { message: o.message, push: o.push, dryRun: o.dryRun });
|
|
1791
|
-
}));
|
|
1792
|
-
program.command("list").description("everything in the shed and which profiles use it").option("--unused", "only things no profile uses").action((o) => run(async () => {
|
|
1793
|
-
const ctx = await ctxFor("other");
|
|
1794
|
-
const m = await loadManifest(ctx);
|
|
1795
|
-
const rows = listRows(m).filter((r) => !o.unused || !r.usedBy.length);
|
|
1796
|
-
console.log(o.unused && !rows.length ? "\uBBF8\uC0AC\uC6A9 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4." : formatRows(rows, m));
|
|
1797
|
-
}));
|
|
1798
|
-
program.command("remove <key>").description("delete a component or package from the shed (refused while a profile uses it)").action((key) => run(async () => {
|
|
1799
|
-
const ctx = await ctxFor("other");
|
|
1800
|
-
await remove(ctx, key);
|
|
1801
|
-
}));
|
|
1802
|
-
program.command("prune").description("remove everything no profile uses").option("--yes", "actually delete; without it, just list").action((o) => run(async () => {
|
|
1803
|
-
const ctx = await ctxFor("other");
|
|
1804
|
-
await prune(ctx, { yes: o.yes });
|
|
1805
|
-
}));
|
|
1806
|
-
program.command("scan").description("(debug) list components found in the agent config root").action(() => run(async () => {
|
|
1807
|
-
const adapter = adapterFromOpts();
|
|
1808
|
-
const found = await adapter.scan();
|
|
1809
|
-
for (const c of found) console.log(`${c.category}/${c.id} ${c.path}`);
|
|
1810
|
-
let n = found.length;
|
|
1811
|
-
for (const e of adapter.entries()) for (const id of Object.keys(await e.read())) {
|
|
1812
|
-
console.log(`${e.name}/${id} (entry)`);
|
|
1813
|
-
n++;
|
|
1814
|
-
}
|
|
1815
|
-
console.error(`${n}\uAC1C \uBC1C\uACAC (root: ${adapter.root})`);
|
|
1816
|
-
}));
|
|
1817
|
-
program.parseAsync();
|
|
259
|
+
git config --global user.email "\uBA54\uC77C"`):d}}n.committed=o}else t.log(" = \uCC3D\uACE0\uC5D0 \uCEE4\uBC0B\uD560 \uBCC0\uACBD \uC5C6\uC74C");let a=await te(["remote","get-url","origin"],r).catch(()=>null);if(!a)return t.log(" \xB7 origin \uC774 \uC5C6\uC5B4 pull/push \uB294 \uAC74\uB108\uB700 (git remote add origin <url>)"),n;if(e.dryRun)return t.log(` (dry-run) pull --rebase, push \u2192 ${a}`),n;let s=await te(["rev-parse","HEAD"],r),c=await te(["rev-parse","--abbrev-ref","HEAD"],r),u=await te(["rev-parse","--abbrev-ref","@{upstream}"],r).then(()=>!0,()=>!1);if(u){try{await te(["pull","--rebase","--quiet"],r)}catch(d){throw await te(["rebase","--abort"],r).catch(()=>{}),new Error(`pull \uC911 \uCDA9\uB3CC\uC774 \uB098\uC11C \uB418\uB3CC\uB838\uC2B5\uB2C8\uB2E4. \uCC3D\uACE0\uC5D0\uC11C \uC9C1\uC811 \uD574\uACB0\uD558\uC138\uC694:
|
|
260
|
+
cd ${r} && git pull --rebase
|
|
261
|
+
(${Sj(d.message)})`)}let l=await te(["rev-parse","HEAD"],r);if(l!==s){let d=Number(await te(["rev-list","--count",`${s}..${l}`],r).catch(()=>"0"));n.pulled=Math.max(0,d-(n.committed.length?1:0)),n.pulled&&t.log(` \u2193 \uC6D0\uACA9 \uCEE4\uBC0B ${n.pulled}\uAC1C \uBC1B\uC74C`)}}else t.log(` \xB7 \uBE0C\uB79C\uCE58 ${c} \uC5D0 upstream \uC774 \uC5C6\uC5B4 pull \uC740 \uAC74\uB108\uB700`);if(i){let l=u?Number(await te(["rev-list","--count","@{upstream}..HEAD"],r)):1;l>0?(await te(u?["push","--quiet"]:["push","--quiet","-u","origin",c],r),n.pushed=!0,t.log(` \u2191 push ${u?`${l}\uAC1C \uCEE4\uBC0B`:`(upstream \uC124\uC815: origin/${c})`}`)):t.log(" = \uC6D0\uACA9\uACFC \uAC19\uC74C")}return n.pulled&&t.log(`
|
|
262
|
+
\uCC3D\uACE0\uAC00 \uBC14\uB00C\uC5C8\uC2B5\uB2C8\uB2E4. \uC774 \uAE30\uAE30\uC5D0 \uC801\uC6A9\uD558\uB824\uBA74: lshed restore`),n}function kj(t,e){let r=[...new Set(t.map(n=>n.split("/").slice(0,2).join("/")))];return`lshed sync: ${r.slice(0,3).join(", ")+(r.length>3?` +${r.length-3}`:"")}
|
|
263
|
+
|
|
264
|
+
${wj.hostname()}${e?` \xB7 profile ${e}`:""}`}var Sj=t=>t.split(`
|
|
265
|
+
`).find(e=>e.trim()&&!e.startsWith("Command failed"))??t;var Ij="0.7.4";for(let t of[process.stdout,process.stderr])t.on("error",e=>{e.code==="EPIPE"&&process.exit(0)});var ve=new mn().name("lshed").description("Keep your coding-agent harness (skills, agents, commands, instructions) in a shed and restore it anywhere by profile.").version(Ij).option("--shed <dir>","shed directory (default: $LSHED_HOME, then the shed recorded by the last restore)").option("--root <dir>","agent config root (default: ~/.claude)");function Yh(){let{root:t}=ve.opts();return new eo(t?Hh.resolve(t):void 0)}async function Fe(t){let e=Yh(),{shed:r}=ve.opts(),i=r??process.env.LSHED_HOME;if(!i&&t==="other"&&(i=(await le(e))?.shed),!i&&t==="init"&&(i=Hh.join(xj.homedir(),"lshed")),!i)throw new Error("\uCC3D\uACE0 \uC704\uCE58\uB97C \uBAA8\uB985\uB2C8\uB2E4. --shed <dir> \uB610\uB294 LSHED_HOME \uC744 \uC9C0\uC815\uD558\uC138\uC694.");return{adapter:e,shed:Hh.resolve(i),log:n=>console.log(n),exec:Ww}}async function Ue(t){try{await t()}catch(e){console.error(`\uC624\uB958: ${e.message}`),process.exitCode=1}}ve.command("init").description("scan the current environment into a shed and write lshed.yaml").option("--profile <name>","name of the initial profile","default").option("--exclude <id...>","components to leave out (id or category/id)").action(t=>Ue(async()=>{let e=await Fe("init");console.log(`\uC2A4\uCE94: ${e.adapter.root} \u2192 \uCC3D\uACE0: ${e.shed}`),await gk(e,{profile:t.profile,exclude:t.exclude}),console.log(`
|
|
266
|
+
\uB2E4\uC74C: \uCC3D\uACE0\uB97C git \uC73C\uB85C \uAD00\uB9AC\uD558\uC138\uC694. cd ${e.shed} && git init`)}));ve.command("restore [profile]").description("apply a profile (defaults to the last applied one)").option("--dry-run","print what would change without touching anything").option("--no-backup","skip backing up files that get replaced or removed").option("--yes","run package install commands (they are shown, not run, without this)").action((t,e)=>Ue(async()=>{let r=await Fe("other");await yk(r,t,{dryRun:e.dryRun,backup:e.backup,yes:e.yes})}));ve.command("update [ids...]").description("pull packages to their latest upstream and refresh lshed.lock").option("--dry-run","show what would be updated").option("--yes","run package install commands after updating").action((t,e)=>Ue(async()=>{let r=await Fe("other"),i=await le(r.adapter);if(!i)throw new Error("\uC801\uC6A9\uB41C \uD504\uB85C\uD544\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 'lshed restore <profile>' \uC744 \uC2E4\uD589\uD558\uC138\uC694.");let n=await fe(r),o=cr(n,i.profile);if(t.length&&(o=t.map(s=>{let c=n.packages.find(u=>u.id===s);if(!c)throw new Error(`\uD328\uD0A4\uC9C0 "${s}" \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4`);return c})),!o.length){console.log("\uAC31\uC2E0\uD560 \uD328\uD0A4\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");return}let a=await ik(r,o,{dryRun:e.dryRun,yes:e.yes});Fi(r,a)}));ve.command("status").description("show the applied profile, managed paths and drift").action(()=>Ue(async()=>{let t=Yh();if(!await le(t)){console.log(Wh({state:null,drifted:[],packages:[],missingEnv:[],fresh:[]},t.root));return}let r=await Fe("other");console.log(Wh(await kk(r),t.root))}));ve.command("diff").description("list files that differ between the local harness and the shed").action(()=>Ue(async()=>{let t=await Fe("other");console.log($k(await fr(t)))}));ve.command("save [ids...]").description("copy local edits back into the shed (file: sources only)").action(t=>Ue(async()=>{let e=await Fe("other");await Sk(e,t)}));ve.command("add [keys...]").description("put things that appeared locally since init into the shed and the current profile (lists candidates without keys)").option("--all","add every candidate").action((t,e)=>Ue(async()=>{let r=await Fe("other");await wk(r,t,{all:e.all})}));ve.command("sync").description("commit the shed, pull --rebase and push (the shed must be a git repo with origin)").option("-m, --message <msg>","commit message (default: names the changed parts)").option("--no-push","commit and pull only").option("--dry-run","show what would be committed and pushed").action(t=>Ue(async()=>{let e=await Fe("other");await zk(e,{message:t.message,push:t.push,dryRun:t.dryRun})}));ve.command("list").description("everything in the shed and which profiles use it").option("--unused","only things no profile uses").action(t=>Ue(async()=>{let e=await Fe("other"),r=await fe(e),i=pr(r).filter(n=>!t.unused||!n.usedBy.length);console.log(t.unused&&!i.length?"\uBBF8\uC0AC\uC6A9 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":xk(i,r))}));ve.command("remove <key>").description("delete a component or package from the shed (refused while a profile uses it)").action(t=>Ue(async()=>{let e=await Fe("other");await Gh(e,t)}));ve.command("prune").description("remove everything no profile uses").option("--yes","actually delete; without it, just list").action(t=>Ue(async()=>{let e=await Fe("other");await Ok(e,{yes:t.yes})}));ve.command("scan").description("(debug) list components found in the agent config root").action(()=>Ue(async()=>{let t=Yh(),e=await t.scan();for(let i of e)console.log(`${i.category}/${i.id} ${i.path}`);let r=e.length;for(let i of t.entries())for(let n of Object.keys(await i.read()))console.log(`${i.name}/${n} (entry)`),r++;console.error(`${r}\uAC1C \uBC1C\uACAC (root: ${t.root})`)}));ve.parseAsync();
|