@herjarsa/omo-meta-governor 0.29.1 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import{createRequire as pf}from"node:module";var{defineProperty:ao,getOwnPropertyNames:of,getOwnPropertyDescriptor:af}=Object,sf=Object.prototype.hasOwnProperty;function cf(e){return this[e]}var lf=(e)=>{var r=(bu??=new WeakMap).get(e),n;if(r)return r;if(r=ao({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of of(e))if(!sf.call(r,o))ao(r,o,{get:cf.bind(e,o),enumerable:!(n=af(e,o))||n.enumerable})}return bu.set(e,r),r},bu,uf=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var df=(e)=>e;function mf(e,r){this[e]=df.bind(null,r)}var me=(e,r)=>{for(var n in r)ao(e,n,{get:r[n],enumerable:!0,configurable:!0,set:mf.bind(r,n)})};var Ge=(e,r)=>()=>(e&&(r=e(e=0)),r);var we=pf(import.meta.url);import{spawn as ff,spawnSync as Ve}from"node:child_process";function _u(e){try{let r=Ve("pgrep",["-P",String(e)],{encoding:"utf8"});for(let n of r.stdout.trim().split(/\s+/)){let o=Number(n);if(!o)continue;_u(o);try{process.kill(o,"SIGKILL")}catch{}}}catch{}}function We(e){if(!e||e<=0)return;try{if(process.platform==="win32")Ve("taskkill",["/pid",String(e),"/T","/F"],{stdio:"ignore"});else{try{process.kill(-e,"SIGKILL")}catch{}_u(e);try{process.kill(e,"SIGKILL")}catch{}}}catch{}}function gf(e){if(!e||e<=0)return!1;try{return process.kill(e,0),!0}catch(r){if(r.code==="ESRCH")return!1;return!0}}function co(e){if(e&&e>0)xr.add(e)}function wr(e){xr.delete(e)}function Sr(){let e=0;for(let r of xr)if(gf(r))We(r),e++;return xr.clear(),e}function Ir(e,r,n){return new Promise((o)=>{let t;try{t=ff(e,r,{cwd:n.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...n.env}})}catch{o({stdout:"",stderr:"",code:null,timedOut:!1});return}co(t.pid);let i="",a="",s=!1,c=!1,l,d=(h)=>{if(c)return;if(c=!0,clearTimeout(v),l)clearTimeout(l);wr(t.pid),o(h)},v=setTimeout(()=>{s=!0,We(t.pid),l=setTimeout(()=>{d({stdout:i,stderr:a,code:null,timedOut:!0})},2000)},n.timeoutMs);t.stdout?.on("data",(h)=>{i+=h.toString("utf8")}),t.stderr?.on("data",(h)=>{a+=h.toString("utf8")}),t.on("error",()=>{d({stdout:i,stderr:a,code:null,timedOut:s})}),t.on("close",(h)=>{if(t.exitCode===null)We(t.pid);d({stdout:i,stderr:a,code:h,timedOut:s})})})}function H(e,r,n){let o=Date.now(),t;try{t=Ve(e,r,{cwd:n.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...n.env},timeout:n.timeoutMs})}catch{return{stdout:"",stderr:"",code:null,timedOut:!1}}let i=Date.now()-o,a=t.error!=null&&t.error.code==="ETIMEDOUT"||t.signal==="SIGTERM"||i>=n.timeoutMs-50;if(a&&t.pid)We(t.pid);return{stdout:(t.stdout??"").toString("utf8"),stderr:(t.stderr??"").toString("utf8"),code:t.status,timedOut:a}}function tt(){let e=0;try{if(process.platform==="win32"){for(let r of["graphify.exe","codegraph.exe"])try{Ve("taskkill",["/IM",r,"/F"],{stdio:"ignore"})}catch{}try{if(Ve("powershell",["-NoProfile","-Command","Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -match 'OMO_MG_WATCH|OMO_MG_SPAWN' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }"],{stdio:"ignore"}).status===0)e=1}catch{}}else{for(let r of["graphify","codegraph"])try{Ve("pkill",["-x",r],{stdio:"ignore"})}catch{}try{Ve("pkill",["-f","OMO_MG_WATCH|OMO_MG_SPAWN"],{stdio:"ignore"})}catch{}}}catch{}return e}function lo(){if(so)return!1;so=!0;let e=()=>{try{Sr()}catch{}try{tt()}catch{}};wt.push({event:"exit",fn:e}),process.on("exit",e);let r=(o)=>{e();try{process.removeListener(o,r),process.kill(process.pid,o)}catch{}};wt.push({event:"SIGINT",fn:r}),wt.push({event:"SIGTERM",fn:r}),wt.push({event:"SIGHUP",fn:r}),process.on("SIGINT",r),process.on("SIGTERM",r),process.on("SIGHUP",r);let n=()=>{e()};return wt.push({event:"beforeExit",fn:n}),process.on("beforeExit",n),!0}function P_(){return so}var xr,wt,so=!1;var Tr=Ge(()=>{xr=new Set;wt=[]});var po={};me(po,{LOG_PATH:()=>pe,getLogFileSize:()=>Df,getRotatedLogCount:()=>Pf,logStructured:()=>Of,logToFile:()=>T});import{appendFileSync as hf,mkdirSync as vf,statSync as ku,renameSync as yf,existsSync as Or,unlinkSync as bf}from"node:fs";import{resolve as _f,dirname as kf}from"node:path";import{homedir as $f}from"node:os";function $u(e){let r=e;for(let n of xf)r=r.replace(n,"[REDACTED]");return r}function uo(e,r=new WeakSet){if(typeof e==="string")return $u(e);if(Array.isArray(e)){if(r.has(e))return"[Circular]";return r.add(e),e.map((n)=>uo(n,r))}if(e&&typeof e==="object"){if(r.has(e))return"[Circular]";r.add(e);let n={};for(let[o,t]of Object.entries(e))if(wf.test(o))n[o]="[REDACTED]";else try{n[o]=uo(t,r)}catch{n[o]="[unserializable]"}return n}return e}function If(){try{vf(kf(pe),{recursive:!0})}catch{}}function Tf(){if(!Or(pe))return;try{if(ku(pe).size<Sf)return}catch{return}for(let e=mo;e>=1;e--){let r=e===1?pe:`${pe}.${e-1}`,n=`${pe}.${e}`;if(Or(r))try{if(e===mo)bf(r);else yf(r,n)}catch{}}}function xu(e,r,n,o,t){If(),Tf();let i=$u(r),a=n!==void 0?uo(n):void 0,s={timestamp:new Date().toISOString(),level:e,message:i,...o?{event:o}:{},...t?{sessionID:t}:{},...a!==void 0?{data:a}:{}},c;try{c=JSON.stringify(s)+`
2
- `}catch{c=JSON.stringify({timestamp:s.timestamp,level:e,message:r,data:"[unserializable]"})+`
3
- `}try{hf(pe,c)}catch{}if(e==="error")console.error(`[meta-governor] ${r}`)}function T(e,r,n){xu(e,r,n)}function Of(e){xu(e.level,e.message,e.data,e.event,e.sessionID)}function Df(){try{if(Or(pe))return ku(pe).size}catch{}return 0}function Pf(){let e=0;for(let r=1;r<=mo;r++)if(Or(`${pe}.${r}`))e=r;else break;return e}var xf,wf,pe,Sf=10485760,mo=5;var Dr=Ge(()=>{xf=[/eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/g,/sk-(?:proj-|svc-|)[a-zA-Z0-9]{20,}/g,/pk-[a-zA-Z0-9]{20,}/g,/ghp_[a-zA-Z0-9]{36,}/g,/ghs_[a-zA-Z0-9]{36,}/g,/github_pat_[a-zA-Z0-9]{22,}/g,/Bearer\s+[a-zA-Z0-9_\-]{20,}/gi,/(?:key|secret|token|password|credential|private_key)\s*[:=]\s*['"]?[a-zA-Z0-9_\-]{16,}/gi],wf=/^(?:key|secret|token|password|credential|private_key|api[_-]?key|access[_-]?token|auth[_-]?token)$/i;pe=_f($f(),".config","opencode","meta-governor.log")});var Uu={};me(Uu,{checkToolAvailability:()=>vo,detectRemoteNewCommits:()=>ko,fetchCodegraphLatestVersion:()=>Mu,fetchGraphifyLatestVersion:()=>Ru,getDefaultUpgradeCachePath:()=>Eu,getInstalledCodegraphVersion:()=>bo,getInstalledGraphifyVersion:()=>Nu,getSessionCount:()=>Mf,hasActiveWatcher:()=>Rf,initCodegraph:()=>Du,initGraphify:()=>Pu,installCodegraph:()=>fo,installGraphify:()=>go,isCacheFresh:()=>_o,isGitCommitCommand:()=>Ar,isGraphifyHookInstalled:()=>zu,isNewerVersion:()=>jr,logToFile:()=>Er,readUpgradeCache:()=>ju,resetInitializedProjects:()=>Ef,runGraphSync:()=>It,shouldUpgrade:()=>yo,stopWatches:()=>St,trackSession:()=>jf,triggerCodegraphSync:()=>Cu,triggerReindex:()=>Mr,untrackSession:()=>Af,writeUpgradeCache:()=>Au});import{execSync as Be,spawn as wu}from"node:child_process";import{access as R_,stat as Ou}from"node:fs/promises";import{resolve as Cr,join as zf}from"node:path";import{homedir as Cf}from"node:os";async function fo(e,r=60000,n){let o=["i","-D","@colbymchenry/codegraph"];if(n)try{return n(`npm ${o.join(" ")}`,{cwd:e,stdio:"ignore",timeout:r}),"codegraph-installed"}catch{return"codegraph-install-failed"}return H("npm",o,{cwd:e,timeoutMs:r}).code===0?"codegraph-installed":"codegraph-install-failed"}async function go(e=60000,r){if(r)try{return r("pip install --upgrade graphifyy --break-system-packages --quiet",{stdio:"ignore",timeout:e}),"graphify-installed"}catch{try{return r("uv tool install --upgrade graphifyy --quiet",{stdio:"ignore",timeout:e}),"graphify-installed"}catch{return"graphify-install-failed"}}if(H("pip",["install","--upgrade","graphifyy","--break-system-packages","--quiet"],{timeoutMs:e}).code===0)return"graphify-installed";return H("uv",["tool","install","--upgrade","graphifyy","--quiet"],{timeoutMs:e}).code===0?"graphify-installed":"graphify-install-failed"}function Ef(){ho.clear()}function jf(e){let n=(rt.get(e)??0)+1;return rt.set(e,n),n}function Af(e){let r=rt.get(e)??0,n=Math.max(0,r-1);if(n===0)rt.delete(e),St(e);else rt.set(e,n);return n}function Mf(e){return rt.get(e)??0}async function vo(e,r=Be){let n=!1,o=!1,t=await Tu(Cr(e,".codegraph","codegraph.db")),i=await Tu(Cr(e,"graphify-out","graph.json")),a=(s,c)=>{if(r!==Be)return r(s,{stdio:"ignore",...c});let l=s.split(" "),d=l[0],v=l.slice(1),h=H(d,v,{cwd:c?.cwd??e,timeoutMs:c?.timeout??1e4});if(h.code!==0)throw Error(`exit ${h.code}`)};try{a("npx --yes codegraph --version",{timeout:1e4}),n=!0}catch{try{a("node node_modules/.bin/codegraph --version",{cwd:e,timeout:5000}),n=!0}catch{}}try{a("graphify --version",{timeout:5000}),o=!0}catch{try{a("graphifyy --version",{timeout:5000}),o=!0}catch{try{a('python -c "import graphifyy"',{timeout:5000}),o=!0}catch{try{a('python3 -c "import graphifyy"',{timeout:5000}),o=!0}catch{}}}}return{codegraph:n,graphify:o,codegraphIndexExists:t,graphifyIndexExists:i}}async function Du(e,r=60000,n=Be){try{if(n!==Be)n("npx --yes codegraph init",{cwd:e,stdio:"ignore",timeout:r});else{let o=H("npx",["--yes","codegraph","init"],{cwd:e,timeoutMs:r});if(o.code!==0)throw Error(`exit ${o.code}`)}return!0}catch{return!1}}async function Pu(e,r=120000,n=Be){let o=[{bin:"graphify",args:[".","--no-viz"]},{bin:"python",args:["-m","graphify",".","--no-viz"]},{bin:"python3",args:["-m","graphify",".","--no-viz"]}];for(let t of o)try{if(n!==Be)n(`${t.bin} ${t.args.join(" ")}`,{cwd:e,stdio:"ignore",timeout:r});else{let i=H(t.bin,t.args,{cwd:e,timeoutMs:r});if(i.code!==0)throw Error(`exit ${i.code}`)}return!0}catch{}return!1}function Iu(e,r){let n=`${e}:${r}`;if(nt.has(n))return;try{let o;if(r==="codegraph")o=wu("node",["-e",`
1
+ import{createRequire as kI}from"node:module";var{defineProperty:rU,getOwnPropertyNames:vI,getOwnPropertyDescriptor:UI}=Object,bI=Object.prototype.hasOwnProperty;function rI($){return this[$]}var zI=($)=>{var U=(YN??=new WeakMap).get($),b;if(U)return U;if(U=rU({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var r of vI($))if(!bI.call(U,r))rU(U,r,{get:rI.bind($,r),enumerable:!(b=UI($,r))||b.enumerable})}return YN.set($,U),U},YN,_I=($,U)=>()=>(U||$((U={exports:{}}).exports,U),U.exports);var NI=($)=>$;function OI($,U){this[$]=NI.bind(null,U)}var J$=($,U)=>{for(var b in U)rU($,b,{get:U[b],enumerable:!0,configurable:!0,set:OI.bind(U,b)})};var y$=($,U)=>()=>($&&(U=$($=0)),U);var L$=kI(import.meta.url);import{spawn as II,spawnSync as f$}from"node:child_process";function WN($){try{let U=f$("pgrep",["-P",String($)],{encoding:"utf8"});for(let b of U.stdout.trim().split(/\s+/)){let r=Number(b);if(!r)continue;WN(r);try{process.kill(r,"SIGKILL")}catch{}}}catch{}}function n$($){if(!$||$<=0)return;try{if(process.platform==="win32")f$("taskkill",["/pid",String($),"/T","/F"],{stdio:"ignore"});else{try{process.kill(-$,"SIGKILL")}catch{}WN($);try{process.kill($,"SIGKILL")}catch{}}}catch{}}function JI($){if(!$||$<=0)return!1;try{return process.kill($,0),!0}catch(U){if(U.code==="ESRCH")return!1;return!0}}function _U($){if($&&$>0)B4.add($)}function L4($){B4.delete($)}function A4(){let $=0;for(let U of B4)if(JI(U))n$(U),$++;return B4.clear(),$}function G4($,U,b){return new Promise((r)=>{let v;try{v=II($,U,{cwd:b.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...b.env}})}catch{r({stdout:"",stderr:"",code:null,timedOut:!1});return}_U(v.pid);let z="",_="",N=!1,O=!1,k,J=(Y)=>{if(O)return;if(O=!0,clearTimeout(W),k)clearTimeout(k);L4(v.pid),r(Y)},W=setTimeout(()=>{N=!0,n$(v.pid),k=setTimeout(()=>{J({stdout:z,stderr:_,code:null,timedOut:!0})},2000)},b.timeoutMs);v.stdout?.on("data",(Y)=>{z+=Y.toString("utf8")}),v.stderr?.on("data",(Y)=>{_+=Y.toString("utf8")}),v.on("error",()=>{J({stdout:z,stderr:_,code:null,timedOut:N})}),v.on("close",(Y)=>{if(v.exitCode===null)n$(v.pid);J({stdout:z,stderr:_,code:Y,timedOut:N})})})}function l($,U,b){let r=Date.now(),v;try{v=f$($,U,{cwd:b.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...b.env},timeout:b.timeoutMs})}catch{return{stdout:"",stderr:"",code:null,timedOut:!1}}let z=Date.now()-r,_=v.error!=null&&v.error.code==="ETIMEDOUT"||v.signal==="SIGTERM"||z>=b.timeoutMs-50;if(_&&v.pid)n$(v.pid);return{stdout:(v.stdout??"").toString("utf8"),stderr:(v.stderr??"").toString("utf8"),code:v.status,timedOut:_}}function $v(){let $=0;try{if(process.platform==="win32"){for(let U of["graphify.exe","codegraph.exe"])try{f$("taskkill",["/IM",U,"/F"],{stdio:"ignore"})}catch{}try{if(f$("powershell",["-NoProfile","-Command","Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -match 'OMO_MG_WATCH|OMO_MG_SPAWN' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }"],{stdio:"ignore"}).status===0)$=1}catch{}}else{for(let U of["graphify","codegraph"])try{f$("pkill",["-x",U],{stdio:"ignore"})}catch{}try{f$("pkill",["-f","OMO_MG_WATCH|OMO_MG_SPAWN"],{stdio:"ignore"})}catch{}}}catch{}return $}function NU(){if(zU)return!1;zU=!0;let $=()=>{try{A4()}catch{}try{$v()}catch{}};Lv.push({event:"exit",fn:$}),process.on("exit",$);let U=(r)=>{$();try{process.removeListener(r,U),process.kill(process.pid,r)}catch{}};Lv.push({event:"SIGINT",fn:U}),Lv.push({event:"SIGTERM",fn:U}),Lv.push({event:"SIGHUP",fn:U}),process.on("SIGINT",U),process.on("SIGTERM",U),process.on("SIGHUP",U);let b=()=>{$()};return Lv.push({event:"beforeExit",fn:b}),process.on("beforeExit",b),!0}function H9(){return zU}var B4,Lv,zU=!1;var H4=y$(()=>{B4=new Set;Lv=[]});var IU={};J$(IU,{logToFile:()=>H,logStructured:()=>AI,getRotatedLogCount:()=>HI,getLogFileSize:()=>GI,LOG_PATH:()=>X$});import{appendFileSync as XI,mkdirSync as KI,statSync as jN,renameSync as wI,existsSync as E4,unlinkSync as QI}from"node:fs";import{resolve as YI,dirname as WI}from"node:path";import{homedir as jI}from"node:os";function VN($){let U=$;for(let b of VI)U=U.replace(b,"[REDACTED]");return U}function OU($,U=new WeakSet){if(typeof $==="string")return VN($);if(Array.isArray($)){if(U.has($))return"[Circular]";return U.add($),$.map((b)=>OU(b,U))}if($&&typeof $==="object"){if(U.has($))return"[Circular]";U.add($);let b={};for(let[r,v]of Object.entries($))if(PI.test(r))b[r]="[REDACTED]";else try{b[r]=OU(v,U)}catch{b[r]="[unserializable]"}return b}return $}function BI(){try{KI(WI(X$),{recursive:!0})}catch{}}function LI(){if(!E4(X$))return;try{if(jN(X$).size<qI)return}catch{return}for(let $=kU;$>=1;$--){let U=$===1?X$:`${X$}.${$-1}`,b=`${X$}.${$}`;if(E4(U))try{if($===kU)QI(U);else wI(U,b)}catch{}}}function PN($,U,b,r,v){BI(),LI();let z=VN(U),_=b!==void 0?OU(b):void 0,N={timestamp:new Date().toISOString(),level:$,message:z,...r?{event:r}:{},...v?{sessionID:v}:{},..._!==void 0?{data:_}:{}},O;try{O=JSON.stringify(N)+`
2
+ `}catch{O=JSON.stringify({timestamp:N.timestamp,level:$,message:U,data:"[unserializable]"})+`
3
+ `}try{XI(X$,O)}catch{}if($==="error")console.error(`[meta-governor] ${U}`)}function H($,U,b){PN($,U,b)}function AI($){PN($.level,$.message,$.data,$.event,$.sessionID)}function GI(){try{if(E4(X$))return jN(X$).size}catch{}return 0}function HI(){let $=0;for(let U=1;U<=kU;U++)if(E4(`${X$}.${U}`))$=U;else break;return $}var VI,PI,X$,qI=10485760,kU=5;var S4=y$(()=>{VI=[/eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/g,/sk-(?:proj-|svc-|)[a-zA-Z0-9]{20,}/g,/pk-[a-zA-Z0-9]{20,}/g,/ghp_[a-zA-Z0-9]{36,}/g,/ghs_[a-zA-Z0-9]{36,}/g,/github_pat_[a-zA-Z0-9]{22,}/g,/Bearer\s+[a-zA-Z0-9_\-]{20,}/gi,/(?:key|secret|token|password|credential|private_key)\s*[:=]\s*['"]?[a-zA-Z0-9_\-]{16,}/gi],PI=/^(?:key|secret|token|password|credential|private_key|api[_-]?key|access[_-]?token|auth[_-]?token)$/i;X$=YI(jI(),".config","opencode","meta-governor.log")});var mN={};J$(mN,{writeUpgradeCache:()=>DN,untrackSession:()=>ZI,triggerReindex:()=>R4,triggerCodegraphSync:()=>FN,trackSession:()=>MI,stopWatches:()=>Av,shouldUpgrade:()=>QU,runGraphSync:()=>Gv,resetInitializedProjects:()=>FI,readUpgradeCache:()=>ZN,logToFile:()=>D4,isNewerVersion:()=>x4,isGraphifyHookInstalled:()=>SN,isGitCommitCommand:()=>g4,isCacheFresh:()=>WU,installGraphify:()=>XU,installCodegraph:()=>JU,initGraphify:()=>EN,initCodegraph:()=>HN,hasActiveWatcher:()=>xI,getSessionCount:()=>DI,getInstalledGraphifyVersion:()=>RN,getInstalledCodegraphVersion:()=>YU,getDefaultUpgradeCachePath:()=>MN,fetchGraphifyLatestVersion:()=>gN,fetchCodegraphLatestVersion:()=>xN,detectRemoteNewCommits:()=>jU,checkToolAvailability:()=>wU});import{execSync as i$,spawn as qN}from"node:child_process";import{access as x9,stat as GN}from"node:fs/promises";import{resolve as Z4,join as EI}from"node:path";import{homedir as SI}from"node:os";async function JU($,U=60000,b){let r=["i","-D","@colbymchenry/codegraph"];if(b)try{return b(`npm ${r.join(" ")}`,{cwd:$,stdio:"ignore",timeout:U}),"codegraph-installed"}catch{return"codegraph-install-failed"}return l("npm",r,{cwd:$,timeoutMs:U}).code===0?"codegraph-installed":"codegraph-install-failed"}async function XU($=60000,U){if(U)try{return U("pip install --upgrade graphifyy --break-system-packages --quiet",{stdio:"ignore",timeout:$}),"graphify-installed"}catch{try{return U("uv tool install --upgrade graphifyy --quiet",{stdio:"ignore",timeout:$}),"graphify-installed"}catch{return"graphify-install-failed"}}if(l("pip",["install","--upgrade","graphifyy","--break-system-packages","--quiet"],{timeoutMs:$}).code===0)return"graphify-installed";return l("uv",["tool","install","--upgrade","graphifyy","--quiet"],{timeoutMs:$}).code===0?"graphify-installed":"graphify-install-failed"}function FI(){KU.clear()}function MI($){let b=(vv.get($)??0)+1;return vv.set($,b),b}function ZI($){let U=vv.get($)??0,b=Math.max(0,U-1);if(b===0)vv.delete($),Av($);else vv.set($,b);return b}function DI($){return vv.get($)??0}async function wU($,U=i$){let b=!1,r=!1,v=await AN(Z4($,".codegraph","codegraph.db")),z=await AN(Z4($,"graphify-out","graph.json")),_=(N,O)=>{if(U!==i$)return U(N,{stdio:"ignore",...O});let k=N.split(" "),J=k[0],W=k.slice(1),Y=l(J,W,{cwd:O?.cwd??$,timeoutMs:O?.timeout??1e4});if(Y.code!==0)throw Error(`exit ${Y.code}`)};try{_("npx --yes codegraph --version",{timeout:1e4}),b=!0}catch{try{_("node node_modules/.bin/codegraph --version",{cwd:$,timeout:5000}),b=!0}catch{}}try{_("graphify --version",{timeout:5000}),r=!0}catch{try{_("graphifyy --version",{timeout:5000}),r=!0}catch{try{_('python -c "import graphifyy"',{timeout:5000}),r=!0}catch{try{_('python3 -c "import graphifyy"',{timeout:5000}),r=!0}catch{}}}}return{codegraph:b,graphify:r,codegraphIndexExists:v,graphifyIndexExists:z}}async function HN($,U=60000,b=i$){try{if(b!==i$)b("npx --yes codegraph init",{cwd:$,stdio:"ignore",timeout:U});else{let r=l("npx",["--yes","codegraph","init"],{cwd:$,timeoutMs:U});if(r.code!==0)throw Error(`exit ${r.code}`)}return!0}catch{return!1}}async function EN($,U=120000,b=i$){let r=[{bin:"graphify",args:[".","--no-viz"]},{bin:"python",args:["-m","graphify",".","--no-viz"]},{bin:"python3",args:["-m","graphify",".","--no-viz"]}];for(let v of r)try{if(b!==i$)b(`${v.bin} ${v.args.join(" ")}`,{cwd:$,stdio:"ignore",timeout:U});else{let z=l(v.bin,v.args,{cwd:$,timeoutMs:U});if(z.code!==0)throw Error(`exit ${z.code}`)}return!0}catch{}return!1}function LN($,U){let b=`${$}:${U}`;if(Uv.has(b))return;try{let r;if(U==="codegraph")r=qN("node",["-e",`
4
4
  const OMO_MG_WATCH = 1;
5
5
  const {spawn} = require("child_process");
6
6
  const run = () => {
7
7
  try {
8
8
  const c = spawn("npx", ["codegraph", "update"], {
9
- cwd: ${JSON.stringify(e)},
9
+ cwd: ${JSON.stringify($)},
10
10
  stdio: "ignore",
11
11
  windowsHide: true,
12
12
  shell: false,
@@ -16,25 +16,25 @@ import{createRequire as pf}from"node:module";var{defineProperty:ao,getOwnPropert
16
16
  };
17
17
  run();
18
18
  setInterval(run, 30_000);
19
- `],{stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});else o=wu("python3",["-m","graphify",".","--no-viz","--watch"],{cwd:e,stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});o.unref(),nt.set(n,{process:o,tool:r}),co(o.pid),o.on("exit",()=>{nt.delete(n),wr(o.pid)})}catch{}}function St(e){for(let[r,n]of nt)if(!e||r.startsWith(e)){let o=n.process.pid;if(o)wr(o);if(process.platform==="win32")We(o);else{try{n.process.kill("SIGTERM")}catch{}setTimeout(()=>{We(o)},2000).unref()}nt.delete(r)}}function Rf(e,r){for(let n of nt.keys())if(n.startsWith(e)){if(!r||n.endsWith(r))return!0}return!1}async function It(e={enabled:!0,watch:!1,autoInstall:!0,installTimeoutMs:60000}){let r=[],n=e.projectDir??process.cwd();if(!e.enabled)return{attempted:!1,codes:["disabled"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1};if(e.killOrphanedOnInit!==!1&&!Su){Su=!0;let t=tt();Er("info","orphan sweep: killed "+t+" leftover tool processes")}if(ho.has(n)){let t=await vo(n,e.runner);return{attempted:!1,codes:t.codegraphIndexExists?["codegraph-already-exists"]:[],availability:t,alreadyInitialized:!0}}ho.add(n);let o;try{o=await vo(n,e.runner)}catch{return{attempted:!1,codes:["error"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1}}if(e.autoUpgrade!==!1)try{let t=e.upgradeCachePath??Eu(),i=await ju(t),a=e.upgradeCheckTtlMs??86400000,s={codegraph:null,graphify:null},c=async(l)=>{let d=l==="codegraph"?"codegraphLatest":"graphifyLatest";if(_o(i,a)&&i?.[d])return i[d];let h=await(l==="codegraph"?Mu:Ru)();return s[l]=h,h};if(o.codegraph){let l=await bo(e.runner),d=await c("codegraph");if(yo(l,d,i,a,"codegraphLatest")){if(d&&jr(l,d)){if(await fo(n,e.installTimeoutMs??60000,e.runner)==="codegraph-installed"){if(r.push("codegraph-upgraded"),await bo(e.runner)==null)r.push("codegraph-upgrade-broken")}}}}if(o.graphify){let l=await Nu(e.runner),d=await c("graphify");if(yo(l,d,i,a,"graphifyLatest")){if(d&&jr(l,d)){if(await go(e.installTimeoutMs??60000,e.runner)==="graphify-installed")r.push("graphify-upgraded")}}if(e.checkGraphifyNeedsUpdate!==!1)try{if((e.runner?(()=>{try{return e.runner("graphify check-update "+n,{cwd:n,stdio:"ignore",timeout:1e4}),{code:0,stdout:"",stderr:""}}catch{return{code:1,stdout:"",stderr:"runner rejected"}}})():H("graphify",["check-update",n],{cwd:n,timeoutMs:1e4})).code!==0){if(e.runner)try{e.runner("graphify update "+n+" --no-cluster",{cwd:n,stdio:"ignore",timeout:e.installTimeoutMs??60000})}catch{}else H("graphify",["update",n,"--no-cluster"],{cwd:n,timeoutMs:e.installTimeoutMs??60000});r.push("graphify-reextract-triggered")}}catch{}}try{await Au(t,{checkedAtMs:Date.now(),codegraphLatest:s.codegraph??i?.codegraphLatest,graphifyLatest:s.graphify??i?.graphifyLatest}),r.push("upgrade-cache-written")}catch{}}catch{r.push("upgrade-check-skipped")}if(e.autoInstall!==!1){if(!o.codegraph){let t=await fo(n,e.installTimeoutMs??60000,e.runner);if(r.push(t),t==="codegraph-installed")o.codegraph=!0}if(!o.graphify){let t=await go(e.installTimeoutMs??60000,e.runner);if(r.push(t),t==="graphify-installed")o.graphify=!0}}else{if(!o.codegraph)r.push("codegraph-install-skipped");if(!o.graphify)r.push("graphify-install-skipped")}if(o.codegraph)if(!o.codegraphIndexExists){let t=await Du(n,e.installTimeoutMs??60000);r.push(t?"codegraph-initialized":"codegraph-init-failed")}else r.push("codegraph-already-exists");else r.push("codegraph-unavailable");if(o.graphify){if(!o.graphifyIndexExists){let t=await Pu(n,e.installTimeoutMs??120000);r.push(t?"graphify-initialized":"graphify-init-failed")}else r.push("graphify-already-exists");try{if(!await zu(n)){if(H("graphify",["hook","install"],{cwd:n,timeoutMs:1e4}).code===0)r.push("graphify-hook-installed")}}catch{}}else r.push("graphify-unavailable");if(e.watch){if(o.codegraph)Iu(n,"codegraph"),r.push("watch-started-codegraph");if(o.graphify)Iu(n,"graphify"),r.push("watch-started-graphify")}if(e.addToGlobalGraph===!0&&o.graphify)try{await Ir("graphify",["global","add",zf(n,"graphify-out")],{cwd:n,timeoutMs:1e4}),r.push("graphify-added-to-global")}catch{r.push("graphify-global-add-failed")}return{attempted:!0,codes:r,availability:o,alreadyInitialized:!1}}async function zr(e){try{return(await Ou(e)).isDirectory()}catch{return!1}}async function Tu(e){try{return(await Ou(e)).isFile()}catch{return!1}}function Ar(e){if(typeof e!=="string"||e.length===0)return!1;let r=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+commit(?:\s+-|\s|$)/.test(r)}async function Mr(e,r){if(await zr(Cr(e,".codegraph")))return await Cu(e,r);return await It({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:e,runner:r})}async function zu(e){let{access:r,readFile:n}=await import("node:fs/promises"),{resolve:o}=await import("node:path"),t=o(e,".git","hooks","post-commit");try{await r(t)}catch{return!1}try{return(await n(t,"utf-8")).includes("graphify-hook-start")}catch{return!1}}async function Cu(e,r){let{resolve:n}=await import("node:path"),o=[],t=await zr(n(e,".codegraph"));if(t){try{if(r)r("npx --yes codegraph sync -q",{cwd:e,stdio:"ignore",timeout:30000});else H("npx",["--yes","codegraph","sync","-q"],{cwd:e,timeoutMs:30000});o.push("codegraph-already-exists"),Er("info",`codegraph sync -q completed for ${e}`)}catch(a){Er("warn",`codegraph sync failed for ${e}: ${a}`),o.push("codegraph-install-failed")}return{attempted:!0,codes:o,availability:{codegraph:!0,graphify:!1,codegraphIndexExists:t,graphifyIndexExists:await zr(n(e,"graphify-out"))},alreadyInitialized:!1}}let i=!1;try{if(r)r("npx --yes codegraph --version",{stdio:"ignore",timeout:5000});else if(H("npx",["--yes","codegraph","--version"],{timeoutMs:5000}).code!==0)throw Error("codegraph probe failed");i=!0}catch{try{if(r)r("node node_modules/.bin/codegraph --version",{cwd:e,stdio:"ignore",timeout:5000});else if(H("node",["node_modules/.bin/codegraph","--version"],{cwd:e,timeoutMs:5000}).code!==0)throw Error("local codegraph probe failed");i=!0}catch{}}if(!i)return{attempted:!0,codes:["codegraph-unavailable"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:t,graphifyIndexExists:await zr(n(e,"graphify-out"))},alreadyInitialized:!1};return await It({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:e,runner:r})}async function Nf(){if(Pr)return Pr;let e=await Promise.resolve().then(() => (Dr(),po));return Pr=(r,n)=>e.logToFile(r,n),Pr}async function Er(e,r){(await Nf())(e,r)}function jr(e,r){if(e==null&&r)return!0;if(!r)return!1;let n=e,o=r;if(!n||n===o)return!1;let t=/^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$/;if(!t.test(n)||!t.test(o))return!1;let i=(y)=>{let[x="",j=""]=y.split("-",2),A=x.split(".").map((he)=>{let kt=Number.parseInt(he,10);return Number.isFinite(kt)?kt:0}),[G=0,N=0,X=0]=A;return[G,N,X,j]},[a,s,c,l]=i(n),[d,v,h,u]=i(o);if(d!==a)return d>a;if(v!==s)return v>s;if(h!==c)return h>c;if(l&&!u)return!0;if(!l&&u)return!1;return u>l}function Eu(){return Cr(Cf(),".config","opencode","omo-meta-governor-upgrade-check.json")}async function ju(e){try{let{readFile:r}=await import("node:fs/promises"),n=await r(e,"utf-8"),o=JSON.parse(n);if(typeof o?.checkedAtMs==="number")return o;return null}catch{return null}}async function Au(e,r){let{dirname:n}=await import("node:path"),{mkdir:o,writeFile:t}=await import("node:fs/promises"),i=n(e);try{await o(i,{recursive:!0}),await t(e,JSON.stringify(r,null,2))}catch{}}function _o(e,r){if(!e)return!1;let n=Date.now()-e.checkedAtMs;return n>=0&&n<r}function yo(e,r,n,o,t="codegraphLatest"){let i=r;if(_o(n,o))i=n?.[t]??i;if(!e&&!i)return!1;if(!i)return!1;if(!e)return!0;return jr(e,i)}async function Mu(){try{let r=H("npm",["view","@colbymchenry/codegraph","version"],{timeoutMs:1e4}).stdout.trim();return r.length>0?r:null}catch{return null}}async function Ru(e=Be){for(let r of["python","python3"])try{let t=(H(r,["-m","pip","index","versions","graphifyy"],{timeoutMs:1e4}).stdout.split(`
20
- `)[0]??"").match(/graphifyy\s*\(?([0-9]+\.[0-9]+\.[0-9]+[^\s)]*)/);if(t)return t[1]}catch{}for(let r of["python","python3"])try{let o=H(r,["-c","import urllib.request, json; d=json.load(urllib.request.urlopen('https://pypi.org/pypi/graphifyy/json')); print(d['info']['version'])"],{timeoutMs:1e4}).stdout.trim();if(o.length>0)return o}catch{}return null}async function bo(e){let r=[{bin:"npx",args:["--yes","codegraph","--version"]},{bin:"node",args:["node_modules/.bin/codegraph","--version"]}];for(let{bin:n,args:o}of r)try{let t;if(e){let a=e(`${n} ${o.join(" ")}`,{stdio:"ignore",timeout:1e4});t=typeof a==="string"?a:a.toString()}else t=H(n,o,{timeoutMs:1e4}).stdout;let i=t.match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(i)return i[1]}catch{}return null}async function Nu(e){let r=(n,o)=>{if(e){let t=e(`${n} ${o.join(" ")}`,{stdio:"ignore",timeout:1e4});return typeof t==="string"?t:t.toString()}return H(n,o,{timeoutMs:1e4}).stdout};try{let o=r("graphify",["--version"]).match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}try{let o=r("python",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}try{let o=r("python3",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}return null}function ko(e,r,n){let o=n?(i)=>n(i,{cwd:e}).toString():void 0,t=r;try{if(!t)if(o)t=o("git rev-parse --abbrev-ref HEAD").trim();else t=H("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,timeoutMs:5000}).stdout.trim();if(o)o(`git fetch origin ${t}`);else H("git",["fetch","origin",t],{cwd:e,timeoutMs:30000});let i;if(o)i=o(`git rev-list --count HEAD..origin/${t}`);else i=H("git",["rev-list","--count",`HEAD..origin/${t}`],{cwd:e,timeoutMs:1e4}).stdout;let a=Number.parseInt(i.trim(),10);return Number.isFinite(a)&&a>0?a:0}catch{return 0}}var ho,rt,Su=!1,nt,Pr=null;var Rr=Ge(()=>{Tr();ho=new Set;rt=new Map;nt=new Map});var Ot={};me(Ot,{compareSemver:()=>xo,fetchCliHubLatestVersion:()=>$o,getInstalledCliHubVersion:()=>Tt,infoCli:()=>Ff,installCli:()=>Gf,installCliHub:()=>wo,installCliHubMetaSkill:()=>Io,isCliHubMetaSkillInstalled:()=>Oo,listClis:()=>Lf,searchClis:()=>Zf,upgradeCliHub:()=>So,upgradeCliHubMetaSkill:()=>To});import{execSync as Uf}from"node:child_process";function oe(e,r,n){try{return{ok:!0,stdout:r(e,{timeoutMs:n}),stderr:"",timedOut:!1}}catch(o){let t=o,i=typeof t.stdout==="string"?t.stdout:t.stdout instanceof Buffer?t.stdout.toString("utf8"):"",a=typeof t.stderr==="string"?t.stderr:t.stderr instanceof Buffer?t.stderr.toString("utf8"):t.message??"",s=/timed out|ETIMEDOUT|timeout/i.test(a);return{ok:!1,stdout:i,stderr:a,timedOut:s}}}function Tt(e=$e){let r=oe("pip show cli-anything-hub",e,1e4);if(!r.ok)r=oe("pip3 show cli-anything-hub",e,1e4);if(!r.ok)r=oe("python -m pip show cli-anything-hub",e,1e4);if(!r.ok)return null;let n=r.stdout.match(/^Version:\s*([\d.]+[^\s]*)/m);return n?n[1].trim():null}function $o(e=$e){let r=oe("pip index versions cli-anything-hub",e,1e4);if(!r.ok)r=oe("pip3 index versions cli-anything-hub",e,1e4);if(!r.ok)r=oe("python -m pip index versions cli-anything-hub",e,1e4);if(!r.ok)return null;let n=r.stdout.match(/^\S+\s+\(([\d.]+[^\s,)]*)/m);return n?n[1].trim():null}function xo(e,r){if(e===r)return 0;if(!e)return-1;if(!r)return 1;let n=e.split(/[.+-]/).map((t)=>Number.parseInt(t,10)||0),o=r.split(/[.+-]/).map((t)=>Number.parseInt(t,10)||0);for(let t=0;t<Math.max(n.length,o.length);t++){let i=n[t]??0,a=o[t]??0;if(i<a)return-1;if(i>a)return 1}return 0}function wo(e=$e,r=60000){let n=Date.now(),o=["uv tool install cli-anything-hub","uv pip install --system --break-system-packages cli-anything-hub","pip install --user cli-anything-hub","pip install cli-anything-hub"],t="";for(let i of o){let a=oe(i,e,r);if(a.ok)return{ok:!0,data:null,rawOutput:a.stdout,stderr:a.stderr,durationMs:Date.now()-n,code:"cli-anything-install-succeeded"};t=a.stderr}return{ok:!1,data:null,rawOutput:null,stderr:t.slice(0,500),durationMs:Date.now()-n,code:"cli-anything-install-failed"}}function So(e=$e,r=60000){let n=Date.now(),o=["uv tool upgrade cli-anything-hub","uv tool install --upgrade cli-anything-hub","uv pip install --system --upgrade --break-system-packages cli-anything-hub","pip install --user --upgrade cli-anything-hub","pip install --upgrade cli-anything-hub"],t="";for(let i of o){let a=oe(i,e,r);if(a.ok)return{ok:!0,data:null,rawOutput:a.stdout,stderr:a.stderr,durationMs:Date.now()-n,code:"cli-anything-upgrade-succeeded"};t=a.stderr}return{ok:!1,data:null,rawOutput:null,stderr:t.slice(0,500),durationMs:Date.now()-n,code:"cli-anything-upgrade-failed"}}function Lf(e={},r=$e,n=30000,o="cli-hub"){let t=Date.now(),i=["list","--json"];if(e.category)i.push("--category",e.category);if(e.source)i.push("--source",e.source);let a=oe(`${o} ${i.join(" ")}`,r,n);if(!a.ok)return{ok:!1,data:null,rawOutput:a.stdout,stderr:a.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-list-failed"};try{return{ok:!0,data:JSON.parse(a.stdout),rawOutput:null,stderr:a.stderr,durationMs:Date.now()-t,code:"cli-hub-list-succeeded"}}catch{return{ok:!1,data:null,rawOutput:a.stdout,stderr:"Failed to parse cli-hub list JSON output",durationMs:Date.now()-t,code:"cli-hub-list-failed"}}}function Zf(e,r=$e,n=30000,o="cli-hub"){let t=Date.now();if(!e.trim())return{ok:!1,data:null,rawOutput:null,stderr:"empty query",durationMs:0,code:"cli-hub-search-failed"};let i=oe(`${o} search "${e}" --json`,r,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-search-failed"};try{return{ok:!0,data:JSON.parse(i.stdout),rawOutput:null,stderr:i.stderr,durationMs:Date.now()-t,code:"cli-hub-search-succeeded"}}catch{return{ok:!1,data:null,rawOutput:i.stdout,stderr:"Failed to parse cli-hub search JSON output",durationMs:Date.now()-t,code:"cli-hub-search-failed"}}}function Ff(e,r=$e,n=1e4,o="cli-hub"){let t=Date.now(),i=oe(`${o} info "${e}"`,r,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-info-failed"};return{ok:!0,data:i.stdout,rawOutput:null,stderr:i.stderr,durationMs:Date.now()-t,code:"cli-hub-info-succeeded"}}function Gf(e,r=$e,n=120000,o="cli-hub"){let t=Date.now(),i=oe(`${o} install "${e}"`,r,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-install-failed"};return{ok:!0,data:null,rawOutput:i.stdout,stderr:i.stderr,durationMs:Date.now()-t,code:"cli-hub-install-succeeded"}}function Io(e="global",r=$e,n=60000,o="npx skills"){let t=Date.now(),a=`${o} add HKUDS/CLI-Anything --skill cli-hub-meta-skill ${e==="global"?"-g":"-p"} -y`,s=oe(a,r,n);if(!s.ok)return{ok:!1,data:null,rawOutput:s.stdout,stderr:s.stderr.slice(0,500),durationMs:Date.now()-t,code:"skill-install-failed"};return{ok:!0,data:null,rawOutput:s.stdout,stderr:s.stderr,durationMs:Date.now()-t,code:"skill-install-succeeded"}}function To(e="global",r=$e,n=60000,o="npx skills"){let t=Date.now(),a=`${o} update cli-hub-meta-skill ${e==="global"?"-g":"-p"} -y`,s=oe(a,r,n);if(!s.ok)return{ok:!1,data:null,rawOutput:s.stdout,stderr:s.stderr.slice(0,500),durationMs:Date.now()-t,code:"skill-upgrade-failed"};return{ok:!0,data:null,rawOutput:s.stdout,stderr:s.stderr,durationMs:Date.now()-t,code:"skill-upgrade-succeeded"}}function Oo(e="global",r=$e,n=1e4,o="npx skills"){let i=oe(`${o} list ${e==="global"?"-g":"-p"}`,r,n);if(!i.ok)return!1;return/cli-hub-meta-skill/i.test(i.stdout)}var $e=(e,r)=>Uf(e,{timeout:r?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]}).toString();var ot=()=>{};var Nm={};me(Nm,{_sessionStore:()=>hr,buildEscalationPrompt:()=>Ol,existsSync:()=>Ib,hasSessionClient:()=>bt,join:()=>Sb,persistSessionMessage:()=>Yn,promptAgent:()=>_t,promptAgentText:()=>Tl,runWithClient:()=>Ob,setSessionClient:()=>Il});import{join as Sb}from"node:path";import{existsSync as Ib}from"node:fs";import{AsyncLocalStorage as Tb}from"node:async_hooks";function Il(e){if(e){let r=Date.now();if(r-Mm>1000){Mm=r;try{let{logToFile:n}=(Dr(),lf(po));n("info","SessionBridge: OpenCode client hydrated — session.prompt() available")}catch{}}}Xn=e}function Ob(e,r){return hr.run(e,r)}function bt(){return(hr.getStore()??Xn)!==null}async function _t(e,r){let n=Date.now(),o=r.timeoutMs??15000,t=hr.getStore()??Xn;if(!t)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!e)return{ok:!1,messageID:null,error:"SessionBridge: sessionID is required",durationMs:0};let i=JSON.stringify(r.mcpArgs,null,2),c={type:"text",text:`${r.preamble??"The user wants to record this."}
19
+ `],{stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});else r=qN("python3",["-m","graphify",".","--no-viz","--watch"],{cwd:$,stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});r.unref(),Uv.set(b,{process:r,tool:U}),_U(r.pid),r.on("exit",()=>{Uv.delete(b),L4(r.pid)})}catch{}}function Av($){for(let[U,b]of Uv)if(!$||U.startsWith($)){let r=b.process.pid;if(r)L4(r);if(process.platform==="win32")n$(r);else{try{b.process.kill("SIGTERM")}catch{}setTimeout(()=>{n$(r)},2000).unref()}Uv.delete(U)}}function xI($,U){for(let b of Uv.keys())if(b.startsWith($)){if(!U||b.endsWith(U))return!0}return!1}async function Gv($={enabled:!0,watch:!1,autoInstall:!0,installTimeoutMs:60000}){let U=[],b=$.projectDir??process.cwd();if(!$.enabled)return{attempted:!1,codes:["disabled"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1};if($.killOrphanedOnInit!==!1&&!BN){BN=!0;let v=$v();D4("info","orphan sweep: killed "+v+" leftover tool processes")}if(KU.has(b)){let v=await wU(b,$.runner);return{attempted:!1,codes:v.codegraphIndexExists?["codegraph-already-exists"]:[],availability:v,alreadyInitialized:!0}}KU.add(b);let r;try{r=await wU(b,$.runner)}catch{return{attempted:!1,codes:["error"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1}}if($.autoUpgrade!==!1)try{let v=$.upgradeCachePath??MN(),z=await ZN(v),_=$.upgradeCheckTtlMs??86400000,N={codegraph:null,graphify:null},O=async(k)=>{let J=k==="codegraph"?"codegraphLatest":"graphifyLatest";if(WU(z,_)&&z?.[J])return z[J];let Y=await(k==="codegraph"?xN:gN)();return N[k]=Y,Y};if(r.codegraph){let k=await YU($.runner),J=await O("codegraph");if(QU(k,J,z,_,"codegraphLatest")){if(J&&x4(k,J)){if(await JU(b,$.installTimeoutMs??60000,$.runner)==="codegraph-installed"){if(U.push("codegraph-upgraded"),await YU($.runner)==null)U.push("codegraph-upgrade-broken")}}}}if(r.graphify){let k=await RN($.runner),J=await O("graphify");if(QU(k,J,z,_,"graphifyLatest")){if(J&&x4(k,J)){if(await XU($.installTimeoutMs??60000,$.runner)==="graphify-installed")U.push("graphify-upgraded")}}if($.checkGraphifyNeedsUpdate!==!1)try{if(($.runner?(()=>{try{return $.runner("graphify check-update "+b,{cwd:b,stdio:"ignore",timeout:1e4}),{code:0,stdout:"",stderr:""}}catch{return{code:1,stdout:"",stderr:"runner rejected"}}})():l("graphify",["check-update",b],{cwd:b,timeoutMs:1e4})).code!==0){if($.runner)try{$.runner("graphify update "+b+" --no-cluster",{cwd:b,stdio:"ignore",timeout:$.installTimeoutMs??60000})}catch{}else l("graphify",["update",b,"--no-cluster"],{cwd:b,timeoutMs:$.installTimeoutMs??60000});U.push("graphify-reextract-triggered")}}catch{}}try{await DN(v,{checkedAtMs:Date.now(),codegraphLatest:N.codegraph??z?.codegraphLatest,graphifyLatest:N.graphify??z?.graphifyLatest}),U.push("upgrade-cache-written")}catch{}}catch{U.push("upgrade-check-skipped")}if($.autoInstall!==!1){if(!r.codegraph){let v=await JU(b,$.installTimeoutMs??60000,$.runner);if(U.push(v),v==="codegraph-installed")r.codegraph=!0}if(!r.graphify){let v=await XU($.installTimeoutMs??60000,$.runner);if(U.push(v),v==="graphify-installed")r.graphify=!0}}else{if(!r.codegraph)U.push("codegraph-install-skipped");if(!r.graphify)U.push("graphify-install-skipped")}if(r.codegraph)if(!r.codegraphIndexExists){let v=await HN(b,$.installTimeoutMs??60000);U.push(v?"codegraph-initialized":"codegraph-init-failed")}else U.push("codegraph-already-exists");else U.push("codegraph-unavailable");if(r.graphify){if(!r.graphifyIndexExists){let v=await EN(b,$.installTimeoutMs??120000);U.push(v?"graphify-initialized":"graphify-init-failed")}else U.push("graphify-already-exists");try{if(!await SN(b)){if(l("graphify",["hook","install"],{cwd:b,timeoutMs:1e4}).code===0)U.push("graphify-hook-installed")}}catch{}}else U.push("graphify-unavailable");if($.watch){if(r.codegraph)LN(b,"codegraph"),U.push("watch-started-codegraph");if(r.graphify)LN(b,"graphify"),U.push("watch-started-graphify")}if($.addToGlobalGraph===!0&&r.graphify)try{await G4("graphify",["global","add",EI(b,"graphify-out")],{cwd:b,timeoutMs:1e4}),U.push("graphify-added-to-global")}catch{U.push("graphify-global-add-failed")}return{attempted:!0,codes:U,availability:r,alreadyInitialized:!1}}async function M4($){try{return(await GN($)).isDirectory()}catch{return!1}}async function AN($){try{return(await GN($)).isFile()}catch{return!1}}function g4($){if(typeof $!=="string"||$.length===0)return!1;let U=$.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+commit(?:\s+-|\s|$)/.test(U)}async function R4($,U){if(await M4(Z4($,".codegraph")))return await FN($,U);return await Gv({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:$,runner:U})}async function SN($){let{access:U,readFile:b}=await import("node:fs/promises"),{resolve:r}=await import("node:path"),v=r($,".git","hooks","post-commit");try{await U(v)}catch{return!1}try{return(await b(v,"utf-8")).includes("graphify-hook-start")}catch{return!1}}async function FN($,U){let{resolve:b}=await import("node:path"),r=[],v=await M4(b($,".codegraph"));if(v){try{if(U)U("npx --yes codegraph sync -q",{cwd:$,stdio:"ignore",timeout:30000});else l("npx",["--yes","codegraph","sync","-q"],{cwd:$,timeoutMs:30000});r.push("codegraph-already-exists"),D4("info",`codegraph sync -q completed for ${$}`)}catch(_){D4("warn",`codegraph sync failed for ${$}: ${_}`),r.push("codegraph-install-failed")}return{attempted:!0,codes:r,availability:{codegraph:!0,graphify:!1,codegraphIndexExists:v,graphifyIndexExists:await M4(b($,"graphify-out"))},alreadyInitialized:!1}}let z=!1;try{if(U)U("npx --yes codegraph --version",{stdio:"ignore",timeout:5000});else if(l("npx",["--yes","codegraph","--version"],{timeoutMs:5000}).code!==0)throw Error("codegraph probe failed");z=!0}catch{try{if(U)U("node node_modules/.bin/codegraph --version",{cwd:$,stdio:"ignore",timeout:5000});else if(l("node",["node_modules/.bin/codegraph","--version"],{cwd:$,timeoutMs:5000}).code!==0)throw Error("local codegraph probe failed");z=!0}catch{}}if(!z)return{attempted:!0,codes:["codegraph-unavailable"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:v,graphifyIndexExists:await M4(b($,"graphify-out"))},alreadyInitialized:!1};return await Gv({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:$,runner:U})}async function gI(){if(F4)return F4;let $=await Promise.resolve().then(() => (S4(),IU));return F4=(U,b)=>$.logToFile(U,b),F4}async function D4($,U){(await gI())($,U)}function x4($,U){if($==null&&U)return!0;if(!U)return!1;let b=$,r=U;if(!b||b===r)return!1;let v=/^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$/;if(!v.test(b)||!v.test(r))return!1;let z=(j)=>{let[B="",x=""]=j.split("-",2),g=B.split(".").map((Q$)=>{let Pv=Number.parseInt(Q$,10);return Number.isFinite(Pv)?Pv:0}),[y=0,T=0,t=0]=g;return[y,T,t,x]},[_,N,O,k]=z(b),[J,W,Y,I]=z(r);if(J!==_)return J>_;if(W!==N)return W>N;if(Y!==O)return Y>O;if(k&&!I)return!0;if(!k&&I)return!1;return I>k}function MN(){return Z4(SI(),".config","opencode","omo-meta-governor-upgrade-check.json")}async function ZN($){try{let{readFile:U}=await import("node:fs/promises"),b=await U($,"utf-8"),r=JSON.parse(b);if(typeof r?.checkedAtMs==="number")return r;return null}catch{return null}}async function DN($,U){let{dirname:b}=await import("node:path"),{mkdir:r,writeFile:v}=await import("node:fs/promises"),z=b($);try{await r(z,{recursive:!0}),await v($,JSON.stringify(U,null,2))}catch{}}function WU($,U){if(!$)return!1;let b=Date.now()-$.checkedAtMs;return b>=0&&b<U}function QU($,U,b,r,v="codegraphLatest"){let z=U;if(WU(b,r))z=b?.[v]??z;if(!$&&!z)return!1;if(!z)return!1;if(!$)return!0;return x4($,z)}async function xN(){try{let U=l("npm",["view","@colbymchenry/codegraph","version"],{timeoutMs:1e4}).stdout.trim();return U.length>0?U:null}catch{return null}}async function gN($=i$){for(let U of["python","python3"])try{let v=(l(U,["-m","pip","index","versions","graphifyy"],{timeoutMs:1e4}).stdout.split(`
20
+ `)[0]??"").match(/graphifyy\s*\(?([0-9]+\.[0-9]+\.[0-9]+[^\s)]*)/);if(v)return v[1]}catch{}for(let U of["python","python3"])try{let r=l(U,["-c","import urllib.request, json; d=json.load(urllib.request.urlopen('https://pypi.org/pypi/graphifyy/json')); print(d['info']['version'])"],{timeoutMs:1e4}).stdout.trim();if(r.length>0)return r}catch{}return null}async function YU($){let U=[{bin:"npx",args:["--yes","codegraph","--version"]},{bin:"node",args:["node_modules/.bin/codegraph","--version"]}];for(let{bin:b,args:r}of U)try{let v;if($){let _=$(`${b} ${r.join(" ")}`,{stdio:"ignore",timeout:1e4});v=typeof _==="string"?_:_.toString()}else v=l(b,r,{timeoutMs:1e4}).stdout;let z=v.match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(z)return z[1]}catch{}return null}async function RN($){let U=(b,r)=>{if($){let v=$(`${b} ${r.join(" ")}`,{stdio:"ignore",timeout:1e4});return typeof v==="string"?v:v.toString()}return l(b,r,{timeoutMs:1e4}).stdout};try{let r=U("graphify",["--version"]).match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(r)return r[1]}catch{}try{let r=U("python",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(r)return r[1]}catch{}try{let r=U("python3",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(r)return r[1]}catch{}return null}function jU($,U,b){let r=b?(z)=>b(z,{cwd:$}).toString():void 0,v=U;try{if(!v)if(r)v=r("git rev-parse --abbrev-ref HEAD").trim();else v=l("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:$,timeoutMs:5000}).stdout.trim();if(r)r(`git fetch origin ${v}`);else l("git",["fetch","origin",v],{cwd:$,timeoutMs:30000});let z;if(r)z=r(`git rev-list --count HEAD..origin/${v}`);else z=l("git",["rev-list","--count",`HEAD..origin/${v}`],{cwd:$,timeoutMs:1e4}).stdout;let _=Number.parseInt(z.trim(),10);return Number.isFinite(_)&&_>0?_:0}catch{return 0}}var KU,vv,BN=!1,Uv,F4=null;var m4=y$(()=>{H4();KU=new Set;vv=new Map;Uv=new Map});var Ev={};J$(Ev,{upgradeCliHubMetaSkill:()=>AU,upgradeCliHub:()=>BU,searchClis:()=>TI,listClis:()=>mI,isCliHubMetaSkillInstalled:()=>GU,installCliHubMetaSkill:()=>LU,installCliHub:()=>qU,installCli:()=>cI,infoCli:()=>CI,getInstalledCliHubVersion:()=>Hv,fetchCliHubLatestVersion:()=>VU,compareSemver:()=>PU});import{execSync as RI}from"node:child_process";function b$($,U,b){try{return{ok:!0,stdout:U($,{timeoutMs:b}),stderr:"",timedOut:!1}}catch(r){let v=r,z=typeof v.stdout==="string"?v.stdout:v.stdout instanceof Buffer?v.stdout.toString("utf8"):"",_=typeof v.stderr==="string"?v.stderr:v.stderr instanceof Buffer?v.stderr.toString("utf8"):v.message??"",N=/timed out|ETIMEDOUT|timeout/i.test(_);return{ok:!1,stdout:z,stderr:_,timedOut:N}}}function Hv($=q$){let U=b$("pip show cli-anything-hub",$,1e4);if(!U.ok)U=b$("pip3 show cli-anything-hub",$,1e4);if(!U.ok)U=b$("python -m pip show cli-anything-hub",$,1e4);if(!U.ok)return null;let b=U.stdout.match(/^Version:\s*([\d.]+[^\s]*)/m);return b?b[1].trim():null}function VU($=q$){let U=b$("pip index versions cli-anything-hub",$,1e4);if(!U.ok)U=b$("pip3 index versions cli-anything-hub",$,1e4);if(!U.ok)U=b$("python -m pip index versions cli-anything-hub",$,1e4);if(!U.ok)return null;let b=U.stdout.match(/^\S+\s+\(([\d.]+[^\s,)]*)/m);return b?b[1].trim():null}function PU($,U){if($===U)return 0;if(!$)return-1;if(!U)return 1;let b=$.split(/[.+-]/).map((v)=>Number.parseInt(v,10)||0),r=U.split(/[.+-]/).map((v)=>Number.parseInt(v,10)||0);for(let v=0;v<Math.max(b.length,r.length);v++){let z=b[v]??0,_=r[v]??0;if(z<_)return-1;if(z>_)return 1}return 0}function qU($=q$,U=60000){let b=Date.now(),r=["uv tool install cli-anything-hub","uv pip install --system --break-system-packages cli-anything-hub","pip install --user cli-anything-hub","pip install cli-anything-hub"],v="";for(let z of r){let _=b$(z,$,U);if(_.ok)return{ok:!0,data:null,rawOutput:_.stdout,stderr:_.stderr,durationMs:Date.now()-b,code:"cli-anything-install-succeeded"};v=_.stderr}return{ok:!1,data:null,rawOutput:null,stderr:v.slice(0,500),durationMs:Date.now()-b,code:"cli-anything-install-failed"}}function BU($=q$,U=60000){let b=Date.now(),r=["uv tool upgrade cli-anything-hub","uv tool install --upgrade cli-anything-hub","uv pip install --system --upgrade --break-system-packages cli-anything-hub","pip install --user --upgrade cli-anything-hub","pip install --upgrade cli-anything-hub"],v="";for(let z of r){let _=b$(z,$,U);if(_.ok)return{ok:!0,data:null,rawOutput:_.stdout,stderr:_.stderr,durationMs:Date.now()-b,code:"cli-anything-upgrade-succeeded"};v=_.stderr}return{ok:!1,data:null,rawOutput:null,stderr:v.slice(0,500),durationMs:Date.now()-b,code:"cli-anything-upgrade-failed"}}function mI($={},U=q$,b=30000,r="cli-hub"){let v=Date.now(),z=["list","--json"];if($.category)z.push("--category",$.category);if($.source)z.push("--source",$.source);let _=b$(`${r} ${z.join(" ")}`,U,b);if(!_.ok)return{ok:!1,data:null,rawOutput:_.stdout,stderr:_.stderr.slice(0,500),durationMs:Date.now()-v,code:"cli-hub-list-failed"};try{return{ok:!0,data:JSON.parse(_.stdout),rawOutput:null,stderr:_.stderr,durationMs:Date.now()-v,code:"cli-hub-list-succeeded"}}catch{return{ok:!1,data:null,rawOutput:_.stdout,stderr:"Failed to parse cli-hub list JSON output",durationMs:Date.now()-v,code:"cli-hub-list-failed"}}}function TI($,U=q$,b=30000,r="cli-hub"){let v=Date.now();if(!$.trim())return{ok:!1,data:null,rawOutput:null,stderr:"empty query",durationMs:0,code:"cli-hub-search-failed"};let z=b$(`${r} search "${$}" --json`,U,b);if(!z.ok)return{ok:!1,data:null,rawOutput:z.stdout,stderr:z.stderr.slice(0,500),durationMs:Date.now()-v,code:"cli-hub-search-failed"};try{return{ok:!0,data:JSON.parse(z.stdout),rawOutput:null,stderr:z.stderr,durationMs:Date.now()-v,code:"cli-hub-search-succeeded"}}catch{return{ok:!1,data:null,rawOutput:z.stdout,stderr:"Failed to parse cli-hub search JSON output",durationMs:Date.now()-v,code:"cli-hub-search-failed"}}}function CI($,U=q$,b=1e4,r="cli-hub"){let v=Date.now(),z=b$(`${r} info "${$}"`,U,b);if(!z.ok)return{ok:!1,data:null,rawOutput:z.stdout,stderr:z.stderr.slice(0,500),durationMs:Date.now()-v,code:"cli-hub-info-failed"};return{ok:!0,data:z.stdout,rawOutput:null,stderr:z.stderr,durationMs:Date.now()-v,code:"cli-hub-info-succeeded"}}function cI($,U=q$,b=120000,r="cli-hub"){let v=Date.now(),z=b$(`${r} install "${$}"`,U,b);if(!z.ok)return{ok:!1,data:null,rawOutput:z.stdout,stderr:z.stderr.slice(0,500),durationMs:Date.now()-v,code:"cli-hub-install-failed"};return{ok:!0,data:null,rawOutput:z.stdout,stderr:z.stderr,durationMs:Date.now()-v,code:"cli-hub-install-succeeded"}}function LU($="global",U=q$,b=60000,r="npx skills"){let v=Date.now(),_=`${r} add HKUDS/CLI-Anything --skill cli-hub-meta-skill ${$==="global"?"-g":"-p"} -y`,N=b$(_,U,b);if(!N.ok)return{ok:!1,data:null,rawOutput:N.stdout,stderr:N.stderr.slice(0,500),durationMs:Date.now()-v,code:"skill-install-failed"};return{ok:!0,data:null,rawOutput:N.stdout,stderr:N.stderr,durationMs:Date.now()-v,code:"skill-install-succeeded"}}function AU($="global",U=q$,b=60000,r="npx skills"){let v=Date.now(),_=`${r} update cli-hub-meta-skill ${$==="global"?"-g":"-p"} -y`,N=b$(_,U,b);if(!N.ok)return{ok:!1,data:null,rawOutput:N.stdout,stderr:N.stderr.slice(0,500),durationMs:Date.now()-v,code:"skill-upgrade-failed"};return{ok:!0,data:null,rawOutput:N.stdout,stderr:N.stderr,durationMs:Date.now()-v,code:"skill-upgrade-succeeded"}}function GU($="global",U=q$,b=1e4,r="npx skills"){let z=b$(`${r} list ${$==="global"?"-g":"-p"}`,U,b);if(!z.ok)return!1;return/cli-hub-meta-skill/i.test(z.stdout)}var q$=($,U)=>{return RI($,{timeout:U?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]}).toString()};var bv=()=>{};var R2={};J$(R2,{setSessionClient:()=>L_,runWithClient:()=>Aw,promptAgentText:()=>A_,promptAgent:()=>Vv,persistSessionMessage:()=>t6,join:()=>qw,hasSessionClient:()=>jv,existsSync:()=>Bw,buildEscalationPrompt:()=>G_,_sessionStore:()=>Q4});import{join as qw}from"node:path";import{existsSync as Bw}from"node:fs";import{AsyncLocalStorage as Lw}from"node:async_hooks";function L_($){if($){let U=Date.now();if(U-x2>1000){x2=U;try{let{logToFile:b}=(S4(),zI(IU));b("info","SessionBridge: OpenCode client hydrated — session.prompt() available")}catch{}}}p6=$}function Aw($,U){return Q4.run($,U)}function jv(){return(Q4.getStore()??p6)!==null}async function Vv($,U){let b=Date.now(),r=U.timeoutMs??15000,v=Q4.getStore()??p6;if(!v)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!$)return{ok:!1,messageID:null,error:"SessionBridge: sessionID is required",durationMs:0};let z=JSON.stringify(U.mcpArgs,null,2),O={type:"text",text:`${U.preamble??"The user wants to record this."}
21
21
 
22
- Please call the \`${r.mcpTool}\` MCP tool with EXACTLY these args:
22
+ Please call the \`${U.mcpTool}\` MCP tool with EXACTLY these args:
23
23
 
24
24
  \`\`\`json
25
- `+i+`
25
+ `+z+`
26
26
  \`\`\`
27
27
 
28
28
  Do not paraphrase, modify, or add fields. Pass the args through verbatim.
29
- After the tool call, briefly confirm what you stored and for which tool.`};try{return{ok:!0,messageID:(await Rm(t.session.prompt({path:{id:e},body:{parts:[c]}}),o,`session.prompt for ${r.mcpTool}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-n}}catch(l){return{ok:!1,messageID:null,error:l instanceof Error?l.message:String(l),durationMs:Date.now()-n}}}async function Yn(e,r,n=1e4){let o=Date.now(),t=hr.getStore()??Xn;if(!t)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!e||!r)return{ok:!1,messageID:null,error:"SessionBridge: sessionID and text are required",durationMs:0};let i={type:"text",text:r};try{return{ok:!0,messageID:(await Rm(t.session.prompt({path:{id:e},body:{parts:[i]}}),n,`session.prompt persist for ${e}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-o}}catch(a){return{ok:!1,messageID:null,error:a instanceof Error?a.message:String(a),durationMs:Date.now()-o}}}async function Tl(e,r){return Yn(e,r)}function Rm(e,r,n){return new Promise((o,t)=>{let i=setTimeout(()=>{t(Error(`${n} timed out after ${r}ms`))},r);e.then((a)=>{clearTimeout(i),o(a)},(a)=>{clearTimeout(i),t(a)})})}function Ol(e){if(e.target==="oracle")return`[MetaGovernor] Escalation triggered. Reason: ${e.reasoning}
29
+ After the tool call, briefly confirm what you stored and for which tool.`};try{return{ok:!0,messageID:(await g2(v.session.prompt({path:{id:$},body:{parts:[O]}}),r,`session.prompt for ${U.mcpTool}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-b}}catch(k){return{ok:!1,messageID:null,error:k instanceof Error?k.message:String(k),durationMs:Date.now()-b}}}async function t6($,U,b=1e4){let r=Date.now(),v=Q4.getStore()??p6;if(!v)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!$||!U)return{ok:!1,messageID:null,error:"SessionBridge: sessionID and text are required",durationMs:0};let z={type:"text",text:U};try{return{ok:!0,messageID:(await g2(v.session.prompt({path:{id:$},body:{parts:[z]}}),b,`session.prompt persist for ${$}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-r}}catch(_){return{ok:!1,messageID:null,error:_ instanceof Error?_.message:String(_),durationMs:Date.now()-r}}}async function A_($,U){return t6($,U)}function g2($,U,b){return new Promise((r,v)=>{let z=setTimeout(()=>{v(Error(`${b} timed out after ${U}ms`))},U);$.then((_)=>{clearTimeout(z),r(_)},(_)=>{clearTimeout(z),v(_)})})}function G_($){if($.target==="oracle")return`[MetaGovernor] Escalation triggered. Reason: ${$.reasoning}
30
30
 
31
- Please invoke the \`task\` tool with \`subagent_type=oracle\` to perform a verification pass on the current session state. Decision context: ${e.evidenceCount} evidence unit(s). After Oracle returns, you should continue with the recommended action.`;return`[MetaGovernor] Escalation to user required. Reason: ${e.reasoning}
31
+ Please invoke the \`task\` tool with \`subagent_type=oracle\` to perform a verification pass on the current session state. Decision context: ${$.evidenceCount} evidence unit(s). After Oracle returns, you should continue with the recommended action.`;return`[MetaGovernor] Escalation to user required. Reason: ${$.reasoning}
32
32
 
33
- Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var hr,Mm=0,Xn=null;var Qn=Ge(()=>{hr=new Tb});var Um=uf(function(nw,Db){Db.exports={name:"@herjarsa/omo-meta-governor",version:"0.29.0",type:"module",description:"Self-judging agent orchestration layer for OpenCode. Reads memory, scores sessions, dispatches decisions.",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./lib":{types:"./dist/lib.d.ts",import:"./dist/lib.js"}},types:"./dist/index.d.ts",main:"./dist/index.js",files:["dist","README.md"],scripts:{build:"bun build.ts",typecheck:"tsc --noEmit",test:"bun test"},peerDependencies:{"@opencode-ai/plugin":">=1.0.0"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},license:"MIT",repository:{type:"git",url:"https://github.com/herjarsa/omo-meta-governor.git"},devDependencies:{"@colbymchenry/codegraph":"^1.5.0","@opencode-ai/plugin":"^1.17.4","@types/node":"^25.9.3",typescript:"^7.0.2"}}});var Np={};me(Np,{deepMerge:()=>vr,getProjectConfigPath:()=>Rp,getUserConfigPath:()=>Mp,loadJsoncFile:()=>El,loadMetaGovernorConfig:()=>jl,parseJsonc:()=>Ap,stripJsoncComments:()=>jp});import{readFile as Rb,access as Nb}from"node:fs/promises";import{resolve as Ub,join as Lb}from"node:path";import{homedir as Zb}from"node:os";function jp(e){let r=[],n=0;while(n<e.length){let t=e[n];if(t==='"'||t==="'"){let i=t;r.push(i),n++;while(n<e.length){let a=e[n];if(r.push(a),a==="\\"){if(n++,n<e.length)r.push(e[n])}else if(a===i){n++;break}n++}continue}if(t==="/"&&n+1<e.length&&e[n+1]==="/"){n+=2;while(n<e.length&&e[n]!==`
34
- `)n++;continue}if(t==="/"&&n+1<e.length&&e[n+1]==="*"){n+=2;while(n<e.length){if(e[n]==="*"&&n+1<e.length&&e[n+1]==="/"){n+=2;break}n++}continue}r.push(t),n++}let o=r.join("");for(let t=0;t<10;t++){let i=o;if(o=o.replace(/,(\s*[\]}])/g,"$1"),o===i)break}return o}function Ap(e){try{let r=jp(e);return JSON.parse(r)}catch{return}}function Mp(){return Ub(Zb(),".config","opencode",Ep)}function Rp(e){let r=e??process.cwd();return Lb(r,".opencode",Ep)}async function Fb(e){try{return await Nb(e),!0}catch{return!1}}async function El(e){if(!await Fb(e))return;try{let r=await Rb(e,"utf-8");return Ap(r)}catch{return}}function vr(e,r){let n={...e};for(let o of Object.keys(r)){let t=r[o],i=n[o];if(t===void 0)continue;if(Cp(t)&&Cp(i))n[o]=vr(i,t);else n[o]=t}return n}function Cp(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}async function jl(e={}){let r=[],n="defaults",o={},t=Mp(),i=await El(t);if(i)o=vr(o,i),r.push(`user:${t}`),n="user";let a=Rp(e.projectDir),s=await El(a);if(s)o=vr(o,s),r.push(`project:${a}`),n="project";if(e.cliOptions&&Object.keys(e.cliOptions).length>0)o=vr(o,e.cliOptions),r.push("cli:inline"),n="cli";return{config:o,sources:r,effectiveSource:n}}var Ep="omo-meta-governor.jsonc";var Al=()=>{};var Vp={};me(Vp,{DEFAULT_CI_MONITOR_CONFIG:()=>Jb,getFailedLogs:()=>Yb,getLatestRunForSha:()=>qb,pollRunUntilComplete:()=>Kb,triggerWorkflow:()=>Xb});import{execFileSync as Hb}from"node:child_process";function yr(e,r=1e4){try{return Hb("gh",e,{encoding:"utf-8",timeout:r,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().replace(/\r\n/g,`
35
- `).trim()}catch{return null}}function qb(e){let r=yr(["run","list","--limit","1","--commit",e,"--json","databaseId,status,conclusion,displayTitle,headSha,url"],1e4);if(!r)return null;try{return JSON.parse(r)[0]??null}catch{return null}}function Kb(e,r){let n=Date.now(),o="",t=yr(["run","view",String(e),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!t)return null;let i;try{i=JSON.parse(t)}catch{return null}while((i.status==="queued"||i.status==="in_progress"||i.status==="waiting"||i.status==="requested")&&Date.now()-n<r.maxWaitMs){let a=Date.now()+r.pollIntervalMs;while(Date.now()<a);let s=yr(["run","view",String(e),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!s)return null;try{i=JSON.parse(s)}catch{return null}}return i}function Xb(e,r){let n=yr(["workflow","run",e,"--ref",r],15000);return null}function Yb(e,r=4000){let n=yr(["run","view",String(e),"--log-failed"],30000);if(!n)return"";if(n.length<=r)return n;return n.slice(0,r)+`
33
+ Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var Q4,x2=0,p6=null;var e6=y$(()=>{Q4=new Lw});var m2=_I((sY,Gw)=>{Gw.exports={name:"@herjarsa/omo-meta-governor",version:"0.29.0",type:"module",description:"Self-judging agent orchestration layer for OpenCode. Reads memory, scores sessions, dispatches decisions.",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./lib":{types:"./dist/lib.d.ts",import:"./dist/lib.js"}},types:"./dist/index.d.ts",main:"./dist/index.js",files:["dist","README.md"],scripts:{build:"bun build.ts",typecheck:"tsc --noEmit",test:"bun test"},peerDependencies:{"@opencode-ai/plugin":">=1.0.0"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},license:"MIT",repository:{type:"git",url:"https://github.com/herjarsa/omo-meta-governor.git"},devDependencies:{"@colbymchenry/codegraph":"^1.5.0","@opencode-ai/plugin":"^1.17.4","@types/node":"^25.9.3",typescript:"^7.0.2"}}});var Rk={};J$(Rk,{stripJsoncComments:()=>Zk,parseJsonc:()=>Dk,loadMetaGovernorConfig:()=>Z_,loadJsoncFile:()=>M_,getUserConfigPath:()=>xk,getProjectConfigPath:()=>gk,deepMerge:()=>Y4});import{readFile as xw,access as gw}from"node:fs/promises";import{resolve as Rw,join as mw}from"node:path";import{homedir as Tw}from"node:os";function Zk($){let U=[],b=0;while(b<$.length){let v=$[b];if(v==='"'||v==="'"){let z=v;U.push(z),b++;while(b<$.length){let _=$[b];if(U.push(_),_==="\\"){if(b++,b<$.length)U.push($[b])}else if(_===z){b++;break}b++}continue}if(v==="/"&&b+1<$.length&&$[b+1]==="/"){b+=2;while(b<$.length&&$[b]!==`
34
+ `)b++;continue}if(v==="/"&&b+1<$.length&&$[b+1]==="*"){b+=2;while(b<$.length){if($[b]==="*"&&b+1<$.length&&$[b+1]==="/"){b+=2;break}b++}continue}U.push(v),b++}let r=U.join("");for(let v=0;v<10;v++){let z=r;if(r=r.replace(/,(\s*[\]}])/g,"$1"),r===z)break}return r}function Dk($){try{let U=Zk($);return JSON.parse(U)}catch{return}}function xk(){return Rw(Tw(),".config","opencode",Mk)}function gk($){let U=$??process.cwd();return mw(U,".opencode",Mk)}async function Cw($){try{return await gw($),!0}catch{return!1}}async function M_($){if(!await Cw($))return;try{let U=await xw($,"utf-8");return Dk(U)}catch{return}}function Y4($,U){let b={...$};for(let r of Object.keys(U)){let v=U[r],z=b[r];if(v===void 0)continue;if(Fk(v)&&Fk(z))b[r]=Y4(z,v);else b[r]=v}return b}function Fk($){return typeof $==="object"&&$!==null&&!Array.isArray($)}async function Z_($={}){let U=[],b="defaults",r={},v=xk(),z=await M_(v);if(z)r=Y4(r,z),U.push(`user:${v}`),b="user";let _=gk($.projectDir),N=await M_(_);if(N)r=Y4(r,N),U.push(`project:${_}`),b="project";if($.cliOptions&&Object.keys($.cliOptions).length>0)r=Y4(r,$.cliOptions),U.push("cli:inline"),b="cli";return{config:r,sources:U,effectiveSource:b}}var Mk="omo-meta-governor.jsonc";var D_=()=>{};var hk={};J$(hk,{triggerWorkflow:()=>ow,pollRunUntilComplete:()=>lw,getLatestRunForSha:()=>iw,getFailedLogs:()=>dw,DEFAULT_CI_MONITOR_CONFIG:()=>nw});import{execFileSync as fw}from"node:child_process";function W4($,U=1e4){try{return fw("gh",$,{encoding:"utf-8",timeout:U,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().replace(/\r\n/g,`
35
+ `).trim()}catch{return null}}function iw($){let U=W4(["run","list","--limit","1","--commit",$,"--json","databaseId,status,conclusion,displayTitle,headSha,url"],1e4);if(!U)return null;try{return JSON.parse(U)[0]??null}catch{return null}}function lw($,U){let b=Date.now(),r="",v=W4(["run","view",String($),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!v)return null;let z;try{z=JSON.parse(v)}catch{return null}while((z.status==="queued"||z.status==="in_progress"||z.status==="waiting"||z.status==="requested")&&Date.now()-b<U.maxWaitMs){let _=Date.now()+U.pollIntervalMs;while(Date.now()<_);let N=W4(["run","view",String($),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!N)return null;try{z=JSON.parse(N)}catch{return null}}return z}function ow($,U){let b=W4(["workflow","run",$,"--ref",U],15000);return null}function dw($,U=4000){let b=W4(["run","view",String($),"--log-failed"],30000);if(!b)return"";if(b.length<=U)return b;return b.slice(0,U)+`
36
36
 
37
- … (${n.length-r} chars truncated) …`}var Jb;var Wp=Ge(()=>{Jb={enabled:!0,workflow:"CI",pollIntervalMs:15000,maxWaitMs:600000,failOnly:!0}});Rr();Tr();import{randomUUID as Nw,createHash as Qb}from"node:crypto";import{fileURLToPath as e_}from"node:url";ot();import{existsSync as Vf,readFileSync as Wf,writeFileSync as Bf,mkdirSync as Hf}from"node:fs";import{dirname as Jf}from"node:path";function qf(e){if(!Vf(e))return null;try{return JSON.parse(Wf(e,"utf8"))}catch{return null}}function Kf(e,r){try{Hf(Jf(e),{recursive:!0}),Bf(e,JSON.stringify(r,null,2),"utf8")}catch{}}async function Lu(e={}){let r={enabled:e.enabled??!0,autoInstall:e.autoInstall??!0,autoUpgrade:e.autoUpgrade??!0,cachePath:e.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:e.upgradeCheckTtlMs??86400000,projectDir:e.projectDir,runner:e.runner,installScope:e.installScope??"global",cliHubBin:e.cliHubBin,skillsBin:e.skillsBin,installTimeoutMs:e.installTimeoutMs??60000};if(!r.enabled)return{attempted:!1,codes:["cli-anything-upgrade-skipped"],availability:{cliHub:!1,cliHubVersion:null,metaSkill:!1},alreadyInitialized:!0};let n=[],o=r.runner??((s,c)=>{let{execSync:l}=we("node:child_process");return l(s,{timeout:c?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}),t=Tt(o),i=Oo(r.installScope,o,1e4,r.skillsBin),a={cliHub:t!==null,cliHubVersion:t,metaSkill:i};if(t===null&&r.autoInstall){let s=wo(o,r.installTimeoutMs);if(n.push(s.code),s.ok){let c=Tt(o);a.cliHub=!0,a.cliHubVersion=c}}else if(t!==null)n.push("cli-anything-already-installed");if(!i&&r.autoInstall){let s=Io(r.installScope,o,r.installTimeoutMs,r.skillsBin);if(n.push(s.code),s.ok)a.metaSkill=!0}else if(i)n.push("skill-already-current");if(r.autoUpgrade){let s=qf(r.cachePath),c=Date.now(),l=!0;if(s?.updatedAtISO){let v=Date.parse(s.updatedAtISO);if(Number.isFinite(v)&&c-v<r.upgradeCheckTtlMs)l=!1}let d=s?.cliHubLatestVersion??null;if(l)d=$o(o),Kf(r.cachePath,{cliHubLatestVersion:d,metaSkillLastCheckedISO:new Date(c).toISOString(),updatedAtISO:new Date(c).toISOString()});if(a.cliHub&&d!==null&&a.cliHubVersion!==null&&xo(d,a.cliHubVersion)>0){let v=So(o,r.installTimeoutMs);if(n.push(v.code),v.ok){let h=Tt(o);a.cliHubVersion=h}}else if(a.cliHub&&a.cliHubVersion);if(a.metaSkill){let v=To(r.installScope,o,r.installTimeoutMs,r.skillsBin);if(v.ok||/no update/i.test(v.stderr)){if(!n.includes("skill-already-current"))n.push(v.ok?"skill-upgrade-succeeded":"skill-already-current")}else n.push(v.code)}}return{attempted:!0,codes:n,availability:a,alreadyInitialized:!1}}var Zu={limits:{maxLessons:10,maxSlots:20,maxTasks:10},timeouts:{agentmemoryMs:2000,boulderStateMs:1000}};async function Wu(e,r){let n=performance.now(),o={...Zu.limits,...e.limits},t={...Zu.timeouts,...e.timeouts},[i,a]=await Promise.allSettled([Xf(e,r.agentmemory,o,t.agentmemoryMs),Yf(e,r.boulderState,o,t.boulderStateMs)]),s=[],c={},l=i.status==="fulfilled"?i.value:(Gu(s,c,"agentmemory",Fu(i.reason)),Vu.agentmemory),d=a.status==="fulfilled"?a.value:(Gu(s,c,"boulderState",Fu(a.reason)),Vu.boulderState);return{query:e.query,timestampISO:new Date().toISOString(),agentmemory:l,boulderState:d,degradedSources:s,durationMs:performance.now()-n,errorMessages:c}}async function Xf(e,r,n,o){let t=await Bu(r.smartSearch({query:e.query,limit:n.maxLessons}),o,"agentmemory");return{available:!0,lessons:Qf(t.lessons).slice(0,n.maxLessons).map((a)=>({id:a.id,title:a.title,advice:a.advice??"info",confidence:a.confidence,concepts:a.concepts}))}}async function Yf(e,r,n,o){let t=await Bu(r.boulderRead({directory:e.directory,sessionID:e.sessionID,query:e.query}),o,"boulderState");return{available:!0,tasks:t.sort((a,s)=>a.priority-s.priority||s.updatedAtMs-a.updatedAtMs).slice(0,n.maxTasks).map((a)=>({id:a.id,status:a.status,title:a.title})),planProgress:eg(t)}}function Qf(e){return[...e].sort((r,n)=>n.confidence-r.confidence)}function eg(e){if(e.length===0)return 0;return e.filter((n)=>n.status==="done").length/e.length}function Fu(e){if(e instanceof Error)return e.message;if(typeof e==="string")return e;return"unknown error"}function Gu(e,r,n,o){e.push(n),r[n]=o}var Vu={agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0}};async function Bu(e,r,n){return new Promise((o,t)=>{let i=setTimeout(()=>t(Error(`${n} timeout after ${r}ms`)),r);e.then((a)=>{clearTimeout(i),o(a)},(a)=>{clearTimeout(i),t(a)})})}function H_(){return{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}}function tg(e){if(e.length===0)return 0;return e.reduce((n,o)=>n+o,0)/e.length}function rg(e,r){let n=0;for(let o=e.length-1;o>=0;o--)if(e[o]>=r)n++;else break;return n}function ng(e,r,n,o){let t=r-e;if(t<=0)return o;if(n<=0)return null;let i=Math.floor(t/n);if(i<=0)return o;let a=i*2;return new Date(new Date(o).getTime()+a*1000).toISOString()}function Hu(e){let{currentUsage:r,modelLimit:n,recentTurnTokens:o,timestampISO:t,config:i}=e,a=o.slice(-i.windowSize),s=tg(a),c=n-r,l=n>0?r/n:1,d=Math.min(0.95,0.3+a.length/i.windowSize*0.65),v="no-action",h=[],u="within normal parameters";if(l>=i.switchModelUsageThreshold)u=`context usage ${(l*100).toFixed(1)}% exceeds switch threshold ${(i.switchModelUsageThreshold*100).toFixed(1)}%`,h.push("switch-model");if(l>=i.compactUsageThreshold||s>=i.compactBurnRateThreshold){if(v==="no-action")v="compact-now",u=l>=i.compactUsageThreshold?`context usage ${(l*100).toFixed(1)}% exceeds compact threshold ${(i.compactUsageThreshold*100).toFixed(1)}%`:`burn rate ${s.toFixed(0)} tokens/turn exceeds threshold ${i.compactBurnRateThreshold}`}let y=rg(a,i.compactBurnRateThreshold);if(y>=i.delegateConsecutiveHighBurn&&v==="no-action")u=`${y} consecutive high-burn turns (threshold: ${i.delegateConsecutiveHighBurn})`,h.push("delegate-to-subagent");let x=ng(r,n,s,t);return{currentUsage:r,burnRate:s,budgetLeft:c,willOverflowAt:x,recommendation:v,recommendations:h,confidence:d,modelLimit:n,windowRemaining:Math.max(0,Math.floor(c/Math.max(s,1))),input:{...e},computedAtISO:t,turnsAnalyzed:a.length}}var Se={"oracle-verified":0.25,"no-progress-detector":0.2,"deviation-detector":0.2,"iteration-budget":0.15,"lesson-recall":0.1,"token-predictor":0.1},Do=()=>({continueThreshold:0.3,warnThreshold:0.3,escalateThreshold:0.45,stopThreshold:0.55,paralysisThreshold:3,defaultEscalationTarget:"oracle"});function og(e,r){let n=[];n.push({source:"oracle-verified",rawScore:e.oracleVerified?0.6:0,weight:Se["oracle-verified"],weightedScore:e.oracleVerified?0.6*Se["oracle-verified"]:0,description:e.oracleVerified?"Oracle verification passed":"No Oracle verification"}),n.push({source:"no-progress-detector",rawScore:e.noProgress?-0.8:0,weight:Se["no-progress-detector"],weightedScore:e.noProgress?-0.8*Se["no-progress-detector"]:0,description:e.noProgress?"No progress detected in last turn":"Progress detected"});let o=ig(e.deviations,r),t=60000,i=e.deviations.filter((c)=>c.ts===void 0||r-c.ts<=t);n.push({source:"deviation-detector",rawScore:o,weight:Se["deviation-detector"],weightedScore:o*Se["deviation-detector"],description:i.length>0?`${i.length} deviation(s) detected (worst: ${i[0].severity})`:"No deviations detected"});let a=ag(e.iterationRatio);n.push({source:"iteration-budget",rawScore:a,weight:Se["iteration-budget"],weightedScore:a*Se["iteration-budget"],description:`Iteration ratio: ${e.iterationRatio.toFixed(2)} (${e.ambient.iteration}/${e.ambient.maxIterations})`});let s=sg(e.lessonsRelevant);return n.push({source:"lesson-recall",rawScore:s,weight:Se["lesson-recall"],weightedScore:s*Se["lesson-recall"],description:e.lessonsRelevant.length>0?`${e.lessonsRelevant.length} relevant lesson(s) (avg confidence: ${cg(e.lessonsRelevant).toFixed(2)})`:"No relevant lessons"}),n}function ig(e,r=Date.now()){let o=e.filter((s)=>s.ts===void 0||r-s.ts<=60000);if(o.length===0)return 0;let t={grave:-0.9,media:-0.5,leve:-0.2},i=0;for(let s of o){let c=t[s.severity]??-0.3;if(c<i)i=c}let a=Math.min(o.length*0.05,0.2);return Math.max(i-a,-1)}function ag(e){if(e<=0.5)return-e*0.6;return-0.3-(e-0.5)*1}function sg(e){if(e.length===0)return 0;let r=0;for(let n of e)r+=({continue:0.3,info:0,warn:-0.3,stop:-0.7}[n.advice]??0)*n.confidence;return Math.max(Math.min(r/e.length,1),-1)}function cg(e){if(e.length===0)return 0;return e.reduce((r,n)=>r+n.confidence,0)/e.length}function lg(e,r){if(e>=r.continueThreshold)return"continue";if(e<=-r.stopThreshold)return"stop";if(e<=-r.escalateThreshold)return"escalate";if(e<=-r.warnThreshold)return"warn";return"continue"}function ug(e,r){if(!e.oracleVerified)return"oracle";if(e.deviations.some((n)=>n.severity==="grave"))return"user";return r.defaultEscalationTarget}function Ju(e,r,n,o){if(o)return`Paralysis detected: forced continue despite score ${e.toFixed(3)} (too many consecutive stops)`;let t=[...n].sort((l,d)=>l.weightedScore-d.weightedScore),i=t[0],a=t[t.length-1],s=[];if(i.weightedScore<0)s.push(`primary concern: ${i.description}`);if(a.weightedScore>0)s.push(`positive signal: ${a.description}`);return`${{continue:"Continue",warn:"Warn",escalate:"Escalate",stop:"Stop"}[r]} (score: ${e.toFixed(3)}): ${s.join("; ")||"balanced signals"}`}function qu(e,r,n=Date.now()){let o={...Do(),...r},t=e.deviations.map((u)=>({...u}));if(!Number.isFinite(e.iterationRatio)||!Number.isFinite(e.ambient.iteration)||!Number.isFinite(e.ambient.maxIterations))return{decision:{action:"continue",score:0,reasoning:"Score neutral: NaN detected in input(s); defaulting to continue.",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()};let i=og(e,n),a=i.reduce((u,y)=>u+y.weightedScore,0),s=Math.max(Math.min(a,1),-1),c=e.slotMemory.consecutiveStops>=o.paralysisThreshold&&s<=-o.warnThreshold,l=c?"continue":lg(s,o),d=[];if(l!=="continue"||Math.abs(s)<o.continueThreshold){for(let u of i)if(Math.abs(u.weightedScore)>0.01)d.push({source:u.source,value:u.description,confidence:Math.abs(u.rawScore),weight:u.weight});if(d.length===0&&l!=="continue")d.push({source:"ambient",value:Ju(s,l,i,c),confidence:0.5,weight:0.1})}let v=l==="escalate"?ug(e,o):null;return{decision:{action:l,score:s,reasoning:Ju(s,l,i,c),evidence:d,shouldEscalateTo:v},contributions:i,rawScore:s,paralysisOverride:c,computedAtISO:new Date().toISOString()}}var Po=()=>({enabled:!0,maxHistoryPerSession:50,forceContinueAfterStops:3,warnMessageTemplate:"[MetaGovernor] Score {score}: {reasoning}. Evidence: {evidenceCount} signal(s).",escalateMessageTemplate:"[MetaGovernor] Escalating to {target}: {reasoning}",stopMessageTemplate:"[MetaGovernor] STOP — {reasoning}. Evidence: {evidenceCount} signal(s)."});function Nr(e,r){let n=e;for(let[o,t]of Object.entries(r))n=n.replaceAll(`{${o}}`,t);return n}function dg(e){return e.length}function Ku(e,r){let n={...Po(),...r};if(!n.enabled)return{action:"continue",message:null,historyEntry:{decision:e.scoringResult.decision,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:"Decision handler disabled — pass-through continue"}};let o=e.scoringResult.decision,t=o.score,i=o.reasoning,a=dg(o.evidence),s=o.shouldEscalateTo??n.defaultEscalationTarget??"oracle";if(e.scoringResult.paralysisOverride)return{action:"continue",message:Nr(n.warnMessageTemplate,{score:t.toFixed(3),reasoning:`Paralysis detected — forced continue. ${i}`,evidenceCount:String(a)}),historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Paralysis override: ${i}`}};switch(o.action){case"continue":return{action:"continue",message:null,historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"warn":return{action:"warn",message:Nr(n.warnMessageTemplate,{score:t.toFixed(3),reasoning:i,evidenceCount:String(a)}),historyEntry:{decision:o,action:"warn",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"escalate":return{action:"escalate",message:Nr(n.escalateMessageTemplate,{target:s,reasoning:i}),historyEntry:{decision:o,action:"escalate",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Escalate to ${s}: ${i}`}};case"stop":return{action:"stop",message:Nr(n.stopMessageTemplate,{reasoning:i,evidenceCount:String(a)}),historyEntry:{decision:o,action:"stop",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}}}}function K_(e,r){if(e.length<=r)return{trimmed:[...e],dropped:0};let n=e.length-r;return{trimmed:e.slice(-r),dropped:n}}function X_(e){let r=0;for(let n=e.length-1;n>=0;n--)if(e[n].action==="stop")r++;else break;return r}var Xu={leve:0,media:1,grave:2};function mg(e,r,n){let o=`${e}-${r}-${n}`.split("").reduce((t,i)=>(t<<5)-t+i.charCodeAt(0)|0,0);return`D-${Math.abs(o).toString(36)}`}function Yu(e,r){let n=Xu[r]??0;return e.some((o)=>(Xu[o.severity]??0)>=n)}function pg(e,r=[]){let n=new Set;for(let o of e)if(n.add(o.category),n.add(o.severity),o.filePath){let t=o.filePath.split("/").pop()??o.filePath;n.add(t)}for(let o of r){let t=o.split("/").pop()??o;if(t)n.add(t)}return[...n]}function fg(e,r){let n=r.map((o)=>`[${o.severity}] ${o.category}: ${o.detail}`).join("; ");return`Action "${e.action}" (score ${e.score.toFixed(2)}) after deviations: ${n}. Reasoning: ${e.reasoning}`}async function Qu(e,r){let{decision:n,config:o,sessionID:t,directory:i,filesChanged:a}=e,s=new Date().toISOString();if(!o.enabled)return{lessonSaved:null,decisionSaved:null,reason:"closed-loop learning disabled"};if(n.evidence.length===0&&n.action==="continue")return{lessonSaved:null,decisionSaved:null,reason:"no deviations to learn from"};let c=null,l=null;if(o.saveDecisions){let y={id:mg(t,n.action,s),timestampISO:s,action:n.action,score:n.score,reasoning:n.reasoning,sessionID:t,directory:i,deviations:n.evidence.filter((x)=>x.source==="deviation-detector").map((x)=>({severity:"media",category:x.source,detail:x.value}))};try{await r.saveMemory({content:`Decision: ${n.action} (score ${n.score.toFixed(2)}). ${n.reasoning}`,concepts:["meta-governor","decision",n.action],type:"fact",files:[...a]}),l=y}catch{}}let d=n.evidence.filter((y)=>y.source==="deviation-detector").map((y)=>({severity:"media",category:y.source,detail:y.value})),v=e.currentLessonCount??0;if(v>=o.maxLessonsPerSession)return{lessonSaved:null,decisionSaved:l,reason:`maxLessonsPerSession cap reached (${v} >= ${o.maxLessonsPerSession})`};let h=o.saveLessons!==!1;if(h&&Yu(d,o.minSeverityToLearn)){let y=pg(d,a),x=fg(n,d);try{c={id:(await r.saveLesson({content:x,context:`session:${t} dir:${i}`,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),tags:y})).id,title:`${n.action} after ${d[0]?.category??"deviation"}`,content:x,type:"pattern",concepts:y,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),files:[...a],sessionID:t}}catch{}}let u=[];if(l)u.push("decision saved");if(c)u.push("lesson saved");if(!l&&!c)if(!h)u.push("saveLessons disabled");else if(!Yu(d,o.minSeverityToLearn))u.push("severity below threshold");else u.push("no saveable content");return{lessonSaved:c,decisionSaved:l,reason:u.join("; ")||"no action taken"}}function Ur(){return{enabled:!0,minSeverityToLearn:"media",maxLessonsPerSession:20,saveDecisions:!0,saveLessons:!0}}var gg=()=>({enabled:!0,memory:{enabled:!0,query:"",timeoutMs:3000},tokenPredictor:{},scoring:{},decision:{},closedLoop:{},intervention:{mode:"silent",includeDecisionHistory:!0,maxHistoryMessages:5,minActionForMessage:"stop",maxInterventionsPerSession:3,respectDoneSignal:!0,phaseAwareDoneSignal:!1,persistToSession:!0},protocolEnforcement:{enabled:!1,path:void 0,injectIntoSystem:!1,auditToolCalls:!1},skillPriming:{enabled:!1,trigger:"firstImplement",router:"both"},graphSync:{killOrphanedOnInit:!0,reindexOnFetch:!0,fetchBranch:"main",autoUpgrade:!0,upgradeCachePath:void 0,checkGraphifyNeedsUpdate:!0,addToGlobalGraph:!1},graphRetrieval:{preferredTool:"auto",preferLocalCodegraph:!1,contextRouting:!1},cliAnything:{enabled:!0,autoInstall:!0,autoUpgrade:!0,cachePath:void 0,upgradeCheckTtlMs:void 0,cliHubBin:"cli-hub",skillsBin:"npx skills",installScope:"global"}}),zo={query:"",timestampISO:new Date().toISOString(),agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0},degradedSources:["agentmemory","boulderState"]},hg={consecutiveStops:0,consecutiveContinues:0,lastUpdatedISO:new Date().toISOString()},vg={action:"continue",message:null,historyEntry:{decision:{action:"continue",score:0,reasoning:"no decision made",evidence:[],shouldEscalateTo:null},action:"continue",timestampISO:new Date().toISOString(),sessionID:"",reasoning:"no decision made"}};function yg(e,r=zo){let n=e.maxIterations>0?e.iteration/e.maxIterations:0,o={...hg,consecutiveStops:e.consecutiveStops??0};return{oracleVerified:e.oracleVerified,noProgress:e.noProgress,deviations:e.deviations,iterationRatio:n,lessonsRelevant:r.agentmemory.lessons,slotMemory:o,ambient:{sessionID:e.sessionID,directory:".",mode:"simple",agentName:e.agentName??"unknown",iteration:e.iteration,maxIterations:e.maxIterations}}}async function td(e,r={}){let n={...gg(),...r};if(!n.enabled)return{memoryRead:zo,tokenPrediction:ed(e),scoringResult:{decision:{action:"continue",score:0,reasoning:"MetaGovernor disabled",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()},decision:vg,lessonSaved:null,decisionHistory:[],skipped:!0,skipReason:"disabled"};let o=zo;if(n.memory.enabled)try{let l={agentmemory:e.backends.agentmemory,boulderState:e.backends.boulderState};o=await Wu({directory:".",sessionID:e.sessionID,query:n.memory.query||e.toolName},l)}catch{}let t;try{t=Hu({currentUsage:e.recentTurnTokens.reduce((l,d)=>l+d,0),modelLimit:e.modelLimit??r.modelOverride?.modelLimit??200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:n.tokenPredictor})}catch{t=ed(e)}let i=qu(yg(e,o),n.scoring),a={sessionID:e.sessionID,scoringResult:i},s=Ku(a,n.decision),c=null;try{if(n.closedLoop.enabled!==!1)c=await Qu({decision:s.historyEntry.decision,memoryRead:o,config:{...Ur(),...n.closedLoop},sessionID:e.sessionID,directory:".",filesChanged:e.filePaths??[],currentLessonCount:e.currentLessonCount},e.writeBackend)}catch{}return{memoryRead:o,tokenPrediction:t,scoringResult:i,decision:s,lessonSaved:c,decisionHistory:[s.historyEntry],skipped:!1}}function ed(e){let r=e.recentTurnTokens.reduce((n,o)=>n+o,0);return{burnRate:0,budgetLeft:200000,currentUsage:r,modelLimit:200000,willOverflowAt:null,recommendation:"no-action",confidence:1,windowRemaining:200000,input:{currentUsage:r,modelLimit:200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}},computedAtISO:new Date().toISOString(),turnsAnalyzed:e.recentTurnTokens.length,recommendations:[]}}import{Database as bg}from"bun:sqlite";import{existsSync as _g,mkdirSync as kg}from"node:fs";import{join as rd}from"node:path";import{homedir as $g}from"node:os";function xg(){let e=rd($g(),".omo-meta-governor");if(!_g(e))kg(e,{recursive:!0});return rd(e,"meta-governor.db")}var nd="1",wg=`
37
+ … (${b.length-U} chars truncated) …`}var nw;var yk=y$(()=>{nw={enabled:!0,workflow:"CI",pollIntervalMs:15000,maxWaitMs:600000,failOnly:!0}});m4();H4();import{randomUUID as gW,createHash as pw}from"node:crypto";import{fileURLToPath as tw}from"node:url";bv();import{existsSync as uI,readFileSync as hI,writeFileSync as yI,mkdirSync as fI}from"node:fs";import{dirname as nI}from"node:path";function iI($){if(!uI($))return null;try{return JSON.parse(hI($,"utf8"))}catch{return null}}function lI($,U){try{fI(nI($),{recursive:!0}),yI($,JSON.stringify(U,null,2),"utf8")}catch{}}async function TN($={}){let U={enabled:$.enabled??!0,autoInstall:$.autoInstall??!0,autoUpgrade:$.autoUpgrade??!0,cachePath:$.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:$.upgradeCheckTtlMs??86400000,projectDir:$.projectDir,runner:$.runner,installScope:$.installScope??"global",cliHubBin:$.cliHubBin,skillsBin:$.skillsBin,installTimeoutMs:$.installTimeoutMs??60000};if(!U.enabled)return{attempted:!1,codes:["cli-anything-upgrade-skipped"],availability:{cliHub:!1,cliHubVersion:null,metaSkill:!1},alreadyInitialized:!0};let b=[],r=U.runner??((N,O)=>{let{execSync:k}=L$("node:child_process");return k(N,{timeout:O?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}),v=Hv(r),z=GU(U.installScope,r,1e4,U.skillsBin),_={cliHub:v!==null,cliHubVersion:v,metaSkill:z};if(v===null&&U.autoInstall){let N=qU(r,U.installTimeoutMs);if(b.push(N.code),N.ok){let O=Hv(r);_.cliHub=!0,_.cliHubVersion=O}}else if(v!==null)b.push("cli-anything-already-installed");if(!z&&U.autoInstall){let N=LU(U.installScope,r,U.installTimeoutMs,U.skillsBin);if(b.push(N.code),N.ok)_.metaSkill=!0}else if(z)b.push("skill-already-current");if(U.autoUpgrade){let N=iI(U.cachePath),O=Date.now(),k=!0;if(N?.updatedAtISO){let W=Date.parse(N.updatedAtISO);if(Number.isFinite(W)&&O-W<U.upgradeCheckTtlMs)k=!1}let J=N?.cliHubLatestVersion??null;if(k)J=VU(r),lI(U.cachePath,{cliHubLatestVersion:J,metaSkillLastCheckedISO:new Date(O).toISOString(),updatedAtISO:new Date(O).toISOString()});if(_.cliHub&&J!==null&&_.cliHubVersion!==null&&PU(J,_.cliHubVersion)>0){let W=BU(r,U.installTimeoutMs);if(b.push(W.code),W.ok){let Y=Hv(r);_.cliHubVersion=Y}}else if(_.cliHub&&_.cliHubVersion);if(_.metaSkill){let W=AU(U.installScope,r,U.installTimeoutMs,U.skillsBin);if(W.ok||/no update/i.test(W.stderr)){if(!b.includes("skill-already-current"))b.push(W.ok?"skill-upgrade-succeeded":"skill-already-current")}else b.push(W.code)}}return{attempted:!0,codes:b,availability:_,alreadyInitialized:!1}}var CN={limits:{maxLessons:10,maxSlots:20,maxTasks:10},timeouts:{agentmemoryMs:2000,boulderStateMs:1000}};async function yN($,U){let b=performance.now(),r={...CN.limits,...$.limits},v={...CN.timeouts,...$.timeouts},[z,_]=await Promise.allSettled([oI($,U.agentmemory,r,v.agentmemoryMs),dI($,U.boulderState,r,v.boulderStateMs)]),N=[],O={},k=z.status==="fulfilled"?z.value:(uN(N,O,"agentmemory",cN(z.reason)),hN.agentmemory),J=_.status==="fulfilled"?_.value:(uN(N,O,"boulderState",cN(_.reason)),hN.boulderState);return{query:$.query,timestampISO:new Date().toISOString(),agentmemory:k,boulderState:J,degradedSources:N,durationMs:performance.now()-b,errorMessages:O}}async function oI($,U,b,r){let v=await fN(U.smartSearch({query:$.query,limit:b.maxLessons}),r,"agentmemory");return{available:!0,lessons:pI(v.lessons).slice(0,b.maxLessons).map((_)=>({id:_.id,title:_.title,advice:_.advice??"info",confidence:_.confidence,concepts:_.concepts}))}}async function dI($,U,b,r){let v=await fN(U.boulderRead({directory:$.directory,sessionID:$.sessionID,query:$.query}),r,"boulderState");return{available:!0,tasks:v.sort((_,N)=>_.priority-N.priority||N.updatedAtMs-_.updatedAtMs).slice(0,b.maxTasks).map((_)=>({id:_.id,status:_.status,title:_.title})),planProgress:tI(v)}}function pI($){return[...$].sort((U,b)=>b.confidence-U.confidence)}function tI($){if($.length===0)return 0;return $.filter((b)=>b.status==="done").length/$.length}function cN($){if($ instanceof Error)return $.message;if(typeof $==="string")return $;return"unknown error"}function uN($,U,b,r){$.push(b),U[b]=r}var hN={agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0}};async function fN($,U,b){return new Promise((r,v)=>{let z=setTimeout(()=>v(Error(`${b} timeout after ${U}ms`)),U);$.then((_)=>{clearTimeout(z),r(_)},(_)=>{clearTimeout(z),v(_)})})}function f9(){return{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}}function eI($){if($.length===0)return 0;return $.reduce((b,r)=>b+r,0)/$.length}function aI($,U){let b=0;for(let r=$.length-1;r>=0;r--)if($[r]>=U)b++;else break;return b}function sI($,U,b,r){let v=U-$;if(v<=0)return r;if(b<=0)return null;let z=Math.floor(v/b);if(z<=0)return r;let _=z*2;return new Date(new Date(r).getTime()+_*1000).toISOString()}function nN($){let{currentUsage:U,modelLimit:b,recentTurnTokens:r,timestampISO:v,config:z}=$,_=r.slice(-z.windowSize),N=eI(_),O=b-U,k=b>0?U/b:1,J=Math.min(0.95,0.3+_.length/z.windowSize*0.65),W="no-action",Y=[],I="within normal parameters";if(k>=z.switchModelUsageThreshold)I=`context usage ${(k*100).toFixed(1)}% exceeds switch threshold ${(z.switchModelUsageThreshold*100).toFixed(1)}%`,Y.push("switch-model");if(k>=z.compactUsageThreshold||N>=z.compactBurnRateThreshold){if(W==="no-action")W="compact-now",I=k>=z.compactUsageThreshold?`context usage ${(k*100).toFixed(1)}% exceeds compact threshold ${(z.compactUsageThreshold*100).toFixed(1)}%`:`burn rate ${N.toFixed(0)} tokens/turn exceeds threshold ${z.compactBurnRateThreshold}`}let j=aI(_,z.compactBurnRateThreshold);if(j>=z.delegateConsecutiveHighBurn&&W==="no-action")I=`${j} consecutive high-burn turns (threshold: ${z.delegateConsecutiveHighBurn})`,Y.push("delegate-to-subagent");let B=sI(U,b,N,v);return{currentUsage:U,burnRate:N,budgetLeft:O,willOverflowAt:B,recommendation:W,recommendations:Y,confidence:J,modelLimit:b,windowRemaining:Math.max(0,Math.floor(O/Math.max(N,1))),input:{...$},computedAtISO:v,turnsAnalyzed:_.length}}var A$={"oracle-verified":0.25,"no-progress-detector":0.2,"deviation-detector":0.2,"iteration-budget":0.15,"lesson-recall":0.1,"token-predictor":0.1},HU=()=>({continueThreshold:0.3,warnThreshold:0.3,escalateThreshold:0.45,stopThreshold:0.55,paralysisThreshold:3,defaultEscalationTarget:"oracle"});function $J($,U){let b=[];b.push({source:"oracle-verified",rawScore:$.oracleVerified?0.6:0,weight:A$["oracle-verified"],weightedScore:$.oracleVerified?0.6*A$["oracle-verified"]:0,description:$.oracleVerified?"Oracle verification passed":"No Oracle verification"}),b.push({source:"no-progress-detector",rawScore:$.noProgress?-0.8:0,weight:A$["no-progress-detector"],weightedScore:$.noProgress?-0.8*A$["no-progress-detector"]:0,description:$.noProgress?"No progress detected in last turn":"Progress detected"});let r=vJ($.deviations,U),v=60000,z=$.deviations.filter((O)=>O.ts===void 0||U-O.ts<=v);b.push({source:"deviation-detector",rawScore:r,weight:A$["deviation-detector"],weightedScore:r*A$["deviation-detector"],description:z.length>0?`${z.length} deviation(s) detected (worst: ${z[0].severity})`:"No deviations detected"});let _=UJ($.iterationRatio);b.push({source:"iteration-budget",rawScore:_,weight:A$["iteration-budget"],weightedScore:_*A$["iteration-budget"],description:`Iteration ratio: ${$.iterationRatio.toFixed(2)} (${$.ambient.iteration}/${$.ambient.maxIterations})`});let N=bJ($.lessonsRelevant);return b.push({source:"lesson-recall",rawScore:N,weight:A$["lesson-recall"],weightedScore:N*A$["lesson-recall"],description:$.lessonsRelevant.length>0?`${$.lessonsRelevant.length} relevant lesson(s) (avg confidence: ${rJ($.lessonsRelevant).toFixed(2)})`:"No relevant lessons"}),b}function vJ($,U=Date.now()){let r=$.filter((N)=>N.ts===void 0||U-N.ts<=60000);if(r.length===0)return 0;let v={grave:-0.9,media:-0.5,leve:-0.2},z=0;for(let N of r){let O=v[N.severity]??-0.3;if(O<z)z=O}let _=Math.min(r.length*0.05,0.2);return Math.max(z-_,-1)}function UJ($){if($<=0.5)return-$*0.6;return-0.3-($-0.5)*1}function bJ($){if($.length===0)return 0;let U=0;for(let b of $)U+=({continue:0.3,info:0,warn:-0.3,stop:-0.7}[b.advice]??0)*b.confidence;return Math.max(Math.min(U/$.length,1),-1)}function rJ($){if($.length===0)return 0;return $.reduce((U,b)=>U+b.confidence,0)/$.length}function zJ($,U){if($>=U.continueThreshold)return"continue";if($<=-U.stopThreshold)return"stop";if($<=-U.escalateThreshold)return"escalate";if($<=-U.warnThreshold)return"warn";return"continue"}function _J($,U){if(!$.oracleVerified)return"oracle";if($.deviations.some((b)=>b.severity==="grave"))return"user";return U.defaultEscalationTarget}function iN($,U,b,r){if(r)return`Paralysis detected: forced continue despite score ${$.toFixed(3)} (too many consecutive stops)`;let v=[...b].sort((k,J)=>k.weightedScore-J.weightedScore),z=v[0],_=v[v.length-1],N=[];if(z.weightedScore<0)N.push(`primary concern: ${z.description}`);if(_.weightedScore>0)N.push(`positive signal: ${_.description}`);return`${{continue:"Continue",warn:"Warn",escalate:"Escalate",stop:"Stop"}[U]} (score: ${$.toFixed(3)}): ${N.join("; ")||"balanced signals"}`}function lN($,U,b=Date.now()){let r={...HU(),...U},v=$.deviations.map((I)=>({...I}));if(!Number.isFinite($.iterationRatio)||!Number.isFinite($.ambient.iteration)||!Number.isFinite($.ambient.maxIterations))return{decision:{action:"continue",score:0,reasoning:"Score neutral: NaN detected in input(s); defaulting to continue.",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()};let z=$J($,b),_=z.reduce((I,j)=>I+j.weightedScore,0),N=Math.max(Math.min(_,1),-1),O=$.slotMemory.consecutiveStops>=r.paralysisThreshold&&N<=-r.warnThreshold,k=O?"continue":zJ(N,r),J=[];if(k!=="continue"||Math.abs(N)<r.continueThreshold){for(let I of z)if(Math.abs(I.weightedScore)>0.01)J.push({source:I.source,value:I.description,confidence:Math.abs(I.rawScore),weight:I.weight});if(J.length===0&&k!=="continue")J.push({source:"ambient",value:iN(N,k,z,O),confidence:0.5,weight:0.1})}let W=k==="escalate"?_J($,r):null;return{decision:{action:k,score:N,reasoning:iN(N,k,z,O),evidence:J,shouldEscalateTo:W},contributions:z,rawScore:N,paralysisOverride:O,computedAtISO:new Date().toISOString()}}var EU=()=>({enabled:!0,maxHistoryPerSession:50,forceContinueAfterStops:3,warnMessageTemplate:"[MetaGovernor] Score {score}: {reasoning}. Evidence: {evidenceCount} signal(s).",escalateMessageTemplate:"[MetaGovernor] Escalating to {target}: {reasoning}",stopMessageTemplate:"[MetaGovernor] STOP — {reasoning}. Evidence: {evidenceCount} signal(s)."});function T4($,U){let b=$;for(let[r,v]of Object.entries(U))b=b.replaceAll(`{${r}}`,v);return b}function NJ($){return $.length}function oN($,U){let b={...EU(),...U};if(!b.enabled)return{action:"continue",message:null,historyEntry:{decision:$.scoringResult.decision,action:"continue",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:"Decision handler disabled — pass-through continue"}};let r=$.scoringResult.decision,v=r.score,z=r.reasoning,_=NJ(r.evidence),N=r.shouldEscalateTo??b.defaultEscalationTarget??"oracle";if($.scoringResult.paralysisOverride)return{action:"continue",message:T4(b.warnMessageTemplate,{score:v.toFixed(3),reasoning:`Paralysis detected — forced continue. ${z}`,evidenceCount:String(_)}),historyEntry:{decision:r,action:"continue",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:`Paralysis override: ${z}`}};switch(r.action){case"continue":return{action:"continue",message:null,historyEntry:{decision:r,action:"continue",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:z}};case"warn":return{action:"warn",message:T4(b.warnMessageTemplate,{score:v.toFixed(3),reasoning:z,evidenceCount:String(_)}),historyEntry:{decision:r,action:"warn",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:z}};case"escalate":return{action:"escalate",message:T4(b.escalateMessageTemplate,{target:N,reasoning:z}),historyEntry:{decision:r,action:"escalate",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:`Escalate to ${N}: ${z}`}};case"stop":return{action:"stop",message:T4(b.stopMessageTemplate,{reasoning:z,evidenceCount:String(_)}),historyEntry:{decision:r,action:"stop",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:z}}}}function l9($,U){if($.length<=U)return{trimmed:[...$],dropped:0};let b=$.length-U;return{trimmed:$.slice(-U),dropped:b}}function o9($){let U=0;for(let b=$.length-1;b>=0;b--)if($[b].action==="stop")U++;else break;return U}var dN={leve:0,media:1,grave:2};function OJ($,U,b){let r=`${$}-${U}-${b}`.split("").reduce((v,z)=>(v<<5)-v+z.charCodeAt(0)|0,0);return`D-${Math.abs(r).toString(36)}`}function pN($,U){let b=dN[U]??0;return $.some((r)=>(dN[r.severity]??0)>=b)}function kJ($,U=[]){let b=new Set;for(let r of $)if(b.add(r.category),b.add(r.severity),r.filePath){let v=r.filePath.split("/").pop()??r.filePath;b.add(v)}for(let r of U){let v=r.split("/").pop()??r;if(v)b.add(v)}return[...b]}function IJ($,U){let b=U.map((r)=>`[${r.severity}] ${r.category}: ${r.detail}`).join("; ");return`Action "${$.action}" (score ${$.score.toFixed(2)}) after deviations: ${b}. Reasoning: ${$.reasoning}`}async function tN($,U){let{decision:b,config:r,sessionID:v,directory:z,filesChanged:_}=$,N=new Date().toISOString();if(!r.enabled)return{lessonSaved:null,decisionSaved:null,reason:"closed-loop learning disabled"};if(b.evidence.length===0&&b.action==="continue")return{lessonSaved:null,decisionSaved:null,reason:"no deviations to learn from"};let O=null,k=null;if(r.saveDecisions){let j={id:OJ(v,b.action,N),timestampISO:N,action:b.action,score:b.score,reasoning:b.reasoning,sessionID:v,directory:z,deviations:b.evidence.filter((B)=>B.source==="deviation-detector").map((B)=>({severity:"media",category:B.source,detail:B.value}))};try{await U.saveMemory({content:`Decision: ${b.action} (score ${b.score.toFixed(2)}). ${b.reasoning}`,concepts:["meta-governor","decision",b.action],type:"fact",files:[..._]}),k=j}catch{}}let J=b.evidence.filter((j)=>j.source==="deviation-detector").map((j)=>({severity:"media",category:j.source,detail:j.value})),W=$.currentLessonCount??0;if(W>=r.maxLessonsPerSession)return{lessonSaved:null,decisionSaved:k,reason:`maxLessonsPerSession cap reached (${W} >= ${r.maxLessonsPerSession})`};let Y=r.saveLessons!==!1;if(Y&&pN(J,r.minSeverityToLearn)){let j=kJ(J,_),B=IJ(b,J);try{O={id:(await U.saveLesson({content:B,context:`session:${v} dir:${z}`,confidence:Math.max(0.3,Math.min(0.8,Math.abs(b.score))),tags:j})).id,title:`${b.action} after ${J[0]?.category??"deviation"}`,content:B,type:"pattern",concepts:j,confidence:Math.max(0.3,Math.min(0.8,Math.abs(b.score))),files:[..._],sessionID:v}}catch{}}let I=[];if(k)I.push("decision saved");if(O)I.push("lesson saved");if(!k&&!O)if(!Y)I.push("saveLessons disabled");else if(!pN(J,r.minSeverityToLearn))I.push("severity below threshold");else I.push("no saveable content");return{lessonSaved:O,decisionSaved:k,reason:I.join("; ")||"no action taken"}}function C4(){return{enabled:!0,minSeverityToLearn:"media",maxLessonsPerSession:20,saveDecisions:!0,saveLessons:!0}}var JJ=()=>({enabled:!0,memory:{enabled:!0,query:"",timeoutMs:3000},tokenPredictor:{},scoring:{},decision:{},closedLoop:{},intervention:{mode:"silent",includeDecisionHistory:!0,maxHistoryMessages:5,minActionForMessage:"stop",maxInterventionsPerSession:3,respectDoneSignal:!0,phaseAwareDoneSignal:!1,persistToSession:!0},protocolEnforcement:{enabled:!1,path:void 0,injectIntoSystem:!1,auditToolCalls:!1},skillPriming:{enabled:!1,trigger:"firstImplement",router:"both"},graphSync:{killOrphanedOnInit:!0,reindexOnFetch:!0,fetchBranch:"main",autoUpgrade:!0,upgradeCachePath:void 0,checkGraphifyNeedsUpdate:!0,addToGlobalGraph:!1},graphRetrieval:{preferredTool:"auto",preferLocalCodegraph:!1,contextRouting:!1},cliAnything:{enabled:!0,autoInstall:!0,autoUpgrade:!0,cachePath:void 0,upgradeCheckTtlMs:void 0,cliHubBin:"cli-hub",skillsBin:"npx skills",installScope:"global"}}),SU={query:"",timestampISO:new Date().toISOString(),agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0},degradedSources:["agentmemory","boulderState"]},XJ={consecutiveStops:0,consecutiveContinues:0,lastUpdatedISO:new Date().toISOString()},KJ={action:"continue",message:null,historyEntry:{decision:{action:"continue",score:0,reasoning:"no decision made",evidence:[],shouldEscalateTo:null},action:"continue",timestampISO:new Date().toISOString(),sessionID:"",reasoning:"no decision made"}};function wJ($,U=SU){let b=$.maxIterations>0?$.iteration/$.maxIterations:0,r={...XJ,consecutiveStops:$.consecutiveStops??0};return{oracleVerified:$.oracleVerified,noProgress:$.noProgress,deviations:$.deviations,iterationRatio:b,lessonsRelevant:U.agentmemory.lessons,slotMemory:r,ambient:{sessionID:$.sessionID,directory:".",mode:"simple",agentName:$.agentName??"unknown",iteration:$.iteration,maxIterations:$.maxIterations}}}async function aN($,U={}){let b={...JJ(),...U};if(!b.enabled)return{memoryRead:SU,tokenPrediction:eN($),scoringResult:{decision:{action:"continue",score:0,reasoning:"MetaGovernor disabled",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()},decision:KJ,lessonSaved:null,decisionHistory:[],skipped:!0,skipReason:"disabled"};let r=SU;if(b.memory.enabled)try{let k={agentmemory:$.backends.agentmemory,boulderState:$.backends.boulderState};r=await yN({directory:".",sessionID:$.sessionID,query:b.memory.query||$.toolName},k)}catch{}let v;try{v=nN({currentUsage:$.recentTurnTokens.reduce((k,J)=>k+J,0),modelLimit:$.modelLimit??U.modelOverride?.modelLimit??200000,recentTurnTokens:$.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:$.providerID??"",modelID:$.modelID??"",config:b.tokenPredictor})}catch{v=eN($)}let z=lN(wJ($,r),b.scoring),_={sessionID:$.sessionID,scoringResult:z},N=oN(_,b.decision),O=null;try{if(b.closedLoop.enabled!==!1)O=await tN({decision:N.historyEntry.decision,memoryRead:r,config:{...C4(),...b.closedLoop},sessionID:$.sessionID,directory:".",filesChanged:$.filePaths??[],currentLessonCount:$.currentLessonCount},$.writeBackend)}catch{}return{memoryRead:r,tokenPrediction:v,scoringResult:z,decision:N,lessonSaved:O,decisionHistory:[N.historyEntry],skipped:!1}}function eN($){let U=$.recentTurnTokens.reduce((b,r)=>b+r,0);return{burnRate:0,budgetLeft:200000,currentUsage:U,modelLimit:200000,willOverflowAt:null,recommendation:"no-action",confidence:1,windowRemaining:200000,input:{currentUsage:U,modelLimit:200000,recentTurnTokens:$.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:$.providerID??"",modelID:$.modelID??"",config:{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}},computedAtISO:new Date().toISOString(),turnsAnalyzed:$.recentTurnTokens.length,recommendations:[]}}import{Database as QJ}from"bun:sqlite";import{existsSync as YJ,mkdirSync as WJ}from"node:fs";import{join as sN}from"node:path";import{homedir as jJ}from"node:os";function VJ(){let $=sN(jJ(),".omo-meta-governor");if(!YJ($))WJ($,{recursive:!0});return sN($,"meta-governor.db")}var $O="1",PJ=`
38
38
  CREATE TABLE IF NOT EXISTS _meta (
39
39
  key TEXT PRIMARY KEY,
40
40
  value TEXT NOT NULL
@@ -94,7 +94,7 @@ CREATE TABLE IF NOT EXISTS boulder_tasks (
94
94
  CREATE INDEX IF NOT EXISTS idx_entries_kind ON entries(kind);
95
95
  CREATE INDEX IF NOT EXISTS idx_entries_session ON entries(session_id, directory);
96
96
  CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, session_id);
97
- `;function od(e){let r=Date.now().toString(36),n=Math.floor(Math.random()*65535).toString(36);return`${e}-${r}-${n}`}class ad{db;stmts;constructor(e){let r=e??xg();this.db=new bg(r,{create:!0}),this.db.exec("PRAGMA journal_mode = WAL;"),this.db.exec("PRAGMA synchronous = NORMAL;"),this.db.exec("PRAGMA foreign_keys = ON;"),this.db.exec("PRAGMA busy_timeout = 5000;"),this.db.exec(wg);let n=this.db.query("SELECT value FROM _meta WHERE key = 'schema_version'").get();if(!n)this.db.query("INSERT INTO _meta (key, value) VALUES ('schema_version', ?)").run(nd);else if(n.value!==nd);this.stmts={insertEntry:this.db.prepare(`
97
+ `;function vO($){let U=Date.now().toString(36),b=Math.floor(Math.random()*65535).toString(36);return`${$}-${U}-${b}`}class bO{db;stmts;constructor($){let U=$??VJ();this.db=new QJ(U,{create:!0}),this.db.exec("PRAGMA journal_mode = WAL;"),this.db.exec("PRAGMA synchronous = NORMAL;"),this.db.exec("PRAGMA foreign_keys = ON;"),this.db.exec("PRAGMA busy_timeout = 5000;"),this.db.exec(PJ);let b=this.db.query("SELECT value FROM _meta WHERE key = 'schema_version'").get();if(!b)this.db.query("INSERT INTO _meta (key, value) VALUES ('schema_version', ?)").run($O);else if(b.value!==$O);this.stmts={insertEntry:this.db.prepare(`
98
98
  INSERT INTO entries (id, kind, title, content, context, advice, confidence, tags, files, session_id, directory, created_at)
99
99
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
100
100
  `),ftsSearch:this.db.prepare(`
@@ -109,116 +109,116 @@ CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, s
109
109
  FROM boulder_tasks
110
110
  WHERE directory = ? AND session_id = ?
111
111
  ORDER BY priority ASC, updated_at_ms DESC
112
- `)}}saveMemory(e){let r=od("M"),n=(e.concepts[0]??"memory").slice(0,80);return this.stmts.insertEntry.run(r,"memory",n,e.content,"",null,0.5,JSON.stringify(e.concepts),JSON.stringify(e.files??[]),"","",Date.now()),Promise.resolve({id:r})}saveLesson(e){let r=od("L"),n=e.confidence??0.5,o=(e.content.split(`
113
- `)[0]??"lesson").slice(0,80);return this.stmts.insertEntry.run(r,"lesson",o,e.content,e.context,null,n,JSON.stringify(e.tags??[]),JSON.stringify([]),"","",Date.now()),Promise.resolve({id:r})}smartSearch(e){let r=e.limit??10,n=this.toFtsQuery(e.query),t=this.stmts.ftsSearch.all(n,r).map((i)=>({id:i.id,title:i.title,content:i.content,type:i.kind,concepts:id(i.tags),confidence:i.confidence,files:id(i.files),advice:i.advice??"info"}));return Promise.resolve({lessons:t,crystals:[]})}boulderRead(e){let n=this.stmts.boulderSelect.all(e.directory,e.sessionID).map((o)=>({id:o.id,title:o.title,priority:o.priority,status:o.status,description:o.description,createdAtMs:o.created_at_ms,updatedAtMs:o.updated_at_ms}));if(e.query){let o=e.query.toLowerCase();n=n.filter((t)=>t.title.toLowerCase().includes(o)||t.description.toLowerCase().includes(o))}return Promise.resolve(n)}close(){this.db.close()}toFtsQuery(e){let r=e.trim().split(/\s+/).filter(Boolean).map((n)=>n.replace(/["()*]/g,"")).filter(Boolean);if(r.length===0)return'""';return r.map((n)=>`"${n}"*`).join(" ")}}function id(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[]}catch{return[]}}var Co=null;function Lr(){if(!Co)Co=new ad;return Co}var qn={};me(qn,{$brand:()=>jo,$input:()=>Us,$output:()=>Ns,NEVER:()=>Eo,TimePrecision:()=>Fs,ZodAny:()=>Hd,ZodArray:()=>Xd,ZodBase64:()=>il,ZodBase64URL:()=>al,ZodBigInt:()=>gr,ZodBigIntFormat:()=>ll,ZodBoolean:()=>fr,ZodCIDRv4:()=>nl,ZodCIDRv6:()=>ol,ZodCUID:()=>Kc,ZodCUID2:()=>Xc,ZodCatch:()=>hm,ZodCodec:()=>bl,ZodCustom:()=>Jn,ZodCustomStringFormat:()=>mr,ZodDate:()=>Wn,ZodDefault:()=>um,ZodDiscriminatedUnion:()=>Yd,ZodE164:()=>sl,ZodEmail:()=>Hc,ZodEmoji:()=>Jc,ZodEnum:()=>ur,ZodError:()=>Kv,ZodFile:()=>sm,ZodFirstPartyTypeKind:()=>_l,ZodFunction:()=>Sm,ZodGUID:()=>Ln,ZodIPv4:()=>tl,ZodIPv6:()=>rl,ZodISODate:()=>Mn,ZodISODateTime:()=>An,ZodISODuration:()=>Nn,ZodISOTime:()=>Rn,ZodIntersection:()=>Qd,ZodIssueCode:()=>sb,ZodJWT:()=>cl,ZodKSUID:()=>el,ZodLazy:()=>$m,ZodLiteral:()=>am,ZodMap:()=>om,ZodNaN:()=>ym,ZodNanoID:()=>qc,ZodNever:()=>qd,ZodNonOptional:()=>vl,ZodNull:()=>Wd,ZodNullable:()=>lm,ZodNumber:()=>pr,ZodNumberFormat:()=>yt,ZodObject:()=>Hn,ZodOptional:()=>hl,ZodPipe:()=>yl,ZodPrefault:()=>mm,ZodPromise:()=>wm,ZodReadonly:()=>bm,ZodRealError:()=>ue,ZodRecord:()=>pl,ZodSet:()=>im,ZodString:()=>dr,ZodStringFormat:()=>V,ZodSuccess:()=>gm,ZodSymbol:()=>Gd,ZodTemplateLiteral:()=>km,ZodTransform:()=>cm,ZodTuple:()=>tm,ZodType:()=>z,ZodULID:()=>Yc,ZodURL:()=>Vn,ZodUUID:()=>Ee,ZodUndefined:()=>Vd,ZodUnion:()=>dl,ZodUnknown:()=>Jd,ZodVoid:()=>Kd,ZodXID:()=>Qc,_ZodString:()=>Bc,_default:()=>dm,_function:()=>eb,any:()=>jy,array:()=>Bn,base64:()=>vy,base64url:()=>yy,bigint:()=>Dy,boolean:()=>Fd,catch:()=>vm,check:()=>tb,cidrv4:()=>gy,cidrv6:()=>hy,clone:()=>ie,codec:()=>Xy,coerce:()=>kl,config:()=>q,core:()=>Ce,cuid:()=>cy,cuid2:()=>ly,custom:()=>rb,date:()=>My,decode:()=>Rc,decodeAsync:()=>Uc,discriminatedUnion:()=>Zy,e164:()=>by,email:()=>Yv,emoji:()=>ay,encode:()=>Mc,encodeAsync:()=>Nc,endsWith:()=>or,enum:()=>fl,file:()=>Hy,flattenError:()=>Rt,float32:()=>Sy,float64:()=>Iy,formatError:()=>Nt,function:()=>eb,getErrorMap:()=>lb,globalRegistry:()=>Oe,gt:()=>Pe,gte:()=>le,guid:()=>Qv,hash:()=>wy,hex:()=>xy,hostname:()=>$y,httpUrl:()=>iy,includes:()=>rr,instanceof:()=>nb,int:()=>Wc,int32:()=>Ty,int64:()=>Py,intersection:()=>em,ipv4:()=>py,ipv6:()=>fy,iso:()=>Un,json:()=>ib,jwt:()=>_y,keyof:()=>Ry,ksuid:()=>my,lazy:()=>xm,length:()=>gt,literal:()=>By,locales:()=>Jt,looseObject:()=>Ly,lowercase:()=>er,lt:()=>De,lte:()=>ye,map:()=>Gy,maxLength:()=>ft,maxSize:()=>pt,mime:()=>ir,minLength:()=>Ue,minSize:()=>Ye,multipleOf:()=>Xe,nan:()=>Ky,nanoid:()=>sy,nativeEnum:()=>Wy,negative:()=>vc,never:()=>ul,nonnegative:()=>bc,nonoptional:()=>fm,nonpositive:()=>yc,normalize:()=>ar,null:()=>Bd,nullable:()=>Fn,nullish:()=>Jy,number:()=>Zd,object:()=>Ny,optional:()=>Zn,overwrite:()=>ze,parse:()=>Cc,parseAsync:()=>Ec,partialRecord:()=>Fy,pipe:()=>Gn,positive:()=>hc,prefault:()=>pm,preprocess:()=>ab,prettifyError:()=>Vo,promise:()=>Qy,property:()=>_c,readonly:()=>_m,record:()=>nm,refine:()=>Im,regex:()=>Qt,regexes:()=>ve,registry:()=>pn,safeDecode:()=>Zc,safeDecodeAsync:()=>Gc,safeEncode:()=>Lc,safeEncodeAsync:()=>Fc,safeParse:()=>jc,safeParseAsync:()=>Ac,set:()=>Vy,setErrorMap:()=>cb,size:()=>Yt,startsWith:()=>nr,strictObject:()=>Uy,string:()=>Vc,stringFormat:()=>ky,stringbool:()=>ob,success:()=>qy,superRefine:()=>Tm,symbol:()=>Cy,templateLiteral:()=>Yy,toJSONSchema:()=>Tc,toLowerCase:()=>cr,toUpperCase:()=>lr,transform:()=>gl,treeifyError:()=>Go,trim:()=>sr,tuple:()=>rm,uint32:()=>Oy,uint64:()=>zy,ulid:()=>uy,undefined:()=>Ey,union:()=>ml,unknown:()=>vt,uppercase:()=>tr,url:()=>oy,util:()=>b,uuid:()=>ey,uuidv4:()=>ty,uuidv6:()=>ry,uuidv7:()=>ny,void:()=>Ay,xid:()=>dy});var Ce={};me(Ce,{$ZodAny:()=>ya,$ZodArray:()=>xa,$ZodAsyncError:()=>Ie,$ZodBase64:()=>ca,$ZodBase64URL:()=>la,$ZodBigInt:()=>un,$ZodBigIntFormat:()=>fa,$ZodBoolean:()=>Zt,$ZodCIDRv4:()=>ia,$ZodCIDRv6:()=>aa,$ZodCUID:()=>Ji,$ZodCUID2:()=>qi,$ZodCatch:()=>La,$ZodCheck:()=>W,$ZodCheckBigIntFormat:()=>wi,$ZodCheckEndsWith:()=>Mi,$ZodCheckGreaterThan:()=>tn,$ZodCheckIncludes:()=>ji,$ZodCheckLengthEquals:()=>Pi,$ZodCheckLessThan:()=>en,$ZodCheckLowerCase:()=>Ci,$ZodCheckMaxLength:()=>Oi,$ZodCheckMaxSize:()=>Si,$ZodCheckMimeType:()=>Ni,$ZodCheckMinLength:()=>Di,$ZodCheckMinSize:()=>Ii,$ZodCheckMultipleOf:()=>$i,$ZodCheckNumberFormat:()=>xi,$ZodCheckOverwrite:()=>Ui,$ZodCheckProperty:()=>Ri,$ZodCheckRegex:()=>zi,$ZodCheckSizeEquals:()=>Ti,$ZodCheckStartsWith:()=>Ai,$ZodCheckStringFormat:()=>mt,$ZodCheckUpperCase:()=>Ei,$ZodCodec:()=>Ft,$ZodCustom:()=>Ja,$ZodCustomStringFormat:()=>ma,$ZodDate:()=>$a,$ZodDefault:()=>Ma,$ZodDiscriminatedUnion:()=>Sa,$ZodE164:()=>ua,$ZodEmail:()=>Vi,$ZodEmoji:()=>Bi,$ZodEncodeError:()=>He,$ZodEnum:()=>Pa,$ZodError:()=>Mt,$ZodFile:()=>Ca,$ZodFunction:()=>Wa,$ZodGUID:()=>Fi,$ZodIPv4:()=>na,$ZodIPv6:()=>oa,$ZodISODate:()=>ea,$ZodISODateTime:()=>Qi,$ZodISODuration:()=>ra,$ZodISOTime:()=>ta,$ZodIntersection:()=>Ia,$ZodJWT:()=>da,$ZodKSUID:()=>Yi,$ZodLazy:()=>Ha,$ZodLiteral:()=>za,$ZodMap:()=>Oa,$ZodNaN:()=>Za,$ZodNanoID:()=>Hi,$ZodNever:()=>_a,$ZodNonOptional:()=>Na,$ZodNull:()=>va,$ZodNullable:()=>Aa,$ZodNumber:()=>ln,$ZodNumberFormat:()=>pa,$ZodObject:()=>Ed,$ZodObjectJIT:()=>wa,$ZodOptional:()=>ja,$ZodPipe:()=>Fa,$ZodPrefault:()=>Ra,$ZodPromise:()=>Ba,$ZodReadonly:()=>Ga,$ZodRealError:()=>ce,$ZodRecord:()=>Ta,$ZodRegistry:()=>qt,$ZodSet:()=>Da,$ZodString:()=>Ke,$ZodStringFormat:()=>F,$ZodSuccess:()=>Ua,$ZodSymbol:()=>ga,$ZodTemplateLiteral:()=>Va,$ZodTransform:()=>Ea,$ZodTuple:()=>mn,$ZodType:()=>D,$ZodULID:()=>Ki,$ZodURL:()=>Wi,$ZodUUID:()=>Gi,$ZodUndefined:()=>ha,$ZodUnion:()=>dn,$ZodUnknown:()=>ba,$ZodVoid:()=>ka,$ZodXID:()=>Xi,$brand:()=>jo,$constructor:()=>m,$input:()=>Us,$output:()=>Ns,Doc:()=>rn,JSONSchema:()=>Nd,JSONSchemaGenerator:()=>jn,NEVER:()=>Eo,TimePrecision:()=>Fs,_any:()=>lc,_array:()=>kc,_base64:()=>Pn,_base64url:()=>zn,_bigint:()=>rc,_boolean:()=>ec,_catch:()=>Gv,_check:()=>Rd,_cidrv4:()=>On,_cidrv6:()=>Dn,_coercedBigint:()=>nc,_coercedBoolean:()=>tc,_coercedDate:()=>fc,_coercedNumber:()=>Js,_coercedString:()=>Zs,_cuid:()=>kn,_cuid2:()=>$n,_custom:()=>xc,_date:()=>pc,_decode:()=>Br,_decodeAsync:()=>Jr,_default:()=>Lv,_discriminatedUnion:()=>Ov,_e164:()=>Cn,_email:()=>fn,_emoji:()=>bn,_encode:()=>Wr,_encodeAsync:()=>Hr,_endsWith:()=>or,_enum:()=>jv,_file:()=>$c,_float32:()=>Ks,_float64:()=>Xs,_gt:()=>Pe,_gte:()=>le,_guid:()=>Kt,_includes:()=>rr,_int:()=>qs,_int32:()=>Ys,_int64:()=>oc,_intersection:()=>Dv,_ipv4:()=>In,_ipv6:()=>Tn,_isoDate:()=>Vs,_isoDateTime:()=>Gs,_isoDuration:()=>Bs,_isoTime:()=>Ws,_jwt:()=>En,_ksuid:()=>Sn,_lazy:()=>Hv,_length:()=>gt,_literal:()=>Mv,_lowercase:()=>er,_lt:()=>De,_lte:()=>ye,_map:()=>Cv,_max:()=>ye,_maxLength:()=>ft,_maxSize:()=>pt,_mime:()=>ir,_min:()=>le,_minLength:()=>Ue,_minSize:()=>Ye,_multipleOf:()=>Xe,_nan:()=>gc,_nanoid:()=>_n,_nativeEnum:()=>Av,_negative:()=>vc,_never:()=>dc,_nonnegative:()=>bc,_nonoptional:()=>Zv,_nonpositive:()=>yc,_normalize:()=>ar,_null:()=>cc,_nullable:()=>Uv,_number:()=>Hs,_optional:()=>Nv,_overwrite:()=>ze,_parse:()=>ct,_parseAsync:()=>lt,_pipe:()=>Vv,_positive:()=>hc,_promise:()=>Jv,_property:()=>_c,_readonly:()=>Wv,_record:()=>zv,_refine:()=>wc,_regex:()=>Qt,_safeDecode:()=>Kr,_safeDecodeAsync:()=>Yr,_safeEncode:()=>qr,_safeEncodeAsync:()=>Xr,_safeParse:()=>ut,_safeParseAsync:()=>dt,_set:()=>Ev,_size:()=>Yt,_startsWith:()=>nr,_string:()=>Ls,_stringFormat:()=>ht,_stringbool:()=>Ic,_success:()=>Fv,_superRefine:()=>Sc,_symbol:()=>ac,_templateLiteral:()=>Bv,_toLowerCase:()=>cr,_toUpperCase:()=>lr,_transform:()=>Rv,_trim:()=>sr,_tuple:()=>Pv,_uint32:()=>Qs,_uint64:()=>ic,_ulid:()=>xn,_undefined:()=>sc,_union:()=>Tv,_unknown:()=>uc,_uppercase:()=>tr,_url:()=>Xt,_uuid:()=>gn,_uuidv4:()=>hn,_uuidv6:()=>vn,_uuidv7:()=>yn,_void:()=>mc,_xid:()=>wn,clone:()=>ie,config:()=>q,decode:()=>Yg,decodeAsync:()=>eh,encode:()=>Xg,encodeAsync:()=>Qg,flattenError:()=>Rt,formatError:()=>Nt,globalConfig:()=>Dt,globalRegistry:()=>Oe,isValidBase64:()=>sa,isValidBase64URL:()=>Dd,isValidJWT:()=>Pd,locales:()=>Jt,parse:()=>Gr,parseAsync:()=>Vr,prettifyError:()=>Vo,regexes:()=>ve,registry:()=>pn,safeDecode:()=>rh,safeDecodeAsync:()=>oh,safeEncode:()=>th,safeEncodeAsync:()=>nh,safeParse:()=>Wo,safeParseAsync:()=>Bo,toDotPath:()=>md,toJSONSchema:()=>Tc,treeifyError:()=>Go,util:()=>b,version:()=>Li});var Eo=Object.freeze({status:"aborted"});function m(e,r,n){function o(s,c){var l;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(l=s._zod).traits??(l.traits=new Set),s._zod.traits.add(e),r(s,c);for(let d in a.prototype)if(!(d in s))Object.defineProperty(s,d,{value:a.prototype[d].bind(s)});s._zod.constr=a,s._zod.def=c}let t=n?.Parent??Object;class i extends t{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let l=n?.Parent?new i:this;o(l,s),(c=l._zod).deferred??(c.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:(s)=>{if(n?.Parent&&s instanceof n.Parent)return!0;return s?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var jo=Symbol("zod_brand");class Ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class He extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}var Dt={};function q(e){if(e)Object.assign(Dt,e);return Dt}var b={};me(b,{BIGINT_FORMAT_RANGES:()=>Fo,Class:()=>ud,NUMBER_FORMAT_RANGES:()=>Zo,aborted:()=>Ne,allowsEval:()=>Ro,assert:()=>Dg,assertEqual:()=>Sg,assertIs:()=>Tg,assertNever:()=>Og,assertNotEqual:()=>Ig,assignProp:()=>Ae,base64ToUint8Array:()=>cd,base64urlToUint8Array:()=>Bg,cached:()=>at,captureStackTrace:()=>Fr,cleanEnum:()=>Wg,cleanRegex:()=>Ct,clone:()=>ie,cloneDef:()=>zg,createTransparentProxy:()=>Rg,defineLazy:()=>E,esc:()=>Zr,escapeRegex:()=>Te,extend:()=>Lg,finalizeIssue:()=>ge,floatSafeRemainder:()=>Mo,getElementAtPath:()=>Cg,getEnumValues:()=>zt,getLengthableOrigin:()=>At,getParsedType:()=>Mg,getSizableOrigin:()=>jt,hexToUint8Array:()=>Jg,isObject:()=>Je,isPlainObject:()=>Re,issue:()=>st,joinValues:()=>p,jsonStringifyReplacer:()=>it,merge:()=>Fg,mergeDefs:()=>Me,normalizeParams:()=>k,nullish:()=>je,numKeys:()=>Ag,objectClone:()=>Pg,omit:()=>Ug,optionalKeys:()=>Lo,partial:()=>Gg,pick:()=>Ng,prefixIssues:()=>fe,primitiveTypes:()=>Uo,promiseAllObject:()=>Eg,propertyKeyTypes:()=>Et,randomString:()=>jg,required:()=>Vg,safeExtend:()=>Zg,shallowClone:()=>No,stringifyPrimitive:()=>_,uint8ArrayToBase64:()=>ld,uint8ArrayToBase64url:()=>Hg,uint8ArrayToHex:()=>qg,unwrapMessage:()=>Pt});function Sg(e){return e}function Ig(e){return e}function Tg(e){}function Og(e){throw Error()}function Dg(e){}function zt(e){let r=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function p(e,r="|"){return e.map((n)=>_(n)).join(r)}function it(e,r){if(typeof r==="bigint")return r.toString();return r}function at(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function je(e){return e===null||e===void 0}function Ct(e){let r=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(r,n)}function Mo(e,r){let n=(e.toString().split(".")[1]||"").length,o=r.toString(),t=(o.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);if(c?.[1])t=Number.parseInt(c[1])}let i=n>t?n:t,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(r.toFixed(i).replace(".",""));return a%s/10**i}var sd=Symbol("evaluating");function E(e,r,n){let o=void 0;Object.defineProperty(e,r,{get(){if(o===sd)return;if(o===void 0)o=sd,o=n();return o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Pg(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ae(e,r,n){Object.defineProperty(e,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Me(...e){let r={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(r,o)}return Object.defineProperties({},r)}function zg(e){return Me(e._zod.def)}function Cg(e,r){if(!r)return e;return r.reduce((n,o)=>n?.[o],e)}function Eg(e){let r=Object.keys(e),n=r.map((o)=>e[o]);return Promise.all(n).then((o)=>{let t={};for(let i=0;i<r.length;i++)t[r[i]]=o[i];return t})}function jg(e=10){let n="";for(let o=0;o<e;o++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function Zr(e){return JSON.stringify(e)}var Fr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Je(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Ro=at(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Re(e){if(Je(e)===!1)return!1;let r=e.constructor;if(r===void 0)return!0;let n=r.prototype;if(Je(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function No(e){if(Re(e))return{...e};if(Array.isArray(e))return[...e];return e}function Ag(e){let r=0;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))r++;return r}var Mg=(e)=>{let r=typeof e;switch(r){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":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${r}`)}},Et=new Set(["string","number","symbol"]),Uo=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ie(e,r,n){let o=new e._zod.constr(r??e._zod.def);if(!r||n?.parent)o._zod.parent=e;return o}function k(e){let r=e;if(!r)return{};if(typeof r==="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");r.error=r.message}if(delete r.message,typeof r.error==="string")return{...r,error:()=>r.error};return r}function Rg(e){let r;return new Proxy({},{get(n,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(n,o,t,i){return r??(r=e()),Reflect.set(r,o,t,i)},has(n,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(n,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(n){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(n,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function _(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Lo(e){return Object.keys(e).filter((r)=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}var Zo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Fo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ng(e,r){let n=e._zod.def,o=Me(e._zod.def,{get shape(){let t={};for(let i in r){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;t[i]=n.shape[i]}return Ae(this,"shape",t),t},checks:[]});return ie(e,o)}function Ug(e,r){let n=e._zod.def,o=Me(e._zod.def,{get shape(){let t={...e._zod.def.shape};for(let i in r){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;delete t[i]}return Ae(this,"shape",t),t},checks:[]});return ie(e,o)}function Lg(e,r){if(!Re(r))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let t=Me(e._zod.def,{get shape(){let i={...e._zod.def.shape,...r};return Ae(this,"shape",i),i},checks:[]});return ie(e,t)}function Zg(e,r){if(!Re(r))throw Error("Invalid input to safeExtend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...r};return Ae(this,"shape",o),o},checks:e._zod.def.checks};return ie(e,n)}function Fg(e,r){let n=Me(e._zod.def,{get shape(){let o={...e._zod.def.shape,...r._zod.def.shape};return Ae(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return ie(e,n)}function Gg(e,r,n){let o=Me(r._zod.def,{get shape(){let t=r._zod.def.shape,i={...t};if(n)for(let a in n){if(!(a in t))throw Error(`Unrecognized key: "${a}"`);if(!n[a])continue;i[a]=e?new e({type:"optional",innerType:t[a]}):t[a]}else for(let a in t)i[a]=e?new e({type:"optional",innerType:t[a]}):t[a];return Ae(this,"shape",i),i},checks:[]});return ie(r,o)}function Vg(e,r,n){let o=Me(r._zod.def,{get shape(){let t=r._zod.def.shape,i={...t};if(n)for(let a in n){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);if(!n[a])continue;i[a]=new e({type:"nonoptional",innerType:t[a]})}else for(let a in t)i[a]=new e({type:"nonoptional",innerType:t[a]});return Ae(this,"shape",i),i},checks:[]});return ie(r,o)}function Ne(e,r=0){if(e.aborted===!0)return!0;for(let n=r;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function fe(e,r){return r.map((n)=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Pt(e){return typeof e==="string"?e:e?.message}function ge(e,r,n){let o={...e,path:e.path??[]};if(!e.message){let t=Pt(e.inst?._zod.def?.error?.(e))??Pt(r?.error?.(e))??Pt(n.customError?.(e))??Pt(n.localeError?.(e))??"Invalid input";o.message=t}if(delete o.inst,delete o.continue,!r?.reportInput)delete o.input;return o}function jt(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function At(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function st(...e){let[r,n,o]=e;if(typeof r==="string")return{message:r,code:"custom",input:n,inst:o};return{...r}}function Wg(e){return Object.entries(e).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map((r)=>r[1])}function cd(e){let r=atob(e),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}function ld(e){let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}function Bg(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-r.length%4)%4);return cd(r+n)}function Hg(e){return ld(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Jg(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw Error("Invalid hex string length");let n=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)n[o/2]=Number.parseInt(r.slice(o,o+2),16);return n}function qg(e){return Array.from(e).map((r)=>r.toString(16).padStart(2,"0")).join("")}class ud{constructor(...e){}}var dd=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,it,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Mt=m("$ZodError",dd),ce=m("$ZodError",dd,{Parent:Error});function Rt(e,r=(n)=>n.message){let n={},o=[];for(let t of e.issues)if(t.path.length>0)n[t.path[0]]=n[t.path[0]]||[],n[t.path[0]].push(r(t));else o.push(r(t));return{formErrors:o,fieldErrors:n}}function Nt(e,r){let n=r||function(i){return i.message},o={_errors:[]},t=(i)=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((s)=>t({issues:s}));else if(a.code==="invalid_key")t({issues:a.issues});else if(a.code==="invalid_element")t({issues:a.issues});else if(a.path.length===0)o._errors.push(n(a));else{let s=o,c=0;while(c<a.path.length){let l=a.path[c];if(c!==a.path.length-1)s[l]=s[l]||{_errors:[]};else s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a));s=s[l],c++}}};return t(e),o}function Go(e,r){let n=r||function(i){return i.message},o={errors:[]},t=(i,a=[])=>{var s,c;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map((d)=>t({issues:d},l.path));else if(l.code==="invalid_key")t({issues:l.issues},l.path);else if(l.code==="invalid_element")t({issues:l.issues},l.path);else{let d=[...a,...l.path];if(d.length===0){o.errors.push(n(l));continue}let v=o,h=0;while(h<d.length){let u=d[h],y=h===d.length-1;if(typeof u==="string")v.properties??(v.properties={}),(s=v.properties)[u]??(s[u]={errors:[]}),v=v.properties[u];else v.items??(v.items=[]),(c=v.items)[u]??(c[u]={errors:[]}),v=v.items[u];if(y)v.errors.push(n(l));h++}}};return t(e),o}function md(e){let r=[],n=e.map((o)=>typeof o==="object"?o.key:o);for(let o of n)if(typeof o==="number")r.push(`[${o}]`);else if(typeof o==="symbol")r.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))r.push(`[${JSON.stringify(o)}]`);else{if(r.length)r.push(".");r.push(o)}return r.join("")}function Vo(e){let r=[],n=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of n)if(r.push(`✖ ${o.message}`),o.path?.length)r.push(` → at ${md(o.path)}`);return r.join(`
114
- `)}var ct=(e)=>(r,n,o,t)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ie;if(a.issues.length){let s=new(t?.Err??e)(a.issues.map((c)=>ge(c,i,q())));throw Fr(s,t?.callee),s}return a.value},Gr=ct(ce),lt=(e)=>async(r,n,o,t)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let s=new(t?.Err??e)(a.issues.map((c)=>ge(c,i,q())));throw Fr(s,t?.callee),s}return a.value},Vr=lt(ce),ut=(e)=>(r,n,o)=>{let t=o?{...o,async:!1}:{async:!1},i=r._zod.run({value:n,issues:[]},t);if(i instanceof Promise)throw new Ie;return i.issues.length?{success:!1,error:new(e??Mt)(i.issues.map((a)=>ge(a,t,q())))}:{success:!0,data:i.value}},Wo=ut(ce),dt=(e)=>async(r,n,o)=>{let t=o?Object.assign(o,{async:!0}):{async:!0},i=r._zod.run({value:n,issues:[]},t);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((a)=>ge(a,t,q())))}:{success:!0,data:i.value}},Bo=dt(ce),Wr=(e)=>(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ct(e)(r,n,t)},Xg=Wr(ce),Br=(e)=>(r,n,o)=>ct(e)(r,n,o),Yg=Br(ce),Hr=(e)=>async(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return lt(e)(r,n,t)},Qg=Hr(ce),Jr=(e)=>async(r,n,o)=>lt(e)(r,n,o),eh=Jr(ce),qr=(e)=>(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ut(e)(r,n,t)},th=qr(ce),Kr=(e)=>(r,n,o)=>ut(e)(r,n,o),rh=Kr(ce),Xr=(e)=>async(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return dt(e)(r,n,t)},nh=Xr(ce),Yr=(e)=>async(r,n,o)=>dt(e)(r,n,o),oh=Yr(ce);var ve={};me(ve,{base64:()=>si,base64url:()=>Qr,bigint:()=>fi,boolean:()=>vi,browserEmail:()=>mh,cidrv4:()=>ii,cidrv6:()=>ai,cuid:()=>Ho,cuid2:()=>Jo,date:()=>ui,datetime:()=>mi,domain:()=>ph,duration:()=>Qo,e164:()=>li,email:()=>ti,emoji:()=>ri,extendedDuration:()=>ih,guid:()=>ei,hex:()=>fh,hostname:()=>ci,html5Email:()=>lh,idnEmail:()=>dh,integer:()=>gi,ipv4:()=>ni,ipv6:()=>oi,ksuid:()=>Xo,lowercase:()=>_i,md5_base64:()=>hh,md5_base64url:()=>vh,md5_hex:()=>gh,nanoid:()=>Yo,null:()=>yi,number:()=>hi,rfc5322Email:()=>uh,sha1_base64:()=>bh,sha1_base64url:()=>_h,sha1_hex:()=>yh,sha256_base64:()=>$h,sha256_base64url:()=>xh,sha256_hex:()=>kh,sha384_base64:()=>Sh,sha384_base64url:()=>Ih,sha384_hex:()=>wh,sha512_base64:()=>Oh,sha512_base64url:()=>Dh,sha512_hex:()=>Th,string:()=>pi,time:()=>di,ulid:()=>qo,undefined:()=>bi,unicodeEmail:()=>pd,uppercase:()=>ki,uuid:()=>qe,uuid4:()=>ah,uuid6:()=>sh,uuid7:()=>ch,xid:()=>Ko});var Ho=/^[cC][^\s-]{8,}$/,Jo=/^[0-9a-z]+$/,qo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ko=/^[0-9a-vA-V]{20}$/,Xo=/^[A-Za-z0-9]{27}$/,Yo=/^[a-zA-Z0-9_-]{21}$/,Qo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ih=/^[-+]?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)?)??$/,ei=/^([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})$/,qe=(e)=>{if(!e)return/^([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)$/;return 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})$`)},ah=qe(4),sh=qe(6),ch=qe(7),ti=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lh=/^[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])?)*$/,uh=/^(([^<>()\[\]\\.,;:\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,}))$/,pd=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dh=pd,mh=/^[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])?)*$/;function ri(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var ni=/^(?:(?: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])$/,oi=/^(([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}|:))$/,ii=/^((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])$/,ai=/^(([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])$/,si=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qr=/^[A-Za-z0-9_-]*$/,ci=/^(?=.{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])?)*\.?$/,ph=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,li=/^\+(?:[0-9]){6,14}[0-9]$/,fd="(?:(?:\\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])))",ui=new RegExp(`^${fd}$`);function gd(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function di(e){return new RegExp(`^${gd(e)}$`)}function mi(e){let r=gd({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${r}(?:${n.join("|")})`;return new RegExp(`^${fd}T(?:${o})$`)}var pi=(e)=>{let r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},fi=/^-?\d+n?$/,gi=/^-?\d+$/,hi=/^-?\d+(?:\.\d+)?/,vi=/^(?:true|false)$/i,yi=/^null$/i;var bi=/^undefined$/i;var _i=/^[^A-Z]*$/,ki=/^[^a-z]*$/,fh=/^[0-9a-fA-F]*$/;function Ut(e,r){return new RegExp(`^[A-Za-z0-9+/]{${e}}${r}$`)}function Lt(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var gh=/^[0-9a-fA-F]{32}$/,hh=Ut(22,"=="),vh=Lt(22),yh=/^[0-9a-fA-F]{40}$/,bh=Ut(27,"="),_h=Lt(27),kh=/^[0-9a-fA-F]{64}$/,$h=Ut(43,"="),xh=Lt(43),wh=/^[0-9a-fA-F]{96}$/,Sh=Ut(64,""),Ih=Lt(64),Th=/^[0-9a-fA-F]{128}$/,Oh=Ut(86,"=="),Dh=Lt(86);var W=m("$ZodCheck",(e,r)=>{var n;e._zod??(e._zod={}),e._zod.def=r,(n=e._zod).onattach??(n.onattach=[])}),vd={number:"number",bigint:"bigint",object:"date"},en=m("$ZodCheckLessThan",(e,r)=>{W.init(e,r);let n=vd[typeof r.value];e._zod.onattach.push((o)=>{let t=o._zod.bag,i=(r.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(r.value<i)if(r.inclusive)t.maximum=r.value;else t.exclusiveMaximum=r.value}),e._zod.check=(o)=>{if(r.inclusive?o.value<=r.value:o.value<r.value)return;o.issues.push({origin:n,code:"too_big",maximum:r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),tn=m("$ZodCheckGreaterThan",(e,r)=>{W.init(e,r);let n=vd[typeof r.value];e._zod.onattach.push((o)=>{let t=o._zod.bag,i=(r.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(r.value>i)if(r.inclusive)t.minimum=r.value;else t.exclusiveMinimum=r.value}),e._zod.check=(o)=>{if(r.inclusive?o.value>=r.value:o.value>r.value)return;o.issues.push({origin:n,code:"too_small",minimum:r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),$i=m("$ZodCheckMultipleOf",(e,r)=>{W.init(e,r),e._zod.onattach.push((n)=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=r.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof r.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%r.value===BigInt(0):Mo(n.value,r.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:e,continue:!r.abort})}}),xi=m("$ZodCheckNumberFormat",(e,r)=>{W.init(e,r),r.format=r.format||"float64";let n=r.format?.includes("int"),o=n?"int":"number",[t,i]=Zo[r.format];e._zod.onattach.push((a)=>{let s=a._zod.bag;if(s.format=r.format,s.minimum=t,s.maximum=i,n)s.pattern=gi}),e._zod.check=(a)=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){if(s>0)a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort});else a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort});return}}if(s<t)a.issues.push({origin:"number",input:s,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort});if(s>i)a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:e})}}),wi=m("$ZodCheckBigIntFormat",(e,r)=>{W.init(e,r);let[n,o]=Fo[r.format];e._zod.onattach.push((t)=>{let i=t._zod.bag;i.format=r.format,i.minimum=n,i.maximum=o}),e._zod.check=(t)=>{let i=t.value;if(i<n)t.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!r.abort});if(i>o)t.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),Si=m("$ZodCheckMaxSize",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.size!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(r.maximum<t)o._zod.bag.maximum=r.maximum}),e._zod.check=(o)=>{let t=o.value;if(t.size<=r.maximum)return;o.issues.push({origin:jt(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Ii=m("$ZodCheckMinSize",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.size!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(r.minimum>t)o._zod.bag.minimum=r.minimum}),e._zod.check=(o)=>{let t=o.value;if(t.size>=r.minimum)return;o.issues.push({origin:jt(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Ti=m("$ZodCheckSizeEquals",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.size!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.minimum=r.size,t.maximum=r.size,t.size=r.size}),e._zod.check=(o)=>{let t=o.value,i=t.size;if(i===r.size)return;let a=i>r.size;o.issues.push({origin:jt(t),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),Oi=m("$ZodCheckMaxLength",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.length!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(r.maximum<t)o._zod.bag.maximum=r.maximum}),e._zod.check=(o)=>{let t=o.value;if(t.length<=r.maximum)return;let a=At(t);o.issues.push({origin:a,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Di=m("$ZodCheckMinLength",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.length!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(r.minimum>t)o._zod.bag.minimum=r.minimum}),e._zod.check=(o)=>{let t=o.value;if(t.length>=r.minimum)return;let a=At(t);o.issues.push({origin:a,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Pi=m("$ZodCheckLengthEquals",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.length!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.minimum=r.length,t.maximum=r.length,t.length=r.length}),e._zod.check=(o)=>{let t=o.value,i=t.length;if(i===r.length)return;let a=At(t),s=i>r.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),mt=m("$ZodCheckStringFormat",(e,r)=>{var n,o;if(W.init(e,r),e._zod.onattach.push((t)=>{let i=t._zod.bag;if(i.format=r.format,r.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(r.pattern)}),r.pattern)(n=e._zod).check??(n.check=(t)=>{if(r.pattern.lastIndex=0,r.pattern.test(t.value))return;t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})});else(o=e._zod).check??(o.check=()=>{})}),zi=m("$ZodCheckRegex",(e,r)=>{mt.init(e,r),e._zod.check=(n)=>{if(r.pattern.lastIndex=0,r.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),Ci=m("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=_i),mt.init(e,r)}),Ei=m("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=ki),mt.init(e,r)}),ji=m("$ZodCheckIncludes",(e,r)=>{W.init(e,r);let n=Te(r.includes),o=new RegExp(typeof r.position==="number"?`^.{${r.position}}${n}`:n);r.pattern=o,e._zod.onattach.push((t)=>{let i=t._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(t)=>{if(t.value.includes(r.includes,r.position))return;t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),Ai=m("$ZodCheckStartsWith",(e,r)=>{W.init(e,r);let n=new RegExp(`^${Te(r.prefix)}.*`);r.pattern??(r.pattern=n),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.startsWith(r.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),Mi=m("$ZodCheckEndsWith",(e,r)=>{W.init(e,r);let n=new RegExp(`.*${Te(r.suffix)}$`);r.pattern??(r.pattern=n),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.endsWith(r.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}});function hd(e,r,n){if(e.issues.length)r.issues.push(...fe(n,e.issues))}var Ri=m("$ZodCheckProperty",(e,r)=>{W.init(e,r),e._zod.check=(n)=>{let o=r.schema._zod.run({value:n.value[r.property],issues:[]},{});if(o instanceof Promise)return o.then((t)=>hd(t,n,r.property));hd(o,n,r.property);return}}),Ni=m("$ZodCheckMimeType",(e,r)=>{W.init(e,r);let n=new Set(r.mime);e._zod.onattach.push((o)=>{o._zod.bag.mime=r.mime}),e._zod.check=(o)=>{if(n.has(o.value.type))return;o.issues.push({code:"invalid_value",values:r.mime,input:o.value.type,inst:e,continue:!r.abort})}}),Ui=m("$ZodCheckOverwrite",(e,r)=>{W.init(e,r),e._zod.check=(n)=>{n.value=r.tx(n.value)}});class rn{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
115
- `).filter((i)=>i),o=Math.min(...n.map((i)=>i.length-i.trimStart().length)),t=n.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of t)this.content.push(i)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map((t)=>` ${t}`)];return new e(...r,o.join(`
116
- `))}}var Li={major:4,minor:1,patch:8};var D=m("$ZodType",(e,r)=>{var n;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=Li;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))o.unshift(e);for(let t of o)for(let i of t._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(a,s,c)=>{let l=Ne(a),d;for(let v of s){if(v._zod.def.when){if(!v._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,u=v._zod.check(a);if(u instanceof Promise&&c?.async===!1)throw new Ie;if(d||u instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await u,a.issues.length===h)return;if(!l)l=Ne(a,h)});else{if(a.issues.length===h)continue;if(!l)l=Ne(a,h)}}if(d)return d.then(()=>a);return a},i=(a,s,c)=>{if(Ne(a))return a.aborted=!0,a;let l=t(s,o,c);if(l instanceof Promise){if(c.async===!1)throw new Ie;return l.then((d)=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,s));return i(l,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Ie;return c.then((l)=>t(l,o,s))}return t(c,o,s)}}e["~standard"]={validate:(t)=>{try{let i=Wo(e,t);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Bo(e,t).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Ke=m("$ZodString",(e,r)=>{D.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pi(e._zod.bag),e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=String(n.value)}catch(t){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),F=m("$ZodStringFormat",(e,r)=>{mt.init(e,r),Ke.init(e,r)}),Fi=m("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=ei),F.init(e,r)}),Gi=m("$ZodUUID",(e,r)=>{if(r.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=qe(o))}else r.pattern??(r.pattern=qe());F.init(e,r)}),Vi=m("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=ti),F.init(e,r)}),Wi=m("$ZodURL",(e,r)=>{F.init(e,r),e._zod.check=(n)=>{try{let o=n.value.trim(),t=new URL(o);if(r.hostname){if(r.hostname.lastIndex=0,!r.hostname.test(t.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ci.source,input:n.value,inst:e,continue:!r.abort})}if(r.protocol){if(r.protocol.lastIndex=0,!r.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:n.value,inst:e,continue:!r.abort})}if(r.normalize)n.value=t.href;else n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!r.abort})}}}),Bi=m("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=ri()),F.init(e,r)}),Hi=m("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=Yo),F.init(e,r)}),Ji=m("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=Ho),F.init(e,r)}),qi=m("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=Jo),F.init(e,r)}),Ki=m("$ZodULID",(e,r)=>{r.pattern??(r.pattern=qo),F.init(e,r)}),Xi=m("$ZodXID",(e,r)=>{r.pattern??(r.pattern=Ko),F.init(e,r)}),Yi=m("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=Xo),F.init(e,r)}),Qi=m("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=mi(r)),F.init(e,r)}),ea=m("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=ui),F.init(e,r)}),ta=m("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=di(r)),F.init(e,r)}),ra=m("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=Qo),F.init(e,r)}),na=m("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=ni),F.init(e,r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv4"})}),oa=m("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=oi),F.init(e,r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!r.abort})}}}),ia=m("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=ii),F.init(e,r)}),aa=m("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=ai),F.init(e,r),e._zod.check=(n)=>{let o=n.value.split("/");try{if(o.length!==2)throw Error();let[t,i]=o;if(!i)throw Error();let a=Number(i);if(`${a}`!==i)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${t}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!r.abort})}}});function sa(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ca=m("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=si),F.init(e,r),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=(n)=>{if(sa(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!r.abort})}});function Dd(e){if(!Qr.test(e))return!1;let r=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),n=r.padEnd(Math.ceil(r.length/4)*4,"=");return sa(n)}var la=m("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=Qr),F.init(e,r),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=(n)=>{if(Dd(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!r.abort})}}),ua=m("$ZodE164",(e,r)=>{r.pattern??(r.pattern=li),F.init(e,r)});function Pd(e,r=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let t=JSON.parse(atob(o));if("typ"in t&&t?.typ!=="JWT")return!1;if(!t.alg)return!1;if(r&&(!("alg"in t)||t.alg!==r))return!1;return!0}catch{return!1}}var da=m("$ZodJWT",(e,r)=>{F.init(e,r),e._zod.check=(n)=>{if(Pd(n.value,r.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!r.abort})}}),ma=m("$ZodCustomStringFormat",(e,r)=>{F.init(e,r),e._zod.check=(n)=>{if(r.fn(n.value))return;n.issues.push({code:"invalid_format",format:r.format,input:n.value,inst:e,continue:!r.abort})}}),ln=m("$ZodNumber",(e,r)=>{D.init(e,r),e._zod.pattern=e._zod.bag.pattern??hi,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=Number(n.value)}catch(a){}let t=n.value;if(typeof t==="number"&&!Number.isNaN(t)&&Number.isFinite(t))return n;let i=typeof t==="number"?Number.isNaN(t)?"NaN":!Number.isFinite(t)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...i?{received:i}:{}}),n}}),pa=m("$ZodNumber",(e,r)=>{xi.init(e,r),ln.init(e,r)}),Zt=m("$ZodBoolean",(e,r)=>{D.init(e,r),e._zod.pattern=vi,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=Boolean(n.value)}catch(i){}let t=n.value;if(typeof t==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),n}}),un=m("$ZodBigInt",(e,r)=>{D.init(e,r),e._zod.pattern=fi,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=BigInt(n.value)}catch(t){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),fa=m("$ZodBigInt",(e,r)=>{wi.init(e,r),un.init(e,r)}),ga=m("$ZodSymbol",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(typeof t==="symbol")return n;return n.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),n}}),ha=m("$ZodUndefined",(e,r)=>{D.init(e,r),e._zod.pattern=bi,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let t=n.value;if(typeof t>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),n}}),va=m("$ZodNull",(e,r)=>{D.init(e,r),e._zod.pattern=yi,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let t=n.value;if(t===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),n}}),ya=m("$ZodAny",(e,r)=>{D.init(e,r),e._zod.parse=(n)=>n}),ba=m("$ZodUnknown",(e,r)=>{D.init(e,r),e._zod.parse=(n)=>n}),_a=m("$ZodNever",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),ka=m("$ZodVoid",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(typeof t>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),n}}),$a=m("$ZodDate",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=new Date(n.value)}catch(s){}let t=n.value,i=t instanceof Date;if(i&&!Number.isNaN(t.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:t,...i?{received:"Invalid Date"}:{},inst:e}),n}});function bd(e,r,n){if(e.issues.length)r.issues.push(...fe(n,e.issues));r.value[n]=e.value}var xa=m("$ZodArray",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!Array.isArray(t))return n.issues.push({expected:"array",code:"invalid_type",input:t,inst:e}),n;n.value=Array(t.length);let i=[];for(let a=0;a<t.length;a++){let s=t[a],c=r.element._zod.run({value:s,issues:[]},o);if(c instanceof Promise)i.push(c.then((l)=>bd(l,n,a)));else bd(c,n,a)}if(i.length)return Promise.all(i).then(()=>n);return n}});function cn(e,r,n,o){if(e.issues.length)r.issues.push(...fe(n,e.issues));if(e.value===void 0){if(n in o)r.value[n]=void 0}else r.value[n]=e.value}function zd(e){let r=Object.keys(e.shape);for(let o of r)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Lo(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function Cd(e,r,n,o,t,i){let a=[],s=t.keySet,c=t.catchall._zod,l=c.def.type;for(let d of Object.keys(r)){if(s.has(d))continue;if(l==="never"){a.push(d);continue}let v=c.run({value:r[d],issues:[]},o);if(v instanceof Promise)e.push(v.then((h)=>cn(h,n,d,r)));else cn(v,n,d,r)}if(a.length)n.issues.push({code:"unrecognized_keys",keys:a,input:r,inst:i});if(!e.length)return n;return Promise.all(e).then(()=>n)}var Ed=m("$ZodObject",(e,r)=>{D.init(e,r);let n=at(()=>zd(r));E(e._zod,"propValues",()=>{let a=r.shape,s={};for(let c in a){let l=a[c]._zod;if(l.values){s[c]??(s[c]=new Set);for(let d of l.values)s[c].add(d)}}return s});let o=Je,t=r.catchall,i;e._zod.parse=(a,s)=>{i??(i=n.value);let c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};let l=[],d=i.shape;for(let v of i.keys){let u=d[v]._zod.run({value:c[v],issues:[]},s);if(u instanceof Promise)l.push(u.then((y)=>cn(y,a,v,c)));else cn(u,a,v,c)}if(!t)return l.length?Promise.all(l).then(()=>a):a;return Cd(l,c,a,s,n.value,e)}}),wa=m("$ZodObjectJIT",(e,r)=>{Ed.init(e,r);let n=e._zod.parse,o=at(()=>zd(r)),t=(h)=>{let u=new rn(["shape","payload","ctx"]),y=o.value,x=(N)=>{let X=Zr(N);return`shape[${X}]._zod.run({ value: input[${X}], issues: [] }, ctx)`};u.write("const input = payload.value;");let j=Object.create(null),A=0;for(let N of y.keys)j[N]=`key_${A++}`;u.write("const newResult = {};");for(let N of y.keys){let X=j[N],he=Zr(N);u.write(`const ${X} = ${x(N)};`),u.write(`
117
- if (${X}.issues.length) {
118
- payload.issues = payload.issues.concat(${X}.issues.map(iss => ({
112
+ `)}}saveMemory($){let U=vO("M"),b=($.concepts[0]??"memory").slice(0,80);return this.stmts.insertEntry.run(U,"memory",b,$.content,"",null,0.5,JSON.stringify($.concepts),JSON.stringify($.files??[]),"","",Date.now()),Promise.resolve({id:U})}saveLesson($){let U=vO("L"),b=$.confidence??0.5,r=($.content.split(`
113
+ `)[0]??"lesson").slice(0,80);return this.stmts.insertEntry.run(U,"lesson",r,$.content,$.context,null,b,JSON.stringify($.tags??[]),JSON.stringify([]),"","",Date.now()),Promise.resolve({id:U})}smartSearch($){let U=$.limit??10,b=this.toFtsQuery($.query),v=this.stmts.ftsSearch.all(b,U).map((z)=>({id:z.id,title:z.title,content:z.content,type:z.kind,concepts:UO(z.tags),confidence:z.confidence,files:UO(z.files),advice:z.advice??"info"}));return Promise.resolve({lessons:v,crystals:[]})}boulderRead($){let b=this.stmts.boulderSelect.all($.directory,$.sessionID).map((r)=>({id:r.id,title:r.title,priority:r.priority,status:r.status,description:r.description,createdAtMs:r.created_at_ms,updatedAtMs:r.updated_at_ms}));if($.query){let r=$.query.toLowerCase();b=b.filter((v)=>v.title.toLowerCase().includes(r)||v.description.toLowerCase().includes(r))}return Promise.resolve(b)}close(){this.db.close()}toFtsQuery($){let U=$.trim().split(/\s+/).filter(Boolean).map((b)=>b.replace(/["()*]/g,"")).filter(Boolean);if(U.length===0)return'""';return U.map((b)=>`"${b}"*`).join(" ")}}function UO($){try{let U=JSON.parse($);return Array.isArray(U)?U:[]}catch{return[]}}var FU=null;function c4(){if(!FU)FU=new bO;return FU}var o6={};J$(o6,{xid:()=>NK,void:()=>ZK,uuidv7:()=>sX,uuidv6:()=>aX,uuidv4:()=>eX,uuid:()=>tX,util:()=>V,url:()=>$K,uppercase:()=>$4,unknown:()=>Yv,union:()=>k_,undefined:()=>FK,ulid:()=>_K,uint64:()=>EK,uint32:()=>AK,tuple:()=>sO,trim:()=>_4,treeifyError:()=>uU,transform:()=>X_,toUpperCase:()=>O4,toLowerCase:()=>N4,toJSONSchema:()=>Az,templateLiteral:()=>dK,symbol:()=>SK,superRefine:()=>A2,success:()=>iK,stringbool:()=>$w,stringFormat:()=>WK,string:()=>hz,strictObject:()=>RK,startsWith:()=>U4,size:()=>ev,setErrorMap:()=>rw,set:()=>uK,safeParseAsync:()=>Dz,safeParse:()=>Zz,safeEncodeAsync:()=>cz,safeEncode:()=>Tz,safeDecodeAsync:()=>uz,safeDecode:()=>Cz,registry:()=>J6,regexes:()=>Y$,regex:()=>av,refine:()=>L2,record:()=>$2,readonly:()=>W2,property:()=>Wz,promise:()=>pK,prettifyError:()=>hU,preprocess:()=>Uw,prefault:()=>I2,positive:()=>Kz,pipe:()=>h6,partialRecord:()=>CK,parseAsync:()=>Mz,parse:()=>Fz,overwrite:()=>M$,optional:()=>c6,object:()=>gK,number:()=>CO,nullish:()=>nK,nullable:()=>u6,null:()=>fO,normalize:()=>z4,nonpositive:()=>Qz,nonoptional:()=>J2,nonnegative:()=>Yz,never:()=>N_,negative:()=>wz,nativeEnum:()=>hK,nanoid:()=>bK,nan:()=>lK,multipleOf:()=>t$,minSize:()=>e$,minLength:()=>C$,mime:()=>r4,maxSize:()=>Xv,maxLength:()=>Kv,map:()=>cK,lte:()=>W$,lt:()=>S$,lowercase:()=>sv,looseObject:()=>mK,locales:()=>ov,literal:()=>yK,length:()=>wv,lazy:()=>P2,ksuid:()=>OK,keyof:()=>xK,jwt:()=>YK,json:()=>vw,iso:()=>T6,ipv6:()=>IK,ipv4:()=>kK,intersection:()=>eO,int64:()=>HK,int32:()=>LK,int:()=>yz,instanceof:()=>sK,includes:()=>v4,httpUrl:()=>vK,hostname:()=>jK,hex:()=>VK,hash:()=>PK,guid:()=>pX,gte:()=>O$,gt:()=>F$,globalRegistry:()=>E$,getErrorMap:()=>zw,function:()=>tK,formatError:()=>Tv,float64:()=>BK,float32:()=>qK,flattenError:()=>mv,file:()=>fK,enum:()=>J_,endsWith:()=>b4,encodeAsync:()=>Rz,encode:()=>xz,emoji:()=>UK,email:()=>dX,e164:()=>QK,discriminatedUnion:()=>TK,decodeAsync:()=>mz,decode:()=>gz,date:()=>DK,custom:()=>aK,cuid2:()=>zK,cuid:()=>rK,core:()=>Z$,config:()=>d,coerce:()=>j_,codec:()=>oK,clone:()=>r$,cidrv6:()=>XK,cidrv4:()=>JK,check:()=>eK,catch:()=>w2,boolean:()=>cO,bigint:()=>GK,base64url:()=>wK,base64:()=>KK,array:()=>n6,any:()=>MK,_function:()=>tK,_default:()=>O2,_ZodString:()=>fz,ZodXID:()=>tz,ZodVoid:()=>oO,ZodUnknown:()=>iO,ZodUnion:()=>O_,ZodUndefined:()=>hO,ZodUUID:()=>D$,ZodURL:()=>y6,ZodULID:()=>pz,ZodType:()=>M,ZodTuple:()=>aO,ZodTransform:()=>z2,ZodTemplateLiteral:()=>j2,ZodSymbol:()=>uO,ZodSuccess:()=>X2,ZodStringFormat:()=>f,ZodString:()=>I4,ZodSet:()=>U2,ZodRecord:()=>I_,ZodRealError:()=>k$,ZodReadonly:()=>Y2,ZodPromise:()=>q2,ZodPrefault:()=>k2,ZodPipe:()=>Q_,ZodOptional:()=>K_,ZodObject:()=>i6,ZodNumberFormat:()=>Wv,ZodNumber:()=>X4,ZodNullable:()=>_2,ZodNull:()=>yO,ZodNonOptional:()=>w_,ZodNever:()=>lO,ZodNanoID:()=>lz,ZodNaN:()=>Q2,ZodMap:()=>v2,ZodLiteral:()=>b2,ZodLazy:()=>V2,ZodKSUID:()=>ez,ZodJWT:()=>z_,ZodIssueCode:()=>bw,ZodIntersection:()=>tO,ZodISOTime:()=>R6,ZodISODuration:()=>m6,ZodISODateTime:()=>x6,ZodISODate:()=>g6,ZodIPv6:()=>sz,ZodIPv4:()=>az,ZodGUID:()=>C6,ZodFunction:()=>B2,ZodFirstPartyTypeKind:()=>W_,ZodFile:()=>r2,ZodError:()=>lX,ZodEnum:()=>k4,ZodEmoji:()=>iz,ZodEmail:()=>nz,ZodE164:()=>r_,ZodDiscriminatedUnion:()=>pO,ZodDefault:()=>N2,ZodDate:()=>f6,ZodCustomStringFormat:()=>J4,ZodCustom:()=>l6,ZodCodec:()=>Y_,ZodCatch:()=>K2,ZodCUID2:()=>dz,ZodCUID:()=>oz,ZodCIDRv6:()=>v_,ZodCIDRv4:()=>$_,ZodBoolean:()=>K4,ZodBigIntFormat:()=>__,ZodBigInt:()=>w4,ZodBase64URL:()=>b_,ZodBase64:()=>U_,ZodArray:()=>dO,ZodAny:()=>nO,TimePrecision:()=>c1,NEVER:()=>MU,$output:()=>R1,$input:()=>m1,$brand:()=>ZU});var Z$={};J$(Z$,{version:()=>Tb,util:()=>V,treeifyError:()=>uU,toJSONSchema:()=>Az,toDotPath:()=>kO,safeParseAsync:()=>fU,safeParse:()=>yU,safeEncodeAsync:()=>sJ,safeEncode:()=>eJ,safeDecodeAsync:()=>$0,safeDecode:()=>aJ,registry:()=>J6,regexes:()=>Y$,prettifyError:()=>hU,parseAsync:()=>f4,parse:()=>y4,locales:()=>ov,isValidJWT:()=>EO,isValidBase64URL:()=>HO,isValidBase64:()=>rr,globalRegistry:()=>E$,globalConfig:()=>Sv,formatError:()=>Tv,flattenError:()=>mv,encodeAsync:()=>pJ,encode:()=>oJ,decodeAsync:()=>tJ,decode:()=>dJ,config:()=>d,clone:()=>r$,_xid:()=>B6,_void:()=>kz,_uuidv7:()=>Y6,_uuidv6:()=>Q6,_uuidv4:()=>w6,_uuid:()=>K6,_url:()=>tv,_uppercase:()=>$4,_unknown:()=>Nz,_union:()=>LX,_undefined:()=>rz,_ulid:()=>q6,_uint64:()=>Uz,_uint32:()=>t1,_tuple:()=>HX,_trim:()=>_4,_transform:()=>xX,_toUpperCase:()=>O4,_toLowerCase:()=>N4,_templateLiteral:()=>yX,_symbol:()=>bz,_superRefine:()=>Bz,_success:()=>CX,_stringbool:()=>Lz,_stringFormat:()=>Qv,_string:()=>T1,_startsWith:()=>U4,_size:()=>ev,_set:()=>FX,_safeParseAsync:()=>Iv,_safeParse:()=>kv,_safeEncodeAsync:()=>t4,_safeEncode:()=>d4,_safeDecodeAsync:()=>e4,_safeDecode:()=>p4,_regex:()=>av,_refine:()=>qz,_record:()=>EX,_readonly:()=>hX,_property:()=>Wz,_promise:()=>nX,_positive:()=>Kz,_pipe:()=>uX,_parseAsync:()=>Ov,_parse:()=>Nv,_overwrite:()=>M$,_optional:()=>gX,_number:()=>n1,_nullable:()=>RX,_null:()=>zz,_normalize:()=>z4,_nonpositive:()=>Qz,_nonoptional:()=>TX,_nonnegative:()=>Yz,_never:()=>Oz,_negative:()=>wz,_nativeEnum:()=>ZX,_nanoid:()=>j6,_nan:()=>Xz,_multipleOf:()=>t$,_minSize:()=>e$,_minLength:()=>C$,_min:()=>O$,_mime:()=>r4,_maxSize:()=>Xv,_maxLength:()=>Kv,_max:()=>W$,_map:()=>SX,_lte:()=>W$,_lt:()=>S$,_lowercase:()=>sv,_literal:()=>DX,_length:()=>wv,_lazy:()=>fX,_ksuid:()=>L6,_jwt:()=>Z6,_isoTime:()=>y1,_isoDuration:()=>f1,_isoDateTime:()=>u1,_isoDate:()=>h1,_ipv6:()=>G6,_ipv4:()=>A6,_intersection:()=>GX,_int64:()=>vz,_int32:()=>p1,_int:()=>l1,_includes:()=>v4,_guid:()=>pv,_gte:()=>O$,_gt:()=>F$,_float64:()=>d1,_float32:()=>o1,_file:()=>Vz,_enum:()=>MX,_endsWith:()=>b4,_encodeAsync:()=>l4,_encode:()=>n4,_emoji:()=>W6,_email:()=>X6,_e164:()=>M6,_discriminatedUnion:()=>AX,_default:()=>mX,_decodeAsync:()=>o4,_decode:()=>i4,_date:()=>Iz,_custom:()=>Pz,_cuid2:()=>P6,_cuid:()=>V6,_coercedString:()=>C1,_coercedNumber:()=>i1,_coercedDate:()=>Jz,_coercedBoolean:()=>a1,_coercedBigint:()=>$z,_cidrv6:()=>E6,_cidrv4:()=>H6,_check:()=>gO,_catch:()=>cX,_boolean:()=>e1,_bigint:()=>s1,_base64url:()=>F6,_base64:()=>S6,_array:()=>jz,_any:()=>_z,TimePrecision:()=>c1,NEVER:()=>MU,JSONSchemaGenerator:()=>D6,JSONSchema:()=>RO,Doc:()=>v6,$output:()=>R1,$input:()=>m1,$constructor:()=>X,$brand:()=>ZU,$ZodXID:()=>db,$ZodVoid:()=>jr,$ZodUnknown:()=>Yr,$ZodUnion:()=>k6,$ZodUndefined:()=>Kr,$ZodUUID:()=>ub,$ZodURL:()=>yb,$ZodULID:()=>ob,$ZodType:()=>S,$ZodTuple:()=>I6,$ZodTransform:()=>Mr,$ZodTemplateLiteral:()=>hr,$ZodSymbol:()=>Xr,$ZodSuccess:()=>mr,$ZodStringFormat:()=>h,$ZodString:()=>p$,$ZodSet:()=>Hr,$ZodRegistry:()=>dv,$ZodRecord:()=>Ar,$ZodRealError:()=>N$,$ZodReadonly:()=>ur,$ZodPromise:()=>fr,$ZodPrefault:()=>gr,$ZodPipe:()=>cr,$ZodOptional:()=>Zr,$ZodObjectJIT:()=>qr,$ZodObject:()=>MO,$ZodNumberFormat:()=>Ir,$ZodNumber:()=>N6,$ZodNullable:()=>Dr,$ZodNull:()=>wr,$ZodNonOptional:()=>Rr,$ZodNever:()=>Wr,$ZodNanoID:()=>nb,$ZodNaN:()=>Cr,$ZodMap:()=>Gr,$ZodLiteral:()=>Sr,$ZodLazy:()=>nr,$ZodKSUID:()=>pb,$ZodJWT:()=>Or,$ZodIntersection:()=>Lr,$ZodISOTime:()=>ab,$ZodISODuration:()=>sb,$ZodISODateTime:()=>tb,$ZodISODate:()=>eb,$ZodIPv6:()=>vr,$ZodIPv4:()=>$r,$ZodGUID:()=>cb,$ZodFunction:()=>yr,$ZodFile:()=>Fr,$ZodError:()=>Rv,$ZodEnum:()=>Er,$ZodEncodeError:()=>l$,$ZodEmoji:()=>fb,$ZodEmail:()=>hb,$ZodE164:()=>Nr,$ZodDiscriminatedUnion:()=>Br,$ZodDefault:()=>xr,$ZodDate:()=>Vr,$ZodCustomStringFormat:()=>kr,$ZodCustom:()=>ir,$ZodCodec:()=>hv,$ZodCheckUpperCase:()=>Mb,$ZodCheckStringFormat:()=>Jv,$ZodCheckStartsWith:()=>Db,$ZodCheckSizeEquals:()=>Ab,$ZodCheckRegex:()=>Sb,$ZodCheckProperty:()=>gb,$ZodCheckOverwrite:()=>mb,$ZodCheckNumberFormat:()=>Pb,$ZodCheckMultipleOf:()=>Vb,$ZodCheckMinSize:()=>Lb,$ZodCheckMinLength:()=>Hb,$ZodCheckMimeType:()=>Rb,$ZodCheckMaxSize:()=>Bb,$ZodCheckMaxLength:()=>Gb,$ZodCheckLowerCase:()=>Fb,$ZodCheckLessThan:()=>s4,$ZodCheckLengthEquals:()=>Eb,$ZodCheckIncludes:()=>Zb,$ZodCheckGreaterThan:()=>$6,$ZodCheckEndsWith:()=>xb,$ZodCheckBigIntFormat:()=>qb,$ZodCheck:()=>n,$ZodCatch:()=>Tr,$ZodCUID2:()=>lb,$ZodCUID:()=>ib,$ZodCIDRv6:()=>br,$ZodCIDRv4:()=>Ur,$ZodBoolean:()=>uv,$ZodBigIntFormat:()=>Jr,$ZodBigInt:()=>O6,$ZodBase64URL:()=>_r,$ZodBase64:()=>zr,$ZodAsyncError:()=>G$,$ZodArray:()=>Pr,$ZodAny:()=>Qr});var MU=Object.freeze({status:"aborted"});function X($,U,b){function r(N,O){var k;Object.defineProperty(N,"_zod",{value:N._zod??{},enumerable:!1}),(k=N._zod).traits??(k.traits=new Set),N._zod.traits.add($),U(N,O);for(let J in _.prototype)if(!(J in N))Object.defineProperty(N,J,{value:_.prototype[J].bind(N)});N._zod.constr=_,N._zod.def=O}let v=b?.Parent??Object;class z extends v{}Object.defineProperty(z,"name",{value:$});function _(N){var O;let k=b?.Parent?new z:this;r(k,N),(O=k._zod).deferred??(O.deferred=[]);for(let J of k._zod.deferred)J();return k}return Object.defineProperty(_,"init",{value:r}),Object.defineProperty(_,Symbol.hasInstance,{value:(N)=>{if(b?.Parent&&N instanceof b.Parent)return!0;return N?._zod?.traits?.has($)}}),Object.defineProperty(_,"name",{value:$}),_}var ZU=Symbol("zod_brand");class G$ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class l$ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var Sv={};function d($){if($)Object.assign(Sv,$);return Sv}var V={};J$(V,{unwrapMessage:()=>Fv,uint8ArrayToHex:()=>iJ,uint8ArrayToBase64url:()=>fJ,uint8ArrayToBase64:()=>_O,stringifyPrimitive:()=>P,shallowClone:()=>RU,safeExtend:()=>TJ,required:()=>uJ,randomString:()=>MJ,propertyKeyTypes:()=>Dv,promiseAllObject:()=>FJ,primitiveTypes:()=>mU,prefixIssues:()=>K$,pick:()=>gJ,partial:()=>cJ,optionalKeys:()=>TU,omit:()=>RJ,objectClone:()=>HJ,numKeys:()=>ZJ,nullish:()=>x$,normalizeParams:()=>q,mergeDefs:()=>R$,merge:()=>CJ,jsonStringifyReplacer:()=>rv,joinValues:()=>K,issue:()=>_v,isPlainObject:()=>m$,isObject:()=>o$,hexToUint8Array:()=>nJ,getSizableOrigin:()=>xv,getParsedType:()=>DJ,getLengthableOrigin:()=>gv,getEnumValues:()=>Mv,getElementAtPath:()=>SJ,floatSafeRemainder:()=>xU,finalizeIssue:()=>w$,extend:()=>mJ,escapeRegex:()=>H$,esc:()=>u4,defineLazy:()=>D,createTransparentProxy:()=>xJ,cloneDef:()=>EJ,clone:()=>r$,cleanRegex:()=>Zv,cleanEnum:()=>hJ,captureStackTrace:()=>h4,cached:()=>zv,base64urlToUint8Array:()=>yJ,base64ToUint8Array:()=>zO,assignProp:()=>g$,assertNotEqual:()=>BJ,assertNever:()=>AJ,assertIs:()=>LJ,assertEqual:()=>qJ,assert:()=>GJ,allowsEval:()=>gU,aborted:()=>T$,NUMBER_FORMAT_RANGES:()=>CU,Class:()=>NO,BIGINT_FORMAT_RANGES:()=>cU});function qJ($){return $}function BJ($){return $}function LJ($){}function AJ($){throw Error()}function GJ($){}function Mv($){let U=Object.values($).filter((r)=>typeof r==="number");return Object.entries($).filter(([r,v])=>U.indexOf(+r)===-1).map(([r,v])=>v)}function K($,U="|"){return $.map((b)=>P(b)).join(U)}function rv($,U){if(typeof U==="bigint")return U.toString();return U}function zv($){return{get value(){{let b=$();return Object.defineProperty(this,"value",{value:b}),b}throw Error("cached value already set")}}}function x$($){return $===null||$===void 0}function Zv($){let U=$.startsWith("^")?1:0,b=$.endsWith("$")?$.length-1:$.length;return $.slice(U,b)}function xU($,U){let b=($.toString().split(".")[1]||"").length,r=U.toString(),v=(r.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(r)){let O=r.match(/\d?e-(\d?)/);if(O?.[1])v=Number.parseInt(O[1])}let z=b>v?b:v,_=Number.parseInt($.toFixed(z).replace(".","")),N=Number.parseInt(U.toFixed(z).replace(".",""));return _%N/10**z}var rO=Symbol("evaluating");function D($,U,b){let r=void 0;Object.defineProperty($,U,{get(){if(r===rO)return;if(r===void 0)r=rO,r=b();return r},set(v){Object.defineProperty($,U,{value:v})},configurable:!0})}function HJ($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function g$($,U,b){Object.defineProperty($,U,{value:b,writable:!0,enumerable:!0,configurable:!0})}function R$(...$){let U={};for(let b of $){let r=Object.getOwnPropertyDescriptors(b);Object.assign(U,r)}return Object.defineProperties({},U)}function EJ($){return R$($._zod.def)}function SJ($,U){if(!U)return $;return U.reduce((b,r)=>b?.[r],$)}function FJ($){let U=Object.keys($),b=U.map((r)=>$[r]);return Promise.all(b).then((r)=>{let v={};for(let z=0;z<U.length;z++)v[U[z]]=r[z];return v})}function MJ($=10){let b="";for(let r=0;r<$;r++)b+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return b}function u4($){return JSON.stringify($)}var h4="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function o$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var gU=zv(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function m$($){if(o$($)===!1)return!1;let U=$.constructor;if(U===void 0)return!0;let b=U.prototype;if(o$(b)===!1)return!1;if(Object.prototype.hasOwnProperty.call(b,"isPrototypeOf")===!1)return!1;return!0}function RU($){if(m$($))return{...$};if(Array.isArray($))return[...$];return $}function ZJ($){let U=0;for(let b in $)if(Object.prototype.hasOwnProperty.call($,b))U++;return U}var DJ=($)=>{let U=typeof $;switch(U){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${U}`)}},Dv=new Set(["string","number","symbol"]),mU=new Set(["string","number","bigint","boolean","symbol","undefined"]);function H$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r$($,U,b){let r=new $._zod.constr(U??$._zod.def);if(!U||b?.parent)r._zod.parent=$;return r}function q($){let U=$;if(!U)return{};if(typeof U==="string")return{error:()=>U};if(U?.message!==void 0){if(U?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");U.error=U.message}if(delete U.message,typeof U.error==="string")return{...U,error:()=>U.error};return U}function xJ($){let U;return new Proxy({},{get(b,r,v){return U??(U=$()),Reflect.get(U,r,v)},set(b,r,v,z){return U??(U=$()),Reflect.set(U,r,v,z)},has(b,r){return U??(U=$()),Reflect.has(U,r)},deleteProperty(b,r){return U??(U=$()),Reflect.deleteProperty(U,r)},ownKeys(b){return U??(U=$()),Reflect.ownKeys(U)},getOwnPropertyDescriptor(b,r){return U??(U=$()),Reflect.getOwnPropertyDescriptor(U,r)},defineProperty(b,r,v){return U??(U=$()),Reflect.defineProperty(U,r,v)}})}function P($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function TU($){return Object.keys($).filter((U)=>{return $[U]._zod.optin==="optional"&&$[U]._zod.optout==="optional"})}var CU={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},cU={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function gJ($,U){let b=$._zod.def,r=R$($._zod.def,{get shape(){let v={};for(let z in U){if(!(z in b.shape))throw Error(`Unrecognized key: "${z}"`);if(!U[z])continue;v[z]=b.shape[z]}return g$(this,"shape",v),v},checks:[]});return r$($,r)}function RJ($,U){let b=$._zod.def,r=R$($._zod.def,{get shape(){let v={...$._zod.def.shape};for(let z in U){if(!(z in b.shape))throw Error(`Unrecognized key: "${z}"`);if(!U[z])continue;delete v[z]}return g$(this,"shape",v),v},checks:[]});return r$($,r)}function mJ($,U){if(!m$(U))throw Error("Invalid input to extend: expected a plain object");let b=$._zod.def.checks;if(b&&b.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let v=R$($._zod.def,{get shape(){let z={...$._zod.def.shape,...U};return g$(this,"shape",z),z},checks:[]});return r$($,v)}function TJ($,U){if(!m$(U))throw Error("Invalid input to safeExtend: expected a plain object");let b={...$._zod.def,get shape(){let r={...$._zod.def.shape,...U};return g$(this,"shape",r),r},checks:$._zod.def.checks};return r$($,b)}function CJ($,U){let b=R$($._zod.def,{get shape(){let r={...$._zod.def.shape,...U._zod.def.shape};return g$(this,"shape",r),r},get catchall(){return U._zod.def.catchall},checks:[]});return r$($,b)}function cJ($,U,b){let r=R$(U._zod.def,{get shape(){let v=U._zod.def.shape,z={...v};if(b)for(let _ in b){if(!(_ in v))throw Error(`Unrecognized key: "${_}"`);if(!b[_])continue;z[_]=$?new $({type:"optional",innerType:v[_]}):v[_]}else for(let _ in v)z[_]=$?new $({type:"optional",innerType:v[_]}):v[_];return g$(this,"shape",z),z},checks:[]});return r$(U,r)}function uJ($,U,b){let r=R$(U._zod.def,{get shape(){let v=U._zod.def.shape,z={...v};if(b)for(let _ in b){if(!(_ in z))throw Error(`Unrecognized key: "${_}"`);if(!b[_])continue;z[_]=new $({type:"nonoptional",innerType:v[_]})}else for(let _ in v)z[_]=new $({type:"nonoptional",innerType:v[_]});return g$(this,"shape",z),z},checks:[]});return r$(U,r)}function T$($,U=0){if($.aborted===!0)return!0;for(let b=U;b<$.issues.length;b++)if($.issues[b]?.continue!==!0)return!0;return!1}function K$($,U){return U.map((b)=>{var r;return(r=b).path??(r.path=[]),b.path.unshift($),b})}function Fv($){return typeof $==="string"?$:$?.message}function w$($,U,b){let r={...$,path:$.path??[]};if(!$.message){let v=Fv($.inst?._zod.def?.error?.($))??Fv(U?.error?.($))??Fv(b.customError?.($))??Fv(b.localeError?.($))??"Invalid input";r.message=v}if(delete r.inst,delete r.continue,!U?.reportInput)delete r.input;return r}function xv($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function gv($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function _v(...$){let[U,b,r]=$;if(typeof U==="string")return{message:U,code:"custom",input:b,inst:r};return{...U}}function hJ($){return Object.entries($).filter(([U,b])=>{return Number.isNaN(Number.parseInt(U,10))}).map((U)=>U[1])}function zO($){let U=atob($),b=new Uint8Array(U.length);for(let r=0;r<U.length;r++)b[r]=U.charCodeAt(r);return b}function _O($){let U="";for(let b=0;b<$.length;b++)U+=String.fromCharCode($[b]);return btoa(U)}function yJ($){let U=$.replace(/-/g,"+").replace(/_/g,"/"),b="=".repeat((4-U.length%4)%4);return zO(U+b)}function fJ($){return _O($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function nJ($){let U=$.replace(/^0x/,"");if(U.length%2!==0)throw Error("Invalid hex string length");let b=new Uint8Array(U.length/2);for(let r=0;r<U.length;r+=2)b[r/2]=Number.parseInt(U.slice(r,r+2),16);return b}function iJ($){return Array.from($).map((U)=>U.toString(16).padStart(2,"0")).join("")}class NO{constructor(...$){}}var OO=($,U)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:U,enumerable:!1}),$.message=JSON.stringify(U,rv,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Rv=X("$ZodError",OO),N$=X("$ZodError",OO,{Parent:Error});function mv($,U=(b)=>b.message){let b={},r=[];for(let v of $.issues)if(v.path.length>0)b[v.path[0]]=b[v.path[0]]||[],b[v.path[0]].push(U(v));else r.push(U(v));return{formErrors:r,fieldErrors:b}}function Tv($,U){let b=U||function(z){return z.message},r={_errors:[]},v=(z)=>{for(let _ of z.issues)if(_.code==="invalid_union"&&_.errors.length)_.errors.map((N)=>v({issues:N}));else if(_.code==="invalid_key")v({issues:_.issues});else if(_.code==="invalid_element")v({issues:_.issues});else if(_.path.length===0)r._errors.push(b(_));else{let N=r,O=0;while(O<_.path.length){let k=_.path[O];if(O!==_.path.length-1)N[k]=N[k]||{_errors:[]};else N[k]=N[k]||{_errors:[]},N[k]._errors.push(b(_));N=N[k],O++}}};return v($),r}function uU($,U){let b=U||function(z){return z.message},r={errors:[]},v=(z,_=[])=>{var N,O;for(let k of z.issues)if(k.code==="invalid_union"&&k.errors.length)k.errors.map((J)=>v({issues:J},k.path));else if(k.code==="invalid_key")v({issues:k.issues},k.path);else if(k.code==="invalid_element")v({issues:k.issues},k.path);else{let J=[..._,...k.path];if(J.length===0){r.errors.push(b(k));continue}let W=r,Y=0;while(Y<J.length){let I=J[Y],j=Y===J.length-1;if(typeof I==="string")W.properties??(W.properties={}),(N=W.properties)[I]??(N[I]={errors:[]}),W=W.properties[I];else W.items??(W.items=[]),(O=W.items)[I]??(O[I]={errors:[]}),W=W.items[I];if(j)W.errors.push(b(k));Y++}}};return v($),r}function kO($){let U=[],b=$.map((r)=>typeof r==="object"?r.key:r);for(let r of b)if(typeof r==="number")U.push(`[${r}]`);else if(typeof r==="symbol")U.push(`[${JSON.stringify(String(r))}]`);else if(/[^\w$]/.test(r))U.push(`[${JSON.stringify(r)}]`);else{if(U.length)U.push(".");U.push(r)}return U.join("")}function hU($){let U=[],b=[...$.issues].sort((r,v)=>(r.path??[]).length-(v.path??[]).length);for(let r of b)if(U.push(`✖ ${r.message}`),r.path?.length)U.push(` → at ${kO(r.path)}`);return U.join(`
114
+ `)}var Nv=($)=>(U,b,r,v)=>{let z=r?Object.assign(r,{async:!1}):{async:!1},_=U._zod.run({value:b,issues:[]},z);if(_ instanceof Promise)throw new G$;if(_.issues.length){let N=new(v?.Err??$)(_.issues.map((O)=>w$(O,z,d())));throw h4(N,v?.callee),N}return _.value},y4=Nv(N$),Ov=($)=>async(U,b,r,v)=>{let z=r?Object.assign(r,{async:!0}):{async:!0},_=U._zod.run({value:b,issues:[]},z);if(_ instanceof Promise)_=await _;if(_.issues.length){let N=new(v?.Err??$)(_.issues.map((O)=>w$(O,z,d())));throw h4(N,v?.callee),N}return _.value},f4=Ov(N$),kv=($)=>(U,b,r)=>{let v=r?{...r,async:!1}:{async:!1},z=U._zod.run({value:b,issues:[]},v);if(z instanceof Promise)throw new G$;return z.issues.length?{success:!1,error:new($??Rv)(z.issues.map((_)=>w$(_,v,d())))}:{success:!0,data:z.value}},yU=kv(N$),Iv=($)=>async(U,b,r)=>{let v=r?Object.assign(r,{async:!0}):{async:!0},z=U._zod.run({value:b,issues:[]},v);if(z instanceof Promise)z=await z;return z.issues.length?{success:!1,error:new $(z.issues.map((_)=>w$(_,v,d())))}:{success:!0,data:z.value}},fU=Iv(N$),n4=($)=>(U,b,r)=>{let v=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Nv($)(U,b,v)},oJ=n4(N$),i4=($)=>(U,b,r)=>{return Nv($)(U,b,r)},dJ=i4(N$),l4=($)=>async(U,b,r)=>{let v=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ov($)(U,b,v)},pJ=l4(N$),o4=($)=>async(U,b,r)=>{return Ov($)(U,b,r)},tJ=o4(N$),d4=($)=>(U,b,r)=>{let v=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return kv($)(U,b,v)},eJ=d4(N$),p4=($)=>(U,b,r)=>{return kv($)(U,b,r)},aJ=p4(N$),t4=($)=>async(U,b,r)=>{let v=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Iv($)(U,b,v)},sJ=t4(N$),e4=($)=>async(U,b,r)=>{return Iv($)(U,b,r)},$0=e4(N$);var Y$={};J$(Y$,{xid:()=>oU,uuid7:()=>r0,uuid6:()=>b0,uuid4:()=>U0,uuid:()=>d$,uppercase:()=>jb,unicodeEmail:()=>IO,undefined:()=>Yb,ulid:()=>lU,time:()=>Ob,string:()=>Ib,sha512_hex:()=>L0,sha512_base64url:()=>G0,sha512_base64:()=>A0,sha384_hex:()=>P0,sha384_base64url:()=>B0,sha384_base64:()=>q0,sha256_hex:()=>W0,sha256_base64url:()=>V0,sha256_base64:()=>j0,sha1_hex:()=>w0,sha1_base64url:()=>Y0,sha1_base64:()=>Q0,rfc5322Email:()=>_0,number:()=>Kb,null:()=>Qb,nanoid:()=>pU,md5_hex:()=>J0,md5_base64url:()=>K0,md5_base64:()=>X0,lowercase:()=>Wb,ksuid:()=>dU,ipv6:()=>vb,ipv4:()=>$b,integer:()=>Xb,idnEmail:()=>N0,html5Email:()=>z0,hostname:()=>zb,hex:()=>I0,guid:()=>eU,extendedDuration:()=>v0,emoji:()=>sU,email:()=>aU,e164:()=>_b,duration:()=>tU,domain:()=>k0,datetime:()=>kb,date:()=>Nb,cuid2:()=>iU,cuid:()=>nU,cidrv6:()=>bb,cidrv4:()=>Ub,browserEmail:()=>O0,boolean:()=>wb,bigint:()=>Jb,base64url:()=>a4,base64:()=>rb});var nU=/^[cC][^\s-]{8,}$/,iU=/^[0-9a-z]+$/,lU=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oU=/^[0-9a-vA-V]{20}$/,dU=/^[A-Za-z0-9]{27}$/,pU=/^[a-zA-Z0-9_-]{21}$/,tU=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,v0=/^[-+]?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)?)??$/,eU=/^([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})$/,d$=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},U0=d$(4),b0=d$(6),r0=d$(7),aU=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,z0=/^[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])?)*$/,_0=/^(([^<>()\[\]\\.,;:\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,}))$/,IO=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,N0=IO,O0=/^[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])?)*$/;function sU(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var $b=/^(?:(?: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])$/,vb=/^(([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}|:))$/,Ub=/^((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])$/,bb=/^(([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])$/,rb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,a4=/^[A-Za-z0-9_-]*$/,zb=/^(?=.{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])?)*\.?$/,k0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,_b=/^\+(?:[0-9]){6,14}[0-9]$/,JO="(?:(?:\\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])))",Nb=new RegExp(`^${JO}$`);function XO($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Ob($){return new RegExp(`^${XO($)}$`)}function kb($){let U=XO({precision:$.precision}),b=["Z"];if($.local)b.push("");if($.offset)b.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${U}(?:${b.join("|")})`;return new RegExp(`^${JO}T(?:${r})$`)}var Ib=($)=>{let U=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${U}$`)},Jb=/^-?\d+n?$/,Xb=/^-?\d+$/,Kb=/^-?\d+(?:\.\d+)?/,wb=/^(?:true|false)$/i,Qb=/^null$/i;var Yb=/^undefined$/i;var Wb=/^[^A-Z]*$/,jb=/^[^a-z]*$/,I0=/^[0-9a-fA-F]*$/;function Cv($,U){return new RegExp(`^[A-Za-z0-9+/]{${$}}${U}$`)}function cv($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var J0=/^[0-9a-fA-F]{32}$/,X0=Cv(22,"=="),K0=cv(22),w0=/^[0-9a-fA-F]{40}$/,Q0=Cv(27,"="),Y0=cv(27),W0=/^[0-9a-fA-F]{64}$/,j0=Cv(43,"="),V0=cv(43),P0=/^[0-9a-fA-F]{96}$/,q0=Cv(64,""),B0=cv(64),L0=/^[0-9a-fA-F]{128}$/,A0=Cv(86,"=="),G0=cv(86);var n=X("$ZodCheck",($,U)=>{var b;$._zod??($._zod={}),$._zod.def=U,(b=$._zod).onattach??(b.onattach=[])}),wO={number:"number",bigint:"bigint",object:"date"},s4=X("$ZodCheckLessThan",($,U)=>{n.init($,U);let b=wO[typeof U.value];$._zod.onattach.push((r)=>{let v=r._zod.bag,z=(U.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(U.value<z)if(U.inclusive)v.maximum=U.value;else v.exclusiveMaximum=U.value}),$._zod.check=(r)=>{if(U.inclusive?r.value<=U.value:r.value<U.value)return;r.issues.push({origin:b,code:"too_big",maximum:U.value,input:r.value,inclusive:U.inclusive,inst:$,continue:!U.abort})}}),$6=X("$ZodCheckGreaterThan",($,U)=>{n.init($,U);let b=wO[typeof U.value];$._zod.onattach.push((r)=>{let v=r._zod.bag,z=(U.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(U.value>z)if(U.inclusive)v.minimum=U.value;else v.exclusiveMinimum=U.value}),$._zod.check=(r)=>{if(U.inclusive?r.value>=U.value:r.value>U.value)return;r.issues.push({origin:b,code:"too_small",minimum:U.value,input:r.value,inclusive:U.inclusive,inst:$,continue:!U.abort})}}),Vb=X("$ZodCheckMultipleOf",($,U)=>{n.init($,U),$._zod.onattach.push((b)=>{var r;(r=b._zod.bag).multipleOf??(r.multipleOf=U.value)}),$._zod.check=(b)=>{if(typeof b.value!==typeof U.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof b.value==="bigint"?b.value%U.value===BigInt(0):xU(b.value,U.value)===0)return;b.issues.push({origin:typeof b.value,code:"not_multiple_of",divisor:U.value,input:b.value,inst:$,continue:!U.abort})}}),Pb=X("$ZodCheckNumberFormat",($,U)=>{n.init($,U),U.format=U.format||"float64";let b=U.format?.includes("int"),r=b?"int":"number",[v,z]=CU[U.format];$._zod.onattach.push((_)=>{let N=_._zod.bag;if(N.format=U.format,N.minimum=v,N.maximum=z,b)N.pattern=Xb}),$._zod.check=(_)=>{let N=_.value;if(b){if(!Number.isInteger(N)){_.issues.push({expected:r,format:U.format,code:"invalid_type",continue:!1,input:N,inst:$});return}if(!Number.isSafeInteger(N)){if(N>0)_.issues.push({input:N,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:r,continue:!U.abort});else _.issues.push({input:N,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:r,continue:!U.abort});return}}if(N<v)_.issues.push({origin:"number",input:N,code:"too_small",minimum:v,inclusive:!0,inst:$,continue:!U.abort});if(N>z)_.issues.push({origin:"number",input:N,code:"too_big",maximum:z,inst:$})}}),qb=X("$ZodCheckBigIntFormat",($,U)=>{n.init($,U);let[b,r]=cU[U.format];$._zod.onattach.push((v)=>{let z=v._zod.bag;z.format=U.format,z.minimum=b,z.maximum=r}),$._zod.check=(v)=>{let z=v.value;if(z<b)v.issues.push({origin:"bigint",input:z,code:"too_small",minimum:b,inclusive:!0,inst:$,continue:!U.abort});if(z>r)v.issues.push({origin:"bigint",input:z,code:"too_big",maximum:r,inst:$})}}),Bb=X("$ZodCheckMaxSize",($,U)=>{var b;n.init($,U),(b=$._zod.def).when??(b.when=(r)=>{let v=r.value;return!x$(v)&&v.size!==void 0}),$._zod.onattach.push((r)=>{let v=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(U.maximum<v)r._zod.bag.maximum=U.maximum}),$._zod.check=(r)=>{let v=r.value;if(v.size<=U.maximum)return;r.issues.push({origin:xv(v),code:"too_big",maximum:U.maximum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Lb=X("$ZodCheckMinSize",($,U)=>{var b;n.init($,U),(b=$._zod.def).when??(b.when=(r)=>{let v=r.value;return!x$(v)&&v.size!==void 0}),$._zod.onattach.push((r)=>{let v=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(U.minimum>v)r._zod.bag.minimum=U.minimum}),$._zod.check=(r)=>{let v=r.value;if(v.size>=U.minimum)return;r.issues.push({origin:xv(v),code:"too_small",minimum:U.minimum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Ab=X("$ZodCheckSizeEquals",($,U)=>{var b;n.init($,U),(b=$._zod.def).when??(b.when=(r)=>{let v=r.value;return!x$(v)&&v.size!==void 0}),$._zod.onattach.push((r)=>{let v=r._zod.bag;v.minimum=U.size,v.maximum=U.size,v.size=U.size}),$._zod.check=(r)=>{let v=r.value,z=v.size;if(z===U.size)return;let _=z>U.size;r.issues.push({origin:xv(v),..._?{code:"too_big",maximum:U.size}:{code:"too_small",minimum:U.size},inclusive:!0,exact:!0,input:r.value,inst:$,continue:!U.abort})}}),Gb=X("$ZodCheckMaxLength",($,U)=>{var b;n.init($,U),(b=$._zod.def).when??(b.when=(r)=>{let v=r.value;return!x$(v)&&v.length!==void 0}),$._zod.onattach.push((r)=>{let v=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(U.maximum<v)r._zod.bag.maximum=U.maximum}),$._zod.check=(r)=>{let v=r.value;if(v.length<=U.maximum)return;let _=gv(v);r.issues.push({origin:_,code:"too_big",maximum:U.maximum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Hb=X("$ZodCheckMinLength",($,U)=>{var b;n.init($,U),(b=$._zod.def).when??(b.when=(r)=>{let v=r.value;return!x$(v)&&v.length!==void 0}),$._zod.onattach.push((r)=>{let v=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(U.minimum>v)r._zod.bag.minimum=U.minimum}),$._zod.check=(r)=>{let v=r.value;if(v.length>=U.minimum)return;let _=gv(v);r.issues.push({origin:_,code:"too_small",minimum:U.minimum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Eb=X("$ZodCheckLengthEquals",($,U)=>{var b;n.init($,U),(b=$._zod.def).when??(b.when=(r)=>{let v=r.value;return!x$(v)&&v.length!==void 0}),$._zod.onattach.push((r)=>{let v=r._zod.bag;v.minimum=U.length,v.maximum=U.length,v.length=U.length}),$._zod.check=(r)=>{let v=r.value,z=v.length;if(z===U.length)return;let _=gv(v),N=z>U.length;r.issues.push({origin:_,...N?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},inclusive:!0,exact:!0,input:r.value,inst:$,continue:!U.abort})}}),Jv=X("$ZodCheckStringFormat",($,U)=>{var b,r;if(n.init($,U),$._zod.onattach.push((v)=>{let z=v._zod.bag;if(z.format=U.format,U.pattern)z.patterns??(z.patterns=new Set),z.patterns.add(U.pattern)}),U.pattern)(b=$._zod).check??(b.check=(v)=>{if(U.pattern.lastIndex=0,U.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:U.format,input:v.value,...U.pattern?{pattern:U.pattern.toString()}:{},inst:$,continue:!U.abort})});else(r=$._zod).check??(r.check=()=>{})}),Sb=X("$ZodCheckRegex",($,U)=>{Jv.init($,U),$._zod.check=(b)=>{if(U.pattern.lastIndex=0,U.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:"regex",input:b.value,pattern:U.pattern.toString(),inst:$,continue:!U.abort})}}),Fb=X("$ZodCheckLowerCase",($,U)=>{U.pattern??(U.pattern=Wb),Jv.init($,U)}),Mb=X("$ZodCheckUpperCase",($,U)=>{U.pattern??(U.pattern=jb),Jv.init($,U)}),Zb=X("$ZodCheckIncludes",($,U)=>{n.init($,U);let b=H$(U.includes),r=new RegExp(typeof U.position==="number"?`^.{${U.position}}${b}`:b);U.pattern=r,$._zod.onattach.push((v)=>{let z=v._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(r)}),$._zod.check=(v)=>{if(v.value.includes(U.includes,U.position))return;v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:U.includes,input:v.value,inst:$,continue:!U.abort})}}),Db=X("$ZodCheckStartsWith",($,U)=>{n.init($,U);let b=new RegExp(`^${H$(U.prefix)}.*`);U.pattern??(U.pattern=b),$._zod.onattach.push((r)=>{let v=r._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(b)}),$._zod.check=(r)=>{if(r.value.startsWith(U.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:U.prefix,input:r.value,inst:$,continue:!U.abort})}}),xb=X("$ZodCheckEndsWith",($,U)=>{n.init($,U);let b=new RegExp(`.*${H$(U.suffix)}$`);U.pattern??(U.pattern=b),$._zod.onattach.push((r)=>{let v=r._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(b)}),$._zod.check=(r)=>{if(r.value.endsWith(U.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:U.suffix,input:r.value,inst:$,continue:!U.abort})}});function KO($,U,b){if($.issues.length)U.issues.push(...K$(b,$.issues))}var gb=X("$ZodCheckProperty",($,U)=>{n.init($,U),$._zod.check=(b)=>{let r=U.schema._zod.run({value:b.value[U.property],issues:[]},{});if(r instanceof Promise)return r.then((v)=>KO(v,b,U.property));KO(r,b,U.property);return}}),Rb=X("$ZodCheckMimeType",($,U)=>{n.init($,U);let b=new Set(U.mime);$._zod.onattach.push((r)=>{r._zod.bag.mime=U.mime}),$._zod.check=(r)=>{if(b.has(r.value.type))return;r.issues.push({code:"invalid_value",values:U.mime,input:r.value.type,inst:$,continue:!U.abort})}}),mb=X("$ZodCheckOverwrite",($,U)=>{n.init($,U),$._zod.check=(b)=>{b.value=U.tx(b.value)}});class v6{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let b=$.split(`
115
+ `).filter((z)=>z),r=Math.min(...b.map((z)=>z.length-z.trimStart().length)),v=b.map((z)=>z.slice(r)).map((z)=>" ".repeat(this.indent*2)+z);for(let z of v)this.content.push(z)}compile(){let $=Function,U=this?.args,r=[...(this?.content??[""]).map((v)=>` ${v}`)];return new $(...U,r.join(`
116
+ `))}}var Tb={major:4,minor:1,patch:8};var S=X("$ZodType",($,U)=>{var b;$??($={}),$._zod.def=U,$._zod.bag=$._zod.bag||{},$._zod.version=Tb;let r=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))r.unshift($);for(let v of r)for(let z of v._zod.onattach)z($);if(r.length===0)(b=$._zod).deferred??(b.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let v=(_,N,O)=>{let k=T$(_),J;for(let W of N){if(W._zod.def.when){if(!W._zod.def.when(_))continue}else if(k)continue;let Y=_.issues.length,I=W._zod.check(_);if(I instanceof Promise&&O?.async===!1)throw new G$;if(J||I instanceof Promise)J=(J??Promise.resolve()).then(async()=>{if(await I,_.issues.length===Y)return;if(!k)k=T$(_,Y)});else{if(_.issues.length===Y)continue;if(!k)k=T$(_,Y)}}if(J)return J.then(()=>{return _});return _},z=(_,N,O)=>{if(T$(_))return _.aborted=!0,_;let k=v(N,r,O);if(k instanceof Promise){if(O.async===!1)throw new G$;return k.then((J)=>$._zod.parse(J,O))}return $._zod.parse(k,O)};$._zod.run=(_,N)=>{if(N.skipChecks)return $._zod.parse(_,N);if(N.direction==="backward"){let k=$._zod.parse({value:_.value,issues:[]},{...N,skipChecks:!0});if(k instanceof Promise)return k.then((J)=>{return z(J,_,N)});return z(k,_,N)}let O=$._zod.parse(_,N);if(O instanceof Promise){if(N.async===!1)throw new G$;return O.then((k)=>v(k,r,N))}return v(O,r,N)}}$["~standard"]={validate:(v)=>{try{let z=yU($,v);return z.success?{value:z.data}:{issues:z.error?.issues}}catch(z){return fU($,v).then((_)=>_.success?{value:_.data}:{issues:_.error?.issues})}},vendor:"zod",version:1}}),p$=X("$ZodString",($,U)=>{S.init($,U),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??Ib($._zod.bag),$._zod.parse=(b,r)=>{if(U.coerce)try{b.value=String(b.value)}catch(v){}if(typeof b.value==="string")return b;return b.issues.push({expected:"string",code:"invalid_type",input:b.value,inst:$}),b}}),h=X("$ZodStringFormat",($,U)=>{Jv.init($,U),p$.init($,U)}),cb=X("$ZodGUID",($,U)=>{U.pattern??(U.pattern=eU),h.init($,U)}),ub=X("$ZodUUID",($,U)=>{if(U.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[U.version];if(r===void 0)throw Error(`Invalid UUID version: "${U.version}"`);U.pattern??(U.pattern=d$(r))}else U.pattern??(U.pattern=d$());h.init($,U)}),hb=X("$ZodEmail",($,U)=>{U.pattern??(U.pattern=aU),h.init($,U)}),yb=X("$ZodURL",($,U)=>{h.init($,U),$._zod.check=(b)=>{try{let r=b.value.trim(),v=new URL(r);if(U.hostname){if(U.hostname.lastIndex=0,!U.hostname.test(v.hostname))b.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:zb.source,input:b.value,inst:$,continue:!U.abort})}if(U.protocol){if(U.protocol.lastIndex=0,!U.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol))b.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:U.protocol.source,input:b.value,inst:$,continue:!U.abort})}if(U.normalize)b.value=v.href;else b.value=r;return}catch(r){b.issues.push({code:"invalid_format",format:"url",input:b.value,inst:$,continue:!U.abort})}}}),fb=X("$ZodEmoji",($,U)=>{U.pattern??(U.pattern=sU()),h.init($,U)}),nb=X("$ZodNanoID",($,U)=>{U.pattern??(U.pattern=pU),h.init($,U)}),ib=X("$ZodCUID",($,U)=>{U.pattern??(U.pattern=nU),h.init($,U)}),lb=X("$ZodCUID2",($,U)=>{U.pattern??(U.pattern=iU),h.init($,U)}),ob=X("$ZodULID",($,U)=>{U.pattern??(U.pattern=lU),h.init($,U)}),db=X("$ZodXID",($,U)=>{U.pattern??(U.pattern=oU),h.init($,U)}),pb=X("$ZodKSUID",($,U)=>{U.pattern??(U.pattern=dU),h.init($,U)}),tb=X("$ZodISODateTime",($,U)=>{U.pattern??(U.pattern=kb(U)),h.init($,U)}),eb=X("$ZodISODate",($,U)=>{U.pattern??(U.pattern=Nb),h.init($,U)}),ab=X("$ZodISOTime",($,U)=>{U.pattern??(U.pattern=Ob(U)),h.init($,U)}),sb=X("$ZodISODuration",($,U)=>{U.pattern??(U.pattern=tU),h.init($,U)}),$r=X("$ZodIPv4",($,U)=>{U.pattern??(U.pattern=$b),h.init($,U),$._zod.onattach.push((b)=>{let r=b._zod.bag;r.format="ipv4"})}),vr=X("$ZodIPv6",($,U)=>{U.pattern??(U.pattern=vb),h.init($,U),$._zod.onattach.push((b)=>{let r=b._zod.bag;r.format="ipv6"}),$._zod.check=(b)=>{try{new URL(`http://[${b.value}]`)}catch{b.issues.push({code:"invalid_format",format:"ipv6",input:b.value,inst:$,continue:!U.abort})}}}),Ur=X("$ZodCIDRv4",($,U)=>{U.pattern??(U.pattern=Ub),h.init($,U)}),br=X("$ZodCIDRv6",($,U)=>{U.pattern??(U.pattern=bb),h.init($,U),$._zod.check=(b)=>{let r=b.value.split("/");try{if(r.length!==2)throw Error();let[v,z]=r;if(!z)throw Error();let _=Number(z);if(`${_}`!==z)throw Error();if(_<0||_>128)throw Error();new URL(`http://[${v}]`)}catch{b.issues.push({code:"invalid_format",format:"cidrv6",input:b.value,inst:$,continue:!U.abort})}}});function rr($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var zr=X("$ZodBase64",($,U)=>{U.pattern??(U.pattern=rb),h.init($,U),$._zod.onattach.push((b)=>{b._zod.bag.contentEncoding="base64"}),$._zod.check=(b)=>{if(rr(b.value))return;b.issues.push({code:"invalid_format",format:"base64",input:b.value,inst:$,continue:!U.abort})}});function HO($){if(!a4.test($))return!1;let U=$.replace(/[-_]/g,(r)=>r==="-"?"+":"/"),b=U.padEnd(Math.ceil(U.length/4)*4,"=");return rr(b)}var _r=X("$ZodBase64URL",($,U)=>{U.pattern??(U.pattern=a4),h.init($,U),$._zod.onattach.push((b)=>{b._zod.bag.contentEncoding="base64url"}),$._zod.check=(b)=>{if(HO(b.value))return;b.issues.push({code:"invalid_format",format:"base64url",input:b.value,inst:$,continue:!U.abort})}}),Nr=X("$ZodE164",($,U)=>{U.pattern??(U.pattern=_b),h.init($,U)});function EO($,U=null){try{let b=$.split(".");if(b.length!==3)return!1;let[r]=b;if(!r)return!1;let v=JSON.parse(atob(r));if("typ"in v&&v?.typ!=="JWT")return!1;if(!v.alg)return!1;if(U&&(!("alg"in v)||v.alg!==U))return!1;return!0}catch{return!1}}var Or=X("$ZodJWT",($,U)=>{h.init($,U),$._zod.check=(b)=>{if(EO(b.value,U.alg))return;b.issues.push({code:"invalid_format",format:"jwt",input:b.value,inst:$,continue:!U.abort})}}),kr=X("$ZodCustomStringFormat",($,U)=>{h.init($,U),$._zod.check=(b)=>{if(U.fn(b.value))return;b.issues.push({code:"invalid_format",format:U.format,input:b.value,inst:$,continue:!U.abort})}}),N6=X("$ZodNumber",($,U)=>{S.init($,U),$._zod.pattern=$._zod.bag.pattern??Kb,$._zod.parse=(b,r)=>{if(U.coerce)try{b.value=Number(b.value)}catch(_){}let v=b.value;if(typeof v==="number"&&!Number.isNaN(v)&&Number.isFinite(v))return b;let z=typeof v==="number"?Number.isNaN(v)?"NaN":!Number.isFinite(v)?"Infinity":void 0:void 0;return b.issues.push({expected:"number",code:"invalid_type",input:v,inst:$,...z?{received:z}:{}}),b}}),Ir=X("$ZodNumber",($,U)=>{Pb.init($,U),N6.init($,U)}),uv=X("$ZodBoolean",($,U)=>{S.init($,U),$._zod.pattern=wb,$._zod.parse=(b,r)=>{if(U.coerce)try{b.value=Boolean(b.value)}catch(z){}let v=b.value;if(typeof v==="boolean")return b;return b.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:$}),b}}),O6=X("$ZodBigInt",($,U)=>{S.init($,U),$._zod.pattern=Jb,$._zod.parse=(b,r)=>{if(U.coerce)try{b.value=BigInt(b.value)}catch(v){}if(typeof b.value==="bigint")return b;return b.issues.push({expected:"bigint",code:"invalid_type",input:b.value,inst:$}),b}}),Jr=X("$ZodBigInt",($,U)=>{qb.init($,U),O6.init($,U)}),Xr=X("$ZodSymbol",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value;if(typeof v==="symbol")return b;return b.issues.push({expected:"symbol",code:"invalid_type",input:v,inst:$}),b}}),Kr=X("$ZodUndefined",($,U)=>{S.init($,U),$._zod.pattern=Yb,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(b,r)=>{let v=b.value;if(typeof v>"u")return b;return b.issues.push({expected:"undefined",code:"invalid_type",input:v,inst:$}),b}}),wr=X("$ZodNull",($,U)=>{S.init($,U),$._zod.pattern=Qb,$._zod.values=new Set([null]),$._zod.parse=(b,r)=>{let v=b.value;if(v===null)return b;return b.issues.push({expected:"null",code:"invalid_type",input:v,inst:$}),b}}),Qr=X("$ZodAny",($,U)=>{S.init($,U),$._zod.parse=(b)=>b}),Yr=X("$ZodUnknown",($,U)=>{S.init($,U),$._zod.parse=(b)=>b}),Wr=X("$ZodNever",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{return b.issues.push({expected:"never",code:"invalid_type",input:b.value,inst:$}),b}}),jr=X("$ZodVoid",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value;if(typeof v>"u")return b;return b.issues.push({expected:"void",code:"invalid_type",input:v,inst:$}),b}}),Vr=X("$ZodDate",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{if(U.coerce)try{b.value=new Date(b.value)}catch(N){}let v=b.value,z=v instanceof Date;if(z&&!Number.isNaN(v.getTime()))return b;return b.issues.push({expected:"date",code:"invalid_type",input:v,...z?{received:"Invalid Date"}:{},inst:$}),b}});function YO($,U,b){if($.issues.length)U.issues.push(...K$(b,$.issues));U.value[b]=$.value}var Pr=X("$ZodArray",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value;if(!Array.isArray(v))return b.issues.push({expected:"array",code:"invalid_type",input:v,inst:$}),b;b.value=Array(v.length);let z=[];for(let _=0;_<v.length;_++){let N=v[_],O=U.element._zod.run({value:N,issues:[]},r);if(O instanceof Promise)z.push(O.then((k)=>YO(k,b,_)));else YO(O,b,_)}if(z.length)return Promise.all(z).then(()=>b);return b}});function _6($,U,b,r){if($.issues.length)U.issues.push(...K$(b,$.issues));if($.value===void 0){if(b in r)U.value[b]=void 0}else U.value[b]=$.value}function SO($){let U=Object.keys($.shape);for(let r of U)if(!$.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let b=TU($.shape);return{...$,keys:U,keySet:new Set(U),numKeys:U.length,optionalKeys:new Set(b)}}function FO($,U,b,r,v,z){let _=[],N=v.keySet,O=v.catchall._zod,k=O.def.type;for(let J of Object.keys(U)){if(N.has(J))continue;if(k==="never"){_.push(J);continue}let W=O.run({value:U[J],issues:[]},r);if(W instanceof Promise)$.push(W.then((Y)=>_6(Y,b,J,U)));else _6(W,b,J,U)}if(_.length)b.issues.push({code:"unrecognized_keys",keys:_,input:U,inst:z});if(!$.length)return b;return Promise.all($).then(()=>{return b})}var MO=X("$ZodObject",($,U)=>{S.init($,U);let b=zv(()=>SO(U));D($._zod,"propValues",()=>{let _=U.shape,N={};for(let O in _){let k=_[O]._zod;if(k.values){N[O]??(N[O]=new Set);for(let J of k.values)N[O].add(J)}}return N});let r=o$,v=U.catchall,z;$._zod.parse=(_,N)=>{z??(z=b.value);let O=_.value;if(!r(O))return _.issues.push({expected:"object",code:"invalid_type",input:O,inst:$}),_;_.value={};let k=[],J=z.shape;for(let W of z.keys){let I=J[W]._zod.run({value:O[W],issues:[]},N);if(I instanceof Promise)k.push(I.then((j)=>_6(j,_,W,O)));else _6(I,_,W,O)}if(!v)return k.length?Promise.all(k).then(()=>_):_;return FO(k,O,_,N,b.value,$)}}),qr=X("$ZodObjectJIT",($,U)=>{MO.init($,U);let b=$._zod.parse,r=zv(()=>SO(U)),v=(Y)=>{let I=new v6(["shape","payload","ctx"]),j=r.value,B=(T)=>{let t=u4(T);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};I.write("const input = payload.value;");let x=Object.create(null),g=0;for(let T of j.keys)x[T]=`key_${g++}`;I.write("const newResult = {};");for(let T of j.keys){let t=x[T],Q$=u4(T);I.write(`const ${t} = ${B(T)};`),I.write(`
117
+ if (${t}.issues.length) {
118
+ payload.issues = payload.issues.concat(${t}.issues.map(iss => ({
119
119
  ...iss,
120
- path: iss.path ? [${he}, ...iss.path] : [${he}]
120
+ path: iss.path ? [${Q$}, ...iss.path] : [${Q$}]
121
121
  })));
122
122
  }
123
123
 
124
124
 
125
- if (${X}.value === undefined) {
126
- if (${he} in input) {
127
- newResult[${he}] = undefined;
125
+ if (${t}.value === undefined) {
126
+ if (${Q$} in input) {
127
+ newResult[${Q$}] = undefined;
128
128
  }
129
129
  } else {
130
- newResult[${he}] = ${X}.value;
130
+ newResult[${Q$}] = ${t}.value;
131
131
  }
132
132
 
133
- `)}u.write("payload.value = newResult;"),u.write("return payload;");let G=u.compile();return(N,X)=>G(h,N,X)},i,a=Je,s=!Dt.jitless,l=s&&Ro.value,d=r.catchall,v;e._zod.parse=(h,u)=>{v??(v=o.value);let y=h.value;if(!a(y))return h.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),h;if(s&&l&&u?.async===!1&&u.jitless!==!0){if(!i)i=t(r.shape);if(h=i(h,u),!d)return h;return Cd([],y,h,u,v,e)}return n(h,u)}});function _d(e,r,n,o){for(let i of e)if(i.issues.length===0)return r.value=i.value,r;let t=e.filter((i)=>!Ne(i));if(t.length===1)return r.value=t[0].value,t[0];return r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:e.map((i)=>i.issues.map((a)=>ge(a,o,q())))}),r}var dn=m("$ZodUnion",(e,r)=>{D.init(e,r),E(e._zod,"optin",()=>r.options.some((t)=>t._zod.optin==="optional")?"optional":void 0),E(e._zod,"optout",()=>r.options.some((t)=>t._zod.optout==="optional")?"optional":void 0),E(e._zod,"values",()=>{if(r.options.every((t)=>t._zod.values))return new Set(r.options.flatMap((t)=>Array.from(t._zod.values)));return}),E(e._zod,"pattern",()=>{if(r.options.every((t)=>t._zod.pattern)){let t=r.options.map((i)=>i._zod.pattern);return new RegExp(`^(${t.map((i)=>Ct(i.source)).join("|")})$`)}return});let n=r.options.length===1,o=r.options[0]._zod.run;e._zod.parse=(t,i)=>{if(n)return o(t,i);let a=!1,s=[];for(let c of r.options){let l=c._zod.run({value:t.value,issues:[]},i);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}if(!a)return _d(s,t,e,i);return Promise.all(s).then((c)=>_d(c,t,e,i))}}),Sa=m("$ZodDiscriminatedUnion",(e,r)=>{dn.init(e,r);let n=e._zod.parse;E(e._zod,"propValues",()=>{let t={};for(let i of r.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${r.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){if(!t[s])t[s]=new Set;for(let l of c)t[s].add(l)}}return t});let o=at(()=>{let t=r.options,i=new Map;for(let a of t){let s=a._zod.propValues?.[r.discriminator];if(!s||s.size===0)throw Error(`Invalid discriminated union option at index "${r.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(t,i)=>{let a=t.value;if(!Je(a))return t.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),t;let s=o.value.get(a?.[r.discriminator]);if(s)return s._zod.run(t,i);if(r.unionFallback)return n(t,i);return t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:r.discriminator,input:a,path:[r.discriminator],inst:e}),t}}),Ia=m("$ZodIntersection",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value,i=r.left._zod.run({value:t,issues:[]},o),a=r.right._zod.run({value:t,issues:[]},o);if(i instanceof Promise||a instanceof Promise)return Promise.all([i,a]).then(([c,l])=>kd(n,c,l));return kd(n,i,a)}});function Zi(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e===+r)return{valid:!0,data:e};if(Re(e)&&Re(r)){let n=Object.keys(r),o=Object.keys(e).filter((i)=>n.indexOf(i)!==-1),t={...e,...r};for(let i of o){let a=Zi(e[i],r[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};t[i]=a.data}return{valid:!0,data:t}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let t=e[o],i=r[o],a=Zi(t,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kd(e,r,n){if(r.issues.length)e.issues.push(...r.issues);if(n.issues.length)e.issues.push(...n.issues);if(Ne(e))return e;let o=Zi(r.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var mn=m("$ZodTuple",(e,r)=>{D.init(e,r);let n=r.items,o=n.length-[...n].reverse().findIndex((t)=>t._zod.optin!=="optional");e._zod.parse=(t,i)=>{let a=t.value;if(!Array.isArray(a))return t.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),t;t.value=[];let s=[];if(!r.rest){let l=a.length>n.length,d=a.length<o-1;if(l||d)return t.issues.push({...l?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),t}let c=-1;for(let l of n){if(c++,c>=a.length){if(c>=o)continue}let d=l._zod.run({value:a[c],issues:[]},i);if(d instanceof Promise)s.push(d.then((v)=>nn(v,t,c)));else nn(d,t,c)}if(r.rest){let l=a.slice(n.length);for(let d of l){c++;let v=r.rest._zod.run({value:d,issues:[]},i);if(v instanceof Promise)s.push(v.then((h)=>nn(h,t,c)));else nn(v,t,c)}}if(s.length)return Promise.all(s).then(()=>t);return t}});function nn(e,r,n){if(e.issues.length)r.issues.push(...fe(n,e.issues));r.value[n]=e.value}var Ta=m("$ZodRecord",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!Re(t))return n.issues.push({expected:"record",code:"invalid_type",input:t,inst:e}),n;let i=[];if(r.keyType._zod.values){let a=r.keyType._zod.values;n.value={};for(let c of a)if(typeof c==="string"||typeof c==="number"||typeof c==="symbol"){let l=r.valueType._zod.run({value:t[c],issues:[]},o);if(l instanceof Promise)i.push(l.then((d)=>{if(d.issues.length)n.issues.push(...fe(c,d.issues));n.value[c]=d.value}));else{if(l.issues.length)n.issues.push(...fe(c,l.issues));n.value[c]=l.value}}let s;for(let c in t)if(!a.has(c))s=s??[],s.push(c);if(s&&s.length>0)n.issues.push({code:"unrecognized_keys",input:t,inst:e,keys:s})}else{n.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let s=r.keyType._zod.run({value:a,issues:[]},o);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map((l)=>ge(l,o,q())),input:a,path:[a],inst:e}),n.value[s.value]=s.value;continue}let c=r.valueType._zod.run({value:t[a],issues:[]},o);if(c instanceof Promise)i.push(c.then((l)=>{if(l.issues.length)n.issues.push(...fe(a,l.issues));n.value[s.value]=l.value}));else{if(c.issues.length)n.issues.push(...fe(a,c.issues));n.value[s.value]=c.value}}}if(i.length)return Promise.all(i).then(()=>n);return n}}),Oa=m("$ZodMap",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!(t instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:t,inst:e}),n;let i=[];n.value=new Map;for(let[a,s]of t){let c=r.keyType._zod.run({value:a,issues:[]},o),l=r.valueType._zod.run({value:s,issues:[]},o);if(c instanceof Promise||l instanceof Promise)i.push(Promise.all([c,l]).then(([d,v])=>{$d(d,v,n,a,t,e,o)}));else $d(c,l,n,a,t,e,o)}if(i.length)return Promise.all(i).then(()=>n);return n}});function $d(e,r,n,o,t,i,a){if(e.issues.length)if(Et.has(typeof o))n.issues.push(...fe(o,e.issues));else n.issues.push({code:"invalid_key",origin:"map",input:t,inst:i,issues:e.issues.map((s)=>ge(s,a,q()))});if(r.issues.length)if(Et.has(typeof o))n.issues.push(...fe(o,r.issues));else n.issues.push({origin:"map",code:"invalid_element",input:t,inst:i,key:o,issues:r.issues.map((s)=>ge(s,a,q()))});n.value.set(e.value,r.value)}var Da=m("$ZodSet",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!(t instanceof Set))return n.issues.push({input:t,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of t){let s=r.valueType._zod.run({value:a,issues:[]},o);if(s instanceof Promise)i.push(s.then((c)=>xd(c,n)));else xd(s,n)}if(i.length)return Promise.all(i).then(()=>n);return n}});function xd(e,r){if(e.issues.length)r.issues.push(...e.issues);r.value.add(e.value)}var Pa=m("$ZodEnum",(e,r)=>{D.init(e,r);let n=zt(r.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((t)=>Et.has(typeof t)).map((t)=>typeof t==="string"?Te(t):t.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let a=t.value;if(o.has(a))return t;return t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),za=m("$ZodLiteral",(e,r)=>{if(D.init(e,r),r.values.length===0)throw Error("Cannot create literal schema with no valid values");e._zod.values=new Set(r.values),e._zod.pattern=new RegExp(`^(${r.values.map((n)=>typeof n==="string"?Te(n):n?Te(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let t=n.value;if(e._zod.values.has(t))return n;return n.issues.push({code:"invalid_value",values:r.values,input:t,inst:e}),n}}),Ca=m("$ZodFile",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(t instanceof File)return n;return n.issues.push({expected:"file",code:"invalid_type",input:t,inst:e}),n}}),Ea=m("$ZodTransform",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new He(e.constructor.name);let t=r.transform(n.value,n);if(o.async)return(t instanceof Promise?t:Promise.resolve(t)).then((a)=>(n.value=a,n));if(t instanceof Promise)throw new Ie;return n.value=t,n}});function wd(e,r){if(e.issues.length&&r===void 0)return{issues:[],value:void 0};return e}var ja=m("$ZodOptional",(e,r)=>{D.init(e,r),e._zod.optin="optional",e._zod.optout="optional",E(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),E(e._zod,"pattern",()=>{let n=r.innerType._zod.pattern;return n?new RegExp(`^(${Ct(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(r.innerType._zod.optin==="optional"){let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>wd(i,n.value));return wd(t,n.value)}if(n.value===void 0)return n;return r.innerType._zod.run(n,o)}}),Aa=m("$ZodNullable",(e,r)=>{D.init(e,r),E(e._zod,"optin",()=>r.innerType._zod.optin),E(e._zod,"optout",()=>r.innerType._zod.optout),E(e._zod,"pattern",()=>{let n=r.innerType._zod.pattern;return n?new RegExp(`^(${Ct(n.source)}|null)$`):void 0}),E(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>{if(n.value===null)return n;return r.innerType._zod.run(n,o)}}),Ma=m("$ZodDefault",(e,r)=>{D.init(e,r),e._zod.optin="optional",E(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);if(n.value===void 0)return n.value=r.defaultValue,n;let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>Sd(i,r));return Sd(t,r)}});function Sd(e,r){if(e.value===void 0)e.value=r.defaultValue;return e}var Ra=m("$ZodPrefault",(e,r)=>{D.init(e,r),e._zod.optin="optional",E(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);if(n.value===void 0)n.value=r.defaultValue;return r.innerType._zod.run(n,o)}}),Na=m("$ZodNonOptional",(e,r)=>{D.init(e,r),E(e._zod,"values",()=>{let n=r.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>Id(i,e));return Id(t,e)}});function Id(e,r){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r});return e}var Ua=m("$ZodSuccess",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new He("ZodSuccess");let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>(n.value=i.issues.length===0,n));return n.value=t.issues.length===0,n}}),La=m("$ZodCatch",(e,r)=>{D.init(e,r),E(e._zod,"optin",()=>r.innerType._zod.optin),E(e._zod,"optout",()=>r.innerType._zod.optout),E(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>{if(n.value=i.value,i.issues.length)n.value=r.catchValue({...n,error:{issues:i.issues.map((a)=>ge(a,o,q()))},input:n.value}),n.issues=[];return n});if(n.value=t.value,t.issues.length)n.value=r.catchValue({...n,error:{issues:t.issues.map((i)=>ge(i,o,q()))},input:n.value}),n.issues=[];return n}}),Za=m("$ZodNaN",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(typeof n.value!=="number"||!Number.isNaN(n.value))return n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n;return n}}),Fa=m("$ZodPipe",(e,r)=>{D.init(e,r),E(e._zod,"values",()=>r.in._zod.values),E(e._zod,"optin",()=>r.in._zod.optin),E(e._zod,"optout",()=>r.out._zod.optout),E(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=r.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>on(a,r.in,o));return on(i,r.in,o)}let t=r.in._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>on(i,r.out,o));return on(t,r.out,o)}});function on(e,r,n){if(e.issues.length)return e.aborted=!0,e;return r._zod.run({value:e.value,issues:e.issues},n)}var Ft=m("$ZodCodec",(e,r)=>{D.init(e,r),E(e._zod,"values",()=>r.in._zod.values),E(e._zod,"optin",()=>r.in._zod.optin),E(e._zod,"optout",()=>r.out._zod.optout),E(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=r.in._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>an(a,r,o));return an(i,r,o)}else{let i=r.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>an(a,r,o));return an(i,r,o)}}});function an(e,r,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let t=r.transform(e.value,e);if(t instanceof Promise)return t.then((i)=>sn(e,i,r.out,n));return sn(e,t,r.out,n)}else{let t=r.reverseTransform(e.value,e);if(t instanceof Promise)return t.then((i)=>sn(e,i,r.in,n));return sn(e,t,r.in,n)}}function sn(e,r,n,o){if(e.issues.length)return e.aborted=!0,e;return n._zod.run({value:r,issues:e.issues},o)}var Ga=m("$ZodReadonly",(e,r)=>{D.init(e,r),E(e._zod,"propValues",()=>r.innerType._zod.propValues),E(e._zod,"values",()=>r.innerType._zod.values),E(e._zod,"optin",()=>r.innerType._zod.optin),E(e._zod,"optout",()=>r.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then(Td);return Td(t)}});function Td(e){return e.value=Object.freeze(e.value),e}var Va=m("$ZodTemplateLiteral",(e,r)=>{D.init(e,r);let n=[];for(let o of r.parts)if(typeof o==="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let t=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${o._zod.traits}`);let i=t.startsWith("^")?1:0,a=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(i,a))}else if(o===null||Uo.has(typeof o))n.push(Te(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,t)=>{if(typeof o.value!=="string")return o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(o.value))return o.issues.push({input:o.value,inst:e,code:"invalid_format",format:r.format??"template_literal",pattern:e._zod.pattern.source}),o;return o}}),Wa=m("$ZodFunction",(e,r)=>(D.init(e,r),e._def=r,e._zod.def=r,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return function(...o){let t=e._def.input?Gr(e._def.input,o):o,i=Reflect.apply(n,this,t);if(e._def.output)return Gr(e._def.output,i);return i}},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return async function(...o){let t=e._def.input?await Vr(e._def.input,o):o,i=await Reflect.apply(n,this,t);if(e._def.output)return await Vr(e._def.output,i);return i}},e._zod.parse=(n,o)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let o=e.constructor;if(Array.isArray(n[0]))return new o({type:"function",input:new mn({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new o({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),Ba=m("$ZodPromise",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>Promise.resolve(n.value).then((t)=>r.innerType._zod.run({value:t,issues:[]},o))}),Ha=m("$ZodLazy",(e,r)=>{D.init(e,r),E(e._zod,"innerType",()=>r.getter()),E(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),E(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),E(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),E(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),Ja=m("$ZodCustom",(e,r)=>{W.init(e,r),D.init(e,r),e._zod.parse=(n,o)=>n,e._zod.check=(n)=>{let o=n.value,t=r.fn(o);if(t instanceof Promise)return t.then((i)=>Od(i,n,o,e));Od(t,n,o,e);return}});function Od(e,r,n,o){if(!e){let t={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)t.params=o._zod.def.params;r.issues.push(st(t))}}var Jt={};me(Jt,{ar:()=>qa,az:()=>Ka,be:()=>Xa,ca:()=>Ya,cs:()=>Qa,da:()=>es,de:()=>ts,en:()=>Gt,eo:()=>rs,es:()=>ns,fa:()=>os,fi:()=>is,fr:()=>as,frCA:()=>ss,he:()=>cs,hu:()=>ls,id:()=>us,is:()=>ds,it:()=>ms,ja:()=>ps,ka:()=>fs,kh:()=>gs,km:()=>Vt,ko:()=>hs,lt:()=>vs,mk:()=>ys,ms:()=>bs,nl:()=>_s,no:()=>ks,ota:()=>$s,pl:()=>ws,ps:()=>xs,pt:()=>Ss,ru:()=>Is,sl:()=>Ts,sv:()=>Os,ta:()=>Ds,th:()=>Ps,tr:()=>zs,ua:()=>Cs,uk:()=>Ht,ur:()=>Es,vi:()=>js,yo:()=>Rs,zhCN:()=>As,zhTW:()=>Ms});var zh=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(t)=>{switch(t.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${t.expected}، ولكن تم إدخال ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${_(t.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return` أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${i} ${t.maximum.toString()} ${a.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${i} ${t.minimum.toString()} ${a.unit}`;return`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${t.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${o[i.format]??t.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${t.divisor}`;case"unrecognized_keys":return`معرف${t.keys.length>1?"ات":""} غريب${t.keys.length>1?"ة":""}: ${p(t.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${t.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${t.origin}`;default:return"مدخل غير مقبول"}}};function qa(){return{localeError:zh()}}var Ch=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${t.expected}, daxil olan ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Yanlış dəyər: gözlənilən ${_(t.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${i}${t.maximum.toString()} ${a.unit??"element"}`;return`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Çox kiçik: gözlənilən ${t.origin} ${i}${t.minimum.toString()} ${a.unit}`;return`Çox kiçik: gözlənilən ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${o[i.format]??t.format}`}case"not_multiple_of":return`Yanlış ədəd: ${t.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${t.keys.length>1?"lar":""}: ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${t.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Ka(){return{localeError:Ch()}}function jd(e,r,n,o){let t=Math.abs(e),i=t%10,a=t%100;if(a>=11&&a<=19)return o;if(i===1)return r;if(i>=2&&i<=4)return n;return o}var Eh=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"лік";case"object":{if(Array.isArray(t))return"масіў";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(t)=>{switch(t.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${t.expected}, атрымана ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Няправільны ўвод: чакалася ${_(t.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a){let s=Number(t.maximum),c=jd(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна ${a.verb} ${i}${t.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна быць ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a){let s=Number(t.minimum),c=jd(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${t.origin} павінна ${a.verb} ${i}${t.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${t.origin} павінна быць ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${o[i.format]??t.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${t.keys.length>1?"ключы":"ключ"}: ${p(t.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${t.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${t.origin}`;default:return"Няправільны ўвод"}}};function Xa(){return{localeError:Eh()}}var jh=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(t)=>{switch(t.code){case"invalid_type":return`Tipus invàlid: s'esperava ${t.expected}, s'ha rebut ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Valor invàlid: s'esperava ${_(t.values[0])}`;return`Opció invàlida: s'esperava una de ${p(t.values," o ")}`;case"too_big":{let i=t.inclusive?"com a màxim":"menys de",a=r(t.origin);if(a)return`Massa gran: s'esperava que ${t.origin??"el valor"} contingués ${i} ${t.maximum.toString()} ${a.unit??"elements"}`;return`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?"com a mínim":"més de",a=r(t.origin);if(a)return`Massa petit: s'esperava que ${t.origin} contingués ${i} ${t.minimum.toString()} ${a.unit}`;return`Massa petit: s'esperava que ${t.origin} fos ${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${o[i.format]??t.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${t.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${t.origin}`;default:return"Entrada invàlida"}}};function Ya(){return{localeError:jh()}}var Ah=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(t))return"pole";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(t)=>{switch(t.code){case"invalid_type":return`Neplatný vstup: očekáváno ${t.expected}, obdrženo ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Neplatný vstup: očekáváno ${_(t.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Hodnota je příliš velká: ${t.origin??"hodnota"} musí mít ${i}${t.maximum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš velká: ${t.origin??"hodnota"} musí být ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Hodnota je příliš malá: ${t.origin??"hodnota"} musí mít ${i}${t.minimum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš malá: ${t.origin??"hodnota"} musí být ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${o[i.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${t.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${p(t.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function Qa(){return{localeError:Ah()}}var Mh=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},r={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function n(a){return e[a]??null}function o(a){return r[a]??a}let t=(a)=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":{if(Array.isArray(a))return"liste";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name;return"objekt"}}return s},i={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",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"};return(a)=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${o(a.expected)}, fik ${o(t(a.input))}`;case"invalid_value":if(a.values.length===1)return`Ugyldig værdi: forventede ${_(a.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${p(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=n(a.origin),l=o(a.origin);if(c)return`For stor: forventede ${l??"value"} ${c.verb} ${s} ${a.maximum.toString()} ${c.unit??"elementer"}`;return`For stor: forventede ${l??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=n(a.origin),l=o(a.origin);if(c)return`For lille: forventede ${l} ${c.verb} ${s} ${a.minimum.toString()} ${c.unit}`;return`For lille: forventede ${l} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;if(s.format==="starts_with")return`Ugyldig streng: skal starte med "${s.prefix}"`;if(s.format==="ends_with")return`Ugyldig streng: skal ende med "${s.suffix}"`;if(s.format==="includes")return`Ugyldig streng: skal indeholde "${s.includes}"`;if(s.format==="regex")return`Ugyldig streng: skal matche mønsteret ${s.pattern}`;return`Ugyldig ${i[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${p(a.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${a.origin}`;default:return"Ugyldigt input"}}};function es(){return{localeError:Mh()}}var Rh=()=>{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 r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"Zahl";case"object":{if(Array.isArray(t))return"Array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${t.expected}, erhalten ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ungültige Eingabe: erwartet ${_(t.values[0])}`;return`Ungültige Option: erwartet eine von ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Zu groß: erwartet, dass ${t.origin??"Wert"} ${i}${t.maximum.toString()} ${a.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${t.origin??"Wert"} ${i}${t.maximum.toString()} ist`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Zu klein: erwartet, dass ${t.origin} ${i}${t.minimum.toString()} ${a.unit} hat`;return`Zu klein: erwartet, dass ${t.origin} ${i}${t.minimum.toString()} ist`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${o[i.format]??t.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${p(t.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${t.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${t.origin}`;default:return"Ungültige Eingabe"}}};function ts(){return{localeError:Rh()}}var Nh=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},Uh=()=>{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"}};function r(o){return e[o]??null}let n={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"};return(o)=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${Nh(o.input)}`;case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${_(o.values[0])}`;return`Invalid option: expected one of ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Too big: expected ${o.origin??"value"} to have ${t}${o.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Too small: expected ${o.origin} to have ${t}${o.minimum.toString()} ${i.unit}`;return`Too small: expected ${o.origin} to be ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Invalid string: must start with "${t.prefix}"`;if(t.format==="ends_with")return`Invalid string: must end with "${t.suffix}"`;if(t.format==="includes")return`Invalid string: must include "${t.includes}"`;if(t.format==="regex")return`Invalid string: must match pattern ${t.pattern}`;return`Invalid ${n[t.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${p(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Gt(){return{localeError:Uh()}}var Lh=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},Zh=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function r(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"};return(o)=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${o.expected}, riceviĝis ${Lh(o.input)}`;case"invalid_value":if(o.values.length===1)return`Nevalida enigo: atendiĝis ${_(o.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${t}${o.maximum.toString()} ${i.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Tro malgranda: atendiĝis ke ${o.origin} havu ${t}${o.minimum.toString()} ${i.unit}`;return`Tro malgranda: atendiĝis ke ${o.origin} estu ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`;if(t.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`;if(t.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${t.includes}"`;if(t.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`;return`Nevalida ${n[t.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} ŝlosilo${o.keys.length>1?"j":""}: ${p(o.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function rs(){return{localeError:Zh()}}var Fh=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},r={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(a){return e[a]??null}function o(a){return r[a]??a}let t=(a)=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype)return a.constructor.name;return"object"}}return s},i={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(a)=>{switch(a.code){case"invalid_type":return`Entrada inválida: se esperaba ${o(a.expected)}, recibido ${o(t(a.input))}`;case"invalid_value":if(a.values.length===1)return`Entrada inválida: se esperaba ${_(a.values[0])}`;return`Opción inválida: se esperaba una de ${p(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=n(a.origin),l=o(a.origin);if(c)return`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${s}${a.maximum.toString()} ${c.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${l??"valor"} fuera ${s}${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=n(a.origin),l=o(a.origin);if(c)return`Demasiado pequeño: se esperaba que ${l} tuviera ${s}${a.minimum.toString()} ${c.unit}`;return`Demasiado pequeño: se esperaba que ${l} fuera ${s}${a.minimum.toString()}`}case"invalid_format":{let s=a;if(s.format==="starts_with")return`Cadena inválida: debe comenzar con "${s.prefix}"`;if(s.format==="ends_with")return`Cadena inválida: debe terminar en "${s.suffix}"`;if(s.format==="includes")return`Cadena inválida: debe incluir "${s.includes}"`;if(s.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${s.pattern}`;return`Inválido ${i[s.format]??a.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${p(a.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o(a.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o(a.origin)}`;default:return"Entrada inválida"}}};function ns(){return{localeError:Fh()}}var Gh=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"عدد";case"object":{if(Array.isArray(t))return"آرایه";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(t)=>{switch(t.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${t.expected} می‌بود، ${n(t.input)} دریافت شد`;case"invalid_value":if(t.values.length===1)return`ورودی نامعتبر: می‌بایست ${_(t.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${p(t.values,"|")} می‌بود`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`خیلی بزرگ: ${t.origin??"مقدار"} باید ${i}${t.maximum.toString()} ${a.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${t.origin??"مقدار"} باید ${i}${t.maximum.toString()} باشد`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`خیلی کوچک: ${t.origin} باید ${i}${t.minimum.toString()} ${a.unit} باشد`;return`خیلی کوچک: ${t.origin} باید ${i}${t.minimum.toString()} باشد`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${o[i.format]??t.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${t.divisor} باشد`;case"unrecognized_keys":return`کلید${t.keys.length>1?"های":""} ناشناس: ${p(t.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${t.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${t.origin}`;default:return"ورودی نامعتبر"}}};function os(){return{localeError:Gh()}}var Vh=()=>{let e={string:{unit:"merkkiä",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äivämäärän"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",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"};return(t)=>{switch(t.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${t.expected}, oli ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Virheellinen syöte: täytyy olla ${_(t.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Liian suuri: ${a.subject} täytyy olla ${i}${t.maximum.toString()} ${a.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Liian pieni: ${a.subject} täytyy olla ${i}${t.minimum.toString()} ${a.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${o[i.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${p(t.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öte"}}};function is(){return{localeError:Vh()}}var Wh=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"nombre";case"object":{if(Array.isArray(t))return"tableau";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(t)=>{switch(t.code){case"invalid_type":return`Entrée invalide : ${t.expected} attendu, ${n(t.input)} reçu`;case"invalid_value":if(t.values.length===1)return`Entrée invalide : ${_(t.values[0])} attendu`;return`Option invalide : une valeur parmi ${p(t.values,"|")} attendue`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Trop grand : ${t.origin??"valeur"} doit ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"élément(s)"}`;return`Trop grand : ${t.origin??"valeur"} doit être ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Trop petit : ${t.origin} doit ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Trop petit : ${t.origin} doit être ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${o[i.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${p(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function as(){return{localeError:Wh()}}var Bh=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(t)=>{switch(t.code){case"invalid_type":return`Entrée invalide : attendu ${t.expected}, reçu ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Entrée invalide : attendu ${_(t.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"≤":"<",a=r(t.origin);if(a)return`Trop grand : attendu que ${t.origin??"la valeur"} ait ${i}${t.maximum.toString()} ${a.unit}`;return`Trop grand : attendu que ${t.origin??"la valeur"} soit ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?"≥":">",a=r(t.origin);if(a)return`Trop petit : attendu que ${t.origin} ait ${i}${t.minimum.toString()} ${a.unit}`;return`Trop petit : attendu que ${t.origin} soit ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${o[i.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${p(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function ss(){return{localeError:Bh()}}var Hh=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(t)=>{switch(t.code){case"invalid_type":return`קלט לא תקין: צריך ${t.expected}, התקבל ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`קלט לא תקין: צריך ${_(t.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`גדול מדי: ${t.origin??"value"} צריך להיות ${i}${t.maximum.toString()} ${a.unit??"elements"}`;return`גדול מדי: ${t.origin??"value"} צריך להיות ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`קטן מדי: ${t.origin} צריך להיות ${i}${t.minimum.toString()} ${a.unit}`;return`קטן מדי: ${t.origin} צריך להיות ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${i.prefix}"`;if(i.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${i.suffix}"`;if(i.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${i.includes}"`;if(i.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${i.pattern}`;return`${o[i.format]??t.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case"unrecognized_keys":return`מפתח${t.keys.length>1?"ות":""} לא מזוה${t.keys.length>1?"ים":"ה"}: ${p(t.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${t.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${t.origin}`;default:return"קלט לא תקין"}}};function cs(){return{localeError:Hh()}}var Jh=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"szám";case"object":{if(Array.isArray(t))return"tömb";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(t)=>{switch(t.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${t.expected}, a kapott érték ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Érvénytelen bemenet: a várt érték ${_(t.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Túl nagy: ${t.origin??"érték"} mérete túl nagy ${i}${t.maximum.toString()} ${a.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${t.origin??"érték"} túl nagy: ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Túl kicsi: a bemeneti érték ${t.origin} mérete túl kicsi ${i}${t.minimum.toString()} ${a.unit}`;return`Túl kicsi: a bemeneti érték ${t.origin} túl kicsi ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${o[i.format]??t.format}`}case"not_multiple_of":return`Érvénytelen szám: ${t.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${t.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${t.origin}`;default:return"Érvénytelen bemenet"}}};function ls(){return{localeError:Jh()}}var qh=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Input tidak valid: diharapkan ${t.expected}, diterima ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Input tidak valid: diharapkan ${_(t.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${i}${t.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Terlalu kecil: diharapkan ${t.origin} memiliki ${i}${t.minimum.toString()} ${a.unit}`;return`Terlalu kecil: diharapkan ${t.origin} menjadi ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${o[i.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function us(){return{localeError:qh()}}var Kh=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},Xh=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function r(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",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ölugildi",jwt:"JWT",template_literal:"gildi"};return(o)=>{switch(o.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Kh(o.input)} þar sem á að vera ${o.expected}`;case"invalid_value":if(o.values.length===1)return`Rangt gildi: gert ráð fyrir ${_(o.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} hafi ${t}${o.maximum.toString()} ${i.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} sé ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Of lítið: gert er ráð fyrir að ${o.origin} hafi ${t}${o.minimum.toString()} ${i.unit}`;return`Of lítið: gert er ráð fyrir að ${o.origin} sé ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Ógildur strengur: verður að byrja á "${t.prefix}"`;if(t.format==="ends_with")return`Ógildur strengur: verður að enda á "${t.suffix}"`;if(t.format==="includes")return`Ógildur strengur: verður að innihalda "${t.includes}"`;if(t.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`;return`Rangt ${n[t.format]??o.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`Óþekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${p(o.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${o.origin}`;default:return"Rangt gildi"}}};function ds(){return{localeError:Xh()}}var Yh=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"numero";case"object":{if(Array.isArray(t))return"vettore";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Input non valido: atteso ${t.expected}, ricevuto ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Input non valido: atteso ${_(t.values[0])}`;return`Opzione non valida: atteso uno tra ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Troppo grande: ${t.origin??"valore"} deve avere ${i}${t.maximum.toString()} ${a.unit??"elementi"}`;return`Troppo grande: ${t.origin??"valore"} deve essere ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Troppo piccolo: ${t.origin} deve avere ${i}${t.minimum.toString()} ${a.unit}`;return`Troppo piccolo: ${t.origin} deve essere ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${o[i.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${p(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function ms(){return{localeError:Yh()}}var Qh=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"数値";case"object":{if(Array.isArray(t))return"配列";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(t)=>{switch(t.code){case"invalid_type":return`無効な入力: ${t.expected}が期待されましたが、${n(t.input)}が入力されました`;case"invalid_value":if(t.values.length===1)return`無効な入力: ${_(t.values[0])}が期待されました`;return`無効な選択: ${p(t.values,"、")}のいずれかである必要があります`;case"too_big":{let i=t.inclusive?"以下である":"より小さい",a=r(t.origin);if(a)return`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${a.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${i}必要があります`}case"too_small":{let i=t.inclusive?"以上である":"より大きい",a=r(t.origin);if(a)return`小さすぎる値: ${t.origin}は${t.minimum.toString()}${a.unit}${i}必要があります`;return`小さすぎる値: ${t.origin}は${t.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${o[i.format]??t.format}`}case"not_multiple_of":return`無効な数値: ${t.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${t.keys.length>1?"群":""}: ${p(t.keys,"、")}`;case"invalid_key":return`${t.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${t.origin}内の無効な値`;default:return"無効な入力"}}};function ps(){return{localeError:Qh()}}var ev=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[r]??r},tv=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function r(o){return e[o]??null}let n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(o)=>{switch(o.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${o.expected}, მიღებული ${ev(o.input)}`;case"invalid_value":if(o.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${_(o.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${p(o.values,"|")}-დან`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} ${i.verb} ${t}${o.maximum.toString()} ${i.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} იყოს ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} ${i.verb} ${t}${o.minimum.toString()} ${i.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} იყოს ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`;if(t.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`;if(t.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`;if(t.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`;return`არასწორი ${n[t.format]??o.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${o.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${o.keys.length>1?"ები":"ი"}: ${p(o.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${o.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${o.origin}-ში`;default:return"არასწორი შეყვანა"}}};function fs(){return{localeError:tv()}}var rv=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(t))return"អារេ (Array)";if(t===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(t)=>{switch(t.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t.expected} ប៉ុន្តែទទួលបាន ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${_(t.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${i} ${t.maximum.toString()} ${a.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`តូចពេក៖ ត្រូវការ ${t.origin} ${i} ${t.minimum.toString()} ${a.unit}`;return`តូចពេក៖ ត្រូវការ ${t.origin} ${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${o[i.format]??t.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${t.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${p(t.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Vt(){return{localeError:rv()}}function gs(){return Vt()}var nv=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(t)=>{switch(t.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${t.expected}, 받은 타입은 ${n(t.input)}입니다`;case"invalid_value":if(t.values.length===1)return`잘못된 입력: 값은 ${_(t.values[0])} 이어야 합니다`;return`잘못된 옵션: ${p(t.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=t.inclusive?"이하":"미만",a=i==="미만"?"이어야 합니다":"여야 합니다",s=r(t.origin),c=s?.unit??"요소";if(s)return`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()}${c} ${i}${a}`;return`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()} ${i}${a}`}case"too_small":{let i=t.inclusive?"이상":"초과",a=i==="이상"?"이어야 합니다":"여야 합니다",s=r(t.origin),c=s?.unit??"요소";if(s)return`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()}${c} ${i}${a}`;return`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${o[i.format]??t.format}`}case"not_multiple_of":return`잘못된 숫자: ${t.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${p(t.keys,", ")}`;case"invalid_key":return`잘못된 키: ${t.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${t.origin}`;default:return"잘못된 입력"}}};function hs(){return{localeError:nv()}}var ov=(e)=>Bt(typeof e,e),Bt=(e,r=void 0)=>{switch(e){case"number":return Number.isNaN(r)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(r===void 0)return"nežinomas objektas";if(r===null)return"nulinė reikšmė";if(Array.isArray(r))return"masyvas";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return e},Wt=(e)=>e.charAt(0).toUpperCase()+e.slice(1);function Ad(e){let r=Math.abs(e),n=r%10,o=r%100;if(o>=11&&o<=19||n===0)return"many";if(n===1)return"one";return"few"}var iv=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function r(o,t,i,a){let s=e[o]??null;if(s===null)return s;return{unit:s.unit[t],verb:s.verb[a][i?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(o)=>{switch(o.code){case"invalid_type":return`Gautas tipas ${ov(o.input)}, o tikėtasi - ${Bt(o.expected)}`;case"invalid_value":if(o.values.length===1)return`Privalo būti ${_(o.values[0])}`;return`Privalo būti vienas iš ${p(o.values,"|")} pasirinkimų`;case"too_big":{let t=Bt(o.origin),i=r(o.origin,Ad(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${Wt(t??o.origin??"reikšmė")} ${i.verb} ${o.maximum.toString()} ${i.unit??"elementų"}`;let a=o.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Wt(t??o.origin??"reikšmė")} turi būti ${a} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{let t=Bt(o.origin),i=r(o.origin,Ad(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${Wt(t??o.origin??"reikšmė")} ${i.verb} ${o.minimum.toString()} ${i.unit??"elementų"}`;let a=o.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Wt(t??o.origin??"reikšmė")} turi būti ${a} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Eilutė privalo prasidėti "${t.prefix}"`;if(t.format==="ends_with")return`Eilutė privalo pasibaigti "${t.suffix}"`;if(t.format==="includes")return`Eilutė privalo įtraukti "${t.includes}"`;if(t.format==="regex")return`Eilutė privalo atitikti ${t.pattern}`;return`Neteisingas ${n[t.format]??o.format}`}case"not_multiple_of":return`Skaičius privalo būti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${p(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let t=Bt(o.origin);return`${Wt(t??o.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function vs(){return{localeError:iv()}}var av=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"број";case"object":{if(Array.isArray(t))return"низа";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(t)=>{switch(t.code){case"invalid_type":return`Грешен внес: се очекува ${t.expected}, примено ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Invalid input: expected ${_(t.values[0])}`;return`Грешана опција: се очекува една ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Премногу голем: се очекува ${t.origin??"вредноста"} да има ${i}${t.maximum.toString()} ${a.unit??"елементи"}`;return`Премногу голем: се очекува ${t.origin??"вредноста"} да биде ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Премногу мал: се очекува ${t.origin} да има ${i}${t.minimum.toString()} ${a.unit}`;return`Премногу мал: се очекува ${t.origin} да биде ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${o[i.format]??t.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${p(t.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${t.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${t.origin}`;default:return"Грешен внес"}}};function ys(){return{localeError:av()}}var sv=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"nombor";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Input tidak sah: dijangka ${t.expected}, diterima ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Input tidak sah: dijangka ${_(t.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Terlalu besar: dijangka ${t.origin??"nilai"} ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Terlalu kecil: dijangka ${t.origin} ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Terlalu kecil: dijangka ${t.origin} adalah ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${o[i.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${p(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function bs(){return{localeError:sv()}}var cv=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"getal";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Ongeldige invoer: verwacht ${t.expected}, ontving ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ongeldige invoer: verwacht ${_(t.values[0])}`;return`Ongeldige optie: verwacht één van ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Te lang: verwacht dat ${t.origin??"waarde"} ${i}${t.maximum.toString()} ${a.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${t.origin??"waarde"} ${i}${t.maximum.toString()} is`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Te kort: verwacht dat ${t.origin} ${i}${t.minimum.toString()} ${a.unit} bevat`;return`Te kort: verwacht dat ${t.origin} ${i}${t.minimum.toString()} is`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${o[i.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function _s(){return{localeError:cv()}}var lv=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"tall";case"object":{if(Array.isArray(t))return"liste";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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åde",ipv6:"IPv6-område",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"};return(t)=>{switch(t.code){case"invalid_type":return`Ugyldig input: forventet ${t.expected}, fikk ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ugyldig verdi: forventet ${_(t.values[0])}`;return`Ugyldig valg: forventet en av ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`For stor(t): forventet ${t.origin??"value"} til å ha ${i}${t.maximum.toString()} ${a.unit??"elementer"}`;return`For stor(t): forventet ${t.origin??"value"} til å ha ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`For lite(n): forventet ${t.origin} til å ha ${i}${t.minimum.toString()} ${a.unit}`;return`For lite(n): forventet ${t.origin} til å ha ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${p(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function ks(){return{localeError:lv()}}var uv=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"numara";case"object":{if(Array.isArray(t))return"saf";if(t===null)return"gayb";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(t)=>{switch(t.code){case"invalid_type":return`Fâsit giren: umulan ${t.expected}, alınan ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Fâsit giren: umulan ${_(t.values[0])}`;return`Fâsit tercih: mûteberler ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Fazla büyük: ${t.origin??"value"}, ${i}${t.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${t.origin??"value"}, ${i}${t.maximum.toString()} olmalıydı.`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Fazla küçük: ${t.origin}, ${i}${t.minimum.toString()} ${a.unit} sahip olmalıydı.`;return`Fazla küçük: ${t.origin}, ${i}${t.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${o[i.format]??t.format}`}case"not_multiple_of":return`Fâsit sayı: ${t.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${t.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function $s(){return{localeError:uv()}}var dv=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"عدد";case"object":{if(Array.isArray(t))return"ارې";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(t)=>{switch(t.code){case"invalid_type":return`ناسم ورودي: باید ${t.expected} وای, مګر ${n(t.input)} ترلاسه شو`;case"invalid_value":if(t.values.length===1)return`ناسم ورودي: باید ${_(t.values[0])} وای`;return`ناسم انتخاب: باید یو له ${p(t.values,"|")} څخه وای`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`ډیر لوی: ${t.origin??"ارزښت"} باید ${i}${t.maximum.toString()} ${a.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${t.origin??"ارزښت"} باید ${i}${t.maximum.toString()} وي`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`ډیر کوچنی: ${t.origin} باید ${i}${t.minimum.toString()} ${a.unit} ولري`;return`ډیر کوچنی: ${t.origin} باید ${i}${t.minimum.toString()} وي`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${o[i.format]??t.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${t.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${t.keys.length>1?"کلیډونه":"کلیډ"}: ${p(t.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${t.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${t.origin} کې`;default:return"ناسمه ورودي"}}};function xs(){return{localeError:dv()}}var mv=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"liczba";case"object":{if(Array.isArray(t))return"tablica";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(t)=>{switch(t.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${t.expected}, otrzymano ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${_(t.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Za duża wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${i}${t.maximum.toString()} ${a.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Za mała wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${i}${t.minimum.toString()} ${a.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${o[i.format]??t.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${t.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${t.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function ws(){return{localeError:mv()}}var pv=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"número";case"object":{if(Array.isArray(t))return"array";if(t===null)return"nulo";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"};return(t)=>{switch(t.code){case"invalid_type":return`Tipo inválido: esperado ${t.expected}, recebido ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Entrada inválida: esperado ${_(t.values[0])}`;return`Opção inválida: esperada uma das ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Muito grande: esperado que ${t.origin??"valor"} tivesse ${i}${t.maximum.toString()} ${a.unit??"elementos"}`;return`Muito grande: esperado que ${t.origin??"valor"} fosse ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Muito pequeno: esperado que ${t.origin} tivesse ${i}${t.minimum.toString()} ${a.unit}`;return`Muito pequeno: esperado que ${t.origin} fosse ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${o[i.format]??t.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Chave inválida em ${t.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${t.origin}`;default:return"Campo inválido"}}};function Ss(){return{localeError:pv()}}function Md(e,r,n,o){let t=Math.abs(e),i=t%10,a=t%100;if(a>=11&&a<=19)return o;if(i===1)return r;if(i>=2&&i<=4)return n;return o}var fv=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"число";case"object":{if(Array.isArray(t))return"массив";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(t)=>{switch(t.code){case"invalid_type":return`Неверный ввод: ожидалось ${t.expected}, получено ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Неверный ввод: ожидалось ${_(t.values[0])}`;return`Неверный вариант: ожидалось одно из ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a){let s=Number(t.maximum),c=Md(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет иметь ${i}${t.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a){let s=Number(t.minimum),c=Md(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${t.origin} будет иметь ${i}${t.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${t.origin} будет ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${o[i.format]??t.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспознанн${t.keys.length>1?"ые":"ый"} ключ${t.keys.length>1?"и":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${t.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${t.origin}`;default:return"Неверные входные данные"}}};function Is(){return{localeError:fv()}}var gv=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"število";case"object":{if(Array.isArray(t))return"tabela";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"};return(t)=>{switch(t.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${t.expected}, prejeto ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Neveljaven vnos: pričakovano ${_(t.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} imelo ${i}${t.maximum.toString()} ${a.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Premajhno: pričakovano, da bo ${t.origin} imelo ${i}${t.minimum.toString()} ${a.unit}`;return`Premajhno: pričakovano, da bo ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${o[i.format]??t.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i ključi":" ključ"}: ${p(t.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Ts(){return{localeError:gv()}}var hv=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"antal";case"object":{if(Array.isArray(t))return"lista";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(t)=>{switch(t.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${t.expected}, fick ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ogiltig inmatning: förväntat ${_(t.values[0])}`;return`Ogiltigt val: förväntade en av ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`För stor(t): förväntade ${t.origin??"värdet"} att ha ${i}${t.maximum.toString()} ${a.unit??"element"}`;return`För stor(t): förväntat ${t.origin??"värdet"} att ha ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`För lite(t): förväntade ${t.origin??"värdet"} att ha ${i}${t.minimum.toString()} ${a.unit}`;return`För lite(t): förväntade ${t.origin??"värdet"} att ha ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${o[i.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${p(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${t.origin??"värdet"}`;default:return"Ogiltig input"}}};function Os(){return{localeError:hv()}}var vv=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(t))return"அணி";if(t===null)return"வெறுமை";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(t)=>{switch(t.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t.expected}, பெறப்பட்டது ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${_(t.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${p(t.values,"|")} இல் ஒன்று`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${i}${t.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${i}${t.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${i}${t.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${i}${t.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${o[i.format]??t.format}`}case"not_multiple_of":return`தவறான எண்: ${t.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${t.keys.length>1?"கள்":""}: ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${t.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Ds(){return{localeError:vv()}}var yv=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(t))return"อาร์เรย์ (Array)";if(t===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(t)=>{switch(t.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t.expected} แต่ได้รับ ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${_(t.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"ไม่เกิน":"น้อยกว่า",a=r(t.origin);if(a)return`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${i} ${t.maximum.toString()} ${a.unit??"รายการ"}`;return`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?"อย่างน้อย":"มากกว่า",a=r(t.origin);if(a)return`น้อยกว่ากำหนด: ${t.origin} ควรมี${i} ${t.minimum.toString()} ${a.unit}`;return`น้อยกว่ากำหนด: ${t.origin} ควรมี${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${o[i.format]??t.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${t.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${p(t.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${t.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${t.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Ps(){return{localeError:yv()}}var bv=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},_v=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function r(o){return e[o]??null}let n={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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(o)=>{switch(o.code){case"invalid_type":return`Geçersiz değer: beklenen ${o.expected}, alınan ${bv(o.input)}`;case"invalid_value":if(o.values.length===1)return`Geçersiz değer: beklenen ${_(o.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Çok büyük: beklenen ${o.origin??"değer"} ${t}${o.maximum.toString()} ${i.unit??"öğe"}`;return`Çok büyük: beklenen ${o.origin??"değer"} ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Çok küçük: beklenen ${o.origin} ${t}${o.minimum.toString()} ${i.unit}`;return`Çok küçük: beklenen ${o.origin} ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Geçersiz metin: "${t.prefix}" ile başlamalı`;if(t.format==="ends_with")return`Geçersiz metin: "${t.suffix}" ile bitmeli`;if(t.format==="includes")return`Geçersiz metin: "${t.includes}" içermeli`;if(t.format==="regex")return`Geçersiz metin: ${t.pattern} desenine uymalı`;return`Geçersiz ${n[t.format]??o.format}`}case"not_multiple_of":return`Geçersiz sayı: ${o.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${o.keys.length>1?"lar":""}: ${p(o.keys,", ")}`;case"invalid_key":return`${o.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${o.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function zs(){return{localeError:_v()}}var kv=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"число";case"object":{if(Array.isArray(t))return"масив";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(t)=>{switch(t.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${t.expected}, отримано ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Неправильні вхідні дані: очікується ${_(t.values[0])}`;return`Неправильна опція: очікується одне з ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Занадто велике: очікується, що ${t.origin??"значення"} ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"елементів"}`;return`Занадто велике: очікується, що ${t.origin??"значення"} буде ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Занадто мале: очікується, що ${t.origin} ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Занадто мале: очікується, що ${t.origin} буде ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${o[i.format]??t.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${t.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${t.keys.length>1?"і":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${t.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${t.origin}`;default:return"Неправильні вхідні дані"}}};function Ht(){return{localeError:kv()}}function Cs(){return Ht()}var $v=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"نمبر";case"object":{if(Array.isArray(t))return"آرے";if(t===null)return"نل";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(t)=>{switch(t.code){case"invalid_type":return`غلط ان پٹ: ${t.expected} متوقع تھا، ${n(t.input)} موصول ہوا`;case"invalid_value":if(t.values.length===1)return`غلط ان پٹ: ${_(t.values[0])} متوقع تھا`;return`غلط آپشن: ${p(t.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`بہت بڑا: ${t.origin??"ویلیو"} کے ${i}${t.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${t.origin??"ویلیو"} کا ${i}${t.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`بہت چھوٹا: ${t.origin} کے ${i}${t.minimum.toString()} ${a.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${t.origin} کا ${i}${t.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${o[i.format]??t.format}`}case"not_multiple_of":return`غلط نمبر: ${t.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${t.keys.length>1?"ز":""}: ${p(t.keys,"، ")}`;case"invalid_key":return`${t.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${t.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Es(){return{localeError:$v()}}var xv=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"số";case"object":{if(Array.isArray(t))return"mảng";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(t)=>{switch(t.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${t.expected}, nhận được ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${_(t.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Quá lớn: mong đợi ${t.origin??"giá trị"} ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"phần tử"}`;return`Quá lớn: mong đợi ${t.origin??"giá trị"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Quá nhỏ: mong đợi ${t.origin} ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Quá nhỏ: mong đợi ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${o[i.format]??t.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${t.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${p(t.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${t.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${t.origin}`;default:return"Đầu vào không hợp lệ"}}};function js(){return{localeError:xv()}}var wv=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(t))return"数组";if(t===null)return"空值(null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(t)=>{switch(t.code){case"invalid_type":return`无效输入:期望 ${t.expected},实际接收 ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`无效输入:期望 ${_(t.values[0])}`;return`无效选项:期望以下之一 ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`数值过大:期望 ${t.origin??"值"} ${i}${t.maximum.toString()} ${a.unit??"个元素"}`;return`数值过大:期望 ${t.origin??"值"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`数值过小:期望 ${t.origin} ${i}${t.minimum.toString()} ${a.unit}`;return`数值过小:期望 ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${o[i.format]??t.format}`}case"not_multiple_of":return`无效数字:必须是 ${t.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${t.origin} 中包含无效值(value)`;default:return"无效输入"}}};function As(){return{localeError:wv()}}var Sv=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(t)=>{switch(t.code){case"invalid_type":return`無效的輸入值:預期為 ${t.expected},但收到 ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`無效的輸入值:預期為 ${_(t.values[0])}`;return`無效的選項:預期為以下其中之一 ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`數值過大:預期 ${t.origin??"值"} 應為 ${i}${t.maximum.toString()} ${a.unit??"個元素"}`;return`數值過大:預期 ${t.origin??"值"} 應為 ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`數值過小:預期 ${t.origin} 應為 ${i}${t.minimum.toString()} ${a.unit}`;return`數值過小:預期 ${t.origin} 應為 ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${o[i.format]??t.format}`}case"not_multiple_of":return`無效的數字:必須為 ${t.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${t.keys.length>1?"們":""}:${p(t.keys,"、")}`;case"invalid_key":return`${t.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${t.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Ms(){return{localeError:Sv()}}var Iv=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(t))return"akopọ";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(t)=>{switch(t.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${t.expected}, àmọ̀ a rí ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${_(t.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${t.origin??"iye"} ${a.verb} ${i}${t.maximum} ${a.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${t.maximum}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Kéré ju: a ní láti jẹ́ pé ${t.origin} ${a.verb} ${i}${t.minimum} ${a.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${t.minimum}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${o[i.format]??t.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${t.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${p(t.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${t.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${t.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Rs(){return{localeError:Iv()}}var Ns=Symbol("ZodOutput"),Us=Symbol("ZodInput");class qt{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);if(r&&typeof r==="object"&&"id"in r)this._idmap.delete(r.id);return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function pn(){return new qt}var Oe=pn();function Ls(e,r){return new e({type:"string",...k(r)})}function Zs(e,r){return new e({type:"string",coerce:!0,...k(r)})}function fn(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(r)})}function Kt(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(r)})}function gn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(r)})}function hn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(r)})}function vn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(r)})}function yn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(r)})}function Xt(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(r)})}function bn(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(r)})}function _n(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(r)})}function kn(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(r)})}function $n(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(r)})}function xn(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(r)})}function wn(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(r)})}function Sn(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(r)})}function In(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(r)})}function Tn(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(r)})}function On(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(r)})}function Dn(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(r)})}function Pn(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(r)})}function zn(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(r)})}function Cn(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(r)})}function En(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(r)})}var Fs={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Gs(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(r)})}function Vs(e,r){return new e({type:"string",format:"date",check:"string_format",...k(r)})}function Ws(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(r)})}function Bs(e,r){return new e({type:"string",format:"duration",check:"string_format",...k(r)})}function Hs(e,r){return new e({type:"number",checks:[],...k(r)})}function Js(e,r){return new e({type:"number",coerce:!0,checks:[],...k(r)})}function qs(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(r)})}function Ks(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...k(r)})}function Xs(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...k(r)})}function Ys(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...k(r)})}function Qs(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...k(r)})}function ec(e,r){return new e({type:"boolean",...k(r)})}function tc(e,r){return new e({type:"boolean",coerce:!0,...k(r)})}function rc(e,r){return new e({type:"bigint",...k(r)})}function nc(e,r){return new e({type:"bigint",coerce:!0,...k(r)})}function oc(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...k(r)})}function ic(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...k(r)})}function ac(e,r){return new e({type:"symbol",...k(r)})}function sc(e,r){return new e({type:"undefined",...k(r)})}function cc(e,r){return new e({type:"null",...k(r)})}function lc(e){return new e({type:"any"})}function uc(e){return new e({type:"unknown"})}function dc(e,r){return new e({type:"never",...k(r)})}function mc(e,r){return new e({type:"void",...k(r)})}function pc(e,r){return new e({type:"date",...k(r)})}function fc(e,r){return new e({type:"date",coerce:!0,...k(r)})}function gc(e,r){return new e({type:"nan",...k(r)})}function De(e,r){return new en({check:"less_than",...k(r),value:e,inclusive:!1})}function ye(e,r){return new en({check:"less_than",...k(r),value:e,inclusive:!0})}function Pe(e,r){return new tn({check:"greater_than",...k(r),value:e,inclusive:!1})}function le(e,r){return new tn({check:"greater_than",...k(r),value:e,inclusive:!0})}function hc(e){return Pe(0,e)}function vc(e){return De(0,e)}function yc(e){return ye(0,e)}function bc(e){return le(0,e)}function Xe(e,r){return new $i({check:"multiple_of",...k(r),value:e})}function pt(e,r){return new Si({check:"max_size",...k(r),maximum:e})}function Ye(e,r){return new Ii({check:"min_size",...k(r),minimum:e})}function Yt(e,r){return new Ti({check:"size_equals",...k(r),size:e})}function ft(e,r){return new Oi({check:"max_length",...k(r),maximum:e})}function Ue(e,r){return new Di({check:"min_length",...k(r),minimum:e})}function gt(e,r){return new Pi({check:"length_equals",...k(r),length:e})}function Qt(e,r){return new zi({check:"string_format",format:"regex",...k(r),pattern:e})}function er(e){return new Ci({check:"string_format",format:"lowercase",...k(e)})}function tr(e){return new Ei({check:"string_format",format:"uppercase",...k(e)})}function rr(e,r){return new ji({check:"string_format",format:"includes",...k(r),includes:e})}function nr(e,r){return new Ai({check:"string_format",format:"starts_with",...k(r),prefix:e})}function or(e,r){return new Mi({check:"string_format",format:"ends_with",...k(r),suffix:e})}function _c(e,r,n){return new Ri({check:"property",property:e,schema:r,...k(n)})}function ir(e,r){return new Ni({check:"mime_type",mime:e,...k(r)})}function ze(e){return new Ui({check:"overwrite",tx:e})}function ar(e){return ze((r)=>r.normalize(e))}function sr(){return ze((e)=>e.trim())}function cr(){return ze((e)=>e.toLowerCase())}function lr(){return ze((e)=>e.toUpperCase())}function kc(e,r,n){return new e({type:"array",element:r,...k(n)})}function Tv(e,r,n){return new e({type:"union",options:r,...k(n)})}function Ov(e,r,n,o){return new e({type:"union",options:n,discriminator:r,...k(o)})}function Dv(e,r,n){return new e({type:"intersection",left:r,right:n})}function Pv(e,r,n,o){let t=n instanceof D;return new e({type:"tuple",items:r,rest:t?n:null,...k(t?o:n)})}function zv(e,r,n,o){return new e({type:"record",keyType:r,valueType:n,...k(o)})}function Cv(e,r,n,o){return new e({type:"map",keyType:r,valueType:n,...k(o)})}function Ev(e,r,n){return new e({type:"set",valueType:r,...k(n)})}function jv(e,r,n){let o=Array.isArray(r)?Object.fromEntries(r.map((t)=>[t,t])):r;return new e({type:"enum",entries:o,...k(n)})}function Av(e,r,n){return new e({type:"enum",entries:r,...k(n)})}function Mv(e,r,n){return new e({type:"literal",values:Array.isArray(r)?r:[r],...k(n)})}function $c(e,r){return new e({type:"file",...k(r)})}function Rv(e,r){return new e({type:"transform",transform:r})}function Nv(e,r){return new e({type:"optional",innerType:r})}function Uv(e,r){return new e({type:"nullable",innerType:r})}function Lv(e,r,n){return new e({type:"default",innerType:r,get defaultValue(){return typeof n==="function"?n():No(n)}})}function Zv(e,r,n){return new e({type:"nonoptional",innerType:r,...k(n)})}function Fv(e,r){return new e({type:"success",innerType:r})}function Gv(e,r,n){return new e({type:"catch",innerType:r,catchValue:typeof n==="function"?n:()=>n})}function Vv(e,r,n){return new e({type:"pipe",in:r,out:n})}function Wv(e,r){return new e({type:"readonly",innerType:r})}function Bv(e,r,n){return new e({type:"template_literal",parts:r,...k(n)})}function Hv(e,r){return new e({type:"lazy",getter:r})}function Jv(e,r){return new e({type:"promise",innerType:r})}function xc(e,r,n){let o=k(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:r,...o})}function wc(e,r,n){return new e({type:"custom",check:"custom",fn:r,...k(n)})}function Sc(e){let r=Rd((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(st(o,n.value,r._zod.def));else{let t=o;if(t.fatal)t.continue=!1;t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=r),t.continue??(t.continue=!r._zod.def.abort),n.issues.push(st(t))}},e(n.value,n)));return r}function Rd(e,r){let n=new W({check:"custom",...k(r)});return n._zod.check=e,n}function Ic(e,r){let n=k(r),o=n.truthy??["true","1","yes","on","y","enabled"],t=n.falsy??["false","0","no","off","n","disabled"];if(n.case!=="sensitive")o=o.map((u)=>typeof u==="string"?u.toLowerCase():u),t=t.map((u)=>typeof u==="string"?u.toLowerCase():u);let i=new Set(o),a=new Set(t),s=e.Codec??Ft,c=e.Boolean??Zt,d=new(e.String??Ke)({type:"string",error:n.error}),v=new c({type:"boolean",error:n.error}),h=new s({type:"pipe",in:d,out:v,transform:(u,y)=>{let x=u;if(n.case!=="sensitive")x=x.toLowerCase();if(i.has(x))return!0;else if(a.has(x))return!1;else return y.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:y.value,inst:h,continue:!1}),{}},reverseTransform:(u,y)=>{if(u===!0)return o[0]||"true";else return t[0]||"false"},error:n.error});return h}function ht(e,r,n,o={}){let t=k(o),i={...k(o),check:"string_format",type:"string",format:r,fn:typeof n==="function"?n:(s)=>n.test(s),...t};if(n instanceof RegExp)i.pattern=n;return new e(i)}class jn{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Oe,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,t={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path},v=e._zod.parent;if(v)a.ref=v,this.process(v,d),this.seen.get(v).isParent=!0;else{let h=a.schema;switch(o.type){case"string":{let u=h;u.type="string";let{minimum:y,maximum:x,format:j,patterns:A,contentEncoding:G}=e._zod.bag;if(typeof y==="number")u.minLength=y;if(typeof x==="number")u.maxLength=x;if(j){if(u.format=t[j]??j,u.format==="")delete u.format}if(G)u.contentEncoding=G;if(A&&A.size>0){let N=[...A];if(N.length===1)u.pattern=N[0].source;else if(N.length>1)a.schema.allOf=[...N.map((X)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}break}case"number":{let u=h,{minimum:y,maximum:x,format:j,multipleOf:A,exclusiveMaximum:G,exclusiveMinimum:N}=e._zod.bag;if(typeof j==="string"&&j.includes("int"))u.type="integer";else u.type="number";if(typeof N==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")u.minimum=N,u.exclusiveMinimum=!0;else u.exclusiveMinimum=N;if(typeof y==="number"){if(u.minimum=y,typeof N==="number"&&this.target!=="draft-4")if(N>=y)delete u.minimum;else delete u.exclusiveMinimum}if(typeof G==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")u.maximum=G,u.exclusiveMaximum=!0;else u.exclusiveMaximum=G;if(typeof x==="number"){if(u.maximum=x,typeof G==="number"&&this.target!=="draft-4")if(G<=x)delete u.maximum;else delete u.exclusiveMaximum}if(typeof A==="number")u.multipleOf=A;break}case"boolean":{let u=h;u.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")h.type="string",h.nullable=!0,h.enum=[null];else h.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{h.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let u=h,{minimum:y,maximum:x}=e._zod.bag;if(typeof y==="number")u.minItems=y;if(typeof x==="number")u.maxItems=x;u.type="array",u.items=this.process(o.element,{...d,path:[...d.path,"items"]});break}case"object":{let u=h;u.type="object",u.properties={};let y=o.shape;for(let A in y)u.properties[A]=this.process(y[A],{...d,path:[...d.path,"properties",A]});let x=new Set(Object.keys(y)),j=new Set([...x].filter((A)=>{let G=o.shape[A]._zod;if(this.io==="input")return G.optin===void 0;else return G.optout===void 0}));if(j.size>0)u.required=Array.from(j);if(o.catchall?._zod.def.type==="never")u.additionalProperties=!1;else if(!o.catchall){if(this.io==="output")u.additionalProperties=!1}else if(o.catchall)u.additionalProperties=this.process(o.catchall,{...d,path:[...d.path,"additionalProperties"]});break}case"union":{let u=h,y=o.options.map((x,j)=>this.process(x,{...d,path:[...d.path,"anyOf",j]}));u.anyOf=y;break}case"intersection":{let u=h,y=this.process(o.left,{...d,path:[...d.path,"allOf",0]}),x=this.process(o.right,{...d,path:[...d.path,"allOf",1]}),j=(G)=>("allOf"in G)&&Object.keys(G).length===1,A=[...j(y)?y.allOf:[y],...j(x)?x.allOf:[x]];u.allOf=A;break}case"tuple":{let u=h;u.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",j=o.items.map((X,he)=>this.process(X,{...d,path:[...d.path,y,he]})),A=o.rest?this.process(o.rest,{...d,path:[...d.path,x,...this.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(u.prefixItems=j,A)u.items=A}else if(this.target==="openapi-3.0"){if(u.items={anyOf:j},A)u.items.anyOf.push(A);if(u.minItems=j.length,!A)u.maxItems=j.length}else if(u.items=j,A)u.additionalItems=A;let{minimum:G,maximum:N}=e._zod.bag;if(typeof G==="number")u.minItems=G;if(typeof N==="number")u.maxItems=N;break}case"record":{let u=h;if(u.type="object",this.target==="draft-7"||this.target==="draft-2020-12")u.propertyNames=this.process(o.keyType,{...d,path:[...d.path,"propertyNames"]});u.additionalProperties=this.process(o.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let u=h,y=zt(o.entries);if(y.every((x)=>typeof x==="number"))u.type="number";if(y.every((x)=>typeof x==="string"))u.type="string";u.enum=y;break}case"literal":{let u=h,y=[];for(let x of o.values)if(x===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else y.push(Number(x));else y.push(x);if(y.length===0);else if(y.length===1){let x=y[0];if(u.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0")u.enum=[x];else u.const=x}else{if(y.every((x)=>typeof x==="number"))u.type="number";if(y.every((x)=>typeof x==="string"))u.type="string";if(y.every((x)=>typeof x==="boolean"))u.type="string";if(y.every((x)=>x===null))u.type="null";u.enum=y}break}case"file":{let u=h,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:j,mime:A}=e._zod.bag;if(x!==void 0)y.minLength=x;if(j!==void 0)y.maxLength=j;if(A)if(A.length===1)y.contentMediaType=A[0],Object.assign(u,y);else u.anyOf=A.map((G)=>({...y,contentMediaType:G}));else Object.assign(u,y);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let u=this.process(o.innerType,d);if(this.target==="openapi-3.0")a.ref=o.innerType,h.nullable=!0;else h.anyOf=[u,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"success":{let u=h;u.type="boolean";break}case"default":{this.process(o.innerType,d),a.ref=o.innerType,h.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{if(this.process(o.innerType,d),a.ref=o.innerType,this.io==="input")h._prefault=JSON.parse(JSON.stringify(o.defaultValue));break}case"catch":{this.process(o.innerType,d),a.ref=o.innerType;let u;try{u=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}h.default=u;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let u=h,y=e._zod.pattern;if(!y)throw Error("Pattern not found in template literal");u.type="string",u.pattern=y.source;break}case"pipe":{let u=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(u,d),a.ref=u;break}case"readonly":{this.process(o.innerType,d),a.ref=o.innerType,h.readOnly=!0;break}case"promise":{this.process(o.innerType,d),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"lazy":{let u=e._zod.innerType;this.process(u,d),a.ref=u;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);if(c)Object.assign(a.schema,c);if(this.io==="input"&&Q(e))delete a.schema.examples,delete a.schema.default;if(this.io==="input"&&a.schema._prefault)(n=a.schema).default??(n.default=a.schema._prefault);return delete a.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let t=(l)=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(l[0])?.id,x=n.external.uri??((A)=>A);if(y)return{ref:x(y)};let j=l[1].defId??l[1].schema.id??`schema${this.counter++}`;return l[1].defId=j,{defId:j,ref:`${x("__shared")}#/${d}/${j}`}}if(l[1]===o)return{ref:"#"};let h=`${"#"}/${d}/`,u=l[1].schema.id??`__schema${this.counter++}`;return{defId:u,ref:h+u}},i=(l)=>{if(l[1].schema.$ref)return;let d=l[1],{ref:v,defId:h}=t(l);if(d.def={...d.schema},h)d.defId=h;let u=d.schema;for(let y in u)delete u[y];u.$ref=v};if(n.cycles==="throw")for(let l of this.seen.entries()){let d=l[1];if(d.cycle)throw Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
133
+ `)}I.write("payload.value = newResult;"),I.write("return payload;");let y=I.compile();return(T,t)=>y(Y,T,t)},z,_=o$,N=!Sv.jitless,k=N&&gU.value,J=U.catchall,W;$._zod.parse=(Y,I)=>{W??(W=r.value);let j=Y.value;if(!_(j))return Y.issues.push({expected:"object",code:"invalid_type",input:j,inst:$}),Y;if(N&&k&&I?.async===!1&&I.jitless!==!0){if(!z)z=v(U.shape);if(Y=z(Y,I),!J)return Y;return FO([],j,Y,I,W,$)}return b(Y,I)}});function WO($,U,b,r){for(let z of $)if(z.issues.length===0)return U.value=z.value,U;let v=$.filter((z)=>!T$(z));if(v.length===1)return U.value=v[0].value,v[0];return U.issues.push({code:"invalid_union",input:U.value,inst:b,errors:$.map((z)=>z.issues.map((_)=>w$(_,r,d())))}),U}var k6=X("$ZodUnion",($,U)=>{S.init($,U),D($._zod,"optin",()=>U.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),D($._zod,"optout",()=>U.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),D($._zod,"values",()=>{if(U.options.every((v)=>v._zod.values))return new Set(U.options.flatMap((v)=>Array.from(v._zod.values)));return}),D($._zod,"pattern",()=>{if(U.options.every((v)=>v._zod.pattern)){let v=U.options.map((z)=>z._zod.pattern);return new RegExp(`^(${v.map((z)=>Zv(z.source)).join("|")})$`)}return});let b=U.options.length===1,r=U.options[0]._zod.run;$._zod.parse=(v,z)=>{if(b)return r(v,z);let _=!1,N=[];for(let O of U.options){let k=O._zod.run({value:v.value,issues:[]},z);if(k instanceof Promise)N.push(k),_=!0;else{if(k.issues.length===0)return k;N.push(k)}}if(!_)return WO(N,v,$,z);return Promise.all(N).then((O)=>{return WO(O,v,$,z)})}}),Br=X("$ZodDiscriminatedUnion",($,U)=>{k6.init($,U);let b=$._zod.parse;D($._zod,"propValues",()=>{let v={};for(let z of U.options){let _=z._zod.propValues;if(!_||Object.keys(_).length===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(z)}"`);for(let[N,O]of Object.entries(_)){if(!v[N])v[N]=new Set;for(let k of O)v[N].add(k)}}return v});let r=zv(()=>{let v=U.options,z=new Map;for(let _ of v){let N=_._zod.propValues?.[U.discriminator];if(!N||N.size===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(_)}"`);for(let O of N){if(z.has(O))throw Error(`Duplicate discriminator value "${String(O)}"`);z.set(O,_)}}return z});$._zod.parse=(v,z)=>{let _=v.value;if(!o$(_))return v.issues.push({code:"invalid_type",expected:"object",input:_,inst:$}),v;let N=r.value.get(_?.[U.discriminator]);if(N)return N._zod.run(v,z);if(U.unionFallback)return b(v,z);return v.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:U.discriminator,input:_,path:[U.discriminator],inst:$}),v}}),Lr=X("$ZodIntersection",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value,z=U.left._zod.run({value:v,issues:[]},r),_=U.right._zod.run({value:v,issues:[]},r);if(z instanceof Promise||_ instanceof Promise)return Promise.all([z,_]).then(([O,k])=>{return jO(b,O,k)});return jO(b,z,_)}});function Cb($,U){if($===U)return{valid:!0,data:$};if($ instanceof Date&&U instanceof Date&&+$===+U)return{valid:!0,data:$};if(m$($)&&m$(U)){let b=Object.keys(U),r=Object.keys($).filter((z)=>b.indexOf(z)!==-1),v={...$,...U};for(let z of r){let _=Cb($[z],U[z]);if(!_.valid)return{valid:!1,mergeErrorPath:[z,..._.mergeErrorPath]};v[z]=_.data}return{valid:!0,data:v}}if(Array.isArray($)&&Array.isArray(U)){if($.length!==U.length)return{valid:!1,mergeErrorPath:[]};let b=[];for(let r=0;r<$.length;r++){let v=$[r],z=U[r],_=Cb(v,z);if(!_.valid)return{valid:!1,mergeErrorPath:[r,..._.mergeErrorPath]};b.push(_.data)}return{valid:!0,data:b}}return{valid:!1,mergeErrorPath:[]}}function jO($,U,b){if(U.issues.length)$.issues.push(...U.issues);if(b.issues.length)$.issues.push(...b.issues);if(T$($))return $;let r=Cb(U.value,b.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return $.value=r.data,$}var I6=X("$ZodTuple",($,U)=>{S.init($,U);let b=U.items,r=b.length-[...b].reverse().findIndex((v)=>v._zod.optin!=="optional");$._zod.parse=(v,z)=>{let _=v.value;if(!Array.isArray(_))return v.issues.push({input:_,inst:$,expected:"tuple",code:"invalid_type"}),v;v.value=[];let N=[];if(!U.rest){let k=_.length>b.length,J=_.length<r-1;if(k||J)return v.issues.push({...k?{code:"too_big",maximum:b.length}:{code:"too_small",minimum:b.length},input:_,inst:$,origin:"array"}),v}let O=-1;for(let k of b){if(O++,O>=_.length){if(O>=r)continue}let J=k._zod.run({value:_[O],issues:[]},z);if(J instanceof Promise)N.push(J.then((W)=>U6(W,v,O)));else U6(J,v,O)}if(U.rest){let k=_.slice(b.length);for(let J of k){O++;let W=U.rest._zod.run({value:J,issues:[]},z);if(W instanceof Promise)N.push(W.then((Y)=>U6(Y,v,O)));else U6(W,v,O)}}if(N.length)return Promise.all(N).then(()=>v);return v}});function U6($,U,b){if($.issues.length)U.issues.push(...K$(b,$.issues));U.value[b]=$.value}var Ar=X("$ZodRecord",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value;if(!m$(v))return b.issues.push({expected:"record",code:"invalid_type",input:v,inst:$}),b;let z=[];if(U.keyType._zod.values){let _=U.keyType._zod.values;b.value={};for(let O of _)if(typeof O==="string"||typeof O==="number"||typeof O==="symbol"){let k=U.valueType._zod.run({value:v[O],issues:[]},r);if(k instanceof Promise)z.push(k.then((J)=>{if(J.issues.length)b.issues.push(...K$(O,J.issues));b.value[O]=J.value}));else{if(k.issues.length)b.issues.push(...K$(O,k.issues));b.value[O]=k.value}}let N;for(let O in v)if(!_.has(O))N=N??[],N.push(O);if(N&&N.length>0)b.issues.push({code:"unrecognized_keys",input:v,inst:$,keys:N})}else{b.value={};for(let _ of Reflect.ownKeys(v)){if(_==="__proto__")continue;let N=U.keyType._zod.run({value:_,issues:[]},r);if(N instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(N.issues.length){b.issues.push({code:"invalid_key",origin:"record",issues:N.issues.map((k)=>w$(k,r,d())),input:_,path:[_],inst:$}),b.value[N.value]=N.value;continue}let O=U.valueType._zod.run({value:v[_],issues:[]},r);if(O instanceof Promise)z.push(O.then((k)=>{if(k.issues.length)b.issues.push(...K$(_,k.issues));b.value[N.value]=k.value}));else{if(O.issues.length)b.issues.push(...K$(_,O.issues));b.value[N.value]=O.value}}}if(z.length)return Promise.all(z).then(()=>b);return b}}),Gr=X("$ZodMap",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value;if(!(v instanceof Map))return b.issues.push({expected:"map",code:"invalid_type",input:v,inst:$}),b;let z=[];b.value=new Map;for(let[_,N]of v){let O=U.keyType._zod.run({value:_,issues:[]},r),k=U.valueType._zod.run({value:N,issues:[]},r);if(O instanceof Promise||k instanceof Promise)z.push(Promise.all([O,k]).then(([J,W])=>{VO(J,W,b,_,v,$,r)}));else VO(O,k,b,_,v,$,r)}if(z.length)return Promise.all(z).then(()=>b);return b}});function VO($,U,b,r,v,z,_){if($.issues.length)if(Dv.has(typeof r))b.issues.push(...K$(r,$.issues));else b.issues.push({code:"invalid_key",origin:"map",input:v,inst:z,issues:$.issues.map((N)=>w$(N,_,d()))});if(U.issues.length)if(Dv.has(typeof r))b.issues.push(...K$(r,U.issues));else b.issues.push({origin:"map",code:"invalid_element",input:v,inst:z,key:r,issues:U.issues.map((N)=>w$(N,_,d()))});b.value.set($.value,U.value)}var Hr=X("$ZodSet",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value;if(!(v instanceof Set))return b.issues.push({input:v,inst:$,expected:"set",code:"invalid_type"}),b;let z=[];b.value=new Set;for(let _ of v){let N=U.valueType._zod.run({value:_,issues:[]},r);if(N instanceof Promise)z.push(N.then((O)=>PO(O,b)));else PO(N,b)}if(z.length)return Promise.all(z).then(()=>b);return b}});function PO($,U){if($.issues.length)U.issues.push(...$.issues);U.value.add($.value)}var Er=X("$ZodEnum",($,U)=>{S.init($,U);let b=Mv(U.entries),r=new Set(b);$._zod.values=r,$._zod.pattern=new RegExp(`^(${b.filter((v)=>Dv.has(typeof v)).map((v)=>typeof v==="string"?H$(v):v.toString()).join("|")})$`),$._zod.parse=(v,z)=>{let _=v.value;if(r.has(_))return v;return v.issues.push({code:"invalid_value",values:b,input:_,inst:$}),v}}),Sr=X("$ZodLiteral",($,U)=>{if(S.init($,U),U.values.length===0)throw Error("Cannot create literal schema with no valid values");$._zod.values=new Set(U.values),$._zod.pattern=new RegExp(`^(${U.values.map((b)=>typeof b==="string"?H$(b):b?H$(b.toString()):String(b)).join("|")})$`),$._zod.parse=(b,r)=>{let v=b.value;if($._zod.values.has(v))return b;return b.issues.push({code:"invalid_value",values:U.values,input:v,inst:$}),b}}),Fr=X("$ZodFile",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{let v=b.value;if(v instanceof File)return b;return b.issues.push({expected:"file",code:"invalid_type",input:v,inst:$}),b}}),Mr=X("$ZodTransform",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{if(r.direction==="backward")throw new l$($.constructor.name);let v=U.transform(b.value,b);if(r.async)return(v instanceof Promise?v:Promise.resolve(v)).then((_)=>{return b.value=_,b});if(v instanceof Promise)throw new G$;return b.value=v,b}});function qO($,U){if($.issues.length&&U===void 0)return{issues:[],value:void 0};return $}var Zr=X("$ZodOptional",($,U)=>{S.init($,U),$._zod.optin="optional",$._zod.optout="optional",D($._zod,"values",()=>{return U.innerType._zod.values?new Set([...U.innerType._zod.values,void 0]):void 0}),D($._zod,"pattern",()=>{let b=U.innerType._zod.pattern;return b?new RegExp(`^(${Zv(b.source)})?$`):void 0}),$._zod.parse=(b,r)=>{if(U.innerType._zod.optin==="optional"){let v=U.innerType._zod.run(b,r);if(v instanceof Promise)return v.then((z)=>qO(z,b.value));return qO(v,b.value)}if(b.value===void 0)return b;return U.innerType._zod.run(b,r)}}),Dr=X("$ZodNullable",($,U)=>{S.init($,U),D($._zod,"optin",()=>U.innerType._zod.optin),D($._zod,"optout",()=>U.innerType._zod.optout),D($._zod,"pattern",()=>{let b=U.innerType._zod.pattern;return b?new RegExp(`^(${Zv(b.source)}|null)$`):void 0}),D($._zod,"values",()=>{return U.innerType._zod.values?new Set([...U.innerType._zod.values,null]):void 0}),$._zod.parse=(b,r)=>{if(b.value===null)return b;return U.innerType._zod.run(b,r)}}),xr=X("$ZodDefault",($,U)=>{S.init($,U),$._zod.optin="optional",D($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(b,r)=>{if(r.direction==="backward")return U.innerType._zod.run(b,r);if(b.value===void 0)return b.value=U.defaultValue,b;let v=U.innerType._zod.run(b,r);if(v instanceof Promise)return v.then((z)=>BO(z,U));return BO(v,U)}});function BO($,U){if($.value===void 0)$.value=U.defaultValue;return $}var gr=X("$ZodPrefault",($,U)=>{S.init($,U),$._zod.optin="optional",D($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(b,r)=>{if(r.direction==="backward")return U.innerType._zod.run(b,r);if(b.value===void 0)b.value=U.defaultValue;return U.innerType._zod.run(b,r)}}),Rr=X("$ZodNonOptional",($,U)=>{S.init($,U),D($._zod,"values",()=>{let b=U.innerType._zod.values;return b?new Set([...b].filter((r)=>r!==void 0)):void 0}),$._zod.parse=(b,r)=>{let v=U.innerType._zod.run(b,r);if(v instanceof Promise)return v.then((z)=>LO(z,$));return LO(v,$)}});function LO($,U){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:U});return $}var mr=X("$ZodSuccess",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{if(r.direction==="backward")throw new l$("ZodSuccess");let v=U.innerType._zod.run(b,r);if(v instanceof Promise)return v.then((z)=>{return b.value=z.issues.length===0,b});return b.value=v.issues.length===0,b}}),Tr=X("$ZodCatch",($,U)=>{S.init($,U),D($._zod,"optin",()=>U.innerType._zod.optin),D($._zod,"optout",()=>U.innerType._zod.optout),D($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(b,r)=>{if(r.direction==="backward")return U.innerType._zod.run(b,r);let v=U.innerType._zod.run(b,r);if(v instanceof Promise)return v.then((z)=>{if(b.value=z.value,z.issues.length)b.value=U.catchValue({...b,error:{issues:z.issues.map((_)=>w$(_,r,d()))},input:b.value}),b.issues=[];return b});if(b.value=v.value,v.issues.length)b.value=U.catchValue({...b,error:{issues:v.issues.map((z)=>w$(z,r,d()))},input:b.value}),b.issues=[];return b}}),Cr=X("$ZodNaN",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{if(typeof b.value!=="number"||!Number.isNaN(b.value))return b.issues.push({input:b.value,inst:$,expected:"nan",code:"invalid_type"}),b;return b}}),cr=X("$ZodPipe",($,U)=>{S.init($,U),D($._zod,"values",()=>U.in._zod.values),D($._zod,"optin",()=>U.in._zod.optin),D($._zod,"optout",()=>U.out._zod.optout),D($._zod,"propValues",()=>U.in._zod.propValues),$._zod.parse=(b,r)=>{if(r.direction==="backward"){let z=U.out._zod.run(b,r);if(z instanceof Promise)return z.then((_)=>b6(_,U.in,r));return b6(z,U.in,r)}let v=U.in._zod.run(b,r);if(v instanceof Promise)return v.then((z)=>b6(z,U.out,r));return b6(v,U.out,r)}});function b6($,U,b){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:$.value,issues:$.issues},b)}var hv=X("$ZodCodec",($,U)=>{S.init($,U),D($._zod,"values",()=>U.in._zod.values),D($._zod,"optin",()=>U.in._zod.optin),D($._zod,"optout",()=>U.out._zod.optout),D($._zod,"propValues",()=>U.in._zod.propValues),$._zod.parse=(b,r)=>{if((r.direction||"forward")==="forward"){let z=U.in._zod.run(b,r);if(z instanceof Promise)return z.then((_)=>r6(_,U,r));return r6(z,U,r)}else{let z=U.out._zod.run(b,r);if(z instanceof Promise)return z.then((_)=>r6(_,U,r));return r6(z,U,r)}}});function r6($,U,b){if($.issues.length)return $.aborted=!0,$;if((b.direction||"forward")==="forward"){let v=U.transform($.value,$);if(v instanceof Promise)return v.then((z)=>z6($,z,U.out,b));return z6($,v,U.out,b)}else{let v=U.reverseTransform($.value,$);if(v instanceof Promise)return v.then((z)=>z6($,z,U.in,b));return z6($,v,U.in,b)}}function z6($,U,b,r){if($.issues.length)return $.aborted=!0,$;return b._zod.run({value:U,issues:$.issues},r)}var ur=X("$ZodReadonly",($,U)=>{S.init($,U),D($._zod,"propValues",()=>U.innerType._zod.propValues),D($._zod,"values",()=>U.innerType._zod.values),D($._zod,"optin",()=>U.innerType._zod.optin),D($._zod,"optout",()=>U.innerType._zod.optout),$._zod.parse=(b,r)=>{if(r.direction==="backward")return U.innerType._zod.run(b,r);let v=U.innerType._zod.run(b,r);if(v instanceof Promise)return v.then(AO);return AO(v)}});function AO($){return $.value=Object.freeze($.value),$}var hr=X("$ZodTemplateLiteral",($,U)=>{S.init($,U);let b=[];for(let r of U.parts)if(typeof r==="object"&&r!==null){if(!r._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let v=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!v)throw Error(`Invalid template literal part: ${r._zod.traits}`);let z=v.startsWith("^")?1:0,_=v.endsWith("$")?v.length-1:v.length;b.push(v.slice(z,_))}else if(r===null||mU.has(typeof r))b.push(H$(`${r}`));else throw Error(`Invalid template literal part: ${r}`);$._zod.pattern=new RegExp(`^${b.join("")}$`),$._zod.parse=(r,v)=>{if(typeof r.value!=="string")return r.issues.push({input:r.value,inst:$,expected:"template_literal",code:"invalid_type"}),r;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(r.value))return r.issues.push({input:r.value,inst:$,code:"invalid_format",format:U.format??"template_literal",pattern:$._zod.pattern.source}),r;return r}}),yr=X("$ZodFunction",($,U)=>{return S.init($,U),$._def=U,$._zod.def=U,$.implement=(b)=>{if(typeof b!=="function")throw Error("implement() must be called with a function");return function(...r){let v=$._def.input?y4($._def.input,r):r,z=Reflect.apply(b,this,v);if($._def.output)return y4($._def.output,z);return z}},$.implementAsync=(b)=>{if(typeof b!=="function")throw Error("implementAsync() must be called with a function");return async function(...r){let v=$._def.input?await f4($._def.input,r):r,z=await Reflect.apply(b,this,v);if($._def.output)return await f4($._def.output,z);return z}},$._zod.parse=(b,r)=>{if(typeof b.value!=="function")return b.issues.push({code:"invalid_type",expected:"function",input:b.value,inst:$}),b;if($._def.output&&$._def.output._zod.def.type==="promise")b.value=$.implementAsync(b.value);else b.value=$.implement(b.value);return b},$.input=(...b)=>{let r=$.constructor;if(Array.isArray(b[0]))return new r({type:"function",input:new I6({type:"tuple",items:b[0],rest:b[1]}),output:$._def.output});return new r({type:"function",input:b[0],output:$._def.output})},$.output=(b)=>{return new $.constructor({type:"function",input:$._def.input,output:b})},$}),fr=X("$ZodPromise",($,U)=>{S.init($,U),$._zod.parse=(b,r)=>{return Promise.resolve(b.value).then((v)=>U.innerType._zod.run({value:v,issues:[]},r))}}),nr=X("$ZodLazy",($,U)=>{S.init($,U),D($._zod,"innerType",()=>U.getter()),D($._zod,"pattern",()=>$._zod.innerType._zod.pattern),D($._zod,"propValues",()=>$._zod.innerType._zod.propValues),D($._zod,"optin",()=>$._zod.innerType._zod.optin??void 0),D($._zod,"optout",()=>$._zod.innerType._zod.optout??void 0),$._zod.parse=(b,r)=>{return $._zod.innerType._zod.run(b,r)}}),ir=X("$ZodCustom",($,U)=>{n.init($,U),S.init($,U),$._zod.parse=(b,r)=>{return b},$._zod.check=(b)=>{let r=b.value,v=U.fn(r);if(v instanceof Promise)return v.then((z)=>GO(z,b,r,$));GO(v,b,r,$);return}});function GO($,U,b,r){if(!$){let v={code:"custom",input:b,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};if(r._zod.def.params)v.params=r._zod.def.params;U.issues.push(_v(v))}}var ov={};J$(ov,{zhTW:()=>x1,zhCN:()=>D1,yo:()=>g1,vi:()=>Z1,ur:()=>M1,uk:()=>lv,ua:()=>F1,tr:()=>S1,th:()=>E1,ta:()=>H1,sv:()=>G1,sl:()=>A1,ru:()=>L1,pt:()=>B1,ps:()=>P1,pl:()=>q1,ota:()=>V1,no:()=>j1,nl:()=>W1,ms:()=>Y1,mk:()=>Q1,lt:()=>w1,ko:()=>K1,km:()=>fv,kh:()=>X1,ka:()=>J1,ja:()=>I1,it:()=>k1,is:()=>O1,id:()=>N1,hu:()=>_1,he:()=>z1,frCA:()=>r1,fr:()=>b1,fi:()=>U1,fa:()=>v1,es:()=>$1,eo:()=>sr,en:()=>yv,de:()=>ar,da:()=>er,cs:()=>tr,ca:()=>pr,be:()=>dr,az:()=>or,ar:()=>lr});var E0=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(v)=>{switch(v.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${v.expected}، ولكن تم إدخال ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${P(v.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return` أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${z} ${v.maximum.toString()} ${_.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${z} ${v.minimum.toString()} ${_.unit}`;return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${v.prefix}"`;if(z.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${z.suffix}"`;if(z.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${z.includes}"`;if(z.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${z.pattern}`;return`${r[z.format]??v.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${v.divisor}`;case"unrecognized_keys":return`معرف${v.keys.length>1?"ات":""} غريب${v.keys.length>1?"ة":""}: ${K(v.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${v.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${v.origin}`;default:return"مدخل غير مقبول"}}};function lr(){return{localeError:E0()}}var S0=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},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"};return(v)=>{switch(v.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${v.expected}, daxil olan ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Yanlış dəyər: gözlənilən ${P(v.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${z}${v.maximum.toString()} ${_.unit??"element"}`;return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Çox kiçik: gözlənilən ${v.origin} ${z}${v.minimum.toString()} ${_.unit}`;return`Çox kiçik: gözlənilən ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Yanlış mətn: "${z.prefix}" ilə başlamalıdır`;if(z.format==="ends_with")return`Yanlış mətn: "${z.suffix}" ilə bitməlidir`;if(z.format==="includes")return`Yanlış mətn: "${z.includes}" daxil olmalıdır`;if(z.format==="regex")return`Yanlış mətn: ${z.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${r[z.format]??v.format}`}case"not_multiple_of":return`Yanlış ədəd: ${v.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${v.keys.length>1?"lar":""}: ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${v.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function or(){return{localeError:S0()}}function ZO($,U,b,r){let v=Math.abs($),z=v%10,_=v%100;if(_>=11&&_<=19)return r;if(z===1)return U;if(z>=2&&z<=4)return b;return r}var F0=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"лік";case"object":{if(Array.isArray(v))return"масіў";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(v)=>{switch(v.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${v.expected}, атрымана ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Няправільны ўвод: чакалася ${P(v.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_){let N=Number(v.maximum),O=ZO(N,_.unit.one,_.unit.few,_.unit.many);return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна ${_.verb} ${z}${v.maximum.toString()} ${O}`}return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна быць ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_){let N=Number(v.minimum),O=ZO(N,_.unit.one,_.unit.few,_.unit.many);return`Занадта малы: чакалася, што ${v.origin} павінна ${_.verb} ${z}${v.minimum.toString()} ${O}`}return`Занадта малы: чакалася, што ${v.origin} павінна быць ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${z.prefix}"`;if(z.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${z.suffix}"`;if(z.format==="includes")return`Няправільны радок: павінен змяшчаць "${z.includes}"`;if(z.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${z.pattern}`;return`Няправільны ${r[z.format]??v.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${v.keys.length>1?"ключы":"ключ"}: ${K(v.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${v.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${v.origin}`;default:return"Няправільны ўвод"}}};function dr(){return{localeError:F0()}}var M0=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(v)=>{switch(v.code){case"invalid_type":return`Tipus invàlid: s'esperava ${v.expected}, s'ha rebut ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Valor invàlid: s'esperava ${P(v.values[0])}`;return`Opció invàlida: s'esperava una de ${K(v.values," o ")}`;case"too_big":{let z=v.inclusive?"com a màxim":"menys de",_=U(v.origin);if(_)return`Massa gran: s'esperava que ${v.origin??"el valor"} contingués ${z} ${v.maximum.toString()} ${_.unit??"elements"}`;return`Massa gran: s'esperava que ${v.origin??"el valor"} fos ${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?"com a mínim":"més de",_=U(v.origin);if(_)return`Massa petit: s'esperava que ${v.origin} contingués ${z} ${v.minimum.toString()} ${_.unit}`;return`Massa petit: s'esperava que ${v.origin} fos ${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Format invàlid: ha de començar amb "${z.prefix}"`;if(z.format==="ends_with")return`Format invàlid: ha d'acabar amb "${z.suffix}"`;if(z.format==="includes")return`Format invàlid: ha d'incloure "${z.includes}"`;if(z.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${z.pattern}`;return`Format invàlid per a ${r[z.format]??v.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${v.divisor}`;case"unrecognized_keys":return`Clau${v.keys.length>1?"s":""} no reconeguda${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${v.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${v.origin}`;default:return"Entrada invàlida"}}};function pr(){return{localeError:M0()}}var Z0=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(v))return"pole";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(v)=>{switch(v.code){case"invalid_type":return`Neplatný vstup: očekáváno ${v.expected}, obdrženo ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Neplatný vstup: očekáváno ${P(v.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí mít ${z}${v.maximum.toString()} ${_.unit??"prvků"}`;return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí být ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí mít ${z}${v.minimum.toString()} ${_.unit??"prvků"}`;return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí být ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Neplatný řetězec: musí začínat na "${z.prefix}"`;if(z.format==="ends_with")return`Neplatný řetězec: musí končit na "${z.suffix}"`;if(z.format==="includes")return`Neplatný řetězec: musí obsahovat "${z.includes}"`;if(z.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${z.pattern}`;return`Neplatný formát ${r[z.format]??v.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${v.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${K(v.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${v.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${v.origin}`;default:return"Neplatný vstup"}}};function tr(){return{localeError:Z0()}}var D0=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},U={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function b(_){return $[_]??null}function r(_){return U[_]??_}let v=(_)=>{let N=typeof _;switch(N){case"number":return Number.isNaN(_)?"NaN":"tal";case"object":{if(Array.isArray(_))return"liste";if(_===null)return"null";if(Object.getPrototypeOf(_)!==Object.prototype&&_.constructor)return _.constructor.name;return"objekt"}}return N},z={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",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"};return(_)=>{switch(_.code){case"invalid_type":return`Ugyldigt input: forventede ${r(_.expected)}, fik ${r(v(_.input))}`;case"invalid_value":if(_.values.length===1)return`Ugyldig værdi: forventede ${P(_.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${K(_.values,"|")}`;case"too_big":{let N=_.inclusive?"<=":"<",O=b(_.origin),k=r(_.origin);if(O)return`For stor: forventede ${k??"value"} ${O.verb} ${N} ${_.maximum.toString()} ${O.unit??"elementer"}`;return`For stor: forventede ${k??"value"} havde ${N} ${_.maximum.toString()}`}case"too_small":{let N=_.inclusive?">=":">",O=b(_.origin),k=r(_.origin);if(O)return`For lille: forventede ${k} ${O.verb} ${N} ${_.minimum.toString()} ${O.unit}`;return`For lille: forventede ${k} havde ${N} ${_.minimum.toString()}`}case"invalid_format":{let N=_;if(N.format==="starts_with")return`Ugyldig streng: skal starte med "${N.prefix}"`;if(N.format==="ends_with")return`Ugyldig streng: skal ende med "${N.suffix}"`;if(N.format==="includes")return`Ugyldig streng: skal indeholde "${N.includes}"`;if(N.format==="regex")return`Ugyldig streng: skal matche mønsteret ${N.pattern}`;return`Ugyldig ${z[N.format]??_.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${K(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${_.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${_.origin}`;default:return"Ugyldigt input"}}};function er(){return{localeError:D0()}}var x0=()=>{let $={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 U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"Zahl";case"object":{if(Array.isArray(v))return"Array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},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"};return(v)=>{switch(v.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${v.expected}, erhalten ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ungültige Eingabe: erwartet ${P(v.values[0])}`;return`Ungültige Option: erwartet eine von ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${z}${v.maximum.toString()} ${_.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${z}${v.maximum.toString()} ist`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Zu klein: erwartet, dass ${v.origin} ${z}${v.minimum.toString()} ${_.unit} hat`;return`Zu klein: erwartet, dass ${v.origin} ${z}${v.minimum.toString()} ist`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ungültiger String: muss mit "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ungültiger String: muss mit "${z.suffix}" enden`;if(z.format==="includes")return`Ungültiger String: muss "${z.includes}" enthalten`;if(z.format==="regex")return`Ungültiger String: muss dem Muster ${z.pattern} entsprechen`;return`Ungültig: ${r[z.format]??v.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${v.divisor} sein`;case"unrecognized_keys":return`${v.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${K(v.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${v.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${v.origin}`;default:return"Ungültige Eingabe"}}};function ar(){return{localeError:x0()}}var g0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},R0=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function U(r){return $[r]??null}let b={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"};return(r)=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${g0(r.input)}`;case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${P(r.values[0])}`;return`Invalid option: expected one of ${K(r.values,"|")}`;case"too_big":{let v=r.inclusive?"<=":"<",z=U(r.origin);if(z)return`Too big: expected ${r.origin??"value"} to have ${v}${r.maximum.toString()} ${z.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",z=U(r.origin);if(z)return`Too small: expected ${r.origin} to have ${v}${r.minimum.toString()} ${z.unit}`;return`Too small: expected ${r.origin} to be ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;if(v.format==="starts_with")return`Invalid string: must start with "${v.prefix}"`;if(v.format==="ends_with")return`Invalid string: must end with "${v.suffix}"`;if(v.format==="includes")return`Invalid string: must include "${v.includes}"`;if(v.format==="regex")return`Invalid string: must match pattern ${v.pattern}`;return`Invalid ${b[v.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${K(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function yv(){return{localeError:R0()}}var m0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},T0=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function U(r){return $[r]??null}let b={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"};return(r)=>{switch(r.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${r.expected}, riceviĝis ${m0(r.input)}`;case"invalid_value":if(r.values.length===1)return`Nevalida enigo: atendiĝis ${P(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${K(r.values,"|")}`;case"too_big":{let v=r.inclusive?"<=":"<",z=U(r.origin);if(z)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${v}${r.maximum.toString()} ${z.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",z=U(r.origin);if(z)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${v}${r.minimum.toString()} ${z.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;if(v.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${v.prefix}"`;if(v.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${v.suffix}"`;if(v.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${v.includes}"`;if(v.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${v.pattern}`;return`Nevalida ${b[v.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${K(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function sr(){return{localeError:T0()}}var C0=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},U={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function b(_){return $[_]??null}function r(_){return U[_]??_}let v=(_)=>{let N=typeof _;switch(N){case"number":return Number.isNaN(_)?"NaN":"number";case"object":{if(Array.isArray(_))return"array";if(_===null)return"null";if(Object.getPrototypeOf(_)!==Object.prototype)return _.constructor.name;return"object"}}return N},z={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(_)=>{switch(_.code){case"invalid_type":return`Entrada inválida: se esperaba ${r(_.expected)}, recibido ${r(v(_.input))}`;case"invalid_value":if(_.values.length===1)return`Entrada inválida: se esperaba ${P(_.values[0])}`;return`Opción inválida: se esperaba una de ${K(_.values,"|")}`;case"too_big":{let N=_.inclusive?"<=":"<",O=b(_.origin),k=r(_.origin);if(O)return`Demasiado grande: se esperaba que ${k??"valor"} tuviera ${N}${_.maximum.toString()} ${O.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${k??"valor"} fuera ${N}${_.maximum.toString()}`}case"too_small":{let N=_.inclusive?">=":">",O=b(_.origin),k=r(_.origin);if(O)return`Demasiado pequeño: se esperaba que ${k} tuviera ${N}${_.minimum.toString()} ${O.unit}`;return`Demasiado pequeño: se esperaba que ${k} fuera ${N}${_.minimum.toString()}`}case"invalid_format":{let N=_;if(N.format==="starts_with")return`Cadena inválida: debe comenzar con "${N.prefix}"`;if(N.format==="ends_with")return`Cadena inválida: debe terminar en "${N.suffix}"`;if(N.format==="includes")return`Cadena inválida: debe incluir "${N.includes}"`;if(N.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${N.pattern}`;return`Inválido ${z[N.format]??_.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Llave${_.keys.length>1?"s":""} desconocida${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r(_.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r(_.origin)}`;default:return"Entrada inválida"}}};function $1(){return{localeError:C0()}}var c0=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"عدد";case"object":{if(Array.isArray(v))return"آرایه";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(v)=>{switch(v.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${v.expected} می‌بود، ${b(v.input)} دریافت شد`;case"invalid_value":if(v.values.length===1)return`ورودی نامعتبر: می‌بایست ${P(v.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${K(v.values,"|")} می‌بود`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${z}${v.maximum.toString()} ${_.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${z}${v.maximum.toString()} باشد`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`خیلی کوچک: ${v.origin} باید ${z}${v.minimum.toString()} ${_.unit} باشد`;return`خیلی کوچک: ${v.origin} باید ${z}${v.minimum.toString()} باشد`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`رشته نامعتبر: باید با "${z.prefix}" شروع شود`;if(z.format==="ends_with")return`رشته نامعتبر: باید با "${z.suffix}" تمام شود`;if(z.format==="includes")return`رشته نامعتبر: باید شامل "${z.includes}" باشد`;if(z.format==="regex")return`رشته نامعتبر: باید با الگوی ${z.pattern} مطابقت داشته باشد`;return`${r[z.format]??v.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${v.divisor} باشد`;case"unrecognized_keys":return`کلید${v.keys.length>1?"های":""} ناشناس: ${K(v.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${v.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${v.origin}`;default:return"ورودی نامعتبر"}}};function v1(){return{localeError:c0()}}var u0=()=>{let $={string:{unit:"merkkiä",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äivämäärän"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",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"};return(v)=>{switch(v.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${v.expected}, oli ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Virheellinen syöte: täytyy olla ${P(v.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Liian suuri: ${_.subject} täytyy olla ${z}${v.maximum.toString()} ${_.unit}`.trim();return`Liian suuri: arvon täytyy olla ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Liian pieni: ${_.subject} täytyy olla ${z}${v.minimum.toString()} ${_.unit}`.trim();return`Liian pieni: arvon täytyy olla ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${z.prefix}"`;if(z.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${z.suffix}"`;if(z.format==="includes")return`Virheellinen syöte: täytyy sisältää "${z.includes}"`;if(z.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${z.pattern}`;return`Virheellinen ${r[z.format]??v.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${v.divisor} monikerta`;case"unrecognized_keys":return`${v.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${K(v.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öte"}}};function U1(){return{localeError:u0()}}var h0=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"nombre";case"object":{if(Array.isArray(v))return"tableau";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(v)=>{switch(v.code){case"invalid_type":return`Entrée invalide : ${v.expected} attendu, ${b(v.input)} reçu`;case"invalid_value":if(v.values.length===1)return`Entrée invalide : ${P(v.values[0])} attendu`;return`Option invalide : une valeur parmi ${K(v.values,"|")} attendue`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Trop grand : ${v.origin??"valeur"} doit ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"élément(s)"}`;return`Trop grand : ${v.origin??"valeur"} doit être ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Trop petit : ${v.origin} doit ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Trop petit : ${v.origin} doit être ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${z.pattern}`;return`${r[z.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${K(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function b1(){return{localeError:h0()}}var y0=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(v)=>{switch(v.code){case"invalid_type":return`Entrée invalide : attendu ${v.expected}, reçu ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Entrée invalide : attendu ${P(v.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"≤":"<",_=U(v.origin);if(_)return`Trop grand : attendu que ${v.origin??"la valeur"} ait ${z}${v.maximum.toString()} ${_.unit}`;return`Trop grand : attendu que ${v.origin??"la valeur"} soit ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?"≥":">",_=U(v.origin);if(_)return`Trop petit : attendu que ${v.origin} ait ${z}${v.minimum.toString()} ${_.unit}`;return`Trop petit : attendu que ${v.origin} soit ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au motif ${z.pattern}`;return`${r[z.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${K(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function r1(){return{localeError:y0()}}var f0=()=>{let $={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(v)=>{switch(v.code){case"invalid_type":return`קלט לא תקין: צריך ${v.expected}, התקבל ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`קלט לא תקין: צריך ${P(v.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`גדול מדי: ${v.origin??"value"} צריך להיות ${z}${v.maximum.toString()} ${_.unit??"elements"}`;return`גדול מדי: ${v.origin??"value"} צריך להיות ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`קטן מדי: ${v.origin} צריך להיות ${z}${v.minimum.toString()} ${_.unit}`;return`קטן מדי: ${v.origin} צריך להיות ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${z.prefix}"`;if(z.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${z.suffix}"`;if(z.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${z.includes}"`;if(z.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${z.pattern}`;return`${r[z.format]??v.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${v.divisor}`;case"unrecognized_keys":return`מפתח${v.keys.length>1?"ות":""} לא מזוה${v.keys.length>1?"ים":"ה"}: ${K(v.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${v.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${v.origin}`;default:return"קלט לא תקין"}}};function z1(){return{localeError:f0()}}var n0=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"szám";case"object":{if(Array.isArray(v))return"tömb";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(v)=>{switch(v.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${v.expected}, a kapott érték ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Érvénytelen bemenet: a várt érték ${P(v.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Túl nagy: ${v.origin??"érték"} mérete túl nagy ${z}${v.maximum.toString()} ${_.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${v.origin??"érték"} túl nagy: ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Túl kicsi: a bemeneti érték ${v.origin} mérete túl kicsi ${z}${v.minimum.toString()} ${_.unit}`;return`Túl kicsi: a bemeneti érték ${v.origin} túl kicsi ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Érvénytelen string: "${z.prefix}" értékkel kell kezdődnie`;if(z.format==="ends_with")return`Érvénytelen string: "${z.suffix}" értékkel kell végződnie`;if(z.format==="includes")return`Érvénytelen string: "${z.includes}" értéket kell tartalmaznia`;if(z.format==="regex")return`Érvénytelen string: ${z.pattern} mintának kell megfelelnie`;return`Érvénytelen ${r[z.format]??v.format}`}case"not_multiple_of":return`Érvénytelen szám: ${v.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${v.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${v.origin}`;default:return"Érvénytelen bemenet"}}};function _1(){return{localeError:n0()}}var i0=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},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"};return(v)=>{switch(v.code){case"invalid_type":return`Input tidak valid: diharapkan ${v.expected}, diterima ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Input tidak valid: diharapkan ${P(v.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Terlalu besar: diharapkan ${v.origin??"value"} memiliki ${z}${v.maximum.toString()} ${_.unit??"elemen"}`;return`Terlalu besar: diharapkan ${v.origin??"value"} menjadi ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Terlalu kecil: diharapkan ${v.origin} memiliki ${z}${v.minimum.toString()} ${_.unit}`;return`Terlalu kecil: diharapkan ${v.origin} menjadi ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`String tidak valid: harus dimulai dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak valid: harus berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak valid: harus menyertakan "${z.includes}"`;if(z.format==="regex")return`String tidak valid: harus sesuai pola ${z.pattern}`;return`${r[z.format]??v.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${v.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${v.origin}`;default:return"Input tidak valid"}}};function N1(){return{localeError:i0()}}var l0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},o0=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function U(r){return $[r]??null}let b={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",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ölugildi",jwt:"JWT",template_literal:"gildi"};return(r)=>{switch(r.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${l0(r.input)} þar sem á að vera ${r.expected}`;case"invalid_value":if(r.values.length===1)return`Rangt gildi: gert ráð fyrir ${P(r.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${K(r.values,"|")}`;case"too_big":{let v=r.inclusive?"<=":"<",z=U(r.origin);if(z)return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} hafi ${v}${r.maximum.toString()} ${z.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} sé ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",z=U(r.origin);if(z)return`Of lítið: gert er ráð fyrir að ${r.origin} hafi ${v}${r.minimum.toString()} ${z.unit}`;return`Of lítið: gert er ráð fyrir að ${r.origin} sé ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;if(v.format==="starts_with")return`Ógildur strengur: verður að byrja á "${v.prefix}"`;if(v.format==="ends_with")return`Ógildur strengur: verður að enda á "${v.suffix}"`;if(v.format==="includes")return`Ógildur strengur: verður að innihalda "${v.includes}"`;if(v.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${v.pattern}`;return`Rangt ${b[v.format]??r.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`Óþekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${K(r.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${r.origin}`;default:return"Rangt gildi"}}};function O1(){return{localeError:o0()}}var d0=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"numero";case"object":{if(Array.isArray(v))return"vettore";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},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"};return(v)=>{switch(v.code){case"invalid_type":return`Input non valido: atteso ${v.expected}, ricevuto ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Input non valido: atteso ${P(v.values[0])}`;return`Opzione non valida: atteso uno tra ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Troppo grande: ${v.origin??"valore"} deve avere ${z}${v.maximum.toString()} ${_.unit??"elementi"}`;return`Troppo grande: ${v.origin??"valore"} deve essere ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Troppo piccolo: ${v.origin} deve avere ${z}${v.minimum.toString()} ${_.unit}`;return`Troppo piccolo: ${v.origin} deve essere ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Stringa non valida: deve iniziare con "${z.prefix}"`;if(z.format==="ends_with")return`Stringa non valida: deve terminare con "${z.suffix}"`;if(z.format==="includes")return`Stringa non valida: deve includere "${z.includes}"`;if(z.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${z.pattern}`;return`Invalid ${r[z.format]??v.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${v.divisor}`;case"unrecognized_keys":return`Chiav${v.keys.length>1?"i":"e"} non riconosciut${v.keys.length>1?"e":"a"}: ${K(v.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${v.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${v.origin}`;default:return"Input non valido"}}};function k1(){return{localeError:d0()}}var p0=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"数値";case"object":{if(Array.isArray(v))return"配列";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(v)=>{switch(v.code){case"invalid_type":return`無効な入力: ${v.expected}が期待されましたが、${b(v.input)}が入力されました`;case"invalid_value":if(v.values.length===1)return`無効な入力: ${P(v.values[0])}が期待されました`;return`無効な選択: ${K(v.values,"、")}のいずれかである必要があります`;case"too_big":{let z=v.inclusive?"以下である":"より小さい",_=U(v.origin);if(_)return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${_.unit??"要素"}${z}必要があります`;return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${z}必要があります`}case"too_small":{let z=v.inclusive?"以上である":"より大きい",_=U(v.origin);if(_)return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${_.unit}${z}必要があります`;return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${z}必要があります`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`無効な文字列: "${z.prefix}"で始まる必要があります`;if(z.format==="ends_with")return`無効な文字列: "${z.suffix}"で終わる必要があります`;if(z.format==="includes")return`無効な文字列: "${z.includes}"を含む必要があります`;if(z.format==="regex")return`無効な文字列: パターン${z.pattern}に一致する必要があります`;return`無効な${r[z.format]??v.format}`}case"not_multiple_of":return`無効な数値: ${v.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${v.keys.length>1?"群":""}: ${K(v.keys,"、")}`;case"invalid_key":return`${v.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${v.origin}内の無効な値`;default:return"無効な入力"}}};function I1(){return{localeError:p0()}}var t0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[U]??U},e0=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function U(r){return $[r]??null}let b={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(r)=>{switch(r.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${r.expected}, მიღებული ${t0(r.input)}`;case"invalid_value":if(r.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${P(r.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${K(r.values,"|")}-დან`;case"too_big":{let v=r.inclusive?"<=":"<",z=U(r.origin);if(z)return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${z.verb} ${v}${r.maximum.toString()} ${z.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",z=U(r.origin);if(z)return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${z.verb} ${v}${r.minimum.toString()} ${z.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;if(v.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${v.prefix}"-ით`;if(v.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${v.suffix}"-ით`;if(v.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${v.includes}"-ს`;if(v.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${v.pattern}`;return`არასწორი ${b[v.format]??r.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${K(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`;default:return"არასწორი შეყვანა"}}};function J1(){return{localeError:e0()}}var a0=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(v))return"អារេ (Array)";if(v===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(v)=>{switch(v.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${v.expected} ប៉ុន្តែទទួលបាន ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${P(v.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${z} ${v.maximum.toString()} ${_.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`តូចពេក៖ ត្រូវការ ${v.origin} ${z} ${v.minimum.toString()} ${_.unit}`;return`តូចពេក៖ ត្រូវការ ${v.origin} ${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${z.prefix}"`;if(z.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${z.suffix}"`;if(z.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${z.includes}"`;if(z.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${z.pattern}`;return`មិនត្រឹមត្រូវ៖ ${r[z.format]??v.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${v.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${K(v.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function fv(){return{localeError:a0()}}function X1(){return fv()}var s0=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(v)=>{switch(v.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${v.expected}, 받은 타입은 ${b(v.input)}입니다`;case"invalid_value":if(v.values.length===1)return`잘못된 입력: 값은 ${P(v.values[0])} 이어야 합니다`;return`잘못된 옵션: ${K(v.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let z=v.inclusive?"이하":"미만",_=z==="미만"?"이어야 합니다":"여야 합니다",N=U(v.origin),O=N?.unit??"요소";if(N)return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()}${O} ${z}${_}`;return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()} ${z}${_}`}case"too_small":{let z=v.inclusive?"이상":"초과",_=z==="이상"?"이어야 합니다":"여야 합니다",N=U(v.origin),O=N?.unit??"요소";if(N)return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()}${O} ${z}${_}`;return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()} ${z}${_}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`잘못된 문자열: "${z.prefix}"(으)로 시작해야 합니다`;if(z.format==="ends_with")return`잘못된 문자열: "${z.suffix}"(으)로 끝나야 합니다`;if(z.format==="includes")return`잘못된 문자열: "${z.includes}"을(를) 포함해야 합니다`;if(z.format==="regex")return`잘못된 문자열: 정규식 ${z.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${r[z.format]??v.format}`}case"not_multiple_of":return`잘못된 숫자: ${v.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${K(v.keys,", ")}`;case"invalid_key":return`잘못된 키: ${v.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${v.origin}`;default:return"잘못된 입력"}}};function K1(){return{localeError:s0()}}var $X=($)=>{return iv(typeof $,$)},iv=($,U=void 0)=>{switch($){case"number":return Number.isNaN(U)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(U===void 0)return"nežinomas objektas";if(U===null)return"nulinė reikšmė";if(Array.isArray(U))return"masyvas";if(Object.getPrototypeOf(U)!==Object.prototype&&U.constructor)return U.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},nv=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function DO($){let U=Math.abs($),b=U%10,r=U%100;if(r>=11&&r<=19||b===0)return"many";if(b===1)return"one";return"few"}var vX=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function U(r,v,z,_){let N=$[r]??null;if(N===null)return N;return{unit:N.unit[v],verb:N.verb[_][z?"inclusive":"notInclusive"]}}let b={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(r)=>{switch(r.code){case"invalid_type":return`Gautas tipas ${$X(r.input)}, o tikėtasi - ${iv(r.expected)}`;case"invalid_value":if(r.values.length===1)return`Privalo būti ${P(r.values[0])}`;return`Privalo būti vienas iš ${K(r.values,"|")} pasirinkimų`;case"too_big":{let v=iv(r.origin),z=U(r.origin,DO(Number(r.maximum)),r.inclusive??!1,"smaller");if(z?.verb)return`${nv(v??r.origin??"reikšmė")} ${z.verb} ${r.maximum.toString()} ${z.unit??"elementų"}`;let _=r.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${nv(v??r.origin??"reikšmė")} turi būti ${_} ${r.maximum.toString()} ${z?.unit}`}case"too_small":{let v=iv(r.origin),z=U(r.origin,DO(Number(r.minimum)),r.inclusive??!1,"bigger");if(z?.verb)return`${nv(v??r.origin??"reikšmė")} ${z.verb} ${r.minimum.toString()} ${z.unit??"elementų"}`;let _=r.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${nv(v??r.origin??"reikšmė")} turi būti ${_} ${r.minimum.toString()} ${z?.unit}`}case"invalid_format":{let v=r;if(v.format==="starts_with")return`Eilutė privalo prasidėti "${v.prefix}"`;if(v.format==="ends_with")return`Eilutė privalo pasibaigti "${v.suffix}"`;if(v.format==="includes")return`Eilutė privalo įtraukti "${v.includes}"`;if(v.format==="regex")return`Eilutė privalo atitikti ${v.pattern}`;return`Neteisingas ${b[v.format]??r.format}`}case"not_multiple_of":return`Skaičius privalo būti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${K(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let v=iv(r.origin);return`${nv(v??r.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function w1(){return{localeError:vX()}}var UX=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"број";case"object":{if(Array.isArray(v))return"низа";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(v)=>{switch(v.code){case"invalid_type":return`Грешен внес: се очекува ${v.expected}, примено ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${P(v.values[0])}`;return`Грешана опција: се очекува една ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Премногу голем: се очекува ${v.origin??"вредноста"} да има ${z}${v.maximum.toString()} ${_.unit??"елементи"}`;return`Премногу голем: се очекува ${v.origin??"вредноста"} да биде ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Премногу мал: се очекува ${v.origin} да има ${z}${v.minimum.toString()} ${_.unit}`;return`Премногу мал: се очекува ${v.origin} да биде ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Неважечка низа: мора да започнува со "${z.prefix}"`;if(z.format==="ends_with")return`Неважечка низа: мора да завршува со "${z.suffix}"`;if(z.format==="includes")return`Неважечка низа: мора да вклучува "${z.includes}"`;if(z.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${z.pattern}`;return`Invalid ${r[z.format]??v.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${K(v.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${v.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${v.origin}`;default:return"Грешен внес"}}};function Q1(){return{localeError:UX()}}var bX=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"nombor";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},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"};return(v)=>{switch(v.code){case"invalid_type":return`Input tidak sah: dijangka ${v.expected}, diterima ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Input tidak sah: dijangka ${P(v.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Terlalu besar: dijangka ${v.origin??"nilai"} ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"elemen"}`;return`Terlalu besar: dijangka ${v.origin??"nilai"} adalah ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Terlalu kecil: dijangka ${v.origin} ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Terlalu kecil: dijangka ${v.origin} adalah ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`String tidak sah: mesti bermula dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak sah: mesti mengandungi "${z.includes}"`;if(z.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${z.pattern}`;return`${r[z.format]??v.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${K(v.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${v.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${v.origin}`;default:return"Input tidak sah"}}};function Y1(){return{localeError:bX()}}var rX=()=>{let $={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"getal";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},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"};return(v)=>{switch(v.code){case"invalid_type":return`Ongeldige invoer: verwacht ${v.expected}, ontving ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ongeldige invoer: verwacht ${P(v.values[0])}`;return`Ongeldige optie: verwacht één van ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Te lang: verwacht dat ${v.origin??"waarde"} ${z}${v.maximum.toString()} ${_.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${v.origin??"waarde"} ${z}${v.maximum.toString()} is`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Te kort: verwacht dat ${v.origin} ${z}${v.minimum.toString()} ${_.unit} bevat`;return`Te kort: verwacht dat ${v.origin} ${z}${v.minimum.toString()} is`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ongeldige tekst: moet met "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ongeldige tekst: moet op "${z.suffix}" eindigen`;if(z.format==="includes")return`Ongeldige tekst: moet "${z.includes}" bevatten`;if(z.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${z.pattern}`;return`Ongeldig: ${r[z.format]??v.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${v.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${v.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${v.origin}`;default:return"Ongeldige invoer"}}};function W1(){return{localeError:rX()}}var zX=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"tall";case"object":{if(Array.isArray(v))return"liste";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},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åde",ipv6:"IPv6-område",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"};return(v)=>{switch(v.code){case"invalid_type":return`Ugyldig input: forventet ${v.expected}, fikk ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ugyldig verdi: forventet ${P(v.values[0])}`;return`Ugyldig valg: forventet en av ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`For stor(t): forventet ${v.origin??"value"} til å ha ${z}${v.maximum.toString()} ${_.unit??"elementer"}`;return`For stor(t): forventet ${v.origin??"value"} til å ha ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`For lite(n): forventet ${v.origin} til å ha ${z}${v.minimum.toString()} ${_.unit}`;return`For lite(n): forventet ${v.origin} til å ha ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ugyldig streng: må starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: må ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: må inneholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: må matche mønsteret ${z.pattern}`;return`Ugyldig ${r[z.format]??v.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${K(v.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${v.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${v.origin}`;default:return"Ugyldig input"}}};function j1(){return{localeError:zX()}}var _X=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"numara";case"object":{if(Array.isArray(v))return"saf";if(v===null)return"gayb";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(v)=>{switch(v.code){case"invalid_type":return`Fâsit giren: umulan ${v.expected}, alınan ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Fâsit giren: umulan ${P(v.values[0])}`;return`Fâsit tercih: mûteberler ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Fazla büyük: ${v.origin??"value"}, ${z}${v.maximum.toString()} ${_.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${v.origin??"value"}, ${z}${v.maximum.toString()} olmalıydı.`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Fazla küçük: ${v.origin}, ${z}${v.minimum.toString()} ${_.unit} sahip olmalıydı.`;return`Fazla küçük: ${v.origin}, ${z}${v.minimum.toString()} olmalıydı.`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Fâsit metin: "${z.prefix}" ile başlamalı.`;if(z.format==="ends_with")return`Fâsit metin: "${z.suffix}" ile bitmeli.`;if(z.format==="includes")return`Fâsit metin: "${z.includes}" ihtivâ etmeli.`;if(z.format==="regex")return`Fâsit metin: ${z.pattern} nakşına uymalı.`;return`Fâsit ${r[z.format]??v.format}`}case"not_multiple_of":return`Fâsit sayı: ${v.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${v.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function V1(){return{localeError:_X()}}var NX=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"عدد";case"object":{if(Array.isArray(v))return"ارې";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(v)=>{switch(v.code){case"invalid_type":return`ناسم ورودي: باید ${v.expected} وای, مګر ${b(v.input)} ترلاسه شو`;case"invalid_value":if(v.values.length===1)return`ناسم ورودي: باید ${P(v.values[0])} وای`;return`ناسم انتخاب: باید یو له ${K(v.values,"|")} څخه وای`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`ډیر لوی: ${v.origin??"ارزښت"} باید ${z}${v.maximum.toString()} ${_.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${v.origin??"ارزښت"} باید ${z}${v.maximum.toString()} وي`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`ډیر کوچنی: ${v.origin} باید ${z}${v.minimum.toString()} ${_.unit} ولري`;return`ډیر کوچنی: ${v.origin} باید ${z}${v.minimum.toString()} وي`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`ناسم متن: باید د "${z.prefix}" سره پیل شي`;if(z.format==="ends_with")return`ناسم متن: باید د "${z.suffix}" سره پای ته ورسيږي`;if(z.format==="includes")return`ناسم متن: باید "${z.includes}" ولري`;if(z.format==="regex")return`ناسم متن: باید د ${z.pattern} سره مطابقت ولري`;return`${r[z.format]??v.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${v.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${v.keys.length>1?"کلیډونه":"کلیډ"}: ${K(v.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${v.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${v.origin} کې`;default:return"ناسمه ورودي"}}};function P1(){return{localeError:NX()}}var OX=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"liczba";case"object":{if(Array.isArray(v))return"tablica";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(v)=>{switch(v.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${v.expected}, otrzymano ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${P(v.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Za duża wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${z}${v.maximum.toString()} ${_.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Za mała wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${z}${v.minimum.toString()} ${_.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${z.prefix}"`;if(z.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${z.suffix}"`;if(z.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${z.includes}"`;if(z.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${z.pattern}`;return`Nieprawidłow(y/a/e) ${r[z.format]??v.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${v.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${v.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${v.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function q1(){return{localeError:OX()}}var kX=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"número";case"object":{if(Array.isArray(v))return"array";if(v===null)return"nulo";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"};return(v)=>{switch(v.code){case"invalid_type":return`Tipo inválido: esperado ${v.expected}, recebido ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Entrada inválida: esperado ${P(v.values[0])}`;return`Opção inválida: esperada uma das ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Muito grande: esperado que ${v.origin??"valor"} tivesse ${z}${v.maximum.toString()} ${_.unit??"elementos"}`;return`Muito grande: esperado que ${v.origin??"valor"} fosse ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Muito pequeno: esperado que ${v.origin} tivesse ${z}${v.minimum.toString()} ${_.unit}`;return`Muito pequeno: esperado que ${v.origin} fosse ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Texto inválido: deve começar com "${z.prefix}"`;if(z.format==="ends_with")return`Texto inválido: deve terminar com "${z.suffix}"`;if(z.format==="includes")return`Texto inválido: deve incluir "${z.includes}"`;if(z.format==="regex")return`Texto inválido: deve corresponder ao padrão ${z.pattern}`;return`${r[z.format]??v.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${v.divisor}`;case"unrecognized_keys":return`Chave${v.keys.length>1?"s":""} desconhecida${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Chave inválida em ${v.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${v.origin}`;default:return"Campo inválido"}}};function B1(){return{localeError:kX()}}function xO($,U,b,r){let v=Math.abs($),z=v%10,_=v%100;if(_>=11&&_<=19)return r;if(z===1)return U;if(z>=2&&z<=4)return b;return r}var IX=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"число";case"object":{if(Array.isArray(v))return"массив";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(v)=>{switch(v.code){case"invalid_type":return`Неверный ввод: ожидалось ${v.expected}, получено ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Неверный ввод: ожидалось ${P(v.values[0])}`;return`Неверный вариант: ожидалось одно из ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_){let N=Number(v.maximum),O=xO(N,_.unit.one,_.unit.few,_.unit.many);return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет иметь ${z}${v.maximum.toString()} ${O}`}return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_){let N=Number(v.minimum),O=xO(N,_.unit.one,_.unit.few,_.unit.many);return`Слишком маленькое значение: ожидалось, что ${v.origin} будет иметь ${z}${v.minimum.toString()} ${O}`}return`Слишком маленькое значение: ожидалось, что ${v.origin} будет ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Неверная строка: должна начинаться с "${z.prefix}"`;if(z.format==="ends_with")return`Неверная строка: должна заканчиваться на "${z.suffix}"`;if(z.format==="includes")return`Неверная строка: должна содержать "${z.includes}"`;if(z.format==="regex")return`Неверная строка: должна соответствовать шаблону ${z.pattern}`;return`Неверный ${r[z.format]??v.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспознанн${v.keys.length>1?"ые":"ый"} ключ${v.keys.length>1?"и":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${v.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${v.origin}`;default:return"Неверные входные данные"}}};function L1(){return{localeError:IX()}}var JX=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"število";case"object":{if(Array.isArray(v))return"tabela";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"};return(v)=>{switch(v.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${v.expected}, prejeto ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Neveljaven vnos: pričakovano ${P(v.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} imelo ${z}${v.maximum.toString()} ${_.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Premajhno: pričakovano, da bo ${v.origin} imelo ${z}${v.minimum.toString()} ${_.unit}`;return`Premajhno: pričakovano, da bo ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Neveljaven niz: mora se začeti z "${z.prefix}"`;if(z.format==="ends_with")return`Neveljaven niz: mora se končati z "${z.suffix}"`;if(z.format==="includes")return`Neveljaven niz: mora vsebovati "${z.includes}"`;if(z.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${z.pattern}`;return`Neveljaven ${r[z.format]??v.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${v.divisor}`;case"unrecognized_keys":return`Neprepoznan${v.keys.length>1?"i ključi":" ključ"}: ${K(v.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${v.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${v.origin}`;default:return"Neveljaven vnos"}}};function A1(){return{localeError:JX()}}var XX=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"antal";case"object":{if(Array.isArray(v))return"lista";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(v)=>{switch(v.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${v.expected}, fick ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ogiltig inmatning: förväntat ${P(v.values[0])}`;return`Ogiltigt val: förväntade en av ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`För stor(t): förväntade ${v.origin??"värdet"} att ha ${z}${v.maximum.toString()} ${_.unit??"element"}`;return`För stor(t): förväntat ${v.origin??"värdet"} att ha ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${z}${v.minimum.toString()} ${_.unit}`;return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ogiltig sträng: måste börja med "${z.prefix}"`;if(z.format==="ends_with")return`Ogiltig sträng: måste sluta med "${z.suffix}"`;if(z.format==="includes")return`Ogiltig sträng: måste innehålla "${z.includes}"`;if(z.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${z.pattern}"`;return`Ogiltig(t) ${r[z.format]??v.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${K(v.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${v.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${v.origin??"värdet"}`;default:return"Ogiltig input"}}};function G1(){return{localeError:XX()}}var KX=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(v))return"அணி";if(v===null)return"வெறுமை";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(v)=>{switch(v.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${v.expected}, பெறப்பட்டது ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${P(v.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${K(v.values,"|")} இல் ஒன்று`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${z}${v.maximum.toString()} ${_.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${z}${v.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${z}${v.minimum.toString()} ${_.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${z}${v.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`தவறான சரம்: "${z.prefix}" இல் தொடங்க வேண்டும்`;if(z.format==="ends_with")return`தவறான சரம்: "${z.suffix}" இல் முடிவடைய வேண்டும்`;if(z.format==="includes")return`தவறான சரம்: "${z.includes}" ஐ உள்ளடக்க வேண்டும்`;if(z.format==="regex")return`தவறான சரம்: ${z.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${r[z.format]??v.format}`}case"not_multiple_of":return`தவறான எண்: ${v.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${v.keys.length>1?"கள்":""}: ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${v.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function H1(){return{localeError:KX()}}var wX=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(v))return"อาร์เรย์ (Array)";if(v===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(v)=>{switch(v.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${v.expected} แต่ได้รับ ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${P(v.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"ไม่เกิน":"น้อยกว่า",_=U(v.origin);if(_)return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${z} ${v.maximum.toString()} ${_.unit??"รายการ"}`;return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?"อย่างน้อย":"มากกว่า",_=U(v.origin);if(_)return`น้อยกว่ากำหนด: ${v.origin} ควรมี${z} ${v.minimum.toString()} ${_.unit}`;return`น้อยกว่ากำหนด: ${v.origin} ควรมี${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${z.prefix}"`;if(z.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${z.suffix}"`;if(z.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${z.includes}" อยู่ในข้อความ`;if(z.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${z.pattern}`;return`รูปแบบไม่ถูกต้อง: ${r[z.format]??v.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${v.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${K(v.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${v.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${v.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function E1(){return{localeError:wX()}}var QX=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},YX=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function U(r){return $[r]??null}let b={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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(r)=>{switch(r.code){case"invalid_type":return`Geçersiz değer: beklenen ${r.expected}, alınan ${QX(r.input)}`;case"invalid_value":if(r.values.length===1)return`Geçersiz değer: beklenen ${P(r.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${K(r.values,"|")}`;case"too_big":{let v=r.inclusive?"<=":"<",z=U(r.origin);if(z)return`Çok büyük: beklenen ${r.origin??"değer"} ${v}${r.maximum.toString()} ${z.unit??"öğe"}`;return`Çok büyük: beklenen ${r.origin??"değer"} ${v}${r.maximum.toString()}`}case"too_small":{let v=r.inclusive?">=":">",z=U(r.origin);if(z)return`Çok küçük: beklenen ${r.origin} ${v}${r.minimum.toString()} ${z.unit}`;return`Çok küçük: beklenen ${r.origin} ${v}${r.minimum.toString()}`}case"invalid_format":{let v=r;if(v.format==="starts_with")return`Geçersiz metin: "${v.prefix}" ile başlamalı`;if(v.format==="ends_with")return`Geçersiz metin: "${v.suffix}" ile bitmeli`;if(v.format==="includes")return`Geçersiz metin: "${v.includes}" içermeli`;if(v.format==="regex")return`Geçersiz metin: ${v.pattern} desenine uymalı`;return`Geçersiz ${b[v.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${K(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function S1(){return{localeError:YX()}}var WX=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"число";case"object":{if(Array.isArray(v))return"масив";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(v)=>{switch(v.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${v.expected}, отримано ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Неправильні вхідні дані: очікується ${P(v.values[0])}`;return`Неправильна опція: очікується одне з ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Занадто велике: очікується, що ${v.origin??"значення"} ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"елементів"}`;return`Занадто велике: очікується, що ${v.origin??"значення"} буде ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Занадто мале: очікується, що ${v.origin} ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Занадто мале: очікується, що ${v.origin} буде ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Неправильний рядок: повинен починатися з "${z.prefix}"`;if(z.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${z.suffix}"`;if(z.format==="includes")return`Неправильний рядок: повинен містити "${z.includes}"`;if(z.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${z.pattern}`;return`Неправильний ${r[z.format]??v.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${v.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${v.keys.length>1?"і":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${v.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${v.origin}`;default:return"Неправильні вхідні дані"}}};function lv(){return{localeError:WX()}}function F1(){return lv()}var jX=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"نمبر";case"object":{if(Array.isArray(v))return"آرے";if(v===null)return"نل";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(v)=>{switch(v.code){case"invalid_type":return`غلط ان پٹ: ${v.expected} متوقع تھا، ${b(v.input)} موصول ہوا`;case"invalid_value":if(v.values.length===1)return`غلط ان پٹ: ${P(v.values[0])} متوقع تھا`;return`غلط آپشن: ${K(v.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`بہت بڑا: ${v.origin??"ویلیو"} کے ${z}${v.maximum.toString()} ${_.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${v.origin??"ویلیو"} کا ${z}${v.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`بہت چھوٹا: ${v.origin} کے ${z}${v.minimum.toString()} ${_.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${v.origin} کا ${z}${v.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`غلط سٹرنگ: "${z.prefix}" سے شروع ہونا چاہیے`;if(z.format==="ends_with")return`غلط سٹرنگ: "${z.suffix}" پر ختم ہونا چاہیے`;if(z.format==="includes")return`غلط سٹرنگ: "${z.includes}" شامل ہونا چاہیے`;if(z.format==="regex")return`غلط سٹرنگ: پیٹرن ${z.pattern} سے میچ ہونا چاہیے`;return`غلط ${r[z.format]??v.format}`}case"not_multiple_of":return`غلط نمبر: ${v.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${v.keys.length>1?"ز":""}: ${K(v.keys,"، ")}`;case"invalid_key":return`${v.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${v.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function M1(){return{localeError:jX()}}var VX=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"số";case"object":{if(Array.isArray(v))return"mảng";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(v)=>{switch(v.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${v.expected}, nhận được ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${P(v.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"phần tử"}`;return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Quá nhỏ: mong đợi ${v.origin} ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Quá nhỏ: mong đợi ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${z.prefix}"`;if(z.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${z.suffix}"`;if(z.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${z.includes}"`;if(z.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${z.pattern}`;return`${r[z.format]??v.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${v.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${K(v.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${v.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${v.origin}`;default:return"Đầu vào không hợp lệ"}}};function Z1(){return{localeError:VX()}}var PX=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(v))return"数组";if(v===null)return"空值(null)";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(v)=>{switch(v.code){case"invalid_type":return`无效输入:期望 ${v.expected},实际接收 ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`无效输入:期望 ${P(v.values[0])}`;return`无效选项:期望以下之一 ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`数值过大:期望 ${v.origin??"值"} ${z}${v.maximum.toString()} ${_.unit??"个元素"}`;return`数值过大:期望 ${v.origin??"值"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`数值过小:期望 ${v.origin} ${z}${v.minimum.toString()} ${_.unit}`;return`数值过小:期望 ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`无效字符串:必须以 "${z.prefix}" 开头`;if(z.format==="ends_with")return`无效字符串:必须以 "${z.suffix}" 结尾`;if(z.format==="includes")return`无效字符串:必须包含 "${z.includes}"`;if(z.format==="regex")return`无效字符串:必须满足正则表达式 ${z.pattern}`;return`无效${r[z.format]??v.format}`}case"not_multiple_of":return`无效数字:必须是 ${v.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${v.origin} 中包含无效值(value)`;default:return"无效输入"}}};function D1(){return{localeError:PX()}}var qX=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(v)=>{switch(v.code){case"invalid_type":return`無效的輸入值:預期為 ${v.expected},但收到 ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`無效的輸入值:預期為 ${P(v.values[0])}`;return`無效的選項:預期為以下其中之一 ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`數值過大:預期 ${v.origin??"值"} 應為 ${z}${v.maximum.toString()} ${_.unit??"個元素"}`;return`數值過大:預期 ${v.origin??"值"} 應為 ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`數值過小:預期 ${v.origin} 應為 ${z}${v.minimum.toString()} ${_.unit}`;return`數值過小:預期 ${v.origin} 應為 ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`無效的字串:必須以 "${z.prefix}" 開頭`;if(z.format==="ends_with")return`無效的字串:必須以 "${z.suffix}" 結尾`;if(z.format==="includes")return`無效的字串:必須包含 "${z.includes}"`;if(z.format==="regex")return`無效的字串:必須符合格式 ${z.pattern}`;return`無效的 ${r[z.format]??v.format}`}case"not_multiple_of":return`無效的數字:必須為 ${v.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${v.keys.length>1?"們":""}:${K(v.keys,"、")}`;case"invalid_key":return`${v.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${v.origin} 中有無效的值`;default:return"無效的輸入值"}}};function x1(){return{localeError:qX()}}var BX=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function U(v){return $[v]??null}let b=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(v))return"akopọ";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},r={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(v)=>{switch(v.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${v.expected}, àmọ̀ a rí ${b(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${P(v.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${v.origin??"iye"} ${_.verb} ${z}${v.maximum} ${_.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${z}${v.maximum}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Kéré ju: a ní láti jẹ́ pé ${v.origin} ${_.verb} ${z}${v.minimum} ${_.unit}`;return`Kéré ju: a ní láti jẹ́ ${z}${v.minimum}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${z.prefix}"`;if(z.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${z.suffix}"`;if(z.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${z.includes}"`;if(z.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${z.pattern}`;return`Aṣìṣe: ${r[z.format]??v.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${v.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${K(v.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${v.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${v.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function g1(){return{localeError:BX()}}var R1=Symbol("ZodOutput"),m1=Symbol("ZodInput");class dv{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...U){let b=U[0];if(this._map.set($,b),b&&typeof b==="object"&&"id"in b){if(this._idmap.has(b.id))throw Error(`ID ${b.id} already exists in the registry`);this._idmap.set(b.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let U=this._map.get($);if(U&&typeof U==="object"&&"id"in U)this._idmap.delete(U.id);return this._map.delete($),this}get($){let U=$._zod.parent;if(U){let b={...this.get(U)??{}};delete b.id;let r={...b,...this._map.get($)};return Object.keys(r).length?r:void 0}return this._map.get($)}has($){return this._map.has($)}}function J6(){return new dv}var E$=J6();function T1($,U){return new $({type:"string",...q(U)})}function C1($,U){return new $({type:"string",coerce:!0,...q(U)})}function X6($,U){return new $({type:"string",format:"email",check:"string_format",abort:!1,...q(U)})}function pv($,U){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...q(U)})}function K6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...q(U)})}function w6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...q(U)})}function Q6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...q(U)})}function Y6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...q(U)})}function tv($,U){return new $({type:"string",format:"url",check:"string_format",abort:!1,...q(U)})}function W6($,U){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...q(U)})}function j6($,U){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...q(U)})}function V6($,U){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...q(U)})}function P6($,U){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...q(U)})}function q6($,U){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...q(U)})}function B6($,U){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...q(U)})}function L6($,U){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...q(U)})}function A6($,U){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...q(U)})}function G6($,U){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...q(U)})}function H6($,U){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...q(U)})}function E6($,U){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...q(U)})}function S6($,U){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...q(U)})}function F6($,U){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...q(U)})}function M6($,U){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...q(U)})}function Z6($,U){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...q(U)})}var c1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function u1($,U){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...q(U)})}function h1($,U){return new $({type:"string",format:"date",check:"string_format",...q(U)})}function y1($,U){return new $({type:"string",format:"time",check:"string_format",precision:null,...q(U)})}function f1($,U){return new $({type:"string",format:"duration",check:"string_format",...q(U)})}function n1($,U){return new $({type:"number",checks:[],...q(U)})}function i1($,U){return new $({type:"number",coerce:!0,checks:[],...q(U)})}function l1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...q(U)})}function o1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...q(U)})}function d1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...q(U)})}function p1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...q(U)})}function t1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...q(U)})}function e1($,U){return new $({type:"boolean",...q(U)})}function a1($,U){return new $({type:"boolean",coerce:!0,...q(U)})}function s1($,U){return new $({type:"bigint",...q(U)})}function $z($,U){return new $({type:"bigint",coerce:!0,...q(U)})}function vz($,U){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...q(U)})}function Uz($,U){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...q(U)})}function bz($,U){return new $({type:"symbol",...q(U)})}function rz($,U){return new $({type:"undefined",...q(U)})}function zz($,U){return new $({type:"null",...q(U)})}function _z($){return new $({type:"any"})}function Nz($){return new $({type:"unknown"})}function Oz($,U){return new $({type:"never",...q(U)})}function kz($,U){return new $({type:"void",...q(U)})}function Iz($,U){return new $({type:"date",...q(U)})}function Jz($,U){return new $({type:"date",coerce:!0,...q(U)})}function Xz($,U){return new $({type:"nan",...q(U)})}function S$($,U){return new s4({check:"less_than",...q(U),value:$,inclusive:!1})}function W$($,U){return new s4({check:"less_than",...q(U),value:$,inclusive:!0})}function F$($,U){return new $6({check:"greater_than",...q(U),value:$,inclusive:!1})}function O$($,U){return new $6({check:"greater_than",...q(U),value:$,inclusive:!0})}function Kz($){return F$(0,$)}function wz($){return S$(0,$)}function Qz($){return W$(0,$)}function Yz($){return O$(0,$)}function t$($,U){return new Vb({check:"multiple_of",...q(U),value:$})}function Xv($,U){return new Bb({check:"max_size",...q(U),maximum:$})}function e$($,U){return new Lb({check:"min_size",...q(U),minimum:$})}function ev($,U){return new Ab({check:"size_equals",...q(U),size:$})}function Kv($,U){return new Gb({check:"max_length",...q(U),maximum:$})}function C$($,U){return new Hb({check:"min_length",...q(U),minimum:$})}function wv($,U){return new Eb({check:"length_equals",...q(U),length:$})}function av($,U){return new Sb({check:"string_format",format:"regex",...q(U),pattern:$})}function sv($){return new Fb({check:"string_format",format:"lowercase",...q($)})}function $4($){return new Mb({check:"string_format",format:"uppercase",...q($)})}function v4($,U){return new Zb({check:"string_format",format:"includes",...q(U),includes:$})}function U4($,U){return new Db({check:"string_format",format:"starts_with",...q(U),prefix:$})}function b4($,U){return new xb({check:"string_format",format:"ends_with",...q(U),suffix:$})}function Wz($,U,b){return new gb({check:"property",property:$,schema:U,...q(b)})}function r4($,U){return new Rb({check:"mime_type",mime:$,...q(U)})}function M$($){return new mb({check:"overwrite",tx:$})}function z4($){return M$((U)=>U.normalize($))}function _4(){return M$(($)=>$.trim())}function N4(){return M$(($)=>$.toLowerCase())}function O4(){return M$(($)=>$.toUpperCase())}function jz($,U,b){return new $({type:"array",element:U,...q(b)})}function LX($,U,b){return new $({type:"union",options:U,...q(b)})}function AX($,U,b,r){return new $({type:"union",options:b,discriminator:U,...q(r)})}function GX($,U,b){return new $({type:"intersection",left:U,right:b})}function HX($,U,b,r){let v=b instanceof S;return new $({type:"tuple",items:U,rest:v?b:null,...q(v?r:b)})}function EX($,U,b,r){return new $({type:"record",keyType:U,valueType:b,...q(r)})}function SX($,U,b,r){return new $({type:"map",keyType:U,valueType:b,...q(r)})}function FX($,U,b){return new $({type:"set",valueType:U,...q(b)})}function MX($,U,b){let r=Array.isArray(U)?Object.fromEntries(U.map((v)=>[v,v])):U;return new $({type:"enum",entries:r,...q(b)})}function ZX($,U,b){return new $({type:"enum",entries:U,...q(b)})}function DX($,U,b){return new $({type:"literal",values:Array.isArray(U)?U:[U],...q(b)})}function Vz($,U){return new $({type:"file",...q(U)})}function xX($,U){return new $({type:"transform",transform:U})}function gX($,U){return new $({type:"optional",innerType:U})}function RX($,U){return new $({type:"nullable",innerType:U})}function mX($,U,b){return new $({type:"default",innerType:U,get defaultValue(){return typeof b==="function"?b():RU(b)}})}function TX($,U,b){return new $({type:"nonoptional",innerType:U,...q(b)})}function CX($,U){return new $({type:"success",innerType:U})}function cX($,U,b){return new $({type:"catch",innerType:U,catchValue:typeof b==="function"?b:()=>b})}function uX($,U,b){return new $({type:"pipe",in:U,out:b})}function hX($,U){return new $({type:"readonly",innerType:U})}function yX($,U,b){return new $({type:"template_literal",parts:U,...q(b)})}function fX($,U){return new $({type:"lazy",getter:U})}function nX($,U){return new $({type:"promise",innerType:U})}function Pz($,U,b){let r=q(b);return r.abort??(r.abort=!0),new $({type:"custom",check:"custom",fn:U,...r})}function qz($,U,b){return new $({type:"custom",check:"custom",fn:U,...q(b)})}function Bz($){let U=gO((b)=>{return b.addIssue=(r)=>{if(typeof r==="string")b.issues.push(_v(r,b.value,U._zod.def));else{let v=r;if(v.fatal)v.continue=!1;v.code??(v.code="custom"),v.input??(v.input=b.value),v.inst??(v.inst=U),v.continue??(v.continue=!U._zod.def.abort),b.issues.push(_v(v))}},$(b.value,b)});return U}function gO($,U){let b=new n({check:"custom",...q(U)});return b._zod.check=$,b}function Lz($,U){let b=q(U),r=b.truthy??["true","1","yes","on","y","enabled"],v=b.falsy??["false","0","no","off","n","disabled"];if(b.case!=="sensitive")r=r.map((I)=>typeof I==="string"?I.toLowerCase():I),v=v.map((I)=>typeof I==="string"?I.toLowerCase():I);let z=new Set(r),_=new Set(v),N=$.Codec??hv,O=$.Boolean??uv,J=new($.String??p$)({type:"string",error:b.error}),W=new O({type:"boolean",error:b.error}),Y=new N({type:"pipe",in:J,out:W,transform:(I,j)=>{let B=I;if(b.case!=="sensitive")B=B.toLowerCase();if(z.has(B))return!0;else if(_.has(B))return!1;else return j.issues.push({code:"invalid_value",expected:"stringbool",values:[...z,..._],input:j.value,inst:Y,continue:!1}),{}},reverseTransform:(I,j)=>{if(I===!0)return r[0]||"true";else return v[0]||"false"},error:b.error});return Y}function Qv($,U,b,r={}){let v=q(r),z={...q(r),check:"string_format",type:"string",format:U,fn:typeof b==="function"?b:(N)=>b.test(N),...v};if(b instanceof RegExp)z.pattern=b;return new $(z)}class D6{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??E$,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,U={path:[],schemaPath:[]}){var b;let r=$._zod.def,v={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},z=this.seen.get($);if(z){if(z.count++,U.schemaPath.includes($))z.cycle=U.path;return z.schema}let _={schema:{},count:1,cycle:void 0,path:U.path};this.seen.set($,_);let N=$._zod.toJSONSchema?.();if(N)_.schema=N;else{let J={...U,schemaPath:[...U.schemaPath,$],path:U.path},W=$._zod.parent;if(W)_.ref=W,this.process(W,J),this.seen.get(W).isParent=!0;else{let Y=_.schema;switch(r.type){case"string":{let I=Y;I.type="string";let{minimum:j,maximum:B,format:x,patterns:g,contentEncoding:y}=$._zod.bag;if(typeof j==="number")I.minLength=j;if(typeof B==="number")I.maxLength=B;if(x){if(I.format=v[x]??x,I.format==="")delete I.format}if(y)I.contentEncoding=y;if(g&&g.size>0){let T=[...g];if(T.length===1)I.pattern=T[0].source;else if(T.length>1)_.schema.allOf=[...T.map((t)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:t.source}))]}break}case"number":{let I=Y,{minimum:j,maximum:B,format:x,multipleOf:g,exclusiveMaximum:y,exclusiveMinimum:T}=$._zod.bag;if(typeof x==="string"&&x.includes("int"))I.type="integer";else I.type="number";if(typeof T==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")I.minimum=T,I.exclusiveMinimum=!0;else I.exclusiveMinimum=T;if(typeof j==="number"){if(I.minimum=j,typeof T==="number"&&this.target!=="draft-4")if(T>=j)delete I.minimum;else delete I.exclusiveMinimum}if(typeof y==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")I.maximum=y,I.exclusiveMaximum=!0;else I.exclusiveMaximum=y;if(typeof B==="number"){if(I.maximum=B,typeof y==="number"&&this.target!=="draft-4")if(y<=B)delete I.maximum;else delete I.exclusiveMaximum}if(typeof g==="number")I.multipleOf=g;break}case"boolean":{let I=Y;I.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")Y.type="string",Y.nullable=!0,Y.enum=[null];else Y.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{Y.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let I=Y,{minimum:j,maximum:B}=$._zod.bag;if(typeof j==="number")I.minItems=j;if(typeof B==="number")I.maxItems=B;I.type="array",I.items=this.process(r.element,{...J,path:[...J.path,"items"]});break}case"object":{let I=Y;I.type="object",I.properties={};let j=r.shape;for(let g in j)I.properties[g]=this.process(j[g],{...J,path:[...J.path,"properties",g]});let B=new Set(Object.keys(j)),x=new Set([...B].filter((g)=>{let y=r.shape[g]._zod;if(this.io==="input")return y.optin===void 0;else return y.optout===void 0}));if(x.size>0)I.required=Array.from(x);if(r.catchall?._zod.def.type==="never")I.additionalProperties=!1;else if(!r.catchall){if(this.io==="output")I.additionalProperties=!1}else if(r.catchall)I.additionalProperties=this.process(r.catchall,{...J,path:[...J.path,"additionalProperties"]});break}case"union":{let I=Y,j=r.options.map((B,x)=>this.process(B,{...J,path:[...J.path,"anyOf",x]}));I.anyOf=j;break}case"intersection":{let I=Y,j=this.process(r.left,{...J,path:[...J.path,"allOf",0]}),B=this.process(r.right,{...J,path:[...J.path,"allOf",1]}),x=(y)=>("allOf"in y)&&Object.keys(y).length===1,g=[...x(j)?j.allOf:[j],...x(B)?B.allOf:[B]];I.allOf=g;break}case"tuple":{let I=Y;I.type="array";let j=this.target==="draft-2020-12"?"prefixItems":"items",B=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",x=r.items.map((t,Q$)=>this.process(t,{...J,path:[...J.path,j,Q$]})),g=r.rest?this.process(r.rest,{...J,path:[...J.path,B,...this.target==="openapi-3.0"?[r.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(I.prefixItems=x,g)I.items=g}else if(this.target==="openapi-3.0"){if(I.items={anyOf:x},g)I.items.anyOf.push(g);if(I.minItems=x.length,!g)I.maxItems=x.length}else if(I.items=x,g)I.additionalItems=g;let{minimum:y,maximum:T}=$._zod.bag;if(typeof y==="number")I.minItems=y;if(typeof T==="number")I.maxItems=T;break}case"record":{let I=Y;if(I.type="object",this.target==="draft-7"||this.target==="draft-2020-12")I.propertyNames=this.process(r.keyType,{...J,path:[...J.path,"propertyNames"]});I.additionalProperties=this.process(r.valueType,{...J,path:[...J.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let I=Y,j=Mv(r.entries);if(j.every((B)=>typeof B==="number"))I.type="number";if(j.every((B)=>typeof B==="string"))I.type="string";I.enum=j;break}case"literal":{let I=Y,j=[];for(let B of r.values)if(B===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof B==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else j.push(Number(B));else j.push(B);if(j.length===0);else if(j.length===1){let B=j[0];if(I.type=B===null?"null":typeof B,this.target==="draft-4"||this.target==="openapi-3.0")I.enum=[B];else I.const=B}else{if(j.every((B)=>typeof B==="number"))I.type="number";if(j.every((B)=>typeof B==="string"))I.type="string";if(j.every((B)=>typeof B==="boolean"))I.type="string";if(j.every((B)=>B===null))I.type="null";I.enum=j}break}case"file":{let I=Y,j={type:"string",format:"binary",contentEncoding:"binary"},{minimum:B,maximum:x,mime:g}=$._zod.bag;if(B!==void 0)j.minLength=B;if(x!==void 0)j.maxLength=x;if(g)if(g.length===1)j.contentMediaType=g[0],Object.assign(I,j);else I.anyOf=g.map((y)=>{return{...j,contentMediaType:y}});else Object.assign(I,j);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let I=this.process(r.innerType,J);if(this.target==="openapi-3.0")_.ref=r.innerType,Y.nullable=!0;else Y.anyOf=[I,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,J),_.ref=r.innerType;break}case"success":{let I=Y;I.type="boolean";break}case"default":{this.process(r.innerType,J),_.ref=r.innerType,Y.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{if(this.process(r.innerType,J),_.ref=r.innerType,this.io==="input")Y._prefault=JSON.parse(JSON.stringify(r.defaultValue));break}case"catch":{this.process(r.innerType,J),_.ref=r.innerType;let I;try{I=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}Y.default=I;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let I=Y,j=$._zod.pattern;if(!j)throw Error("Pattern not found in template literal");I.type="string",I.pattern=j.source;break}case"pipe":{let I=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(I,J),_.ref=I;break}case"readonly":{this.process(r.innerType,J),_.ref=r.innerType,Y.readOnly=!0;break}case"promise":{this.process(r.innerType,J),_.ref=r.innerType;break}case"optional":{this.process(r.innerType,J),_.ref=r.innerType;break}case"lazy":{let I=$._zod.innerType;this.process(I,J),_.ref=I;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let O=this.metadataRegistry.get($);if(O)Object.assign(_.schema,O);if(this.io==="input"&&a($))delete _.schema.examples,delete _.schema.default;if(this.io==="input"&&_.schema._prefault)(b=_.schema).default??(b.default=_.schema._prefault);return delete _.schema._prefault,this.seen.get($).schema}emit($,U){let b={cycles:U?.cycles??"ref",reused:U?.reused??"inline",external:U?.external??void 0},r=this.seen.get($);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let v=(k)=>{let J=this.target==="draft-2020-12"?"$defs":"definitions";if(b.external){let j=b.external.registry.get(k[0])?.id,B=b.external.uri??((g)=>g);if(j)return{ref:B(j)};let x=k[1].defId??k[1].schema.id??`schema${this.counter++}`;return k[1].defId=x,{defId:x,ref:`${B("__shared")}#/${J}/${x}`}}if(k[1]===r)return{ref:"#"};let Y=`${"#"}/${J}/`,I=k[1].schema.id??`__schema${this.counter++}`;return{defId:I,ref:Y+I}},z=(k)=>{if(k[1].schema.$ref)return;let J=k[1],{ref:W,defId:Y}=v(k);if(J.def={...J.schema},Y)J.defId=Y;let I=J.schema;for(let j in I)delete I[j];I.$ref=W};if(b.cycles==="throw")for(let k of this.seen.entries()){let J=k[1];if(J.cycle)throw Error(`Cycle detected: #/${J.cycle?.join("/")}/<root>
134
134
 
135
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let l of this.seen.entries()){let d=l[1];if(e===l[0]){i(l);continue}if(n.external){let h=n.external.registry.get(l[0])?.id;if(e!==l[0]&&h){i(l);continue}}if(this.metadataRegistry.get(l[0])?.id){i(l);continue}if(d.cycle){i(l);continue}if(d.count>1){if(n.reused==="ref"){i(l);continue}}}let a=(l,d)=>{let v=this.seen.get(l),h=v.def??v.schema,u={...h};if(v.ref===null)return;let y=v.ref;if(v.ref=null,y){a(y,d);let x=this.seen.get(y).schema;if(x.$ref&&(d.target==="draft-7"||d.target==="draft-4"||d.target==="openapi-3.0"))h.allOf=h.allOf??[],h.allOf.push(x);else Object.assign(h,x),Object.assign(h,u)}if(!v.isParent)this.override({zodSchema:l,jsonSchema:h,path:v.path??[]})};for(let l of[...this.seen.entries()].reverse())a(l[0],{target:this.target});let s={};if(this.target==="draft-2020-12")s.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")s.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")s.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(n.external?.uri){let l=n.external.registry.get(e)?.id;if(!l)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(l)}Object.assign(s,o.def);let c=n.external?.defs??{};for(let l of this.seen.entries()){let d=l[1];if(d.def&&d.defId)c[d.defId]=d.def}if(n.external);else if(Object.keys(c).length>0)if(this.target==="draft-2020-12")s.$defs=c;else s.definitions=c;try{return JSON.parse(JSON.stringify(s))}catch(l){throw Error("Error converting schema to JSON.")}}}function Tc(e,r){if(e instanceof qt){let o=new jn(r),t={};for(let s of e._idmap.entries()){let[c,l]=s;o.process(l)}let i={},a={registry:e,uri:r?.uri,defs:t};for(let s of e._idmap.entries()){let[c,l]=s;i[c]=o.emit(l,{...r,external:a})}if(Object.keys(t).length>0){let s=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[s]:t}}return{schemas:i}}let n=new jn(r);return n.process(e),n.emit(e,r)}function Q(e,r){let n=r??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let t=e._zod.def;switch(t.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Q(t.element,n);case"object":{for(let i in t.shape)if(Q(t.shape[i],n))return!0;return!1}case"union":{for(let i of t.options)if(Q(i,n))return!0;return!1}case"intersection":return Q(t.left,n)||Q(t.right,n);case"tuple":{for(let i of t.items)if(Q(i,n))return!0;if(t.rest&&Q(t.rest,n))return!0;return!1}case"record":return Q(t.keyType,n)||Q(t.valueType,n);case"map":return Q(t.keyType,n)||Q(t.valueType,n);case"set":return Q(t.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Q(t.innerType,n);case"lazy":return Q(t.getter(),n);case"default":return Q(t.innerType,n);case"prefault":return Q(t.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Q(t.in,n)||Q(t.out,n);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw Error(`Unknown schema type: ${t.type}`)}var Nd={};var Un={};me(Un,{ZodISODate:()=>Mn,ZodISODateTime:()=>An,ZodISODuration:()=>Nn,ZodISOTime:()=>Rn,date:()=>Dc,datetime:()=>Oc,duration:()=>zc,time:()=>Pc});var An=m("ZodISODateTime",(e,r)=>{Qi.init(e,r),V.init(e,r)});function Oc(e){return Gs(An,e)}var Mn=m("ZodISODate",(e,r)=>{ea.init(e,r),V.init(e,r)});function Dc(e){return Vs(Mn,e)}var Rn=m("ZodISOTime",(e,r)=>{ta.init(e,r),V.init(e,r)});function Pc(e){return Ws(Rn,e)}var Nn=m("ZodISODuration",(e,r)=>{ra.init(e,r),V.init(e,r)});function zc(e){return Bs(Nn,e)}var Ld=(e,r)=>{Mt.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>Nt(e,n)},flatten:{value:(n)=>Rt(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,it,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,it,2)}},isEmpty:{get(){return e.issues.length===0}}})},Kv=m("ZodError",Ld),ue=m("ZodError",Ld,{Parent:Error});var Cc=ct(ue),Ec=lt(ue),jc=ut(ue),Ac=dt(ue),Mc=Wr(ue),Rc=Br(ue),Nc=Hr(ue),Uc=Jr(ue),Lc=qr(ue),Zc=Kr(ue),Fc=Xr(ue),Gc=Yr(ue);var z=m("ZodType",(e,r)=>(D.init(e,r),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...n)=>e.clone({...r,checks:[...r.checks??[],...n.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>ie(e,n,o),e.brand=()=>e,e.register=(n,o)=>(n.add(e,o),e),e.parse=(n,o)=>Cc(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>jc(e,n,o),e.parseAsync=async(n,o)=>Ec(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Ac(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>Mc(e,n,o),e.decode=(n,o)=>Rc(e,n,o),e.encodeAsync=async(n,o)=>Nc(e,n,o),e.decodeAsync=async(n,o)=>Uc(e,n,o),e.safeEncode=(n,o)=>Lc(e,n,o),e.safeDecode=(n,o)=>Zc(e,n,o),e.safeEncodeAsync=async(n,o)=>Fc(e,n,o),e.safeDecodeAsync=async(n,o)=>Gc(e,n,o),e.refine=(n,o)=>e.check(Im(n,o)),e.superRefine=(n)=>e.check(Tm(n)),e.overwrite=(n)=>e.check(ze(n)),e.optional=()=>Zn(e),e.nullable=()=>Fn(e),e.nullish=()=>Zn(Fn(e)),e.nonoptional=(n)=>fm(e,n),e.array=()=>Bn(e),e.or=(n)=>ml([e,n]),e.and=(n)=>em(e,n),e.transform=(n)=>Gn(e,gl(n)),e.default=(n)=>dm(e,n),e.prefault=(n)=>pm(e,n),e.catch=(n)=>vm(e,n),e.pipe=(n)=>Gn(e,n),e.readonly=()=>_m(e),e.describe=(n)=>{let o=e.clone();return Oe.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return Oe.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Oe.get(e);let o=e.clone();return Oe.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Bc=m("_ZodString",(e,r)=>{Ke.init(e,r),z.init(e,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Qt(...o)),e.includes=(...o)=>e.check(rr(...o)),e.startsWith=(...o)=>e.check(nr(...o)),e.endsWith=(...o)=>e.check(or(...o)),e.min=(...o)=>e.check(Ue(...o)),e.max=(...o)=>e.check(ft(...o)),e.length=(...o)=>e.check(gt(...o)),e.nonempty=(...o)=>e.check(Ue(1,...o)),e.lowercase=(o)=>e.check(er(o)),e.uppercase=(o)=>e.check(tr(o)),e.trim=()=>e.check(sr()),e.normalize=(...o)=>e.check(ar(...o)),e.toLowerCase=()=>e.check(cr()),e.toUpperCase=()=>e.check(lr())}),dr=m("ZodString",(e,r)=>{Ke.init(e,r),Bc.init(e,r),e.email=(n)=>e.check(fn(Hc,n)),e.url=(n)=>e.check(Xt(Vn,n)),e.jwt=(n)=>e.check(En(cl,n)),e.emoji=(n)=>e.check(bn(Jc,n)),e.guid=(n)=>e.check(Kt(Ln,n)),e.uuid=(n)=>e.check(gn(Ee,n)),e.uuidv4=(n)=>e.check(hn(Ee,n)),e.uuidv6=(n)=>e.check(vn(Ee,n)),e.uuidv7=(n)=>e.check(yn(Ee,n)),e.nanoid=(n)=>e.check(_n(qc,n)),e.guid=(n)=>e.check(Kt(Ln,n)),e.cuid=(n)=>e.check(kn(Kc,n)),e.cuid2=(n)=>e.check($n(Xc,n)),e.ulid=(n)=>e.check(xn(Yc,n)),e.base64=(n)=>e.check(Pn(il,n)),e.base64url=(n)=>e.check(zn(al,n)),e.xid=(n)=>e.check(wn(Qc,n)),e.ksuid=(n)=>e.check(Sn(el,n)),e.ipv4=(n)=>e.check(In(tl,n)),e.ipv6=(n)=>e.check(Tn(rl,n)),e.cidrv4=(n)=>e.check(On(nl,n)),e.cidrv6=(n)=>e.check(Dn(ol,n)),e.e164=(n)=>e.check(Cn(sl,n)),e.datetime=(n)=>e.check(Oc(n)),e.date=(n)=>e.check(Dc(n)),e.time=(n)=>e.check(Pc(n)),e.duration=(n)=>e.check(zc(n))});function Vc(e){return Ls(dr,e)}var V=m("ZodStringFormat",(e,r)=>{F.init(e,r),Bc.init(e,r)}),Hc=m("ZodEmail",(e,r)=>{Vi.init(e,r),V.init(e,r)});function Yv(e){return fn(Hc,e)}var Ln=m("ZodGUID",(e,r)=>{Fi.init(e,r),V.init(e,r)});function Qv(e){return Kt(Ln,e)}var Ee=m("ZodUUID",(e,r)=>{Gi.init(e,r),V.init(e,r)});function ey(e){return gn(Ee,e)}function ty(e){return hn(Ee,e)}function ry(e){return vn(Ee,e)}function ny(e){return yn(Ee,e)}var Vn=m("ZodURL",(e,r)=>{Wi.init(e,r),V.init(e,r)});function oy(e){return Xt(Vn,e)}function iy(e){return Xt(Vn,{protocol:/^https?$/,hostname:ve.domain,...b.normalizeParams(e)})}var Jc=m("ZodEmoji",(e,r)=>{Bi.init(e,r),V.init(e,r)});function ay(e){return bn(Jc,e)}var qc=m("ZodNanoID",(e,r)=>{Hi.init(e,r),V.init(e,r)});function sy(e){return _n(qc,e)}var Kc=m("ZodCUID",(e,r)=>{Ji.init(e,r),V.init(e,r)});function cy(e){return kn(Kc,e)}var Xc=m("ZodCUID2",(e,r)=>{qi.init(e,r),V.init(e,r)});function ly(e){return $n(Xc,e)}var Yc=m("ZodULID",(e,r)=>{Ki.init(e,r),V.init(e,r)});function uy(e){return xn(Yc,e)}var Qc=m("ZodXID",(e,r)=>{Xi.init(e,r),V.init(e,r)});function dy(e){return wn(Qc,e)}var el=m("ZodKSUID",(e,r)=>{Yi.init(e,r),V.init(e,r)});function my(e){return Sn(el,e)}var tl=m("ZodIPv4",(e,r)=>{na.init(e,r),V.init(e,r)});function py(e){return In(tl,e)}var rl=m("ZodIPv6",(e,r)=>{oa.init(e,r),V.init(e,r)});function fy(e){return Tn(rl,e)}var nl=m("ZodCIDRv4",(e,r)=>{ia.init(e,r),V.init(e,r)});function gy(e){return On(nl,e)}var ol=m("ZodCIDRv6",(e,r)=>{aa.init(e,r),V.init(e,r)});function hy(e){return Dn(ol,e)}var il=m("ZodBase64",(e,r)=>{ca.init(e,r),V.init(e,r)});function vy(e){return Pn(il,e)}var al=m("ZodBase64URL",(e,r)=>{la.init(e,r),V.init(e,r)});function yy(e){return zn(al,e)}var sl=m("ZodE164",(e,r)=>{ua.init(e,r),V.init(e,r)});function by(e){return Cn(sl,e)}var cl=m("ZodJWT",(e,r)=>{da.init(e,r),V.init(e,r)});function _y(e){return En(cl,e)}var mr=m("ZodCustomStringFormat",(e,r)=>{ma.init(e,r),V.init(e,r)});function ky(e,r,n={}){return ht(mr,e,r,n)}function $y(e){return ht(mr,"hostname",ve.hostname,e)}function xy(e){return ht(mr,"hex",ve.hex,e)}function wy(e,r){let n=r?.enc??"hex",o=`${e}_${n}`,t=ve[o];if(!t)throw Error(`Unrecognized hash format: ${o}`);return ht(mr,o,t,r)}var pr=m("ZodNumber",(e,r)=>{ln.init(e,r),z.init(e,r),e.gt=(o,t)=>e.check(Pe(o,t)),e.gte=(o,t)=>e.check(le(o,t)),e.min=(o,t)=>e.check(le(o,t)),e.lt=(o,t)=>e.check(De(o,t)),e.lte=(o,t)=>e.check(ye(o,t)),e.max=(o,t)=>e.check(ye(o,t)),e.int=(o)=>e.check(Wc(o)),e.safe=(o)=>e.check(Wc(o)),e.positive=(o)=>e.check(Pe(0,o)),e.nonnegative=(o)=>e.check(le(0,o)),e.negative=(o)=>e.check(De(0,o)),e.nonpositive=(o)=>e.check(ye(0,o)),e.multipleOf=(o,t)=>e.check(Xe(o,t)),e.step=(o,t)=>e.check(Xe(o,t)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});function Zd(e){return Hs(pr,e)}var yt=m("ZodNumberFormat",(e,r)=>{pa.init(e,r),pr.init(e,r)});function Wc(e){return qs(yt,e)}function Sy(e){return Ks(yt,e)}function Iy(e){return Xs(yt,e)}function Ty(e){return Ys(yt,e)}function Oy(e){return Qs(yt,e)}var fr=m("ZodBoolean",(e,r)=>{Zt.init(e,r),z.init(e,r)});function Fd(e){return ec(fr,e)}var gr=m("ZodBigInt",(e,r)=>{un.init(e,r),z.init(e,r),e.gte=(o,t)=>e.check(le(o,t)),e.min=(o,t)=>e.check(le(o,t)),e.gt=(o,t)=>e.check(Pe(o,t)),e.gte=(o,t)=>e.check(le(o,t)),e.min=(o,t)=>e.check(le(o,t)),e.lt=(o,t)=>e.check(De(o,t)),e.lte=(o,t)=>e.check(ye(o,t)),e.max=(o,t)=>e.check(ye(o,t)),e.positive=(o)=>e.check(Pe(BigInt(0),o)),e.negative=(o)=>e.check(De(BigInt(0),o)),e.nonpositive=(o)=>e.check(ye(BigInt(0),o)),e.nonnegative=(o)=>e.check(le(BigInt(0),o)),e.multipleOf=(o,t)=>e.check(Xe(o,t));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Dy(e){return rc(gr,e)}var ll=m("ZodBigIntFormat",(e,r)=>{fa.init(e,r),gr.init(e,r)});function Py(e){return oc(ll,e)}function zy(e){return ic(ll,e)}var Gd=m("ZodSymbol",(e,r)=>{ga.init(e,r),z.init(e,r)});function Cy(e){return ac(Gd,e)}var Vd=m("ZodUndefined",(e,r)=>{ha.init(e,r),z.init(e,r)});function Ey(e){return sc(Vd,e)}var Wd=m("ZodNull",(e,r)=>{va.init(e,r),z.init(e,r)});function Bd(e){return cc(Wd,e)}var Hd=m("ZodAny",(e,r)=>{ya.init(e,r),z.init(e,r)});function jy(){return lc(Hd)}var Jd=m("ZodUnknown",(e,r)=>{ba.init(e,r),z.init(e,r)});function vt(){return uc(Jd)}var qd=m("ZodNever",(e,r)=>{_a.init(e,r),z.init(e,r)});function ul(e){return dc(qd,e)}var Kd=m("ZodVoid",(e,r)=>{ka.init(e,r),z.init(e,r)});function Ay(e){return mc(Kd,e)}var Wn=m("ZodDate",(e,r)=>{$a.init(e,r),z.init(e,r),e.min=(o,t)=>e.check(le(o,t)),e.max=(o,t)=>e.check(ye(o,t));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function My(e){return pc(Wn,e)}var Xd=m("ZodArray",(e,r)=>{xa.init(e,r),z.init(e,r),e.element=r.element,e.min=(n,o)=>e.check(Ue(n,o)),e.nonempty=(n)=>e.check(Ue(1,n)),e.max=(n,o)=>e.check(ft(n,o)),e.length=(n,o)=>e.check(gt(n,o)),e.unwrap=()=>e.element});function Bn(e,r){return kc(Xd,e,r)}function Ry(e){let r=e._zod.def.shape;return fl(Object.keys(r))}var Hn=m("ZodObject",(e,r)=>{wa.init(e,r),z.init(e,r),b.defineLazy(e,"shape",()=>r.shape),e.keyof=()=>fl(Object.keys(e._zod.def.shape)),e.catchall=(n)=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vt()}),e.loose=()=>e.clone({...e._zod.def,catchall:vt()}),e.strict=()=>e.clone({...e._zod.def,catchall:ul()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(n)=>b.extend(e,n),e.safeExtend=(n)=>b.safeExtend(e,n),e.merge=(n)=>b.merge(e,n),e.pick=(n)=>b.pick(e,n),e.omit=(n)=>b.omit(e,n),e.partial=(...n)=>b.partial(hl,e,n[0]),e.required=(...n)=>b.required(vl,e,n[0])});function Ny(e,r){let n={type:"object",get shape(){return b.assignProp(this,"shape",e?b.objectClone(e):{}),this.shape},...b.normalizeParams(r)};return new Hn(n)}function Uy(e,r){return new Hn({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:ul(),...b.normalizeParams(r)})}function Ly(e,r){return new Hn({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:vt(),...b.normalizeParams(r)})}var dl=m("ZodUnion",(e,r)=>{dn.init(e,r),z.init(e,r),e.options=r.options});function ml(e,r){return new dl({type:"union",options:e,...b.normalizeParams(r)})}var Yd=m("ZodDiscriminatedUnion",(e,r)=>{dl.init(e,r),Sa.init(e,r)});function Zy(e,r,n){return new Yd({type:"union",options:r,discriminator:e,...b.normalizeParams(n)})}var Qd=m("ZodIntersection",(e,r)=>{Ia.init(e,r),z.init(e,r)});function em(e,r){return new Qd({type:"intersection",left:e,right:r})}var tm=m("ZodTuple",(e,r)=>{mn.init(e,r),z.init(e,r),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});function rm(e,r,n){let o=r instanceof D,t=o?n:r;return new tm({type:"tuple",items:e,rest:o?r:null,...b.normalizeParams(t)})}var pl=m("ZodRecord",(e,r)=>{Ta.init(e,r),z.init(e,r),e.keyType=r.keyType,e.valueType=r.valueType});function nm(e,r,n){return new pl({type:"record",keyType:e,valueType:r,...b.normalizeParams(n)})}function Fy(e,r,n){let o=ie(e);return o._zod.values=void 0,new pl({type:"record",keyType:o,valueType:r,...b.normalizeParams(n)})}var om=m("ZodMap",(e,r)=>{Oa.init(e,r),z.init(e,r),e.keyType=r.keyType,e.valueType=r.valueType});function Gy(e,r,n){return new om({type:"map",keyType:e,valueType:r,...b.normalizeParams(n)})}var im=m("ZodSet",(e,r)=>{Da.init(e,r),z.init(e,r),e.min=(...n)=>e.check(Ye(...n)),e.nonempty=(n)=>e.check(Ye(1,n)),e.max=(...n)=>e.check(pt(...n)),e.size=(...n)=>e.check(Yt(...n))});function Vy(e,r){return new im({type:"set",valueType:e,...b.normalizeParams(r)})}var ur=m("ZodEnum",(e,r)=>{Pa.init(e,r),z.init(e,r),e.enum=r.entries,e.options=Object.values(r.entries);let n=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let i={};for(let a of o)if(n.has(a))i[a]=r.entries[a];else throw Error(`Key ${a} not found in enum`);return new ur({...r,checks:[],...b.normalizeParams(t),entries:i})},e.exclude=(o,t)=>{let i={...r.entries};for(let a of o)if(n.has(a))delete i[a];else throw Error(`Key ${a} not found in enum`);return new ur({...r,checks:[],...b.normalizeParams(t),entries:i})}});function fl(e,r){let n=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new ur({type:"enum",entries:n,...b.normalizeParams(r)})}function Wy(e,r){return new ur({type:"enum",entries:e,...b.normalizeParams(r)})}var am=m("ZodLiteral",(e,r)=>{za.init(e,r),z.init(e,r),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function By(e,r){return new am({type:"literal",values:Array.isArray(e)?e:[e],...b.normalizeParams(r)})}var sm=m("ZodFile",(e,r)=>{Ca.init(e,r),z.init(e,r),e.min=(n,o)=>e.check(Ye(n,o)),e.max=(n,o)=>e.check(pt(n,o)),e.mime=(n,o)=>e.check(ir(Array.isArray(n)?n:[n],o))});function Hy(e){return $c(sm,e)}var cm=m("ZodTransform",(e,r)=>{Ea.init(e,r),z.init(e,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new He(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(b.issue(i,n.value,r));else{let a=i;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(b.issue(a))}};let t=r.transform(n.value,n);if(t instanceof Promise)return t.then((i)=>(n.value=i,n));return n.value=t,n}});function gl(e){return new cm({type:"transform",transform:e})}var hl=m("ZodOptional",(e,r)=>{ja.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Zn(e){return new hl({type:"optional",innerType:e})}var lm=m("ZodNullable",(e,r)=>{Aa.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Fn(e){return new lm({type:"nullable",innerType:e})}function Jy(e){return Zn(Fn(e))}var um=m("ZodDefault",(e,r)=>{Ma.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dm(e,r){return new um({type:"default",innerType:e,get defaultValue(){return typeof r==="function"?r():b.shallowClone(r)}})}var mm=m("ZodPrefault",(e,r)=>{Ra.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function pm(e,r){return new mm({type:"prefault",innerType:e,get defaultValue(){return typeof r==="function"?r():b.shallowClone(r)}})}var vl=m("ZodNonOptional",(e,r)=>{Na.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function fm(e,r){return new vl({type:"nonoptional",innerType:e,...b.normalizeParams(r)})}var gm=m("ZodSuccess",(e,r)=>{Ua.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function qy(e){return new gm({type:"success",innerType:e})}var hm=m("ZodCatch",(e,r)=>{La.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vm(e,r){return new hm({type:"catch",innerType:e,catchValue:typeof r==="function"?r:()=>r})}var ym=m("ZodNaN",(e,r)=>{Za.init(e,r),z.init(e,r)});function Ky(e){return gc(ym,e)}var yl=m("ZodPipe",(e,r)=>{Fa.init(e,r),z.init(e,r),e.in=r.in,e.out=r.out});function Gn(e,r){return new yl({type:"pipe",in:e,out:r})}var bl=m("ZodCodec",(e,r)=>{yl.init(e,r),Ft.init(e,r)});function Xy(e,r,n){return new bl({type:"pipe",in:e,out:r,transform:n.decode,reverseTransform:n.encode})}var bm=m("ZodReadonly",(e,r)=>{Ga.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function _m(e){return new bm({type:"readonly",innerType:e})}var km=m("ZodTemplateLiteral",(e,r)=>{Va.init(e,r),z.init(e,r)});function Yy(e,r){return new km({type:"template_literal",parts:e,...b.normalizeParams(r)})}var $m=m("ZodLazy",(e,r)=>{Ha.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.getter()});function xm(e){return new $m({type:"lazy",getter:e})}var wm=m("ZodPromise",(e,r)=>{Ba.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Qy(e){return new wm({type:"promise",innerType:e})}var Sm=m("ZodFunction",(e,r)=>{Wa.init(e,r),z.init(e,r)});function eb(e){return new Sm({type:"function",input:Array.isArray(e?.input)?rm(e?.input):e?.input??Bn(vt()),output:e?.output??vt()})}var Jn=m("ZodCustom",(e,r)=>{Ja.init(e,r),z.init(e,r)});function tb(e){let r=new W({check:"custom"});return r._zod.check=e,r}function rb(e,r){return xc(Jn,e??(()=>!0),r)}function Im(e,r={}){return wc(Jn,e,r)}function Tm(e){return Sc(e)}function nb(e,r={error:`Input not instance of ${e.name}`}){let n=new Jn({type:"custom",check:"custom",fn:(o)=>o instanceof e,abort:!0,...b.normalizeParams(r)});return n._zod.bag.Class=e,n}var ob=(...e)=>Ic({Codec:bl,Boolean:fr,String:dr},...e);function ib(e){let r=xm(()=>ml([Vc(e),Zd(),Fd(),Bd(),Bn(r),nm(Vc(),r)]));return r}function ab(e,r){return Gn(gl(e),r)}var sb={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 cb(e){q({customError:e})}function lb(){return q().customError}var _l;(function(e){})(_l||(_l={}));var kl={};me(kl,{bigint:()=>pb,boolean:()=>mb,date:()=>fb,number:()=>db,string:()=>ub});function ub(e){return Zs(dr,e)}function db(e){return Js(pr,e)}function mb(e){return tc(fr,e)}function pb(e){return nc(gr,e)}function fb(e){return fc(Wn,e)}q(Gt());function C(e){return e}C.schema=qn;import{renameSync as gb,writeFileSync as hb,readFileSync as Fx,existsSync as vb,statSync as Gx}from"node:fs";import{dirname as yb}from"node:path";import{mkdirSync as bb}from"node:fs";function Om(e,r){let n=yb(r);if(!vb(n))bb(n,{recursive:!0});let o=`${r}.tmp`;hb(o,JSON.stringify(e,null,2),"utf8"),gb(o,r)}Tr();import{statSync as Dm,existsSync as qx}from"node:fs";import{join as $l}from"node:path";function _b(e,r,n,o){let t=r&&n;if(e==="codegraph")return r?{kind:"codegraph",cmd:"codegraph",args:[]}:null;if(e==="graphify")return n?{kind:"graphify",cmd:"graphify",args:[]}:null;if(e==="alternate"&&t)return(o??"").trim().toLowerCase().split("").reduce((s,c)=>s+c.charCodeAt(0),0)%2===0?{kind:"codegraph",cmd:"codegraph",args:[]}:{kind:"graphify",cmd:"graphify",args:[]};if(r)return{kind:"codegraph",cmd:"codegraph",args:[]};if(n)return{kind:"graphify",cmd:"graphify",args:[]};return null}function Pm(e){let r=e.trim().toLowerCase(),n=2166136261;for(let o=0;o<r.length;o++)n^=r.charCodeAt(o),n=n*16777619>>>0;return n.toString(16)}class zm{timeoutMs;cacheTtlMs;maxEntriesPerSession;cache=new Map;preferredTool;constructor(e={}){this.timeoutMs=e.timeoutMs??5000,this.cacheTtlMs=e.cacheTtlMs??300000,this.maxEntriesPerSession=e.maxEntriesPerSession??10,this.preferredTool=e.preferredTool??"auto"}setPreferredTool(e){this.preferredTool=e}hasCodegraphDir(e){try{return Dm($l(e,".codegraph")).isDirectory()}catch{return!1}}hasGraphifyDir(e){try{return Dm($l(e,"graphify-out")).isDirectory()}catch{return!1}}cacheContext(e,r,n){let o=this.cache.get(e);if(!o)o={entries:new Map},this.cache.set(e,o);let t=Pm(r);o.entries.set(t,{query:r,content:n,insertedAtMs:Date.now()});while(o.entries.size>this.maxEntriesPerSession){let i=o.entries.keys().next().value;if(!i)break;o.entries.delete(i)}}getCachedContext(e,r){let n=this.cache.get(e);if(!n)return null;if(r){let t=Pm(r),i=n.entries.get(t);if(!i)return null;if(Date.now()-i.insertedAtMs>this.cacheTtlMs)return n.entries.delete(t),null;return i.content}let o=null;for(let t of n.entries.values())if(Date.now()-t.insertedAtMs<=this.cacheTtlMs)o=t.content;return o}clear(){this.cache.clear()}clearSession(e){this.cache.delete(e)}async invoke(e,r,n={}){let o=Date.now(),t=n.timeoutMs??this.timeoutMs,i=this.hasCodegraphDir(e),a=this.hasGraphifyDir(e),s=n.preferredTool??this.preferredTool,c=_b(s,i,a,r),l=null,d=null,v=[];if(c)if(l=c.kind,l==="codegraph")d=n.codegraphBin??"codegraph",v=["explore",r,"--project-path",e];else d=n.graphifyBin??"graphify",v=["query",r,"--graph",$l(e,"graphify-out")];if(!d||!l)return{kind:null,query:r,result:null,timedOut:!1,durationMs:Date.now()-o};try{let h=await this.spawnWithTimeout(d,v,t,e);return{kind:l,query:r,result:h.trim()||null,timedOut:!1,durationMs:Date.now()-o}}catch(h){let u=h instanceof Error&&h.message.includes("timed out");return{kind:l,query:r,result:null,timedOut:u,durationMs:Date.now()-o}}}spawnWithTimeout(e,r,n,o){return Ir(e,r,{cwd:o,timeoutMs:n}).then((t)=>{if(t.timedOut)throw Error(`graph retrieval subprocess timed out after ${n}ms`);if(t.code===null)throw Error(`graph retrieval subprocess failed to spawn: ${e}`);if(t.code!==0)throw Error(`graph retrieval subprocess exited ${t.code}: ${t.stderr.slice(0,200)}`);return t.stdout})}async invokeNode(e,r,n={}){return this.invokeCodegraphSubcommand("node",e,r,n)}async invokeCallers(e,r,n={}){return this.invokeCodegraphSubcommand("callers",e,r,n)}async invokeImpact(e,r,n={}){return this.invokeCodegraphSubcommand("impact",e,r,n)}async invokeFiles(e,r={}){return this.invokeCodegraphSubcommand("files",void 0,e,r)}async invokeContext(e,r,n={}){return this.invokeCodegraphSubcommand("context",e,r,n)}async invokeAffected(e,r,n={}){return this.invokeCodegraphSubcommand("affected",e,r,n)}async invokeStatus(e,r={}){return this.invokeCodegraphSubcommand("status",void 0,e,r)}async invokeUnlock(e,r={}){return this.invokeCodegraphSubcommand("unlock",void 0,e,r)}async invokeMarkDirty(e,r={}){return this.invokeCodegraphSubcommand("mark-dirty",void 0,e,r)}async invokeSyncIfDirty(e,r={}){return this.invokeCodegraphSubcommand("sync-if-dirty",void 0,e,r)}async invokeIndex(e,r={}){return this.invokeCodegraphSubcommand("index",void 0,e,r)}async invokeVisualize(e,r={}){return this.invokeCodegraphSubcommand("visualize",void 0,e,r)}async invokeServe(e,r,n={}){return this.invokeCodegraphSubcommand("serve",String(e),r,n)}async invokeUninit(e,r={}){return this.invokeCodegraphSubcommand("uninit",void 0,e,r)}async invokeCodegraphSubcommand(e,r,n,o){let t=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasCodegraphDir(n))return{kind:null,query:r===void 0?e:Array.isArray(r)?r.join(","):r,result:null,timedOut:!1,durationMs:Date.now()-t};let a=o.codegraphBin??"codegraph",s=r===void 0?[]:Array.isArray(r)?r:[r],c=[e,...s,"--project-path",n],l=r===void 0?e:Array.isArray(r)?r.join(","):r;try{let d=await this.spawnWithTimeout(a,c,i,n);return{kind:"codegraph",query:l,result:d.trim()||null,timedOut:!1,durationMs:Date.now()-t}}catch(d){let v=d instanceof Error&&/timed out/i.test(d.message);return{kind:"codegraph",query:l,result:null,timedOut:v,durationMs:Date.now()-t}}}async invokePath(e,r,n,o={}){let t=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:`${e} ${r}`,result:null,timedOut:!1,durationMs:Date.now()-t};let a=o.graphifyBin??"graphify",s=["path",e,r];try{let c=await this.spawnWithTimeout(a,s,i,n);return{kind:"graphify",query:`${e} ${r}`,result:c.trim()||null,timedOut:!1,durationMs:Date.now()-t}}catch(c){return{kind:"graphify",query:`${e} ${r}`,result:null,timedOut:c instanceof Error&&/timed out/i.test(c.message),durationMs:Date.now()-t}}}async invokeExplain(e,r,n={}){return this.invokeGraphifySubcommand("explain",e,r,n)}async invokeGraphifySubcommand(e,r,n,o){let t=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:r??e,result:null,timedOut:!1,durationMs:Date.now()-t};let a=o.graphifyBin??"graphify",s=r===void 0?[e]:[e,r];try{let c=await this.spawnWithTimeout(a,s,i,n);return{kind:"graphify",query:r??e,result:c.trim()||null,timedOut:!1,durationMs:Date.now()-t}}catch(c){return{kind:"graphify",query:r??e,result:null,timedOut:c instanceof Error&&/timed out/i.test(c.message),durationMs:Date.now()-t}}}async invokeDiagnose(e,r={}){return this.invokeGraphifySubcommand("diagnose",void 0,e,r)}async invokeMergeDriver(e,r={}){return this.invokeGraphifySubcommand("merge-driver",void 0,e,r)}async invokeSaveResult(e,r={}){return this.invokeGraphifySubcommand("save-result",void 0,e,r)}async invokeExtract(e,r={}){return this.invokeGraphifySubcommand("extract",void 0,e,r)}async invokeClusterOnly(e,r={}){return this.invokeGraphifySubcommand("cluster-only",void 0,e,r)}async invokeLabel(e,r,n={}){return this.invokeGraphifySubcommand("label",e,r,n)}async invokeTree(e,r={}){return this.invokeGraphifySubcommand("tree",void 0,e,r)}async invokeClone(e,r={}){return this.invokeGraphifySubcommand("clone",void 0,e,r)}async invokeAdd(e,r,n={}){return this.invokeGraphifySubcommand("add",e,r,n)}async invokeCheckUpdate(e,r={}){return this.invokeGraphifySubcommand("check-update",void 0,e,r)}}var xl=null;function R(){if(!xl)xl=new zm;return xl}function Cm(e){let r=R();if(e.preferredTool)r.setPreferredTool(e.preferredTool)}var kb=R();class Am{retrieval;constructor(e=kb){this.retrieval=e}async find(e,r,n=5000){let o=Date.now(),t=await this.retrieval.invokeNode(e,r,{timeoutMs:n});if(t.kind==="codegraph"&&t.result)return $b(e,t.result,o,"codegraph");let i=await this.retrieval.invoke(r,e,{timeoutMs:n});if(i.kind==="graphify"&&i.result)return xb(e,i.result,o,"graphify");return{symbol:e,source:null,callers:[],found:!1,kind:t.kind??i.kind,durationMs:Date.now()-o}}async impact(e,r,n=5000){let o=Date.now(),t=await this.retrieval.invokeImpact(e,r,{timeoutMs:n});if(t.kind==="codegraph"&&t.result)return wb(e,t.result,o,"codegraph",t.timedOut);let i=await this.retrieval.invokeCallers(e,r,{timeoutMs:n});if(i.kind==="codegraph"&&i.result)return{symbol:e,directCallers:Kn(i.result),transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:new Set(Kn(i.result).map((a)=>a.file)).size,kind:"codegraph",durationMs:Date.now()-o,timedOut:i.timedOut};return{symbol:e,directCallers:[],transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:0,kind:t.kind??i.kind,durationMs:Date.now()-o,timedOut:t.timedOut||i.timedOut}}async listFiles(e,r=5000){let n=Date.now(),o=await this.retrieval.invokeFiles(e,{timeoutMs:r});if(o.kind==="codegraph"&&o.result){let t=o.result.split(`
136
- `).map((i)=>i.trim()).filter(Boolean);return{files:t,count:t.length,kind:"codegraph",durationMs:Date.now()-n}}return{files:[],count:0,kind:o.kind,durationMs:Date.now()-n}}}function $b(e,r,n,o){let t=Kn(r),i=r.search(/callers?:|## callers?/i),a=i>0?r.slice(0,i).trim():r.trim();return{symbol:e,source:a||null,callers:t,found:t.length>0||a.length>0,kind:o,durationMs:Date.now()-n}}function xb(e,r,n,o){return{symbol:e,source:r.trim()||null,callers:[],found:r.trim().length>0,kind:o,durationMs:Date.now()-n}}function wb(e,r,n,o,t){let i=Em(r,/direct\s*callers?:|## direct/i),a=Em(r,/transitive\s*callers?:|## transitive/i),s=jm(r,/tests?:|## tests?/i),c=jm(r,/docs?:|## docs?/i),l=new Set;for(let d of i)l.add(d.file);for(let d of a)l.add(d.file);for(let d of s)l.add(d);for(let d of c)l.add(d);return{symbol:e,directCallers:i,transitiveCallers:a,testFiles:s,docFiles:c,totalAffectedFiles:l.size,kind:o,durationMs:Date.now()-n,timedOut:t}}function Kn(e){let r=[],n=e.split(`
137
- `);for(let o of n){let t=o.match(/^\s*[-*]?\s*([^\s:]+\.[a-z]+):(\d+)(?:[:\s—–-]+(.+))?/i);if(t){let i=t[1]??"",a=t[2]?parseInt(t[2],10):0,s=(t[3]??"").trim();if(i&&a>0)r.push({file:i,line:a,context:s})}}return r}function Em(e,r){let n=e.split(`
138
- `),o=!1,t=[];for(let i of n){if(r.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!r.test(i))break;if(i.trim()===""&&t.length>0)break;t.push(i)}}return Kn(t.join(`
139
- `))}function jm(e,r){let n=e.split(`
140
- `),o=!1,t=[];for(let i of n){if(r.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!r.test(i))break;if(i.trim()===""&&t.length>0)break;let a=i.trim().replace(/^[-*]\s*/,"");if(a.match(/[^\s:]+\.[a-z]+/i))t.push(a)}}return t}var wl=null;function Sl(){if(!wl)wl=new Am;return wl}Qn();var Z=C.schema,Dl="0.0.0";try{Dl=Um().version}catch{}async function Pb(e,r,n=1500){if(!Pl)return"pending";return await Pl.awaitDelivery({sessionID:e,mcpTool:r,timeoutMs:n})}var Pl=null;function Lm(e){Pl=e}async function Zm(e,r){return await Pb(e,r)}function Fm(e){return C({description:"Semantic code search over the project graph. ROUTING (v0.25.0): with both indexes present, codegraph handles code-structure queries (symbols, call sites, module layout) and graphify "+"handles concept/architecture queries — the plugin alternates deterministically per query, "+"or you can force one via config graphRetrieval.preferredTool. USE THIS for architecture questions, finding call sites, understanding module structure. "+"Prefer over grep/glob for high-level understanding — grep is still better for literal text matches.",args:{query:Z.string().min(3).describe("Natural language query describing what you're looking for"),maxResults:Z.number().int().min(1).max(20).optional().describe("Max results to return (default 10)")},async execute(r,n){let o=Date.now(),t=await e.graphRetrieval.invoke(e.cwd,r.query,{timeoutMs:8000}),i={tool:"omo_search",query:r.query,kind:t.kind,timedOut:t.timedOut,durationMs:t.durationMs,resultSize:t.result?.length??0,sessionID:n.sessionID};if(t.timedOut)return{title:"omo_search: timeout",output:`Graph search timed out after ${t.durationMs}ms. No graph tools available at ${e.cwd}, or the query is too expensive. Fall back to grep/glob for direct text matching.`,metadata:i};if(!t.result)return{title:"omo_search: no graph backend",output:`No codegraph or graphify directory found at ${e.cwd}. Run \`npx codegraph init\` or \`graphify . --no-viz\` to build the index, then call omo_search again. Until then, use grep/glob for direct text matching.`,metadata:i};return{title:`omo_search: ${t.kind}`,output:t.result,metadata:i}}})}function Gm(e){return C({description:"Search lessons learned in past sessions of this project. Returns ranked lessons (highest confidence first) matching the query. "+"Use before making non-trivial decisions — the answer may already be in memory.",args:{query:Z.string().min(2).describe("What kind of lesson you're looking for"),limit:Z.number().int().min(1).max(20).optional().describe("Max lessons to return (default 5)")},async execute(r,n){let o=Date.now(),i=(await e.sqlite.smartSearch({query:r.query,limit:r.limit??5})).lessons;if(i.length===0)return{title:"omo_recall: no matches",output:`No past lessons found matching "${r.query}". This is the first time the agent is encountering this question.`,metadata:{tool:"omo_recall",query:r.query,durationMs:Date.now()-o,lessonsFound:0}};let a=i.map((s,c)=>`${c+1}. [${s.id}] confidence=${s.confidence.toFixed(2)}
141
- ${s.title}
142
- ${s.content.slice(0,500)}${s.content.length>500?"...":""}`).join(`
135
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let k of this.seen.entries()){let J=k[1];if($===k[0]){z(k);continue}if(b.external){let Y=b.external.registry.get(k[0])?.id;if($!==k[0]&&Y){z(k);continue}}if(this.metadataRegistry.get(k[0])?.id){z(k);continue}if(J.cycle){z(k);continue}if(J.count>1){if(b.reused==="ref"){z(k);continue}}}let _=(k,J)=>{let W=this.seen.get(k),Y=W.def??W.schema,I={...Y};if(W.ref===null)return;let j=W.ref;if(W.ref=null,j){_(j,J);let B=this.seen.get(j).schema;if(B.$ref&&(J.target==="draft-7"||J.target==="draft-4"||J.target==="openapi-3.0"))Y.allOf=Y.allOf??[],Y.allOf.push(B);else Object.assign(Y,B),Object.assign(Y,I)}if(!W.isParent)this.override({zodSchema:k,jsonSchema:Y,path:W.path??[]})};for(let k of[...this.seen.entries()].reverse())_(k[0],{target:this.target});let N={};if(this.target==="draft-2020-12")N.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")N.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")N.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(b.external?.uri){let k=b.external.registry.get($)?.id;if(!k)throw Error("Schema is missing an `id` property");N.$id=b.external.uri(k)}Object.assign(N,r.def);let O=b.external?.defs??{};for(let k of this.seen.entries()){let J=k[1];if(J.def&&J.defId)O[J.defId]=J.def}if(b.external);else if(Object.keys(O).length>0)if(this.target==="draft-2020-12")N.$defs=O;else N.definitions=O;try{return JSON.parse(JSON.stringify(N))}catch(k){throw Error("Error converting schema to JSON.")}}}function Az($,U){if($ instanceof dv){let r=new D6(U),v={};for(let N of $._idmap.entries()){let[O,k]=N;r.process(k)}let z={},_={registry:$,uri:U?.uri,defs:v};for(let N of $._idmap.entries()){let[O,k]=N;z[O]=r.emit(k,{...U,external:_})}if(Object.keys(v).length>0){let N=r.target==="draft-2020-12"?"$defs":"definitions";z.__shared={[N]:v}}return{schemas:z}}let b=new D6(U);return b.process($),b.emit($,U)}function a($,U){let b=U??{seen:new Set};if(b.seen.has($))return!1;b.seen.add($);let v=$._zod.def;switch(v.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return a(v.element,b);case"object":{for(let z in v.shape)if(a(v.shape[z],b))return!0;return!1}case"union":{for(let z of v.options)if(a(z,b))return!0;return!1}case"intersection":return a(v.left,b)||a(v.right,b);case"tuple":{for(let z of v.items)if(a(z,b))return!0;if(v.rest&&a(v.rest,b))return!0;return!1}case"record":return a(v.keyType,b)||a(v.valueType,b);case"map":return a(v.keyType,b)||a(v.valueType,b);case"set":return a(v.valueType,b);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return a(v.innerType,b);case"lazy":return a(v.getter(),b);case"default":return a(v.innerType,b);case"prefault":return a(v.innerType,b);case"custom":return!1;case"transform":return!0;case"pipe":return a(v.in,b)||a(v.out,b);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw Error(`Unknown schema type: ${v.type}`)}var RO={};var T6={};J$(T6,{time:()=>Ez,duration:()=>Sz,datetime:()=>Gz,date:()=>Hz,ZodISOTime:()=>R6,ZodISODuration:()=>m6,ZodISODateTime:()=>x6,ZodISODate:()=>g6});var x6=X("ZodISODateTime",($,U)=>{tb.init($,U),f.init($,U)});function Gz($){return u1(x6,$)}var g6=X("ZodISODate",($,U)=>{eb.init($,U),f.init($,U)});function Hz($){return h1(g6,$)}var R6=X("ZodISOTime",($,U)=>{ab.init($,U),f.init($,U)});function Ez($){return y1(R6,$)}var m6=X("ZodISODuration",($,U)=>{sb.init($,U),f.init($,U)});function Sz($){return f1(m6,$)}var TO=($,U)=>{Rv.init($,U),$.name="ZodError",Object.defineProperties($,{format:{value:(b)=>Tv($,b)},flatten:{value:(b)=>mv($,b)},addIssue:{value:(b)=>{$.issues.push(b),$.message=JSON.stringify($.issues,rv,2)}},addIssues:{value:(b)=>{$.issues.push(...b),$.message=JSON.stringify($.issues,rv,2)}},isEmpty:{get(){return $.issues.length===0}}})},lX=X("ZodError",TO),k$=X("ZodError",TO,{Parent:Error});var Fz=Nv(k$),Mz=Ov(k$),Zz=kv(k$),Dz=Iv(k$),xz=n4(k$),gz=i4(k$),Rz=l4(k$),mz=o4(k$),Tz=d4(k$),Cz=p4(k$),cz=t4(k$),uz=e4(k$);var M=X("ZodType",($,U)=>{return S.init($,U),$.def=U,$.type=U.type,Object.defineProperty($,"_def",{value:U}),$.check=(...b)=>{return $.clone({...U,checks:[...U.checks??[],...b.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})},$.clone=(b,r)=>r$($,b,r),$.brand=()=>$,$.register=(b,r)=>{return b.add($,r),$},$.parse=(b,r)=>Fz($,b,r,{callee:$.parse}),$.safeParse=(b,r)=>Zz($,b,r),$.parseAsync=async(b,r)=>Mz($,b,r,{callee:$.parseAsync}),$.safeParseAsync=async(b,r)=>Dz($,b,r),$.spa=$.safeParseAsync,$.encode=(b,r)=>xz($,b,r),$.decode=(b,r)=>gz($,b,r),$.encodeAsync=async(b,r)=>Rz($,b,r),$.decodeAsync=async(b,r)=>mz($,b,r),$.safeEncode=(b,r)=>Tz($,b,r),$.safeDecode=(b,r)=>Cz($,b,r),$.safeEncodeAsync=async(b,r)=>cz($,b,r),$.safeDecodeAsync=async(b,r)=>uz($,b,r),$.refine=(b,r)=>$.check(L2(b,r)),$.superRefine=(b)=>$.check(A2(b)),$.overwrite=(b)=>$.check(M$(b)),$.optional=()=>c6($),$.nullable=()=>u6($),$.nullish=()=>c6(u6($)),$.nonoptional=(b)=>J2($,b),$.array=()=>n6($),$.or=(b)=>k_([$,b]),$.and=(b)=>eO($,b),$.transform=(b)=>h6($,X_(b)),$.default=(b)=>O2($,b),$.prefault=(b)=>I2($,b),$.catch=(b)=>w2($,b),$.pipe=(b)=>h6($,b),$.readonly=()=>W2($),$.describe=(b)=>{let r=$.clone();return E$.add(r,{description:b}),r},Object.defineProperty($,"description",{get(){return E$.get($)?.description},configurable:!0}),$.meta=(...b)=>{if(b.length===0)return E$.get($);let r=$.clone();return E$.add(r,b[0]),r},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),fz=X("_ZodString",($,U)=>{p$.init($,U),M.init($,U);let b=$._zod.bag;$.format=b.format??null,$.minLength=b.minimum??null,$.maxLength=b.maximum??null,$.regex=(...r)=>$.check(av(...r)),$.includes=(...r)=>$.check(v4(...r)),$.startsWith=(...r)=>$.check(U4(...r)),$.endsWith=(...r)=>$.check(b4(...r)),$.min=(...r)=>$.check(C$(...r)),$.max=(...r)=>$.check(Kv(...r)),$.length=(...r)=>$.check(wv(...r)),$.nonempty=(...r)=>$.check(C$(1,...r)),$.lowercase=(r)=>$.check(sv(r)),$.uppercase=(r)=>$.check($4(r)),$.trim=()=>$.check(_4()),$.normalize=(...r)=>$.check(z4(...r)),$.toLowerCase=()=>$.check(N4()),$.toUpperCase=()=>$.check(O4())}),I4=X("ZodString",($,U)=>{p$.init($,U),fz.init($,U),$.email=(b)=>$.check(X6(nz,b)),$.url=(b)=>$.check(tv(y6,b)),$.jwt=(b)=>$.check(Z6(z_,b)),$.emoji=(b)=>$.check(W6(iz,b)),$.guid=(b)=>$.check(pv(C6,b)),$.uuid=(b)=>$.check(K6(D$,b)),$.uuidv4=(b)=>$.check(w6(D$,b)),$.uuidv6=(b)=>$.check(Q6(D$,b)),$.uuidv7=(b)=>$.check(Y6(D$,b)),$.nanoid=(b)=>$.check(j6(lz,b)),$.guid=(b)=>$.check(pv(C6,b)),$.cuid=(b)=>$.check(V6(oz,b)),$.cuid2=(b)=>$.check(P6(dz,b)),$.ulid=(b)=>$.check(q6(pz,b)),$.base64=(b)=>$.check(S6(U_,b)),$.base64url=(b)=>$.check(F6(b_,b)),$.xid=(b)=>$.check(B6(tz,b)),$.ksuid=(b)=>$.check(L6(ez,b)),$.ipv4=(b)=>$.check(A6(az,b)),$.ipv6=(b)=>$.check(G6(sz,b)),$.cidrv4=(b)=>$.check(H6($_,b)),$.cidrv6=(b)=>$.check(E6(v_,b)),$.e164=(b)=>$.check(M6(r_,b)),$.datetime=(b)=>$.check(Gz(b)),$.date=(b)=>$.check(Hz(b)),$.time=(b)=>$.check(Ez(b)),$.duration=(b)=>$.check(Sz(b))});function hz($){return T1(I4,$)}var f=X("ZodStringFormat",($,U)=>{h.init($,U),fz.init($,U)}),nz=X("ZodEmail",($,U)=>{hb.init($,U),f.init($,U)});function dX($){return X6(nz,$)}var C6=X("ZodGUID",($,U)=>{cb.init($,U),f.init($,U)});function pX($){return pv(C6,$)}var D$=X("ZodUUID",($,U)=>{ub.init($,U),f.init($,U)});function tX($){return K6(D$,$)}function eX($){return w6(D$,$)}function aX($){return Q6(D$,$)}function sX($){return Y6(D$,$)}var y6=X("ZodURL",($,U)=>{yb.init($,U),f.init($,U)});function $K($){return tv(y6,$)}function vK($){return tv(y6,{protocol:/^https?$/,hostname:Y$.domain,...V.normalizeParams($)})}var iz=X("ZodEmoji",($,U)=>{fb.init($,U),f.init($,U)});function UK($){return W6(iz,$)}var lz=X("ZodNanoID",($,U)=>{nb.init($,U),f.init($,U)});function bK($){return j6(lz,$)}var oz=X("ZodCUID",($,U)=>{ib.init($,U),f.init($,U)});function rK($){return V6(oz,$)}var dz=X("ZodCUID2",($,U)=>{lb.init($,U),f.init($,U)});function zK($){return P6(dz,$)}var pz=X("ZodULID",($,U)=>{ob.init($,U),f.init($,U)});function _K($){return q6(pz,$)}var tz=X("ZodXID",($,U)=>{db.init($,U),f.init($,U)});function NK($){return B6(tz,$)}var ez=X("ZodKSUID",($,U)=>{pb.init($,U),f.init($,U)});function OK($){return L6(ez,$)}var az=X("ZodIPv4",($,U)=>{$r.init($,U),f.init($,U)});function kK($){return A6(az,$)}var sz=X("ZodIPv6",($,U)=>{vr.init($,U),f.init($,U)});function IK($){return G6(sz,$)}var $_=X("ZodCIDRv4",($,U)=>{Ur.init($,U),f.init($,U)});function JK($){return H6($_,$)}var v_=X("ZodCIDRv6",($,U)=>{br.init($,U),f.init($,U)});function XK($){return E6(v_,$)}var U_=X("ZodBase64",($,U)=>{zr.init($,U),f.init($,U)});function KK($){return S6(U_,$)}var b_=X("ZodBase64URL",($,U)=>{_r.init($,U),f.init($,U)});function wK($){return F6(b_,$)}var r_=X("ZodE164",($,U)=>{Nr.init($,U),f.init($,U)});function QK($){return M6(r_,$)}var z_=X("ZodJWT",($,U)=>{Or.init($,U),f.init($,U)});function YK($){return Z6(z_,$)}var J4=X("ZodCustomStringFormat",($,U)=>{kr.init($,U),f.init($,U)});function WK($,U,b={}){return Qv(J4,$,U,b)}function jK($){return Qv(J4,"hostname",Y$.hostname,$)}function VK($){return Qv(J4,"hex",Y$.hex,$)}function PK($,U){let b=U?.enc??"hex",r=`${$}_${b}`,v=Y$[r];if(!v)throw Error(`Unrecognized hash format: ${r}`);return Qv(J4,r,v,U)}var X4=X("ZodNumber",($,U)=>{N6.init($,U),M.init($,U),$.gt=(r,v)=>$.check(F$(r,v)),$.gte=(r,v)=>$.check(O$(r,v)),$.min=(r,v)=>$.check(O$(r,v)),$.lt=(r,v)=>$.check(S$(r,v)),$.lte=(r,v)=>$.check(W$(r,v)),$.max=(r,v)=>$.check(W$(r,v)),$.int=(r)=>$.check(yz(r)),$.safe=(r)=>$.check(yz(r)),$.positive=(r)=>$.check(F$(0,r)),$.nonnegative=(r)=>$.check(O$(0,r)),$.negative=(r)=>$.check(S$(0,r)),$.nonpositive=(r)=>$.check(W$(0,r)),$.multipleOf=(r,v)=>$.check(t$(r,v)),$.step=(r,v)=>$.check(t$(r,v)),$.finite=()=>$;let b=$._zod.bag;$.minValue=Math.max(b.minimum??Number.NEGATIVE_INFINITY,b.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(b.maximum??Number.POSITIVE_INFINITY,b.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(b.format??"").includes("int")||Number.isSafeInteger(b.multipleOf??0.5),$.isFinite=!0,$.format=b.format??null});function CO($){return n1(X4,$)}var Wv=X("ZodNumberFormat",($,U)=>{Ir.init($,U),X4.init($,U)});function yz($){return l1(Wv,$)}function qK($){return o1(Wv,$)}function BK($){return d1(Wv,$)}function LK($){return p1(Wv,$)}function AK($){return t1(Wv,$)}var K4=X("ZodBoolean",($,U)=>{uv.init($,U),M.init($,U)});function cO($){return e1(K4,$)}var w4=X("ZodBigInt",($,U)=>{O6.init($,U),M.init($,U),$.gte=(r,v)=>$.check(O$(r,v)),$.min=(r,v)=>$.check(O$(r,v)),$.gt=(r,v)=>$.check(F$(r,v)),$.gte=(r,v)=>$.check(O$(r,v)),$.min=(r,v)=>$.check(O$(r,v)),$.lt=(r,v)=>$.check(S$(r,v)),$.lte=(r,v)=>$.check(W$(r,v)),$.max=(r,v)=>$.check(W$(r,v)),$.positive=(r)=>$.check(F$(BigInt(0),r)),$.negative=(r)=>$.check(S$(BigInt(0),r)),$.nonpositive=(r)=>$.check(W$(BigInt(0),r)),$.nonnegative=(r)=>$.check(O$(BigInt(0),r)),$.multipleOf=(r,v)=>$.check(t$(r,v));let b=$._zod.bag;$.minValue=b.minimum??null,$.maxValue=b.maximum??null,$.format=b.format??null});function GK($){return s1(w4,$)}var __=X("ZodBigIntFormat",($,U)=>{Jr.init($,U),w4.init($,U)});function HK($){return vz(__,$)}function EK($){return Uz(__,$)}var uO=X("ZodSymbol",($,U)=>{Xr.init($,U),M.init($,U)});function SK($){return bz(uO,$)}var hO=X("ZodUndefined",($,U)=>{Kr.init($,U),M.init($,U)});function FK($){return rz(hO,$)}var yO=X("ZodNull",($,U)=>{wr.init($,U),M.init($,U)});function fO($){return zz(yO,$)}var nO=X("ZodAny",($,U)=>{Qr.init($,U),M.init($,U)});function MK(){return _z(nO)}var iO=X("ZodUnknown",($,U)=>{Yr.init($,U),M.init($,U)});function Yv(){return Nz(iO)}var lO=X("ZodNever",($,U)=>{Wr.init($,U),M.init($,U)});function N_($){return Oz(lO,$)}var oO=X("ZodVoid",($,U)=>{jr.init($,U),M.init($,U)});function ZK($){return kz(oO,$)}var f6=X("ZodDate",($,U)=>{Vr.init($,U),M.init($,U),$.min=(r,v)=>$.check(O$(r,v)),$.max=(r,v)=>$.check(W$(r,v));let b=$._zod.bag;$.minDate=b.minimum?new Date(b.minimum):null,$.maxDate=b.maximum?new Date(b.maximum):null});function DK($){return Iz(f6,$)}var dO=X("ZodArray",($,U)=>{Pr.init($,U),M.init($,U),$.element=U.element,$.min=(b,r)=>$.check(C$(b,r)),$.nonempty=(b)=>$.check(C$(1,b)),$.max=(b,r)=>$.check(Kv(b,r)),$.length=(b,r)=>$.check(wv(b,r)),$.unwrap=()=>$.element});function n6($,U){return jz(dO,$,U)}function xK($){let U=$._zod.def.shape;return J_(Object.keys(U))}var i6=X("ZodObject",($,U)=>{qr.init($,U),M.init($,U),V.defineLazy($,"shape",()=>U.shape),$.keyof=()=>J_(Object.keys($._zod.def.shape)),$.catchall=(b)=>$.clone({...$._zod.def,catchall:b}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Yv()}),$.loose=()=>$.clone({...$._zod.def,catchall:Yv()}),$.strict=()=>$.clone({...$._zod.def,catchall:N_()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(b)=>{return V.extend($,b)},$.safeExtend=(b)=>{return V.safeExtend($,b)},$.merge=(b)=>V.merge($,b),$.pick=(b)=>V.pick($,b),$.omit=(b)=>V.omit($,b),$.partial=(...b)=>V.partial(K_,$,b[0]),$.required=(...b)=>V.required(w_,$,b[0])});function gK($,U){let b={type:"object",get shape(){return V.assignProp(this,"shape",$?V.objectClone($):{}),this.shape},...V.normalizeParams(U)};return new i6(b)}function RK($,U){return new i6({type:"object",get shape(){return V.assignProp(this,"shape",V.objectClone($)),this.shape},catchall:N_(),...V.normalizeParams(U)})}function mK($,U){return new i6({type:"object",get shape(){return V.assignProp(this,"shape",V.objectClone($)),this.shape},catchall:Yv(),...V.normalizeParams(U)})}var O_=X("ZodUnion",($,U)=>{k6.init($,U),M.init($,U),$.options=U.options});function k_($,U){return new O_({type:"union",options:$,...V.normalizeParams(U)})}var pO=X("ZodDiscriminatedUnion",($,U)=>{O_.init($,U),Br.init($,U)});function TK($,U,b){return new pO({type:"union",options:U,discriminator:$,...V.normalizeParams(b)})}var tO=X("ZodIntersection",($,U)=>{Lr.init($,U),M.init($,U)});function eO($,U){return new tO({type:"intersection",left:$,right:U})}var aO=X("ZodTuple",($,U)=>{I6.init($,U),M.init($,U),$.rest=(b)=>$.clone({...$._zod.def,rest:b})});function sO($,U,b){let r=U instanceof S,v=r?b:U;return new aO({type:"tuple",items:$,rest:r?U:null,...V.normalizeParams(v)})}var I_=X("ZodRecord",($,U)=>{Ar.init($,U),M.init($,U),$.keyType=U.keyType,$.valueType=U.valueType});function $2($,U,b){return new I_({type:"record",keyType:$,valueType:U,...V.normalizeParams(b)})}function CK($,U,b){let r=r$($);return r._zod.values=void 0,new I_({type:"record",keyType:r,valueType:U,...V.normalizeParams(b)})}var v2=X("ZodMap",($,U)=>{Gr.init($,U),M.init($,U),$.keyType=U.keyType,$.valueType=U.valueType});function cK($,U,b){return new v2({type:"map",keyType:$,valueType:U,...V.normalizeParams(b)})}var U2=X("ZodSet",($,U)=>{Hr.init($,U),M.init($,U),$.min=(...b)=>$.check(e$(...b)),$.nonempty=(b)=>$.check(e$(1,b)),$.max=(...b)=>$.check(Xv(...b)),$.size=(...b)=>$.check(ev(...b))});function uK($,U){return new U2({type:"set",valueType:$,...V.normalizeParams(U)})}var k4=X("ZodEnum",($,U)=>{Er.init($,U),M.init($,U),$.enum=U.entries,$.options=Object.values(U.entries);let b=new Set(Object.keys(U.entries));$.extract=(r,v)=>{let z={};for(let _ of r)if(b.has(_))z[_]=U.entries[_];else throw Error(`Key ${_} not found in enum`);return new k4({...U,checks:[],...V.normalizeParams(v),entries:z})},$.exclude=(r,v)=>{let z={...U.entries};for(let _ of r)if(b.has(_))delete z[_];else throw Error(`Key ${_} not found in enum`);return new k4({...U,checks:[],...V.normalizeParams(v),entries:z})}});function J_($,U){let b=Array.isArray($)?Object.fromEntries($.map((r)=>[r,r])):$;return new k4({type:"enum",entries:b,...V.normalizeParams(U)})}function hK($,U){return new k4({type:"enum",entries:$,...V.normalizeParams(U)})}var b2=X("ZodLiteral",($,U)=>{Sr.init($,U),M.init($,U),$.values=new Set(U.values),Object.defineProperty($,"value",{get(){if(U.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return U.values[0]}})});function yK($,U){return new b2({type:"literal",values:Array.isArray($)?$:[$],...V.normalizeParams(U)})}var r2=X("ZodFile",($,U)=>{Fr.init($,U),M.init($,U),$.min=(b,r)=>$.check(e$(b,r)),$.max=(b,r)=>$.check(Xv(b,r)),$.mime=(b,r)=>$.check(r4(Array.isArray(b)?b:[b],r))});function fK($){return Vz(r2,$)}var z2=X("ZodTransform",($,U)=>{Mr.init($,U),M.init($,U),$._zod.parse=(b,r)=>{if(r.direction==="backward")throw new l$($.constructor.name);b.addIssue=(z)=>{if(typeof z==="string")b.issues.push(V.issue(z,b.value,U));else{let _=z;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=b.value),_.inst??(_.inst=$),b.issues.push(V.issue(_))}};let v=U.transform(b.value,b);if(v instanceof Promise)return v.then((z)=>{return b.value=z,b});return b.value=v,b}});function X_($){return new z2({type:"transform",transform:$})}var K_=X("ZodOptional",($,U)=>{Zr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType});function c6($){return new K_({type:"optional",innerType:$})}var _2=X("ZodNullable",($,U)=>{Dr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType});function u6($){return new _2({type:"nullable",innerType:$})}function nK($){return c6(u6($))}var N2=X("ZodDefault",($,U)=>{xr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function O2($,U){return new N2({type:"default",innerType:$,get defaultValue(){return typeof U==="function"?U():V.shallowClone(U)}})}var k2=X("ZodPrefault",($,U)=>{gr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType});function I2($,U){return new k2({type:"prefault",innerType:$,get defaultValue(){return typeof U==="function"?U():V.shallowClone(U)}})}var w_=X("ZodNonOptional",($,U)=>{Rr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType});function J2($,U){return new w_({type:"nonoptional",innerType:$,...V.normalizeParams(U)})}var X2=X("ZodSuccess",($,U)=>{mr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType});function iK($){return new X2({type:"success",innerType:$})}var K2=X("ZodCatch",($,U)=>{Tr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function w2($,U){return new K2({type:"catch",innerType:$,catchValue:typeof U==="function"?U:()=>U})}var Q2=X("ZodNaN",($,U)=>{Cr.init($,U),M.init($,U)});function lK($){return Xz(Q2,$)}var Q_=X("ZodPipe",($,U)=>{cr.init($,U),M.init($,U),$.in=U.in,$.out=U.out});function h6($,U){return new Q_({type:"pipe",in:$,out:U})}var Y_=X("ZodCodec",($,U)=>{Q_.init($,U),hv.init($,U)});function oK($,U,b){return new Y_({type:"pipe",in:$,out:U,transform:b.decode,reverseTransform:b.encode})}var Y2=X("ZodReadonly",($,U)=>{ur.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType});function W2($){return new Y2({type:"readonly",innerType:$})}var j2=X("ZodTemplateLiteral",($,U)=>{hr.init($,U),M.init($,U)});function dK($,U){return new j2({type:"template_literal",parts:$,...V.normalizeParams(U)})}var V2=X("ZodLazy",($,U)=>{nr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.getter()});function P2($){return new V2({type:"lazy",getter:$})}var q2=X("ZodPromise",($,U)=>{fr.init($,U),M.init($,U),$.unwrap=()=>$._zod.def.innerType});function pK($){return new q2({type:"promise",innerType:$})}var B2=X("ZodFunction",($,U)=>{yr.init($,U),M.init($,U)});function tK($){return new B2({type:"function",input:Array.isArray($?.input)?sO($?.input):$?.input??n6(Yv()),output:$?.output??Yv()})}var l6=X("ZodCustom",($,U)=>{ir.init($,U),M.init($,U)});function eK($){let U=new n({check:"custom"});return U._zod.check=$,U}function aK($,U){return Pz(l6,$??(()=>!0),U)}function L2($,U={}){return qz(l6,$,U)}function A2($){return Bz($)}function sK($,U={error:`Input not instance of ${$.name}`}){let b=new l6({type:"custom",check:"custom",fn:(r)=>r instanceof $,abort:!0,...V.normalizeParams(U)});return b._zod.bag.Class=$,b}var $w=(...$)=>Lz({Codec:Y_,Boolean:K4,String:I4},...$);function vw($){let U=P2(()=>{return k_([hz($),CO(),cO(),fO(),n6(U),$2(hz(),U)])});return U}function Uw($,U){return h6(X_($),U)}var bw={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 rw($){d({customError:$})}function zw(){return d().customError}var W_;(function($){})(W_||(W_={}));var j_={};J$(j_,{string:()=>_w,number:()=>Nw,date:()=>Iw,boolean:()=>Ow,bigint:()=>kw});function _w($){return C1(I4,$)}function Nw($){return i1(X4,$)}function Ow($){return a1(K4,$)}function kw($){return $z(w4,$)}function Iw($){return Jz(f6,$)}d(yv());function Z($){return $}Z.schema=o6;import{renameSync as Jw,writeFileSync as Xw,readFileSync as CY,existsSync as Kw,statSync as cY}from"node:fs";import{dirname as ww}from"node:path";import{mkdirSync as Qw}from"node:fs";function G2($,U){let b=ww(U);if(!Kw(b))Qw(b,{recursive:!0});let r=`${U}.tmp`;Xw(r,JSON.stringify($,null,2),"utf8"),Jw(r,U)}H4();import{statSync as H2,existsSync as iY}from"node:fs";import{join as V_}from"node:path";function Yw($,U,b,r){let v=U&&b;if($==="codegraph")return U?{kind:"codegraph",cmd:"codegraph",args:[]}:null;if($==="graphify")return b?{kind:"graphify",cmd:"graphify",args:[]}:null;if($==="alternate"&&v)return(r??"").trim().toLowerCase().split("").reduce((N,O)=>N+O.charCodeAt(0),0)%2===0?{kind:"codegraph",cmd:"codegraph",args:[]}:{kind:"graphify",cmd:"graphify",args:[]};if(U)return{kind:"codegraph",cmd:"codegraph",args:[]};if(b)return{kind:"graphify",cmd:"graphify",args:[]};return null}function E2($){let U=$.trim().toLowerCase(),b=2166136261;for(let r=0;r<U.length;r++)b^=U.charCodeAt(r),b=b*16777619>>>0;return b.toString(16)}class S2{timeoutMs;cacheTtlMs;maxEntriesPerSession;cache=new Map;preferredTool;constructor($={}){this.timeoutMs=$.timeoutMs??5000,this.cacheTtlMs=$.cacheTtlMs??300000,this.maxEntriesPerSession=$.maxEntriesPerSession??10,this.preferredTool=$.preferredTool??"auto"}setPreferredTool($){this.preferredTool=$}hasCodegraphDir($){try{return H2(V_($,".codegraph")).isDirectory()}catch{return!1}}hasGraphifyDir($){try{return H2(V_($,"graphify-out")).isDirectory()}catch{return!1}}cacheContext($,U,b){let r=this.cache.get($);if(!r)r={entries:new Map},this.cache.set($,r);let v=E2(U);r.entries.set(v,{query:U,content:b,insertedAtMs:Date.now()});while(r.entries.size>this.maxEntriesPerSession){let z=r.entries.keys().next().value;if(!z)break;r.entries.delete(z)}}getCachedContext($,U){let b=this.cache.get($);if(!b)return null;if(U){let v=E2(U),z=b.entries.get(v);if(!z)return null;if(Date.now()-z.insertedAtMs>this.cacheTtlMs)return b.entries.delete(v),null;return z.content}let r=null;for(let v of b.entries.values())if(Date.now()-v.insertedAtMs<=this.cacheTtlMs)r=v.content;return r}clear(){this.cache.clear()}clearSession($){this.cache.delete($)}async invoke($,U,b={}){let r=Date.now(),v=b.timeoutMs??this.timeoutMs,z=this.hasCodegraphDir($),_=this.hasGraphifyDir($),N=b.preferredTool??this.preferredTool,O=Yw(N,z,_,U),k=null,J=null,W=[];if(O)if(k=O.kind,k==="codegraph")J=b.codegraphBin??"codegraph",W=["explore",U,"--project-path",$];else J=b.graphifyBin??"graphify",W=["query",U,"--graph",V_($,"graphify-out")];if(!J||!k)return{kind:null,query:U,result:null,timedOut:!1,durationMs:Date.now()-r};try{let Y=await this.spawnWithTimeout(J,W,v,$);return{kind:k,query:U,result:Y.trim()||null,timedOut:!1,durationMs:Date.now()-r}}catch(Y){let I=Y instanceof Error&&Y.message.includes("timed out");return{kind:k,query:U,result:null,timedOut:I,durationMs:Date.now()-r}}}spawnWithTimeout($,U,b,r){return G4($,U,{cwd:r,timeoutMs:b}).then((v)=>{if(v.timedOut)throw Error(`graph retrieval subprocess timed out after ${b}ms`);if(v.code===null)throw Error(`graph retrieval subprocess failed to spawn: ${$}`);if(v.code!==0)throw Error(`graph retrieval subprocess exited ${v.code}: ${v.stderr.slice(0,200)}`);return v.stdout})}async invokeNode($,U,b={}){return this.invokeCodegraphSubcommand("node",$,U,b)}async invokeCallers($,U,b={}){return this.invokeCodegraphSubcommand("callers",$,U,b)}async invokeImpact($,U,b={}){return this.invokeCodegraphSubcommand("impact",$,U,b)}async invokeFiles($,U={}){return this.invokeCodegraphSubcommand("files",void 0,$,U)}async invokeContext($,U,b={}){return this.invokeCodegraphSubcommand("context",$,U,b)}async invokeAffected($,U,b={}){return this.invokeCodegraphSubcommand("affected",$,U,b)}async invokeStatus($,U={}){return this.invokeCodegraphSubcommand("status",void 0,$,U)}async invokeUnlock($,U={}){return this.invokeCodegraphSubcommand("unlock",void 0,$,U)}async invokeMarkDirty($,U={}){return this.invokeCodegraphSubcommand("mark-dirty",void 0,$,U)}async invokeSyncIfDirty($,U={}){return this.invokeCodegraphSubcommand("sync-if-dirty",void 0,$,U)}async invokeIndex($,U={}){return this.invokeCodegraphSubcommand("index",void 0,$,U)}async invokeVisualize($,U={}){return this.invokeCodegraphSubcommand("visualize",void 0,$,U)}async invokeServe($,U,b={}){return this.invokeCodegraphSubcommand("serve",String($),U,b)}async invokeUninit($,U={}){return this.invokeCodegraphSubcommand("uninit",void 0,$,U)}async invokeCodegraphSubcommand($,U,b,r){let v=Date.now(),z=r.timeoutMs??this.timeoutMs;if(!this.hasCodegraphDir(b))return{kind:null,query:U===void 0?$:Array.isArray(U)?U.join(","):U,result:null,timedOut:!1,durationMs:Date.now()-v};let _=r.codegraphBin??"codegraph",N=U===void 0?[]:Array.isArray(U)?U:[U],O=[$,...N,"--project-path",b],k=U===void 0?$:Array.isArray(U)?U.join(","):U;try{let J=await this.spawnWithTimeout(_,O,z,b);return{kind:"codegraph",query:k,result:J.trim()||null,timedOut:!1,durationMs:Date.now()-v}}catch(J){let W=J instanceof Error&&/timed out/i.test(J.message);return{kind:"codegraph",query:k,result:null,timedOut:W,durationMs:Date.now()-v}}}async invokePath($,U,b,r={}){let v=Date.now(),z=r.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(b))return{kind:null,query:`${$} ${U}`,result:null,timedOut:!1,durationMs:Date.now()-v};let _=r.graphifyBin??"graphify",N=["path",$,U];try{let O=await this.spawnWithTimeout(_,N,z,b);return{kind:"graphify",query:`${$} ${U}`,result:O.trim()||null,timedOut:!1,durationMs:Date.now()-v}}catch(O){return{kind:"graphify",query:`${$} ${U}`,result:null,timedOut:O instanceof Error&&/timed out/i.test(O.message),durationMs:Date.now()-v}}}async invokeExplain($,U,b={}){return this.invokeGraphifySubcommand("explain",$,U,b)}async invokeGraphifySubcommand($,U,b,r){let v=Date.now(),z=r.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(b))return{kind:null,query:U??$,result:null,timedOut:!1,durationMs:Date.now()-v};let _=r.graphifyBin??"graphify",N=U===void 0?[$]:[$,U];try{let O=await this.spawnWithTimeout(_,N,z,b);return{kind:"graphify",query:U??$,result:O.trim()||null,timedOut:!1,durationMs:Date.now()-v}}catch(O){return{kind:"graphify",query:U??$,result:null,timedOut:O instanceof Error&&/timed out/i.test(O.message),durationMs:Date.now()-v}}}async invokeDiagnose($,U={}){return this.invokeGraphifySubcommand("diagnose",void 0,$,U)}async invokeMergeDriver($,U={}){return this.invokeGraphifySubcommand("merge-driver",void 0,$,U)}async invokeSaveResult($,U={}){return this.invokeGraphifySubcommand("save-result",void 0,$,U)}async invokeExtract($,U={}){return this.invokeGraphifySubcommand("extract",void 0,$,U)}async invokeClusterOnly($,U={}){return this.invokeGraphifySubcommand("cluster-only",void 0,$,U)}async invokeLabel($,U,b={}){return this.invokeGraphifySubcommand("label",$,U,b)}async invokeTree($,U={}){return this.invokeGraphifySubcommand("tree",void 0,$,U)}async invokeClone($,U={}){return this.invokeGraphifySubcommand("clone",void 0,$,U)}async invokeAdd($,U,b={}){return this.invokeGraphifySubcommand("add",$,U,b)}async invokeCheckUpdate($,U={}){return this.invokeGraphifySubcommand("check-update",void 0,$,U)}}var P_=null;function m(){if(!P_)P_=new S2;return P_}function F2($){let U=m();if($.preferredTool)U.setPreferredTool($.preferredTool)}var Ww=m();class D2{retrieval;constructor($=Ww){this.retrieval=$}async find($,U,b=5000){let r=Date.now(),v=await this.retrieval.invokeNode($,U,{timeoutMs:b});if(v.kind==="codegraph"&&v.result)return jw($,v.result,r,"codegraph");let z=await this.retrieval.invoke(U,$,{timeoutMs:b});if(z.kind==="graphify"&&z.result)return Vw($,z.result,r,"graphify");return{symbol:$,source:null,callers:[],found:!1,kind:v.kind??z.kind,durationMs:Date.now()-r}}async impact($,U,b=5000){let r=Date.now(),v=await this.retrieval.invokeImpact($,U,{timeoutMs:b});if(v.kind==="codegraph"&&v.result)return Pw($,v.result,r,"codegraph",v.timedOut);let z=await this.retrieval.invokeCallers($,U,{timeoutMs:b});if(z.kind==="codegraph"&&z.result)return{symbol:$,directCallers:d6(z.result),transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:new Set(d6(z.result).map((_)=>_.file)).size,kind:"codegraph",durationMs:Date.now()-r,timedOut:z.timedOut};return{symbol:$,directCallers:[],transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:0,kind:v.kind??z.kind,durationMs:Date.now()-r,timedOut:v.timedOut||z.timedOut}}async listFiles($,U=5000){let b=Date.now(),r=await this.retrieval.invokeFiles($,{timeoutMs:U});if(r.kind==="codegraph"&&r.result){let v=r.result.split(`
136
+ `).map((z)=>z.trim()).filter(Boolean);return{files:v,count:v.length,kind:"codegraph",durationMs:Date.now()-b}}return{files:[],count:0,kind:r.kind,durationMs:Date.now()-b}}}function jw($,U,b,r){let v=d6(U),z=U.search(/callers?:|## callers?/i),_=z>0?U.slice(0,z).trim():U.trim();return{symbol:$,source:_||null,callers:v,found:v.length>0||_.length>0,kind:r,durationMs:Date.now()-b}}function Vw($,U,b,r){return{symbol:$,source:U.trim()||null,callers:[],found:U.trim().length>0,kind:r,durationMs:Date.now()-b}}function Pw($,U,b,r,v){let z=M2(U,/direct\s*callers?:|## direct/i),_=M2(U,/transitive\s*callers?:|## transitive/i),N=Z2(U,/tests?:|## tests?/i),O=Z2(U,/docs?:|## docs?/i),k=new Set;for(let J of z)k.add(J.file);for(let J of _)k.add(J.file);for(let J of N)k.add(J);for(let J of O)k.add(J);return{symbol:$,directCallers:z,transitiveCallers:_,testFiles:N,docFiles:O,totalAffectedFiles:k.size,kind:r,durationMs:Date.now()-b,timedOut:v}}function d6($){let U=[],b=$.split(`
137
+ `);for(let r of b){let v=r.match(/^\s*[-*]?\s*([^\s:]+\.[a-z]+):(\d+)(?:[:\s—–-]+(.+))?/i);if(v){let z=v[1]??"",_=v[2]?parseInt(v[2],10):0,N=(v[3]??"").trim();if(z&&_>0)U.push({file:z,line:_,context:N})}}return U}function M2($,U){let b=$.split(`
138
+ `),r=!1,v=[];for(let z of b){if(U.test(z)){r=!0;continue}if(r){if(/^#\s/.test(z)&&!U.test(z))break;if(z.trim()===""&&v.length>0)break;v.push(z)}}return d6(v.join(`
139
+ `))}function Z2($,U){let b=$.split(`
140
+ `),r=!1,v=[];for(let z of b){if(U.test(z)){r=!0;continue}if(r){if(/^#\s/.test(z)&&!U.test(z))break;if(z.trim()===""&&v.length>0)break;let _=z.trim().replace(/^[-*]\s*/,"");if(_.match(/[^\s:]+\.[a-z]+/i))v.push(_)}}return v}var q_=null;function B_(){if(!q_)q_=new D2;return q_}e6();var u=Z.schema,H_="0.0.0";try{H_=m2().version}catch{}async function Hw($,U,b=1500){if(!E_)return"pending";return await E_.awaitDelivery({sessionID:$,mcpTool:U,timeoutMs:b})}var E_=null;function T2($){E_=$}async function C2($,U){return await Hw($,U)}function c2($){return Z({description:"Semantic code search over the project graph. ROUTING (v0.25.0): with both indexes present, codegraph handles code-structure queries (symbols, call sites, module layout) and graphify "+"handles concept/architecture queries — the plugin alternates deterministically per query, "+"or you can force one via config graphRetrieval.preferredTool. USE THIS for architecture questions, finding call sites, understanding module structure. "+"Prefer over grep/glob for high-level understanding — grep is still better for literal text matches.",args:{query:u.string().min(3).describe("Natural language query describing what you're looking for"),maxResults:u.number().int().min(1).max(20).optional().describe("Max results to return (default 10)")},async execute(U,b){let r=Date.now(),v=await $.graphRetrieval.invoke($.cwd,U.query,{timeoutMs:8000}),z={tool:"omo_search",query:U.query,kind:v.kind,timedOut:v.timedOut,durationMs:v.durationMs,resultSize:v.result?.length??0,sessionID:b.sessionID};if(v.timedOut)return{title:"omo_search: timeout",output:`Graph search timed out after ${v.durationMs}ms. No graph tools available at ${$.cwd}, or the query is too expensive. Fall back to grep/glob for direct text matching.`,metadata:z};if(!v.result)return{title:"omo_search: no graph backend",output:`No codegraph or graphify directory found at ${$.cwd}. Run \`npx codegraph init\` or \`graphify . --no-viz\` to build the index, then call omo_search again. Until then, use grep/glob for direct text matching.`,metadata:z};return{title:`omo_search: ${v.kind}`,output:v.result,metadata:z}}})}function u2($){return Z({description:"Search lessons learned in past sessions of this project. Returns ranked lessons (highest confidence first) matching the query. "+"Use before making non-trivial decisions — the answer may already be in memory.",args:{query:u.string().min(2).describe("What kind of lesson you're looking for"),limit:u.number().int().min(1).max(20).optional().describe("Max lessons to return (default 5)")},async execute(U,b){let r=Date.now(),z=(await $.sqlite.smartSearch({query:U.query,limit:U.limit??5})).lessons;if(z.length===0)return{title:"omo_recall: no matches",output:`No past lessons found matching "${U.query}". This is the first time the agent is encountering this question.`,metadata:{tool:"omo_recall",query:U.query,durationMs:Date.now()-r,lessonsFound:0}};let _=z.map((N,O)=>`${O+1}. [${N.id}] confidence=${N.confidence.toFixed(2)}
141
+ ${N.title}
142
+ ${N.content.slice(0,500)}${N.content.length>500?"...":""}`).join(`
143
143
 
144
- `);return{title:`omo_recall: ${i.length} lesson${i.length===1?"":"s"}`,output:`Found ${i.length} past lesson${i.length===1?"":"s"} matching "${r.query}":
144
+ `);return{title:`omo_recall: ${z.length} lesson${z.length===1?"":"s"}`,output:`Found ${z.length} past lesson${z.length===1?"":"s"} matching "${U.query}":
145
145
 
146
- ${a}`,metadata:{tool:"omo_recall",query:r.query,durationMs:Date.now()-o,lessonsFound:i.length}}}})}function Vm(e){return C({description:"Show omo-meta-governor plugin status: enabled, metrics, recent decisions, and current config. Use when the user asks 'is the plugin working?' or to verify that lessons are being persisted.",args:{},async execute(r,n){let o=e.metrics.getMetrics(),t=o.counters.interventions_delivered?.count??0,i=(o.counters.decisions_skipped_continue?.count??0)+(o.counters.decisions_skipped_no_decision?.count??0)+(o.counters.decisions_skipped_no_message?.count??0)+(o.counters.decisions_skipped_below_threshold?.count??0),a=o.counters.decisions_taken?.lastOccurrenceISO,s=o.counters.interventions_delivered?.lastOccurrenceISO,c={version:Dl,status:o.counters.orchestrator_errors?.count?"degraded":"healthy",enabled:!0,startedAtISO:o.startedAtISO,uptimeMs:o.uptimeMs,metrics:{decisionsTaken:o.counters.decisions_taken?.count??0,decisionsStored:o.counters.decisions_stored?.count??0,interventionsDelivered:t,orchestratorRuns:o.counters.orchestrator_runs?.count??0,orchestratorErrors:o.counters.orchestrator_errors?.count??0,lastDecisionISO:a,lastInterventionISO:s},logFile:{path:e.logFilePath,sizeBytes:0,rotatedFiles:0},session:{id:n.sessionID,toolCallsObserved:o.counters.orchestrator_runs?.count??0,violationsDetected:o.counters.protocol_violations_detected?.count??0,interventionsSkipped:i,firstSeenISO:o.startedAtISO,lastSeenISO:new Date().toISOString()},graphSync:{lastUpgradeAtISO:null,lastUpgradeResult:"unknown",lastUpgradeTarget:null,lastUpgradeMs:null},graphToolsUsed:{omo_search:0,omo_recall:0,omo_health:0,omo_find:0,omo_impact:0,omo_remember:0,omo_recall_mcp:0,omo_path:0,omo_explain:0,omo_files:0,omo_callers:0,omo_node:0,omo_context:0,omo_affected_cg:0,omo_status:0,omo_unlock:0,omo_mark_dirty:0,omo_sync_if_dirty:0,omo_index:0,omo_visualize:0,omo_serve:0,omo_uninit:0,omo_diagnose:0,omo_merge_graphs:0,omo_save_result:0,omo_extract:0,omo_cluster_only:0,omo_label:0,omo_tree:0,omo_clone:0,omo_add:0,omo_check_update:0,omo_hook_status:0}};try{Om(c,e.healthFilePath)}catch{}return{title:"omo_health",output:`# omo-meta-governor v${Dl} — Health Report
146
+ ${_}`,metadata:{tool:"omo_recall",query:U.query,durationMs:Date.now()-r,lessonsFound:z.length}}}})}function h2($){return Z({description:"Show omo-meta-governor plugin status: enabled, metrics, recent decisions, and current config. Use when the user asks 'is the plugin working?' or to verify that lessons are being persisted.",args:{},async execute(U,b){let r=$.metrics.getMetrics(),v=r.counters.interventions_delivered?.count??0,z=(r.counters.decisions_skipped_continue?.count??0)+(r.counters.decisions_skipped_no_decision?.count??0)+(r.counters.decisions_skipped_no_message?.count??0)+(r.counters.decisions_skipped_below_threshold?.count??0),_=r.counters.decisions_taken?.lastOccurrenceISO,N=r.counters.interventions_delivered?.lastOccurrenceISO,O={version:H_,status:r.counters.orchestrator_errors?.count?"degraded":"healthy",enabled:!0,startedAtISO:r.startedAtISO,uptimeMs:r.uptimeMs,metrics:{decisionsTaken:r.counters.decisions_taken?.count??0,decisionsStored:r.counters.decisions_stored?.count??0,interventionsDelivered:v,orchestratorRuns:r.counters.orchestrator_runs?.count??0,orchestratorErrors:r.counters.orchestrator_errors?.count??0,lastDecisionISO:_,lastInterventionISO:N},logFile:{path:$.logFilePath,sizeBytes:0,rotatedFiles:0},session:{id:b.sessionID,toolCallsObserved:r.counters.orchestrator_runs?.count??0,violationsDetected:r.counters.protocol_violations_detected?.count??0,interventionsSkipped:z,firstSeenISO:r.startedAtISO,lastSeenISO:new Date().toISOString()},graphSync:{lastUpgradeAtISO:null,lastUpgradeResult:"unknown",lastUpgradeTarget:null,lastUpgradeMs:null},graphToolsUsed:{omo_search:0,omo_recall:0,omo_health:0,omo_find:0,omo_impact:0,omo_remember:0,omo_recall_mcp:0,omo_path:0,omo_explain:0,omo_files:0,omo_callers:0,omo_node:0,omo_context:0,omo_affected_cg:0,omo_status:0,omo_unlock:0,omo_mark_dirty:0,omo_sync_if_dirty:0,omo_index:0,omo_visualize:0,omo_serve:0,omo_uninit:0,omo_diagnose:0,omo_merge_graphs:0,omo_save_result:0,omo_extract:0,omo_cluster_only:0,omo_label:0,omo_tree:0,omo_clone:0,omo_add:0,omo_check_update:0,omo_hook_status:0}};try{G2(O,$.healthFilePath)}catch{}return{title:"omo_health",output:`# omo-meta-governor v${H_} — Health Report
147
147
 
148
- `+`**Status**: ${c.status}
149
- **Enabled**: ${c.enabled}
150
- **Uptime**: ${(c.uptimeMs/1000).toFixed(1)}s
151
- **Session**: ${c.session.id}
148
+ `+`**Status**: ${O.status}
149
+ **Enabled**: ${O.enabled}
150
+ **Uptime**: ${(O.uptimeMs/1000).toFixed(1)}s
151
+ **Session**: ${O.session.id}
152
152
 
153
153
  ## Metrics (this session)
154
154
  | Metric | Count | Last seen |
155
155
  |--------|-------|-----------|
156
- | Decisions taken | ${c.metrics.decisionsTaken} | ${a??"—"} |
157
- | Decisions stored | ${c.metrics.decisionsStored} | — |
158
- `+`| Interventions delivered | ${t} | ${s??"—"} |
159
- | Interventions skipped | ${i} | — |
160
- `+`| Orchestrator runs | ${c.metrics.orchestratorRuns} | — |
161
- `+`| Orchestrator errors | ${c.metrics.orchestratorErrors} | — |
162
- `+`| Protocol violations | ${c.session.violationsDetected} | — |
156
+ | Decisions taken | ${O.metrics.decisionsTaken} | ${_??"—"} |
157
+ | Decisions stored | ${O.metrics.decisionsStored} | — |
158
+ `+`| Interventions delivered | ${v} | ${N??"—"} |
159
+ | Interventions skipped | ${z} | — |
160
+ `+`| Orchestrator runs | ${O.metrics.orchestratorRuns} | — |
161
+ `+`| Orchestrator errors | ${O.metrics.orchestratorErrors} | — |
162
+ `+`| Protocol violations | ${O.session.violationsDetected} | — |
163
163
 
164
164
  `+`## Files
165
- - Health JSON: \`${e.healthFilePath}\`
166
- - Log file: \`${e.logFilePath}\`
165
+ - Health JSON: \`${$.healthFilePath}\`
166
+ - Log file: \`${$.logFilePath}\`
167
167
 
168
- The health JSON file is updated on every invocation. Run \`cat ${e.healthFilePath}\` to see the full snapshot.`,metadata:{tool:"omo_health",sessionID:n.sessionID,uptimeMs:c.uptimeMs}}}})}function Wm(e){return C({description:"Find the exact source location and direct callers of a symbol (function, class, method, variable). "+"CODEGRAPH TOOL (v0.25.0): symbol precision lives in codegraph — use this for exact definitions "+"and call sites. USE THIS when you know the exact symbol name and need its source code. Example: omo_find with symbol='UserService.create' returns the file:line of the definition and every call site.",args:{symbol:Z.string().min(1).describe("The exact symbol name to find (e.g. 'UserService.create', 'validateToken')")},async execute(r,n){let o=Date.now(),i=await(e.codeGraph??Sl()).find(r.symbol,e.cwd,5000),a={tool:"omo_find",symbol:r.symbol,kind:i.kind,found:i.found,callerCount:i.callers.length,durationMs:i.durationMs,sessionID:n.sessionID};if(!i.found)return{title:`omo_find: ${r.symbol} not found`,output:`Symbol "${r.symbol}" was not found in the codebase graph. If .codegraph/ doesn't exist, run \`npx codegraph init\` first. Otherwise, try omo_search with a natural-language description.`,metadata:a};let s=i.source?`
168
+ The health JSON file is updated on every invocation. Run \`cat ${$.healthFilePath}\` to see the full snapshot.`,metadata:{tool:"omo_health",sessionID:b.sessionID,uptimeMs:O.uptimeMs}}}})}function y2($){return Z({description:"Find the exact source location and direct callers of a symbol (function, class, method, variable). "+"CODEGRAPH TOOL (v0.25.0): symbol precision lives in codegraph — use this for exact definitions "+"and call sites. USE THIS when you know the exact symbol name and need its source code. Example: omo_find with symbol='UserService.create' returns the file:line of the definition and every call site.",args:{symbol:u.string().min(1).describe("The exact symbol name to find (e.g. 'UserService.create', 'validateToken')")},async execute(U,b){let r=Date.now(),z=await($.codeGraph??B_()).find(U.symbol,$.cwd,5000),_={tool:"omo_find",symbol:U.symbol,kind:z.kind,found:z.found,callerCount:z.callers.length,durationMs:z.durationMs,sessionID:b.sessionID};if(!z.found)return{title:`omo_find: ${U.symbol} not found`,output:`Symbol "${U.symbol}" was not found in the codebase graph. If .codegraph/ doesn't exist, run \`npx codegraph init\` first. Otherwise, try omo_search with a natural-language description.`,metadata:_};let N=z.source?`
169
169
  ## Definition
170
170
 
171
171
  \`\`\`
172
- ${i.source.slice(0,2000)}
172
+ ${z.source.slice(0,2000)}
173
173
  \`\`\`
174
- `:"",c=i.callers.length>0?`
175
- ## Direct Callers (${i.callers.length})
174
+ `:"",O=z.callers.length>0?`
175
+ ## Direct Callers (${z.callers.length})
176
176
 
177
- `+i.callers.slice(0,30).map((l)=>`- ${l.file}:${l.line}${l.context?` — ${l.context}`:""}`).join(`
178
- `)+(i.callers.length>30?`
179
- ... and ${i.callers.length-30} more`:""):`
177
+ `+z.callers.slice(0,30).map((k)=>`- ${k.file}:${k.line}${k.context?` — ${k.context}`:""}`).join(`
178
+ `)+(z.callers.length>30?`
179
+ ... and ${z.callers.length-30} more`:""):`
180
180
  ## Direct Callers
181
181
 
182
- None found in the indexed graph.`;return{title:`omo_find: ${r.symbol}${i.callers.length>0?` (${i.callers.length} callers)`:""}`,output:`Found definition for "${r.symbol}" (via ${i.kind??"fallback"}).
183
- `+s+c,metadata:a}}})}function Bm(e){return C({description:"Analyze the impact of changing a symbol. Lists direct callers, transitive callers, and affected test/doc files. CODEGRAPH TOOL (v0.25.0): call-graph analysis is codegraph-only. "+"ALWAYS run this BEFORE modifying a function or class — "+"knows what will break. Example: omo_impact with symbol='validateToken' lists every file that calls validateToken and every test that exercises it.",args:{symbol:Z.string().min(1).describe("The symbol to analyze (function, class, method)")},async execute(r,n){let o=Date.now(),i=await(e.codeGraph??Sl()).impact(r.symbol,e.cwd,5000),a={tool:"omo_impact",symbol:r.symbol,kind:i.kind,directCallers:i.directCallers.length,transitiveCallers:i.transitiveCallers.length,testFiles:i.testFiles.length,docFiles:i.docFiles.length,totalAffectedFiles:i.totalAffectedFiles,timedOut:i.timedOut,durationMs:i.durationMs,sessionID:n.sessionID};if(i.totalAffectedFiles===0&&i.directCallers.length===0)return{title:`omo_impact: no callers found for ${r.symbol}`,output:`No call sites found for "${r.symbol}". Either the symbol is unused, or the codegraph index is stale. Run \`npx codegraph sync\` to refresh the index and try again.`,metadata:a};let s=[];if(s.push(`Impact analysis for "${r.symbol}" (via ${i.kind??"fallback"}).
184
- `),s.push("## Summary"),s.push(`- Direct callers: **${i.directCallers.length}**`),s.push(`- Transitive callers: **${i.transitiveCallers.length}**`),s.push(`- Test files affected: **${i.testFiles.length}**`),s.push(`- Doc files affected: **${i.docFiles.length}**`),s.push(`- Total affected files: **${i.totalAffectedFiles}**
185
- `),i.directCallers.length>0){s.push("## Direct Callers");for(let c of i.directCallers.slice(0,30))s.push(`- ${c.file}:${c.line}${c.context?` — ${c.context}`:""}`);if(i.directCallers.length>30)s.push(`- ... and ${i.directCallers.length-30} more`);s.push("")}if(i.testFiles.length>0){s.push("## Test Files Affected");for(let c of i.testFiles.slice(0,20))s.push(`- ${c}`);s.push("")}if(i.docFiles.length>0){s.push("## Doc Files Affected");for(let c of i.docFiles.slice(0,20))s.push(`- ${c}`);s.push("")}if(i.timedOut)s.push("⚠️ Analysis timed out — results may be incomplete. Try with a more specific symbol.");return{title:`omo_impact: ${r.symbol} (${i.totalAffectedFiles} files)`,output:s.join(`
186
- `),metadata:a}}})}function Hm(e){return C({description:"Save a fact, observation, or insight to AgentMemory so it persists across sessions. USE THIS when you learn something worth remembering: a bug pattern, a config quirk, a user preference, a project rule. The system will route the save to AgentMemory's MCP server. Example: omo_remember with content='Always use bun:sqlite, not better-sqlite3' "+"concepts=['storage', 'bun'] — the system will save this to AgentMemory.",args:{content:Z.string().min(1).describe("The fact/observation/lesson to remember"),concepts:Z.array(Z.string()).optional().describe("Tags to categorize this memory (e.g. ['security', 'auth'])"),type:Z.enum(["fact","pattern","observation"]).optional().describe("Type of memory: fact, pattern, or observation")},async execute(r,n){let o=n.sessionID;if(!bt())return{title:"omo_remember: session not initialized",output:"Could not save to AgentMemory: the plugin has not captured the OpenCode session client. Try restarting the plugin or check that the OpenCode session is running.",metadata:{tool:"omo_remember",ok:!1}};let t={content:r.content,concepts:r.concepts??[],type:r.type??"observation"},i=await _t(o,{toolName:"omo_remember",mcpTool:"agentmemory_memory_save",mcpArgs:t,preamble:"Save this to AgentMemory (cross-session persistent memory)."});if(!i.ok)return{title:"omo_remember: failed",output:`Failed to dispatch save to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_remember",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_save",mcpArgs:t});let a=await Zm(o,"agentmemory_memory_save");return{title:`omo_remember: ${a}`,output:`Save to AgentMemory ${a==="delivered"?"verified":a==="expired"?"not delivered within TTL":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_save ${a==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(t)}. It will be available in future sessions via agentmemory_memory_recall.`,metadata:{tool:"omo_remember",ok:!0,messageID:i.messageID,durationMs:i.durationMs,contentLength:r.content.length,deliveryStatus:a}}}})}function Jm(e){return C({description:"Search AgentMemory's cross-session memory (via agentmemory_memory_smart_search). USE THIS for questions that need context from PREVIOUS sessions: 'how did we set up X', 'what was the last approach to Y', 'recall the config for Z'. For current-session recall, prefer omo_recall (local SQLite) instead.",args:{query:Z.string().min(2).describe("The search query"),limit:Z.number().int().min(1).max(20).optional().describe("Max results (default 5)")},async execute(r,n){let o=n.sessionID;if(!bt())return{title:"omo_recall_mcp: session not initialized",output:"Could not search AgentMemory: session client not captured. Use omo_recall for local session memory instead.",metadata:{tool:"omo_recall_mcp",ok:!1}};let t={query:r.query,limit:r.limit??5},i=await _t(o,{toolName:"omo_recall_mcp",mcpTool:"agentmemory_memory_smart_search",mcpArgs:t,preamble:"Search AgentMemory for this query and report the results."});if(!i.ok)return{title:"omo_recall_mcp: failed",output:`Failed to dispatch search to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_recall_mcp",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_smart_search",mcpArgs:t});let a=await Zm(o,"agentmemory_memory_smart_search");return{title:`omo_recall_mcp: ${a}`,output:`Search to AgentMemory ${a==="delivered"?"verified":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_smart_search ${a==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(t)}. Results will appear in the next assistant message.`,metadata:{tool:"omo_recall_mcp",ok:!0,messageID:i.messageID,durationMs:i.durationMs,query:r.query,deliveryStatus:a}}}})}function qm(e){return C({description:"Find the shortest conceptual path between two concepts in the codebase "+"using the graphify knowledge graph. GRAPHIFY TOOL (v0.25.0): concept-level relations live in graphify — "+"codegraph cannot answer these. USE THIS to understand how two apparently unrelated parts of the codebase connect. Example: omo_path with from='auth' to='database' traces the chain from authentication handlers to DB queries.",args:{from:Z.string().min(1).describe("Start concept"),to:Z.string().min(1).describe("End concept")},async execute(r,n){let o=Date.now(),i=await R().invokePath(r.from,r.to,e.cwd,{timeoutMs:8000});return{title:i.kind==="graphify"?"omo_path: path found":"omo_path: unavailable",output:i.result??`No path found between "${r.from}" and "${r.to}". Check if graphify-out/ exists and is up to date.`,metadata:{tool:"omo_path",from:r.from,to:r.to,kind:i.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Km(e){return C({description:"Get a plain-language explanation of a concept from the graphify knowledge graph. "+"GRAPHIFY TOOL (v0.25.0): conceptual overviews live in graphify — codegraph cannot produce them. "+"USE THIS when you encounter an unfamiliar term or module and need a quick overview of what it is and how it fits into the codebase. Example: 'omo_explain SwinTransformer'.",args:{concept:Z.string().min(1).describe("The concept to explain")},async execute(r,n){let o=Date.now(),i=await R().invokeExplain(r.concept,e.cwd,{timeoutMs:8000});return{title:i.kind==="graphify"?"omo_explain: done":"omo_explain: unavailable",output:i.result??`Concept "${r.concept}" not found in the knowledge graph. Run \`graphify . --no-viz\` first.`,metadata:{tool:"omo_explain",concept:r.concept,kind:i.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Xm(e){return C({description:"List files indexed by the codebase graph (codegraph or graphify). USAGE: returns a list of indexed file paths. Use this when you need to discover which files are in the graph before drilling into a specific one.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeFiles(e.cwd,{timeoutMs:5000});if(!i.result)return{title:"omo_files: no index",output:"No indexed files found. If `.codegraph/` doesn't exist, run `npx codegraph init` first. If `graphify-out/` doesn't exist, run `graphify . --no-viz` first.",metadata:{tool:"omo_files",kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_files: ${i.kind??"unknown"} backend`,output:i.result,metadata:{tool:"omo_files",kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Ym(e){return C({description:"List all call sites of a symbol in the codebase graph. USAGE: omo_callers with symbol='UserService.create' returns every file:line "+"where that symbol is called. Codegraph-only — returns null if .codegraph/ is missing.",args:{symbol:Z.string().min(1).describe("The symbol to find callers for (function, class, method, variable)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeCallers(r.symbol,e.cwd,{timeoutMs:5000});if(!i.result)return{title:`omo_callers: ${r.symbol} (no callers or no codegraph)`,output:`No call sites found for "${r.symbol}". Either the symbol is unused, or codegraph is not installed / has no index. Run \`npx codegraph init\` to create the index.`,metadata:{tool:"omo_callers",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_callers: ${r.symbol}`,output:i.result,metadata:{tool:"omo_callers",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Qm(e){return C({description:"Get the source code of a symbol (function/class/method/variable) and its direct callers. USAGE: omo_node with symbol='UserService.create' returns the symbol's definition and "+"every direct call site. Distinct from omo_find (which only returns a definition summary) — "+"this tool returns the full source body. Codegraph-only.",args:{symbol:Z.string().min(1).describe("The symbol to resolve (function, class, method, variable)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeNode(r.symbol,e.cwd,{timeoutMs:5000});if(!i.result)return{title:`omo_node: ${r.symbol} not found`,output:`Symbol "${r.symbol}" was not found in the codegraph index. Run \`npx codegraph init\` if the index doesn't exist, or \`npx codegraph sync\` to refresh.`,metadata:{tool:"omo_node",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_node: ${r.symbol}`,output:i.result,metadata:{tool:"omo_node",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function K(e,r,n,o,t,i){let a=Date.now()-o;if(!n.result)return{title:`${e}: no result`,output:i,metadata:{tool:e,kind:n.kind,durationMs:a,sessionID:t.sessionID,...r}};return{title:e,output:n.result,metadata:{tool:e,kind:n.kind,durationMs:a,sessionID:t.sessionID,...r}}}function ep(e){return C({description:"Get a focused code context window for a given task. USAGE: omo_context with task='validate JWT tokens' returns relevant code blocks (file paths + line ranges). "+"Codegraph-only — returns null if .codegraph/ is missing.",args:{task:Z.string().min(1).describe("The task to extract context for")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeContext(r.task,e.cwd,{timeoutMs:5000});return K("omo_context",{task:r.task},{...i,durationMs:Date.now()-o},o,n,`No context for task "${r.task}". Run \`npx codegraph init\` if the index doesn't exist.`)}})}function tp(e){return C({description:"List files affected by changes in the given source files. USAGE: omo_affected_cg with files=['src/auth.ts'] returns the set of test files, callers, and dependent modules. Codegraph-only.",args:{files:Z.array(Z.string().min(1)).min(1).describe("Source file paths to analyze (relative to cwd)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeAffected(r.files,e.cwd,{timeoutMs:5000});return K("omo_affected_cg",{files:r.files.join(",")},{...i,durationMs:Date.now()-o},o,n,`Could not compute affected files for [${r.files.join(", ")}]. Run \`npx codegraph init\` if needed.`)}})}function rp(e){return C({description:"Show codegraph health: node count, version, last update timestamp. USAGE: omo_status returns a multi-line report. Codegraph-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeStatus(e.cwd,{timeoutMs:5000});return K("omo_status",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed or has no index. Run `npx codegraph init` to create one.")}})}function np(e){return C({description:"Remove a stale codegraph lock file (left behind after a crash). USAGE: omo_unlock clears the lock so the next sync can run. Codegraph-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeUnlock(e.cwd,{timeoutMs:5000});return K("omo_unlock",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function op(e){return C({description:"Mark the codegraph index as dirty so the next sync re-extracts. USAGE: omo_mark_dirty when you know source files changed without git hooks firing.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeMarkDirty(e.cwd,{timeoutMs:5000});return K("omo_mark_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function ip(e){return C({description:"Trigger a codegraph sync ONLY if the graph was previously marked dirty. USAGE: omo_sync_if_dirty is a cheap daily check; omo_status shows the dirty flag.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeSyncIfDirty(e.cwd,{timeoutMs:30000});return K("omo_sync_if_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed or no index exists.")}})}function ap(e){return C({description:"Manually trigger a full codegraph reindex. USAGE: omo_index when you want a guaranteed-fresh graph (bypasses the dirty-flag check).",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeIndex(e.cwd,{timeoutMs:60000});return K("omo_index",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function sp(e){return C({description:"Generate an HTML visualization of the codegraph. USAGE: omo_visualize returns the path to the generated HTML file.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeVisualize(e.cwd,{timeoutMs:30000});return K("omo_visualize",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function cp(e){return C({description:"Start the codegraph HTTP server on the given port. USAGE: omo_serve with port=3030 starts the server in the background. Returns the port + status.",args:{port:Z.number().int().min(1).max(65535).describe("TCP port to bind the codegraph server to")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeServe(r.port,e.cwd,{timeoutMs:5000});return K("omo_serve",{port:r.port},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function lp(e){return C({description:"Remove the codegraph index (.codegraph/) from disk. "+"USAGE: omo_uninit when you want a clean slate — next sync will rebuild from scratch.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeUninit(e.cwd,{timeoutMs:5000});return K("omo_uninit",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function up(e){return C({description:"Diagnose the graphify graph for inconsistencies, multigraph warnings, and stale nodes. USAGE: omo_diagnose returns a JSON-like report. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeDiagnose(e.cwd,{timeoutMs:1e4});return K("omo_diagnose",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed. Run `pip install graphifyy` first.")}})}function dp(e){return C({description:"Run graphify's 3-way merge driver to resolve conflicting graph segments. USAGE: omo_merge_graphs when git reports a conflict in graphify-out/. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeMergeDriver(e.cwd,{timeoutMs:30000});return K("omo_merge_graphs",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function mp(e){return C({description:"Persist the result of the last graphify query to disk for later inspection. USAGE: omo_save_result after omo_explain or omo_path returns a useful output.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeSaveResult(e.cwd,{timeoutMs:5000});return K("omo_save_result",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function pp(e){return C({description:"Re-run graphify's semantic extraction over the entire source tree. USAGE: omo_extract when the graph schema changed and you want a fresh semantic layer.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeExtract(e.cwd,{timeoutMs:60000});return K("omo_extract",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function fp(e){return C({description:"Re-run graphify's clustering step (skip semantic extraction). USAGE: omo_cluster_only after minor node additions to refresh the topic map.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeClusterOnly(e.cwd,{timeoutMs:30000});return K("omo_cluster_only",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function gp(e){return C({description:"Apply a label to a graphify node (e.g. for categorization or human notes). USAGE: omo_label with node='validateToken' applies a label.",args:{node:Z.string().min(1).describe("The graph node to label")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeLabel(r.node,e.cwd,{timeoutMs:5000});return K("omo_label",{node:r.node},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function hp(e){return C({description:"Emit a tree visualization of the graphify graph (hierarchical topic layout). USAGE: omo_tree for a structural overview of the topic map. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeTree(e.cwd,{timeoutMs:1e4});return K("omo_tree",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function vp(e){return C({description:"Clone the graphify graph to a new location. USAGE: omo_clone when forking a project or creating a backup.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeClone(e.cwd,{timeoutMs:30000});return K("omo_clone",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function yp(e){return C({description:"Add specific files to the graphify graph (instead of re-extracting the whole tree). USAGE: omo_add with files='src/auth.ts src/login.ts' after writing new files.",args:{files:Z.string().min(1).describe("Space-separated list of file paths to add (relative to cwd)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeAdd(r.files,e.cwd,{timeoutMs:30000});return K("omo_add",{files:r.files},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function bp(e){return C({description:"Check if the graphify schema or extractors changed since the last extraction. USAGE: omo_check_update to decide if re-extraction is needed. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeCheckUpdate(e.cwd,{timeoutMs:1e4});return K("omo_check_update",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function _p(e){return C({description:"Check whether the graphify post-commit git hook is installed in this project. USAGE: omo_hook_status returns 'installed' or 'missing' along with the hook path. Run after `git init` to confirm the hook is wired.",args:{},async execute(r,n){let o=Date.now(),{isGraphifyHookInstalled:t}=await Promise.resolve().then(() => (Rr(),Uu)),i=await t(e.cwd),a=`${e.cwd}/.git/hooks/post-commit`,s=i?`graphify post-commit hook is INSTALLED at ${a}.`:"graphify post-commit hook is NOT installed. Run `graphify hook install` or enable graphSync in plugin config to install automatically.";return{title:`omo_hook_status: ${i?"installed":"missing"}`,output:s,metadata:{tool:"omo_hook_status",installed:i,hookPath:a,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function eo(e,r,n,o,t,i){let a=Date.now()-o;if(!n.ok)return{title:`${e}: ${n.code}`,output:`${i}
182
+ None found in the indexed graph.`;return{title:`omo_find: ${U.symbol}${z.callers.length>0?` (${z.callers.length} callers)`:""}`,output:`Found definition for "${U.symbol}" (via ${z.kind??"fallback"}).
183
+ `+N+O,metadata:_}}})}function f2($){return Z({description:"Analyze the impact of changing a symbol. Lists direct callers, transitive callers, and affected test/doc files. CODEGRAPH TOOL (v0.25.0): call-graph analysis is codegraph-only. "+"ALWAYS run this BEFORE modifying a function or class — "+"knows what will break. Example: omo_impact with symbol='validateToken' lists every file that calls validateToken and every test that exercises it.",args:{symbol:u.string().min(1).describe("The symbol to analyze (function, class, method)")},async execute(U,b){let r=Date.now(),z=await($.codeGraph??B_()).impact(U.symbol,$.cwd,5000),_={tool:"omo_impact",symbol:U.symbol,kind:z.kind,directCallers:z.directCallers.length,transitiveCallers:z.transitiveCallers.length,testFiles:z.testFiles.length,docFiles:z.docFiles.length,totalAffectedFiles:z.totalAffectedFiles,timedOut:z.timedOut,durationMs:z.durationMs,sessionID:b.sessionID};if(z.totalAffectedFiles===0&&z.directCallers.length===0)return{title:`omo_impact: no callers found for ${U.symbol}`,output:`No call sites found for "${U.symbol}". Either the symbol is unused, or the codegraph index is stale. Run \`npx codegraph sync\` to refresh the index and try again.`,metadata:_};let N=[];if(N.push(`Impact analysis for "${U.symbol}" (via ${z.kind??"fallback"}).
184
+ `),N.push("## Summary"),N.push(`- Direct callers: **${z.directCallers.length}**`),N.push(`- Transitive callers: **${z.transitiveCallers.length}**`),N.push(`- Test files affected: **${z.testFiles.length}**`),N.push(`- Doc files affected: **${z.docFiles.length}**`),N.push(`- Total affected files: **${z.totalAffectedFiles}**
185
+ `),z.directCallers.length>0){N.push("## Direct Callers");for(let O of z.directCallers.slice(0,30))N.push(`- ${O.file}:${O.line}${O.context?` — ${O.context}`:""}`);if(z.directCallers.length>30)N.push(`- ... and ${z.directCallers.length-30} more`);N.push("")}if(z.testFiles.length>0){N.push("## Test Files Affected");for(let O of z.testFiles.slice(0,20))N.push(`- ${O}`);N.push("")}if(z.docFiles.length>0){N.push("## Doc Files Affected");for(let O of z.docFiles.slice(0,20))N.push(`- ${O}`);N.push("")}if(z.timedOut)N.push("⚠️ Analysis timed out — results may be incomplete. Try with a more specific symbol.");return{title:`omo_impact: ${U.symbol} (${z.totalAffectedFiles} files)`,output:N.join(`
186
+ `),metadata:_}}})}function n2($){return Z({description:"Save a fact, observation, or insight to AgentMemory so it persists across sessions. USE THIS when you learn something worth remembering: a bug pattern, a config quirk, a user preference, a project rule. The system will route the save to AgentMemory's MCP server. Example: omo_remember with content='Always use bun:sqlite, not better-sqlite3' "+"concepts=['storage', 'bun'] — the system will save this to AgentMemory.",args:{content:u.string().min(1).describe("The fact/observation/lesson to remember"),concepts:u.array(u.string()).optional().describe("Tags to categorize this memory (e.g. ['security', 'auth'])"),type:u.enum(["fact","pattern","observation"]).optional().describe("Type of memory: fact, pattern, or observation")},async execute(U,b){let r=b.sessionID;if(!jv())return{title:"omo_remember: session not initialized",output:"Could not save to AgentMemory: the plugin has not captured the OpenCode session client. Try restarting the plugin or check that the OpenCode session is running.",metadata:{tool:"omo_remember",ok:!1}};let v={content:U.content,concepts:U.concepts??[],type:U.type??"observation"},z=await Vv(r,{toolName:"omo_remember",mcpTool:"agentmemory_memory_save",mcpArgs:v,preamble:"Save this to AgentMemory (cross-session persistent memory)."});if(!z.ok)return{title:"omo_remember: failed",output:`Failed to dispatch save to AgentMemory: ${z.error??"unknown error"}`,metadata:{tool:"omo_remember",ok:!1,durationMs:z.durationMs}};$.onDispatch?.({sessionID:r,mcpTool:"agentmemory_memory_save",mcpArgs:v});let _=await C2(r,"agentmemory_memory_save");return{title:`omo_remember: ${_}`,output:`Save to AgentMemory ${_==="delivered"?"verified":_==="expired"?"not delivered within TTL":"dispatched"} (messageID: ${z.messageID??"pending"}). LLM call to agentmemory_memory_save ${_==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(v)}. It will be available in future sessions via agentmemory_memory_recall.`,metadata:{tool:"omo_remember",ok:!0,messageID:z.messageID,durationMs:z.durationMs,contentLength:U.content.length,deliveryStatus:_}}}})}function i2($){return Z({description:"Search AgentMemory's cross-session memory (via agentmemory_memory_smart_search). USE THIS for questions that need context from PREVIOUS sessions: 'how did we set up X', 'what was the last approach to Y', 'recall the config for Z'. For current-session recall, prefer omo_recall (local SQLite) instead.",args:{query:u.string().min(2).describe("The search query"),limit:u.number().int().min(1).max(20).optional().describe("Max results (default 5)")},async execute(U,b){let r=b.sessionID;if(!jv())return{title:"omo_recall_mcp: session not initialized",output:"Could not search AgentMemory: session client not captured. Use omo_recall for local session memory instead.",metadata:{tool:"omo_recall_mcp",ok:!1}};let v={query:U.query,limit:U.limit??5},z=await Vv(r,{toolName:"omo_recall_mcp",mcpTool:"agentmemory_memory_smart_search",mcpArgs:v,preamble:"Search AgentMemory for this query and report the results."});if(!z.ok)return{title:"omo_recall_mcp: failed",output:`Failed to dispatch search to AgentMemory: ${z.error??"unknown error"}`,metadata:{tool:"omo_recall_mcp",ok:!1,durationMs:z.durationMs}};$.onDispatch?.({sessionID:r,mcpTool:"agentmemory_memory_smart_search",mcpArgs:v});let _=await C2(r,"agentmemory_memory_smart_search");return{title:`omo_recall_mcp: ${_}`,output:`Search to AgentMemory ${_==="delivered"?"verified":"dispatched"} (messageID: ${z.messageID??"pending"}). LLM call to agentmemory_memory_smart_search ${_==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(v)}. Results will appear in the next assistant message.`,metadata:{tool:"omo_recall_mcp",ok:!0,messageID:z.messageID,durationMs:z.durationMs,query:U.query,deliveryStatus:_}}}})}function l2($){return Z({description:"Find the shortest conceptual path between two concepts in the codebase "+"using the graphify knowledge graph. GRAPHIFY TOOL (v0.25.0): concept-level relations live in graphify — "+"codegraph cannot answer these. USE THIS to understand how two apparently unrelated parts of the codebase connect. Example: omo_path with from='auth' to='database' traces the chain from authentication handlers to DB queries.",args:{from:u.string().min(1).describe("Start concept"),to:u.string().min(1).describe("End concept")},async execute(U,b){let r=Date.now(),z=await m().invokePath(U.from,U.to,$.cwd,{timeoutMs:8000});return{title:z.kind==="graphify"?"omo_path: path found":"omo_path: unavailable",output:z.result??`No path found between "${U.from}" and "${U.to}". Check if graphify-out/ exists and is up to date.`,metadata:{tool:"omo_path",from:U.from,to:U.to,kind:z.kind,durationMs:Date.now()-r,sessionID:b?b.sessionID:"unknown"}}}})}function o2($){return Z({description:"Get a plain-language explanation of a concept from the graphify knowledge graph. "+"GRAPHIFY TOOL (v0.25.0): conceptual overviews live in graphify — codegraph cannot produce them. "+"USE THIS when you encounter an unfamiliar term or module and need a quick overview of what it is and how it fits into the codebase. Example: 'omo_explain SwinTransformer'.",args:{concept:u.string().min(1).describe("The concept to explain")},async execute(U,b){let r=Date.now(),z=await m().invokeExplain(U.concept,$.cwd,{timeoutMs:8000});return{title:z.kind==="graphify"?"omo_explain: done":"omo_explain: unavailable",output:z.result??`Concept "${U.concept}" not found in the knowledge graph. Run \`graphify . --no-viz\` first.`,metadata:{tool:"omo_explain",concept:U.concept,kind:z.kind,durationMs:Date.now()-r,sessionID:b?b.sessionID:"unknown"}}}})}function d2($){return Z({description:"List files indexed by the codebase graph (codegraph or graphify). USAGE: returns a list of indexed file paths. Use this when you need to discover which files are in the graph before drilling into a specific one.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeFiles($.cwd,{timeoutMs:5000});if(!z.result)return{title:"omo_files: no index",output:"No indexed files found. If `.codegraph/` doesn't exist, run `npx codegraph init` first. If `graphify-out/` doesn't exist, run `graphify . --no-viz` first.",metadata:{tool:"omo_files",kind:z.kind,durationMs:Date.now()-r,sessionID:b.sessionID}};return{title:`omo_files: ${z.kind??"unknown"} backend`,output:z.result,metadata:{tool:"omo_files",kind:z.kind,durationMs:Date.now()-r,sessionID:b.sessionID}}}})}function p2($){return Z({description:"List all call sites of a symbol in the codebase graph. USAGE: omo_callers with symbol='UserService.create' returns every file:line "+"where that symbol is called. Codegraph-only — returns null if .codegraph/ is missing.",args:{symbol:u.string().min(1).describe("The symbol to find callers for (function, class, method, variable)")},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeCallers(U.symbol,$.cwd,{timeoutMs:5000});if(!z.result)return{title:`omo_callers: ${U.symbol} (no callers or no codegraph)`,output:`No call sites found for "${U.symbol}". Either the symbol is unused, or codegraph is not installed / has no index. Run \`npx codegraph init\` to create the index.`,metadata:{tool:"omo_callers",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-r,sessionID:b.sessionID}};return{title:`omo_callers: ${U.symbol}`,output:z.result,metadata:{tool:"omo_callers",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-r,sessionID:b.sessionID}}}})}function t2($){return Z({description:"Get the source code of a symbol (function/class/method/variable) and its direct callers. USAGE: omo_node with symbol='UserService.create' returns the symbol's definition and "+"every direct call site. Distinct from omo_find (which only returns a definition summary) — "+"this tool returns the full source body. Codegraph-only.",args:{symbol:u.string().min(1).describe("The symbol to resolve (function, class, method, variable)")},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeNode(U.symbol,$.cwd,{timeoutMs:5000});if(!z.result)return{title:`omo_node: ${U.symbol} not found`,output:`Symbol "${U.symbol}" was not found in the codegraph index. Run \`npx codegraph init\` if the index doesn't exist, or \`npx codegraph sync\` to refresh.`,metadata:{tool:"omo_node",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-r,sessionID:b.sessionID}};return{title:`omo_node: ${U.symbol}`,output:z.result,metadata:{tool:"omo_node",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-r,sessionID:b.sessionID}}}})}function p($,U,b,r,v,z){let _=Date.now()-r;if(!b.result)return{title:`${$}: no result`,output:z,metadata:{tool:$,kind:b.kind,durationMs:_,sessionID:v.sessionID,...U}};return{title:$,output:b.result,metadata:{tool:$,kind:b.kind,durationMs:_,sessionID:v.sessionID,...U}}}function e2($){return Z({description:"Get a focused code context window for a given task. USAGE: omo_context with task='validate JWT tokens' returns relevant code blocks (file paths + line ranges). "+"Codegraph-only — returns null if .codegraph/ is missing.",args:{task:u.string().min(1).describe("The task to extract context for")},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeContext(U.task,$.cwd,{timeoutMs:5000});return p("omo_context",{task:U.task},{...z,durationMs:Date.now()-r},r,b,`No context for task "${U.task}". Run \`npx codegraph init\` if the index doesn't exist.`)}})}function a2($){return Z({description:"List files affected by changes in the given source files. USAGE: omo_affected_cg with files=['src/auth.ts'] returns the set of test files, callers, and dependent modules. Codegraph-only.",args:{files:u.array(u.string().min(1)).min(1).describe("Source file paths to analyze (relative to cwd)")},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeAffected(U.files,$.cwd,{timeoutMs:5000});return p("omo_affected_cg",{files:U.files.join(",")},{...z,durationMs:Date.now()-r},r,b,`Could not compute affected files for [${U.files.join(", ")}]. Run \`npx codegraph init\` if needed.`)}})}function s2($){return Z({description:"Show codegraph health: node count, version, last update timestamp. USAGE: omo_status returns a multi-line report. Codegraph-only.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeStatus($.cwd,{timeoutMs:5000});return p("omo_status",{},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed or has no index. Run `npx codegraph init` to create one.")}})}function $k($){return Z({description:"Remove a stale codegraph lock file (left behind after a crash). USAGE: omo_unlock clears the lock so the next sync can run. Codegraph-only.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeUnlock($.cwd,{timeoutMs:5000});return p("omo_unlock",{},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed.")}})}function vk($){return Z({description:"Mark the codegraph index as dirty so the next sync re-extracts. USAGE: omo_mark_dirty when you know source files changed without git hooks firing.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeMarkDirty($.cwd,{timeoutMs:5000});return p("omo_mark_dirty",{},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed.")}})}function Uk($){return Z({description:"Trigger a codegraph sync ONLY if the graph was previously marked dirty. USAGE: omo_sync_if_dirty is a cheap daily check; omo_status shows the dirty flag.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeSyncIfDirty($.cwd,{timeoutMs:30000});return p("omo_sync_if_dirty",{},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed or no index exists.")}})}function bk($){return Z({description:"Manually trigger a full codegraph reindex. USAGE: omo_index when you want a guaranteed-fresh graph (bypasses the dirty-flag check).",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeIndex($.cwd,{timeoutMs:60000});return p("omo_index",{},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function rk($){return Z({description:"Generate an HTML visualization of the codegraph. USAGE: omo_visualize returns the path to the generated HTML file.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeVisualize($.cwd,{timeoutMs:30000});return p("omo_visualize",{},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed.")}})}function zk($){return Z({description:"Start the codegraph HTTP server on the given port. USAGE: omo_serve with port=3030 starts the server in the background. Returns the port + status.",args:{port:u.number().int().min(1).max(65535).describe("TCP port to bind the codegraph server to")},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeServe(U.port,$.cwd,{timeoutMs:5000});return p("omo_serve",{port:U.port},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function _k($){return Z({description:"Remove the codegraph index (.codegraph/) from disk. "+"USAGE: omo_uninit when you want a clean slate — next sync will rebuild from scratch.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeUninit($.cwd,{timeoutMs:5000});return p("omo_uninit",{},{...z,durationMs:Date.now()-r},r,b,"codegraph is not installed.")}})}function Nk($){return Z({description:"Diagnose the graphify graph for inconsistencies, multigraph warnings, and stale nodes. USAGE: omo_diagnose returns a JSON-like report. Graphify-only.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeDiagnose($.cwd,{timeoutMs:1e4});return p("omo_diagnose",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed. Run `pip install graphifyy` first.")}})}function Ok($){return Z({description:"Run graphify's 3-way merge driver to resolve conflicting graph segments. USAGE: omo_merge_graphs when git reports a conflict in graphify-out/. Graphify-only.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeMergeDriver($.cwd,{timeoutMs:30000});return p("omo_merge_graphs",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function kk($){return Z({description:"Persist the result of the last graphify query to disk for later inspection. USAGE: omo_save_result after omo_explain or omo_path returns a useful output.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeSaveResult($.cwd,{timeoutMs:5000});return p("omo_save_result",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function Ik($){return Z({description:"Re-run graphify's semantic extraction over the entire source tree. USAGE: omo_extract when the graph schema changed and you want a fresh semantic layer.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeExtract($.cwd,{timeoutMs:60000});return p("omo_extract",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function Jk($){return Z({description:"Re-run graphify's clustering step (skip semantic extraction). USAGE: omo_cluster_only after minor node additions to refresh the topic map.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeClusterOnly($.cwd,{timeoutMs:30000});return p("omo_cluster_only",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function Xk($){return Z({description:"Apply a label to a graphify node (e.g. for categorization or human notes). USAGE: omo_label with node='validateToken' applies a label.",args:{node:u.string().min(1).describe("The graph node to label")},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeLabel(U.node,$.cwd,{timeoutMs:5000});return p("omo_label",{node:U.node},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function Kk($){return Z({description:"Emit a tree visualization of the graphify graph (hierarchical topic layout). USAGE: omo_tree for a structural overview of the topic map. Graphify-only.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeTree($.cwd,{timeoutMs:1e4});return p("omo_tree",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function wk($){return Z({description:"Clone the graphify graph to a new location. USAGE: omo_clone when forking a project or creating a backup.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeClone($.cwd,{timeoutMs:30000});return p("omo_clone",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function Qk($){return Z({description:"Add specific files to the graphify graph (instead of re-extracting the whole tree). USAGE: omo_add with files='src/auth.ts src/login.ts' after writing new files.",args:{files:u.string().min(1).describe("Space-separated list of file paths to add (relative to cwd)")},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeAdd(U.files,$.cwd,{timeoutMs:30000});return p("omo_add",{files:U.files},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function Yk($){return Z({description:"Check if the graphify schema or extractors changed since the last extraction. USAGE: omo_check_update to decide if re-extraction is needed. Graphify-only.",args:{},async execute(U,b){let r=Date.now(),z=await($.graphRetrieval??m()).invokeCheckUpdate($.cwd,{timeoutMs:1e4});return p("omo_check_update",{},{...z,durationMs:Date.now()-r},r,b,"graphify is not installed.")}})}function Wk($){return Z({description:"Check whether the graphify post-commit git hook is installed in this project. USAGE: omo_hook_status returns 'installed' or 'missing' along with the hook path. Run after `git init` to confirm the hook is wired.",args:{},async execute(U,b){let r=Date.now(),{isGraphifyHookInstalled:v}=await Promise.resolve().then(() => (m4(),mN)),z=await v($.cwd),_=`${$.cwd}/.git/hooks/post-commit`,N=z?`graphify post-commit hook is INSTALLED at ${_}.`:"graphify post-commit hook is NOT installed. Run `graphify hook install` or enable graphSync in plugin config to install automatically.";return{title:`omo_hook_status: ${z?"installed":"missing"}`,output:N,metadata:{tool:"omo_hook_status",installed:z,hookPath:_,durationMs:Date.now()-r,sessionID:b.sessionID}}}})}function a6($,U,b,r,v,z){let _=Date.now()-r;if(!b.ok)return{title:`${$}: ${b.code}`,output:`${z}
187
187
 
188
- Diagnostic: ${n.code}
189
- stderr: ${n.stderr||"(empty)"}`,metadata:{tool:e,code:n.code,durationMs:a,sessionID:t.sessionID,...r}};let s=n.data!==null&&n.data!==void 0?typeof n.data==="string"?n.data:JSON.stringify(n.data,null,2):n.rawOutput??"";return{title:e,output:s,metadata:{tool:e,code:n.code,durationMs:a,sessionID:t.sessionID,...r}}}function kp(e){return C({description:"Install a CLI from the CLI-Anything hub so the agent can drive that software. USAGE: omo_cli_anything_install with name='gimp' installs `cli-anything-gimp`, which exposes a `cli-anything-gimp` command. Browse the catalog with omo_cli_anything_list. See https://github.com/HKUDS/CLI-Anything for the full registry.",args:{name:Z.string().min(1).describe("The CLI name to install (e.g. 'gimp', 'blender', 'drawio')")},async execute(r,n){let o=Date.now(),{installCli:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t(r.name,e.runner,120000,"cli-hub");return eo("omo_cli_anything_install",{name:r.name},{...i,durationMs:Date.now()-o},o,n,`Could not install '${r.name}'. Check that cli-anything-hub is installed (omo_health) and the name is correct.`)}})}function $p(e){return C({description:"List all CLIs available in the CLI-Anything hub (40+ GUI software harnesses). USAGE: omo_cli_anything_list with category='image' returns only image-related CLIs. Returns JSON with name, version, description, category, install_cmd, entry_point. See https://github.com/HKUDS/CLI-Anything.",args:{category:Z.string().optional().describe("Optional category filter (e.g. 'image', 'devops', '3d', 'audio')"),source:Z.enum(["harness","public","npm","all"]).optional().describe("Optional source filter. 'all' includes harness + public + npm.")},async execute(r,n){let o=Date.now(),{listClis:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t({category:r.category,source:r.source},e.runner,30000,"cli-hub");return eo("omo_cli_anything_list",{category:r.category,source:r.source},{...i,durationMs:Date.now()-o},o,n,"Could not list CLIs from the hub. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function xp(e){return C({description:"Search the CLI-Anything hub for CLIs matching a query (name, description, or category). USAGE: omo_cli_anything_search with query='cad' returns CAD-related CLIs. Returns JSON array. See https://github.com/HKUDS/CLI-Anything.",args:{query:Z.string().min(1).describe("Search query (matches name, description, or category)")},async execute(r,n){let o=Date.now(),{searchClis:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t(r.query,e.runner,30000,"cli-hub");return eo("omo_cli_anything_search",{query:r.query},{...i,durationMs:Date.now()-o},o,n,"Search failed. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function wp(e){return C({description:"Show details for a specific CLI in the CLI-Anything hub. USAGE: omo_cli_anything_info with name='blender' returns display name, version, description, requirements (e.g. 'blender (apt install blender)'), entry point, install command. See https://github.com/HKUDS/CLI-Anything.",args:{name:Z.string().min(1).describe("The CLI name to look up")},async execute(r,n){let o=Date.now(),{infoCli:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t(r.name,e.runner,1e4,"cli-hub");return eo("omo_cli_anything_info",{name:r.name},{...i,durationMs:Date.now()-o},o,n,`Could not find '${r.name}' in the hub. Try omo_cli_anything_search to find similar names.`)}})}class Sp{client=null;defaultTimeoutMs;toolCache=null;constructor(e={}){this.defaultTimeoutMs=e.defaultTimeoutMs??5000}setClient(e){this.client=e,this.toolCache=null}isReady(){return this.client!==null}async callTool(e,r={},n){let o=Date.now(),t=n??this.defaultTimeoutMs;if(!this.client)return{data:null,timedOut:!1,durationMs:Date.now()-o,error:"MCP client not initialized"};try{let a=(await this.raceWithTimeout(this.client.tool.invoke({toolID:e,input:r}),t,e)).data;return{data:a&&typeof a==="object"&&!Array.isArray(a)?a:null,timedOut:!1,durationMs:Date.now()-o,error:null}}catch(i){return{data:null,timedOut:i instanceof Error&&/timed out/i.test(i.message),durationMs:Date.now()-o,error:i instanceof Error?i.message:String(i)}}}async isAvailable(e){if(!this.client)return!1;if(this.toolCache===null)try{let r=await this.client.tool.list();this.toolCache=new Set((r.data??[]).map((n)=>n.id))}catch{this.toolCache=new Set}return this.toolCache.has(e)}async availableTools(){if(!this.client)return[];if(this.toolCache===null)await this.isAvailable("__bootstrap__");return Array.from(this.toolCache??new Set)}invalidateCache(){this.toolCache=null}raceWithTimeout(e,r,n){return new Promise((o,t)=>{let i=setTimeout(()=>{t(Error(`${n} timed out after ${r}ms`))},r);e.then((a)=>{clearTimeout(i),o(a)},(a)=>{clearTimeout(i),t(a)})})}}var zl=null;function Ip(){if(!zl)zl=new Sp;return zl}Qn();class Cl{entries=new Map;deliveredCount=0;expiredCount=0;register(e){this.cleanup();let r=`deliv-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,n=Tp(e.mcpArgs);return this.entries.set(r,{id:r,sessionID:e.sessionID,mcpTool:e.mcpTool,mcpArgsHash:n,registeredAt:Date.now(),ttlMs:e.ttlMs??1e4}),r}markDelivered(e){this.cleanup();let r=e.mcpArgs?Tp(e.mcpArgs):null;for(let[n,o]of this.entries){if(o.sessionID!==e.sessionID)continue;if(o.mcpTool!==e.mcpTool)continue;if(r!==null&&o.mcpArgsHash!==r)continue;return this.entries.delete(n),this.deliveredCount++,n}return null}async awaitDelivery(e){let r=e.timeoutMs??2000,n=Date.now();while(Date.now()-n<r){if(this.cleanup(),![...this.entries.values()].find((t)=>t.sessionID===e.sessionID&&t.mcpTool===e.mcpTool))return"delivered";await zb(50)}return"expired"}getStats(){return{pending:this.entries.size,delivered:this.deliveredCount,expired:this.expiredCount}}clearSession(e){for(let[r,n]of this.entries)if(n.sessionID===e)this.entries.delete(r)}cleanup(){let e=Date.now();for(let[r,n]of this.entries)if(e-n.registeredAt>n.ttlMs)this.entries.delete(r),this.expiredCount++}}function Tp(e){return JSON.stringify(e,Object.keys(e).sort())}function zb(e){return new Promise((r)=>setTimeout(r,e))}Dr();import{resolve as qp}from"node:path";import{homedir as t_}from"node:os";import{readFileSync as Cb}from"node:fs";import{dirname as Eb,resolve as jb}from"node:path";import{fileURLToPath as Ab}from"node:url";var Op="0.0.0";try{let e=Eb(Ab(import.meta.url)),r=jb(e,"..","package.json"),n=JSON.parse(Cb(r,"utf8"));if(typeof n.version==="string"&&n.version.length>0)Op=n.version}catch{}var be=Op,Dp=["decisions_taken","decisions_skipped_continue","decisions_skipped_no_decision","decisions_skipped_no_message","decisions_skipped_below_threshold","interventions_delivered","interventions_disabled_done","interventions_disabled_cap","decisions_stored","plan_reminders_injected","bot_feedback_injected","violations_injected","protocol_audits_passed","protocol_violations_detected","git_commit_reindex","orchestrator_runs","orchestrator_errors"];function Pp(){let e={};for(let r of Dp)e[r]={count:0,lastOccurrenceISO:null};return e}var Mb=Pp(),gw=new Date().toISOString();function zp(e){let r=e??{},n=Pp(),o=new Date().toISOString(),t=r.version??be,i=r.global===!0;return{inc(a){let s=n[a];if(!s)return;if(s.count++,s.lastOccurrenceISO=new Date().toISOString(),i){let c=Mb[a];if(c)c.count++,c.lastOccurrenceISO=s.lastOccurrenceISO}},getMetrics(){return{version:t,sessionID:r.sessionID??"",startedAtISO:o,uptimeMs:Date.now()-new Date(o).getTime(),counters:{...n}}},reset(){for(let a of Dp)n[a]={count:0,lastOccurrenceISO:null}}}}function Ml(e){let r={enabled:!1,...e},n=Do(),o=Po(),t=Ur();return{enabled:r.enabled===!0,memory:{enabled:!0,query:r.memory?.query??"meta_governor_context",timeoutMs:r.memory?.timeoutMs??r.memory?.agentmemoryTimeoutMs??2000},tokenPredictor:{compactBurnRateThreshold:r.tokenPredictor?.compactBurnRateThreshold??500,compactUsageThreshold:r.tokenPredictor?.compactUsageThreshold??0.85,switchModelUsageThreshold:r.tokenPredictor?.switchModelUsageThreshold??0.95,delegateConsecutiveHighBurn:r.tokenPredictor?.delegateConsecutiveHighBurn??5},scoring:{...n,...r.scoring?.continueThreshold!==void 0?{continueThreshold:r.scoring.continueThreshold}:{},...r.scoring?.warnThreshold!==void 0?{warnThreshold:r.scoring.warnThreshold}:{},...r.scoring?.escalateThreshold!==void 0?{escalateThreshold:r.scoring.escalateThreshold}:{},...r.scoring?.stopThreshold!==void 0?{stopThreshold:r.scoring.stopThreshold}:{},...r.scoring?.paralysisThreshold!==void 0?{paralysisThreshold:r.scoring.paralysisThreshold}:{},...r.scoring?.defaultEscalationTarget!==void 0?{defaultEscalationTarget:r.scoring.defaultEscalationTarget}:{}},closedLoop:{...t,...r.closedLoop?.enabled!==void 0?{enabled:r.closedLoop.enabled}:{},...r.closedLoop?.minSeverityToLearn!==void 0?{minSeverityToLearn:r.closedLoop.minSeverityToLearn}:{},...r.closedLoop?.maxLessonsPerSession!==void 0?{maxLessonsPerSession:r.closedLoop.maxLessonsPerSession}:{},...r.closedLoop?.saveDecisions!==void 0?{saveDecisions:r.closedLoop.saveDecisions}:{},...r.closedLoop?.saveLessons!==void 0?{saveLessons:r.closedLoop.saveLessons}:{}},decision:{...o,...r.decision?.maxHistoryPerSession!==void 0?{maxHistoryPerSession:r.decision.maxHistoryPerSession}:{},...r.decision?.forceContinueAfterStops!==void 0?{forceContinueAfterStops:r.decision.forceContinueAfterStops}:{},...r.decision?.warnMessageTemplate!==void 0?{warnMessageTemplate:r.decision.warnMessageTemplate}:{},...r.decision?.escalateMessageTemplate!==void 0?{escalateMessageTemplate:r.decision.escalateMessageTemplate}:{},...r.decision?.stopMessageTemplate!==void 0?{stopMessageTemplate:r.decision.stopMessageTemplate}:{}},modelOverride:r.modelOverride?{providerID:r.modelOverride.providerID,modelID:r.modelOverride.modelID,modelLimit:r.modelOverride.modelLimit,temperature:r.modelOverride.temperature??0.2,topP:r.modelOverride.topP??1,maxTokens:r.modelOverride.maxTokens??2048,reasoning:r.modelOverride.reasoning??!1,verbosity:r.modelOverride.verbosity??"minimal"}:void 0,intervention:{mode:r.intervention?.mode??"silent",includeDecisionHistory:r.intervention?.includeDecisionHistory??!0,maxHistoryMessages:r.intervention?.maxHistoryMessages??5,minActionForMessage:r.intervention?.minActionForMessage??"stop",maxInterventionsPerSession:r.intervention?.maxInterventionsPerSession??3,respectDoneSignal:r.intervention?.respectDoneSignal??!0,phaseAwareDoneSignal:r.intervention?.phaseAwareDoneSignal??!1,persistToSession:r.intervention?.persistToSession??!0},postWave:{enabled:r.postWave?.enabled??r.intervention?.phaseAwareDoneSignal===!0,repoMode:r.postWave?.repoMode??"auto",aasToolPrefix:r.postWave?.aasToolPrefix??"aas",ciTimeoutMs:r.postWave?.ciTimeoutMs??600000,maxRetriesPerWave:r.postWave?.maxRetriesPerWave??1,reinjectCooldownMs:r.postWave?.reinjectCooldownMs??60000,respectSilentMode:r.postWave?.respectSilentMode??!1,...r.postWave?.ownRepoDirective!==void 0?{ownRepoDirective:r.postWave.ownRepoDirective}:{},...r.postWave?.thirdPartyDirective!==void 0?{thirdPartyDirective:r.postWave.thirdPartyDirective}:{}},protocolEnforcement:{enabled:r.protocolEnforcement?.enabled??!1,path:r.protocolEnforcement?.path,injectIntoSystem:r.protocolEnforcement?.injectIntoSystem??!1,auditToolCalls:r.protocolEnforcement?.auditToolCalls??!1},skillPriming:{enabled:r.skillPriming?.enabled??!1,trigger:r.skillPriming?.trigger??"firstImplement",router:r.skillPriming?.router??"both"},graphSync:{killOrphanedOnInit:r.graphSync?.killOrphanedOnInit??!0,reindexOnFetch:r.graphSync?.reindexOnFetch!==!1,fetchBranch:r.graphSync?.fetchBranch??"main",autoUpgrade:r.graphSync?.autoUpgrade!==!1,upgradeCachePath:r.graphSync?.upgradeCachePath,checkGraphifyNeedsUpdate:r.graphSync?.checkGraphifyNeedsUpdate!==!1,addToGlobalGraph:r.graphSync?.addToGlobalGraph===!0},graphRetrieval:{preferredTool:r.graphRetrieval?.preferredTool??"auto",preferLocalCodegraph:r.graphRetrieval?.preferLocalCodegraph===!0,contextRouting:r.graphRetrieval?.contextRouting===!0},cliAnything:{enabled:r.cliAnything?.enabled!==!1,autoInstall:r.cliAnything?.autoInstall!==!1,autoUpgrade:r.cliAnything?.autoUpgrade!==!1,cachePath:r.cliAnything?.cachePath,upgradeCheckTtlMs:r.cliAnything?.upgradeCheckTtlMs,cliHubBin:r.cliAnything?.cliHubBin??"cli-hub",skillsBin:r.cliAnything?.skillsBin??"npx skills",installScope:r.cliAnything?.installScope??"global"}}}function xw(e){if(!e)return!1;if(e.enabled===!0)return!0;return e.meta_governor?.enabled===!0}async function ww(e={}){let{loadMetaGovernorConfig:r}=await Promise.resolve().then(() => (Al(),Np)),n=await r(e);return Ml(n.config)}Al();var Qe=new Map;function Up(e,r){Qe.set(e,r)}function Le(e){let r=Qe.get(e);if(r!==void 0)Qe.delete(e);return r}function Iw(e){return Qe.has(e)}function Tw(){for(let[e,r]of Qe)return Qe.delete(e),r;return}function Ow(){Qe.clear()}class Rl{store=new Map;maxEntries;ttlMs;now;constructor(e={}){this.maxEntries=e.maxEntries??100,this.ttlMs=e.ttlMs??3600000,this.now=e.now??Date.now}get(e){let r=this.store.get(e);if(!r)return;let n=this.now();if(r.expiresAtMs<=n){this.store.delete(e);return}return r.lastAccessAtMs=n,r.value}has(e){return this.get(e)!==void 0}set(e,r){let n=this.now();if(!this.store.has(e)&&this.store.size>=this.maxEntries)this.evictOldest();this.store.set(e,{value:r,expiresAtMs:n+this.ttlMs,lastAccessAtMs:n})}delete(e){return this.store.delete(e)}size(){return this.store.size}clear(){this.store.clear()}evictOldest(){let e,r=1/0;for(let[n,o]of this.store)if(o.lastAccessAtMs<r)r=o.lastAccessAtMs,e=n;if(e!==void 0)this.store.delete(e)}}import{statSync as r_,readFileSync as Kp}from"node:fs";import{execSync as n_}from"node:child_process";import{join as Bp}from"node:path";import{readFile as Gb}from"node:fs/promises";import{resolve as Vb}from"node:path";import{homedir as Wb}from"node:os";var Nl=Vb(Wb(),".config","opencode","sisyphus-mandatory","sisyphus-mandatory.md");async function Lp(e){return await Gb(e??Nl,"utf-8")}function Ul(e,r){let n=r?.oracleVerified===!0,o=r?.filesChanged??0,t=["","## Sisyphus Protocol Enforcement","","You MUST follow these Sisyphus protocol rules:","","1. **Pre-response Memory Check**: Before any action, read `<project-memory>` and `<session-history-since>` blocks in context. Cite `<memory id>` for any fact used from memory. Do not ask questions whose answers are in those blocks.","","2. **Codebase Graph First**: Before using grep/glob/read for architecture or symbol queries, check whether `.codegraph/` or `graphify-out/` exists. If so, use codegraph/graphify tools first, then grep/read only as last resort.","","3. **Tool Routing Table**: Match common intents to the correct tool:",' - "we did this before" / "you should know" → `agentmemory_memory_recall`'," - Starting a task that resembles a previous one → `agentmemory_memory_smart_search`"," - Before asking the user a clarifying question → `agentmemory_memory_recall` first"," - Save durable insight/decision/rule → `agentmemory_memory_save`",""];if(/\boracle\b/i.test(e)&&!(n&&o>0))t.push("4. **Post-task Oracle Verification**: If files touched >= 3 OR any INVOKE trigger matches, invoke Oracle with the exact format:",' `task(subagent_type="oracle", run_in_background=false, prompt="Verify: ...")`'," - INVOKE triggers: created 1+ new file, modified abstraction, touched security/auth paths, modified DB/persistence, modified CI/CD, added/removed dependency, modified perf-critical path, todo had 2+ completed items."," - SKIP only when: files touched <= 2, no new file, no dependency change, single-step task, change is typo/comment/rename only."," - Verdict: PASS → done. FAIL/CONDITIONAL → fix and re-invoke. Max 3 invocations."," - Cost: Max 3 oracle invocations per task. Skip rate: Must NOT skip Oracle on 2+ file change.","");return t.push("5. **Parallel Query Rule**: Fire independent tool queries in the same turn. Do NOT serialize independent memory/context queries.","","6. **Empty-Result Escalation**: On empty `agentmemory_memory_recall`, fire `agentmemory_memory_smart_search` + `agentmemory_memory_export` before asking the user.","","7. **Hard Rules (No Exceptions)**:"," - Do NOT ask 'where is X?' if memory or session record already contains it."," - Do NOT claim 'I don't know' before firing at least 2 different recall tools."," - Do NOT re-issue clarifying questions whose answer is in `<project-memory>` or `<session-history-since>`."," - Do NOT suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`."," - Do NOT leave empty catch blocks `catch(e) {}`.",' - Do NOT start a fresh agent via `task()` when `task(task_id="ses_...")` (continuation) exists — use continuation IDs.'," - Do NOT batch-complete todos — mark each one `completed` immediately after finishing."," - Do NOT skip creating todos for multi-step tasks.","","8. **Self-Check Before Responding**:"," - Verify you read `<project-memory>` and `<session-history-since>` blocks."," - Verify you cited `<memory id>` for any fact used from memory."," - Verify you did not ask a question whose answer is in those blocks."," - For multi-file changes, verify Oracle was invoked."," - For codebase exploration, verify codegraph/graphify was tried before grep/read."," - After discovering something non-obvious, save it with `agentmemory_memory_save` so future sessions benefit."," - Do NOT save routine operations (file reads, greps, list commands), trivial decisions, or facts already covered by existing memory. Save only novel insights, non-obvious patterns, or corrections to previous assumptions.","","9. **CI Verification Loop (NON-NEGOTIABLE)**: After EVERY step of an implementation plan that produces a code change you intend to keep, you MUST execute the full CI loop BEFORE moving to the next step:"," a. Commit the changes atomically (one commit per verified increment, never omnibus)."," b. Push to the remote that has CI configured (own repo: `git push origin <branch>`. Fork upstream: `git push fork <branch>` + open/update PR)."," c. Wait for the CI run triggered by the push to reach a terminal state (`gh run watch <run-id> --exit-status`).",' d. Assert `conclusion == "success"` on EVERY job. If any job fails, fix the regression, re-push, and re-verify until all jobs are green.'," e. Capture the green run-id so the final plan-completion message can cite it as evidence."," - Anti-pattern this rule kills: running local tests, seeing 0 failures, declaring done, then shipping the next step on top of an unverified CI. Local green is NOT CI green. Pushed-not-watched is NOT CI green."," - At the END of the plan (when the last step is done), run a final guarantee: `gh run list --branch <branch> --limit 5` and assert EVERY recent run on this branch has `conclusion=success`. If any run shows `failure`, surface it explicitly to the user with the run-id, the failing job, and the log excerpt - do NOT claim plan success."," - For fork -> upstream PR workflow: verify the workflow_run on the upstream repo (the PR's head ref), not just the fork. Both must be green."," - This rule applies whenever the repo has a `.github/workflows/*.yml` file (or equivalent CI config). For repos without CI, document the absence explicitly."," - If the user explicitly says 'skip CI' or 'local only', this rule is suppressed for that turn ONLY - re-engage on next step.",""),t.join(`
190
- `)}function Zp(e,r,n){let o=[],t=n.recentToolCalls??[],i=n.recentWriteContents??[],a=n.memorySaved??!1,s=n.batchCompletions??0;if((e==="grep"||e==="glob")&&(n.hasCodegraphDir||n.hasGraphifyDir)){let u=n.hasCodegraphDir?".codegraph":"graphify-out";o.push({rule:"codebase-graph-first",tool:e,severity:"media",detail:`Used ${e} when ${u} exists — should use codegraph/graphify first for architecture and symbol queries.`})}if(e==="task"&&r&&typeof r==="object"){let u=r;if(!u.task_id&&typeof u.prompt==="string"&&t.length>3)o.push({rule:"continuation-discipline",tool:e,severity:"leve",detail:`Started a new task() without task(task_id="ses_...") continuation ID. Use task_id to preserve the subagent's full context and save tokens.`})}let c=["write","edit","edit_block","desktop-commander_edit_block","desktop-commander_write_file"];if(c.includes(e)){let u=typeof r==="object"&&r!==null?JSON.stringify(r):String(r??""),y=/@ts-ignore|@ts-expect-error/.test(u),x=/\bas any\b/.test(u);if(y&&x)o.push({rule:"no-type-suppression",tool:e,severity:"grave",detail:"File write contains both @ts-ignore/@ts-expect-error AND 'as any' — double type suppression. "+"Both are forbidden by the Sisyphus protocol."});else if(y)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains @ts-ignore or @ts-expect-error — both are forbidden. "+"Fix the underlying type error instead."});else if(x)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains 'as any' — type suppression forbidden. "+"Use proper type narrowing instead."})}if(c.includes(e)){let u=typeof r==="object"&&r!==null?JSON.stringify(r):String(r??"");if(/catch\s*\(\s*\w+\s*\)\s*\{\s*\}/.test(u))o.push({rule:"no-empty-catch",tool:e,severity:"media",detail:"Empty catch block detected — `catch(e) {}` is forbidden. "+"Log the error or handle it gracefully."})}if(["codegraph_explore","graphify query"].includes(e)&&t.length>=2){if(!a)o.push({rule:"save-discovery-to-memory",tool:e,severity:"leve",detail:`Used ${e} to discover code but no memory save was made afterwards. Save non-obvious findings with agentmemory_memory_save so future sessions benefit.`})}if(s>0&&e!=="todowrite")o.push({rule:"no-batch-todo-completion",tool:e,severity:"leve",detail:"Batch todo completion detected. Each todo must be marked `completed` immediately "+"after finishing — do not batch-complete multiple items."});if(n.emptyRecall&&!n.escalationAttempted){if(e.startsWith("question")||e==="ask")o.push({rule:"empty-result-escalation",tool:e,severity:"grave",detail:"Memory recall returned empty but agent did not fire smart_search + export before asking the user. Steps 1-3 of empty-result escalation protocol are mandatory."})}let d=["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"];if(!n.memoryToolsUsed.some((u)=>d.some((y)=>u.startsWith(y)))&&(e.startsWith("question")||e==="ask"))o.push({rule:"memory-first",tool:e,severity:"grave",detail:"Asked a question without first querying memory. Must fire agentmemory_memory_recall or agentmemory_memory_smart_search before asking the user."});let h=["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block","apply_patch"];if(n.filesChanged>=3&&!n.oracleInvoked&&h.includes(e))o.push({rule:"oracle-verification",tool:e,severity:"media",detail:`Files changed (${n.filesChanged}) >= 3 but Oracle was not invoked. The POST-TASK ORACLE VERIFICATION protocol requires Oracle invocation on multi-file changes.`});return o}var Ll=["write","edit","edit_block","multi_edit","apply_patch","ast_grep_replace","refactor","desktop-commander_write_file","desktop-commander_edit_block"],Bb=["brainstorming","writing-plans","test-driven-development","systematic-debugging","subagent-driven-development"];function Fp(e){let r=["[SKILL PRIMING] This session involves implementation work. Select precise skills for this task before writing code:"],n=1;if(e==="aas"||e==="both")r.push(`${n}. Query the AAS skill catalog (aas search_skills) for the 2-3 capabilities most relevant to this task (e.g. testing, architecture, language-specific), and compare candidates with aas get_skill.`),n++,r.push(`${n}. If 2+ viable candidates exist, compose a minimal stack (<= 3 skills) with aas compose_stack.`),n++;if(e==="superpowers"||e==="both")r.push(`${n}. If a matching superpowers skill is available and not yet active (${Bb.join(" / ")}), load it via the skill tool.`),n++;if(e==="both")r.push("If a superpowers skill is already active, skip the catalog step.");return r.push("Do NOT enumerate the full catalog — keep the stack minimal and task-specific."),r.join(`
191
- `)}function Gp(e){if(e.trigger==="sessionStart")return!0;if(e.implementationToolSeen)return!0;return e.recentToolCalls.some((r)=>Ll.includes(r))}Rr();var Hp={continue:0,warn:1,escalate:2,stop:3};function Zl(e,r){return Hp[e]>=Hp[r]}function o_(e){let r=e.args;if(!r||typeof r!=="object")return null;let n=["pattern","query","path","glob","regex","include_pattern"];for(let o of n){let t=r[o];if(typeof t==="string"&&t.trim().length>0)return t.trim()}return null}var i_=zp({sessionID:"__global__",global:!0,version:be}),a_=qp(t_(),".config","opencode","meta-governor-health.json");function Xp(e={},r={}){let n=R(),o=new Cl;Lm(o);let t=process.cwd(),i=Lr(),a=Fm({graphRetrieval:n,cwd:t}),s=Gm({sqlite:i}),c=Vm({metrics:i_,logFilePath:pe,healthFilePath:a_}),l=Wm({cwd:t}),d=Bm({cwd:t}),v=Hm({onDispatch:({sessionID:re,mcpTool:de,mcpArgs:xe})=>{o.register({sessionID:re,mcpTool:de,mcpArgs:xe})}}),h=Jm({onDispatch:({sessionID:re,mcpTool:de,mcpArgs:xe})=>{o.register({sessionID:re,mcpTool:de,mcpArgs:xe})}}),u=qm({cwd:t}),y=Km({cwd:t}),x=Xm({graphRetrieval:n,cwd:t}),j=Ym({graphRetrieval:n,cwd:t}),A=Qm({graphRetrieval:n,cwd:t}),G=ep({graphRetrieval:n,cwd:t}),N=tp({graphRetrieval:n,cwd:t}),X=rp({graphRetrieval:n,cwd:t}),he=np({graphRetrieval:n,cwd:t}),kt=op({graphRetrieval:n,cwd:t}),Gl=ip({graphRetrieval:n,cwd:t}),Vl=ap({graphRetrieval:n,cwd:t}),Wl=sp({graphRetrieval:n,cwd:t}),Bl=cp({graphRetrieval:n,cwd:t}),Hl=lp({graphRetrieval:n,cwd:t}),Jl=up({graphRetrieval:n,cwd:t}),ql=dp({graphRetrieval:n,cwd:t}),Kl=mp({graphRetrieval:n,cwd:t}),Xl=pp({graphRetrieval:n,cwd:t}),Yl=fp({graphRetrieval:n,cwd:t}),Ql=gp({graphRetrieval:n,cwd:t}),eu=hp({graphRetrieval:n,cwd:t}),tu=vp({graphRetrieval:n,cwd:t}),ru=yp({graphRetrieval:n,cwd:t}),nu=bp({graphRetrieval:n,cwd:t}),ou=_p({cwd:t}),iu=kp({cwd:t}),au=$p({cwd:t}),su=xp({cwd:t}),cu=wp({cwd:t});T("info",`v${be} MetaGovernor plugin loaded`,{version:be,build:"0.19.5-instr",cwd:t,projectHasCodegraph:n.hasCodegraphDir(t),projectHasGraphify:n.hasGraphifyDir(t)});let lu="?";try{let de=e_(import.meta.url),xe=Kp(de);lu=Qb("sha256").update(xe).digest("hex").slice(0,8)}catch{}return console.log(`[meta-governor] v${be} loaded (bundle: ${lu})`),(async()=>{try{let{execSync:re}=await import("node:child_process"),de=re("npm view @herjarsa/omo-meta-governor version",{timeout:5000,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(de&&de!==be)T("warn",`STALE_CACHE: loaded v${be} but npm has v${de}. Run: npm cache clean --force && rm -rf ~/.cache/opencode/packages/@herjarsa/omo-meta-governor*`)}catch{}})(),async(re,de)=>{T("info",`v${be} factory_invoked`,{version:be,hasInput:re!=null,inputDir:re?.directory??null,inputKeys:re?Object.keys(re):[]});let xe=re.client,uu=xe!=null&&typeof xe==="object"&&"tool"in xe?xe:null;Ip().setClient(uu),Il(uu);let Ze;try{Ze=await jl({projectDir:re.directory??t})}catch(g){throw T("error","factory_config_load_failed",{message:g instanceof Error?g.message:String(g),stack:g instanceof Error?g.stack?.slice(0,800):void 0}),g}let Yp={...e,...Ze.config,...de?.meta_governor??{}},O;try{O=Ml(Yp)}catch(g){throw T("error","factory_orchestrator_config_failed",{message:g instanceof Error?g.message:String(g)}),g}if(Cm({preferredTool:O.graphRetrieval.preferredTool}),Ze.sources.length>0)T("info",`v${be} config_loaded`,{version:be,sources:Ze.sources,effectiveSource:Ze.effectiveSource,enabled:O.enabled});if(O.postWave?.enabled===!0&&O.intervention.respectDoneSignal===!1)T("info","post_wave_warning",{message:"postWave.enabled=true but intervention.respectDoneSignal=false: post-wave directives still fire on Oracle-verified PHASE-N-COMPLETE, but the done-signal latch is off (intervention is not auto-disabled at plan end)."});let du=new Set,mu=new Set,Qp=new Set,_e=re.directory?qp(re.directory):t,$t=e.graphSync??Ze.config?.graphSync??de?.meta_governor?.graphSync;if($t?.enabled!==!1){if(r.__test_onGraphSyncInit?.({projectDir:_e}),(r.__test_runGraphSync??It)({enabled:!0,watch:$t?.watch??!1,autoInstall:$t?.autoInstall??!0,installTimeoutMs:$t?.installTimeoutMs??60000,killOrphanedOnInit:$t?.killOrphanedOnInit??!0,projectDir:_e}).then((w)=>{if(w?.attempted&&w.availability.codegraph&&w.availability.graphify)du.add(_e)}).catch(()=>{}),O.cliAnything?.enabled!==!1){let w=Ze.config?.cliAnything??de?.meta_governor?.cliAnything;(r.__test_runCliAnythingSync??Lu)({enabled:!0,autoInstall:w?.autoInstall??!0,autoUpgrade:w?.autoUpgrade??!0,cachePath:w?.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:w?.upgradeCheckTtlMs??86400000,projectDir:_e,installScope:w?.installScope??"global",cliHubBin:w?.cliHubBin??"cli-hub",skillsBin:w?.skillsBin??"npx skills"}).then((I)=>{if(I?.attempted&&I.availability.cliHub)Qp.add(_e)}).catch((I)=>{T("warn",`cli-anything sync failed: ${String(I)}`)})}queueMicrotask(()=>{try{let w=O.graphSync.fetchBranch,f=ko(_e,w);if(f>0)T("info",`reindexOnFetch: ${f} new commits on origin/${w}, reindexing`),Mr(_e).catch((I)=>{T("warn",`reindexOnFetch failed: ${String(I)}`)})}catch{}})}if(!O.enabled)return{tool:{omo_search:a,omo_recall:s,omo_health:c,omo_find:l,omo_impact:d,omo_remember:v,omo_recall_mcp:h,omo_path:u,omo_explain:y,omo_files:x,omo_callers:j,omo_node:A,omo_context:G,omo_affected_cg:N,omo_status:X,omo_unlock:he,omo_mark_dirty:kt,omo_sync_if_dirty:Gl,omo_index:Vl,omo_visualize:Wl,omo_serve:Bl,omo_uninit:Hl,omo_diagnose:Jl,omo_merge_graphs:ql,omo_save_result:Kl,omo_extract:Xl,omo_cluster_only:Yl,omo_label:Ql,omo_tree:eu,omo_clone:tu,omo_add:ru,omo_check_update:nu,omo_hook_status:ou,omo_cli_anything_install:iu,omo_cli_anything_list:au,omo_cli_anything_search:su,omo_cli_anything_info:cu},dispose:()=>{try{lo()}catch{}try{St()}catch{}try{Sr()}catch{}try{tt()}catch{}return Promise.resolve()}};let ro=()=>O.modelOverride?.providerID??r.providerID?.(),no=()=>O.modelOverride?.modelID??r.modelID?.(),ef=()=>O.modelOverride?.modelLimit??200000,S_=ro()??"unknown",I_=no()??"unknown",br,pu;if(O.protocolEnforcement.enabled||O.protocolEnforcement.injectIntoSystem){let g=O.protocolEnforcement.path??Nl;try{br=await Lp(g),pu=Ul(br)}catch(w){if(O.modelOverride?.verbosity!=="silent")T("warn",`could not load protocol: ${w instanceof Error?w.message:String(w)}`)}}let ke=new Rl({maxEntries:100,ttlMs:3600000}),_r=new Map,fu=300000,kr=new Map,gu=new Set,hu=new Set,vu=new Set,tf=()=>({currentWaveN:null,lastInjectedWaveN:null,lastInjectedAtMs:null,postWaveInjectionsThisWave:0,rulesReadForWave:{},oracleAfterPhaseAtMs:{},repoModeResolved:null}),yu=new Map,$r=(g,w)=>{if(!g||!w)return;if(!O.intervention.persistToSession)return;Yn(g,w).then((f)=>{if(!f.ok)T("warn",`persist intervention failed for ${g}`,{error:f.error});else T("info",`persisted intervention for ${g}`)})};return{dispose:()=>{try{lo()}catch{}try{St()}catch{}try{Sr()}catch{}try{tt()}catch{}return Promise.resolve()},"tool.execute.before":async(g,w)=>{if(!O.enabled)return;if(!O.protocolEnforcement.auditToolCalls)return;if(!g.sessionID)return;let f=ke.get(g.sessionID);if(!f)f={memoryToolsUsed:[],hasCodegraphDir:n.hasCodegraphDir(t),hasGraphifyDir:n.hasGraphifyDir(t),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,lastViolationInjectionAtMs:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[]},ke.set(g.sessionID,f);if(f?.oracleInFlight)return;if(pu)T("info","protocol loaded, system injection ready");let I=Zp(g.tool,w.args,{memoryToolsUsed:f.memoryToolsUsed,hasCodegraphDir:f.hasCodegraphDir,hasGraphifyDir:f.hasGraphifyDir,oracleInvoked:f.oracleInvoked,filesChanged:f.filesChanged,emptyRecall:f.emptyRecall,escalationAttempted:f.escalationAttempted,recentToolCalls:f.recentToolCalls,recentWriteContents:f.recentWriteContents,memorySaved:f.memorySaved,batchCompletions:f.batchCompletions});if(I.length>0){let ae=f.lastViolationInjectionAtMs??0;if(ae>0&&Date.now()-ae<30000){T("info",`violation during cooldown (${Math.round((30000-(Date.now()-ae))/1000)}s remaining), skipping queue`);let ne=I.map((Y)=>({severity:Y.severity,category:Y.rule,detail:Y.detail,ts:Date.now()}));f.accumulatedDeviations=[...f.accumulatedDeviations,...ne].slice(-5)}else{T("warn",`protocol violations on tool ${g.tool}`,I);let ne=_r.get(g.sessionID)?.items??[],Y=new Set;for(let S of I){let U=`${S.severity}::${S.rule}::${S.detail}`;if(Y.has(U))continue;Y.add(U);let L=`[${S.severity.toUpperCase()}] ${S.rule}: ${S.detail}`;if(!ne.includes(L))ne.push(L)}_r.set(g.sessionID,{items:ne,expiresAtMs:Date.now()+fu});let M=I.map((S)=>({severity:S.severity,category:S.rule,detail:S.detail,ts:Date.now()}));f.accumulatedDeviations=[...f.accumulatedDeviations,...M].slice(-5)}}else T("info",`audit OK on tool ${g.tool}`);if((g.tool==="grep"||g.tool==="glob")&&(n.hasCodegraphDir(t)||n.hasGraphifyDir(t))){let ee=o_(g);if(ee)n.invoke(t,ee,{timeoutMs:5000}).then((ae)=>{if(ae.result)n.cacheContext(g.sessionID,ee,ae.result)}).catch(()=>{})}},"tool.execute.after":async(g,w)=>{if(!O.enabled)return;try{o.markDelivered({sessionID:g.sessionID,mcpTool:g.tool,mcpArgs:g.args})}catch{}if(Ll.includes(g.tool))vu.add(g.sessionID);let f=ke.get(g.sessionID);if(f){if(f.iteration++,f.recentToolCalls=[g.tool].concat(f.recentToolCalls).slice(0,20),["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block"].includes(g.tool)){f.filesChanged++;let P=(w.output??"").slice(0,500);f.recentWriteContents=[P].concat(f.recentWriteContents).slice(0,3);let te=g.args,B=te?.filePath??te?.path;if(typeof B==="string"&&B.length>0)f.recentWriteFilePaths=[B].concat(f.recentWriteFilePaths).slice(0,10)}if(["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"].some((P)=>g.tool.startsWith(P))&&!f.memoryToolsUsed.includes(g.tool))f.memoryToolsUsed.push(g.tool);if(g.tool.startsWith("agentmemory_memory_save")){let P=w.output??"";if(P.includes("saved")||P.includes("written"))f.memorySaved=!0}if(g.tool==="task"){let P=w.output??"",te=g.args,B=te?.subagent_type;if(B==="oracle"||P.includes("subagent_type=oracle")){if(f.oracleInvoked=!0,te?.run_in_background===!0)f.oracleInFlight=!0,f.oracleInFlightSinceMs=Date.now()}if(te?.run_in_background===!0&&typeof B==="string")f.backgroundTaskInFlight=!0,f.backgroundTaskInFlightSinceMs=Date.now(),f.backgroundTaskType=B,T("info",`background_task_in_flight: subagent_type=${B} for session ${g.sessionID}`)}let L=(w.output??"").toLowerCase();if(g.tool.includes("recall")&&(L.includes("returned empty")||L.includes("no results")))f.emptyRecall=!0;if(g.tool==="todowrite"&&(w.output??"").includes("completed")){if(((w.output??"").match(/"status":"completed"/g)??[]).length>=3)f.batchCompletions++}let J=[typeof w.output==="string"?w.output:"",typeof g.args==="string"?g.args:""].join(`
192
- `);if(!f.taskDoneSignal&&f_(J))f.taskDoneSignal=!0,f.signalAtMs=Date.now(),T("info",`task_done_signal detected (legacy) for session ${g.sessionID}`);if(!f.phaseCompleteSignal&&g_(J))f.phaseCompleteSignal=!0,f.signalAtMs=Date.now(),T("info",`phase_complete_signal detected for session ${g.sessionID}`);if(!f.planCompleteSignal&&h_(J))f.planCompleteSignal=!0,f.signalAtMs=Date.now(),T("info",`plan_complete_signal detected for session ${g.sessionID}`);if(f.oracleInFlight){let te=f.oracleInFlightSinceMs!==null&&Date.now()-f.oracleInFlightSinceMs>300000;if(f.oracleInFlightSinceMs!==null&&f.signalAtMs>f.oracleInFlightSinceMs||te)f.oracleInFlight=!1,f.oracleInFlightSinceMs=null,T("info",`oracle_completed: re-enabling intervention for session ${g.sessionID}${te?" (timeout)":""}`);if(g.tool==="task"&&g.args?.subagent_type==="oracle"&&g.args?.run_in_background===!1)f.oracleInFlight=!1,f.oracleInFlightSinceMs=null,T("info",`oracle_completed (foreground call): re-enabling intervention for session ${g.sessionID}`)}if(f.backgroundTaskInFlight){if(f.backgroundTaskInFlightSinceMs!==null&&Date.now()-f.backgroundTaskInFlightSinceMs>300000)f.backgroundTaskInFlight=!1,f.backgroundTaskInFlightSinceMs=null,f.backgroundTaskType=null,T("info",`background_task_timed_out: re-enabling intervention for session ${g.sessionID}`)}}if(O.postWave?.enabled){let M=O.postWave,S=[typeof w.output==="string"?w.output:"",typeof g.args==="string"?g.args:""].join(`
193
- `),U=v_(S),L=g.tool==="task"&&S.includes("subagent_type=oracle");if(U!==null||L){let J=ke.get(g.sessionID);if(J){let B=Jp(S);if(J.recentPwArgsHashes.includes(B)){if(U===null&&L)T("info",`post_wave_dedupe: skipping re-detection of identical Oracle-call text for session ${g.sessionID}`)}else J.recentPwArgsHashes=[B,...J.recentPwArgsHashes].slice(0,8)}let P=yu.get(g.sessionID);if(!P)P=tf(),yu.set(g.sessionID,P);if(U!==null&&U!==P.currentWaveN)P.currentWaveN=U,P.postWaveInjectionsThisWave=0;if(L&&P.currentWaveN!==null){if(!(J!==void 0&&J.recentPwArgsHashes.slice(1).includes(Jp(S))))P.oracleAfterPhaseAtMs[P.currentWaveN]=Date.now()}let te=Date.now();if(y_({postWave:P},M,te)){let B=P.repoModeResolved??k_(M.repoMode??"auto",_e);P.repoModeResolved=B;let xt=B==="third-party"?__(M.thirdPartyDirective,P.currentWaveN,M.aasToolPrefix):b_(M.ownRepoDirective,P.currentWaveN);P.lastInjectedWaveN=P.currentWaveN,P.lastInjectedAtMs=te,P.postWaveInjectionsThisWave++,Tl(g.sessionID,xt).then((oo)=>{if(!oo.ok)T("info",`post-wave directive delivery failed for ${g.sessionID}: ${oo.error??"unknown"}`)})}}}if(f?.interventionDisabled)return;let ee=(f?.recentToolCalls??[]).slice(0,5).filter((M)=>["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block","task"].includes(M)),ae=f?!(f.oracleInFlight||f.backgroundTaskInFlight)&&ee.length===0:!1,ne=f?.accumulatedDeviations??[],Y={sessionID:g.sessionID,toolName:g.tool,toolOutput:w.output,iteration:f?.iteration??0,maxIterations:O.closedLoop.maxLessonsPerSession??10,oracleVerified:f?.oracleInvoked??!1,noProgress:ae,filesChanged:f?.filesChanged??0,recentTurnTokens:[],deviations:ne,filePaths:f?.recentWriteFilePaths??[],...(()=>{let{backends:M,writeBackend:S}=r;if(M&&S)return{backends:M,writeBackend:S};try{let U=Lr();return{backends:M??{agentmemory:U,boulderState:U},writeBackend:S??U}}catch{return{backends:M??{agentmemory:{smartSearch:async()=>({lessons:[],crystals:[]})},boulderState:{boulderRead:async()=>[]}},writeBackend:S??{saveMemory:async()=>({id:""}),saveLesson:async()=>({id:""})}}}})(),config:O,...ro()?{providerID:ro()}:{},...no()?{modelID:no()}:{},modelLimit:ef(),currentLessonCount:f?.lessonCount??0};try{let M=await td(Y);if(M.lessonSaved?.lessonSaved&&f)f.lessonCount++;if(M.decision.action==="escalate"&&g.sessionID&&bt()){let S=M.decision.historyEntry.decision,U=S.evidence.length,L=S.shouldEscalateTo??"oracle",J=Ol({reasoning:S.reasoning,target:L,evidenceCount:U,sessionID:g.sessionID});_t(g.sessionID,{toolName:"meta_governor_escalate",mcpTool:"task",mcpArgs:{subagent_type:L},preamble:J}).catch((P)=>{T("warn",`escalation prompt failed: ${String(P)}`)})}if(O.intervention.mode!=="silent"&&f){let S=M.decision;if(f.oracleInFlight||f.backgroundTaskInFlight){let L=f.oracleInFlight?"oracle_in_flight":"background_task_in_flight";T("info",`${L}: skipping intervention for session ${g.sessionID} (score ${M.scoringResult.rawScore.toFixed(2)})`);return}let U=O.intervention.phaseAwareDoneSignal===!0;if(O.intervention.respectDoneSignal&&f.oracleInvoked&&(f.planCompleteSignal||!U&&(f.taskDoneSignal||f.phaseCompleteSignal))){f.interventionDisabled=!0;let L=f.planCompleteSignal?"PLAN-COMPLETE":f.taskDoneSignal?"DONE":"PHASE-N-COMPLETE";T("info",`task verified (${L} + Oracle): disabling intervention for session ${g.sessionID}`),Le(g.sessionID);return}if(S.action!=="continue"&&Zl(S.action,O.intervention.minActionForMessage)){let L=Math.max(0,O.intervention.maxInterventionsPerSession??0);if(L>0&&f.interventionCount>=L){f.interventionDisabled=!0,T("warn",`intervention cap (${L}) reached for session ${g.sessionID}; disabling further intervention`),Le(g.sessionID);return}let J=60000,P=Date.now(),te=S.historyEntry?.reasoning??S.message??"",B=`${S.action}::${te.slice(0,80)}`;if((S.action==="warn"||S.action==="escalate")&&f.lastWarnHash===B&&f.lastWarnAtMs>0&&P-f.lastWarnAtMs<J){T("info",`warn_cooldown: suppressing duplicate ${S.action} (${Math.round((J-(P-f.lastWarnAtMs))/1000)}s remaining) for session ${g.sessionID}`),Le(g.sessionID);return}if(f.interventionCount++,S.action==="warn"||S.action==="escalate")f.lastWarnAtMs=P,f.lastWarnHash=B;Up(g.sessionID,S)}}}catch{}try{if(g.tool==="bash"){let S=g.args?.command;if(Ar(S))T("info","git_commit_reindex_triggered",{sessionID:g.sessionID,command:S}),r.__test_onCommitTrigger?.({projectDir:_e,command:S??"",sessionID:g.sessionID}),Mr(_e).catch((U)=>{T("warn",`codegraph sync failed: ${String(U)}`)})}}catch{}try{if(g.tool==="bash"){let S=g.args?.command;if(c_(S)){let U=s_(w.output,g.sessionID);if(U.length>0){let L=kr.get(g.sessionID)?.items??[];kr.set(g.sessionID,{items:L.concat(U),expiresAtMs:Date.now()+fu}),T("info",`captured ${U.length} bot feedback line(s) for session ${g.sessionID}`)}}}}catch{}try{let M=g.args?.command;if(g.tool==="bash"&&l_(M)){let S=O.ciMonitor;if(S?.enabled){let U=u_(t),L=d_(t);if(U&&L)T("info",`ci_monitor: git push detected on ${L}@${U.slice(0,7)} — starting background poll`),m_(U,L,S,g.sessionID).catch((J)=>{T("warn",`ci_monitor: background poll failed: ${J instanceof Error?J.message:String(J)}`)})}}}catch{}},"experimental.chat.messages.transform":async(g,w)=>{if(!O.enabled)return;let I=w.messages[w.messages.length-1]?.info?.sessionID;if(!I)return;let ee=ke.get(I);if(O.skillPriming.enabled&&!hu.has(I)&&Gp({trigger:O.skillPriming.trigger,recentToolCalls:ee?.recentToolCalls??[],implementationToolSeen:vu.has(I)}))hu.add(I),w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:Fp(O.skillPriming.router),synthetic:!0}]}),T("info",`skill_priming_injected for session ${I}`);if(du.has(_e)&&!mu.has(I))mu.add(I),w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:["[META-GOVERNOR] codegraph y graphify ya están inicializados en este repo. ","ROUTING EXPLÍCITO (v0.25.0): ","• Símbolos/definiciones/callers/impacto (código) → CODEGRAPH: omo_find, omo_impact, omo_search. ","• Conceptos/arquitectura/conexiones/explicaciones → GRAPHIFY: omo_path, omo_explain (y omo_search en modo alternate). ","• Vista general del repo → lee graphify-out/GRAPH_REPORT.md. ","Actualizan tras cada commit."].join(" "),synthetic:!0}]}),T("info",`graph_tools_ready_injected for session ${I}`);if(O.intervention.mode!=="message")return;if(ee?.interventionDisabled){Le(I);return}if(ee&&!gu.has(I)&&p_(t,ee.interventionCount)){gu.add(I);let se="[MetaGovernor] Before any code change, create PLAN.md or a `## Plan` section in AGENTS.md that enumerates the phases. After each phase, commit (local + fork + upstream). Each commit triggers automatic reindex via the graphify post-commit hook + `codegraph sync`.";w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:se,synthetic:!0}]}),T("info",`plan_reminder_injected for session ${I}`),$r(I,se)}let ae=kr.get(I);if(ae&&ae.expiresAtMs>Date.now()){let se=ae.items;if(se.length>0){let Fe=`[MetaGovernor PR Reviewer Feedback]
188
+ Diagnostic: ${b.code}
189
+ stderr: ${b.stderr||"(empty)"}`,metadata:{tool:$,code:b.code,durationMs:_,sessionID:v.sessionID,...U}};let N=b.data!==null&&b.data!==void 0?typeof b.data==="string"?b.data:JSON.stringify(b.data,null,2):b.rawOutput??"";return{title:$,output:N,metadata:{tool:$,code:b.code,durationMs:_,sessionID:v.sessionID,...U}}}function jk($){return Z({description:"Install a CLI from the CLI-Anything hub so the agent can drive that software. USAGE: omo_cli_anything_install with name='gimp' installs `cli-anything-gimp`, which exposes a `cli-anything-gimp` command. Browse the catalog with omo_cli_anything_list. See https://github.com/HKUDS/CLI-Anything for the full registry.",args:{name:u.string().min(1).describe("The CLI name to install (e.g. 'gimp', 'blender', 'drawio')")},async execute(U,b){let r=Date.now(),{installCli:v}=await Promise.resolve().then(() => (bv(),Ev)),z=v(U.name,$.runner,120000,"cli-hub");return a6("omo_cli_anything_install",{name:U.name},{...z,durationMs:Date.now()-r},r,b,`Could not install '${U.name}'. Check that cli-anything-hub is installed (omo_health) and the name is correct.`)}})}function Vk($){return Z({description:"List all CLIs available in the CLI-Anything hub (40+ GUI software harnesses). USAGE: omo_cli_anything_list with category='image' returns only image-related CLIs. Returns JSON with name, version, description, category, install_cmd, entry_point. See https://github.com/HKUDS/CLI-Anything.",args:{category:u.string().optional().describe("Optional category filter (e.g. 'image', 'devops', '3d', 'audio')"),source:u.enum(["harness","public","npm","all"]).optional().describe("Optional source filter. 'all' includes harness + public + npm.")},async execute(U,b){let r=Date.now(),{listClis:v}=await Promise.resolve().then(() => (bv(),Ev)),z=v({category:U.category,source:U.source},$.runner,30000,"cli-hub");return a6("omo_cli_anything_list",{category:U.category,source:U.source},{...z,durationMs:Date.now()-r},r,b,"Could not list CLIs from the hub. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function Pk($){return Z({description:"Search the CLI-Anything hub for CLIs matching a query (name, description, or category). USAGE: omo_cli_anything_search with query='cad' returns CAD-related CLIs. Returns JSON array. See https://github.com/HKUDS/CLI-Anything.",args:{query:u.string().min(1).describe("Search query (matches name, description, or category)")},async execute(U,b){let r=Date.now(),{searchClis:v}=await Promise.resolve().then(() => (bv(),Ev)),z=v(U.query,$.runner,30000,"cli-hub");return a6("omo_cli_anything_search",{query:U.query},{...z,durationMs:Date.now()-r},r,b,"Search failed. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function qk($){return Z({description:"Show details for a specific CLI in the CLI-Anything hub. USAGE: omo_cli_anything_info with name='blender' returns display name, version, description, requirements (e.g. 'blender (apt install blender)'), entry point, install command. See https://github.com/HKUDS/CLI-Anything.",args:{name:u.string().min(1).describe("The CLI name to look up")},async execute(U,b){let r=Date.now(),{infoCli:v}=await Promise.resolve().then(() => (bv(),Ev)),z=v(U.name,$.runner,1e4,"cli-hub");return a6("omo_cli_anything_info",{name:U.name},{...z,durationMs:Date.now()-r},r,b,`Could not find '${U.name}' in the hub. Try omo_cli_anything_search to find similar names.`)}})}class Bk{client=null;defaultTimeoutMs;toolCache=null;constructor($={}){this.defaultTimeoutMs=$.defaultTimeoutMs??5000}setClient($){this.client=$,this.toolCache=null}isReady(){return this.client!==null}async callTool($,U={},b){let r=Date.now(),v=b??this.defaultTimeoutMs;if(!this.client)return{data:null,timedOut:!1,durationMs:Date.now()-r,error:"MCP client not initialized"};try{let _=(await this.raceWithTimeout(this.client.tool.invoke({toolID:$,input:U}),v,$)).data;return{data:_&&typeof _==="object"&&!Array.isArray(_)?_:null,timedOut:!1,durationMs:Date.now()-r,error:null}}catch(z){return{data:null,timedOut:z instanceof Error&&/timed out/i.test(z.message),durationMs:Date.now()-r,error:z instanceof Error?z.message:String(z)}}}async isAvailable($){if(!this.client)return!1;if(this.toolCache===null)try{let U=await this.client.tool.list();this.toolCache=new Set((U.data??[]).map((b)=>b.id))}catch{this.toolCache=new Set}return this.toolCache.has($)}async availableTools(){if(!this.client)return[];if(this.toolCache===null)await this.isAvailable("__bootstrap__");return Array.from(this.toolCache??new Set)}invalidateCache(){this.toolCache=null}raceWithTimeout($,U,b){return new Promise((r,v)=>{let z=setTimeout(()=>{v(Error(`${b} timed out after ${U}ms`))},U);$.then((_)=>{clearTimeout(z),r(_)},(_)=>{clearTimeout(z),v(_)})})}}var S_=null;function Lk(){if(!S_)S_=new Bk;return S_}e6();class F_{entries=new Map;deliveredCount=0;expiredCount=0;register($){this.cleanup();let U=`deliv-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,b=Ak($.mcpArgs);return this.entries.set(U,{id:U,sessionID:$.sessionID,mcpTool:$.mcpTool,mcpArgsHash:b,registeredAt:Date.now(),ttlMs:$.ttlMs??1e4}),U}markDelivered($){this.cleanup();let U=$.mcpArgs?Ak($.mcpArgs):null;for(let[b,r]of this.entries){if(r.sessionID!==$.sessionID)continue;if(r.mcpTool!==$.mcpTool)continue;if(U!==null&&r.mcpArgsHash!==U)continue;return this.entries.delete(b),this.deliveredCount++,b}return null}async awaitDelivery($){let U=$.timeoutMs??2000,b=Date.now();while(Date.now()-b<U){if(this.cleanup(),![...this.entries.values()].find((v)=>v.sessionID===$.sessionID&&v.mcpTool===$.mcpTool))return"delivered";await Ew(50)}return"expired"}getStats(){return{pending:this.entries.size,delivered:this.deliveredCount,expired:this.expiredCount}}clearSession($){for(let[U,b]of this.entries)if(b.sessionID===$)this.entries.delete(U)}cleanup(){let $=Date.now();for(let[U,b]of this.entries)if($-b.registeredAt>b.ttlMs)this.entries.delete(U),this.expiredCount++}}function Ak($){return JSON.stringify($,Object.keys($).sort())}function Ew($){return new Promise((U)=>setTimeout(U,$))}S4();import{resolve as lk}from"node:path";import{homedir as ew}from"node:os";import{readFileSync as Sw}from"node:fs";import{dirname as Fw,resolve as Mw}from"node:path";import{fileURLToPath as Zw}from"node:url";var Gk="0.0.0";try{let $=Fw(Zw(import.meta.url)),U=Mw($,"..","package.json"),b=JSON.parse(Sw(U,"utf8"));if(typeof b.version==="string"&&b.version.length>0)Gk=b.version}catch{}var j$=Gk,Hk=["decisions_taken","decisions_skipped_continue","decisions_skipped_no_decision","decisions_skipped_no_message","decisions_skipped_below_threshold","interventions_delivered","interventions_disabled_done","interventions_disabled_cap","decisions_stored","plan_reminders_injected","bot_feedback_injected","violations_injected","protocol_audits_passed","protocol_violations_detected","git_commit_reindex","orchestrator_runs","orchestrator_errors"];function Ek(){let $={};for(let U of Hk)$[U]={count:0,lastOccurrenceISO:null};return $}var Dw=Ek(),JW=new Date().toISOString();function Sk($){let U=$??{},b=Ek(),r=new Date().toISOString(),v=U.version??j$,z=U.global===!0;return{inc(_){let N=b[_];if(!N)return;if(N.count++,N.lastOccurrenceISO=new Date().toISOString(),z){let O=Dw[_];if(O)O.count++,O.lastOccurrenceISO=N.lastOccurrenceISO}},getMetrics(){return{version:v,sessionID:U.sessionID??"",startedAtISO:r,uptimeMs:Date.now()-new Date(r).getTime(),counters:{...b}}},reset(){for(let _ of Hk)b[_]={count:0,lastOccurrenceISO:null}}}}function x_($){let U={enabled:!1,...$},b=HU(),r=EU(),v=C4();return{enabled:U.enabled===!0,memory:{enabled:!0,query:U.memory?.query??"meta_governor_context",timeoutMs:U.memory?.timeoutMs??U.memory?.agentmemoryTimeoutMs??2000},tokenPredictor:{compactBurnRateThreshold:U.tokenPredictor?.compactBurnRateThreshold??500,compactUsageThreshold:U.tokenPredictor?.compactUsageThreshold??0.85,switchModelUsageThreshold:U.tokenPredictor?.switchModelUsageThreshold??0.95,delegateConsecutiveHighBurn:U.tokenPredictor?.delegateConsecutiveHighBurn??5},scoring:{...b,...U.scoring?.continueThreshold!==void 0?{continueThreshold:U.scoring.continueThreshold}:{},...U.scoring?.warnThreshold!==void 0?{warnThreshold:U.scoring.warnThreshold}:{},...U.scoring?.escalateThreshold!==void 0?{escalateThreshold:U.scoring.escalateThreshold}:{},...U.scoring?.stopThreshold!==void 0?{stopThreshold:U.scoring.stopThreshold}:{},...U.scoring?.paralysisThreshold!==void 0?{paralysisThreshold:U.scoring.paralysisThreshold}:{},...U.scoring?.defaultEscalationTarget!==void 0?{defaultEscalationTarget:U.scoring.defaultEscalationTarget}:{}},closedLoop:{...v,...U.closedLoop?.enabled!==void 0?{enabled:U.closedLoop.enabled}:{},...U.closedLoop?.minSeverityToLearn!==void 0?{minSeverityToLearn:U.closedLoop.minSeverityToLearn}:{},...U.closedLoop?.maxLessonsPerSession!==void 0?{maxLessonsPerSession:U.closedLoop.maxLessonsPerSession}:{},...U.closedLoop?.saveDecisions!==void 0?{saveDecisions:U.closedLoop.saveDecisions}:{},...U.closedLoop?.saveLessons!==void 0?{saveLessons:U.closedLoop.saveLessons}:{}},decision:{...r,...U.decision?.maxHistoryPerSession!==void 0?{maxHistoryPerSession:U.decision.maxHistoryPerSession}:{},...U.decision?.forceContinueAfterStops!==void 0?{forceContinueAfterStops:U.decision.forceContinueAfterStops}:{},...U.decision?.warnMessageTemplate!==void 0?{warnMessageTemplate:U.decision.warnMessageTemplate}:{},...U.decision?.escalateMessageTemplate!==void 0?{escalateMessageTemplate:U.decision.escalateMessageTemplate}:{},...U.decision?.stopMessageTemplate!==void 0?{stopMessageTemplate:U.decision.stopMessageTemplate}:{}},modelOverride:U.modelOverride?{providerID:U.modelOverride.providerID,modelID:U.modelOverride.modelID,modelLimit:U.modelOverride.modelLimit,temperature:U.modelOverride.temperature??0.2,topP:U.modelOverride.topP??1,maxTokens:U.modelOverride.maxTokens??2048,reasoning:U.modelOverride.reasoning??!1,verbosity:U.modelOverride.verbosity??"minimal"}:void 0,intervention:{mode:U.intervention?.mode??"silent",includeDecisionHistory:U.intervention?.includeDecisionHistory??!0,maxHistoryMessages:U.intervention?.maxHistoryMessages??5,minActionForMessage:U.intervention?.minActionForMessage??"stop",maxInterventionsPerSession:U.intervention?.maxInterventionsPerSession??3,respectDoneSignal:U.intervention?.respectDoneSignal??!0,phaseAwareDoneSignal:U.intervention?.phaseAwareDoneSignal??!1,persistToSession:U.intervention?.persistToSession??!0},postWave:{enabled:U.postWave?.enabled??U.intervention?.phaseAwareDoneSignal===!0,repoMode:U.postWave?.repoMode??"auto",aasToolPrefix:U.postWave?.aasToolPrefix??"aas",ciTimeoutMs:U.postWave?.ciTimeoutMs??600000,maxRetriesPerWave:U.postWave?.maxRetriesPerWave??1,reinjectCooldownMs:U.postWave?.reinjectCooldownMs??60000,respectSilentMode:U.postWave?.respectSilentMode??!1,...U.postWave?.ownRepoDirective!==void 0?{ownRepoDirective:U.postWave.ownRepoDirective}:{},...U.postWave?.thirdPartyDirective!==void 0?{thirdPartyDirective:U.postWave.thirdPartyDirective}:{}},protocolEnforcement:{enabled:U.protocolEnforcement?.enabled??!1,path:U.protocolEnforcement?.path,injectIntoSystem:U.protocolEnforcement?.injectIntoSystem??!1,auditToolCalls:U.protocolEnforcement?.auditToolCalls??!1},skillPriming:{enabled:U.skillPriming?.enabled??!1,trigger:U.skillPriming?.trigger??"firstImplement",router:U.skillPriming?.router??"both"},graphSync:{killOrphanedOnInit:U.graphSync?.killOrphanedOnInit??!0,reindexOnFetch:U.graphSync?.reindexOnFetch!==!1,fetchBranch:U.graphSync?.fetchBranch??"main",autoUpgrade:U.graphSync?.autoUpgrade!==!1,upgradeCachePath:U.graphSync?.upgradeCachePath,checkGraphifyNeedsUpdate:U.graphSync?.checkGraphifyNeedsUpdate!==!1,addToGlobalGraph:U.graphSync?.addToGlobalGraph===!0},graphRetrieval:{preferredTool:U.graphRetrieval?.preferredTool??"auto",preferLocalCodegraph:U.graphRetrieval?.preferLocalCodegraph===!0,contextRouting:U.graphRetrieval?.contextRouting===!0},cliAnything:{enabled:U.cliAnything?.enabled!==!1,autoInstall:U.cliAnything?.autoInstall!==!1,autoUpgrade:U.cliAnything?.autoUpgrade!==!1,cachePath:U.cliAnything?.cachePath,upgradeCheckTtlMs:U.cliAnything?.upgradeCheckTtlMs,cliHubBin:U.cliAnything?.cliHubBin??"cli-hub",skillsBin:U.cliAnything?.skillsBin??"npx skills",installScope:U.cliAnything?.installScope??"global"}}}function VW($){if(!$)return!1;if($.enabled===!0)return!0;return $.meta_governor?.enabled===!0}async function PW($={}){let{loadMetaGovernorConfig:U}=await Promise.resolve().then(() => (D_(),Rk)),b=await U($);return x_(b.config)}D_();var a$=new Map;function mk($,U){a$.set($,U)}function c$($){let U=a$.get($);if(U!==void 0)a$.delete($);return U}function BW($){return a$.has($)}function LW(){for(let[$,U]of a$)return a$.delete($),U;return}function AW(){a$.clear()}class g_{store=new Map;maxEntries;ttlMs;now;constructor($={}){this.maxEntries=$.maxEntries??100,this.ttlMs=$.ttlMs??3600000,this.now=$.now??Date.now}get($){let U=this.store.get($);if(!U)return;let b=this.now();if(U.expiresAtMs<=b){this.store.delete($);return}return U.lastAccessAtMs=b,U.value}has($){return this.get($)!==void 0}set($,U){let b=this.now();if(!this.store.has($)&&this.store.size>=this.maxEntries)this.evictOldest();this.store.set($,{value:U,expiresAtMs:b+this.ttlMs,lastAccessAtMs:b})}delete($){return this.store.delete($)}size(){return this.store.size}clear(){this.store.clear()}evictOldest(){let $,U=1/0;for(let[b,r]of this.store)if(r.lastAccessAtMs<U)U=r.lastAccessAtMs,$=b;if($!==void 0)this.store.delete($)}}import{statSync as aw,readFileSync as ok}from"node:fs";import{execSync as sw}from"node:child_process";import{join as fk}from"node:path";import{readFile as cw}from"node:fs/promises";import{resolve as uw}from"node:path";import{homedir as hw}from"node:os";var R_=uw(hw(),".config","opencode","sisyphus-mandatory","sisyphus-mandatory.md");async function Tk($){return await cw($??R_,"utf-8")}function m_($,U){let b=U?.oracleVerified===!0,r=U?.filesChanged??0,v=["","## Sisyphus Protocol Enforcement","","You MUST follow these Sisyphus protocol rules:","","1. **Pre-response Memory Check**: Before any action, read `<project-memory>` and `<session-history-since>` blocks in context. Cite `<memory id>` for any fact used from memory. Do not ask questions whose answers are in those blocks.","","2. **Codebase Graph First**: Before using grep/glob/read for architecture or symbol queries, check whether `.codegraph/` or `graphify-out/` exists. If so, use codegraph/graphify tools first, then grep/read only as last resort.","","3. **Tool Routing Table**: Match common intents to the correct tool:",' - "we did this before" / "you should know" → `agentmemory_memory_recall`'," - Starting a task that resembles a previous one → `agentmemory_memory_smart_search`"," - Before asking the user a clarifying question → `agentmemory_memory_recall` first"," - Save durable insight/decision/rule → `agentmemory_memory_save`",""];if(/\boracle\b/i.test($)&&!(b&&r>0))v.push("4. **Post-task Oracle Verification**: If files touched >= 3 OR any INVOKE trigger matches, invoke Oracle with the exact format:",' `task(subagent_type="oracle", run_in_background=false, prompt="Verify: ...")`'," - INVOKE triggers: created 1+ new file, modified abstraction, touched security/auth paths, modified DB/persistence, modified CI/CD, added/removed dependency, modified perf-critical path, todo had 2+ completed items."," - SKIP only when: files touched <= 2, no new file, no dependency change, single-step task, change is typo/comment/rename only."," - Verdict: PASS → done. FAIL/CONDITIONAL → fix and re-invoke. Max 3 invocations."," - Cost: Max 3 oracle invocations per task. Skip rate: Must NOT skip Oracle on 2+ file change.","");return v.push("5. **Parallel Query Rule**: Fire independent tool queries in the same turn. Do NOT serialize independent memory/context queries.","","6. **Empty-Result Escalation**: On empty `agentmemory_memory_recall`, fire `agentmemory_memory_smart_search` + `agentmemory_memory_export` before asking the user.","","7. **Hard Rules (No Exceptions)**:"," - Do NOT ask 'where is X?' if memory or session record already contains it."," - Do NOT claim 'I don't know' before firing at least 2 different recall tools."," - Do NOT re-issue clarifying questions whose answer is in `<project-memory>` or `<session-history-since>`."," - Do NOT suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`."," - Do NOT leave empty catch blocks `catch(e) {}`.",' - Do NOT start a fresh agent via `task()` when `task(task_id="ses_...")` (continuation) exists — use continuation IDs.'," - Do NOT batch-complete todos — mark each one `completed` immediately after finishing."," - Do NOT skip creating todos for multi-step tasks.","","8. **Self-Check Before Responding**:"," - Verify you read `<project-memory>` and `<session-history-since>` blocks."," - Verify you cited `<memory id>` for any fact used from memory."," - Verify you did not ask a question whose answer is in those blocks."," - For multi-file changes, verify Oracle was invoked."," - For codebase exploration, verify codegraph/graphify was tried before grep/read."," - After discovering something non-obvious, save it with `agentmemory_memory_save` so future sessions benefit."," - Do NOT save routine operations (file reads, greps, list commands), trivial decisions, or facts already covered by existing memory. Save only novel insights, non-obvious patterns, or corrections to previous assumptions.","","9. **CI Verification Loop (NON-NEGOTIABLE)**: After EVERY step of an implementation plan that produces a code change you intend to keep, you MUST execute the full CI loop BEFORE moving to the next step:"," a. Commit the changes atomically (one commit per verified increment, never omnibus)."," b. Push to the remote that has CI configured (own repo: `git push origin <branch>`. Fork upstream: `git push fork <branch>` + open/update PR)."," c. Wait for the CI run triggered by the push to reach a terminal state (`gh run watch <run-id> --exit-status`).",' d. Assert `conclusion == "success"` on EVERY job. If any job fails, fix the regression, re-push, and re-verify until all jobs are green.'," e. Capture the green run-id so the final plan-completion message can cite it as evidence."," - Anti-pattern this rule kills: running local tests, seeing 0 failures, declaring done, then shipping the next step on top of an unverified CI. Local green is NOT CI green. Pushed-not-watched is NOT CI green."," - At the END of the plan (when the last step is done), run a final guarantee: `gh run list --branch <branch> --limit 5` and assert EVERY recent run on this branch has `conclusion=success`. If any run shows `failure`, surface it explicitly to the user with the run-id, the failing job, and the log excerpt - do NOT claim plan success."," - For fork -> upstream PR workflow: verify the workflow_run on the upstream repo (the PR's head ref), not just the fork. Both must be green."," - This rule applies whenever the repo has a `.github/workflows/*.yml` file (or equivalent CI config). For repos without CI, document the absence explicitly."," - If the user explicitly says 'skip CI' or 'local only', this rule is suppressed for that turn ONLY - re-engage on next step.",""),v.join(`
190
+ `)}function Ck($,U,b){let r=[],v=b.recentToolCalls??[],z=b.recentWriteContents??[],_=b.memorySaved??!1,N=b.batchCompletions??0;if(($==="grep"||$==="glob")&&(b.hasCodegraphDir||b.hasGraphifyDir)){let I=b.hasCodegraphDir?".codegraph":"graphify-out";r.push({rule:"codebase-graph-first",tool:$,severity:"media",detail:`Used ${$} when ${I} exists — should use codegraph/graphify first for architecture and symbol queries.`})}if($==="task"&&U&&typeof U==="object"){let I=U;if(!I.task_id&&typeof I.prompt==="string"&&v.length>3)r.push({rule:"continuation-discipline",tool:$,severity:"leve",detail:`Started a new task() without task(task_id="ses_...") continuation ID. Use task_id to preserve the subagent's full context and save tokens.`})}let O=["write","edit","edit_block","desktop-commander_edit_block","desktop-commander_write_file"];if(O.includes($)){let I=typeof U==="object"&&U!==null?JSON.stringify(U):String(U??""),j=/@ts-ignore|@ts-expect-error/.test(I),B=/\bas any\b/.test(I);if(j&&B)r.push({rule:"no-type-suppression",tool:$,severity:"grave",detail:"File write contains both @ts-ignore/@ts-expect-error AND 'as any' — double type suppression. "+"Both are forbidden by the Sisyphus protocol."});else if(j)r.push({rule:"no-type-suppression",tool:$,severity:"media",detail:"File write contains @ts-ignore or @ts-expect-error — both are forbidden. "+"Fix the underlying type error instead."});else if(B)r.push({rule:"no-type-suppression",tool:$,severity:"media",detail:"File write contains 'as any' — type suppression forbidden. "+"Use proper type narrowing instead."})}if(O.includes($)){let I=typeof U==="object"&&U!==null?JSON.stringify(U):String(U??"");if(/catch\s*\(\s*\w+\s*\)\s*\{\s*\}/.test(I))r.push({rule:"no-empty-catch",tool:$,severity:"media",detail:"Empty catch block detected — `catch(e) {}` is forbidden. "+"Log the error or handle it gracefully."})}if(["codegraph_explore","graphify query"].includes($)&&v.length>=2){if(!_)r.push({rule:"save-discovery-to-memory",tool:$,severity:"leve",detail:`Used ${$} to discover code but no memory save was made afterwards. Save non-obvious findings with agentmemory_memory_save so future sessions benefit.`})}if(N>0&&$!=="todowrite")r.push({rule:"no-batch-todo-completion",tool:$,severity:"leve",detail:"Batch todo completion detected. Each todo must be marked `completed` immediately "+"after finishing — do not batch-complete multiple items."});if(b.emptyRecall&&!b.escalationAttempted){if($.startsWith("question")||$==="ask")r.push({rule:"empty-result-escalation",tool:$,severity:"grave",detail:"Memory recall returned empty but agent did not fire smart_search + export before asking the user. Steps 1-3 of empty-result escalation protocol are mandatory."})}let J=["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"];if(!b.memoryToolsUsed.some((I)=>J.some((j)=>I.startsWith(j)))&&($.startsWith("question")||$==="ask"))r.push({rule:"memory-first",tool:$,severity:"grave",detail:"Asked a question without first querying memory. Must fire agentmemory_memory_recall or agentmemory_memory_smart_search before asking the user."});let Y=["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block","apply_patch"];if(b.filesChanged>=3&&!b.oracleInvoked&&Y.includes($))r.push({rule:"oracle-verification",tool:$,severity:"media",detail:`Files changed (${b.filesChanged}) >= 3 but Oracle was not invoked. The POST-TASK ORACLE VERIFICATION protocol requires Oracle invocation on multi-file changes.`});return r}var T_=["write","edit","edit_block","multi_edit","apply_patch","ast_grep_replace","refactor","desktop-commander_write_file","desktop-commander_edit_block"],yw=["brainstorming","writing-plans","test-driven-development","systematic-debugging","subagent-driven-development"];function ck($){let U=["[SKILL PRIMING] This session involves implementation work. Select precise skills for this task before writing code:"],b=1;if($==="aas"||$==="both")U.push(`${b}. Query the AAS skill catalog (aas search_skills) for the 2-3 capabilities most relevant to this task (e.g. testing, architecture, language-specific), and compare candidates with aas get_skill.`),b++,U.push(`${b}. If 2+ viable candidates exist, compose a minimal stack (<= 3 skills) with aas compose_stack.`),b++;if($==="superpowers"||$==="both")U.push(`${b}. If a matching superpowers skill is available and not yet active (${yw.join(" / ")}), load it via the skill tool.`),b++;if($==="both")U.push("If a superpowers skill is already active, skip the catalog step.");return U.push("Do NOT enumerate the full catalog — keep the stack minimal and task-specific."),U.join(`
191
+ `)}function uk($){if($.trigger==="sessionStart")return!0;if($.implementationToolSeen)return!0;return $.recentToolCalls.some((U)=>T_.includes(U))}m4();var nk={continue:0,warn:1,escalate:2,stop:3};function C_($,U){return nk[$]>=nk[U]}function $9($){let U=$.args;if(!U||typeof U!=="object")return null;let b=["pattern","query","path","glob","regex","include_pattern"];for(let r of b){let v=U[r];if(typeof v==="string"&&v.trim().length>0)return v.trim()}return null}var v9=Sk({sessionID:"__global__",global:!0,version:j$}),U9=lk(ew(),".config","opencode","meta-governor-health.json");function dk($={},U={}){let b=m(),r=new F_;T2(r);let v=process.cwd(),z=c4(),_=c2({graphRetrieval:b,cwd:v}),N=u2({sqlite:z}),O=h2({metrics:v9,logFilePath:X$,healthFilePath:U9}),k=y2({cwd:v}),J=f2({cwd:v}),W=n2({onDispatch:({sessionID:v$,mcpTool:I$,mcpArgs:B$})=>{r.register({sessionID:v$,mcpTool:I$,mcpArgs:B$})}}),Y=i2({onDispatch:({sessionID:v$,mcpTool:I$,mcpArgs:B$})=>{r.register({sessionID:v$,mcpTool:I$,mcpArgs:B$})}}),I=l2({cwd:v}),j=o2({cwd:v}),B=d2({graphRetrieval:b,cwd:v}),x=p2({graphRetrieval:b,cwd:v}),g=t2({graphRetrieval:b,cwd:v}),y=e2({graphRetrieval:b,cwd:v}),T=a2({graphRetrieval:b,cwd:v}),t=s2({graphRetrieval:b,cwd:v}),Q$=$k({graphRetrieval:b,cwd:v}),Pv=vk({graphRetrieval:b,cwd:v}),u_=Uk({graphRetrieval:b,cwd:v}),h_=bk({graphRetrieval:b,cwd:v}),y_=rk({graphRetrieval:b,cwd:v}),f_=zk({graphRetrieval:b,cwd:v}),n_=_k({graphRetrieval:b,cwd:v}),i_=Nk({graphRetrieval:b,cwd:v}),l_=Ok({graphRetrieval:b,cwd:v}),o_=kk({graphRetrieval:b,cwd:v}),d_=Ik({graphRetrieval:b,cwd:v}),p_=Jk({graphRetrieval:b,cwd:v}),t_=Xk({graphRetrieval:b,cwd:v}),e_=Kk({graphRetrieval:b,cwd:v}),a_=wk({graphRetrieval:b,cwd:v}),s_=Qk({graphRetrieval:b,cwd:v}),$N=Yk({graphRetrieval:b,cwd:v}),vN=Wk({cwd:v}),UN=jk({cwd:v}),bN=Vk({cwd:v}),rN=Pk({cwd:v}),zN=qk({cwd:v});H("info",`v${j$} MetaGovernor plugin loaded`,{version:j$,build:"0.19.5-instr",cwd:v,projectHasCodegraph:b.hasCodegraphDir(v),projectHasGraphify:b.hasGraphifyDir(v)});let _N="?";try{let I$=tw(import.meta.url),B$=ok(I$);_N=pw("sha256").update(B$).digest("hex").slice(0,8)}catch{}return console.log(`[meta-governor] v${j$} loaded (bundle: ${_N})`),(async()=>{try{let{execSync:v$}=await import("node:child_process"),I$=v$("npm view @herjarsa/omo-meta-governor version",{timeout:5000,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(I$&&I$!==j$)H("warn",`STALE_CACHE: loaded v${j$} but npm has v${I$}. Run: npm cache clean --force && rm -rf ~/.cache/opencode/packages/@herjarsa/omo-meta-governor*`)}catch{}})(),async(v$,I$)=>{H("info",`v${j$} factory_invoked`,{version:j$,hasInput:v$!=null,inputDir:v$?.directory??null,inputKeys:v$?Object.keys(v$):[]});let B$=v$.client,NN=B$!=null&&typeof B$==="object"&&"tool"in B$?B$:null;Lk().setClient(NN),L_(NN);let u$;try{u$=await Z_({projectDir:v$.directory??v})}catch(Q){throw H("error","factory_config_load_failed",{message:Q instanceof Error?Q.message:String(Q),stack:Q instanceof Error?Q.stack?.slice(0,800):void 0}),Q}let pk={...$,...u$.config,...I$?.meta_governor??{}},E;try{E=x_(pk)}catch(Q){throw H("error","factory_orchestrator_config_failed",{message:Q instanceof Error?Q.message:String(Q)}),Q}if(F2({preferredTool:E.graphRetrieval.preferredTool}),u$.sources.length>0)H("info",`v${j$} config_loaded`,{version:j$,sources:u$.sources,effectiveSource:u$.effectiveSource,enabled:E.enabled});if(E.postWave?.enabled===!0&&E.intervention.respectDoneSignal===!1)H("info","post_wave_warning",{message:"postWave.enabled=true but intervention.respectDoneSignal=false: post-wave directives still fire on Oracle-verified PHASE-N-COMPLETE, but the done-signal latch is off (intervention is not auto-disabled at plan end)."});let ON=new Set,kN=new Set,tk=new Set,V$=v$.directory?lk(v$.directory):v,qv=$.graphSync??u$.config?.graphSync??I$?.meta_governor?.graphSync;if(qv?.enabled!==!1){if(U.__test_onGraphSyncInit?.({projectDir:V$}),(U.__test_runGraphSync??Gv)({enabled:!0,watch:qv?.watch??!1,autoInstall:qv?.autoInstall??!0,installTimeoutMs:qv?.installTimeoutMs??60000,killOrphanedOnInit:qv?.killOrphanedOnInit??!0,projectDir:V$}).then((L)=>{if(L?.attempted&&L.availability.codegraph&&L.availability.graphify)ON.add(V$)}).catch(()=>{}),E.cliAnything?.enabled!==!1){let L=u$.config?.cliAnything??I$?.meta_governor?.cliAnything;(U.__test_runCliAnythingSync??TN)({enabled:!0,autoInstall:L?.autoInstall??!0,autoUpgrade:L?.autoUpgrade??!0,cachePath:L?.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:L?.upgradeCheckTtlMs??86400000,projectDir:V$,installScope:L?.installScope??"global",cliHubBin:L?.cliHubBin??"cli-hub",skillsBin:L?.skillsBin??"npx skills"}).then((G)=>{if(G?.attempted&&G.availability.cliHub)tk.add(V$)}).catch((G)=>{H("warn",`cli-anything sync failed: ${String(G)}`)})}queueMicrotask(()=>{try{let L=E.graphSync.fetchBranch,w=jU(V$,L);if(w>0)H("info",`reindexOnFetch: ${w} new commits on origin/${L}, reindexing`),R4(V$).catch((G)=>{H("warn",`reindexOnFetch failed: ${String(G)}`)})}catch{}})}if(!E.enabled)return{tool:{omo_search:_,omo_recall:N,omo_health:O,omo_find:k,omo_impact:J,omo_remember:W,omo_recall_mcp:Y,omo_path:I,omo_explain:j,omo_files:B,omo_callers:x,omo_node:g,omo_context:y,omo_affected_cg:T,omo_status:t,omo_unlock:Q$,omo_mark_dirty:Pv,omo_sync_if_dirty:u_,omo_index:h_,omo_visualize:y_,omo_serve:f_,omo_uninit:n_,omo_diagnose:i_,omo_merge_graphs:l_,omo_save_result:o_,omo_extract:d_,omo_cluster_only:p_,omo_label:t_,omo_tree:e_,omo_clone:a_,omo_add:s_,omo_check_update:$N,omo_hook_status:vN,omo_cli_anything_install:UN,omo_cli_anything_list:bN,omo_cli_anything_search:rN,omo_cli_anything_info:zN},dispose:()=>{try{NU()}catch{}try{Av()}catch{}try{A4()}catch{}try{$v()}catch{}return Promise.resolve()}};let $U=()=>E.modelOverride?.providerID??U.providerID?.(),vU=()=>E.modelOverride?.modelID??U.modelID?.(),ek=()=>E.modelOverride?.modelLimit??200000,q9=$U()??"unknown",B9=vU()??"unknown",j4,IN;if(E.protocolEnforcement.enabled||E.protocolEnforcement.injectIntoSystem){let Q=E.protocolEnforcement.path??R_;try{j4=await Tk(Q),IN=m_(j4)}catch(L){if(E.modelOverride?.verbosity!=="silent")H("warn",`could not load protocol: ${L instanceof Error?L.message:String(L)}`)}}let P$=new g_({maxEntries:100,ttlMs:3600000}),V4=new Map,JN=300000,P4=new Map,XN=new Set,KN=new Set,wN=new Set,ak=()=>({currentWaveN:null,lastInjectedWaveN:null,lastInjectedAtMs:null,postWaveInjectionsThisWave:0,rulesReadForWave:{},oracleAfterPhaseAtMs:{},repoModeResolved:null}),QN=new Map,q4=(Q,L)=>{if(!Q||!L)return;if(!E.intervention.persistToSession)return;t6(Q,L).then((w)=>{if(!w.ok)H("warn",`persist intervention failed for ${Q}`,{error:w.error});else H("info",`persisted intervention for ${Q}`)})};return{dispose:()=>{try{NU()}catch{}try{Av()}catch{}try{A4()}catch{}try{$v()}catch{}return Promise.resolve()},"tool.execute.before":async(Q,L)=>{if(!E.enabled)return;if(!E.protocolEnforcement.auditToolCalls)return;if(!Q.sessionID)return;let w=P$.get(Q.sessionID);if(!w)w={memoryToolsUsed:[],hasCodegraphDir:b.hasCodegraphDir(v),hasGraphifyDir:b.hasGraphifyDir(v),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,lastViolationInjectionAtMs:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[]},P$.set(Q.sessionID,w);if(w?.oracleInFlight)return;if(IN)H("info","protocol loaded, system injection ready");let G=Ck(Q.tool,L.args,{memoryToolsUsed:w.memoryToolsUsed,hasCodegraphDir:w.hasCodegraphDir,hasGraphifyDir:w.hasGraphifyDir,oracleInvoked:w.oracleInvoked,filesChanged:w.filesChanged,emptyRecall:w.emptyRecall,escalationAttempted:w.escalationAttempted,recentToolCalls:w.recentToolCalls,recentWriteContents:w.recentWriteContents,memorySaved:w.memorySaved,batchCompletions:w.batchCompletions});if(G.length>0){let z$=w.lastViolationInjectionAtMs??0;if(z$>0&&Date.now()-z$<30000){H("info",`violation during cooldown (${Math.round((30000-(Date.now()-z$))/1000)}s remaining), skipping queue`);let U$=G.map((e)=>({severity:e.severity,category:e.rule,detail:e.detail,ts:Date.now()}));w.accumulatedDeviations=[...w.accumulatedDeviations,...U$].slice(-5)}else{H("warn",`protocol violations on tool ${Q.tool}`,G);let U$=V4.get(Q.sessionID)?.items??[],e=new Set;for(let A of G){let C=`${A.severity}::${A.rule}::${A.detail}`;if(e.has(C))continue;e.add(C);let c=`[${A.severity.toUpperCase()}] ${A.rule}: ${A.detail}`;if(!U$.includes(c))U$.push(c)}V4.set(Q.sessionID,{items:U$,expiresAtMs:Date.now()+JN});let R=G.map((A)=>({severity:A.severity,category:A.rule,detail:A.detail,ts:Date.now()}));w.accumulatedDeviations=[...w.accumulatedDeviations,...R].slice(-5)}}else H("info",`audit OK on tool ${Q.tool}`);if((Q.tool==="grep"||Q.tool==="glob")&&(b.hasCodegraphDir(v)||b.hasGraphifyDir(v))){let s=$9(Q);if(s)b.invoke(v,s,{timeoutMs:5000}).then((z$)=>{if(z$.result)b.cacheContext(Q.sessionID,s,z$.result)}).catch(()=>{})}},"tool.execute.after":async(Q,L)=>{if(!E.enabled)return;try{r.markDelivered({sessionID:Q.sessionID,mcpTool:Q.tool,mcpArgs:Q.args})}catch{}if(T_.includes(Q.tool))wN.add(Q.sessionID);let w=P$.get(Q.sessionID);if(w){if(w.iteration++,w.recentToolCalls=[Q.tool].concat(w.recentToolCalls).slice(0,20),["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block"].includes(Q.tool)){w.filesChanged++;let F=(L.output??"").slice(0,500);w.recentWriteContents=[F].concat(w.recentWriteContents).slice(0,3);let $$=Q.args,i=$$?.filePath??$$?.path;if(typeof i==="string"&&i.length>0)w.recentWriteFilePaths=[i].concat(w.recentWriteFilePaths).slice(0,10)}if(["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"].some((F)=>Q.tool.startsWith(F))&&!w.memoryToolsUsed.includes(Q.tool))w.memoryToolsUsed.push(Q.tool);if(Q.tool.startsWith("agentmemory_memory_save")){let F=L.output??"";if(F.includes("saved")||F.includes("written"))w.memorySaved=!0}if(Q.tool==="task"){let F=L.output??"",$$=Q.args,i=$$?.subagent_type;if(i==="oracle"||F.includes("subagent_type=oracle")){if(w.oracleInvoked=!0,$$?.run_in_background===!0)w.oracleInFlight=!0,w.oracleInFlightSinceMs=Date.now()}if($$?.run_in_background===!0&&typeof i==="string")w.backgroundTaskInFlight=!0,w.backgroundTaskInFlightSinceMs=Date.now(),w.backgroundTaskType=i,H("info",`background_task_in_flight: subagent_type=${i} for session ${Q.sessionID}`)}let c=(L.output??"").toLowerCase();if(Q.tool.includes("recall")&&(c.includes("returned empty")||c.includes("no results")))w.emptyRecall=!0;if(Q.tool==="todowrite"&&(L.output??"").includes("completed")){if(((L.output??"").match(/"status":"completed"/g)??[]).length>=3)w.batchCompletions++}let o=[typeof L.output==="string"?L.output:"",typeof Q.args==="string"?Q.args:""].join(`
192
+ `);if(!w.taskDoneSignal&&I9(o))w.taskDoneSignal=!0,w.signalAtMs=Date.now(),H("info",`task_done_signal detected (legacy) for session ${Q.sessionID}`);if(!w.phaseCompleteSignal&&J9(o))w.phaseCompleteSignal=!0,w.signalAtMs=Date.now(),H("info",`phase_complete_signal detected for session ${Q.sessionID}`);if(!w.planCompleteSignal&&X9(o))w.planCompleteSignal=!0,w.signalAtMs=Date.now(),H("info",`plan_complete_signal detected for session ${Q.sessionID}`);if(w.oracleInFlight){let $$=w.oracleInFlightSinceMs!==null&&Date.now()-w.oracleInFlightSinceMs>300000;if(w.oracleInFlightSinceMs!==null&&w.signalAtMs>w.oracleInFlightSinceMs||$$)w.oracleInFlight=!1,w.oracleInFlightSinceMs=null,H("info",`oracle_completed: re-enabling intervention for session ${Q.sessionID}${$$?" (timeout)":""}`);if(Q.tool==="task"&&Q.args?.subagent_type==="oracle"&&Q.args?.run_in_background===!1)w.oracleInFlight=!1,w.oracleInFlightSinceMs=null,H("info",`oracle_completed (foreground call): re-enabling intervention for session ${Q.sessionID}`)}if(w.backgroundTaskInFlight){if(w.backgroundTaskInFlightSinceMs!==null&&Date.now()-w.backgroundTaskInFlightSinceMs>300000)w.backgroundTaskInFlight=!1,w.backgroundTaskInFlightSinceMs=null,w.backgroundTaskType=null,H("info",`background_task_timed_out: re-enabling intervention for session ${Q.sessionID}`)}}if(E.postWave?.enabled){let R=E.postWave,A=[typeof L.output==="string"?L.output:"",typeof Q.args==="string"?Q.args:""].join(`
193
+ `),C=K9(A),c=Q.tool==="task"&&A.includes("subagent_type=oracle");if(C!==null||c){let o=P$.get(Q.sessionID);if(o){let i=ik(A);if(o.recentPwArgsHashes.includes(i)){if(C===null&&c)H("info",`post_wave_dedupe: skipping re-detection of identical Oracle-call text for session ${Q.sessionID}`)}else o.recentPwArgsHashes=[i,...o.recentPwArgsHashes].slice(0,8)}let F=QN.get(Q.sessionID);if(!F)F=ak(),QN.set(Q.sessionID,F);if(C!==null&&C!==F.currentWaveN)F.currentWaveN=C,F.postWaveInjectionsThisWave=0;if(c&&F.currentWaveN!==null){if(!(o!==void 0&&o.recentPwArgsHashes.slice(1).includes(ik(A))))F.oracleAfterPhaseAtMs[F.currentWaveN]=Date.now()}let $$=Date.now();if(w9({postWave:F},R,$$)){let i=F.repoModeResolved??W9(R.repoMode??"auto",V$);F.repoModeResolved=i;let Bv=i==="third-party"?Y9(R.thirdPartyDirective,F.currentWaveN,R.aasToolPrefix):Q9(R.ownRepoDirective,F.currentWaveN);F.lastInjectedWaveN=F.currentWaveN,F.lastInjectedAtMs=$$,F.postWaveInjectionsThisWave++,A_(Q.sessionID,Bv).then((UU)=>{if(!UU.ok)H("info",`post-wave directive delivery failed for ${Q.sessionID}: ${UU.error??"unknown"}`)})}}}if(w?.interventionDisabled)return;let s=(w?.recentToolCalls??[]).slice(0,5).filter((R)=>["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block","task"].includes(R)),z$=w?!(w.oracleInFlight||w.backgroundTaskInFlight)&&s.length===0:!1,U$=w?.accumulatedDeviations??[],e={sessionID:Q.sessionID,toolName:Q.tool,toolOutput:L.output,iteration:w?.iteration??0,maxIterations:E.closedLoop.maxLessonsPerSession??10,oracleVerified:w?.oracleInvoked??!1,noProgress:z$,filesChanged:w?.filesChanged??0,recentTurnTokens:[],deviations:U$,filePaths:w?.recentWriteFilePaths??[],...(()=>{let{backends:R,writeBackend:A}=U;if(R&&A)return{backends:R,writeBackend:A};try{let C=c4();return{backends:R??{agentmemory:C,boulderState:C},writeBackend:A??C}}catch{return{backends:R??{agentmemory:{smartSearch:async()=>({lessons:[],crystals:[]})},boulderState:{boulderRead:async()=>[]}},writeBackend:A??{saveMemory:async()=>({id:""}),saveLesson:async()=>({id:""})}}}})(),config:E,...$U()?{providerID:$U()}:{},...vU()?{modelID:vU()}:{},modelLimit:ek(),currentLessonCount:w?.lessonCount??0};try{let R=await aN(e);if(R.lessonSaved?.lessonSaved&&w)w.lessonCount++;if(R.decision.action==="escalate"&&Q.sessionID&&jv()){let A=R.decision.historyEntry.decision,C=A.evidence.length,c=A.shouldEscalateTo??"oracle",o=G_({reasoning:A.reasoning,target:c,evidenceCount:C,sessionID:Q.sessionID});Vv(Q.sessionID,{toolName:"meta_governor_escalate",mcpTool:"task",mcpArgs:{subagent_type:c},preamble:o}).catch((F)=>{H("warn",`escalation prompt failed: ${String(F)}`)})}if(E.intervention.mode!=="silent"&&w){let A=R.decision;if(w.oracleInFlight||w.backgroundTaskInFlight){let c=w.oracleInFlight?"oracle_in_flight":"background_task_in_flight";H("info",`${c}: skipping intervention for session ${Q.sessionID} (score ${R.scoringResult.rawScore.toFixed(2)})`);return}let C=E.intervention.phaseAwareDoneSignal===!0;if(E.intervention.respectDoneSignal&&w.oracleInvoked&&(w.planCompleteSignal||!C&&(w.taskDoneSignal||w.phaseCompleteSignal))){w.interventionDisabled=!0;let c=w.planCompleteSignal?"PLAN-COMPLETE":w.taskDoneSignal?"DONE":"PHASE-N-COMPLETE";H("info",`task verified (${c} + Oracle): disabling intervention for session ${Q.sessionID}`),c$(Q.sessionID);return}if(A.action!=="continue"&&C_(A.action,E.intervention.minActionForMessage)){let c=Math.max(0,E.intervention.maxInterventionsPerSession??0);if(c>0&&w.interventionCount>=c){w.interventionDisabled=!0,H("warn",`intervention cap (${c}) reached for session ${Q.sessionID}; disabling further intervention`),c$(Q.sessionID);return}let o=60000,F=Date.now(),$$=A.historyEntry?.reasoning??A.message??"",i=`${A.action}::${$$.slice(0,80)}`;if((A.action==="warn"||A.action==="escalate")&&w.lastWarnHash===i&&w.lastWarnAtMs>0&&F-w.lastWarnAtMs<o){H("info",`warn_cooldown: suppressing duplicate ${A.action} (${Math.round((o-(F-w.lastWarnAtMs))/1000)}s remaining) for session ${Q.sessionID}`),c$(Q.sessionID);return}if(w.interventionCount++,A.action==="warn"||A.action==="escalate")w.lastWarnAtMs=F,w.lastWarnHash=i;mk(Q.sessionID,A)}}}catch{}try{if(Q.tool==="bash"){let A=Q.args?.command;if(g4(A))H("info","git_commit_reindex_triggered",{sessionID:Q.sessionID,command:A}),U.__test_onCommitTrigger?.({projectDir:V$,command:A??"",sessionID:Q.sessionID}),R4(V$).catch((C)=>{H("warn",`codegraph sync failed: ${String(C)}`)})}}catch{}try{if(Q.tool==="bash"){let A=Q.args?.command;if(r9(A)){let C=b9(L.output,Q.sessionID);if(C.length>0){let c=P4.get(Q.sessionID)?.items??[];P4.set(Q.sessionID,{items:c.concat(C),expiresAtMs:Date.now()+JN}),H("info",`captured ${C.length} bot feedback line(s) for session ${Q.sessionID}`)}}}}catch{}try{let R=Q.args?.command;if(Q.tool==="bash"&&z9(R)){let A=E.ciMonitor;if(A?.enabled){let C=_9(v),c=N9(v);if(C&&c)H("info",`ci_monitor: git push detected on ${c}@${C.slice(0,7)} — starting background poll`),O9(C,c,A,Q.sessionID).catch((o)=>{H("warn",`ci_monitor: background poll failed: ${o instanceof Error?o.message:String(o)}`)})}}}catch{}},"experimental.chat.messages.transform":async(Q,L)=>{if(!E.enabled)return;let G=L.messages[L.messages.length-1]?.info?.sessionID;if(!G)return;let s=P$.get(G);if(E.skillPriming.enabled&&!KN.has(G)&&uk({trigger:E.skillPriming.trigger,recentToolCalls:s?.recentToolCalls??[],implementationToolSeen:wN.has(G)}))KN.add(G),L.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:ck(E.skillPriming.router),synthetic:!0}]}),H("info",`skill_priming_injected for session ${G}`);if(ON.has(V$)&&!kN.has(G))kN.add(G),L.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:["[META-GOVERNOR] codegraph y graphify ya están inicializados en este repo. ","ROUTING EXPLÍCITO (v0.25.0): ","• Símbolos/definiciones/callers/impacto (código) → CODEGRAPH: omo_find, omo_impact, omo_search. ","• Conceptos/arquitectura/conexiones/explicaciones → GRAPHIFY: omo_path, omo_explain (y omo_search en modo alternate). ","• Vista general del repo → lee graphify-out/GRAPH_REPORT.md. ","Actualizan tras cada commit."].join(" "),synthetic:!0}]}),H("info",`graph_tools_ready_injected for session ${G}`);if(E.intervention.mode!=="message")return;if(s?.interventionDisabled){c$(G);return}if(s&&!XN.has(G)&&k9(v,s.interventionCount)){XN.add(G);let _$="[MetaGovernor] Before any code change, create PLAN.md or a `## Plan` section in AGENTS.md that enumerates the phases. After each phase, commit (local + fork + upstream). Each commit triggers automatic reindex via the graphify post-commit hook + `codegraph sync`.";L.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:_$,synthetic:!0}]}),H("info",`plan_reminder_injected for session ${G}`),q4(G,_$)}let z$=P4.get(G);if(z$&&z$.expiresAtMs>Date.now()){let _$=z$.items;if(_$.length>0){let h$=`[MetaGovernor PR Reviewer Feedback]
194
194
 
195
- ${se.map((et,io)=>`${io+1}. ${et}`).join(`
195
+ ${_$.map((s$,bU)=>`${bU+1}. ${s$}`).join(`
196
196
  `)}
197
197
 
198
- Apply these fixes to keep the PR mergeable.`;w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:Fe,synthetic:!0}]}),kr.delete(I),T("info",`injected ${se.length} bot feedback line(s) to model for session ${I}`),$r(I,Fe)}}let ne=_r.get(I);if(ne&&ne.expiresAtMs>Date.now()){let se=ne.items;if(se.length>0){let Fe=`[META-GOVERNOR PROTOCOL VIOLATIONS - YOU MUST COMPLY]
198
+ Apply these fixes to keep the PR mergeable.`;L.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:h$,synthetic:!0}]}),P4.delete(G),H("info",`injected ${_$.length} bot feedback line(s) to model for session ${G}`),q4(G,h$)}}let U$=V4.get(G);if(U$&&U$.expiresAtMs>Date.now()){let _$=U$.items;if(_$.length>0){let h$=`[META-GOVERNOR PROTOCOL VIOLATIONS - YOU MUST COMPLY]
199
199
 
200
- ${se.map((io,nf)=>`${nf+1}. ${io}`).join(`
200
+ ${_$.map((bU,$I)=>`${$I+1}. ${bU}`).join(`
201
201
  `)}
202
202
 
203
- Remember: use codegraph/graphify for architecture queries, do not grep without trying codegraph/graphify first, no @ts-ignore/as-any, no empty catch, check memory before asking.`;w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:Fe,synthetic:!0}]}),_r.delete(I),T("info",`injected ${se.length} violation(s) to model`),$r(I,Fe);let et=ke.get(I);if(et)et.lastViolationInjectionAtMs=Date.now()}}let Y=Le(I);if(!Y)return;if(Y.action==="continue")return;if(!Y.message)return;if(!Zl(Y.action,O.intervention.minActionForMessage))return;let M=ee??ke.get(I);if(!M)M={memoryToolsUsed:[],hasCodegraphDir:n.hasCodegraphDir(t),hasGraphifyDir:n.hasGraphifyDir(t),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,lastViolationInjectionAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[]},ke.set(I,M);let S=Math.max(0,O.intervention.maxInterventionsPerSession??0);if(S>0&&M.interventionCount>=S){M.interventionDisabled=!0;return}M.interventionCount++;let U=O.intervention.includeDecisionHistory!==!1,L=O.intervention.maxHistoryMessages??5,J=(M.recentInterventionTexts??[]).slice(-L),P=[];for(let se of J)if(P.length===0||P[P.length-1]!==se)P.push(se);let te=Math.max(L,P.length),B=`[MetaGovernor] ${Y.message}`;if(U&&P.length>0)B=`[MetaGovernor] Recent decisions in this session:
204
- ${P.map((Fe,et)=>`${et+1}. ${Fe}`).join(`
203
+ Remember: use codegraph/graphify for architecture queries, do not grep without trying codegraph/graphify first, no @ts-ignore/as-any, no empty catch, check memory before asking.`;L.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:h$,synthetic:!0}]}),V4.delete(G),H("info",`injected ${_$.length} violation(s) to model`),q4(G,h$);let s$=P$.get(G);if(s$)s$.lastViolationInjectionAtMs=Date.now()}}let e=c$(G);if(!e)return;if(e.action==="continue")return;if(!e.message)return;if(!C_(e.action,E.intervention.minActionForMessage))return;let R=s??P$.get(G);if(!R)R={memoryToolsUsed:[],hasCodegraphDir:b.hasCodegraphDir(v),hasGraphifyDir:b.hasGraphifyDir(v),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,lastViolationInjectionAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[]},P$.set(G,R);let A=Math.max(0,E.intervention.maxInterventionsPerSession??0);if(A>0&&R.interventionCount>=A){R.interventionDisabled=!0;return}R.interventionCount++;let C=E.intervention.includeDecisionHistory!==!1,c=E.intervention.maxHistoryMessages??5,o=(R.recentInterventionTexts??[]).slice(-c),F=[];for(let _$ of o)if(F.length===0||F[F.length-1]!==_$)F.push(_$);let $$=Math.max(c,F.length),i=`[MetaGovernor] ${e.message}`;if(C&&F.length>0)i=`[MetaGovernor] Recent decisions in this session:
204
+ ${F.map((h$,s$)=>`${s$+1}. ${h$}`).join(`
205
205
  `)}
206
206
 
207
207
  ---
208
208
 
209
- Current decision: ${Y.message}`;let xt=`[${Y.action}] ${Y.message}`;if(M.recentInterventionTexts?.slice(-1)[0]!==xt)M.recentInterventionTexts=[...M.recentInterventionTexts??[],xt].slice(-te);let rf={type:"text",text:B,synthetic:!0};w.messages.push({info:{role:"user",agent:"meta-governor"},parts:[rf]}),$r(I,B)},"experimental.chat.system.transform":async(g,w)=>{if(!O.enabled)return;if(O.protocolEnforcement.injectIntoSystem&&br){let f=g.sessionID?ke.get(g.sessionID):void 0;w.system.push(`
210
- ### Sisyphus Protocol Enforcement`,Ul(br,{oracleVerified:f?.oracleInvoked===!0,filesChanged:f?.filesChanged??0}),"---")}if(g.sessionID){let f=n.getCachedContext(g.sessionID);if(f)w.system.push(`
211
- ### Graph Context (auto-retrieved)`,f,"---")}if(O.intervention.mode==="system"&&g.sessionID){let f=ke.get(g.sessionID);if(f?.interventionDisabled){Le(g.sessionID);return}let I=Le(g.sessionID);if(I&&I.action!=="continue"&&I.message){if(Zl(I.action,O.intervention.minActionForMessage)){if(f){let ee=Math.max(0,O.intervention.maxInterventionsPerSession??0);if(ee>0&&f.interventionCount>=ee){f.interventionDisabled=!0;return}f.interventionCount++}w.system.push(`
212
- [MetaGovernor Intervention]`,I.message,"---")}}}},tool:{omo_search:a,omo_recall:s,omo_health:c,omo_find:l,omo_impact:d,omo_remember:v,omo_recall_mcp:h,omo_path:u,omo_explain:y,omo_files:x,omo_callers:j,omo_node:A,omo_context:G,omo_affected_cg:N,omo_status:X,omo_unlock:he,omo_mark_dirty:kt,omo_sync_if_dirty:Gl,omo_index:Vl,omo_visualize:Wl,omo_serve:Bl,omo_uninit:Hl,omo_diagnose:Jl,omo_merge_graphs:ql,omo_save_result:Kl,omo_extract:Xl,omo_cluster_only:Yl,omo_label:Ql,omo_tree:eu,omo_clone:tu,omo_add:ru,omo_check_update:nu,omo_hook_status:ou,omo_cli_anything_install:iu,omo_cli_anything_list:au,omo_cli_anything_search:su,omo_cli_anything_info:cu},"experimental.session.compacting":async(g,w)=>{if(!O.enabled||!O.closedLoop.enabled)return;let f=Lr(),I=`session:${g.sessionID}`,ee=await f.smartSearch({query:I,limit:3});if(ee.lessons.length>0){let ae=ee.lessons.map((ne,Y)=>`${Y+1}. [${ne.id}] confidence=${ne.confidence.toFixed(2)}
213
- ${ne.content.slice(0,300)}`).join(`
214
-
215
- `);w.context.push(`
216
- ### Past Lessons (auto-retrieved)`,ae,"---")}},"experimental.compaction.autocontinue":async(g,w)=>{if(!O.enabled)return;if(ke.get(g.sessionID)?.interventionDisabled)w.enabled=!1}}}}function s_(e,r){if(typeof e!=="string"||e.length===0)return[];let n=e.split(`
217
- `),o=[];for(let t of n){let i=t.match(/^\s*(\S+)\s+(fail)\s+(.*)$/);if(i){let a=i[1].trim(),s=i[3].trim();o.push(`${r} · ${a}: ${s}`)}}return o}function c_(e){if(typeof e!=="string"||e.length===0)return!1;let r=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])gh\s+pr(?:\s|$)/.test(r)}function l_(e){if(typeof e!=="string"||e.length===0)return!1;let r=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+push(?:\s|$)/.test(r)}function u_(e){try{let{execFileSync:r}=we("node:child_process");return r("git",["rev-parse","HEAD"],{cwd:e,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim()||null}catch{return null}}function d_(e){try{let{execFileSync:r}=we("node:child_process"),o=r("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim();return o&&o!=="HEAD"?o:null}catch{return null}}var Fl=new Map;async function m_(e,r,n,o){let t=await Promise.resolve().then(() => (Wp(),Vp)),i=Fl.get(o)??{lastPolledSha:null,lastFailureInjectionAtMs:0,pending:new Set};i.pending.add(e),Fl.set(o,i);try{t.triggerWorkflow(n.workflow,r);let a=Date.now(),s=null;while(Date.now()-a<n.maxWaitMs){if(s=t.getLatestRunForSha(e),!s){await new Promise((c)=>setTimeout(c,n.pollIntervalMs));continue}if(s.status==="completed")break;await new Promise((c)=>setTimeout(c,n.pollIntervalMs))}if(!s||s.status!=="completed"){T("warn",`ci_monitor: timeout waiting for run on ${e.slice(0,7)} (${n.maxWaitMs}ms)`);return}if(i.lastPolledSha=e,s.conclusion==="failure"){let c=Date.now();if(c-i.lastFailureInjectionAtMs<60000)return;i.lastFailureInjectionAtMs=c;let l=t.getFailedLogs(s.databaseId,4000),d=[`[CI Monitor] GitHub Actions run #${s.databaseId} FAILED on ${r}@${e.slice(0,7)}.`,"",`Title: ${s.displayTitle}`,`URL: ${s.url}`,`Conclusion: ${s.conclusion}`,"","── FAILED-STEP LOGS (truncated) ──",l||"(no failed-log output available — run `gh run view "+s.databaseId+" --log-failed` for full output)","","── ACTION ──",n.failOnly?"Read the failed logs above, identify which tests broke, run them locally to reproduce, fix, and re-push. Use `bun run typecheck` first (fastest signal), then run only the failing test files.":"Review the run and take action."].join(`
218
- `);T("warn",`ci_monitor: CI failed for ${e.slice(0,7)} — ${s.url}`);let h=await(await Promise.resolve().then(() => (Qn(),Nm))).persistSessionMessage(o,d,1e4);if(!h.ok)T("warn",`ci_monitor: failed to inject failure message: ${h.error??"unknown"}`)}else if(s.conclusion==="success")T("info",`ci_monitor: run #${s.databaseId} passed for ${e.slice(0,7)}`);else T("info",`ci_monitor: run #${s.databaseId} conclusion=${s.conclusion} for ${e.slice(0,7)}`)}finally{i.pending.delete(e),Fl.set(o,i)}}function p_(e,r){if(r>=1)return!1;try{return r_(Bp(e,"PLAN.md")),!1}catch{}try{let n=Kp(Bp(e,"AGENTS.md"),"utf-8");if(/^##\s+Plan\b/im.test(n))return!1}catch{}return!0}function f_(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test(e)}function g_(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test(e)||/<promise>\s*PHASE-\d+-COMPLETE\s*<\/promise>/i.test(e)}function h_(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*PLAN-COMPLETE\s*<\/promise>/i.test(e)}function v_(e){let r=/(?:<promise>\s*)?PHASE-(\d+)-COMPLETE\s*(?:<\/promise>)?/i.exec(e);return r?Number.parseInt(r[1],10):null}function Jp(e){let r=2166136261;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,16777619);return(r>>>0).toString(36)}function y_(e,r,n){if(r.enabled===!1)return!1;let o=e.postWave.currentWaveN;if(o===null)return!1;if(!(o in e.postWave.oracleAfterPhaseAtMs))return!1;let t=r.maxRetriesPerWave??1,i=r.reinjectCooldownMs??60000,a=e.postWave.lastInjectedWaveN===o;if(a&&e.postWave.postWaveInjectionsThisWave>=t)return!1;if(a&&e.postWave.lastInjectedAtMs!==null&&n-e.postWave.lastInjectedAtMs<i)return!1;return!0}function b_(e,r){if(e)return e;return[`Wave ${r===null||r===void 0?"?":String(r)} is Oracle-verified. Land it now:`,"1. Use a CLEAN dedicated branch for this PR: `git checkout -b <branch>` (each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem).","2. `git push -u origin HEAD` (sets upstream on first push).","3. If no PR exists yet: `gh pr create --fill`.","4. Monitor CI: `timeout 600 gh pr checks --watch` (auto-stops after 10 min).","5. Only start the next wave after checks are green."].join(`
219
- `)}function __(e,r,n="aas"){if(e)return e;return[`Wave ${r===null||r===void 0?"?":String(r)} is Oracle-verified. This is a THIRD-PARTY repo — land it as a contribution:`,"1. READ FIRST the repo's contribution rules (read CONTRIBUTING.md, PR/issue templates and guides) and follow them exactly.","2. Create a CLEAN dedicated branch for THIS PR: `git checkout -b <branch>` — each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem (then commit onto that same branch).",`3. Invoke the \`${n}\` MCP GitHub skills (search_skills → get_skill → compose_stack) to create the PR/issue.`,"4. Push the branch to your FORK (`git push -u origin HEAD`) and open the PR against the UPSTREAM repo following the repo's template.","5. Request review on the PR (add reviewers) and wait for CI to pass before starting the next wave."].join(`
220
- `)}function k_(e,r,n=n_){if(e==="own"||e==="third-party")return e;try{let o=n("gh repo view --json isFork,parent",{cwd:r,stdio:"pipe",timeout:1e4}),t=JSON.parse(String(o));if(t.isFork===!0&&t.parent!==null&&t.parent!==void 0)return"third-party";return"own"}catch{try{let o=n("git remote -v",{cwd:r,stdio:"pipe",timeout:1e4});if(String(o).split(`
221
- `).some((i)=>/^\s*upstream\s+/.test(i)))return"third-party"}catch{}return"own"}}var $_=Xp();function to(e,r){return $_(e,r)}to.id="omo-meta-governor";to.server=to;var yS=to;export{yS as default};
222
-
223
- //# debugId=4D56165EDF6D78A364756E2164756E21
209
+ Current decision: ${e.message}`;let Bv=`[${e.action}] ${e.message}`;if(R.recentInterventionTexts?.slice(-1)[0]!==Bv)R.recentInterventionTexts=[...R.recentInterventionTexts??[],Bv].slice(-$$);let sk={type:"text",text:i,synthetic:!0};L.messages.push({info:{role:"user",agent:"meta-governor"},parts:[sk]}),q4(G,i)},"experimental.chat.system.transform":async(Q,L)=>{if(!E.enabled)return;if(E.protocolEnforcement.injectIntoSystem&&j4){let w=Q.sessionID?P$.get(Q.sessionID):void 0;L.system.push(`
210
+ ### Sisyphus Protocol Enforcement`,m_(j4,{oracleVerified:w?.oracleInvoked===!0,filesChanged:w?.filesChanged??0}),"---")}if(Q.sessionID){let w=b.getCachedContext(Q.sessionID);if(w)L.system.push(`
211
+ ### Graph Context (auto-retrieved)`,w,"---")}if(E.intervention.mode==="system"&&Q.sessionID){let w=P$.get(Q.sessionID);if(w?.interventionDisabled){c$(Q.sessionID);return}let G=c$(Q.sessionID);if(G&&G.action!=="continue"&&G.message){if(C_(G.action,E.intervention.minActionForMessage)){if(w){let s=Math.max(0,E.intervention.maxInterventionsPerSession??0);if(s>0&&w.interventionCount>=s){w.interventionDisabled=!0;return}w.interventionCount++}L.system.push(`
212
+ [MetaGovernor Intervention]`,G.message,"---")}}}},tool:{omo_search:_,omo_recall:N,omo_health:O,omo_find:k,omo_impact:J,omo_remember:W,omo_recall_mcp:Y,omo_path:I,omo_explain:j,omo_files:B,omo_callers:x,omo_node:g,omo_context:y,omo_affected_cg:T,omo_status:t,omo_unlock:Q$,omo_mark_dirty:Pv,omo_sync_if_dirty:u_,omo_index:h_,omo_visualize:y_,omo_serve:f_,omo_uninit:n_,omo_diagnose:i_,omo_merge_graphs:l_,omo_save_result:o_,omo_extract:d_,omo_cluster_only:p_,omo_label:t_,omo_tree:e_,omo_clone:a_,omo_add:s_,omo_check_update:$N,omo_hook_status:vN,omo_cli_anything_install:UN,omo_cli_anything_list:bN,omo_cli_anything_search:rN,omo_cli_anything_info:zN},"experimental.session.compacting":async(Q,L)=>{if(!E.enabled||!E.closedLoop.enabled)return;let w=c4(),G=`session:${Q.sessionID}`,s=await w.smartSearch({query:G,limit:3});if(s.lessons.length>0){let z$=s.lessons.map((U$,e)=>`${e+1}. [${U$.id}] confidence=${U$.confidence.toFixed(2)}
213
+ ${U$.content.slice(0,300)}`).join(`
214
+
215
+ `);L.context.push(`
216
+ ### Past Lessons (auto-retrieved)`,z$,"---")}},"experimental.compaction.autocontinue":async(Q,L)=>{if(!E.enabled)return;if(P$.get(Q.sessionID)?.interventionDisabled)L.enabled=!1}}}}function b9($,U){if(typeof $!=="string"||$.length===0)return[];let b=$.split(`
217
+ `),r=[];for(let v of b){let z=v.match(/^\s*(\S+)\s+(fail)\s+(.*)$/);if(z){let _=z[1].trim(),N=z[3].trim();r.push(`${U} · ${_}: ${N}`)}}return r}function r9($){if(typeof $!=="string"||$.length===0)return!1;let U=$.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])gh\s+pr(?:\s|$)/.test(U)}function z9($){if(typeof $!=="string"||$.length===0)return!1;let U=$.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+push(?:\s|$)/.test(U)}function _9($){try{let{execFileSync:U}=L$("node:child_process");return U("git",["rev-parse","HEAD"],{cwd:$,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim()||null}catch{return null}}function N9($){try{let{execFileSync:U}=L$("node:child_process"),r=U("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:$,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim();return r&&r!=="HEAD"?r:null}catch{return null}}var c_=new Map;async function O9($,U,b,r){let v=await Promise.resolve().then(() => (yk(),hk)),z=c_.get(r)??{lastPolledSha:null,lastFailureInjectionAtMs:0,pending:new Set};z.pending.add($),c_.set(r,z);try{v.triggerWorkflow(b.workflow,U);let _=Date.now(),N=null;while(Date.now()-_<b.maxWaitMs){if(N=v.getLatestRunForSha($),!N){await new Promise((O)=>setTimeout(O,b.pollIntervalMs));continue}if(N.status==="completed")break;await new Promise((O)=>setTimeout(O,b.pollIntervalMs))}if(!N||N.status!=="completed"){H("warn",`ci_monitor: timeout waiting for run on ${$.slice(0,7)} (${b.maxWaitMs}ms)`);return}if(z.lastPolledSha=$,N.conclusion==="failure"){let O=Date.now();if(O-z.lastFailureInjectionAtMs<60000)return;z.lastFailureInjectionAtMs=O;let k=v.getFailedLogs(N.databaseId,4000),J=[`[CI Monitor] GitHub Actions run #${N.databaseId} FAILED on ${U}@${$.slice(0,7)}.`,"",`Title: ${N.displayTitle}`,`URL: ${N.url}`,`Conclusion: ${N.conclusion}`,"","── FAILED-STEP LOGS (truncated) ──",k||"(no failed-log output available — run `gh run view "+N.databaseId+" --log-failed` for full output)","","── ACTION ──",b.failOnly?"Read the failed logs above, identify which tests broke, run them locally to reproduce, fix, and re-push. Use `bun run typecheck` first (fastest signal), then run only the failing test files.":"Review the run and take action."].join(`
218
+ `);H("warn",`ci_monitor: CI failed for ${$.slice(0,7)} — ${N.url}`);let Y=await(await Promise.resolve().then(() => (e6(),R2))).persistSessionMessage(r,J,1e4);if(!Y.ok)H("warn",`ci_monitor: failed to inject failure message: ${Y.error??"unknown"}`)}else if(N.conclusion==="success")H("info",`ci_monitor: run #${N.databaseId} passed for ${$.slice(0,7)}`);else H("info",`ci_monitor: run #${N.databaseId} conclusion=${N.conclusion} for ${$.slice(0,7)}`)}finally{z.pending.delete($),c_.set(r,z)}}function k9($,U){if(U>=1)return!1;try{return aw(fk($,"PLAN.md")),!1}catch{}try{let b=ok(fk($,"AGENTS.md"),"utf-8");if(/^##\s+Plan\b/im.test(b))return!1}catch{}return!0}function I9($){if(typeof $!=="string"||$.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test($)}function J9($){if(typeof $!=="string"||$.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test($)||/<promise>\s*PHASE-\d+-COMPLETE\s*<\/promise>/i.test($)}function X9($){if(typeof $!=="string"||$.length===0)return!1;return/<promise>\s*PLAN-COMPLETE\s*<\/promise>/i.test($)}function K9($){let U=/(?:<promise>\s*)?PHASE-(\d+)-COMPLETE\s*(?:<\/promise>)?/i.exec($);return U?Number.parseInt(U[1],10):null}function ik($){let U=2166136261;for(let b=0;b<$.length;b++)U^=$.charCodeAt(b),U=Math.imul(U,16777619);return(U>>>0).toString(36)}function w9($,U,b){if(U.enabled===!1)return!1;let r=$.postWave.currentWaveN;if(r===null)return!1;if(!(r in $.postWave.oracleAfterPhaseAtMs))return!1;let v=U.maxRetriesPerWave??1,z=U.reinjectCooldownMs??60000,_=$.postWave.lastInjectedWaveN===r;if(_&&$.postWave.postWaveInjectionsThisWave>=v)return!1;if(_&&$.postWave.lastInjectedAtMs!==null&&b-$.postWave.lastInjectedAtMs<z)return!1;return!0}function Q9($,U){if($)return $;return[`Wave ${U===null||U===void 0?"?":String(U)} is Oracle-verified. Land it now:`,"1. Use a CLEAN dedicated branch for this PR: `git checkout -b <branch>` (each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem).","2. `git push -u origin HEAD` (sets upstream on first push).","3. If no PR exists yet: `gh pr create --fill`.","4. Monitor CI: `timeout 600 gh pr checks --watch` (auto-stops after 10 min).","5. Only start the next wave after checks are green."].join(`
219
+ `)}function Y9($,U,b="aas"){if($)return $;return[`Wave ${U===null||U===void 0?"?":String(U)} is Oracle-verified. This is a THIRD-PARTY repo — land it as a contribution:`,"1. READ FIRST the repo's contribution rules (read CONTRIBUTING.md, PR/issue templates and guides) and follow them exactly.","2. Create a CLEAN dedicated branch for THIS PR: `git checkout -b <branch>` — each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem (then commit onto that same branch).",`3. Invoke the \`${b}\` MCP GitHub skills (search_skills → get_skill → compose_stack) to create the PR/issue.`,"4. Push the branch to your FORK (`git push -u origin HEAD`) and open the PR against the UPSTREAM repo following the repo's template.","5. Request review on the PR (add reviewers) and wait for CI to pass before starting the next wave."].join(`
220
+ `)}function W9($,U,b=sw){if($==="own"||$==="third-party")return $;try{let r=b("gh repo view --json isFork,parent",{cwd:U,stdio:"pipe",timeout:1e4}),v=JSON.parse(String(r));if(v.isFork===!0&&v.parent!==null&&v.parent!==void 0)return"third-party";return"own"}catch{try{let r=b("git remote -v",{cwd:U,stdio:"pipe",timeout:1e4});if(String(r).split(`
221
+ `).some((z)=>/^\s*upstream\s+/.test(z)))return"third-party"}catch{}return"own"}}var j9=dk();function s6($,U){return j9($,U)}s6.id="omo-meta-governor";s6.server=s6;var w3=s6;export{w3 as default};
222
+
223
+ //# debugId=FE0BA67A1433FD2B64756E2164756E21
224
224
  //# sourceMappingURL=index.js.map