@npayload/sdk 6.0.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/chunk-2U3QN6IU.mjs +1 -0
- package/dist/{chunk-MWLEDQSA.mjs → chunk-2UJADZ6K.mjs} +1 -1
- package/dist/chunk-2ZK6PEZR.mjs +1 -0
- package/dist/chunk-3RE3BK3W.mjs +1 -0
- package/dist/chunk-4QKJIAQO.mjs +1 -0
- package/dist/chunk-64SVI75H.mjs +1 -0
- package/dist/chunk-7AZ3YJ62.mjs +1 -0
- package/dist/chunk-BPVBERWX.mjs +3 -0
- package/dist/chunk-C4LTBM2E.mjs +1 -0
- package/dist/chunk-CJIZRYGT.mjs +5 -0
- package/dist/{chunk-5L5EATJW.mjs → chunk-EM46J3TV.mjs} +1 -1
- package/dist/chunk-ERQXEWTC.mjs +1 -0
- package/dist/chunk-F4F5GA36.mjs +9 -0
- package/dist/chunk-F5PMOFZY.mjs +1 -0
- package/dist/chunk-GEDYBXWJ.mjs +1 -0
- package/dist/chunk-HNHTAV57.mjs +1 -0
- package/dist/chunk-IA5ADBRQ.mjs +2 -0
- package/dist/chunk-IKKXOIJF.mjs +20 -0
- package/dist/chunk-IW34IJP4.mjs +1 -0
- package/dist/chunk-JWEUM2BU.mjs +1 -0
- package/dist/chunk-JYVB32D3.mjs +1 -0
- package/dist/chunk-K6H7MJ4W.mjs +1 -0
- package/dist/{chunk-F6RREQEH.mjs → chunk-MKQUL5LA.mjs} +1 -1
- package/dist/{chunk-UV2R4VAS.mjs → chunk-MYM6C3WY.mjs} +1 -1
- package/dist/chunk-NCKK7PHF.mjs +1 -0
- package/dist/{chunk-UZ4TQPD3.mjs → chunk-NV6B7I6P.mjs} +1 -1
- package/dist/chunk-O2USGVDT.mjs +1 -0
- package/dist/chunk-O7KSYRUO.mjs +2 -0
- package/dist/chunk-OGXDRDCJ.mjs +1 -0
- package/dist/chunk-PX7FINE4.mjs +17 -0
- package/dist/chunk-QXEFKQAF.mjs +1 -0
- package/dist/chunk-ROYJNUAJ.mjs +4 -0
- package/dist/chunk-TOF3BORJ.mjs +5 -0
- package/dist/chunk-TYVWHQ4H.mjs +1 -0
- package/dist/chunk-VC3Y57EV.mjs +1 -0
- package/dist/chunk-VZZ4FDPO.mjs +1 -0
- package/dist/{chunk-47FWIF2H.mjs → chunk-WLHCORNO.mjs} +1 -1
- package/dist/chunk-WWSPP7WV.mjs +1 -0
- package/dist/chunk-XAB3ANJT.mjs +22 -0
- package/dist/chunk-XF6XPU25.mjs +5 -0
- package/dist/chunk-XPZRF64T.mjs +1 -0
- package/dist/{chunk-YFFHEYYK.mjs → chunk-XVZEP6PT.mjs} +1 -1
- package/dist/chunk-YVGH2T7O.mjs +5 -0
- package/dist/{chunk-YZGGWQC5.mjs → chunk-Z24VZ6HI.mjs} +1 -1
- package/dist/chunk-ZYMM2PCZ.mjs +65 -0
- package/dist/cli/index.js +353 -336
- package/dist/cli/index.mjs +274 -259
- package/dist/index.d.mts +56 -8
- package/dist/index.d.ts +56 -8
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-33VA5RSC.mjs +0 -4
- package/dist/chunk-3FAIUX4A.mjs +0 -1
- package/dist/chunk-4HRWY6VL.mjs +0 -1
- package/dist/chunk-6WXPOKLY.mjs +0 -20
- package/dist/chunk-7C63YJ2F.mjs +0 -1
- package/dist/chunk-AECDYMA2.mjs +0 -1
- package/dist/chunk-AM74KBVG.mjs +0 -1
- package/dist/chunk-BBHWYMQA.mjs +0 -1
- package/dist/chunk-BNGQVWMV.mjs +0 -64
- package/dist/chunk-F455VQCQ.mjs +0 -1
- package/dist/chunk-FY32IC3I.mjs +0 -9
- package/dist/chunk-GGXNXM73.mjs +0 -1
- package/dist/chunk-GTEVGEFA.mjs +0 -1
- package/dist/chunk-IWWVVZC7.mjs +0 -5
- package/dist/chunk-KQCX2PCW.mjs +0 -1
- package/dist/chunk-LCUELOEE.mjs +0 -2
- package/dist/chunk-MNKWLZS2.mjs +0 -1
- package/dist/chunk-N6NIJISZ.mjs +0 -5
- package/dist/chunk-O2J73777.mjs +0 -3
- package/dist/chunk-OMUKWD3N.mjs +0 -1
- package/dist/chunk-Q3RG3NEU.mjs +0 -1
- package/dist/chunk-QQC6352X.mjs +0 -6
- package/dist/chunk-SKJL2WB7.mjs +0 -1
- package/dist/chunk-SRJTV2LW.mjs +0 -1
- package/dist/chunk-VZT7RCAC.mjs +0 -4
- package/dist/chunk-W5UKL26F.mjs +0 -17
- package/dist/chunk-WG5MUAXT.mjs +0 -1
- package/dist/chunk-XLK55DEY.mjs +0 -1
- package/dist/chunk-XOG6ZE4E.mjs +0 -22
- package/dist/chunk-YLV3KSNV.mjs +0 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as Oc,b as xy,c as _y,d as $y,e as Sy,f as ln,i as fi,k as Tr,l as Ar,m as Nc,n as Cr}from"../chunk-VC3Y57EV.mjs";import{a as An,b as cn,c as Hh,d as Yh,e as Qh,f as un,g as Tt,h as Ey,i as Uc,k as Ty}from"../chunk-PX7FINE4.mjs";import{a as Er,b as pi}from"../chunk-F5PMOFZY.mjs";import{a as Lc,b as Rr,c as zc,g as Ay}from"../chunk-IKKXOIJF.mjs";import"../chunk-MDW42OG6.mjs";import{a as ui,b as cy,c as uy,d as ly}from"../chunk-NV6B7I6P.mjs";import"../chunk-EM46J3TV.mjs";import"../chunk-Z24VZ6HI.mjs";import{b as wy,c as ky}from"../chunk-TOF3BORJ.mjs";import"../chunk-2UJADZ6K.mjs";import{B as Et,C as Iy,J as Dc,K as ft,L as jc,Q as Py,R as xe,S as Ye,a as Q,b as Gh,c as Vh,d as dt,e as Wh,h as ci,i as Xh,j as ey,l as dy,m as py,n as fy,o as Cn,p as my,q as li,r as Ac,s as yy,t as vy,u as Rn,v as Cc,w as Pr,x as by,y as He,z as le}from"../chunk-ZYMM2PCZ.mjs";import{a as Ec,b as Ir,c as di,d as Tc,e as gy,f as hy}from"../chunk-OGXDRDCJ.mjs";import{a as Pc,c as Sr}from"../chunk-ROYJNUAJ.mjs";import"../chunk-4NWQCPI4.mjs";import{c as Rc}from"../chunk-XAB3ANJT.mjs";import"../chunk-MYM6C3WY.mjs";import{a as ke}from"../chunk-QXEFKQAF.mjs";import{a as kc,b as Eh,c as Th,e as Ah,f as Ch,g as Rh,h as xc,i as Oh,j as Nh,l as jh}from"../chunk-TYVWHQ4H.mjs";import"../chunk-CJDCY2NH.mjs";import{a as Uh,c as Lh,f as zh}from"../chunk-MKQUL5LA.mjs";import{d as Fh,e as ai,h as qh,k as Zh}from"../chunk-7AZ3YJ62.mjs";import{a as Pe,b as Bh,c as R,d as Kh,f as Ee,g as ae,i as Jh,j as pe}from"../chunk-YVGH2T7O.mjs";import{a as $r,b as sy,c as pt,d as $c,e as Sc,h as Ze,j as ay,k as Ic}from"../chunk-CJIZRYGT.mjs";import{a as ry,b as qe,c as _r,d as oy}from"../chunk-IA5ADBRQ.mjs";import{a as se,b as ty,c as ny}from"../chunk-WWSPP7WV.mjs";import{e as iy}from"../chunk-XF6XPU25.mjs";import"../chunk-XVZEP6PT.mjs";import{b as Dt,c as Tn,d as Ph,e as on,g as ii,h as F}from"../chunk-JWEUM2BU.mjs";import{B as xh,O as bc,Q as _h,R as ri,S as $h,U as we,X as Sh,Y as oi,Z as Ih,a as Xo,c as dh,d as ei,e as ph,g as fh,h as mh,i as gh,j as hh,k as yh,m as yc,n as vc,o as ti,p as ni,t as vh,v as bh,x as wh,z as kh}from"../chunk-O7KSYRUO.mjs";import{g as wc}from"../chunk-BPVBERWX.mjs";import{a as sn,b,c as _c,d as Mh,e as an,f as si}from"../chunk-IW34IJP4.mjs";import"../chunk-HNHTAV57.mjs";import{a as Dh}from"../chunk-K6H7MJ4W.mjs";import{a,c as Pt}from"../chunk-LJNU5QHZ.mjs";import{realpathSync as yR}from"fs";import{pathToFileURL as vR}from"url";var Cy={"POST /v1/subscriptions/:subscriptionId/queue/purge":{confirm:"Purge ALL buffered messages in this queue? This cannot be undone."},"POST /v1/dlq/:dlqEntryId/discard":{confirm:"Discard this DLQ entry? The message will not be redelivered."},"POST /v1/dlq/discard":{confirm:"Bulk-discard DLQ entries? Discarded messages will not be redelivered."}};function Ry(e){return Cy[e]}a(Ry,"getOverride");var $R=Object.keys(Cy);var he={OK:0,USER_ERROR:1,AUTH_ERROR:2,SERVER_ERROR:3,NETWORK_ERROR:4,PROTOCOL_ERROR:5},f_={auth:he.AUTH_ERROR,deferred:he.SERVER_ERROR,admission:he.USER_ERROR,protocol:he.PROTOCOL_ERROR},Dy=`
|
|
3
3
|
Exit codes
|
|
4
4
|
0 ok
|
|
5
5
|
1 user error (bad args, missing file, a 4xx refusal of the request as issued)
|
|
@@ -7,17 +7,21 @@ import{a as Pn,b as on,c as Ch,d as Rh,e as Oh,f as cn,g as Pt,h as iy,i as $c,j
|
|
|
7
7
|
3 server error (5xx, 429/408 after the kernel's retries)
|
|
8
8
|
4 network error (DNS, connection refused, TLS, timeout)
|
|
9
9
|
5 protocol error (an NPP answer that breaks the protocol: a malformed frame, an unsupported version or QoS, a code no registry holds)
|
|
10
|
-
`,uy=new Set(["ECONNREFUSED","ECONNRESET","ENOTFOUND","EAI_AGAIN","ETIMEDOUT","EHOSTUNREACH","ENETUNREACH","EPIPE","UND_ERR_CONNECT_TIMEOUT","UND_ERR_SOCKET","UND_ERR_HEADERS_TIMEOUT"]),xk=new Set(["AuthError","AuthenticationError","InsufficientScopeError","AuthScopeError"]),kk=/^(?:UNAUTHENTICATED|UNAUTHORIZED|FORBIDDEN|FORBIDDEN_SCOPE|INSUFFICIENT_SCOPE|TOKEN_EXPIRED|INVALID_TOKEN|MISSING_TOKEN|DPOP_[A-Z_]+|AUTHENTICATION_ERROR|SCOPE_[A-Z_]+)$/i,dy=a(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"asNumber"),Pc=a(e=>typeof e=="string"?e:void 0,"asString");function Dt(e){if(e instanceof Y)return ge.USER_ERROR;if(e instanceof Yo)return ge.PROTOCOL_ERROR;if(e instanceof sh)return wk[Ho(e.refusal.name)];if(e instanceof Qg||e instanceof Xg||e instanceof eh)return ge.NETWORK_ERROR;if(e instanceof Jo||e instanceof Kg||e instanceof Ko||e instanceof Wo)return ge.AUTH_ERROR;if(e instanceof Jg)return e.isRetryable()?ge.SERVER_ERROR:ge.USER_ERROR;let t=e??{},r=Pc(t.code),o=Pc(t.cause?.code);if(r&&uy.has(r)||o&&uy.has(o))return ge.NETWORK_ERROR;let n=Pc(t.name);if(n&&xk.has(n))return ge.AUTH_ERROR;let i=dy(t.status)??dy(t.statusCode);return i!==void 0?i===401||i===403?ge.AUTH_ERROR:i>=500&&i<600?ge.SERVER_ERROR:ge.USER_ERROR:r&&kk.test(r)?ge.AUTH_ERROR:ge.USER_ERROR}a(Dt,"exitCodeFor");var Ec="Settings > Security > Networks",_k="Instances",$k="Allow new instances for one hour";function ii(e,t){if(e===null||typeof e!="object")return;let r=e;if(t(r.code))return r.code;if(t(r.upstreamCode))return r.upstreamCode}a(ii,"ruleCodeOf");function Tc(e){return e instanceof Ko?!0:ii(e,ac)!==void 0}a(Tc,"isSourceRefusal");function Ac(e){return e instanceof Wo?!0:ii(e,cc)!==void 0}a(Ac,"isFingerprintRefusal");async function my(e,t,r=3e3,o){let n;try{n=new URL("/cdn-cgi/trace",e).toString()}catch{return}try{let s=await Nt(t,o)(n,{method:"GET",signal:AbortSignal.timeout(r)});if(!s.ok)return;let c=await s.text();for(let l of c.split(/\r?\n/)){if(!l.startsWith("ip="))continue;let u=l.slice(3).trim();return Sk(u)?u:void 0}return}catch{return}}a(my,"addressThisMachineReachesNpayloadFrom");function Sk(e){return/^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/.test(e)?!0:/^[0-9a-f:]+$/i.test(e)&&e.includes(":")&&e.length<=39}a(Sk,"isAddress");function Ik(e){return e.includes(":")?`${e}/128`:`${e}/32`}a(Ik,"hostNetworkOf");function Cc(e,t){let r=ii(e,ac)??"source_network_not_allowed",o=r.toLowerCase()==="source_network_not_declared",n=t!==void 0?`this machine reaches npayload from ${t}, which`:"the network this call came from",i=o?`npayload refused this request: this app environment has no network yet, so its keys cannot be used${t!==void 0?` (this machine reaches npayload from ${t})`:""}.`:`npayload refused this request: ${n} is not a network of this app environment.`,s=t!==void 0?`Add ${Ik(t)} in the dashboard under ${Ec}, then run the command again.`:`Add the network this machine uses in the dashboard under ${Ec}, then run the command again. Open the API host's /cdn-cgi/trace page on this machine to see the address npayload sees.`;return new C(i,{code:r,hint:s,cause:e})}a(Cc,"sourceRefusalCliError");function Rc(e){let t=ii(e,cc)??"thumbprint_not_bound",r=e.fingerprint,o=typeof r=="string"&&r.length>0?` (${r})`:"";return new C(`npayload refused this request: the key fingerprint this machine presents${o} is not enrolled for this API key.`,{code:t,hint:`In the dashboard, open ${Ec}. Under ${_k}, choose "${$k}" on this API key, then run the command again from a network of this app environment.`,cause:e})}a(Rc,"fingerprintRefusalCliError");async function fy(e,t){if(Tc(e)){let r=t!==void 0?await t().catch(()=>{}):void 0;return Cc(e,r)}if(Ac(e))return Rc(e)}a(fy,"callerRefusalCliError");var Oc={LIMIT_EXCEEDED:{message:"You've reached your plan's limit for this resource.",hint:"Upgrade your plan in the dashboard (Settings \u2192 Billing) to raise the limit."},TIER_LIMIT_EXCEEDED:{message:"You've reached your plan's limit for this resource.",hint:"Archive an unused one to free a slot, or upgrade your plan in the dashboard (Settings \u2192 Billing) to raise the limit."},PER_RUN_LIMIT_EXCEEDED:{message:"This request is too large for a single run.",hint:"Shorten the message, or split the task into smaller steps."},CAPABILITY_REQUIRED:{message:"This feature isn't included in your current plan.",hint:"Upgrade your plan in the dashboard (Settings \u2192 Billing) to unlock it."},BILLING_LIMIT:{message:"You've used your plan's monthly allowance.",hint:"Upgrade your plan, or wait for the next billing cycle."},BUDGET_EXCEEDED:{message:"Your AI budget for this period has been used.",hint:"Raise the budget in the dashboard, or upgrade your plan."},BUDGET_CAP_EXCEEDED:{message:"Your organization's daily AI spending cap has been reached.",hint:"Try again tomorrow, or raise the cap in the dashboard."},RATE_LIMITED:{message:"Too many requests right now.",hint:"Wait a moment and try again."},SECURITY_BLOCKED:{message:"This input was blocked by safety checks.",hint:"Rephrase the request and try again."},NOT_FOUND:{message:"We couldn't find that. It may have been moved or removed."},FORBIDDEN:{message:"You don't have permission to do that.",hint:"Ask an organization admin to grant access if you think you should have it."},PERMISSION_DENIED:{message:"You don't have permission to do that.",hint:"Ask an organization admin to grant access if you think you should have it."},INSUFFICIENT_SCOPE:{message:"This credential doesn't have the scope needed for that.",hint:"Re-provision the credential with the required scope."},UNAUTHORIZED:{message:"You're not signed in.",hint:"Run: np login"},UNAUTHENTICATED:{message:"Your session has expired.",hint:"Run: np login"},INVALID_ARGUMENT:{message:"Some of the provided values weren't valid. Check the flags and try again."},VALIDATION_ERROR:{message:"Some of the provided values weren't valid. Check the flags and try again."},INVALID_STATE:{message:"That action isn't possible right now \u2014 the item may have changed. Re-fetch and try again."},CONFLICT:{message:"That change conflicts with the current state. Re-fetch and try again."},EXPIRED:{message:"This item or link has expired. Request a new one and try again."},RUN_START_TIMEOUT:{message:"The agent didn't start in time.",hint:"Try again \u2014 if this keeps happening, contact support."},INTERNAL:{message:"Something went wrong on our side. Please try again \u2014 the error has been logged."},INTERNAL_ERROR:{message:"Something went wrong on our side. Please try again \u2014 the error has been logged."}};function si(e){if(e instanceof C)return e;if(Tc(e))return Cc(e,void 0);if(Ac(e))return Rc(e);let t=yh(e);if(t)return new C(t.reason??"This request was refused by your plan's current state.",{code:t.code,hint:"Upgrade your plan to continue",docs:t.upgradeUrl,cause:e});let r=e?.code;if(typeof r=="string"){let o=Oc[r]??Oc[r.toUpperCase()];if(o)return new C(o.message,{code:r,hint:o.hint,docs:o.docs,cause:e})}return e}a(si,"toFriendlyCliError");function gy(e){let t=e.kind??e.code,r=t?Oc[t]:void 0;return r||{message:e.message??"The agent run failed. Please try again."}}a(gy,"friendlyStreamErrorLine");function Nc(e,t){let r=e.commands;if(Array.isArray(r))return r.find(o=>{let n=typeof o.name=="function"?o.name():void 0;if(n!==void 0&&t.has(n))return!0;let i=typeof o.aliases=="function"?o.aliases():void 0;return Array.isArray(i)&&i.some(s=>t.has(s))})}a(Nc,"findChild");var Pk=/token|secret|password|passphrase|apikey|api_key|credential|privatekey/i;function hy(e){return Pk.test(e)}a(hy,"isSecretFlag");async function Ek(e,t,r){let o=e.flags.filter(i=>i.name!=="idempotencyKey"&&t[i.name]===void 0),n=[...o.filter(i=>!i.optional),...o.filter(i=>i.optional)];for(let i of n){let s=`--${ai(i.name)}`,c=i.optional?" (optional, blank to skip)":"",l=i.coerce==="json"?" [JSON]":"",u;if(i.choices&&i.choices.length>0){let d=i.choices.map(m=>({name:m,value:m}));i.optional&&d.push({name:"(skip)",value:""}),u=await r.select(`${s}${l}`,d)}else hy(i.name)?u=await r.secret(`${s}${c}`,{optional:i.optional}):u=await r.text(`${s}${l}${c}`,{optional:i.optional});u!==""&&(t[i.name]=u)}}a(Ek,"fillFlagsInteractively");function Tk(e,t){if(t.size===0)return e;let r=a(o=>{if(typeof o=="string")return t.has(o)?"[redacted \u2014 same value you supplied]":o;if(Array.isArray(o))return o.map(r);if(o&&typeof o=="object"){let n={};for(let[i,s]of Object.entries(o))n[i]=r(s);return n}return o},"walk");return r(e)}a(Tk,"redactEchoedSecrets");var Ak={channels:["events","channels"],messages:["events","messages"],subscriptions:["events","subscriptions"],dlq:["events","dlq"],streams:["events","streams"]};function ai(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}a(ai,"kebab");var Ck={connectAccess:"grants",connectBridges:"bridges",connectExplore:"explore",connectProfile:"profile",connectPartner:"partner",connectTenantApproval:"approvals"},Rk={"connect.connect.requestAccess":{group:["connect","grants"],leaf:"request"},"connect.connect.approveAccess":{group:["connect","grants"],leaf:"approve"},"connect.connect.rejectAccess":{group:["connect","grants"],leaf:"reject",aliases:["decline"]},"connect.connect.revokeGrant":{group:["connect","grants"],leaf:"revoke"},"connect.connectAccess.listMyGrants":{group:["connect","grants"],leaf:"list"},"connect.connectAccess.getGrant":{group:["connect","grants"],leaf:"get"}};function yy(e){return`--${ai(e.name)} <value>`}a(yy,"optionSpec");function Ok(e){let t=e.choices!==void 0&&e.choices.length>0?`, one of: ${e.choices.join(", ")}`:"";return`${e.coerce??"string"}${t}${e.optional?"":" (required)"}`}a(Ok,"optionHelp");function Nk(e,t){let r=[`np ${t}`,...e.pathParams.map(i=>`<${i.key}>`)];for(let i of e.flags)i.name==="idempotencyKey"||i.optional||r.push(yy(i));let o=[],n="";for(let i of r)n===""?n=i:`${n} ${i}`.length>78?(o.push(`${n} \\`),n=` ${i}`):n=`${n} ${i}`;return o.push(n),o}a(Nk,"exampleLines");var Dk="wickfeed/lit",jk="wickfeed.lit",Lk=a(e=>e.split("/").filter(t=>t.length>0),"pathSegments"),Uk=a(e=>e.startsWith(":")||e.startsWith("{")&&e.endsWith("}"),"isPathParam");function zk(e){let t=Lk(e.pattern);if(!t.some(o=>o==="feeds"||o==="feed-listings"))return;let r=t[t.length-1]??"";if(e.method==="POST"&&(r==="subscribe"||r.startsWith("subscribe-")))return"subscribe";if(e.method==="DELETE"&&t[t.length-2]==="subscriptions"&&Uk(r)||r==="unsubscribe")return"unsubscribe"}a(zk,"feedRefVerb");function Mk(e,t){let r=t==="subscribe"?"Subscribe":"Unsubscribe",o=`${Dk} (or its alias ${jk})`;return Nc(e,new Set([t]))!==void 0?`${r} by ref: np ${t} ${o}`:`${r} by the ref form, ${o}, never a gid`}a(Mk,"feedRefLine");function vy(e,t,r){let o=new Map,n=a(c=>{let l=e,u="";for(let d of c){let m=ai(d),p=Ck[d]??m;u=u?`${u} ${p}`:p;let f=new Set;d!==p&&f.add(d),m!==p&&f.add(m);let g=o.get(u);if(g){l=g.node;let v=l.alias;if(typeof v=="function")for(let h of f)g.aliases.has(h)||(v.call(l,h),g.aliases.add(h))}else{let v=Nc(l,new Set([p,...f]));if(v){let h=new Set(typeof v.aliases=="function"?v.aliases():[]),x=v.alias;if(typeof x=="function")for(let E of f)h.has(E)||(x.call(v,E),h.add(E));o.set(u,{node:v,aliases:h}),l=v}else{let h=l.command(p),x=h.alias,E=new Set;if(typeof x=="function")for(let k of f)x.call(h,k),E.add(k);o.set(u,{node:h,aliases:E}),l=h}}}return{node:l,path:u}},"groupNode"),i=new Map,s=a((c,l,u)=>{let d=c.commandPath[c.commandPath.length-1],{node:m,path:p}=n(l),f=u?.leaf??ai(d),g=p?`${p} ${f}`:f,v=i.get(g);if(v!==void 0)throw new Error(`CLI command table conflict: rows '${v}' and '${c.key}' both map to 'np ${g}'. This release of @npayload/sdk spells two commands alike; it is a defect of the package, not of your project. Upgrade @npayload/sdk, or contact support if the newest release fails the same way.`);if(i.set(g,c.key),Nc(m,new Set([f])))return;let h=c.pathParams.map(k=>`<${k.key}>`).join(" "),x=m.command(h?`${f} ${h}`:f),E=x.alias;if(typeof E=="function")for(let k of u?.aliases??[])E.call(x,k);x.description(c.summary);for(let k of c.flags)k.name!=="idempotencyKey"&&x.option(yy(k),Ok(k));if($h(c.method)&&(c.idempotent||c.flags.some(k=>k.name==="idempotencyKey"))&&x.option("--idempotency-key <key>","Idempotency key (UUIDv7 auto-generated when omitted)"),c.flags.some(k=>k.name!=="idempotencyKey")&&x.option("-i, --interactive","prompt step-by-step for any flag not passed on the command line"),typeof x.addHelpText=="function"){let k=zk(c);x.addHelpText("after",k===void 0?`
|
|
10
|
+
`,Oy=new Set(["ECONNREFUSED","ECONNRESET","ENOTFOUND","EAI_AGAIN","ETIMEDOUT","EHOSTUNREACH","ENETUNREACH","EPIPE","UND_ERR_CONNECT_TIMEOUT","UND_ERR_SOCKET","UND_ERR_HEADERS_TIMEOUT"]),m_=new Set(["AuthError","AuthenticationError","InsufficientScopeError","AuthScopeError"]),g_=/^(?:UNAUTHENTICATED|UNAUTHORIZED|FORBIDDEN|FORBIDDEN_SCOPE|INSUFFICIENT_SCOPE|TOKEN_EXPIRED|INVALID_TOKEN|MISSING_TOKEN|DPOP_[A-Z_]+|AUTHENTICATION_ERROR|SCOPE_[A-Z_]+)$/i,Ny=a(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"asNumber"),Mc=a(e=>typeof e=="string"?e:void 0,"asString");function jt(e){if(e instanceof Q)return he.USER_ERROR;if(e instanceof oi)return he.PROTOCOL_ERROR;if(e instanceof Sh)return f_[ri(e.refusal.name)];if(e instanceof hh||e instanceof yh||e instanceof vh)return he.NETWORK_ERROR;if(e instanceof ei||e instanceof ph||e instanceof ti||e instanceof ni)return he.AUTH_ERROR;if(e instanceof dh)return e.isRetryable()?he.SERVER_ERROR:he.USER_ERROR;let t=e??{},r=Mc(t.code),o=Mc(t.cause?.code);if(r&&Oy.has(r)||o&&Oy.has(o))return he.NETWORK_ERROR;let n=Mc(t.name);if(n&&m_.has(n))return he.AUTH_ERROR;let i=Ny(t.status)??Ny(t.statusCode);return i!==void 0?i===401||i===403?he.AUTH_ERROR:i>=500&&i<600?he.SERVER_ERROR:he.USER_ERROR:r&&g_.test(r)?he.AUTH_ERROR:he.USER_ERROR}a(jt,"exitCodeFor");var Fc="Settings > Security > Networks",h_="Instances",y_="Allow new instances for one hour";function mi(e,t){if(e===null||typeof e!="object")return;let r=e;if(t(r.code))return r.code;if(t(r.upstreamCode))return r.upstreamCode}a(mi,"ruleCodeOf");function qc(e){return e instanceof ti?!0:mi(e,yc)!==void 0}a(qc,"isSourceRefusal");function Zc(e){return e instanceof ni?!0:mi(e,vc)!==void 0}a(Zc,"isFingerprintRefusal");async function jy(e,t,r=3e3,o){let n;try{n=new URL("/cdn-cgi/trace",e).toString()}catch{return}try{let s=await Dt(t,o)(n,{method:"GET",signal:AbortSignal.timeout(r)});if(!s.ok)return;let c=await s.text();for(let u of c.split(/\r?\n/)){if(!u.startsWith("ip="))continue;let l=u.slice(3).trim();return v_(l)?l:void 0}return}catch{return}}a(jy,"addressThisMachineReachesNpayloadFrom");function v_(e){return/^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/.test(e)?!0:/^[0-9a-f:]+$/i.test(e)&&e.includes(":")&&e.length<=39}a(v_,"isAddress");function b_(e){return e.includes(":")?`${e}/128`:`${e}/32`}a(b_,"hostNetworkOf");function Gc(e,t){let r=mi(e,yc)??"source_network_not_allowed",o=r.toLowerCase()==="source_network_not_declared",n=t!==void 0?`this machine reaches npayload from ${t}, which`:"the network this call came from",i=o?`npayload refused this request: this app environment has no network yet, so its keys cannot be used${t!==void 0?` (this machine reaches npayload from ${t})`:""}.`:`npayload refused this request: ${n} is not a network of this app environment.`,s=t!==void 0?`Add ${b_(t)} in the dashboard under ${Fc}, then run the command again.`:`Add the network this machine uses in the dashboard under ${Fc}, then run the command again. Open the API host's /cdn-cgi/trace page on this machine to see the address npayload sees.`;return new R(i,{code:r,hint:s,cause:e})}a(Gc,"sourceRefusalCliError");function Vc(e){let t=mi(e,vc)??"thumbprint_not_bound",r=e.fingerprint,o=typeof r=="string"&&r.length>0?` (${r})`:"";return new R(`npayload refused this request: the key fingerprint this machine presents${o} is not enrolled for this API key.`,{code:t,hint:`In the dashboard, open ${Fc}. Under ${h_}, choose "${y_}" on this API key, then run the command again from a network of this app environment.`,cause:e})}a(Vc,"fingerprintRefusalCliError");async function Uy(e,t){if(qc(e)){let r=t!==void 0?await t().catch(()=>{}):void 0;return Gc(e,r)}if(Zc(e))return Vc(e)}a(Uy,"callerRefusalCliError");var Bc={LIMIT_EXCEEDED:{message:"You've reached your plan's limit for this resource.",hint:"Upgrade your plan in the dashboard (Settings \u2192 Billing) to raise the limit."},TIER_LIMIT_EXCEEDED:{message:"You've reached your plan's limit for this resource.",hint:"Archive an unused one to free a slot, or upgrade your plan in the dashboard (Settings \u2192 Billing) to raise the limit."},PER_RUN_LIMIT_EXCEEDED:{message:"This request is too large for a single run.",hint:"Shorten the message, or split the task into smaller steps."},CAPABILITY_REQUIRED:{message:"This feature isn't included in your current plan.",hint:"Upgrade your plan in the dashboard (Settings \u2192 Billing) to unlock it."},BILLING_LIMIT:{message:"You've used your plan's monthly allowance.",hint:"Upgrade your plan, or wait for the next billing cycle."},BUDGET_EXCEEDED:{message:"Your AI budget for this period has been used.",hint:"Raise the budget in the dashboard, or upgrade your plan."},BUDGET_CAP_EXCEEDED:{message:"Your organization's daily AI spending cap has been reached.",hint:"Try again tomorrow, or raise the cap in the dashboard."},RATE_LIMITED:{message:"Too many requests right now.",hint:"Wait a moment and try again."},SECURITY_BLOCKED:{message:"This input was blocked by safety checks.",hint:"Rephrase the request and try again."},NOT_FOUND:{message:"We couldn't find that. It may have been moved or removed."},FORBIDDEN:{message:"You don't have permission to do that.",hint:"Ask an organization admin to grant access if you think you should have it."},PERMISSION_DENIED:{message:"You don't have permission to do that.",hint:"Ask an organization admin to grant access if you think you should have it."},INSUFFICIENT_SCOPE:{message:"This credential doesn't have the scope needed for that.",hint:"Re-provision the credential with the required scope."},UNAUTHORIZED:{message:"You're not signed in.",hint:"Run: "+b("login")},UNAUTHENTICATED:{message:"Your session has expired.",hint:"Run: "+b("login")},INVALID_ARGUMENT:{message:"Some of the provided values weren't valid. Check the flags and try again."},VALIDATION_ERROR:{message:"Some of the provided values weren't valid. Check the flags and try again."},INVALID_STATE:{message:"That action isn't possible right now \u2014 the item may have changed. Re-fetch and try again."},CONFLICT:{message:"That change conflicts with the current state. Re-fetch and try again."},EXPIRED:{message:"This item or link has expired. Request a new one and try again."},RUN_START_TIMEOUT:{message:"The agent didn't start in time.",hint:"Try again \u2014 if this keeps happening, contact support."},INTERNAL:{message:"Something went wrong on our side. Please try again \u2014 the error has been logged."},INTERNAL_ERROR:{message:"Something went wrong on our side. Please try again \u2014 the error has been logged."}};function gi(e){if(e instanceof R)return e;if(qc(e))return Gc(e,void 0);if(Zc(e))return Vc(e);let t=jh(e);if(t)return new R(t.reason??"This request was refused by your plan's current state.",{code:t.code,hint:"Upgrade your plan to continue",docs:t.upgradeUrl,cause:e});let r=e?.code;if(typeof r=="string"){let o=Bc[r]??Bc[r.toUpperCase()];if(o)return new R(o.message,{code:r,hint:o.hint,docs:o.docs,cause:e})}return e}a(gi,"toFriendlyCliError");function Ly(e){let t=e.kind??e.code,r=t?Bc[t]:void 0;return r||{message:e.message??"The agent run failed. Please try again."}}a(Ly,"friendlyStreamErrorLine");function Kc(e,t){let r=t.split("?")[0].replace(/:[A-Za-z_][\w]*/g,"{}").replace(/\{[^}]*\}/g,"{}").replace(/\/+$/,"");return`${e.toUpperCase()} ${r}`}a(Kc,"doorKey");var Jc="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",w_=[{door:"POST /v1/tenants/act-as",what:"the act-as exchange: a short-lived token pinned to one of the application's tenants"}],k_=new Set(w_.map(e=>{let t=e.door.indexOf(" ");return Kc(e.door.slice(0,t),e.door.slice(t+1))}));function qy(e){return k_.has(Kc(String(e.method),String(e.pattern)))}a(qy,"isTenantTokenDoor");var Wc=/[A-Za-z0-9_.-]+/g;function Zy(e){let t=e.split(".");for(let r=0;r+2<t.length;r+=1)if([t[r],t[r+1],t[r+2]].every(o=>(o??"").length>=8))return!0;return!1}a(Zy,"hasTokenShape");function x_(e){return(e.match(Wc)??[]).some(Zy)}a(x_,"holdsTokenShape");var Or=12,zy=8;function __(e){if(e.length<Or)return o=>o.includes(e)||o.length>=zy&&e.includes(o);let t=new Map,r=a(o=>{let n=t.get(o);if(n===void 0){n=new Set;for(let i=0;i+o<=e.length;i+=1)n.add(e.slice(i,i+o));t.set(o,n)}return n},"runsOf");return o=>{if(o.length>=Or){let n=r(Or);for(let i=0;i+Or<=o.length;i+=1)if(n.has(o.slice(i,i+Or)))return!0;return!1}return o.length>=zy&&r(o.length).has(o)}}a(__,"pieceTestOf");function On(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}a(On,"isPlainObject");function $_(e,t){let r={token:Jc};if(!On(e))return r;let n=!a(l=>"token"in l||"tenantId"in l||"expiresAt"in l||"scopes"in l,"readable")(e)&&On(e.data)?e.data:e,i=[e.token,On(e.data)?e.data.token:void 0].filter(l=>typeof l=="string"&&l!==""),s=new Map,c=a((l,d)=>{let f=s.get(d);return f===void 0&&(f=__(d),s.set(d,f)),f(l)},"holdsPieceOf"),u=a(l=>!x_(l)&&!i.some(d=>c(l,d)),"safe");return typeof n.tenantId=="string"&&(n.tenantId===t||u(n.tenantId))&&(r.tenantId=n.tenantId),typeof n.expiresAt=="number"&&Number.isFinite(n.expiresAt)&&(r.expiresAt=n.expiresAt),Array.isArray(n.scopes)&&(r.scopes=n.scopes.filter(l=>typeof l=="string"&&u(l))),r}a($_,"tenantTokenView");function S_(e){return e.replace(Wc,t=>Zy(t)?Jc:t)}a(S_,"scrubTokenShapes");var I_="npayload/tenantId",My="npayload/actorClass",P_="app-machine";function E_(e){try{let t=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}}a(E_,"claimsOf");function T_(e){let t=e[I_];return t!=null&&t!==""?!0:My in e&&e[My]!==P_}a(T_,"pinsATenant");function A_(e){let t=e.split(".");for(let r=1;r+1<t.length;r+=1){let o=E_(t[r]??"");if(o!==void 0&&T_(o))return!0}return!1}a(A_,"holdsTenantPinnedToken");function Fy(e){return e.includes(".")?e.replace(Wc,t=>A_(t)?Jc:t):e}a(Fy,"maskText");function Nr(e){let t=a(r=>{if(typeof r=="string")return Fy(r);if(Array.isArray(r)){let o=!1,n=r.map(i=>{let s=t(i);return s!==i&&(o=!0),s});return o?n:r}if(On(r)){let o=!1,n={};for(let[i,s]of Object.entries(r)){let c=Fy(i),u=t(s);(c!==i||u!==s)&&(o=!0),n[c]=u}return o?n:r}return r},"walk");return t(e)}a(Nr,"maskTenantPinnedTokens");function C_(e){let t=e?.body;return On(t)&&typeof t.externalId=="string"?t.externalId:void 0}a(C_,"askedExternalIdOf");function hi(e,t,r){return qy(e)?Nr($_(t,C_(r))):Nr(t)}a(hi,"showAnswer");function Dr(e,t){let r=Nr(t);if(e===void 0||!qy(e))return r;let o=a(n=>{if(typeof n=="string")return S_(n);if(Array.isArray(n))return n.map(o);if(On(n)){let i={};for(let[s,c]of Object.entries(n))i[s]=o(c);return i}return n},"scrub");return o(r)}a(Dr,"showFailure");function Hc(e,t){let r=e.commands;if(Array.isArray(r))return r.find(o=>{let n=typeof o.name=="function"?o.name():void 0;if(n!==void 0&&t.has(n))return!0;let i=typeof o.aliases=="function"?o.aliases():void 0;return Array.isArray(i)&&i.some(s=>t.has(s))})}a(Hc,"findChild");var R_=/token|secret|password|passphrase|apikey|api_key|credential|privatekey/i;function Gy(e){return R_.test(e)}a(Gy,"isSecretFlag");async function O_(e,t,r){let o=e.flags.filter(i=>i.name!=="idempotencyKey"&&t[i.name]===void 0),n=[...o.filter(i=>!i.optional),...o.filter(i=>i.optional)];for(let i of n){let s=`--${yi(i.name)}`,c=i.optional?" (optional, blank to skip)":"",u=i.coerce==="json"?" [JSON]":"",l;if(i.choices&&i.choices.length>0){let d=i.choices.map(f=>({name:f,value:f}));i.optional&&d.push({name:"(skip)",value:""}),l=await r.select(`${s}${u}`,d)}else Gy(i.name)?l=await r.secret(`${s}${c}`,{optional:i.optional}):l=await r.text(`${s}${u}${c}`,{optional:i.optional});l!==""&&(t[i.name]=l)}}a(O_,"fillFlagsInteractively");function N_(e,t){if(t.size===0)return e;let r=a(o=>{if(typeof o=="string")return t.has(o)?"[redacted \u2014 same value you supplied]":o;if(Array.isArray(o))return o.map(r);if(o&&typeof o=="object"){let n={};for(let[i,s]of Object.entries(o))n[i]=r(s);return n}return o},"walk");return r(e)}a(N_,"redactEchoedSecrets");var D_={channels:["events","channels"],messages:["events","messages"],subscriptions:["events","subscriptions"],dlq:["events","dlq"],streams:["events","streams"]};function yi(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}a(yi,"kebab");var j_={connectAccess:"grants",connectBridges:"bridges",connectExplore:"explore",connectProfile:"profile",connectPartner:"partner",connectTenantApproval:"approvals"},U_={"connect.connect.requestAccess":{group:["connect","grants"],leaf:"request"},"connect.connect.approveAccess":{group:["connect","grants"],leaf:"approve"},"connect.connect.rejectAccess":{group:["connect","grants"],leaf:"reject",aliases:["decline"]},"connect.connect.revokeGrant":{group:["connect","grants"],leaf:"revoke"},"connect.connectAccess.listMyGrants":{group:["connect","grants"],leaf:"list"},"connect.connectAccess.getGrant":{group:["connect","grants"],leaf:"get"}};function Vy(e){return`--${yi(e.name)} <value>`}a(Vy,"optionSpec");function L_(e){let t=e.choices!==void 0&&e.choices.length>0?`, one of: ${e.choices.join(", ")}`:"";return`${e.coerce??"string"}${t}${e.optional?"":" (required)"}`}a(L_,"optionHelp");function z_(e,t){let r=[`np ${t}`,...e.pathParams.map(i=>`<${i.key}>`)];for(let i of e.flags)i.name==="idempotencyKey"||i.optional||r.push(Vy(i));let o=[],n="";for(let i of r)n===""?n=i:`${n} ${i}`.length>78?(o.push(`${n} \\`),n=` ${i}`):n=`${n} ${i}`;return o.push(n),o}a(z_,"exampleLines");var M_="wickfeed/lit",F_="wickfeed.lit",q_=a(e=>e.split("/").filter(t=>t.length>0),"pathSegments"),Z_=a(e=>e.startsWith(":")||e.startsWith("{")&&e.endsWith("}"),"isPathParam");function G_(e){let t=q_(e.pattern);if(!t.some(o=>o==="feeds"||o==="feed-listings"))return;let r=t[t.length-1]??"";if(e.method==="POST"&&(r==="subscribe"||r.startsWith("subscribe-")))return"subscribe";if(e.method==="DELETE"&&t[t.length-2]==="subscriptions"&&Z_(r)||r==="unsubscribe")return"unsubscribe"}a(G_,"feedRefVerb");function V_(e,t){let r=t==="subscribe"?"Subscribe":"Unsubscribe",o=`${M_} (or its alias ${F_})`;return Hc(e,new Set([t]))!==void 0?`${r} by ref: np ${t} ${o}`:`${r} by the ref form, ${o}, never a gid`}a(V_,"feedRefLine");function By(e,t,r){let o=new Map,n=a(c=>{let u=e,l="";for(let d of c){let f=yi(d),p=j_[d]??f;l=l?`${l} ${p}`:p;let m=new Set;d!==p&&m.add(d),f!==p&&m.add(f);let g=o.get(l);if(g){u=g.node;let v=u.alias;if(typeof v=="function")for(let h of m)g.aliases.has(h)||(v.call(u,h),g.aliases.add(h))}else{let v=Hc(u,new Set([p,...m]));if(v){let h=new Set(typeof v.aliases=="function"?v.aliases():[]),k=v.alias;if(typeof k=="function")for(let T of m)h.has(T)||(k.call(v,T),h.add(T));o.set(l,{node:v,aliases:h}),u=v}else{let h=u.command(p),k=h.alias,T=new Set;if(typeof k=="function")for(let _ of m)k.call(h,_),T.add(_);o.set(l,{node:h,aliases:T}),u=h}}}return{node:u,path:l}},"groupNode"),i=new Map,s=a((c,u,l)=>{let d=c.commandPath[c.commandPath.length-1],{node:f,path:p}=n(u),m=l?.leaf??yi(d),g=p?`${p} ${m}`:m,v=i.get(g);if(v!==void 0)throw new Error(`CLI command table conflict: rows '${v}' and '${c.key}' both map to 'np ${g}'. This release of @npayload/sdk spells two commands alike; it is a defect of the package, not of your project. Upgrade @npayload/sdk, or contact support if the newest release fails the same way.`);if(i.set(g,c.key),Hc(f,new Set([m])))return;let h=c.pathParams.map(_=>`<${_.key}>`).join(" "),k=f.command(h?`${m} ${h}`:m),T=k.alias;if(typeof T=="function")for(let _ of l?.aliases??[])T.call(k,_);k.description(c.summary);for(let _ of c.flags)_.name!=="idempotencyKey"&&k.option(Vy(_),L_(_));if(Gh(c.method)&&(c.idempotent||c.flags.some(_=>_.name==="idempotencyKey"))&&k.option("--idempotency-key <key>","Idempotency key (UUIDv7 auto-generated when omitted)"),c.flags.some(_=>_.name!=="idempotencyKey")&&k.option("-i, --interactive","prompt step-by-step for any flag not passed on the command line"),typeof k.addHelpText=="function"){let _=G_(c);k.addHelpText("after",_===void 0?`
|
|
11
11
|
Example:
|
|
12
|
-
${
|
|
12
|
+
${z_(c,g).join(`
|
|
13
13
|
`)}`:`
|
|
14
|
-
${
|
|
15
|
-
|
|
14
|
+
${V_(e,_)}`)}k.action(async(..._)=>{let N,I=_.slice(0,c.pathParams.length),j=_[c.pathParams.length],z=j&&typeof j=="object"?j:{},W=z.interactive===!0,B={};for(let[L,K]of Object.entries(z))K===void 0||typeof K=="function"||L!=="interactive"&&(L==="idempotencyKey"?B["idempotency-key"]=String(K):B[L]=String(K));try{if(W){if(!r.prompt)throw new Q("--interactive is not available in this environment");if(r.isInteractive&&!r.isInteractive())throw new Q("--interactive requires a TTY; pass the values as flags instead (see --help for the full list)");await O_(c,B,r.prompt)}let L=Ry(c.opId);if(L?.confirm&&r.confirm&&!await r.confirm(L.confirm)){r.printError("aborted"),r.exit(1);return}let K=dt({row:c,positionals:I,flags:B,newIdempotencyKey:r.newIdempotencyKey});N=K;let ge=await r.send(K),ie=new Set(Object.entries(B).filter(([C,q])=>Gy(C)&&q!=="").map(([,C])=>C)),w=hi(c,Zh(N_(ge,ie)),K);L?.render?r.print(L.render(w)):r.print(w),r.exit(0)}catch(L){if(L instanceof Q){r.printError(Dr(c,L.message)),r.exit(L.exitCode);return}let K=r.whereAmI,ge=await Uy(L,K!==void 0?()=>K(N):void 0)??gi(L),ie=ge instanceof R?ge:L,w=ge instanceof R?Kh(ge):L instanceof Error?L.message:String(L);r.printError(Dr(c,Ee(w,ie))),r.exit(jt(L))}})},"registerRow");for(let c of t){s(c,c.commandPath.slice(0,-1));let u=J_(c.commandPath);u&&s(c,u);let l=U_[c.key];l&&s(c,l.group,l)}}a(By,"registerGeneratedCommands");function Yc(e){for(let t of e.commands??[])Yc(t),(t.commands??[]).length!==0&&B_(t)===""&&t.description(K_(t))}a(Yc,"describeUndescribedGroups");function B_(e){let t=e.description,r=typeof t=="function"?t.call(e):void 0;return typeof r=="string"?r:""}a(B_,"currentDescription");function Ky(e){let t=e.commands??[];return t.length===0?1:t.reduce((r,o)=>r+Ky(o),0)}a(Ky,"leafCount");function K_(e){let t=(e.commands??[]).map((i,s)=>({name:typeof i.name=="function"?i.name():"",n:Ky(i),i:s})).filter(i=>i.name!=="").sort((i,s)=>s.n-i.n||i.i-s.i),r=t.reduce((i,s)=>i+s.n,0),o=t.slice(0,5).map(i=>i.name),n=t.length-o.length;return`${o.join(", ")}${n>0?` and ${n} more`:""} (${r} ${r===1?"command":"commands"})`}a(K_,"groupSummary");function J_(e){for(let[t,r]of Object.entries(D_))if(e.length>=3&&e[0]===r[0]&&e[1]===r[1])return[t,...e.slice(2,-1)];return null}a(J_,"rootAliasPath");import{Command as Jy}from"commander";var W_=3,H_=.4;function Y_(e,t){let r=[];for(let o=0;o<=e.length;o+=1)r[o]=[o];for(let o=0;o<=t.length;o+=1)r[0][o]=o;for(let o=1;o<=t.length;o+=1)for(let n=1;n<=e.length;n+=1){let i=e[n-1]===t[o-1]?0:1;r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}a(Y_,"editDistance");function Wy(e,t){let r=e.startsWith("--"),o=r?e.slice(2):e,n=W_,i=[];for(let s of new Set(t)){let c=r?s.replace(/^--/,""):s;if(c.length<=1)continue;let u=Y_(o,c),l=Math.max(o.length,c.length);(l-u)/l<=H_||(u<n?(n=u,i=[s]):u===n&&i.push(s))}return i.sort((s,c)=>s.localeCompare(c))}a(Wy,"closestOf");function Hy(e){return e.length>1?`
|
|
15
|
+
(Did you mean one of ${e.join(", ")}?)`:e.length===1?`
|
|
16
|
+
(Did you mean ${e[0]}?)`:""}a(Hy,"suggestionLine");function Qc(e){let t=[];for(let r=e;r!==null;r=r.parent)t.unshift(r.name());return t.join(" ")}a(Qc,"pathOf");function Yy(e){let t=Qc(e).split(" ").slice(1).join(" ");return b(t===""?"--help":`${t} --help`)}a(Yy,"helpOf");function Q_(e){let t=e;for(;t.parent!==null;)t=t.parent;return t}a(Q_,"rootOf");function Xy(e){let t=Q_(e);if(t.npUserArgs!==void 0)return t.npUserArgs;let r=t.rawArgs;return Array.isArray(r)?r.slice(2).map(String):[]}a(Xy,"userArgsOf");function X_(e,t){let r=Xy(e),o=r.indexOf(t);return o<0&&t.startsWith("-")&&!t.startsWith("--")&&(o=r.findIndex(n=>n.startsWith("-")&&!n.startsWith("--")&&n.endsWith(t.slice(1)))),o<0?void 0:o+1}a(X_,"optionPosition");function e$(e,t){let r=Xy(e),o=[];for(let s=e;s!==null&&s.parent!==null;s=s.parent)o.unshift(s);let n=0;for(let s of o){let c=new Set([s.name(),...s.aliases()]),u=-1;for(let l=n;l<r.length;l+=1)if(c.has(r[l])){u=l;break}if(u<0){n=0;break}n=u+1}let i=r.indexOf(t,n);return i<0&&(i=r.indexOf(t)),i<0?void 0:i+1}a(e$,"commandWordPosition");function Qy(e){return e===void 0?"":` at argument ${e}`}a(Qy,"where");var vi=class e extends Jy{static{a(this,"NpCommand")}npUserArgs;createCommand(t){return new e(t)}_prepareUserArgs(t,r){let n=Reflect.get(Jy.prototype,"_prepareUserArgs").call(this,t,r);return this.npUserArgs=Array.isArray(n)?n.map(String):void 0,n}unknownOption(t){let r=this;if(r._allowUnknownOption)return;let o=t.includes("=")?t.slice(0,t.indexOf("=")):t,n="";if(o.startsWith("--")&&r._showSuggestionAfterError!==!1){let s=[],c=this;do{for(let u of c.createHelp().visibleOptions(c))u.long&&s.push(u.long);c=c.parent}while(c!==null&&!c._enablePositionalOptions);n=Hy(Wy(o,s))}let i=Qc(this);this.error(`error: unknown option${Qy(X_(this,t))}: ${i} has no such option; it is not shown here.${n}
|
|
17
|
+
Run '${Yy(this)}' to see its options.`,{code:"commander.unknownOption"})}unknownCommand(){let t=this,r=String(this.args[0]??""),o="";if(t._showSuggestionAfterError!==!1){let i=[];for(let s of this.createHelp().visibleCommands(this))i.push(s.name()),s.alias()&&i.push(s.alias());o=Hy(Wy(r,i))}let n=Qc(this);this.error(`error: unknown command${Qy(e$(this,r))}: ${n} has no such command; it is not shown here.${o}
|
|
18
|
+
Run '${Yy(this)}' to see its commands.`,{code:"commander.unknownCommand"})}_callParseArg(t,r,o,n){try{return t.parseArg(r,o)}catch(i){let s=i;if(s.code==="commander.invalidArgument"){let c=typeof t.flags=="string"?`option '${t.flags}'`:`argument '${typeof t.name=="function"?t.name():""}'`,u=Array.isArray(t.argChoices)?` Allowed choices are ${t.argChoices.join(", ")}.`:"";this.error(`error: ${c} was given a value it does not take; the value is not shown here.${u}`,{exitCode:s.exitCode??1,code:s.code})}throw i}}};import{input as t$,select as n$,confirm as r$,password as lO,checkbox as o$}from"@inquirer/prompts";import Nn from"chalk";var Xc=class extends Error{static{a(this,"NonInteractiveError")}constructor(){super("Interactive mode required. Use --skip-auth and set NPAYLOAD_CLIENT_ID + NPAYLOAD_HMAC_SECRET env vars for non-interactive environments."),this.name="NonInteractiveError"}};function Le(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}a(Le,"isInteractive");function bi(){if(!Le())throw new Xc}a(bi,"ensureTTY");async function jr(e,t){return bi(),t$({message:e,default:t?.default,validate:t?.validate})}a(jr,"askText");async function Qe(e,t){return bi(),n$({message:e,choices:t})}a(Qe,"askSelect");async function Ur(e,t=!1){return bi(),r$({message:e,default:t})}a(Ur,"askConfirm");async function tv(e,t){return bi(),o$({message:e,choices:t,loop:!1,pageSize:15})}a(tv,"askCheckbox");function Lr(e){console.log(),console.log(Nn.bold(e)),console.log(Nn.dim("\u2500".repeat(60)))}a(Lr,"sectionHeader");function ev(e){return e.replace(/\x1b\[[0-9;]*m/g,"").length}a(ev,"visibleWidth");function wi(e){let t=Math.max(...e.map(o=>ev(o))),r="\u2500".repeat(t+4);console.log(),console.log(Nn.dim(`\u250C${r}\u2510`));for(let o of e){let n=" ".repeat(Math.max(0,t-ev(o)));console.log(Nn.dim("\u2502 ")+o+n+Nn.dim(" \u2502"))}console.log(Nn.dim(`\u2514${r}\u2518`)),console.log()}a(wi,"printBox");import D from"chalk";import{readdirSync as Pv,existsSync as J$}from"fs";import{join as Ev}from"path";import{existsSync as Fr,mkdirSync as d$,writeFileSync as $i,readFileSync as su,appendFileSync as p$}from"fs";import{join as dn}from"path";import{createHash as i$,generateKeyPairSync as s$}from"crypto";import{existsSync as a$,readFileSync as c$}from"fs";import{join as u$}from"path";function ki(){let{publicKey:e,privateKey:t}=s$("ec",{namedCurve:"P-256"}),r=t.export({format:"jwk"}),o=e.export({format:"jwk"}),n=JSON.stringify({crv:o.crv,kty:o.kty,x:o.x,y:o.y});return{kid:i$("sha256").update(n).digest("base64url").slice(0,12),alg:"ES256",publicJwk:o,privateJwk:r,createdAt:Date.now()}}a(ki,"provisionDpopKeypair");function zr(e){let t=u$(e,".npayload.json");if(!a$(t))return null;try{let r=JSON.parse(c$(t,"utf8"));if(r.dpopKid&&r.dpopPrivateJwk&&r.dpopPublicJwk)return{kid:r.dpopKid,alg:"ES256",privateJwk:r.dpopPrivateJwk,publicJwk:r.dpopPublicJwk,createdAt:Date.now()}}catch{}return null}a(zr,"readExistingDpop");function nv(e,t){return["# managed by npayload: environments and access scopes as code","# docs: https://npayload.com/docs/manifest","","[app]",`slug = "${e.appSlug}"`,...e.appName&&e.appName!==e.appSlug?[`name = "${e.appName}"`]:[],"",`# Development environments (N per app). \`${b(`env use ${t}`)}\` targets it;`,"# add more with `"+b("env create")+"` (each maps onto the shared sandbox pool).",`[env.${t}]`,'kind = "development"',"","# The production environment (exactly ONE per app \u2014 the production","# singleton). Only `"+b("deploy")+"` writes here; the branch guard requires","# main/master (or this env's deploy_branch).","[env.production]",'kind = "production"',"","# Scopes-as-code: the concrete <resource>:<action>","# grants this app's machine credential holds. `"+b("scopes fix")+"` fills the","# projected floor from your config; wildcards are rejected.","[access_scopes]","scopes = []","","# Embedded components. Name the components you","# MOUNT \u2014 never their scopes. `"+b("scopes fix")+"` derives the scopes those","# components need, plus the embed/tenant scopes your own backend needs to","# mint a session, from the component map. Adding an id here is the ONLY","# edit required; an unknown id fails the parse.",'# e.g. components = ["primus", "connect"]',`# valid ids: ${Wh.join(", ")}`,"[embed]","components = []",""].join(`
|
|
19
|
+
`)}a(nv,"renderManifest");function eu(e){return`import { defineEventsConfig } from "@npayload/sdk";
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* Declare your Events topology here, then:
|
|
19
|
-
*
|
|
20
|
-
*
|
|
23
|
+
* ${b("validate")} check it against the contract
|
|
24
|
+
* ${b("deploy")} reconcile it to npayload (idempotent)
|
|
21
25
|
*
|
|
22
26
|
* Tip: ask your coding agent \u2014 "set up npayload Events for this app" \u2014 and it
|
|
23
27
|
* will fill this in from your schema using the npayload MCP server. Resources are
|
|
@@ -31,12 +35,12 @@ export default defineEventsConfig({
|
|
|
31
35
|
// eventTypes: { ... },
|
|
32
36
|
// subscriptions: { ... },
|
|
33
37
|
});
|
|
34
|
-
`}a(
|
|
38
|
+
`}a(eu,"renderEventsConfig");function tu(e){return`import { definePrimusConfig } from "@npayload/sdk";
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
41
|
* Declare your Primus (AI) topology here, then:
|
|
38
|
-
*
|
|
39
|
-
*
|
|
42
|
+
* ${b("dev")} watch + sync this (and events.config.ts) live
|
|
43
|
+
* ${b("deploy")} reconcile to npayload (idempotent: create + update)
|
|
40
44
|
*
|
|
41
45
|
* Tip: ask your coding agent \u2014 "set up npayload Primus for this app" \u2014 and it
|
|
42
46
|
* will fill this in using the npayload MCP server. Secrets (LLM keys) NEVER go
|
|
@@ -84,25 +88,18 @@ export default definePrimusConfig({
|
|
|
84
88
|
// },
|
|
85
89
|
},
|
|
86
90
|
|
|
87
|
-
// \u2500\u2500 Triggers \u2014
|
|
91
|
+
// \u2500\u2500 Triggers \u2014 start an agent (keyed by slug; fields from primus_contract) \u2500\u2500
|
|
88
92
|
// Requires the \`triggers:read\`/\`triggers:write\` scopes on your OAuth client.
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
// description: "Run support-bot when an order is created.",
|
|
93
|
-
// agentGid: "support_bot", // an agent SLUG above (resolved to its gid)
|
|
94
|
-
// type: "event", // "cron" | "event" | "webhook" | "message"
|
|
95
|
-
// config: { eventType: "orders.created" },
|
|
96
|
-
// action: { goal: "Summarize the new order and notify the team." },
|
|
97
|
-
// },
|
|
98
|
-
// },
|
|
93
|
+
// Not yet: a trigger of type "event" is accepted, and no event of yours reaches it.
|
|
94
|
+
// To run an agent on an event, send the event to your own route with a webhook
|
|
95
|
+
// subscription in events.config.ts and call np.primus.agents.run from that route.
|
|
99
96
|
});
|
|
100
|
-
`}a(
|
|
97
|
+
`}a(tu,"renderPrimusConfig");function nu(e){return`import { definePipesConfig } from "@npayload/sdk";
|
|
101
98
|
|
|
102
99
|
/**
|
|
103
100
|
* Declare your Pipes (automation) topology here, then:
|
|
104
|
-
*
|
|
105
|
-
*
|
|
101
|
+
* ${b("dev")} watch + sync this (and events/primus) live
|
|
102
|
+
* ${b("deploy")} reconcile to npayload (idempotent: create + update)
|
|
106
103
|
*
|
|
107
104
|
* Tip: ask your coding agent \u2014 "set up a npayload workflow for this app" \u2014 and it
|
|
108
105
|
* will fill this in using the npayload MCP server (call \`pipes_contract\` for the
|
|
@@ -122,7 +119,8 @@ export default definePipesConfig({
|
|
|
122
119
|
// ],
|
|
123
120
|
// edges: [],
|
|
124
121
|
// },
|
|
125
|
-
// // type: "
|
|
122
|
+
// // type: "schedule" (config: { cron }) | "manual" (config: {}, started by a call)
|
|
123
|
+
// // Turning on a pipe that starts on an event is refused today; start it by a call or on a schedule.
|
|
126
124
|
// triggerConfig: { type: "schedule", config: { cron: "0 9 * * *" } },
|
|
127
125
|
// },
|
|
128
126
|
},
|
|
@@ -137,12 +135,12 @@ export default definePipesConfig({
|
|
|
137
135
|
// },
|
|
138
136
|
},
|
|
139
137
|
});
|
|
140
|
-
`}a(
|
|
138
|
+
`}a(nu,"renderPipesConfig");function ru(e){return`import { defineConnectConfig } from "@npayload/sdk";
|
|
141
139
|
|
|
142
140
|
/**
|
|
143
141
|
* Declare cross-org identity BRIDGES here, then:
|
|
144
|
-
*
|
|
145
|
-
*
|
|
142
|
+
* ${b("validate")} check it against the Connect contract
|
|
143
|
+
* ${b("deploy")} reconcile it to npayload (admin is the source of truth)
|
|
146
144
|
*
|
|
147
145
|
* A bridge maps the same real entity across two orgs that use different ids
|
|
148
146
|
* (e.g. a customer that is "customer_123" in your org and "contact_XYZ" in the
|
|
@@ -158,9 +156,9 @@ export default defineConnectConfig({
|
|
|
158
156
|
// "<target-org-gid>": { entityTypeSlug: "customer" },
|
|
159
157
|
},
|
|
160
158
|
});
|
|
161
|
-
`}a(
|
|
162
|
-
`}a(
|
|
163
|
-
`}a(
|
|
159
|
+
`}a(ru,"renderConnectConfig");function Mr(e){return JSON.stringify({version:Dh,hash:Uh,note:"Pinned npayload contract. Bump by installing a newer npayload version."},null,2)+`
|
|
160
|
+
`}a(Mr,"renderContractLock");function ou(e){return JSON.stringify({mcpServers:{npayload:{command:"npx",args:[si(),"mcp","serve"]}}},null,2)+`
|
|
161
|
+
`}a(ou,"renderMcpConfig");function xi(e,t={}){let r=e.apiUrl?`
|
|
164
162
|
# API URL
|
|
165
163
|
NPAYLOAD_API_URL=${e.apiUrl}
|
|
166
164
|
`:"",o=`
|
|
@@ -172,7 +170,7 @@ NPAYLOAD_API_URL=${e.apiUrl}
|
|
|
172
170
|
NPAYLOAD_DPOP_KID=${e.dpop.kid}
|
|
173
171
|
NPAYLOAD_DPOP_PRIVATE_JWK=${JSON.stringify(e.dpop.privateJwk)}
|
|
174
172
|
`:"",c=n==="http"?`
|
|
175
|
-
# Transport: HTTP/JSON (opted in via --http). Re-run
|
|
173
|
+
# Transport: HTTP/JSON (opted in via --http). Re-run \`${b("init")}\` for the default secure transport.
|
|
176
174
|
NPAYLOAD_TRANSPORT=http
|
|
177
175
|
`:`
|
|
178
176
|
# Transport: the default secure binary wire. The SDK provisions and registers a
|
|
@@ -180,121 +178,124 @@ NPAYLOAD_TRANSPORT=http
|
|
|
180
178
|
NPAYLOAD_TRANSPORT=npp
|
|
181
179
|
${i}`;return`# npayload credentials
|
|
182
180
|
# Created by: npayload init
|
|
183
|
-
${
|
|
181
|
+
${un(e.clientId)?`# Not connected yet. These are PLACEHOLDERS \u2014 run \`${b("login")}\` to fill in
|
|
184
182
|
# your real app credentials. The project is safe to import; only the first
|
|
185
183
|
# network call needs real credentials.
|
|
186
184
|
`:""}
|
|
187
185
|
NPAYLOAD_CLIENT_ID=${e.clientId}
|
|
188
186
|
NPAYLOAD_HMAC_SECRET=${e.hmacSecret}
|
|
189
187
|
NPAYLOAD_APP_ID=${e.appId}
|
|
190
|
-
${r}${o}${c}${s}`}a(
|
|
191
|
-
`)}a(
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
${r}${o}${c}${s}`}a(xi,"renderEnvFile");var _i=["","# npayload \u2014 credentials (never commit)",".env",".npayload.json","# npayload \u2014 local machine state (regenerated; like .next/)",".npayload/"],iu=["npayload/_generated/","npayload/_generated"];var rv=[{step:1,do:"Check the project state: credentials, endpoint reachability, generated artifacts.",mcpTool:"npayload_status",cli:b("doctor"),expect:"ok:true with a credential source present. If not, stop and show the user the remediation lines."},{step:2,do:"Fetch the config contract for the product you are wiring \u2014 Events (channels/eventTypes/subscriptions), Pipes (workflows/credentials), or Primus AI agents (agents/skills/tools/triggers). Each returns JSON Schema + capability catalog + guidance: the ONLY source for what that config may contain \u2014 never guess fields.",mcpTool:"events_contract / pipes_contract / primus_contract",cli:null,expect:"The schema you will author npayload/<product>.config.ts against."},{step:3,do:"Study the app's own data model (its schema/models/types) and design the topology in the product config(s): npayload/events.config.ts (channels, typed eventTypes, subscriptions), npayload/pipes.config.ts (workflows, vault-referenced credentials), npayload/primus.config.ts (agents, skills, tools, triggers).",mcpTool:null,cli:null,expect:"One default-exported define<Product>Config({...}) per product the app uses, reflecting its real domain."},{step:4,do:"Validate each config offline against its contract.",mcpTool:"events_validate / pipes_validate / primus_validate",cli:b("validate"),expect:"ok:true per product. Fix every issue it returns before going further."},{step:5,do:"Preview the plan \u2014 nothing is applied.",mcpTool:"events_deploy / pipes_deploy / primus_deploy (check:true)",cli:b("diff"),expect:"A plan of creates/updates/no-ops (and orphans). Review it; surprises here mean the config is wrong."},{step:6,do:"Apply to the sandbox. This also regenerates npayload/permissions.generated.ts (the per-object scope union across EVERY product config present) and npayload/_generated/events.d.ts (typed payloads).",mcpTool:"events_deploy / pipes_deploy / primus_deploy",cli:b("push"),expect:"Resources reconciled; generated files updated. A second run is all no-ops (idempotent)."},{step:7,do:`Wire the app code: np.events.publish("<channel-slug>", payload, { routingKey: "<event.type>" }) \u2014 payloads are typed by _generated/events.d.ts after the push; the routing key is the event's type, which Connect grants match on; np.pipes.* / np.primus.* for the other products. Use events_usage for copy-ready runtime recipes; one-off operations on ANY product go through npayload_catalog \u2192 npayload_invoke.`,mcpTool:"events_usage",cli:null,expect:"App code compiles against the generated payload types."},{step:8,do:"Prove it end to end: publish one real event from the app, watch it arrive.",mcpTool:null,cli:b("tail <channel-slug>"),expect:"The published event printed live in the terminal."},{step:9,do:"Go live from a pipeline. This is the user's step, never yours: tell them exactly this. (a) In the npayload console, on the app's PRODUCTION environment, create an API key for the deploy on the API keys page; the project's own key is bound to its development environment and cannot reach production. (b) Store that key's two values as secrets of the pipeline, named NPAYLOAD_CLIENT_ID and NPAYLOAD_HMAC_SECRET: never in the repository, never printed, never pasted into a chat. (c) Add one step to the pipeline, run from the production branch (main or master unless the environment declares another; from any other branch add `--allow-branch <that branch>`): `"+b("deploy --check")+"` to read the plan, then `"+b("deploy")+"` to apply it.",mcpTool:null,cli:b("deploy"),expect:"The plan against production, then the same resources reconciled there; a second run applies nothing. If a run stops on a missing permission, the user adds that scope to the key in the console and runs the pipeline again."}],ov=["Never guess config fields or operations. The config schema comes from the product's contract tool (`events_contract` / `pipes_contract` / `primus_contract`, or `"+b("validate")+"`); the full operation surface comes from `npayload_catalog`. If it is not there, it does not exist.","Never edit anything under npayload/_generated/ or npayload/permissions.generated.ts \u2014 they are generated on push and committed; hand edits are overwritten and fail drift checks.","Never read, print, or edit .env or .npayload.json \u2014 credentials are already wired; tools and the CLI resolve them automatically.","Config references take the NATURAL identity, never an id: channel refs take the channel's SLUG (subscriptions[].channelGid, eventTypes[].channels, consumerGroups[].channelGid); a Primus trigger's agentGid and an agent's skills[] take the NAMES declared in the same config \u2014 all resolved to ids at push. Do not invent ids.","Event payload schemas (eventTypes[].schema) are append-only: changing one registers a NEW catalogue version on push; it never mutates the old version.","Primus naming rule: skill and tool names are lowercase + digits + underscores \u2014 a hyphenated name is rejected by the platform. Agent and trigger names may use hyphens.","Pipes lifecycle: a config-declared workflow is created as a DRAFT; activation is deliberate (dashboard, CLI, or pipes_create's activate flag for imperative builds). NEVER put a plaintext secret in pipes.config.ts \u2014 credentials carry a vault REFERENCE only.","`"+b("push")+"` / the *_deploy tools target the SANDBOX. Production is only `"+b("deploy")+"`, run deliberately by a human \u2014 never call it as an agent.","Going live (step 9) is the user's own step. Never create, read, print or store a production API key, never write one into a file or a chat, and never run the production deploy yourself: give the user the three parts of step 9 and let their pipeline run it.","The .npayload/ directory (dot-prefixed) is local machine state written by `"+b("pull")+"`; its absence is normal. The committed workspace is npayload/ (no dot).","If a call fails, run npayload_status / `"+b("doctor")+"` first and act on its remediation \u2014 do not retry blindly or invent workarounds.","Read how npayload and each of its products work in the npayload docs, through `npayload_docs_search` (the pages that hold your words) and `npayload_docs_read` (a page whole, or the list of every page), never from memory; a product's config fields and operations still come only from its contract tool (`events_contract` / `pipes_contract` / `primus_contract`) and `npayload_catalog`."],iv=[{path:"npayload/events.config.ts",what:"Events topology you author: channels, typed eventTypes, subscriptions. Committed."},{path:"npayload/pipes.config.ts",what:"Pipes topology you author: workflows + vault-referenced credentials. Committed."},{path:"npayload/primus.config.ts",what:"Primus (AI agents) topology you author: agents, skills, tools, triggers. Committed."},{path:"npayload/connect.config.ts",what:"Connect identity bridges you author: the only Connect resource a config declares; grants are requested and approved with commands. Committed."},{path:"npayload/permissions.generated.ts",what:"Per-object permission model \u2014 the union across every product config present, generated on push. Committed, never hand-edited."},{path:"npayload/_generated/",what:"contract.lock + events.d.ts (typed payloads), generated on push. Committed, never hand-edited."},{path:"npayload/AGENTS.md",what:"This guide. Regenerated by `"+b("init")+"`."},{path:".npayload/",what:"Local machine state (pull snapshots). Gitignored; absent until `"+b("pull")+"` runs."},{path:".env + .npayload.json",what:"Credentials. Gitignored; never read or edit them."},{path:".mcp.json",what:"Connects your editor's agent to the npayload MCP server."}],sv="Use this section when the app links products: another company's events arrive (Connect or Feed), a pipe checks them and raises what needs doing, and an agent acts and reports. Do the steps in order and prove each one before the next. Every command runs from the project folder as written. Pipes and Primus need a paid plan on the organization of the app that runs them; Connect and buying on Feed work on a free one.",av=[` Every command runs in your project folder as: ${b("<command>")}`," [Partner's Events] publish with routingKey = the event type"," | [Connect] connect grants request; partner: connect grants approve"," | [Feed] subscribe <seller>/<listing> --env sandbox --tail"," v"," [Events: a channel of your app, or its receiving channel]"," | events.config.ts: a webhook subscription to your https route,"," | which starts the pipe with the event as its input:"," | np.pipes.executions.triggerExecution",' | pipes.config.ts trigger { type: "manual", config: {} };'," | validate, diff, push, then pipes workflows activate-workflow <id>"," | refused today: turning on a pipe that starts on an event"," v"," [Pipes] checks, decides; its events node publishes on your channel"," | events.config.ts: a webhook subscription to your https route"," v"," [Your route] --np.primus.agents.run--> [Primus agent] (primus.config.ts)"," [Primus agent] --its tools call--> [Your route], which publishes results"," not yet: [Events] -x-> [Primus] directly; [Pipes] -x-> [Primus] by config"].join(`
|
|
189
|
+
`),cv=[{step:1,do:'Publish every event with its type as the routing key: `np.events.publish("<channel-slug>", payload, { routingKey: "<event.type>" })`. A Connect grant matches on the routing key. An event published without it, or with a type the grant does not name, is accepted and reaches no partner, and no error says so.',mcpTool:null,cli:b("messages publish <channel id> --payload '<json>' --routing-key <event.type>"),expect:"`"+b("tail <channel-slug>")+"` prints the event."},{step:2,do:"Connect, to receive another company's events. Both apps are Connect apps, in two organizations, using credentials of environments of the same kind. Read your own app id, then ask for the event types.",mcpTool:null,cli:b("connect profile get-app-profile")+"`, then `"+b(`connect grants request --publisher-app-id <their app id> --subscriber-app-id <your app id> --event-types '["<event.type>"]' --purpose "<why>"`),expect:"a pending grant id (`agt_\u2026`)."},{step:3,do:"The publishing company approves, with a credential of the environment whose channels it shares. Every open channel of its app in that environment takes part; only events whose routing key equals a granted type cross.",mcpTool:null,cli:b("connect grants list --direction received --status pending")+"`, then `"+b("connect grants approve <grant id>"),expect:"the grant is active."},{step:4,do:"Find the receiving channel. Its slug is `connect-recv-<grant id>`.",mcpTool:null,cli:b("connect grants get <grant id>")+"`, field `connectReceivingChannelGid",expect:"after the partner publishes with a granted type, `"+b("messages list <receiving channel id>")+"` shows the event."},{step:5,do:"Feed, to buy a listing's events. Subscribe in the sandbox only: a production subscription can charge the user's saved card, so it is the user's step. There is no feed config file; selling a listing is described in the Feed docs.",mcpTool:null,cli:b("subscribe <seller-slug>/<listing-slug> --env sandbox --tail"),expect:"the terms, a consent question, then the receiving channel (`feed-<listing-slug>-sandbox`) and the seller's events printed live."},{step:6,do:'A pipe the app starts by a call. In `npayload/pipes.config.ts`, declare a workflow whose `triggerConfig` is `{ type: "manual", config: {} }`; each run takes as its input what the call passes. Trigger types to use: `manual`, or `schedule` with its `cron`; `webhook` and `form` are refused. Take the exact fields from `pipes_contract`.',mcpTool:"pipes_validate",cli:b("validate")+"`, `"+b("diff")+"`, then `"+b("push"),expect:"the pipe is created as a draft."},{step:7,do:["Activate the pipe; a draft never runs.","Turning on a pipe that starts on an event is refused today; start it by a call or on a schedule.","Then bring each event to the app's own route and start the pipe there. In `npayload/events.config.ts`, declare a webhook subscription on the channel the events arrive on, a channel of this app or the receiving channel of step 4 or 5 (`type: \"webhook\"`, `channelGid: \"<channel slug>\"`, `endpoint.url` = the route's public https address), then push; the route checks each delivery's signature as step 10 says. For each event the route calls `np.pipes.executions.triggerExecution({ workflowGid, triggerData: <the event> })`, which answers the run's id. Starting a run needs the `pipes:execute` scope, which `"+b("scopes fix")+"` adds once the pipe is declared in `npayload/pipes.config.ts`."].join(" "),mcpTool:null,cli:b("pipes workflows list-workflows")+"`, then `"+b("pipes workflows activate-workflow <workflow id>")+"`, then `"+b("pipes executions trigger-execution <workflow id> --trigger-data '<json>'"),expect:"the pipe is active; a run started by hand answers its id; then each event on the channel starts one run through the route."},{step:8,do:"The pipe raises what needs doing: an events connector node (action `publish`) in the pipe's definition publishes on a channel of this app, for example `orders-to-review`; declare that channel in `npayload/events.config.ts`. After the first push the node graph is edited in the editor; a config update changes the description only.",mcpTool:null,cli:b("push"),expect:"`"+b("tail orders-to-review")+"` prints what the pipe raised."},{step:9,do:"The agent. In `npayload/primus.config.ts`, declare the agent and its tools; a tool with the `webhook` executor calls an https route of the app. Take the exact fields from `primus_contract`.",mcpTool:"primus_validate",cli:b("validate")+"`, then `"+b("push"),expect:"`"+b("primus agents list")+"` shows the agent."},{step:10,do:"Link the pipe to the agent through the app's own route. In `npayload/events.config.ts`, declare a webhook subscription on the channel the pipe raises into (`type: \"webhook\"`, `channelGid: \"orders-to-review\"`, `endpoint.url` = the route's public https address), then push. The route checks each delivery's signature with the subscription's signing secret, which the user stores (`"+b("events subscriptions reveal-secret <subscription id>")+"`); never print it yourself. The route calls `np.primus.agents.run({ agentGid, input })`, which needs the `agents:execute` scope: add it to `[access_scopes]` in `npayload.toml`, because `"+b("scopes fix")+"` does not add it.",mcpTool:null,cli:b("primus agents run <agent id> --input '<text>'"),expect:"the run answers by hand; then each event the pipe raises starts one run through the route."},{step:11,do:'The agent acts and reports. Each tool call reaches the app\'s route; the route does the work and publishes the result: `np.events.publish("<channel-slug>", result, { routingKey: "<result.type>" })`.',mcpTool:null,cli:b("tail <channel-slug>"),expect:"the result printed live."}],uv=["An event that starts an agent directly: a trigger of type `event` in `primus.config.ts` is accepted, and no event of this app reaches it. Use steps 10 and 11.","A pipe that calls an agent from `pipes.config.ts`. Use steps 8 and 10.","A pipe trigger of type `webhook` or `form`: refused.","Starting the pipe from a receiving channel (steps 4 and 5) through the route is not yet proven end to end, whatever step 7 says: prove it with one real partner event before telling the user it works."];function lv(e){let t=["# npayload \u2014 guide for coding agents","",`<!-- Generated by \`${b("init")}\` (@npayload/sdk@${e}). Re-run init to refresh. -->`,"","npayload is communication infrastructure for autonomous systems, and it is","configuration-driven: you author the product configs under `npayload/`","(`events.config.ts`, `pipes.config.ts`, `primus.config.ts`, `connect.config.ts`), validate them,","push them, and the platform reconciles everything else. There is nothing to","reverse-engineer \u2014 follow the loop below exactly. The npayload MCP server","(already wired via `.mcp.json`) serves the same loop as tools; start with","the `npayload_overview` tool when connected.","","## The workspace","","| Path | What it is |","|------|------------|",...iv.map(r=>`| \`${r.path}\` | ${r.what} |`),"","## The loop \u2014 do these steps in order",""];for(let r of rv){let o=[r.mcpTool?`MCP \`${r.mcpTool}\``:null,r.cli?`CLI \`${r.cli}\``:null].filter(Boolean).join(" \xB7 ");t.push(`${r.step}. ${r.do}${o?` (${o})`:""}`),t.push(` Expect: ${r.expect}`)}t.push("","## The full loop: linking the products","",sv,"","```",av,"```","");for(let r of cv){let o=[r.mcpTool?`MCP \`${r.mcpTool}\``:null,r.cli?`CLI \`${r.cli}\``:null].filter(Boolean).join(" \xB7 ");t.push(`${r.step}. ${r.do}${o?` (${o})`:""}`),t.push(`${" ".repeat(String(r.step).length+2)}Expect: ${r.expect}`)}return t.push("","Not yet: never wire these.",...uv.map(r=>`- ${r}`)),t.push("","## Hard rules","",...ov.map(r=>`- ${r}`),"","## Where facts come from (never from memory)","","- How npayload and each of its products work: the npayload docs, through the `npayload_docs_search` and `npayload_docs_read` tools.","- Config schema + capabilities: the product's contract tool \u2014 `events_contract` / `pipes_contract` / `primus_contract` \u2014 or `"+b("validate")+"` offline.","- Full operation surface (every product, incl. AI `primus.*` ops): `npayload_catalog` tool (invoke via `npayload_invoke`).","- Runtime code recipes: `events_usage` tool; imperative workflow building: `pipes_catalog` \u2192 `pipes_build` \u2192 `pipes_create` \u2192 `pipes_run` \u2192 `pipes_get_execution`.","- Project/stack health: `npayload_status` tool, or `"+b("doctor")+"`.","- Feed (buying and selling event data): no config file and no Feed tool of its own; buy with `"+b("subscribe <seller>/<listing>")+"`; every other Feed operation goes through `npayload_catalog` \u2192 `npayload_invoke`.",""),t.join(`
|
|
190
|
+
`)}a(lv,"renderAgentsMd");function dv(){return{workflow:rv,rules:ov,workspace:iv,loopIntro:sv,loopDiagram:av,loop:cv,loopNotYet:uv}}a(dv,"overviewRails");import*as l$ from"fs";function Xe(e,t,r={}){let o=r.fs??l$;if(o.existsSync(e)){try{o.chmodSync(e,384)}catch{}r.append?o.appendFileSync(e,t,"utf8"):o.writeFileSync(e,t,"utf8");return}o.writeFileSync(e,t,{encoding:"utf8",mode:384})}a(Xe,"writeSecretFile");function pv(e,t,r={}){let o=dn(e,"npayload"),n=[],i=[],s=[],c=[];t.dpop||(t.dpop=zr(e)??ki());let u=[o,dn(o,"_generated")];for(let f of u)r.dryRun||d$(f,{recursive:!0}),c.push(f.replace(e+"/",""));let l=[["npayload.toml",nv(t,r.firstEnv??"sandbox")],["npayload/events.config.ts",eu(t)],["npayload/primus.config.ts",tu(t)],["npayload/pipes.config.ts",nu(t)],["npayload/connect.config.ts",ru(t)],["npayload/_generated/contract.lock",Mr(t)],["npayload/AGENTS.md",lv(an())],[".mcp.json",ou(t)]],d=new Set(["npayload/AGENTS.md"]);for(let[f,p]of l){let m=dn(e,f);if(n.push(f),Fr(m)&&!r.force&&!d.has(f)){s.push(f);continue}r.dryRun||$i(m,p,"utf8"),i.push(f)}return n.push(".env",".npayload.json"),r.dryRun?n.push():(f$(e,t,r.force)?i.push(".env"):s.push(".env"),m$(e,t,r.force)?i.push(".npayload.json"):s.push(".npayload.json"),g$(e)&&i.push("package.json"),au(e)),{files:n,written:i,skipped:s,directories:c}}a(pv,"scaffold");function f$(e,t,r){let o=dn(e,".env");if(Fr(o)){let n=su(o,"utf8");if(n.includes("NPAYLOAD_CLIENT_ID")&&!r||n.includes("NPAYLOAD_CLIENT_ID")&&r)return!1;let i=ai(n),s=xi(t,{namesEdge:!!i.NPAYLOAD_EDGE_URL?.trim()});return Xe(o,`
|
|
191
|
+
`+s,{append:!0}),!0}return Xe(o,xi(t)),!0}a(f$,"writeEnvFile");function m$(e,t,r){let o=dn(e,".npayload.json");if(Fr(o)&&!r)return!1;let n={clientId:t.clientId,hmacSecret:t.hmacSecret,...t.targetEnv?{targetEnv:t.targetEnv}:{}};return t.dpop&&(n.dpopKid=t.dpop.kid,n.dpopPrivateJwk=t.dpop.privateJwk,n.dpopPublicJwk=t.dpop.publicJwk),Xe(o,JSON.stringify(n,null,2)+`
|
|
192
|
+
`),!0}a(m$,"writeProjectCredentials");function g$(e){let t=dn(e,"package.json");if(!Fr(t))return!1;let r=Mh();if(!r)return!1;let o=su(t,"utf8"),n;try{n=JSON.parse(o)}catch{return!1}let i=!1;for(let c of["dependencies","devDependencies"]){let u=n[c];if(!u||typeof u!="object")continue;let l=u;if(_c.some(d=>typeof l[d]=="string")){let d={};for(let[f,p]of Object.entries(l))_c.includes(f)&&typeof p=="string"?!(sn in d)&&!(sn in l)&&(d[sn]=r):d[f]=p;n[c]=l=d,i=!0}typeof l[sn]=="string"&&l[sn]!==r&&(l[sn]=r,i=!0)}if(!i)return!1;let s=/^(\s+)"/m.exec(o)?.[1]??" ";return $i(t,JSON.stringify(n,null,s)+(o.endsWith(`
|
|
194
193
|
`)?`
|
|
195
|
-
`:""),"utf8"),!0}a(
|
|
194
|
+
`:""),"utf8"),!0}a(g$,"healPackageJsonPin");function au(e){let t=dn(e,".gitignore");if(!Fr(t)){$i(t,_i.join(`
|
|
196
195
|
`)+`
|
|
197
|
-
`,"utf8");return}let r=
|
|
196
|
+
`,"utf8");return}let r=su(t,"utf8"),o=new Set,n=r.split(/\r?\n/).filter(s=>{let c=s.trim();if(iu.includes(c))return!1;if(c.startsWith("# npayload")){if(o.has(c))return!1;o.add(c)}return!0}).join(`
|
|
198
197
|
`);n!==r&&(r=n.endsWith(`
|
|
199
198
|
`)?n:n+`
|
|
200
|
-
|
|
199
|
+
`,$i(t,r,"utf8"));let i=[];for(let s of _i)s&&!r.includes(s)&&i.push(s);if(i.length>0){let s=r.endsWith(`
|
|
201
200
|
`)?"":`
|
|
202
|
-
`;
|
|
201
|
+
`;p$(t,s+`
|
|
203
202
|
# npayload
|
|
204
203
|
`+i.join(`
|
|
205
204
|
`)+`
|
|
206
|
-
`,"utf8")}}a(Gc,"updateGitignore");import{existsSync as jr,readFileSync as Lr,writeFileSync as I_}from"fs";function fi(e,t,r){let o=Me([["the edge this run names",t.edgeUrl]],e);if(o.production)return;let n=Uh(e).NPAYLOAD_EDGE_URL,i=t.edgeUrl?.trim()?t.edgeUrl:n,s=i===void 0?void 0:uc(o.estate,i);if(s!==void 0){let l=t.edgeUrl?.trim()?"":" (the production edge is the one this project's .env names)";throw new be(`This run mixes two estates${l}: ${s}. ${r.edge}`)}let c=t.signIn===void 0?void 0:uc(o.estate,t.signIn);if(c!==void 0)throw new be(`This run's sign-in would mix two estates: ${c}. ${r.signIn}`)}a(fi,"refuseMixedEstate");import{join as Ur}from"path";import Ny from"chalk";import Qe from"chalk";import{spawn as i_}from"child_process";function s_(e,t){return e==="darwin"?["open",[t]]:e==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]]}a(s_,"browserLauncher");function a_(e){try{let[t,r]=s_(process.platform,e),o=i_(t,r,{stdio:"ignore",detached:!0});o.on("error",()=>{}),o.unref()}catch{}}a(a_,"openBrowser");async function Ty(e={}){Cr("Sign in");let t=await qe(e.authServerUrl);if(t)try{return await t.listOrgs(),console.log(Qe.green("\u2713")+" Already signed in"),t}catch(i){M(i),console.log(Qe.dim(" Your session expired. Signing in again."))}if(!je()&&!process.env.NPAYLOAD_AUTH_URL)throw new C("Cannot sign in: this is a non-interactive terminal.",{code:"NO_TTY",hint:"For CI, provision an app in the dashboard and pass NPAYLOAD_CLIENT_ID + NPAYLOAD_HMAC_SECRET with --skip-auth.",docs:"https://docs.npayload.com/docs/start/initialize"});console.log(Qe.dim(" Sign in to npayload to continue."));let r=e.authServerUrl??"",o=null,n=0;try{let i=await Fh({authUrl:e.authServerUrl,onStart:a(s=>{r=s,console.log(" "+Qe.cyan("\u2192")+" requesting a device code from "+Qe.dim(s)+" \u2026")},"onStart"),onPrompt:a(s=>{let c=s.verificationUriComplete||s.verificationUri;console.log(),console.log(" "+Qe.cyan("\u2197")+" Opening your browser to approve this device\u2026"),console.log(" "+Qe.dim(c)),a_(c),console.log(" Verification code: "+Qe.bold(s.userCode)+Qe.dim(" (already filled in)")),console.log(Qe.dim(" Didn't open? Paste the URL above.")),n=Date.now(),o=on("Waiting for browser approval\u2026")},"onPrompt"),onPoll:a(()=>{if(!o)return;let s=Math.round((Date.now()-n)/1e3);o.text=`Waiting for browser approval\u2026 (${s}s)`},"onPoll")});return o?o.succeed("Signed in"):console.log(Qe.green("\u2713")+" Signed in"),i}catch(i){o&&o.fail("Sign in failed"),M(i);let s=i instanceof Error?i.message:"Please run the command again.";throw new C("Sign in failed.",{code:"AUTH_FAILED",hint:r&&!s.includes(r)?`${s} (endpoint: ${r})`:s,docs:"https://docs.npayload.com/docs/start/initialize",cause:i})}}a(Ty,"authFlow");import Le from"chalk";function gi(){let e=process.env.NPAYLOAD_PORTAL_URL?.trim();return e&&e.length>0?e.replace(/\/+$/,""):Me().production?"https://admin.npayload.com":void 0}a(gi,"portalHost");var c_=["events","pipes","ai","primus","credentials","keys","feed"];function l_(e){return/^[a-z][a-z0-9_]{0,40}:[a-z][a-z0-9_]{0,40}$/.test(e)&&!e.includes("*")}a(l_,"isWellFormedScope");function Ay(e=[]){let t=new Set;for(let r of[...we.commands,...e]){let o=r.key.split(".")[0];if(c_.includes(o))for(let n of r.scopes??[])l_(n)&&t.add(n)}return[...t].sort()}a(Ay,"projectedCeiling");async function On(e,t,r){let o=on(e);try{let n=await t();return o.succeed(r?r(n):e),n}catch(n){throw o.fail(`${e} \u2014 failed`),n}}a(On,"withSpin");var u_=[{name:"No tenants \u2014 my own services publish and consume",value:"none",description:"Every event belongs to your org directly. No customers-of-customers."},{name:"Tenanted \u2014 my customers' tenants are first-class",value:"tenanted",description:"Every event row carries a tenantId (org > app > env > tenant). Pick this when you serve your customers' customers."}],d_=[{name:"Internal \u2014 events within your org",value:"internal",description:"Private event bus for your own services. The ESB replacement."},{name:"Connect \u2014 share events with other orgs",value:"connect",description:"Cross-org event sharing. Discoverable in Explore. You'll pick a subtype next (platform / device / mobile) \u2014 at parity with the dashboard."},{name:"Feed \u2014 sell event data",value:"feed",description:"Commercial data distribution with Stripe billing."}],p_=[{name:"None \u2014 standard connect app",value:"none",description:"Cross-org sharing without platform/device/mobile specialization. An app you build on a platform another organization operates is this kind."},{name:"Platform \u2014 your own multi-tenant platform",value:"platform",description:"You operate the platform and your customers' tenants run on it: per-tenant events, tenant approvals, Entity NAT, identity bridges. Its slug is registered to your organization."},{name:"Device \u2014 a device-class connect app",value:"device",description:"For a physical / edge device integration."},{name:"Mobile \u2014 a mobile-class connect app",value:"mobile",description:"For a mobile app integration."}];function m_(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}a(m_,"slugify");async function Cy(e,t={}){let r=await f_(e,t.org),o=r.orgId,n=await g_(e,o,t.app,r.name),{loadExtraCommandRows:i}=await import("../chunk-GTEVGEFA.mjs"),s=Ay(await i()),c=await On("Provisioning credentials\u2026",()=>e.provisionOac(o,n.appId,t.rotate,s));if(c.alreadyProvisioned&&!c.hmacSecret&&t.needSecret&&!t.rotate)throw new C(`This app already has CLI credentials (${c.clientId}) and this project holds none saved; the existing secret was left untouched.`,{code:"CREDENTIALS_EXIST",hint:"Copy the team's .env and .npayload.json into this project, or pass --rotate to issue a fresh secret (the previous one stops working immediately)."});return c.alreadyProvisioned&&!c.hmacSecret?(console.log(Le.green("\u2713")+` Using existing credentials (${Le.dim(c.clientId)}). Your previous secret is kept.`),console.log(Le.dim(" Lost the secret? Re-run with --rotate to issue a new one (this invalidates the old)."))):c.hmacSecret&&console.log(Le.green("\u2713")+` Credentials ${t.rotate?"rotated":"provisioned"} (${Le.dim(c.clientId)})`),{orgId:o,...n,clientId:c.clientId,hmacSecret:c.hmacSecret}}a(Cy,"selectTarget");async function f_(e,t){Cr("Organization");let r=await On("Loading your organizations\u2026",()=>e.listOrgs(),n=>n.length===1?n[0].name:`${n.length} organizations`);if(t!==void 0&&t.trim()!==""){let n=t.trim().toLowerCase(),i=r.find(s=>s.orgId.toLowerCase()===n||s.slug.toLowerCase()===n||s.name.toLowerCase()===n);if(!i){let s=r.length>0?r.map(c=>c.slug).join(", "):"(none \u2014 the session can access no organizations)";throw new Error(`No organization matching "${t}" is accessible to this session. Available: ${s}.`)}return console.log(Le.green("\u2713")+` ${i.name} (${i.slug})`),{orgId:i.orgId,name:i.name||void 0}}for(;r.length===0;){console.log(Le.yellow(" You're not in any organization yet."));let n=gi();console.log(n!==void 0?" Create one at "+Le.cyan(`${n}/organization-list`)+", then press Enter.":" Create one in your npayload dashboard, then press Enter."),await Tr(" Press Enter when your organization is ready",{default:""}),r=await On("Checking for your organization\u2026",()=>e.listOrgs(),i=>`${i.length} found`)}if(r.length===1)return{orgId:r[0].orgId,name:r[0].name||void 0};if(!je())throw new Error(`This session can access ${r.length} organizations; a non-interactive login must choose one. Pass --org <slug|gid> (or set NPAYLOAD_ORG). Available: ${r.map(n=>n.slug).join(", ")}.`);let o=await He("Select an organization",r.map(n=>({name:`${n.name} (${n.slug})`,value:n.orgId})));return{orgId:o,name:r.find(n=>n.orgId===o)?.name||void 0}}a(f_,"selectOrg");async function g_(e,t,r,o){Cr("App");let n=await On("Loading your apps\u2026",()=>e.listApps(t),c=>c.length?`${c.length} app${c.length===1?"":"s"}`:"no apps yet"),i="__create__";if(r!==void 0&&r.trim()!==""){let c=r.trim().toLowerCase(),l=n.find(u=>u.gid.toLowerCase()===c||u.slug.toLowerCase()===c||u.name.toLowerCase()===c);if(!l){let u=n.length>0?n.map(d=>d.slug).join(", "):"(none \u2014 create one in the dashboard or run `np login` interactively)";throw new Error(`No app matching "${r}" exists in this organization. Available: ${u}.`)}return console.log(Le.green("\u2713")+` ${l.name} (${l.slug})`),{appId:l.gid,appName:l.name,appSlug:l.slug,appType:l.appType,subtype:l.subtype,platformSlug:l.platformSlug}}if(!je()){let c=n.length>0?`Pass --app <slug|gid> (or set NPAYLOAD_APP). Available: ${n.map(l=>l.slug).join(", ")}.`:"This organization has no apps yet; create one in the dashboard, then pass --app <slug|gid>.";throw new Error(`A non-interactive login must choose an existing app. ${c}`)}let s=i;if(n.length>0&&(s=await He("Select an app or create a new one",[...n.map(c=>({name:`${c.name} (${c.slug}) \u2014 ${c.appType}`,value:c.gid})),{name:Le.green("\uFF0B")+" Create a new app",value:i}])),s!==i){let c=n.find(l=>l.gid===s);return console.log(Le.green("\u2713")+` ${c.name}`),{appId:c.gid,appName:c.name,appSlug:c.slug,appType:c.appType,subtype:c.subtype,platformSlug:c.platformSlug}}return h_(e,t,o??"your organization")}a(g_,"selectOrCreateApp");async function h_(e,t,r){let n=await Tr("App name:",{validate:a(u=>u.trim().length>0?!0:"App name is required","validate")}),i=await He("What kind of app?",d_),s=i==="feed"?void 0:await He("Who does this app serve?",u_),c,l;if(i==="connect"){let u=await He("What kind of connect app?",p_);if(u!=="none"&&(c=u),c==="platform"){let d=(await Tr("Your platform's slug:",{validate:a(m=>/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(m.trim())?!0:"Platform slug must be lowercase alphanumeric with hyphens","validate")})).trim();await y_(e,t,r,d)?l=d:(c=void 0,await v_(n.trim(),d))}}for(let u=0;u<5;u++){let d=await Tr("Slug:",{default:u===0?m_(n):"",validate:a(m=>m.trim()?/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(m.trim())?!0:"Slug must be lowercase alphanumeric with hyphens, no leading/trailing hyphens":"Slug is required","validate")});try{let m=await On(`Creating app ${n.trim()}\u2026`,()=>e.createApp(t,{name:n.trim(),slug:d.trim(),appType:i,...s!==void 0?{tenancyMode:s}:{},subtype:c,platformSlug:l}),()=>`App created: ${n.trim()}`);return{appId:m.gid,appName:n.trim(),appSlug:m.slug,appType:i,subtype:c,platformSlug:l}}catch(m){M(m);let p=gc(m);if(p!==void 0&&(p.reason==="platform_not_registered"||p.reason==="platform_claimed"))throw new fc(hc(p.reason,p.httpStatus,{slug:l,organization:r}),p.reason,p.httpStatus);let f=m instanceof Error?m.message:"";if(f.toLowerCase().includes("slug")||f.toLowerCase().includes("taken")){console.log(Le.red(` ${f} Choose another.`));continue}throw m}}throw new Error("Could not create the app after several attempts.")}a(h_,"createApp");async function y_(e,t,r,o){if(!await Ar(`Register ${o} as ${r}'s own platform?`))return!1;try{return await On(`Registering ${o}\u2026`,()=>e.registerPlatform(t,{slug:o}),i=>i.already?`${o} is already registered to ${r}`:`${o} registered to ${r}`),!0}catch(i){M(i);let s=gc(i);if(s===void 0)throw i;let c=hc(s.reason,s.httpStatus,{slug:o,organization:r,door:"platforms"});if(s.reason==="platform_claimed")return console.log(Le.yellow(` ${c}`)),!1;throw new fc(c,s.reason,s.httpStatus)}}a(y_,"registerOwnPlatform");async function v_(e,t){if(console.log(` An app you build on ${t} is a standard connect app: it carries no platform subtype and no platform slug, and its tenants name ${t} as their platform.`),!await Ar(`Create ${e} as a standard connect app?`,!0))throw new Error("No app was created. Run np login again when you are ready to create it.")}a(v_,"offerStandardConnectApp");import{existsSync as b_,readFileSync as w_,writeFileSync as x_}from"fs";import{join as k_}from"path";function hi(e){let t=!1;for(let r=0;r<e.length;r++){let o=e[r];if(t){if(o==="\\"&&t==='"'){r++;continue}o===t&&(t=!1);continue}if(o==='"'||o==="'")t=o;else if(o==="#")return e.slice(0,r).trim()}return e.trim()}a(hi,"codePart");function __(e){return e.startsWith("[")}a(__,"isHeaderLine");function Dr(e,t){for(let r=0;r<e.length;r++)if(hi(e[r])===t)return r;return-1}a(Dr,"findHeader");function Oy(e,t){for(let r=t+1;r<e.length;r++)if(__(hi(e[r])))return r;return e.length}a(Oy,"sectionEnd");function Ry(e,t,r,o){let n=Oy(e,t),i=`${r} = "${o}"`;for(let s=t+1;s<n;s++){let c=hi(e[s]);if(c.startsWith(`${r} =`)||c.startsWith(`${r}=`)){if(c===i)return;e[s]=i;return}}e.splice(t+1,0,i)}a(Ry,"setKeyInSection");function $_(e,t){let r=e.includes(`\r
|
|
205
|
+
`,"utf8")}}a(au,"updateGitignore");import{existsSync as Zr,readFileSync as Gr,writeFileSync as U$}from"fs";function Si(e,t,r){let o=qe([["the edge this run names",t.edgeUrl]],e);if(o.production)return;let n=ry(e).NPAYLOAD_EDGE_URL,i=t.edgeUrl?.trim()?t.edgeUrl:n,s=i===void 0?void 0:wc(o.estate,i);if(s!==void 0){let u=t.edgeUrl?.trim()?"":" (the production edge is the one this project's .env names)";throw new we(`This run mixes two estates${u}: ${s}. ${r.edge}`)}let c=t.signIn===void 0?void 0:wc(o.estate,t.signIn);if(c!==void 0)throw new we(`This run's sign-in would mix two estates: ${c}. ${r.signIn}`)}a(Si,"refuseMixedEstate");import{join as Vr}from"path";import vv from"chalk";import et from"chalk";import{spawn as h$}from"child_process";function y$(e,t){return e==="darwin"?["open",[t]]:e==="win32"?["rundll32",["url.dll,FileProtocolHandler",t]]:["xdg-open",[t]]}a(y$,"browserLauncher");function v$(e){try{let[t,r]=y$(process.platform,e),o=h$(t,r,{stdio:"ignore",detached:!0});o.on("error",()=>{}),o.unref()}catch{}}a(v$,"openBrowser");async function fv(e={}){Lr("Sign in");let t=await Ze(e.authServerUrl);if(t)try{return await t.listOrgs(),console.log(et.green("\u2713")+" Already signed in"),t}catch(n){F(n),console.log(et.dim(" Your session expired. Signing in again."))}if(!Le()&&!process.env.NPAYLOAD_AUTH_URL)throw new R("Cannot sign in: this is a non-interactive terminal.",{code:"NO_TTY",hint:"For CI, provision an app in the dashboard and pass NPAYLOAD_CLIENT_ID + NPAYLOAD_HMAC_SECRET with --skip-auth.",docs:"https://docs.npayload.com/docs/start/initialize"});console.log(et.dim(" Sign in to npayload to continue."));let r=null,o=0;try{let n=await ay({authUrl:e.authServerUrl,onStart:a(i=>{console.log(" "+et.cyan("\u2192")+" requesting a device code from "+et.dim(i)+" \u2026")},"onStart"),onPrompt:a(i=>{let s=i.verificationUriComplete||i.verificationUri;console.log(),console.log(" "+et.cyan("\u2197")+" Opening your browser to approve this device\u2026"),console.log(" "+et.dim(s)),v$(s),console.log(" Verification code: "+et.bold(i.userCode)+et.dim(" (already filled in)")),console.log(et.dim(" Didn't open? Paste the URL above.")),o=Date.now(),r=cn("Waiting for browser approval\u2026")},"onPrompt"),onPoll:a(()=>{if(!r)return;let i=Math.round((Date.now()-o)/1e3);r.text=`Waiting for browser approval\u2026 (${i}s)`},"onPoll")});return r?r.succeed("Signed in"):console.log(et.green("\u2713")+" Signed in"),n}catch(n){r&&r.fail("Sign in failed"),F(n);let i=n instanceof Error?n.message:"Please run the command again.";throw new R("Sign in failed.",{code:"AUTH_FAILED",hint:i,docs:"https://docs.npayload.com/docs/start/initialize",cause:n})}}a(fv,"authFlow");import ze from"chalk";function Ii(){let e=process.env.NPAYLOAD_PORTAL_URL?.trim();return e&&e.length>0?e.replace(/\/+$/,""):qe().production?"https://admin.npayload.com":void 0}a(Ii,"portalHost");var b$=["events","pipes","ai","primus","credentials","keys","feed"];function w$(e){return/^[a-z][a-z0-9_]{0,40}:[a-z][a-z0-9_]{0,40}$/.test(e)&&!e.includes("*")}a(w$,"isWellFormedScope");function mv(e=[]){let t=new Set;for(let r of[...ke.commands,...e]){let o=r.key.split(".")[0];if(b$.includes(o))for(let n of r.scopes??[])w$(n)&&t.add(n)}return[...t].sort()}a(mv,"projectedCeiling");async function Dn(e,t,r){let o=cn(e);try{let n=await t();return o.succeed(r?r(n):e),n}catch(n){throw o.fail(`${e} \u2014 failed`),n}}a(Dn,"withSpin");var k$=[{name:"No tenants \u2014 my own services publish and consume",value:"none",description:"Every event belongs to your org directly. No customers-of-customers."},{name:"Tenanted \u2014 my customers' tenants are first-class",value:"tenanted",description:"Every event row carries a tenantId (org > app > env > tenant). Pick this when you serve your customers' customers."}],x$=[{name:"Internal \u2014 events within your org",value:"internal",description:"Private event bus for your own services. The ESB replacement."},{name:"Connect \u2014 share events with other orgs",value:"connect",description:"Cross-org event sharing. Discoverable in Explore. You'll pick a subtype next (platform / device / mobile) \u2014 at parity with the dashboard."},{name:"Feed \u2014 sell event data",value:"feed",description:"Commercial data distribution with Stripe billing."}],_$=[{name:"None \u2014 standard connect app",value:"none",description:"Cross-org sharing without platform/device/mobile specialization. An app you build on a platform another organization operates is this kind."},{name:"Platform \u2014 your own multi-tenant platform",value:"platform",description:"You operate the platform and your customers' tenants run on it: per-tenant events, tenant approvals, Entity NAT, identity bridges. Its slug is registered to your organization."},{name:"Device \u2014 a device-class connect app",value:"device",description:"For a physical / edge device integration."},{name:"Mobile \u2014 a mobile-class connect app",value:"mobile",description:"For a mobile app integration."}];function $$(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}a($$,"slugify");async function gv(e,t={}){let r=await S$(e,t.org),o=r.orgId,n=await I$(e,o,t.app,r.name),{loadExtraCommandRows:i}=await import("../chunk-VZZ4FDPO.mjs"),s=mv(await i()),c=await Dn("Provisioning credentials\u2026",()=>e.provisionOac(o,n.appId,t.rotate,s));if(c.alreadyProvisioned&&!c.hmacSecret&&t.needSecret&&!t.rotate)throw new R(`This app already has CLI credentials (${c.clientId}) and this project holds none saved; the existing secret was left untouched.`,{code:"CREDENTIALS_EXIST",hint:"Copy the team's .env and .npayload.json into this project, or pass --rotate to issue a fresh secret (the previous one stops working immediately)."});return c.alreadyProvisioned&&!c.hmacSecret?(console.log(ze.green("\u2713")+` Using existing credentials (${ze.dim(c.clientId)}). Your previous secret is kept.`),console.log(ze.dim(" Lost the secret? Re-run with --rotate to issue a new one (this invalidates the old)."))):c.hmacSecret&&console.log(ze.green("\u2713")+` Credentials ${t.rotate?"rotated":"provisioned"} (${ze.dim(c.clientId)})`),{orgId:o,...n,clientId:c.clientId,hmacSecret:c.hmacSecret}}a(gv,"selectTarget");async function S$(e,t){Lr("Organization");let r=await Dn("Loading your organizations\u2026",()=>e.listOrgs(),n=>n.length===1?n[0].name:`${n.length} organizations`);if(t!==void 0&&t.trim()!==""){let n=t.trim().toLowerCase(),i=r.find(s=>s.orgId.toLowerCase()===n||s.slug.toLowerCase()===n||s.name.toLowerCase()===n);if(!i){let s=r.length>0?r.map(c=>c.slug).join(", "):"(none \u2014 the session can access no organizations)";throw new Error(`No organization matching "${t}" is accessible to this session. Available: ${s}.`)}return console.log(ze.green("\u2713")+` ${i.name} (${i.slug})`),{orgId:i.orgId,name:i.name||void 0}}for(;r.length===0;){console.log(ze.yellow(" You're not in any organization yet."));let n=Ii();console.log(n!==void 0?" Create one at "+ze.cyan(`${n}/organization-list`)+", then press Enter.":" Create one in your npayload dashboard, then press Enter."),await jr(" Press Enter when your organization is ready",{default:""}),r=await Dn("Checking for your organization\u2026",()=>e.listOrgs(),i=>`${i.length} found`)}if(r.length===1)return{orgId:r[0].orgId,name:r[0].name||void 0};if(!Le())throw new Error(`This session can access ${r.length} organizations; a non-interactive login must choose one. Pass --org <slug|gid> (or set NPAYLOAD_ORG). Available: ${r.map(n=>n.slug).join(", ")}.`);let o=await Qe("Select an organization",r.map(n=>({name:`${n.name} (${n.slug})`,value:n.orgId})));return{orgId:o,name:r.find(n=>n.orgId===o)?.name||void 0}}a(S$,"selectOrg");async function I$(e,t,r,o){Lr("App");let n=await Dn("Loading your apps\u2026",()=>e.listApps(t),c=>c.length?`${c.length} app${c.length===1?"":"s"}`:"no apps yet"),i="__create__";if(r!==void 0&&r.trim()!==""){let c=r.trim().toLowerCase(),u=n.find(l=>l.gid.toLowerCase()===c||l.slug.toLowerCase()===c||l.name.toLowerCase()===c);if(!u){let l=n.length>0?n.map(d=>d.slug).join(", "):"(none \u2014 create one in the dashboard or run `"+b("login")+"` interactively)";throw new Error(`No app matching "${r}" exists in this organization. Available: ${l}.`)}return console.log(ze.green("\u2713")+` ${u.name} (${u.slug})`),{appId:u.gid,appName:u.name,appSlug:u.slug,appType:u.appType,subtype:u.subtype,platformSlug:u.platformSlug}}if(!Le()){let c=n.length>0?`Pass --app <slug|gid> (or set NPAYLOAD_APP). Available: ${n.map(u=>u.slug).join(", ")}.`:"This organization has no apps yet; create one in the dashboard, then pass --app <slug|gid>.";throw new Error(`A non-interactive login must choose an existing app. ${c}`)}let s=i;if(n.length>0&&(s=await Qe("Select an app or create a new one",[...n.map(c=>({name:`${c.name} (${c.slug}) \u2014 ${c.appType}`,value:c.gid})),{name:ze.green("\uFF0B")+" Create a new app",value:i}])),s!==i){let c=n.find(u=>u.gid===s);return console.log(ze.green("\u2713")+` ${c.name}`),{appId:c.gid,appName:c.name,appSlug:c.slug,appType:c.appType,subtype:c.subtype,platformSlug:c.platformSlug}}return P$(e,t,o??"your organization")}a(I$,"selectOrCreateApp");async function P$(e,t,r){let n=await jr("App name:",{validate:a(l=>l.trim().length>0?!0:"App name is required","validate")}),i=await Qe("What kind of app?",x$),s=i==="feed"?void 0:await Qe("Who does this app serve?",k$),c,u;if(i==="connect"){let l=await Qe("What kind of connect app?",_$);if(l!=="none"&&(c=l),c==="platform"){let d=(await jr("Your platform's slug:",{validate:a(f=>/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(f.trim())?!0:"Platform slug must be lowercase alphanumeric with hyphens","validate")})).trim();await E$(e,t,r,d)?u=d:(c=void 0,await T$(n.trim(),d))}}for(let l=0;l<5;l++){let d=await jr("Slug:",{default:l===0?$$(n):"",validate:a(f=>f.trim()?/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(f.trim())?!0:"Slug must be lowercase alphanumeric with hyphens, no leading/trailing hyphens":"Slug is required","validate")});try{let f=await Dn(`Creating app ${n.trim()}\u2026`,()=>e.createApp(t,{name:n.trim(),slug:d.trim(),appType:i,...s!==void 0?{tenancyMode:s}:{},subtype:c,platformSlug:u}),()=>`App created: ${n.trim()}`);return{appId:f.gid,appName:n.trim(),appSlug:f.slug,appType:i,subtype:c,platformSlug:u}}catch(f){F(f);let p=Sc(f);if(p!==void 0&&(p.reason==="platform_not_registered"||p.reason==="platform_claimed"))throw new $c(Ic(p.reason,p.httpStatus,{slug:u,organization:r}),p.reason,p.httpStatus);let m=f instanceof Error?f.message:"";if(m.toLowerCase().includes("slug")||m.toLowerCase().includes("taken")){console.log(ze.red(` ${m} Choose another.`));continue}throw f}}throw new Error("Could not create the app after several attempts.")}a(P$,"createApp");async function E$(e,t,r,o){if(!await Ur(`Register ${o} as ${r}'s own platform?`))return!1;try{return await Dn(`Registering ${o}\u2026`,()=>e.registerPlatform(t,{slug:o}),i=>i.already?`${o} is already registered to ${r}`:`${o} registered to ${r}`),!0}catch(i){F(i);let s=Sc(i);if(s===void 0)throw i;let c=Ic(s.reason,s.httpStatus,{slug:o,organization:r,door:"platforms"});if(s.reason==="platform_claimed")return console.log(ze.yellow(` ${c}`)),!1;throw new $c(c,s.reason,s.httpStatus)}}a(E$,"registerOwnPlatform");async function T$(e,t){if(console.log(` An app you build on ${t} is a standard connect app: it carries no platform subtype and no platform slug, and its tenants name ${t} as their platform.`),!await Ur(`Create ${e} as a standard connect app?`,!0))throw new Error("No app was created. Run "+b("login")+" again when you are ready to create it.")}a(T$,"offerStandardConnectApp");import{existsSync as A$,readFileSync as C$,writeFileSync as R$}from"fs";import{join as O$}from"path";function Pi(e){let t=!1;for(let r=0;r<e.length;r++){let o=e[r];if(t){if(o==="\\"&&t==='"'){r++;continue}o===t&&(t=!1);continue}if(o==='"'||o==="'")t=o;else if(o==="#")return e.slice(0,r).trim()}return e.trim()}a(Pi,"codePart");function N$(e){return e.startsWith("[")}a(N$,"isHeaderLine");function qr(e,t){for(let r=0;r<e.length;r++)if(Pi(e[r])===t)return r;return-1}a(qr,"findHeader");function yv(e,t){for(let r=t+1;r<e.length;r++)if(N$(Pi(e[r])))return r;return e.length}a(yv,"sectionEnd");function hv(e,t,r,o){let n=yv(e,t),i=`${r} = "${o}"`;for(let s=t+1;s<n;s++){let c=Pi(e[s]);if(c.startsWith(`${r} =`)||c.startsWith(`${r}=`)){if(c===i)return;e[s]=i;return}}e.splice(t+1,0,i)}a(hv,"setKeyInSection");function D$(e,t){let r=e.includes(`\r
|
|
207
206
|
`)?`\r
|
|
208
207
|
`:`
|
|
209
|
-
`,o=e.split(/\r?\n/),n=
|
|
208
|
+
`,o=e.split(/\r?\n/),n=qr(o,"[app]");if(n===-1){let i=0;for(;i<o.length;){if(Pi(o[i])===""||o[i].trim().startsWith("#")){i++;continue}break}o.splice(i,0,"[app]",`slug = "${t.slug}"`,""),n=i}else hv(o,n,"slug",t.slug);return t.name&&t.name!==t.slug&&hv(o,n,"name",t.name),o.join(r)}a(D$,"setAppIdentity");function j$(e,t){let r=e.includes(`\r
|
|
210
209
|
`)?`\r
|
|
211
210
|
`:`
|
|
212
|
-
`,o=e.split(/\r?\n/);for(let n of t){if(
|
|
213
|
-
`)},"appSection");return
|
|
214
|
-
`,{encoding:"utf8",mode:384})}a(
|
|
215
|
-
`)){let o=r.trim();if(!o||o.startsWith("#"))continue;let n=o.indexOf("=");n<=0||(t[o.slice(0,n).trim()]=o.slice(n+1))}return t}a(
|
|
216
|
-
`);
|
|
211
|
+
`,o=e.split(/\r?\n/);for(let n of t){if(qr(o,`[env.${n.slug}]`)!==-1)continue;let i=[`[env.${n.slug}]`,`kind = "${n.kind}"`,...n.name&&n.name!==n.slug?[`name = "${n.name}"`]:[],""],s=qr(o,"[access_scopes]");if(s!==-1){let c=s;for(;c>0;){let u=o[c-1].trim();if(u===""||u.startsWith("#"))c--;else break}o.splice(c,0,...i)}else o.length>0&&o[o.length-1].trim()!==""&&o.push(""),o=[...o,...i]}return o.join(r)}a(j$,"ensureEnvSections");var cu={changed:!1,addedEnvSections:[],appUpdated:!1};function Ei(e,t){let r=O$(e,py);if(!A$(r))return cu;let o=C$(r,"utf8"),n=o;t.app&&(n=D$(n,t.app));let i=[];if(t.envs&&t.envs.length>0){for(let c of t.envs)qr(n.split(/\r?\n/),`[env.${c.slug}]`)!==-1||i.push(c.slug);n=j$(n,t.envs)}if(n===o)return cu;try{fy(n)}catch{return cu}let s=a(c=>{let u=c.split(/\r?\n/),l=qr(u,"[app]");return l===-1?"":u.slice(l,yv(u,l)).join(`
|
|
212
|
+
`)},"appSection");return R$(r,n,"utf8"),{changed:!0,addedEnvSections:i,appUpdated:t.app!==void 0&&s(o)!==s(n)}}a(Ei,"reconcileManifestFile");function bv(e,t,r){try{Ei(e,{app:{slug:t,name:r}}).appUpdated&&console.log(vv.green("\u2713")+` npayload.toml updated (app ${vv.bold(t)})`)}catch{}}a(bv,"reconcileManifestIdentity");async function Ti(e,t={}){let{base:r}=oy(t.authUrl);Si(e,{edgeUrl:t.edgeUrl,signIn:`${r}/oauth/cli/code`},{edge:"Name the edge of that estate with NPAYLOAD_EDGE_URL, or name nothing outside npayload's production hosts to use its production estate.",signIn:"Name that estate's auth host with NPAYLOAD_AUTH_URL or its API with NPAYLOAD_API_URL (export what the project's .env names), so the sign-in goes there, or name nothing outside npayload's production hosts."});let o=L$(e),n=await fv({authServerUrl:r,debug:t.debug}),i=await gv(n,{rotate:t.rotate,needSecret:!o,...t.org?{org:t.org}:{},...t.app?{app:t.app}:{}}),s=i.hmacSecret;if(o&&(s===void 0||s===""))return t.env&&wv(e,t.env),bv(e,i.appSlug,i.appName),{appName:i.appName,appSlug:i.appSlug,appId:i.appId,appType:i.appType,subtype:i.subtype,platformSlug:i.platformSlug,clientId:i.clientId,dpopKid:zr(e)?.kid??"",filled:!1};let c=zr(e)??ki();return au(e),M$(e,{clientId:i.clientId,hmacSecret:s??"",appId:i.appId,apiUrl:t.apiUrl,edgeUrl:t.edgeUrl,dpop:c}),F$(e,{clientId:i.clientId,hmacSecret:s??"",appId:i.appId,appSlug:i.appSlug,dpop:c}),t.env&&wv(e,t.env),bv(e,i.appSlug,i.appName),{appName:i.appName,appSlug:i.appSlug,appId:i.appId,appType:i.appType,subtype:i.subtype,platformSlug:i.platformSlug,clientId:i.clientId,dpopKid:c.kid,filled:!0}}a(Ti,"connectProject");function Ai(e){return[`App: ${e.appName} (${e.appSlug})`,`Client: ${e.clientId}`,`DPoP key: ${e.dpopKid||"(none registered)"}`,e.filled?"Real credentials written to .env + .npayload.json.":"Credentials already present \u2014 reconciled to the same state."]}a(Ai,"connectedSummaryLines");function wv(e,t){let r=t.trim();if(!r)return;let o=Vr(e,".npayload.json"),n={};if(Zr(o))try{n=JSON.parse(Gr(o,"utf8"))}catch{n={}}n.targetEnv!==r&&U$(o,JSON.stringify({...n,targetEnv:r},null,2)+`
|
|
213
|
+
`,{encoding:"utf8",mode:384})}a(wv,"persistTargetEnv");function L$(e){let t=Vr(e,".npayload.json");if(Zr(t))try{let o=JSON.parse(Gr(t,"utf8"));if(!un(o.clientId)&&!un(o.hmacSecret))return!0}catch{}let r=Vr(e,".env");if(Zr(r)){let o=z$(Gr(r,"utf8"));if(!un(o.NPAYLOAD_CLIENT_ID)&&!un(o.NPAYLOAD_HMAC_SECRET))return!0}return!1}a(L$,"projectHasRealCredentials");function z$(e){let t={};for(let r of e.split(`
|
|
214
|
+
`)){let o=r.trim();if(!o||o.startsWith("#"))continue;let n=o.indexOf("=");n<=0||(t[o.slice(0,n).trim()]=o.slice(n+1))}return t}a(z$,"readEnvVars");function M$(e,t){let r=Vr(e,".env"),o=Zr(r)?Gr(r,"utf8"):void 0,n={NPAYLOAD_CLIENT_ID:t.clientId,NPAYLOAD_HMAC_SECRET:t.hmacSecret,NPAYLOAD_APP_ID:t.appId,NPAYLOAD_DPOP_KID:t.dpop.kid,NPAYLOAD_DPOP_PRIVATE_JWK:JSON.stringify(t.dpop.privateJwk)};if(t.apiUrl&&(n.NPAYLOAD_API_URL=t.apiUrl),t.edgeUrl&&(n.NPAYLOAD_EDGE_URL=t.edgeUrl),o===void 0){let d=Object.entries(n).map(([f,p])=>`${f}=${p}`).join(`
|
|
215
|
+
`);Xe(r,d+`
|
|
217
216
|
`);return}let i=o.split(`
|
|
218
|
-
`),s=new Set,c=i.map(d=>{let
|
|
219
|
-
`);
|
|
220
|
-
`)||(
|
|
221
|
-
`),u
|
|
217
|
+
`),s=new Set,c=i.map(d=>{let f=d.indexOf("=");if(f<=0||d.trim().startsWith("#"))return d;let p=d.slice(0,f).trim();return p in n?(s.add(p),`${p}=${n[p]}`):d}),u=Object.entries(n).filter(([d])=>!s.has(d)),l=c.join(`
|
|
218
|
+
`);u.length>0&&(l.endsWith(`
|
|
219
|
+
`)||(l+=`
|
|
220
|
+
`),l+=u.map(([d,f])=>`${d}=${f}`).join(`
|
|
222
221
|
`)+`
|
|
223
|
-
`),
|
|
224
|
-
`)}a(
|
|
222
|
+
`),Xe(r,l)}a(M$,"fillEnv");function F$(e,t){let r=Vr(e,".npayload.json"),o={};if(Zr(r))try{o=JSON.parse(Gr(r,"utf8"))}catch{o={}}let n={...o,clientId:t.clientId,hmacSecret:t.hmacSecret,...t.appId?{appId:t.appId}:{},...t.appSlug?{appSlug:t.appSlug}:{},dpopKid:t.dpop.kid,dpopPrivateJwk:t.dpop.privateJwk,dpopPublicJwk:t.dpop.publicJwk};Xe(r,JSON.stringify(n,null,2)+`
|
|
223
|
+
`)}a(F$,"fillProjectCredentials");import{existsSync as tt,readFileSync as q$}from"fs";import{join as nt}from"path";function kv(e=process.cwd()){let t=nt(e,"package.json");if(!tt(t))return"node";let r={};try{let o=JSON.parse(q$(t,"utf8"));r={...o.dependencies,...o.devDependencies}}catch{return"node"}return r.next?"nextjs":r["@remix-run/react"]||r["@remix-run/node"]||r["@remix-run/server-runtime"]?"remix":r.hono?"hono":r.express?"express":r.react?"react":"node"}a(kv,"detectFramework");function xv(e=process.cwd()){let t=process.env.npm_config_user_agent??"";return t.startsWith("bun")?"bun":t.startsWith("pnpm")?"pnpm":t.startsWith("yarn")?"yarn":tt(nt(e,"bun.lock"))||tt(nt(e,"bun.lockb"))?"bun":tt(nt(e,"pnpm-lock.yaml"))?"pnpm":tt(nt(e,"yarn.lock"))?"yarn":"npm"}a(xv,"detectPackageManager");function _v(e=process.cwd()){return tt(nt(e,"package.json"))}a(_v,"hasPackageJson");function Ci(e=process.cwd()){return{hasNpayloadDir:tt(nt(e,"npayload")),hasConfig:tt(nt(e,"npayload.config.ts"))||tt(nt(e,"npayload.config.js")),hasProjectCreds:tt(nt(e,".npayload.json")),hasEnv:tt(nt(e,".env"))}}a(Ci,"detectExistingSetup");function $v(e,t){switch(e){case"bun":return`bun add ${t}`;case"pnpm":return`pnpm add ${t}`;case"yarn":return`yarn add ${t}`;default:return`npm install ${t} --no-audit --no-fund --loglevel=error`}}a($v,"getInstallCommand");import{spawn as Z$}from"child_process";import{readFileSync as G$,writeFileSync as V$}from"fs";import{join as B$}from"path";var K$={"npayload:listen":"npayload listen","npayload:promote":"npayload promote create"};async function Sv(e,t,r,o,n){let i=$v(e,t.join(" ")),s={...process.env};if(o)for(let c of Object.keys(s))/^npm_config_.*registry$/i.test(c)&&delete s[c];await new Promise((c,u)=>{let l=Z$(i,{cwd:r,env:s,shell:!0,stdio:["ignore","pipe","pipe"]}),d=a(f=>{if(n)for(let p of f.toString().split(/\r?\n/)){let m=p.trim();m&&n(m)}},"feed");l.stdout?.on("data",d),l.stderr?.on("data",d),l.on("error",u),l.on("close",f=>f===0?c():u(new Error(`${e} install exited with code ${f}`)))})}a(Sv,"installDependencies");function Iv(e){let t=B$(e,"package.json"),r=G$(t,"utf8"),o=JSON.parse(r),n=o.scripts??{},i=[];for(let[c,u]of Object.entries(K$))c in n||(n[c]=u,i.push(c));o.scripts=n,o.type===void 0&&(o.type="module",i.push('type: "module"'));let s=r.startsWith(`{
|
|
225
224
|
`)?2:r.startsWith(`{
|
|
226
|
-
`)?" ":2;return
|
|
227
|
-
`,"utf8"),i}a(
|
|
228
|
-
Install skipped (--skip-install)`));else{console.log();let
|
|
229
|
-
`))}else
|
|
230
|
-
`),t(1)})}),"forward"),exit:a(e=>{process.exitCode=e},"exit")},
|
|
231
|
-
`}:(r.push(o),{v2Args:["connect","grants",o,...t.slice(1)],invoked:`np federation ${r.join(" ")}`,target:`np connect grants ${o}`})}a(
|
|
232
|
-
`),
|
|
233
|
-
After 6 months post-GA this command exits non-zero; set NPAYLOAD_FEDERATION_HARD_FAIL=1 to opt in early. ${
|
|
234
|
-
`),dn.exit(await dn.forward(n.v2Args))})}a(Yy,"registerFederation");var Re="1.36.1";var pt=[],Fe=[],G_=Uint8Array,Jc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pn=0,Qy=Jc.length;pn<Qy;++pn)pt[pn]=Jc[pn],Fe[Jc.charCodeAt(pn)]=pn;var pn,Qy;Fe[45]=62;Fe[95]=63;function V_(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}a(V_,"getLens");function B_(e,t,r){return(t+r)*3/4-r}a(B_,"_byteLength");function zr(e){var t,r=V_(e),o=r[0],n=r[1],i=new G_(B_(e,o,n)),s=0,c=n>0?o-4:o,l;for(l=0;l<c;l+=4)t=Fe[e.charCodeAt(l)]<<18|Fe[e.charCodeAt(l+1)]<<12|Fe[e.charCodeAt(l+2)]<<6|Fe[e.charCodeAt(l+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return n===2&&(t=Fe[e.charCodeAt(l)]<<2|Fe[e.charCodeAt(l+1)]>>4,i[s++]=t&255),n===1&&(t=Fe[e.charCodeAt(l)]<<10|Fe[e.charCodeAt(l+1)]<<4|Fe[e.charCodeAt(l+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}a(zr,"toByteArray");function J_(e){return pt[e>>18&63]+pt[e>>12&63]+pt[e>>6&63]+pt[e&63]}a(J_,"tripletToBase64");function K_(e,t,r){for(var o,n=[],i=t;i<r;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),n.push(J_(o));return n.join("")}a(K_,"encodeChunk");function Mr(e){for(var t,r=e.length,o=r%3,n=[],i=16383,s=0,c=r-o;s<c;s+=i)n.push(K_(e,s,s+i>c?c:s+i));return o===1?(t=e[r-1],n.push(pt[t>>2]+pt[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],n.push(pt[t>>10]+pt[t>>4&63]+pt[t<<2&63]+"=")),n.join("")}a(Mr,"fromByteArray");function Ze(e){if(e===void 0)return{};if(!xi(e))throw new Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}a(Ze,"parseArgs");function Dn(e){if(typeof e>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof e!="string")throw new Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw new Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}a(Dn,"validateDeploymentUrl");function xi(e){let t=typeof e=="object",r=Object.getPrototypeOf(e),o=r===null||r===Object.prototype||r?.constructor?.name==="Object";return t&&o}a(xi,"isSimpleObject");var tv=!0,jn=BigInt("-9223372036854775808"),Qc=BigInt("9223372036854775807"),Hc=BigInt("0"),W_=BigInt("8"),H_=BigInt("256");function nv(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}a(nv,"isSpecial");function Y_(e){e<Hc&&(e-=jn+jn);let t=e.toString(16);t.length%2===1&&(t="0"+t);let r=new Uint8Array(new ArrayBuffer(8)),o=0;for(let n of t.match(/.{2}/g).reverse())r.set([parseInt(n,16)],o++),e>>=W_;return Mr(r)}a(Y_,"slowBigIntToBase64");function Q_(e){let t=zr(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let r=Hc,o=Hc;for(let n of t)r+=BigInt(n)*H_**o,o++;return r>Qc&&(r+=jn+jn),r}a(Q_,"slowBase64ToBigInt");function X_(e){if(e<jn||Qc<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),Mr(new Uint8Array(t))}a(X_,"modernBigIntToBase64");function e$(e){let t=zr(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}a(e$,"modernBase64ToBigInt");var t$=DataView.prototype.setBigInt64?X_:Y_,n$=DataView.prototype.getBigInt64?e$:Q_,Xy=1024;function Yc(e){if(e.length>Xy)throw new Error(`Field name ${e} exceeds maximum field name length ${Xy}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r<32||r>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}a(Yc,"validateObjectField");function he(e){if(e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(Array.isArray(e))return e.map(o=>he(o));if(typeof e!="object")throw new Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(t.length===1){let o=t[0][0];if(o==="$bytes"){if(typeof e.$bytes!="string")throw new Error(`Malformed $bytes field on ${e}`);return zr(e.$bytes).buffer}if(o==="$integer"){if(typeof e.$integer!="string")throw new Error(`Malformed $integer field on ${e}`);return n$(e.$integer)}if(o==="$float"){if(typeof e.$float!="string")throw new Error(`Malformed $float field on ${e}`);let n=zr(e.$float);if(n.byteLength!==8)throw new Error(`Received ${n.byteLength} bytes, expected 8 for $float`);let s=new DataView(n.buffer).getFloat64(0,tv);if(!nv(s))throw new Error(`Float ${s} should be encoded as a number`);return s}if(o==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(o==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}let r={};for(let[o,n]of Object.entries(e))Yc(o),r[o]=he(n);return r}a(he,"jsonToConvex");var ev=16384;function mn(e){let t=JSON.stringify(e,(r,o)=>o===void 0?"undefined":typeof o=="bigint"?`${o.toString()}n`:o);if(t.length>ev){let r="[...truncated]",o=ev-r.length,n=t.codePointAt(o-1);return n!==void 0&&n>65535&&(o-=1),t.substring(0,o)+r}return t}a(mn,"stringifyValueForError");function ki(e,t,r,o){if(e===void 0){let s=r&&` (present at path ${r} in original object ${mn(t)})`;throw new Error(`undefined is not a valid Convex value${s}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<jn||Qc<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:t$(e)}}if(typeof e=="number")if(nv(e)){let s=new ArrayBuffer(8);return new DataView(s).setFloat64(0,e,tv),{$float:Mr(new Uint8Array(s))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:Mr(new Uint8Array(e))};if(Array.isArray(e))return e.map((s,c)=>ki(s,t,r+`[${c}]`,!1));if(e instanceof Set)throw new Error(Wc(r,"Set",[...e],t));if(e instanceof Map)throw new Error(Wc(r,"Map",[...e],t));if(!xi(e)){let s=e?.constructor?.name,c=s?`${s} `:"";throw new Error(Wc(r,c,e,t))}let n={},i=Object.entries(e);i.sort(([s,c],[l,u])=>s===l?0:s<l?-1:1);for(let[s,c]of i)c!==void 0?(Yc(s),n[s]=ki(c,t,r+`.${s}`,!1)):o&&(Yc(s),n[s]=r$(c,t,r+`.${s}`));return n}a(ki,"convexToJsonInternal");function Wc(e,t,r,o){return e?`${t}${mn(r)} is not a supported Convex type (present at path ${e} in original object ${mn(o)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${mn(r)} is not a supported Convex type.`}a(Wc,"errorMessageForUnsupportedType");function r$(e,t,r){if(e===void 0)return{$undefined:null};if(t===void 0)throw new Error(`Programming error. Current value is ${mn(e)} but original value is undefined`);return ki(e,t,r,!1)}a(r$,"convexOrUndefinedToJsonInternal");function ye(e){return ki(e,e,"",!1)}a(ye,"convexToJson");var o$=Object.defineProperty,i$=a((e,t,r)=>t in e?o$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),oe=a((e,t,r)=>i$(e,typeof t!="symbol"?t+"":t,r),"__publicField"),s$="https://docs.convex.dev/error#undefined-validator";function qr(e,t){let r=t!==void 0?` for field "${t}"`:"";throw new Error(`A validator is undefined${r} in ${e}. This is often caused by circular imports. See ${s$} for details.`)}a(qr,"throwUndefinedValidatorError");var Pe=class{static{a(this,"BaseValidator")}constructor({isOptional:t}){oe(this,"type"),oe(this,"fieldPaths"),oe(this,"isOptional"),oe(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}},_i=class e extends Pe{static{a(this,"VId")}constructor({isOptional:t,tableName:r}){if(super({isOptional:t}),oe(this,"tableName"),oe(this,"kind","id"),typeof r!="string")throw new Error("v.id(tableName) requires a string");this.tableName=r}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new e({isOptional:"optional",tableName:this.tableName})}},Fr=class e extends Pe{static{a(this,"VFloat64")}constructor(){super(...arguments),oe(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new e({isOptional:"optional"})}},Zr=class e extends Pe{static{a(this,"VInt64")}constructor(){super(...arguments),oe(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new e({isOptional:"optional"})}},$i=class e extends Pe{static{a(this,"VBoolean")}constructor(){super(...arguments),oe(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Si=class e extends Pe{static{a(this,"VBytes")}constructor(){super(...arguments),oe(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Ii=class e extends Pe{static{a(this,"VString")}constructor(){super(...arguments),oe(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Pi=class e extends Pe{static{a(this,"VNull")}constructor(){super(...arguments),oe(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Ei=class e extends Pe{static{a(this,"VAny")}constructor(){super(...arguments),oe(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Ti=class e extends Pe{static{a(this,"VObject")}constructor({isOptional:t,fields:r}){super({isOptional:t}),oe(this,"fields"),oe(this,"kind","object"),globalThis.Object.entries(r).forEach(([o,n])=>{if(n===void 0&&qr("v.object()",o),!n.isConvexValidator)throw new Error("v.object() entries must be validators")}),this.fields=r}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,r])=>[t,{fieldType:r.json,optional:r.isOptional==="optional"}]))}}asOptional(){return new e({isOptional:"optional",fields:this.fields})}omit(...t){let r={...this.fields};for(let o of t)delete r[o];return new e({isOptional:this.isOptional,fields:r})}pick(...t){let r={};for(let o of t)r[o]=this.fields[o];return new e({isOptional:this.isOptional,fields:r})}partial(){let t={};for(let[r,o]of globalThis.Object.entries(this.fields))t[r]=o.asOptional();return new e({isOptional:this.isOptional,fields:t})}extend(t){return new e({isOptional:this.isOptional,fields:{...this.fields,...t}})}},Ai=class e extends Pe{static{a(this,"VLiteral")}constructor({isOptional:t,value:r}){if(super({isOptional:t}),oe(this,"value"),oe(this,"kind","literal"),typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"&&typeof r!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=r}get json(){return{type:this.kind,value:ye(this.value)}}asOptional(){return new e({isOptional:"optional",value:this.value})}},Ci=class e extends Pe{static{a(this,"VArray")}constructor({isOptional:t,element:r}){super({isOptional:t}),oe(this,"element"),oe(this,"kind","array"),r===void 0&&qr("v.array()"),this.element=r}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new e({isOptional:"optional",element:this.element})}},Ri=class e extends Pe{static{a(this,"VRecord")}constructor({isOptional:t,key:r,value:o}){if(super({isOptional:t}),oe(this,"key"),oe(this,"value"),oe(this,"kind","record"),r===void 0&&qr("v.record()","key"),o===void 0&&qr("v.record()","value"),r.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(o.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!r.isConvexValidator||!o.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=r,this.value=o}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new e({isOptional:"optional",key:this.key,value:this.value})}},Oi=class e extends Pe{static{a(this,"VUnion")}constructor({isOptional:t,members:r}){super({isOptional:t}),oe(this,"members"),oe(this,"kind","union"),r.forEach((o,n)=>{if(o===void 0&&qr("v.union()",`member at index ${n}`),!o.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=r}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new e({isOptional:"optional",members:this.members})}};function rv(e){return!!e.isConvexValidator}a(rv,"isValidator");var F={id:a(e=>new _i({isOptional:"required",tableName:e}),"id"),null:a(()=>new Pi({isOptional:"required"}),"null"),number:a(()=>new Fr({isOptional:"required"}),"number"),float64:a(()=>new Fr({isOptional:"required"}),"float64"),bigint:a(()=>new Zr({isOptional:"required"}),"bigint"),int64:a(()=>new Zr({isOptional:"required"}),"int64"),boolean:a(()=>new $i({isOptional:"required"}),"boolean"),string:a(()=>new Ii({isOptional:"required"}),"string"),bytes:a(()=>new Si({isOptional:"required"}),"bytes"),literal:a(e=>new Ai({isOptional:"required",value:e}),"literal"),array:a(e=>new Ci({isOptional:"required",element:e}),"array"),object:a(e=>new Ti({isOptional:"required",fields:e}),"object"),record:a((e,t)=>new Ri({isOptional:"required",key:e,value:t}),"record"),union:a((...e)=>new Oi({isOptional:"required",members:e}),"union"),any:a(()=>new Ei({isOptional:"required"}),"any"),optional:a(e=>e.asOptional(),"optional"),nullable:a(e=>F.union(e,F.null()),"nullable")};var a$=Object.defineProperty,c$=a((e,t,r)=>t in e?a$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Xc=a((e,t,r)=>c$(e,typeof t!="symbol"?t+"":t,r),"__publicField"),ov,iv,l$=Symbol.for("ConvexError"),mt=class extends(iv=Error,ov=l$,iv){static{a(this,"ConvexError")}constructor(t){super(typeof t=="string"?t:mn(t)),Xc(this,"name","ConvexError"),Xc(this,"data"),Xc(this,ov,!0),this.data=t}};var sv=a(()=>Array.from({length:4},()=>0),"arr"),bN=sv(),wN=sv();var d$=Object.defineProperty,p$=a((e,t,r)=>t in e?d$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),av=a((e,t,r)=>p$(e,typeof t!="symbol"?t+"":t,r),"__publicField"),m$="color:rgb(0, 145, 255)";function f$(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}a(f$,"prefix_for_source");var Ni=class{static{a(this,"DefaultLogger")}constructor(t){av(this,"_onLogLineFuncs"),av(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let r=Math.random().toString(36).substring(2,15);for(let o=0;o<10&&this._onLogLineFuncs[r]!==void 0;o++)r=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[r]=t,()=>{delete this._onLogLineFuncs[r]}}logVerbose(...t){if(this._verbose)for(let r of Object.values(this._onLogLineFuncs))r("debug",`${new Date().toISOString()}`,...t)}log(...t){for(let r of Object.values(this._onLogLineFuncs))r("info",...t)}warn(...t){for(let r of Object.values(this._onLogLineFuncs))r("warn",...t)}error(...t){for(let r of Object.values(this._onLogLineFuncs))r("error",...t)}};function el(e){let t=new Ni(e);return t.addLogLineListener((r,...o)=>{switch(r){case"debug":console.debug(...o);break;case"info":console.log(...o);break;case"warn":console.warn(...o);break;case"error":console.error(...o);break;default:console.log(...o)}}),t}a(el,"instantiateDefaultLogger");function tl(e){return new Ni(e)}a(tl,"instantiateNoopLogger");function fn(e,t,r,o,n){let i=f$(r);if(typeof n=="object"&&(n=`ConvexError ${JSON.stringify(n.errorData,null,2)}`),t==="info"){let s=n.match(/^\[.*?\] /);if(s===null){e.error(`[CONVEX ${i}(${o})] Could not parse console.log`);return}let c=n.slice(1,s[0].length-2),l=n.slice(s[0].length);e.log(`%c[CONVEX ${i}(${o})] [${c}]`,m$,l)}else e.error(`[CONVEX ${i}(${o})] ${n}`)}a(fn,"logForFunction");var gn=Symbol.for("functionName");var uv=Symbol.for("toReferencePath");function g$(e){return e[uv]??null}a(g$,"extractReferencePath");function h$(e){return e.startsWith("function://")}a(h$,"isFunctionHandle");function jt(e){let t;if(typeof e=="string")h$(e)?t={functionHandle:e}:t={name:e};else if(e[gn])t={name:e[gn]};else{let r=g$(e);if(!r)throw new Error(`${e} is not a functionReference`);t={reference:r}}return t}a(jt,"getFunctionAddress");function ft(e){let t=jt(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;let r=e[gn];if(!r)throw new Error(`${e} is not a functionReference`);return r}a(ft,"getFunctionName");function Gr(e){return{[gn]:e}}a(Gr,"makeFunctionReference");function dv(e=[]){let t={get(r,o){if(typeof o=="string"){let n=[...e,o];return dv(n)}else if(o===gn){if(e.length<2){let s=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${s}\``)}let n=e.slice(0,-1).join("/"),i=e[e.length-1];return i==="default"?n:n+":"+i}else return o===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}a(dv,"createApi");var y$=dv();var w$=Object.defineProperty,x$=a((e,t,r)=>t in e?w$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),nl=a((e,t,r)=>x$(e,typeof t!="symbol"?t+"":t,r),"__publicField"),hn=class e{static{a(this,"Long")}constructor(t,r){nl(this,"low"),nl(this,"high"),nl(this,"__isUnsignedLong__"),this.low=t|0,this.high=r|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){let t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?pv:t>=k$?_$:new e(t%Vr|0,t/Vr|0)}toString(){return(BigInt(this.high)*BigInt(Vr)+BigInt(this.low)).toString()}equals(t){return e.isLong(t)||(t=e.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return e.isLong(t)||(t=e.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?e.fromNumber(t):new e(t.low,t.high)}},pv=new hn(0,0),mv=65536,Vr=mv*mv,k$=Vr*Vr,_$=new hn(-1,-1);var rl=class extends Error{static{a(this,"InvalidTokenError")}};rl.prototype.name="InvalidTokenError";var ND=480*60*60*1e3;var I$=Object.defineProperty,P$=a((e,t,r)=>t in e?I$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),gt=a((e,t,r)=>P$(e,typeof t!="symbol"?t+"":t,r),"__publicField");var Di=560,Br;var Jr=class{static{a(this,"ConvexHttpClient")}constructor(t,r){if(gt(this,"address"),gt(this,"auth"),gt(this,"adminAuth"),gt(this,"encodedTsPromise"),gt(this,"debug"),gt(this,"fetchOptions"),gt(this,"fetch"),gt(this,"logger"),gt(this,"mutationQueue",[]),gt(this,"isProcessingQueue",!1),typeof r=="boolean")throw new Error("skipConvexDeploymentUrlCheck as the second argument is no longer supported. Please pass an options object, `{ skipConvexDeploymentUrlCheck: true }`.");(r??{}).skipConvexDeploymentUrlCheck!==!0&&Dn(t),this.logger=r?.logger===!1?tl({verbose:!1}):r?.logger!==!0&&r?.logger?r.logger:el({verbose:!1}),this.address=t,this.debug=!0,this.auth=void 0,this.adminAuth=void 0,this.fetch=r?.fetch,r?.auth&&this.setAuth(r.auth)}backendUrl(){return`${this.address}/api`}get url(){return this.address}setAuth(t){this.clearAuth(),this.auth=t}setAdminAuth(t,r){if(this.clearAuth(),r!==void 0){let o=new TextEncoder().encode(JSON.stringify(r)),n=btoa(String.fromCodePoint(...o));this.adminAuth=`${t}:${n}`}else this.adminAuth=t}clearAuth(){this.auth=void 0,this.adminAuth=void 0}setDebug(t){this.debug=t}setFetchOptions(t){this.fetchOptions=t}async consistentQuery(t,...r){let o=Ze(r[0]),n=this.getTimestamp();return await this.queryInner(t,o,{timestampPromise:n})}async getTimestamp(){return this.encodedTsPromise?this.encodedTsPromise:this.encodedTsPromise=this.getTimestampInner()}async getTimestampInner(){let t=this.fetch||Br||fetch,r={"Content-Type":"application/json","Convex-Client":`npm-${Re}`},o=await t(`${this.address}/api/query_ts`,{...this.fetchOptions,method:"POST",headers:r});if(!o.ok)throw new Error(await o.text());let{ts:n}=await o.json();return n}async query(t,...r){let o=Ze(r[0]);return await this.queryInner(t,o,{})}async queryInner(t,r,o){let n=ft(t),i=[ye(r)],s={"Content-Type":"application/json","Convex-Client":`npm-${Re}`};this.adminAuth?s.Authorization=`Convex ${this.adminAuth}`:this.auth&&(s.Authorization=`Bearer ${this.auth}`);let c=this.fetch||Br||fetch,l=o.timestampPromise?await o.timestampPromise:void 0,u=JSON.stringify({path:n,format:"convex_encoded_json",args:i,...l?{ts:l}:{}}),d=l?`${this.address}/api/query_at_ts`:`${this.address}/api/query`,m=await c(d,{...this.fetchOptions,body:u,method:"POST",headers:s});if(!m.ok&&m.status!==Di)throw new Error(await m.text());let p=await m.json();if(this.debug)for(let f of p.logLines??[])fn(this.logger,"info","query",n,f);switch(p.status){case"success":return he(p.value);case"error":throw p.errorData!==void 0?ji(p.errorData,new mt(p.errorMessage)):new Error(p.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(p)}`)}}async mutationInner(t,r){let o=ft(t),n=JSON.stringify({path:o,format:"convex_encoded_json",args:[ye(r)]}),i={"Content-Type":"application/json","Convex-Client":`npm-${Re}`};this.adminAuth?i.Authorization=`Convex ${this.adminAuth}`:this.auth&&(i.Authorization=`Bearer ${this.auth}`);let c=await(this.fetch||Br||fetch)(`${this.address}/api/mutation`,{...this.fetchOptions,body:n,method:"POST",headers:i});if(!c.ok&&c.status!==Di)throw new Error(await c.text());let l=await c.json();if(this.debug)for(let u of l.logLines??[])fn(this.logger,"info","mutation",o,u);switch(l.status){case"success":return he(l.value);case"error":throw l.errorData!==void 0?ji(l.errorData,new mt(l.errorMessage)):new Error(l.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(l)}`)}}async processMutationQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;this.mutationQueue.length>0;){let{mutation:t,args:r,resolve:o,reject:n}=this.mutationQueue.shift();try{let i=await this.mutationInner(t,r);o(i)}catch(i){n(i)}}this.isProcessingQueue=!1}}enqueueMutation(t,r){return new Promise((o,n)=>{this.mutationQueue.push({mutation:t,args:r,resolve:o,reject:n}),this.processMutationQueue()})}async mutation(t,...r){let[o,n]=r,i=Ze(o);return n?.skipQueue?await this.mutationInner(t,i):await this.enqueueMutation(t,i)}async action(t,...r){let o=Ze(r[0]),n=ft(t),i=JSON.stringify({path:n,format:"convex_encoded_json",args:[ye(o)]}),s={"Content-Type":"application/json","Convex-Client":`npm-${Re}`};this.adminAuth?s.Authorization=`Convex ${this.adminAuth}`:this.auth&&(s.Authorization=`Bearer ${this.auth}`);let l=await(this.fetch||Br||fetch)(`${this.address}/api/action`,{...this.fetchOptions,body:i,method:"POST",headers:s});if(!l.ok&&l.status!==Di)throw new Error(await l.text());let u=await l.json();if(this.debug)for(let d of u.logLines??[])fn(this.logger,"info","action",n,d);switch(u.status){case"success":return he(u.value);case"error":throw u.errorData!==void 0?ji(u.errorData,new mt(u.errorMessage)):new Error(u.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(u)}`)}}async function(t,r,...o){let n=Ze(o[0]),i=typeof t=="string"?t:ft(t),s=JSON.stringify({componentPath:r,path:i,format:"convex_encoded_json",args:ye(n)}),c={"Content-Type":"application/json","Convex-Client":`npm-${Re}`};this.adminAuth?c.Authorization=`Convex ${this.adminAuth}`:this.auth&&(c.Authorization=`Bearer ${this.auth}`);let u=await(this.fetch||Br||fetch)(`${this.address}/api/function`,{...this.fetchOptions,body:s,method:"POST",headers:c});if(!u.ok&&u.status!==Di)throw new Error(await u.text());let d=await u.json();if(this.debug)for(let m of d.logLines??[])fn(this.logger,"info","any",i,m);switch(d.status){case"success":return he(d.value);case"error":throw d.errorData!==void 0?ji(d.errorData,new mt(d.errorMessage)):new Error(d.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(d)}`)}}};function ji(e,t){return t.data=he(e),t}a(ji,"forwardErrorData");var nU=F.object({numItems:F.number(),cursor:F.union(F.string(),F.null()),endCursor:F.optional(F.union(F.string(),F.null())),id:F.optional(F.number()),maximumRowsRead:F.optional(F.number()),maximumBytesRead:F.optional(F.number())});var C$=Object.defineProperty,R$=a((e,t,r)=>t in e?C$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),ht=a((e,t,r)=>R$(e,typeof t!="symbol"?t+"":t,r),"__publicField"),Li=class{static{a(this,"TableDefinition")}constructor(t){ht(this,"indexes"),ht(this,"stagedDbIndexes"),ht(this,"searchIndexes"),ht(this,"stagedSearchIndexes"),ht(this,"vectorIndexes"),ht(this,"stagedVectorIndexes"),ht(this,"validator"),this.indexes=[],this.stagedDbIndexes=[],this.searchIndexes=[],this.stagedSearchIndexes=[],this.vectorIndexes=[],this.stagedVectorIndexes=[],this.validator=t}" indexes"(){return this.indexes}index(t,r){return Array.isArray(r)?this.indexes.push({indexDescriptor:t,fields:r}):r.staged?this.stagedDbIndexes.push({indexDescriptor:t,fields:r.fields}):this.indexes.push({indexDescriptor:t,fields:r.fields}),this}searchIndex(t,r){return r.staged?this.stagedSearchIndexes.push({indexDescriptor:t,searchField:r.searchField,filterFields:r.filterFields||[]}):this.searchIndexes.push({indexDescriptor:t,searchField:r.searchField,filterFields:r.filterFields||[]}),this}vectorIndex(t,r){return r.staged?this.stagedVectorIndexes.push({indexDescriptor:t,vectorField:r.vectorField,dimensions:r.dimensions,filterFields:r.filterFields||[]}):this.vectorIndexes.push({indexDescriptor:t,vectorField:r.vectorField,dimensions:r.dimensions,filterFields:r.filterFields||[]}),this}self(){return this}export(){let t=this.validator.json;if(typeof t!="object")throw new Error("Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)");return{indexes:this.indexes,stagedDbIndexes:this.stagedDbIndexes,searchIndexes:this.searchIndexes,stagedSearchIndexes:this.stagedSearchIndexes,vectorIndexes:this.vectorIndexes,stagedVectorIndexes:this.stagedVectorIndexes,documentType:t}}};function il(e){return rv(e)?new Li(e):new Li(F.object(e))}a(il,"defineTable");var sl=class{static{a(this,"SchemaDefinition")}constructor(t,r){ht(this,"tables"),ht(this,"strictTableNameTypes"),ht(this,"schemaValidation"),this.tables=t,this.schemaValidation=r?.schemaValidation===void 0?!0:r.schemaValidation}export(){return JSON.stringify({tables:Object.entries(this.tables).map(([t,r])=>{let{indexes:o,stagedDbIndexes:n,searchIndexes:i,stagedSearchIndexes:s,vectorIndexes:c,stagedVectorIndexes:l,documentType:u}=r.export();return{tableName:t,indexes:o,stagedDbIndexes:n,searchIndexes:i,stagedSearchIndexes:s,vectorIndexes:c,stagedVectorIndexes:l,documentType:u}}),schemaValidation:this.schemaValidation})}};function fv(e,t){return new sl(e,t)}a(fv,"defineSchema");var kU=fv({_scheduled_functions:il({name:F.string(),args:F.array(F.any()),scheduledTime:F.float64(),completedTime:F.optional(F.float64()),state:F.union(F.object({kind:F.literal("pending")}),F.object({kind:F.literal("inProgress")}),F.object({kind:F.literal("success")}),F.object({kind:F.literal("failed"),error:F.string()}),F.object({kind:F.literal("canceled")}))}),_storage:il({sha256:F.string(),size:F.float64(),contentType:F.optional(F.string())})});async function gv(e,...t){let[r,o]=t;return al(o??{}).query(e,r||{})}a(gv,"fetchQuery");async function hv(e,...t){let[r,o]=t;return al(o??{}).mutation(e,r||{})}a(hv,"fetchMutation");async function yv(e,...t){let[r,o]=t;return al(o??{}).action(e,r||{})}a(yv,"fetchAction");function al(e){"url"in e&&e.url===void 0&&console.error("deploymentUrl is undefined, are your environment variables set? In the future explicitly passing undefined will cause an error. To explicitly use the default, pass `process.env.NEXT_PUBLIC_CONVEX_URL`.");let t=new Jr(O$(e.url,e.skipConvexDeploymentUrlCheck??!1));return e.token!==void 0&&t.setAuth(e.token),e.adminToken!==void 0&&t.setAdminAuth(e.adminToken),t.setFetchOptions({cache:"no-store"}),t}a(al,"setupClient");function O$(e,t){let r=e??process.env.NEXT_PUBLIC_CONVEX_URL,o=e===void 0;if(typeof r!="string")throw new Error(o?"Environment variable NEXT_PUBLIC_CONVEX_URL is not set.":"Convex function called with invalid deployment address.");return t||Dn(r),r}a(O$,"getConvexUrl");var Lt={create:"",validate:"",drift:"",approve:"",execute:"",rollback:"",list:"",getJobWithSteps:""};async function N$(e){let t=globalThis.fetch,r=[],o=Nt(Me(),t),n=a((async(i,s)=>{try{return await o(i,s)}catch(c){throw c instanceof be&&r.push(c),c}}),"held");globalThis.fetch=n;try{return await e()}catch(i){throw r[0]??i}finally{globalThis.fetch===n&&(globalThis.fetch=t)}}a(N$,"underTheRunsFetch");function D$(){throw new C("`np promote` is no longer available: promotion to production was removed.",{code:"PROMOTION_UNAVAILABLE",hint:"Run `np deploy` from your pipeline to put your configuration in production."})}a(D$,"resolveAdminUrl");var tt=class e{constructor(t,r){this.url=t;this.token=r}static{a(this,"PromoteAdmin")}static async fromSession(){let t=D$(),r=await Mh();if(!r?.accessToken)throw new C("You are not signed in to the npayload Control Plane.",{code:"NOT_AUTHENTICATED",hint:"Run `npx @npayload/sdk init` or `np auth login` to sign in, then retry."});return Me().check(t),new e(t,r.accessToken)}async call(t){try{return await N$(()=>t({url:this.url,token:this.token}))}catch(r){throw M(r),j$(r)}}query(t,r){return this.call(o=>gv(Gr(t),r,o))}mutation(t,r){return this.call(o=>hv(Gr(t),r,o))}action(t,r){return this.call(o=>yv(Gr(t),r,o))}create(t){return this.mutation(Lt.create,{...t})}validate(t){return this.mutation(Lt.validate,{promotionId:t})}drift(t){return this.action(Lt.drift,{appId:t})}approve(t){return this.mutation(Lt.approve,{promotionId:t})}execute(t){return this.mutation(Lt.execute,{promotionId:t})}rollback(t){return this.mutation(Lt.rollback,{promotionId:t})}list(t){return this.query(Lt.list,t?{appId:t}:{})}getJobWithSteps(t){return this.query(Lt.getJobWithSteps,{promotionId:t})}};function j$(e){let t=e?.data;if(t!==null&&typeof t=="object"&&typeof t.kind=="string"){let r=t,o=typeof r.message=="string"&&r.message.length>0?r.message:e instanceof Error?e.message:r.kind;return new C(o,{code:r.kind,cause:e})}return e}a(j$,"adminRefusal");function yt(e,t){process.stdout.write(`${iy(e,t)}
|
|
235
|
-
`)}a(yt,"emit");function cl(e){let t=String(e.status??"").toLowerCase(),r=t==="succeeded"||t==="success"||t==="completed"?"succeeded":t==="failed"||t==="error"?"failed":t==="skipped"?"skipped":"running",o=e.resourceGid??e.resource??e.label??"resource";return{label:`${e.plane?`${String(e.plane)}: `:""}${String(o)}`,status:r,message:e.message?String(e.message):void 0}}a(cl,"toStepLine");async function vv(e,t,r,o={}){let n=o.intervalMs??1e3,i=Date.now()+(o.timeoutMs??600*1e3),s=0,c=null,l=new Set(["completed","failed","rolled_back","rolledback","cancelled"]);for(;;){c=await e.getJobWithSteps(t);let u=c?.steps??[];for(let m=s;m<u.length;m++){let p=cl(u[m]);r.start(p.label),r.finish(p)}s=u.length;let d=String(c?.promotion?.status??"").toLowerCase();if(l.has(d))break;if(Date.now()>i)throw new C("Timed out waiting for the promotion to finish.",{code:"PROMOTE_TIMEOUT",hint:`Check status with: np promote status ${t}`});await new Promise(m=>setTimeout(m,n))}return c}a(vv,"streamSteps");function bv(e){let t=e.command("promote").description("[DEPRECATED \u2014 use `np deploy`] promote a tested app's config sandbox\u2192production (snapshot \u2192 diff \u2192 approve \u2192 execute \u2192 rollback)");t.hook("preAction",()=>{process.stderr.write("\u26A0\uFE0F `np promote` is deprecated and the sandbox\u2192production clone is disabled. Use `np deploy` to push config to production (code is the source of truth).\n")}),t.command("create").description("snapshot the sandbox's configuration and open a promotion").requiredOption("--app <slug>","app slug or GID to promote").option("--from <env>","source environment","sandbox").option("--to <env>","target environment","production").option("--mode <clone|fresh>","snapshot mode","clone").option("--output <fmt>","human | table | json | yaml | ndjson").action(async r=>{try{let o=Pt(r.output),n=r.mode==="fresh"?"fresh":"clone",s=await(await tt.fromSession()).create({appId:r.app,fromEnv:r.from,toEnv:r.to,mode:n});yt(s,o)}catch(o){de(o)}}),t.command("run").description("one-shot promotion: create \u2192 validate \u2192 approve \u2192 execute, streaming the live step log. Requires --yes.").requiredOption("--app <slug>","app slug or GID to promote").option("--from <env>","source environment","sandbox").option("--to <env>","target environment","production").option("--mode <clone|fresh>","snapshot mode","clone").option("--yes","confirm non-interactive auto-approval of the full pipeline").option("--output <fmt>","human | table | json | yaml | ndjson").option("--no-follow","do not stream the live step log; return immediately").action(async r=>{try{let o=Pt(r.output);if(!r.yes)throw new C("`np promote run` auto-approves and executes the promotion. Re-run with --yes to confirm.",{code:"CONFIRMATION_REQUIRED",hint:"Or use the step-by-step flow: create \u2192 diff \u2192 approve \u2192 execute."});let n=r.mode==="fresh"?"fresh":"clone",i=await tt.fromSession(),s=new $c(o),l=(await i.create({appId:r.app,fromEnv:r.from,toEnv:r.to,mode:n})).promotionId;await i.validate(l),await i.approve(l);let u=await i.execute(l),d=null;if(r.follow!==!1)d=await vv(i,l,s);else{d=await i.getJobWithSteps(l);for(let v of d?.steps??[]){let h=cl(v);s.start(h.label),s.finish(h)}}let m=String(d?.promotion?.status??"").toLowerCase(),{cellRegistryId:p,...f}=u,g={promotionId:l,...f,status:d?.promotion?.status??null,steps:s.all()};yt(o==="human"?{promotionId:l,status:g.status}:g,o),(s.hasFailure()||m==="failed")&&(process.exitCode=1)}catch(o){de(o)}}),t.command("diff").description("run the validation pipeline and show the field-level diff vs production (read-only)").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Pt(o.output),i=await tt.fromSession();await i.validate(r);let s=await i.getJobWithSteps(r);if(!s)throw new C(`Promotion ${r} not found.`,{code:"PROMOTION_NOT_FOUND"});yt(s.promotion,n)}catch(n){de(n)}}),t.command("approve").description("record approval (production requires a second approver \u2014 4-eyes \u2014 on mesh+)").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Pt(o.output),s=await(await tt.fromSession()).approve(r);yt({promotionId:r,...s},n)}catch(n){de(n)}}),t.command("execute").description("apply the promotion and stream a live step log").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").option("--no-follow","do not stream the live step log; return immediately").action(async(r,o)=>{try{let n=Pt(o.output),i=await tt.fromSession(),s=new $c(n),c=await i.execute(r),l=null;if(o.follow!==!1)l=await vv(i,r,s);else{l=await i.getJobWithSteps(r);for(let f of l?.steps??[]){let g=cl(f);s.start(g.label),s.finish(g)}}let u=String(l?.promotion?.status??"").toLowerCase(),{cellRegistryId:d,...m}=c,p={promotionId:r,...m,status:l?.promotion?.status??null,steps:s.all()};yt(n==="human"?{promotionId:r,status:p.status}:p,n),(s.hasFailure()||u==="failed")&&(process.exitCode=1)}catch(n){de(n)}}),t.command("rollback").description("restore the prior production snapshot within the rollback window (default 30m)").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Pt(o.output),s=await(await tt.fromSession()).rollback(r);yt({promotionId:r,...s},n)}catch(n){de(n)}}),t.command("list").description("promotion history").option("--app <slug>","filter to one app slug or GID").option("--output <fmt>","human | table | json | yaml | ndjson").action(async r=>{try{let o=Pt(r.output),i=await(await tt.fromSession()).list(r.app);yt(i,o)}catch(o){de(o)}}),t.command("status").description("current job state + live steps").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Pt(o.output),s=await(await tt.fromSession()).getJobWithSteps(r);if(!s)throw new C(`Promotion ${r} not found.`,{code:"PROMOTION_NOT_FOUND"});yt(s,n)}catch(n){de(n)}})}a(bv,"registerPromote");import{createServer as q$}from"http";import te from"chalk";var L$=12e4,U$=["dev","listen","sync","tail"];function z$(e){return U$.includes(e)}a(z$,"isLongRunningVerb");function Ut(){let e,t=a(()=>{},"reject"),r=new Promise((o,n)=>{t=n});return r.catch(()=>{}),{onRefused:a(o=>{e??=o,t(o)},"onRefused"),ended:r,refusal:a(()=>e,"refusal")}}a(Ut,"heartbeatEnd");function M$(e,t,r={}){let o=r.intervalMs??L$,n=!1,i=!1,s=a(()=>{n||(n=!0,clearInterval(l))},"stop"),c=a(async()=>{if(!(n||i)){i=!0;try{await t.heartbeat(e)}catch(u){u instanceof be?(s(),r.onRefused?.(u)):qh(u)?(s(),r.onRevoked?.(u instanceof _r?u:new _r)):r.onTransientError?.(u)}finally{i=!1}}},"tick"),l=setInterval(()=>void c(),o);return l.unref?.(),c(),s}a(M$,"startHeartbeat");function zt(e,t,r={}){return!t||!z$(e)?()=>{}:M$(e,t,r)}a(zt,"maybeStartHeartbeat");async function ll(){let e=process.env.NPAYLOAD_CLIENT_ID,t=(process.env.NPAYLOAD_CLIENT_SECRET??process.env.NPAYLOAD_HMAC_SECRET)?.trim()||void 0,r;if(!e)try{let l=await $r();e=l.clientId,t=t??l.hmacSecret,r=l.dpopPrivateJwk}catch{}if(!e)throw new C("Not authenticated.",{code:"NOT_AUTHENTICATED",hint:"Run `npx @npayload/sdk init` (device flow), or export NPAYLOAD_CLIENT_ID + NPAYLOAD_HMAC_SECRET."});let{apiUrl:o,authUrl:n,guard:i}=kr(),s=ri({env:process.env,credentialKey:r})??(await Bo()).privateJwk,c=process.env.NPAYLOAD_APP_ID;return Qo({clientId:e,dpopPrivateJwk:s,baseUrl:o,...t!==void 0?{clientSecret:t}:{},...n!==void 0?{authUrl:n}:{},...c!==void 0?{appId:c}:{}},i)}a(ll,"resolveKernel");function F$(e){return/^(ch|chn)_/.test(e)}a(F$,"isChannelGid");async function ul(e,t,r){if(F$(t))return t;if(!r)throw new C(`Cannot resolve channel slug "${t}" without an app.`,{code:"NO_APP_FOR_SLUG",hint:"Pass --app <app_\u2026> (or set NPAYLOAD_APP_ID), or pass a channel GID directly as --channel ch_\u2026"});let o=await e.send({method:"GET",path:`/v1/apps/channels/by-slug/${encodeURIComponent(t)}`,scope:"events:read"}),n=o.gid??o.channelId??o.id??o._id;if(!n)throw new C(`Channel "${t}" not found in app ${r}.`,{code:"CHANNEL_NOT_FOUND",hint:"Create it first (publish/subscribe in the scaffold), or pass a channel GID with --channel ch_\u2026"});return n}a(ul,"resolveChannelGid");function Z$(e){return e.publicUrl?{url:e.publicUrl,note:"using --public-url"}:{url:`http://localhost:${e.port}/`,note:"localhost is not reachable from npayload's delivery: pass --public-url with a tunnel's address"}}a(Z$,"deliveryEndpointUrl");async function G$(e,t){let r=t.events&&t.events.length===1?t.events[0]:void 0,o={name:t.name,type:"webhook",endpoint:{url:t.endpointUrl}};r&&(o.subjectFilter=r);try{let n=await e.send({method:"POST",path:`/v1/channels/${encodeURIComponent(t.channelGid)}/subscriptions`,body:o,scope:"events:write"}),i=n.gid??n.subscriptionId??n.id??n._id;if(!i)throw new C("Subscription created but no id was returned.",{code:"SUBSCRIPTION_NO_ID",hint:"Cannot guarantee cleanup without an id \u2014 aborting. Check the cell create response."});return i}catch(n){M(n);let i=n instanceof Error?n.message:String(n);if(/already.?exists|ALREADY_EXISTS/i.test(i)){let s=await V$(e,t.channelGid,t.name);if(s)return s}throw n}}a(G$,"registerTempSubscription");async function V$(e,t,r){let o=await e.send({method:"GET",path:`/v1/channels/${encodeURIComponent(t)}/subscriptions`,scope:"events:read"}),i=(o.subscriptions??o.items??[]).find(c=>c.name===r);if(!i)return;let s=i.gid??i.subscriptionId??i.id??i._id;return typeof s=="string"?s:void 0}a(V$,"findSubscriptionByName");async function B$(e,t){await e.send({method:"DELETE",path:`/v1/subscriptions/${encodeURIComponent(t)}`,scope:"events:write"})}a(B$,"deleteSubscription");async function J$(e){let t=[];for await(let r of e)t.push(r);return Buffer.concat(t).toString("utf8")}a(J$,"readBody");async function K$(e,t,r){let o={"content-type":"application/json"};for(let i of["x-npayload-signature","x-webhook-signature","x-npayload-timestamp","x-npayload-event-type","x-npayload-delivery-id"]){let s=r[i];typeof s=="string"&&(o[i]=s)}return(await Nt(Me())(e,{method:"POST",headers:o,body:t})).status}a(K$,"forwardDelivery");function W$(e){let t=e.log??(r=>void process.stderr.write(`${r}
|
|
236
|
-
`));return
|
|
237
|
-
`);let
|
|
238
|
-
`)):
|
|
225
|
+
`)?" ":2;return V$(t,JSON.stringify(o,null,s)+`
|
|
226
|
+
`,"utf8"),i}a(Iv,"addScripts");function W$(e){try{let t=Ev(e,"node_modules");if(!J$(t))return 0;let r=0;for(let o of Pv(t))if(!o.startsWith("."))if(o.startsWith("@"))try{r+=Pv(Ev(t,o)).filter(n=>!n.startsWith(".")).length}catch{}else r++;return r}catch{return 0}}a(W$,"countInstalledPackages");async function Tv(e){let t=process.cwd();if(console.log(ey()),!_v(t))throw new R("No package.json found in this directory.",{code:"NO_PACKAGE_JSON",hint:`Run \`npm init -y\` first, then re-run \`${b("init")}\` from your project root.`,docs:"https://docs.npayload.com/docs/start/initialize"});e.http||Si(t,{edgeUrl:e.edgeUrl},{edge:"Name the edge of that estate with --edge-url or NPAYLOAD_EDGE_URL, or name nothing outside npayload's production hosts to use its production estate.",signIn:""});let r=Ci(t);(r.hasNpayloadDir||r.hasConfig)&&!e.dryRun&&(e.force?console.log(D.yellow(" npayload already set up \u2014 overwriting existing files (--force).")):(console.log(D.dim(" npayload already set up \u2014 adding missing files, existing files are preserved.")),console.log(D.dim(" Re-run with --force to overwrite, or --dry-run to preview."))));let o=kv(t),n=ny(),i=void 0,s={appName:process.env.NPAYLOAD_APP_NAME??"my-app",appSlug:process.env.NPAYLOAD_APP_SLUG??"my-app",appId:Qh,appType:process.env.NPAYLOAD_APP_TYPE??"internal",subtype:process.env.NPAYLOAD_APP_SUBTYPE,platformSlug:process.env.NPAYLOAD_PLATFORM_SLUG,framework:o,clientId:Hh,hmacSecret:Yh,apiUrl:e.apiUrl,targetEnv:n,transport:e.http?"http":"npp",edgeUrl:e.edgeUrl},c=(process.env.NPAYLOAD_FIRST_ENV??"").trim()||"sandbox",u=cn(e.dryRun?"Previewing scaffold (dry run)...":"Scaffolding npayload/..."),l=pv(t,s,{force:e.force,dryRun:e.dryRun,firstEnv:c});u.succeed(e.dryRun?`Dry run: ${l.written.length} to write, ${l.skipped.length} preserved`:`Scaffolded ${l.written.length} files`+(l.skipped.length?`, ${l.skipped.length} preserved`:"")),console.log();for(let k of l.written)console.log(D.dim(` ${D.green("+")} ${k}`));for(let k of l.skipped)console.log(D.dim(` ${D.yellow("=")} ${k} ${D.dim("(exists, preserved)")}`));if(e.dryRun){console.log(),console.log(D.bold(" Dry run complete \u2014 no files were written.")),console.log(D.dim(" Re-run without --dry-run to apply, or with --force to overwrite existing files."));return}let d=s.appName,f=s.appSlug,p=s.appType,m=!1,g=[];if(e.skipAuth)console.log(),console.log(D.dim(" Auth skipped (--skip-auth). Credentials left as placeholders.")),console.log(D.dim(` Run \`${b("login")}\` to connect this project.`));else{console.log();try{let k=await Ti(t,{authUrl:e.authUrl,apiUrl:e.apiUrl,edgeUrl:e.edgeUrl,rotate:e.rotate,debug:e.debug});d=k.appName,f=k.appSlug,p=k.appType,m=!0,g=Ai(k)}catch(k){let T=k instanceof Error?k.message:String(k);console.log(D.yellow(" Could not connect this project right now.")),console.log(D.dim(` ${ae(T,k)}`)),console.log(),console.log(" "+D.bold(`Run \`${b("login")}\` to connect this project.`)+D.dim(" (your files are already scaffolded)"))}}if(e.skipInstall)console.log(D.dim(`
|
|
227
|
+
Install skipped (--skip-install)`));else{console.log();let k=e.packageManager??xv(t),T=void 0,_=T?.pkgs??[si()];_.push("dotenv");let N=T?.label??"npayload",I=cn(`Installing ${N} (${k})\u2026`),j=Date.now(),z="",W=setInterval(()=>{let B=Math.round((Date.now()-j)/1e3);I.text=`Installing ${N} (${k})\u2026 ${B}s`+(z?` \u2014 ${z}`:"")},500);try{await Sv(k,_,t,i,L=>{/added|packages|resolv|reify|fetch|download|link|progress/i.test(L)&&(z=L.length>48?L.slice(0,47)+"\u2026":L)}),clearInterval(W);let B=W$(t);I.succeed(B>0?`${N} + dotenv installed (${B} packages)`:`${N} + dotenv installed`)}catch{clearInterval(W),I.warn(`Failed to install packages. Run manually: ${k} install ${_.join(" ")}`)}try{let B=Iv(t);B.length>0&&console.log(D.dim(` Added scripts: ${B.join(", ")}`))}catch{console.log(D.dim(" Could not update package.json scripts."))}}let v={internal:"Internal",connect:"Connect",platform:"Platform",feed:"Feed"},h={nextjs:"Next.js",remix:"Remix",express:"Express",hono:"Hono",react:"React",node:"Node.js"};if(m){let k=a(I=>` ${D.dim("\u2500\u2500")} ${D.bold(I)} ${D.dim("\u2500".repeat(Math.max(2,56-I.length)))}`,"rule"),T=[[b("validate"),"check your config against the contract (offline)"],[b("diff"),"see exactly what would change \u2014 nothing applied"],[b("push"),"apply to your sandbox + regenerate typed payloads"],[b("tail <channel>"),"watch events arrive, live, in this terminal"],[b("doctor"),"one-line diagnosis when anything feels off"],[b("deploy"),"the one deliberate path to production"]],_=Math.max(...T.map(([I])=>I.length))+2,N=a((I,j)=>` ${D.green(I.padEnd(_))}${D.dim(j)}`,"cmd");console.log(["",` ${Xh()} ${ci("Connected.")}`,"",` ${D.dim("app")} ${D.cyan(d)} ${D.dim(`(${f}) \xB7 ${v[p]} \xB7 ${h[o]}`)}`,` ${D.dim("credential")} ${D.dim("machine identity with generated per-object permissions \u2014 no keys to manage")}`,...g.map(I=>` ${D.dim(I)}`),` ${D.dim("workspace")} ${D.cyan("npayload/")} ${D.dim("config + generated types (commit it) \xB7 secrets stay in .env")}`,"",k("The loop"),"",...T.map(([I,j])=>N(I,j)),"",k("Hand it to your AI agent"),"",` ${D.dim("Your editor's agent is already wired to npayload (.mcp.json). Paste this:")}`,"",` ${D.cyan('"Set up npayload Events for this app end to end: study my data model,')}`,` ${D.cyan(" design the channels and typed event schemas in npayload/events.config.ts,")}`,` ${D.cyan(" validate, push, wire my code to publish, then prove it \u2014 publish a")}`,` ${D.cyan(' test event and tail the channel."')}`,"",` ${D.dim("Or, to link the products (Connect or Feed, a pipe, an agent), paste this:")}`,"",` ${D.cyan('"Set up the npayload loop for this app as far as it works today, by the')}`,` ${D.cyan(" full loop in npayload/AGENTS.md: publish with routingKey = event type;")}`,` ${D.cyan(" take partner events by Connect grant or Feed subscribe; declare a pipe")}`,` ${D.cyan(` started by a call in pipes.config.ts. Run each as ${b("<cmd>")}:`)}`,` ${D.cyan(" validate, diff, push, then pipes workflows activate-workflow <id>.")}`,` ${D.cyan(" Turning on a pipe that starts on an event is refused today.")}`,` ${D.cyan(" Send each event by webhook to my route, which starts the pipe with it as")}`,` ${D.cyan(" input; send the pipe's event by webhook to my route, which runs my agent")}`,` ${D.cyan(" from primus.config.ts. Prove each step with tail.")}`,` ${D.cyan(' Production stays my step."')}`,"",` ${D.dim("Publish from code, typed after your first push:")}`,` ${D.white('np.events.publish("<channel>", payload, { routingKey: "<event.type>" })')}`,""].join(`
|
|
228
|
+
`))}else wi([D.bold("npayload scaffolded."),"",`Framework: ${D.cyan(h[o])}`,"Dir: npayload/",`Target: ${n}`,"",D.yellow("Not connected yet \u2014 credentials are placeholders."),"",D.bold("Connect, then let your agent build it:"),"",` ${D.green(b("login"))} sign in + provision + fill credentials`,"",D.dim(' Then ask your coding agent: "set up npayload Events for this app" \u2014 it uses the'),D.dim(" npayload MCP (start with the npayload_overview tool).")])}a(Tv,"runInit");function H$(e){if(e.transport&&e.transport!=="http"&&e.transport!=="npp")throw new R("Unknown transport given to --transport (it is not shown here). Use npp (default) or http.",{code:"INVALID_TRANSPORT",hint:"Run `"+b("init")+"` for the default NPP wire, or `--transport http` for HTTP/JSON."});return e.http===!0||e.transport==="http"?"http":"npp"}a(H$,"resolveInitTransport");function Av(e){e.command("init").description("set up npayload in your project (device-flow auth + scaffold)").option("--skip-install","skip dependency installation").option("--skip-auth","skip authentication (use existing credentials)").option("--package-manager <pm>","force package manager: npm | pnpm | yarn | bun").option("--force","overwrite existing scaffold files (default: preserve them)").option("--rotate","issue a fresh app secret on re-run (invalidates the previous one)").option("--dry-run","preview what init would do without writing any files").option("--http","scaffold the HTTP/JSON transport instead of the NPP default").option("--transport <npp|http>","wire transport to scaffold (default: npp) \u2014 `--transport http` is the long form of `--http`").option("--edge-url <url>","override the edge the secure (NPP) transport connects to (default for the production API: https://npp.npayload.com), written into .env as NPAYLOAD_EDGE_URL").action(async r=>{try{let o=H$({http:r.http,transport:r.transport})==="http";await Tv({skipInstall:r.skipInstall??!1,skipAuth:r.skipAuth??!1,packageManager:r.packageManager,force:r.force??!1,rotate:r.rotate??!1,dryRun:r.dryRun??!1,apiUrl:se(process.env.NPAYLOAD_API_URL,"apiUrl"),authUrl:se(process.env.NPAYLOAD_AUTH_URL,"authUrl"),debug:process.env.NPAYLOAD_DEBUG==="1",http:o,edgeUrl:se(r.edgeUrl??process.env.NPAYLOAD_EDGE_URL,"edgeUrl")})}catch(o){pe(o)}})}a(Av,"registerInit");var Cv={org:"NPAYLOAD_ORG",app:"NPAYLOAD_APP",env:"NPAYLOAD_TARGET_ENV"};function Rv(e,t=process.env){let r={};for(let o of Object.keys(Cv)){let i=e[o]?.trim()||t[Cv[o]]?.trim();i&&(r[o]=i)}return r}a(Rv,"resolveLoginTargets");import jn from"chalk";function Ov(e){let t=a(async(o,n)=>{try{let i=process.cwd(),s=Ci(i);if(!s.hasNpayloadDir&&!s.hasConfig&&!s.hasEnv)throw new R("No npayload project found in this directory.",{code:"NO_SCAFFOLD",hint:"Run `"+b("init")+"` first to scaffold the project, then `"+b("login")+"` to connect it.",docs:"https://docs.npayload.com/docs/start/initialize"});console.log(),console.log(jn.bold(" npayload login")+jn.dim(" \u2014 connect this project."));let{org:c,app:u,env:l}=Rv({org:o.org,app:o.app,env:ft({env:o.env},n)}),d=await Ti(i,{authUrl:se(process.env.NPAYLOAD_AUTH_URL,"authUrl"),apiUrl:se(process.env.NPAYLOAD_API_URL,"apiUrl"),edgeUrl:se(process.env.NPAYLOAD_EDGE_URL,"edgeUrl"),rotate:o.rotate??!1,debug:process.env.NPAYLOAD_DEBUG==="1",...c?{org:c}:{},...u?{app:u}:{},...l?{env:l}:{}}),f=Ii();wi([jn.bold(d.filled?"Connected!":"Already connected."),"",...Ai(d).map(p=>jn.dim(p)),...f!==void 0?[`Dashboard: ${jn.cyan(`${f}/apps/${d.appSlug}/sandbox`)}`]:[],"",` ${jn.green("npx tsx npayload/events/publish.ts")} publish your first signal`])}catch(i){pe(i)}},"handler"),r=a(o=>o.description("connect an already-scaffolded project (device-flow auth + provision + fill credentials)").option("--rotate","issue a fresh app secret (invalidates the previous one)").option("--org <slug|gid>","select this organization without prompting (env: NPAYLOAD_ORG)").option("--app <slug|gid>","select this existing app without prompting (env: NPAYLOAD_APP)").option("--env <slug>","record this logical environment as the project target (env: NPAYLOAD_TARGET_ENV)").action(t),"defineLogin");r(e.command("login")),r(uu(e).command("login"))}a(Ov,"registerLogin");function uu(e){return e.commands.find(t=>t.name()==="auth")??e.command("auth").description("The credential the CLI signs in with (login, status)")}a(uu,"authGroup");import{spawn as Y$}from"child_process";var pn={stderr:a(e=>{process.stderr.write(e)},"stderr"),forward:a(e=>new Promise(t=>{let r=Y$(process.argv[0]??"node",[process.argv[1]??"",...e],{stdio:"inherit",env:process.env});r.on("close",o=>t(o??0)),r.on("error",o=>{process.stderr.write(`Forward failed: ${o.message}
|
|
229
|
+
`),t(1)})}),"forward"),exit:a(e=>{process.exitCode=e},"exit")},Q$=new Set(["grants","consents"]),Nv="Migration: use `np connect grants` for every grant and consent command.";function X$(e){let t=[...e],r=[];t.length>0&&Q$.has(t[0])&&r.push(t.shift());let o=t[0];return o===void 0||o.startsWith("-")?{unknown:`[deprecated] 'np federation${r.length?` ${r.join(" ")}`:""}' names no verb; the surface moved to 'np connect grants' \u2014 run 'np connect grants --help' for the supported verbs.
|
|
230
|
+
`}:(r.push(o),{v2Args:["connect","grants",o,...t.slice(1)],invoked:`np federation ${r.join(" ")}`,target:`np connect grants ${o}`})}a(X$,"federationForward");function eS(){let e=(process.env.NPAYLOAD_FEDERATION_HARD_FAIL??"").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}a(eS,"isHardFailMode");function tS(e,t){let r=t.v2Args[2]??"";if(e.commands.find(s=>s.name()==="connect")?.commands.find(s=>s.name()==="grants")?.commands.some(s=>s.name()===r||s.aliases().includes(r))??!1)return{invoked:t.invoked,target:t.target,note:""};let i=a(s=>s.slice(0,s.lastIndexOf(" ")),"withoutVerb");return{invoked:i(t.invoked),target:i(t.target),note:" (the verb given is not shown here)"}}a(tS,"shownForward");function Dv(e){e.command("federation",{hidden:!0}).description("Deprecated. Use 'np connect grants': V1 federation is retired.").argument("[tokens...]","the V1 verb and its arguments").allowUnknownOption(!0).allowExcessArguments(!0).action(async(t,r,o)=>{let n=X$(o.args);if("unknown"in n){pn.stderr(n.unknown),pn.exit(2);return}let i=tS(e,n);if(eS()){pn.stderr(`[deprecated] '${i.invoked}' has been retired: run '${i.target}' instead${i.note}. ${Nv}
|
|
231
|
+
`),pn.exit(2);return}pn.stderr(`[deprecated] '${i.invoked}' is deprecated. Forwarding to '${i.target}'${i.note}.
|
|
232
|
+
After 6 months post-GA this command exits non-zero; set NPAYLOAD_FEDERATION_HARD_FAIL=1 to opt in early. ${Nv}
|
|
233
|
+
`),pn.exit(await pn.forward(n.v2Args))})}a(Dv,"registerFederation");var Ne="1.36.1";var mt=[],Ge=[],nS=Uint8Array,lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(fn=0,jv=lu.length;fn<jv;++fn)mt[fn]=lu[fn],Ge[lu.charCodeAt(fn)]=fn;var fn,jv;Ge[45]=62;Ge[95]=63;function rS(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}a(rS,"getLens");function oS(e,t,r){return(t+r)*3/4-r}a(oS,"_byteLength");function Br(e){var t,r=rS(e),o=r[0],n=r[1],i=new nS(oS(e,o,n)),s=0,c=n>0?o-4:o,u;for(u=0;u<c;u+=4)t=Ge[e.charCodeAt(u)]<<18|Ge[e.charCodeAt(u+1)]<<12|Ge[e.charCodeAt(u+2)]<<6|Ge[e.charCodeAt(u+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return n===2&&(t=Ge[e.charCodeAt(u)]<<2|Ge[e.charCodeAt(u+1)]>>4,i[s++]=t&255),n===1&&(t=Ge[e.charCodeAt(u)]<<10|Ge[e.charCodeAt(u+1)]<<4|Ge[e.charCodeAt(u+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}a(Br,"toByteArray");function iS(e){return mt[e>>18&63]+mt[e>>12&63]+mt[e>>6&63]+mt[e&63]}a(iS,"tripletToBase64");function sS(e,t,r){for(var o,n=[],i=t;i<r;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),n.push(iS(o));return n.join("")}a(sS,"encodeChunk");function Kr(e){for(var t,r=e.length,o=r%3,n=[],i=16383,s=0,c=r-o;s<c;s+=i)n.push(sS(e,s,s+i>c?c:s+i));return o===1?(t=e[r-1],n.push(mt[t>>2]+mt[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],n.push(mt[t>>10]+mt[t>>4&63]+mt[t<<2&63]+"=")),n.join("")}a(Kr,"fromByteArray");function Ve(e){if(e===void 0)return{};if(!Ri(e))throw new Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}a(Ve,"parseArgs");function Un(e){if(typeof e>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof e!="string")throw new Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw new Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}a(Un,"validateDeploymentUrl");function Ri(e){let t=typeof e=="object",r=Object.getPrototypeOf(e),o=r===null||r===Object.prototype||r?.constructor?.name==="Object";return t&&o}a(Ri,"isSimpleObject");var zv=!0,Ln=BigInt("-9223372036854775808"),gu=BigInt("9223372036854775807"),fu=BigInt("0"),aS=BigInt("8"),cS=BigInt("256");function Mv(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}a(Mv,"isSpecial");function uS(e){e<fu&&(e-=Ln+Ln);let t=e.toString(16);t.length%2===1&&(t="0"+t);let r=new Uint8Array(new ArrayBuffer(8)),o=0;for(let n of t.match(/.{2}/g).reverse())r.set([parseInt(n,16)],o++),e>>=aS;return Kr(r)}a(uS,"slowBigIntToBase64");function lS(e){let t=Br(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let r=fu,o=fu;for(let n of t)r+=BigInt(n)*cS**o,o++;return r>gu&&(r+=Ln+Ln),r}a(lS,"slowBase64ToBigInt");function dS(e){if(e<Ln||gu<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);let t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),Kr(new Uint8Array(t))}a(dS,"modernBigIntToBase64");function pS(e){let t=Br(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}a(pS,"modernBase64ToBigInt");var fS=DataView.prototype.setBigInt64?dS:uS,mS=DataView.prototype.getBigInt64?pS:lS,Uv=1024;function mu(e){if(e.length>Uv)throw new Error(`Field name ${e} exceeds maximum field name length ${Uv}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r<32||r>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}a(mu,"validateObjectField");function ye(e){if(e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(Array.isArray(e))return e.map(o=>ye(o));if(typeof e!="object")throw new Error(`Unexpected type of ${e}`);let t=Object.entries(e);if(t.length===1){let o=t[0][0];if(o==="$bytes"){if(typeof e.$bytes!="string")throw new Error(`Malformed $bytes field on ${e}`);return Br(e.$bytes).buffer}if(o==="$integer"){if(typeof e.$integer!="string")throw new Error(`Malformed $integer field on ${e}`);return mS(e.$integer)}if(o==="$float"){if(typeof e.$float!="string")throw new Error(`Malformed $float field on ${e}`);let n=Br(e.$float);if(n.byteLength!==8)throw new Error(`Received ${n.byteLength} bytes, expected 8 for $float`);let s=new DataView(n.buffer).getFloat64(0,zv);if(!Mv(s))throw new Error(`Float ${s} should be encoded as a number`);return s}if(o==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(o==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}let r={};for(let[o,n]of Object.entries(e))mu(o),r[o]=ye(n);return r}a(ye,"jsonToConvex");var Lv=16384;function mn(e){let t=JSON.stringify(e,(r,o)=>o===void 0?"undefined":typeof o=="bigint"?`${o.toString()}n`:o);if(t.length>Lv){let r="[...truncated]",o=Lv-r.length,n=t.codePointAt(o-1);return n!==void 0&&n>65535&&(o-=1),t.substring(0,o)+r}return t}a(mn,"stringifyValueForError");function Oi(e,t,r,o){if(e===void 0){let s=r&&` (present at path ${r} in original object ${mn(t)})`;throw new Error(`undefined is not a valid Convex value${s}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<Ln||gu<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:fS(e)}}if(typeof e=="number")if(Mv(e)){let s=new ArrayBuffer(8);return new DataView(s).setFloat64(0,e,zv),{$float:Kr(new Uint8Array(s))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:Kr(new Uint8Array(e))};if(Array.isArray(e))return e.map((s,c)=>Oi(s,t,r+`[${c}]`,!1));if(e instanceof Set)throw new Error(pu(r,"Set",[...e],t));if(e instanceof Map)throw new Error(pu(r,"Map",[...e],t));if(!Ri(e)){let s=e?.constructor?.name,c=s?`${s} `:"";throw new Error(pu(r,c,e,t))}let n={},i=Object.entries(e);i.sort(([s,c],[u,l])=>s===u?0:s<u?-1:1);for(let[s,c]of i)c!==void 0?(mu(s),n[s]=Oi(c,t,r+`.${s}`,!1)):o&&(mu(s),n[s]=gS(c,t,r+`.${s}`));return n}a(Oi,"convexToJsonInternal");function pu(e,t,r,o){return e?`${t}${mn(r)} is not a supported Convex type (present at path ${e} in original object ${mn(o)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${mn(r)} is not a supported Convex type.`}a(pu,"errorMessageForUnsupportedType");function gS(e,t,r){if(e===void 0)return{$undefined:null};if(t===void 0)throw new Error(`Programming error. Current value is ${mn(e)} but original value is undefined`);return Oi(e,t,r,!1)}a(gS,"convexOrUndefinedToJsonInternal");function ve(e){return Oi(e,e,"",!1)}a(ve,"convexToJson");var hS=Object.defineProperty,yS=a((e,t,r)=>t in e?hS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),oe=a((e,t,r)=>yS(e,typeof t!="symbol"?t+"":t,r),"__publicField"),vS="https://docs.convex.dev/error#undefined-validator";function Jr(e,t){let r=t!==void 0?` for field "${t}"`:"";throw new Error(`A validator is undefined${r} in ${e}. This is often caused by circular imports. See ${vS} for details.`)}a(Jr,"throwUndefinedValidatorError");var Te=class{static{a(this,"BaseValidator")}constructor({isOptional:t}){oe(this,"type"),oe(this,"fieldPaths"),oe(this,"isOptional"),oe(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}},Ni=class e extends Te{static{a(this,"VId")}constructor({isOptional:t,tableName:r}){if(super({isOptional:t}),oe(this,"tableName"),oe(this,"kind","id"),typeof r!="string")throw new Error("v.id(tableName) requires a string");this.tableName=r}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new e({isOptional:"optional",tableName:this.tableName})}},Wr=class e extends Te{static{a(this,"VFloat64")}constructor(){super(...arguments),oe(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new e({isOptional:"optional"})}},Hr=class e extends Te{static{a(this,"VInt64")}constructor(){super(...arguments),oe(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new e({isOptional:"optional"})}},Di=class e extends Te{static{a(this,"VBoolean")}constructor(){super(...arguments),oe(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},ji=class e extends Te{static{a(this,"VBytes")}constructor(){super(...arguments),oe(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Ui=class e extends Te{static{a(this,"VString")}constructor(){super(...arguments),oe(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Li=class e extends Te{static{a(this,"VNull")}constructor(){super(...arguments),oe(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},zi=class e extends Te{static{a(this,"VAny")}constructor(){super(...arguments),oe(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new e({isOptional:"optional"})}},Mi=class e extends Te{static{a(this,"VObject")}constructor({isOptional:t,fields:r}){super({isOptional:t}),oe(this,"fields"),oe(this,"kind","object"),globalThis.Object.entries(r).forEach(([o,n])=>{if(n===void 0&&Jr("v.object()",o),!n.isConvexValidator)throw new Error("v.object() entries must be validators")}),this.fields=r}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,r])=>[t,{fieldType:r.json,optional:r.isOptional==="optional"}]))}}asOptional(){return new e({isOptional:"optional",fields:this.fields})}omit(...t){let r={...this.fields};for(let o of t)delete r[o];return new e({isOptional:this.isOptional,fields:r})}pick(...t){let r={};for(let o of t)r[o]=this.fields[o];return new e({isOptional:this.isOptional,fields:r})}partial(){let t={};for(let[r,o]of globalThis.Object.entries(this.fields))t[r]=o.asOptional();return new e({isOptional:this.isOptional,fields:t})}extend(t){return new e({isOptional:this.isOptional,fields:{...this.fields,...t}})}},Fi=class e extends Te{static{a(this,"VLiteral")}constructor({isOptional:t,value:r}){if(super({isOptional:t}),oe(this,"value"),oe(this,"kind","literal"),typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"&&typeof r!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=r}get json(){return{type:this.kind,value:ve(this.value)}}asOptional(){return new e({isOptional:"optional",value:this.value})}},qi=class e extends Te{static{a(this,"VArray")}constructor({isOptional:t,element:r}){super({isOptional:t}),oe(this,"element"),oe(this,"kind","array"),r===void 0&&Jr("v.array()"),this.element=r}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new e({isOptional:"optional",element:this.element})}},Zi=class e extends Te{static{a(this,"VRecord")}constructor({isOptional:t,key:r,value:o}){if(super({isOptional:t}),oe(this,"key"),oe(this,"value"),oe(this,"kind","record"),r===void 0&&Jr("v.record()","key"),o===void 0&&Jr("v.record()","value"),r.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(o.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!r.isConvexValidator||!o.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=r,this.value=o}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new e({isOptional:"optional",key:this.key,value:this.value})}},Gi=class e extends Te{static{a(this,"VUnion")}constructor({isOptional:t,members:r}){super({isOptional:t}),oe(this,"members"),oe(this,"kind","union"),r.forEach((o,n)=>{if(o===void 0&&Jr("v.union()",`member at index ${n}`),!o.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=r}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new e({isOptional:"optional",members:this.members})}};function Fv(e){return!!e.isConvexValidator}a(Fv,"isValidator");var Z={id:a(e=>new Ni({isOptional:"required",tableName:e}),"id"),null:a(()=>new Li({isOptional:"required"}),"null"),number:a(()=>new Wr({isOptional:"required"}),"number"),float64:a(()=>new Wr({isOptional:"required"}),"float64"),bigint:a(()=>new Hr({isOptional:"required"}),"bigint"),int64:a(()=>new Hr({isOptional:"required"}),"int64"),boolean:a(()=>new Di({isOptional:"required"}),"boolean"),string:a(()=>new Ui({isOptional:"required"}),"string"),bytes:a(()=>new ji({isOptional:"required"}),"bytes"),literal:a(e=>new Fi({isOptional:"required",value:e}),"literal"),array:a(e=>new qi({isOptional:"required",element:e}),"array"),object:a(e=>new Mi({isOptional:"required",fields:e}),"object"),record:a((e,t)=>new Zi({isOptional:"required",key:e,value:t}),"record"),union:a((...e)=>new Gi({isOptional:"required",members:e}),"union"),any:a(()=>new zi({isOptional:"required"}),"any"),optional:a(e=>e.asOptional(),"optional"),nullable:a(e=>Z.union(e,Z.null()),"nullable")};var bS=Object.defineProperty,wS=a((e,t,r)=>t in e?bS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),hu=a((e,t,r)=>wS(e,typeof t!="symbol"?t+"":t,r),"__publicField"),qv,Zv,kS=Symbol.for("ConvexError"),gt=class extends(Zv=Error,qv=kS,Zv){static{a(this,"ConvexError")}constructor(t){super(typeof t=="string"?t:mn(t)),hu(this,"name","ConvexError"),hu(this,"data"),hu(this,qv,!0),this.data=t}};var Gv=a(()=>Array.from({length:4},()=>0),"arr"),Oj=Gv(),Nj=Gv();var _S=Object.defineProperty,$S=a((e,t,r)=>t in e?_S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Vv=a((e,t,r)=>$S(e,typeof t!="symbol"?t+"":t,r),"__publicField"),SS="color:rgb(0, 145, 255)";function IS(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}a(IS,"prefix_for_source");var Vi=class{static{a(this,"DefaultLogger")}constructor(t){Vv(this,"_onLogLineFuncs"),Vv(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let r=Math.random().toString(36).substring(2,15);for(let o=0;o<10&&this._onLogLineFuncs[r]!==void 0;o++)r=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[r]=t,()=>{delete this._onLogLineFuncs[r]}}logVerbose(...t){if(this._verbose)for(let r of Object.values(this._onLogLineFuncs))r("debug",`${new Date().toISOString()}`,...t)}log(...t){for(let r of Object.values(this._onLogLineFuncs))r("info",...t)}warn(...t){for(let r of Object.values(this._onLogLineFuncs))r("warn",...t)}error(...t){for(let r of Object.values(this._onLogLineFuncs))r("error",...t)}};function yu(e){let t=new Vi(e);return t.addLogLineListener((r,...o)=>{switch(r){case"debug":console.debug(...o);break;case"info":console.log(...o);break;case"warn":console.warn(...o);break;case"error":console.error(...o);break;default:console.log(...o)}}),t}a(yu,"instantiateDefaultLogger");function vu(e){return new Vi(e)}a(vu,"instantiateNoopLogger");function gn(e,t,r,o,n){let i=IS(r);if(typeof n=="object"&&(n=`ConvexError ${JSON.stringify(n.errorData,null,2)}`),t==="info"){let s=n.match(/^\[.*?\] /);if(s===null){e.error(`[CONVEX ${i}(${o})] Could not parse console.log`);return}let c=n.slice(1,s[0].length-2),u=n.slice(s[0].length);e.log(`%c[CONVEX ${i}(${o})] [${c}]`,SS,u)}else e.error(`[CONVEX ${i}(${o})] ${n}`)}a(gn,"logForFunction");var hn=Symbol.for("functionName");var Jv=Symbol.for("toReferencePath");function PS(e){return e[Jv]??null}a(PS,"extractReferencePath");function ES(e){return e.startsWith("function://")}a(ES,"isFunctionHandle");function Ut(e){let t;if(typeof e=="string")ES(e)?t={functionHandle:e}:t={name:e};else if(e[hn])t={name:e[hn]};else{let r=PS(e);if(!r)throw new Error(`${e} is not a functionReference`);t={reference:r}}return t}a(Ut,"getFunctionAddress");function ht(e){let t=Ut(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;let r=e[hn];if(!r)throw new Error(`${e} is not a functionReference`);return r}a(ht,"getFunctionName");function Yr(e){return{[hn]:e}}a(Yr,"makeFunctionReference");function Wv(e=[]){let t={get(r,o){if(typeof o=="string"){let n=[...e,o];return Wv(n)}else if(o===hn){if(e.length<2){let s=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${s}\``)}let n=e.slice(0,-1).join("/"),i=e[e.length-1];return i==="default"?n:n+":"+i}else return o===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}a(Wv,"createApi");var TS=Wv();var RS=Object.defineProperty,OS=a((e,t,r)=>t in e?RS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),bu=a((e,t,r)=>OS(e,typeof t!="symbol"?t+"":t,r),"__publicField"),yn=class e{static{a(this,"Long")}constructor(t,r){bu(this,"low"),bu(this,"high"),bu(this,"__isUnsignedLong__"),this.low=t|0,this.high=r|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){let t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?Hv:t>=NS?DS:new e(t%Qr|0,t/Qr|0)}toString(){return(BigInt(this.high)*BigInt(Qr)+BigInt(this.low)).toString()}equals(t){return e.isLong(t)||(t=e.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return e.isLong(t)||(t=e.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?e.fromNumber(t):new e(t.low,t.high)}},Hv=new yn(0,0),Yv=65536,Qr=Yv*Yv,NS=Qr*Qr,DS=new yn(-1,-1);var wu=class extends Error{static{a(this,"InvalidTokenError")}};wu.prototype.name="InvalidTokenError";var J0=480*60*60*1e3;var LS=Object.defineProperty,zS=a((e,t,r)=>t in e?LS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),yt=a((e,t,r)=>zS(e,typeof t!="symbol"?t+"":t,r),"__publicField");var Bi=560,Xr;var eo=class{static{a(this,"ConvexHttpClient")}constructor(t,r){if(yt(this,"address"),yt(this,"auth"),yt(this,"adminAuth"),yt(this,"encodedTsPromise"),yt(this,"debug"),yt(this,"fetchOptions"),yt(this,"fetch"),yt(this,"logger"),yt(this,"mutationQueue",[]),yt(this,"isProcessingQueue",!1),typeof r=="boolean")throw new Error("skipConvexDeploymentUrlCheck as the second argument is no longer supported. Please pass an options object, `{ skipConvexDeploymentUrlCheck: true }`.");(r??{}).skipConvexDeploymentUrlCheck!==!0&&Un(t),this.logger=r?.logger===!1?vu({verbose:!1}):r?.logger!==!0&&r?.logger?r.logger:yu({verbose:!1}),this.address=t,this.debug=!0,this.auth=void 0,this.adminAuth=void 0,this.fetch=r?.fetch,r?.auth&&this.setAuth(r.auth)}backendUrl(){return`${this.address}/api`}get url(){return this.address}setAuth(t){this.clearAuth(),this.auth=t}setAdminAuth(t,r){if(this.clearAuth(),r!==void 0){let o=new TextEncoder().encode(JSON.stringify(r)),n=btoa(String.fromCodePoint(...o));this.adminAuth=`${t}:${n}`}else this.adminAuth=t}clearAuth(){this.auth=void 0,this.adminAuth=void 0}setDebug(t){this.debug=t}setFetchOptions(t){this.fetchOptions=t}async consistentQuery(t,...r){let o=Ve(r[0]),n=this.getTimestamp();return await this.queryInner(t,o,{timestampPromise:n})}async getTimestamp(){return this.encodedTsPromise?this.encodedTsPromise:this.encodedTsPromise=this.getTimestampInner()}async getTimestampInner(){let t=this.fetch||Xr||fetch,r={"Content-Type":"application/json","Convex-Client":`npm-${Ne}`},o=await t(`${this.address}/api/query_ts`,{...this.fetchOptions,method:"POST",headers:r});if(!o.ok)throw new Error(await o.text());let{ts:n}=await o.json();return n}async query(t,...r){let o=Ve(r[0]);return await this.queryInner(t,o,{})}async queryInner(t,r,o){let n=ht(t),i=[ve(r)],s={"Content-Type":"application/json","Convex-Client":`npm-${Ne}`};this.adminAuth?s.Authorization=`Convex ${this.adminAuth}`:this.auth&&(s.Authorization=`Bearer ${this.auth}`);let c=this.fetch||Xr||fetch,u=o.timestampPromise?await o.timestampPromise:void 0,l=JSON.stringify({path:n,format:"convex_encoded_json",args:i,...u?{ts:u}:{}}),d=u?`${this.address}/api/query_at_ts`:`${this.address}/api/query`,f=await c(d,{...this.fetchOptions,body:l,method:"POST",headers:s});if(!f.ok&&f.status!==Bi)throw new Error(await f.text());let p=await f.json();if(this.debug)for(let m of p.logLines??[])gn(this.logger,"info","query",n,m);switch(p.status){case"success":return ye(p.value);case"error":throw p.errorData!==void 0?Ki(p.errorData,new gt(p.errorMessage)):new Error(p.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(p)}`)}}async mutationInner(t,r){let o=ht(t),n=JSON.stringify({path:o,format:"convex_encoded_json",args:[ve(r)]}),i={"Content-Type":"application/json","Convex-Client":`npm-${Ne}`};this.adminAuth?i.Authorization=`Convex ${this.adminAuth}`:this.auth&&(i.Authorization=`Bearer ${this.auth}`);let c=await(this.fetch||Xr||fetch)(`${this.address}/api/mutation`,{...this.fetchOptions,body:n,method:"POST",headers:i});if(!c.ok&&c.status!==Bi)throw new Error(await c.text());let u=await c.json();if(this.debug)for(let l of u.logLines??[])gn(this.logger,"info","mutation",o,l);switch(u.status){case"success":return ye(u.value);case"error":throw u.errorData!==void 0?Ki(u.errorData,new gt(u.errorMessage)):new Error(u.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(u)}`)}}async processMutationQueue(){if(!this.isProcessingQueue){for(this.isProcessingQueue=!0;this.mutationQueue.length>0;){let{mutation:t,args:r,resolve:o,reject:n}=this.mutationQueue.shift();try{let i=await this.mutationInner(t,r);o(i)}catch(i){n(i)}}this.isProcessingQueue=!1}}enqueueMutation(t,r){return new Promise((o,n)=>{this.mutationQueue.push({mutation:t,args:r,resolve:o,reject:n}),this.processMutationQueue()})}async mutation(t,...r){let[o,n]=r,i=Ve(o);return n?.skipQueue?await this.mutationInner(t,i):await this.enqueueMutation(t,i)}async action(t,...r){let o=Ve(r[0]),n=ht(t),i=JSON.stringify({path:n,format:"convex_encoded_json",args:[ve(o)]}),s={"Content-Type":"application/json","Convex-Client":`npm-${Ne}`};this.adminAuth?s.Authorization=`Convex ${this.adminAuth}`:this.auth&&(s.Authorization=`Bearer ${this.auth}`);let u=await(this.fetch||Xr||fetch)(`${this.address}/api/action`,{...this.fetchOptions,body:i,method:"POST",headers:s});if(!u.ok&&u.status!==Bi)throw new Error(await u.text());let l=await u.json();if(this.debug)for(let d of l.logLines??[])gn(this.logger,"info","action",n,d);switch(l.status){case"success":return ye(l.value);case"error":throw l.errorData!==void 0?Ki(l.errorData,new gt(l.errorMessage)):new Error(l.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(l)}`)}}async function(t,r,...o){let n=Ve(o[0]),i=typeof t=="string"?t:ht(t),s=JSON.stringify({componentPath:r,path:i,format:"convex_encoded_json",args:ve(n)}),c={"Content-Type":"application/json","Convex-Client":`npm-${Ne}`};this.adminAuth?c.Authorization=`Convex ${this.adminAuth}`:this.auth&&(c.Authorization=`Bearer ${this.auth}`);let l=await(this.fetch||Xr||fetch)(`${this.address}/api/function`,{...this.fetchOptions,body:s,method:"POST",headers:c});if(!l.ok&&l.status!==Bi)throw new Error(await l.text());let d=await l.json();if(this.debug)for(let f of d.logLines??[])gn(this.logger,"info","any",i,f);switch(d.status){case"success":return ye(d.value);case"error":throw d.errorData!==void 0?Ki(d.errorData,new gt(d.errorMessage)):new Error(d.errorMessage);default:throw new Error(`Invalid response: ${JSON.stringify(d)}`)}}};function Ki(e,t){return t.data=ye(e),t}a(Ki,"forwardErrorData");var h1=Z.object({numItems:Z.number(),cursor:Z.union(Z.string(),Z.null()),endCursor:Z.optional(Z.union(Z.string(),Z.null())),id:Z.optional(Z.number()),maximumRowsRead:Z.optional(Z.number()),maximumBytesRead:Z.optional(Z.number())});var ZS=Object.defineProperty,GS=a((e,t,r)=>t in e?ZS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),vt=a((e,t,r)=>GS(e,typeof t!="symbol"?t+"":t,r),"__publicField"),Ji=class{static{a(this,"TableDefinition")}constructor(t){vt(this,"indexes"),vt(this,"stagedDbIndexes"),vt(this,"searchIndexes"),vt(this,"stagedSearchIndexes"),vt(this,"vectorIndexes"),vt(this,"stagedVectorIndexes"),vt(this,"validator"),this.indexes=[],this.stagedDbIndexes=[],this.searchIndexes=[],this.stagedSearchIndexes=[],this.vectorIndexes=[],this.stagedVectorIndexes=[],this.validator=t}" indexes"(){return this.indexes}index(t,r){return Array.isArray(r)?this.indexes.push({indexDescriptor:t,fields:r}):r.staged?this.stagedDbIndexes.push({indexDescriptor:t,fields:r.fields}):this.indexes.push({indexDescriptor:t,fields:r.fields}),this}searchIndex(t,r){return r.staged?this.stagedSearchIndexes.push({indexDescriptor:t,searchField:r.searchField,filterFields:r.filterFields||[]}):this.searchIndexes.push({indexDescriptor:t,searchField:r.searchField,filterFields:r.filterFields||[]}),this}vectorIndex(t,r){return r.staged?this.stagedVectorIndexes.push({indexDescriptor:t,vectorField:r.vectorField,dimensions:r.dimensions,filterFields:r.filterFields||[]}):this.vectorIndexes.push({indexDescriptor:t,vectorField:r.vectorField,dimensions:r.dimensions,filterFields:r.filterFields||[]}),this}self(){return this}export(){let t=this.validator.json;if(typeof t!="object")throw new Error("Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)");return{indexes:this.indexes,stagedDbIndexes:this.stagedDbIndexes,searchIndexes:this.searchIndexes,stagedSearchIndexes:this.stagedSearchIndexes,vectorIndexes:this.vectorIndexes,stagedVectorIndexes:this.stagedVectorIndexes,documentType:t}}};function xu(e){return Fv(e)?new Ji(e):new Ji(Z.object(e))}a(xu,"defineTable");var _u=class{static{a(this,"SchemaDefinition")}constructor(t,r){vt(this,"tables"),vt(this,"strictTableNameTypes"),vt(this,"schemaValidation"),this.tables=t,this.schemaValidation=r?.schemaValidation===void 0?!0:r.schemaValidation}export(){return JSON.stringify({tables:Object.entries(this.tables).map(([t,r])=>{let{indexes:o,stagedDbIndexes:n,searchIndexes:i,stagedSearchIndexes:s,vectorIndexes:c,stagedVectorIndexes:u,documentType:l}=r.export();return{tableName:t,indexes:o,stagedDbIndexes:n,searchIndexes:i,stagedSearchIndexes:s,vectorIndexes:c,stagedVectorIndexes:u,documentType:l}}),schemaValidation:this.schemaValidation})}};function Qv(e,t){return new _u(e,t)}a(Qv,"defineSchema");var j1=Qv({_scheduled_functions:xu({name:Z.string(),args:Z.array(Z.any()),scheduledTime:Z.float64(),completedTime:Z.optional(Z.float64()),state:Z.union(Z.object({kind:Z.literal("pending")}),Z.object({kind:Z.literal("inProgress")}),Z.object({kind:Z.literal("success")}),Z.object({kind:Z.literal("failed"),error:Z.string()}),Z.object({kind:Z.literal("canceled")}))}),_storage:xu({sha256:Z.string(),size:Z.float64(),contentType:Z.optional(Z.string())})});async function Xv(e,...t){let[r,o]=t;return $u(o??{}).query(e,r||{})}a(Xv,"fetchQuery");async function eb(e,...t){let[r,o]=t;return $u(o??{}).mutation(e,r||{})}a(eb,"fetchMutation");async function tb(e,...t){let[r,o]=t;return $u(o??{}).action(e,r||{})}a(tb,"fetchAction");function $u(e){"url"in e&&e.url===void 0&&console.error("deploymentUrl is undefined, are your environment variables set? In the future explicitly passing undefined will cause an error. To explicitly use the default, pass `process.env.NEXT_PUBLIC_CONVEX_URL`.");let t=new eo(VS(e.url,e.skipConvexDeploymentUrlCheck??!1));return e.token!==void 0&&t.setAuth(e.token),e.adminToken!==void 0&&t.setAdminAuth(e.adminToken),t.setFetchOptions({cache:"no-store"}),t}a($u,"setupClient");function VS(e,t){let r=e??process.env.NEXT_PUBLIC_CONVEX_URL,o=e===void 0;if(typeof r!="string")throw new Error(o?"Environment variable NEXT_PUBLIC_CONVEX_URL is not set.":"Convex function called with invalid deployment address.");return t||Un(r),r}a(VS,"getConvexUrl");var Lt={create:"",validate:"",drift:"",approve:"",execute:"",rollback:"",list:"",getJobWithSteps:""};async function BS(e){let t=globalThis.fetch,r=[],o=Dt(qe(),t),n=a((async(i,s)=>{try{return await o(i,s)}catch(c){throw c instanceof we&&r.push(c),c}}),"held");globalThis.fetch=n;try{return await e()}catch(i){throw r[0]??i}finally{globalThis.fetch===n&&(globalThis.fetch=t)}}a(BS,"underTheRunsFetch");function KS(){throw new R("`np promote` is no longer available: promotion to production was removed.",{code:"PROMOTION_UNAVAILABLE",hint:"Run `"+b("deploy")+"` from your pipeline to put your configuration in production."})}a(KS,"resolveAdminUrl");var rt=class e{constructor(t,r){this.url=t;this.token=r}static{a(this,"PromoteAdmin")}static async fromSession(){let t=KS(),r=await iy();if(!r?.accessToken)throw new R("You are not signed in to the npayload Control Plane.",{code:"NOT_AUTHENTICATED",hint:"Run `"+b("init")+"` or `"+b("auth login")+"` to sign in, then retry."});return qe().check(t),new e(t,r.accessToken)}async call(t){try{return await BS(()=>t({url:this.url,token:this.token}))}catch(r){throw F(r),JS(r)}}query(t,r){return this.call(o=>Xv(Yr(t),r,o))}mutation(t,r){return this.call(o=>eb(Yr(t),r,o))}action(t,r){return this.call(o=>tb(Yr(t),r,o))}create(t){return this.mutation(Lt.create,{...t})}validate(t){return this.mutation(Lt.validate,{promotionId:t})}drift(t){return this.action(Lt.drift,{appId:t})}approve(t){return this.mutation(Lt.approve,{promotionId:t})}execute(t){return this.mutation(Lt.execute,{promotionId:t})}rollback(t){return this.mutation(Lt.rollback,{promotionId:t})}list(t){return this.query(Lt.list,t?{appId:t}:{})}getJobWithSteps(t){return this.query(Lt.getJobWithSteps,{promotionId:t})}};function JS(e){let t=e?.data;if(t!==null&&typeof t=="object"&&typeof t.kind=="string"){let r=t,o=typeof r.message=="string"&&r.message.length>0?r.message:e instanceof Error?e.message:r.kind;return new R(o,{code:r.kind,cause:e})}return e}a(JS,"adminRefusal");function bt(e,t){process.stdout.write(`${Ey(e,t)}
|
|
234
|
+
`)}a(bt,"emit");function Su(e){let t=String(e.status??"").toLowerCase(),r=t==="succeeded"||t==="success"||t==="completed"?"succeeded":t==="failed"||t==="error"?"failed":t==="skipped"?"skipped":"running",o=e.resourceGid??e.resource??e.label??"resource";return{label:`${e.plane?`${String(e.plane)}: `:""}${String(o)}`,status:r,message:e.message?String(e.message):void 0}}a(Su,"toStepLine");async function nb(e,t,r,o={}){let n=o.intervalMs??1e3,i=Date.now()+(o.timeoutMs??600*1e3),s=0,c=null,u=new Set(["completed","failed","rolled_back","rolledback","cancelled"]);for(;;){c=await e.getJobWithSteps(t);let l=c?.steps??[];for(let f=s;f<l.length;f++){let p=Su(l[f]);r.start(p.label),r.finish(p)}s=l.length;let d=String(c?.promotion?.status??"").toLowerCase();if(u.has(d))break;if(Date.now()>i)throw new R("Timed out waiting for the promotion to finish.",{code:"PROMOTE_TIMEOUT",hint:`Check status with: ${b(`promote status ${t}`)}`});await new Promise(f=>setTimeout(f,n))}return c}a(nb,"streamSteps");function rb(e){let t=e.command("promote").description("[DEPRECATED \u2014 use `np deploy`] promote a tested app's config sandbox\u2192production (snapshot \u2192 diff \u2192 approve \u2192 execute \u2192 rollback)");t.hook("preAction",()=>{process.stderr.write("\u26A0\uFE0F `np promote` is deprecated and the sandbox\u2192production clone is disabled. Use `"+b("deploy")+"` to push config to production (code is the source of truth).\n")}),t.command("create").description("snapshot the sandbox's configuration and open a promotion").requiredOption("--app <slug>","app slug or GID to promote").option("--from <env>","source environment","sandbox").option("--to <env>","target environment","production").option("--mode <clone|fresh>","snapshot mode","clone").option("--output <fmt>","human | table | json | yaml | ndjson").action(async r=>{try{let o=Tt(r.output),n=r.mode==="fresh"?"fresh":"clone",s=await(await rt.fromSession()).create({appId:r.app,fromEnv:r.from,toEnv:r.to,mode:n});bt(s,o)}catch(o){pe(o)}}),t.command("run").description("one-shot promotion: create \u2192 validate \u2192 approve \u2192 execute, streaming the live step log. Requires --yes.").requiredOption("--app <slug>","app slug or GID to promote").option("--from <env>","source environment","sandbox").option("--to <env>","target environment","production").option("--mode <clone|fresh>","snapshot mode","clone").option("--yes","confirm non-interactive auto-approval of the full pipeline").option("--output <fmt>","human | table | json | yaml | ndjson").option("--no-follow","do not stream the live step log; return immediately").action(async r=>{try{let o=Tt(r.output);if(!r.yes)throw new R("`np promote run` auto-approves and executes the promotion. Re-run with --yes to confirm.",{code:"CONFIRMATION_REQUIRED",hint:"Or use the step-by-step flow: create \u2192 diff \u2192 approve \u2192 execute."});let n=r.mode==="fresh"?"fresh":"clone",i=await rt.fromSession(),s=new Uc(o),u=(await i.create({appId:r.app,fromEnv:r.from,toEnv:r.to,mode:n})).promotionId;await i.validate(u),await i.approve(u);let l=await i.execute(u),d=null;if(r.follow!==!1)d=await nb(i,u,s);else{d=await i.getJobWithSteps(u);for(let v of d?.steps??[]){let h=Su(v);s.start(h.label),s.finish(h)}}let f=String(d?.promotion?.status??"").toLowerCase(),{cellRegistryId:p,...m}=l,g={promotionId:u,...m,status:d?.promotion?.status??null,steps:s.all()};bt(o==="human"?{promotionId:u,status:g.status}:g,o),(s.hasFailure()||f==="failed")&&(process.exitCode=1)}catch(o){pe(o)}}),t.command("diff").description("run the validation pipeline and show the field-level diff vs production (read-only)").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Tt(o.output),i=await rt.fromSession();await i.validate(r);let s=await i.getJobWithSteps(r);if(!s)throw new R("The promotion given was not found (its id is not shown here).",{code:"PROMOTION_NOT_FOUND"});bt(s.promotion,n)}catch(n){pe(n)}}),t.command("approve").description("record approval (production requires a second approver \u2014 4-eyes \u2014 on mesh+)").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Tt(o.output),s=await(await rt.fromSession()).approve(r);bt({promotionId:r,...s},n)}catch(n){pe(n)}}),t.command("execute").description("apply the promotion and stream a live step log").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").option("--no-follow","do not stream the live step log; return immediately").action(async(r,o)=>{try{let n=Tt(o.output),i=await rt.fromSession(),s=new Uc(n),c=await i.execute(r),u=null;if(o.follow!==!1)u=await nb(i,r,s);else{u=await i.getJobWithSteps(r);for(let m of u?.steps??[]){let g=Su(m);s.start(g.label),s.finish(g)}}let l=String(u?.promotion?.status??"").toLowerCase(),{cellRegistryId:d,...f}=c,p={promotionId:r,...f,status:u?.promotion?.status??null,steps:s.all()};bt(n==="human"?{promotionId:r,status:p.status}:p,n),(s.hasFailure()||l==="failed")&&(process.exitCode=1)}catch(n){pe(n)}}),t.command("rollback").description("restore the prior production snapshot within the rollback window (default 30m)").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Tt(o.output),s=await(await rt.fromSession()).rollback(r);bt({promotionId:r,...s},n)}catch(n){pe(n)}}),t.command("list").description("promotion history").option("--app <slug>","filter to one app slug or GID").option("--output <fmt>","human | table | json | yaml | ndjson").action(async r=>{try{let o=Tt(r.output),i=await(await rt.fromSession()).list(r.app);bt(i,o)}catch(o){pe(o)}}),t.command("status").description("current job state + live steps").argument("<promotion-id>","promotion id (prm_\u2026)").option("--output <fmt>","human | table | json | yaml | ndjson").action(async(r,o)=>{try{let n=Tt(o.output),s=await(await rt.fromSession()).getJobWithSteps(r);if(!s)throw new R("The promotion given was not found (its id is not shown here).",{code:"PROMOTION_NOT_FOUND"});bt(s,n)}catch(n){pe(n)}})}a(rb,"registerPromote");import{createServer as XS}from"http";import ne from"chalk";var WS=12e4,HS=["dev","listen","sync","tail"];function YS(e){return HS.includes(e)}a(YS,"isLongRunningVerb");function zt(){let e,t=a(()=>{},"reject"),r=new Promise((o,n)=>{t=n});return r.catch(()=>{}),{onRefused:a(o=>{e??=o,t(o)},"onRefused"),ended:r,refusal:a(()=>e,"refusal")}}a(zt,"heartbeatEnd");function QS(e,t,r={}){let o=r.intervalMs??WS,n=!1,i=!1,s=a(()=>{n||(n=!0,clearInterval(u))},"stop"),c=a(async()=>{if(!(n||i)){i=!0;try{await t.heartbeat(e)}catch(l){l instanceof we?(s(),r.onRefused?.(l)):sy(l)?(s(),r.onRevoked?.(l instanceof $r?l:new $r)):r.onTransientError?.(l)}finally{i=!1}}},"tick"),u=setInterval(()=>void c(),o);return u.unref?.(),c(),s}a(QS,"startHeartbeat");function Mt(e,t,r={}){return!t||!YS(e)?()=>{}:QS(e,t,r)}a(Mt,"maybeStartHeartbeat");async function Iu(){let e=process.env.NPAYLOAD_CLIENT_ID,t=(process.env.NPAYLOAD_CLIENT_SECRET??process.env.NPAYLOAD_HMAC_SECRET)?.trim()||void 0,r;if(!e)try{let u=await Sr();e=u.clientId,t=t??u.hmacSecret,r=u.dpopPrivateJwk}catch{}if(!e)throw new R("Not authenticated.",{code:"NOT_AUTHENTICATED",hint:"Run `"+b("init")+"` (device flow), or export NPAYLOAD_CLIENT_ID + NPAYLOAD_HMAC_SECRET."});let{apiUrl:o,authUrl:n,guard:i}=_r(),s=li({env:process.env,credentialKey:r})??(await Xo()).privateJwk,c=process.env.NPAYLOAD_APP_ID;return ii({clientId:e,dpopPrivateJwk:s,baseUrl:o,...t!==void 0?{clientSecret:t}:{},...n!==void 0?{authUrl:n}:{},...c!==void 0?{appId:c}:{}},i)}a(Iu,"resolveKernel");function eI(e){return/^(ch|chn)_/.test(e)}a(eI,"isChannelGid");async function Pu(e,t,r){if(eI(t))return t;if(!r)throw new R("Cannot resolve the channel slug given to --channel without an app (the slug is not shown here).",{code:"NO_APP_FOR_SLUG",hint:"Pass --app <app_\u2026> (or set NPAYLOAD_APP_ID), or pass a channel GID directly as --channel ch_\u2026"});let o=await e.send({method:"GET",path:`/v1/apps/channels/by-slug/${encodeURIComponent(t)}`,scope:"events:read"}),n=o.gid??o.channelId??o.id??o._id;if(!n)throw new R("The channel given to --channel was not found in the app (neither is shown here).",{code:"CHANNEL_NOT_FOUND",hint:"Create it first (publish/subscribe in the scaffold), or pass a channel GID with --channel ch_\u2026"});return n}a(Pu,"resolveChannelGid");function tI(e){return e.publicUrl?{url:e.publicUrl,note:"using --public-url"}:{url:`http://localhost:${e.port}/`,note:"localhost is not reachable from npayload's delivery: pass --public-url with a tunnel's address"}}a(tI,"deliveryEndpointUrl");async function nI(e,t){let r=t.events&&t.events.length===1?t.events[0]:void 0,o={name:t.name,type:"webhook",endpoint:{url:t.endpointUrl}};r&&(o.subjectFilter=r);try{let n=await e.send({method:"POST",path:`/v1/channels/${encodeURIComponent(t.channelGid)}/subscriptions`,body:o,scope:"events:write"}),i=n.gid??n.subscriptionId??n.id??n._id;if(!i)throw new R("Subscription created but no id was returned.",{code:"SUBSCRIPTION_NO_ID",hint:"Cannot guarantee cleanup without an id \u2014 aborting. Check the cell create response."});return i}catch(n){F(n);let i=n instanceof Error?n.message:String(n);if(/already.?exists|ALREADY_EXISTS/i.test(i)){let s=await rI(e,t.channelGid,t.name);if(s)return s}throw n}}a(nI,"registerTempSubscription");async function rI(e,t,r){let o=await e.send({method:"GET",path:`/v1/channels/${encodeURIComponent(t)}/subscriptions`,scope:"events:read"}),i=(o.subscriptions??o.items??[]).find(c=>c.name===r);if(!i)return;let s=i.gid??i.subscriptionId??i.id??i._id;return typeof s=="string"?s:void 0}a(rI,"findSubscriptionByName");async function oI(e,t){await e.send({method:"DELETE",path:`/v1/subscriptions/${encodeURIComponent(t)}`,scope:"events:write"})}a(oI,"deleteSubscription");async function iI(e){let t=[];for await(let r of e)t.push(r);return Buffer.concat(t).toString("utf8")}a(iI,"readBody");async function sI(e,t,r){let o={"content-type":"application/json"};for(let i of["x-npayload-signature","x-webhook-signature","x-npayload-timestamp","x-npayload-event-type","x-npayload-delivery-id"]){let s=r[i];typeof s=="string"&&(o[i]=s)}return(await Dt(qe())(e,{method:"POST",headers:o,body:t})).status}a(sI,"forwardDelivery");function aI(e){let t=e.log??(r=>void process.stderr.write(`${r}
|
|
235
|
+
`));return XS((r,o)=>{(async()=>{if(r.method==="GET"&&(r.url==="/health"||r.url==="/")){o.writeHead(200,{"content-type":"application/json"}),o.end(JSON.stringify({status:"ok"}));return}if(r.method!=="POST"){o.writeHead(404),o.end();return}let n=await iI(r),i=new Date().toISOString().slice(11,19);if(t(`${ne.dim(i)} ${ne.green("\u2190")} ${cI(n)}`),!e.printOnly)try{let s=await sI(e.forwardTo,n,r.headers),c=s>=200&&s<300?ne.green("\u2192"):ne.red("\u2192");t(` ${c} forwarded to ${ne.dim(e.forwardTo)} ${ne.dim(`[${s}]`)}`)}catch(s){let c=s instanceof Error?s.message:String(s);t(` ${ne.red("\u2192")} forward failed: ${ne.dim(ae(c,s))}`)}o.writeHead(200,{"content-type":"application/json"}),o.end(JSON.stringify({received:!0}))})()})}a(aI,"createListenServer");function cI(e){try{let t=JSON.parse(e),r=t.eventType??t.type??"event",o=t.messageGid??t.id??t.deliveryId??"";return`${ne.cyan(String(r))}${o?ne.dim(` ${String(o)}`):""}`}catch{return ne.dim(`${e.length} bytes (non-JSON)`)}}a(cI,"summarize");function ob(e){e.command("listen").description("forward npayload webhooks to a local URL (registers a temporary subscription, cleans up on exit)").option("--channel <slug|gid>","channel to listen on (slug needs --app, or pass a ch_\u2026 GID)","signals").option("--forward-to <url>","local URL to forward each event to","http://localhost:3001/hooks/signals").option("--forward <url>","alias of --forward-to").option("--events <types>","comma-separated event-type allowlist (a single type is applied as a subject filter)",t=>t.split(",").map(r=>r.trim()).filter(Boolean)).option("--print","log received events only; do not forward to --forward-to").option("--public-url <url>","explicit public/tunnel URL npayload should deliver to (e.g. an ngrok URL); required against production").option("--app <app_\u2026>","app GID to scope channel resolution + subscription (default NPAYLOAD_APP_ID)").option("--port <port>","local receiver port (default: ephemeral)",t=>Number(t)).action(async t=>{let r={channel:t.channel??"signals",forwardTo:t.forward??t.forwardTo??"http://localhost:3001/hooks/signals",events:t.events,printOnly:t.print===!0,publicUrl:t.publicUrl,appId:t.app??process.env.NPAYLOAD_APP_ID,port:typeof t.port=="number"&&!Number.isNaN(t.port)?t.port:0};try{await uI(r)}catch(o){pe(o)}})}a(ob,"registerListen");async function uI(e){e.printOnly||qe().check(e.forwardTo);let r=await Iu(),o=new An("Resolving channel\u2026").start(),n;try{n=await Pu(r,e.channel,e.appId)}catch(_){throw o.fail("Could not resolve the channel."),_}o.succeed(`Channel ${ne.cyan(e.channel)} \u2192 ${ne.dim(n)}`);let i=null,s=!1,c=aI({forwardTo:e.forwardTo,printOnly:e.printOnly});await new Promise((_,N)=>{c.once("error",N),c.listen(e.port,"0.0.0.0",()=>_())});let u=c.address().port,{url:l,note:d}=tI({publicUrl:e.publicUrl,port:u}),f=`np-listen-${u}`,p=new An("Registering temporary subscription\u2026").start();try{i=await nI(r,{channelGid:n,endpointUrl:l,name:f,events:e.events})}catch(_){throw p.fail("Could not register the subscription."),c.close(),_}p.succeed(`Subscription ${ne.dim(i)} \u2192 ${ne.cyan(l)}`);let m=await Ze().catch(()=>null),g=zt(),v=Mt("listen",m,{onRevoked:a(()=>pt(),"onRevoked"),onRefused:g.onRefused}),h=!1,k=a(async()=>{if(s)return;s=!0,v(),process.stderr.write(`
|
|
236
|
+
`);let _=new An("Cleaning up the temporary subscription\u2026").start();try{i&&await oI(r,i),_.succeed("Temporary subscription removed.")}catch(N){let I=N instanceof Error?N.message:String(N);N instanceof we?(h=!0,_.stop(),process.stderr.write(`${ne.yellow("\u26A0")} ${ae(`Could not delete subscription ${i??"?"}: ${I}`,N)}
|
|
237
|
+
`)):_.warn(`Could not delete subscription ${i??"?"}: ${I}`)}finally{c.close()}},"cleanup"),T=a(()=>{k().then(()=>process.exit(h?1:0))},"onSignal");process.on("SIGINT",T),process.on("SIGTERM",T),process.stderr.write(["",ne.bold("Listening for npayload events\u2026"),` ${ne.dim("channel")} ${e.channel} ${ne.dim(`(${n})`)}`,` ${ne.dim("endpoint")} ${l} ${ne.dim(`(${d})`)}`,e.printOnly?` ${ne.dim("mode")} print-only (not forwarding)`:` ${ne.dim("forward to")} ${e.forwardTo}`,e.events?` ${ne.dim("events")} ${e.events.join(", ")}`:"","",ne.dim(" Publish one with: npx tsx npayload/events/publish.ts"),ne.dim(" Press Ctrl-C to stop and remove the temporary subscription."),""].filter(_=>_!=="").join(`
|
|
239
238
|
`)+`
|
|
240
|
-
`);try{await g.ended}catch(k){throw s=!0,process.removeListener("SIGINT",E),process.removeListener("SIGTERM",E),c.close(),k}}a(Y$,"runListen");import{readFile as Q$}from"fs/promises";import Ui from"chalk";async function X$(e,t,r){if(r){let o;try{o=await Q$(r,"utf8")}catch(n){throw new C(`Cannot read --payload-file ${r}.`,{code:"PAYLOAD_FILE_UNREADABLE",hint:"Pass a readable JSON file, e.g. --payload-file ./sample.json",cause:n})}try{return{payload:JSON.parse(o),source:"payload-file"}}catch(n){throw new C(`--payload-file ${r} is not valid JSON.`,{code:"PAYLOAD_FILE_INVALID_JSON",hint:"The sample payload must be a JSON document.",cause:n})}}try{let o=await e.send({method:"GET",path:"/v1/event-catalogue",scope:"events:read"}),i=(Array.isArray(o)?o:o.items??o.entries??[]).find(s=>s.eventType===t||s.name===t);if(i&&i.example!==void 0)return{payload:i.example,source:"catalogue-example"}}catch(o){M(o)}return{payload:{sample:!0,eventType:t,note:"generated by `np trigger` \u2014 register a catalogue example for a realistic payload"},source:"generated-sample"}}a(X$,"resolveTriggerPayload");async function eS(e,t){let r=await e.send({method:"POST",path:`/v1/channels/${encodeURIComponent(t.channelGid)}/messages`,body:{payload:t.payload,routingKey:t.eventType,metadata:{source:"np-trigger"}},scope:"messages:write"});return{messageGid:r.gid??r.messageGid??r.id}}a(eS,"fireTrigger");function xv(e,t){e.command("trigger").argument("<event-type>","event type to fire, e.g. order.confirmed").description("Fire a sample event of the given type for webhook-handler testing (pairs with `np listen`)").option("--channel <channel>","channel slug or GID to publish into","events").option("--app <appId>","app the channel slug resolves under (or NPAYLOAD_APP_ID)").option("--payload-file <path>","JSON file overriding the sample payload").action(async(r,o)=>{let n=await t.resolveKernel(),i=o.app??process.env.NPAYLOAD_APP_ID,s=await t.resolveChannelGid(n,o.channel,i),{payload:c,source:l}=await X$(n,r,o.payloadFile),{messageGid:u}=await eS(n,{channelGid:s,eventType:r,payload:c});console.log(`${Ui.green("\u2714")} fired ${Ui.bold(r)} on ${o.channel} ${Ui.dim(`(payload: ${l}${u?`, message ${u}`:""})`)}`),console.log(Ui.dim(" Watching for it? `np listen --forward http://localhost:PORT/webhook`"))})}a(xv,"registerTrigger");import{existsSync as oS,readFileSync as iS}from"fs";import{join as Iv}from"path";import Ge from"chalk";import tS from"ajv";var dl="d6f97f724c494689c7307f26fa9081b55303f9d0c6f4b7b9523b2f4a26172cb3",zi={$schema:"http://json-schema.org/draft-07/schema#",title:"ConnectConfig",type:"object",additionalProperties:!1,properties:{bridges:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{entityTypeSlug:{type:"string",maxLength:4096}}}}}};var kv="dc3cb629dd49ea35025a10e40f58ee3165989ab7d43c13dff891a90efe5d1914",Mi={$schema:"http://json-schema.org/draft-07/schema#",title:"PipesConfig",type:"object",additionalProperties:!1,properties:{credentials:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{connectorId:{type:"string",maxLength:4096},auth:{type:"object",properties:{type:{type:"string",maxLength:4096},nangoConnectionId:{type:"string",maxLength:4096},vaultSecretId:{type:"string",maxLength:4096},expiresAt:{type:"number"}},required:["type"],additionalProperties:!1}}}},governance:{type:"object",additionalProperties:!1,properties:{mode:{type:"string",enum:["open","allowlist","approval_required"]},allowedConnectors:{type:"array",items:{type:"string",maxLength:4096}},blockedConnectors:{type:"array",items:{type:"string",maxLength:4096}},allowedTiers:{type:"array",items:{type:"number"}},allowedCategories:{type:"array",items:{type:"string",maxLength:4096}},requireFirstUseApproval:{type:"boolean"},autoApproveInternalConnectors:{type:"boolean"},maxCredentialsPerConnector:{type:"number"},auditConfig:{type:"object",properties:{logAllActions:{type:"boolean"},logCredentialAccess:{type:"boolean"},retentionDays:{type:"number"}},required:["logAllActions","logCredentialAccess","retentionDays"],additionalProperties:!1}}},workflows:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{description:{type:"string",maxLength:4096},definition:{type:"object",properties:{nodes:{type:"array",items:{type:"object",properties:{id:{type:"string",maxLength:4096},type:{type:"string",maxLength:4096},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1},data:{}},required:["id","type","position","data"],additionalProperties:!1}},edges:{type:"array",items:{type:"object",properties:{id:{type:"string",maxLength:4096},source:{type:"string",maxLength:4096},target:{type:"string",maxLength:4096},sourceHandle:{type:"string",maxLength:4096},targetHandle:{type:"string",maxLength:4096}},required:["id","source","target"],additionalProperties:!1}},viewport:{}},required:["nodes","edges"],additionalProperties:!1},triggerConfig:{type:"object",properties:{type:{type:"string",maxLength:4096},config:{type:"object",additionalProperties:{},propertyNames:{maxLength:256,not:{enum:["__proto__","constructor","prototype"]}}}},required:["type","config"],additionalProperties:!1},maxDurationMs:{type:"number"}}}}}};var _v="41cca5221cf2d3f14ebe43426ffadbc50816dfa8db8d6325205687a732db66dc",Tt={$schema:"http://json-schema.org/draft-07/schema#",title:"PrimusConfig",type:"object",additionalProperties:!1,properties:{agents:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{name:{type:"string",maxLength:4096},description:{type:"string",maxLength:4096},systemPrompt:{type:"string",maxLength:4096},personality:{type:"string",maxLength:4096},language:{type:"string",maxLength:4096},skills:{type:"array",items:{type:"string",maxLength:4096}},isDiscoverable:{type:"boolean"},trustLevel:{type:"string",enum:["restricted","standard","elevated","admin"]},defaultModel:{type:"string",maxLength:4096},maxTurns:{type:"number"}},required:["name","systemPrompt"]}},skills:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{name:{type:"string",maxLength:4096},description:{type:"string",maxLength:4096},category:{type:"string",maxLength:4096},icon:{type:"string",maxLength:4096},executor:{type:"string",enum:["inline","webhook","dynamic_worker","container","gpu","openshell","cloud_run","fly_machines","k8s_jobs"]},definition:{type:"object",properties:{systemPrompt:{type:"string",maxLength:4096},tools:{type:"array",items:{type:"string",maxLength:4096}},examples:{type:"array",items:{type:"object",properties:{input:{type:"string",maxLength:4096},output:{type:"string",maxLength:4096}},required:["input","output"],additionalProperties:!1}},endpoint:{type:"string",maxLength:4096},containerImage:{type:"string",maxLength:4096}},additionalProperties:!1},limits:{type:"object",properties:{maxExecutionTime:{type:"number"},maxMemory:{type:"number"},maxCost:{type:"number"}},additionalProperties:!1},enabled:{type:"boolean"}},required:["name","description","executor","definition"]}},tools:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{name:{type:"string",maxLength:4096},description:{type:"string",maxLength:4096},parameters:{type:"object",additionalProperties:{},propertyNames:{maxLength:256,not:{enum:["__proto__","constructor","prototype"]}}},outputSchema:{type:"object",additionalProperties:{},propertyNames:{maxLength:256,not:{enum:["__proto__","constructor","prototype"]}}},riskLevel:{type:"string",enum:["safe","moderate","dangerous"]},requiresApproval:{type:"boolean"},endpoint:{type:"string",maxLength:4096},uri:{type:"string",maxLength:4096},authType:{type:"string",enum:["none","bearer","apiKey","basic","oauth","hmac"]},scopes:{type:"array",items:{type:"string",maxLength:4096}},executor:{type:"string",enum:["webhook","inline","dynamic_worker","container","gpu","openshell"]},timeout:{type:"number"},category:{type:"string",maxLength:4096},headers:{type:"object",additionalProperties:{type:"string",pattern:"^[^\\r\\n]*$",maxLength:4096},propertyNames:{pattern:"^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,128}$"}}},required:["description","riskLevel"]}},triggers:{type:"object",maxProperties:500,propertyNames:{pattern:"^[a-z0-9][a-z0-9._-]{0,126}$"},additionalProperties:{type:"object",additionalProperties:!1,properties:{agentGid:{type:"string",maxLength:4096},name:{type:"string",maxLength:4096},description:{type:"string",maxLength:4096},type:{type:"string",maxLength:4096},config:{type:"object",properties:{cronExpression:{type:"string",maxLength:4096},eventType:{type:"string",maxLength:4096},webhookId:{type:"string",maxLength:4096},channel:{type:"string",maxLength:4096}},additionalProperties:!1},action:{type:"object",properties:{goal:{type:"string",maxLength:4096},skillIds:{type:"array",items:{type:"string",description:"skills id",maxLength:4096}},maxTurns:{type:"number"}},required:["goal"],additionalProperties:!1},conditions:{type:"array",items:{type:"object",properties:{field:{type:"string",maxLength:4096},operator:{type:"string",maxLength:4096},value:{oneOf:[{type:"string",maxLength:4096},{type:"number"},{type:"boolean"},{type:"null"}]}},required:["field","operator","value"],additionalProperties:!1}},enabled:{type:"boolean"}},required:["name","config","action"]}}}};function Sv(e){let t=e.replace(/^\[|\]$/g,"").toLowerCase();if(t==="localhost"||t.endsWith(".localhost")||t.endsWith(".internal")||t.endsWith(".local")||t==="::1"||t==="::"||t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe8")||t.startsWith("fe9")||t.startsWith("fea")||t.startsWith("feb"))return!0;let r=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(!r)return!1;let[o,n]=[Number(r[1]),Number(r[2])];return o===10||o===127||o===0||o===169&&n===254||o===192&&n===168||o===172&&n>=16&&n<=31||o===100&&n>=64&&n<=127}a(Sv,"isReservedHost");function nS(e,t={}){let r;try{r=new URL(e)}catch{return!1}return r.username||r.password?!1:t.allowInternal?r.protocol==="http:"||r.protocol==="https:":!(r.protocol!=="https:"||Sv(r.hostname))}a(nS,"isSafeWebhookUrl");function rS(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"||Sv(t.hostname)}a(rS,"isPlainOrReservedDoor");function qi(e={},t=process.env){if(e.strict===!0)return!1;if(e.allowInternalUrls===!0||t.NPAYLOAD_ALLOW_INTERNAL_URLS==="1")return!0;let r=ne(t.NPAYLOAD_API_URL,"apiUrl");return r!==void 0&&rS(r)}a(qi,"resolveUrlPosture");function Fi(e,t,r={}){let o=new tS({allErrors:!0,strict:!1});o.addFormat("npayload-safe-url",c=>nS(c,{allowInternal:r.allowInternalUrls??!1}));let n=o.compile(e);return n(t)?{ok:!0,issues:[]}:{ok:!1,issues:(n.errors??[]).map(c=>{let l=c.params??{},u=Object.keys(l).length?` (${JSON.stringify(l)})`:"";return{path:c.instancePath||"(root)",message:`${c.message??"invalid"}${u}`,..."allowedValues"in l?{allowed:l.allowedValues}:{}}})}}a(Fi,"validateConfig");function Wr(e,t={}){return Fi(Cn,e,t)}a(Wr,"validateEventsConfig");function Hr(e,t={}){return Fi(Mi,e,t)}a(Hr,"validatePipesConfig");function pl(e,t={}){return Fi(zi,e,t)}a(pl,"validateConnectConfig");var $v=/^[a-z][a-z0-9_]*$/;function Yr(e,t={}){let o=[...Fi(Tt,e,t).issues],n=e??{};for(let s of["skills","tools"])for(let c of Object.keys(n[s]??{}))$v.test(c)||o.push({path:`/${s}/${c}`,message:`invalid ${s.slice(0,-1)} name "${c}" \u2014 must match ${String($v)} (lowercase + digits + underscores; hyphens are rejected by the platform)`});let i=e??{};for(let s of Sr()){let c=i[s];if(c)for(let[l,u]of Object.entries(c))for(let d of ln(s)){let m=new Set(Object.keys(i[d.parent]??{})),p=oi(Tn(u,d.path))??[];for(let f of p)m.has(f)||Yh(f)||o.push({path:`/${s}/${l}/${d.path}`,message:`${s} "${l}" references ${d.parent.slice(0,-1)} "${f}", which is not declared in this config's ${d.parent} map. If it exists live (created in the dashboard/CLI), run \`npayload wire\` to confirm it; otherwise declare it or fix the name.`})}}return{ok:o.length===0,issues:o}}a(Yr,"validatePrimusConfig");function Pv(e){return kh(e).map(t=>({path:t.path,message:`raw secret-classified header "${t.header}" present in config \u2014 replace the literal value with a secret reference "{{ secrets.NAME }}"; \`np pull\` writes references, \`np push\` resolves them`}))}a(Pv,"secretHeaderIssues");function Ev(e){e.command("validate").description("Validate a config against the contract (structure + security + relationships)").option("--config <path>","path to the config (default: the product's config)").option("--product <product>","which config to validate: events | primus | pipes","events").option("--allow-internal-urls","allow localhost / private webhook URLs (to test against your own receiver; never in production)").option("--strict","force the production security posture (reject internal/loopback URLs even on a dev machine)").action(async t=>{try{let r=t.product??"events",o=En();o&&Bh(o.accessScopes);let n=qi({allowInternalUrls:t.allowInternalUrls,strict:t.strict});if(r==="primus"||r==="pipes"){let d=t.config??Ke(r);d||(process.stderr.write(Ge.red(`no ${r}.config.ts found (pass --config).
|
|
241
|
-
`)),process.exit(1));let
|
|
242
|
-
`)),process.exit(0));let g=[...p.issues,...
|
|
243
|
-
`));for(let v of g)process.stderr.write(` ${
|
|
244
|
-
`);process.exit(1)}let i=t.config??
|
|
245
|
-
`));let d=
|
|
246
|
-
`))}catch{process.stdout.write(
|
|
247
|
-
`)),process.exit(0)}process.stderr.write(
|
|
248
|
-
`));for(let d of
|
|
249
|
-
`)}process.exit(1)}catch(r){let o=r instanceof Error?r.message:String(r);process.stderr.write(
|
|
250
|
-
`)),process.exit(1)}})}a(
|
|
239
|
+
`);try{await g.ended}catch(_){throw s=!0,process.removeListener("SIGINT",T),process.removeListener("SIGTERM",T),c.close(),_}}a(uI,"runListen");import{readFile as lI}from"fs/promises";import Wi from"chalk";async function dI(e,t,r){if(r){let o;try{o=await lI(r,"utf8")}catch(n){throw new R("Cannot read the file --payload-file names (the path is not shown here).",{code:"PAYLOAD_FILE_UNREADABLE",hint:"Pass a readable JSON file, e.g. --payload-file ./sample.json",cause:n})}try{return{payload:JSON.parse(o),source:"payload-file"}}catch(n){throw new R("The file --payload-file names is not valid JSON (the path is not shown here).",{code:"PAYLOAD_FILE_INVALID_JSON",hint:"The sample payload must be a JSON document.",cause:n})}}try{let o=await e.send({method:"GET",path:"/v1/event-catalogue",scope:"events:read"}),i=(Array.isArray(o)?o:o.items??o.entries??[]).find(s=>s.eventType===t||s.name===t);if(i&&i.example!==void 0)return{payload:i.example,source:"catalogue-example"}}catch(o){F(o)}return{payload:{sample:!0,eventType:t,note:"generated by `np trigger` \u2014 register a catalogue example for a realistic payload"},source:"generated-sample"}}a(dI,"resolveTriggerPayload");async function pI(e,t){let r=await e.send({method:"POST",path:`/v1/channels/${encodeURIComponent(t.channelGid)}/messages`,body:{payload:t.payload,routingKey:t.eventType,metadata:{source:"np-trigger"}},scope:"messages:write"});return{messageGid:r.gid??r.messageGid??r.id}}a(pI,"fireTrigger");function ib(e,t){e.command("trigger").argument("<event-type>","event type to fire, e.g. order.confirmed").description("Fire a sample event of the given type for webhook-handler testing (pairs with `np listen`)").option("--channel <channel>","channel slug or GID to publish into","events").option("--app <appId>","app the channel slug resolves under (or NPAYLOAD_APP_ID)").option("--payload-file <path>","JSON file overriding the sample payload").action(async(r,o)=>{let n=await t.resolveKernel(),i=o.app??process.env.NPAYLOAD_APP_ID,s=await t.resolveChannelGid(n,o.channel,i),{payload:c,source:u}=await dI(n,r,o.payloadFile),{messageGid:l}=await pI(n,{channelGid:s,eventType:r,payload:c});console.log(`${Wi.green("\u2714")} fired ${Wi.bold(r)} on ${o.channel} ${Wi.dim(`(payload: ${u}${l?`, message ${l}`:""})`)}`),console.log(Wi.dim(" Watching for it? `"+b("listen --forward http://localhost:PORT/webhook")+"`"))})}a(ib,"registerTrigger");import{existsSync as fI,readFileSync as mI}from"fs";import{join as sb}from"path";import Be from"chalk";function ab(e,t){return qh(e,t).map(r=>({path:r.path,message:`raw secret-classified header ${r.nameRefused?"(its name is not shown here)":`"${r.header}"`} present in config`+(r.inRefusedEntry?" (in an entry whose name is not shown here)":"")+` \u2014 replace the literal value with a secret reference "{{ secrets.NAME }}"; \`${b("pull")}\` writes references, \`${b("push")}\` resolves them`}))}a(ab,"secretHeaderIssues");function cb(e){e.command("validate").description("Validate a config against the contract (structure + security + relationships)").option("--config <path>","path to the config (default: the product's config)").option("--product <product>","which config to validate: events | primus | pipes","events").option("--allow-internal-urls","allow localhost / private webhook URLs (to test against your own receiver; never in production)").option("--strict","force the production security posture (reject internal/loopback URLs even on a dev machine)").action(async t=>{try{let r=t.product??"events",o=Cn();o&&dy(o.accessScopes);let n=fi({allowInternalUrls:t.allowInternalUrls,strict:t.strict});if(r==="primus"||r==="pipes"){let d=t.config??He(r);d||(process.stderr.write(Be.red(`no ${r}.config.ts found (pass --config).
|
|
240
|
+
`)),process.exit(1));let f=await le(d),p=r==="primus"?Cr(f,{allowInternalUrls:n}):Ar(f,{allowInternalUrls:n}),m=ab(f,p.refused);p.ok&&m.length===0&&(process.stdout.write(Be.green.bold(`\u2713 ${r}.config is valid.
|
|
241
|
+
`)),process.exit(0));let g=[...p.issues,...m];process.stderr.write(Be.red.bold(`\u2717 ${r}.config has ${g.length} problem(s):
|
|
242
|
+
`));for(let v of g)process.stderr.write(` ${Be.yellow(v.path)} ${v.message}
|
|
243
|
+
`);process.exit(1)}let i=t.config??Ye(),s=await le(i),u=Tr(s,{allowInternalUrls:n}),l=ab(s,u.refused);if(l.length>0&&(u.ok=!1,u.issues.push(...l)),u.ok){process.stdout.write(Be.green.bold(`\u2713 events.config is valid.
|
|
244
|
+
`));let d=sb(process.cwd(),"npayload","_generated","contract.lock");if(fI(d))try{JSON.parse(mI(d,"utf8")).hash!==Er&&process.stdout.write(Be.yellow(`! contract.lock was pinned against a different npayload contract \u2014 re-validate after upgrading.
|
|
245
|
+
`))}catch{process.stdout.write(Be.yellow("! contract.lock is unreadable \u2014 regenerate via `"+b("init")+"`.\n"))}let f=sb(i,"..","permissions.generated.ts"),{projectAllPermissions:p}=await import("../chunk-O2USGVDT.mjs"),{checkScopesDrift:m}=await import("../chunk-2ZK6PEZR.mjs"),g=m(await p(),f);!g.ok&&g.reason&&process.stdout.write(Be.yellow(`! ${g.reason}
|
|
246
|
+
`)),process.exit(0)}process.stderr.write(Be.red.bold(`\u2717 events.config has ${u.issues.length} problem(s):
|
|
247
|
+
`));for(let d of u.issues){let f=d.allowed?Be.dim(` allowed: ${JSON.stringify(d.allowed)}`):"";process.stderr.write(` ${Be.yellow(d.path)} ${d.message}${f}
|
|
248
|
+
`)}process.exit(1)}catch(r){let o=r instanceof Error?r.message:String(r);process.stderr.write(Be.red(`validate failed: ${o}
|
|
249
|
+
`)),process.exit(1)}})}a(cb,"registerValidate");import{existsSync as Tu,mkdirSync as gI,readFileSync as Au}from"fs";import{join as lb,resolve as Eu}from"path";var ub=/^[A-Za-z_][A-Za-z0-9_]*$/;function Cu(e){return lb(e,"npayload",".env")}a(Cu,"secretEnvPath");function hI(e,t,r){let o=`${t}="${r}"`,n=e.length>0?e.replace(/\r?\n$/,"").split(/\r?\n/):[],i=a(u=>{let l=u.trim().replace(/^export\s+/,""),d=l.indexOf("=");return d>0&&l.slice(0,d).trim()===t},"isName"),s=[],c=!1;for(let u of n){if(i(u)){c||s.push(o),c=!0;continue}s.push(u)}return c||s.push(o),{text:s.join(`
|
|
251
250
|
`)+`
|
|
252
|
-
`,replaced:c}}a(
|
|
251
|
+
`,replaced:c}}a(hI,"upsertDotenv");function Hi(e){if(!ub.test(e))throw new Q(`invalid secret name (the NAME given is not shown here) \u2014 a name must match ${ub.source} so a config can reference it as {{ secrets.NAME }}`)}a(Hi,"assertSecretName");function yI(e,t,r){if(Hi(t),r==="")throw new Q("refusing to set the secret to an empty value; nothing was written");if(/[\r\n]/.test(r))throw new Q("the value spans several lines \u2014 a secret must be one line; nothing was written");let o=Cu(e);gI(lb(e,"npayload"),{recursive:!0});let n=Tu(o)?Au(o,"utf8"):"",{text:i,replaced:s}=hI(n,t,r);return Xe(o,i),{path:o,replaced:s}}a(yI,"mintSecret");var no="npayload/.env";function vI(e){let t=Cu(e);return Tu(t)?Object.keys(ai(Au(t,"utf8"))).sort():[]}a(vI,"listSecretNames");function bI(e,t){if(e.length===0)return{text:e,removed:!1};let r=/\r?\n$/.test(e),o=e.replace(/\r?\n$/,"").split(/\r?\n/),n=o.filter(i=>{let s=i.trim().replace(/^export\s+/,""),c=s.indexOf("=");return!(c>0&&s.slice(0,c).trim()===t)});return n.length===o.length?{text:e,removed:!1}:{text:n.length===0?"":n.join(`
|
|
253
252
|
`)+(r?`
|
|
254
|
-
`:""),removed:!0}}a(
|
|
253
|
+
`:""),removed:!0}}a(bI,"removeDotenvKey");function wI(e,t,r={}){Hi(t);let o=Cu(e),n=Tu(o)?Au(o,"utf8"):"",{text:i,removed:s}=bI(n,t);if(!s){let c=r.byProjectFlag?`${no} of the folder --project names`:no,u=b(r.byProjectFlag?"secret list --project <dir>":"secret list");throw new Q(`no secret by the name given (not shown here) in ${c}; nothing was deleted; \`${u}\` shows the names it holds`)}return Xe(o,i),{path:o}}a(wI,"deleteSecret");async function kI(e){if(!process.stdin.isTTY){let r=[];for await(let o of process.stdin)r.push(Buffer.isBuffer(o)?o:Buffer.from(String(o)));return Buffer.concat(r).toString("utf8").replace(/\r?\n$/,"")}let{password:t}=await import("@inquirer/prompts");return t({message:`Value for ${e}`,mask:!0})}a(kI,"readSecretValue");function db(e,t){let r=e.command("secret").description("Manage local secret values referenced as {{ secrets.NAME }} in your config");r.command("set").argument("<NAME>","secret name, referenced in config as {{ secrets.NAME }}").description("Mint NAME into the git-ignored npayload/.env (value from stdin, or a masked prompt) so {{ secrets.NAME }} resolves on push / deploy").option("--project <dir>","project root (default: the current directory)").action(async(o,n)=>{try{let i=Eu(n.project??process.cwd());Hi(o);let s=await(t.readSecret??kI)(o),{replaced:c}=yI(i,o,s);t.print({secret:o,file:"npayload/.env",action:c?"replaced":"set",reference:`{{ secrets.${o} }}`})}catch(i){t.printError(i instanceof Error?i.message:String(i)),process.exitCode=1}}),r.command("list").description("List the secrets in the git-ignored npayload/.env by name, each with its {{ secrets.NAME }} reference (values are never shown)").option("--project <dir>","project root (default: the current directory)").action(o=>{try{let n=Eu(o.project??process.cwd());t.print({file:no,secrets:vI(n).map(i=>({name:i,reference:`{{ secrets.${i} }}`}))})}catch(n){t.printError(n instanceof Error?n.message:String(n)),process.exitCode=1}}),r.command("delete").argument("<NAME>","secret name to remove from npayload/.env").description("Delete NAME from the git-ignored npayload/.env; {{ secrets.NAME }} stops resolving from that file").option("--project <dir>","project root (default: the current directory)").option("--yes","delete without asking for confirmation").action(async(o,n)=>{try{let i=Eu(n.project??process.cwd());if(Hi(o),!n.yes&&!await(t.confirm??(async()=>!1))(`Delete the secret you named from ${no}? Its value cannot be recovered.`)){t.printError("kept the secret: nothing was deleted (pass --yes to delete without asking)"),process.exitCode=1;return}wI(i,o,{byProjectFlag:n.project!==void 0}),t.print({secret:o,file:no,action:"deleted"})}catch(i){t.printError(i instanceof Error?i.message:String(i)),process.exitCode=1}})}a(db,"registerSecret");var xI={env:"the NPAYLOAD_CLIENT_ID environment variable",env_token:"the NPAYLOAD_TOKEN environment variable",project:"this project's .npayload.json",keychain:"np login (your OS keychain)"};async function _I(e){let{clientId:t,source:r}=await e.credential(),o=await e.token();return{clientId:t,signedInWith:xI[r],scopes:[...o.scopes].sort(),expiresAt:new Date(o.expiresAt).toISOString()}}a(_I,"readAuthStatus");function pb(e,t){uu(e).command("status").description("Show the client the CLI signs in as, where it was found, its scopes and when its token expires (no secret, token or key is ever shown)").action(async()=>{try{t.print(await _I(t))}catch(r){t.printError(Ee(r instanceof Error?r.message:String(r),r)),process.exitCode=jt(r)}})}a(pb,"registerAuth");import{existsSync as Ru,readFileSync as $I,writeFileSync as SI,mkdirSync as II,rmSync as PI}from"fs";import{resolve as mb,join as ro,dirname as EI}from"path";import Ft from"chalk";var gb=["contract.lock","events.d.ts"];function TI(){return{appName:"",appSlug:"",appId:"",appType:"internal",framework:"none",clientId:"",hmacSecret:""}}a(TI,"stubContext");async function hb(e){let t=mb(e),o=(await le(t)).eventTypes,n=o?Object.values(o).filter(i=>i?.schema?.definition).length:0;return{dir:ro(EI(t),"_generated"),files:{"contract.lock":Mr(TI()),"events.d.ts":n>0&&o?by(o):null}}}a(hb,"renderGeneratedLayer");async function AI(e){let{dir:t,files:r}=await hb(e);II(t,{recursive:!0});let o=[],n=[];for(let i of gb){let s=ro(t,i),c=r[i];if(c===null){Ru(s)&&(PI(s),n.push(i));continue}SI(s,c,"utf8"),o.push(i)}return{dir:t,written:o,removed:n}}a(AI,"runGenerate");async function CI(e){let{dir:t,files:r}=await hb(e),o=[];for(let n of gb){let i=ro(t,n),s=r[n],c=Ru(i);if(s===null){c&&o.push({file:n,why:"present, but the pin produces no such file"});continue}c?$I(i,"utf8")!==s&&o.push({file:n,why:"differs from the pinned projection"}):o.push({file:n,why:"missing"})}return{dir:t,drifted:o}}a(CI,"runCheck");function fb(e){let t=e?mb(e):Ye();if(!Ru(t))throw new Error(`no events config found ${e?"at the path --config names (it is not shown here)":"in this project"} \u2014 run \`${b("init")}\` first, or pass --config <path>.`);return t}a(fb,"resolveConfig");function yb(e,t){e.command("generate").description("Regenerate _generated/ (contract.lock + events.d.ts) from the pinned contract (strict, never hand-edited)").option("--config <path>","path to events.config.ts (default: npayload/events.config.ts)").action(async r=>{try{let{dir:o,written:n,removed:i}=await AI(fb(r.config)),s=[...n.map(c=>` ${Ft.green("regenerated")} ${ro(o,c)}`),...i.map(c=>` ${Ft.yellow("removed")} ${ro(o,c)} (the pin produces no such file)`)];t.print(`${s.join(`
|
|
255
254
|
`)}
|
|
256
|
-
${
|
|
257
|
-
`)+
|
|
258
|
-
`)+Mt.dim("\n\nRun `npayload generate` to restore the pinned projection, then commit.")),process.exitCode=1;return}t.print(Mt.green.bold("\u2713 _generated/ matches the pinned contract \u2014 no drift."))}catch(o){t.printError(Mt.red(o instanceof Error?o.message:String(o))),process.exitCode=1}})}a(Lv,"registerGenerate");import{existsSync as px}from"fs";import{join as _E}from"path";var S={};St(S,{$brand:()=>Gi,$input:()=>Ap,$output:()=>Tp,NEVER:()=>bl,TimePrecision:()=>Np,ZodAny:()=>$f,ZodArray:()=>Ef,ZodBase64:()=>fa,ZodBase64URL:()=>ga,ZodBigInt:()=>mr,ZodBigIntFormat:()=>va,ZodBoolean:()=>pr,ZodCIDRv4:()=>pa,ZodCIDRv6:()=>ma,ZodCUID:()=>ia,ZodCUID2:()=>sa,ZodCatch:()=>Hf,ZodCodec:()=>Ia,ZodCustom:()=>Oo,ZodCustomStringFormat:()=>ur,ZodDate:()=>Eo,ZodDefault:()=>Gf,ZodDiscriminatedUnion:()=>Af,ZodE164:()=>ha,ZodEmail:()=>na,ZodEmoji:()=>ra,ZodEnum:()=>cr,ZodError:()=>HP,ZodExactOptional:()=>qf,ZodFile:()=>zf,ZodFirstPartyTypeKind:()=>cg,ZodFunction:()=>ig,ZodGUID:()=>_o,ZodIPv4:()=>ua,ZodIPv6:()=>da,ZodISODate:()=>Hs,ZodISODateTime:()=>Ws,ZodISODuration:()=>Qs,ZodISOTime:()=>Ys,ZodIntersection:()=>Cf,ZodIssueCode:()=>QP,ZodJWT:()=>ya,ZodKSUID:()=>la,ZodLazy:()=>ng,ZodLiteral:()=>Uf,ZodMAC:()=>yf,ZodMap:()=>jf,ZodNaN:()=>Qf,ZodNanoID:()=>oa,ZodNever:()=>If,ZodNonOptional:()=>$a,ZodNull:()=>kf,ZodNullable:()=>Zf,ZodNumber:()=>dr,ZodNumberFormat:()=>$n,ZodObject:()=>Ao,ZodOptional:()=>_a,ZodPipe:()=>Sa,ZodPrefault:()=>Bf,ZodPromise:()=>og,ZodReadonly:()=>Xf,ZodRealError:()=>De,ZodRecord:()=>Ro,ZodSet:()=>Lf,ZodString:()=>lr,ZodStringFormat:()=>X,ZodSuccess:()=>Wf,ZodSymbol:()=>wf,ZodTemplateLiteral:()=>tg,ZodTransform:()=>Mf,ZodTuple:()=>Of,ZodType:()=>Z,ZodULID:()=>aa,ZodURL:()=>Po,ZodUUID:()=>xt,ZodUndefined:()=>xf,ZodUnion:()=>Co,ZodUnknown:()=>Sf,ZodVoid:()=>Pf,ZodXID:()=>ca,ZodXor:()=>Tf,_ZodString:()=>ta,_default:()=>Vf,_function:()=>$w,any:()=>nw,array:()=>To,base64:()=>zb,base64url:()=>Mb,bigint:()=>Yb,boolean:()=>bf,catch:()=>Yf,check:()=>Sw,cidrv4:()=>Lb,cidrv6:()=>Ub,clone:()=>Ee,codec:()=>xw,coerce:()=>lg,config:()=>ae,core:()=>Rt,cuid:()=>Tb,cuid2:()=>Ab,custom:()=>Iw,date:()=>ow,decode:()=>uf,decodeAsync:()=>pf,describe:()=>Pw,discriminatedUnion:()=>uw,e164:()=>qb,email:()=>bb,emoji:()=>Pb,encode:()=>lf,encodeAsync:()=>df,endsWith:()=>Qn,enum:()=>xa,exactOptional:()=>Ff,file:()=>yw,flattenError:()=>so,float32:()=>Jb,float64:()=>Kb,formatError:()=>ao,fromJSONSchema:()=>Nw,function:()=>$w,getErrorMap:()=>eE,globalRegistry:()=>ke,gt:()=>bt,gte:()=>Te,guid:()=>wb,hash:()=>Bb,hex:()=>Vb,hostname:()=>Gb,httpUrl:()=>Ib,includes:()=>Hn,instanceof:()=>Tw,int:()=>ea,int32:()=>Wb,int64:()=>Qb,intersection:()=>Rf,ipv4:()=>Nb,ipv6:()=>jb,iso:()=>ar,json:()=>Cw,jwt:()=>Fb,keyof:()=>iw,ksuid:()=>Ob,lazy:()=>rg,length:()=>kn,literal:()=>hw,locales:()=>bo,looseObject:()=>cw,looseRecord:()=>pw,lowercase:()=>Kn,lt:()=>vt,lte:()=>ze,mac:()=>Db,map:()=>mw,maxLength:()=>xn,maxSize:()=>Jt,meta:()=>Ew,mime:()=>Xn,minLength:()=>Ct,minSize:()=>wt,multipleOf:()=>Bt,nan:()=>ww,nanoid:()=>Eb,nativeEnum:()=>gw,negative:()=>zs,never:()=>ba,nonnegative:()=>qs,nonoptional:()=>Kf,nonpositive:()=>Ms,normalize:()=>er,null:()=>_f,nullable:()=>So,nullish:()=>vw,number:()=>vf,object:()=>sw,optional:()=>$o,overwrite:()=>rt,parse:()=>of,parseAsync:()=>sf,partialRecord:()=>dw,pipe:()=>Io,positive:()=>Us,prefault:()=>Jf,preprocess:()=>Rw,prettifyError:()=>Cl,promise:()=>_w,property:()=>Fs,readonly:()=>eg,record:()=>Df,refine:()=>sg,regex:()=>Jn,regexes:()=>Be,registry:()=>ys,safeDecode:()=>ff,safeDecodeAsync:()=>hf,safeEncode:()=>mf,safeEncodeAsync:()=>gf,safeParse:()=>af,safeParseAsync:()=>cf,set:()=>fw,setErrorMap:()=>XP,size:()=>wn,slugify:()=>or,startsWith:()=>Yn,strictObject:()=>aw,string:()=>Xs,stringFormat:()=>Zb,stringbool:()=>Aw,success:()=>bw,superRefine:()=>ag,symbol:()=>ew,templateLiteral:()=>kw,toJSONSchema:()=>Bs,toLowerCase:()=>nr,toUpperCase:()=>rr,transform:()=>ka,treeifyError:()=>Al,trim:()=>tr,tuple:()=>Nf,uint32:()=>Hb,uint64:()=>Xb,ulid:()=>Cb,undefined:()=>tw,union:()=>wa,unknown:()=>_n,uppercase:()=>Wn,url:()=>Sb,util:()=>I,uuid:()=>xb,uuidv4:()=>kb,uuidv6:()=>_b,uuidv7:()=>$b,void:()=>rw,xid:()=>Rb,xor:()=>lw});var Rt={};St(Rt,{$ZodAny:()=>id,$ZodArray:()=>ud,$ZodAsyncError:()=>nt,$ZodBase64:()=>Wu,$ZodBase64URL:()=>Hu,$ZodBigInt:()=>ms,$ZodBigIntFormat:()=>td,$ZodBoolean:()=>po,$ZodCIDRv4:()=>Bu,$ZodCIDRv6:()=>Ju,$ZodCUID:()=>Nu,$ZodCUID2:()=>Du,$ZodCatch:()=>Ed,$ZodCheck:()=>ee,$ZodCheckBigIntFormat:()=>uu,$ZodCheckEndsWith:()=>ku,$ZodCheckGreaterThan:()=>ss,$ZodCheckIncludes:()=>wu,$ZodCheckLengthEquals:()=>hu,$ZodCheckLessThan:()=>is,$ZodCheckLowerCase:()=>vu,$ZodCheckMaxLength:()=>fu,$ZodCheckMaxSize:()=>du,$ZodCheckMimeType:()=>$u,$ZodCheckMinLength:()=>gu,$ZodCheckMinSize:()=>pu,$ZodCheckMultipleOf:()=>cu,$ZodCheckNumberFormat:()=>lu,$ZodCheckOverwrite:()=>Su,$ZodCheckProperty:()=>_u,$ZodCheckRegex:()=>yu,$ZodCheckSizeEquals:()=>mu,$ZodCheckStartsWith:()=>xu,$ZodCheckStringFormat:()=>Vn,$ZodCheckUpperCase:()=>bu,$ZodCodec:()=>fo,$ZodCustom:()=>jd,$ZodCustomStringFormat:()=>Xu,$ZodDate:()=>ld,$ZodDefault:()=>$d,$ZodDiscriminatedUnion:()=>md,$ZodE164:()=>Yu,$ZodEmail:()=>Au,$ZodEmoji:()=>Ru,$ZodEncodeError:()=>qt,$ZodEnum:()=>vd,$ZodError:()=>io,$ZodExactOptional:()=>kd,$ZodFile:()=>wd,$ZodFunction:()=>Od,$ZodGUID:()=>Eu,$ZodIPv4:()=>Zu,$ZodIPv6:()=>Gu,$ZodISODate:()=>Mu,$ZodISODateTime:()=>zu,$ZodISODuration:()=>Fu,$ZodISOTime:()=>qu,$ZodIntersection:()=>fd,$ZodJWT:()=>Qu,$ZodKSUID:()=>Uu,$ZodLazy:()=>Dd,$ZodLiteral:()=>bd,$ZodMAC:()=>Vu,$ZodMap:()=>hd,$ZodNaN:()=>Td,$ZodNanoID:()=>Ou,$ZodNever:()=>ad,$ZodNonOptional:()=>Id,$ZodNull:()=>od,$ZodNullable:()=>_d,$ZodNumber:()=>ps,$ZodNumberFormat:()=>ed,$ZodObject:()=>ub,$ZodObjectJIT:()=>dd,$ZodOptional:()=>gs,$ZodPipe:()=>Ad,$ZodPrefault:()=>Sd,$ZodPromise:()=>Nd,$ZodReadonly:()=>Cd,$ZodRealError:()=>Ne,$ZodRecord:()=>gd,$ZodRegistry:()=>hs,$ZodSet:()=>yd,$ZodString:()=>bn,$ZodStringFormat:()=>Q,$ZodSuccess:()=>Pd,$ZodSymbol:()=>nd,$ZodTemplateLiteral:()=>Rd,$ZodTransform:()=>xd,$ZodTuple:()=>fs,$ZodType:()=>z,$ZodULID:()=>ju,$ZodURL:()=>Cu,$ZodUUID:()=>Tu,$ZodUndefined:()=>rd,$ZodUnion:()=>mo,$ZodUnknown:()=>sd,$ZodVoid:()=>cd,$ZodXID:()=>Lu,$ZodXor:()=>pd,$brand:()=>Gi,$constructor:()=>y,$input:()=>Ap,$output:()=>Tp,Doc:()=>uo,JSONSchema:()=>yb,JSONSchemaGenerator:()=>Js,NEVER:()=>bl,TimePrecision:()=>Np,_any:()=>tm,_array:()=>cm,_base64:()=>Ns,_base64url:()=>Ds,_bigint:()=>Kp,_boolean:()=>Bp,_catch:()=>FP,_check:()=>hb,_cidrv4:()=>Rs,_cidrv6:()=>Os,_coercedBigint:()=>Wp,_coercedBoolean:()=>Jp,_coercedDate:()=>sm,_coercedNumber:()=>Mp,_coercedString:()=>Rp,_cuid:()=>Ss,_cuid2:()=>Is,_custom:()=>um,_date:()=>im,_decode:()=>Hi,_decodeAsync:()=>Qi,_default:()=>zP,_discriminatedUnion:()=>PP,_e164:()=>js,_email:()=>vs,_emoji:()=>_s,_encode:()=>Wi,_encodeAsync:()=>Yi,_endsWith:()=>Qn,_enum:()=>OP,_file:()=>lm,_float32:()=>Fp,_float64:()=>Zp,_gt:()=>bt,_gte:()=>Te,_guid:()=>wo,_includes:()=>Hn,_int:()=>qp,_int32:()=>Gp,_int64:()=>Hp,_intersection:()=>EP,_ipv4:()=>As,_ipv6:()=>Cs,_isoDate:()=>jp,_isoDateTime:()=>Dp,_isoDuration:()=>Up,_isoTime:()=>Lp,_jwt:()=>Ls,_ksuid:()=>Ts,_lazy:()=>BP,_length:()=>kn,_literal:()=>DP,_lowercase:()=>Kn,_lt:()=>vt,_lte:()=>ze,_mac:()=>Op,_map:()=>CP,_max:()=>ze,_maxLength:()=>xn,_maxSize:()=>Jt,_mime:()=>Xn,_min:()=>Te,_minLength:()=>Ct,_minSize:()=>wt,_multipleOf:()=>Bt,_nan:()=>am,_nanoid:()=>$s,_nativeEnum:()=>NP,_negative:()=>zs,_never:()=>rm,_nonnegative:()=>qs,_nonoptional:()=>MP,_nonpositive:()=>Ms,_normalize:()=>er,_null:()=>em,_nullable:()=>UP,_number:()=>zp,_optional:()=>LP,_overwrite:()=>rt,_parse:()=>qn,_parseAsync:()=>Fn,_pipe:()=>ZP,_positive:()=>Us,_promise:()=>JP,_property:()=>Fs,_readonly:()=>GP,_record:()=>AP,_refine:()=>dm,_regex:()=>Jn,_safeDecode:()=>es,_safeDecodeAsync:()=>ns,_safeEncode:()=>Xi,_safeEncodeAsync:()=>ts,_safeParse:()=>Zn,_safeParseAsync:()=>Gn,_set:()=>RP,_size:()=>wn,_slugify:()=>or,_startsWith:()=>Yn,_string:()=>Cp,_stringFormat:()=>ir,_stringbool:()=>gm,_success:()=>qP,_superRefine:()=>pm,_symbol:()=>Qp,_templateLiteral:()=>VP,_toLowerCase:()=>nr,_toUpperCase:()=>rr,_transform:()=>jP,_trim:()=>tr,_tuple:()=>TP,_uint32:()=>Vp,_uint64:()=>Yp,_ulid:()=>Ps,_undefined:()=>Xp,_union:()=>SP,_unknown:()=>nm,_uppercase:()=>Wn,_url:()=>xo,_uuid:()=>bs,_uuidv4:()=>ws,_uuidv6:()=>xs,_uuidv7:()=>ks,_void:()=>om,_xid:()=>Es,_xor:()=>IP,clone:()=>Ee,config:()=>ae,createStandardJSONSchemaMethod:()=>sr,createToJSONSchemaMethod:()=>hm,decode:()=>HS,decodeAsync:()=>QS,describe:()=>mm,encode:()=>WS,encodeAsync:()=>YS,extractDefs:()=>Wt,finalize:()=>Ht,flattenError:()=>so,formatError:()=>ao,globalConfig:()=>Qr,globalRegistry:()=>ke,initializeContext:()=>Kt,isValidBase64:()=>Ku,isValidBase64URL:()=>sb,isValidJWT:()=>ab,locales:()=>bo,meta:()=>fm,parse:()=>Ji,parseAsync:()=>Ki,prettifyError:()=>Cl,process:()=>W,regexes:()=>Be,registry:()=>ys,safeDecode:()=>eI,safeDecodeAsync:()=>nI,safeEncode:()=>XS,safeEncodeAsync:()=>tI,safeParse:()=>Rl,safeParseAsync:()=>Ol,toDotPath:()=>Fv,toJSONSchema:()=>Bs,treeifyError:()=>Al,util:()=>I,version:()=>Iu});var bl=Object.freeze({status:"aborted"});function y(e,t,r){function o(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let u=s.prototype,d=Object.keys(u);for(let m=0;m<d.length;m++){let p=d[m];p in c||(c[p]=u[p].bind(c))}}a(o,"init");let n=r?.Parent??Object;class i extends n{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(c){var l;let u=r?.Parent?new i:this;o(u,c),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return a(s,"_"),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a(c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(y,"$constructor");var Gi=Symbol("zod_brand"),nt=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},qt=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Qr={};function ae(e){return e&&Object.assign(Qr,e),Qr}a(ae,"config");var I={};St(I,{BIGINT_FORMAT_RANGES:()=>Tl,Class:()=>xl,NUMBER_FORMAT_RANGES:()=>El,aborted:()=>Vt,allowsEval:()=>$l,assert:()=>PS,assertEqual:()=>_S,assertIs:()=>SS,assertNever:()=>IS,assertNotEqual:()=>$S,assignProp:()=>Zt,base64ToUint8Array:()=>zv,base64urlToUint8Array:()=>GS,cached:()=>zn,captureStackTrace:()=>Bi,cleanEnum:()=>ZS,cleanRegex:()=>to,clone:()=>Ee,cloneDef:()=>TS,createTransparentProxy:()=>DS,defineLazy:()=>G,esc:()=>Vi,escapeRegex:()=>Ve,extend:()=>US,finalizeIssue:()=>Oe,floatSafeRemainder:()=>kl,getElementAtPath:()=>AS,getEnumValues:()=>eo,getLengthableOrigin:()=>oo,getParsedType:()=>NS,getSizableOrigin:()=>ro,hexToUint8Array:()=>BS,isObject:()=>yn,isPlainObject:()=>Gt,issue:()=>Mn,joinValues:()=>w,jsonStringifyReplacer:()=>Un,merge:()=>MS,mergeDefs:()=>At,normalizeParams:()=>P,nullish:()=>Ft,numKeys:()=>OS,objectClone:()=>ES,omit:()=>LS,optionalKeys:()=>Pl,parsedType:()=>$,partial:()=>qS,pick:()=>jS,prefixIssues:()=>Ue,primitiveTypes:()=>Il,promiseAllObject:()=>CS,propertyKeyTypes:()=>no,randomString:()=>RS,required:()=>FS,safeExtend:()=>zS,shallowClone:()=>Sl,slugify:()=>_l,stringifyPrimitive:()=>_,uint8ArrayToBase64:()=>Mv,uint8ArrayToBase64url:()=>VS,uint8ArrayToHex:()=>JS,unwrapMessage:()=>Xr});function _S(e){return e}a(_S,"assertEqual");function $S(e){return e}a($S,"assertNotEqual");function SS(e){}a(SS,"assertIs");function IS(e){throw new Error("Unexpected value in exhaustive check")}a(IS,"assertNever");function PS(e){}a(PS,"assert");function eo(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}a(eo,"getEnumValues");function w(e,t="|"){return e.map(r=>_(r)).join(t)}a(w,"joinValues");function Un(e,t){return typeof t=="bigint"?t.toString():t}a(Un,"jsonStringifyReplacer");function zn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(zn,"cached");function Ft(e){return e==null}a(Ft,"nullish");function to(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(to,"cleanRegex");function kl(e,t){let r=(e.toString().split(".")[1]||"").length,o=t.toString(),n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),c=Number.parseInt(t.toFixed(i).replace(".",""));return s%c/10**i}a(kl,"floatSafeRemainder");var Uv=Symbol("evaluating");function G(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Uv)return o===void 0&&(o=Uv,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}a(G,"defineLazy");function ES(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}a(ES,"objectClone");function Zt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(Zt,"assignProp");function At(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}a(At,"mergeDefs");function TS(e){return At(e._zod.def)}a(TS,"cloneDef");function AS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}a(AS,"getElementAtPath");function CS(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}a(CS,"promiseAllObject");function RS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}a(RS,"randomString");function Vi(e){return JSON.stringify(e)}a(Vi,"esc");function _l(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(_l,"slugify");var Bi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function yn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(yn,"isObject");var $l=zn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Gt(e){if(yn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(yn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Gt,"isPlainObject");function Sl(e){return Gt(e)?{...e}:Array.isArray(e)?[...e]:e}a(Sl,"shallowClone");function OS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}a(OS,"numKeys");var NS=a(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),no=new Set(["string","number","symbol"]),Il=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Ve,"escapeRegex");function Ee(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}a(Ee,"clone");function P(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(P,"normalizeParams");function DS(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}a(DS,"createTransparentProxy");function _(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}a(_,"stringifyPrimitive");function Pl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Pl,"optionalKeys");var El={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]},Tl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function jS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=At(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(s[c]=r.shape[c])}return Zt(this,"shape",s),s},checks:[]});return Ee(e,i)}a(jS,"pick");function LS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=At(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete s[c]}return Zt(this,"shape",s),s},checks:[]});return Ee(e,i)}a(LS,"omit");function US(e,t){if(!Gt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=At(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Zt(this,"shape",i),i}});return Ee(e,n)}a(US,"extend");function zS(e,t){if(!Gt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=At(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Zt(this,"shape",o),o}});return Ee(e,r)}a(zS,"safeExtend");function MS(e,t){let r=At(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Zt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ee(e,r)}a(MS,"merge");function qS(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=At(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(r)for(let u in r){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)l[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return Zt(this,"shape",l),l},checks:[]});return Ee(t,s)}a(qS,"partial");function FS(e,t,r){let o=At(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return Zt(this,"shape",i),i}});return Ee(t,o)}a(FS,"required");function Vt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}a(Vt,"aborted");function Ue(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}a(Ue,"prefixIssues");function Xr(e){return typeof e=="string"?e:e?.message}a(Xr,"unwrapMessage");function Oe(e,t,r){let o={...e,path:e.path??[]};if(!e.message){let n=Xr(e.inst?._zod.def?.error?.(e))??Xr(t?.error?.(e))??Xr(r.customError?.(e))??Xr(r.localeError?.(e))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}a(Oe,"finalizeIssue");function ro(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}a(ro,"getSizableOrigin");function oo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(oo,"getLengthableOrigin");function $(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}a($,"parsedType");function Mn(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}a(Mn,"issue");function ZS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}a(ZS,"cleanEnum");function zv(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}a(zv,"base64ToUint8Array");function Mv(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}a(Mv,"uint8ArrayToBase64");function GS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return zv(t+r)}a(GS,"base64urlToUint8Array");function VS(e){return Mv(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(VS,"uint8ArrayToBase64url");function BS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}a(BS,"hexToUint8Array");function JS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}a(JS,"uint8ArrayToHex");var xl=class{static{a(this,"Class")}constructor(...t){}};var qv=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Un,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),io=y("$ZodError",qv),Ne=y("$ZodError",qv,{Parent:Error});function so(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}a(so,"flattenError");function ao(e,t=r=>r.message){let r={_errors:[]},o=a(n=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let s=r,c=0;for(;c<i.path.length;){let l=i.path[c];c===i.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(i))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}},"processError");return o(e),r}a(ao,"formatError");function Al(e,t=r=>r.message){let r={errors:[]},o=a((n,i=[])=>{var s,c;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u},l.path));else if(l.code==="invalid_key")o({issues:l.issues},l.path);else if(l.code==="invalid_element")o({issues:l.issues},l.path);else{let u=[...i,...l.path];if(u.length===0){r.errors.push(t(l));continue}let d=r,m=0;for(;m<u.length;){let p=u[m],f=m===u.length-1;typeof p=="string"?(d.properties??(d.properties={}),(s=d.properties)[p]??(s[p]={errors:[]}),d=d.properties[p]):(d.items??(d.items=[]),(c=d.items)[p]??(c[p]={errors:[]}),d=d.items[p]),f&&d.errors.push(t(l)),m++}}},"processError");return o(e),r}a(Al,"treeifyError");function Fv(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}a(Fv,"toDotPath");function Cl(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Fv(o.path)}`);return t.join(`
|
|
259
|
-
`)}a(Cl,"prettifyError");var qn=a(e=>(t,r,o,n)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new nt;if(s.issues.length){let c=new(n?.Err??e)(s.issues.map(l=>Oe(l,i,ae())));throw Bi(c,n?.callee),c}return s.value},"_parse"),Ji=qn(Ne),Fn=a(e=>async(t,r,o,n)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(n?.Err??e)(s.issues.map(l=>Oe(l,i,ae())));throw Bi(c,n?.callee),c}return s.value},"_parseAsync"),Ki=Fn(Ne),Zn=a(e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new nt;return i.issues.length?{success:!1,error:new(e??io)(i.issues.map(s=>Oe(s,n,ae())))}:{success:!0,data:i.value}},"_safeParse"),Rl=Zn(Ne),Gn=a(e=>async(t,r,o)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Oe(s,n,ae())))}:{success:!0,data:i.value}},"_safeParseAsync"),Ol=Gn(Ne),Wi=a(e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return qn(e)(t,r,n)},"_encode"),WS=Wi(Ne),Hi=a(e=>(t,r,o)=>qn(e)(t,r,o),"_decode"),HS=Hi(Ne),Yi=a(e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Fn(e)(t,r,n)},"_encodeAsync"),YS=Yi(Ne),Qi=a(e=>async(t,r,o)=>Fn(e)(t,r,o),"_decodeAsync"),QS=Qi(Ne),Xi=a(e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Zn(e)(t,r,n)},"_safeEncode"),XS=Xi(Ne),es=a(e=>(t,r,o)=>Zn(e)(t,r,o),"_safeDecode"),eI=es(Ne),ts=a(e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Gn(e)(t,r,n)},"_safeEncodeAsync"),tI=ts(Ne),ns=a(e=>async(t,r,o)=>Gn(e)(t,r,o),"_safeDecodeAsync"),nI=ns(Ne);var Be={};St(Be,{base64:()=>Wl,base64url:()=>rs,bigint:()=>tu,boolean:()=>ru,browserEmail:()=>uI,cidrv4:()=>Jl,cidrv6:()=>Kl,cuid:()=>Nl,cuid2:()=>Dl,date:()=>Yl,datetime:()=>Xl,domain:()=>mI,duration:()=>Ml,e164:()=>Hl,email:()=>Fl,emoji:()=>Zl,extendedDuration:()=>rI,guid:()=>ql,hex:()=>fI,hostname:()=>pI,html5Email:()=>aI,idnEmail:()=>lI,integer:()=>nu,ipv4:()=>Gl,ipv6:()=>Vl,ksuid:()=>Ul,lowercase:()=>su,mac:()=>Bl,md5_base64:()=>hI,md5_base64url:()=>yI,md5_hex:()=>gI,nanoid:()=>zl,null:()=>ou,number:()=>os,rfc5322Email:()=>cI,sha1_base64:()=>bI,sha1_base64url:()=>wI,sha1_hex:()=>vI,sha256_base64:()=>kI,sha256_base64url:()=>_I,sha256_hex:()=>xI,sha384_base64:()=>SI,sha384_base64url:()=>II,sha384_hex:()=>$I,sha512_base64:()=>EI,sha512_base64url:()=>TI,sha512_hex:()=>PI,string:()=>eu,time:()=>Ql,ulid:()=>jl,undefined:()=>iu,unicodeEmail:()=>Zv,uppercase:()=>au,uuid:()=>vn,uuid4:()=>oI,uuid6:()=>iI,uuid7:()=>sI,xid:()=>Ll});var Nl=/^[cC][^\s-]{8,}$/,Dl=/^[0-9a-z]+$/,jl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ll=/^[0-9a-vA-V]{20}$/,Ul=/^[A-Za-z0-9]{27}$/,zl=/^[a-zA-Z0-9_-]{21}$/,Ml=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rI=/^[-+]?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)?)??$/,ql=/^([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})$/,vn=a(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),oI=vn(4),iI=vn(6),sI=vn(7),Fl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aI=/^[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])?)*$/,cI=/^(([^<>()\[\]\\.,;:\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,}))$/,Zv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,lI=Zv,uI=/^[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])?)*$/,dI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Zl(){return new RegExp(dI,"u")}a(Zl,"emoji");var Gl=/^(?:(?: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])$/,Vl=/^(([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}|:))$/,Bl=a(e=>{let t=Ve(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),Jl=/^((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])$/,Kl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rs=/^[A-Za-z0-9_-]*$/,pI=/^(?=.{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])?)*\.?$/,mI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Hl=/^\+[1-9]\d{6,14}$/,Gv="(?:(?:\\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])))",Yl=new RegExp(`^${Gv}$`);function Vv(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(Vv,"timeSource");function Ql(e){return new RegExp(`^${Vv(e)}$`)}a(Ql,"time");function Xl(e){let t=Vv({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Gv}T(?:${o})$`)}a(Xl,"datetime");var eu=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),tu=/^-?\d+n?$/,nu=/^-?\d+$/,os=/^-?\d+(?:\.\d+)?$/,ru=/^(?:true|false)$/i,ou=/^null$/i;var iu=/^undefined$/i;var su=/^[^A-Z]*$/,au=/^[^a-z]*$/,fI=/^[0-9a-fA-F]*$/;function co(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}a(co,"fixedBase64");function lo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}a(lo,"fixedBase64url");var gI=/^[0-9a-fA-F]{32}$/,hI=co(22,"=="),yI=lo(22),vI=/^[0-9a-fA-F]{40}$/,bI=co(27,"="),wI=lo(27),xI=/^[0-9a-fA-F]{64}$/,kI=co(43,"="),_I=lo(43),$I=/^[0-9a-fA-F]{96}$/,SI=co(64,""),II=lo(64),PI=/^[0-9a-fA-F]{128}$/,EI=co(86,"=="),TI=lo(86);var ee=y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Jv={number:"number",bigint:"bigint",object:"date"},is=y("$ZodCheckLessThan",(e,t)=>{ee.init(e,t);let r=Jv[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ss=y("$ZodCheckGreaterThan",(e,t)=>{ee.init(e,t);let r=Jv[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cu=y("$ZodCheckMultipleOf",(e,t)=>{ee.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):kl(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),lu=y("$ZodCheckNumberFormat",(e,t)=>{ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=El[t.format];e._zod.onattach.push(s=>{let c=s._zod.bag;c.format=t.format,c.minimum=n,c.maximum=i,r&&(c.pattern=nu)}),e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),uu=y("$ZodCheckBigIntFormat",(e,t)=>{ee.init(e,t);let[r,o]=Tl[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),du=y("$ZodCheckMaxSize",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ft(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:ro(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),pu=y("$ZodCheckMinSize",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ft(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:ro(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),mu=y("$ZodCheckSizeEquals",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ft(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:ro(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),fu=y("$ZodCheckMaxLength",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ft(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let s=oo(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),gu=y("$ZodCheckMinLength",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ft(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let s=oo(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),hu=y("$ZodCheckLengthEquals",(e,t)=>{var r;ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ft(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let s=oo(n),c=i>t.length;o.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Vn=y("$ZodCheckStringFormat",(e,t)=>{var r,o;ee.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),yu=y("$ZodCheckRegex",(e,t)=>{Vn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vu=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=su),Vn.init(e,t)}),bu=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=au),Vn.init(e,t)}),wu=y("$ZodCheckIncludes",(e,t)=>{ee.init(e,t);let r=Ve(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),xu=y("$ZodCheckStartsWith",(e,t)=>{ee.init(e,t);let r=new RegExp(`^${Ve(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),ku=y("$ZodCheckEndsWith",(e,t)=>{ee.init(e,t);let r=new RegExp(`.*${Ve(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Bv(e,t,r){e.issues.length&&t.issues.push(...Ue(r,e.issues))}a(Bv,"handleCheckPropertyResult");var _u=y("$ZodCheckProperty",(e,t)=>{ee.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Bv(n,r,t.property));Bv(o,r,t.property)}}),$u=y("$ZodCheckMimeType",(e,t)=>{ee.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Su=y("$ZodCheckOverwrite",(e,t)=>{ee.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var uo=class{static{a(this,"Doc")}constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
255
|
+
${Ft.green.bold("\u2713 _generated/ regenerated from the pinned contract.")}`)}catch(o){t.printError(Ft.red(o instanceof Error?o.message:String(o))),process.exitCode=1}}),e.command("check").description("Fail if the committed _generated/ differs from what the pinned contract would produce (drift gate)").option("--config <path>","path to events.config.ts (default: npayload/events.config.ts)").action(async r=>{try{let{drifted:o}=await CI(fb(r.config));if(o.length>0){t.printError(Ft.red(`\u2717 _generated/ drifted from the pin (${o.length}):
|
|
256
|
+
`)+o.map(n=>` - _generated/${n.file}: ${n.why}`).join(`
|
|
257
|
+
`)+Ft.dim(`
|
|
258
|
+
|
|
259
|
+
Run \``+b("generate")+"` to restore the pinned projection, then commit.")),process.exitCode=1;return}t.print(Ft.green.bold("\u2713 _generated/ matches the pinned contract \u2014 no drift."))}catch(o){t.printError(Ft.red(o instanceof Error?o.message:String(o))),process.exitCode=1}})}a(yb,"registerGenerate");import{existsSync as rx}from"fs";import{join as yA}from"path";var $={};Pt($,{$brand:()=>Yi,$input:()=>Gp,$output:()=>Zp,NEVER:()=>Ou,TimePrecision:()=>Jp,ZodAny:()=>Lm,ZodArray:()=>qm,ZodBase64:()=>ka,ZodBase64URL:()=>xa,ZodBigInt:()=>mr,ZodBigIntFormat:()=>Sa,ZodBoolean:()=>fr,ZodCIDRv4:()=>ba,ZodCIDRv6:()=>wa,ZodCUID:()=>pa,ZodCUID2:()=>fa,ZodCatch:()=>lg,ZodCodec:()=>Oa,ZodCustom:()=>zo,ZodCustomStringFormat:()=>dr,ZodDate:()=>No,ZodDefault:()=>og,ZodDiscriminatedUnion:()=>Gm,ZodE164:()=>_a,ZodEmail:()=>ua,ZodEmoji:()=>la,ZodEnum:()=>ur,ZodError:()=>iT,ZodExactOptional:()=>tg,ZodFile:()=>Xm,ZodFirstPartyTypeKind:()=>xg,ZodFunction:()=>bg,ZodGUID:()=>To,ZodIPv4:()=>ya,ZodIPv6:()=>va,ZodISODate:()=>ra,ZodISODateTime:()=>na,ZodISODuration:()=>ia,ZodISOTime:()=>oa,ZodIntersection:()=>Vm,ZodIssueCode:()=>aT,ZodJWT:()=>$a,ZodKSUID:()=>ha,ZodLazy:()=>hg,ZodLiteral:()=>Qm,ZodMAC:()=>Cm,ZodMap:()=>Hm,ZodNaN:()=>pg,ZodNanoID:()=>da,ZodNever:()=>Mm,ZodNonOptional:()=>Ca,ZodNull:()=>jm,ZodNullable:()=>rg,ZodNumber:()=>pr,ZodNumberFormat:()=>Sn,ZodObject:()=>jo,ZodOptional:()=>Aa,ZodPipe:()=>Ra,ZodPrefault:()=>sg,ZodPromise:()=>vg,ZodReadonly:()=>fg,ZodRealError:()=>Ue,ZodRecord:()=>Lo,ZodSet:()=>Ym,ZodString:()=>lr,ZodStringFormat:()=>ee,ZodSuccess:()=>ug,ZodSymbol:()=>Nm,ZodTemplateLiteral:()=>gg,ZodTransform:()=>eg,ZodTuple:()=>Km,ZodType:()=>G,ZodULID:()=>ma,ZodURL:()=>Oo,ZodUUID:()=>_t,ZodUndefined:()=>Dm,ZodUnion:()=>Uo,ZodUnknown:()=>zm,ZodVoid:()=>Fm,ZodXID:()=>ga,ZodXor:()=>Zm,_ZodString:()=>ca,_default:()=>ig,_function:()=>ok,any:()=>jw,array:()=>Do,base64:()=>bw,base64url:()=>ww,bigint:()=>Cw,boolean:()=>Om,catch:()=>dg,check:()=>ik,cidrv4:()=>yw,cidrv6:()=>vw,clone:()=>Ae,codec:()=>tk,coerce:()=>_g,config:()=>ce,core:()=>Ot,cuid:()=>uw,cuid2:()=>lw,custom:()=>sk,date:()=>Lw,decode:()=>$m,decodeAsync:()=>Im,describe:()=>ak,discriminatedUnion:()=>Gw,e164:()=>kw,email:()=>Xb,emoji:()=>aw,encode:()=>_m,encodeAsync:()=>Sm,endsWith:()=>Xn,enum:()=>Ea,exactOptional:()=>ng,file:()=>Yw,flattenError:()=>fo,float32:()=>Pw,float64:()=>Ew,formatError:()=>mo,fromJSONSchema:()=>mk,function:()=>ok,getErrorMap:()=>uT,globalRegistry:()=>_e,gt:()=>kt,gte:()=>Ce,guid:()=>ew,hash:()=>Iw,hex:()=>Sw,hostname:()=>$w,httpUrl:()=>sw,includes:()=>Yn,instanceof:()=>uk,int:()=>aa,int32:()=>Tw,int64:()=>Rw,intersection:()=>Bm,ipv4:()=>mw,ipv6:()=>hw,iso:()=>cr,json:()=>dk,jwt:()=>xw,keyof:()=>zw,ksuid:()=>fw,lazy:()=>yg,length:()=>_n,literal:()=>Hw,locales:()=>So,looseObject:()=>qw,looseRecord:()=>Bw,lowercase:()=>Wn,lt:()=>wt,lte:()=>Fe,mac:()=>gw,map:()=>Kw,maxLength:()=>xn,maxSize:()=>Jt,meta:()=>ck,mime:()=>er,minLength:()=>Rt,minSize:()=>xt,multipleOf:()=>Kt,nan:()=>ek,nanoid:()=>cw,nativeEnum:()=>Ww,negative:()=>Bs,never:()=>Ia,nonnegative:()=>Js,nonoptional:()=>cg,nonpositive:()=>Ks,normalize:()=>tr,null:()=>Um,nullable:()=>Co,nullish:()=>Qw,number:()=>Rm,object:()=>Mw,optional:()=>Ao,overwrite:()=>it,parse:()=>bm,parseAsync:()=>wm,partialRecord:()=>Vw,pipe:()=>Ro,positive:()=>Vs,prefault:()=>ag,preprocess:()=>pk,prettifyError:()=>Vu,promise:()=>rk,property:()=>Ws,readonly:()=>mg,record:()=>Wm,refine:()=>wg,regex:()=>Jn,regexes:()=>Je,registry:()=>$s,safeDecode:()=>Em,safeDecodeAsync:()=>Am,safeEncode:()=>Pm,safeEncodeAsync:()=>Tm,safeParse:()=>km,safeParseAsync:()=>xm,set:()=>Jw,setErrorMap:()=>cT,size:()=>kn,slugify:()=>ir,startsWith:()=>Qn,strictObject:()=>Fw,string:()=>sa,stringFormat:()=>_w,stringbool:()=>lk,success:()=>Xw,superRefine:()=>kg,symbol:()=>Nw,templateLiteral:()=>nk,toJSONSchema:()=>Xs,toLowerCase:()=>rr,toUpperCase:()=>or,transform:()=>Ta,treeifyError:()=>Gu,trim:()=>nr,tuple:()=>Jm,uint32:()=>Aw,uint64:()=>Ow,ulid:()=>dw,undefined:()=>Dw,union:()=>Pa,unknown:()=>$n,uppercase:()=>Hn,url:()=>iw,util:()=>E,uuid:()=>tw,uuidv4:()=>nw,uuidv6:()=>rw,uuidv7:()=>ow,void:()=>Uw,xid:()=>pw,xor:()=>Zw});var Ot={};Pt(Ot,{$ZodAny:()=>bd,$ZodArray:()=>$d,$ZodAsyncError:()=>ot,$ZodBase64:()=>ud,$ZodBase64URL:()=>ld,$ZodBigInt:()=>ws,$ZodBigIntFormat:()=>gd,$ZodBoolean:()=>vo,$ZodCIDRv4:()=>sd,$ZodCIDRv6:()=>ad,$ZodCUID:()=>Jl,$ZodCUID2:()=>Wl,$ZodCatch:()=>qd,$ZodCheck:()=>te,$ZodCheckBigIntFormat:()=>$l,$ZodCheckEndsWith:()=>jl,$ZodCheckGreaterThan:()=>fs,$ZodCheckIncludes:()=>Nl,$ZodCheckLengthEquals:()=>Al,$ZodCheckLessThan:()=>ps,$ZodCheckLowerCase:()=>Rl,$ZodCheckMaxLength:()=>El,$ZodCheckMaxSize:()=>Sl,$ZodCheckMimeType:()=>Ll,$ZodCheckMinLength:()=>Tl,$ZodCheckMinSize:()=>Il,$ZodCheckMultipleOf:()=>xl,$ZodCheckNumberFormat:()=>_l,$ZodCheckOverwrite:()=>zl,$ZodCheckProperty:()=>Ul,$ZodCheckRegex:()=>Cl,$ZodCheckSizeEquals:()=>Pl,$ZodCheckStartsWith:()=>Dl,$ZodCheckStringFormat:()=>Bn,$ZodCheckUpperCase:()=>Ol,$ZodCodec:()=>wo,$ZodCustom:()=>Hd,$ZodCustomStringFormat:()=>fd,$ZodDate:()=>_d,$ZodDefault:()=>Ld,$ZodDiscriminatedUnion:()=>Pd,$ZodE164:()=>dd,$ZodEmail:()=>Gl,$ZodEmoji:()=>Bl,$ZodEncodeError:()=>qt,$ZodEnum:()=>Rd,$ZodError:()=>po,$ZodExactOptional:()=>jd,$ZodFile:()=>Nd,$ZodFunction:()=>Kd,$ZodGUID:()=>ql,$ZodIPv4:()=>rd,$ZodIPv6:()=>od,$ZodISODate:()=>ed,$ZodISODateTime:()=>Xl,$ZodISODuration:()=>nd,$ZodISOTime:()=>td,$ZodIntersection:()=>Ed,$ZodJWT:()=>pd,$ZodKSUID:()=>Ql,$ZodLazy:()=>Wd,$ZodLiteral:()=>Od,$ZodMAC:()=>id,$ZodMap:()=>Ad,$ZodNaN:()=>Zd,$ZodNanoID:()=>Kl,$ZodNever:()=>kd,$ZodNonOptional:()=>Md,$ZodNull:()=>vd,$ZodNullable:()=>Ud,$ZodNumber:()=>bs,$ZodNumberFormat:()=>md,$ZodObject:()=>Gb,$ZodObjectJIT:()=>Sd,$ZodOptional:()=>xs,$ZodPipe:()=>Gd,$ZodPrefault:()=>zd,$ZodPromise:()=>Jd,$ZodReadonly:()=>Vd,$ZodRealError:()=>je,$ZodRecord:()=>Td,$ZodRegistry:()=>_s,$ZodSet:()=>Cd,$ZodString:()=>wn,$ZodStringFormat:()=>X,$ZodSuccess:()=>Fd,$ZodSymbol:()=>hd,$ZodTemplateLiteral:()=>Bd,$ZodTransform:()=>Dd,$ZodTuple:()=>ks,$ZodType:()=>M,$ZodULID:()=>Hl,$ZodURL:()=>Vl,$ZodUUID:()=>Zl,$ZodUndefined:()=>yd,$ZodUnion:()=>bo,$ZodUnknown:()=>wd,$ZodVoid:()=>xd,$ZodXID:()=>Yl,$ZodXor:()=>Id,$brand:()=>Yi,$constructor:()=>y,$input:()=>Gp,$output:()=>Zp,Doc:()=>yo,JSONSchema:()=>Yb,JSONSchemaGenerator:()=>ea,NEVER:()=>Ou,TimePrecision:()=>Jp,_any:()=>hf,_array:()=>_f,_base64:()=>Fs,_base64url:()=>qs,_bigint:()=>uf,_boolean:()=>af,_catch:()=>YE,_check:()=>Hb,_cidrv4:()=>zs,_cidrv6:()=>Ms,_coercedBigint:()=>lf,_coercedBoolean:()=>cf,_coercedDate:()=>kf,_coercedNumber:()=>ef,_coercedString:()=>Bp,_cuid:()=>Rs,_cuid2:()=>Os,_custom:()=>Sf,_date:()=>wf,_decode:()=>rs,_decodeAsync:()=>is,_default:()=>JE,_discriminatedUnion:()=>jE,_e164:()=>Zs,_email:()=>Ss,_emoji:()=>As,_encode:()=>ns,_encodeAsync:()=>os,_endsWith:()=>Xn,_enum:()=>qE,_file:()=>$f,_float32:()=>nf,_float64:()=>rf,_gt:()=>kt,_gte:()=>Ce,_guid:()=>Io,_includes:()=>Yn,_int:()=>tf,_int32:()=>of,_int64:()=>df,_intersection:()=>UE,_ipv4:()=>Us,_ipv6:()=>Ls,_isoDate:()=>Hp,_isoDateTime:()=>Wp,_isoDuration:()=>Qp,_isoTime:()=>Yp,_jwt:()=>Gs,_ksuid:()=>js,_lazy:()=>tT,_length:()=>_n,_literal:()=>GE,_lowercase:()=>Wn,_lt:()=>wt,_lte:()=>Fe,_mac:()=>Kp,_map:()=>ME,_max:()=>Fe,_maxLength:()=>xn,_maxSize:()=>Jt,_mime:()=>er,_min:()=>Ce,_minLength:()=>Rt,_minSize:()=>xt,_multipleOf:()=>Kt,_nan:()=>xf,_nanoid:()=>Cs,_nativeEnum:()=>ZE,_negative:()=>Bs,_never:()=>vf,_nonnegative:()=>Js,_nonoptional:()=>WE,_nonpositive:()=>Ks,_normalize:()=>tr,_null:()=>gf,_nullable:()=>KE,_number:()=>Xp,_optional:()=>BE,_overwrite:()=>it,_parse:()=>qn,_parseAsync:()=>Zn,_pipe:()=>QE,_positive:()=>Vs,_promise:()=>nT,_property:()=>Ws,_readonly:()=>XE,_record:()=>zE,_refine:()=>If,_regex:()=>Jn,_safeDecode:()=>as,_safeDecodeAsync:()=>us,_safeEncode:()=>ss,_safeEncodeAsync:()=>cs,_safeParse:()=>Gn,_safeParseAsync:()=>Vn,_set:()=>FE,_size:()=>kn,_slugify:()=>ir,_startsWith:()=>Qn,_string:()=>Vp,_stringFormat:()=>sr,_stringbool:()=>Af,_success:()=>HE,_superRefine:()=>Pf,_symbol:()=>ff,_templateLiteral:()=>eT,_toLowerCase:()=>rr,_toUpperCase:()=>or,_transform:()=>VE,_trim:()=>nr,_tuple:()=>LE,_uint32:()=>sf,_uint64:()=>pf,_ulid:()=>Ns,_undefined:()=>mf,_union:()=>NE,_unknown:()=>yf,_uppercase:()=>Hn,_url:()=>Po,_uuid:()=>Is,_uuidv4:()=>Ps,_uuidv6:()=>Es,_uuidv7:()=>Ts,_void:()=>bf,_xid:()=>Ds,_xor:()=>DE,clone:()=>Ae,config:()=>ce,createStandardJSONSchemaMethod:()=>ar,createToJSONSchemaMethod:()=>Cf,decode:()=>iP,decodeAsync:()=>aP,describe:()=>Ef,encode:()=>oP,encodeAsync:()=>sP,extractDefs:()=>Ht,finalize:()=>Yt,flattenError:()=>fo,formatError:()=>mo,globalConfig:()=>oo,globalRegistry:()=>_e,initializeContext:()=>Wt,isValidBase64:()=>cd,isValidBase64URL:()=>Mb,isValidJWT:()=>Fb,locales:()=>So,meta:()=>Tf,parse:()=>es,parseAsync:()=>ts,prettifyError:()=>Vu,process:()=>H,regexes:()=>Je,registry:()=>$s,safeDecode:()=>uP,safeDecodeAsync:()=>dP,safeEncode:()=>cP,safeEncodeAsync:()=>lP,safeParse:()=>Bu,safeParseAsync:()=>Ku,toDotPath:()=>xb,toJSONSchema:()=>Xs,treeifyError:()=>Gu,util:()=>E,version:()=>Ml});var Ou=Object.freeze({status:"aborted"});function y(e,t,r){function o(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);let l=s.prototype,d=Object.keys(l);for(let f=0;f<d.length;f++){let p=d[f];p in c||(c[p]=l[p].bind(c))}}a(o,"init");let n=r?.Parent??Object;class i extends n{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(c){var u;let l=r?.Parent?new i:this;o(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let d of l._zod.deferred)d();return l}return a(s,"_"),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a(c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(y,"$constructor");var Yi=Symbol("zod_brand"),ot=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},qt=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},oo={};function ce(e){return e&&Object.assign(oo,e),oo}a(ce,"config");var E={};Pt(E,{BIGINT_FORMAT_RANGES:()=>Zu,Class:()=>Du,NUMBER_FORMAT_RANGES:()=>qu,aborted:()=>Bt,allowsEval:()=>Lu,assert:()=>jI,assertEqual:()=>RI,assertIs:()=>NI,assertNever:()=>DI,assertNotEqual:()=>OI,assignProp:()=>Gt,base64ToUint8Array:()=>bb,base64urlToUint8Array:()=>XI,cached:()=>Mn,captureStackTrace:()=>Xi,cleanEnum:()=>QI,cleanRegex:()=>ao,clone:()=>Ae,cloneDef:()=>LI,createTransparentProxy:()=>GI,defineLazy:()=>V,esc:()=>Qi,escapeRegex:()=>Ke,extend:()=>KI,finalizeIssue:()=>De,floatSafeRemainder:()=>ju,getElementAtPath:()=>zI,getEnumValues:()=>so,getLengthableOrigin:()=>lo,getParsedType:()=>ZI,getSizableOrigin:()=>uo,hexToUint8Array:()=>tP,isObject:()=>vn,isPlainObject:()=>Vt,issue:()=>Fn,joinValues:()=>x,jsonStringifyReplacer:()=>zn,merge:()=>WI,mergeDefs:()=>Ct,normalizeParams:()=>A,nullish:()=>Zt,numKeys:()=>qI,objectClone:()=>UI,omit:()=>BI,optionalKeys:()=>Fu,parsedType:()=>P,partial:()=>HI,pick:()=>VI,prefixIssues:()=>Me,primitiveTypes:()=>Mu,promiseAllObject:()=>MI,propertyKeyTypes:()=>co,randomString:()=>FI,required:()=>YI,safeExtend:()=>JI,shallowClone:()=>zu,slugify:()=>Uu,stringifyPrimitive:()=>S,uint8ArrayToBase64:()=>wb,uint8ArrayToBase64url:()=>eP,uint8ArrayToHex:()=>nP,unwrapMessage:()=>io});function RI(e){return e}a(RI,"assertEqual");function OI(e){return e}a(OI,"assertNotEqual");function NI(e){}a(NI,"assertIs");function DI(e){throw new Error("Unexpected value in exhaustive check")}a(DI,"assertNever");function jI(e){}a(jI,"assert");function so(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}a(so,"getEnumValues");function x(e,t="|"){return e.map(r=>S(r)).join(t)}a(x,"joinValues");function zn(e,t){return typeof t=="bigint"?t.toString():t}a(zn,"jsonStringifyReplacer");function Mn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Mn,"cached");function Zt(e){return e==null}a(Zt,"nullish");function ao(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(ao,"cleanRegex");function ju(e,t){let r=(e.toString().split(".")[1]||"").length,o=t.toString(),n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){let u=o.match(/\d?e-(\d?)/);u?.[1]&&(n=Number.parseInt(u[1]))}let i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),c=Number.parseInt(t.toFixed(i).replace(".",""));return s%c/10**i}a(ju,"floatSafeRemainder");var vb=Symbol("evaluating");function V(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==vb)return o===void 0&&(o=vb,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}a(V,"defineLazy");function UI(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}a(UI,"objectClone");function Gt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(Gt,"assignProp");function Ct(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}a(Ct,"mergeDefs");function LI(e){return Ct(e._zod.def)}a(LI,"cloneDef");function zI(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}a(zI,"getElementAtPath");function MI(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}a(MI,"promiseAllObject");function FI(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}a(FI,"randomString");function Qi(e){return JSON.stringify(e)}a(Qi,"esc");function Uu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(Uu,"slugify");var Xi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function vn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(vn,"isObject");var Lu=Mn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Vt(e){if(vn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(vn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Vt,"isPlainObject");function zu(e){return Vt(e)?{...e}:Array.isArray(e)?[...e]:e}a(zu,"shallowClone");function qI(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}a(qI,"numKeys");var ZI=a(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),co=new Set(["string","number","symbol"]),Mu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Ke,"escapeRegex");function Ae(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}a(Ae,"clone");function A(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(A,"normalizeParams");function GI(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}a(GI,"createTransparentProxy");function S(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}a(S,"stringifyPrimitive");function Fu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Fu,"optionalKeys");var qu={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]},Zu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function VI(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Ct(e._zod.def,{get shape(){let s={};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(s[c]=r.shape[c])}return Gt(this,"shape",s),s},checks:[]});return Ae(e,i)}a(VI,"pick");function BI(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Ct(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete s[c]}return Gt(this,"shape",s),s},checks:[]});return Ae(e,i)}a(BI,"omit");function KI(e,t){if(!Vt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ct(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Gt(this,"shape",i),i}});return Ae(e,n)}a(KI,"extend");function JI(e,t){if(!Vt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ct(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Gt(this,"shape",o),o}});return Ae(e,r)}a(JI,"safeExtend");function WI(e,t){let r=Ct(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Gt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ae(e,r)}a(WI,"merge");function HI(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Ct(t._zod.def,{get shape(){let c=t._zod.def.shape,u={...c};if(r)for(let l in r){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:c[l]}):c[l])}else for(let l in c)u[l]=e?new e({type:"optional",innerType:c[l]}):c[l];return Gt(this,"shape",u),u},checks:[]});return Ae(t,s)}a(HI,"partial");function YI(e,t,r){let o=Ct(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return Gt(this,"shape",i),i}});return Ae(t,o)}a(YI,"required");function Bt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}a(Bt,"aborted");function Me(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}a(Me,"prefixIssues");function io(e){return typeof e=="string"?e:e?.message}a(io,"unwrapMessage");function De(e,t,r){let o={...e,path:e.path??[]};if(!e.message){let n=io(e.inst?._zod.def?.error?.(e))??io(t?.error?.(e))??io(r.customError?.(e))??io(r.localeError?.(e))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}a(De,"finalizeIssue");function uo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}a(uo,"getSizableOrigin");function lo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(lo,"getLengthableOrigin");function P(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}a(P,"parsedType");function Fn(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}a(Fn,"issue");function QI(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}a(QI,"cleanEnum");function bb(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}a(bb,"base64ToUint8Array");function wb(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}a(wb,"uint8ArrayToBase64");function XI(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return bb(t+r)}a(XI,"base64urlToUint8Array");function eP(e){return wb(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(eP,"uint8ArrayToBase64url");function tP(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}a(tP,"hexToUint8Array");function nP(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}a(nP,"uint8ArrayToHex");var Du=class{static{a(this,"Class")}constructor(...t){}};var kb=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zn,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),po=y("$ZodError",kb),je=y("$ZodError",kb,{Parent:Error});function fo(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}a(fo,"flattenError");function mo(e,t=r=>r.message){let r={_errors:[]},o=a(n=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let s=r,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(t(i))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}},"processError");return o(e),r}a(mo,"formatError");function Gu(e,t=r=>r.message){let r={errors:[]},o=a((n,i=[])=>{var s,c;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>o({issues:l},u.path));else if(u.code==="invalid_key")o({issues:u.issues},u.path);else if(u.code==="invalid_element")o({issues:u.issues},u.path);else{let l=[...i,...u.path];if(l.length===0){r.errors.push(t(u));continue}let d=r,f=0;for(;f<l.length;){let p=l[f],m=f===l.length-1;typeof p=="string"?(d.properties??(d.properties={}),(s=d.properties)[p]??(s[p]={errors:[]}),d=d.properties[p]):(d.items??(d.items=[]),(c=d.items)[p]??(c[p]={errors:[]}),d=d.items[p]),m&&d.errors.push(t(u)),f++}}},"processError");return o(e),r}a(Gu,"treeifyError");function xb(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}a(xb,"toDotPath");function Vu(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${xb(o.path)}`);return t.join(`
|
|
260
|
+
`)}a(Vu,"prettifyError");var qn=a(e=>(t,r,o,n)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new ot;if(s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>De(u,i,ce())));throw Xi(c,n?.callee),c}return s.value},"_parse"),es=qn(je),Zn=a(e=>async(t,r,o,n)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>De(u,i,ce())));throw Xi(c,n?.callee),c}return s.value},"_parseAsync"),ts=Zn(je),Gn=a(e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new ot;return i.issues.length?{success:!1,error:new(e??po)(i.issues.map(s=>De(s,n,ce())))}:{success:!0,data:i.value}},"_safeParse"),Bu=Gn(je),Vn=a(e=>async(t,r,o)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>De(s,n,ce())))}:{success:!0,data:i.value}},"_safeParseAsync"),Ku=Vn(je),ns=a(e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return qn(e)(t,r,n)},"_encode"),oP=ns(je),rs=a(e=>(t,r,o)=>qn(e)(t,r,o),"_decode"),iP=rs(je),os=a(e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Zn(e)(t,r,n)},"_encodeAsync"),sP=os(je),is=a(e=>async(t,r,o)=>Zn(e)(t,r,o),"_decodeAsync"),aP=is(je),ss=a(e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Gn(e)(t,r,n)},"_safeEncode"),cP=ss(je),as=a(e=>(t,r,o)=>Gn(e)(t,r,o),"_safeDecode"),uP=as(je),cs=a(e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Vn(e)(t,r,n)},"_safeEncodeAsync"),lP=cs(je),us=a(e=>async(t,r,o)=>Vn(e)(t,r,o),"_safeDecodeAsync"),dP=us(je);var Je={};Pt(Je,{base64:()=>ul,base64url:()=>ls,bigint:()=>gl,boolean:()=>yl,browserEmail:()=>bP,cidrv4:()=>al,cidrv6:()=>cl,cuid:()=>Ju,cuid2:()=>Wu,date:()=>dl,datetime:()=>fl,domain:()=>xP,duration:()=>el,e164:()=>ll,email:()=>nl,emoji:()=>rl,extendedDuration:()=>pP,guid:()=>tl,hex:()=>_P,hostname:()=>kP,html5Email:()=>hP,idnEmail:()=>vP,integer:()=>hl,ipv4:()=>ol,ipv6:()=>il,ksuid:()=>Qu,lowercase:()=>wl,mac:()=>sl,md5_base64:()=>SP,md5_base64url:()=>IP,md5_hex:()=>$P,nanoid:()=>Xu,null:()=>vl,number:()=>ds,rfc5322Email:()=>yP,sha1_base64:()=>EP,sha1_base64url:()=>TP,sha1_hex:()=>PP,sha256_base64:()=>CP,sha256_base64url:()=>RP,sha256_hex:()=>AP,sha384_base64:()=>NP,sha384_base64url:()=>DP,sha384_hex:()=>OP,sha512_base64:()=>UP,sha512_base64url:()=>LP,sha512_hex:()=>jP,string:()=>ml,time:()=>pl,ulid:()=>Hu,undefined:()=>bl,unicodeEmail:()=>_b,uppercase:()=>kl,uuid:()=>bn,uuid4:()=>fP,uuid6:()=>mP,uuid7:()=>gP,xid:()=>Yu});var Ju=/^[cC][^\s-]{8,}$/,Wu=/^[0-9a-z]+$/,Hu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Yu=/^[0-9a-vA-V]{20}$/,Qu=/^[A-Za-z0-9]{27}$/,Xu=/^[a-zA-Z0-9_-]{21}$/,el=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pP=/^[-+]?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)?)??$/,tl=/^([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})$/,bn=a(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),fP=bn(4),mP=bn(6),gP=bn(7),nl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hP=/^[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])?)*$/,yP=/^(([^<>()\[\]\\.,;:\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,}))$/,_b=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,vP=_b,bP=/^[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])?)*$/,wP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function rl(){return new RegExp(wP,"u")}a(rl,"emoji");var ol=/^(?:(?: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])$/,il=/^(([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}|:))$/,sl=a(e=>{let t=Ke(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),al=/^((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])$/,cl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ul=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ls=/^[A-Za-z0-9_-]*$/,kP=/^(?=.{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])?)*\.?$/,xP=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ll=/^\+[1-9]\d{6,14}$/,$b="(?:(?:\\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])))",dl=new RegExp(`^${$b}$`);function Sb(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(Sb,"timeSource");function pl(e){return new RegExp(`^${Sb(e)}$`)}a(pl,"time");function fl(e){let t=Sb({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${$b}T(?:${o})$`)}a(fl,"datetime");var ml=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),gl=/^-?\d+n?$/,hl=/^-?\d+$/,ds=/^-?\d+(?:\.\d+)?$/,yl=/^(?:true|false)$/i,vl=/^null$/i;var bl=/^undefined$/i;var wl=/^[^A-Z]*$/,kl=/^[^a-z]*$/,_P=/^[0-9a-fA-F]*$/;function go(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}a(go,"fixedBase64");function ho(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}a(ho,"fixedBase64url");var $P=/^[0-9a-fA-F]{32}$/,SP=go(22,"=="),IP=ho(22),PP=/^[0-9a-fA-F]{40}$/,EP=go(27,"="),TP=ho(27),AP=/^[0-9a-fA-F]{64}$/,CP=go(43,"="),RP=ho(43),OP=/^[0-9a-fA-F]{96}$/,NP=go(64,""),DP=ho(64),jP=/^[0-9a-fA-F]{128}$/,UP=go(86,"=="),LP=ho(86);var te=y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Pb={number:"number",bigint:"bigint",object:"date"},ps=y("$ZodCheckLessThan",(e,t)=>{te.init(e,t);let r=Pb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fs=y("$ZodCheckGreaterThan",(e,t)=>{te.init(e,t);let r=Pb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xl=y("$ZodCheckMultipleOf",(e,t)=>{te.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):ju(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),_l=y("$ZodCheckNumberFormat",(e,t)=>{te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=qu[t.format];e._zod.onattach.push(s=>{let c=s._zod.bag;c.format=t.format,c.minimum=n,c.maximum=i,r&&(c.pattern=hl)}),e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}c<n&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),$l=y("$ZodCheckBigIntFormat",(e,t)=>{te.init(e,t);let[r,o]=Zu[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Sl=y("$ZodCheckMaxSize",(e,t)=>{var r;te.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Zt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:uo(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Il=y("$ZodCheckMinSize",(e,t)=>{var r;te.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Zt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:uo(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Pl=y("$ZodCheckSizeEquals",(e,t)=>{var r;te.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Zt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:uo(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),El=y("$ZodCheckMaxLength",(e,t)=>{var r;te.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Zt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let s=lo(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Tl=y("$ZodCheckMinLength",(e,t)=>{var r;te.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Zt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let s=lo(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Al=y("$ZodCheckLengthEquals",(e,t)=>{var r;te.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Zt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let s=lo(n),c=i>t.length;o.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Bn=y("$ZodCheckStringFormat",(e,t)=>{var r,o;te.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Cl=y("$ZodCheckRegex",(e,t)=>{Bn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Rl=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=wl),Bn.init(e,t)}),Ol=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kl),Bn.init(e,t)}),Nl=y("$ZodCheckIncludes",(e,t)=>{te.init(e,t);let r=Ke(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Dl=y("$ZodCheckStartsWith",(e,t)=>{te.init(e,t);let r=new RegExp(`^${Ke(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),jl=y("$ZodCheckEndsWith",(e,t)=>{te.init(e,t);let r=new RegExp(`.*${Ke(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Ib(e,t,r){e.issues.length&&t.issues.push(...Me(r,e.issues))}a(Ib,"handleCheckPropertyResult");var Ul=y("$ZodCheckProperty",(e,t)=>{te.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Ib(n,r,t.property));Ib(o,r,t.property)}}),Ll=y("$ZodCheckMimeType",(e,t)=>{te.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),zl=y("$ZodCheckOverwrite",(e,t)=>{te.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var yo=class{static{a(this,"Doc")}constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
260
261
|
`).filter(s=>s),n=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
261
|
-
`))}};var Iu={major:4,minor:3,patch:6};var z=y("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Iu;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=a((s,c,l)=>{let u=Vt(s),d;for(let m of c){if(m._zod.def.when){if(!m._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,f=m._zod.check(s);if(f instanceof Promise&&l?.async===!1)throw new nt;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(u||(u=Vt(s,p)))});else{if(s.issues.length===p)continue;u||(u=Vt(s,p))}}return d?d.then(()=>s):s},"runChecks"),i=a((s,c,l)=>{if(Vt(s))return s.aborted=!0,s;let u=n(c,o,l);if(u instanceof Promise){if(l.async===!1)throw new nt;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)},"handleCanaryResult");e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,s,c)):i(u,s,c)}let l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new nt;return l.then(u=>n(u,o,c))}return n(l,o,c)}}G(e,"~standard",()=>({validate:a(n=>{try{let i=Rl(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ol(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),bn=y("$ZodString",(e,t)=>{z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??eu(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Q=y("$ZodStringFormat",(e,t)=>{Vn.init(e,t),bn.init(e,t)}),Eu=y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ql),Q.init(e,t)}),Tu=y("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vn(o))}else t.pattern??(t.pattern=vn());Q.init(e,t)}),Au=y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fl),Q.init(e,t)}),Cu=y("$ZodURL",(e,t)=>{Q.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ru=y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Zl()),Q.init(e,t)}),Ou=y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=zl),Q.init(e,t)}),Nu=y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Nl),Q.init(e,t)}),Du=y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Dl),Q.init(e,t)}),ju=y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=jl),Q.init(e,t)}),Lu=y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ll),Q.init(e,t)}),Uu=y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ul),Q.init(e,t)}),zu=y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xl(t)),Q.init(e,t)}),Mu=y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Yl),Q.init(e,t)}),qu=y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ql(t)),Q.init(e,t)}),Fu=y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ml),Q.init(e,t)}),Zu=y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gl),Q.init(e,t),e._zod.bag.format="ipv4"}),Gu=y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Vl),Q.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Vu=y("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Bl(t.delimiter)),Q.init(e,t),e._zod.bag.format="mac"}),Bu=y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Jl),Q.init(e,t)}),Ju=y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Kl),Q.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ku(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}a(Ku,"isValidBase64");var Wu=y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Wl),Q.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ku(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function sb(e){if(!rs.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ku(r)}a(sb,"isValidBase64URL");var Hu=y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rs),Q.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{sb(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Yu=y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Hl),Q.init(e,t)});function ab(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}a(ab,"isValidJWT");var Qu=y("$ZodJWT",(e,t)=>{Q.init(e,t),e._zod.check=r=>{ab(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Xu=y("$ZodCustomStringFormat",(e,t)=>{Q.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),ps=y("$ZodNumber",(e,t)=>{z.init(e,t),e._zod.pattern=e._zod.bag.pattern??os,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),ed=y("$ZodNumberFormat",(e,t)=>{lu.init(e,t),ps.init(e,t)}),po=y("$ZodBoolean",(e,t)=>{z.init(e,t),e._zod.pattern=ru,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ms=y("$ZodBigInt",(e,t)=>{z.init(e,t),e._zod.pattern=tu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),td=y("$ZodBigIntFormat",(e,t)=>{uu.init(e,t),ms.init(e,t)}),nd=y("$ZodSymbol",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),rd=y("$ZodUndefined",(e,t)=>{z.init(e,t),e._zod.pattern=iu,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),od=y("$ZodNull",(e,t)=>{z.init(e,t),e._zod.pattern=ou,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),id=y("$ZodAny",(e,t)=>{z.init(e,t),e._zod.parse=r=>r}),sd=y("$ZodUnknown",(e,t)=>{z.init(e,t),e._zod.parse=r=>r}),ad=y("$ZodNever",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),cd=y("$ZodVoid",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),ld=y("$ZodDate",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Wv(e,t,r){e.issues.length&&t.issues.push(...Ue(r,e.issues)),t.value[r]=e.value}a(Wv,"handleArrayResult");var ud=y("$ZodArray",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let c=n[s],l=t.element._zod.run({value:c,issues:[]},o);l instanceof Promise?i.push(l.then(u=>Wv(u,r,s))):Wv(l,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function ds(e,t,r,o,n){if(e.issues.length){if(n&&!(r in o))return;t.issues.push(...Ue(r,e.issues))}e.value===void 0?r in o&&(t.value[r]=void 0):t.value[r]=e.value}a(ds,"handlePropertyResult");function cb(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Pl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(cb,"normalizeDef");function lb(e,t,r,o,n,i){let s=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optout==="optional";for(let m in t){if(c.has(m))continue;if(u==="never"){s.push(m);continue}let p=l.run({value:t[m],issues:[]},o);p instanceof Promise?e.push(p.then(f=>ds(f,r,m,t,d))):ds(p,r,m,t,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}a(lb,"handleCatchall");var ub=y("$ZodObject",(e,t)=>{if(z.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let o=zn(()=>cb(t));G(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let d=c[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let m of d.values)l[u].add(m)}}return l});let n=yn,i=t.catchall,s;e._zod.parse=(c,l)=>{s??(s=o.value);let u=c.value;if(!n(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};let d=[],m=s.shape;for(let p of s.keys){let f=m[p],g=f._zod.optout==="optional",v=f._zod.run({value:u[p],issues:[]},l);v instanceof Promise?d.push(v.then(h=>ds(h,c,p,u,g))):ds(v,c,p,u,g)}return i?lb(d,u,c,l,o.value,e):d.length?Promise.all(d).then(()=>c):c}}),dd=y("$ZodObjectJIT",(e,t)=>{ub.init(e,t);let r=e._zod.parse,o=zn(()=>cb(t)),n=a(p=>{let f=new uo(["shape","payload","ctx"]),g=o.value,v=a(k=>{let O=Vi(k);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`},"parseStr");f.write("const input = payload.value;");let h=Object.create(null),x=0;for(let k of g.keys)h[k]=`key_${x++}`;f.write("const newResult = {};");for(let k of g.keys){let O=h[k],A=Vi(k),L=p[k]?._zod?.optout==="optional";f.write(`const ${O} = ${v(k)};`),L?f.write(`
|
|
262
|
-
if (${
|
|
263
|
-
if (${
|
|
264
|
-
payload.issues = payload.issues.concat(${
|
|
262
|
+
`))}};var Ml={major:4,minor:3,patch:6};var M=y("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ml;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=a((s,c,u)=>{let l=Bt(s),d;for(let f of c){if(f._zod.def.when){if(!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 ot;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==p&&(l||(l=Bt(s,p)))});else{if(s.issues.length===p)continue;l||(l=Bt(s,p))}}return d?d.then(()=>s):s},"runChecks"),i=a((s,c,u)=>{if(Bt(s))return s.aborted=!0,s;let l=n(c,o,u);if(l instanceof Promise){if(u.async===!1)throw new ot;return l.then(d=>e._zod.parse(d,u))}return e._zod.parse(l,u)},"handleCanaryResult");e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,s,c)):i(l,s,c)}let u=e._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new ot;return u.then(l=>n(l,o,c))}return n(u,o,c)}}V(e,"~standard",()=>({validate:a(n=>{try{let i=Bu(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ku(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wn=y("$ZodString",(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ml(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),X=y("$ZodStringFormat",(e,t)=>{Bn.init(e,t),wn.init(e,t)}),ql=y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tl),X.init(e,t)}),Zl=y("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bn(o))}else t.pattern??(t.pattern=bn());X.init(e,t)}),Gl=y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=nl),X.init(e,t)}),Vl=y("$ZodURL",(e,t)=>{X.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Bl=y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=rl()),X.init(e,t)}),Kl=y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Xu),X.init(e,t)}),Jl=y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ju),X.init(e,t)}),Wl=y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Wu),X.init(e,t)}),Hl=y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Hu),X.init(e,t)}),Yl=y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Yu),X.init(e,t)}),Ql=y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Qu),X.init(e,t)}),Xl=y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=fl(t)),X.init(e,t)}),ed=y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=dl),X.init(e,t)}),td=y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pl(t)),X.init(e,t)}),nd=y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=el),X.init(e,t)}),rd=y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ol),X.init(e,t),e._zod.bag.format="ipv4"}),od=y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=il),X.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),id=y("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=sl(t.delimiter)),X.init(e,t),e._zod.bag.format="mac"}),sd=y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=al),X.init(e,t)}),ad=y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=cl),X.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function cd(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}a(cd,"isValidBase64");var ud=y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ul),X.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{cd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Mb(e){if(!ls.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return cd(r)}a(Mb,"isValidBase64URL");var ld=y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ls),X.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Mb(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),dd=y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ll),X.init(e,t)});function Fb(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}a(Fb,"isValidJWT");var pd=y("$ZodJWT",(e,t)=>{X.init(e,t),e._zod.check=r=>{Fb(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),fd=y("$ZodCustomStringFormat",(e,t)=>{X.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),bs=y("$ZodNumber",(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??ds,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),md=y("$ZodNumberFormat",(e,t)=>{_l.init(e,t),bs.init(e,t)}),vo=y("$ZodBoolean",(e,t)=>{M.init(e,t),e._zod.pattern=yl,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ws=y("$ZodBigInt",(e,t)=>{M.init(e,t),e._zod.pattern=gl,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),gd=y("$ZodBigIntFormat",(e,t)=>{$l.init(e,t),ws.init(e,t)}),hd=y("$ZodSymbol",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),yd=y("$ZodUndefined",(e,t)=>{M.init(e,t),e._zod.pattern=bl,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),vd=y("$ZodNull",(e,t)=>{M.init(e,t),e._zod.pattern=vl,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),bd=y("$ZodAny",(e,t)=>{M.init(e,t),e._zod.parse=r=>r}),wd=y("$ZodUnknown",(e,t)=>{M.init(e,t),e._zod.parse=r=>r}),kd=y("$ZodNever",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),xd=y("$ZodVoid",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),_d=y("$ZodDate",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Tb(e,t,r){e.issues.length&&t.issues.push(...Me(r,e.issues)),t.value[r]=e.value}a(Tb,"handleArrayResult");var $d=y("$ZodArray",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let c=n[s],u=t.element._zod.run({value:c,issues:[]},o);u instanceof Promise?i.push(u.then(l=>Tb(l,r,s))):Tb(u,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function vs(e,t,r,o,n){if(e.issues.length){if(n&&!(r in o))return;t.issues.push(...Me(r,e.issues))}e.value===void 0?r in o&&(t.value[r]=void 0):t.value[r]=e.value}a(vs,"handlePropertyResult");function qb(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Fu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(qb,"normalizeDef");function Zb(e,t,r,o,n,i){let s=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,d=u.optout==="optional";for(let f in t){if(c.has(f))continue;if(l==="never"){s.push(f);continue}let p=u.run({value:t[f],issues:[]},o);p instanceof Promise?e.push(p.then(m=>vs(m,r,f,t,d))):vs(p,r,f,t,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}a(Zb,"handleCatchall");var Gb=y("$ZodObject",(e,t)=>{if(M.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let u={...c};return Object.defineProperty(t,"shape",{value:u}),u},"get")})}let o=Mn(()=>qb(t));V(e._zod,"propValues",()=>{let c=t.shape,u={};for(let l in c){let d=c[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(let f of d.values)u[l].add(f)}}return u});let n=vn,i=t.catchall,s;e._zod.parse=(c,u)=>{s??(s=o.value);let l=c.value;if(!n(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;c.value={};let d=[],f=s.shape;for(let p of s.keys){let m=f[p],g=m._zod.optout==="optional",v=m._zod.run({value:l[p],issues:[]},u);v instanceof Promise?d.push(v.then(h=>vs(h,c,p,l,g))):vs(v,c,p,l,g)}return i?Zb(d,l,c,u,o.value,e):d.length?Promise.all(d).then(()=>c):c}}),Sd=y("$ZodObjectJIT",(e,t)=>{Gb.init(e,t);let r=e._zod.parse,o=Mn(()=>qb(t)),n=a(p=>{let m=new yo(["shape","payload","ctx"]),g=o.value,v=a(_=>{let N=Qi(_);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`},"parseStr");m.write("const input = payload.value;");let h=Object.create(null),k=0;for(let _ of g.keys)h[_]=`key_${k++}`;m.write("const newResult = {};");for(let _ of g.keys){let N=h[_],I=Qi(_),z=p[_]?._zod?.optout==="optional";m.write(`const ${N} = ${v(_)};`),z?m.write(`
|
|
263
|
+
if (${N}.issues.length) {
|
|
264
|
+
if (${I} in input) {
|
|
265
|
+
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
|
|
265
266
|
...iss,
|
|
266
|
-
path: iss.path ? [${
|
|
267
|
+
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
267
268
|
})));
|
|
268
269
|
}
|
|
269
270
|
}
|
|
270
271
|
|
|
271
|
-
if (${
|
|
272
|
-
if (${
|
|
273
|
-
newResult[${
|
|
272
|
+
if (${N}.value === undefined) {
|
|
273
|
+
if (${I} in input) {
|
|
274
|
+
newResult[${I}] = undefined;
|
|
274
275
|
}
|
|
275
276
|
} else {
|
|
276
|
-
newResult[${
|
|
277
|
+
newResult[${I}] = ${N}.value;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
`):
|
|
280
|
-
if (${
|
|
281
|
-
payload.issues = payload.issues.concat(${
|
|
280
|
+
`):m.write(`
|
|
281
|
+
if (${N}.issues.length) {
|
|
282
|
+
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
|
|
282
283
|
...iss,
|
|
283
|
-
path: iss.path ? [${
|
|
284
|
+
path: iss.path ? [${I}, ...iss.path] : [${I}]
|
|
284
285
|
})));
|
|
285
286
|
}
|
|
286
287
|
|
|
287
|
-
if (${
|
|
288
|
-
if (${
|
|
289
|
-
newResult[${
|
|
288
|
+
if (${N}.value === undefined) {
|
|
289
|
+
if (${I} in input) {
|
|
290
|
+
newResult[${I}] = undefined;
|
|
290
291
|
}
|
|
291
292
|
} else {
|
|
292
|
-
newResult[${
|
|
293
|
+
newResult[${I}] = ${N}.value;
|
|
293
294
|
}
|
|
294
295
|
|
|
295
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let E=f.compile();return(k,O)=>E(p,k,O)},"generateFastpass"),i,s=yn,c=!Qr.jitless,u=c&&$l.value,d=t.catchall,m;e._zod.parse=(p,f)=>{m??(m=o.value);let g=p.value;return s(g)?c&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),p=i(p,f),d?lb([],g,p,f,m,e):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function Hv(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Vt(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Oe(s,o,ae())))}),t)}a(Hv,"handleUnionResults");var mo=y("$ZodUnion",(e,t)=>{z.init(e,t),G(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),G(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),G(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),G(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>to(i.source)).join("|")})$`)}});let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,c=[];for(let l of t.options){let u=l._zod.run({value:n.value,issues:[]},i);if(u instanceof Promise)c.push(u),s=!0;else{if(u.issues.length===0)return u;c.push(u)}}return s?Promise.all(c).then(l=>Hv(l,n,e,i)):Hv(c,n,e,i)}});function Yv(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Oe(s,o,ae())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}a(Yv,"handleExclusiveUnionResults");var pd=y("$ZodXor",(e,t)=>{mo.init(e,t),t.inclusive=!1;let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,c=[];for(let l of t.options){let u=l._zod.run({value:n.value,issues:[]},i);u instanceof Promise?(c.push(u),s=!0):c.push(u)}return s?Promise.all(c).then(l=>Yv(l,n,e,i)):Yv(c,n,e,i)}}),md=y("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mo.init(e,t);let r=e._zod.parse;G(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[c,l]of Object.entries(s)){n[c]||(n[c]=new Set);for(let u of l)n[c].add(u)}}return n});let o=zn(()=>{let n=t.options,i=new Map;for(let s of n){let c=s._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let l of c){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!yn(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let c=o.value.get(s?.[t.discriminator]);return c?c._zod.run(n,i):t.unionFallback?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),fd=y("$ZodIntersection",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>Qv(r,l,u)):Qv(r,i,s)}});function Pu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Gt(e)&&Gt(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=Pu(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=Pu(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}a(Pu,"mergeValues");function Qv(e,t,r){let o=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let l of c.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let l of c.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(c);let i=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(i.length&&n&&e.issues.push({...n,keys:i}),Vt(e))return e;let s=Pu(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}a(Qv,"handleIntersectionResults");var fs=y("$ZodTuple",(e,t)=>{z.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],c=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),l=c===-1?0:r.length-c;if(!t.rest){let d=i.length>r.length,m=i.length<l-1;if(d||m)return o.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:i,inst:e,origin:"array"}),o}let u=-1;for(let d of r){if(u++,u>=i.length&&u>=l)continue;let m=d._zod.run({value:i[u],issues:[]},n);m instanceof Promise?s.push(m.then(p=>as(p,o,u))):as(m,o,u)}if(t.rest){let d=i.slice(r.length);for(let m of d){u++;let p=t.rest._zod.run({value:m,issues:[]},n);p instanceof Promise?s.push(p.then(f=>as(f,o,u))):as(p,o,u)}}return s.length?Promise.all(s).then(()=>o):o}});function as(e,t,r){e.issues.length&&t.issues.push(...Ue(r,e.issues)),t.value[r]=e.value}a(as,"handleTupleResult");var gd=y("$ZodRecord",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Gt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let c=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);let d=t.valueType._zod.run({value:n[u],issues:[]},o);d instanceof Promise?i.push(d.then(m=>{m.issues.length&&r.issues.push(...Ue(u,m.issues)),r.value[u]=m.value})):(d.issues.length&&r.issues.push(...Ue(u,d.issues)),r.value[u]=d.value)}let l;for(let u in n)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__")continue;let l=t.keyType._zod.run({value:c,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&os.test(c)&&l.issues.length){let m=t.keyType._zod.run({value:Number(c),issues:[]},o);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){t.mode==="loose"?r.value[c]=n[c]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>Oe(m,o,ae())),input:c,path:[c],inst:e});continue}let d=t.valueType._zod.run({value:n[c],issues:[]},o);d instanceof Promise?i.push(d.then(m=>{m.issues.length&&r.issues.push(...Ue(c,m.issues)),r.value[l.value]=m.value})):(d.issues.length&&r.issues.push(...Ue(c,d.issues)),r.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>r):r}}),hd=y("$ZodMap",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[s,c]of n){let l=t.keyType._zod.run({value:s,issues:[]},o),u=t.valueType._zod.run({value:c,issues:[]},o);l instanceof Promise||u instanceof Promise?i.push(Promise.all([l,u]).then(([d,m])=>{Xv(d,m,r,s,n,e,o)})):Xv(l,u,r,s,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Xv(e,t,r,o,n,i,s){e.issues.length&&(no.has(typeof o)?r.issues.push(...Ue(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(c=>Oe(c,s,ae()))})),t.issues.length&&(no.has(typeof o)?r.issues.push(...Ue(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(c=>Oe(c,s,ae()))})),r.value.set(e.value,t.value)}a(Xv,"handleMapResult");var yd=y("$ZodSet",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let c=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(l=>eb(l,r))):eb(c,r)}return i.length?Promise.all(i).then(()=>r):r}});function eb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}a(eb,"handleSetResult");var vd=y("$ZodEnum",(e,t)=>{z.init(e,t);let r=eo(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>no.has(typeof n)).map(n=>typeof n=="string"?Ve(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),bd=y("$ZodLiteral",(e,t)=>{if(z.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ve(o):o?Ve(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),wd=y("$ZodFile",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),xd=y("$ZodTransform",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qt(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new nt;return r.value=n,r}});function tb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(tb,"handleOptionalResult");var gs=y("$ZodOptional",(e,t)=>{z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",G(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${to(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>tb(i,r.value)):tb(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),kd=y("$ZodExactOptional",(e,t)=>{gs.init(e,t),G(e._zod,"values",()=>t.innerType._zod.values),G(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),_d=y("$ZodNullable",(e,t)=>{z.init(e,t),G(e._zod,"optin",()=>t.innerType._zod.optin),G(e._zod,"optout",()=>t.innerType._zod.optout),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${to(r.source)}|null)$`):void 0}),G(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),$d=y("$ZodDefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",G(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>nb(i,t)):nb(n,t)}});function nb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}a(nb,"handleDefaultResult");var Sd=y("$ZodPrefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",G(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Id=y("$ZodNonOptional",(e,t)=>{z.init(e,t),G(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>rb(i,e)):rb(n,e)}});function rb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}a(rb,"handleNonOptionalResult");var Pd=y("$ZodSuccess",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qt("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Ed=y("$ZodCatch",(e,t)=>{z.init(e,t),G(e._zod,"optin",()=>t.innerType._zod.optin),G(e._zod,"optout",()=>t.innerType._zod.optout),G(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>Oe(s,o,ae()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Oe(i,o,ae()))},input:r.value}),r.issues=[]),r)}}),Td=y("$ZodNaN",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Ad=y("$ZodPipe",(e,t)=>{z.init(e,t),G(e._zod,"values",()=>t.in._zod.values),G(e._zod,"optin",()=>t.in._zod.optin),G(e._zod,"optout",()=>t.out._zod.optout),G(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>cs(s,t.in,o)):cs(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>cs(i,t.out,o)):cs(n,t.out,o)}});function cs(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(cs,"handlePipeResult");var fo=y("$ZodCodec",(e,t)=>{z.init(e,t),G(e._zod,"values",()=>t.in._zod.values),G(e._zod,"optin",()=>t.in._zod.optin),G(e._zod,"optout",()=>t.out._zod.optout),G(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(s=>ls(s,t,o)):ls(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>ls(s,t,o)):ls(i,t,o)}}});function ls(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>us(e,i,t.out,r)):us(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>us(e,i,t.in,r)):us(e,n,t.in,r)}}a(ls,"handleCodecAResult");function us(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}a(us,"handleCodecTxResult");var Cd=y("$ZodReadonly",(e,t)=>{z.init(e,t),G(e._zod,"propValues",()=>t.innerType._zod.propValues),G(e._zod,"values",()=>t.innerType._zod.values),G(e._zod,"optin",()=>t.innerType?._zod?.optin),G(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(ob):ob(n)}});function ob(e){return e.value=Object.freeze(e.value),e}a(ob,"handleReadonlyResult");var Rd=y("$ZodTemplateLiteral",(e,t)=>{z.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||Il.has(typeof o))r.push(Ve(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Od=y("$ZodFunction",(e,t)=>(z.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?Ji(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Ji(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await Ki(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Ki(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new fs({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Nd=y("$ZodPromise",(e,t)=>{z.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Dd=y("$ZodLazy",(e,t)=>{z.init(e,t),G(e._zod,"innerType",()=>t.getter()),G(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),G(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),G(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),G(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),jd=y("$ZodCustom",(e,t)=>{ee.init(e,t),z.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>ib(i,r,o,e));ib(n,r,o,e)}});function ib(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Mn(n))}}a(ib,"handleRefineResult");var bo={};St(bo,{ar:()=>Ld,az:()=>Ud,be:()=>zd,bg:()=>Md,ca:()=>qd,cs:()=>Fd,da:()=>Zd,de:()=>Gd,en:()=>go,eo:()=>Vd,es:()=>Bd,fa:()=>Jd,fi:()=>Kd,fr:()=>Wd,frCA:()=>Hd,he:()=>Yd,hu:()=>Qd,hy:()=>Xd,id:()=>ep,is:()=>tp,it:()=>np,ja:()=>rp,ka:()=>op,kh:()=>ip,km:()=>ho,ko:()=>sp,lt:()=>ap,mk:()=>cp,ms:()=>lp,nl:()=>up,no:()=>dp,ota:()=>pp,pl:()=>fp,ps:()=>mp,pt:()=>gp,ru:()=>hp,sl:()=>yp,sv:()=>vp,ta:()=>bp,th:()=>wp,tr:()=>xp,ua:()=>kp,uk:()=>vo,ur:()=>_p,uz:()=>$p,vi:()=>Sp,yo:()=>Ep,zhCN:()=>Ip,zhTW:()=>Pp});var CI=a(()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}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: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${w(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"}}},"error");function Ld(){return{localeError:CI()}}a(Ld,"default");var RI=a(()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${c}`}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: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${w(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"}}},"error");function Ud(){return{localeError:RI()}}a(Ud,"default");function db(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}a(db,"getBelarusianPlural");var OI=a(()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),l=db(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),l=db(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(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"}}},"error");function zd(){return{localeError:OI()}}a(zd,"default");var NI=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${w(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"}}},"error");function Md(){return{localeError:NI()}}a(Md,"default");var DI=a(()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${c}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${_(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${w(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"}}},"error");function qd(){return{localeError:DI()}}a(qd,"default");var jI=a(()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(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"}}},"error");function Fd(){return{localeError:jI()}}a(Fd,"default");var LI=a(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${c}`:`Ugyldigt input: forventede ${i}, fik ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${_(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),c=o[n.origin]??n.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),c=o[n.origin]??n.origin;return s?`For lille: forventede ${c} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(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"}}},"error");function Zd(){return{localeError:LI()}}a(Zd,"default");var UI=a(()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${c}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${_(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(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"}}},"error");function Gd(){return{localeError:UI()}}a(Gd,"default");var zI=a(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${_(n.values[0])}`:`Invalid option: expected one of ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function go(){return{localeError:zI()}}a(go,"default");var MI=a(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${c}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${_(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${w(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"}}},"error");function Vd(){return{localeError:MI()}}a(Vd,"default");var qI=a(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${_(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),c=o[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),c=o[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function Bd(){return{localeError:qI()}}a(Bd,"default");var FI=a(()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \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 ${w(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(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"}}},"error");function Jd(){return{localeError:FI()}}a(Jd,"default");var ZI=a(()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${c}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${_(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(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"}}},"error");function Kd(){return{localeError:ZI()}}a(Kd,"default");var GI=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${c} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${_(n.values[0])} attendu`:`Option invalide : une valeur parmi ${w(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(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"}}},"error");function Wd(){return{localeError:GI()}}a(Wd,"default");var VI=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${c}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${_(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(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"}}},"error");function Hd(){return{localeError:VI()}}a(Hd,"default");var BI=a(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=a(u=>u?e[u]:void 0,"typeEntry"),o=a(u=>{let d=r(u);return d?d.label:u??e.unknown.label},"typeLabel"),n=a(u=>`\u05D4${o(u)}`,"withDefinite"),i=a(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","verbFor"),s=a(u=>u?t[u]??null:null,"getSizing"),c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,m=l[d??""]??o(d),p=$(u.input),f=l[p]??e[p]?.label??p;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 ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}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 d=u.values.map(f=>_(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let m=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${m}`}case"too_big":{let d=s(u.origin),m=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let g=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: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",v=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let p=u.inclusive?"<=":"<",f=i(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${m} ${f} ${p}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${m} ${f} ${p}${u.maximum.toString()}`}case"too_small":{let d=s(u.origin),m=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let g=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: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let h=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`}let v=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let p=u.inclusive?">=":">",f=i(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${m} ${f} ${p}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${m} ${f} ${p}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let m=c[d.format],p=m?.label??d.format,g=(m?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${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"}: ${w(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"}}},"error");function Yd(){return{localeError:BI()}}a(Yd,"default");var JI=a(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${w(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"}}},"error");function Qd(){return{localeError:JI()}}a(Qd,"default");function pb(e,t,r){return Math.abs(e)===1?t:r}a(pb,"getArmenianPlural");function Bn(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}a(Bn,"withDefiniteArticle");var KI=a(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),l=pb(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),l=pb(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bn(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bn(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${w(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Bn(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 ${Bn(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function Xd(){return{localeError:KI()}}a(Xd,"default");var WI=a(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${i}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${_(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${w(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"}}},"error");function ep(){return{localeError:WI()}}a(ep,"default");var HI=a(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${i}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${w(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"}}},"error");function tp(){return{localeError:HI()}}a(tp,"default");var YI=a(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${c}`:`Input non valido: atteso ${i}, ricevuto ${c}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${_(n.values[0])}`:`Opzione non valida: atteso uno tra ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${w(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"}}},"error");function np(){return{localeError:YI()}}a(np,"default");var QI=a(()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\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: ${w(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${w(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"}}},"error");function rp(){return{localeError:QI()}}a(rp,"default");var XI=a(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}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 ${w(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(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"}}},"error");function op(){return{localeError:XI()}}a(op,"default");var eP=a(()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(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"}}},"error");function ho(){return{localeError:eP()}}a(ho,"default");function ip(){return ho()}a(ip,"default");var tP=a(()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\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: ${w(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),l=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),l=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(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"}}},"error");function sp(){return{localeError:tP()}}a(sp,"default");var yo=a(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function mb(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}a(mb,"getUnitTypeFromNumber");var nP=a(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,s,c){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[c][s?"inclusive":"notInclusive"]}}a(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${_(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=t(n.origin,mb(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${yo(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${yo(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=t(n.origin,mb(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${yo(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${yo(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${w(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${yo(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function ap(){return{localeError:nP()}}a(ap,"default");var rP=a(()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(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"}}},"error");function cp(){return{localeError:rP()}}a(cp,"default");var oP=a(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${c}`:`Input tidak sah: dijangka ${i}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${_(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(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"}}},"error");function lp(){return{localeError:oP()}}a(lp,"default");var iP=a(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${i}, ontving ${c}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${_(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),c=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),c=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${w(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"}}},"error");function up(){return{localeError:iP()}}a(up,"default");var sP=a(()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${c}`:`Ugyldig input: forventet ${i}, fikk ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${_(n.values[0])}`:`Ugyldig valg: forventet en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(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"}}},"error");function dp(){return{localeError:sP()}}a(dp,"default");var aP=a(()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${_(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${w(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."}}},"error");function pp(){return{localeError:aP()}}a(pp,"default");var cP=a(()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \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 ${w(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(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"}}},"error");function mp(){return{localeError:cP()}}a(mp,"default");var lP=a(()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${w(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"}}},"error");function fp(){return{localeError:lP()}}a(fp,"default");var uP=a(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${_(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}},"error");function gp(){return{localeError:uP()}}a(gp,"default");function fb(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}a(fb,"getRussianPlural");var dP=a(()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),l=fb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),l=fb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${w(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"}}},"error");function hp(){return{localeError:dP()}}a(hp,"default");var pP=a(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${c}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${_(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(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"}}},"error");function yp(){return{localeError:pP()}}a(yp,"default");var mP=a(()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${c}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${_(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(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"}}},"error");function vp(){return{localeError:mP()}}a(vp,"default");var fP=a(()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}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 ${w(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(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"}}},"error");function bp(){return{localeError:fP()}}a(bp,"default");var gP=a(()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(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"}}},"error");function wp(){return{localeError:gP()}}a(wp,"default");var hP=a(()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${c}`}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: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${w(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"}}},"error");function xp(){return{localeError:hP()}}a(xp,"default");var yP=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${w(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"}}},"error");function vo(){return{localeError:yP()}}a(vo,"default");function kp(){return vo()}a(kp,"default");var vP=a(()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \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: ${w(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${w(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"}}},"error");function _p(){return{localeError:vP()}}a(_p,"default");var bP=a(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${c}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${_(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${w(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"}}},"error");function $p(){return{localeError:bP()}}a($p,"default");var wP=a(()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(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"}}},"error");function Sp(){return{localeError:wP()}}a(Sp,"default");var xP=a(()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(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"}}},"error");function Ip(){return{localeError:xP()}}a(Ip,"default");var kP=a(()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${w(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"}}},"error");function Pp(){return{localeError:kP()}}a(Pp,"default");var _P=a(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=$(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${c}`}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 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(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"}}},"error");function Ep(){return{localeError:_P()}}a(Ep,"default");var gb,Tp=Symbol("ZodOutput"),Ap=Symbol("ZodInput"),hs=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ys(){return new hs}a(ys,"registry");(gb=globalThis).__zod_globalRegistry??(gb.__zod_globalRegistry=ys());var ke=globalThis.__zod_globalRegistry;function Cp(e,t){return new e({type:"string",...P(t)})}a(Cp,"_string");function Rp(e,t){return new e({type:"string",coerce:!0,...P(t)})}a(Rp,"_coercedString");function vs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...P(t)})}a(vs,"_email");function wo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...P(t)})}a(wo,"_guid");function bs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...P(t)})}a(bs,"_uuid");function ws(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(t)})}a(ws,"_uuidv4");function xs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(t)})}a(xs,"_uuidv6");function ks(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(t)})}a(ks,"_uuidv7");function xo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...P(t)})}a(xo,"_url");function _s(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...P(t)})}a(_s,"_emoji");function $s(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(t)})}a($s,"_nanoid");function Ss(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...P(t)})}a(Ss,"_cuid");function Is(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(t)})}a(Is,"_cuid2");function Ps(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...P(t)})}a(Ps,"_ulid");function Es(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...P(t)})}a(Es,"_xid");function Ts(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(t)})}a(Ts,"_ksuid");function As(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(t)})}a(As,"_ipv4");function Cs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(t)})}a(Cs,"_ipv6");function Op(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...P(t)})}a(Op,"_mac");function Rs(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(t)})}a(Rs,"_cidrv4");function Os(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(t)})}a(Os,"_cidrv6");function Ns(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...P(t)})}a(Ns,"_base64");function Ds(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...P(t)})}a(Ds,"_base64url");function js(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...P(t)})}a(js,"_e164");function Ls(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...P(t)})}a(Ls,"_jwt");var Np={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Dp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(t)})}a(Dp,"_isoDateTime");function jp(e,t){return new e({type:"string",format:"date",check:"string_format",...P(t)})}a(jp,"_isoDate");function Lp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...P(t)})}a(Lp,"_isoTime");function Up(e,t){return new e({type:"string",format:"duration",check:"string_format",...P(t)})}a(Up,"_isoDuration");function zp(e,t){return new e({type:"number",checks:[],...P(t)})}a(zp,"_number");function Mp(e,t){return new e({type:"number",coerce:!0,checks:[],...P(t)})}a(Mp,"_coercedNumber");function qp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...P(t)})}a(qp,"_int");function Fp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...P(t)})}a(Fp,"_float32");function Zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...P(t)})}a(Zp,"_float64");function Gp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...P(t)})}a(Gp,"_int32");function Vp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...P(t)})}a(Vp,"_uint32");function Bp(e,t){return new e({type:"boolean",...P(t)})}a(Bp,"_boolean");function Jp(e,t){return new e({type:"boolean",coerce:!0,...P(t)})}a(Jp,"_coercedBoolean");function Kp(e,t){return new e({type:"bigint",...P(t)})}a(Kp,"_bigint");function Wp(e,t){return new e({type:"bigint",coerce:!0,...P(t)})}a(Wp,"_coercedBigint");function Hp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(t)})}a(Hp,"_int64");function Yp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(t)})}a(Yp,"_uint64");function Qp(e,t){return new e({type:"symbol",...P(t)})}a(Qp,"_symbol");function Xp(e,t){return new e({type:"undefined",...P(t)})}a(Xp,"_undefined");function em(e,t){return new e({type:"null",...P(t)})}a(em,"_null");function tm(e){return new e({type:"any"})}a(tm,"_any");function nm(e){return new e({type:"unknown"})}a(nm,"_unknown");function rm(e,t){return new e({type:"never",...P(t)})}a(rm,"_never");function om(e,t){return new e({type:"void",...P(t)})}a(om,"_void");function im(e,t){return new e({type:"date",...P(t)})}a(im,"_date");function sm(e,t){return new e({type:"date",coerce:!0,...P(t)})}a(sm,"_coercedDate");function am(e,t){return new e({type:"nan",...P(t)})}a(am,"_nan");function vt(e,t){return new is({check:"less_than",...P(t),value:e,inclusive:!1})}a(vt,"_lt");function ze(e,t){return new is({check:"less_than",...P(t),value:e,inclusive:!0})}a(ze,"_lte");function bt(e,t){return new ss({check:"greater_than",...P(t),value:e,inclusive:!1})}a(bt,"_gt");function Te(e,t){return new ss({check:"greater_than",...P(t),value:e,inclusive:!0})}a(Te,"_gte");function Us(e){return bt(0,e)}a(Us,"_positive");function zs(e){return vt(0,e)}a(zs,"_negative");function Ms(e){return ze(0,e)}a(Ms,"_nonpositive");function qs(e){return Te(0,e)}a(qs,"_nonnegative");function Bt(e,t){return new cu({check:"multiple_of",...P(t),value:e})}a(Bt,"_multipleOf");function Jt(e,t){return new du({check:"max_size",...P(t),maximum:e})}a(Jt,"_maxSize");function wt(e,t){return new pu({check:"min_size",...P(t),minimum:e})}a(wt,"_minSize");function wn(e,t){return new mu({check:"size_equals",...P(t),size:e})}a(wn,"_size");function xn(e,t){return new fu({check:"max_length",...P(t),maximum:e})}a(xn,"_maxLength");function Ct(e,t){return new gu({check:"min_length",...P(t),minimum:e})}a(Ct,"_minLength");function kn(e,t){return new hu({check:"length_equals",...P(t),length:e})}a(kn,"_length");function Jn(e,t){return new yu({check:"string_format",format:"regex",...P(t),pattern:e})}a(Jn,"_regex");function Kn(e){return new vu({check:"string_format",format:"lowercase",...P(e)})}a(Kn,"_lowercase");function Wn(e){return new bu({check:"string_format",format:"uppercase",...P(e)})}a(Wn,"_uppercase");function Hn(e,t){return new wu({check:"string_format",format:"includes",...P(t),includes:e})}a(Hn,"_includes");function Yn(e,t){return new xu({check:"string_format",format:"starts_with",...P(t),prefix:e})}a(Yn,"_startsWith");function Qn(e,t){return new ku({check:"string_format",format:"ends_with",...P(t),suffix:e})}a(Qn,"_endsWith");function Fs(e,t,r){return new _u({check:"property",property:e,schema:t,...P(r)})}a(Fs,"_property");function Xn(e,t){return new $u({check:"mime_type",mime:e,...P(t)})}a(Xn,"_mime");function rt(e){return new Su({check:"overwrite",tx:e})}a(rt,"_overwrite");function er(e){return rt(t=>t.normalize(e))}a(er,"_normalize");function tr(){return rt(e=>e.trim())}a(tr,"_trim");function nr(){return rt(e=>e.toLowerCase())}a(nr,"_toLowerCase");function rr(){return rt(e=>e.toUpperCase())}a(rr,"_toUpperCase");function or(){return rt(e=>_l(e))}a(or,"_slugify");function cm(e,t,r){return new e({type:"array",element:t,...P(r)})}a(cm,"_array");function SP(e,t,r){return new e({type:"union",options:t,...P(r)})}a(SP,"_union");function IP(e,t,r){return new e({type:"union",options:t,inclusive:!1,...P(r)})}a(IP,"_xor");function PP(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...P(o)})}a(PP,"_discriminatedUnion");function EP(e,t,r){return new e({type:"intersection",left:t,right:r})}a(EP,"_intersection");function TP(e,t,r,o){let n=r instanceof z,i=n?o:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...P(i)})}a(TP,"_tuple");function AP(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...P(o)})}a(AP,"_record");function CP(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...P(o)})}a(CP,"_map");function RP(e,t,r){return new e({type:"set",valueType:t,...P(r)})}a(RP,"_set");function OP(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...P(r)})}a(OP,"_enum");function NP(e,t,r){return new e({type:"enum",entries:t,...P(r)})}a(NP,"_nativeEnum");function DP(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...P(r)})}a(DP,"_literal");function lm(e,t){return new e({type:"file",...P(t)})}a(lm,"_file");function jP(e,t){return new e({type:"transform",transform:t})}a(jP,"_transform");function LP(e,t){return new e({type:"optional",innerType:t})}a(LP,"_optional");function UP(e,t){return new e({type:"nullable",innerType:t})}a(UP,"_nullable");function zP(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Sl(r)}})}a(zP,"_default");function MP(e,t,r){return new e({type:"nonoptional",innerType:t,...P(r)})}a(MP,"_nonoptional");function qP(e,t){return new e({type:"success",innerType:t})}a(qP,"_success");function FP(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}a(FP,"_catch");function ZP(e,t,r){return new e({type:"pipe",in:t,out:r})}a(ZP,"_pipe");function GP(e,t){return new e({type:"readonly",innerType:t})}a(GP,"_readonly");function VP(e,t,r){return new e({type:"template_literal",parts:t,...P(r)})}a(VP,"_templateLiteral");function BP(e,t){return new e({type:"lazy",getter:t})}a(BP,"_lazy");function JP(e,t){return new e({type:"promise",innerType:t})}a(JP,"_promise");function um(e,t,r){let o=P(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}a(um,"_custom");function dm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...P(r)})}a(dm,"_refine");function pm(e){let t=hb(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Mn(o,r.value,t._zod.def));else{let n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(Mn(n))}},e(r.value,r)));return t}a(pm,"_superRefine");function hb(e,t){let r=new ee({check:"custom",...P(t)});return r._zod.check=e,r}a(hb,"_check");function mm(e){let t=new ee({check:"describe"});return t._zod.onattach=[r=>{let o=ke.get(r)??{};ke.add(r,{...o,description:e})}],t._zod.check=()=>{},t}a(mm,"describe");function fm(e){let t=new ee({check:"meta"});return t._zod.onattach=[r=>{let o=ke.get(r)??{};ke.add(r,{...o,...e})}],t._zod.check=()=>{},t}a(fm,"meta");function gm(e,t){let r=P(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),s=new Set(n),c=e.Codec??fo,l=e.Boolean??po,u=e.String??bn,d=new u({type:"string",error:r.error}),m=new l({type:"boolean",error:r.error}),p=new c({type:"pipe",in:d,out:m,transform:a(((f,g)=>{let v=f;return r.case!=="sensitive"&&(v=v.toLowerCase()),i.has(v)?!0:s.has(v)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:g.value,inst:p,continue:!1}),{})}),"transform"),reverseTransform:a(((f,g)=>f===!0?o[0]||"true":n[0]||"false"),"reverseTransform"),error:r.error});return p}a(gm,"_stringbool");function ir(e,t,r,o={}){let n=P(o),i={...P(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}a(ir,"_stringFormat");function Kt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ke,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}a(Kt,"initializeContext");function W(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let p=s.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,p,d)}let m=e._zod.parent;m&&(s.ref||(s.ref=m),W(m,t,d),t.seen.get(m).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Ae(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}a(W,"process");function Wt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let l=o.get(c);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,s[0])}}let n=a(s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let m=e.external.registry.get(s[0])?.id,p=e.external.uri??(g=>g);if(m)return{ref:p(m)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${c}/${f}`}}if(s[1]===r)return{ref:"#"};let u=`#/${c}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},"makeURI"),i=a(s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:l,defId:u}=n(s);c.def={...c.schema},u&&(c.defId=u);let d=c.schema;for(let m in d)delete d[m];d.$ref=l},"extractToDef");if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
296
|
+
`)}m.write("payload.value = newResult;"),m.write("return payload;");let T=m.compile();return(_,N)=>T(p,_,N)},"generateFastpass"),i,s=vn,c=!oo.jitless,l=c&&Lu.value,d=t.catchall,f;e._zod.parse=(p,m)=>{f??(f=o.value);let g=p.value;return s(g)?c&&l&&m?.async===!1&&m.jitless!==!0?(i||(i=n(t.shape)),p=i(p,m),d?Zb([],g,p,m,f,e):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function Ab(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Bt(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>De(s,o,ce())))}),t)}a(Ab,"handleUnionResults");var bo=y("$ZodUnion",(e,t)=>{M.init(e,t),V(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>ao(i.source)).join("|")})$`)}});let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,c=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},i);if(l instanceof Promise)c.push(l),s=!0;else{if(l.issues.length===0)return l;c.push(l)}}return s?Promise.all(c).then(u=>Ab(u,n,e,i)):Ab(c,n,e,i)}});function Cb(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>De(s,o,ce())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}a(Cb,"handleExclusiveUnionResults");var Id=y("$ZodXor",(e,t)=>{bo.init(e,t),t.inclusive=!1;let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,c=[];for(let u of t.options){let l=u._zod.run({value:n.value,issues:[]},i);l instanceof Promise?(c.push(l),s=!0):c.push(l)}return s?Promise.all(c).then(u=>Cb(u,n,e,i)):Cb(c,n,e,i)}}),Pd=y("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,bo.init(e,t);let r=e._zod.parse;V(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[c,u]of Object.entries(s)){n[c]||(n[c]=new Set);for(let l of u)n[c].add(l)}}return n});let o=Mn(()=>{let n=t.options,i=new Map;for(let s of n){let c=s._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of c){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!vn(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let c=o.value.get(s?.[t.discriminator]);return c?c._zod.run(n,i):t.unionFallback?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),Ed=y("$ZodIntersection",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,l])=>Rb(r,u,l)):Rb(r,i,s)}});function Fl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Vt(e)&&Vt(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=Fl(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=Fl(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}a(Fl,"mergeValues");function Rb(e,t,r){let o=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let u of c.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else e.issues.push(c);let i=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(i.length&&n&&e.issues.push({...n,keys:i}),Bt(e))return e;let s=Fl(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}a(Rb,"handleIntersectionResults");var ks=y("$ZodTuple",(e,t)=>{M.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],c=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),u=c===-1?0:r.length-c;if(!t.rest){let d=i.length>r.length,f=i.length<u-1;if(d||f)return o.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:i,inst:e,origin:"array"}),o}let l=-1;for(let d of r){if(l++,l>=i.length&&l>=u)continue;let f=d._zod.run({value:i[l],issues:[]},n);f instanceof Promise?s.push(f.then(p=>ms(p,o,l))):ms(f,o,l)}if(t.rest){let d=i.slice(r.length);for(let f of d){l++;let p=t.rest._zod.run({value:f,issues:[]},n);p instanceof Promise?s.push(p.then(m=>ms(m,o,l))):ms(p,o,l)}}return s.length?Promise.all(s).then(()=>o):o}});function ms(e,t,r){e.issues.length&&t.issues.push(...Me(r,e.issues)),t.value[r]=e.value}a(ms,"handleTupleResult");var Td=y("$ZodRecord",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Vt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let c=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);let d=t.valueType._zod.run({value:n[l],issues:[]},o);d instanceof Promise?i.push(d.then(f=>{f.issues.length&&r.issues.push(...Me(l,f.issues)),r.value[l]=f.value})):(d.issues.length&&r.issues.push(...Me(l,d.issues)),r.value[l]=d.value)}let u;for(let l in n)c.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__")continue;let u=t.keyType._zod.run({value:c,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&ds.test(c)&&u.issues.length){let f=t.keyType._zod.run({value:Number(c),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(u=f)}if(u.issues.length){t.mode==="loose"?r.value[c]=n[c]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>De(f,o,ce())),input:c,path:[c],inst:e});continue}let d=t.valueType._zod.run({value:n[c],issues:[]},o);d instanceof Promise?i.push(d.then(f=>{f.issues.length&&r.issues.push(...Me(c,f.issues)),r.value[u.value]=f.value})):(d.issues.length&&r.issues.push(...Me(c,d.issues)),r.value[u.value]=d.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Ad=y("$ZodMap",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[s,c]of n){let u=t.keyType._zod.run({value:s,issues:[]},o),l=t.valueType._zod.run({value:c,issues:[]},o);u instanceof Promise||l instanceof Promise?i.push(Promise.all([u,l]).then(([d,f])=>{Ob(d,f,r,s,n,e,o)})):Ob(u,l,r,s,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Ob(e,t,r,o,n,i,s){e.issues.length&&(co.has(typeof o)?r.issues.push(...Me(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(c=>De(c,s,ce()))})),t.issues.length&&(co.has(typeof o)?r.issues.push(...Me(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(c=>De(c,s,ce()))})),r.value.set(e.value,t.value)}a(Ob,"handleMapResult");var Cd=y("$ZodSet",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let c=t.valueType._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(u=>Nb(u,r))):Nb(c,r)}return i.length?Promise.all(i).then(()=>r):r}});function Nb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}a(Nb,"handleSetResult");var Rd=y("$ZodEnum",(e,t)=>{M.init(e,t);let r=so(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>co.has(typeof n)).map(n=>typeof n=="string"?Ke(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),Od=y("$ZodLiteral",(e,t)=>{if(M.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ke(o):o?Ke(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Nd=y("$ZodFile",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Dd=y("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qt(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new ot;return r.value=n,r}});function Db(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(Db,"handleOptionalResult");var xs=y("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ao(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Db(i,r.value)):Db(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),jd=y("$ZodExactOptional",(e,t)=>{xs.init(e,t),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Ud=y("$ZodNullable",(e,t)=>{M.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ao(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Ld=y("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>jb(i,t)):jb(n,t)}});function jb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}a(jb,"handleDefaultResult");var zd=y("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Md=y("$ZodNonOptional",(e,t)=>{M.init(e,t),V(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Ub(i,e)):Ub(n,e)}});function Ub(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}a(Ub,"handleNonOptionalResult");var Fd=y("$ZodSuccess",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qt("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),qd=y("$ZodCatch",(e,t)=>{M.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>De(s,o,ce()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>De(i,o,ce()))},input:r.value}),r.issues=[]),r)}}),Zd=y("$ZodNaN",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Gd=y("$ZodPipe",(e,t)=>{M.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>gs(s,t.in,o)):gs(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>gs(i,t.out,o)):gs(n,t.out,o)}});function gs(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(gs,"handlePipeResult");var wo=y("$ZodCodec",(e,t)=>{M.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(s=>hs(s,t,o)):hs(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>hs(s,t,o)):hs(i,t,o)}}});function hs(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>ys(e,i,t.out,r)):ys(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>ys(e,i,t.in,r)):ys(e,n,t.in,r)}}a(hs,"handleCodecAResult");function ys(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}a(ys,"handleCodecTxResult");var Vd=y("$ZodReadonly",(e,t)=>{M.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType?._zod?.optin),V(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Lb):Lb(n)}});function Lb(e){return e.value=Object.freeze(e.value),e}a(Lb,"handleReadonlyResult");var Bd=y("$ZodTemplateLiteral",(e,t)=>{M.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||Mu.has(typeof o))r.push(Ke(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Kd=y("$ZodFunction",(e,t)=>(M.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?es(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?es(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await ts(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await ts(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new ks({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Jd=y("$ZodPromise",(e,t)=>{M.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Wd=y("$ZodLazy",(e,t)=>{M.init(e,t),V(e._zod,"innerType",()=>t.getter()),V(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),V(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),V(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),V(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Hd=y("$ZodCustom",(e,t)=>{te.init(e,t),M.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>zb(i,r,o,e));zb(n,r,o,e)}});function zb(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Fn(n))}}a(zb,"handleRefineResult");var So={};Pt(So,{ar:()=>Yd,az:()=>Qd,be:()=>Xd,bg:()=>ep,ca:()=>tp,cs:()=>np,da:()=>rp,de:()=>op,en:()=>ko,eo:()=>ip,es:()=>sp,fa:()=>ap,fi:()=>cp,fr:()=>up,frCA:()=>lp,he:()=>dp,hu:()=>pp,hy:()=>fp,id:()=>mp,is:()=>gp,it:()=>hp,ja:()=>yp,ka:()=>vp,kh:()=>bp,km:()=>xo,ko:()=>wp,lt:()=>kp,mk:()=>xp,ms:()=>_p,nl:()=>$p,no:()=>Sp,ota:()=>Ip,pl:()=>Ep,ps:()=>Pp,pt:()=>Tp,ru:()=>Ap,sl:()=>Cp,sv:()=>Rp,ta:()=>Op,th:()=>Np,tr:()=>Dp,ua:()=>jp,uk:()=>$o,ur:()=>Up,uz:()=>Lp,vi:()=>zp,yo:()=>qp,zhCN:()=>Mp,zhTW:()=>Fp});var MP=a(()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}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 ${S(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: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${x(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"}}},"error");function Yd(){return{localeError:MP()}}a(Yd,"default");var FP=a(()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${c}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${S(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${x(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"}}},"error");function Qd(){return{localeError:FP()}}a(Qd,"default");function Vb(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}a(Vb,"getBelarusianPlural");var qP=a(()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}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 ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=Vb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=Vb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${x(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"}}},"error");function Xd(){return{localeError:qP()}}a(Xd,"default");var ZP=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}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 ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${x(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"}}},"error");function ep(){return{localeError:ZP()}}a(ep,"default");var GP=a(()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${c}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${S(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${x(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${x(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"}}},"error");function tp(){return{localeError:GP()}}a(tp,"default");var VP=a(()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${c}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${S(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${x(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"}}},"error");function np(){return{localeError:VP()}}a(np,"default");var BP=a(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${c}`:`Ugyldigt input: forventede ${i}, fik ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${S(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),c=o[n.origin]??n.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),c=o[n.origin]??n.origin;return s?`For lille: forventede ${c} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${x(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"}}},"error");function rp(){return{localeError:BP()}}a(rp,"default");var KP=a(()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${c}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${S(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${x(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"}}},"error");function op(){return{localeError:KP()}}a(op,"default");var JP=a(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${S(n.values[0])}`:`Invalid option: expected one of ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function ko(){return{localeError:JP()}}a(ko,"default");var WP=a(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${c}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${S(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${x(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"}}},"error");function ip(){return{localeError:WP()}}a(ip,"default");var HP=a(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${S(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),c=o[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),c=o[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function sp(){return{localeError:HP()}}a(sp,"default");var YP=a(()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \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 ${S(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 ${x(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${x(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"}}},"error");function ap(){return{localeError:YP()}}a(ap,"default");var QP=a(()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${c}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${S(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${x(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"}}},"error");function cp(){return{localeError:QP()}}a(cp,"default");var XP=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${c} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${S(n.values[0])} attendu`:`Option invalide : une valeur parmi ${x(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(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"}}},"error");function up(){return{localeError:XP()}}a(up,"default");var eE=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${c}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${S(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(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"}}},"error");function lp(){return{localeError:eE()}}a(lp,"default");var tE=a(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=a(l=>l?e[l]:void 0,"typeEntry"),o=a(l=>{let d=r(l);return d?d.label:l??e.unknown.label},"typeLabel"),n=a(l=>`\u05D4${o(l)}`,"withDefinite"),i=a(l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),s=a(l=>l?t[l]??null:null,"getSizing"),c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let d=l.expected,f=u[d??""]??o(d),p=P(l.input),m=u[p]??e[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${S(l.values[0])}`;let d=l.values.map(m=>S(m));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let f=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${f}`}case"too_big":{let d=s(l.origin),f=n(l.origin??"value");if(l.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${d?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",v=l.inclusive?`${l.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let p=l.inclusive?"<=":"<",m=i(l.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.maximum.toString()}`}case"too_small":{let d=s(l.origin),f=n(l.origin??"value");if(l.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${d?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let h=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`}let v=l.inclusive?`${l.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let p=l.inclusive?">=":">",m=i(l.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.minimum.toString()}`}case"invalid_format":{let d=l;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let f=c[d.format],p=f?.label??d.format,g=(f?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${x(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function dp(){return{localeError:tE()}}a(dp,"default");var nE=a(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${S(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${x(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"}}},"error");function pp(){return{localeError:nE()}}a(pp,"default");function Bb(e,t,r){return Math.abs(e)===1?t:r}a(Bb,"getArmenianPlural");function Kn(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}a(Kn,"withDefiniteArticle");var rE=a(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}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 ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=Bb(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Kn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Kn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=Bb(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Kn(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Kn(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${x(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Kn(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 ${Kn(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function fp(){return{localeError:rE()}}a(fp,"default");var oE=a(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${i}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${S(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${x(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"}}},"error");function mp(){return{localeError:oE()}}a(mp,"default");var iE=a(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${S(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${x(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"}}},"error");function gp(){return{localeError:iE()}}a(gp,"default");var sE=a(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${c}`:`Input non valido: atteso ${i}, ricevuto ${c}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${S(n.values[0])}`:`Opzione non valida: atteso uno tra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${x(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"}}},"error");function hp(){return{localeError:sE()}}a(hp,"default");var aE=a(()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${S(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${x(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${x(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"}}},"error");function yp(){return{localeError:aE()}}a(yp,"default");var cE=a(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}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 ${S(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 ${x(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${x(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"}}},"error");function vp(){return{localeError:cE()}}a(vp,"default");var uE=a(()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}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 ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${x(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"}}},"error");function xo(){return{localeError:uE()}}a(xo,"default");function bp(){return xo()}a(bp,"default");var lE=a(()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${S(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${x(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${x(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"}}},"error");function wp(){return{localeError:lE()}}a(wp,"default");var _o=a(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function Kb(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}a(Kb,"getUnitTypeFromNumber");var dE=a(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,s,c){let u=e[n]??null;return u===null?u:{unit:u.unit[i],verb:u.verb[c][s?"inclusive":"notInclusive"]}}a(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${S(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${x(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=t(n.origin,Kb(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${_o(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${_o(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=t(n.origin,Kb(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${_o(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let c=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${_o(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${x(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${_o(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function kp(){return{localeError:dE()}}a(kp,"default");var pE=a(()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${x(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"}}},"error");function xp(){return{localeError:pE()}}a(xp,"default");var fE=a(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${c}`:`Input tidak sah: dijangka ${i}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${S(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${x(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"}}},"error");function _p(){return{localeError:fE()}}a(_p,"default");var mE=a(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${i}, ontving ${c}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${S(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),c=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),c=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${x(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"}}},"error");function $p(){return{localeError:mE()}}a($p,"default");var gE=a(()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${c}`:`Ugyldig input: forventet ${i}, fikk ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${S(n.values[0])}`:`Ugyldig valg: forventet en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${x(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"}}},"error");function Sp(){return{localeError:gE()}}a(Sp,"default");var hE=a(()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${S(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${x(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."}}},"error");function Ip(){return{localeError:hE()}}a(Ip,"default");var yE=a(()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \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 ${S(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${x(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${x(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"}}},"error");function Pp(){return{localeError:yE()}}a(Pp,"default");var vE=a(()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${c}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${S(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${x(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"}}},"error");function Ep(){return{localeError:vE()}}a(Ep,"default");var bE=a(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${S(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}},"error");function Tp(){return{localeError:bE()}}a(Tp,"default");function Jb(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}a(Jb,"getRussianPlural");var wE=a(()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}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 ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=Jb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=Jb(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${x(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"}}},"error");function Ap(){return{localeError:wE()}}a(Ap,"default");var kE=a(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${c}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${S(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${x(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"}}},"error");function Cp(){return{localeError:kE()}}a(Cp,"default");var xE=a(()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${c}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${S(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${x(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"}}},"error");function Rp(){return{localeError:xE()}}a(Rp,"default");var _E=a(()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}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 ${S(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 ${x(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${x(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"}}},"error");function Op(){return{localeError:_E()}}a(Op,"default");var $E=a(()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}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 ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${x(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"}}},"error");function Np(){return{localeError:$E()}}a(Np,"default");var SE=a(()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${S(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${x(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"}}},"error");function Dp(){return{localeError:SE()}}a(Dp,"default");var IE=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}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 ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${x(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"}}},"error");function $o(){return{localeError:IE()}}a($o,"default");function jp(){return $o()}a(jp,"default");var PE=a(()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${S(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${x(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${x(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"}}},"error");function Up(){return{localeError:PE()}}a(Up,"default");var EE=a(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${c}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${S(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${x(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"}}},"error");function Lp(){return{localeError:EE()}}a(Lp,"default");var TE=a(()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${S(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 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${x(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"}}},"error");function zp(){return{localeError:TE()}}a(zp,"default");var AE=a(()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${S(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${x(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"}}},"error");function Mp(){return{localeError:AE()}}a(Mp,"default");var CE=a(()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${S(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${x(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"}}},"error");function Fp(){return{localeError:CE()}}a(Fp,"default");var RE=a(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}a(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),c=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${S(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${x(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"}}},"error");function qp(){return{localeError:RE()}}a(qp,"default");var Wb,Zp=Symbol("ZodOutput"),Gp=Symbol("ZodInput"),_s=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function $s(){return new _s}a($s,"registry");(Wb=globalThis).__zod_globalRegistry??(Wb.__zod_globalRegistry=$s());var _e=globalThis.__zod_globalRegistry;function Vp(e,t){return new e({type:"string",...A(t)})}a(Vp,"_string");function Bp(e,t){return new e({type:"string",coerce:!0,...A(t)})}a(Bp,"_coercedString");function Ss(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}a(Ss,"_email");function Io(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}a(Io,"_guid");function Is(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}a(Is,"_uuid");function Ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}a(Ps,"_uuidv4");function Es(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}a(Es,"_uuidv6");function Ts(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}a(Ts,"_uuidv7");function Po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}a(Po,"_url");function As(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}a(As,"_emoji");function Cs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}a(Cs,"_nanoid");function Rs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}a(Rs,"_cuid");function Os(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}a(Os,"_cuid2");function Ns(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}a(Ns,"_ulid");function Ds(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}a(Ds,"_xid");function js(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}a(js,"_ksuid");function Us(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}a(Us,"_ipv4");function Ls(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}a(Ls,"_ipv6");function Kp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...A(t)})}a(Kp,"_mac");function zs(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}a(zs,"_cidrv4");function Ms(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}a(Ms,"_cidrv6");function Fs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}a(Fs,"_base64");function qs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}a(qs,"_base64url");function Zs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}a(Zs,"_e164");function Gs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}a(Gs,"_jwt");var Jp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Wp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}a(Wp,"_isoDateTime");function Hp(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}a(Hp,"_isoDate");function Yp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}a(Yp,"_isoTime");function Qp(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}a(Qp,"_isoDuration");function Xp(e,t){return new e({type:"number",checks:[],...A(t)})}a(Xp,"_number");function ef(e,t){return new e({type:"number",coerce:!0,checks:[],...A(t)})}a(ef,"_coercedNumber");function tf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}a(tf,"_int");function nf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...A(t)})}a(nf,"_float32");function rf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...A(t)})}a(rf,"_float64");function of(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...A(t)})}a(of,"_int32");function sf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...A(t)})}a(sf,"_uint32");function af(e,t){return new e({type:"boolean",...A(t)})}a(af,"_boolean");function cf(e,t){return new e({type:"boolean",coerce:!0,...A(t)})}a(cf,"_coercedBoolean");function uf(e,t){return new e({type:"bigint",...A(t)})}a(uf,"_bigint");function lf(e,t){return new e({type:"bigint",coerce:!0,...A(t)})}a(lf,"_coercedBigint");function df(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...A(t)})}a(df,"_int64");function pf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...A(t)})}a(pf,"_uint64");function ff(e,t){return new e({type:"symbol",...A(t)})}a(ff,"_symbol");function mf(e,t){return new e({type:"undefined",...A(t)})}a(mf,"_undefined");function gf(e,t){return new e({type:"null",...A(t)})}a(gf,"_null");function hf(e){return new e({type:"any"})}a(hf,"_any");function yf(e){return new e({type:"unknown"})}a(yf,"_unknown");function vf(e,t){return new e({type:"never",...A(t)})}a(vf,"_never");function bf(e,t){return new e({type:"void",...A(t)})}a(bf,"_void");function wf(e,t){return new e({type:"date",...A(t)})}a(wf,"_date");function kf(e,t){return new e({type:"date",coerce:!0,...A(t)})}a(kf,"_coercedDate");function xf(e,t){return new e({type:"nan",...A(t)})}a(xf,"_nan");function wt(e,t){return new ps({check:"less_than",...A(t),value:e,inclusive:!1})}a(wt,"_lt");function Fe(e,t){return new ps({check:"less_than",...A(t),value:e,inclusive:!0})}a(Fe,"_lte");function kt(e,t){return new fs({check:"greater_than",...A(t),value:e,inclusive:!1})}a(kt,"_gt");function Ce(e,t){return new fs({check:"greater_than",...A(t),value:e,inclusive:!0})}a(Ce,"_gte");function Vs(e){return kt(0,e)}a(Vs,"_positive");function Bs(e){return wt(0,e)}a(Bs,"_negative");function Ks(e){return Fe(0,e)}a(Ks,"_nonpositive");function Js(e){return Ce(0,e)}a(Js,"_nonnegative");function Kt(e,t){return new xl({check:"multiple_of",...A(t),value:e})}a(Kt,"_multipleOf");function Jt(e,t){return new Sl({check:"max_size",...A(t),maximum:e})}a(Jt,"_maxSize");function xt(e,t){return new Il({check:"min_size",...A(t),minimum:e})}a(xt,"_minSize");function kn(e,t){return new Pl({check:"size_equals",...A(t),size:e})}a(kn,"_size");function xn(e,t){return new El({check:"max_length",...A(t),maximum:e})}a(xn,"_maxLength");function Rt(e,t){return new Tl({check:"min_length",...A(t),minimum:e})}a(Rt,"_minLength");function _n(e,t){return new Al({check:"length_equals",...A(t),length:e})}a(_n,"_length");function Jn(e,t){return new Cl({check:"string_format",format:"regex",...A(t),pattern:e})}a(Jn,"_regex");function Wn(e){return new Rl({check:"string_format",format:"lowercase",...A(e)})}a(Wn,"_lowercase");function Hn(e){return new Ol({check:"string_format",format:"uppercase",...A(e)})}a(Hn,"_uppercase");function Yn(e,t){return new Nl({check:"string_format",format:"includes",...A(t),includes:e})}a(Yn,"_includes");function Qn(e,t){return new Dl({check:"string_format",format:"starts_with",...A(t),prefix:e})}a(Qn,"_startsWith");function Xn(e,t){return new jl({check:"string_format",format:"ends_with",...A(t),suffix:e})}a(Xn,"_endsWith");function Ws(e,t,r){return new Ul({check:"property",property:e,schema:t,...A(r)})}a(Ws,"_property");function er(e,t){return new Ll({check:"mime_type",mime:e,...A(t)})}a(er,"_mime");function it(e){return new zl({check:"overwrite",tx:e})}a(it,"_overwrite");function tr(e){return it(t=>t.normalize(e))}a(tr,"_normalize");function nr(){return it(e=>e.trim())}a(nr,"_trim");function rr(){return it(e=>e.toLowerCase())}a(rr,"_toLowerCase");function or(){return it(e=>e.toUpperCase())}a(or,"_toUpperCase");function ir(){return it(e=>Uu(e))}a(ir,"_slugify");function _f(e,t,r){return new e({type:"array",element:t,...A(r)})}a(_f,"_array");function NE(e,t,r){return new e({type:"union",options:t,...A(r)})}a(NE,"_union");function DE(e,t,r){return new e({type:"union",options:t,inclusive:!1,...A(r)})}a(DE,"_xor");function jE(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...A(o)})}a(jE,"_discriminatedUnion");function UE(e,t,r){return new e({type:"intersection",left:t,right:r})}a(UE,"_intersection");function LE(e,t,r,o){let n=r instanceof M,i=n?o:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...A(i)})}a(LE,"_tuple");function zE(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...A(o)})}a(zE,"_record");function ME(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...A(o)})}a(ME,"_map");function FE(e,t,r){return new e({type:"set",valueType:t,...A(r)})}a(FE,"_set");function qE(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...A(r)})}a(qE,"_enum");function ZE(e,t,r){return new e({type:"enum",entries:t,...A(r)})}a(ZE,"_nativeEnum");function GE(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...A(r)})}a(GE,"_literal");function $f(e,t){return new e({type:"file",...A(t)})}a($f,"_file");function VE(e,t){return new e({type:"transform",transform:t})}a(VE,"_transform");function BE(e,t){return new e({type:"optional",innerType:t})}a(BE,"_optional");function KE(e,t){return new e({type:"nullable",innerType:t})}a(KE,"_nullable");function JE(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():zu(r)}})}a(JE,"_default");function WE(e,t,r){return new e({type:"nonoptional",innerType:t,...A(r)})}a(WE,"_nonoptional");function HE(e,t){return new e({type:"success",innerType:t})}a(HE,"_success");function YE(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}a(YE,"_catch");function QE(e,t,r){return new e({type:"pipe",in:t,out:r})}a(QE,"_pipe");function XE(e,t){return new e({type:"readonly",innerType:t})}a(XE,"_readonly");function eT(e,t,r){return new e({type:"template_literal",parts:t,...A(r)})}a(eT,"_templateLiteral");function tT(e,t){return new e({type:"lazy",getter:t})}a(tT,"_lazy");function nT(e,t){return new e({type:"promise",innerType:t})}a(nT,"_promise");function Sf(e,t,r){let o=A(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}a(Sf,"_custom");function If(e,t,r){return new e({type:"custom",check:"custom",fn:t,...A(r)})}a(If,"_refine");function Pf(e){let t=Hb(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Fn(o,r.value,t._zod.def));else{let n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(Fn(n))}},e(r.value,r)));return t}a(Pf,"_superRefine");function Hb(e,t){let r=new te({check:"custom",...A(t)});return r._zod.check=e,r}a(Hb,"_check");function Ef(e){let t=new te({check:"describe"});return t._zod.onattach=[r=>{let o=_e.get(r)??{};_e.add(r,{...o,description:e})}],t._zod.check=()=>{},t}a(Ef,"describe");function Tf(e){let t=new te({check:"meta"});return t._zod.onattach=[r=>{let o=_e.get(r)??{};_e.add(r,{...o,...e})}],t._zod.check=()=>{},t}a(Tf,"meta");function Af(e,t){let r=A(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(m=>typeof m=="string"?m.toLowerCase():m),n=n.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(o),s=new Set(n),c=e.Codec??wo,u=e.Boolean??vo,l=e.String??wn,d=new l({type:"string",error:r.error}),f=new u({type:"boolean",error:r.error}),p=new c({type:"pipe",in:d,out:f,transform:a(((m,g)=>{let v=m;return r.case!=="sensitive"&&(v=v.toLowerCase()),i.has(v)?!0:s.has(v)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:g.value,inst:p,continue:!1}),{})}),"transform"),reverseTransform:a(((m,g)=>m===!0?o[0]||"true":n[0]||"false"),"reverseTransform"),error:r.error});return p}a(Af,"_stringbool");function sr(e,t,r,o={}){let n=A(o),i={...A(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}a(sr,"_stringFormat");function Wt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??_e,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}a(Wt,"initializeContext");function H(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let p=s.schema,m=t.processors[n.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,p,d)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),H(f,t,d),t.seen.get(f).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&Re(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}a(H,"process");function Ht(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=o.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,s[0])}}let n=a(s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,p=e.external.uri??(g=>g);if(f)return{ref:p(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${p("__shared")}#/${c}/${m}`}}if(s[1]===r)return{ref:"#"};let l=`#/${c}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+d}},"makeURI"),i=a(s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:l}=n(s);c.def={...c.schema},l&&(c.defId=l);let d=c.schema;for(let f in d)delete d[f];d.$ref=u},"extractToDef");if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
296
297
|
|
|
297
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1&&e.reused==="ref"){i(s);continue}}}a(Wt,"extractDefs");function Ht(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a(s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){o(d);let p=e.seen.get(d),f=p.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(f)):Object.assign(l,f),Object.assign(l,u),s._zod.parent===d)for(let v in l)v==="$ref"||v==="allOf"||v in u||delete l[v];if(f.$ref&&p.def)for(let v in l)v==="$ref"||v==="allOf"||v in p.def&&JSON.stringify(l[v])===JSON.stringify(p.def[v])&&delete l[v]}let m=s._zod.parent;if(m&&m!==d){o(m);let p=e.seen.get(m);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let f in l)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(l[f])===JSON.stringify(p.def[f])&&delete l[f]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})},"flattenRef");for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:sr(t,"input",e.processors),output:sr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}a(Ht,"finalize");function Ae(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ae(o.element,r);if(o.type==="set")return Ae(o.valueType,r);if(o.type==="lazy")return Ae(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Ae(o.innerType,r);if(o.type==="intersection")return Ae(o.left,r)||Ae(o.right,r);if(o.type==="record"||o.type==="map")return Ae(o.keyType,r)||Ae(o.valueType,r);if(o.type==="pipe")return Ae(o.in,r)||Ae(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ae(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ae(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ae(n,r))return!0;return!!(o.rest&&Ae(o.rest,r))}return!1}a(Ae,"isTransforming");var hm=a((e,t={})=>r=>{let o=Kt({...r,processors:t});return W(e,o),Wt(o,e),Ht(o,e)},"createToJSONSchemaMethod"),sr=a((e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=Kt({...n??{},target:i,io:t,processors:r});return W(e,s),Wt(s,e),Ht(s,e)},"createStandardJSONSchemaMethod");var KP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ym=a((e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),c&&(n.format=KP[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),vm=a((e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d),typeof i=="number"&&(n.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),typeof s=="number"&&(n.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof l=="number"&&(n.multipleOf=l)},"numberProcessor"),bm=a((e,t,r,o)=>{r.type="boolean"},"booleanProcessor"),wm=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),xm=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),km=a((e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),_m=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),$m=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),Sm=a((e,t,r,o)=>{r.not={}},"neverProcessor"),Im=a((e,t,r,o)=>{},"anyProcessor"),Pm=a((e,t,r,o)=>{},"unknownProcessor"),Em=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Tm=a((e,t,r,o)=>{let n=e._zod.def,i=eo(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},"enumProcessor"),Am=a((e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},"literalProcessor"),Cm=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Rm=a((e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},"templateLiteralProcessor"),Om=a((e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:l}=e._zod.bag;s!==void 0&&(i.minLength=s),c!==void 0&&(i.maxLength=c),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,i)},"fileProcessor"),Nm=a((e,t,r,o)=>{r.type="boolean"},"successProcessor"),Dm=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),jm=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),Lm=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),Um=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),zm=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),Mm=a((e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=W(i.element,t,{...o,path:[...o.path,"items"]})},"arrayProcessor"),qm=a((e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=W(s[u],t,{...o,path:[...o.path,"properties",u]});let c=new Set(Object.keys(s)),l=new Set([...c].filter(u=>{let d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=W(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},"objectProcessor"),Gs=a((e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((c,l)=>W(c,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=s:r.anyOf=s},"unionProcessor"),Fm=a((e,t,r,o)=>{let n=e._zod.def,i=W(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=W(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=a(u=>"allOf"in u&&Object.keys(u).length===1,"isSimpleIntersection"),l=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=l},"intersectionProcessor"),Zm=a((e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((p,f)=>W(p,t,{...o,path:[...o.path,s,f]})),u=i.rest?W(i.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:d,maximum:m}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof m=="number"&&(n.maxItems=m)},"tupleProcessor"),Gm=a((e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let d=W(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let m of l)n.patternProperties[m.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=W(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=W(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=s._zod.values;if(u){let d=[...u].filter(m=>typeof m=="string"||typeof m=="number");d.length>0&&(n.required=d)}},"recordProcessor"),Vm=a((e,t,r,o)=>{let n=e._zod.def,i=W(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},"nullableProcessor"),Bm=a((e,t,r,o)=>{let n=e._zod.def;W(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},"nonoptionalProcessor"),Jm=a((e,t,r,o)=>{let n=e._zod.def;W(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},"defaultProcessor"),Km=a((e,t,r,o)=>{let n=e._zod.def;W(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},"prefaultProcessor"),Wm=a((e,t,r,o)=>{let n=e._zod.def;W(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},"catchProcessor"),Hm=a((e,t,r,o)=>{let n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;W(i,t,o);let s=t.seen.get(e);s.ref=i},"pipeProcessor"),Ym=a((e,t,r,o)=>{let n=e._zod.def;W(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},"readonlyProcessor"),Qm=a((e,t,r,o)=>{let n=e._zod.def;W(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},"promiseProcessor"),Vs=a((e,t,r,o)=>{let n=e._zod.def;W(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},"optionalProcessor"),Xm=a((e,t,r,o)=>{let n=e._zod.innerType;W(n,t,o);let i=t.seen.get(e);i.ref=n},"lazyProcessor"),Zs={string:ym,number:vm,boolean:bm,bigint:wm,symbol:xm,null:km,undefined:_m,void:$m,never:Sm,any:Im,unknown:Pm,date:Em,enum:Tm,literal:Am,nan:Cm,template_literal:Rm,file:Om,success:Nm,custom:Dm,function:jm,transform:Lm,map:Um,set:zm,array:Mm,object:qm,union:Gs,intersection:Fm,tuple:Zm,record:Gm,nullable:Vm,nonoptional:Bm,default:Jm,prefault:Km,catch:Wm,pipe:Hm,readonly:Ym,promise:Qm,optional:Vs,lazy:Xm};function Bs(e,t){if("_idmap"in e){let o=e,n=Kt({...t,processors:Zs}),i={};for(let l of o._idmap.entries()){let[u,d]=l;W(d,n)}let s={},c={registry:o,uri:t?.uri,defs:i};n.external=c;for(let l of o._idmap.entries()){let[u,d]=l;Wt(n,d),s[u]=Ht(n,d)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:i}}return{schemas:s}}let r=Kt({...t,processors:Zs});return W(e,r),Wt(r,e),Ht(r,e)}a(Bs,"toJSONSchema");var Js=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Kt({processors:Zs,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return W(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Wt(this.ctx,t);let o=Ht(this.ctx,t),{"~standard":n,...i}=o;return i}};var yb={};var ko={};St(ko,{ZodAny:()=>$f,ZodArray:()=>Ef,ZodBase64:()=>fa,ZodBase64URL:()=>ga,ZodBigInt:()=>mr,ZodBigIntFormat:()=>va,ZodBoolean:()=>pr,ZodCIDRv4:()=>pa,ZodCIDRv6:()=>ma,ZodCUID:()=>ia,ZodCUID2:()=>sa,ZodCatch:()=>Hf,ZodCodec:()=>Ia,ZodCustom:()=>Oo,ZodCustomStringFormat:()=>ur,ZodDate:()=>Eo,ZodDefault:()=>Gf,ZodDiscriminatedUnion:()=>Af,ZodE164:()=>ha,ZodEmail:()=>na,ZodEmoji:()=>ra,ZodEnum:()=>cr,ZodExactOptional:()=>qf,ZodFile:()=>zf,ZodFunction:()=>ig,ZodGUID:()=>_o,ZodIPv4:()=>ua,ZodIPv6:()=>da,ZodIntersection:()=>Cf,ZodJWT:()=>ya,ZodKSUID:()=>la,ZodLazy:()=>ng,ZodLiteral:()=>Uf,ZodMAC:()=>yf,ZodMap:()=>jf,ZodNaN:()=>Qf,ZodNanoID:()=>oa,ZodNever:()=>If,ZodNonOptional:()=>$a,ZodNull:()=>kf,ZodNullable:()=>Zf,ZodNumber:()=>dr,ZodNumberFormat:()=>$n,ZodObject:()=>Ao,ZodOptional:()=>_a,ZodPipe:()=>Sa,ZodPrefault:()=>Bf,ZodPromise:()=>og,ZodReadonly:()=>Xf,ZodRecord:()=>Ro,ZodSet:()=>Lf,ZodString:()=>lr,ZodStringFormat:()=>X,ZodSuccess:()=>Wf,ZodSymbol:()=>wf,ZodTemplateLiteral:()=>tg,ZodTransform:()=>Mf,ZodTuple:()=>Of,ZodType:()=>Z,ZodULID:()=>aa,ZodURL:()=>Po,ZodUUID:()=>xt,ZodUndefined:()=>xf,ZodUnion:()=>Co,ZodUnknown:()=>Sf,ZodVoid:()=>Pf,ZodXID:()=>ca,ZodXor:()=>Tf,_ZodString:()=>ta,_default:()=>Vf,_function:()=>$w,any:()=>nw,array:()=>To,base64:()=>zb,base64url:()=>Mb,bigint:()=>Yb,boolean:()=>bf,catch:()=>Yf,check:()=>Sw,cidrv4:()=>Lb,cidrv6:()=>Ub,codec:()=>xw,cuid:()=>Tb,cuid2:()=>Ab,custom:()=>Iw,date:()=>ow,describe:()=>Pw,discriminatedUnion:()=>uw,e164:()=>qb,email:()=>bb,emoji:()=>Pb,enum:()=>xa,exactOptional:()=>Ff,file:()=>yw,float32:()=>Jb,float64:()=>Kb,function:()=>$w,guid:()=>wb,hash:()=>Bb,hex:()=>Vb,hostname:()=>Gb,httpUrl:()=>Ib,instanceof:()=>Tw,int:()=>ea,int32:()=>Wb,int64:()=>Qb,intersection:()=>Rf,ipv4:()=>Nb,ipv6:()=>jb,json:()=>Cw,jwt:()=>Fb,keyof:()=>iw,ksuid:()=>Ob,lazy:()=>rg,literal:()=>hw,looseObject:()=>cw,looseRecord:()=>pw,mac:()=>Db,map:()=>mw,meta:()=>Ew,nan:()=>ww,nanoid:()=>Eb,nativeEnum:()=>gw,never:()=>ba,nonoptional:()=>Kf,null:()=>_f,nullable:()=>So,nullish:()=>vw,number:()=>vf,object:()=>sw,optional:()=>$o,partialRecord:()=>dw,pipe:()=>Io,prefault:()=>Jf,preprocess:()=>Rw,promise:()=>_w,readonly:()=>eg,record:()=>Df,refine:()=>sg,set:()=>fw,strictObject:()=>aw,string:()=>Xs,stringFormat:()=>Zb,stringbool:()=>Aw,success:()=>bw,superRefine:()=>ag,symbol:()=>ew,templateLiteral:()=>kw,transform:()=>ka,tuple:()=>Nf,uint32:()=>Hb,uint64:()=>Xb,ulid:()=>Cb,undefined:()=>tw,union:()=>wa,unknown:()=>_n,url:()=>Sb,uuid:()=>xb,uuidv4:()=>kb,uuidv6:()=>_b,uuidv7:()=>$b,void:()=>rw,xid:()=>Rb,xor:()=>lw});var Ks={};St(Ks,{endsWith:()=>Qn,gt:()=>bt,gte:()=>Te,includes:()=>Hn,length:()=>kn,lowercase:()=>Kn,lt:()=>vt,lte:()=>ze,maxLength:()=>xn,maxSize:()=>Jt,mime:()=>Xn,minLength:()=>Ct,minSize:()=>wt,multipleOf:()=>Bt,negative:()=>zs,nonnegative:()=>qs,nonpositive:()=>Ms,normalize:()=>er,overwrite:()=>rt,positive:()=>Us,property:()=>Fs,regex:()=>Jn,size:()=>wn,slugify:()=>or,startsWith:()=>Yn,toLowerCase:()=>nr,toUpperCase:()=>rr,trim:()=>tr,uppercase:()=>Wn});var ar={};St(ar,{ZodISODate:()=>Hs,ZodISODateTime:()=>Ws,ZodISODuration:()=>Qs,ZodISOTime:()=>Ys,date:()=>tf,datetime:()=>ef,duration:()=>rf,time:()=>nf});var Ws=y("ZodISODateTime",(e,t)=>{zu.init(e,t),X.init(e,t)});function ef(e){return Dp(Ws,e)}a(ef,"datetime");var Hs=y("ZodISODate",(e,t)=>{Mu.init(e,t),X.init(e,t)});function tf(e){return jp(Hs,e)}a(tf,"date");var Ys=y("ZodISOTime",(e,t)=>{qu.init(e,t),X.init(e,t)});function nf(e){return Lp(Ys,e)}a(nf,"time");var Qs=y("ZodISODuration",(e,t)=>{Fu.init(e,t),X.init(e,t)});function rf(e){return Up(Qs,e)}a(rf,"duration");var vb=a((e,t)=>{io.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a(r=>ao(e,r),"value")},flatten:{value:a(r=>so(e,r),"value")},addIssue:{value:a(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Un,2)},"value")},addIssues:{value:a(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Un,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),HP=y("ZodError",vb),De=y("ZodError",vb,{Parent:Error});var of=qn(De),sf=Fn(De),af=Zn(De),cf=Gn(De),lf=Wi(De),uf=Hi(De),df=Yi(De),pf=Qi(De),mf=Xi(De),ff=es(De),gf=ts(De),hf=ns(De);var Z=y("ZodType",(e,t)=>(z.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:sr(e,"input"),output:sr(e,"output")}}),e.toJSONSchema=hm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(I.mergeDefs(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>Ee(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>of(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>af(e,r,o),e.parseAsync=async(r,o)=>sf(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>cf(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>lf(e,r,o),e.decode=(r,o)=>uf(e,r,o),e.encodeAsync=async(r,o)=>df(e,r,o),e.decodeAsync=async(r,o)=>pf(e,r,o),e.safeEncode=(r,o)=>mf(e,r,o),e.safeDecode=(r,o)=>ff(e,r,o),e.safeEncodeAsync=async(r,o)=>gf(e,r,o),e.safeDecodeAsync=async(r,o)=>hf(e,r,o),e.refine=(r,o)=>e.check(sg(r,o)),e.superRefine=r=>e.check(ag(r)),e.overwrite=r=>e.check(rt(r)),e.optional=()=>$o(e),e.exactOptional=()=>Ff(e),e.nullable=()=>So(e),e.nullish=()=>$o(So(e)),e.nonoptional=r=>Kf(e,r),e.array=()=>To(e),e.or=r=>wa([e,r]),e.and=r=>Rf(e,r),e.transform=r=>Io(e,ka(r)),e.default=r=>Vf(e,r),e.prefault=r=>Jf(e,r),e.catch=r=>Yf(e,r),e.pipe=r=>Io(e,r),e.readonly=()=>eg(e),e.describe=r=>{let o=e.clone();return ke.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return ke.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ke.get(e);let o=e.clone();return ke.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),ta=y("_ZodString",(e,t)=>{bn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>ym(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Jn(...o)),e.includes=(...o)=>e.check(Hn(...o)),e.startsWith=(...o)=>e.check(Yn(...o)),e.endsWith=(...o)=>e.check(Qn(...o)),e.min=(...o)=>e.check(Ct(...o)),e.max=(...o)=>e.check(xn(...o)),e.length=(...o)=>e.check(kn(...o)),e.nonempty=(...o)=>e.check(Ct(1,...o)),e.lowercase=o=>e.check(Kn(o)),e.uppercase=o=>e.check(Wn(o)),e.trim=()=>e.check(tr()),e.normalize=(...o)=>e.check(er(...o)),e.toLowerCase=()=>e.check(nr()),e.toUpperCase=()=>e.check(rr()),e.slugify=()=>e.check(or())}),lr=y("ZodString",(e,t)=>{bn.init(e,t),ta.init(e,t),e.email=r=>e.check(vs(na,r)),e.url=r=>e.check(xo(Po,r)),e.jwt=r=>e.check(Ls(ya,r)),e.emoji=r=>e.check(_s(ra,r)),e.guid=r=>e.check(wo(_o,r)),e.uuid=r=>e.check(bs(xt,r)),e.uuidv4=r=>e.check(ws(xt,r)),e.uuidv6=r=>e.check(xs(xt,r)),e.uuidv7=r=>e.check(ks(xt,r)),e.nanoid=r=>e.check($s(oa,r)),e.guid=r=>e.check(wo(_o,r)),e.cuid=r=>e.check(Ss(ia,r)),e.cuid2=r=>e.check(Is(sa,r)),e.ulid=r=>e.check(Ps(aa,r)),e.base64=r=>e.check(Ns(fa,r)),e.base64url=r=>e.check(Ds(ga,r)),e.xid=r=>e.check(Es(ca,r)),e.ksuid=r=>e.check(Ts(la,r)),e.ipv4=r=>e.check(As(ua,r)),e.ipv6=r=>e.check(Cs(da,r)),e.cidrv4=r=>e.check(Rs(pa,r)),e.cidrv6=r=>e.check(Os(ma,r)),e.e164=r=>e.check(js(ha,r)),e.datetime=r=>e.check(ef(r)),e.date=r=>e.check(tf(r)),e.time=r=>e.check(nf(r)),e.duration=r=>e.check(rf(r))});function Xs(e){return Cp(lr,e)}a(Xs,"string");var X=y("ZodStringFormat",(e,t)=>{Q.init(e,t),ta.init(e,t)}),na=y("ZodEmail",(e,t)=>{Au.init(e,t),X.init(e,t)});function bb(e){return vs(na,e)}a(bb,"email");var _o=y("ZodGUID",(e,t)=>{Eu.init(e,t),X.init(e,t)});function wb(e){return wo(_o,e)}a(wb,"guid");var xt=y("ZodUUID",(e,t)=>{Tu.init(e,t),X.init(e,t)});function xb(e){return bs(xt,e)}a(xb,"uuid");function kb(e){return ws(xt,e)}a(kb,"uuidv4");function _b(e){return xs(xt,e)}a(_b,"uuidv6");function $b(e){return ks(xt,e)}a($b,"uuidv7");var Po=y("ZodURL",(e,t)=>{Cu.init(e,t),X.init(e,t)});function Sb(e){return xo(Po,e)}a(Sb,"url");function Ib(e){return xo(Po,{protocol:/^https?$/,hostname:Be.domain,...I.normalizeParams(e)})}a(Ib,"httpUrl");var ra=y("ZodEmoji",(e,t)=>{Ru.init(e,t),X.init(e,t)});function Pb(e){return _s(ra,e)}a(Pb,"emoji");var oa=y("ZodNanoID",(e,t)=>{Ou.init(e,t),X.init(e,t)});function Eb(e){return $s(oa,e)}a(Eb,"nanoid");var ia=y("ZodCUID",(e,t)=>{Nu.init(e,t),X.init(e,t)});function Tb(e){return Ss(ia,e)}a(Tb,"cuid");var sa=y("ZodCUID2",(e,t)=>{Du.init(e,t),X.init(e,t)});function Ab(e){return Is(sa,e)}a(Ab,"cuid2");var aa=y("ZodULID",(e,t)=>{ju.init(e,t),X.init(e,t)});function Cb(e){return Ps(aa,e)}a(Cb,"ulid");var ca=y("ZodXID",(e,t)=>{Lu.init(e,t),X.init(e,t)});function Rb(e){return Es(ca,e)}a(Rb,"xid");var la=y("ZodKSUID",(e,t)=>{Uu.init(e,t),X.init(e,t)});function Ob(e){return Ts(la,e)}a(Ob,"ksuid");var ua=y("ZodIPv4",(e,t)=>{Zu.init(e,t),X.init(e,t)});function Nb(e){return As(ua,e)}a(Nb,"ipv4");var yf=y("ZodMAC",(e,t)=>{Vu.init(e,t),X.init(e,t)});function Db(e){return Op(yf,e)}a(Db,"mac");var da=y("ZodIPv6",(e,t)=>{Gu.init(e,t),X.init(e,t)});function jb(e){return Cs(da,e)}a(jb,"ipv6");var pa=y("ZodCIDRv4",(e,t)=>{Bu.init(e,t),X.init(e,t)});function Lb(e){return Rs(pa,e)}a(Lb,"cidrv4");var ma=y("ZodCIDRv6",(e,t)=>{Ju.init(e,t),X.init(e,t)});function Ub(e){return Os(ma,e)}a(Ub,"cidrv6");var fa=y("ZodBase64",(e,t)=>{Wu.init(e,t),X.init(e,t)});function zb(e){return Ns(fa,e)}a(zb,"base64");var ga=y("ZodBase64URL",(e,t)=>{Hu.init(e,t),X.init(e,t)});function Mb(e){return Ds(ga,e)}a(Mb,"base64url");var ha=y("ZodE164",(e,t)=>{Yu.init(e,t),X.init(e,t)});function qb(e){return js(ha,e)}a(qb,"e164");var ya=y("ZodJWT",(e,t)=>{Qu.init(e,t),X.init(e,t)});function Fb(e){return Ls(ya,e)}a(Fb,"jwt");var ur=y("ZodCustomStringFormat",(e,t)=>{Xu.init(e,t),X.init(e,t)});function Zb(e,t,r={}){return ir(ur,e,t,r)}a(Zb,"stringFormat");function Gb(e){return ir(ur,"hostname",Be.hostname,e)}a(Gb,"hostname");function Vb(e){return ir(ur,"hex",Be.hex,e)}a(Vb,"hex");function Bb(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=Be[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return ir(ur,o,n,t)}a(Bb,"hash");var dr=y("ZodNumber",(e,t)=>{ps.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>vm(e,o,n,i),e.gt=(o,n)=>e.check(bt(o,n)),e.gte=(o,n)=>e.check(Te(o,n)),e.min=(o,n)=>e.check(Te(o,n)),e.lt=(o,n)=>e.check(vt(o,n)),e.lte=(o,n)=>e.check(ze(o,n)),e.max=(o,n)=>e.check(ze(o,n)),e.int=o=>e.check(ea(o)),e.safe=o=>e.check(ea(o)),e.positive=o=>e.check(bt(0,o)),e.nonnegative=o=>e.check(Te(0,o)),e.negative=o=>e.check(vt(0,o)),e.nonpositive=o=>e.check(ze(0,o)),e.multipleOf=(o,n)=>e.check(Bt(o,n)),e.step=(o,n)=>e.check(Bt(o,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function vf(e){return zp(dr,e)}a(vf,"number");var $n=y("ZodNumberFormat",(e,t)=>{ed.init(e,t),dr.init(e,t)});function ea(e){return qp($n,e)}a(ea,"int");function Jb(e){return Fp($n,e)}a(Jb,"float32");function Kb(e){return Zp($n,e)}a(Kb,"float64");function Wb(e){return Gp($n,e)}a(Wb,"int32");function Hb(e){return Vp($n,e)}a(Hb,"uint32");var pr=y("ZodBoolean",(e,t)=>{po.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bm(e,r,o,n)});function bf(e){return Bp(pr,e)}a(bf,"boolean");var mr=y("ZodBigInt",(e,t)=>{ms.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>wm(e,o,n,i),e.gte=(o,n)=>e.check(Te(o,n)),e.min=(o,n)=>e.check(Te(o,n)),e.gt=(o,n)=>e.check(bt(o,n)),e.gte=(o,n)=>e.check(Te(o,n)),e.min=(o,n)=>e.check(Te(o,n)),e.lt=(o,n)=>e.check(vt(o,n)),e.lte=(o,n)=>e.check(ze(o,n)),e.max=(o,n)=>e.check(ze(o,n)),e.positive=o=>e.check(bt(BigInt(0),o)),e.negative=o=>e.check(vt(BigInt(0),o)),e.nonpositive=o=>e.check(ze(BigInt(0),o)),e.nonnegative=o=>e.check(Te(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Bt(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Yb(e){return Kp(mr,e)}a(Yb,"bigint");var va=y("ZodBigIntFormat",(e,t)=>{td.init(e,t),mr.init(e,t)});function Qb(e){return Hp(va,e)}a(Qb,"int64");function Xb(e){return Yp(va,e)}a(Xb,"uint64");var wf=y("ZodSymbol",(e,t)=>{nd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xm(e,r,o,n)});function ew(e){return Qp(wf,e)}a(ew,"symbol");var xf=y("ZodUndefined",(e,t)=>{rd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_m(e,r,o,n)});function tw(e){return Xp(xf,e)}a(tw,"_undefined");var kf=y("ZodNull",(e,t)=>{od.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>km(e,r,o,n)});function _f(e){return em(kf,e)}a(_f,"_null");var $f=y("ZodAny",(e,t)=>{id.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Im(e,r,o,n)});function nw(){return tm($f)}a(nw,"any");var Sf=y("ZodUnknown",(e,t)=>{sd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pm(e,r,o,n)});function _n(){return nm(Sf)}a(_n,"unknown");var If=y("ZodNever",(e,t)=>{ad.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sm(e,r,o,n)});function ba(e){return rm(If,e)}a(ba,"never");var Pf=y("ZodVoid",(e,t)=>{cd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$m(e,r,o,n)});function rw(e){return om(Pf,e)}a(rw,"_void");var Eo=y("ZodDate",(e,t)=>{ld.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Em(e,o,n,i),e.min=(o,n)=>e.check(Te(o,n)),e.max=(o,n)=>e.check(ze(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function ow(e){return im(Eo,e)}a(ow,"date");var Ef=y("ZodArray",(e,t)=>{ud.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mm(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(Ct(r,o)),e.nonempty=r=>e.check(Ct(1,r)),e.max=(r,o)=>e.check(xn(r,o)),e.length=(r,o)=>e.check(kn(r,o)),e.unwrap=()=>e.element});function To(e,t){return cm(Ef,e,t)}a(To,"array");function iw(e){let t=e._zod.def.shape;return xa(Object.keys(t))}a(iw,"keyof");var Ao=y("ZodObject",(e,t)=>{dd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qm(e,r,o,n),I.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>xa(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_n()}),e.loose=()=>e.clone({...e._zod.def,catchall:_n()}),e.strict=()=>e.clone({...e._zod.def,catchall:ba()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>I.extend(e,r),e.safeExtend=r=>I.safeExtend(e,r),e.merge=r=>I.merge(e,r),e.pick=r=>I.pick(e,r),e.omit=r=>I.omit(e,r),e.partial=(...r)=>I.partial(_a,e,r[0]),e.required=(...r)=>I.required($a,e,r[0])});function sw(e,t){let r={type:"object",shape:e??{},...I.normalizeParams(t)};return new Ao(r)}a(sw,"object");function aw(e,t){return new Ao({type:"object",shape:e,catchall:ba(),...I.normalizeParams(t)})}a(aw,"strictObject");function cw(e,t){return new Ao({type:"object",shape:e,catchall:_n(),...I.normalizeParams(t)})}a(cw,"looseObject");var Co=y("ZodUnion",(e,t)=>{mo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gs(e,r,o,n),e.options=t.options});function wa(e,t){return new Co({type:"union",options:e,...I.normalizeParams(t)})}a(wa,"union");var Tf=y("ZodXor",(e,t)=>{Co.init(e,t),pd.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gs(e,r,o,n),e.options=t.options});function lw(e,t){return new Tf({type:"union",options:e,inclusive:!1,...I.normalizeParams(t)})}a(lw,"xor");var Af=y("ZodDiscriminatedUnion",(e,t)=>{Co.init(e,t),md.init(e,t)});function uw(e,t,r){return new Af({type:"union",options:t,discriminator:e,...I.normalizeParams(r)})}a(uw,"discriminatedUnion");var Cf=y("ZodIntersection",(e,t)=>{fd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fm(e,r,o,n)});function Rf(e,t){return new Cf({type:"intersection",left:e,right:t})}a(Rf,"intersection");var Of=y("ZodTuple",(e,t)=>{fs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zm(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Nf(e,t,r){let o=t instanceof z,n=o?r:t,i=o?t:null;return new Of({type:"tuple",items:e,rest:i,...I.normalizeParams(n)})}a(Nf,"tuple");var Ro=y("ZodRecord",(e,t)=>{gd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gm(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Df(e,t,r){return new Ro({type:"record",keyType:e,valueType:t,...I.normalizeParams(r)})}a(Df,"record");function dw(e,t,r){let o=Ee(e);return o._zod.values=void 0,new Ro({type:"record",keyType:o,valueType:t,...I.normalizeParams(r)})}a(dw,"partialRecord");function pw(e,t,r){return new Ro({type:"record",keyType:e,valueType:t,mode:"loose",...I.normalizeParams(r)})}a(pw,"looseRecord");var jf=y("ZodMap",(e,t)=>{hd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(wt(...r)),e.nonempty=r=>e.check(wt(1,r)),e.max=(...r)=>e.check(Jt(...r)),e.size=(...r)=>e.check(wn(...r))});function mw(e,t,r){return new jf({type:"map",keyType:e,valueType:t,...I.normalizeParams(r)})}a(mw,"map");var Lf=y("ZodSet",(e,t)=>{yd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zm(e,r,o,n),e.min=(...r)=>e.check(wt(...r)),e.nonempty=r=>e.check(wt(1,r)),e.max=(...r)=>e.check(Jt(...r)),e.size=(...r)=>e.check(wn(...r))});function fw(e,t){return new Lf({type:"set",valueType:e,...I.normalizeParams(t)})}a(fw,"set");var cr=y("ZodEnum",(e,t)=>{vd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Tm(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new cr({...t,checks:[],...I.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new cr({...t,checks:[],...I.normalizeParams(n),entries:i})}});function xa(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new cr({type:"enum",entries:r,...I.normalizeParams(t)})}a(xa,"_enum");function gw(e,t){return new cr({type:"enum",entries:e,...I.normalizeParams(t)})}a(gw,"nativeEnum");var Uf=y("ZodLiteral",(e,t)=>{bd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Am(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function hw(e,t){return new Uf({type:"literal",values:Array.isArray(e)?e:[e],...I.normalizeParams(t)})}a(hw,"literal");var zf=y("ZodFile",(e,t)=>{wd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Om(e,r,o,n),e.min=(r,o)=>e.check(wt(r,o)),e.max=(r,o)=>e.check(Jt(r,o)),e.mime=(r,o)=>e.check(Xn(Array.isArray(r)?r:[r],o))});function yw(e){return lm(zf,e)}a(yw,"file");var Mf=y("ZodTransform",(e,t)=>{xd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lm(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qt(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(I.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(I.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function ka(e){return new Mf({type:"transform",transform:e})}a(ka,"transform");var _a=y("ZodOptional",(e,t)=>{gs.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function $o(e){return new _a({type:"optional",innerType:e})}a($o,"optional");var qf=y("ZodExactOptional",(e,t)=>{kd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ff(e){return new qf({type:"optional",innerType:e})}a(Ff,"exactOptional");var Zf=y("ZodNullable",(e,t)=>{_d.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function So(e){return new Zf({type:"nullable",innerType:e})}a(So,"nullable");function vw(e){return $o(So(e))}a(vw,"nullish");var Gf=y("ZodDefault",(e,t)=>{$d.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Vf(e,t){return new Gf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}a(Vf,"_default");var Bf=y("ZodPrefault",(e,t)=>{Sd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Km(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Jf(e,t){return new Bf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}a(Jf,"prefault");var $a=y("ZodNonOptional",(e,t)=>{Id.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Kf(e,t){return new $a({type:"nonoptional",innerType:e,...I.normalizeParams(t)})}a(Kf,"nonoptional");var Wf=y("ZodSuccess",(e,t)=>{Pd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function bw(e){return new Wf({type:"success",innerType:e})}a(bw,"success");var Hf=y("ZodCatch",(e,t)=>{Ed.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Yf(e,t){return new Hf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}a(Yf,"_catch");var Qf=y("ZodNaN",(e,t)=>{Td.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cm(e,r,o,n)});function ww(e){return am(Qf,e)}a(ww,"nan");var Sa=y("ZodPipe",(e,t)=>{Ad.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hm(e,r,o,n),e.in=t.in,e.out=t.out});function Io(e,t){return new Sa({type:"pipe",in:e,out:t})}a(Io,"pipe");var Ia=y("ZodCodec",(e,t)=>{Sa.init(e,t),fo.init(e,t)});function xw(e,t,r){return new Ia({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}a(xw,"codec");var Xf=y("ZodReadonly",(e,t)=>{Cd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ym(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function eg(e){return new Xf({type:"readonly",innerType:e})}a(eg,"readonly");var tg=y("ZodTemplateLiteral",(e,t)=>{Rd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rm(e,r,o,n)});function kw(e,t){return new tg({type:"template_literal",parts:e,...I.normalizeParams(t)})}a(kw,"templateLiteral");var ng=y("ZodLazy",(e,t)=>{Dd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function rg(e){return new ng({type:"lazy",getter:e})}a(rg,"lazy");var og=y("ZodPromise",(e,t)=>{Nd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _w(e){return new og({type:"promise",innerType:e})}a(_w,"promise");var ig=y("ZodFunction",(e,t)=>{Od.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jm(e,r,o,n)});function $w(e){return new ig({type:"function",input:Array.isArray(e?.input)?Nf(e?.input):e?.input??To(_n()),output:e?.output??_n()})}a($w,"_function");var Oo=y("ZodCustom",(e,t)=>{jd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dm(e,r,o,n)});function Sw(e){let t=new ee({check:"custom"});return t._zod.check=e,t}a(Sw,"check");function Iw(e,t){return um(Oo,e??(()=>!0),t)}a(Iw,"custom");function sg(e,t={}){return dm(Oo,e,t)}a(sg,"refine");function ag(e){return pm(e)}a(ag,"superRefine");var Pw=mm,Ew=fm;function Tw(e,t={}){let r=new Oo({type:"custom",check:"custom",fn:a(o=>o instanceof e,"fn"),abort:!0,...I.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}a(Tw,"_instanceof");var Aw=a((...e)=>gm({Codec:Ia,Boolean:pr,String:lr},...e),"stringbool");function Cw(e){let t=rg(()=>wa([Xs(e),vf(),bf(),_f(),To(t),Df(Xs(),t)]));return t}a(Cw,"json");function Rw(e,t){return Io(ka(e),t)}a(Rw,"preprocess");var QP={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 XP(e){ae({customError:e})}a(XP,"setErrorMap");function eE(){return ae().customError}a(eE,"getErrorMap");var cg;cg||(cg={});var R={...ko,...Ks,iso:ar},tE=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 nE(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}a(nE,"detectVersion");function rE(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}a(rE,"resolveRef");function Ow(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return R.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return R.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=rE(n,t),s=$e(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return R.null();if(n.length===0)return R.never();if(n.length===1)return R.literal(n[0]);if(n.every(s=>typeof s=="string"))return R.enum(n);let i=n.map(s=>R.literal(s));return i.length<2?i[0]:R.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return R.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...e,type:i};return Ow(s,t)});return n.length===0?R.never():n.length===1?n[0]:R.union(n)}if(!r)return R.any();let o;switch(r){case"string":{let n=R.string();if(e.format){let i=e.format;i==="email"?n=n.check(R.email()):i==="uri"||i==="uri-reference"?n=n.check(R.url()):i==="uuid"||i==="guid"?n=n.check(R.uuid()):i==="date-time"?n=n.check(R.iso.datetime()):i==="date"?n=n.check(R.iso.date()):i==="time"?n=n.check(R.iso.time()):i==="duration"?n=n.check(R.iso.duration()):i==="ipv4"?n=n.check(R.ipv4()):i==="ipv6"?n=n.check(R.ipv6()):i==="mac"?n=n.check(R.mac()):i==="cidr"?n=n.check(R.cidrv4()):i==="cidr-v6"?n=n.check(R.cidrv6()):i==="base64"?n=n.check(R.base64()):i==="base64url"?n=n.check(R.base64url()):i==="e164"?n=n.check(R.e164()):i==="jwt"?n=n.check(R.jwt()):i==="emoji"?n=n.check(R.emoji()):i==="nanoid"?n=n.check(R.nanoid()):i==="cuid"?n=n.check(R.cuid()):i==="cuid2"?n=n.check(R.cuid2()):i==="ulid"?n=n.check(R.ulid()):i==="xid"?n=n.check(R.xid()):i==="ksuid"&&(n=n.check(R.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?R.number().int():R.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=R.boolean();break}case"null":{o=R.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let d=$e(u,t);n[l]=s.has(l)?d:d.optional()}if(e.propertyNames){let l=$e(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?$e(e.additionalProperties,t):R.any();if(Object.keys(n).length===0){o=R.record(l,u);break}let d=R.object(n).passthrough(),m=R.looseRecord(l,u);o=R.intersection(d,m);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let p of u){let f=$e(l[p],t),g=R.string().regex(new RegExp(p));d.push(R.looseRecord(g,f))}let m=[];if(Object.keys(n).length>0&&m.push(R.object(n).passthrough()),m.push(...d),m.length===0)o=R.object({}).passthrough();else if(m.length===1)o=m[0];else{let p=R.intersection(m[0],m[1]);for(let f=2;f<m.length;f++)p=R.intersection(p,m[f]);o=p}break}let c=R.object(n);e.additionalProperties===!1?o=c.strict():typeof e.additionalProperties=="object"?o=c.catchall($e(e.additionalProperties,t)):o=c.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let s=n.map(l=>$e(l,t)),c=i&&typeof i=="object"&&!Array.isArray(i)?$e(i,t):void 0;c?o=R.tuple(s).rest(c):o=R.tuple(s),typeof e.minItems=="number"&&(o=o.check(R.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(R.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(l=>$e(l,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?$e(e.additionalItems,t):void 0;c?o=R.tuple(s).rest(c):o=R.tuple(s),typeof e.minItems=="number"&&(o=o.check(R.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(R.maxLength(e.maxItems)))}else if(i!==void 0){let s=$e(i,t),c=R.array(s);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),o=c}else o=R.array(R.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}a(Ow,"convertBaseSchema");function $e(e,t){if(typeof e=="boolean")return e?R.any():R.never();let r=Ow(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(u=>$e(u,t)),l=R.union(c);r=o?R.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(u=>$e(u,t)),l=R.xor(c);r=o?R.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:R.any();else{let c=o?r:$e(e.allOf[0],t),l=o?0:1;for(let u=l;u<e.allOf.length;u++)c=R.intersection(c,$e(e.allOf[u],t));r=c}e.nullable===!0&&t.version==="openapi-3.0"&&(r=R.nullable(r)),e.readOnly===!0&&(r=R.readonly(r));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)c in e&&(n[c]=e[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))tE.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(r,n),r}a($e,"convertSchema");function Nw(e,t){if(typeof e=="boolean")return e?R.any():R.never();let r=nE(e,t?.defaultTarget),o=e.$defs||e.definitions||{},n={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??ke};return $e(e,n)}a(Nw,"fromJSONSchema");var lg={};St(lg,{bigint:()=>aE,boolean:()=>sE,date:()=>cE,number:()=>iE,string:()=>oE});function oE(e){return Rp(lr,e)}a(oE,"string");function iE(e){return Mp(dr,e)}a(iE,"number");function sE(e){return Jp(pr,e)}a(sE,"boolean");function aE(e){return Wp(mr,e)}a(aE,"bigint");function cE(e){return sm(Eo,e)}a(cE,"date");ae(go());import $E from"ajv";import{McpServer as SE}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as IE}from"@modelcontextprotocol/sdk/server/stdio.js";import{resolve as lx}from"path";var Pa={skills:Tt.properties.skills.additionalProperties.properties.executor.enum,tools:Tt.properties.tools.additionalProperties.properties.executor.enum},Dw=a(e=>e.map(t=>`"${t}"`).join(" | "),"quoted"),No={publish:{feature:"Publish (single, by channel slug)",whenToUse:"Emit a domain event as a side effect of a business operation, after the state is durably stored.",snippet:`// after the order is saved to your DB:
|
|
298
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1&&e.reused==="ref"){i(s);continue}}}a(Ht,"extractDefs");function Yt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a(s=>{let c=e.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let p=e.seen.get(d),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,l),s._zod.parent===d)for(let v in u)v==="$ref"||v==="allOf"||v in l||delete u[v];if(m.$ref&&p.def)for(let v in u)v==="$ref"||v==="allOf"||v in p.def&&JSON.stringify(u[v])===JSON.stringify(p.def[v])&&delete u[v]}let f=s._zod.parent;if(f&&f!==d){o(f);let p=e.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]}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})},"flattenRef");for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:ar(t,"input",e.processors),output:ar(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}a(Yt,"finalize");function Re(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Re(o.element,r);if(o.type==="set")return Re(o.valueType,r);if(o.type==="lazy")return Re(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Re(o.innerType,r);if(o.type==="intersection")return Re(o.left,r)||Re(o.right,r);if(o.type==="record"||o.type==="map")return Re(o.keyType,r)||Re(o.valueType,r);if(o.type==="pipe")return Re(o.in,r)||Re(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Re(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Re(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Re(n,r))return!0;return!!(o.rest&&Re(o.rest,r))}return!1}a(Re,"isTransforming");var Cf=a((e,t={})=>r=>{let o=Wt({...r,processors:t});return H(e,o),Ht(o,e),Yt(o,e)},"createToJSONSchemaMethod"),ar=a((e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=Wt({...n??{},target:i,io:t,processors:r});return H(e,s),Ht(s,e),Yt(s,e)},"createStandardJSONSchemaMethod");var rT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Rf=a((e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),c&&(n.format=rT[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){let d=[...u];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},"stringProcessor"),Of=a((e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:d}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d),typeof i=="number"&&(n.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof s=="number"&&(n.maximum=s,typeof l=="number"&&t.target!=="draft-04"&&(l<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},"numberProcessor"),Nf=a((e,t,r,o)=>{r.type="boolean"},"booleanProcessor"),Df=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),jf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Uf=a((e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),Lf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),zf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),Mf=a((e,t,r,o)=>{r.not={}},"neverProcessor"),Ff=a((e,t,r,o)=>{},"anyProcessor"),qf=a((e,t,r,o)=>{},"unknownProcessor"),Zf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Gf=a((e,t,r,o)=>{let n=e._zod.def,i=so(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},"enumProcessor"),Vf=a((e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},"literalProcessor"),Bf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Kf=a((e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},"templateLiteralProcessor"),Jf=a((e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=e._zod.bag;s!==void 0&&(i.minLength=s),c!==void 0&&(i.maxLength=c),u?u.length===1?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(n,i)},"fileProcessor"),Wf=a((e,t,r,o)=>{r.type="boolean"},"successProcessor"),Hf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),Yf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),Qf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),Xf=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),em=a((e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),tm=a((e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=H(i.element,t,{...o,path:[...o.path,"items"]})},"arrayProcessor"),nm=a((e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let l in s)n.properties[l]=H(s[l],t,{...o,path:[...o.path,"properties",l]});let c=new Set(Object.keys(s)),u=new Set([...c].filter(l=>{let d=i.shape[l]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=H(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},"objectProcessor"),Ys=a((e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((c,u)=>H(c,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},"unionProcessor"),rm=a((e,t,r,o)=>{let n=e._zod.def,i=H(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=H(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=a(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u},"intersectionProcessor"),om=a((e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((p,m)=>H(p,t,{...o,path:[...o.path,s,m]})),l=i.rest?H(i.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:u},l&&n.items.anyOf.push(l),n.minItems=u.length,l||(n.maxItems=u.length)):(n.items=u,l&&(n.additionalItems=l));let{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof f=="number"&&(n.maxItems=f)},"tupleProcessor"),im=a((e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,u=s._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let d=H(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of u)n.patternProperties[f.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=H(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=H(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let l=s._zod.values;if(l){let d=[...l].filter(f=>typeof f=="string"||typeof f=="number");d.length>0&&(n.required=d)}},"recordProcessor"),sm=a((e,t,r,o)=>{let n=e._zod.def,i=H(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},"nullableProcessor"),am=a((e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},"nonoptionalProcessor"),cm=a((e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},"defaultProcessor"),um=a((e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},"prefaultProcessor"),lm=a((e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},"catchProcessor"),dm=a((e,t,r,o)=>{let n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;H(i,t,o);let s=t.seen.get(e);s.ref=i},"pipeProcessor"),pm=a((e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},"readonlyProcessor"),fm=a((e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},"promiseProcessor"),Qs=a((e,t,r,o)=>{let n=e._zod.def;H(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},"optionalProcessor"),mm=a((e,t,r,o)=>{let n=e._zod.innerType;H(n,t,o);let i=t.seen.get(e);i.ref=n},"lazyProcessor"),Hs={string:Rf,number:Of,boolean:Nf,bigint:Df,symbol:jf,null:Uf,undefined:Lf,void:zf,never:Mf,any:Ff,unknown:qf,date:Zf,enum:Gf,literal:Vf,nan:Bf,template_literal:Kf,file:Jf,success:Wf,custom:Hf,function:Yf,transform:Qf,map:Xf,set:em,array:tm,object:nm,union:Ys,intersection:rm,tuple:om,record:im,nullable:sm,nonoptional:am,default:cm,prefault:um,catch:lm,pipe:dm,readonly:pm,promise:fm,optional:Qs,lazy:mm};function Xs(e,t){if("_idmap"in e){let o=e,n=Wt({...t,processors:Hs}),i={};for(let u of o._idmap.entries()){let[l,d]=u;H(d,n)}let s={},c={registry:o,uri:t?.uri,defs:i};n.external=c;for(let u of o._idmap.entries()){let[l,d]=u;Ht(n,d),s[l]=Yt(n,d)}if(Object.keys(i).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:i}}return{schemas:s}}let r=Wt({...t,processors:Hs});return H(e,r),Ht(r,e),Yt(r,e)}a(Xs,"toJSONSchema");var ea=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Wt({processors:Hs,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return H(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Ht(this.ctx,t);let o=Yt(this.ctx,t),{"~standard":n,...i}=o;return i}};var Yb={};var Eo={};Pt(Eo,{ZodAny:()=>Lm,ZodArray:()=>qm,ZodBase64:()=>ka,ZodBase64URL:()=>xa,ZodBigInt:()=>mr,ZodBigIntFormat:()=>Sa,ZodBoolean:()=>fr,ZodCIDRv4:()=>ba,ZodCIDRv6:()=>wa,ZodCUID:()=>pa,ZodCUID2:()=>fa,ZodCatch:()=>lg,ZodCodec:()=>Oa,ZodCustom:()=>zo,ZodCustomStringFormat:()=>dr,ZodDate:()=>No,ZodDefault:()=>og,ZodDiscriminatedUnion:()=>Gm,ZodE164:()=>_a,ZodEmail:()=>ua,ZodEmoji:()=>la,ZodEnum:()=>ur,ZodExactOptional:()=>tg,ZodFile:()=>Xm,ZodFunction:()=>bg,ZodGUID:()=>To,ZodIPv4:()=>ya,ZodIPv6:()=>va,ZodIntersection:()=>Vm,ZodJWT:()=>$a,ZodKSUID:()=>ha,ZodLazy:()=>hg,ZodLiteral:()=>Qm,ZodMAC:()=>Cm,ZodMap:()=>Hm,ZodNaN:()=>pg,ZodNanoID:()=>da,ZodNever:()=>Mm,ZodNonOptional:()=>Ca,ZodNull:()=>jm,ZodNullable:()=>rg,ZodNumber:()=>pr,ZodNumberFormat:()=>Sn,ZodObject:()=>jo,ZodOptional:()=>Aa,ZodPipe:()=>Ra,ZodPrefault:()=>sg,ZodPromise:()=>vg,ZodReadonly:()=>fg,ZodRecord:()=>Lo,ZodSet:()=>Ym,ZodString:()=>lr,ZodStringFormat:()=>ee,ZodSuccess:()=>ug,ZodSymbol:()=>Nm,ZodTemplateLiteral:()=>gg,ZodTransform:()=>eg,ZodTuple:()=>Km,ZodType:()=>G,ZodULID:()=>ma,ZodURL:()=>Oo,ZodUUID:()=>_t,ZodUndefined:()=>Dm,ZodUnion:()=>Uo,ZodUnknown:()=>zm,ZodVoid:()=>Fm,ZodXID:()=>ga,ZodXor:()=>Zm,_ZodString:()=>ca,_default:()=>ig,_function:()=>ok,any:()=>jw,array:()=>Do,base64:()=>bw,base64url:()=>ww,bigint:()=>Cw,boolean:()=>Om,catch:()=>dg,check:()=>ik,cidrv4:()=>yw,cidrv6:()=>vw,codec:()=>tk,cuid:()=>uw,cuid2:()=>lw,custom:()=>sk,date:()=>Lw,describe:()=>ak,discriminatedUnion:()=>Gw,e164:()=>kw,email:()=>Xb,emoji:()=>aw,enum:()=>Ea,exactOptional:()=>ng,file:()=>Yw,float32:()=>Pw,float64:()=>Ew,function:()=>ok,guid:()=>ew,hash:()=>Iw,hex:()=>Sw,hostname:()=>$w,httpUrl:()=>sw,instanceof:()=>uk,int:()=>aa,int32:()=>Tw,int64:()=>Rw,intersection:()=>Bm,ipv4:()=>mw,ipv6:()=>hw,json:()=>dk,jwt:()=>xw,keyof:()=>zw,ksuid:()=>fw,lazy:()=>yg,literal:()=>Hw,looseObject:()=>qw,looseRecord:()=>Bw,mac:()=>gw,map:()=>Kw,meta:()=>ck,nan:()=>ek,nanoid:()=>cw,nativeEnum:()=>Ww,never:()=>Ia,nonoptional:()=>cg,null:()=>Um,nullable:()=>Co,nullish:()=>Qw,number:()=>Rm,object:()=>Mw,optional:()=>Ao,partialRecord:()=>Vw,pipe:()=>Ro,prefault:()=>ag,preprocess:()=>pk,promise:()=>rk,readonly:()=>mg,record:()=>Wm,refine:()=>wg,set:()=>Jw,strictObject:()=>Fw,string:()=>sa,stringFormat:()=>_w,stringbool:()=>lk,success:()=>Xw,superRefine:()=>kg,symbol:()=>Nw,templateLiteral:()=>nk,transform:()=>Ta,tuple:()=>Jm,uint32:()=>Aw,uint64:()=>Ow,ulid:()=>dw,undefined:()=>Dw,union:()=>Pa,unknown:()=>$n,url:()=>iw,uuid:()=>tw,uuidv4:()=>nw,uuidv6:()=>rw,uuidv7:()=>ow,void:()=>Uw,xid:()=>pw,xor:()=>Zw});var ta={};Pt(ta,{endsWith:()=>Xn,gt:()=>kt,gte:()=>Ce,includes:()=>Yn,length:()=>_n,lowercase:()=>Wn,lt:()=>wt,lte:()=>Fe,maxLength:()=>xn,maxSize:()=>Jt,mime:()=>er,minLength:()=>Rt,minSize:()=>xt,multipleOf:()=>Kt,negative:()=>Bs,nonnegative:()=>Js,nonpositive:()=>Ks,normalize:()=>tr,overwrite:()=>it,positive:()=>Vs,property:()=>Ws,regex:()=>Jn,size:()=>kn,slugify:()=>ir,startsWith:()=>Qn,toLowerCase:()=>rr,toUpperCase:()=>or,trim:()=>nr,uppercase:()=>Hn});var cr={};Pt(cr,{ZodISODate:()=>ra,ZodISODateTime:()=>na,ZodISODuration:()=>ia,ZodISOTime:()=>oa,date:()=>hm,datetime:()=>gm,duration:()=>vm,time:()=>ym});var na=y("ZodISODateTime",(e,t)=>{Xl.init(e,t),ee.init(e,t)});function gm(e){return Wp(na,e)}a(gm,"datetime");var ra=y("ZodISODate",(e,t)=>{ed.init(e,t),ee.init(e,t)});function hm(e){return Hp(ra,e)}a(hm,"date");var oa=y("ZodISOTime",(e,t)=>{td.init(e,t),ee.init(e,t)});function ym(e){return Yp(oa,e)}a(ym,"time");var ia=y("ZodISODuration",(e,t)=>{nd.init(e,t),ee.init(e,t)});function vm(e){return Qp(ia,e)}a(vm,"duration");var Qb=a((e,t)=>{po.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a(r=>mo(e,r),"value")},flatten:{value:a(r=>fo(e,r),"value")},addIssue:{value:a(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,zn,2)},"value")},addIssues:{value:a(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,zn,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),iT=y("ZodError",Qb),Ue=y("ZodError",Qb,{Parent:Error});var bm=qn(Ue),wm=Zn(Ue),km=Gn(Ue),xm=Vn(Ue),_m=ns(Ue),$m=rs(Ue),Sm=os(Ue),Im=is(Ue),Pm=ss(Ue),Em=as(Ue),Tm=cs(Ue),Am=us(Ue);var G=y("ZodType",(e,t)=>(M.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ar(e,"input"),output:ar(e,"output")}}),e.toJSONSchema=Cf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(E.mergeDefs(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>Ae(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>bm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>km(e,r,o),e.parseAsync=async(r,o)=>wm(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>xm(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>_m(e,r,o),e.decode=(r,o)=>$m(e,r,o),e.encodeAsync=async(r,o)=>Sm(e,r,o),e.decodeAsync=async(r,o)=>Im(e,r,o),e.safeEncode=(r,o)=>Pm(e,r,o),e.safeDecode=(r,o)=>Em(e,r,o),e.safeEncodeAsync=async(r,o)=>Tm(e,r,o),e.safeDecodeAsync=async(r,o)=>Am(e,r,o),e.refine=(r,o)=>e.check(wg(r,o)),e.superRefine=r=>e.check(kg(r)),e.overwrite=r=>e.check(it(r)),e.optional=()=>Ao(e),e.exactOptional=()=>ng(e),e.nullable=()=>Co(e),e.nullish=()=>Ao(Co(e)),e.nonoptional=r=>cg(e,r),e.array=()=>Do(e),e.or=r=>Pa([e,r]),e.and=r=>Bm(e,r),e.transform=r=>Ro(e,Ta(r)),e.default=r=>ig(e,r),e.prefault=r=>ag(e,r),e.catch=r=>dg(e,r),e.pipe=r=>Ro(e,r),e.readonly=()=>mg(e),e.describe=r=>{let o=e.clone();return _e.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return _e.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return _e.get(e);let o=e.clone();return _e.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),ca=y("_ZodString",(e,t)=>{wn.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Rf(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Jn(...o)),e.includes=(...o)=>e.check(Yn(...o)),e.startsWith=(...o)=>e.check(Qn(...o)),e.endsWith=(...o)=>e.check(Xn(...o)),e.min=(...o)=>e.check(Rt(...o)),e.max=(...o)=>e.check(xn(...o)),e.length=(...o)=>e.check(_n(...o)),e.nonempty=(...o)=>e.check(Rt(1,...o)),e.lowercase=o=>e.check(Wn(o)),e.uppercase=o=>e.check(Hn(o)),e.trim=()=>e.check(nr()),e.normalize=(...o)=>e.check(tr(...o)),e.toLowerCase=()=>e.check(rr()),e.toUpperCase=()=>e.check(or()),e.slugify=()=>e.check(ir())}),lr=y("ZodString",(e,t)=>{wn.init(e,t),ca.init(e,t),e.email=r=>e.check(Ss(ua,r)),e.url=r=>e.check(Po(Oo,r)),e.jwt=r=>e.check(Gs($a,r)),e.emoji=r=>e.check(As(la,r)),e.guid=r=>e.check(Io(To,r)),e.uuid=r=>e.check(Is(_t,r)),e.uuidv4=r=>e.check(Ps(_t,r)),e.uuidv6=r=>e.check(Es(_t,r)),e.uuidv7=r=>e.check(Ts(_t,r)),e.nanoid=r=>e.check(Cs(da,r)),e.guid=r=>e.check(Io(To,r)),e.cuid=r=>e.check(Rs(pa,r)),e.cuid2=r=>e.check(Os(fa,r)),e.ulid=r=>e.check(Ns(ma,r)),e.base64=r=>e.check(Fs(ka,r)),e.base64url=r=>e.check(qs(xa,r)),e.xid=r=>e.check(Ds(ga,r)),e.ksuid=r=>e.check(js(ha,r)),e.ipv4=r=>e.check(Us(ya,r)),e.ipv6=r=>e.check(Ls(va,r)),e.cidrv4=r=>e.check(zs(ba,r)),e.cidrv6=r=>e.check(Ms(wa,r)),e.e164=r=>e.check(Zs(_a,r)),e.datetime=r=>e.check(gm(r)),e.date=r=>e.check(hm(r)),e.time=r=>e.check(ym(r)),e.duration=r=>e.check(vm(r))});function sa(e){return Vp(lr,e)}a(sa,"string");var ee=y("ZodStringFormat",(e,t)=>{X.init(e,t),ca.init(e,t)}),ua=y("ZodEmail",(e,t)=>{Gl.init(e,t),ee.init(e,t)});function Xb(e){return Ss(ua,e)}a(Xb,"email");var To=y("ZodGUID",(e,t)=>{ql.init(e,t),ee.init(e,t)});function ew(e){return Io(To,e)}a(ew,"guid");var _t=y("ZodUUID",(e,t)=>{Zl.init(e,t),ee.init(e,t)});function tw(e){return Is(_t,e)}a(tw,"uuid");function nw(e){return Ps(_t,e)}a(nw,"uuidv4");function rw(e){return Es(_t,e)}a(rw,"uuidv6");function ow(e){return Ts(_t,e)}a(ow,"uuidv7");var Oo=y("ZodURL",(e,t)=>{Vl.init(e,t),ee.init(e,t)});function iw(e){return Po(Oo,e)}a(iw,"url");function sw(e){return Po(Oo,{protocol:/^https?$/,hostname:Je.domain,...E.normalizeParams(e)})}a(sw,"httpUrl");var la=y("ZodEmoji",(e,t)=>{Bl.init(e,t),ee.init(e,t)});function aw(e){return As(la,e)}a(aw,"emoji");var da=y("ZodNanoID",(e,t)=>{Kl.init(e,t),ee.init(e,t)});function cw(e){return Cs(da,e)}a(cw,"nanoid");var pa=y("ZodCUID",(e,t)=>{Jl.init(e,t),ee.init(e,t)});function uw(e){return Rs(pa,e)}a(uw,"cuid");var fa=y("ZodCUID2",(e,t)=>{Wl.init(e,t),ee.init(e,t)});function lw(e){return Os(fa,e)}a(lw,"cuid2");var ma=y("ZodULID",(e,t)=>{Hl.init(e,t),ee.init(e,t)});function dw(e){return Ns(ma,e)}a(dw,"ulid");var ga=y("ZodXID",(e,t)=>{Yl.init(e,t),ee.init(e,t)});function pw(e){return Ds(ga,e)}a(pw,"xid");var ha=y("ZodKSUID",(e,t)=>{Ql.init(e,t),ee.init(e,t)});function fw(e){return js(ha,e)}a(fw,"ksuid");var ya=y("ZodIPv4",(e,t)=>{rd.init(e,t),ee.init(e,t)});function mw(e){return Us(ya,e)}a(mw,"ipv4");var Cm=y("ZodMAC",(e,t)=>{id.init(e,t),ee.init(e,t)});function gw(e){return Kp(Cm,e)}a(gw,"mac");var va=y("ZodIPv6",(e,t)=>{od.init(e,t),ee.init(e,t)});function hw(e){return Ls(va,e)}a(hw,"ipv6");var ba=y("ZodCIDRv4",(e,t)=>{sd.init(e,t),ee.init(e,t)});function yw(e){return zs(ba,e)}a(yw,"cidrv4");var wa=y("ZodCIDRv6",(e,t)=>{ad.init(e,t),ee.init(e,t)});function vw(e){return Ms(wa,e)}a(vw,"cidrv6");var ka=y("ZodBase64",(e,t)=>{ud.init(e,t),ee.init(e,t)});function bw(e){return Fs(ka,e)}a(bw,"base64");var xa=y("ZodBase64URL",(e,t)=>{ld.init(e,t),ee.init(e,t)});function ww(e){return qs(xa,e)}a(ww,"base64url");var _a=y("ZodE164",(e,t)=>{dd.init(e,t),ee.init(e,t)});function kw(e){return Zs(_a,e)}a(kw,"e164");var $a=y("ZodJWT",(e,t)=>{pd.init(e,t),ee.init(e,t)});function xw(e){return Gs($a,e)}a(xw,"jwt");var dr=y("ZodCustomStringFormat",(e,t)=>{fd.init(e,t),ee.init(e,t)});function _w(e,t,r={}){return sr(dr,e,t,r)}a(_w,"stringFormat");function $w(e){return sr(dr,"hostname",Je.hostname,e)}a($w,"hostname");function Sw(e){return sr(dr,"hex",Je.hex,e)}a(Sw,"hex");function Iw(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=Je[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return sr(dr,o,n,t)}a(Iw,"hash");var pr=y("ZodNumber",(e,t)=>{bs.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Of(e,o,n,i),e.gt=(o,n)=>e.check(kt(o,n)),e.gte=(o,n)=>e.check(Ce(o,n)),e.min=(o,n)=>e.check(Ce(o,n)),e.lt=(o,n)=>e.check(wt(o,n)),e.lte=(o,n)=>e.check(Fe(o,n)),e.max=(o,n)=>e.check(Fe(o,n)),e.int=o=>e.check(aa(o)),e.safe=o=>e.check(aa(o)),e.positive=o=>e.check(kt(0,o)),e.nonnegative=o=>e.check(Ce(0,o)),e.negative=o=>e.check(wt(0,o)),e.nonpositive=o=>e.check(Fe(0,o)),e.multipleOf=(o,n)=>e.check(Kt(o,n)),e.step=(o,n)=>e.check(Kt(o,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Rm(e){return Xp(pr,e)}a(Rm,"number");var Sn=y("ZodNumberFormat",(e,t)=>{md.init(e,t),pr.init(e,t)});function aa(e){return tf(Sn,e)}a(aa,"int");function Pw(e){return nf(Sn,e)}a(Pw,"float32");function Ew(e){return rf(Sn,e)}a(Ew,"float64");function Tw(e){return of(Sn,e)}a(Tw,"int32");function Aw(e){return sf(Sn,e)}a(Aw,"uint32");var fr=y("ZodBoolean",(e,t)=>{vo.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nf(e,r,o,n)});function Om(e){return af(fr,e)}a(Om,"boolean");var mr=y("ZodBigInt",(e,t)=>{ws.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Df(e,o,n,i),e.gte=(o,n)=>e.check(Ce(o,n)),e.min=(o,n)=>e.check(Ce(o,n)),e.gt=(o,n)=>e.check(kt(o,n)),e.gte=(o,n)=>e.check(Ce(o,n)),e.min=(o,n)=>e.check(Ce(o,n)),e.lt=(o,n)=>e.check(wt(o,n)),e.lte=(o,n)=>e.check(Fe(o,n)),e.max=(o,n)=>e.check(Fe(o,n)),e.positive=o=>e.check(kt(BigInt(0),o)),e.negative=o=>e.check(wt(BigInt(0),o)),e.nonpositive=o=>e.check(Fe(BigInt(0),o)),e.nonnegative=o=>e.check(Ce(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Kt(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Cw(e){return uf(mr,e)}a(Cw,"bigint");var Sa=y("ZodBigIntFormat",(e,t)=>{gd.init(e,t),mr.init(e,t)});function Rw(e){return df(Sa,e)}a(Rw,"int64");function Ow(e){return pf(Sa,e)}a(Ow,"uint64");var Nm=y("ZodSymbol",(e,t)=>{hd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jf(e,r,o,n)});function Nw(e){return ff(Nm,e)}a(Nw,"symbol");var Dm=y("ZodUndefined",(e,t)=>{yd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lf(e,r,o,n)});function Dw(e){return mf(Dm,e)}a(Dw,"_undefined");var jm=y("ZodNull",(e,t)=>{vd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uf(e,r,o,n)});function Um(e){return gf(jm,e)}a(Um,"_null");var Lm=y("ZodAny",(e,t)=>{bd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ff(e,r,o,n)});function jw(){return hf(Lm)}a(jw,"any");var zm=y("ZodUnknown",(e,t)=>{wd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qf(e,r,o,n)});function $n(){return yf(zm)}a($n,"unknown");var Mm=y("ZodNever",(e,t)=>{kd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mf(e,r,o,n)});function Ia(e){return vf(Mm,e)}a(Ia,"never");var Fm=y("ZodVoid",(e,t)=>{xd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zf(e,r,o,n)});function Uw(e){return bf(Fm,e)}a(Uw,"_void");var No=y("ZodDate",(e,t)=>{_d.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Zf(e,o,n,i),e.min=(o,n)=>e.check(Ce(o,n)),e.max=(o,n)=>e.check(Fe(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Lw(e){return wf(No,e)}a(Lw,"date");var qm=y("ZodArray",(e,t)=>{$d.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tm(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(Rt(r,o)),e.nonempty=r=>e.check(Rt(1,r)),e.max=(r,o)=>e.check(xn(r,o)),e.length=(r,o)=>e.check(_n(r,o)),e.unwrap=()=>e.element});function Do(e,t){return _f(qm,e,t)}a(Do,"array");function zw(e){let t=e._zod.def.shape;return Ea(Object.keys(t))}a(zw,"keyof");var jo=y("ZodObject",(e,t)=>{Sd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nm(e,r,o,n),E.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Ea(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$n()}),e.loose=()=>e.clone({...e._zod.def,catchall:$n()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ia()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>E.extend(e,r),e.safeExtend=r=>E.safeExtend(e,r),e.merge=r=>E.merge(e,r),e.pick=r=>E.pick(e,r),e.omit=r=>E.omit(e,r),e.partial=(...r)=>E.partial(Aa,e,r[0]),e.required=(...r)=>E.required(Ca,e,r[0])});function Mw(e,t){let r={type:"object",shape:e??{},...E.normalizeParams(t)};return new jo(r)}a(Mw,"object");function Fw(e,t){return new jo({type:"object",shape:e,catchall:Ia(),...E.normalizeParams(t)})}a(Fw,"strictObject");function qw(e,t){return new jo({type:"object",shape:e,catchall:$n(),...E.normalizeParams(t)})}a(qw,"looseObject");var Uo=y("ZodUnion",(e,t)=>{bo.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ys(e,r,o,n),e.options=t.options});function Pa(e,t){return new Uo({type:"union",options:e,...E.normalizeParams(t)})}a(Pa,"union");var Zm=y("ZodXor",(e,t)=>{Uo.init(e,t),Id.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ys(e,r,o,n),e.options=t.options});function Zw(e,t){return new Zm({type:"union",options:e,inclusive:!1,...E.normalizeParams(t)})}a(Zw,"xor");var Gm=y("ZodDiscriminatedUnion",(e,t)=>{Uo.init(e,t),Pd.init(e,t)});function Gw(e,t,r){return new Gm({type:"union",options:t,discriminator:e,...E.normalizeParams(r)})}a(Gw,"discriminatedUnion");var Vm=y("ZodIntersection",(e,t)=>{Ed.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rm(e,r,o,n)});function Bm(e,t){return new Vm({type:"intersection",left:e,right:t})}a(Bm,"intersection");var Km=y("ZodTuple",(e,t)=>{ks.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>om(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Jm(e,t,r){let o=t instanceof M,n=o?r:t,i=o?t:null;return new Km({type:"tuple",items:e,rest:i,...E.normalizeParams(n)})}a(Jm,"tuple");var Lo=y("ZodRecord",(e,t)=>{Td.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>im(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Wm(e,t,r){return new Lo({type:"record",keyType:e,valueType:t,...E.normalizeParams(r)})}a(Wm,"record");function Vw(e,t,r){let o=Ae(e);return o._zod.values=void 0,new Lo({type:"record",keyType:o,valueType:t,...E.normalizeParams(r)})}a(Vw,"partialRecord");function Bw(e,t,r){return new Lo({type:"record",keyType:e,valueType:t,mode:"loose",...E.normalizeParams(r)})}a(Bw,"looseRecord");var Hm=y("ZodMap",(e,t)=>{Ad.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(xt(...r)),e.nonempty=r=>e.check(xt(1,r)),e.max=(...r)=>e.check(Jt(...r)),e.size=(...r)=>e.check(kn(...r))});function Kw(e,t,r){return new Hm({type:"map",keyType:e,valueType:t,...E.normalizeParams(r)})}a(Kw,"map");var Ym=y("ZodSet",(e,t)=>{Cd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>em(e,r,o,n),e.min=(...r)=>e.check(xt(...r)),e.nonempty=r=>e.check(xt(1,r)),e.max=(...r)=>e.check(Jt(...r)),e.size=(...r)=>e.check(kn(...r))});function Jw(e,t){return new Ym({type:"set",valueType:e,...E.normalizeParams(t)})}a(Jw,"set");var ur=y("ZodEnum",(e,t)=>{Rd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Gf(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ur({...t,checks:[],...E.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new ur({...t,checks:[],...E.normalizeParams(n),entries:i})}});function Ea(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ur({type:"enum",entries:r,...E.normalizeParams(t)})}a(Ea,"_enum");function Ww(e,t){return new ur({type:"enum",entries:e,...E.normalizeParams(t)})}a(Ww,"nativeEnum");var Qm=y("ZodLiteral",(e,t)=>{Od.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vf(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Hw(e,t){return new Qm({type:"literal",values:Array.isArray(e)?e:[e],...E.normalizeParams(t)})}a(Hw,"literal");var Xm=y("ZodFile",(e,t)=>{Nd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jf(e,r,o,n),e.min=(r,o)=>e.check(xt(r,o)),e.max=(r,o)=>e.check(Jt(r,o)),e.mime=(r,o)=>e.check(er(Array.isArray(r)?r:[r],o))});function Yw(e){return $f(Xm,e)}a(Yw,"file");var eg=y("ZodTransform",(e,t)=>{Dd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qf(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new qt(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(E.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(E.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function Ta(e){return new eg({type:"transform",transform:e})}a(Ta,"transform");var Aa=y("ZodOptional",(e,t)=>{xs.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ao(e){return new Aa({type:"optional",innerType:e})}a(Ao,"optional");var tg=y("ZodExactOptional",(e,t)=>{jd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ng(e){return new tg({type:"optional",innerType:e})}a(ng,"exactOptional");var rg=y("ZodNullable",(e,t)=>{Ud.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Co(e){return new rg({type:"nullable",innerType:e})}a(Co,"nullable");function Qw(e){return Ao(Co(e))}a(Qw,"nullish");var og=y("ZodDefault",(e,t)=>{Ld.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ig(e,t){return new og({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}a(ig,"_default");var sg=y("ZodPrefault",(e,t)=>{zd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>um(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ag(e,t){return new sg({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}a(ag,"prefault");var Ca=y("ZodNonOptional",(e,t)=>{Md.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>am(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cg(e,t){return new Ca({type:"nonoptional",innerType:e,...E.normalizeParams(t)})}a(cg,"nonoptional");var ug=y("ZodSuccess",(e,t)=>{Fd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Xw(e){return new ug({type:"success",innerType:e})}a(Xw,"success");var lg=y("ZodCatch",(e,t)=>{qd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dg(e,t){return new lg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}a(dg,"_catch");var pg=y("ZodNaN",(e,t)=>{Zd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bf(e,r,o,n)});function ek(e){return xf(pg,e)}a(ek,"nan");var Ra=y("ZodPipe",(e,t)=>{Gd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dm(e,r,o,n),e.in=t.in,e.out=t.out});function Ro(e,t){return new Ra({type:"pipe",in:e,out:t})}a(Ro,"pipe");var Oa=y("ZodCodec",(e,t)=>{Ra.init(e,t),wo.init(e,t)});function tk(e,t,r){return new Oa({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}a(tk,"codec");var fg=y("ZodReadonly",(e,t)=>{Vd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function mg(e){return new fg({type:"readonly",innerType:e})}a(mg,"readonly");var gg=y("ZodTemplateLiteral",(e,t)=>{Bd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kf(e,r,o,n)});function nk(e,t){return new gg({type:"template_literal",parts:e,...E.normalizeParams(t)})}a(nk,"templateLiteral");var hg=y("ZodLazy",(e,t)=>{Wd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function yg(e){return new hg({type:"lazy",getter:e})}a(yg,"lazy");var vg=y("ZodPromise",(e,t)=>{Jd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rk(e){return new vg({type:"promise",innerType:e})}a(rk,"promise");var bg=y("ZodFunction",(e,t)=>{Kd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yf(e,r,o,n)});function ok(e){return new bg({type:"function",input:Array.isArray(e?.input)?Jm(e?.input):e?.input??Do($n()),output:e?.output??$n()})}a(ok,"_function");var zo=y("ZodCustom",(e,t)=>{Hd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hf(e,r,o,n)});function ik(e){let t=new te({check:"custom"});return t._zod.check=e,t}a(ik,"check");function sk(e,t){return Sf(zo,e??(()=>!0),t)}a(sk,"custom");function wg(e,t={}){return If(zo,e,t)}a(wg,"refine");function kg(e){return Pf(e)}a(kg,"superRefine");var ak=Ef,ck=Tf;function uk(e,t={}){let r=new zo({type:"custom",check:"custom",fn:a(o=>o instanceof e,"fn"),abort:!0,...E.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}a(uk,"_instanceof");var lk=a((...e)=>Af({Codec:Oa,Boolean:fr,String:lr},...e),"stringbool");function dk(e){let t=yg(()=>Pa([sa(e),Rm(),Om(),Um(),Do(t),Wm(sa(),t)]));return t}a(dk,"json");function pk(e,t){return Ro(Ta(e),t)}a(pk,"preprocess");var aT={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 cT(e){ce({customError:e})}a(cT,"setErrorMap");function uT(){return ce().customError}a(uT,"getErrorMap");var xg;xg||(xg={});var O={...Eo,...ta,iso:cr},lT=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 dT(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}a(dT,"detectVersion");function pT(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}a(pT,"resolveRef");function fk(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return O.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=pT(n,t),s=Se(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return O.null();if(n.length===0)return O.never();if(n.length===1)return O.literal(n[0]);if(n.every(s=>typeof s=="string"))return O.enum(n);let i=n.map(s=>O.literal(s));return i.length<2?i[0]:O.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...e,type:i};return fk(s,t)});return n.length===0?O.never():n.length===1?n[0]:O.union(n)}if(!r)return O.any();let o;switch(r){case"string":{let n=O.string();if(e.format){let i=e.format;i==="email"?n=n.check(O.email()):i==="uri"||i==="uri-reference"?n=n.check(O.url()):i==="uuid"||i==="guid"?n=n.check(O.uuid()):i==="date-time"?n=n.check(O.iso.datetime()):i==="date"?n=n.check(O.iso.date()):i==="time"?n=n.check(O.iso.time()):i==="duration"?n=n.check(O.iso.duration()):i==="ipv4"?n=n.check(O.ipv4()):i==="ipv6"?n=n.check(O.ipv6()):i==="mac"?n=n.check(O.mac()):i==="cidr"?n=n.check(O.cidrv4()):i==="cidr-v6"?n=n.check(O.cidrv6()):i==="base64"?n=n.check(O.base64()):i==="base64url"?n=n.check(O.base64url()):i==="e164"?n=n.check(O.e164()):i==="jwt"?n=n.check(O.jwt()):i==="emoji"?n=n.check(O.emoji()):i==="nanoid"?n=n.check(O.nanoid()):i==="cuid"?n=n.check(O.cuid()):i==="cuid2"?n=n.check(O.cuid2()):i==="ulid"?n=n.check(O.ulid()):i==="xid"?n=n.check(O.xid()):i==="ksuid"&&(n=n.check(O.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?O.number().int():O.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=O.boolean();break}case"null":{o=O.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[u,l]of Object.entries(i)){let d=Se(l,t);n[u]=s.has(u)?d:d.optional()}if(e.propertyNames){let u=Se(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Se(e.additionalProperties,t):O.any();if(Object.keys(n).length===0){o=O.record(u,l);break}let d=O.object(n).passthrough(),f=O.looseRecord(u,l);o=O.intersection(d,f);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),d=[];for(let p of l){let m=Se(u[p],t),g=O.string().regex(new RegExp(p));d.push(O.looseRecord(g,m))}let f=[];if(Object.keys(n).length>0&&f.push(O.object(n).passthrough()),f.push(...d),f.length===0)o=O.object({}).passthrough();else if(f.length===1)o=f[0];else{let p=O.intersection(f[0],f[1]);for(let m=2;m<f.length;m++)p=O.intersection(p,f[m]);o=p}break}let c=O.object(n);e.additionalProperties===!1?o=c.strict():typeof e.additionalProperties=="object"?o=c.catchall(Se(e.additionalProperties,t)):o=c.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let s=n.map(u=>Se(u,t)),c=i&&typeof i=="object"&&!Array.isArray(i)?Se(i,t):void 0;c?o=O.tuple(s).rest(c):o=O.tuple(s),typeof e.minItems=="number"&&(o=o.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(O.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(u=>Se(u,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?Se(e.additionalItems,t):void 0;c?o=O.tuple(s).rest(c):o=O.tuple(s),typeof e.minItems=="number"&&(o=o.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(O.maxLength(e.maxItems)))}else if(i!==void 0){let s=Se(i,t),c=O.array(s);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),o=c}else o=O.array(O.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}a(fk,"convertBaseSchema");function Se(e,t){if(typeof e=="boolean")return e?O.any():O.never();let r=fk(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>Se(l,t)),u=O.union(c);r=o?O.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>Se(l,t)),u=O.xor(c);r=o?O.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:O.any();else{let c=o?r:Se(e.allOf[0],t),u=o?0:1;for(let l=u;l<e.allOf.length;l++)c=O.intersection(c,Se(e.allOf[l],t));r=c}e.nullable===!0&&t.version==="openapi-3.0"&&(r=O.nullable(r)),e.readOnly===!0&&(r=O.readonly(r));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)c in e&&(n[c]=e[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))lT.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(r,n),r}a(Se,"convertSchema");function mk(e,t){if(typeof e=="boolean")return e?O.any():O.never();let r=dT(e,t?.defaultTarget),o=e.$defs||e.definitions||{},n={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??_e};return Se(e,n)}a(mk,"fromJSONSchema");var _g={};Pt(_g,{bigint:()=>hT,boolean:()=>gT,date:()=>yT,number:()=>mT,string:()=>fT});function fT(e){return Bp(lr,e)}a(fT,"string");function mT(e){return ef(pr,e)}a(mT,"number");function gT(e){return cf(fr,e)}a(gT,"boolean");function hT(e){return lf(mr,e)}a(hT,"bigint");function yT(e){return kf(No,e)}a(yT,"date");ce(ko());import vA from"ajv";import{McpServer as bA}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as wA}from"@modelcontextprotocol/sdk/server/stdio.js";import{resolve as ex}from"path";var Na={skills:ln.properties.skills.additionalProperties.properties.executor.enum,tools:ln.properties.tools.additionalProperties.properties.executor.enum},gk=a(e=>e.map(t=>`"${t}"`).join(" | "),"quoted"),Mo={publish:{feature:"Publish (single, by channel slug)",whenToUse:"Emit a domain event as a side effect of a business operation, after the state is durably stored.",snippet:`// after the order is saved to your DB:
|
|
298
299
|
await np.events.publish("orders", { id: order.id, symbol: order.symbol, qty: order.qty }, {
|
|
299
300
|
routingKey: "trade.order.placed",
|
|
300
301
|
});`,notes:"The facade resolves the channel slug to its id. Publish is server side; never publish from a browser."},idempotentPublish:{feature:"Idempotent publish",whenToUse:"Avoid duplicates when a publish may be retried (network retries, at-least-once upstream).",snippet:`const channelGid = (await np.events.channels.getBySlug({ slug: "orders" })).gid;
|
|
@@ -349,7 +350,7 @@ const entries = await np.events.dlq.listBySubscription({ subscriptionGid });
|
|
|
349
350
|
await np.events.dlq.reprocess({ dlqEntryGid: entries[0].gid }); // once the endpoint recovers`},snapshots:{feature:"Snapshots (checkpoint + restore a consumer)",whenToUse:"Let a new worker restore to a known point instead of replaying from the start.",snippet:`// createSnapshot records the subscription's current position itself and answers the snapshot's gid (a string):
|
|
350
351
|
const snapshotGid = await np.events.snapshots.createSnapshot({ subscriptionGid, name: "checkpoint" });
|
|
351
352
|
await np.events.snapshots.seekToSnapshot({ snapshotGid });`,notes:"The request takes the subscription's gid, a name and optional metadata \u2014 never a position: the platform records the offset, the acknowledged mark and the pending count at the moment of the call. seekToSnapshot takes the gid createSnapshot answers."},privacy:{feature:"End to end / hybrid privacy",whenToUse:'Share private payloads the platform must not read. Declare the channel privacyMode "e2e" (payload opaque) or "hybrid" (metadata visible, payload encrypted).',snippet:`// the app encrypts before publishing; npayload relays the ciphertext and never reads it.
|
|
352
|
-
await np.events.publish("positions", { ciphertext: encrypt(position) });`,notes:"Server-side transforms (pipe filters) are not available on e2e channels \u2014 the platform cannot see the payload."},nppTransport:{feature:"NPP transport (the default binary
|
|
353
|
+
await np.events.publish("positions", { ciphertext: encrypt(position) });`,notes:"Server-side transforms (pipe filters) are not available on e2e channels \u2014 the platform cannot see the payload."},nppTransport:{feature:"NPP transport (the default binary wire)",whenToUse:"Lower-latency publish/consume over signed binary frames. The default; opt into HTTP only if you need it.",snippet:`const np = await NPayload.connect({ clientId, appId, baseUrl, transport: "npp", edgeUrl });
|
|
353
354
|
await np.events.publish("orders", payload); // rides the NPP wire; lands in the same store as HTTP`,notes:"Management operations (create/list/rotate) always ride the HTTP API; NPP carries the event data itself (publish/consume)."},transportChoice:{feature:"Choosing a transport (NPP vs HTTP) \u2014 the decision tree",whenToUse:"Decide ONCE per service, at connect(). Both transports publish to and consume from the SAME channels \u2014 the choice is about latency and environment, never about features.",snippet:`// 1. High-throughput / latency-sensitive event flow (trading, telemetry,
|
|
354
355
|
// realtime pipelines) \u2192 NPP. Signed binary frames, fastest acks.
|
|
355
356
|
const fast = await NPayload.connect({ clientId, appId, baseUrl, transport: "npp", edgeUrl });
|
|
@@ -370,16 +371,18 @@ eventTypes: {
|
|
|
370
371
|
},
|
|
371
372
|
},
|
|
372
373
|
|
|
373
|
-
// then:
|
|
374
|
+
// then: ${b("push")} \u2192 registers the schema version + regenerates npayload/_generated/events.d.ts
|
|
374
375
|
import type { EventPayloads } from "./npayload/_generated/events";
|
|
375
376
|
const tick: EventPayloads["market.price.tick"] = { symbol: "BTC-USD", price: 64000 };
|
|
376
377
|
await np.events.publish("prices", tick, { routingKey: "market.price.tick" });`,notes:"The generated file is stamped and regenerated on every push \u2014 never edit it by hand. A changed schema registers the NEXT catalogue version; an identical schema is a no-op."},permissionsAsCode:{feature:"Generated permissions (permissions.generated.ts)",whenToUse:"Understand what your app's credential can do. Every push regenerates npayload/permissions.generated.ts \u2014 the exact, least-privilege scope set projected from your declared topology.",snippet:`// npayload/permissions.generated.ts (GENERATED \u2014 never edit)
|
|
377
|
-
export const permissions = { scopes: ["channels:read", "channels:write", "messages:read", "messages:write", /* \u2026 */] };`,notes:"Scopes are per-object (channels:write, messages:read, \u2026) \u2014 never a blanket grant. To widen access, declare the feature in events.config.ts and push; the file (and the credential's authorization) follows the topology. If an operation fails with a scope error, check this file first, then `
|
|
378
|
+
export const permissions = { scopes: ["channels:read", "channels:write", "messages:read", "messages:write", /* \u2026 */] };`,notes:"Scopes are per-object (channels:write, messages:read, \u2026) \u2014 never a blanket grant. To widen access, declare the feature in events.config.ts and push; the file (and the credential's authorization) follows the topology. If an operation fails with a scope error, check this file first, then `"+b("validate")+"` for drift."}},hk={decisionGuide:{channelType:"topic = fan-out to all subscribers (order lifecycle, alerts). queue = each message handled once across workers, with ack/retry (settlement, jobs, the outbox). stream = ordered, replayable log (the trade tape, analytics, event sourcing). compacted (retentionMode) = latest value per key wins (a live price book, current config) \u2014 also usable as a key/value store.",delivery:"Push delivery = a webhook subscription (the platform POSTs signed events to your URL). Pull delivery = a queue subscription (your worker pulls with receiveMessages, the outbox pattern). Choose push for low-latency reactions, pull for controlled throughput + at-least-once with explicit ack.",privacy:"standard = platform can read the payload (default; enables server-side transforms). hybrid = metadata visible, payload encrypted. e2e = payload opaque to the platform (you encrypt before publishing)."},core:["publish (single, batch, groups-FIFO, priority, scheduled, idempotency, TTL, attributes)","channels (topic, queue, stream, compacted)","queue consume / outbox (receive, delete/ack, visibility)","subscriptions (webhook + HMAC, filter, pause/resume, secret rotation, retry, DLQ)","streams (read from offset, commit/resume, replay)","consumer groups (competing/sticky/broadcast, join/leave)","dead letter queue (stats, list, reprocess)","event catalogue (register type, version, compatibility)","exchanges (direct/topic/fanout/headers, bindings, dry run)","key/value (compacted set/get/history)","snapshots (checkpoint, restore)","privacy modes (standard / hybrid / e2e)","transports (NPP default + HTTP)"],notDeclarable:["external connectors / adapters (Kafka, SQS, EventBridge, SNS, Azure, GCP)","cross-workspace channels + geo-replication","bring-your-own-key (BYOK) encryption"]},yk=`npayload Pipes config-as-code. Write npayload/pipes.config.ts that default-exports
|
|
378
379
|
definePipesConfig({...}). Resources are keyed by name (the map key):
|
|
379
380
|
|
|
380
|
-
- workflows: an automation. Provide a "definition" (
|
|
381
|
-
nodes reference connectors) and a "triggerConfig" { type: "
|
|
382
|
-
"
|
|
381
|
+
- workflows: an automation. Provide a "definition" ("nodes" + "edges";
|
|
382
|
+
nodes reference connectors) and a "triggerConfig" { type: "manual" | "schedule", config }:
|
|
383
|
+
"manual" runs on a call (np.pipes.executions.triggerExecution), "schedule" on its { cron }.
|
|
384
|
+
Turning on a pipe that starts on an event is refused today; start it by a call or on a schedule.
|
|
385
|
+
Config "update" changes name/description
|
|
383
386
|
only \u2014 the node graph is versioned and edited in the editor, not via config.
|
|
384
387
|
A config-declared workflow is created as a DRAFT (activate it in the dashboard,
|
|
385
388
|
via the CLI, or with pipes_create's activate flag for imperative builds); a
|
|
@@ -394,30 +397,32 @@ definePipesConfig({...}). Resources are keyed by name (the map key):
|
|
|
394
397
|
admin" note (manage it in the dashboard).
|
|
395
398
|
|
|
396
399
|
Loop: write pipes.config.ts, call pipes_validate (omit the arg to validate the file
|
|
397
|
-
on disk), then pipes_deploy (use check:true first to preview). Reconciles
|
|
398
|
-
|
|
400
|
+
on disk), then pipes_deploy (use check:true first to preview). Reconciles keyed by
|
|
401
|
+
name, like Events (idempotent: re-deploy = no-op).`,vk={decisionGuide:{workflow:"A workflow is a node graph + a trigger. triggerConfig.type: manual (run by a call), schedule (cron). Turning on a pipe that starts on an event is refused today; start it by a call or on a schedule. A webhook or form trigger is refused.",credentials:"Connectors need auth. Declare a credential by NAME with its connectorId and an auth object whose secret is a vault reference (vaultSecretId) \u2014 never a plaintext key; store the secret from the dashboard and reference its id."},core:["workflows (create/list, update name+description, activate/pause/archive)","credentials (vault-backed; secret declared by reference, never plaintext)","connectors (200+ built-in; referenced by workflow nodes, not declared)","governance (mode + allow/block lists; a SINGLETON object, ADMIN-GATED \u2014 an org admin applies it; a machine credential gets a clear 'needs admin' note)"],notDeclarable:["workflow definition (node-graph) edits via config \u2014 use the editor; config update is name/description only","executions / runs / logs / DLQ \u2014 runtime state, not declarable"]},bk=`npayload Primus (AI agents) config-as-code. Write npayload/primus.config.ts that
|
|
399
402
|
default-exports definePrimusConfig({...}). Resources are keyed by name (the map key):
|
|
400
403
|
|
|
401
404
|
- agents: an autonomous worker. "systemPrompt" is required; description/personality/
|
|
402
405
|
language optional. "skills" takes the NAMES of skills declared in this config \u2014
|
|
403
406
|
resolved to their ids at deploy (skills reconcile first). The binding is applied
|
|
404
|
-
at CREATE; re-wire an existing agent imperatively (
|
|
405
|
-
- skills: a reusable capability. description + "executor" (${
|
|
407
|
+
at CREATE; re-wire an existing agent imperatively (\`${b("primus agents assign-skill")}\`).
|
|
408
|
+
- skills: a reusable capability. description + "executor" (${gk(Na.skills)})
|
|
406
409
|
+ a "definition" { systemPrompt }.
|
|
407
410
|
- tools: an action an agent/skill can call. description + "riskLevel" ("safe" |
|
|
408
|
-
"moderate" | "dangerous") + "executor" (${
|
|
411
|
+
"moderate" | "dangerous") + "executor" (${gk(Na.tools)}).
|
|
409
412
|
An "inline" executor needs no endpoint; a "webhook" executor requires an https endpoint.
|
|
410
413
|
Tool/skill names: lowercase + underscores, NO hyphens.
|
|
411
|
-
- triggers:
|
|
412
|
-
"type" ("event" | "cron" | "webhook" | "message"), "config"
|
|
414
|
+
- triggers: start an agent. "agentGid" is an AGENT's name from above (resolved to its id),
|
|
415
|
+
"type" ("event" | "cron" | "webhook" | "message"), "config", "action" { goal }. Not yet: no
|
|
416
|
+
event of yours reaches a trigger of type "event"; to run an agent on an event, send the event
|
|
417
|
+
to your own route with a webhook subscription and call np.primus.agents.run there.
|
|
413
418
|
|
|
414
419
|
Loop: write primus.config.ts, call primus_validate, then primus_deploy (check:true first).
|
|
415
|
-
|
|
420
|
+
Keyed by name (idempotent: re-deploy = no-op).`,wk={decisionGuide:{executor:`inline = runs in the agent process (simple transforms/lookups); webhook = your own https endpoint; every other executor (${Na.skills.filter(e=>e!=="inline"&&e!=="webhook").join(", ")}) = a sandboxed runtime npayload manages \u2014 the schema primus_contract serves lists the exact set.`,risk:"tools.riskLevel: safe (no approval) | moderate | dangerous (approval-gated). Tool/skill names are lowercase + underscores."},core:["agents (create/list/update, name-keyed)",`skills (create/list/update; executors: ${Na.skills.join("/")})`,"tools (create/list/update; vault-backed webhook secrets)","triggers (cron/webhook/message; a trigger of type event is accepted and no event of yours reaches it; parent agent referenced by name via agentGid)"],notDeclarable:["conversations / executions / memories / approvals / kill-switch / audit \u2014 runtime, not declarable","teams / brainConfig (LLM provider): not declarable in config"]};var Fo={updateProfile:{feature:"Set the app's Connect profile (visibility + what it offers)",whenToUse:"Make an app discoverable in Explore and declare which event types it offers cross-org. The profile is the app's one declarative Connect setting.",snippet:`await np.connect.connect.updateAppProfile({
|
|
416
421
|
appId,
|
|
417
422
|
connectVisibility: "listed", // public | listed | unlisted | private
|
|
418
423
|
connectDescription: "Real-time trade signals",
|
|
419
424
|
publishedEventTypes: ["signal.generated", "alert.risk_breach"],
|
|
420
|
-
});`,notes:"INTERNAL-type apps are refused (they are org-private). publishedEventTypes reference eventTypes you declared in events.config.ts.
|
|
425
|
+
});`,notes:"INTERNAL-type apps are refused (they are org-private). publishedEventTypes reference eventTypes you declared in events.config.ts."},exploreApps:{feature:"Discover apps to subscribe to (Explore)",whenToUse:"Find publishers in other orgs that expose event types you want to consume.",snippet:`const { items } = await np.connect.connectExplore.searchExploreApps({ query: "trading" }); // { items, nextCursor?, hasMore }
|
|
421
426
|
// or list/page: np.connect.connectExplore.listExploreApps({})
|
|
422
427
|
// or one app: np.connect.connectExplore.getExploreApp({ appId: publisherAppId })`,notes:"Only public/listed apps in OTHER orgs appear; your own org's apps and INTERNAL apps are excluded."},requestAccess:{feature:"Request cross-org access (subscriber side)",whenToUse:"Ask a publisher app in another org for access to specific event types. Opens a pending grant the publisher must approve.",snippet:`const grant = await np.connect.connect.requestAccess({
|
|
423
428
|
subscriberAppId: appId, // your app asking for access
|
|
@@ -431,7 +436,7 @@ Same edge=>admin=>primus path, keyed by name (idempotent).`,Mw={decisionGuide:{e
|
|
|
431
436
|
});
|
|
432
437
|
// or decline: np.connect.connect.rejectAccess({ grantId, reason })`,notes:"Only the publisher org can approve/reject. After approval, fan-out to the subscriber is authorized by the grant."},listGrants:{feature:"List / inspect your grants",whenToUse:"See inbound and outbound grants, their status, and usage; revoke when no longer needed.",snippet:`const { items } = await np.connect.connectAccess.listMyGrants({}); // { items, nextCursor?, hasMore }
|
|
433
438
|
// one grant: np.connect.connectAccess.getGrant({ grantGid })
|
|
434
|
-
// revoke: np.connect.connect.revokeGrant({ grantId })`,notes:"
|
|
439
|
+
// revoke: np.connect.connect.revokeGrant({ grantId })`,notes:"A read of one grant takes its grantGid; a revoke takes its grantId."},createBridge:{feature:"Identity Bridge (cross-platform entity mapping)",whenToUse:"When two orgs name the same real entity differently (Shopify customer_123 vs HubSpot contact_XYZ). A bilateral, consent-based bridge lets events translate IDs across the boundary.",snippet:`const { gid } = await np.connect.connect.createBridge({
|
|
435
440
|
targetOrgGID, // the other business's org GID
|
|
436
441
|
entityTypeSlug: "customer",
|
|
437
442
|
});
|
|
@@ -443,7 +448,12 @@ await np.connect.connect.confirmBridge({ gid });`,notes:"Starts pending (confirm
|
|
|
443
448
|
redirectUri: "https://app.example.com/connect/done", // optional
|
|
444
449
|
});
|
|
445
450
|
// challenge carries the consent URL + expiry; revoke later:
|
|
446
|
-
// np.connect.connect.revokeTenantApproval({ approvalId })`,notes:"Caller must be the SUBSCRIBER org on an ACTIVE grant; an existing active approval is a CONFLICT. Read state via np.connect.connectTenantApproval.listTenantApprovals({ grantGid })."}},qw={decisionGuide:{visibility:"public = listed + profile visible to all. listed = appears in Explore. unlisted = reachable by direct link only. private = not discoverable (default). INTERNAL-type apps can never be made discoverable \u2014 they are org-private by design.",accessVsBridge:"Access GRANT = subscribe to another org's event types (the core cross-org handshake: request -> approve). Identity BRIDGE = translate entity IDs across two orgs that name the same entity differently (needed only for cross-platform ID mapping). Most integrations need only a grant; add a bridge when the two sides use different IDs for the same customer/order.",tenantConsent:"Plain grant = org-to-org. Tenant approval = a platform app proving an individual tenant (store/business) consented \u2014 required before per-tenant events may flow on that grant."},core:["profile (connectVisibility, connectDescription, publishedEventTypes, platformSlug)","explore (search / list / get discoverable apps in other orgs)","access grants (request -> approve/reject, rate-limit, expiry, list, revoke)","identity bridges (create -> bilateral confirm, suspend, archive, list)","tenant approvals (initiate consent challenge, revoke, list)","partner governance (freeze / reinstate / delist apps on your platformSlug) \u2014 connect:admin"],notDeclarable:["the profile (managed through the np.connect.* SDK calls, not declared in connect.config.ts)","exchanges / AMQP routing across orgs"]};var jo="1.2.0",Fw="https://api.npayload.com/schemas/pipes/pipe-definition.schema.json";var Zw="execution_output",Gw="execution_input",Vw={condition:["true","false"],loop:["loop-body","done"],"error-handler":["success","error"],retry:["success","exhausted"],parallel:["branch-1","branch-2","branch-3"]},Bw="switch",fr="default",ug=["manual","schedule","event","freshness","belief","surprise","dependency"],Lo=[{type:"manual",requiredAnyOf:[[]],keys:["inputData"],summary:"A manual trigger needs no key is needed."},{type:"schedule",requiredAnyOf:[["cron"]],keys:["cron","timezone"],summary:'A schedule trigger needs `cron` (a cron expression such as "0 9 * * 1").'},{type:"event",requiredAnyOf:[["channel"],["eventType"],["feedSubscription"]],keys:["channel","eventType","feedSubscription","debounceSeconds"],summary:'A event trigger needs `channel` (the channel it listens on, a slug or a gid) or `feedSubscription` (a feed your organization bought), and `eventType` (the event type it fires on, such as "order.created").'},{type:"freshness",requiredAnyOf:[["source","watermarkColumn","cron"],["source","channel","eventType"]],keys:["source","watermarkColumn","cron","channel","eventType","debounceSeconds"],summary:"A freshness trigger needs `source` (a source of the pipe) and either `watermarkColumn` with `cron` (every 5 minutes or slower) or the `channel` and `eventType` your system announces a change on."},{type:"belief",requiredAnyOf:[["series","field","crosses","direction"],["series","field","minDelta"]],keys:["series","field","crosses","direction","minDelta","subject"],summary:'A belief trigger needs `series`, `field` (a JSON path into its envelope) and either `crosses` with `direction` (up, down or either) or `minDelta` (a number, or a percent such as "10%").'},{type:"surprise",requiredAnyOf:[["series","errorField","maxError"]],keys:["series","errorField","maxError","subject"],summary:"A surprise trigger needs `series`, `errorField` (the JSON path of the prediction error your pipe computes) and `maxError` (a number, 0 or more)."},{type:"dependency",requiredAnyOf:[["pipes","when"]],keys:["pipes","when"],summary:"A dependency trigger needs `pipes` (one or more pipes of this application environment) and `when` (any or all)."}];var Jw=["condition","switch","loop","filter","merge","setVariable","delay","transform","http","log","ai","classify","generate","extract","summarize","agent"],Kw="condition: Routes on a true/false test (handles: true, false). switch: Routes to one of its cases (handles: each case, default). loop: Runs its body for each item (handles: loop-body, done). filter: Keeps the items that pass a test. merge: Joins the outputs of several branches. setVariable: Sets a pipe variable. delay: Waits before the next step. transform: Reshapes data (config.input, config.mapping). http: Calls an HTTP endpoint (config.url, config.method). log: Writes a line to the run log (config.message). ai: An AI step (config.prompt). classify: An AI classification step (config.prompt). generate: An AI generation step (config.prompt). extract: An AI extraction step (config.prompt). summarize: An AI summary step (config.prompt). agent: An AI agent step.",Ww="study",Hw="A Study step: a study reads your sources where they live (each a credential of this application), runs your SQL or dlt pipeline over them, writes rows only to the write-backs you declare, and returns one envelope of at most 64 KiB that meets your envelope schema. npayload keeps the envelope and the study record, never your rows.",dg=["sources","spec","writeBacks","envelopeSchema","budget","series"],Ea=["sources","spec","envelopeSchema","budget"],pg=["handle","kind","table","cursorField","tenantColumn"],Ta=["handle","kind"],mg="sources[].tenantColumn",fg="The column of this source that holds the tenant's key. An application with tenants names it on every source: a study runs for one tenant and reads that tenant's rows only.",Yw="connector",Aa="{ actionId, params }";var Qw="npayload://pipes/authoring-flow",gg="npayload://pipes/definition-schema",Xw="pipes_author";var Uo='npayload Pipes: how to author a pipe (pipe definition schema 1.2.0, https://api.npayload.com/schemas/pipes/pipe-definition.schema.json).\n\nFollow these steps in this order. Every fact below is generated from the pipe definition schema and its v1 connector catalogue; the schema itself is the MCP resource npayload://pipes/definition-schema.\n\n1. Discover the connectors. Call pipes_catalog. It returns your organization\'s live connector catalogue: every connector, every action, and each action\'s inputSchema and outputSchema. The v1 catalogue: condition (evaluate); delay (wait, waitUntil); error-handler (its own settings in config, no action); events (publish, get); http (request, get, post); log (log, inspect, passthrough); loop (its own settings in config, no action); noop (passthrough); parallel (fork, join, map, race); primus-agent (execute_agent, search_memory, store_memory, list_skills, check_approval); retry (its own settings in config, no action); switch (evaluate); transform (map, filter, reduce, merge, pick, omit, parse, format, flatten, group, sort). Never write a connector id or an action id from memory.\n\n2. Read their input schemas. For each connector step you plan, read that action\'s inputSchema in the pipes_catalog result. Its params go in data.config.params, typed by that inputSchema, and only there; a param value may be a template such as {{trigger.amount}}, resolved at run time.\n\n3. Draft the definition. Call pipes_build with a spec of nodes and edges; it writes node.type, the handles and the layout for you and returns { definition, triggerConfig }.\n - Exactly one trigger node, the entry (no edge leads into it). Its type and config become the trigger config:\n - manual: A manual trigger needs no key is needed.\n - schedule: A schedule trigger needs `cron` (a cron expression such as "0 9 * * 1").\n - event: A event trigger needs `channel` (the channel it listens on, a slug or a gid) or `feedSubscription` (a feed your organization bought), and `eventType` (the event type it fires on, such as "order.created").\n - freshness: A freshness trigger needs `source` (a source of the pipe) and either `watermarkColumn` with `cron` (every 5 minutes or slower) or the `channel` and `eventType` your system announces a change on.\n - belief: A belief trigger needs `series`, `field` (a JSON path into its envelope) and either `crosses` with `direction` (up, down or either) or `minDelta` (a number, or a percent such as "10%").\n - surprise: A surprise trigger needs `series`, `errorField` (the JSON path of the prediction error your pipe computes) and `maxError` (a number, 0 or more).\n - dependency: A dependency trigger needs `pipes` (one or more pipes of this application environment) and `when` (any or all).\n - A built-in step: nodeType one of condition, switch, loop, filter, merge, setVariable, delay, transform, http, log, ai, classify, generate, extract, summarize, agent; its settings are read flat from config.\n - A connector step: nodeType "connector", connectorId from the catalogue, config { actionId, params }, and credentials { <connectorId>: <credential gid> } when the connector signs in.\n - A Study step: nodeType "study", its settings directly under config (sources, spec, envelopeSchema, budget; also writeBacks, series), never under params. Each source carries handle, kind (also table, cursorField, tenantColumn); sources[].tenantColumn: The column of this source that holds the tenant\'s key. An application with tenants names it on every source: a study runs for one tenant and reads that tenant\'s rows only. A Study step: a study reads your sources where they live (each a credential of this application), runs your SQL or dlt pipeline over them, writes rows only to the write-backs you declare, and returns one envelope of at most 64 KiB that meets your envelope schema. npayload keeps the envelope and the study record, never your rows.\n - A step with branches is left by a named branch: condition true|false \xB7 loop loop-body|done \xB7 error-handler success|error \xB7 retry success|exhausted \xB7 parallel branch-1|branch-2|branch-3 \xB7 switch <each case>|default. Any other step is left by execution_output.\n\n4. Validate it. Call pipes_validate_definition with the definition and the trigger config. It applies every check the create door applies and writes nothing: { valid: true } or every reason the door would refuse.\n\n5. Create the pipe. Call pipes_create with the same spec. The door validates again before it writes anything. Pass activate: true to publish it at once; where your organization\'s Pipes settings ask for a review, activation answers REVIEW_REQUIRED and a person publishes it.\n\n6. Run it. Call pipes_run with the workflow id (the pipe must be active). It returns the execution id.\n\n7. Inspect the run. Call pipes_get_execution with the execution id until its status is completed, failed or cancelled; each step\'s run carries its status, its output and its error.\n\n8. Iterate on the reasons returned. A refused definition answers PIPE_DEFINITION_INVALID with every reason: its path, what was expected there, what was got, and didYouMean when an id is mistyped. Fix each reason at its path and go back to step 4; a failed run\'s step errors send you back to step 2 or 3.',ex={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://api.npayload.com/schemas/pipes/pipe-definition.schema.json",title:"npayload pipe definition",description:"A pipe as the Pipes engine runs it: the definition (nodes and edges) and the trigger config. Each node is typed by data.nodeType, the type the engine runs; a connector node names its connector (data.connectorId), its action (data.config.actionId) and its params (data.config.params), typed by the action's input schema. A params value may be a template such as {{trigger.amount}}, resolved at run time.","x-schema-version":"1.2.0","x-generated-from":"the Pipes v1 node contract and connector catalogue (condition, delay, error-handler, events, http, log, loop, noop, parallel, primus-agent, retry, switch, transform)","x-linear-handle":"execution_output","x-target-handle":"execution_input","x-branch-handles":{condition:["true","false"],loop:["loop-body","done"],"error-handler":["success","error"],retry:["success","exhausted"],parallel:["branch-1","branch-2","branch-3"],switch:["<each case: its branch, name or id>","default"],decide:["<each of its intents, by its name>","execution_output"]},type:"object",required:["definition","triggerConfig"],properties:{name:{type:"string",description:"The pipe's name."},description:{type:"string"},definition:{type:"object",required:["nodes","edges"],additionalProperties:!1,properties:{nodes:{type:"array",items:{type:"object",required:["id","type","position","data"],properties:{id:{type:"string",minLength:1},type:{type:"string",description:"The canvas category the dashboard draws the node as: trigger, logic or action. The engine runs data.nodeType."},position:{type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"}},description:"Where the node sits on the dashboard canvas."},data:{oneOf:[{type:"object",title:"trigger node",required:["nodeType"],properties:{nodeType:{enum:["trigger","manual","schedule","event","freshness","belief","surprise","dependency"]},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object"}},description:"The pipe's entry. At most one per pipe; no edge leads into it."},{type:"object",title:"built-in node",required:["nodeType"],not:{required:["connectorId"]},properties:{nodeType:{enum:["condition","switch","loop","filter","merge","setVariable","delay","transform","http","log","ai","classify","generate","extract","summarize","agent"]},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The node's settings, read flat from data.config (e.g. log reads config.message)."}},description:"condition: Routes on a true/false test (handles: true, false). switch: Routes to one of its cases (handles: each case, default). loop: Runs its body for each item (handles: loop-body, done). filter: Keeps the items that pass a test. merge: Joins the outputs of several branches. setVariable: Sets a pipe variable. delay: Waits before the next step. transform: Reshapes data (config.input, config.mapping). http: Calls an HTTP endpoint (config.url, config.method). log: Writes a line to the run log (config.message). ai: An AI step (config.prompt). classify: An AI classification step (config.prompt). generate: An AI generation step (config.prompt). extract: An AI extraction step (config.prompt). summarize: An AI summary step (config.prompt). agent: An AI agent step."},{type:"object",title:"decide node",description:"Decides by ordered rules over the series, trigger fields and run time it names; escalates to its agent only when a matching rule says so (handles: each intent, by its name). An intent is an action (its bare name) or a series write ({ name, series }).",required:["nodeType","config"],properties:{nodeType:{const:"decide"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",required:["intents","rules","default"],if:{required:["intents"],properties:{intents:{contains:{type:"object",required:["series"]}}}},then:{required:["envelopeSchema"]},properties:{series:{type:"array",description:"The envelope series the step reads, the latest version of each (a rule reads series.<name>.envelope.<path> or series.<name>.version). Naming a series here declares it, so an intent of the pipe may write it.",items:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"},subject:{type:"string"}}}},inputs:{type:"array",description:"The trigger fields the step reads (a rule reads trigger.<field>). A field not named here is never an input.",items:{type:"string",minLength:1}},intents:{type:"array",minItems:1,items:{oneOf:[{type:"string",minLength:1,description:"An action, by its bare name: the steps after the decide step carry it out (the Act executor); it writes no version of any series."},{type:"object",required:["name","series"],additionalProperties:!1,properties:{name:{type:"string",minLength:1,description:"The intent's name: its branch leaves by it, and rules and the default name the intent by it."},series:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",description:"The envelope series the intent writes: each decision that decides it adds the decision record to the series as its next version. A step of this pipe must name the series in its own series setting (a decide step's series read, or a Study step's series)."}},description:"A series write: the intent's name and the envelope series it writes."}]},description:"Every intent the step may decide; its branches leave by their names. An action is its bare name; a series write is { name, series } and needs the step's envelopeSchema."},envelopeSchema:{type:"object",description:"The JSON Schema the step's decision record must meet before it is added to the series its intents write. Required when an intent is a series write { name, series }.",required:["type"],properties:{type:{const:"object"}}},rules:{type:"array",description:"Checked in order; the first rule whose condition holds decides (run.time is the time of the run).",items:{type:"object",required:["field","operator"],additionalProperties:!1,properties:{id:{type:"string",minLength:1},field:{type:"string",minLength:1,description:"series.<name>.envelope.<path>, series.<name>.version, trigger.<field> or run.time."},operator:{enum:["eq","equals","neq","notEquals","gt","greaterThan","gte","greaterThanOrEquals","lt","lessThan","lte","lessThanOrEquals","contains","notContains","startsWith","endsWith","matches","exists","isEmpty","isNotEmpty","isNull","isNotNull","isTrue","isFalse"]},value:{},intents:{type:"array",items:{type:"string",minLength:1},minItems:1},escalate:{type:"boolean",description:"true: the step's agent decides (under its budget), never a model on the rule path."}},anyOf:[{required:["intents"]},{required:["escalate"],properties:{escalate:{const:!0}}}]}},default:{type:"object",required:["intents"],additionalProperties:!1,properties:{intents:{type:"array",items:{type:"string",minLength:1}}},description:"The intents of a run no rule matches."},escalation:{type:"object",required:["agentId","budget"],additionalProperties:!1,properties:{agentId:{type:"string",minLength:1,description:"The Primus agent that decides an escalation."},budget:{type:"object",required:["maxTokens","maxCostUsd","maxDurationMs"],additionalProperties:!1,properties:{maxTokens:{type:"number",exclusiveMinimum:0},maxCostUsd:{type:"number",exclusiveMinimum:0},maxDurationMs:{type:"number",exclusiveMinimum:0}},description:"The step's ceilings, capped by your organization's Primus policy."},fallback:{enum:["default"],description:`"default": a failed or over-budget escalation takes the default's intents. Absent: the run fails with the reason.`}}}}}}},{type:"object",title:"chart node",description:"A chart of an envelope series this pipe writes, drawn from its versions.",required:["nodeType","config"],properties:{nodeType:{const:"chart"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",required:["series","kind","lines","x","y"],additionalProperties:!1,properties:{series:{type:"string",minLength:1,description:"An envelope series a step of this pipe writes."},subject:{type:"string"},kind:{enum:["line","bar","area","scatter","stat","table"]},lines:{type:"array",minItems:1,items:{type:"object",required:["path","label"],additionalProperties:!1,properties:{path:{type:"string",pattern:"^\\$(\\.[A-Za-z_][A-Za-z0-9_-]*|\\[[0-9]+\\])+$",description:"A JSON path into the envelope, such as $.score."},label:{type:"string",minLength:1}}}},x:{type:"object",required:["source"],additionalProperties:!1,properties:{source:{enum:["time","version","field"],description:"time: when the version was made; version: its number; field: an envelope field (path)."},path:{type:"string",pattern:"^\\$(\\.[A-Za-z_][A-Za-z0-9_-]*|\\[[0-9]+\\])+$"}}},y:{type:"object",required:["unit","scale"],additionalProperties:!1,properties:{unit:{type:"string",minLength:1},scale:{enum:["linear","log"]}}},window:{type:"integer",minimum:1,description:"The newest versions to draw (a chart over time); absent: the latest version."}}}}},{type:"object",title:"connector condition",description:"Evaluate conditions and branch workflow execution",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"condition"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this condition node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["params"],additionalProperties:!1,properties:{actionId:{const:"evaluate",description:"Evaluate Condition"},params:{type:"object",properties:{condition:{oneOf:[{type:"object",properties:{field:{type:"string",description:"Field to evaluate"},operator:{type:"string",enum:["equals","notEquals","greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","contains","notContains","startsWith","endsWith","matches","isEmpty","isNotEmpty","isNull","isNotNull","isTrue","isFalse"],description:"Comparison operator"},value:{description:"Value to compare against"}},required:["field","operator"]},{type:"object",properties:{logic:{type:"string",enum:["and","or"]},conditions:{type:"array",items:{type:"object"}}},required:["logic","conditions"]}]},data:{type:"object",description:"Data object to evaluate conditions against"}},required:["condition"]}},description:"Evaluate a condition or group of conditions"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector delay",description:"Wait for a specified duration or until a specific time",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"delay"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this delay node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"wait",description:"Wait"},params:{type:"object",properties:{duration:{type:"number",description:"Duration to wait in milliseconds",minimum:0,maximum:3e5},durationSeconds:{type:"number",description:"Duration to wait in seconds",minimum:0,maximum:300},durationMinutes:{type:"number",description:"Duration to wait in minutes",minimum:0,maximum:5}}}},description:"Wait for a specified duration"},{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"waitUntil",description:"Wait Until"},params:{type:"object",properties:{timestamp:{type:"number",description:"Unix timestamp (milliseconds) to wait until"},datetime:{type:"string",description:"ISO 8601 datetime string to wait until",format:"date-time"},maxWait:{type:"number",description:"Maximum wait time in milliseconds (default: 300000 = 5 min)",default:3e5}}}},description:"Wait until a specific time"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector error-handler",description:"Try/catch/finally error handling for workflows",required:["nodeType","connectorId"],properties:{nodeType:{const:"connector"},connectorId:{const:"error-handler"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The error-handler node's own settings; the engine's runner reads them itself (no action)."},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector events",description:"Read or publish npayload Events messages \u2014 the pipe's SENSE (events.get) and ACT (events.publish). Org-scoped: you can only touch your own channels and messages.",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"events"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this events node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"publish",description:"Publish to channel"},params:{type:"object",properties:{channel:{type:"string",description:`Target channel \u2014 its slug (e.g. "fulfillment") or gid. MUST belong to your org; the cell rejects any other tenant's channel.`},payload:{type:"object",description:"The message body to publish. Omit to forward the trigger event's data unchanged (republish).",additionalProperties:!0},eventType:{type:"string",description:'Optional event type label recorded on the message metadata (e.g. "order.fulfilled").'},idempotencyKey:{type:"string",description:"Optional idempotency key \u2014 a duplicate publish collapses to the first message."}},required:["channel"],additionalProperties:!1}},description:"Publish a message to one of your Events channels (by slug or gid). Fans out to subscribers and can re-trigger other pipes via event triggers \u2014 closing the autonomy loop."},{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"get",description:"Get message"},params:{type:"object",properties:{messageGid:{type:"string",description:"The message gid to read. Defaults to the trigger event's messageGid, so an event-triggered pipe can omit it to load the event that fired it."}},additionalProperties:!1}},description:"Read an Events message by gid (the pipe's SENSE). An event-triggered pipe omits messageGid to load the very event that fired it \u2014 fan-out passes only the gid, so this is how a pipe gets the payload to ETL."}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector http",description:"Make HTTP requests to any REST API endpoint",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"http"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this http node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"request",description:"HTTP Request"},params:{type:"object",properties:{method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method",default:"GET"},url:{type:"string",description:"Request URL (must be HTTPS)",format:"uri"},headers:{type:"object",description:"Request headers",additionalProperties:{type:"string"}},queryParams:{type:"object",description:"Query parameters to append to URL",additionalProperties:{type:"string"}},body:{description:"Request body (for POST, PUT, PATCH)"},contentType:{type:"string",enum:["application/json","application/x-www-form-urlencoded","text/plain"],description:"Content type for request body",default:"application/json"},timeout:{type:"number",description:"Request timeout in milliseconds",default:3e4,minimum:1e3,maximum:6e4},followRedirects:{type:"boolean",description:"Whether to follow redirects",default:!0},validateStatus:{type:"boolean",description:"Throw error for non-2xx status codes",default:!0}},required:["url"]}},description:"Make a custom HTTP request"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"get",description:"GET Request"},params:{type:"object",properties:{url:{type:"string",description:"Request URL",format:"uri"},headers:{type:"object",description:"Request headers",additionalProperties:{type:"string"}},queryParams:{type:"object",description:"Query parameters",additionalProperties:{type:"string"}}},required:["url"]}},description:"Make a GET request"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"post",description:"POST Request"},params:{type:"object",properties:{url:{type:"string",description:"Request URL",format:"uri"},headers:{type:"object",description:"Request headers",additionalProperties:{type:"string"}},body:{type:"object",description:"Request body"}},required:["url"]}},description:"Make a POST request with JSON body"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector log",description:"Log data for debugging workflows",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"log"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this log node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"log",description:"Log Message"},params:{type:"object",properties:{message:{type:"string",description:"Log message"},level:{type:"string",enum:["debug","info","warn","error"],description:"Log level",default:"info"},data:{description:"Optional data to include in log"}},required:["message"]}},description:"Log a message with optional data"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"inspect",description:"Inspect Data"},params:{type:"object",properties:{data:{description:"Data to inspect"},label:{type:"string",description:"Optional label for the inspection"},maxDepth:{type:"number",description:"Maximum depth to inspect",default:3,minimum:1,maximum:10}},required:["data"]}},description:"Inspect and return data structure information"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"passthrough",description:"Passthrough"},params:{type:"object",properties:{data:{description:"Data to pass through"},log:{type:"boolean",description:"Whether to also log the data",default:!1}},required:["data"]}},description:"Pass data through unchanged (useful for debugging flow)"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector loop",description:"Iterate over arrays and ranges in workflows",required:["nodeType","connectorId"],properties:{nodeType:{const:"connector"},connectorId:{const:"loop"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The loop node's own settings; the engine's runner reads them itself (no action)."},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector noop",description:"Built-in passthrough connector. Returns input as output verbatim \u2014 Pass-state equivalent.",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"noop"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this noop node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",additionalProperties:!1,properties:{actionId:{const:"passthrough",description:"Passthrough"},params:{type:"object",description:"Arbitrary JSON object. The action returns this value verbatim.",additionalProperties:!0}},description:"Return the input unchanged."}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector parallel",description:"Execute multiple branches in parallel",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"parallel"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this parallel node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"fork",description:"Fork"},params:{type:"object",properties:{branches:{type:"array",description:"Names of branches to execute in parallel",items:{type:"string"},minItems:1},maxConcurrency:{type:"number",description:"Maximum branches to run concurrently (default: unlimited)",minimum:1},timeout:{type:"number",description:"Timeout for all branches in milliseconds",minimum:0},continueOnError:{type:"boolean",description:"Continue executing other branches if one fails",default:!1}},required:["branches"]}},description:"Start parallel execution of multiple branches"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"join",description:"Join"},params:{type:"object",properties:{results:{type:"object",description:"Results from parallel branches (branch name -> result)",additionalProperties:{}},waitFor:{type:"string",enum:["all","any","first"],description:"Wait strategy: all, any success, or first to complete",default:"all"},requiredBranches:{type:"array",description:"Branches that must succeed (optional)",items:{type:"string"}}},required:["results"]}},description:"Wait for and aggregate results from parallel branches"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"map",description:"Parallel Map"},params:{type:"object",properties:{items:{type:"array",description:"Items to process in parallel",items:{}},maxConcurrency:{type:"number",description:"Maximum parallel executions",minimum:1,default:10},continueOnError:{type:"boolean",description:"Continue processing other items if one fails",default:!0}},required:["items"]}},description:"Process array items in parallel (returns items for iteration)"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"race",description:"Race"},params:{type:"object",properties:{branches:{type:"array",description:"Names of branches to execute in parallel",items:{type:"string"},minItems:1},maxConcurrency:{type:"number",description:"Maximum branches to run concurrently (default: unlimited)",minimum:1},timeout:{type:"number",description:"Timeout for all branches in milliseconds",minimum:0},continueOnError:{type:"boolean",description:"Continue executing other branches if one fails",default:!1}},required:["branches"]}},description:"Execute branches and return first result"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector primus-agent",description:"Execute npayload Primus AI agents",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"primus-agent"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this primus-agent node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"execute_agent",description:"Execute Agent"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},goal:{type:"string",description:"What the agent should accomplish (mapped to Primus 'message' field)"},context:{type:"object",description:"Additional context \u2014 merged into Primus 'config'"},maxExecutionTime:{type:"number",description:"Max execution time in ms",default:3e4},testMode:{type:"boolean",description:"When true, sends X-Primus-Test-Mode: 1 so Primus returns an echo fixture instead of invoking the real LLM. Not for production.",default:!1}},required:["agentId","goal"]}},description:"Run a Primus agent with a goal and optional context"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"search_memory",description:"Search Memory"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},query:{type:"string",description:"Search query"},topK:{type:"number",default:5,description:"Number of results"}},required:["agentId","query"]}},description:"Search an agent's memory using hybrid RAG. Not available yet."},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"store_memory",description:"Store Memory"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},content:{type:"string",description:"Content to store"},type:{type:"string",enum:["episodic","semantic","procedural"],default:"semantic",description:"Memory type"},metadata:{type:"object",description:"Additional metadata"}},required:["agentId","content"]}},description:"Store content in an agent's memory. Not available yet."},{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"list_skills",description:"List Skills"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},category:{type:"string",description:"Filter by category"}}}},description:"List available skills for an agent. Not available yet."},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"check_approval",description:"Check Approval"},params:{type:"object",properties:{approvalId:{type:"string",description:"Approval request ID"}},required:["approvalId"]}},description:"Check the status of a pending approval request. Not available yet."}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector retry",description:"Retry operations with exponential backoff",required:["nodeType","connectorId"],properties:{nodeType:{const:"connector"},connectorId:{const:"retry"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The retry node's own settings; the engine's runner reads them itself (no action)."},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector switch",description:"Multi-way branching based on value matching",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"switch"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this switch node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["params"],additionalProperties:!1,properties:{actionId:{const:"evaluate",description:"Evaluate Switch"},params:{type:"object",properties:{value:{description:"Value to switch on"},cases:{type:"array",description:"Case definitions",items:{type:"object",properties:{match:{description:"Value(s) to match",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{}}]},name:{type:"string",description:"Branch name for this case"},output:{description:"Optional output data for this case"}},required:["match","name"]}},default:{type:"object",description:"Default case if no match",properties:{name:{type:"string"},output:{}}},strict:{type:"boolean",description:"Use strict equality (===) for comparison",default:!0}},required:["value","cases"]}},description:"Match value against cases and determine branch"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector transform",description:"Data transformation and manipulation",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"transform"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this transform node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"map",description:"Map"},params:{type:"object",properties:{input:{description:"Input data to transform"},mapping:{type:"object",description:"Mapping of output field -> input path or expression",additionalProperties:{type:"string"}}},required:["input","mapping"]}},description:"Map/transform data using field mappings"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"filter",description:"Filter"},params:{type:"object",properties:{items:{type:"array",description:"Array to filter",items:{}},condition:{type:"object",description:"Filter condition",properties:{field:{type:"string"},operator:{type:"string"},value:{}},required:["field","operator"]}},required:["items","condition"]}},description:"Filter array items based on condition"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"reduce",description:"Reduce"},params:{type:"object",properties:{items:{type:"array",description:"Array to reduce",items:{}},operation:{type:"string",enum:["sum","count","min","max","avg","first","last","concat","unique"],description:"Reduction operation"},field:{type:"string",description:"Field to operate on (for objects)"},initialValue:{description:"Initial value for reduction"}},required:["items","operation"]}},description:"Reduce array to single value"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"merge",description:"Merge"},params:{type:"object",properties:{objects:{type:"array",description:"Objects to merge",items:{type:"object"}},strategy:{type:"string",enum:["shallow","deep","replace"],description:"Merge strategy",default:"shallow"}},required:["objects"]}},description:"Merge multiple objects into one"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"pick",description:"Pick"},params:{type:"object",properties:{input:{type:"object"},fields:{type:"array",items:{type:"string"}}},required:["input","fields"]}},description:"Pick specific fields from object"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"omit",description:"Omit"},params:{type:"object",properties:{input:{type:"object"},fields:{type:"array",items:{type:"string"}}},required:["input","fields"]}},description:"Omit specific fields from object"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"parse",description:"Parse"},params:{type:"object",properties:{input:{type:"string",description:"String to parse"},format:{type:"string",enum:["json","csv","querystring","number","boolean","date"],description:"Format to parse"},options:{type:"object",description:"Format-specific options"}},required:["input","format"]}},description:"Parse string into structured data"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"format",description:"Format"},params:{type:"object",properties:{input:{description:"Data to format"},format:{type:"string",enum:["json","csv","querystring","string","number","date"],description:"Output format"},options:{type:"object",description:"Format-specific options"}},required:["input","format"]}},description:"Format data into string"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"flatten",description:"Flatten"},params:{type:"object",properties:{input:{},depth:{type:"number",default:1},separator:{type:"string",default:"."}},required:["input"]}},description:"Flatten nested object or array"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"group",description:"Group"},params:{type:"object",properties:{items:{type:"array",items:{type:"object"}},by:{type:"string",description:"Field to group by"}},required:["items","by"]}},description:"Group array items by field"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"sort",description:"Sort"},params:{type:"object",properties:{items:{type:"array"},by:{type:"string",description:"Field to sort by"},direction:{type:"string",enum:["asc","desc"],default:"asc"}},required:["items"]}},description:"Sort array items"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"Study step",description:"A Study step: a study reads your sources where they live (each a credential of this application), runs your SQL or dlt pipeline over them, writes rows only to the write-backs you declare, and returns one envelope of at most 64 KiB that meets your envelope schema. npayload keeps the envelope and the study record, never your rows.",required:["nodeType","config"],properties:{nodeType:{const:"study"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The Study step's settings: its sources, its spec, its write-backs, its envelope schema, its budget, and the envelope series it adds to.",required:["sources","spec","envelopeSchema","budget"],additionalProperties:!1,properties:{sources:{type:"array",minItems:1,description:"What the study reads, where it lives, read only. Never a secret: each source is a credential handle.",items:{type:"object",required:["handle","kind"],additionalProperties:!1,properties:{handle:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",description:"A credential of this application (Pipes, Credentials), by its gid; the study reads it under this name."},kind:{type:"string",description:"The kind of the source, one the study image built at commit 6d8c2ae750b11f52858ca2dbdbcd10b5aecd78e2 carries: delta, duckdb, excel, gcs, google_sheets, iceberg, mysql, postgres, r2, rest_api, s3, sqlite.","x-source-kinds":["delta","duckdb","excel","gcs","google_sheets","iceberg","mysql","postgres","r2","rest_api","s3","sqlite"],enum:["delta","duckdb","excel","gcs","google_sheets","iceberg","mysql","postgres","r2","rest_api","s3","sqlite"]},table:{type:"string",minLength:1,description:"The table the study reads first (optional)."},cursorField:{type:"string",minLength:1,description:"The column an incremental study reads from its stored cursor."},tenantColumn:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]{0,127}$",description:"The column of this source that holds the tenant's key. An application with tenants names it on every source: a study runs for one tenant and reads that tenant's rows only."}}}},spec:{type:"object",description:"DuckDB SQL over the sources (each read as <handle>.<schema>.<table>), a dlt pipeline over them, or both. Named parameters ($name) are bound at run time, never spliced into the SQL; COPY ... TO 'writeback://<handle>/<path>' writes to a declared write-back.",anyOf:[{required:["sql"]},{required:["dlt"]}],additionalProperties:!1,properties:{sql:{type:"string",minLength:1},dlt:{type:"object",properties:{sources:{type:"array",items:{type:"string"},description:"The source handles the dlt pipeline reads."},destination:{type:"string",description:"The write-back handle the dlt pipeline loads into."}}},params:{type:"object",description:"The value of each named parameter.",additionalProperties:{type:["string","number","boolean","null"]}},dateRange:{type:"object",description:"The two parameters a date range binds: a start and an end. A backfill binds its window; an incremental study binds its stored cursor and the time of the run.",required:["start","end"],additionalProperties:!1,properties:{start:{type:"string",minLength:1},end:{type:"string",minLength:1}}}}},writeBacks:{type:"array",description:"Where the study may write rows: destinations you own, each a credential handle. A study writes to no store npayload controls.",items:{type:"object",required:["handle","kind"],additionalProperties:!1,properties:{handle:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",description:"A credential of this application (Pipes, Credentials), by its gid; the study reads it under this name."},kind:{enum:["dlt","file"],description:"dlt: a dlt destination (needs table). file: a file the study writes with COPY TO."},table:{type:"string",minLength:1},path:{type:"string",minLength:1},mode:{enum:["append","merge"]},primaryKey:{type:"string",minLength:1,description:"The key a merge write-back matches rows on."}}}},envelopeSchema:{type:"object",description:"The JSON Schema the study's one envelope must meet: findings, aggregates and derived values only, never rows, at most 65536 bytes (64 KiB).",required:["type"],properties:{type:{const:"object"}}},budget:{type:"object",description:"The study stops at the first limit it reaches (BUDGET_EXCEEDED, naming the limit) and moves no cursor.",required:["wallTimeMs","memoryTier","costCeiling"],additionalProperties:!1,properties:{wallTimeMs:{type:"integer",minimum:1e3,maximum:36e5},memoryTier:{enum:["small","medium","large","xlarge"]},costCeiling:{type:"object",required:["amountMicros","currency"],additionalProperties:!1,properties:{amountMicros:{type:"integer",minimum:1,description:"Millionths of a unit of the currency."},currency:{type:"string",pattern:"^[A-Z]{3}$",description:"Your organization's billing currency, such as USD."}}}}},series:{type:"object",description:"The envelope series each accepted envelope is added to as its next version.",required:["name"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"},subjectKey:{type:"string",minLength:1,maxLength:128}}}}}}},{type:"object",title:"node typed by node.type",not:{required:["nodeType"]},properties:{label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object"}},description:"No data.nodeType: the engine dispatches on node.type, which must then be a built-in node type."}]}},if:{properties:{data:{not:{required:["nodeType"]}}}},then:{properties:{type:{enum:["trigger","manual","schedule","event","freshness","belief","surprise","dependency","condition","switch","loop","filter","merge","setVariable","delay","transform","http","log","ai","classify","generate","extract","summarize","agent","decide","chart"]}}}}},edges:{type:"array",items:{type:"object",required:["id","source","target"],additionalProperties:!1,properties:{id:{type:"string",minLength:1},source:{type:"string",description:"The id of the node the edge leaves."},target:{type:"string",description:"The id of the node the edge enters (never the trigger)."},sourceHandle:{type:"string",description:`The branch the edge leaves by: "execution_output" for a step without branches, or one of the node's branches (x-branch-handles: condition true|false, switch each case|default, decide each of its intents by its name, loop loop-body|done, error-handler success|error, retry success|exhausted, parallel branch-1|branch-2|branch-3).`},targetHandle:{enum:["execution_input"]}}}},viewport:{type:"object",required:["x","y","zoom"],properties:{x:{type:"number"},y:{type:"number"},zoom:{type:"number"}}},maxDurationMs:{type:"integer",minimum:1,maximum:864e5,description:"The pipe's run time limit, in milliseconds. A run still going when its next step would start after this limit stops, failed with the error code TIMEOUT. From 1 to 86400000 (24 hours); 1 hour when absent."}}},triggerConfig:{description:"When the pipe runs. One of the trigger types, with the config keys it needs.",oneOf:[{type:"object",title:"manual trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"manual"},config:{type:"object",properties:{inputData:{type:"object"}},description:"A manual trigger needs no key is needed."}}},{type:"object",title:"schedule trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"schedule"},config:{type:"object",properties:{cron:{type:"string",minLength:1},timezone:{type:"string",minLength:1}},description:'A schedule trigger needs `cron` (a cron expression such as "0 9 * * 1").',required:["cron"]}}},{type:"object",title:"event trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"event"},config:{type:"object",properties:{channel:{type:"string",minLength:1},eventType:{type:"string",minLength:1},feedSubscription:{type:"string",minLength:1},debounceSeconds:{type:"integer",minimum:60}},description:'A event trigger needs `channel` (the channel it listens on, a slug or a gid) or `feedSubscription` (a feed your organization bought), and `eventType` (the event type it fires on, such as "order.created").',anyOf:[{required:["channel"]},{required:["eventType"]},{required:["feedSubscription"]}]}}},{type:"object",title:"freshness trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"freshness"},config:{type:"object",properties:{source:{type:"string",minLength:1},watermarkColumn:{type:"string",minLength:1},cron:{type:"string",minLength:1,description:"A cron expression no finer than every 5 minutes."},channel:{type:"string",minLength:1},eventType:{type:"string",minLength:1},debounceSeconds:{type:"integer",minimum:60}},description:"A freshness trigger needs `source` (a source of the pipe) and either `watermarkColumn` with `cron` (every 5 minutes or slower) or the `channel` and `eventType` your system announces a change on.",anyOf:[{required:["source","watermarkColumn","cron"]},{required:["source","channel","eventType"]}]}}},{type:"object",title:"belief trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"belief"},config:{type:"object",properties:{series:{type:"string",minLength:1},field:{type:"string",minLength:1},crosses:{type:"number"},direction:{enum:["up","down","either"]},minDelta:{oneOf:[{type:"number"},{type:"string",pattern:"^[0-9]+(\\.[0-9]+)?%$"}],description:'A number (an absolute change), or a percent such as "10%".'},subject:{type:"string",minLength:1}},description:'A belief trigger needs `series`, `field` (a JSON path into its envelope) and either `crosses` with `direction` (up, down or either) or `minDelta` (a number, or a percent such as "10%").',anyOf:[{required:["series","field","crosses","direction"]},{required:["series","field","minDelta"]}]}}},{type:"object",title:"surprise trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"surprise"},config:{type:"object",properties:{series:{type:"string",minLength:1},errorField:{type:"string",minLength:1},maxError:{type:"number",minimum:0},subject:{type:"string",minLength:1}},description:"A surprise trigger needs `series`, `errorField` (the JSON path of the prediction error your pipe computes) and `maxError` (a number, 0 or more).",required:["series","errorField","maxError"]}}},{type:"object",title:"dependency trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"dependency"},config:{type:"object",properties:{pipes:{type:"array",minItems:1,items:{type:"string",minLength:1}},when:{enum:["any","all"]}},description:"A dependency trigger needs `pipes` (one or more pipes of this application environment) and `when` (any or all).",required:["pipes","when"]}}}]}}};var lE=Zw,uE=Gw,Yt=Object.fromEntries(Object.entries(Vw).map(([e,t])=>[e,[...t]])),Qt=Bw,zo=ug,kt=Yw,gr=Ww,dE=new Set(["condition","switch","loop","filter","merge","setVariable","delay"]),Xt=Object.fromEntries([...ug.map(e=>[e,"trigger"]),...Jw.map(e=>[e,dE.has(e)?"logic":"action"])]),tx=Uo;function pE(e){return e.nodeType===kt?"action":Xt[e.nodeType]??"action"}a(pE,"backendTypeOf");function nx(e){return e.nodeType===kt?e.connectorId??kt:e.nodeType}a(nx,"brancherKey");function mE(e,t,r){let o=nx(e),n=o===Qt||o in Yt;if(!t){if(n){let s=o===Qt?[...r,fr]:Yt[o];throw new Error(`Node "${e.id}" (${o}) is a brancher \u2014 connect FROM one of its branches (${s.join(", ")||"define cases first"}) via { branch }, not a linear edge.`)}return lE}if(o===Qt){let s=[...r,fr];if(!s.includes(t))throw new Error(`switch branch "${t}" is not a configured case. Allowed: ${s.join(", ")} (cases come from config.cases, or config.params.cases on a switch connector step).`);return t}if(!n)throw new Error(`Node "${e.id}" (${o}) has no branches \u2014 use a linear edge (omit "branch").`);let i=Yt[o];if(!i.includes(t))throw new Error(`Branch "${t}" is invalid for "${o}". Allowed: ${i.join(", ")}.`);return t}a(mE,"resolveSourceHandle");function fE(e,t){let r=new Map;e.forEach(d=>r.set(d,0)),t.forEach(d=>r.set(d.to,(r.get(d.to)??0)+1));let o=new Map,n=e.filter(d=>(r.get(d)??0)===0);n.length===0&&e.length&&(n=[e[0]]),n.forEach(d=>o.set(d,0));let i=new Map;t.forEach(d=>i.set(d.from,[...i.get(d.from)??[],d.to]));let s=[...n],c=0;for(;s.length&&c++<1e4;){let d=s.shift(),m=o.get(d)??0;for(let p of i.get(d)??[]){let f=Math.max(o.get(p)??0,m+1);o.get(p)!==f&&(o.set(p,f),s.push(p))}}e.forEach(d=>{o.has(d)||o.set(d,0)});let l=new Map;e.forEach(d=>{let m=o.get(d);l.set(m,[...l.get(m)??[],d])});let u={};for(let[d,m]of l)m.forEach((p,f)=>{u[p]={x:80+d*320,y:120+f*180}});return u}a(fE,"layout");function hg(e){if(!e?.nodes?.length)throw new Error("A pipe needs at least one node.");let t=new Set;for(let l of e.nodes){if(!l.id)throw new Error("Every node needs an id.");if(!l.nodeType)throw new Error(`Node "${l.id}" needs a nodeType (a built-in like "condition"/"log", or "connector" with a connectorId \u2014 see pipes_catalog).`);if(l.nodeType===kt&&!l.connectorId)throw new Error(`Node "${l.id}" has nodeType "connector" but no connectorId \u2014 set connectorId to a connector from pipes_catalog (e.g. "events").`);if(l.nodeType!==kt&&l.connectorId)throw new Error(`Node "${l.id}" sets connectorId "${l.connectorId}" but nodeType is "${l.nodeType}" \u2014 a connector node MUST use nodeType "connector". For a built-in node, drop connectorId.`);if(l.nodeType!==kt&&l.nodeType!==gr&&!(l.nodeType in Xt))throw new Error(`Node "${l.id}" has nodeType "${l.nodeType}", which is not authorable in v1. Use a built-in (${Object.keys(Xt).join(", ")}), the Study step ("${gr}"), or nodeType "connector" with a connectorId from pipes_catalog.`);if(t.has(l.id))throw new Error(`Duplicate node id "${l.id}".`);t.add(l.id)}let r=e.edges??[];for(let l of r){if(!t.has(l.from))throw new Error(`Edge.from "${l.from}" is not a node id.`);if(!t.has(l.to))throw new Error(`Edge.to "${l.to}" is not a node id.`)}let o=fE(e.nodes.map(l=>l.id),r),n=new Map(e.nodes.map(l=>[l.id,l])),i=new Map;for(let l of e.nodes)nx(l)===Qt&&i.set(l.id,hE(l));let s=e.nodes.map(l=>({id:l.id,type:pE(l),position:o[l.id]??{x:80,y:120},data:{nodeType:l.nodeType,label:l.label??l.id,config:l.config??{},...l.connectorId?{connectorId:l.connectorId}:{},...l.credentials&&Object.keys(l.credentials).length?{credentials:l.credentials}:{}}})),c=r.map(l=>{let u=n.get(l.from),d=mE(u,l.branch,i.get(l.from)??[]);return{id:`edge-${l.from}-${l.to}-${d}`,source:l.from,target:l.to,sourceHandle:d,targetHandle:uE}});return{nodes:s,edges:c}}a(hg,"buildPipeDefinition");function gE(e){return e.nodes.find(t=>zo.includes(t.nodeType))}a(gE,"triggerNodeOf");function yg(e,t){let r=gE(e);return r?{type:r.nodeType,config:r.config??{}}:{type:t?.type??"manual",config:t?.config??{}}}a(yg,"triggerConfigOf");function hE(e){let t=e.config??{},r=t.params&&typeof t.params=="object"?t.params:{},o=Array.isArray(r.cases)?r.cases:Array.isArray(t.cases)?t.cases:[],n=[];for(let i of o){if(!i||typeof i!="object")continue;let s=i,c=[s.branch,s.name,s.id].find(l=>typeof l=="string"&&l.length>0);c&&n.push(c)}return n}a(hE,"switchCaseNames");function rx(e){let t=new Map;for(let r of e){let o=String(r.id??r.connectorId??r._id??"");if(!o)continue;let n=new Map;for(let s of r.actions??[]){let c=String(s.id??s.actionId??"");c&&n.set(c,{actionId:c,inputSchema:s.inputSchema??void 0})}let i=r.auth?.type;t.set(o,{actions:n,needsCredential:!!i&&i!=="none"})}return{connectors:t}}a(rx,"indexConnectorCatalog");function yE(e,t){let r=e.length,o=t.length;if(Math.abs(r-o)>3)return 99;let n=Array.from({length:r+1},(i,s)=>[s,...new Array(o).fill(0)]);for(let i=0;i<=o;i++)n[0][i]=i;for(let i=1;i<=r;i++)for(let s=1;s<=o;s++)n[i][s]=Math.min(n[i-1][s]+1,n[i][s-1]+1,n[i-1][s-1]+(e[i-1]===t[s-1]?0:1));return n[r][o]}a(yE,"editDistance");function Ca(e,t){let r=e.toLowerCase();return t.map(n=>{let i=n.toLowerCase(),s=i.includes(r)||r.includes(i)?0:yE(r,i);return{c:n,score:s}}).filter(n=>n.score<=3).sort((n,i)=>n.score-i.score).slice(0,3).map(n=>n.c)}a(Ca,"suggestIds");function vg(e,t,r){let o=[],n=[],i=Object.keys(Xt);for(let[l,u]of(e.nodes??[]).entries())if(u.nodeType===kt){let d=u.config??{},m=Object.keys(d).filter(g=>g!=="actionId"&&g!=="params");if(("actionId"in d||"params"in d||(t?.connectors.get(u.connectorId??"")?.actions.size??0)>0)&&m.length&&o.push(`Node "${u.id}" (connector "${u.connectorId}"): its params go under config.params (definition.nodes[${l}].data.config.params, where the engine reads them), but ${m.map(g=>`"${g}"`).join(", ")} sit flat in config. Write config ${Aa}: { actionId: "${String(d.actionId??"<action>")}", params: { ${m.join(", ")} } }.`),!t)continue;let f=u.connectorId?t.connectors.get(u.connectorId):void 0;if(!f){let g=[...t.connectors.keys()],v=u.connectorId?Ca(u.connectorId,g):[];o.push(`Node "${u.id}": connector "${u.connectorId}" does NOT exist in this deployment`+(v.length?` \u2014 did you mean ${v.map(h=>`"${h}"`).join(" / ")}?`:"")+` Call pipes_catalog for the ${g.length} available connectors; never guess a connectorId.`);continue}if(f.actions.size>0){let g=u.config?.actionId;if(!g)o.push(`Node "${u.id}" (connector "${u.connectorId}"): config.actionId is required (definition.nodes[${l}].data.config.actionId) \u2014 one of: ${[...f.actions.keys()].join(", ")}.`);else if(f.actions.has(g)){if(r){let v=f.actions.get(g).inputSchema;if(v&&typeof v=="object"){let h=d.params??{},x=r(v,h);for(let E of x)o.push(`Node "${u.id}" (${u.connectorId}.${g}): params ${E} (definition.nodes[${l}].data.config.params) \u2014 the schema is in pipes_catalog under this action's inputSchema.`)}}}else{let v=Ca(g,[...f.actions.keys()]);o.push(`Node "${u.id}": action "${g}" does not exist on connector "${u.connectorId}"`+(v.length?` \u2014 did you mean ${v.map(h=>`"${h}"`).join(" / ")}?`:"")+` Valid actions: ${[...f.actions.keys()].join(", ")}.`)}}f.needsCredential&&n.push(`Node "${u.id}" (connector "${u.connectorId}") requires a CREDENTIAL \u2014 configure one for this connector (dashboard \u2192 Pipes \u2192 Credentials) or the node fails at run time with an auth error.`)}else if(u.nodeType!==gr&&!i.includes(u.nodeType)){let d=Ca(u.nodeType,i),m=t?Ca(u.nodeType,[...t.connectors.keys()]):[];o.push(`Node "${u.id}": "${u.nodeType}" is not a built-in node type`+(d.length?` \u2014 did you mean ${d.map(p=>`"${p}"`).join(" / ")}?`:"")+(m.length?` If you meant the "${m[0]}" integration, use nodeType "connector" with connectorId "${m[0]}".`:' For an integration, use nodeType "connector" + a connectorId from pipes_catalog.')+` Built-ins: ${i.join(", ")}.`)}let s=(e.nodes??[]).filter(l=>zo.includes(l.nodeType)),c=e.edges??[];if(s.length===0)n.push("No trigger node \u2014 the workflow gets triggerType 'manual' by default. Add ONE trigger node (manual|schedule|event) as the entry for an explicit trigger.");else if(s.length>1)o.push(`${s.length} trigger nodes (${s.map(l=>`"${l.id}"`).join(", ")}) \u2014 a workflow has exactly ONE trigger. Keep one; downstream steps hang off it.`);else{let l=s[0];if(c.some(u=>u.to===l.id)&&o.push(`Trigger node "${l.id}" has an INCOMING edge \u2014 the trigger is the entry; nothing routes into it.`),e.nodes.length>1){let u=new Set([l.id]),d=!0;for(;d;){d=!1;for(let p of c)u.has(p.from)&&!u.has(p.to)&&(u.add(p.to),d=!0)}let m=e.nodes.filter(p=>!u.has(p.id));m.length&&o.push(`Node(s) ${m.map(p=>`"${p.id}"`).join(", ")} are not reachable from the trigger "${l.id}" \u2014 they will never execute and render disconnected. Wire them with edges (or remove them).`)}}return{ok:o.length===0,issues:o,warnings:n}}a(vg,"validateSpecAgainstCatalog");function Ra(e){return e.key.split(".")[0]??"other"}a(Ra,"productOf");var bg=[];function ox(e){let t=new Set(we.commands.map(o=>o.key)),r=new Set;bg=e.filter(o=>t.has(o.key)||r.has(o.key)?!1:(r.add(o.key),!0))}a(ox,"setCatalogExtraRows");function Oa(){return bg.length===0?[...we.commands]:[...we.commands,...bg]}a(Oa,"catalogRows");function vE(e){return{key:e.key,method:e.method,path:e.pattern,summary:e.summary,isQuery:e.isQuery,idempotent:e.idempotent,scopes:e.scopes,pathParams:e.pathParams.map(t=>({name:t.name,segment:t.key})),args:e.flags.map(t=>({name:t.name,type:t.coerce??"string",required:!t.optional}))}}a(vE,"toCatalogOp");var bE=["events.appDpopKeys.","keys.appDpopKeys."],wE=["credentials.connectors.","pipes.connectors.","pipes.connectorCredentials."],xE=new Set(["events.adapters.createAdapter","events.subscriptions.create","events.subscriptions.revealSecret","events.subscriptions.rotateSecret","events.subscriptions.subscribe","events.subscriptions.update","events.systemEvents.rotateSecret","events.systemEvents.subscribe","events.systemEvents.unsubscribe","webhooks.webhooks.create","webhooks.webhooks.revealSecret","webhooks.webhooks.revoke","webhooks.webhooks.rotateSecret","pipes.webhooks.rotateWebhookSecret","pipes.workflows.updateWorkflow","pipes.governance.revokeConnectorApproval","primus.brainConfig.storeProviderKey","primus.brainConfig.deleteConfig","primus.brainConfig.configure","primus.integrations.connect","primus.integrations.disconnect","primus.integrations.refresh","primus.mcpConnect.beginConnect","primus.mcpConnect.revokeConnection","primus.mcpOauth.beginOauth","primus.mcpOauth.setPreregisteredClient","primus.mcpServers.connect","primus.mcpServers.rotateAuth","primus.mcpServers.test","primus.tenants.suspend","primus.tenants.archive","primus.tools.create","primus.tools.update","primus.tools.importFromOpenApi","primus.triggers.create","primus.triggers.rotateSecret","primus.webhooks.create","primus.configPromotion.applyConfigBundle","billing.connectAccounts.createAccountSession","billing.feedListings.subscribeToListing","billing.feedListings.subscribeToListingWithSavedCard","billing.subscriptions.confirmSubscriptionPayment","billing.subscriptions.createSetupIntent","billing.subscriptions.createSubscription","embed.sessions.create","embed.sessions.revoke","tenants.actAs.actAs","tenants.tenants.close","tenants.tenants.suspend","account.environments.clone","connect.connect.revokeGrant","connect.connect.revokeTenantApproval","connect.publishGrants.revoke","feed.publishers.revokePublisher","connect.connect.partnerOverrideTenantApproval","connect.identityBridges.archiveBridge","connect.connect.partnerDelistApp"]);function kE(e){return e.isQuery?!1:xE.has(e.key)||wE.some(t=>e.key.startsWith(t))}a(kE,"requiresConfirmation");function wg(e){return bE.some(t=>e.startsWith(t))}a(wg,"catalogDenied");function ix(e){let t=e?.trim().toLowerCase()||void 0,r=new Map;for(let n of Oa()){if(wg(n.key))continue;let i=Ra(n);if(t&&i!==t)continue;r.has(i)||r.set(i,[]);let s=vE(n);kE(n)&&(s.summary=`${s.summary} [CREDENTIAL OP \u2014 always confirm with the user before invoking]`),r.get(i).push(s)}let o=[...r.entries()].map(([n,i])=>({product:n,ops:i.sort((s,c)=>s.key.localeCompare(c.key))})).sort((n,i)=>n.product.localeCompare(i.product));return{contentHash:we.contentHash,generatedAt:we.generatedAt,products:o,totalOps:o.reduce((n,i)=>n+i.ops.length,0)}}a(ix,"buildCatalog");function Na(){return[...new Set(Oa().filter(e=>!wg(e.key)).map(e=>Ra(e)))].sort()}a(Na,"listProducts");function sx(e){return Oa().find(t=>t.key===e)}a(sx,"findOp");var Sn=class extends Error{static{a(this,"UnknownOpError")}suggestions;constructor(t,r){super(`unknown op key "${t}". Call npayload_catalog to discover valid keys`+(r.length?`. Did you mean: ${r.join(", ")}?`:".")),this.name="UnknownOpError",this.suggestions=r}};function ax(e,t=5){let r=e.split(".");return Oa().map(o=>{let n=o.key.split("."),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return{key:o.key,shared:i}}).filter(o=>o.shared>0).sort((o,n)=>n.shared-o.shared||o.key.localeCompare(n.key)).slice(0,t).map(o=>o.key)}a(ax,"suggestKeys");function _t(e){let t=sx(e);if(!t)throw new Sn(e,ax(e));return{method:t.method==="HEAD"?"GET":t.method,path:Sh(t.pattern)}}a(_t,"contractRouteFor");async function cx(e,t,r){if(wg(e))throw new Sn(e,[]);let o=sx(e);if(!o)throw new Sn(e,ax(e));let n={...t??{}},i=[];for(let l of o.pathParams){let u=n[l.name];if(delete n[l.name],(u==null||u==="")&&l.name==="appId"){let d=await r.resolveAppId();if(!d)throw new Y(`${e} needs a path param "${l.name}" and it could not be resolved from the token \u2014 pass { "${l.name}": "app_\u2026" }.`);u=d}if(u==null||u==="")throw new Y(`${e} requires path param "${l.name}" (URL segment :${l.key}).`);i.push(typeof u=="object"?JSON.stringify(u):String(u))}let s={};for(let[l,u]of Object.entries(n))if(u!=null){if(l==="idempotencyKey"||l==="idempotency-key"){s["idempotency-key"]=String(u);continue}s[l]=typeof u=="object"?JSON.stringify(u):String(u)}let c=lt({row:o,positionals:i,flags:s,newIdempotencyKey:r.newIdempotencyKey});return{row:o,request:c}}a(cx,"composeInvoke");async function ux(e,t){if(t)return t;let{token:r}=await e.auth.getAccessToken([]),o=JSON.parse(Buffer.from(r.split(".")[1]??"","base64url").toString("utf8"));return o["npayload/appId"]??o.appId??o.app}a(ux,"resolveAppIdFromToken");var PE=`npayload Events config-as-code. Write a npayload/events.config.ts that default-exports
|
|
451
|
+
// np.connect.connect.revokeTenantApproval({ approvalId })`,notes:"Caller must be the SUBSCRIBER org on an ACTIVE grant; an existing active approval is a CONFLICT. Read state via np.connect.connectTenantApproval.listTenantApprovals({ grantGid })."}},kk={decisionGuide:{visibility:"public = listed + profile visible to all. listed = appears in Explore. unlisted = reachable by direct link only. private = not discoverable (default). INTERNAL-type apps can never be made discoverable \u2014 they are org-private by design.",accessVsBridge:"Access GRANT = subscribe to another org's event types (the core cross-org handshake: request -> approve). Identity BRIDGE = translate entity IDs across two orgs that name the same entity differently (needed only for cross-platform ID mapping). Most integrations need only a grant; add a bridge when the two sides use different IDs for the same customer/order.",tenantConsent:"Plain grant = org-to-org. Tenant approval = a platform app proving an individual tenant (store/business) consented \u2014 required before per-tenant events may flow on that grant."},core:["profile (connectVisibility, connectDescription, publishedEventTypes, platformSlug)","explore (search / list / get discoverable apps in other orgs)","access grants (request -> approve/reject, rate-limit, expiry, list, revoke)","identity bridges (create -> bilateral confirm, suspend, archive, list)","tenant approvals (initiate consent challenge, revoke, list)","partner governance (freeze / reinstate / delist apps on your platformSlug) \u2014 connect:admin"],notDeclarable:["the profile (managed through the np.connect.* SDK calls, not declared in connect.config.ts)","exchanges / AMQP routing across orgs"]};var qo="1.2.0",xk="https://api.npayload.com/schemas/pipes/pipe-definition.schema.json";var _k="execution_output",$k="execution_input",Sk={condition:["true","false"],loop:["loop-body","done"],"error-handler":["success","error"],retry:["success","exhausted"],parallel:["branch-1","branch-2","branch-3"]},Ik="switch",In="default",$g=["manual","schedule","event","freshness","belief","surprise","dependency"],Zo=[{type:"manual",requiredAnyOf:[[]],keys:["inputData"],summary:"A manual trigger needs no key is needed."},{type:"schedule",requiredAnyOf:[["cron"]],keys:["cron","timezone"],summary:'A schedule trigger needs `cron` (a cron expression such as "0 9 * * 1").'},{type:"event",requiredAnyOf:[["channel"],["eventType"],["feedSubscription"]],keys:["channel","eventType","feedSubscription","debounceSeconds"],summary:'A event trigger needs `channel` (the channel it listens on, a slug or a gid) or `feedSubscription` (a feed your organization bought), and `eventType` (the event type it fires on, such as "order.created").'},{type:"freshness",requiredAnyOf:[["source","watermarkColumn","cron"],["source","channel","eventType"]],keys:["source","watermarkColumn","cron","channel","eventType","debounceSeconds"],summary:"A freshness trigger needs `source` (a source of the pipe) and either `watermarkColumn` with `cron` (every 5 minutes or slower) or the `channel` and `eventType` your system announces a change on."},{type:"belief",requiredAnyOf:[["series","field","crosses","direction"],["series","field","minDelta"]],keys:["series","field","crosses","direction","minDelta","subject"],summary:'A belief trigger needs `series`, `field` (a JSON path into its envelope) and either `crosses` with `direction` (up, down or either) or `minDelta` (a number, or a percent such as "10%").'},{type:"surprise",requiredAnyOf:[["series","errorField","maxError"]],keys:["series","errorField","maxError","subject"],summary:"A surprise trigger needs `series`, `errorField` (the JSON path of the prediction error your pipe computes) and `maxError` (a number, 0 or more)."},{type:"dependency",requiredAnyOf:[["pipes","when"]],keys:["pipes","when"],summary:"A dependency trigger needs `pipes` (one or more pipes of this application environment) and `when` (any or all)."}];var Pk=["condition","switch","loop","filter","merge","setVariable","delay","transform","http","log","ai","classify","generate","extract","summarize","agent"],Ek="condition: Routes on a true/false test (handles: true, false). switch: Routes to one of its cases (handles: each case, default). loop: Runs its body for each item (handles: loop-body, done). filter: Keeps the items that pass a test. merge: Joins the outputs of several branches. setVariable: Sets a pipe variable. delay: Waits before the next step. transform: Reshapes data (config.input, config.mapping). http: Calls an HTTP endpoint (config.url, config.method). log: Writes a line to the run log (config.message). ai: An AI step (config.prompt). classify: An AI classification step (config.prompt). generate: An AI generation step (config.prompt). extract: An AI extraction step (config.prompt). summarize: An AI summary step (config.prompt). agent: An AI agent step.",Tk="study",Ak="A Study step: a study reads your sources where they live (each a credential of this application), runs your SQL or dlt pipeline over them, writes rows only to the write-backs you declare, and returns one envelope of at most 64 KiB that meets your envelope schema. npayload keeps the envelope and the study record, never your rows.",Sg=["sources","spec","writeBacks","envelopeSchema","budget","series"],Da=["sources","spec","envelopeSchema","budget"],Ig=["handle","kind","table","cursorField","tenantColumn"],ja=["handle","kind"],Pg="sources[].tenantColumn",Eg="The column of this source that holds the tenant's key. An application with tenants names it on every source: a study runs for one tenant and reads that tenant's rows only.",Ck="connector",Ua="{ actionId, params }";var Rk="npayload://pipes/authoring-flow",Tg="npayload://pipes/definition-schema",Ok="pipes_author";var Go='npayload Pipes: how to author a pipe (pipe definition schema 1.2.0, https://api.npayload.com/schemas/pipes/pipe-definition.schema.json).\n\nFollow these steps in this order. Every fact below is generated from the pipe definition schema and its v1 connector catalogue; the schema itself is the MCP resource npayload://pipes/definition-schema.\n\n1. Discover the connectors. Call pipes_catalog. It returns your organization\'s live connector catalogue: every connector, every action, and each action\'s inputSchema and outputSchema. The v1 catalogue: condition (evaluate); delay (wait, waitUntil); error-handler (its own settings in config, no action); events (publish, get); http (request, get, post); log (log, inspect, passthrough); loop (its own settings in config, no action); noop (passthrough); parallel (fork, join, map, race); primus-agent (execute_agent, search_memory, store_memory, list_skills, check_approval); retry (its own settings in config, no action); switch (evaluate); transform (map, filter, reduce, merge, pick, omit, parse, format, flatten, group, sort). Never write a connector id or an action id from memory.\n\n2. Read their input schemas. For each connector step you plan, read that action\'s inputSchema in the pipes_catalog result. Its params go in data.config.params, typed by that inputSchema, and only there; a param value may be a template such as {{trigger.amount}}, resolved at run time.\n\n3. Draft the definition. Call pipes_build with a spec of nodes and edges; it writes node.type, the handles and the layout for you and returns { definition, triggerConfig }.\n - Exactly one trigger node, the entry (no edge leads into it). Its type and config become the trigger config:\n - manual: A manual trigger needs no key is needed.\n - schedule: A schedule trigger needs `cron` (a cron expression such as "0 9 * * 1").\n - event: A event trigger needs `channel` (the channel it listens on, a slug or a gid) or `feedSubscription` (a feed your organization bought), and `eventType` (the event type it fires on, such as "order.created").\n - freshness: A freshness trigger needs `source` (a source of the pipe) and either `watermarkColumn` with `cron` (every 5 minutes or slower) or the `channel` and `eventType` your system announces a change on.\n - belief: A belief trigger needs `series`, `field` (a JSON path into its envelope) and either `crosses` with `direction` (up, down or either) or `minDelta` (a number, or a percent such as "10%").\n - surprise: A surprise trigger needs `series`, `errorField` (the JSON path of the prediction error your pipe computes) and `maxError` (a number, 0 or more).\n - dependency: A dependency trigger needs `pipes` (one or more pipes of this application environment) and `when` (any or all).\n - A built-in step: nodeType one of condition, switch, loop, filter, merge, setVariable, delay, transform, http, log, ai, classify, generate, extract, summarize, agent; its settings are read flat from config.\n - A connector step: nodeType "connector", connectorId from the catalogue, config { actionId, params }, and credentials { <connectorId>: <credential gid> } when the connector signs in.\n - A Study step: nodeType "study", its settings directly under config (sources, spec, envelopeSchema, budget; also writeBacks, series), never under params. Each source carries handle, kind (also table, cursorField, tenantColumn); sources[].tenantColumn: The column of this source that holds the tenant\'s key. An application with tenants names it on every source: a study runs for one tenant and reads that tenant\'s rows only. A Study step: a study reads your sources where they live (each a credential of this application), runs your SQL or dlt pipeline over them, writes rows only to the write-backs you declare, and returns one envelope of at most 64 KiB that meets your envelope schema. npayload keeps the envelope and the study record, never your rows.\n - A step with branches is left by a named branch: condition true|false \xB7 loop loop-body|done \xB7 error-handler success|error \xB7 retry success|exhausted \xB7 parallel branch-1|branch-2|branch-3 \xB7 switch <each case>|default. Any other step is left by execution_output.\n\n4. Validate it. Call pipes_validate_definition with the definition and the trigger config. It applies every check the create door applies and writes nothing: { valid: true } or every reason the door would refuse.\n\n5. Create the pipe. Call pipes_create with the same spec. The door validates again before it writes anything. Pass activate: true to publish it at once; where your organization\'s Pipes settings ask for a review, activation answers REVIEW_REQUIRED and a person publishes it.\n\n6. Run it. Call pipes_run with the workflow id (the pipe must be active). It returns the execution id.\n\n7. Inspect the run. Call pipes_get_execution with the execution id until its status is completed, failed or cancelled; each step\'s run carries its status, its output and its error.\n\n8. Iterate on the reasons returned. A refused definition answers PIPE_DEFINITION_INVALID with every reason: its path, what was expected there, what was got, and didYouMean when an id is mistyped. Fix each reason at its path and go back to step 4; a failed run\'s step errors send you back to step 2 or 3.',Nk={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://api.npayload.com/schemas/pipes/pipe-definition.schema.json",title:"npayload pipe definition",description:"A pipe as the Pipes engine runs it: the definition (nodes and edges) and the trigger config. Each node is typed by data.nodeType, the type the engine runs; a connector node names its connector (data.connectorId), its action (data.config.actionId) and its params (data.config.params), typed by the action's input schema. A params value may be a template such as {{trigger.amount}}, resolved at run time.","x-schema-version":"1.2.0","x-generated-from":"the Pipes v1 node contract and connector catalogue (condition, delay, error-handler, events, http, log, loop, noop, parallel, primus-agent, retry, switch, transform)","x-linear-handle":"execution_output","x-target-handle":"execution_input","x-branch-handles":{condition:["true","false"],loop:["loop-body","done"],"error-handler":["success","error"],retry:["success","exhausted"],parallel:["branch-1","branch-2","branch-3"],switch:["<each case: its branch, name or id>","default"],decide:["<each of its intents, by its name>","execution_output"]},type:"object",required:["definition","triggerConfig"],properties:{name:{type:"string",description:"The pipe's name."},description:{type:"string"},definition:{type:"object",required:["nodes","edges"],additionalProperties:!1,properties:{nodes:{type:"array",items:{type:"object",required:["id","type","position","data"],properties:{id:{type:"string",minLength:1},type:{type:"string",description:"The canvas category the dashboard draws the node as: trigger, logic or action. The engine runs data.nodeType."},position:{type:"object",required:["x","y"],properties:{x:{type:"number"},y:{type:"number"}},description:"Where the node sits on the dashboard canvas."},data:{oneOf:[{type:"object",title:"trigger node",required:["nodeType"],properties:{nodeType:{enum:["trigger","manual","schedule","event","freshness","belief","surprise","dependency"]},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object"}},description:"The pipe's entry. At most one per pipe; no edge leads into it."},{type:"object",title:"built-in node",required:["nodeType"],not:{required:["connectorId"]},properties:{nodeType:{enum:["condition","switch","loop","filter","merge","setVariable","delay","transform","http","log","ai","classify","generate","extract","summarize","agent"]},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The node's settings, read flat from data.config (e.g. log reads config.message)."}},description:"condition: Routes on a true/false test (handles: true, false). switch: Routes to one of its cases (handles: each case, default). loop: Runs its body for each item (handles: loop-body, done). filter: Keeps the items that pass a test. merge: Joins the outputs of several branches. setVariable: Sets a pipe variable. delay: Waits before the next step. transform: Reshapes data (config.input, config.mapping). http: Calls an HTTP endpoint (config.url, config.method). log: Writes a line to the run log (config.message). ai: An AI step (config.prompt). classify: An AI classification step (config.prompt). generate: An AI generation step (config.prompt). extract: An AI extraction step (config.prompt). summarize: An AI summary step (config.prompt). agent: An AI agent step."},{type:"object",title:"decide node",description:"Decides by ordered rules over the series, trigger fields and run time it names; escalates to its agent only when a matching rule says so (handles: each intent, by its name). An intent is an action (its bare name) or a series write ({ name, series }).",required:["nodeType","config"],properties:{nodeType:{const:"decide"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",required:["intents","rules","default"],if:{required:["intents"],properties:{intents:{contains:{type:"object",required:["series"]}}}},then:{required:["envelopeSchema"]},properties:{series:{type:"array",description:"The envelope series the step reads, the latest version of each (a rule reads series.<name>.envelope.<path> or series.<name>.version). Naming a series here declares it, so an intent of the pipe may write it.",items:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"},subject:{type:"string"}}}},inputs:{type:"array",description:"The trigger fields the step reads (a rule reads trigger.<field>). A field not named here is never an input.",items:{type:"string",minLength:1}},intents:{type:"array",minItems:1,items:{oneOf:[{type:"string",minLength:1,description:"An action, by its bare name: the steps after the decide step carry it out (the Act executor); it writes no version of any series."},{type:"object",required:["name","series"],additionalProperties:!1,properties:{name:{type:"string",minLength:1,description:"The intent's name: its branch leaves by it, and rules and the default name the intent by it."},series:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",description:"The envelope series the intent writes: each decision that decides it adds the decision record to the series as its next version. A step of this pipe must name the series in its own series setting (a decide step's series read, or a Study step's series)."}},description:"A series write: the intent's name and the envelope series it writes."}]},description:"Every intent the step may decide; its branches leave by their names. An action is its bare name; a series write is { name, series } and needs the step's envelopeSchema."},envelopeSchema:{type:"object",description:"The JSON Schema the step's decision record must meet before it is added to the series its intents write. Required when an intent is a series write { name, series }.",required:["type"],properties:{type:{const:"object"}}},rules:{type:"array",description:"Checked in order; the first rule whose condition holds decides (run.time is the time of the run).",items:{type:"object",required:["field","operator"],additionalProperties:!1,properties:{id:{type:"string",minLength:1},field:{type:"string",minLength:1,description:"series.<name>.envelope.<path>, series.<name>.version, trigger.<field> or run.time."},operator:{enum:["eq","equals","neq","notEquals","gt","greaterThan","gte","greaterThanOrEquals","lt","lessThan","lte","lessThanOrEquals","contains","notContains","startsWith","endsWith","matches","exists","isEmpty","isNotEmpty","isNull","isNotNull","isTrue","isFalse"]},value:{},intents:{type:"array",items:{type:"string",minLength:1},minItems:1},escalate:{type:"boolean",description:"true: the step's agent decides (under its budget), never a model on the rule path."}},anyOf:[{required:["intents"]},{required:["escalate"],properties:{escalate:{const:!0}}}]}},default:{type:"object",required:["intents"],additionalProperties:!1,properties:{intents:{type:"array",items:{type:"string",minLength:1}}},description:"The intents of a run no rule matches."},escalation:{type:"object",required:["agentId","budget"],additionalProperties:!1,properties:{agentId:{type:"string",minLength:1,description:"The Primus agent that decides an escalation."},budget:{type:"object",required:["maxTokens","maxCostUsd","maxDurationMs"],additionalProperties:!1,properties:{maxTokens:{type:"number",exclusiveMinimum:0},maxCostUsd:{type:"number",exclusiveMinimum:0},maxDurationMs:{type:"number",exclusiveMinimum:0}},description:"The step's ceilings, capped by your organization's Primus policy."},fallback:{enum:["default"],description:`"default": a failed or over-budget escalation takes the default's intents. Absent: the run fails with the reason.`}}}}}}},{type:"object",title:"chart node",description:"A chart of an envelope series this pipe writes, drawn from its versions.",required:["nodeType","config"],properties:{nodeType:{const:"chart"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",required:["series","kind","lines","x","y"],additionalProperties:!1,properties:{series:{type:"string",minLength:1,description:"An envelope series a step of this pipe writes."},subject:{type:"string"},kind:{enum:["line","bar","area","scatter","stat","table"]},lines:{type:"array",minItems:1,items:{type:"object",required:["path","label"],additionalProperties:!1,properties:{path:{type:"string",pattern:"^\\$(\\.[A-Za-z_][A-Za-z0-9_-]*|\\[[0-9]+\\])+$",description:"A JSON path into the envelope, such as $.score."},label:{type:"string",minLength:1}}}},x:{type:"object",required:["source"],additionalProperties:!1,properties:{source:{enum:["time","version","field"],description:"time: when the version was made; version: its number; field: an envelope field (path)."},path:{type:"string",pattern:"^\\$(\\.[A-Za-z_][A-Za-z0-9_-]*|\\[[0-9]+\\])+$"}}},y:{type:"object",required:["unit","scale"],additionalProperties:!1,properties:{unit:{type:"string",minLength:1},scale:{enum:["linear","log"]}}},window:{type:"integer",minimum:1,description:"The newest versions to draw (a chart over time); absent: the latest version."}}}}},{type:"object",title:"connector condition",description:"Evaluate conditions and branch workflow execution",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"condition"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this condition node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["params"],additionalProperties:!1,properties:{actionId:{const:"evaluate",description:"Evaluate Condition"},params:{type:"object",properties:{condition:{oneOf:[{type:"object",properties:{field:{type:"string",description:"Field to evaluate"},operator:{type:"string",enum:["equals","notEquals","greaterThan","greaterThanOrEquals","lessThan","lessThanOrEquals","contains","notContains","startsWith","endsWith","matches","isEmpty","isNotEmpty","isNull","isNotNull","isTrue","isFalse"],description:"Comparison operator"},value:{description:"Value to compare against"}},required:["field","operator"]},{type:"object",properties:{logic:{type:"string",enum:["and","or"]},conditions:{type:"array",items:{type:"object"}}},required:["logic","conditions"]}]},data:{type:"object",description:"Data object to evaluate conditions against"}},required:["condition"]}},description:"Evaluate a condition or group of conditions"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector delay",description:"Wait for a specified duration or until a specific time",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"delay"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this delay node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"wait",description:"Wait"},params:{type:"object",properties:{duration:{type:"number",description:"Duration to wait in milliseconds",minimum:0,maximum:3e5},durationSeconds:{type:"number",description:"Duration to wait in seconds",minimum:0,maximum:300},durationMinutes:{type:"number",description:"Duration to wait in minutes",minimum:0,maximum:5}}}},description:"Wait for a specified duration"},{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"waitUntil",description:"Wait Until"},params:{type:"object",properties:{timestamp:{type:"number",description:"Unix timestamp (milliseconds) to wait until"},datetime:{type:"string",description:"ISO 8601 datetime string to wait until",format:"date-time"},maxWait:{type:"number",description:"Maximum wait time in milliseconds (default: 300000 = 5 min)",default:3e5}}}},description:"Wait until a specific time"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector error-handler",description:"Try/catch/finally error handling for workflows",required:["nodeType","connectorId"],properties:{nodeType:{const:"connector"},connectorId:{const:"error-handler"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The error-handler node's own settings; the engine's runner reads them itself (no action)."},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector events",description:"Read or publish npayload Events messages \u2014 the pipe's SENSE (events.get) and ACT (events.publish). Org-scoped: you can only touch your own channels and messages.",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"events"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this events node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"publish",description:"Publish to channel"},params:{type:"object",properties:{channel:{type:"string",description:`Target channel \u2014 its slug (e.g. "fulfillment") or gid. MUST belong to your org; the cell rejects any other tenant's channel.`},payload:{type:"object",description:"The message body to publish. Omit to forward the trigger event's data unchanged (republish).",additionalProperties:!0},eventType:{type:"string",description:'Optional event type label recorded on the message metadata (e.g. "order.fulfilled").'},idempotencyKey:{type:"string",description:"Optional idempotency key \u2014 a duplicate publish collapses to the first message."}},required:["channel"],additionalProperties:!1}},description:"Publish a message to one of your Events channels (by slug or gid). Fans out to subscribers and can re-trigger other pipes via event triggers \u2014 closing the autonomy loop."},{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"get",description:"Get message"},params:{type:"object",properties:{messageGid:{type:"string",description:"The message gid to read. Defaults to the trigger event's messageGid, so an event-triggered pipe can omit it to load the event that fired it."}},additionalProperties:!1}},description:"Read an Events message by gid (the pipe's SENSE). An event-triggered pipe omits messageGid to load the very event that fired it \u2014 fan-out passes only the gid, so this is how a pipe gets the payload to ETL."}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector http",description:"Make HTTP requests to any REST API endpoint",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"http"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this http node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"request",description:"HTTP Request"},params:{type:"object",properties:{method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method",default:"GET"},url:{type:"string",description:"Request URL (must be HTTPS)",format:"uri"},headers:{type:"object",description:"Request headers",additionalProperties:{type:"string"}},queryParams:{type:"object",description:"Query parameters to append to URL",additionalProperties:{type:"string"}},body:{description:"Request body (for POST, PUT, PATCH)"},contentType:{type:"string",enum:["application/json","application/x-www-form-urlencoded","text/plain"],description:"Content type for request body",default:"application/json"},timeout:{type:"number",description:"Request timeout in milliseconds",default:3e4,minimum:1e3,maximum:6e4},followRedirects:{type:"boolean",description:"Whether to follow redirects",default:!0},validateStatus:{type:"boolean",description:"Throw error for non-2xx status codes",default:!0}},required:["url"]}},description:"Make a custom HTTP request"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"get",description:"GET Request"},params:{type:"object",properties:{url:{type:"string",description:"Request URL",format:"uri"},headers:{type:"object",description:"Request headers",additionalProperties:{type:"string"}},queryParams:{type:"object",description:"Query parameters",additionalProperties:{type:"string"}}},required:["url"]}},description:"Make a GET request"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"post",description:"POST Request"},params:{type:"object",properties:{url:{type:"string",description:"Request URL",format:"uri"},headers:{type:"object",description:"Request headers",additionalProperties:{type:"string"}},body:{type:"object",description:"Request body"}},required:["url"]}},description:"Make a POST request with JSON body"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector log",description:"Log data for debugging workflows",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"log"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this log node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"log",description:"Log Message"},params:{type:"object",properties:{message:{type:"string",description:"Log message"},level:{type:"string",enum:["debug","info","warn","error"],description:"Log level",default:"info"},data:{description:"Optional data to include in log"}},required:["message"]}},description:"Log a message with optional data"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"inspect",description:"Inspect Data"},params:{type:"object",properties:{data:{description:"Data to inspect"},label:{type:"string",description:"Optional label for the inspection"},maxDepth:{type:"number",description:"Maximum depth to inspect",default:3,minimum:1,maximum:10}},required:["data"]}},description:"Inspect and return data structure information"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"passthrough",description:"Passthrough"},params:{type:"object",properties:{data:{description:"Data to pass through"},log:{type:"boolean",description:"Whether to also log the data",default:!1}},required:["data"]}},description:"Pass data through unchanged (useful for debugging flow)"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector loop",description:"Iterate over arrays and ranges in workflows",required:["nodeType","connectorId"],properties:{nodeType:{const:"connector"},connectorId:{const:"loop"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The loop node's own settings; the engine's runner reads them itself (no action)."},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector noop",description:"Built-in passthrough connector. Returns input as output verbatim \u2014 Pass-state equivalent.",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"noop"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this noop node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",additionalProperties:!1,properties:{actionId:{const:"passthrough",description:"Passthrough"},params:{type:"object",description:"Arbitrary JSON object. The action returns this value verbatim.",additionalProperties:!0}},description:"Return the input unchanged."}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector parallel",description:"Execute multiple branches in parallel",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"parallel"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this parallel node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"fork",description:"Fork"},params:{type:"object",properties:{branches:{type:"array",description:"Names of branches to execute in parallel",items:{type:"string"},minItems:1},maxConcurrency:{type:"number",description:"Maximum branches to run concurrently (default: unlimited)",minimum:1},timeout:{type:"number",description:"Timeout for all branches in milliseconds",minimum:0},continueOnError:{type:"boolean",description:"Continue executing other branches if one fails",default:!1}},required:["branches"]}},description:"Start parallel execution of multiple branches"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"join",description:"Join"},params:{type:"object",properties:{results:{type:"object",description:"Results from parallel branches (branch name -> result)",additionalProperties:{}},waitFor:{type:"string",enum:["all","any","first"],description:"Wait strategy: all, any success, or first to complete",default:"all"},requiredBranches:{type:"array",description:"Branches that must succeed (optional)",items:{type:"string"}}},required:["results"]}},description:"Wait for and aggregate results from parallel branches"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"map",description:"Parallel Map"},params:{type:"object",properties:{items:{type:"array",description:"Items to process in parallel",items:{}},maxConcurrency:{type:"number",description:"Maximum parallel executions",minimum:1,default:10},continueOnError:{type:"boolean",description:"Continue processing other items if one fails",default:!0}},required:["items"]}},description:"Process array items in parallel (returns items for iteration)"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"race",description:"Race"},params:{type:"object",properties:{branches:{type:"array",description:"Names of branches to execute in parallel",items:{type:"string"},minItems:1},maxConcurrency:{type:"number",description:"Maximum branches to run concurrently (default: unlimited)",minimum:1},timeout:{type:"number",description:"Timeout for all branches in milliseconds",minimum:0},continueOnError:{type:"boolean",description:"Continue executing other branches if one fails",default:!1}},required:["branches"]}},description:"Execute branches and return first result"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector primus-agent",description:"Execute npayload Primus AI agents",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"primus-agent"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this primus-agent node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"execute_agent",description:"Execute Agent"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},goal:{type:"string",description:"What the agent should accomplish (mapped to Primus 'message' field)"},context:{type:"object",description:"Additional context \u2014 merged into Primus 'config'"},maxExecutionTime:{type:"number",description:"Max execution time in ms",default:3e4},testMode:{type:"boolean",description:"When true, sends X-Primus-Test-Mode: 1 so Primus returns an echo fixture instead of invoking the real LLM. Not for production.",default:!1}},required:["agentId","goal"]}},description:"Run a Primus agent with a goal and optional context"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"search_memory",description:"Search Memory"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},query:{type:"string",description:"Search query"},topK:{type:"number",default:5,description:"Number of results"}},required:["agentId","query"]}},description:"Search an agent's memory using hybrid RAG. Not available yet."},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"store_memory",description:"Store Memory"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},content:{type:"string",description:"Content to store"},type:{type:"string",enum:["episodic","semantic","procedural"],default:"semantic",description:"Memory type"},metadata:{type:"object",description:"Additional metadata"}},required:["agentId","content"]}},description:"Store content in an agent's memory. Not available yet."},{type:"object",required:["actionId"],additionalProperties:!1,properties:{actionId:{const:"list_skills",description:"List Skills"},params:{type:"object",properties:{agentId:{type:"string",description:"Primus agent ID"},category:{type:"string",description:"Filter by category"}}}},description:"List available skills for an agent. Not available yet."},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"check_approval",description:"Check Approval"},params:{type:"object",properties:{approvalId:{type:"string",description:"Approval request ID"}},required:["approvalId"]}},description:"Check the status of a pending approval request. Not available yet."}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector retry",description:"Retry operations with exponential backoff",required:["nodeType","connectorId"],properties:{nodeType:{const:"connector"},connectorId:{const:"retry"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The retry node's own settings; the engine's runner reads them itself (no action)."},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector switch",description:"Multi-way branching based on value matching",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"switch"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this switch node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["params"],additionalProperties:!1,properties:{actionId:{const:"evaluate",description:"Evaluate Switch"},params:{type:"object",properties:{value:{description:"Value to switch on"},cases:{type:"array",description:"Case definitions",items:{type:"object",properties:{match:{description:"Value(s) to match",oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array",items:{}}]},name:{type:"string",description:"Branch name for this case"},output:{description:"Optional output data for this case"}},required:["match","name"]}},default:{type:"object",description:"Default case if no match",properties:{name:{type:"string"},output:{}}},strict:{type:"boolean",description:"Use strict equality (===) for comparison",default:!0}},required:["value","cases"]}},description:"Match value against cases and determine branch"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"connector transform",description:"Data transformation and manipulation",required:["nodeType","connectorId","config"],properties:{nodeType:{const:"connector"},connectorId:{const:"transform"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{description:"The action this transform node runs (data.config.actionId) and its params (data.config.params, where the engine reads them).",oneOf:[{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"map",description:"Map"},params:{type:"object",properties:{input:{description:"Input data to transform"},mapping:{type:"object",description:"Mapping of output field -> input path or expression",additionalProperties:{type:"string"}}},required:["input","mapping"]}},description:"Map/transform data using field mappings"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"filter",description:"Filter"},params:{type:"object",properties:{items:{type:"array",description:"Array to filter",items:{}},condition:{type:"object",description:"Filter condition",properties:{field:{type:"string"},operator:{type:"string"},value:{}},required:["field","operator"]}},required:["items","condition"]}},description:"Filter array items based on condition"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"reduce",description:"Reduce"},params:{type:"object",properties:{items:{type:"array",description:"Array to reduce",items:{}},operation:{type:"string",enum:["sum","count","min","max","avg","first","last","concat","unique"],description:"Reduction operation"},field:{type:"string",description:"Field to operate on (for objects)"},initialValue:{description:"Initial value for reduction"}},required:["items","operation"]}},description:"Reduce array to single value"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"merge",description:"Merge"},params:{type:"object",properties:{objects:{type:"array",description:"Objects to merge",items:{type:"object"}},strategy:{type:"string",enum:["shallow","deep","replace"],description:"Merge strategy",default:"shallow"}},required:["objects"]}},description:"Merge multiple objects into one"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"pick",description:"Pick"},params:{type:"object",properties:{input:{type:"object"},fields:{type:"array",items:{type:"string"}}},required:["input","fields"]}},description:"Pick specific fields from object"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"omit",description:"Omit"},params:{type:"object",properties:{input:{type:"object"},fields:{type:"array",items:{type:"string"}}},required:["input","fields"]}},description:"Omit specific fields from object"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"parse",description:"Parse"},params:{type:"object",properties:{input:{type:"string",description:"String to parse"},format:{type:"string",enum:["json","csv","querystring","number","boolean","date"],description:"Format to parse"},options:{type:"object",description:"Format-specific options"}},required:["input","format"]}},description:"Parse string into structured data"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"format",description:"Format"},params:{type:"object",properties:{input:{description:"Data to format"},format:{type:"string",enum:["json","csv","querystring","string","number","date"],description:"Output format"},options:{type:"object",description:"Format-specific options"}},required:["input","format"]}},description:"Format data into string"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"flatten",description:"Flatten"},params:{type:"object",properties:{input:{},depth:{type:"number",default:1},separator:{type:"string",default:"."}},required:["input"]}},description:"Flatten nested object or array"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"group",description:"Group"},params:{type:"object",properties:{items:{type:"array",items:{type:"object"}},by:{type:"string",description:"Field to group by"}},required:["items","by"]}},description:"Group array items by field"},{type:"object",required:["actionId","params"],additionalProperties:!1,properties:{actionId:{const:"sort",description:"Sort"},params:{type:"object",properties:{items:{type:"array"},by:{type:"string",description:"Field to sort by"},direction:{type:"string",enum:["asc","desc"],default:"asc"}},required:["items"]}},description:"Sort array items"}]},credentials:{type:"object",description:"The credential each connector of this node signs in with: the connector id mapped to the gid of a credential of this application (Pipes, Credentials).",additionalProperties:{type:"string",minLength:1}}}},{type:"object",title:"Study step",description:"A Study step: a study reads your sources where they live (each a credential of this application), runs your SQL or dlt pipeline over them, writes rows only to the write-backs you declare, and returns one envelope of at most 64 KiB that meets your envelope schema. npayload keeps the envelope and the study record, never your rows.",required:["nodeType","config"],properties:{nodeType:{const:"study"},label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object",description:"The Study step's settings: its sources, its spec, its write-backs, its envelope schema, its budget, and the envelope series it adds to.",required:["sources","spec","envelopeSchema","budget"],additionalProperties:!1,properties:{sources:{type:"array",minItems:1,description:"What the study reads, where it lives, read only. Never a secret: each source is a credential handle.",items:{type:"object",required:["handle","kind"],additionalProperties:!1,properties:{handle:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",description:"A credential of this application (Pipes, Credentials), by its gid; the study reads it under this name."},kind:{type:"string",description:"The kind of the source, one the study image built at commit 6d8c2ae750b11f52858ca2dbdbcd10b5aecd78e2 carries: delta, duckdb, excel, gcs, google_sheets, iceberg, mysql, postgres, r2, rest_api, s3, sqlite.","x-source-kinds":["delta","duckdb","excel","gcs","google_sheets","iceberg","mysql","postgres","r2","rest_api","s3","sqlite"],enum:["delta","duckdb","excel","gcs","google_sheets","iceberg","mysql","postgres","r2","rest_api","s3","sqlite"]},table:{type:"string",minLength:1,description:"The table the study reads first (optional)."},cursorField:{type:"string",minLength:1,description:"The column an incremental study reads from its stored cursor."},tenantColumn:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]{0,127}$",description:"The column of this source that holds the tenant's key. An application with tenants names it on every source: a study runs for one tenant and reads that tenant's rows only."}}}},spec:{type:"object",description:"DuckDB SQL over the sources (each read as <handle>.<schema>.<table>), a dlt pipeline over them, or both. Named parameters ($name) are bound at run time, never spliced into the SQL; COPY ... TO 'writeback://<handle>/<path>' writes to a declared write-back.",anyOf:[{required:["sql"]},{required:["dlt"]}],additionalProperties:!1,properties:{sql:{type:"string",minLength:1},dlt:{type:"object",properties:{sources:{type:"array",items:{type:"string"},description:"The source handles the dlt pipeline reads."},destination:{type:"string",description:"The write-back handle the dlt pipeline loads into."}}},params:{type:"object",description:"The value of each named parameter.",additionalProperties:{type:["string","number","boolean","null"]}},dateRange:{type:"object",description:"The two parameters a date range binds: a start and an end. A backfill binds its window; an incremental study binds its stored cursor and the time of the run.",required:["start","end"],additionalProperties:!1,properties:{start:{type:"string",minLength:1},end:{type:"string",minLength:1}}}}},writeBacks:{type:"array",description:"Where the study may write rows: destinations you own, each a credential handle. A study writes to no store npayload controls.",items:{type:"object",required:["handle","kind"],additionalProperties:!1,properties:{handle:{type:"string",pattern:"^[A-Za-z_][A-Za-z0-9_]*$",description:"A credential of this application (Pipes, Credentials), by its gid; the study reads it under this name."},kind:{enum:["dlt","file"],description:"dlt: a dlt destination (needs table). file: a file the study writes with COPY TO."},table:{type:"string",minLength:1},path:{type:"string",minLength:1},mode:{enum:["append","merge"]},primaryKey:{type:"string",minLength:1,description:"The key a merge write-back matches rows on."}}}},envelopeSchema:{type:"object",description:"The JSON Schema the study's one envelope must meet: findings, aggregates and derived values only, never rows, at most 65536 bytes (64 KiB).",required:["type"],properties:{type:{const:"object"}}},budget:{type:"object",description:"The study stops at the first limit it reaches (BUDGET_EXCEEDED, naming the limit) and moves no cursor.",required:["wallTimeMs","memoryTier","costCeiling"],additionalProperties:!1,properties:{wallTimeMs:{type:"integer",minimum:1e3,maximum:36e5},memoryTier:{enum:["small","medium","large","xlarge"]},costCeiling:{type:"object",required:["amountMicros","currency"],additionalProperties:!1,properties:{amountMicros:{type:"integer",minimum:1,description:"Millionths of a unit of the currency."},currency:{type:"string",pattern:"^[A-Z]{3}$",description:"Your organization's billing currency, such as USD."}}}}},series:{type:"object",description:"The envelope series each accepted envelope is added to as its next version.",required:["name"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"},subjectKey:{type:"string",minLength:1,maxLength:128}}}}}}},{type:"object",title:"node typed by node.type",not:{required:["nodeType"]},properties:{label:{type:"string",description:"The name the dashboard shows on the node."},config:{type:"object"}},description:"No data.nodeType: the engine dispatches on node.type, which must then be a built-in node type."}]}},if:{properties:{data:{not:{required:["nodeType"]}}}},then:{properties:{type:{enum:["trigger","manual","schedule","event","freshness","belief","surprise","dependency","condition","switch","loop","filter","merge","setVariable","delay","transform","http","log","ai","classify","generate","extract","summarize","agent","decide","chart"]}}}}},edges:{type:"array",items:{type:"object",required:["id","source","target"],additionalProperties:!1,properties:{id:{type:"string",minLength:1},source:{type:"string",description:"The id of the node the edge leaves."},target:{type:"string",description:"The id of the node the edge enters (never the trigger)."},sourceHandle:{type:"string",description:`The branch the edge leaves by: "execution_output" for a step without branches, or one of the node's branches (x-branch-handles: condition true|false, switch each case|default, decide each of its intents by its name, loop loop-body|done, error-handler success|error, retry success|exhausted, parallel branch-1|branch-2|branch-3).`},targetHandle:{enum:["execution_input"]}}}},viewport:{type:"object",required:["x","y","zoom"],properties:{x:{type:"number"},y:{type:"number"},zoom:{type:"number"}}},maxDurationMs:{type:"integer",minimum:1,maximum:864e5,description:"The pipe's run time limit, in milliseconds. A run still going when its next step would start after this limit stops, failed with the error code TIMEOUT. From 1 to 86400000 (24 hours); 1 hour when absent."}}},triggerConfig:{description:"When the pipe runs. One of the trigger types, with the config keys it needs.",oneOf:[{type:"object",title:"manual trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"manual"},config:{type:"object",properties:{inputData:{type:"object"}},description:"A manual trigger needs no key is needed."}}},{type:"object",title:"schedule trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"schedule"},config:{type:"object",properties:{cron:{type:"string",minLength:1},timezone:{type:"string",minLength:1}},description:'A schedule trigger needs `cron` (a cron expression such as "0 9 * * 1").',required:["cron"]}}},{type:"object",title:"event trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"event"},config:{type:"object",properties:{channel:{type:"string",minLength:1},eventType:{type:"string",minLength:1},feedSubscription:{type:"string",minLength:1},debounceSeconds:{type:"integer",minimum:60}},description:'A event trigger needs `channel` (the channel it listens on, a slug or a gid) or `feedSubscription` (a feed your organization bought), and `eventType` (the event type it fires on, such as "order.created").',anyOf:[{required:["channel"]},{required:["eventType"]},{required:["feedSubscription"]}]}}},{type:"object",title:"freshness trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"freshness"},config:{type:"object",properties:{source:{type:"string",minLength:1},watermarkColumn:{type:"string",minLength:1},cron:{type:"string",minLength:1,description:"A cron expression no finer than every 5 minutes."},channel:{type:"string",minLength:1},eventType:{type:"string",minLength:1},debounceSeconds:{type:"integer",minimum:60}},description:"A freshness trigger needs `source` (a source of the pipe) and either `watermarkColumn` with `cron` (every 5 minutes or slower) or the `channel` and `eventType` your system announces a change on.",anyOf:[{required:["source","watermarkColumn","cron"]},{required:["source","channel","eventType"]}]}}},{type:"object",title:"belief trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"belief"},config:{type:"object",properties:{series:{type:"string",minLength:1},field:{type:"string",minLength:1},crosses:{type:"number"},direction:{enum:["up","down","either"]},minDelta:{oneOf:[{type:"number"},{type:"string",pattern:"^[0-9]+(\\.[0-9]+)?%$"}],description:'A number (an absolute change), or a percent such as "10%".'},subject:{type:"string",minLength:1}},description:'A belief trigger needs `series`, `field` (a JSON path into its envelope) and either `crosses` with `direction` (up, down or either) or `minDelta` (a number, or a percent such as "10%").',anyOf:[{required:["series","field","crosses","direction"]},{required:["series","field","minDelta"]}]}}},{type:"object",title:"surprise trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"surprise"},config:{type:"object",properties:{series:{type:"string",minLength:1},errorField:{type:"string",minLength:1},maxError:{type:"number",minimum:0},subject:{type:"string",minLength:1}},description:"A surprise trigger needs `series`, `errorField` (the JSON path of the prediction error your pipe computes) and `maxError` (a number, 0 or more).",required:["series","errorField","maxError"]}}},{type:"object",title:"dependency trigger",required:["type","config"],additionalProperties:!1,properties:{type:{const:"dependency"},config:{type:"object",properties:{pipes:{type:"array",minItems:1,items:{type:"string",minLength:1}},when:{enum:["any","all"]}},description:"A dependency trigger needs `pipes` (one or more pipes of this application environment) and `when` (any or all).",required:["pipes","when"]}}}]}}};var vT=_k,bT=$k,Qt=Object.fromEntries(Object.entries(Sk).map(([e,t])=>[e,[...t]])),Xt=Ik,Vo=$g,$t=Ck,gr=Tk,wT=new Set(["condition","switch","loop","filter","merge","setVariable","delay"]),en=Object.fromEntries([...$g.map(e=>[e,"trigger"]),...Pk.map(e=>[e,wT.has(e)?"logic":"action"])]),Dk=Go;function kT(e){return e.nodeType===$t?"action":en[e.nodeType]??"action"}a(kT,"backendTypeOf");function jk(e){return e.nodeType===$t?e.connectorId??$t:e.nodeType}a(jk,"brancherKey");function xT(e,t,r,o){let n=`edges[${o.edge}]`,i=`nodes[${o.node}]`,s=jk(e),c=s===Xt||s in Qt;if(!t){if(c){let l=s===Xt?`one of the cases of its config.cases (config.params.cases on a switch connector step) or "${In}"`:`one of its branches (${Qt[s].join(", ")})`;throw new Error(`${n} leaves ${i} (${s}), a brancher, by a linear edge \u2014 connect FROM ${l} via { branch }.`)}return vT}if(s===Xt){if(![...r,In].includes(t))throw new Error(`${n} names a branch that is not a configured case of ${i} (${s}); the branch given is not shown here. Allowed: the cases of its config.cases (config.params.cases on a switch connector step), or "${In}".`);return t}if(!c)throw new Error(`${n} gives a branch, but ${i} has no branches \u2014 use a linear edge (omit "branch").`);let u=Qt[s];if(!u.includes(t))throw new Error(`${n} names a branch that ${i} (${s}) does not have; the branch given is not shown here. Allowed: ${u.join(", ")}.`);return t}a(xT,"resolveSourceHandle");function _T(e,t){let r=new Map;e.forEach(d=>r.set(d,0)),t.forEach(d=>r.set(d.to,(r.get(d.to)??0)+1));let o=new Map,n=e.filter(d=>(r.get(d)??0)===0);n.length===0&&e.length&&(n=[e[0]]),n.forEach(d=>o.set(d,0));let i=new Map;t.forEach(d=>i.set(d.from,[...i.get(d.from)??[],d.to]));let s=[...n],c=0;for(;s.length&&c++<1e4;){let d=s.shift(),f=o.get(d)??0;for(let p of i.get(d)??[]){let m=Math.max(o.get(p)??0,f+1);o.get(p)!==m&&(o.set(p,m),s.push(p))}}e.forEach(d=>{o.has(d)||o.set(d,0)});let u=new Map;e.forEach(d=>{let f=o.get(d);u.set(f,[...u.get(f)??[],d])});let l={};for(let[d,f]of u)f.forEach((p,m)=>{l[p]={x:80+d*320,y:120+m*180}});return l}a(_T,"layout");function Ag(e){if(!e?.nodes?.length)throw new Error("A pipe needs at least one node.");let t=new Map;e.nodes.forEach((u,l)=>{let d=`nodes[${l}]`;if(!u.id)throw new Error(`${d} needs an id: every node needs one.`);if(!u.nodeType)throw new Error(`${d} needs a nodeType (a built-in like "condition"/"log", or "connector" with a connectorId \u2014 see pipes_catalog).`);if(u.nodeType===$t&&!u.connectorId)throw new Error(`${d} has nodeType "connector" but no connectorId \u2014 set connectorId to a connector from pipes_catalog (e.g. "events").`);if(u.nodeType!==$t&&u.connectorId)throw new Error(`${d} sets a connectorId but its nodeType is not "connector" \u2014 a connector node MUST use nodeType "connector". For a built-in node, drop connectorId.`);if(u.nodeType!==$t&&u.nodeType!==gr&&!(u.nodeType in en))throw new Error(`${d} has a nodeType that is not authorable in v1; the type given is not shown here. Use a built-in (${Object.keys(en).join(", ")}), the Study step ("${gr}"), or nodeType "connector" with a connectorId from pipes_catalog.`);let f=t.get(u.id);if(f!==void 0)throw new Error(`${d} repeats the id of nodes[${f}]: every node needs its own id.`);t.set(u.id,l)});let r=e.edges??[];r.forEach((u,l)=>{if(!t.has(u.from))throw new Error(`edges[${l}].from is not the id of any node.`);if(!t.has(u.to))throw new Error(`edges[${l}].to is not the id of any node.`)});let o=_T(e.nodes.map(u=>u.id),r),n=new Map(e.nodes.map(u=>[u.id,u])),i=new Map;for(let u of e.nodes)jk(u)===Xt&&i.set(u.id,ST(u));let s=e.nodes.map(u=>({id:u.id,type:kT(u),position:o[u.id]??{x:80,y:120},data:{nodeType:u.nodeType,label:u.label??u.id,config:u.config??{},...u.connectorId?{connectorId:u.connectorId}:{},...u.credentials&&Object.keys(u.credentials).length?{credentials:u.credentials}:{}}})),c=r.map((u,l)=>{let d=n.get(u.from),f=xT(d,u.branch,i.get(u.from)??[],{edge:l,node:t.get(u.from)});return{id:`edge-${u.from}-${u.to}-${f}`,source:u.from,target:u.to,sourceHandle:f,targetHandle:bT}});return{nodes:s,edges:c}}a(Ag,"buildPipeDefinition");function $T(e){return e.nodes.find(t=>Vo.includes(t.nodeType))}a($T,"triggerNodeOf");function Cg(e,t){let r=$T(e);return r?{type:r.nodeType,config:r.config??{}}:{type:t?.type??"manual",config:t?.config??{}}}a(Cg,"triggerConfigOf");function ST(e){let t=e.config??{},r=t.params&&typeof t.params=="object"?t.params:{},o=Array.isArray(r.cases)?r.cases:Array.isArray(t.cases)?t.cases:[],n=[];for(let i of o){if(!i||typeof i!="object")continue;let s=i,c=[s.branch,s.name,s.id].find(u=>typeof u=="string"&&u.length>0);c&&n.push(c)}return n}a(ST,"switchCaseNames");function Uk(e){let t=new Map;for(let r of e){let o=String(r.id??r.connectorId??r._id??"");if(!o)continue;let n=new Map;for(let s of r.actions??[]){let c=String(s.id??s.actionId??"");c&&n.set(c,{actionId:c,inputSchema:s.inputSchema??void 0})}let i=r.auth?.type;t.set(o,{actions:n,needsCredential:!!i&&i!=="none"})}return{connectors:t}}a(Uk,"indexConnectorCatalog");function IT(e,t){let r=e.length,o=t.length;if(Math.abs(r-o)>3)return 99;let n=Array.from({length:r+1},(i,s)=>[s,...new Array(o).fill(0)]);for(let i=0;i<=o;i++)n[0][i]=i;for(let i=1;i<=r;i++)for(let s=1;s<=o;s++)n[i][s]=Math.min(n[i-1][s]+1,n[i][s-1]+1,n[i-1][s-1]+(e[i-1]===t[s-1]?0:1));return n[r][o]}a(IT,"editDistance");function La(e,t){let r=e.toLowerCase();return t.map(n=>{let i=n.toLowerCase(),s=i.includes(r)||r.includes(i)?0:IT(r,i);return{c:n,score:s}}).filter(n=>n.score<=3).sort((n,i)=>n.score-i.score).slice(0,3).map(n=>n.c)}a(La,"suggestIds");function Rg(e,t,r){let o=[],n=[],i=Object.keys(en);for(let[d,f]of(e.nodes??[]).entries()){let p=`nodes[${d}]`;if(f.nodeType===$t){let m=f.config??{},g=Object.keys(m).filter(k=>k!=="actionId"&&k!=="params");if(("actionId"in m||"params"in m||(t?.connectors.get(f.connectorId??"")?.actions.size??0)>0)&&g.length&&o.push(`${p} (a connector node): its params go under config.params (definition.nodes[${d}].data.config.params, where the engine reads them), but ${g.map(k=>`"${k}"`).join(", ")} sit flat in config. Write config ${Ua}: { actionId: "<action>", params: { ${g.join(", ")} } }.`),!t)continue;let h=f.connectorId?t.connectors.get(f.connectorId):void 0;if(!h){let k=[...t.connectors.keys()],T=f.connectorId?La(f.connectorId,k):[];o.push(`${p}: its connectorId names no connector of this deployment (it is not shown here)`+(T.length?` \u2014 did you mean ${T.map(_=>`"${_}"`).join(" / ")}?`:"")+` Call pipes_catalog for the ${k.length} available connectors; never guess a connectorId.`);continue}if(h.actions.size>0){let k=f.config?.actionId;if(!k)o.push(`${p} (connector "${f.connectorId}"): config.actionId is required (definition.nodes[${d}].data.config.actionId) \u2014 one of: ${[...h.actions.keys()].join(", ")}.`);else if(h.actions.has(k)){if(r){let T=h.actions.get(k).inputSchema;if(T&&typeof T=="object"){let _=m.params??{},N=r(T,_);for(let I of N)o.push(`${p} (${f.connectorId}.${k}): params ${I} (definition.nodes[${d}].data.config.params) \u2014 the schema is in pipes_catalog under this action's inputSchema.`)}}}else{let T=La(k,[...h.actions.keys()]);o.push(`${p}: its config.actionId names no action of connector "${f.connectorId}" (it is not shown here)`+(T.length?` \u2014 did you mean ${T.map(_=>`"${_}"`).join(" / ")}?`:"")+` Valid actions: ${[...h.actions.keys()].join(", ")}.`)}}h.needsCredential&&n.push(`${p} (connector "${f.connectorId}") requires a CREDENTIAL \u2014 configure one for this connector (dashboard \u2192 Pipes \u2192 Credentials) or the node fails at run time with an auth error.`)}else if(f.nodeType!==gr&&!i.includes(f.nodeType)){let m=La(f.nodeType,i),g=t?La(f.nodeType,[...t.connectors.keys()]):[];o.push(`${p}: its nodeType is not a built-in node type (it is not shown here)`+(m.length?` \u2014 did you mean ${m.map(v=>`"${v}"`).join(" / ")}?`:"")+(g.length?` If you meant the "${g[0]}" integration, use nodeType "connector" with connectorId "${g[0]}".`:' For an integration, use nodeType "connector" + a connectorId from pipes_catalog.')+` Built-ins: ${i.join(", ")}.`)}}let s=e.nodes??[],c=a(d=>`nodes[${s.indexOf(d)}]`,"placeOf"),u=s.filter(d=>Vo.includes(d.nodeType)),l=e.edges??[];if(u.length===0)n.push("No trigger node \u2014 the workflow gets triggerType 'manual' by default. Add ONE trigger node (manual|schedule|event) as the entry for an explicit trigger.");else if(u.length>1)o.push(`${u.length} trigger nodes (${u.map(c).join(", ")}) \u2014 a workflow has exactly ONE trigger. Keep one; downstream steps hang off it.`);else{let d=u[0];if(l.some(f=>f.to===d.id)&&o.push(`The trigger node, ${c(d)}, has an INCOMING edge \u2014 the trigger is the entry; nothing routes into it.`),e.nodes.length>1){let f=new Set([d.id]),p=!0;for(;p;){p=!1;for(let g of l)f.has(g.from)&&!f.has(g.to)&&(f.add(g.to),p=!0)}let m=e.nodes.filter(g=>!f.has(g.id));m.length&&o.push(`Node(s) ${m.map(c).join(", ")} are not reachable from the trigger, ${c(d)} \u2014 they will never execute and render disconnected. Wire them with edges (or remove them).`)}}return{ok:o.length===0,issues:o,warnings:n}}a(Rg,"validateSpecAgainstCatalog");function za(e){return e.key.split(".")[0]??"other"}a(za,"productOf");var Og=[];function Lk(e){let t=new Set(ke.commands.map(o=>o.key)),r=new Set;Og=e.filter(o=>t.has(o.key)||r.has(o.key)?!1:(r.add(o.key),!0))}a(Lk,"setCatalogExtraRows");function Ma(){return Og.length===0?[...ke.commands]:[...ke.commands,...Og]}a(Ma,"catalogRows");function PT(e){return{key:e.key,method:e.method,path:e.pattern,summary:e.summary,isQuery:e.isQuery,idempotent:e.idempotent,scopes:e.scopes,pathParams:e.pathParams.map(t=>({name:t.name,segment:t.key})),args:e.flags.map(t=>({name:t.name,type:t.coerce??"string",required:!t.optional}))}}a(PT,"toCatalogOp");var ET=["events.appDpopKeys.","keys.appDpopKeys."],TT=["credentials.connectors.","pipes.connectors.","pipes.connectorCredentials."],AT=new Set(["events.adapters.createAdapter","events.subscriptions.create","events.subscriptions.revealSecret","events.subscriptions.rotateSecret","events.subscriptions.subscribe","events.subscriptions.update","events.systemEvents.rotateSecret","events.systemEvents.subscribe","events.systemEvents.unsubscribe","webhooks.webhooks.create","webhooks.webhooks.revealSecret","webhooks.webhooks.revoke","webhooks.webhooks.rotateSecret","pipes.webhooks.rotateWebhookSecret","pipes.workflows.createWorkflow","pipes.workflows.updateWorkflow","pipes.governance.revokeConnectorApproval","primus.brainConfig.storeProviderKey","primus.brainConfig.deleteConfig","primus.brainConfig.configure","primus.integrations.connect","primus.integrations.disconnect","primus.integrations.refresh","primus.mcpConnect.beginConnect","primus.mcpConnect.revokeConnection","primus.mcpOauth.beginOauth","primus.mcpOauth.setPreregisteredClient","primus.mcpServers.connect","primus.mcpServers.rotateAuth","primus.mcpServers.test","primus.tenants.suspend","primus.tenants.archive","primus.tools.create","primus.tools.update","primus.tools.importFromOpenApi","primus.triggers.create","primus.triggers.rotateSecret","primus.webhooks.create","primus.configPromotion.applyConfigBundle","billing.connectAccounts.createAccountSession","billing.feedListings.subscribeToListing","billing.feedListings.subscribeToListingWithSavedCard","billing.subscriptions.confirmSubscriptionPayment","billing.subscriptions.createSetupIntent","billing.subscriptions.createSubscription","embed.sessions.create","embed.sessions.revoke","tenants.actAs.actAs","tenants.tenants.close","tenants.tenants.suspend","account.environments.clone","connect.connect.revokeGrant","connect.connect.revokeTenantApproval","connect.publishGrants.revoke","feed.publishers.revokePublisher","connect.connect.partnerOverrideTenantApproval","connect.identityBridges.archiveBridge","connect.connect.partnerDelistApp"]);function CT(e){return e.isQuery?!1:AT.has(e.key)||TT.some(t=>e.key.startsWith(t))}a(CT,"requiresConfirmation");function Ng(e){return ET.some(t=>e.startsWith(t))}a(Ng,"catalogDenied");function zk(e){let t=e?.trim().toLowerCase()||void 0,r=new Map;for(let n of Ma()){if(Ng(n.key))continue;let i=za(n);if(t&&i!==t)continue;r.has(i)||r.set(i,[]);let s=PT(n);CT(n)&&(s.summary=`${s.summary} [CREDENTIAL OP \u2014 always confirm with the user before invoking]`),r.get(i).push(s)}let o=[...r.entries()].map(([n,i])=>({product:n,ops:i.sort((s,c)=>s.key.localeCompare(c.key))})).sort((n,i)=>n.product.localeCompare(i.product));return{contentHash:ke.contentHash,generatedAt:ke.generatedAt,products:o,totalOps:o.reduce((n,i)=>n+i.ops.length,0)}}a(zk,"buildCatalog");function Fa(){return[...new Set(Ma().filter(e=>!Ng(e.key)).map(e=>za(e)))].sort()}a(Fa,"listProducts");function Mk(e){return Ma().find(t=>t.key===e)}a(Mk,"findOp");var Pn=class extends Error{static{a(this,"UnknownOpError")}suggestions;constructor(t,r){super("unknown op key (the key given is not shown here). Call npayload_catalog to discover valid keys"+(r.length?`. Did you mean: ${r.join(", ")}?`:".")),this.name="UnknownOpError",this.suggestions=r}};function Fk(e,t=5){let r=e.split(".");return Ma().map(o=>{let n=o.key.split("."),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return{key:o.key,shared:i}}).filter(o=>o.shared>0).sort((o,n)=>n.shared-o.shared||o.key.localeCompare(n.key)).slice(0,t).map(o=>o.key)}a(Fk,"suggestKeys");function St(e){let t=Mk(e);if(!t)throw new Pn(e,Fk(e));return{method:t.method==="HEAD"?"GET":t.method,path:Vh(t.pattern)}}a(St,"contractRouteFor");async function qk(e,t,r){if(Ng(e))throw new Pn(e,[]);let o=Mk(e);if(!o)throw new Pn(e,Fk(e));let n={...t??{}},i=[];for(let u of o.pathParams){let l=n[u.name];if(delete n[u.name],(l==null||l==="")&&u.name==="appId"){let d=await r.resolveAppId();if(!d)throw new Q(`${e} needs a path param "${u.name}" and it could not be resolved from the token \u2014 pass { "${u.name}": "app_\u2026" }.`);l=d}if(l==null||l==="")throw new Q(`${e} requires path param "${u.name}" (URL segment :${u.key}).`);i.push(typeof l=="object"?JSON.stringify(l):String(l))}let s={};for(let[u,l]of Object.entries(n))if(l!=null){if(u==="idempotencyKey"||u==="idempotency-key"){s["idempotency-key"]=String(l);continue}s[u]=typeof l=="object"?JSON.stringify(l):String(l)}let c=dt({row:o,positionals:i,flags:s,newIdempotencyKey:r.newIdempotencyKey});return{row:o,request:c}}a(qk,"composeInvoke");var RT=`${Pe}/api/search`,OT=`${Pe}/docs/llms-full.txt`,Bo=`The npayload docs could not be read right now. Try again in a moment, or read the same pages at ${Pe}.`,NT=3,DT=[250,750],jT=3600*1e3,UT=600*1e3,LT=10,zT=3,Dg=300,MT=5,qa=200,jg=2048,Zk="-".repeat(5),FT=new RegExp(`${Zk}BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY${Zk}`),qT=[FT,/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,/\b(?:AKIA[0-9A-Z]{16}|gh[pousr]_[A-Za-z0-9]{36,}|github_pat_[A-Za-z0-9_]{50,}|npm_[A-Za-z0-9]{36}|(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}|whsec_[A-Za-z0-9+/=]{24,}|xox[abprs]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{35}|sk-ant-[A-Za-z0-9_-]{20,}|sk-(?:proj|svcacct)-[A-Za-z0-9_-]{20,})/,/\b(?:prod|dev|preview|project):[a-z0-9-]+\|[A-Za-z0-9+/=_-]{20,}/],ZT=[/(?<![A-Za-z0-9])(?:oac|npat)_[A-Za-z0-9]{16,}/,/(?<![A-Za-z0-9])(?=[A-Za-z0-9]*[0-9])(?=[A-Za-z0-9]*[A-Za-z])[A-Za-z0-9]{32,}(?![A-Za-z0-9])/,/(?<![A-Za-z0-9])[A-Za-z0-9]{48,}(?![A-Za-z0-9])/,/(?<![A-Za-z0-9_-])(?=[A-Za-z0-9_-]*[0-9])(?=[A-Za-z0-9_-]*[A-Z])(?=[A-Za-z0-9_-]*[a-z])[A-Za-z0-9_-]{43,}(?![A-Za-z0-9_-])/],GT=["NPAYLOAD_TOKEN","NPAYLOAD_CLIENT_SECRET","NPAYLOAD_HMAC_SECRET"];function VT(){return GT.map(e=>process.env[e]?.trim()??"").filter(e=>e.length>=8)}a(VT,"heldCredentialValues");var BT={type:"application/json",timeLimitMs:8e3,maxBytes:2*1024*1024},KT={type:"text/plain",timeLimitMs:15e3,maxBytes:16*1024*1024},Za=class extends Error{static{a(this,"RedirectNotFollowed")}};function JT(e){return(e.headers.get("content-type")??"").split(";")[0].trim().toLowerCase()}a(JT,"mediaTypeOf");async function Ug(e){try{await e.body?.cancel()}catch{}}a(Ug,"letGo");async function WT(e,t){if(Number(e.headers.get("content-length")??"0")>t){await Ug(e);return}if(e.body===null)return"";let r=e.body.getReader(),o=[],n=0;for(;;){let{done:c,value:u}=await r.read();if(c)break;if(n+=u.byteLength,n>t){await r.cancel().catch(()=>{});return}o.push(u)}let i=new Uint8Array(n),s=0;for(let c of o)i.set(c,s),s+=c.byteLength;return new TextDecoder("utf-8").decode(i)}a(WT,"textWithin");async function HT(e,t){let r=!1,o=$h(s=>{if(!r&&s===e){r=!0;return}return"a docs read follows no redirect"},()=>new Za),n=new AbortController,i=setTimeout(()=>n.abort(),t.timeLimitMs);try{let s=await o(e,{method:"GET",headers:{accept:t.type},redirect:"manual",signal:n.signal});if(s.status!==200)return await Ug(s),{failed:s.status===429||s.status>=500?"again":"done"};if(JT(s)!==t.type)return await Ug(s),{failed:"done"};let c=await WT(s,t.maxBytes);return c===void 0?{failed:"done"}:{text:c}}catch(s){return{failed:s instanceof Za?"done":"again"}}finally{clearTimeout(i)}}a(HT,"tryOnce");function YT(e){return new Promise(t=>setTimeout(t,e))}a(YT,"pause");async function Yk(e,t,r){for(let o=1;o<=NT;o+=1){o>1&&await YT(DT[o-2]??0);let n=await HT(e,t);if("text"in n)return r(n.text);if(n.failed==="done")return}}a(Yk,"readFromDocs");function Qk(e){try{let t=new URL(e,`${Pe}/`);return t.origin===Pe?t:void 0}catch{return}}a(Qk,"onDocsHost");var Lg=a(e=>e==="/docs"||e.startsWith("/docs/"),"underDocs");function QT(e){let t=Qk(e);if(t===void 0)return;let r=t.pathname.replace(/\/+$/,"");return Lg(r)?{path:r,hash:t.hash}:void 0}a(QT,"docsAddressOf");function XT(e){let t=Qk(e);if(t===void 0)return;let r=t.pathname.replace(/\/+$/,"").replace(/\.(?:md|mdx|txt)$/i,"").replace(/\/+$/,"");return Lg(r)?r:void 0}a(XT,"pagePathOf");var eA=/^<page url=([^\s"'<>]+)>$/,Gk="</page>",Vk="<page url=",tA=/^# (.*)$/;function nA(e){let t;try{t=new URL(e)}catch{return}if(t.origin!==Pe||t.username!==""||t.password!==""||t.search!==""||t.hash!=="")return;let r=t.pathname.replace(/\/+$/,"");return Lg(r)?r:void 0}a(nA,"pageAddressOf");function rA(e){let t=e.replace(/\r\n?/g,`
|
|
452
|
+
`).split(`
|
|
453
|
+
`),r=[],o=new Set,n=0;for(;n<t.length;){if(t[n]===""){n+=1;continue}let i=eA.exec(t[n]);if(i===null)return;let s=nA(i[1]);if(s===void 0||o.has(s))return;let c=tA.exec(t[n+1]??""),u=t[n+2];if(c===null||c[1].trim()===""||u===void 0||u===Gk||u.startsWith(Vk)||t[n+3]!=="")return;let l=n+4;for(;l<t.length&&t[l]!==Gk;){if(t[l].startsWith(Vk))return;l+=1}if(l>=t.length)return;o.add(s),r.push({path:s,url:`${Pe}${s}`,title:c[1].trim(),description:u.trim(),body:t.slice(n+4,l).join(`
|
|
454
|
+
`)}),n=l+1}return r.length>0?r:void 0}a(rA,"pagesOf");async function oA(){let e=await Yk(OT,KT,rA);if(e!==void 0)return{pages:e,byPath:new Map(e.map(t=>[t.path,t])),readAt:Date.now()}}a(oA,"readLibrary");function Bk(e,t){if(e===void 0)return!1;let r=Date.now()-e;return r>=0&&r<t}a(Bk,"within");function iA(){let e,t,r,o=a(()=>(t??=oA().then(n=>(n!==void 0&&(e=n),n)).finally(()=>{t=void 0}),t),"readNow");return{async read(){if(e!==void 0){if(Bk(e.readAt,jT))return{library:e,fresh:!1};e=void 0}let n=await o();return n===void 0?void 0:{library:n,fresh:!0}},async check(n){return n.fresh?(r=Date.now(),n.library):Bk(r,UT)?(t===void 0?void 0:await t)??e??n.library:(r=Date.now(),o())}}}a(iA,"docsKeep");function hr(e){return{content:[{type:"text",text:typeof e=="string"?e:JSON.stringify(e,null,2)}]}}a(hr,"answer");function En(e){return{...hr(e),isError:!0}}a(En,"refusal");function Kk(e){return[`# ${e.title}`,"",e.url,"",...e.description!==""?[e.description,""]:[],e.body].join(`
|
|
455
|
+
`)}a(Kk,"wholeTextOf");function sA(e){let t=new Map;for(let r of e){let o=r.path.split("/")[2],n=o?`/docs/${o}`:"/docs",i=t.get(n)??[];i.push({title:r.title,url:r.url,description:r.description}),t.set(n,i)}return{count:e.length,sections:[...t].map(([r,o])=>({section:r,pages:o})),next:"Read a page whole: call npayload_docs_read with its url. Find the pages that hold given words: call npayload_docs_search."}}a(sA,"listOf");function Jk(e){return e.toLowerCase().split("/").filter(t=>t!=="")}a(Jk,"segmentsOf");function Wk(e){return new Set(e.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(t=>t!==""))}a(Wk,"wordsOf");function aA(e){let t=e;try{t=new URL(e,`${Pe}/`).pathname}catch{}try{t=decodeURIComponent(t)}catch{}return t.toLowerCase()}a(aA,"pathOfAddress");function cA(e,t){let r=aA(t),o=Jk(r),n=Wk(o[o.length-1]??"");return e.map((i,s)=>{let c=Jk(i.path),u=0;for(;u<o.length&&u<c.length&&o[u]===c[u];)u+=1;let l=Wk(i.title),d=0;for(let f of n)l.has(f)&&(d+=1);return{page:i,index:s,shared:u,common:d}}).sort((i,s)=>s.shared-i.shared||s.common-i.common||i.index-s.index).slice(0,MT).map(i=>i.page)}a(cA,"nearestPages");function Hk(e,t,r){return En([r?"The npayload docs have no page at that address.":"That address is not a page of the npayload docs: npayload_docs_read reads their pages only, never another address.","The nearest pages of the docs:",...cA(e,t).map(o=>`- ${o.title}: ${o.url}`),"Read one of them with npayload_docs_read, or call npayload_docs_read with no address for the list of every page."].join(`
|
|
456
|
+
`))}a(Hk,"noSuchPage");function uA(e){let t;try{t=JSON.parse(e)}catch{return}if(!Array.isArray(t))return;let r=[];for(let o of t){if(o===null||typeof o!="object"||Array.isArray(o))return;let{id:n,type:i,content:s,url:c}=o;if(typeof n!="string"||typeof i!="string"||typeof s!="string"||typeof c!="string")return;(i==="page"||i==="heading"||i==="text")&&r.push({type:i,content:s,url:c})}return r}a(uA,"hitsOf");function lA(e){let t=e.replace(/<\/?[A-Za-z][^<>]*>/g,"").replace(/\s+/g," ").trim();if(t.length<=Dg)return t;let r=t.slice(0,Dg),o=r.lastIndexOf(" ");return`${(o>Dg/2?r.slice(0,o):r).trimEnd()}\u2026`}a(lA,"plainText");function dA(e,t){let r=[],o=new Map;for(let n of e){let i=QT(n.url);if(i===void 0)continue;let s=o.get(i.path);if(s===void 0){if(r.length===LT)continue;s={passages:[]},o.set(i.path,s),r.push(i.path)}let c=lA(n.content);c!==""&&(n.type==="page"?s.title??=c:s.passages.length<zT&&!s.passages.some(u=>u.text===c)&&s.passages.push({text:c,url:`${Pe}${i.path}${i.hash}`}))}return r.map(n=>{let i=o.get(n);return{title:t?.byPath.get(n)?.title??i.title??n,url:`${Pe}${n}`,passages:i.passages}})}a(dA,"pagesFound");function pA(e){return Yk(`${RT}?query=${encodeURIComponent(e)}`,BT,uA)}a(pA,"searchDocs");function fA(e){if(e.trim()==="")return"Give npayload_docs_search the words to look for in the npayload docs.";if([...e].length>qa)return`That query is longer than ${qa} characters, so it was not sent. Search the npayload docs with a few words.`;if([...qT,...ZT].some(t=>t.test(e))||VT().some(t=>e.includes(t)))return"That query holds what looks like a key, a token or a secret, so it was not sent. Search the npayload docs with words, never with code, logs or secrets."}a(fA,"refusalOfQuery");var mA="No page of the npayload docs holds those words. Try other words, or call npayload_docs_read with no address for the list of every page.",gA=`Search the npayload docs (${Pe}) for the pages that hold your words. Answers at most ten pages, in the order the docs' own search ranks them, each with its title, its address and the passages that hold the words. Use it before you write code or config for any npayload product, or whenever you need to know how npayload works, then read the best page whole with npayload_docs_read. Search with a few words, never with code, logs or secrets: a query of more than ${qa} characters, or one that holds a string shaped like a key or a token, is refused before anything is sent. It reads the public docs while you work and needs no sign-in.`,hA=`Read the npayload docs (${Pe}). Give a page's address (/docs/... or ${Pe}/docs/..., as npayload_docs_search or the list gives it) to get that page's whole text: its title, address, description and body. Give no address to get the list of every page, grouped by section, each with its title, address and description. An address the docs do not hold is answered with the nearest pages. Use it to learn how npayload and each of its products work instead of answering from memory. It reads the public docs while you work and needs no sign-in.`;function Xk(e){let t=iA();e.tool("npayload_docs_search",gA,{query:$.string().default("").describe(`a few words to look for, as you would type them in the docs' search, at most ${qa} characters (for example: verify a webhook signature)`)},async({query:r})=>{try{let o=fA(r);if(o!==void 0)return En(o);let[n,i]=await Promise.all([pA(r.trim()),t.read()]);if(n===void 0)return En(Bo);let s=dA(n,i?.library);return s.length===0?hr(mA):hr({pages:s,next:"Read a page whole: call npayload_docs_read with its url."})}catch{return En(Bo)}}),e.tool("npayload_docs_read",hA,{page:$.string().optional().describe(`the page's address: /docs/... or ${Pe}/docs/...; leave it out for the list of every page`)},async({page:r})=>{try{let o=await t.read();if(o===void 0)return En(Bo);let n=(r??"").trim();if(n==="")return hr(sA(o.library.pages));let i=n.length>jg?void 0:XT(n);if(i===void 0)return Hk(o.library.pages,n.slice(0,jg),!1);let s=o.library.byPath.get(i);if(s!==void 0)return hr(Kk(s));let c=await t.check(o);if(c===void 0)return En(Bo);let u=c.byPath.get(i);return u!==void 0?hr(Kk(u)):Hk(c.pages,n.slice(0,jg),!0)}catch{return En(Bo)}})}a(Xk,"registerDocsTools");async function tx(e,t){if(t)return t;let{token:r}=await e.auth.getAccessToken([]),o=JSON.parse(Buffer.from(r.split(".")[1]??"","base64url").toString("utf8"));return o["npayload/appId"]??o.appId??o.app}a(tx,"resolveAppIdFromToken");var kA=`npayload Events config-as-code. Write a npayload/events.config.ts that default-exports
|
|
447
457
|
defineEventsConfig({...}). Resources are keyed by their natural identity (the map key):
|
|
448
458
|
|
|
449
459
|
- channels: keyed by slug (lowercase, a-z 0-9 and hyphens). Choose "type":
|
|
@@ -461,9 +471,9 @@ defineEventsConfig({...}). Resources are keyed by their natural identity (the ma
|
|
|
461
471
|
Loop: write events.config.ts, then call events_validate (pass the config object, or
|
|
462
472
|
omit it to validate the file you wrote on disk; fix any issues it returns), then
|
|
463
473
|
events_deploy (use check:true first to preview). Then the app publishes with
|
|
464
|
-
np.events.publish("<channel-slug>", payload). Payload typing is the developer's:
|
|
474
|
+
np.events.publish("<channel-slug>", payload, { routingKey: "<event type>" }); the routing key is the event's type. Payload typing is the developer's:
|
|
465
475
|
the agent generates the payload shape from the app's schema. NPP transport, signing
|
|
466
|
-
keys, and credentials are handled automatically \u2014 never put them in the config.`,
|
|
476
|
+
keys, and credentials are handled automatically \u2014 never put them in the config.`,xA=`npayload Connect = cross-org event sharing. An app in one org consumes the event
|
|
467
477
|
types published by an app in ANOTHER org, gated by an explicit access grant.
|
|
468
478
|
|
|
469
479
|
Core flow (subscriber S in org A wants publisher P's events in org B):
|
|
@@ -471,7 +481,12 @@ Core flow (subscriber S in org A wants publisher P's events in org B):
|
|
|
471
481
|
np.connect.connect.updateAppProfile({ appId, connectVisibility, publishedEventTypes }).
|
|
472
482
|
2. S finds P: np.connect.connectExplore.searchExploreApps({ query }).
|
|
473
483
|
3. S requests access: np.connect.connect.requestAccess({ subscriberAppId, publisherAppId, eventTypes }).
|
|
474
|
-
4. P approves: np.connect.connect.approveAccess({ grantId })
|
|
484
|
+
4. P approves: np.connect.connect.approveAccess({ grantId }), with a credential of the environment
|
|
485
|
+
whose channels it shares; every open channel of P's app in that environment takes part.
|
|
486
|
+
5. P publishes with routingKey set to a granted type exactly:
|
|
487
|
+
np.events.publish("<channel-slug>", payload, { routingKey: "<granted type>" }). It lands in S's
|
|
488
|
+
receiving channel (slug connect-recv-<grantId>; ${b("connect grants get <grantId>")}).
|
|
489
|
+
An event with no routing key, or another type, is accepted and does not cross; no error says so.
|
|
475
490
|
|
|
476
491
|
Add an Identity Bridge ONLY when the two orgs use different ids for the same entity
|
|
477
492
|
(np.connect.connect.createBridge -> the other side confirmBridge). For multi-tenant
|
|
@@ -479,27 +494,27 @@ platform apps, prove per-tenant consent with np.connect.connect.initiateTenantAp
|
|
|
479
494
|
before per-tenant events flow.
|
|
480
495
|
|
|
481
496
|
Both apps MUST be CONNECT-type \u2014 INTERNAL apps are org-private and refused. The ONLY resource
|
|
482
|
-
you declare in connect.config.ts is identity BRIDGES \u2014 declare them and run connect_deploy
|
|
483
|
-
|
|
497
|
+
you declare in connect.config.ts is identity BRIDGES \u2014 declare them and run connect_deploy.
|
|
498
|
+
Everything else (profile,
|
|
484
499
|
access grants, tenant approvals) is managed through the np.connect.* SDK calls above \u2014 use
|
|
485
500
|
connect_usage for copy-ready snippets. The cross-org HANDSHAKE stays imperative regardless: a
|
|
486
501
|
bridge/grant you declare is an OFFER (pending) until the other org confirms in ITS own config \u2014
|
|
487
|
-
declarative intent, never auto-consent.`;function en(){return qi()}a(en,"allowInternalUrls");function N(e){return{content:[{type:"text",text:typeof e=="string"?e:JSON.stringify(e,null,2)}]}}a(N,"text");function ce(e,t={}){let r=e?.code;return{...N({ok:!1,...typeof r=="string"?{code:r}:{},type:e instanceof Error?e.name:typeof e,error:e instanceof Error?e.message:String(e),...t}),isError:!0}}a(ce,"toolFailure");function dx(e){let t=e,r=t?.details?.errors;if(!(!t||!Array.isArray(r))&&!(t.code!=="PIPE_DEFINITION_INVALID"&&t.status!==400))return{ok:!1,code:typeof t.code=="string"?t.code:"PIPE_DEFINITION_INVALID",message:typeof t.message=="string"?t.message:"The pipe definition is not valid.",errors:r,schemaVersion:jo,retry:!0,next:"Fix each reason at its path, then call pipes_validate_definition (or pipes_create) again.",...typeof t.requestId=="string"?{requestId:t.requestId}:{}}}a(dx,"pipeDefinitionRefusal");function xg(){for(let e of["connect.config.ts","connect.config.mjs","connect.config.js","npayload/connect.config.ts","npayload/connect.config.mjs","npayload/connect.config.js"]){let t=lx(process.cwd(),e);if(px(t))return t}return lx(process.cwd(),"connect.config.ts")}a(xg,"findConnectConfig");function TE(){let e=new SE({name:"npayload",version:an()});e.tool("npayload_overview","Call this FIRST, before anything else. Returns the complete deterministic map for working on this npayload project: current project state (config found, credential source, generated artifacts), the exact ordered end-to-end workflow (each step names the MCP tool AND the CLI command), and the hard rules. Follow it step by step \u2014 never guess, never reverse-engineer.",async()=>{let p=null;try{p=We()}catch{p=null}let f=a(v=>px(_E(process.cwd(),v)),"gen"),g=null;try{let{resolveCredentials:v}=await import("../chunk-4HRWY6VL.mjs");g=(await v()).source}catch{g=null}return N({version:an(),state:{eventsConfig:p,credentialSource:g,generated:{contractLock:f("npayload/_generated/contract.lock"),typedEventPayloads:f("npayload/_generated/events.d.ts"),permissions:f("npayload/permissions.generated.ts")},note:g===null?"No credential source \u2014 run `npx @npayload/sdk init` in this project (or `npayload doctor` for diagnosis) before any deploy/status call.":"Credentials resolve automatically; never read or edit .env / .npayload.json."},...Py()})}),e.tool("events_contract","Return the npayload Events config schema (JSON Schema) + the capability catalog + decision guide + guidance. Call this BEFORE writing or editing events.config.ts \u2014 the schema returned here is the only valid source of config fields (after npayload_overview).",async()=>N({version:Pr,guidance:PE,capabilities:jw,schema:Cn})),e.tool("events_usage","Return server-side, copy-ready RUNTIME recipes for using Events from app code (publish variants, queue/outbox consume, streams, KV, webhook verification, catalogue, exchanges, consumer groups, DLQ, snapshots, privacy, NPP). Call this when writing the app code (not just the topology). Optionally pass a feature key to get one recipe.",{feature:S.string().optional().describe('a recipe key (e.g. "queueConsume", "webhookVerify"); omit to get all recipes')},async({feature:p})=>p&&No[p]?N(No[p]):N(p?{error:`unknown feature "${p}"`,available:Object.keys(No)}:{version:Pr,recipes:No})),e.tool("events_validate","Validate an Events config against the contract (structure + security). Pass the config object, OR omit it to validate the project's events.config.ts on disk. Returns { ok, issues } with precise, fixable problems.",{config:S.union([S.record(S.string(),S.unknown()),S.string()]).optional().describe("the EventsConfig object (or a JSON string) to validate; omit to validate events.config.ts on disk"),configPath:S.string().optional().describe("path to events.config.ts (used when `config` is omitted)")},async({config:p,configPath:f})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}g==null&&(g=await ue(f??We()));let v=Wr(g,{allowInternalUrls:en()});return{...N(v),isError:!v.ok}}),e.tool("events_deploy","Reconcile the project's events.config.ts to your deployment (idempotent). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying.",{check:S.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:S.string().optional().describe("path to events.config.ts (default: ./events.config.ts or ./npayload/events.config.ts)")},async({check:p,configPath:f})=>{let g=f??We(),v=await ue(g),h=Wr(v,{allowInternalUrls:en()});if(!h.ok)return{...N({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let x=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return N(x.output)}catch(x){return ce(x)}}),e.tool("events_status","Show the current sync state between events.config.ts and your deployment (a dry-run plan: what exists, what would change).",{configPath:S.string().optional()},async({configPath:p})=>{let f=p??We();try{let g=await xe({config:f,check:!0,sink:a(()=>{},"sink")});return N(g.output)}catch(g){return ce(g)}}),e.tool("connect_contract","Return what npayload Connect can do (cross-org event sharing): the connect.config.ts schema (JSON Schema) + the capability catalog + decision guide + guidance. Call FIRST to learn how to write connect.config.ts and drive the np.connect.* SDK.",async()=>N({version:dl,guidance:EE,capabilities:qw,schema:zi})),e.tool("pipes_contract","Return the npayload Pipes config schema (JSON Schema) + the capability catalog + decision guide + guidance. Call this BEFORE writing or editing pipes.config.ts \u2014 the schema returned here is the only valid source of config fields.",async()=>N({version:kv,guidance:Lw,capabilities:Uw,schema:Mi})),e.tool("connect_usage","Return server-side, copy-ready RUNTIME recipes for driving Connect from app code (set profile, explore, request/approve access grants, identity bridges, tenant approvals). Call this when writing the cross-org integration. Optionally pass a feature key to get one recipe.",{feature:S.string().optional().describe('a recipe key (e.g. "requestAccess", "createBridge"); omit to get all recipes')},async({feature:p})=>p&&Do[p]?N(Do[p]):N(p?{error:`unknown feature "${p}"`,available:Object.keys(Do)}:{version:dl,recipes:Do})),e.tool("connect_validate","Validate a connect.config.ts against the contract (structure + security). Pass the config object, OR omit it to validate the project's connect.config.ts on disk. Returns { ok, issues } with precise, fixable problems.",{config:S.union([S.record(S.string(),S.unknown()),S.string()]).optional().describe("the ConnectConfig object (or a JSON string) to validate; omit to validate connect.config.ts on disk"),configPath:S.string().optional().describe("path to connect.config.ts (used when `config` is omitted)")},async({config:p,configPath:f})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}g==null&&(g=await ue(f??xg()));let v=pl(g,{allowInternalUrls:en()});return{...N(v),isError:!v.ok}}),e.tool("pipes_validate","Validate a Pipes config against the contract (structure + security). Pass the config object, OR omit it to validate the project's pipes.config.ts on disk. Returns { ok, issues } with precise, fixable problems.",{config:S.union([S.record(S.string(),S.unknown()),S.string()]).optional().describe("the PipesConfig object (or a JSON string) to validate; omit to validate pipes.config.ts on disk"),configPath:S.string().optional().describe("path to pipes.config.ts (used when `config` is omitted)")},async({config:p,configPath:f})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}if(g==null){let h=f??Ke("pipes");if(!h)return{...N({ok:!1,error:"no pipes.config.ts found \u2014 write npayload/pipes.config.ts first (see pipes_contract)"}),isError:!0};g=await ue(h)}let v=Hr(g,{allowInternalUrls:en()});return{...N(v),isError:!v.ok}}),e.tool("pipes_deploy","Reconcile the project's pipes.config.ts to your deployment (idempotent, keyed by name). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying. Governance is admin-gated \u2014 a machine credential gets a clear 'needs admin' note, not a failure.",{check:S.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:S.string().optional().describe("path to pipes.config.ts (default: ./npayload/pipes.config.ts)")},async({check:p,configPath:f})=>{let g=f??Ke("pipes");if(!g)return{...N({ok:!1,error:"no pipes.config.ts found \u2014 write npayload/pipes.config.ts first (see pipes_contract)"}),isError:!0};let v=await ue(g),h=Hr(v,{allowInternalUrls:en()});if(!h.ok)return{...N({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let x=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return N(x.output)}catch(x){return ce(x)}}),e.tool("pipes_status","Show the current sync state between pipes.config.ts and your deployment (a dry-run plan: what exists, what would change).",{configPath:S.string().optional()},async({configPath:p})=>{let f=p??Ke("pipes");if(!f)return{...N({ok:!1,error:"no pipes.config.ts found"}),isError:!0};try{let g=await xe({config:f,check:!0,sink:a(()=>{},"sink")});return N(g.output)}catch(g){return ce(g)}});let t=a(async p=>{let{buildKernel:f}=await import("../chunk-OMUKWD3N.mjs"),g=await f(),v=await ux(g,p);if(!v)throw new Error("could not resolve appId from token; pass appId (app_\u2026)");return{kernel:g,appId:v}},"kernelAndApp"),r=a(p=>{let f=p;return f?.gid??f?.workflowGid??f?.data?.gid},"wfId"),o=6e4,n=new Map,i=a(async(p,f)=>{let g=n.get(f);if(g&&Date.now()-g.at<o)return g;let v=await p.send(_t("pipes.workflows.listConnectors")),h=v?.data??v??[],x={at:Date.now(),rows:h,index:rx(h)};return n.set(f,x),x},"fetchConnectorCatalog"),s=a((p,f)=>{try{let v=new $E({allErrors:!0,strict:!1}).compile(p);return v(f)?[]:(v.errors??[]).map(h=>`${h.instancePath||"(root)"} ${h.message??"invalid"}${h.params?` ${JSON.stringify(h.params)}`:""}`)}catch{return[]}},"ajvValidator"),c=a(async(p,f)=>{try{let{kernel:g,appId:v}=await t(f),{index:h}=await i(g,v);return{...vg(p,h,s),catalogReachable:!0}}catch(g){M(g);let v=vg(p,void 0);return{...v,warnings:[...v.warnings,"deployment unreachable \u2014 connector ids, actionIds, and params were NOT verified against the live catalog; pipes_create will verify them"],catalogReachable:!1}}},"validateAgainstLive");e.tool("pipes_catalog","Return the Pipes authoring guide + the LIVE connector catalog from your deployment: every connector, every action, and each action's FULL JSON-Schema (all params, types, enums, required) \u2014 plus the branch-handle map and the valid trigger types. Call FIRST so you author with the real, current params (no guessing).",{appId:S.string().optional().describe("app GID (app_\u2026); defaults to the token's app claim")},async({appId:p})=>{try{let{kernel:f,appId:g}=await t(p),{rows:v}=await i(f,g);return N({guidance:tx,definitionSchema:{id:Fw,version:jo,resource:gg},triggerTypes:zo,triggers:Lo,branchHandles:Yt,builtinNodeTypes:Object.entries(Xt).map(([h,x])=>({nodeType:h,backendType:x,isBrancher:h===Qt||h in Yt})),steps:[{nodeType:gr,backendType:"action",isBrancher:!1,summary:Hw,requiredConfigKeys:Ea,configKeys:dg,requiredSourceKeys:Ta,sourceKeys:pg,tenantColumn:{path:mg,summary:fg}}],connectors:v.map(h=>({connectorId:h.id??h.connectorId??h._id,category:h.category,description:h.description,tier:h.tier,needsCredential:h.auth?.type&&h.auth.type!=="none",branchHandles:Yt[h.id??h.connectorId]??((h.id??h.connectorId)===Qt?["<case name>",fr]:void 0),actions:(h.actions??[]).map(x=>({actionId:x.id,name:x.name,description:x.description,inputSchema:x.inputSchema,outputSchema:x.outputSchema}))}))})}catch(f){return ce(f)}});let l=Lo.map(p=>p.type).join("|"),u=[...Object.entries(Yt).map(([p,f])=>`${p} ${f.join("/")}`),`${Qt} <case>/${fr}`].join(", "),d=S.object({id:S.string().describe("unique node id"),nodeType:S.string().describe(`the type the engine runs (data.nodeType): a trigger (${l}), a built-in (${Object.keys(Xt).filter(p=>Xt[p]!=="trigger").join("|")}), the Study step ("${gr}"), or "${kt}" for a catalogue connector (then set connectorId from pipes_catalog; it is checked against the live catalogue). Built-ins: ${Kw}`),connectorId:S.string().optional().describe(`REQUIRED when nodeType is "${kt}": the connector id from pipes_catalog`),config:S.record(S.string(),S.unknown()).optional().describe(`data.config. A trigger: its trigger config keys (${Lo.map(p=>`${p.type}: ${p.summary}`).join(" ")}). A built-in: its settings, flat. The Study step: its settings directly under config, never under params (${Ea.join(", ")}; also ${dg.filter(p=>!Ea.includes(p)).join(", ")}); each source carries ${Ta.join(", ")} (also ${pg.filter(p=>!Ta.includes(p)).join(", ")}); ${mg}: ${fg} A connector step: ${Aa} \u2014 the action id from pipes_catalog and its params, typed by that action's inputSchema, under params (data.config.params, the only place the engine reads them).`),credentials:S.record(S.string(),S.string()).optional().describe("a connector step's credentials: { <connectorId>: <credential gid> } (data.credentials)"),label:S.string().optional()}),m=S.object({from:S.string(),to:S.string(),branch:S.string().optional().describe(`the branch a brancher is left by (${u}); omit for a step without branches`)});return e.tool("pipes_build","Compile a HIGH-LEVEL pipe spec into a CORRECT workflow definition (connector-schema nodes + explicit edge handles + branch resolution + auto-layout) AND validate it against the LIVE deployment catalog: every connectorId must exist, every actionId must be one of that connector's actions, and connector params are checked against the action's real inputSchema \u2014 so a guessed name fails HERE with a did-you-mean, not at run time. NEVER hand-write node/edge JSON \u2014 use this. Returns { definition, warnings }.",{nodes:S.array(d).describe("the steps"),edges:S.array(m).optional().describe("how steps connect"),appId:S.string().optional().describe("app GID (app_\u2026); defaults to the token's app claim \u2014 used to fetch the live connector catalog for validation")},async({appId:p,...f})=>{try{let g=hg(f),v=await c(f,p);if(!v.ok)return{...N({ok:!1,stage:"catalog-validation",issues:v.issues,warnings:v.warnings}),isError:!0};let h=yg(f);return N({ok:!0,definition:g,triggerConfig:h,...v.warnings.length?{warnings:v.warnings}:{}})}catch(g){return ce(g)}}),e.tool("pipes_create",`Create a pipe in your deployment from a high-level spec (the same spec as pipes_build) and optionally activate it. Mutating; confirm first. Include exactly ONE trigger node (nodeType ${l}) as the ENTRY node (no incoming edge) wired to the first step; the trigger config is derived from it (or omit the trigger node and pass triggerType + triggerConfig). The door validates the whole definition before it writes anything; a refusal returns PIPE_DEFINITION_INVALID with every reason (path, expected, got) and retry: true.`,{name:S.string(),description:S.string().optional(),nodes:S.array(d),edges:S.array(m).optional(),triggerType:S.enum(zo).optional().describe("the single workflow trigger (default manual)"),triggerConfig:S.record(S.string(),S.unknown()).optional().describe(`the trigger's config when the spec has no trigger node (${Lo.map(p=>`${p.type}: ${p.summary}`).join(" ")})`),activate:S.boolean().optional(),appId:S.string().optional()},async p=>{try{let f;try{f=hg({nodes:p.nodes,edges:p.edges})}catch(k){return ce(k,{stage:"build"})}let g=await c({nodes:p.nodes,edges:p.edges},p.appId);if(!g.catalogReachable)return{...N({ok:!1,stage:"catalog-validation",error:"could not fetch the connector catalog from your deployment \u2014 pipes_create refuses to create unverified workflows",warnings:g.warnings}),isError:!0};if(!g.ok)return{...N({ok:!1,stage:"catalog-validation",issues:g.issues,warnings:g.warnings}),isError:!0};let v=yg({nodes:p.nodes,edges:p.edges},{type:p.triggerType,config:p.triggerConfig}),{kernel:h}=await t(p.appId),x;try{x=await h.send({..._t("pipes.workflows.createWorkflow"),body:{name:p.name,description:p.description??"",definition:f,triggerConfig:v}})}catch(k){let O=dx(k);if(O)return{...N({...O,stage:"door"}),isError:!0};throw k}let E=r(x);return p.activate&&E&&await h.send({..._t("pipes.workflows.activateWorkflow"),pathParams:{workflowId:E},body:{}}),N({ok:!0,workflowId:E,activated:!!(p.activate&&E),nodes:f.nodes.length,edges:f.edges.length,...g.warnings.length?{warnings:g.warnings}:{}})}catch(f){return ce(f)}}),e.tool("pipes_validate_definition","Validate a pipe definition and trigger config against your deployment WITHOUT saving anything: the door applies every check it applies on create (the one pipe definition schema, your live connector catalogue, params against each action's inputSchema, credentials, branches, one reachable trigger). Pass the { definition, triggerConfig } pipes_build returned. Answers { valid: true } or PIPE_DEFINITION_INVALID with every reason (path, expected, got, didYouMean) and retry: true.",{definition:S.record(S.string(),S.unknown()).describe("the pipe definition { nodes, edges } (pipes_build's definition)"),triggerConfig:S.record(S.string(),S.unknown()).optional().describe("the trigger config { type, config } (pipes_build's triggerConfig)"),appId:S.string().optional()},async({definition:p,triggerConfig:f,appId:g})=>{try{let{kernel:v}=await t(g),h;try{h=await v.send({..._t("pipes.workflows.validateWorkflowDefinition"),body:{definition:p,...f?{triggerConfig:f}:{}}})}catch(E){let k=dx(E);if(k)return{...N({...k,stage:"door",valid:!1}),isError:!0};throw E}let x=h?.data??h;return N({ok:!0,valid:x?.valid??!0,errors:x?.errors??[],schemaVersion:jo})}catch(v){return ce(v)}}),e.resource("pipes-authoring-flow",Qw,{description:"How to author a pipe, step by step: discover the connectors, read their input schemas, draft, validate, create, run, inspect, iterate.",mimeType:"text/plain"},async p=>({contents:[{uri:p.href,mimeType:"text/plain",text:Uo}]})),e.resource("pipes-definition-schema",gg,{description:`The pipe definition JSON Schema ${jo} every pipes tool is generated from and the door validates against.`,mimeType:"application/schema+json"},async p=>({contents:[{uri:p.href,mimeType:"application/schema+json",text:JSON.stringify(ex,null,2)}]})),e.prompt(Xw,"Author an npayload pipe with the pipes tools, following the pipe-authoring flow.",{goal:S.string().optional().describe("what the pipe should do, in your words")},({goal:p})=>({messages:[{role:"user",content:{type:"text",text:`${p?`Build an npayload pipe that does this: ${p}
|
|
502
|
+
declarative intent, never auto-consent.`;function tn(){return fi()}a(tn,"allowInternalUrls");function U(e){let t=Nr(e);return{content:[{type:"text",text:typeof t=="string"?t:JSON.stringify(t,null,2)}]}}a(U,"text");function de(e,t={}){return{...U(ox(e,t)),isError:!0}}a(de,"toolFailure");function ox(e,t={}){let r=e?.code;return{ok:!1,...typeof r=="string"?{code:r}:{},type:e instanceof Error?e.name:typeof e,error:e instanceof Error?e.message:String(e),...t}}a(ox,"failureBody");function nx(e){let t=e,r=t?.details?.errors;if(!(!t||!Array.isArray(r))&&!(t.code!=="PIPE_DEFINITION_INVALID"&&t.status!==400))return{ok:!1,code:typeof t.code=="string"?t.code:"PIPE_DEFINITION_INVALID",message:typeof t.message=="string"?t.message:"The pipe definition is not valid.",errors:r,schemaVersion:qo,retry:!0,next:"Fix each reason at its path, then call pipes_validate_definition (or pipes_create) again.",...typeof t.requestId=="string"?{requestId:t.requestId}:{}}}a(nx,"pipeDefinitionRefusal");function zg(){for(let e of["connect.config.ts","connect.config.mjs","connect.config.js","npayload/connect.config.ts","npayload/connect.config.mjs","npayload/connect.config.js"]){let t=ex(process.cwd(),e);if(rx(t))return t}return ex(process.cwd(),"connect.config.ts")}a(zg,"findConnectConfig");function _A(){let e=new bA({name:"npayload",version:an()});e.tool("npayload_overview","Call this FIRST, before anything else. Returns the complete deterministic map for working on this npayload project: current project state (config found, credential source, generated artifacts), the exact ordered end-to-end workflow (each step names the MCP tool AND the CLI command), and the hard rules. Follow it step by step \u2014 never guess, never reverse-engineer.",async()=>{let p=null;try{p=Ye()}catch{p=null}let m=a(v=>rx(yA(process.cwd(),v)),"gen"),g=null;try{let{resolveCredentials:v}=await import("../chunk-C4LTBM2E.mjs");g=(await v()).source}catch{g=null}return U({version:an(),state:{eventsConfig:p,credentialSource:g,generated:{contractLock:m("npayload/_generated/contract.lock"),typedEventPayloads:m("npayload/_generated/events.d.ts"),permissions:m("npayload/permissions.generated.ts")},note:g===null?"No credential source \u2014 run `"+b("init")+"` in this project (or `"+b("doctor")+"` for diagnosis) before any deploy/status call.":"Credentials resolve automatically; never read or edit .env / .npayload.json."},...dv()})}),e.tool("events_contract","Return the npayload Events config schema (JSON Schema) + the capability catalog + decision guide + guidance. Call this BEFORE writing or editing events.config.ts \u2014 the schema returned here is the only valid source of config fields (after npayload_overview).",async()=>U({version:Er,guidance:kA,capabilities:hk,schema:pi})),e.tool("events_usage","Return server-side, copy-ready RUNTIME recipes for using Events from app code (publish variants, queue/outbox consume, streams, KV, webhook verification, catalogue, exchanges, consumer groups, DLQ, snapshots, privacy, NPP). Call this when writing the app code (not just the topology). Optionally pass a feature key to get one recipe.",{feature:$.string().optional().describe('a recipe key (e.g. "queueConsume", "webhookVerify"); omit to get all recipes')},async({feature:p})=>p&&Mo[p]?U(Mo[p]):U(p?{error:"unknown feature (the feature given is not shown here)",available:Object.keys(Mo)}:{version:Er,recipes:Mo})),e.tool("events_validate","Validate an Events config against the contract (structure + security). Pass the config object, OR omit it to validate the project's events.config.ts on disk. Returns { ok, issues } with precise, fixable problems.",{config:$.union([$.record($.string(),$.unknown()),$.string()]).optional().describe("the EventsConfig object (or a JSON string) to validate; omit to validate events.config.ts on disk"),configPath:$.string().optional().describe("path to events.config.ts (used when `config` is omitted)")},async({config:p,configPath:m})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}g==null&&(g=await le(m??Ye()));let v=Tr(g,{allowInternalUrls:tn()});return{...U(v),isError:!v.ok}}),e.tool("events_deploy","Reconcile the project's events.config.ts to your deployment (idempotent). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying.",{check:$.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:$.string().optional().describe("path to events.config.ts (default: ./events.config.ts or ./npayload/events.config.ts)")},async({check:p,configPath:m})=>{let g=m??Ye(),v=await le(g),h=Tr(v,{allowInternalUrls:tn()});if(!h.ok)return{...U({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let k=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return U(k.output)}catch(k){return de(k)}}),e.tool("events_status","Show the current sync state between events.config.ts and your deployment (a dry-run plan: what exists, what would change).",{configPath:$.string().optional()},async({configPath:p})=>{let m=p??Ye();try{let g=await xe({config:m,check:!0,sink:a(()=>{},"sink")});return U(g.output)}catch(g){return de(g)}}),e.tool("connect_contract","Return what npayload Connect can do (cross-org event sharing): the connect.config.ts schema (JSON Schema) + the capability catalog + decision guide + guidance. Call FIRST to learn how to write connect.config.ts and drive the np.connect.* SDK.",async()=>U({version:Oc,guidance:xA,capabilities:kk,schema:xy})),e.tool("pipes_contract","Return the npayload Pipes config schema (JSON Schema) + the capability catalog + decision guide + guidance. Call this BEFORE writing or editing pipes.config.ts \u2014 the schema returned here is the only valid source of config fields.",async()=>U({version:_y,guidance:yk,capabilities:vk,schema:$y})),e.tool("connect_usage","Return server-side, copy-ready RUNTIME recipes for driving Connect from app code (set profile, explore, request/approve access grants, identity bridges, tenant approvals). Call this when writing the cross-org integration. Optionally pass a feature key to get one recipe.",{feature:$.string().optional().describe('a recipe key (e.g. "requestAccess", "createBridge"); omit to get all recipes')},async({feature:p})=>p&&Fo[p]?U(Fo[p]):U(p?{error:"unknown feature (the feature given is not shown here)",available:Object.keys(Fo)}:{version:Oc,recipes:Fo})),e.tool("connect_validate","Validate a connect.config.ts against the contract (structure + security). Pass the config object, OR omit it to validate the project's connect.config.ts on disk. Returns { ok, issues } with precise, fixable problems.",{config:$.union([$.record($.string(),$.unknown()),$.string()]).optional().describe("the ConnectConfig object (or a JSON string) to validate; omit to validate connect.config.ts on disk"),configPath:$.string().optional().describe("path to connect.config.ts (used when `config` is omitted)")},async({config:p,configPath:m})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}g==null&&(g=await le(m??zg()));let v=Nc(g,{allowInternalUrls:tn()});return{...U(v),isError:!v.ok}}),e.tool("pipes_validate","Validate a Pipes config against the contract (structure + security). Pass the config object, OR omit it to validate the project's pipes.config.ts on disk. Returns { ok, issues } with precise, fixable problems.",{config:$.union([$.record($.string(),$.unknown()),$.string()]).optional().describe("the PipesConfig object (or a JSON string) to validate; omit to validate pipes.config.ts on disk"),configPath:$.string().optional().describe("path to pipes.config.ts (used when `config` is omitted)")},async({config:p,configPath:m})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}if(g==null){let h=m??He("pipes");if(!h)return{...U({ok:!1,error:"no pipes.config.ts found \u2014 write npayload/pipes.config.ts first (see pipes_contract)"}),isError:!0};g=await le(h)}let v=Ar(g,{allowInternalUrls:tn()});return{...U(v),isError:!v.ok}}),e.tool("pipes_deploy","Reconcile the project's pipes.config.ts to your deployment (idempotent, keyed by name). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying. Governance is admin-gated \u2014 a machine credential gets a clear 'needs admin' note, not a failure.",{check:$.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:$.string().optional().describe("path to pipes.config.ts (default: ./npayload/pipes.config.ts)")},async({check:p,configPath:m})=>{let g=m??He("pipes");if(!g)return{...U({ok:!1,error:"no pipes.config.ts found \u2014 write npayload/pipes.config.ts first (see pipes_contract)"}),isError:!0};let v=await le(g),h=Ar(v,{allowInternalUrls:tn()});if(!h.ok)return{...U({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let k=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return U(k.output)}catch(k){return de(k)}}),e.tool("pipes_status","Show the current sync state between pipes.config.ts and your deployment (a dry-run plan: what exists, what would change).",{configPath:$.string().optional()},async({configPath:p})=>{let m=p??He("pipes");if(!m)return{...U({ok:!1,error:"no pipes.config.ts found"}),isError:!0};try{let g=await xe({config:m,check:!0,sink:a(()=>{},"sink")});return U(g.output)}catch(g){return de(g)}});let t=a(async p=>{let{buildKernel:m}=await import("../chunk-NCKK7PHF.mjs"),g=await m(),v=await tx(g,p);if(!v)throw new Error("could not resolve appId from token; pass appId (app_\u2026)");return{kernel:g,appId:v}},"kernelAndApp"),r=a(p=>{let m=p;return m?.gid??m?.workflowGid??m?.data?.gid},"wfId"),o=6e4,n=new Map,i=a(async(p,m)=>{let g=n.get(m);if(g&&Date.now()-g.at<o)return g;let v=await p.send(St("pipes.workflows.listConnectors")),h=v?.data??v??[],k={at:Date.now(),rows:h,index:Uk(h)};return n.set(m,k),k},"fetchConnectorCatalog"),s=a((p,m)=>{try{let v=new vA({allErrors:!0,strict:!1}).compile(p);return v(m)?[]:(v.errors??[]).map(h=>`${h.instancePath||"(root)"} ${h.message??"invalid"}${h.params?` ${JSON.stringify(h.params)}`:""}`)}catch{return[]}},"ajvValidator"),c=a(async(p,m)=>{try{let{kernel:g,appId:v}=await t(m),{index:h}=await i(g,v);return{...Rg(p,h,s),catalogReachable:!0}}catch(g){F(g);let v=Rg(p,void 0);return{...v,warnings:[...v.warnings,"deployment unreachable \u2014 connector ids, actionIds, and params were NOT verified against the live catalog; pipes_create will verify them"],catalogReachable:!1}}},"validateAgainstLive");e.tool("pipes_catalog","Return the Pipes authoring guide + the LIVE connector catalog from your deployment: every connector, every action, and each action's FULL JSON-Schema (all params, types, enums, required) \u2014 plus the branch-handle map and the valid trigger types. Call FIRST so you author with the real, current params (no guessing).",{appId:$.string().optional().describe("app GID (app_\u2026); defaults to the token's app claim")},async({appId:p})=>{try{let{kernel:m,appId:g}=await t(p),{rows:v}=await i(m,g);return U({guidance:Dk,definitionSchema:{id:xk,version:qo,resource:Tg},triggerTypes:Vo,triggers:Zo,branchHandles:Qt,builtinNodeTypes:Object.entries(en).map(([h,k])=>({nodeType:h,backendType:k,isBrancher:h===Xt||h in Qt})),steps:[{nodeType:gr,backendType:"action",isBrancher:!1,summary:Ak,requiredConfigKeys:Da,configKeys:Sg,requiredSourceKeys:ja,sourceKeys:Ig,tenantColumn:{path:Pg,summary:Eg}}],connectors:v.map(h=>({connectorId:h.id??h.connectorId??h._id,category:h.category,description:h.description,tier:h.tier,needsCredential:h.auth?.type&&h.auth.type!=="none",branchHandles:Qt[h.id??h.connectorId]??((h.id??h.connectorId)===Xt?["<case name>",In]:void 0),actions:(h.actions??[]).map(k=>({actionId:k.id,name:k.name,description:k.description,inputSchema:k.inputSchema,outputSchema:k.outputSchema}))}))})}catch(m){return de(m)}});let u=Zo.map(p=>p.type).join("|"),l=[...Object.entries(Qt).map(([p,m])=>`${p} ${m.join("/")}`),`${Xt} <case>/${In}`].join(", "),d=$.object({id:$.string().describe("unique node id"),nodeType:$.string().describe(`the type the engine runs (data.nodeType): a trigger (${u}), a built-in (${Object.keys(en).filter(p=>en[p]!=="trigger").join("|")}), the Study step ("${gr}"), or "${$t}" for a catalogue connector (then set connectorId from pipes_catalog; it is checked against the live catalogue). Built-ins: ${Ek}`),connectorId:$.string().optional().describe(`REQUIRED when nodeType is "${$t}": the connector id from pipes_catalog`),config:$.record($.string(),$.unknown()).optional().describe(`data.config. A trigger: its trigger config keys (${Zo.map(p=>`${p.type}: ${p.summary}`).join(" ")}). A built-in: its settings, flat. The Study step: its settings directly under config, never under params (${Da.join(", ")}; also ${Sg.filter(p=>!Da.includes(p)).join(", ")}); each source carries ${ja.join(", ")} (also ${Ig.filter(p=>!ja.includes(p)).join(", ")}); ${Pg}: ${Eg} A connector step: ${Ua} \u2014 the action id from pipes_catalog and its params, typed by that action's inputSchema, under params (data.config.params, the only place the engine reads them).`),credentials:$.record($.string(),$.string()).optional().describe("a connector step's credentials: { <connectorId>: <credential gid> } (data.credentials)"),label:$.string().optional()}),f=$.object({from:$.string(),to:$.string(),branch:$.string().optional().describe(`the branch a brancher is left by (${l}); omit for a step without branches`)});return e.tool("pipes_build","Compile a HIGH-LEVEL pipe spec into a CORRECT workflow definition (connector-schema nodes + explicit edge handles + branch resolution + auto-layout) AND validate it against the LIVE deployment catalog: every connectorId must exist, every actionId must be one of that connector's actions, and connector params are checked against the action's real inputSchema \u2014 so a guessed name fails HERE with a did-you-mean, not at run time. NEVER hand-write node/edge JSON \u2014 use this. Returns { definition, warnings }.",{nodes:$.array(d).describe("the steps"),edges:$.array(f).optional().describe("how steps connect"),appId:$.string().optional().describe("app GID (app_\u2026); defaults to the token's app claim \u2014 used to fetch the live connector catalog for validation")},async({appId:p,...m})=>{try{let g=Ag(m),v=await c(m,p);if(!v.ok)return{...U({ok:!1,stage:"catalog-validation",issues:v.issues,warnings:v.warnings}),isError:!0};let h=Cg(m);return U({ok:!0,definition:g,triggerConfig:h,...v.warnings.length?{warnings:v.warnings}:{}})}catch(g){return de(g)}}),e.tool("pipes_create",`Create a pipe in your deployment from a high-level spec (the same spec as pipes_build) and optionally activate it. Mutating; confirm first. Include exactly ONE trigger node (nodeType ${u}) as the ENTRY node (no incoming edge) wired to the first step; the trigger config is derived from it (or omit the trigger node and pass triggerType + triggerConfig). The door validates the whole definition before it writes anything; a refusal returns PIPE_DEFINITION_INVALID with every reason (path, expected, got) and retry: true.`,{name:$.string(),description:$.string().optional(),nodes:$.array(d),edges:$.array(f).optional(),triggerType:$.enum(Vo).optional().describe("the single workflow trigger (default manual)"),triggerConfig:$.record($.string(),$.unknown()).optional().describe(`the trigger's config when the spec has no trigger node (${Zo.map(p=>`${p.type}: ${p.summary}`).join(" ")})`),activate:$.boolean().optional(),appId:$.string().optional()},async p=>{try{let m;try{m=Ag({nodes:p.nodes,edges:p.edges})}catch(_){return de(_,{stage:"build"})}let g=await c({nodes:p.nodes,edges:p.edges},p.appId);if(!g.catalogReachable)return{...U({ok:!1,stage:"catalog-validation",error:"could not fetch the connector catalog from your deployment \u2014 pipes_create refuses to create unverified workflows",warnings:g.warnings}),isError:!0};if(!g.ok)return{...U({ok:!1,stage:"catalog-validation",issues:g.issues,warnings:g.warnings}),isError:!0};let v=Cg({nodes:p.nodes,edges:p.edges},{type:p.triggerType,config:p.triggerConfig}),{kernel:h}=await t(p.appId),k;try{k=await h.send({...St("pipes.workflows.createWorkflow"),body:{name:p.name,description:p.description??"",definition:m,triggerConfig:v}})}catch(_){let N=nx(_);if(N)return{...U({...N,stage:"door"}),isError:!0};throw _}let T=r(k);return p.activate&&T&&await h.send({...St("pipes.workflows.activateWorkflow"),pathParams:{workflowId:T},body:{}}),U({ok:!0,workflowId:T,activated:!!(p.activate&&T),nodes:m.nodes.length,edges:m.edges.length,...g.warnings.length?{warnings:g.warnings}:{}})}catch(m){return de(m)}}),e.tool("pipes_validate_definition","Validate a pipe definition and trigger config against your deployment WITHOUT saving anything: the door applies every check it applies on create (the one pipe definition schema, your live connector catalogue, params against each action's inputSchema, credentials, branches, one reachable trigger). Pass the { definition, triggerConfig } pipes_build returned. Answers { valid: true } or PIPE_DEFINITION_INVALID with every reason (path, expected, got, didYouMean) and retry: true.",{definition:$.record($.string(),$.unknown()).describe("the pipe definition { nodes, edges } (pipes_build's definition)"),triggerConfig:$.record($.string(),$.unknown()).optional().describe("the trigger config { type, config } (pipes_build's triggerConfig)"),appId:$.string().optional()},async({definition:p,triggerConfig:m,appId:g})=>{try{let{kernel:v}=await t(g),h;try{h=await v.send({...St("pipes.workflows.validateWorkflowDefinition"),body:{definition:p,...m?{triggerConfig:m}:{}}})}catch(T){let _=nx(T);if(_)return{...U({..._,stage:"door",valid:!1}),isError:!0};throw T}let k=h?.data??h;return U({ok:!0,valid:k?.valid??!0,errors:k?.errors??[],schemaVersion:qo})}catch(v){return de(v)}}),e.resource("pipes-authoring-flow",Rk,{description:"How to author a pipe, step by step: discover the connectors, read their input schemas, draft, validate, create, run, inspect, iterate.",mimeType:"text/plain"},async p=>({contents:[{uri:p.href,mimeType:"text/plain",text:Go}]})),e.resource("pipes-definition-schema",Tg,{description:`The pipe definition JSON Schema ${qo} every pipes tool is generated from and the door validates against.`,mimeType:"application/schema+json"},async p=>({contents:[{uri:p.href,mimeType:"application/schema+json",text:JSON.stringify(Nk,null,2)}]})),e.prompt(Ok,"Author an npayload pipe with the pipes tools, following the pipe-authoring flow.",{goal:$.string().optional().describe("what the pipe should do, in your words")},({goal:p})=>({messages:[{role:"user",content:{type:"text",text:`${p?`Build an npayload pipe that does this: ${p}
|
|
488
503
|
|
|
489
|
-
`:""}${Uo}`}}]})),e.tool("pipes_list","List the workflows in your deployment (gid, name, status).",{appId:S.string().optional()},async({appId:p})=>{try{let{kernel:f}=await t(p),g=await f.send(_t("pipes.workflows.listWorkflows")),v=g?.data??g??[];return N(v.map(h=>({workflowId:h.gid??h.workflowGid??h._id,name:h.name,status:h.status})))}catch(f){return ce(f)}}),e.tool("pipes_get","Get one workflow incl. its full definition (nodes + edges) \u2014 useful to inspect or modify an existing pipe.",{workflowId:S.string(),appId:S.string().optional()},async({workflowId:p,appId:f})=>{try{let{kernel:g}=await t(f),v=await g.send({..._t("pipes.workflows.getWorkflow"),pathParams:{workflowId:p}});return N(v)}catch(g){return ce(g)}}),e.tool("pipes_run","Trigger one execution of a workflow (must be active). Returns the execution id + status; poll pipes_get_execution.",{workflowId:S.string(),triggerData:S.record(S.string(),S.unknown()).optional(),appId:S.string().optional()},async({workflowId:p,triggerData:f,appId:g})=>{try{let{kernel:v}=await t(g),h=await v.send({..._t("pipes.executions.triggerExecution"),pathParams:{workflowId:p},body:{triggerData:f??{}}});return N({executionId:h?.gid??h?.executionGid??h?.executionId,status:h?.status})}catch(v){return ce(v)}}),e.tool("pipes_get_execution","Get one execution's live state: overall status (running|completed|failed|cancelled) plus per-node runs with each node's status, output and error. Poll this after pipes_run until the status is terminal. The definition was already checked at create (PIPE_DEFINITION_INVALID); what fails here is the run itself (a remote call, a resolved template, a credential).",{executionId:S.string().describe("the execution id returned by pipes_run"),appId:S.string().optional()},async({executionId:p,appId:f})=>{try{let{kernel:g}=await t(f),v=await g.send({..._t("pipes.executions.getExecution"),pathParams:{executionId:p}});return N(v?.data??v)}catch(g){return ce(g)}}),e.tool("pipes_delete","Delete a workflow (works from ANY state \u2014 draft, paused, archived, active). Mutating \u2014 confirm first.",{workflowId:S.string(),appId:S.string().optional()},async({workflowId:p,appId:f})=>{try{let{kernel:g}=await t(f);return await g.send({..._t("pipes.workflows.deleteWorkflow"),pathParams:{workflowId:p}}),N({ok:!0,deleted:p})}catch(g){return ce(g)}}),e.tool("primus_contract","Return the npayload Primus (AI agents) config schema (JSON Schema) + the capability catalog + decision guide + guidance. Call this BEFORE writing or editing primus.config.ts \u2014 the schema returned here is the only valid source of config fields. Naming rule: skill/tool names are lowercase + underscores (hyphens are rejected).",async()=>N({version:_v,guidance:zw,capabilities:Mw,schema:Tt})),e.tool("primus_validate","Validate a Primus config against the contract PLUS the platform preflight the schema can't express: skill/tool naming rule (lowercase + underscores, NO hyphens \u2014 the platform hard-rejects them) and trigger\u2192agent parent references. Pass the config object, OR omit it to validate the project's primus.config.ts on disk. Returns { ok, issues }.",{config:S.union([S.record(S.string(),S.unknown()),S.string()]).optional().describe("the PrimusConfig object (or a JSON string) to validate; omit to validate primus.config.ts on disk"),configPath:S.string().optional().describe("path to primus.config.ts (used when `config` is omitted)")},async({config:p,configPath:f})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}if(g==null){let h=f??Ke("primus");if(!h)return{...N({ok:!1,error:"no primus.config.ts found \u2014 write npayload/primus.config.ts first (see primus_contract)"}),isError:!0};g=await ue(h)}let v=Yr(g,{allowInternalUrls:en()});return{...N(v),isError:!v.ok}}),e.tool("primus_deploy","Reconcile the project's primus.config.ts (agents / skills / tools / triggers) to your AI deployment \u2014 idempotent, keyed by name; triggers attach to their agent by NAME (resolved at deploy). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying.",{check:S.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:S.string().optional().describe("path to primus.config.ts (default: ./npayload/primus.config.ts)")},async({check:p,configPath:f})=>{let g=f??Ke("primus");if(!g)return{...N({ok:!1,error:"no primus.config.ts found \u2014 write npayload/primus.config.ts first (see primus_contract)"}),isError:!0};let v=await ue(g),h=Yr(v,{allowInternalUrls:en()});if(!h.ok)return{...N({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let x=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return N(x.output)}catch(x){return ce(x)}}),e.tool("primus_status","Show the current sync state between primus.config.ts and your AI deployment (a dry-run plan: what exists, what would change).",{configPath:S.string().optional()},async({configPath:p})=>{let f=p??Ke("primus");if(!f)return{...N({ok:!1,error:"no primus.config.ts found"}),isError:!0};try{let g=await xe({config:f,check:!0,sink:a(()=>{},"sink")});return N(g.output)}catch(g){return ce(g)}}),e.tool("npayload_status","Diagnose the npayload environment: API, auth and token endpoint reachability, which credential source is available, and whether this project's pinned contract and generated permissions are in sync \u2014 each failure with a one-line remediation. Call this FIRST whenever another tool returns a connection or authorization error.",async()=>{try{let{buildReport:p}=await import("../chunk-F455VQCQ.mjs"),f=await p(),g={code:"TRANSPORT_UNAVAILABLE",type:"TransportUnavailableError"};return N({ok:f.authReady&&f.stack.apiReachable&&f.stack.mintReachable,endpoints:{api:{url:f.stack.apiUrl,reachable:f.stack.apiReachable,probe:f.stack.apiProbe,...f.stack.apiProbe==="refused"?g:{}},auth:f.stack.authUrl?{url:f.stack.authUrl,reachable:f.stack.authReachable,probe:f.stack.authProbe,...f.stack.authProbe==="refused"?g:{}}:void 0,token:{url:f.stack.mintUrl,reachable:f.stack.mintReachable,probe:f.stack.mintProbe,...f.stack.mintProbe==="refused"?g:{}}},credentials:f.credentials,project:{contractPin:f.stack.contractLock,generatedPermissions:f.stack.permissions},remediation:f.remediation})}catch(p){return ce(p)}}),e.tool("npayload_catalog",`Discover the FULL npayload op surface across ALL products (events, pipes, connect, feed, primus, account, \u2026). Returns every op grouped by product, each with { key, method, path, summary, isQuery, idempotent, scopes, pathParams, args }. The "key" is what you pass to npayload_invoke. Call this FIRST to learn what you can do, then npayload_invoke to do it. Pass a "product" to filter (products: ${Na().join(", ")}).`,{product:S.string().optional().describe(`filter to one product, e.g. ${Na().slice(0,4).join(", ")}; omit for the full catalog`)},async({product:p})=>{try{let f=ix(p);return p&&f.products.length===0?{...N({ok:!1,error:`no product "${p}"`,products:Na()}),isError:!0}:N(f)}catch(f){return ce(f)}}),e.tool("connect_deploy","Reconcile the project's connect.config.ts to the ADMIN control plane (idempotent; admin is the source of truth and syncs to cells). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying. Declaring a bridge/grant is an OFFER (pending) \u2014 the other org confirms in its own config.",{check:S.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:S.string().optional().describe("path to connect.config.ts (default: ./connect.config.ts or ./npayload/connect.config.ts)")},async({check:p,configPath:f})=>{let g=f??xg(),v=await ue(g),h=pl(v,{allowInternalUrls:en()});if(!h.ok)return{...N({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let x=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return N(x.output)}catch(x){return ce(x)}}),e.tool("connect_status","Show the current sync state between connect.config.ts and the admin control plane (a dry-run plan: what exists, what would change).",{configPath:S.string().optional()},async({configPath:p})=>{let f=p??xg();try{let g=await xe({config:f,check:!0,sink:a(()=>{},"sink")});return N(g.output)}catch(g){return ce(g)}}),e.tool("npayload_invoke",`Invoke ANY npayload op by its catalog "key" (from npayload_catalog), e.g. "events.channels.list", "connect.connectAccess.listMyGrants", "feed.listings.create", "primus.agents.create", "account.environments.create". Pass "args" keyed by the op's arg names \u2014 path params and body/query fields together; this tool splits them per the op's contract. Path params named "appId" are auto-resolved from your token when omitted. Dispatches as your authenticated client (bounded by your own token scopes \u2014 no escalation). WARNING: ops where isQuery is false MUTATE state; ALWAYS confirm with the user before invoking a mutating op (create/update/delete/publish/trigger/\u2026).`,{key:S.string().describe('the op key from npayload_catalog, e.g. "events.channels.create"'),args:S.record(S.string(),S.unknown()).optional().describe("op args keyed by arg name (path params + body/query); see the op's pathParams/args in npayload_catalog")},async({key:p,args:f})=>{try{let{buildKernel:g}=await import("../chunk-OMUKWD3N.mjs"),v=Ra({key:p})==="primus"?ne(process.env.NPAYLOAD_PRIMUS_API_URL,"primusApiUrl"):void 0,h=await g(v||void 0),{row:x,request:E}=await cx(p,f,{resolveAppId:a(()=>ux(h),"resolveAppId"),newIdempotencyKey:a(()=>globalThis.crypto.randomUUID(),"newIdempotencyKey")}),k=await h.send(E);return N({ok:!0,key:p,method:x.method,path:E.path,mutating:!x.isQuery,result:k})}catch(g){return g instanceof Sn?ce(g,{suggestions:g.suggestions}):ce(g)}}),e}a(TE,"buildServer");function mx(e){e.command("mcp").description("npayload MCP server for your coding agent (local stdio)").command("serve",{isDefault:!0}).description("Run the MCP server on stdio (Claude / Cursor / Codex connect to this)").action(async()=>{ox(await Vh());let r=TE(),o=new IE;await r.connect(o)})}a(mx,"registerMcp");import{existsSync as Eg,readFileSync as QE,watch as XE}from"fs";import{resolve as eT,join as Ka}from"path";import tn from"chalk";import le from"chalk";import{createHash as HE}from"crypto";import{readFileSync as YE}from"fs";import{existsSync as Fo,readFileSync as Ig,writeFileSync as Fa,mkdirSync as bx}from"fs";import{resolve as wx,join as Ot,dirname as xx}from"path";import _e from"chalk";function Da(e,t){return ja(e)===ja(t)}a(Da,"deepEqual");function ja(e){if(e===null||typeof e!="object")return JSON.stringify(e)??"null";if(Array.isArray(e))return`[${e.map(ja).join(",")}]`;let t=e;return`{${Object.keys(t).sort().map(o=>`${JSON.stringify(o)}:${ja(t[o])}`).join(",")}}`}a(ja,"stableStringify");var AE=a(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj");function gx(e,t,r){let o={},n=[],i=[],s=[],c=fx(t,r);for(let l of c){let u=t[l]??{},d=r[l]??{},m=e[l]??{},p={};for(let f of fx(u,d)){let g=u[f],v=d[f],h=m[f];if(g&&!v){p[f]=ot(g),s.push({resource:l,key:f});continue}if(!g&&v){p[f]=ot(v),n.push({resource:l,key:f,kind:"add-entry",value:ot(v)});continue}if(!g||!v)continue;let x={};for(let E of CE(h,g,v)){let k=h?E in h:!1,O=E in g,A=E in v,j=h?.[E],L=g[E],K=v[E];if(O&&A)Da(L,K)?x[E]=ot(L):k&&Da(L,j)?(x[E]=ot(K),n.push({resource:l,key:f,field:E,kind:"update-field",value:ot(K)})):k&&Da(K,j)?x[E]=ot(L):(x[E]=ot(L),i.push({resource:l,key:f,field:E,base:j,local:L,remote:K}));else if(O&&!A)x[E]=ot(L);else if(!O&&A){if(k&&Da(K,j))continue;x[E]=ot(K),n.push({resource:l,key:f,field:E,kind:"add-field",value:ot(K)})}}p[f]=x}Object.keys(p).length&&(o[l]=p)}return{merged:o,changes:n,conflicts:i,localOnly:s}}a(gx,"threeWayMergeConfig");function fx(e,t){return Array.from(new Set([...Object.keys(e),...Object.keys(t)]))}a(fx,"unionKeys");function CE(...e){let t=new Set;for(let r of e)if(AE(r))for(let o of Object.keys(r))t.add(o);return Array.from(t)}a(CE,"unionFieldKeys");function ot(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}a(ot,"clone");var Mo;async function RE(){if(Mo!==void 0)return Mo;try{Mo=(await import("typescript")).default??await import("typescript")}catch{Mo=null}return Mo}a(RE,"loadTs");function hr(e,t=0){let r=" ".repeat(t),o=" ".repeat(t+1);if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
490
|
-
${e.map(i=>`${o}${
|
|
504
|
+
`:""}${Go}`}}]})),e.tool("pipes_list","List the workflows in your deployment (gid, name, status).",{appId:$.string().optional()},async({appId:p})=>{try{let{kernel:m}=await t(p),g=await m.send(St("pipes.workflows.listWorkflows")),v=g?.data??g??[];return U(v.map(h=>({workflowId:h.gid??h.workflowGid??h._id,name:h.name,status:h.status})))}catch(m){return de(m)}}),e.tool("pipes_get","Get one workflow incl. its full definition (nodes + edges) \u2014 useful to inspect or modify an existing pipe.",{workflowId:$.string(),appId:$.string().optional()},async({workflowId:p,appId:m})=>{try{let{kernel:g}=await t(m),v=await g.send({...St("pipes.workflows.getWorkflow"),pathParams:{workflowId:p}});return U(v)}catch(g){return de(g)}}),e.tool("pipes_run","Trigger one execution of a workflow (must be active). Returns the execution id + status; poll pipes_get_execution.",{workflowId:$.string(),triggerData:$.record($.string(),$.unknown()).optional(),appId:$.string().optional()},async({workflowId:p,triggerData:m,appId:g})=>{try{let{kernel:v}=await t(g),h=await v.send({...St("pipes.executions.triggerExecution"),pathParams:{workflowId:p},body:{triggerData:m??{}}});return U({executionId:h?.gid??h?.executionGid??h?.executionId,status:h?.status})}catch(v){return de(v)}}),e.tool("pipes_get_execution","Get one execution's live state: overall status (running|completed|failed|cancelled) plus per-node runs with each node's status, output and error. Poll this after pipes_run until the status is terminal. The definition was already checked at create (PIPE_DEFINITION_INVALID); what fails here is the run itself (a remote call, a resolved template, a credential).",{executionId:$.string().describe("the execution id returned by pipes_run"),appId:$.string().optional()},async({executionId:p,appId:m})=>{try{let{kernel:g}=await t(m),v=await g.send({...St("pipes.executions.getExecution"),pathParams:{executionId:p}});return U(v?.data??v)}catch(g){return de(g)}}),e.tool("pipes_delete","Delete a workflow (works from ANY state \u2014 draft, paused, archived, active). Mutating \u2014 confirm first.",{workflowId:$.string(),appId:$.string().optional()},async({workflowId:p,appId:m})=>{try{let{kernel:g}=await t(m);return await g.send({...St("pipes.workflows.deleteWorkflow"),pathParams:{workflowId:p}}),U({ok:!0,deleted:p})}catch(g){return de(g)}}),e.tool("primus_contract","Return the npayload Primus (AI agents) config schema (JSON Schema) + the capability catalog + decision guide + guidance. Call this BEFORE writing or editing primus.config.ts \u2014 the schema returned here is the only valid source of config fields. Naming rule: skill/tool names are lowercase + underscores (hyphens are rejected).",async()=>U({version:Sy,guidance:bk,capabilities:wk,schema:ln})),e.tool("primus_validate","Validate a Primus config against the contract PLUS the platform preflight the schema can't express: skill/tool naming rule (lowercase + underscores, NO hyphens \u2014 the platform hard-rejects them) and trigger\u2192agent parent references. Pass the config object, OR omit it to validate the project's primus.config.ts on disk. Returns { ok, issues }.",{config:$.union([$.record($.string(),$.unknown()),$.string()]).optional().describe("the PrimusConfig object (or a JSON string) to validate; omit to validate primus.config.ts on disk"),configPath:$.string().optional().describe("path to primus.config.ts (used when `config` is omitted)")},async({config:p,configPath:m})=>{let g=p;if(typeof g=="string")try{g=JSON.parse(g)}catch{}if(g==null){let h=m??He("primus");if(!h)return{...U({ok:!1,error:"no primus.config.ts found \u2014 write npayload/primus.config.ts first (see primus_contract)"}),isError:!0};g=await le(h)}let v=Cr(g,{allowInternalUrls:tn()});return{...U(v),isError:!v.ok}}),e.tool("primus_deploy","Reconcile the project's primus.config.ts (agents / skills / tools / triggers) to your AI deployment \u2014 idempotent, keyed by name; triggers attach to their agent by NAME (resolved at deploy). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying.",{check:$.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:$.string().optional().describe("path to primus.config.ts (default: ./npayload/primus.config.ts)")},async({check:p,configPath:m})=>{let g=m??He("primus");if(!g)return{...U({ok:!1,error:"no primus.config.ts found \u2014 write npayload/primus.config.ts first (see primus_contract)"}),isError:!0};let v=await le(g),h=Cr(v,{allowInternalUrls:tn()});if(!h.ok)return{...U({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let k=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return U(k.output)}catch(k){return de(k)}}),e.tool("primus_status","Show the current sync state between primus.config.ts and your AI deployment (a dry-run plan: what exists, what would change).",{configPath:$.string().optional()},async({configPath:p})=>{let m=p??He("primus");if(!m)return{...U({ok:!1,error:"no primus.config.ts found"}),isError:!0};try{let g=await xe({config:m,check:!0,sink:a(()=>{},"sink")});return U(g.output)}catch(g){return de(g)}}),e.tool("npayload_status","Diagnose the npayload environment: API, auth and token endpoint reachability, which credential source is available, and whether this project's pinned contract and generated permissions are in sync \u2014 each failure with a one-line remediation. Call this FIRST whenever another tool returns a connection or authorization error.",async()=>{try{let{buildReport:p}=await import("../chunk-ERQXEWTC.mjs"),m=await p(),g={code:"TRANSPORT_UNAVAILABLE",type:"TransportUnavailableError"};return U({ok:m.authReady&&m.stack.apiReachable&&m.stack.mintReachable,endpoints:{api:{url:m.stack.apiUrl,reachable:m.stack.apiReachable,probe:m.stack.apiProbe,...m.stack.apiProbe==="refused"?g:{}},auth:m.stack.authUrl?{url:m.stack.authUrl,reachable:m.stack.authReachable,probe:m.stack.authProbe,...m.stack.authProbe==="refused"?g:{}}:void 0,token:{url:m.stack.mintUrl,reachable:m.stack.mintReachable,probe:m.stack.mintProbe,...m.stack.mintProbe==="refused"?g:{}}},credentials:m.credentials,project:{contractPin:m.stack.contractLock,generatedPermissions:m.stack.permissions},remediation:m.remediation})}catch(p){return de(p)}}),e.tool("npayload_catalog",`Discover the FULL npayload op surface across ALL products (events, pipes, connect, feed, primus, account, \u2026). Returns every op grouped by product, each with { key, method, path, summary, isQuery, idempotent, scopes, pathParams, args }. The "key" is what you pass to npayload_invoke. Call this FIRST to learn what you can do, then npayload_invoke to do it. Pass a "product" to filter (products: ${Fa().join(", ")}).`,{product:$.string().optional().describe(`filter to one product, e.g. ${Fa().slice(0,4).join(", ")}; omit for the full catalog`)},async({product:p})=>{try{let m=zk(p);return p&&m.products.length===0?{...U({ok:!1,error:"no product matches the product given (it is not shown here)",products:Fa()}),isError:!0}:U(m)}catch(m){return de(m)}}),e.tool("connect_deploy","Reconcile the project's connect.config.ts to your deployment (idempotent). Validates first; pass check:true for a dry-run plan. Mutating: confirm before applying. Declaring a bridge/grant is an OFFER (pending) \u2014 the other org confirms in its own config.",{check:$.boolean().optional().describe("dry run: print the plan, apply nothing"),configPath:$.string().optional().describe("path to connect.config.ts (default: ./connect.config.ts or ./npayload/connect.config.ts)")},async({check:p,configPath:m})=>{let g=m??zg(),v=await le(g),h=Nc(v,{allowInternalUrls:tn()});if(!h.ok)return{...U({error:"config invalid \u2014 fix before deploy",issues:h.issues}),isError:!0};try{let k=await xe({config:g,check:p??!1,sink:a(()=>{},"sink")});return U(k.output)}catch(k){return de(k)}}),e.tool("connect_status","Show the current sync state between connect.config.ts and your deployment (a dry-run plan: what exists, what would change).",{configPath:$.string().optional()},async({configPath:p})=>{let m=p??zg();try{let g=await xe({config:m,check:!0,sink:a(()=>{},"sink")});return U(g.output)}catch(g){return de(g)}}),e.tool("npayload_invoke",`Invoke ANY npayload op by its catalog "key" (from npayload_catalog), e.g. "events.channels.list", "connect.connectAccess.listMyGrants", "feed.listings.create", "primus.agents.create", "account.environments.create". Pass "args" keyed by the op's arg names \u2014 path params and body/query fields together; this tool splits them per the op's contract. Path params named "appId" are auto-resolved from your token when omitted. Dispatches as your authenticated client (bounded by your own token scopes \u2014 no escalation). WARNING: ops where isQuery is false MUTATE state; ALWAYS confirm with the user before invoking a mutating op (create/update/delete/publish/trigger/\u2026).`,{key:$.string().describe('the op key from npayload_catalog, e.g. "events.channels.create"'),args:$.record($.string(),$.unknown()).optional().describe("op args keyed by arg name (path params + body/query); see the op's pathParams/args in npayload_catalog")},async({key:p,args:m})=>{let g;try{let{buildKernel:v}=await import("../chunk-NCKK7PHF.mjs"),h=za({key:p})==="primus"?se(process.env.NPAYLOAD_PRIMUS_API_URL,"primusApiUrl"):void 0,k=await v(h||void 0),T=await qk(p,m,{resolveAppId:a(()=>tx(k),"resolveAppId"),newIdempotencyKey:a(()=>globalThis.crypto.randomUUID(),"newIdempotencyKey")});g=T.row;let{request:_}=T,N=await k.send(_);return U({ok:!0,key:p,method:g.method,path:_.path,mutating:!g.isQuery,result:hi(g,N,_)})}catch(v){let h=v instanceof Pn?{suggestions:v.suggestions}:{};return{...U(Dr(g,ox(v,h))),isError:!0}}}),Xk(e),e}a(_A,"buildServer");function ix(e){e.command("mcp").description("npayload MCP server for your coding agent (local stdio)").command("serve",{isDefault:!0}).description("Run the MCP server on stdio (Claude / Cursor / Codex connect to this)").action(async()=>{Lk(await ly());let r=_A(),o=new wA;await r.connect(o)})}a(ix,"registerMcp");import{existsSync as Bg,readFileSync as KA,watch as JA}from"fs";import{resolve as WA,join as rc}from"path";import nn from"chalk";import ue from"chalk";import{createHash as VA}from"crypto";import{readFileSync as BA}from"fs";import{existsSync as Wo,readFileSync as Gg,writeFileSync as Ya,mkdirSync as dx}from"fs";import{resolve as px,join as Nt,dirname as fx}from"path";import $e from"chalk";function Ga(e,t){return Va(e)===Va(t)}a(Ga,"deepEqual");function Va(e){if(e===null||typeof e!="object")return JSON.stringify(e)??"null";if(Array.isArray(e))return`[${e.map(Va).join(",")}]`;let t=e;return`{${Object.keys(t).sort().map(o=>`${JSON.stringify(o)}:${Va(t[o])}`).join(",")}}`}a(Va,"stableStringify");var $A=a(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj");function ax(e,t,r){let o={},n=[],i=[],s=[],c=sx(t,r);for(let u of c){let l=t[u]??{},d=r[u]??{},f=e[u]??{},p={};for(let m of sx(l,d)){let g=l[m],v=d[m],h=f[m];if(g&&!v){p[m]=st(g),s.push({resource:u,key:m});continue}if(!g&&v){p[m]=st(v),n.push({resource:u,key:m,kind:"add-entry",value:st(v)});continue}if(!g||!v)continue;let k={};for(let T of SA(h,g,v)){let _=h?T in h:!1,N=T in g,I=T in v,j=h?.[T],z=g[T],W=v[T];if(N&&I)Ga(z,W)?k[T]=st(z):_&&Ga(z,j)?(k[T]=st(W),n.push({resource:u,key:m,field:T,kind:"update-field",value:st(W)})):_&&Ga(W,j)?k[T]=st(z):(k[T]=st(z),i.push({resource:u,key:m,field:T,base:j,local:z,remote:W}));else if(N&&!I)k[T]=st(z);else if(!N&&I){if(_&&Ga(W,j))continue;k[T]=st(W),n.push({resource:u,key:m,field:T,kind:"add-field",value:st(W)})}}p[m]=k}Object.keys(p).length&&(o[u]=p)}return{merged:o,changes:n,conflicts:i,localOnly:s}}a(ax,"threeWayMergeConfig");function sx(e,t){return Array.from(new Set([...Object.keys(e),...Object.keys(t)]))}a(sx,"unionKeys");function SA(...e){let t=new Set;for(let r of e)if($A(r))for(let o of Object.keys(r))t.add(o);return Array.from(t)}a(SA,"unionFieldKeys");function st(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}a(st,"clone");var Ko;async function IA(){if(Ko!==void 0)return Ko;try{Ko=(await import("typescript")).default??await import("typescript")}catch{Ko=null}return Ko}a(IA,"loadTs");function yr(e,t=0){let r=" ".repeat(t),o=" ".repeat(t+1);if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.length===0?"[]":`[
|
|
505
|
+
${e.map(i=>`${o}${yr(i,t+1)}`).join(`,
|
|
491
506
|
`)},
|
|
492
507
|
${r}]`;if(typeof e=="object"){let n=e,i=Object.keys(n);return i.length===0?"{}":`{
|
|
493
|
-
${i.map(c=>`${o}${
|
|
508
|
+
${i.map(c=>`${o}${Ka(c)}: ${yr(n[c],t+1)}`).join(`,
|
|
494
509
|
`)},
|
|
495
|
-
${r}}`}return JSON.stringify(e)??"null"}a(
|
|
496
|
-
`,h-1)+1,
|
|
497
|
-
`,
|
|
498
|
-
${h}`);c.push(
|
|
499
|
-
${
|
|
510
|
+
${r}}`}return JSON.stringify(e)??"null"}a(yr,"toTsLiteral");function Ka(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)?e:JSON.stringify(e)}a(Ka,"tsKey");async function Ja(e,t){if(t.changes.length+t.conflicts.length===0)return{ok:!0,text:e,applied:0};let o=await IA();if(!o)return{ok:!1,applied:0,reason:"typescript not available"};let n=o.createSourceFile("config.ts",e,o.ScriptTarget.Latest,!0),i,s=a(h=>{if(!i){if(o.isCallExpression(h)){let k=h.expression.getText(n);if(/define\w*Config$/.test(k)&&h.arguments.length>=1){let T=h.arguments[0];o.isObjectLiteralExpression(T)&&(i=T)}}o.forEachChild(h,s)}},"visit");if(s(n),!i)return{ok:!1,applied:0,reason:"define*Config({...}) object not found"};let c=[],u=a((h,k)=>h.properties.find(T=>o.isPropertyAssignment(T)&&PA(o,n,T)===k),"propByName"),l=a(h=>{let k=e.lastIndexOf(`
|
|
511
|
+
`,h-1)+1,T=/^[ \t]*/.exec(e.slice(k,h));return T?T[0]:""},"indentOf"),d=0,f=a(h=>({ok:!1,applied:0,reason:h}),"fail"),p=new Map;for(let h of t.changes){if(h.kind!=="add-entry"||u(i,h.resource))continue;let k=p.get(h.resource)??{};k[h.key]=h.value,p.set(h.resource,k)}for(let h of t.changes){let k=u(i,h.resource)?.initializer;if(h.kind==="add-entry"){if(!k){if(p.has(h.resource)){d++;continue}return f(`resource "${h.resource}" not found for add-entry`)}if(!o.isObjectLiteralExpression(k))return f(`resource "${h.resource}" is not an object literal (add-entry)`);let B=l(k.getStart(n))+" ",L=`${Ka(h.key)}: ${yr(h.value,Ba(B))}`;c.push(Mg(o,n,k,L,B)),d++;continue}if(!k||!o.isObjectLiteralExpression(k))return f(`resource "${h.resource}" not found`);let T=u(k,h.key)?.initializer;if(!T||!o.isObjectLiteralExpression(T))return f(`entry "${h.resource}.${h.key}" not found`);let _=(h.field??"").split("."),N=T,I=!0;for(let B=0;B<_.length-1;B++){let L=u(N,_[B])?.initializer;if(!L||!o.isObjectLiteralExpression(L)){I=!1;break}N=L}if(!I)return f(`nested path "${h.resource}.${h.key}.${h.field}" not found`);let j=_[_.length-1],z=h.trailingComment?` ${h.trailingComment}`:"",W=u(N,j);if(h.kind==="add-field"||!W){let B=l(N.getStart(n))+" ",L=`${Ka(j)}: ${yr(h.value,Ba(B))}${z}`;c.push(Mg(o,n,N,L,B)),d++}else if(h.kind==="update-field"){let B=W.initializer,L=yr(h.value,Ba(l(W.getStart(n))));if(z){let K=e.indexOf(`
|
|
512
|
+
`,B.getEnd());c.push({start:B.getStart(n),end:K===-1?B.getEnd():K,text:`${L},${z}`})}else c.push({start:B.getStart(n),end:B.getEnd(),text:L});d++}}if(p.size>0){let h=l(i.getStart(n))+" ",k=Array.from(p,([T,_])=>`${Ka(T)}: ${yr(_,Ba(h))}`).join(`,
|
|
513
|
+
${h}`);c.push(Mg(o,n,i,k,h))}for(let h of t.conflicts){let k=u(i,h.resource)?.initializer;if(!k||!o.isObjectLiteralExpression(k))continue;let T=u(k,h.key)?.initializer;if(!T||!o.isObjectLiteralExpression(T))continue;let _=u(T,h.field);if(!_)continue;let N=l(_.getStart(n)),I=`/* CONFLICT (np pull): live=${Fg(h.remote)} ; keeping local ${Fg(h.local)} (was ${Fg(h.base)}). Resolve, then re-pull. */
|
|
514
|
+
${N}`;c.push({start:_.getStart(n),end:_.getStart(n),text:I}),d++}c.sort((h,k)=>k.start-h.start);let m=e;for(let h of c)m=m.slice(0,h.start)+h.text+m.slice(h.end);return(o.createSourceFile("check.ts",m,o.ScriptTarget.Latest,!0).parseDiagnostics??[]).length>0?f("merged output failed re-parse (kept original)"):{ok:!0,text:m,applied:d}}a(Ja,"applyThreeWayMerge");function PA(e,t,r){let o=r.name;return e.isIdentifier(o)||e.isStringLiteral(o)?o.text:o.getText(t)}a(PA,"propName");function Mg(e,t,r,o,n){let i=r.getEnd()-1,s=r.properties.length>0,c="";if(s){let l=r.properties[r.properties.length-1],d=t.text.slice(l.getEnd(),i);!/,\s*$/.test(t.text.slice(l.getEnd()-1,l.getEnd()))&&!d.includes(",")&&(c=",")}let u=n.slice(2);return{start:i,end:i,text:`${c}
|
|
500
515
|
${n}${o},
|
|
501
|
-
${
|
|
502
|
-
`)){let o=r.trim();if(!o||o.startsWith("#"))continue;let n=o.indexOf("=");if(!(n===-1||o.slice(0,n).trim()!==t))return o.slice(n+1).trim().replace(/^["']|["']$/g,"")}}catch{}}a(
|
|
516
|
+
${u}`}}a(Mg,"insertIntoObject");function Ba(e){return Math.floor(e.replace(/\t/g," ").length/2)}a(Ba,"indentLevel");function Fg(e){let t=JSON.stringify(e);return t&&t.length>80?t.slice(0,77)+"...":t??"undefined"}a(Fg,"jsonInline");var EA=[{name:"events",define:"defineEventsConfig",resources:Lh,files:["npayload/events.config.ts","npayload/events.config.mjs","npayload/events.config.js","events.config.ts","events.config.mjs","events.config.js"],plane:"cell",schema:pi},{name:"primus",define:"definePrimusConfig",resources:zh,files:["npayload/primus.config.ts","npayload/primus.config.mjs","npayload/primus.config.js","primus.config.ts","primus.config.mjs","primus.config.js"],plane:"primus",schema:ln}],TA=new Set(["gid","_id","_creationTime","id","createdAt","updatedAt","ownerId","ownerType","orgId","appId","status","subscriptionGid","exchangeGid","consumerGroupGid","messageCount","lastMessageAt","createdBy","version","brainAgentId","environmentId","tenantId"]),AA=new Set(["connect_receiving","feed_receiving"]);function Wa(e){return typeof e=="string"?e.length>0:e!=null&&e!==!1}a(Wa,"present");function CA(e){if(e.isSystemChannel===!0)return!0;let t=typeof e.slug=="string"?e.slug:"";return t.startsWith("_system.")||t==="_system"?!0:(t.split(".")[0]??"").toLowerCase()==="system"}a(CA,"isAutoCreatedSystemRow");function RA(e){let t=e.metadata,r=t!==null&&typeof t=="object"?t:void 0;return Wa(r?.connectGrantGid)||Wa(r?.feedBindingGid)||Wa(e.connectGrantGid)||Wa(e.feedBindingGid)||typeof e.origin=="string"&&AA.has(e.origin)}a(RA,"isSystemManagedRow");function OA(e,t){if(Wo(e))try{for(let r of Gg(e,"utf8").split(`
|
|
517
|
+
`)){let o=r.trim();if(!o||o.startsWith("#"))continue;let n=o.indexOf("=");if(!(n===-1||o.slice(0,n).trim()!==t))return o.slice(n+1).trim().replace(/^["']|["']$/g,"")}}catch{}}a(OA,"readEnvVar");function NA(e){if(e)return e;let t=process.env.NPAYLOAD_APP_ID?.trim();if(t)return t;for(let r of[Nt(process.cwd(),".env"),Nt(process.cwd(),"npayload",".env")]){let o=OA(r,"NPAYLOAD_APP_ID");if(o)return o}}a(NA,"resolveAppGid");function cx(e){return/^[a-z]{2,6}_[A-Za-z0-9]{4,}$/.test(e)}a(cx,"looksLikeGid");function qg(e){if(Array.isArray(e))return e;if(e&&typeof e=="object")for(let t of["data","items","channels","subscriptions","agents","skills","tools","results"]){let r=e[t];if(Array.isArray(r))return r}return[]}a(qg,"asRows");function DA(e){return(e.match(/:([A-Za-z0-9_]+)/g)??[]).map(t=>t.slice(1))}a(DA,"paramsOf");function jA(e){return e.replace(/:([A-Za-z0-9_]+)/g,"{$1}")}a(jA,"toTemplate");function ux(e,t){let n=e.properties?.[t]?.additionalProperties;return n&&typeof n=="object"?n:null}a(ux,"entrySchemaOf");function UA(e,t){for(let[r,o]of Object.entries(t?.properties??{})){let n=o.enum,i=e[r];if(Array.isArray(n)&&typeof i=="string"&&!n.includes(i))return r}}a(UA,"undeclarableField");function Zg(e,t,r={}){if(!e||t===null||t===void 0)return e?t??void 0:void 0;if(e.properties&&typeof t=="object"&&!Array.isArray(t)){let o={};for(let[n,i]of Object.entries(e.properties)){let s=Zg(i,t[n],{fieldName:n,secret:r.secret});s!==void 0&&(o[n]=s)}return Object.keys(o).length?o:void 0}return e.additionalProperties&&typeof t=="object"&&!Array.isArray(t)?r.fieldName==="headers"&&r.secret?Fh(t,r.secret):t:e.items&&Array.isArray(t)?t.map(o=>Zg(e.items,o,r)).filter(o=>o!==void 0):typeof t=="object"&&!Array.isArray(t)?void 0:t}a(Zg,"projectToSchema");function LA(e,t,r,o){let n={},i=typeof e[t]=="string"?{...o?{app:o}:{},channel:String(e[t])}:void 0;for(let[s,c]of Object.entries(e))if(!(s===t||TA.has(s))&&c!=null)if(r){let u=r.properties?.[s];if(!u)continue;let l=Zg(u,c,{fieldName:s,...i?{secret:i}:{}});l!==void 0&&(n[s]=l)}else n[s]=c;return n}a(LA,"projectRow");var zA=new Set(ke.commands.filter(e=>(e.flags??[]).some(t=>t.name==="appId")).map(e=>`${e.method} ${e.pattern}`));function MA(e){let t=se(process.env.NPAYLOAD_PRIMUS_API_URL,"primusApiUrl"),r=on(e);return t!==void 0&&r!==void 0&&t.replace(/\/+$/,"")===r.replace(/\/+$/,"")?"NPAYLOAD_PRIMUS_API_URL":"NPAYLOAD_API_URL"}a(MA,"endpointVarOf");async function FA(e,t,r,o,n,i,s=zA){let c=a((g,v,h,k)=>e.send({method:g,path:jA(v),...Object.keys(h).length?{pathParams:h}:{},...k&&Object.keys(k).length?{query:k}:{}}),"send"),u={},l=new Map,d=new Map,f=["agentGid","channelGid","channels"],p={channels:0,tools:0,skills:1,agents:2,triggers:3},m=Object.keys(t).sort((g,v)=>(p[g]??99)-(p[v]??99));for(let g of m){let v=t[g],h=v.ops?.list;if(!h)continue;let k=DA(h.pattern),T=k.some(I=>I==="channelId"||I==="channelGid"),_=[];try{if(T)for(let[,I]of l){let j={...o?{appId:o}:{}};for(let z of k)(z==="channelId"||z==="channelGid")&&(j[z]=I);_.push(...qg(await c(h.method,h.pattern,j)))}else if(k.length===0){let I=o&&s.has(`${h.method} ${h.pattern}`);_.push(...qg(await c(h.method,h.pattern,{},I?{appId:o}:void 0)))}else if(k.every(I=>I==="appId"))_.push(...qg(await c(h.method,h.pattern,{appId:o})));else{n(` \u2022 skipped ${g} (list needs ${k.join(",")}, which pull does not support)`),i&&i.count++;continue}}catch(I){F(I),n(` \u2022 ${g}: list failed (${Jh(I,on(e),MA(e))})`),i&&i.count++;continue}if(_.length===0)continue;let N={};for(let I of _){let j=I[v.identity];if(typeof j!="string"||RA(I)||CA(I))continue;if(UA(I,ux(r,g))!==void 0){n(` \u2022 skipped ${g}/${j}: npayload creates and manages it for you, so your config does not declare it`);continue}let z=I.gid??I.channelGid??I.id;g==="channels"&&z&&l.set(j,z),z&&d.set(z,j);let W=LA(I,v.identity,ux(r,g),o),B;for(let L of f){let K=W[L];if(typeof K=="string"){if(d.has(K))W[L]=d.get(K);else if(cx(K)){B=`${L} ${K}`;break}}if(Array.isArray(K)){let ge=[];for(let ie of K)typeof ie=="string"&&d.has(ie)?ge.push(d.get(ie)):typeof ie=="string"&&cx(ie)?n(` \u2022 ${g}/${j}: dropped ${L} entry ${ie} \u2014 its parent is not exported (archived, system-managed or not listed); a pulled config must push back as no-ops`):ge.push(ie);W[L]=ge}}if(B!==void 0){n(` \u2022 skipped ${g}/${j}: its ${B} is not exported (archived, system-managed or not listed) \u2014 a pulled config must push back as no-ops`);continue}for(let L of Ir(g)){if(L.wire==="name")continue;let K=di(I,L.publicField);if(L.array){if(!Array.isArray(K))continue;let ge=K.map(ie=>typeof ie=="string"&&d.has(ie)?d.get(ie):ie);Tc(W,L.path,ge)}else typeof K=="string"&&Tc(W,L.path,d.get(K)??K)}N[j]=W}Object.keys(N).length&&(u[g]=N)}return u}a(FA,"fetchLive");function qA(e){switch(e.code){case"EACCES":case"EPERM":return"permission denied";case"ENOENT":return"a folder on the path does not exist";case"ENOTDIR":case"EEXIST":return"a part of the path is a file where a folder is needed";case"EISDIR":return"the path names a folder";case"EROFS":return"the file system is read-only";case"ENOSPC":return"the disk is full";default:return"the system refused the write"}}a(qA,"writeFailureOf");function ZA(e){for(let t of e){let r=px(process.cwd(),t);if(Wo(r))return r}return null}a(ZA,"firstConfig");function Jo(e,t){let r=Wo(Nt(process.cwd(),"npayload"))?Nt(process.cwd(),"npayload",".npayload"):Nt(process.cwd(),".npayload");return Nt(r,`${e.name}.${t}.pull-base.json`)}a(Jo,"basePath");function GA(e){try{return Wo(e)?JSON.parse(Gg(e,"utf8")):{}}catch{return{}}}a(GA,"readBase");function Ha(e,t){try{dx(fx(e),{recursive:!0}),Ya(e,JSON.stringify(t,null,2),"utf8")}catch{}}a(Ha,"saveBase");function lx(e,t,r,o){return`/**
|
|
503
518
|
* Pulled from the live ${t} topology by \`npayload pull\`.
|
|
504
519
|
`+(o?` *
|
|
505
520
|
${o}
|
|
@@ -508,166 +523,166 @@ ${o}
|
|
|
508
523
|
import { ${e} } from "@npayload/sdk";
|
|
509
524
|
|
|
510
525
|
export default ${e}(${JSON.stringify(r,null,2)});
|
|
511
|
-
`}a(
|
|
512
|
-
`)),"warn"),
|
|
513
|
-
`)),d++;continue}try{
|
|
514
|
-
`)),d++;continue}let h,
|
|
515
|
-
`));continue}if(o){let
|
|
516
|
-
`));for(let
|
|
517
|
-
`));d++;continue}let
|
|
518
|
-
`)),d++}else{let
|
|
519
|
-
* This is the MERGED result \u2014 diff it against ${
|
|
520
|
-
`)),d++}}return d===0&&
|
|
521
|
-
`)),
|
|
522
|
-
`)),{touched:d,listFailures:
|
|
523
|
-
`)),process.exit(1)}})}a(
|
|
524
|
-
`)),process.exit(1)}a(
|
|
525
|
-
`)),await
|
|
526
|
+
`}a(lx,"renderModule");async function Vg(e,t=r=>process.stdout.write(r)){let r=e.env??"sandbox",o=e.check===!0,n=NA(e.app);if(!n)throw new Error("No app GID. Pass --app or set NPAYLOAD_APP_ID (or run from a project with .env).");let i=await Et(void 0,e.env,{readOnly:!0}),s=se(process.env.NPAYLOAD_PRIMUS_API_URL,"primusApiUrl"),c=s?await Et(s,e.env,{readOnly:!0}):null,u=a(f=>process.stderr.write($e.yellow(`${f}
|
|
527
|
+
`)),"warn"),l={count:0},d=0;for(let f of EA){let p=f.plane==="primus"?c:i;if(!p)continue;let m=ZA(f.files),g;try{g=await FA(p,f.resources,f.schema,n,u,l)}catch(I){F(I),u(` \u2022 ${f.name}: ${I instanceof Error?I.message:String(I)}`);continue}let v=Object.values(g).reduce((I,j)=>I+Object.keys(j).length,0);if(!m||e.out||e.force){if(!m&&v===0)continue;let I;if(e.out?I=px(process.cwd(),e.out):e.force&&m?I=m:I=Wo(Nt(process.cwd(),"npayload"))?Nt(process.cwd(),"npayload",`${f.name}.config.ts`):Nt(process.cwd(),`${f.name}.config.ts`),o){t($e.cyan(`~ ${f.name}: would write ${v} resource(s) \u2192 ${I}
|
|
528
|
+
`)),d++;continue}try{dx(fx(I),{recursive:!0}),Ya(I,lx(f.define,r,g),"utf8")}catch(j){u(e.out?` \u2022 ${f.name}: could not write the file --out names (its path is not shown here): ${qA(j)}`:` \u2022 ${f.name}: could not write ${I} (${j instanceof Error?j.message:String(j)})`);continue}Ha(Jo(f,r),g),t($e.green(`\u2713 ${f.name}: wrote ${v} resource(s) \u2192 ${I}
|
|
529
|
+
`)),d++;continue}let h,k;try{h=Gg(m,"utf8"),k=await le(m)}catch(I){u(` \u2022 ${f.name}: could not read ${m} (${I instanceof Error?I.message:String(I)})`);continue}let T=GA(Jo(f,r)),_=ax(T,k,g);if(_.changes.length===0&&_.conflicts.length===0){o||Ha(Jo(f,r),g),t($e.dim(` \u2022 ${f.name}: up to date (${m})
|
|
530
|
+
`));continue}if(o){let I=_.changes.filter(z=>z.kind!=="update-field").length,j=_.changes.filter(z=>z.kind==="update-field").length;t($e.cyan(`~ ${f.name}: would merge into ${m} `)+$e.dim(`(${j} updated, ${I} added`)+(_.conflicts.length?$e.yellow(`, ${_.conflicts.length} CONFLICT`):"")+$e.dim(`)
|
|
531
|
+
`));for(let z of _.conflicts)t($e.yellow(` conflict: ${String(z.path??JSON.stringify(z))}
|
|
532
|
+
`));d++;continue}let N=await Ja(h,_);if(N.ok&&N.text!==void 0){Ya(m,N.text,"utf8"),Ha(Jo(f,r),g);let I=_.changes.filter(z=>z.kind!=="update-field").length,j=_.changes.filter(z=>z.kind==="update-field").length;t($e.green(`\u2713 ${f.name}: merged into ${m} `)+$e.dim(`(${j} updated, ${I} added`)+(_.conflicts.length?$e.yellow(`, ${_.conflicts.length} CONFLICT \u2014 resolve inline`):"")+$e.dim(`)
|
|
533
|
+
`)),d++}else{let I=m.replace(/\.config\.(ts|mjs|js)$/,".config.pulled.$1"),j=` * \u26A0 ${_.conflicts.length} conflict(s); in-place merge unavailable (${N.reason??"n/a"}).
|
|
534
|
+
* This is the MERGED result \u2014 diff it against ${m}, then keep.`;Ya(I,lx(f.define,r,_.merged,j),"utf8"),Ha(Jo(f,r),g),t($e.yellow(`! ${f.name}: in-place merge unavailable (${N.reason??"n/a"}) \u2014 wrote sidecar ${I}
|
|
535
|
+
`)),d++}}return d===0&&l.count===0&&t($e.dim(`Nothing to pull.
|
|
536
|
+
`)),l.count>0&&process.stderr.write($e.yellow(`\u26A0 ${l.count} resource type(s) unreadable \u2014 this preview/sync is PARTIAL.
|
|
537
|
+
`)),{touched:d,listFailures:l.count}}a(Vg,"runPullOnce");function mx(e){e.command("pull").description("Pull your live Events and Primus setup into *.config.ts (three-way backward sync)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--out <path>","force-write the resolved config to this path (skips merge)").option("--force","overwrite the resolved config in place (skips merge)").option("--env <slug>","environment to pull from (default: the active environment, `np env use`)").option("--check","preview the merge (adopted fields, additions, conflicts) \u2014 write NOTHING").action(async(t,r)=>{try{let o=ft(t,r),n=Rn(o!==void 0?{explicitSlug:o}:{}),i=await Vg({...t,env:n});try{let{pullScopesIntoManifest:s}=await import("../chunk-2U3QN6IU.mjs");await s({...t.app?{appId:t.app}:{},readRemoteGrant:a(async c=>{let{restoreSession:u}=await import("../chunk-3RE3BK3W.mjs"),l=await u();return l?l.getOacGrant(c):null},"readRemoteGrant"),log:a(c=>process.stdout.write(c),"log")})}catch(s){F(s)}process.exit(i.listFailures>0?1:0)}catch(o){process.stderr.write($e.red(`${ae(o instanceof Error?o.message:String(o),o)}
|
|
538
|
+
`)),process.exit(1)}})}a(mx,"registerPull");var tc=class extends Error{static{a(this,"PushTargetsProductionError")}constructor(t,r="active"){super((r==="--env"?"Refusing: the --env given names the PRODUCTION environment. ":"Refusing: the active environment is the PRODUCTION environment. ")+`\`np push\`/\`diff\`/\`watch\`/\`sync\` target development environments only \u2014 production changes ship through \`${b("deploy")}\`. `+(r==="--env"?"Pass a development environment's slug.":`Switch with \`${b("env use <dev-slug>")}\` first.`)),this.name="PushTargetsProductionError"}};function vr(e,t){let r=t?.trim()?t.trim():void 0,o=r!==void 0?"--env":"active",n=r??Ac(e)??"sandbox";if(n==="production"||n==="prod")throw new tc(n,o);if(Cn(e)?.environments.find(c=>c.slug===n)?.kind==="production")throw new tc(n,o);return n}a(vr,"resolveActivePushEnv");function Qa(e,t){let r=Rr(e.app);return{...e.config?{config:e.config}:{},...r?{app:r}:{},env:vr(void 0,e.env),check:t,...e.prune?{prune:!0}:{},...e.yes?{yes:!0}:{},...e.acceptRemote?{acceptRemote:!0}:{},...e.overwriteRemote?{overwriteRemote:!0}:{}}}a(Qa,"sandboxOpts");function Xa(e){return ft({},e)}a(Xa,"typedEnv");function ec(e){process.stderr.write(ue.red(`${ae(`failed: ${e instanceof Error?e.message:String(e)}`,e)}
|
|
539
|
+
`)),process.exit(1)}a(ec,"fail");function gx(e){try{return VA("sha256").update(BA(e)).digest("hex")}catch{return}}a(gx,"fileDigest");var nc=class{static{a(this,"AdoptedWrites")}digests=new Map;record(t){for(let r of t){let o=gx(r);o!==void 0&&this.digests.set(r,o)}}isOnlyTheAdoption(t){return t.length===0||this.digests.size===0?!1:t.every(r=>this.digests.get(r)!==void 0&&this.digests.get(r)===gx(r))}clear(){this.digests.clear()}};function hx(e,t,r,o){let n=Math.max(5,e.pollSeconds)*1e3,i=!1,s=a(async()=>{if(!(i||t.flag)){t.flag=!0;try{try{let f=await le(Ye()),p=wy(Rc(f)),m=await Et(void 0,void 0,{readOnly:!0}),{token:g}=await m.auth.getAccessToken([]),h=(JSON.parse(Buffer.from(g.split(".")[1]??"","base64url").toString("utf8")).scope??"").split(" ").filter(Boolean).sort();h.length>0&&JSON.stringify(h)!==JSON.stringify(p)&&!i&&(process.stdout.write(ue.cyan(`\u2193 scope drift: credential carries ${h.length} scope(s), config projects ${p.length} \u2014 resyncing to the config\u2026
|
|
540
|
+
`)),await ky(Rc(f),Rr(e.app),k=>process.stdout.write(k)))}catch(f){F(f)}if(i)return;let u=vr(void 0,e.env),d=(await xe({...e.config?{config:e.config}:{},...Rr(e.app)?{app:Rr(e.app)}:{},env:u,check:!0,sink:a(()=>{},"sink")})).plan.filter(f=>f.action!=="noop");d.length>0&&!i&&(process.stdout.write(ue.cyan(`
|
|
526
541
|
\u2193 drift: ${d.length} live change(s) not in your config \u2014 adopting (pull merge)\u2026
|
|
527
|
-
`)),await
|
|
528
|
-
`));return}process.stderr.write(
|
|
529
|
-
`))}finally{t.flag=!1}}},"tick"),c=setInterval(()=>void s(),n);return()=>{i=!0,clearInterval(c)}}a(
|
|
530
|
-
`));let s={flag:!1},c=new
|
|
531
|
-
`));return}c.clear(),s.flag=!0;try{await xe(
|
|
532
|
-
`))}finally{s.flag=!1}}),
|
|
542
|
+
`)),await Vg({...e.app?{app:e.app}:{},env:u}),r.record(o))}catch(u){if(u instanceof we){i=!0,clearInterval(c),process.stderr.write(ue.red(`${ae(`drift poll stopped: ${u.message}`,u)}
|
|
543
|
+
`));return}process.stderr.write(ue.yellow(`drift poll failed (${u instanceof Error?u.message:String(u)}) \u2014 still watching
|
|
544
|
+
`))}finally{t.flag=!1}}},"tick"),c=setInterval(()=>void s(),n);return()=>{i=!0,clearInterval(c)}}a(hx,"startDriftLane");function yx(e){e.command("diff").alias("status").description("Show the plan (create / update / orphan / no-op) without applying \u2014 your code vs the sandbox. Exit 0 in sync, 2 with changes, 1 on error.").option("--config <path>","a single config file (default: every *.config.ts)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--json","machine-readable plan on stdout (no ANSI)").action(async(t,r)=>{try{let o=await xe({...Qa({...t,env:Xa(r)},!0),...t.json?{json:!0}:{}});process.exit(jc("diff",o.plan))}catch(o){ec(o)}}),e.command("push").description("Apply your config to the sandbox (create + update changed fields; --prune deletes undeclared resources after confirmation)").option("--config <path>","a single config file (default: every *.config.ts)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--prune","delete live resources not declared in the config (confirmed; --yes for CI)").option("--yes","skip the prune confirmation (CI)").option("--accept-remote","on scope drift: pull the remote grant change into npayload.toml").option("--overwrite-remote","on scope drift: replace the remote grant with the manifest declaration").option("--json","machine-readable plan + apply results on stdout (no ANSI)").action(async(t,r)=>{try{let o=await xe({...Qa({...t,yes:Dc(t,r),env:Xa(r)},!1),...t.json?{json:!0}:{}});process.exit(jc("push",o.plan))}catch(o){ec(o)}}),e.command("watch").description("Watch your configs and push to the sandbox on every change; poll for backend drift and adopt it into your files (Ctrl-C to stop)").option("--config <path>","a single config file (default: every *.config.ts)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--poll <seconds>","backend drift poll interval","20").option("--no-poll","disable the poll for the server's drift (file-change pushes only)").action(async(t,r)=>{let o=Xa(r);try{vr(void 0,o)}catch(l){ec(l);return}let n=Lc(t.config);n.length===0&&(process.stderr.write(ue.red("No product config found. Run `"+b("init")+"` first.\n")),process.exit(1));let i=t.poll!==!1;process.stdout.write(ue.bold(`\u{1F440} watching ${n.length} config(s) \u2192 sandbox`)+ue.dim(i?` \xB7 drift poll every ${t.poll}s`:" \xB7 drift poll off")+ue.bold(` \xB7 Ctrl-C to stop
|
|
545
|
+
`));let s={flag:!1},c=new nc,u=i?hx({...t.config?{config:t.config}:{},...t.app?{app:t.app}:{},...o!==void 0?{env:o}:{},pollSeconds:Number(t.poll)||20},s,c,n):()=>{};await zc(n,async()=>{if(c.isOnlyTheAdoption(n)){process.stdout.write(ue.dim(`\u2193 config updated by the drift poll \u2014 nothing pushed (the poll never pushes topology)
|
|
546
|
+
`));return}c.clear(),s.flag=!0;try{await xe(Qa({...t,env:o},!1))}catch(l){process.stderr.write(ue.red(`${ae(`reconcile failed: ${l instanceof Error?l.message:String(l)}`,l)}
|
|
547
|
+
`))}finally{s.flag=!1}}),u(),process.stdout.write(ue.dim(`
|
|
533
548
|
stopped.
|
|
534
|
-
`)),process.exit(0)}),e.command("sync").description("Continuously sync your config to the sandbox: push now, then on every save; poll for backend drift and adopt it (= `np dev`)").option("--config <path>","a single config file (default: every *.config.ts)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--prune","delete live resources not declared in the config (requires --yes in the loop)").option("--yes","skip the prune confirmation (CI / the sync loop)").option("--poll <seconds>","backend drift poll interval","20").option("--no-poll","disable the poll for the server's drift (file-change pushes only)").action(async(t,r)=>{let o=
|
|
549
|
+
`)),process.exit(0)}),e.command("sync").description("Continuously sync your config to the sandbox: push now, then on every save; poll for backend drift and adopt it (= `np dev`)").option("--config <path>","a single config file (default: every *.config.ts)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--prune","delete live resources not declared in the config (requires --yes in the loop)").option("--yes","skip the prune confirmation (CI / the sync loop)").option("--poll <seconds>","backend drift poll interval","20").option("--no-poll","disable the poll for the server's drift (file-change pushes only)").action(async(t,r)=>{let o=Dc(t,r),n=Xa(r);try{vr(void 0,n)}catch(g){ec(g);return}let i=Lc(t.config);i.length===0&&(process.stderr.write(ue.red("No product config found. Run `"+b("init")+"` first.\n")),process.exit(1));let s={flag:!1},c=a(async g=>{s.flag=!0,process.stdout.write(ue.dim(`
|
|
535
550
|
[${g}] syncing ${i.length} config(s) \u2192 sandbox\u2026
|
|
536
|
-
`));try{await xe(
|
|
537
|
-
`))}finally{s.flag=!1}},"run");await c("start");let
|
|
538
|
-
\u{1F440} watching ${i.map(g=>g.replace(process.cwd()+"/","")).join(", ")}`)+
|
|
539
|
-
`));let p=new
|
|
540
|
-
`));return}p.clear(),await c(g)},300,
|
|
541
|
-
`)),process.exit(1);return}d(),
|
|
551
|
+
`));try{await xe(Qa({...t,yes:o,env:n},!1))}catch(v){process.stderr.write(ue.red(`${ae(`reconcile failed: ${v instanceof Error?v.message:String(v)}`,v)}
|
|
552
|
+
`))}finally{s.flag=!1}},"run");await c("start");let u=await Ze().catch(()=>null),l=zt(),d=Mt("sync",u,{onRevoked:a(()=>pt(),"onRevoked"),onRefused:l.onRefused}),f=t.poll!==!1;process.stdout.write(ue.bold(`
|
|
553
|
+
\u{1F440} watching ${i.map(g=>g.replace(process.cwd()+"/","")).join(", ")}`)+ue.dim(f?` \xB7 drift poll every ${t.poll}s`:" \xB7 drift poll off")+ue.bold(` \xB7 Ctrl-C to stop
|
|
554
|
+
`));let p=new nc,m=f?hx({...t.config?{config:t.config}:{},...t.app?{app:t.app}:{},...n!==void 0?{env:n}:{},pollSeconds:Number(t.poll)||20},s,p,i):()=>{};try{await zc(i,async g=>{if(p.isOnlyTheAdoption(i)){process.stdout.write(ue.dim(`\u2193 config updated by the drift poll \u2014 nothing pushed (the poll never pushes topology)
|
|
555
|
+
`));return}p.clear(),await c(g)},300,l)}catch(g){d(),m(),process.stderr.write(ue.red(`${ae(`sync stopped: ${g instanceof Error?g.message:String(g)}`,g)}
|
|
556
|
+
`)),process.exit(1);return}d(),m(),process.stdout.write(ue.dim(`
|
|
542
557
|
stopped.
|
|
543
|
-
`)),process.exit(0)})}a(
|
|
544
|
-
`)){let o=r.trim();if(!o||o.startsWith("#"))continue;let n=o.indexOf("=");if(!(n===-1||o.slice(0,n).trim()!==t))return o.slice(n+1).trim().replace(/^["']|["']$/g,"")}}catch{}}a(
|
|
545
|
-
`)),process.exit(1);return}let n=
|
|
558
|
+
`)),process.exit(0)})}a(yx,"registerSyncCommands");function HA(e){if(e){let r=WA(process.cwd(),e);return Bg(r)?[r]:[]}let t=[];for(let r of["events","primus","pipes"])for(let o of[`${r}.config.ts`,rc("npayload",`${r}.config.ts`)]){let n=rc(process.cwd(),o);Bg(n)&&t.push(n)}return t}a(HA,"findAllConfigs");function YA(e,t){if(Bg(e))try{for(let r of KA(e,"utf8").split(`
|
|
559
|
+
`)){let o=r.trim();if(!o||o.startsWith("#"))continue;let n=o.indexOf("=");if(!(n===-1||o.slice(0,n).trim()!==t))return o.slice(n+1).trim().replace(/^["']|["']$/g,"")}}catch{}}a(YA,"readEnvVar");function QA(e){if(e)return e;let t=process.env.NPAYLOAD_APP_ID?.trim();if(t)return t;for(let r of[rc(process.cwd(),".env"),rc(process.cwd(),"npayload",".env")]){let o=YA(r,"NPAYLOAD_APP_ID");if(o)return o}}a(QA,"resolveAppGid");function vx(e){e.command("dev").description("Watch your product configs and reconcile ALL of them to npayload on every change").option("--config <path>","watch/sync a single config file (default: every *.config.ts)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--env <slug>","target development environment (default: the active environment, `np env use`; else sandbox)").action(async(t,r)=>{let o;try{o=vr(void 0,ft(t,r))}catch(g){process.stderr.write(nn.red(`failed: ${g instanceof Error?g.message:String(g)}
|
|
560
|
+
`)),process.exit(1);return}let n=HA(t.config);n.length===0&&(process.stderr.write(nn.red("No product config found (events.config.ts / primus.config.ts). Run `"+b("init")+"` first.\n")),process.exit(1));let i=QA(t.app),s={...t.config?{config:t.config}:{},...i?{app:i}:{},env:o},c=a(async g=>{process.stdout.write(nn.dim(`
|
|
546
561
|
[${g}] reconciling ${n.length} config(s)\u2026
|
|
547
|
-
`));try{await xe(s)}catch(v){process.stderr.write(
|
|
548
|
-
`))}},"reconcile");await c("start"),process.stdout.write(
|
|
562
|
+
`));try{await xe(s)}catch(v){process.stderr.write(nn.red(`${ae(`reconcile failed: ${v instanceof Error?v.message:String(v)}`,v)}
|
|
563
|
+
`))}},"reconcile");await c("start"),process.stdout.write(nn.bold(`
|
|
549
564
|
\u{1F440} watching ${n.map(g=>g.replace(process.cwd()+"/","")).join(", ")}
|
|
550
|
-
`)+
|
|
565
|
+
`)+nn.dim(" edit any to re-reconcile (creates + updates, never deletes) \xB7 run `"+b("listen")+"` for a live stream \xB7 Ctrl-C to stop\n"));let u=await Ze().catch(()=>null),l=zt(),d=Mt("dev",u,{onRevoked:a(()=>pt(),"onRevoked"),onRefused:l.onRefused}),f=null,p=a(()=>{f&&clearTimeout(f),f=setTimeout(()=>void c("change"),300)},"bump"),m=n.map(g=>JA(g,p));try{await Promise.race([new Promise(g=>{process.on("SIGINT",()=>{d(),process.stdout.write(nn.dim(`
|
|
551
566
|
stopped.
|
|
552
|
-
`)),g()})}),
|
|
553
|
-
`)),process.exit(1);return}process.exit(0)})}a(
|
|
554
|
-
`);else{let
|
|
567
|
+
`)),g()})}),l.ended])}catch(g){f&&clearTimeout(f);for(let v of m)v.close();process.stderr.write(nn.red(`${ae(`dev stopped: ${g instanceof Error?g.message:String(g)}`,g)}
|
|
568
|
+
`)),process.exit(1);return}process.exit(0)})}a(vx,"registerDev");var bx="Save the signing secret now: it is shown this once.";function XA(e,t){let r=a((n,i,s={})=>e.send(dt({row:n,positionals:i,flags:s,newIdempotencyKey:e.newIdempotencyKey})),"call"),o=a((n,i)=>i===void 0?{}:{[n]:i},"optional");return{listChannelWebhooks:a(()=>r(t.list,[]),"listChannelWebhooks"),listAgentWebhookTriggers:a(()=>r(t.triggersList,[],{type:"webhook"}),"listAgentWebhookTriggers"),channel:a(n=>r(t.channelGet,[n]),"channel"),listAgents:a(()=>r(t.agentsList,[]),"listAgents"),createChannelWebhook:a(n=>r(t.create,[],{channelGid:n.channelGid,name:n.name,...o("description",n.description)}),"createChannelWebhook"),createAgentWebhookTrigger:a(n=>r(t.triggersCreate,[],{agentGid:n.agentGid,name:n.name,type:n.type,config:JSON.stringify(n.config),action:JSON.stringify(n.action),...o("description",n.description)}),"createAgentWebhookTrigger"),rotateChannelWebhookSecret:a(n=>r(t.rotateSecret,[n]),"rotateChannelWebhookSecret"),revokeChannelWebhook:a(n=>r(t.revoke,[n]),"revokeChannelWebhook"),removeAgentTrigger:a(n=>r(t.triggersRemove,[n]),"removeAgentTrigger")}}a(XA,"kernelWebhookDoors");async function oc(e,t){try{await t(XA(e,await e.rows()))}catch(r){e.printError(Ee(r instanceof Error?r.message:String(r),r)),process.exitCode=r instanceof Ah||r instanceof Q?1:jt(r)}}a(oc,"run");function wx(e,t){let r=e.commands.find(o=>o.name()==="webhooks")??e.command("webhooks").description("Your incoming webhooks: the channels' and the agents'");r.command("list").description("List your incoming webhooks in one list \u2014 the webhooks that publish into a channel and the webhook triggers that start an agent \u2014 with what each delivers to, its signing secret's state, its last delivery and its status").action(()=>oc(t,async o=>t.print({webhooks:await Rh(o)}))),r.command("add").description("Add an incoming webhook to a channel (--channel) or to an agent (--agent with --goal); its signing secret is shown once").requiredOption("--name <name>","the webhook's name").option("--channel <channelId>","the channel it publishes into").option("--agent <agentId>","the agent it starts").option("--goal <text>","what the agent does when the webhook fires (with --agent)").option("--description <text>","a description").action(o=>oc(t,async n=>{if(o.channel===void 0==(o.agent===void 0))throw new Q("name exactly one of --channel <channelId> or --agent <agentId>");if(o.agent!==void 0&&(o.goal===void 0||o.goal.trim()===""))throw new Q("--agent needs --goal: what the agent does when the webhook fires");let i=o.description!==void 0?{description:o.description}:{},s=o.channel!==void 0?await xc(n,{channel:o.channel,name:o.name,...i}):await xc(n,{agent:o.agent,name:o.name,goal:o.goal,...i});t.print(s),t.printError(bx)})),r.command("rotate-secret").argument("<webhookId>","the incoming webhook (whk_\u2026)").description("Rotate an incoming webhook's signing secret; the new one is shown once and the previous one keeps verifying for a grace window").action(o=>oc(t,async n=>{t.print(await Oh(n,o)),t.printError(bx)})),r.command("revoke").argument("<webhookId>","the incoming webhook (whk_\u2026 for a channel's, trg_\u2026 for an agent's)").description("Revoke an incoming webhook: requests sent to it stop being accepted (asks first; --yes skips the question)").action(o=>oc(t,async n=>{if(Ch(o),!await t.confirm("Revoke the incoming webhook you named? Requests sent to it stop being accepted.")){t.printError("kept the webhook: nothing was revoked (pass --yes to revoke without asking)"),process.exitCode=1;return}t.print(await Nh(n,o))}))}a(wx,"registerIncomingWebhooks");import It from"chalk";function eC(e){if(Array.isArray(e))return e;let t=e;return t?.data??t?.messages??t?.page??[]}a(eC,"rowsOf");async function Kg(e,t,r={}){let o=new Set,n=!0,i=Math.max(500,r.intervalMs??1500);for(;;){let s=r.end?.refusal();if(s!==void 0)throw s;try{let c=await e.send({method:"GET",path:"/v1/channels/{channelId}/messages",pathParams:{channelId:t},query:{limit:25}}),l=eC(c).filter(d=>d.gid&&!o.has(d.gid)).reverse();for(let d of l)if(o.add(d.gid),r.json)process.stdout.write(JSON.stringify({gid:d.gid,routingKey:d.routingKey,payload:d.payload})+`
|
|
569
|
+
`);else{let f=new Date(d.publishedAt??d.createdAt??Date.now()).toLocaleTimeString(),p=`${It.dim(f)} ${It.cyan(d.routingKey??"event")} ${JSON.stringify(d.payload).slice(0,160)}`;process.stdout.write(n?It.dim(p)+`
|
|
555
570
|
`:p+`
|
|
556
|
-
`)}n=!1}catch(c){
|
|
557
|
-
`))}await new Promise(c=>setTimeout(c,i))}}a(
|
|
558
|
-
`)),process.exit(1));let i=await o.send({method:"GET",path:"/v1/apps/channels/by-slug/{slug}",pathParams:{slug:t}});i?.gid||(process.stderr.write(
|
|
571
|
+
`)}n=!1}catch(c){F(c),process.stderr.write(It.yellow(`tail: ${c instanceof Error?c.message:String(c)} \u2014 retrying
|
|
572
|
+
`))}await new Promise(c=>setTimeout(c,i))}}a(Kg,"followChannel");function kx(e){e.command("tail").argument("<channel>","channel slug to watch").description("Watch events arrive on a channel, live (Ctrl-C to stop)").option("--app <appGid>","app GID (default: NPAYLOAD_APP_ID or the project .env)").option("--interval <ms>","poll interval in ms","1500").option("--json","one JSON object per event (NDJSON) \u2014 no decoration").action(async(t,r)=>{try{let o=await Et();await Iy(o,r.app)||(process.stderr.write(It.red(`No app GID. Pass --app or set NPAYLOAD_APP_ID.
|
|
573
|
+
`)),process.exit(1));let i=await o.send({method:"GET",path:"/v1/apps/channels/by-slug/{slug}",pathParams:{slug:t}});i?.gid||(process.stderr.write(It.red(`The channel given as <channel> was not found in the app (neither is shown here).
|
|
559
574
|
`)),process.exit(1)),r.json||process.stdout.write(`
|
|
560
|
-
${
|
|
575
|
+
${ci("npayload",!1)} ${It.bold("tail")} ${It.cyan(t)} ${It.dim(`(${i.gid}) \xB7 Ctrl-C to stop`)}
|
|
561
576
|
|
|
562
|
-
`);let s=await
|
|
563
|
-
`)),process.exit(1)}})}a(
|
|
577
|
+
`);let s=await Ze().catch(()=>null),c=zt(),u=Mt("tail",s,{onRevoked:a(()=>pt(),"onRevoked"),onRefused:c.onRefused});process.on("SIGINT",()=>{u(),process.exit(0)}),await Kg(o,i.gid,{intervalMs:Number(r.interval)||1500,...r.json?{json:!0}:{},end:c})}catch(o){process.stderr.write(It.red(`${ae(`tail failed: ${o instanceof Error?o.message:String(o)}`,o)}
|
|
578
|
+
`)),process.exit(1)}})}a(kx,"registerTail");import{Option as tC}from"commander";import be from"chalk";var nC="2026-09-15.v1",rC="2026-09-15.v1",oC="template",iC="Fees are non-refundable, except when the feed did not deliver, the platform failed, or the charge was wrong.";var sC="/settings/billing",xx=/^[a-z0-9-]+$/,aC="Use <publisher-slug>/<listing-slug> (or the alias <publisher-slug>.<listing-slug>), each slug lowercase letters, digits and hyphens [a-z0-9-] \u2014 e.g. `"+b("subscribe wickfeed/lit")+"`.";function Wg(e){let t=(e??"").trim(),r=t.split("/").length-1,o=t.split(".").length-1;if(r+o===1){let n=r===1?"/":".",i=t.indexOf(n),s=t.slice(0,i),c=t.slice(i+1);if(xx.test(s)&&xx.test(c))return{publisherSlug:s,listingSlug:c,ref:`${s}/${c}`,dotted:n==="."}}throw new R("The text given is not a listing reference; it is not shown here.",{code:"INVALID_LISTING_REF",hint:aC})}a(Wg,"parseListingRef");function Hg(e,t,r){t.dotted&&e.print(` ${be.dim(`Using ${t.ref} \u2014 the canonical form of ${r.trim()}.`)}`)}a(Hg,"printAliasHint");function Jg(e){return e instanceof Error?e.message:String(e)}a(Jg,"messageOf");function cC(e){if(!/ACCEPTANCE_REQUIRED/.test(e))return null;let t=a(i=>new RegExp(`${i}:\\s*([^\\s,;)]+)`).exec(e)?.[1],"field"),r=t("subscriberAgreementVersion"),o=t("listingLicenceVersion"),n=/\(version\s*([^)\s]+)\)/.exec(e)?.[1]??t("currentVersion");if(n){let i=/listing_licence/i.test(e)||/licence|license/i.test(e),s=/subscriber_agreement/i.test(e)||/subscriber agreement/i.test(e);i&&!o?o=n:s&&!r&&(r=n)}return!r&&!o?null:{...r?{subscriberAgreementVersion:r}:{},...o?{listingLicenceVersion:o}:{}}}a(cC,"parseStaleAcceptance");function uC(e){if(!/SPEND_CAP_EXCEEDED/.test(e))return null;let t=/approvalRequestId:\s*([^\s,;]+)/.exec(e),r=/expiresAt:\s*([^\s,;]+)/.exec(e);return{...t?{approvalRequestId:t[1]}:{},...r?{expiresAt:r[1]}:{}}}a(uC,"parseSpendCapRefusal");function Sx(e){let t=/^([A-Z][A-Z0-9_]{3,})\b/.exec(e.trim());return t?t[1]:null}a(Sx,"typedCodeOf");function lC(e,t){let r=Sx(e)??t;return new R(e,{code:r})}a(lC,"doorError");function sc(e,t){if(e instanceof R)return e;let r=Jg(e),o=e?.code,n=Sx(r)??(typeof o=="string"&&/^[A-Z][A-Z0-9_]{3,}$/.test(o)?o:null)??t;return new R(r,{code:n,...e!==void 0?{cause:e}:{}})}a(sc,"typedDoorError");function Yg(e){let t=(e.env??e.envGid)?.trim();if(t)return{wanted:t,explicit:!0};let r=e.mintedEnvSlug?.trim();if(r)return{wanted:r,explicit:!1};throw new R("No environment. Pass --env <slug>, or select one with `"+b("env use <slug>")+"`.",{code:"ENV_REQUIRED",hint:"List them with `"+b("env list")+"`, then pass --env <slug> or run `"+b("env use <slug>")+"`."})}a(Yg,"requireEnvChoice");function ic(e){if(typeof e.ref=="string"&&e.ref!=="")return e.ref;if(e.publisherSlug&&e.slug)return`${e.publisherSlug}/${e.slug}`}a(ic,"catalogueRefOf");async function Qg(e,t){let r;try{r=await e.send({method:"GET",path:"/v1/feeds/resolve/{publisherSlug}/{listingSlug}",pathParams:{publisherSlug:t.publisherSlug,listingSlug:t.listingSlug},scope:"listings:read"})}catch(o){throw F(o),sc(o,"RESOLVE_FAILED")}if(!r?.gid)throw new R("The resolver answered no listing for the reference given (it is not shown here).",{code:"RESOLVE_FAILED",hint:"Try again; if it persists, the catalogue door is not answering."});return r}a(Qg,"resolveListingRef");async function Xg(e,t,r){let o=await e.send({method:"GET",path:"/v1/account/environments",scope:"account:read"}),i=(Array.isArray(o)?o:o?.environments??[]).find(s=>s.slug===t.wanted||s.gid===t.wanted);if(!i?.gid)throw new R(`No environment matching ${t.explicit?"the --env given":"the active environment"} on this account (it is not shown here).`,{code:"ENV_NOT_FOUND",hint:"List them with `"+b("env list")+"` and pass one of those slugs to --env."});if(t.explicit&&r&&i.slug&&r!==i.slug)throw new R(`This session is authenticated for the "${r}" environment, but --env names "${i.slug}" (${i.gid}).`,{code:"ENV_MINT_MISMATCH",hint:`Run \`${b(`env use ${i.slug}`)}\` (or pass the global --env ${i.slug}) and try again.`});return i}a(Xg,"resolveTargetEnvironment");var dC=new Set(["cancelled","expired"]);async function eh(e,t,r){let o;try{o=await e.send({method:"GET",path:"/v1/feeds/subscriptions",scope:"feed:read"})}catch(i){throw F(i),sc(i,"SUBSCRIPTIONS_UNREADABLE")}return(Array.isArray(o)?o:o?.data??[]).filter(i=>typeof i.gid=="string"&&i.listingGid===t&&!dC.has(i.status??"")&&(i.targetAppGids??[]).includes(r))}a(eh,"liveSubscriptionsIn");async function th(e,t,r){try{let o=await e.send({method:"GET",path:"/v1/feeds/subscriptions/{subscriptionId}/bindings",pathParams:{subscriptionId:t},scope:"feed:read"}),n=Array.isArray(o)?o:o?.data??[];return(n.find(s=>s.targetAppGid===r)??n[0])?.receivingChannelGid??null}catch(o){return F(o),null}}a(th,"receivingChannelOf");function pC(e){let t=e.licence;return t?.version&&t.type?{...t,type:t.type,version:t.version}:{type:oC,version:rC}}a(pC,"resolveListingLicence");function fC(e){return`$${(e/100).toFixed(2)}`}a(fC,"money");function mC(e,t,r){let o=e.pricing,n=o?.model;if(n==="free"||n===void 0)return 0;if(n==="flat_rate"){let i=o?.flatRate;if(!i)throw new R(`The catalogue does not publish a price for ${e.name??e.slug??"this listing"}, so it cannot be shown before you subscribe.`,{code:"LISTING_PRICE_UNAVAILABLE",hint:"Subscribe from the dashboard, which reads the price from the listing itself."});let s=t==="yearly"?i.yearlyPriceCents:i.monthlyPriceCents;if(typeof s!="number")throw new R(`${e.name??e.slug??"This listing"} has no ${t} price.`,{code:"BILLING_CYCLE_UNAVAILABLE",hint:"Run the command again with --billing-cycle monthly."});return s}if(n==="tiered"){if(t==="yearly")throw new R(`${e.name??e.slug??"This listing"} is tiered: tiers carry a monthly price only, so yearly billing is not available.`,{code:"BILLING_CYCLE_UNAVAILABLE",hint:"Run the command again with --billing-cycle monthly."});let i=o?.tiered?.tiers??[],s=(r?i.find(c=>c.name===r):void 0)??i[0];if(!s||typeof s.monthlyPriceCents!="number")throw new R(`${e.name??e.slug??"This listing"} has no tier${r?" named by the --tier given (it is not shown here)":""}.`,{code:"TIER_NOT_FOUND",hint:"Pass --tier <name> with a tier the listing offers."});return s.monthlyPriceCents}throw new R(`${e.name??e.slug??"This listing"} is priced per message, which this command cannot subscribe to yet.`,{code:"PRICING_MODEL_UNAVAILABLE",hint:"Subscribe to a free, flat-rate or tiered listing, or use the dashboard."})}a(mC,"resolvePrice");function _x(e,t){let r=`${t.listing.name??t.listing.slug??"listing"} (${t.listing.slug??""})`,o=`${t.environment?.name??t.envGid} (${t.envGid})`;e.print(""),e.print(` ${be.bold("Publisher")} ${t.listing.publisherSlug??""}`),e.print(` ${be.bold("Listing")} ${r}`),t.listing.description&&e.print(` ${be.bold("About")} ${t.listing.description}`),gC(e,t.listing.samplePayload),e.print(` ${be.bold("Price")} ${t.priceInCents>0?`${fC(t.priceInCents)} ${t.billingCycle}`:"free"}`),e.print(` ${be.bold("Delivers to")} ${o}`),t.sandboxOnly?e.print(` ${be.dim("This target is a sandbox app: the subscription is free, no card is charged, and delivery pauses at the trial limit until you add a production app.")}`):t.chargeable&&e.print(` ${be.dim("This target is a production app, so this subscription is a paid one.")}`),e.print(` ${be.bold("Agreement")} Subscriber Agreement ${t.agreementVersion}`),e.print(` ${be.bold("Licence")} ${t.licence.type} licence ${t.licence.version}`),e.print(` ${be.dim(iC)}`),e.print("")}a(_x,"printTerms");function gC(e,t){let r=t?.trim();if(!r){e.print(` ${be.bold("Sample")} no sample provided by the publisher`);return}let o;try{o=JSON.stringify(JSON.parse(r),null,2).split(`
|
|
564
579
|
`)}catch{o=r.split(`
|
|
565
|
-
`)}e.print(` ${
|
|
566
|
-
`),"print"),confirm:a(async()=>c?c("Accept these terms and subscribe?"):!1,"confirm"),isTty:!!(process.stdin.isTTY&&process.stdout.isTTY),...s?{tail:a(d=>s(i,d),"tail")}:{}},
|
|
567
|
-
`),"print")})})}a(
|
|
568
|
-
`),t.write(`${
|
|
569
|
-
`);let i=e.resolveContext?await e.resolveContext(r):
|
|
570
|
-
`),t.write(`${
|
|
571
|
-
`),t.write(`${
|
|
572
|
-
`),e.fetchAccountStatus){let c=await e.fetchAccountStatus().catch(
|
|
573
|
-
`)}t.exit(0)}a(
|
|
574
|
-
`)),r.exit(0);return}e.all?(await o.logoutAll(),r.write(
|
|
575
|
-
`)):(await o.logout(),r.write(
|
|
576
|
-
`)),r.exit(0)}a(
|
|
577
|
-
${t}`}a(
|
|
580
|
+
`)}e.print(` ${be.bold("Sample")}`);for(let n of o)e.print(` ${n}`)}a(gC,"printSample");async function $x(e,t){if(t)return;if(!e.isTty)throw new R("Subscribing needs an explicit confirmation, and this session is not interactive.",{code:"CONFIRMATION_REQUIRED",hint:"Run the command again with --yes to accept the terms printed above."});if(!await e.confirm())throw new R("Not subscribed.",{code:"SUBSCRIBE_DECLINED",hint:"Nothing was charged and no subscription was created."})}a($x,"takeConsent");async function hC(e,t,r){let o=Yg(t),n=Wg(t.ref);Hg(r,n,t.ref);let i=t.billingCycle??"monthly",s=await Qg(e,n),c=await Xg(e,o,t.mintedEnvSlug),u=c.gid,l=(await eh(e,s.gid,u))[0];if(l){let C=await th(e,l.gid,u),q=c.slug??u,J=ic(s);throw new R(`Already subscribed to ${J??"the listing given"} in ${q} (${l.gid}), delivering to ${C??"a receiving channel not yet bound"}.`,{code:"ALREADY_SUBSCRIBED",hint:"Nothing was sent. "+(C?`Watch it with \`${b(`tail ${C}`)}\`, or cancel`:"Cancel")+` it with \`${b(`unsubscribe ${J??"<publisherSlug>/<listingSlug>"} --env ${q}`)}\`.`})}let d=c.kind==="production",f=mC(s,i,t.tierName),p=pC(s),m=!!s.licence?.version,g=f>0&&d,v=f>0&&!d,h=s.subscriberAgreementVersion??nC,k=p.version,T=m;_x(r,{listing:s,environment:c,envGid:u,priceInCents:f,billingCycle:i,agreementVersion:h,licence:p,chargeable:g,sandboxOnly:v});let _=!1;if(g)throw new R(`${s.name??ic(s)??"This listing"} is a paid listing and ${c.name??u} is a production app, so this subscribe has to be charged. Charging and subscribing in one step is not available from the command line yet, so the CLI will not charge you: it never charges and subscribes as two separate steps.`,{code:"PAID_PATH_UNAVAILABLE",hint:`Subscribe to this listing from the dashboard, or with this command point --env at a sandbox app (nothing is charged), or subscribe to a free listing. See ${sC} for your cards.`});await $x(r,t.yes);let N=4,I=null;for(let C=0;;C+=1)try{I=await e.send({method:"POST",path:"/v1/feeds/listings/{listingId}/subscribe",pathParams:{listingId:s.gid},scope:"feed:write",body:{targetAppGids:[u],billingCycle:i,...t.tierName?{tierName:t.tierName}:{},...T?{acceptedSubscriberAgreementVersion:h,acceptedListingLicenceVersion:k}:{}}});break}catch(q){F(q);let J=Jg(q),Y=uC(J);if(Y)throw r.print(""),r.print(` ${be.yellow("!")} This subscribe is over your organization's agent spend cap.`),Y.approvalRequestId&&r.print(` Approval request ${Y.approvalRequestId}`),Y.expiresAt&&r.print(` Expires ${Y.expiresAt}`),r.print(" A billing admin of your organization was emailed to approve it."),new R("Refused by the agent spend cap.",{code:"SPEND_CAP_EXCEEDED",hint:"Run the same command again once a billing admin has approved the request."});let re=cC(J);if(!re||C+1>=N)throw lC(J,"SUBSCRIBE_FAILED");h=re.subscriberAgreementVersion??h,k=re.listingLicenceVersion??k,T=!0,r.print(` ${be.yellow("!")} The terms this listing is sold under are not the ones shown above. Here they are again.`),_x(r,{listing:s,environment:c,envGid:u,priceInCents:f,billingCycle:i,agreementVersion:h,licence:{...p,version:k},chargeable:g,sandboxOnly:v}),await $x(r,t.yes)}let j=I?.gid;if(!j)throw new R("The subscribe door answered without a subscription gid.",{code:"SUBSCRIBE_FAILED"});let z=a((C,q)=>new R(`Subscribed (${j}), but the receiving channel could not be read: ${C}.`,{code:"RECEIVING_CHANNEL_UNRESOLVED",hint:`The subscription exists \u2014 do not subscribe again. Read it with \`${b(`feed subscriptions get ${j}`)}\`.`,...q!==void 0?{cause:q}:{}}),"bindingFailure"),W;try{W=await e.send({method:"GET",path:"/v1/feeds/subscriptions/{subscriptionId}/bindings",pathParams:{subscriptionId:j},scope:"feed:read"})}catch(C){throw F(C),z("the bindings door refused",C)}let B=Array.isArray(W)?W:W?.data??[],K=(B.find(C=>C.targetAppGid===u)??B[0])?.receivingChannelGid;if(!K)throw z("no delivery binding carries a receiving channel yet");let ge;try{ge=await e.send({method:"GET",path:"/v1/channels/{channelId}",pathParams:{channelId:K},scope:"channels:read"})}catch(C){throw F(C),z(`channel ${K} could not be read`,C)}let ie=ge?.name;if(!ie)throw z(`channel ${K} answered without a name`);let w;try{w=await e.send({method:"GET",path:"/v1/feeds/subscriptions/{subscriptionId}",pathParams:{subscriptionId:j},scope:"feed:read"})}catch(C){throw F(C),new R(`Subscribed (${j}), but the subscription could not be read back: ${Jg(C)}.`,{code:"ENTITLEMENT_UNREADABLE",hint:`The subscription exists \u2014 do not subscribe again. Read it with \`${b(`feed subscriptions get ${j}`)}\`.`,cause:C})}return r.print(` ${be.green("\u2714")} Subscribed. ${be.dim(j)}`),r.print(` Receiving channel ${ie} (${K})`),r.print(` Entitlement ${w?.environment??"unknown"} \xB7 ${w?.mode??"unknown"} \xB7 ${w?.status??"unknown"}`),r.print(` ${be.dim(`Watch it: ${b(`tail ${ie}`)}`)}`),t.tail&&r.tail&&await r.tail(K),{subscriptionGid:j,receivingChannelGid:K,receivingChannelName:ie,charged:_,listingGid:s.gid,priceInCents:f,billingCycle:i,acceptedSubscriberAgreementVersion:h,acceptedListingLicenceVersion:k,entitlement:{...w?.environment?{environment:w.environment}:{},...w?.mode?{mode:w.mode}:{},...w?.status?{status:w.status}:{}}}}a(hC,"runSubscribe");function Ix(e,t={}){e.command("subscribe").argument("<listing>","listing reference: <publisher-slug>/<listing-slug> (or <publisher-slug>.<listing-slug>), e.g. wickfeed/lit").description("Subscribe this organization to a feed listing by its name and print the channel it arrives on").option("--env <slug>","environment that receives the feed, by slug (a gid is also accepted); defaults to the active environment").addOption(new tC("--billing-cycle <cycle>","monthly | yearly").choices(["monthly","yearly"]).default("monthly")).option("--tier <name>","tier name, for a tiered listing").option("--yes","accept the printed terms without a prompt").option("--tail","after subscribing, follow the receiving channel until interrupted").action(async(r,o)=>{let n=t.resolveKernel;if(!n)throw new R("No credentials resolver is wired for `subscribe`.",{code:"NOT_AUTHENTICATED",hint:"Run `"+b("login")+"` and try again."});let i=await n(),s=t.tail,c=t.confirm,u={print:a(d=>process.stdout.write(`${d}
|
|
581
|
+
`),"print"),confirm:a(async()=>c?c("Accept these terms and subscribe?"):!1,"confirm"),isTty:!!(process.stdin.isTTY&&process.stdout.isTTY),...s?{tail:a(d=>s(i,d),"tail")}:{}},l=t.mintedEnvSlug?t.mintedEnvSlug():void 0;await hC(i,{ref:r,...o.env?{env:o.env}:{},...l?{mintedEnvSlug:l}:{},yes:o.yes??(t.yes?t.yes():!1),...o.tail?{tail:!0}:{},...o.billingCycle?{billingCycle:o.billingCycle}:{},...o.tier?{tierName:o.tier}:{}},u)})}a(Ix,"registerSubscribe");import nh from"chalk";async function yC(e,t,r){let o=Yg(t),n=Wg(t.ref);Hg(r,n,t.ref);let i=await Qg(e,n),s=await Xg(e,o,t.mintedEnvSlug),c=s.slug??s.gid,u=await eh(e,i.gid,s.gid),l=ic(i)??"the listing given";if(u.length===0)throw new R(`No live subscription to ${l} in ${c}.`,{code:"NOT_SUBSCRIBED",hint:"Nothing was cancelled. Check the listing reference and --env."});if(u.length>1){let f=await Promise.all(u.map(async p=>{let m=await th(e,p.gid,s.gid);return`${p.gid} \u2192 ${m??"no receiving channel bound"}`}));r.print(` ${nh.yellow("!")} ${u.length} live subscriptions to ${l} in ${c}:`);for(let p of f)r.print(` ${p}`);throw new R(`${u.length} live subscriptions to ${l} in ${c} (${f.join("; ")}); none was cancelled.`,{code:"MULTIPLE_SUBSCRIPTIONS",hint:"Cancel the one you mean from the dashboard (Feed \u2192 Subscriptions)."})}let d=u[0];try{await e.send({method:"DELETE",path:"/v1/feeds/subscriptions/{subscriptionId}",pathParams:{subscriptionId:d.gid},scope:"feed:write"})}catch(f){throw F(f),sc(f,"UNSUBSCRIBE_FAILED")}return r.print(` ${nh.green("\u2714")} Unsubscribed ${n.ref} in ${c}. ${nh.dim(d.gid)}`),{ref:n.ref,environment:c,subscriptionGid:d.gid}}a(yC,"runUnsubscribe");function Px(e,t={}){e.command("unsubscribe").argument("<listing>","listing reference: <publisher-slug>/<listing-slug> (or <publisher-slug>.<listing-slug>), e.g. wickfeed/lit").description("Cancel this organization's subscription to a feed listing, by its name").option("--env <slug>","environment whose subscription to cancel, by slug (a gid is also accepted); defaults to the active environment").action(async(r,o)=>{let n=t.resolveKernel;if(!n)throw new R("No credentials resolver is wired for `unsubscribe`.",{code:"NOT_AUTHENTICATED",hint:"Run `"+b("login")+"` and try again."});let i=await n(),s=t.mintedEnvSlug?t.mintedEnvSlug():void 0;await yC(i,{ref:r,...o.env?{env:o.env}:{},...s?{mintedEnvSlug:s}:{}},{print:a(c=>process.stdout.write(`${c}
|
|
582
|
+
`),"print")})})}a(Px,"registerUnsubscribe");import Oe from"chalk";import br from"chalk";function Ex(e){return typeof e=="object"&&e!==null&&typeof e.tier=="string"}a(Ex,"isAccountStatus");function Tx(e){let t=[],r=br.bold(e.tier);if(e.trialExpired)r+=" "+br.red("trial expired");else if(e.inTrial){let n=typeof e.trialDaysLeft=="number"?`${e.trialDaysLeft} day${e.trialDaysLeft===1?"":"s"} left`:"active";r+=" "+br.yellow(`trial \u2014 ${n}`)}return t.push(`${br.dim("Plan")} ${r}`),(e.trialExpired||e.inTrial===!0||e.converted===!1)&&typeof e.upgradeUrl=="string"&&e.upgradeUrl.length>0&&t.push(`${br.dim("Upgrade")} ${br.cyan(e.upgradeUrl)}`),t}a(Tx,"renderPlanLines");function Ax(e={}){return{write:e.write??(t=>void process.stdout.write(t)),error:e.error??(t=>void process.stderr.write(t)),exit:e.exit??(t=>process.exit(t))}}a(Ax,"ioOf");async function vC(e){let t=Ax(e.io),r=await e.resolveSession();if(!r){t.error(Oe.red("Not signed in.")+" Run `"+b("login")+"` to authenticate.\n"),t.exit(1);return}let o,n;try{({sid:o,label:n}=await r.whoami())}catch(c){if(c instanceof $r){pt({write:t.error,exit:t.exit});return}F(c),o=r.sessionId(),n=null}t.write(`${Oe.dim("Session")} ${o?Oe.cyan(o):Oe.dim("(unknown)")}
|
|
583
|
+
`),t.write(`${Oe.dim("Device")} ${n?Oe.bold(n):Oe.dim("(unavailable \u2014 could not reach npayload)")}
|
|
584
|
+
`);let i=e.resolveContext?await e.resolveContext(r):Cc(r),s=a(c=>c?Oe.bold(c):Oe.dim("(none)"),"show");if(t.write(`${Oe.dim("Org")} ${s(i.org)}
|
|
585
|
+
`),t.write(`${Oe.dim("App")} ${s(i.app)}
|
|
586
|
+
`),t.write(`${Oe.dim("Env")} ${s(i.env)}
|
|
587
|
+
`),e.fetchAccountStatus){let c=await e.fetchAccountStatus().catch(u=>(F(u),null));if(c&&Ex(c))for(let u of Tx(c))t.write(u+`
|
|
588
|
+
`)}t.exit(0)}a(vC,"runWhoami");async function bC(e,t){let r=Ax(t.io),o=await t.resolveSession();if(!o){r.write(Oe.dim(`Already signed out.
|
|
589
|
+
`)),r.exit(0);return}e.all?(await o.logoutAll(),r.write(Oe.green("\u2713")+` Signed out of ALL your npayload CLI sessions.
|
|
590
|
+
`)):(await o.logout(),r.write(Oe.green("\u2713")+` Signed out of this npayload CLI session.
|
|
591
|
+
`)),r.exit(0)}a(bC,"runLogout");function Cx(e,t){let r={...t,resolveSession:a(()=>Ze(),"resolveSession"),resolveContext:a(o=>{let n=e.opts().env;return Cc(o,typeof n=="string"&&n.trim()!==""?{explicitEnv:n}:{})},"resolveContext")};e.command("whoami").description("Show the current CLI session id, device label, and active org / app / env context").action(async()=>{await vC(r)}),e.command("logout").description("Sign out this CLI session (revoke it server-side and clear local credentials)").option("--all","revoke ALL of your CLI sessions across every device, not just this one").action(async o=>{await bC({all:o.all===!0},r)})}a(Cx,"registerSessionCommands");import IC from"chalk";function at(e){return typeof e=="object"&&e!==null?e:{}}a(at,"rec");function Ie(e){return typeof e=="string"&&e.length>0?e:void 0}a(Ie,"asString");var ct={accepted:a(e=>({conversationId:Ie(at(e).conversationId)}),"accepted"),phaseChange:a(e=>{let t=at(e);return{from:Ie(t.from),to:Ie(t.to),reason:Ie(t.reason)}},"phaseChange"),toolStart:a(e=>{let t=at(e);return{toolCallId:Ie(t.toolCallId),toolName:Ie(t.toolName),arguments:t.arguments}},"toolStart"),toolEnd:a(e=>{let t=at(e);return{toolCallId:Ie(t.toolCallId),success:t.success===!0,result:t.result,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0}},"toolEnd"),turnComplete:a(e=>{let t=at(e);return{turnNumber:typeof t.turnNumber=="number"?t.turnNumber:void 0,tokensUsed:typeof t.tokensUsed=="number"?t.tokensUsed:void 0}},"turnComplete"),contentDelta:a(e=>({content:Ie(at(e).content)}),"contentDelta"),executionComplete:a(e=>{let t=at(e),r=at(t.usage);return{text:Ie(t.text),usage:{promptTokens:typeof r.promptTokens=="number"?r.promptTokens:void 0,completionTokens:typeof r.completionTokens=="number"?r.completionTokens:void 0,totalTokens:typeof r.totalTokens=="number"?r.totalTokens:void 0}}},"executionComplete"),response:a(e=>({text:Ie(at(e).text)}),"response"),done:a(e=>{let t=at(e);return{conversationId:Ie(t.conversationId),executionId:Ie(t.executionId),status:Ie(t.status)}},"done"),error:a(e=>{let t=at(e);return{message:Ie(t.message),code:Ie(t.code),kind:Ie(t.kind)}},"error")};function rh(e,t=60){if(e==null)return"";let r;if(typeof e=="string")r=e;else try{r=JSON.stringify(e)}catch{r=String(e)}return r=r.replace(/\s+/g," ").trim(),r.length>t&&(r=`${r.slice(0,Math.max(0,t-1))}\u2026`),r}a(rh,"previewOneLine");function oh(e){return typeof e!="number"||!Number.isFinite(e)||e<0?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}a(oh,"formatDuration");function ac(e){return{rendered:"",openTools:new Map,done:!1,startedAt:e}}a(ac,"initialTurnState");function wC(e,t){return t===e?null:t.startsWith(e)?t.slice(e.length):e.startsWith(t)?null:`
|
|
592
|
+
${t}`}a(wC,"contentSuffix");function cc(e,t,r=e.startedAt){let o={...e,openTools:new Map(e.openTools)},n=[];switch(t.event){case"accepted":{let i=ct.accepted(t.data);i.conversationId&&(o.conversationId=i.conversationId),n.push({kind:"spinner",text:"thinking\u2026"});break}case"phase_change":{let i=ct.phaseChange(t.data);i.to&&(o.phase=i.to,n.push({kind:"phase",text:i.reason?`\u203A ${i.to} \u2014 ${i.reason}`:`\u203A ${i.to}`}),n.push({kind:"spinner",text:`${i.to}\u2026`}));break}case"tool_call_start":{let i=ct.toolStart(t.data),s=i.toolCallId??`tool-${o.openTools.size}`,c=i.toolName??"tool";o.openTools.set(s,{name:c});let u=rh(i.arguments,48);n.push({kind:"tool_start",id:s,text:u?`${c} ${u}`:c}),n.push({kind:"spinner",text:`running ${c}\u2026`});break}case"tool_call_end":{let i=ct.toolEnd(t.data),s=i.toolCallId??"",c=(s&&o.openTools.get(s)?.name)??"tool";s&&o.openTools.delete(s);let u=oh(i.durationMs),l=!i.success&&i.result!==void 0?` ${rh(i.result,60)}`:"";n.push({kind:"tool_end",id:s,ok:i.success===!0,text:`${c}${u?` (${u})`:""}${l}`}),n.push({kind:"spinner",text:`${o.phase??"working"}\u2026`});break}case"turn_complete":{let i=ct.turnComplete(t.data);if(i.turnNumber!==void 0){let s=i.tokensUsed!==void 0?` \xB7 ${i.tokensUsed} tokens`:"";n.push({kind:"phase",text:`\u203A turn ${i.turnNumber}${s}`})}break}case"content_delta":{let i=ct.contentDelta(t.data);if(i.content!==void 0){let s=wC(o.rendered,i.content);s!==null&&s.length>0&&(o.rendered=i.content,n.push({kind:"content",text:s}))}break}case"execution_complete":{let i=ct.executionComplete(t.data);i.usage&&(o.usage=i.usage),i.text&&o.rendered===""&&(o.rendered=i.text,n.push({kind:"content",text:i.text}));break}case"response":{let i=ct.response(t.data);i.text&&o.rendered===""&&(o.rendered=i.text,n.push({kind:"content",text:i.text}));break}case"done":{let i=ct.done(t.data);i.conversationId&&(o.conversationId=i.conversationId),i.executionId&&(o.executionId=i.executionId),o.status=i.status??"completed",o.done=!0;let s=[o.status];if(o.usage?.totalTokens!==void 0){let u=o.usage.promptTokens!==void 0&&o.usage.completionTokens!==void 0?` (${o.usage.promptTokens}+${o.usage.completionTokens})`:"";s.push(`${o.usage.totalTokens} tokens${u}`)}let c=r-o.startedAt;c>0&&s.push(oh(c)),o.status!=="completed"&&o.status!=="cancelled"&&n.push({kind:"error",text:`run ${o.status}`}),n.push({kind:"meta",text:`\u23FA ${s.filter(Boolean).join(" \xB7 ")}`}),n.push({kind:"end"});break}case"error":{let i=ct.error(t.data);o.status="failed",o.done=!0;let s=Ly(i);n.push({kind:"error",text:s.message,code:i.kind??i.code}),s.hint&&n.push({kind:"meta",text:`\u2192 ${s.hint}`}),n.push({kind:"end"});break}default:break}return{state:o,actions:n}}a(cc,"reduceChatEvent");import ut from"chalk";var Rx={out:a(e=>process.stdout.write(e),"out"),err:a(e=>process.stderr.write(e),"err")},wr=class{static{a(this,"ChatRenderer")}spinner=null;spinnerRetired=!1;contentOpen=!1;sinks;interactive;constructor(t){this.sinks=t?.sinks??Rx,this.interactive=t?.interactive??process.stderr.isTTY===!0}beginTurn(){this.spinnerRetired=!1,this.contentOpen=!1}spin(t){!this.interactive||this.spinnerRetired||(this.spinner?this.spinner.text=t:this.spinner=new An(t).start())}pauseSpinner(){this.spinner?.stop()}resumeSpinner(){!this.spinnerRetired&&this.interactive&&this.spinner?.start()}retireSpinner(){this.spinner?.stop(),this.spinner=null,this.spinnerRetired=!0}stepLine(t){this.pauseSpinner(),this.contentOpen&&(this.sinks.out(`
|
|
578
593
|
`),this.contentOpen=!1),this.sinks.err(`${t}
|
|
579
|
-
`),this.resumeSpinner()}apply(t){switch(t.kind){case"spinner":this.spin(
|
|
594
|
+
`),this.resumeSpinner()}apply(t){switch(t.kind){case"spinner":this.spin(ut.dim(t.text));break;case"phase":this.stepLine(ut.dim(t.text));break;case"tool_start":this.stepLine(ut.dim(` \u2699 ${t.text}`));break;case"tool_end":this.stepLine(t.ok?ut.dim(` ${ut.green("\u2713")} ${t.text}`):` ${ut.red("\u2717")} ${ut.dim(t.text)}`);break;case"content":this.retireSpinner(),this.sinks.out(t.text),this.contentOpen=!t.text.endsWith(`
|
|
580
595
|
`);break;case"meta":this.retireSpinner(),this.contentOpen&&(this.sinks.out(`
|
|
581
|
-
`),this.contentOpen=!1),this.sinks.err(`${
|
|
596
|
+
`),this.contentOpen=!1),this.sinks.err(`${ut.dim(t.text)}
|
|
582
597
|
`);break;case"error":this.retireSpinner(),this.contentOpen&&(this.sinks.out(`
|
|
583
|
-
`),this.contentOpen=!1),this.sinks.err(`${
|
|
598
|
+
`),this.contentOpen=!1),this.sinks.err(`${ut.red(`\u2717 ${t.text}`)}${t.code?ut.dim(` [${t.code}]`):""}
|
|
584
599
|
`);break;case"end":this.retireSpinner(),this.contentOpen&&(this.sinks.out(`
|
|
585
600
|
`),this.contentOpen=!1);break}}interrupt(t){this.retireSpinner(),this.contentOpen&&(this.sinks.out(`
|
|
586
|
-
`),this.contentOpen=!1),this.sinks.err(`${
|
|
587
|
-
`)}},
|
|
588
|
-
`)}};function
|
|
589
|
-
`);var
|
|
590
|
-
`));return}let i=await(r.select??
|
|
591
|
-
`));for(let c of s){let
|
|
601
|
+
`),this.contentOpen=!1),this.sinks.err(`${ut.dim(t)}
|
|
602
|
+
`)}},uc=class{constructor(t=Rx){this.sinks=t}static{a(this,"NdjsonRenderer")}onEvent(t){this.sinks.out(`${JSON.stringify({event:t.event,data:t.data})}
|
|
603
|
+
`)}};function kC(e){return e?/nonce="([^"]+)"/.exec(e)?.[1]:void 0}a(kC,"parseDpopNonce");var xC="executions:execute";async function*Ho(e,t,r,o,n){let i=Dt(Tn(e)??qe(),n?.fetchImpl),s=`${t.replace(/\/+$/,"")}/v1/primus/chat/stream-pipeline`,c=JSON.stringify({agentGid:r.agentGid,input:r.input,...r.conversationGid?{conversationGid:r.conversationGid}:{}}),u=a(async()=>{Tn(e)?.check(s);let d=await e.auth.getAccessToken([xC]),f=await e.auth.signDpopProof({method:"POST",url:s,accessToken:d.token});return i(s,{method:"POST",headers:{Authorization:`DPoP ${d.token}`,DPoP:f,Accept:"text/event-stream","content-type":"application/json"},body:c,signal:o})},"doFetch"),l=await u();if(l.status===401){let d=kC(l.headers.get("www-authenticate"));d&&(e.auth.cacheNonce(new URL(s).origin,d),l=await u())}if(!l.ok){let d="";try{d=(await l.text()).slice(0,300)}catch{}throw new R(`chat stream request failed (${l.status})${d?`: ${d}`:""}`,{code:l.status===401||l.status===403?"CHAT_AUTH":l.status===404?"PRIMUS_UNREACHABLE":"CHAT_STREAM_FAILED",hint:l.status===403?"your credential is missing the executions:execute scope \u2014 re-run `"+b("push")+"` (permissions sync) or grant it in the dashboard":l.status===404?"the chat route was not found at this endpoint \u2014 check NPAYLOAD_PRIMUS_API_URL (or --api-url) names your AI endpoint":void 0})}if(!l.body)throw new R("chat stream returned no body",{code:"CHAT_STREAM_FAILED"});for await(let d of bh(l.body))yield{event:d.event??"message",data:d.data}}a(Ho,"streamChatTurn");function lc(e){let t=e;return(Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[]).filter(o=>typeof o=="object"&&o!==null)}a(lc,"rowsOf");var lt=a(e=>typeof e=="string"&&e?e:void 0,"str");async function Yo(e){let t=await e.send({method:"GET",path:"/v1/primus/agents",query:{activeOnly:!0},scope:"agents:read"});return lc(t).map(r=>({gid:lt(r.gid)??"",name:lt(r.name)??"(unnamed)",description:lt(r.description),status:lt(r.status)})).filter(r=>r.gid&&(r.status===void 0||r.status==="active"))}a(Yo,"listActiveAgents");function dc(e,t,r="the --agent given"){let o=e.find(s=>s.gid===t);if(o)return o;let n=t.toLowerCase(),i=e.filter(s=>s.name.toLowerCase()===n);if(i.length===1)return i[0];throw i.length>1?new R(`${r} is ambiguous (it is not shown here): it matches ${i.length} active agents by name`,{code:"AGENT_AMBIGUOUS",hint:`use the gid: ${i.map(s=>s.gid).join(" | ")}`}):new R(`no active agent matches ${r} (it is not shown here)`,{code:"AGENT_NOT_FOUND",hint:e.length?`available: ${e.slice(0,8).map(s=>s.name).join(", ")}`:"no active agents in this app \u2014 create one first ("+b("primus agents create")+" / dashboard)"})}a(dc,"resolveAgent");async function Ox(e,t){let r=await e.send({method:"GET",path:"/v1/primus/conversations/by-agent",query:{agentGid:t},scope:"conversations:read"});return lc(r).map(o=>({id:lt(o.gid)??"",title:lt(o.title),updatedAt:typeof o.updatedAt=="number"?o.updatedAt:typeof o.lastMessageAt=="number"?o.lastMessageAt:void 0})).filter(o=>o.id)}a(Ox,"listConversationsByAgent");async function Nx(e,t,r=10){let o=await e.send({method:"GET",path:"/v1/primus/conversations/{conversationId}/messages",pathParams:{conversationId:t},query:{messageLimit:r},scope:"conversations:read"}),n=o??{};return(Array.isArray(n.messages)?n.messages:lc(o)).filter(s=>typeof s=="object"&&s!==null).map(s=>({role:lt(s.role)??"message",content:lt(s.content)??JSON.stringify(s.content??"").slice(0,200)})).slice(-r)}a(Nx,"getConversationMessages");async function Dx(e,t){try{let r=await e.send({method:"GET",path:"/v1/primus/executions/by-conversation",query:{conversationGid:t,limit:5},scope:"executions:read"}),o=lc(r).find(i=>lt(i.status)==="running"||lt(i.status)==="pending"),n=o?lt(o.gid):void 0;return n?(await e.send({method:"POST",path:"/v1/primus/executions/{executionId}/cancel",pathParams:{executionId:n},body:{reason:"interrupted from np primus chat"},scope:"executions:execute"}),!0):!1}catch(r){return F(r),!1}}a(Dx,"cancelRunningExecution");import{createInterface as _C}from"readline/promises";import fe from"chalk";function jx(e){let t=e.trim();if(!t.startsWith("/"))return null;let[r,...o]=t.slice(1).split(/\s+/),n=o.join(" ").trim()||void 0;switch((r??"").toLowerCase()){case"help":case"h":case"?":return{kind:"help"};case"exit":case"quit":case"q":return{kind:"exit"};case"new":return{kind:"new"};case"resume":return{kind:"resume"};case"info":return{kind:"info"};case"agent":return{kind:"agent",ref:n};default:return{kind:"unknown",raw:t}}}a(jx,"parseSlashCommand");var Ux=["commands:"," /agent [name|gid] switch agent (picker when no argument; resets the conversation)"," /new start a fresh conversation with the current agent"," /resume pick one of this agent's conversations to continue"," /info show current agent, conversation, and endpoint"," /help this help"," /exit leave the chat","","Ctrl-C during a reply interrupts the run (best-effort server cancel);","at the prompt it exits. Messages are single-line in this version."].join(`
|
|
604
|
+
`);var We=a(e=>{process.stderr.write(e)},"err");async function ih(e,t,r={}){let o=await Yo(e);if(o.length===0){let{CliError:n}=await import("../chunk-XPZRF64T.mjs");throw new n("no active agents in this app",{code:"NO_AGENTS",hint:"create one first: "+b("primus agents create --name \u2026")+" (or use the dashboard), then re-run "+b("primus chat")})}return o.length===1?o[0]:(r.select??Qe)("Pick an agent",o.map(n=>({name:n.gid===t?.gid?`${n.name} (current)`:n.name,value:n,description:n.description})))}a(ih,"pickAgent");async function Lx(e,t,r={}){let o=r.err??We,n=await Ox(e,t.gid);if(n.length===0){o(fe.dim(`no previous conversations with ${t.name} \u2014 starting fresh
|
|
605
|
+
`));return}let i=await(r.select??Qe)(`Resume a conversation with ${t.name}`,n.slice(0,20).map(s=>({name:s.title??s.id,value:s.id,description:s.updatedAt?new Date(s.updatedAt).toLocaleString():void 0})));try{let s=await Nx(e,i,10);if(s.length){o(fe.dim("\u2500".repeat(40)+`
|
|
606
|
+
`));for(let c of s){let u=c.role==="user"?"you":c.role;o(fe.dim(`${u}: ${c.content.split(`
|
|
592
607
|
`)[0].slice(0,120)}
|
|
593
|
-
`))}o(
|
|
594
|
-
`))}}catch(s){
|
|
595
|
-
`),{interrupted:!1,cancelled:!1}}catch(
|
|
608
|
+
`))}o(fe.dim("\u2500".repeat(40)+`
|
|
609
|
+
`))}}catch(s){F(s)}return i}a(Lx,"pickConversation");async function $C(e,t,r,o,n,i,s={}){let c=ac(Date.now());n.beginTurn();let u=Ho(e,t,{agentGid:r.agent.gid,input:o,conversationGid:r.conversationId},i,s.fetchImpl?{fetchImpl:s.fetchImpl}:void 0);for await(let l of u){let d=cc(c,l,Date.now());c=d.state;for(let f of d.actions)n.apply(f);if(c.conversationId&&(r.conversationId=c.conversationId),c.done)break}return c}a($C,"runTurn");async function SC(e,t,r,o,n,i,s={}){let c=s.err??We;try{return await $C(e,t,r,o,n,i.signal,s),c(`
|
|
610
|
+
`),{interrupted:!1,cancelled:!1}}catch(u){if(!i.signal.aborted)throw u;n.interrupt("\u23F9 interrupted");let l=!1;if(r.conversationId){let d;l=await Promise.race([Dx(e,r.conversationId),new Promise(f=>{d=setTimeout(()=>f(!1),s.cancelTimeoutMs??2e3)})]),d&&clearTimeout(d),c(fe.dim(l?`\xB7 run cancelled server-side
|
|
596
611
|
|
|
597
612
|
`:`\xB7 could not confirm server-side cancel \u2014 the run may finish anyway
|
|
598
613
|
|
|
599
|
-
`))}else c(
|
|
614
|
+
`))}else c(fe.dim(`\xB7 no conversation yet \u2014 nothing to cancel server-side
|
|
600
615
|
|
|
601
|
-
`));return{interrupted:!0,cancelled:
|
|
616
|
+
`));return{interrupted:!0,cancelled:l}}}a(SC,"runInterruptibleTurn");async function zx(e,t,r,o){o.resume&&(r.conversationId=await Lx(e,r.agent));let n=_C({input:process.stdin,output:process.stderr}),i=new wr,s=!1,c=null,u=!1;for(n.on("SIGINT",()=>{if(s&&c){c.abort();return}u=!0,n.close()}),We(fe.dim(`chatting with ${fe.bold(r.agent.name)} \xB7 ${r.conversationId?`resuming ${r.conversationId}`:"new conversation"} \xB7 /help for commands \xB7 Ctrl-C to leave
|
|
602
617
|
|
|
603
|
-
`));!
|
|
604
|
-
`);break;case"exit":
|
|
605
|
-
`));break;case"resume":try{let p=await
|
|
606
|
-
`))}break;case"agent":try{let p=
|
|
607
|
-
`)))}catch(p){
|
|
608
|
-
`))}break;case"info":
|
|
618
|
+
`));!u;){let l;try{l=await n.question(fe.cyan("\u276F "))}catch{break}let d=l.trim();if(!d)continue;let f=jx(d);if(f){switch(f.kind){case"help":We(`${fe.dim(Ux)}
|
|
619
|
+
`);break;case"exit":u=!0;break;case"new":r.conversationId=void 0,We(fe.dim(`started a new conversation
|
|
620
|
+
`));break;case"resume":try{let p=await Lx(e,r.agent);p&&(r.conversationId=p)}catch(p){We(fe.red(`${ae(p instanceof Error?p.message:String(p),p)}
|
|
621
|
+
`))}break;case"agent":try{let p=f.ref?dc(await Yo(e),f.ref,"the agent named after /agent"):await ih(e,r.agent);p.gid!==r.agent.gid&&(r.agent=p,r.conversationId=void 0,We(fe.dim(`switched to ${p.name} (new conversation)
|
|
622
|
+
`)))}catch(p){We(fe.red(`${ae(p instanceof Error?p.message:String(p),p)}
|
|
623
|
+
`))}break;case"info":We(fe.dim([`agent ${r.agent.name} (${r.agent.gid})`,`conversation ${r.conversationId??"(new \u2014 created on first message)"}`,`endpoint ${t}`].join(`
|
|
609
624
|
`)+`
|
|
610
|
-
`));break;case"unknown":
|
|
611
|
-
`));break}continue}s=!0,c=new AbortController;try{await
|
|
612
|
-
`)+(v?
|
|
625
|
+
`));break;case"unknown":We(fe.dim(`unknown command (it is not shown here) \u2014 /help lists the commands
|
|
626
|
+
`));break}continue}s=!0,c=new AbortController;try{await SC(e,t,r,d,i,c)}catch(p){let m=gi(p),g=m instanceof Error?m.message:String(m),v=m?.hint;We(fe.red(`\u2717 ${ae(g,p)}
|
|
627
|
+
`)+(v?fe.dim(` ${v}
|
|
613
628
|
`):"")+`
|
|
614
|
-
`)}finally{s=!1,c=null}}n.close(),
|
|
615
|
-
`))}a(
|
|
616
|
-
`)),process.exitCode=1}})}a(
|
|
617
|
-
`)),r}let i=new Set;for(let s of
|
|
618
|
-
`))}}return r}a(
|
|
629
|
+
`)}finally{s=!1,c=null}}n.close(),We(fe.dim(`bye
|
|
630
|
+
`))}a(zx,"runChatRepl");function PC(e,t){if(e.json&&!e.message)throw new R("--json requires --message (NDJSON output is one-shot only)",{code:"JSON_REQUIRES_MESSAGE",hint:b('primus chat --agent <ref> --message "\u2026" --json')});if(e.message){if(!e.agent&&!t)throw new R("--message without a TTY also needs --agent",{code:"AGENT_REQUIRED",hint:b('primus chat --agent <gid|name> --message "\u2026"')});return"oneshot"}if(!t)throw new R("interactive chat needs a TTY",{code:"NO_TTY",hint:"for scripts/CI use one-shot mode: "+b('primus chat --agent <ref> --message "\u2026" [--json]')});return"repl"}a(PC,"assertChatInvocation");async function EC(e){let{buildKernel:t}=await import("../chunk-NCKK7PHF.mjs"),r=e??se(process.env.NPAYLOAD_PRIMUS_API_URL,"primusApiUrl"),o=await t(r),n=r??se(process.env.NPAYLOAD_API_URL,"apiUrl","https://api.npayload.com");return{kernel:o,baseUrl:n}}a(EC,"resolveChatKernel");async function TC(e,t,r,o,n,i={}){let s=i.fetchImpl?{fetchImpl:i.fetchImpl}:void 0,c=new AbortController,u=a(()=>c.abort(),"onSignal");process.on("SIGINT",u);try{let l;if(n){let f=new uc(i.sinks);for await(let p of Ho(e,t,{agentGid:r.gid,input:o},c.signal,s)){if(f.onEvent(p),p.event==="done"){l=(p.data??{}).status;break}if(p.event==="error"){l="failed";break}}}else{let f=new wr(i.sinks?{sinks:i.sinks}:void 0);f.beginTurn();let p=ac(Date.now()),m=Ho(e,t,{agentGid:r.gid,input:o},c.signal,s);for await(let g of m){let v=cc(p,g,Date.now());p=v.state;for(let h of v.actions)f.apply(h);if(p.done)break}l=p.status}let d=l==="completed"?0:1;return process.exitCode=d,d}finally{process.off("SIGINT",u)}}a(TC,"runOneShot");function Mx(e){e.command("chat").description("chat with an agent \u2014 streams the run's steps (phases, tool calls) and the reply live").option("--agent <ref>","agent gid or name (picker on a TTY when omitted)").option("--resume","pick one of the agent's conversations to continue").option("--message <text>","one-shot: send one message, print the reply, exit").option("--json","one-shot only: emit the raw stream as NDJSON").option("--api-url <url>","override the AI endpoint (defaults to npayload's own)").action(async t=>{try{let r=PC(t,Le()),{kernel:o,baseUrl:n}=await EC(t.apiUrl),i;try{i=await Yo(o)}catch(u){let l=u?.status;throw l===404?new R("the AI endpoint is not reachable at this base URL",{code:"PRIMUS_UNREACHABLE",hint:"check NPAYLOAD_PRIMUS_API_URL (or --api-url) names your AI endpoint",cause:u}):l===403?new R("your credential is missing the agents:read scope",{code:"CHAT_AUTH",hint:"re-run `"+b("push")+"` (permissions sync) or grant the ai scopes in the dashboard",cause:u}):u}let s=t.agent?dc(i,t.agent):r==="oneshot"?(()=>{if(i.length===1)return i[0];throw new R("--message needs --agent when more than one agent exists",{code:"AGENT_REQUIRED",hint:`available: ${i.slice(0,8).map(u=>u.name).join(", ")}`})})():await ih(o);if(r==="oneshot"){await TC(o,n,s,t.message,t.json===!0);return}await zx(o,n,{agent:s},{resume:t.resume===!0})}catch(r){(r instanceof R||r instanceof we)&&pe(r),process.stderr.write(IC.red(`\u2717 ${r instanceof Error?r.message:String(r)}
|
|
631
|
+
`)),process.exitCode=1}})}a(Mx,"registerChat");import me from"chalk";import{readFileSync as AC,writeFileSync as Fx}from"fs";import{resolve as CC}from"path";function qx(e,t){let r=[];for(let o of Ec()){let n=e[o];if(n)for(let[i,s]of Object.entries(n))for(let c of Ir(o)){let u=gy(di(s,c.path))??[],l=new Map;for(let m of Object.keys(e[c.parent]??{}))l.set(m,{name:m,source:"config"});for(let m of t[c.parent]??[]){let g=l.get(m.name);l.set(m.name,{name:m.name,source:g?.source??"live",gid:m.gid??g?.gid})}let d=[...l.values()].sort((m,g)=>m.name.localeCompare(g.name)),f=new Set(d.map(m=>m.name)),p=u.filter(m=>!f.has(m));r.push({resource:o,key:i,spec:c,current:u,candidates:d,dangling:p})}}return r}a(qx,"computeWiringSlots");function RC(e,t,r){if(hy(e.current,t))return null;let o=e.spec.array?t:t[0]??null,n=t.map(s=>e.candidates.find(c=>c.name===s)?.gid).filter(s=>!!s),i=n.length?`// ${r}: ${n.join(", ")}`:void 0;return{resource:e.resource,key:e.key,field:e.spec.path,kind:"update-field",value:o,...i?{trailingComment:i}:{}}}a(RC,"slotToChange");function OC(e){let t=e.current.length?e.current.join(", "):me.dim("(none)"),r=e.dangling.length?me.red(` \u26A0 not found: ${e.dangling.join(", ")}`):"";return`${e.resource} "${e.key}" \u2192 ${e.spec.label}: ${t}${r}`}a(OC,"describeSlot");var NC={agents:"/v1/primus/agents",skills:"/v1/primus/skills",tools:"/v1/primus/tools"};async function DC(e,t){let r={},o=se(process.env.NPAYLOAD_PRIMUS_API_URL,"primusApiUrl"),n;try{n=await Et(o,t)}catch(s){return e(me.yellow(` \u2022 live topology unavailable (${s instanceof Error?s.message:String(s)}) \u2014 using config-declared candidates only
|
|
632
|
+
`)),r}let i=new Set;for(let s of Ec())for(let c of Ir(s))i.add(c.parent);for(let s of i){let c=NC[s];if(c)try{let u=await n.send({method:"GET",path:c}),l=jC(u);r[s]=l.map(d=>({name:typeof d.name=="string"?d.name:"",gid:typeof d.gid=="string"?d.gid:void 0})).filter(d=>d.name)}catch(u){F(u),e(me.yellow(` \u2022 could not list ${s} (${u instanceof Error?u.message:String(u)})
|
|
633
|
+
`))}}return r}a(DC,"fetchLive");function jC(e){let t=e;return(Array.isArray(t)?t:Array.isArray(t.data)?t.data:[]).filter(o=>typeof o=="object"&&o!==null)}a(jC,"extractRows");async function UC(e){let t=e.sink??(u=>void process.stdout.write(u)),r={checkbox:tv,select:Qe,confirm:Ur,...e.prompts},o=qx(e.config,e.live);t(me.bold(`
|
|
619
634
|
Wiring relationships (env: ${e.env}) \u2014 Enter to keep a slot unchanged
|
|
620
635
|
|
|
621
|
-
`));let n=[];for(let
|
|
622
|
-
`));continue}let u
|
|
636
|
+
`));let n=[];for(let u of o){if(u.candidates.length===0){t(me.dim(` ${u.resource} "${u.key}" \u2192 ${u.spec.label}: no candidates yet (declare some ${u.spec.parent} first)
|
|
637
|
+
`));continue}let l=u.candidates.map(p=>({name:p.source==="live"&&!Object.keys(e.config[u.spec.parent]??{}).includes(p.name)?`${p.name} ${me.dim("(live)")}`:p.name,value:p.name,checked:u.current.includes(p.name)})),d;if(u.spec.array)d=await r.checkbox(`${u.resource} "${u.key}" \u2192 ${u.spec.label}`,l);else{let p=await r.select(`${u.resource} "${u.key}" \u2192 ${u.spec.label}`,[{name:me.dim("(none)"),value:""},...l.map(m=>({name:m.name,value:m.value}))]);d=p?[p]:[]}let f=RC(u,d,e.env);f&&n.push(f)}if(n.length===0)return t(me.green(`
|
|
623
638
|
\u2713 Everything already wired \u2014 no changes.
|
|
624
639
|
`)),{changes:n};t(me.bold(`
|
|
625
640
|
Changes to write:
|
|
626
|
-
`));for(let
|
|
641
|
+
`));for(let u of n){let l=Array.isArray(u.value)?`[${u.value.join(", ")}]`:String(u.value);t(` ${u.resource} "${u.key}".${u.field} = ${l}${u.trailingComment?me.dim(` ${u.trailingComment}`):""}
|
|
627
642
|
`)}if(!await r.confirm(`
|
|
628
643
|
Write these to the config?`,!0))return t(me.dim(`Aborted \u2014 nothing written.
|
|
629
|
-
`)),{changes:n,aborted:!0};let s={merged:{},changes:n,conflicts:[],localOnly:[]},c=await
|
|
630
|
-
`));return}if(t.check||!
|
|
644
|
+
`)),{changes:n,aborted:!0};let s={merged:{},changes:n,conflicts:[],localOnly:[]},c=await Ja(e.sourceText,s);return!c.ok||c.text===void 0?{changes:n,reason:c.reason??"unknown"}:{changes:n,text:c.text}}a(UC,"runWireWizard");function Zx(e){e.command("wire").description("Interactively wire primus relationships (agents\u2194skills\u2194tools\u2194triggers) by NAME \u2014 no gids").option("--config <path>","path to primus.config.ts (default: ./npayload/primus.config.ts)").option("--check","print the wiring report and change nothing").option("--env <slug>","environment to read live gids from and name in the gid pin comment (default: the active environment)").action(async(t,r)=>{try{let o=ft(t,r),n=Rn(o!==void 0?{explicitSlug:o}:{}),i=n??"sandbox",s=t.config?CC(process.cwd(),t.config):He("primus");if(!s)throw new Error("no primus.config.ts found \u2014 run from a project with npayload/primus.config.ts (or pass --config).");let c=await le(s),u=a(m=>process.stdout.write(m),"sink"),l=await DC(u,n),d=qx(c,l);if(d.length===0){u(me.dim(`No relationship slots in this config (declare agents/skills/tools/triggers first).
|
|
645
|
+
`));return}if(t.check||!Le()){u(me.bold(`
|
|
631
646
|
Wiring report
|
|
632
|
-
`));for(let g of d)
|
|
633
|
-
`);let
|
|
634
|
-
${
|
|
635
|
-
`)),!t.check&&!
|
|
647
|
+
`));for(let g of d)u(` ${OC(g)}
|
|
648
|
+
`);let m=d.filter(g=>g.dangling.length);m.length&&u(me.yellow(`
|
|
649
|
+
${m.length} slot(s) reference a name that doesn't exist \u2014 fix the name or declare the parent, then run \`${b("wire")}\`.
|
|
650
|
+
`)),!t.check&&!Le()&&u(me.dim(`
|
|
636
651
|
(non-interactive: showing the report only; run in a TTY to wire)
|
|
637
|
-
`));return}let
|
|
652
|
+
`));return}let f=AC(s,"utf8"),p=await UC({config:c,live:l,env:i,sourceText:f,sink:u});if(p.changes.length===0||p.aborted)return;if(p.text===void 0){let m=`${s}.wire-suggested.txt`;Fx(m,`Could not apply wiring automatically (${p.reason??"unknown"}). Apply manually:
|
|
638
653
|
|
|
639
654
|
`+p.changes.map(g=>` ${g.resource}.${g.key}.${g.field} = ${JSON.stringify(g.value)}${g.trailingComment?" "+g.trailingComment:""}`).join(`
|
|
640
655
|
`)+`
|
|
641
|
-
`),
|
|
642
|
-
\u26A0 Could not edit the config safely \u2014 wrote suggestions to ${
|
|
643
|
-
`));return}
|
|
656
|
+
`),u(me.yellow(`
|
|
657
|
+
\u26A0 Could not edit the config safely \u2014 wrote suggestions to ${m} (config untouched).
|
|
658
|
+
`));return}Fx(s,p.text),u(me.green(`
|
|
644
659
|
\u2713 Wired ${p.changes.length} relationship(s) into ${s}.
|
|
645
|
-
`)),
|
|
646
|
-
`)}catch{}}a(
|
|
647
|
-
`)
|
|
648
|
-
`,{mode:384}),
|
|
649
|
-
`,{mode:384}),
|
|
660
|
+
`)),u(me.dim("Run `"+b("push")+"` to reconcile the new wiring to your deployment.\n"))}catch(o){pe(o)}})}a(Zx,"registerWire");import{dirname as LC}from"path";function zC(e){if(!e||typeof e!="object")return null;let t=e,r=typeof t.slug=="string"?t.slug:void 0,o=t.kind==="production"||t.kind==="development"?t.kind:void 0;if(!r||!o)return null;let n={slug:r,kind:o},i=typeof t.gid=="string"?t.gid:typeof t.envId=="string"?t.envId:void 0;i&&(n.envId=i);let s=typeof t.deployBranch=="string"?t.deployBranch:void 0;return s&&(n.deployBranch=s),n}a(zC,"toTargetEnv");function Gx(e){if(Array.isArray(e))return e;if(e&&typeof e=="object")for(let t of["environments","data","items"]){let r=e[t];if(Array.isArray(r))return r}return[]}a(Gx,"rowsOf");function MC(e){let t=[];for(let r of e){if(!r||typeof r!="object")continue;let o=r,n=typeof o.slug=="string"?o.slug:void 0,i=o.kind==="production"||o.kind==="development"?o.kind:void 0;if(!n||!i)continue;let s=typeof o.name=="string"?o.name:void 0;t.push({slug:n,kind:i,...s?{name:s}:{}})}return t}a(MC,"toReconcileEnvs");function Vx(e,t){if(t.length!==0)try{let r=my(e??process.cwd());if(!r)return;let o=Ei(LC(r),{envs:t});o.addedEnvSections.length>0&&process.stderr.write(`npayload.toml updated: added [env.${o.addedEnvSections.join("], [env.")}]
|
|
661
|
+
`)}catch{}}a(Vx,"reconcileEnvSections");async function FC(e){try{let t=await e.send(Pr("list")),r=Gx(t).map(zC).filter(o=>o!==null);r.length>0&&vy(r,e.cwd),Vx(e.cwd,MC(Gx(t))),e.print(t),e.exit(0)}catch(t){e.printError(Ee(t instanceof Error?t.message:String(t),t)),e.exit(2)}}a(FC,"runEnvList");async function qC(e,t){let r;try{r=Pr("create",e)}catch(o){if(o instanceof Q){t.printError(o.message),t.exit(o.exitCode);return}throw o}try{let o=await t.send(r);Vx(t.cwd,[{slug:e.slug,kind:e.kind,...e.name?{name:e.name}:{}}]),t.print(o),t.exit(0)}catch(o){t.printError(Ee(o instanceof Error?o.message:String(o),o)),t.exit(2)}}a(qC,"runEnvCreate");async function ZC(e,t){let r;try{r=Pr("show",{slug:e})}catch(o){if(o instanceof Q){t.printError(o.message),t.exit(o.exitCode);return}throw o}try{let o=await t.send(r);t.print(o),t.exit(0)}catch(o){t.printError(Ee(o instanceof Error?o.message:String(o),o)),t.exit(2)}}a(ZC,"runEnvShow");async function GC(e,t){let r;try{r=Pr("clone",{slug:e.source,targetSlug:e.target,...e.name?{targetName:e.name}:{},...e.withData?{withData:!0}:{},...e.confirm?{confirmation:e.confirm}:{}})}catch(o){if(o instanceof Q){t.printError(o.message),t.exit(o.exitCode);return}throw o}try{let o=await t.send(r);t.print(o),t.exit(0)}catch(o){t.printError(Ee(o instanceof Error?o.message:String(o),o)),t.exit(2)}}a(GC,"runEnvClone");function VC(e,t){let r=Cn(t.cwd);if(r){let o=r.environments.map(n=>n.slug);if(!o.includes(e)){t.printError(`Unknown environment: the slug given is not declared (it is not shown here). Declared in npayload.toml: ${o.join(", ")||"(none)"}.`),t.exit(1);return}}yy(e,t.cwd),t.print({activeEnvironment:e}),t.exit(0)}a(VC,"runEnvUse");function BC(e){let t={name:String(e.name??""),slug:String(e.slug??""),kind:String(e.kind??"")};return typeof e.deployBranch=="string"&&e.deployBranch!==""&&(t.deployBranch=e.deployBranch),t}a(BC,"createArgsFromOptions");function Bx(e,t){let r=a((s,c)=>{s.command("list").description(c?"List the app's logical environments":"List the app's logical environments (alias of `np account environments list`)").action(async()=>{await FC(t())}),s.command("create").description("Create a logical environment (--kind development|production)").requiredOption("--name <name>","human-readable environment name").requiredOption("--slug <slug>","environment slug (stable identifier)").requiredOption("--kind <kind>","development | production").option("--deploy-branch <branch>","git branch `np deploy` requires for this env").action(async l=>{await qC(BC(l),t())}),s.command("show <slug>").description("Show one of the app's logical environments by slug").action(async l=>{await ZC(l,t())}),s.command("clone <source> <target>").description("Clone an environment into a NEW development environment (runs as a background job)").option("--name <name>","display name for the target env (defaults to the target slug)").option("--with-data","also copy the data tables (config_and_data mode)").option("--confirm <source-slug>","typed confirmation, required when copying DATA out of a production source").action(async(l,d,f)=>{await GC({source:l,target:d,...typeof f.name=="string"&&f.name!==""?{name:f.name}:{},...f.withData?{withData:!0}:{},...typeof f.confirm=="string"&&f.confirm!==""?{confirm:f.confirm}:{}},t())}),s.command("use <slug>").description("Record the active logical environment for subsequent env-scoped commands").action(l=>{VC(l,t())})},"wire"),o=e.command("env").description("Logical environments \u2014 list/create/show/clone/use (alias of `np account environments`). NOTE: distinct from `np envs`, the local auth-profile switcher.");r(o,!1);let n=e.commands.find(s=>s.name()==="account")??e.command("account");n.description("Account & identity management \u2014 org, apps, environments, oauth-clients, keys");let i=n.command("environments").description("The app's logical environments (canonical form of `np env`)");r(i,!0)}a(Bx,"registerEnv");var pc=["events","primus","pipes"],KC={events:"Events",primus:"Primus",pipes:"Pipes"},JC="The log of the requests made with your keys is coming; until it exists, np logs lists your agents' and tools' errors and your failed pipe runs.",WC=200,HC=20,Kx=5,Jx=50,Wx=a(e=>new Date(typeof e=="number"&&Number.isFinite(e)?e:0).toISOString(),"iso"),fc=a(e=>typeof e=="string"?e:"","str"),sh=a(e=>{if(Array.isArray(e))return e;let t=e?.data;return Array.isArray(t)?t:[]},"items");async function YC(e,t,r){let o=await e.send(dt({row:t.primusErrors,positionals:[],flags:{limit:String(r)},newIdempotencyKey:e.newIdempotencyKey}));return sh(o).map(n=>({product:"Primus",status:n.status==="resolved"?"resolved":"active",message:fc(n.message),source:fc(n.source),at:Wx(n.lastOccurrence??n.firstOccurrence??n.createdAt)}))}a(YC,"primusProblems");function QC(e){let t=e.error;if(typeof t?.message=="string"&&t.message!=="")return t.message;let o=(Array.isArray(e.nodeRuns)?e.nodeRuns:[]).find(n=>n.status==="error"&&typeof n.error=="string"&&n.error!=="");return o?String(o.error):"The run failed."}a(QC,"runMessage");async function XC(e,t){let r=sh(await e.send(dt({row:t.pipesList,positionals:[],flags:{limit:String(WC)},newIdempotencyKey:e.newIdempotencyKey}))),o=[];for(let n=0;n<r.length;n+=Kx){let i=r.slice(n,n+Kx),s=await Promise.all(i.map(c=>e.send(dt({row:t.pipeRuns,positionals:[fc(c.gid)],flags:{status:"failed",limit:String(HC)},newIdempotencyKey:e.newIdempotencyKey}))));i.forEach((c,u)=>{for(let l of sh(s[u])){if(l.status!=="failed")continue;let d=l.timing;o.push({product:"Pipes",status:"failed",message:QC(l),source:fc(c.name),at:Wx(d?.startedAt)})}})}return o}a(XC,"pipesProblems");async function eR(e,t,r){let o=t?[t]:[...pc],n=o.filter(d=>d!=="events"),i=n.length>0?await e.rows():void 0,s=await Promise.all(n.map(async d=>{try{let f=d==="primus"?await YC(e,i,r):await XC(e,i);return{product:d,rows:f}}catch(f){return F(f),{product:d,error:f}}})),c=s.filter(d=>"error"in d);if(c.length>0&&c.length===s.length&&!o.includes("events"))throw c[0].error;let l={logs:s.flatMap(d=>"rows"in d?d.rows:[]).sort((d,f)=>Date.parse(f.at)-Date.parse(d.at)).slice(0,r),requests:JC};return c.length>0&&(l.unavailable=c.map(d=>({product:KC[d.product],reason:d.error instanceof Error?d.error.message:String(d.error)}))),l}a(eR,"readLogs");function Hx(e,t){e.command("logs").argument("[topic]",`one product's problems: ${pc.join(", ")} (default: all)`).description("List the environment's problems in one list \u2014 your agents' and tools' errors and your failed pipe runs \u2014 newest first, each with its product and status").option("--limit <n>",`how many problems to list (default ${Jx})`).action(async(r,o)=>{try{if(r!==void 0&&!pc.includes(r))throw new Q(`the topic takes one of ${pc.join(", ")}, or none for all of them; the word given is not shown here.`);let n=o.limit===void 0?Jx:Number(o.limit);if(!Number.isInteger(n)||n<1)throw new Q("--limit must be a whole number above 0; the value given is not shown here.");t.print(await eR(t,r,n))}catch(n){t.printError(Ee(n instanceof Error?n.message:String(n),n)),process.exitCode=n instanceof Q?n.exitCode:jt(n)}})}a(Hx,"registerLogs");function tR(e,t){return JSON.stringify([e,t??""])}a(tR,"cacheKey");function Yx(e){let t=new Map;return{getKernelFor(r){let{lane:o,url:n}=e.laneOf(r),i=r.envless?void 0:e.resolveEnvSlug(),s=tR(o,i),c=t.get(s);return c||(c=e.build(n,i),t.set(s,c)),c}}}a(Yx,"makeEnvKeyedKernelCache");import{createHash as r_,randomBytes as ch}from"crypto";import{closeSync as nR,mkdirSync as o_,openSync as rR,readFileSync as uh,renameSync as i_,statSync as oR,unlinkSync as Qx,writeFileSync as s_,writeSync as iR}from"fs";import{homedir as a_}from"os";import{join as kr}from"path";function Xx(){return kr(process.env.NPAYLOAD_AUTH_HOME??kr(a_(),".npayload"),"npp","producer-sequence")}a(Xx,"cliNppSequenceDir");var e_=3e4,sR=10*6e4,aR=1e4,c_=new Set(["EACCES","EPERM","EROFS","ENOTDIR"]),t_=!1,gc=class{constructor(t=Xx()){this.dir=t}static{a(this,"FileNppSequenceStore")}async exclusive(t,r){let o=kr(this.dir,r_("sha256").update(kh(t)).digest("hex")),n=`${o}.json`,i;try{o_(this.dir,{recursive:!0,mode:448}),i=await u_(`${o}.lock`)}catch(s){if(!c_.has(xr(s)??""))throw s;if(!t_){t_=!0;let c=this.dir!==Xx()?"in the folder it was given (not shown here)":process.env.NPAYLOAD_AUTH_HOME!==void 0?"under the folder NPAYLOAD_AUTH_HOME names (not shown here)":"under ~/.npayload";process.stderr.write(`np: cannot write the NPP producer-sequence store ${c} (${xr(s)}); the producer sequence is kept for this process only, so a later np process on this credential may be refused REJECTED_DUPLICATE on the same channel. Set NPAYLOAD_AUTH_HOME to a writable directory.
|
|
662
|
+
`)}return xh.exclusive(t,r)}try{return await r({load:a(async()=>cR(n),"load"),save:a(async s=>uR(n,t.channelGid,s),"save")})}finally{i()}}};function xr(e){return e&&typeof e=="object"&&"code"in e?String(e.code):void 0}a(xr,"errCode");function cR(e){let t;try{t=uh(e,"utf8")}catch(r){if(xr(r)==="ENOENT")return{lastAccepted:0n};throw r}try{let r=JSON.parse(t);if(r.v===1&&typeof r.lastAccepted=="string"&&/^\d+$/.test(r.lastAccepted)){let o=BigInt(r.lastAccepted),n=typeof r.inFlight=="string"&&/^\d+$/.test(r.inFlight)?BigInt(r.inFlight):void 0;return n===o+1n?{lastAccepted:o,inFlight:n}:{lastAccepted:o}}}catch{}return{lastAccepted:0n}}a(cR,"readState");function uR(e,t,r){let o={v:1,channelGid:t,lastAccepted:r.lastAccepted.toString(),...r.inFlight!==void 0?{inFlight:r.inFlight.toString()}:{}},n=`${e}.${process.pid}.${ch(4).toString("hex")}.tmp`;s_(n,`${JSON.stringify(o)}
|
|
663
|
+
`,{mode:384}),i_(n,e)}a(uR,"writeState");function mc(e){try{let t=JSON.parse(uh(e,"utf8"));return typeof t.pid=="number"&&typeof t.token=="string"&&typeof t.at=="number"?{pid:t.pid,token:t.token,at:t.at}:void 0}catch{return}}a(mc,"readHolder");function lR(e){try{return process.kill(e,0),!0}catch(t){return xr(t)==="EPERM"}}a(lR,"processAlive");function dR(e){let t=mc(e);if(t)return{stale:!lR(t.pid)||Date.now()-t.at>sR,token:t.token};try{return{stale:Date.now()-oR(e).mtimeMs>aR,token:void 0}}catch{return{stale:!1,token:void 0}}}a(dR,"staleHold");async function u_(e){let t=`${process.pid}.${ch(8).toString("hex")}`,r=Date.now()+e_;for(;;){try{let n=rR(e,"wx",384);try{iR(n,JSON.stringify({pid:process.pid,token:t,at:Date.now()}))}finally{nR(n)}return()=>{try{mc(e)?.token===t&&Qx(e)}catch{}}}catch(n){if(xr(n)!=="EEXIST")throw n}let o=dR(e);if(o.stale){try{mc(e)?.token===o.token&&Qx(e)}catch{}continue}if(Date.now()>r){let n=mc(e);throw new Error(`np: another npayload process${n?` (pid ${n.pid})`:""} has held this channel's NPP producer sequence for over ${e_/1e3} s (${e}); retry when it finishes.`)}await new Promise(n=>setTimeout(n,5+Math.floor(Math.random()*20)))}}a(u_,"acquireHold");function pR(){return kr(process.env.NPAYLOAD_AUTH_HOME??kr(a_(),".npayload"),"npp","producer-epoch")}a(pR,"cliNppEpochDir");var fR=Date.UTC(2025,0,1),n_=2147483647,ah=new Map;function mR(e){try{let t=JSON.parse(uh(e,"utf8"));return t.v===1&&typeof t.lastDrawn=="number"&&Number.isInteger(t.lastDrawn)&&t.lastDrawn>=0?t.lastDrawn:-1}catch{return-1}}a(mR,"readEpoch");function gR(e,t){let r=`${e}.${process.pid}.${ch(4).toString("hex")}.tmp`;s_(r,`${JSON.stringify({v:1,lastDrawn:t})}
|
|
664
|
+
`,{mode:384}),i_(r,e)}a(gR,"writeEpoch");async function l_(e,t={}){let r=Math.floor(((t.nowMs??Date.now())-fR)/1e3),o=Math.max(r,(ah.get(e)??-1)+1),n=t.dir??pR(),i=kr(n,r_("sha256").update(e).digest("hex")),s;try{o_(n,{recursive:!0,mode:448}),s=await u_(`${i}.lock`)}catch(c){if(!c_.has(xr(c)??""))throw c;let u=Math.min(n_,Math.max(0,o));return ah.set(e,u),u}try{let c=Math.min(n_,Math.max(0,o,mR(`${i}.json`)+1));return gR(`${i}.json`,c),ah.set(e,c),c}finally{s()}}a(l_,"drawCliProducerEpoch");import"fs";import*as hR from"tls";import{Agent as pK,fetch as fK}from"undici";function d_(e){return!1}a(d_,"twinNamesKernelFrameDoor");function p_(e,t){if(!t.edgeUrl)throw new we("NPP transport selected but not configured: no NPP door is named"+(t.refusal?`: ${t.refusal}`:". Set NPAYLOAD_EDGE_URL.")+" Or opt into HTTP/JSON explicitly with --transport http or NPAYLOAD_TRANSPORT=http.");let r=t.named?"NPAYLOAD_EDGE_URL":"the production edge";return{url:t.edgeUrl,source:r}}a(p_,"resolveCliKernelFrameDoor");async function hc(e){let t=process.env.NPAYLOAD_CLIENT_ID,r=(process.env.NPAYLOAD_CLIENT_SECRET??process.env.NPAYLOAD_HMAC_SECRET)?.trim()||void 0,o;if(!t)try{let u=await Sr();t=u.clientId,r=r??u.hmacSecret,o=u.dpopPrivateJwk}catch(u){if(u instanceof Pc)throw u}if(!t)throw new Pc("Not authenticated. Run `"+b("login")+"` (device flow, stores the session in the OS keychain), or export NPAYLOAD_CLIENT_ID + NPAYLOAD_HMAC_SECRET.");let{apiUrl:n,authUrl:i,guard:s}=_r(),c=li({env:process.env,credentialKey:o})??(await Xo()).privateJwk;return ii({clientId:t,dpopPrivateJwk:c,baseUrl:n,...r!==void 0?{clientSecret:r}:{},...i!==void 0?{authUrl:i}:{},...e?{env:e}:{}},s)}a(hc,"resolveKernel");var bR={async text(e,t){let{input:r}=await import("@inquirer/prompts");return(await r({message:e,validate:a(o=>t.optional||o.trim()!==""||"required \u2014 enter a value","validate")})).trim()},async secret(e,t){let{password:r}=await import("@inquirer/prompts");return(await r({message:e,mask:!0,validate:a(o=>t.optional||o.trim()!==""||"required \u2014 enter a value","validate")})).trim()},async select(e,t){let{select:r}=await import("@inquirer/prompts");return r({message:e,choices:t})}};async function lh(e){if(!process.stdin.isTTY)return process.stderr.write(`${e}
|
|
650
665
|
Refusing a destructive op without a TTY; pass --yes to proceed.
|
|
651
|
-
`),!1;let{createInterface:t}=await import("readline/promises"),r=t({input:process.stdin,output:process.stderr});try{let o=await r.question(`${e} [y/N] `);return/^y(es)?$/i.test(o.trim())}finally{r.close()}}a(
|
|
666
|
+
`),!1;let{createInterface:t}=await import("readline/promises"),r=t({input:process.stdin,output:process.stderr});try{let o=await r.question(`${e} [y/N] `);return/^y(es)?$/i.test(o.trim())}finally{r.close()}}a(lh,"ttyConfirm");function wR(e){let t=Ih(e),r={code:"NPP_PUBLISH_REJECTED",status:e.httpStatus};switch(ri(e.statusName??_h(e.statusCode))){case"auth":return new ei(t,r);case"deferred":return e.httpStatus===429?new mh(t,r):new gh(t,r);case"protocol":return new oi(t,wh.BULK_ACK,{status:e.httpStatus});default:return new fh(t,r)}}a(wR,"nppRejectionError");async function kR(e={}){let t=new vi;t.name("np").description("npayload CLI \u2014 contract-generated Events surface"),t.addHelpText("after",`
|
|
652
667
|
np --version print the npayload package version
|
|
653
668
|
np --build print the contract build hash
|
|
654
|
-
`+
|
|
655
|
-
Docs: ${
|
|
656
|
-
`);let r=a(
|
|
657
|
-
`),t):q==="--build"?(process.stdout.write(`${
|
|
658
|
-
`),t):o(
|
|
659
|
-
`)),printError:e.printError??(
|
|
660
|
-
`))}),
|
|
661
|
-
`)}),printError:e.printError??(
|
|
662
|
-
`)}),...e.readSecret?{readSecret:e.readSecret}:{},confirm:e.confirm??
|
|
663
|
-
`)}),printError:e.printError??(
|
|
664
|
-
`)}),credential:a(async()=>{let
|
|
665
|
-
`)}),printError:e.printError??(
|
|
666
|
-
`)}),rows:a(async()=>{let
|
|
667
|
-
`)}),printError:e.printError??(
|
|
668
|
-
`)}),exit:a(
|
|
669
|
-
`)}),printError:e.printError??(
|
|
670
|
-
`)}),exit:a(
|
|
671
|
-
`)}),printError:e.printError??(
|
|
672
|
-
`)}),confirm:
|
|
673
|
-
`),process.exitCode=1});export{
|
|
669
|
+
`+Dy+`
|
|
670
|
+
Docs: ${Bh}
|
|
671
|
+
`);let r=a(w=>{let C=(w??process.argv)[2];return C==="--version"||C==="--build"?C:void 0},"rootOnlyFlag"),o=t.parseAsync.bind(t);t.parseAsync=(async(w,C)=>{let q=r(w);return q==="--version"?(process.stdout.write(`${an()}
|
|
672
|
+
`),t):q==="--build"?(process.stdout.write(`${ke.contentHash.slice(0,12)}
|
|
673
|
+
`),t):o(w,C)}),t.option("-y, --yes","skip confirmation prompts for destructive operations"),t.option("--transport <transport>",'transport for data-plane publish/subscribe: "npp" (default) or "http"'),t.option("--env <slug>","target logical environment for env-scoped commands (overrides `np env use`)"),Av(t),Ov(t),Dv(t),rb(t),ob(t),ib(t,{resolveKernel:Iu,resolveChannelGid:a((w,C,q)=>Pu(w,C,q),"resolveChannelGid")}),Py(t,{sendAccount:a(async w=>(await c(w)).send(w),"sendAccount")}),cb(t),yb(t,{print:e.print??(w=>void process.stdout.write(`${String(w)}
|
|
674
|
+
`)),printError:e.printError??(w=>void process.stderr.write(`${w}
|
|
675
|
+
`))}),db(t,{print:e.print??(w=>{process.stdout.write(`${JSON.stringify(w,null,2)}
|
|
676
|
+
`)}),printError:e.printError??(w=>{process.stderr.write(`${w}
|
|
677
|
+
`)}),...e.readSecret?{readSecret:e.readSecret}:{},confirm:e.confirm??lh}),ix(t),vx(t),yx(t),mx(t),Ay(t),Ty(t),kx(t),Zx(t),Cx(t,{fetchAccountStatus:a(async()=>{try{let w={method:"GET",path:"/v1/billing/account-status",scope:"billing:read"},q=await(await c(w)).send(w);return q&&typeof q.tier=="string"?q:null}catch(w){return F(w),null}},"fetchAccountStatus")});let n=a(w=>{if(w.path.startsWith("/v1/primus/")){let C=se(process.env.NPAYLOAD_PRIMUS_API_URL,"primusApiUrl");if(C)return{lane:"primus",url:C}}if(w.path.startsWith("/v1/account/")){let C=se(process.env.NPAYLOAD_ACCOUNT_API_URL,"accountApiUrl");if(C)return{lane:"account",url:C}}if(w.path.startsWith("/v1/analytics/")){let C=se(process.env.NPAYLOAD_ADMIN_API_URL,"adminApiUrl");if(C)return{lane:"analytics",url:C}}return{lane:"cell"}},"laneOf"),i=a(()=>{let w=t.opts().env;return Rn(typeof w=="string"&&w.trim()!==""?{explicitSlug:w}:{})},"resolveDispatchEnvSlug"),s=Yx({laneOf:n,resolveEnvSlug:i,build:a(async(w,C)=>{if(w){let{buildKernel:q}=await import("../chunk-NCKK7PHF.mjs");return q(w,C)}return hc(C)},"build")}),c=a(w=>s.getKernelFor(w),"getKernelFor");pb(t,{print:e.print??(w=>{process.stdout.write(`${JSON.stringify(w,null,2)}
|
|
678
|
+
`)}),printError:e.printError??(w=>{process.stderr.write(`${w}
|
|
679
|
+
`)}),credential:a(async()=>{let w=process.env.NPAYLOAD_CLIENT_ID;if(w)return{clientId:w,source:"env"};let C=await Sr();return{clientId:C.clientId,source:C.source}},"credential"),token:a(async()=>(await hc(i())).auth.getAccessToken([]),"token")}),Ix(t,{resolveKernel:a(async()=>hc(i()),"resolveKernel"),mintedEnvSlug:a(()=>i(),"mintedEnvSlug"),yes:a(()=>t.opts().yes===!0,"yes"),tail:a(async(w,C)=>Kg(w,C),"tail"),confirm:a(async w=>e.confirm?e.confirm(w):lh(w),"confirm")}),Px(t,{resolveKernel:a(async()=>hc(i()),"resolveKernel"),mintedEnvSlug:a(()=>i(),"mintedEnvSlug")});let u=a(()=>{let w=t.opts().transport;if(w==="http"||w==="npp")return w;if(w!==void 0)throw new Q('--transport must be "npp" or "http"; the value given is not shown here.');return process.env.NPAYLOAD_TRANSPORT==="http"?"http":"npp"},"resolveCliTransport"),l=/^\/v1\/channels\/\{channelId\}\/messages$/,d=/^\/v1\/channels\/\{channelId\}\/subscribe$/,f=new Set(["payload","qosLevel"]),p=new WeakMap,m=a(w=>{let C=on(w);return ty(process.env.NPAYLOAD_EDGE_URL,Tn(w),[Ph(w),`${C.replace(/\/+$/,"")}/v1/apps/dpop-keys`])},"nppEdgeOf"),g=a(w=>new we("NPP transport selected but not configured"+(w?`: ${w}`:". Set NPAYLOAD_EDGE_URL.")+" Or opt into HTTP/JSON explicitly with --transport http or NPAYLOAD_TRANSPORT=http."),"nppNotConfigured"),v=a(w=>{let{edgeUrl:C,refusal:q}=m(w);if(!C)throw g(q);let J=on(w),Y=p.get(w);return Y||(Y=Eh(w,{baseUrl:J,edgeUrl:C,clientId:process.env.NPAYLOAD_CLIENT_ID??"",appId:process.env.NPAYLOAD_APP_ID,sequenceStore:new gc}),p.set(w,Y)),Y},"getNppPublisher"),h=new Map,k=a((w,C)=>w.send({method:"GET",path:"/v1/channels/{channelId}",pathParams:{channelId:C}}),"readChannelAnswer"),T=new Map,_=new WeakMap,N=a(()=>se(process.env.NPAYLOAD_API_URL,"apiUrl","https://api.npayload.com"),"cliApiUrl"),I=a((w,C)=>{let q=_.get(w);if(!q){let J=N(),Y=p_(J,C);q=Th(w,{baseUrl:J,frameDoorUrl:Y.url,clientId:process.env.NPAYLOAD_CLIENT_ID??"",appId:process.env.NPAYLOAD_APP_ID,readChannel:a(async re=>{if(T.has(re)){let Qo=T.get(re);return T.delete(re),Qo}return k(w,re)},"readChannel"),producerEpoch:a(re=>l_(re),"producerEpoch"),...Y.fetchImpl?{fetchImpl:Y.fetchImpl}:{}}),_.set(w,q)}return q},"getKernelDoorPublisher"),j=a(async(w,C,q)=>{let J=h.get(C);if(!J){J=k(w,C).catch(()=>{}),h.set(C,J);let Y=await J;bc(Y)&&T.set(C,Y)}if(bc(await J))return I(w,q)},"kernelDoorPublisherFor"),z=a(async w=>{let C=await c(w);if(u()==="npp"){let J=w.body??{};if(w.method==="POST"&&l.test(w.path)){if("payload"in J&&w.idempotencyKeySupplied!==!0&&Object.keys(J).every(re=>f.has(re)||J[re]===void 0)){let re=m(C);if(!re.edgeUrl&&!d_(N()))throw g(re.refusal);let rn=await(await j(C,w.pathParams.channelId,re)??await v(C)).publish(w.pathParams.channelId,J.payload,{...J.qosLevel!==void 0?{qosLevel:J.qosLevel}:{}});if(!rn.accepted)throw wR(rn);return kc({gid:rn.gid,status:"accepted",statusCode:rn.statusCode,statusName:rn.statusName,sequence:rn.sequence,httpStatus:rn.httpStatus,transport:"npp"})}}else if(w.method==="POST"&&d.test(w.path)){let Y=await v(C),re=typeof J.consumerId=="string"&&J.consumerId||`consumer-${w.pathParams.channelId}`;return Y.subscribe(w.pathParams.channelId,{consumerId:re,...typeof J.mode=="number"?{mode:J.mode}:{},...typeof J.deliveryPreference=="number"?{deliveryPreference:J.deliveryPreference}:{}})}}let q=await C.send(w);return w.method==="POST"&&l.test(w.path)?kc(q):q},"sendViaTransport");Hx(t,{send:z,newIdempotencyKey:a(()=>globalThis.crypto.randomUUID(),"newIdempotencyKey"),print:e.print??(w=>{process.stdout.write(`${JSON.stringify(w,null,2)}
|
|
680
|
+
`)}),printError:e.printError??(w=>{process.stderr.write(`${w}
|
|
681
|
+
`)}),rows:a(async()=>{let w=a((q,J)=>{let Y=q.find(re=>re.key===J);if(!Y)throw new Error(`np logs: the command table carries no ${J}`);return Y},"row"),C=(await ui()).commands;return{primusErrors:w(C,"primus.observability.getErrors"),pipesList:w(ke.commands,"pipes.workflows.listWorkflows"),pipeRuns:w(ke.commands,"pipes.executions.listExecutions")}},"rows")}),Bx(t,()=>({send:a(async w=>(await c(w)).send(w),"send"),print:e.print??(w=>{process.stdout.write(`${JSON.stringify(w,null,2)}
|
|
682
|
+
`)}),printError:e.printError??(w=>{process.stderr.write(`${w}
|
|
683
|
+
`)}),exit:a(w=>{process.exitCode=w},"exit")}));let W=await ui(),B=new Set(ke.commands.map(w=>w.commandPath[0])),L=[...new Set(W.commands.map(w=>w.commandPath[0]))].filter(w=>B.has(w));if(L.length>0)throw new Error(`CLI namespace collision between cell and primus command tables: ${L.join(", ")}`);let K=[...ke.commands,...W.commands,...cy(),...uy()],ge=a(async w=>t.opts().yes===!0?!0:e.confirm?e.confirm(w):lh(w),"confirmDestructive");By(t,K,{send:z,newIdempotencyKey:a(()=>globalThis.crypto.randomUUID(),"newIdempotencyKey"),print:e.print??(w=>{process.stdout.write(`${JSON.stringify(w,null,2)}
|
|
684
|
+
`)}),printError:e.printError??(w=>{process.stderr.write(`${w}
|
|
685
|
+
`)}),exit:a(w=>{process.exitCode=w},"exit"),prompt:e.prompt??bR,...e.prompt?{}:{isInteractive:Le},confirm:ge,whereAmI:a(async w=>{let C=w!==void 0?await c(w).catch(()=>{}):void 0,q=_r(),J=(C!==void 0?on(C):void 0)??q.apiUrl,Y=(C!==void 0?Tn(C):void 0)??q.guard;return jy(J,Y)},"whereAmI")}),wx(t,{send:z,newIdempotencyKey:a(()=>globalThis.crypto.randomUUID(),"newIdempotencyKey"),print:e.print??(w=>{process.stdout.write(`${JSON.stringify(w,null,2)}
|
|
686
|
+
`)}),printError:e.printError??(w=>{process.stderr.write(`${w}
|
|
687
|
+
`)}),confirm:ge,rows:a(async()=>{let w=a((J,Y)=>{let re=J.find(Qo=>Qo.key===Y);if(!re)throw new Error(`np webhooks: the command table carries no ${Y}`);return re},"row"),C=(await ui()).commands,q=ke.commands;return{list:w(q,"webhooks.webhooks.list"),create:w(q,"webhooks.webhooks.create"),rotateSecret:w(q,"webhooks.webhooks.rotateSecret"),revoke:w(q,"webhooks.webhooks.revoke"),channelGet:w(q,"events.channels.get"),triggersList:w(C,"primus.triggers.list"),triggersCreate:w(C,"primus.triggers.create"),triggersRemove:w(C,"primus.triggers.remove"),agentsList:w(C,"primus.agents.list")}},"rows")});let ie=t.commands.find(w=>w.name()==="primus")??t.command("primus");return Mx(ie),Yc(t),t}a(kR,"buildProgram");async function xR(){await(await kR()).parseAsync(process.argv)}a(xR,"main");function _R(){let e=process.argv[1];if(!e)return!1;try{return import.meta.url===vR(yR(e)).href}catch{return!1}}a(_R,"invokedAsBinary");_R()&&xR().catch(e=>{process.stderr.write(`${Ee(e instanceof Error?e.message:String(e),e)}
|
|
688
|
+
`),process.exitCode=1});export{kR as buildProgram};
|