@precisionutilityguild/liquid-shadow 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,17 @@
1
1
  #!/usr/bin/env node
2
- var o_=Object.defineProperty;var de=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{for(var r in e)o_(n,r,{get:e[r],enumerable:!0})};import Jx from"pino";var Vx,Gx,$,J=de(()=>{"use strict";Vx={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},Gx=Jx({level:process.env.LOG_LEVEL||"info",base:{service:"liquid-shadow"},formatters:{level(n,e){return{level:n,severity:Vx[e]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),$=Gx});import Dr from"fs";import Zp from"path";import{fileURLToPath as Yx}from"url";function e$(n){n.exec(`
2
+ var E_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ae=(n,e)=>{for(var r in e)E_(n,r,{get:e[r],enumerable:!0})};import d$ from"pino";var m$,f$,x,K=pe(()=>{"use strict";m$={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},f$=d$({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(n,e){return{level:n,severity:m$[e]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),x=f$});import Mr from"fs";import Qp from"path";import{fileURLToPath as y$}from"url";function b$(n){n.exec(`
3
3
  CREATE TABLE IF NOT EXISTS schema_migrations (
4
4
  version INTEGER PRIMARY KEY,
5
5
  name TEXT NOT NULL,
6
6
  applied_at REAL DEFAULT (unixepoch())
7
7
  );
8
- `)}function t$(n){e$(n);let e=n.prepare("SELECT version FROM schema_migrations ORDER BY version").all();return new Set(e.map(r=>r.version))}function n$(){let n=Qx;if(!Dr.readdirSync(n).some(o=>o.match(/^\d{3}_.*\.sql$/))){let o=Zp.resolve(n,"../../data/migrations");Dr.existsSync(o)&&Dr.readdirSync(o).some(a=>a.match(/^\d{3}_.*\.sql$/))&&(n=o)}let i=Dr.readdirSync(n).filter(o=>o.match(/^\d{3}_.*\.sql$/)).sort(),t=[];for(let o of i){let s=o.match(/^(\d{3})_(.+)\.sql$/);if(!s)continue;let a=parseInt(s[1],10),c=s[2],u=Dr.readFileSync(Zp.join(n,o),"utf-8").split(/^-- DOWN$/m),p=u[0].trim(),d=u[1]?.trim();t.push({version:a,name:c,up:p,down:d})}return t}function r$(n,e){Or.info({version:e.version,name:e.name},"Applying migration"),n.transaction(()=>{n.exec(e.up),n.prepare("INSERT INTO schema_migrations (version, name) VALUES (?, ?)").run(e.version,e.name)})(),Or.info({version:e.version},"Migration applied successfully")}function Ph(n){let e=t$(n),i=n$().filter(t=>!e.has(t.version));if(i.length===0){Or.debug("No pending migrations");return}Or.info({count:i.length},"Running pending migrations");for(let t of i)r$(n,t);Or.info("All migrations complete")}var Or,Xx,Qx,Nh=de(()=>{"use strict";J();Or=$.child({module:"migrations"}),Xx=Yx(import.meta.url),Qx=Zp.dirname(Xx)});import i$ from"better-sqlite3";import Jo from"path";import Hp from"fs";import zh from"crypto";import o$ from"os";function Go(n){let e=o$.homedir(),r=Jo.join(e,".mcp-liquid-shadow"),i=Jo.join(r,"dbs");Hp.existsSync(i)||Hp.mkdirSync(i,{recursive:!0});let t=zh.createHash("sha256").update(n).digest("hex").substring(0,12),s=`${Jo.basename(n).replace(/[^a-zA-Z0-9-_]/g,"_")}_${t}.db`;return Jo.join(i,s)}function s$(n,e){let r=e||Go(n);mt.info({repoPath:n,dbPath:r},"Initializing database");let i=new i$(r);return i.pragma("journal_mode = WAL"),i.pragma("busy_timeout = 5000"),Ph(i),Vo.set(n,r),Rt.set(r,i),mt.info({repoPath:n,dbPath:r},"Database initialized successfully"),i}function Wp(n){return zh.createHash("sha256").update(n,"utf8").digest("hex")}function Dh(n,e){return e?Wp(n)!==e:!0}function Oe(n){let e=Vo.get(n)||Go(n),r=Rt.get(e);if(r){if(r.open)return r;Rt.delete(e)}let i=s$(n);return Rt.set(e,i),i}function et(n){let e=Go(n);if(!Hp.existsSync(e))return!1;try{let r=Oe(n);return r.prepare(`
8
+ `)}function x$(n){b$(n);let e=n.prepare("SELECT version FROM schema_migrations ORDER BY version").all();return new Set(e.map(r=>r.version))}function $$(){let n=_$;if(!Mr.readdirSync(n).some(o=>o.match(/^\d{3}_.*\.sql$/))){let o=Qp.resolve(n,"../../data/migrations");Mr.existsSync(o)&&Mr.readdirSync(o).some(a=>a.match(/^\d{3}_.*\.sql$/))&&(n=o)}let i=Mr.readdirSync(n).filter(o=>o.match(/^\d{3}_.*\.sql$/)).sort(),t=[];for(let o of i){let s=o.match(/^(\d{3})_(.+)\.sql$/);if(!s)continue;let a=parseInt(s[1],10),c=s[2],u=Mr.readFileSync(Qp.join(n,o),"utf-8").split(/^-- DOWN$/m),p=u[0].trim(),d=u[1]?.trim();t.push({version:a,name:c,up:p,down:d})}return t}function S$(n,e){Ur.info({version:e.version,name:e.name},"Applying migration"),n.transaction(()=>{n.exec(e.up),n.prepare("INSERT INTO schema_migrations (version, name) VALUES (?, ?)").run(e.version,e.name)})(),Ur.info({version:e.version},"Migration applied successfully")}function jh(n){let e=x$(n),i=$$().filter(t=>!e.has(t.version));if(i.length===0){Ur.debug("No pending migrations");return}Ur.info({count:i.length},"Running pending migrations");for(let t of i)S$(n,t);Ur.info("All migrations complete")}var Ur,v$,_$,Mh=pe(()=>{"use strict";K();Ur=x.child({module:"migrations"}),v$=y$(import.meta.url),_$=Qp.dirname(v$)});import k$ from"better-sqlite3";import ts from"path";import ed from"fs";import Uh from"crypto";import E$ from"os";function rs(n){let e=E$.homedir(),r=ts.join(e,".mcp-liquid-shadow"),i=ts.join(r,"dbs");ed.existsSync(i)||ed.mkdirSync(i,{recursive:!0});let t=Uh.createHash("sha256").update(n).digest("hex").substring(0,12),s=`${ts.basename(n).replace(/[^a-zA-Z0-9-_]/g,"_")}_${t}.db`;return ts.join(i,s)}function w$(n,e){let r=e||rs(n);ft.debug({repoPath:n,dbPath:r},"Initializing database");let i=new k$(r);return i.pragma("journal_mode = WAL"),i.pragma("busy_timeout = 5000"),jh(i),ns.set(n,r),Nt.set(r,i),ft.debug({repoPath:n,dbPath:r},"Database initialized successfully"),i}function Wn(n){return Uh.createHash("sha256").update(n,"utf8").digest("hex")}function Fh(n,e){return e?Wn(n)!==e:!0}function Oe(n){let e=ns.get(n)||rs(n),r=Nt.get(e);if(r){if(r.open)return r;Nt.delete(e)}let i=w$(n);return Nt.set(e,i),i}function rt(n){let e=rs(n);if(!ed.existsSync(e))return!1;try{let r=Oe(n);return r.prepare(`
9
9
  SELECT value FROM index_metadata
10
10
  WHERE key = 'index_completed'
11
- `).get()?.value==="true"?!0:r.prepare("SELECT COUNT(*) as count FROM files").get().count>0}catch(r){return mt.debug({repoPath:n,error:r},"Error checking index status"),!1}}function Bp(n,e){let r=Oe(n);r.prepare(`
12
- INSERT OR REPLACE INTO index_metadata (key, value, updated_at)
13
- VALUES ('index_completed', 'true', unixepoch())
14
- `).run(),r.prepare(`
15
- INSERT OR REPLACE INTO index_metadata (key, value, updated_at)
16
- VALUES ('last_indexed_at', ?, unixepoch())
17
- `).run(Date.now().toString()),e&&r.prepare(`
18
- INSERT OR REPLACE INTO index_metadata (key, value, updated_at)
19
- VALUES ('last_indexed_commit', ?, unixepoch())
20
- `).run(e),mt.info({repoPath:n,commitSha:e},"Repository marked as indexed")}function Oh(n){try{return Oe(n).prepare(`
11
+ `).get()?.value==="true"?!0:r.prepare("SELECT COUNT(*) as count FROM files").get().count>0}catch(r){return ft.debug({repoPath:n,error:r},"Error checking index status"),!1}}function td(n,e){let r=Oe(n),i=r.prepare("INSERT OR REPLACE INTO index_metadata (key, value, updated_at) VALUES (?, ?, unixepoch())");r.transaction(()=>{i.run("index_completed","true"),i.run("last_indexed_at",Date.now().toString()),e&&i.run("last_indexed_commit",e)})(),ft.debug({repoPath:n,commitSha:e},"Repository marked as indexed")}function Zh(n){try{return Oe(n).prepare(`
21
12
  SELECT value FROM index_metadata
22
13
  WHERE key = 'last_indexed_commit'
23
- `).get()?.value||null}catch(e){return mt.debug({repoPath:n,error:e},"Error getting last indexed commit"),null}}function Ah(n){let e=Vo.get(n)||Go(n),r=Rt.get(e);r&&(r.open&&(mt.info({repoPath:n,dbPath:e},"Closing database connection"),r.close()),Rt.delete(e)),Vo.delete(n)}function Lh(){for(let[n,e]of Rt.entries())try{e.open&&(mt.info({dbPath:n},"Closing database connection"),e.close())}catch(r){mt.error({dbPath:n,err:r},"Error closing database execution")}Rt.clear()}var mt,Rt,Vo,Ch,qt=de(()=>{"use strict";J();Nh();mt=$.child({module:"db"});Rt=new Map,Vo=new Map;process.on("exit",()=>Lh());Ch=n=>{mt.info({signal:n},"Received termination signal, closing databases"),Lh(),process.exit(0)};process.on("SIGINT",()=>Ch("SIGINT"));process.on("SIGTERM",()=>Ch("SIGTERM"))});var ye,tt=de(()=>{"use strict";ye=class{db;constructor(e){this.db=e}get database(){return this.db}all(e,...r){return this.db.prepare(e).all(...r)}get(e,...r){return this.db.prepare(e).get(...r)}run(e,...r){return this.db.prepare(e).run(...r).changes}insert(e,...r){return this.db.prepare(e).run(...r).lastInsertRowid}transaction(e){return this.db.transaction(e)()}}});import y$ from"path";var Ko,Gh=de(()=>{"use strict";tt();Ko=class extends ye{findByPath(e){return this.get("SELECT * FROM files WHERE path = ?",e)}findAll(e){let r="SELECT * FROM files ORDER BY path ASC";return e&&(r+=` LIMIT ${e}`),this.all(r)}getAllPaths(){return this.all("SELECT path FROM files").map(r=>r.path)}findInSubPath(e,r){let i=y$.resolve(e,r),t=i.endsWith("/")?i:i+"/";return this.all(`
14
+ `).get()?.value||null}catch(e){return ft.debug({repoPath:n,error:e},"Error getting last indexed commit"),null}}function Wh(n){let e=ns.get(n)||rs(n),r=Nt.get(e);r&&(r.open&&(ft.debug({repoPath:n,dbPath:e},"Closing database connection"),r.close()),Nt.delete(e)),ns.delete(n)}function Hh(){for(let[n,e]of Nt.entries())try{e.open&&(ft.debug({dbPath:n},"Closing database connection"),e.close())}catch(r){ft.error({dbPath:n,err:r},"Error closing database execution")}Nt.clear()}var ft,Nt,ns,Bh,Kt=pe(()=>{"use strict";K();Mh();ft=x.child({module:"db"});Nt=new Map,ns=new Map;process.on("exit",()=>Hh());Bh=n=>{ft.debug({signal:n},"Received termination signal, closing databases"),Hh(),process.exit(0)};process.on("SIGINT",()=>Bh("SIGINT"));process.on("SIGTERM",()=>Bh("SIGTERM"))});var ge,it=pe(()=>{"use strict";ge=class{db;constructor(e){this.db=e}get database(){return this.db}all(e,...r){return this.db.prepare(e).all(...r)}get(e,...r){return this.db.prepare(e).get(...r)}run(e,...r){return this.db.prepare(e).run(...r).changes}insert(e,...r){return this.db.prepare(e).run(...r).lastInsertRowid}transaction(e){return this.db.transaction(e)()}}});import F$ from"path";var os,rg=pe(()=>{"use strict";it();os=class extends ge{findByPath(e){return this.get("SELECT * FROM files WHERE path = ?",e)}findAll(e){let r="SELECT * FROM files ORDER BY path ASC";return e&&(r+=` LIMIT ${e}`),this.all(r)}getAllPaths(){return this.all("SELECT path FROM files").map(r=>r.path)}findInSubPath(e,r){let i=F$.resolve(e,r),t=i.endsWith("/")?i:i+"/";return this.all(`
24
15
  SELECT * FROM files
25
16
  WHERE (path LIKE ? OR path = ?)
26
17
  ORDER BY path ASC
@@ -88,7 +79,7 @@ var o_=Object.defineProperty;var de=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
88
79
  FROM files
89
80
  WHERE path LIKE ? || '/%/package.json'
90
81
  `,e,e)}deletePaths(e){if(e.length===0)return;let r=this.db.prepare("DELETE FROM files WHERE path = ?");this.db.transaction(t=>{for(let o of t)r.run(o)})(e)}updateMtime(e,r){this.run("UPDATE files SET mtime = ? WHERE path = ?",r,e)}batchSaveIndexResults(e,r,i,t){let o=this.db.prepare("DELETE FROM exports WHERE file_path = ?"),s=this.db.prepare("DELETE FROM imports WHERE file_path = ?"),a=this.db.prepare("DELETE FROM configs WHERE file_path = ?"),c=this.db.prepare("DELETE FROM file_content WHERE file_path = ?"),l=this.db.prepare("DELETE FROM event_synapses WHERE file_path = ?"),u=this.db.prepare("INSERT INTO exports (file_path, name, kind, signature, doc, start_line, end_line, classification, capabilities, parent_id, embedding) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"),p=this.db.prepare("INSERT INTO imports (file_path, module_specifier, imported_symbols, resolved_path) VALUES (?, ?, ?, ?)"),d=this.db.prepare("INSERT INTO configs (file_path, key, value, kind) VALUES (?, ?, ?, ?)"),m=this.db.prepare("INSERT INTO file_content (file_path, content) VALUES (?, ?)"),f=this.db.prepare("INSERT INTO event_synapses (file_path, type, name, direction, line_number, code_snippet) VALUES (?, ?, ?, ?, ?, ?)"),h=this.db.prepare(`
91
- INSERT INTO files (path, mtime, last_scanned_at, classification, summary, embedding, content_hash)
82
+ INSERT INTO files (path, mtime, last_scanned_at, classification, summary, embedding, content_hash)
92
83
  VALUES (?, ?, ?, ?, ?, ?, ?)
93
84
  ON CONFLICT(path) DO UPDATE SET
94
85
  mtime=excluded.mtime,
@@ -97,7 +88,7 @@ var o_=Object.defineProperty;var de=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
97
88
  summary=excluded.summary,
98
89
  embedding=excluded.embedding,
99
90
  content_hash=excluded.content_hash
100
- `);this.db.transaction(v=>{for(let g of v){let{meta:x,exports:I,imports:E,configs:w,events:T,content:O,classification:V,summary:k,embedding:D}=g;o.run(x.path),s.run(x.path),a.run(x.path),c.run(x.path),l.run(x.path);let H=O?i(O):null;if(h.run(x.path,x.mtime,Date.now(),V||"Unknown",k||"",D?JSON.stringify(D):null,H),I){let L=(Y,U,C)=>{for(let A of U){let Z=A.embedding?JSON.stringify(A.embedding):null,W=u.run(Y,A.name,A.kind,A.signature,A.doc||"",A.line,A.endLine||A.line,A.classification||"Other",A.capabilities||"[]",C,Z);A.members&&A.members.length>0&&L(Y,A.members,W.lastInsertRowid)}};L(x.path,I,null)}if(E)for(let L of E){let Y=t(L.module,x.path,r);p.run(x.path,L.module,L.name,Y)}if(w)for(let L of w)d.run(x.path,L.key,L.value,L.kind);if(O!==void 0&&m.run(x.path,O),T)for(let L of T)f.run(x.path,L.type,L.name,L.direction,L.line,L.snippet)}})(e)}getLatestScanTime(){return this.get("SELECT MAX(last_scanned_at) as t FROM files")?.t||null}}});var Yo,qh=de(()=>{"use strict";tt();Yo=class extends ye{findByNameAndFile(e,r){return this.all("SELECT * FROM exports WHERE file_path = ? AND name = ?",r,e)}findByNameGlobal(e){return this.all("SELECT * FROM exports WHERE name = ?",e)}findAtLine(e,r){return this.get(`
91
+ `),_=this.db.transaction(g=>{for(let b of g){let{meta:S,exports:k,imports:w,configs:R,events:j,content:B,classification:T,summary:O,embedding:J,contentHash:V}=b;o.run(S.path),s.run(S.path),a.run(S.path),c.run(S.path),l.run(S.path);let q=V??(B&&i?i(B):null);if(h.run(S.path,S.mtime,Date.now(),T||"Unknown",O||"",J?JSON.stringify(J):null,q),k){let I=(C,U,M)=>{for(let L of U){let Z=L.embedding?JSON.stringify(L.embedding):null,ee=u.run(C,L.name,L.kind,L.signature,L.doc||"",L.line,L.endLine||L.line,L.classification||"Other",L.capabilities||"[]",M,Z);L.members&&L.members.length>0&&I(C,L.members,ee.lastInsertRowid)}};I(S.path,k,null)}if(w)for(let I of w){let C=I.resolved_path!==void 0?I.resolved_path:t?.(I.module,S.path,r)??"";p.run(S.path,I.module,I.name,C)}if(R)for(let I of R)d.run(S.path,I.key,I.value,I.kind);if(B!==void 0&&m.run(S.path,B),j)for(let I of j)f.run(S.path,I.type,I.name,I.direction,I.line,I.snippet)}}),v=500;for(let g=0;g<e.length;g+=v)_(e.slice(g,g+v))}getLatestScanTime(){return this.get("SELECT MAX(last_scanned_at) as t FROM files")?.t||null}}});var ss,ig=pe(()=>{"use strict";it();ss=class extends ge{findByNameAndFile(e,r){return this.all("SELECT * FROM exports WHERE file_path = ? AND name = ?",r,e)}findByNameGlobal(e){return this.all("SELECT * FROM exports WHERE name = ?",e)}findAtLine(e,r){return this.get(`
101
92
  SELECT * FROM exports
102
93
  WHERE file_path = ? AND start_line <= ? AND end_line >= ?
103
94
  ORDER BY (end_line - start_line) ASC -- Get innermost symbol
@@ -231,7 +222,7 @@ var o_=Object.defineProperty;var de=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
231
222
  OR name LIKE ?
232
223
  OR name LIKE ?
233
224
  LIMIT 10
234
- `,e,`%.${e}`,`%::${e}`)}}});var Kh,Yh=de(()=>{"use strict";Kh=`
225
+ `,e,`%.${e}`,`%::${e}`)}}});var og,sg=pe(()=>{"use strict";og=`
235
226
  WITH RECURSIVE dependency_chain AS (
236
227
  -- Base case: Direct dependents of the target symbol
237
228
  -- Meaning: Files that import the file where the symbol is defined
@@ -282,7 +273,7 @@ SELECT DISTINCT
282
273
  dc.imported_symbols
283
274
  FROM dependency_chain dc
284
275
  ORDER BY dc.depth, dc.consumer_path;
285
- `});var Xo,Xh=de(()=>{"use strict";tt();Yh();Xo=class extends ye{findByFile(e){return this.all("SELECT * FROM imports WHERE file_path = ?",e)}findByFiles(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM imports WHERE file_path IN (${r}) ORDER BY file_path`,...e)}getAllResolved(){return this.all(`
276
+ `});var as,ag=pe(()=>{"use strict";it();sg();as=class extends ge{findByFile(e){return this.all("SELECT * FROM imports WHERE file_path = ?",e)}findByFiles(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM imports WHERE file_path IN (${r}) ORDER BY file_path`,...e)}getAllResolved(){return this.all(`
286
277
  SELECT * FROM imports
287
278
  WHERE resolved_path IS NOT NULL AND resolved_path != ''
288
279
  `)}findDependents(e){return this.all("SELECT * FROM imports WHERE resolved_path = ?",e)}countByFile(e){return this.get("SELECT COUNT(*) as count FROM imports WHERE file_path = ?",e)?.count||0}countDependents(e){return this.get("SELECT COUNT(*) as count FROM imports WHERE resolved_path = ?",e)?.count||0}getImportsForFile(e){return this.all("SELECT module_specifier, imported_symbols, resolved_path FROM imports WHERE file_path = ?",e)}findImportSource(e,r){return this.get(`
@@ -308,7 +299,7 @@ ORDER BY dc.depth, dc.consumer_path;
308
299
  SELECT COUNT(*) as count FROM imports
309
300
  WHERE resolved_path IN (${i})
310
301
  AND (imported_symbols LIKE ? OR imported_symbols = '' OR imported_symbols = '*')
311
- `,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(Kh,e,r,i,r)}getCount(){return this.get("SELECT COUNT(*) as count FROM imports")?.count||0}}});var Qo,Qh=de(()=>{"use strict";tt();Qo=class extends ye{findById(e){return this.get("SELECT * FROM missions WHERE id = ?",e)}findByIds(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM missions WHERE id IN (${r})`,...e)}findActive(e){let r="SELECT * FROM missions WHERE status IN ('in-progress', 'planned', 'verifying')",i=[];return e&&(r+=" AND git_branch = ?",i.push(e)),r+=` ORDER BY
302
+ `,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(og,e,r,i,r)}getCount(){return this.get("SELECT COUNT(*) as count FROM imports")?.count||0}}});var cs,cg=pe(()=>{"use strict";it();cs=class extends ge{findById(e){return this.get("SELECT * FROM missions WHERE id = ?",e)}findByIds(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM missions WHERE id IN (${r})`,...e)}findActive(e){let r="SELECT * FROM missions WHERE status IN ('in-progress', 'planned', 'verifying')",i=[];return e&&(r+=" AND git_branch = ?",i.push(e)),r+=` ORDER BY
312
303
  CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
313
304
  created_at ASC`,this.all(r,...i)}findAll(e){let r="SELECT * FROM missions",i=[];return e&&(r+=" WHERE status = ?",i.push(e)),r+=` ORDER BY
314
305
  CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
@@ -363,7 +354,7 @@ ORDER BY dc.depth, dc.consumer_path;
363
354
  SELECT linked_repo_path, linked_mission_id, relationship, direction
364
355
  FROM cross_repo_links
365
356
  WHERE mission_id = ?
366
- `,e)}catch{return[]}}findLastMission(){return this.get("SELECT * FROM missions ORDER BY updated_at DESC, id DESC LIMIT 1")}findActiveByPriority(){return this.get("SELECT * FROM missions WHERE status IN ('in-progress', 'active', 'verifying') ORDER BY CASE WHEN status = 'in-progress' THEN 0 ELSE 1 END, created_at ASC LIMIT 1")}}});var es,eg=de(()=>{"use strict";tt();es=class extends ye{findByMission(e,r=50){return this.all(`
357
+ `,e)}catch{return[]}}findLastMission(){return this.get("SELECT * FROM missions ORDER BY updated_at DESC, id DESC LIMIT 1")}findActiveByPriority(){return this.get("SELECT * FROM missions WHERE status IN ('in-progress', 'active', 'verifying') ORDER BY CASE WHEN status = 'in-progress' THEN 0 ELSE 1 END, created_at ASC LIMIT 1")}}});import{fileURLToPath as Z$}from"node:url";import{dirname as sd,join as ug,resolve as W$}from"node:path";import{existsSync as H$}from"node:fs";function J$(){let n=lg;for(;n!==sd(n);){if(H$(ug(n,"package.json")))return n;n=sd(n)}return W$(lg,"..","..")}function Dt(...n){return ug(J$(),...n)}var B$,lg,Wr=pe(()=>{"use strict";B$=Z$(import.meta.url),lg=sd(B$)});import{Worker as G$}from"node:worker_threads";import{cpus as V$}from"node:os";import{fileURLToPath as q$}from"node:url";import{dirname as K$,join as pg}from"node:path";import{existsSync as dg}from"node:fs";function Y$(){if(fg.endsWith(".ts")){let e=pg(mg,"worker.ts");if(dg(e))return e}let n=pg(mg,"worker.js");return dg(n)?n:Dt("dist/logic/domain/embeddings/worker.js")}function Xt(n){return Hn||(Hn=new Bn(n)),Hn}async function Qt(){Hn&&(await Hn.shutdown(),Hn=null)}var fg,mg,Bn,Hn,hg=pe(()=>{"use strict";K();Wr();fg=q$(import.meta.url),mg=K$(fg);Bn=class{workers=[];taskQueue=[];pendingTasks=new Map;taskIdCounter=0;initialized=!1;initPromise;shutdownRequested=!1;numWorkers;cacheDir;initTimeout;constructor(e={}){this.numWorkers=e.numWorkers??Math.max(1,Math.min(4,V$().length-1)),this.cacheDir=e.cacheDir??"./.cache",this.initTimeout=e.initTimeout??6e4}async initialize(){if(!this.initialized)return this.initPromise?this.initPromise:(this.initPromise=this._doInitialize(),this.initPromise)}async _doInitialize(){let e;try{x.info({numWorkers:this.numWorkers},"Initializing embedding worker pool");let r=new Promise((i,t)=>{e=setTimeout(()=>t(new Error(`Worker pool initialization timed out after ${this.initTimeout}ms`)),this.initTimeout)});if(await Promise.race([this._initializeWorkers(),r]),e&&clearTimeout(e),this.shutdownRequested){this.initialized=!1,this.initPromise=void 0,x.debug("Initialization completed but shutdown was requested");return}this.initialized=!0,x.info({numWorkers:this.workers.length},"Embedding worker pool ready")}catch(r){throw e&&clearTimeout(e),this.initPromise=void 0,this.initialized=!1,await this.shutdown(),r}}async _initializeWorkers(){let e=Y$();x.debug({workerPath:e},"Resolved worker path");let r=[];for(let i=0;i<this.numWorkers;i++)i>0&&await new Promise(t=>setTimeout(t,25)),r.push(this.createWorker(e,i));await Promise.all(r)}async createWorker(e,r){return new Promise((i,t)=>{let o=setTimeout(()=>{t(new Error(`Worker ${r} initialization timed out`))},this.initTimeout),s=new G$(e,{workerData:{cacheDir:this.cacheDir},execArgv:process.execArgv}),a={worker:s,busy:!1,currentTaskId:null};s.on("message",c=>{if(c.type==="ready"){if(clearTimeout(o),this.shutdownRequested){x.debug({workerIndex:r},"Worker ready but shutdown requested, terminating"),s.terminate().catch(()=>{}),i();return}this.workers.push(a),x.debug({workerIndex:r},"Worker ready"),i()}else c.type==="result"&&c.id?this.handleTaskComplete(a,c.id,c.embeddings||[]):c.type==="error"&&c.id&&this.handleTaskError(a,c.id,new Error(c.error||"Unknown error"))}),s.on("error",c=>{if(clearTimeout(o),x.error({err:c,workerIndex:r},"Worker error"),a.currentTaskId&&this.handleTaskError(a,a.currentTaskId,c),!this.initialized){t(c);return}let l=this.workers.indexOf(a);l!==-1&&this.workers.splice(l,1),!this.shutdownRequested&&this.initialized&&this.createWorker(e,r).catch(u=>{x.error({err:u},"Failed to replace crashed worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&x.warn({workerIndex:r,code:c},"Worker exited unexpectedly")})})}handleTaskComplete(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.resolve(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}handleTaskError(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.reject(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}processQueue(){if(this.taskQueue.length===0)return;let e=this.workers.find(i=>!i.busy);if(!e)return;let r=this.taskQueue.shift();r&&(e.busy=!0,e.currentTaskId=r.id,this.pendingTasks.set(r.id,r),e.worker.postMessage({type:"embed",id:r.id,texts:r.texts}))}async generateEmbeddings(e,r=128,i){if(this.initialized||await this.initialize(),e.length===0)return[];let t=[];for(let l=0;l<e.length;l+=r)t.push(e.slice(l,l+r));let o=new Array(t.length),s=0,a=t.map((l,u)=>new Promise((p,d)=>{let f={id:`task_${++this.taskIdCounter}`,texts:l,resolve:h=>{if(o[u]=h,s++,i){let _=Math.min(s*r,e.length);i(_,e.length)}p()},reject:h=>{if(o[u]=new Array(l.length).fill(null),s++,x.warn({err:h,chunkIndex:u},"Chunk embedding failed"),i){let _=Math.min(s*r,e.length);i(_,e.length)}p()}};this.taskQueue.push(f),this.processQueue()}));await Promise.all(a);let c=[];for(let l of o)c.push(...l);return x.info({total:e.length,successful:c.filter(l=>l!==null).length,workers:this.workers.length},"Parallel embedding generation complete"),c}get workerCount(){return this.workers.length}get busyWorkers(){return this.workers.filter(e=>e.busy).length}get queueSize(){return this.taskQueue.length}get isInitialized(){return this.initialized}async shutdown(){if(this.shutdownRequested=!0,this.initPromise)try{await this.initPromise}catch{}if(!this.initialized&&this.workers.length===0){this.shutdownRequested=!1,this.initPromise=void 0;return}x.info({numWorkers:this.workers.length},"Shutting down embedding worker pool");let e=this.workers.map(r=>new Promise(i=>{r.worker.postMessage({type:"shutdown"}),r.worker.once("exit",()=>i()),setTimeout(()=>{r.worker.terminate().then(()=>i())},5e3)}));await Promise.all(e),this.workers=[],this.taskQueue=[],this.pendingTasks.clear(),this.initialized=!1,this.shutdownRequested=!1,x.info("Embedding worker pool shutdown complete")}},Hn=null});var ld={};Ae(ld,{EmbeddingPriorityQueue:()=>ls,EmbeddingWorkerPool:()=>Bn,cosineSimilarity:()=>Br,generateEmbedding:()=>us,generateEmbeddingsBatch:()=>ps,getDefaultPool:()=>Xt,setUseWorkerThreads:()=>en,shutdownDefaultPool:()=>Qt});async function X$(){return Hr||(Hr=await import("@xenova/transformers"),Hr.env.cacheDir="./.cache",Hr.env.allowLocalModels=!0),Hr}function en(n){cd=n,x.info({useWorkerThreads:n},"Worker thread mode updated")}async function yg(){return ad||(ad=(async()=>{x.info("Loading embedding model (all-MiniLM-L6-v2)...");let{pipeline:n}=await X$();return await n("feature-extraction","Xenova/all-MiniLM-L6-v2")})()),ad}async function us(n){try{let r=await(await yg())(n,{pooling:"mean",normalize:!0});return Array.from(r.data)}catch(e){return x.error({err:e},"Failed to generate embedding"),null}}async function ps(n,e=gg,r){return n.length===0?[]:cd?Xt().generateEmbeddings(n,e,r):vg(n,e,r)}async function vg(n,e,r){let i=new Array(n.length).fill(null),t=await yg();for(let o=0;o<n.length;o+=e){let s=Math.min(o+e,n.length),a=n.slice(o,s);try{let c=await t(a,{pooling:"mean",normalize:!0}),[l,u]=c.dims;for(let p=0;p<l;p++){let d=p*u,m=d+u;i[o+p]=Array.from(c.data.slice(d,m))}}catch(c){x.error({err:c,batchStart:o,batchEnd:s},"Single-threaded batch embedding failed, falling back to sequential for this chunk");for(let l=0;l<a.length;l++)try{let u=a[l];if(!u||u.trim().length===0)continue;let p=await t(u,{pooling:"mean",normalize:!0});i[o+l]=Array.from(p.data)}catch{i[o+l]=null}}r&&r(s,n.length)}return x.debug({total:n.length,successful:i.filter(o=>o!==null).length},"Batch embedding complete"),i}function Br(n,e){let r=0,i=0,t=0;for(let o=0;o<n.length;o++)r+=n[o]*e[o],i+=n[o]*n[o],t+=e[o]*e[o];return r/(Math.sqrt(i)*Math.sqrt(t))}var Hr,gg,cd,ad,ls,tn=pe(()=>{"use strict";K();hg();Hr=null;gg=128,cd=!1;ad=null;ls=class{queue=[];processing=!1;results=new Map;enqueue(e){this.queue.push(e),this.queue.sort((r,i)=>i.priority-r.priority)}enqueueMany(e){this.queue.push(...e),this.queue.sort((r,i)=>i.priority-r.priority)}get size(){return this.queue.length}get isProcessing(){return this.processing}getResult(e){return this.results.get(e)}async processQueue(e=gg,r){if(this.processing)return x.warn("Queue processing already in progress"),this.results;this.processing=!0;let i=this.queue.length;try{cd?await this.processQueueParallel(e,i,r):await this.processQueueSequential(e,i,r)}finally{this.processing=!1}return this.results}async processQueueSequential(e,r,i){for(;this.queue.length>0;){let t=this.queue.splice(0,e),o=t.map(a=>a.text),s=await vg(o,o.length);if(t.forEach((a,c)=>{this.results.set(a.id,s[c])}),i){let a=r-this.queue.length;i(a,r)}}}async processQueueParallel(e,r,i){let t=this.queue.splice(0),o=t.map(c=>c.text),a=await Xt().generateEmbeddings(o,e,(c,l)=>{i&&i(c,l)});t.forEach((c,l)=>{this.results.set(c.id,a[l])})}clear(){this.queue=[],this.results.clear()}}});var ds,_g=pe(()=>{"use strict";it();K();ds=class n extends ge{findByMission(e,r=50){return this.all(`
367
358
  SELECT * FROM intent_logs
368
359
  WHERE mission_id = ?
369
360
  ORDER BY created_at DESC
@@ -373,10 +364,10 @@ ORDER BY dc.depth, dc.consumer_path;
373
364
  WHERE type IN ('decision', 'system', 'fix', 'heritage', 'adr')
374
365
  ORDER BY created_at DESC
375
366
  LIMIT ?
376
- `,e)}create(e){return this.insert(`
367
+ `,e)}create(e){let r=this.insert(`
377
368
  INSERT INTO intent_logs (mission_id, symbol_id, file_path, type, content, confidence, symbol_name, signature, commit_sha)
378
369
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
379
- `,e.mission_id,e.symbol_id,e.file_path,e.type,e.content,e.confidence,e.symbol_name,e.signature,e.commit_sha)}delete(e){this.run("DELETE FROM intent_logs WHERE id = ?",e)}update(e,r){let i=Object.keys(r);if(i.length===0)return;let t=i.map(s=>`${s} = ?`).join(", "),o=Object.values(r);o.push(e),this.run(`UPDATE intent_logs SET ${t} WHERE id = ?`,...o)}findRepairableOrphans(){return this.all(`
370
+ `,e.mission_id,e.symbol_id,e.file_path,e.type,e.content,e.confidence,e.symbol_name,e.signature,e.commit_sha);return n.EMBEDDABLE_TYPES.has(e.type)&&this.generateAndStoreEmbedding(Number(r),e).catch(i=>{x.debug({err:i,intentLogId:r},"Failed to generate intent log embedding")}),r}static EMBEDDABLE_TYPES=new Set(["decision","discovery","fix","blocker","heritage","crystal"]);static buildEmbeddingText(e){let r=[`[${e.type}]`];return e.symbol_name&&r.push(`symbol: ${e.symbol_name}`),e.file_path&&r.push(`file: ${e.file_path.split("/").pop()}`),r.push(e.content),r.join(" ")}async generateAndStoreEmbedding(e,r){let{generateEmbedding:i}=await Promise.resolve().then(()=>(tn(),ld)),t=n.buildEmbeddingText(r),o=await i(t);o&&this.run("UPDATE intent_logs SET embedding = ? WHERE id = ?",JSON.stringify(o),e)}findWithEmbeddings(){return this.all("SELECT * FROM intent_logs WHERE embedding IS NOT NULL AND type NOT IN ('system', 'lapsed')")}delete(e){this.run("DELETE FROM intent_logs WHERE id = ?",e)}update(e,r){let i=Object.keys(r);if(i.length===0)return;let t=i.map(s=>`${s} = ?`).join(", "),o=Object.values(r);o.push(e),this.run(`UPDATE intent_logs SET ${t} WHERE id = ?`,...o)}findRepairableOrphans(){return this.all(`
380
371
  SELECT id, file_path, symbol_name, signature
381
372
  FROM intent_logs
382
373
  WHERE symbol_id IS NULL AND symbol_name IS NOT NULL
@@ -401,75 +392,96 @@ ORDER BY dc.depth, dc.consumer_path;
401
392
  `,e)}importHeritage(e,r,i,t){this.run(`
402
393
  INSERT INTO intent_logs (type, content, commit_sha, created_at, confidence, mission_id)
403
394
  VALUES ('heritage', ?, ?, ?, ?, 0)
404
- `,e,r,i,t)}countByType(e){return this.get("SELECT COUNT(*) as count FROM intent_logs WHERE type = ?",e)?.count||0}}});var ts,tg=de(()=>{"use strict";tt();ts=class extends ye{findByKey(e,r=20){return this.all(`
395
+ `,e,r,i,t)}countByType(e){return this.get("SELECT COUNT(*) as count FROM intent_logs WHERE type = ?",e)?.count||0}findRawByMission(e){return this.all(`SELECT * FROM intent_logs
396
+ WHERE mission_id = ? AND is_crystallized = 0
397
+ AND type NOT IN ('adr', 'system', 'crystal', 'lapsed')
398
+ ORDER BY created_at ASC`,e)}findCrystalByMission(e){return this.get(`SELECT * FROM intent_logs
399
+ WHERE mission_id = ? AND type = 'crystal'
400
+ ORDER BY created_at DESC LIMIT 1`,e)}crystallize(e,r){return this.transaction(()=>{let i=this.insert(`INSERT INTO intent_logs (mission_id, type, content, confidence, is_crystallized, symbol_id, file_path, symbol_name, signature, commit_sha)
401
+ VALUES (?, 'crystal', ?, 1.0, 0, NULL, NULL, NULL, NULL, NULL)`,e,r);return this.run(`UPDATE intent_logs
402
+ SET is_crystallized = 1, crystal_id = ?
403
+ WHERE mission_id = ? AND is_crystallized = 0 AND id != ?
404
+ AND type NOT IN ('adr', 'system', 'crystal', 'lapsed')`,i,e,i),i})}countByMissions(e){if(e.length===0)return{};let r=e.map(()=>"?").join(","),i=this.all(`SELECT mission_id, COUNT(*) as cnt
405
+ FROM intent_logs
406
+ WHERE mission_id IN (${r})
407
+ AND type NOT IN ('system', 'adr', 'lapsed')
408
+ GROUP BY mission_id`,...e),t={};for(let o of i)t[o.mission_id]=o.cnt;return t}findMissionsWithBlockers(e){if(e.length===0)return new Set;let r=e.map(()=>"?").join(","),i=this.all(`SELECT DISTINCT mission_id
409
+ FROM intent_logs
410
+ WHERE mission_id IN (${r})
411
+ AND type = 'blocker'`,...e);return new Set(i.map(t=>t.mission_id))}findByMissionPreferCrystal(e,r=50){let i=this.findCrystalByMission(e);if(i){let t=this.all(`SELECT * FROM intent_logs
412
+ WHERE mission_id = ? AND is_crystallized = 0 AND type NOT IN ('adr', 'system', 'crystal', 'lapsed')
413
+ AND created_at > ?
414
+ ORDER BY created_at DESC LIMIT ?`,e,i.created_at,r-1);return[i,...t]}return this.findByMission(e,r)}async backfillEmbeddings(e=64,r){let{generateEmbeddingsBatch:i}=await Promise.resolve().then(()=>(tn(),ld)),t=[...n.EMBEDDABLE_TYPES].map(u=>`'${u}'`).join(","),o=this.all(`SELECT * FROM intent_logs WHERE embedding IS NULL AND type IN (${t})`);if(o.length===0)return 0;let s=o.map(u=>n.buildEmbeddingText(u)),a=await i(s,e,r),c=this.db.prepare("UPDATE intent_logs SET embedding = ? WHERE id = ?"),l=0;return this.transaction(()=>{for(let u=0;u<o.length;u++)a[u]&&(c.run(JSON.stringify(a[u]),o[u].id),l++)}),x.info({total:o.length,embedded:l},"Intent log embedding backfill complete"),l}}});var ms,bg=pe(()=>{"use strict";it();ms=class extends ge{findByKey(e,r=20){return this.all(`
405
415
  SELECT file_path, key, value, kind
406
416
  FROM configs
407
417
  WHERE key LIKE ? OR value LIKE ?
408
418
  LIMIT ?
409
- `,`%${e}%`,`%${e}%`,r)}findByKind(e,r=50){let i="SELECT key, value, kind, file_path FROM configs",t=[];return e&&(i+=" WHERE kind = ?",t.push(e)),i+=" LIMIT ?",t.push(r),this.all(i,...t)}findEnvValue(e){return this.get("SELECT value FROM configs WHERE key LIKE ? OR key = ? LIMIT 1",`%:env:${e}`,e)?.value}countByKind(e){return this.get("SELECT COUNT(*) as count FROM configs WHERE kind = ?",e)?.count||0}getAll(){return this.all("SELECT key, value, kind, file_path FROM configs")}}});var ns,ng=de(()=>{"use strict";tt();ns=class extends ye{search(e,r=10){return this.all(`
419
+ `,`%${e}%`,`%${e}%`,r)}findByKind(e,r=50){let i="SELECT key, value, kind, file_path FROM configs",t=[];return e&&(i+=" WHERE kind = ?",t.push(e)),i+=" LIMIT ?",t.push(r),this.all(i,...t)}findEnvValue(e){return this.get("SELECT value FROM configs WHERE key LIKE ? OR key = ? LIMIT 1",`%:env:${e}`,e)?.value}countByKind(e){return this.get("SELECT COUNT(*) as count FROM configs WHERE kind = ?",e)?.count||0}getAll(){return this.all("SELECT key, value, kind, file_path FROM configs")}}});var fs,xg=pe(()=>{"use strict";it();fs=class extends ge{search(e,r=10){return this.all(`
410
420
  SELECT file_path, snippet(content_fts, 1, '<b>', '</b>', '...', 20) as snippet
411
421
  FROM content_fts
412
422
  WHERE content_fts MATCH ?
413
423
  LIMIT ?
414
- `,e,r)}}});var rg,rs,ig=de(()=>{"use strict";tt();rg=500,rs=class extends ye{record(e,r,i=null){this.run("INSERT INTO search_history (query, mode, branch) VALUES (?, ?, ?)",e,r,i),this.pruneIfNeeded()}findRecent(e=20){return this.all("SELECT id, query, mode, branch, created_at FROM search_history ORDER BY created_at DESC LIMIT ?",e)}findRecentByQueryPrefix(e,r=10){return e.trim()?this.all(`SELECT id, query, mode, branch, created_at FROM search_history
415
- WHERE query LIKE ? ORDER BY created_at DESC LIMIT ?`,`${e}%`,r):this.findRecent(r)}pruneIfNeeded(){(this.get("SELECT COUNT(*) as count FROM search_history")?.count??0)<=rg||this.run(`DELETE FROM search_history WHERE id NOT IN (
424
+ `,e,r)}}});var $g,hs,Sg=pe(()=>{"use strict";it();$g=500,hs=class extends ge{record(e,r,i=null){this.run("INSERT INTO search_history (query, mode, branch) VALUES (?, ?, ?)",e,r,i),this.pruneIfNeeded()}findRecent(e=20){return this.all("SELECT id, query, mode, branch, created_at FROM search_history ORDER BY created_at DESC LIMIT ?",e)}findRecentByQueryPrefix(e,r=10){return e.trim()?this.all(`SELECT id, query, mode, branch, created_at FROM search_history
425
+ WHERE query LIKE ? ORDER BY created_at DESC LIMIT ?`,`${e}%`,r):this.findRecent(r)}pruneIfNeeded(){(this.get("SELECT COUNT(*) as count FROM search_history")?.count??0)<=$g||this.run(`DELETE FROM search_history WHERE id NOT IN (
416
426
  SELECT id FROM search_history ORDER BY created_at DESC LIMIT ?
417
- )`,rg)}}});var is,og=de(()=>{"use strict";tt();is=class extends ye{getSection(e){return this.get("SELECT section, data, updated_at FROM hologram_snapshot WHERE section = ?",e)}getAllSections(){return this.all("SELECT section, data, updated_at FROM hologram_snapshot ORDER BY section")}upsertSection(e,r){this.run(`
427
+ )`,$g)}}});var gs,kg=pe(()=>{"use strict";it();gs=class extends ge{getSection(e){return this.get("SELECT section, data, updated_at FROM hologram_snapshot WHERE section = ?",e)}getAllSections(){return this.all("SELECT section, data, updated_at FROM hologram_snapshot ORDER BY section")}upsertSection(e,r){this.run(`
418
428
  INSERT INTO hologram_snapshot (section, data, updated_at)
419
429
  VALUES (?, ?, unixepoch())
420
430
  ON CONFLICT(section) DO UPDATE SET
421
431
  data = excluded.data,
422
432
  updated_at = excluded.updated_at
423
- `,e,r)}deleteSection(e){this.run("DELETE FROM hologram_snapshot WHERE section = ?",e)}deleteAll(){this.run("DELETE FROM hologram_snapshot")}hasSection(e){return(this.get("SELECT COUNT(*) as count FROM hologram_snapshot WHERE section = ?",e)?.count??0)>0}}});var j,Q=de(()=>{"use strict";qt();Gh();qh();Xh();Qh();eg();tg();ng();ig();og();j=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=Oe(e),s=r.files?.database,a=!r.intentLogs||!r.searchHistory||!r.missions||!r.hologram;if(s===o&&o.open&&!a)return r;this.repositoryCache.delete(e)}let i=Oe(e),t={files:new Ko(i),exports:new Yo(i),imports:new Xo(i),missions:new Qo(i),intentLogs:new es(i),configs:new ts(i),content:new ns(i),searchHistory:new rs(i),hologram:new is(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),Ah(e)}static clearCache(e){this.repositoryCache.delete(e)}}});var ds,ms,pg,fs,dg,mg,fg,hg,gg,yg,vg,_g,bg,xg,Lr,hs,$g,Sg,Xp=de(()=>{"use strict";ds=[/\/pages\/(?!_)[^/]+\.(tsx?|jsx?)$/i,/\/pages\/.*\/index\.(tsx?|jsx?)$/i,/\/app\/.*\/page\.(tsx?|jsx?)$/i,/\/app\/.*\/layout\.(tsx?|jsx?)$/i,/\/app\/api\/.*\/route\.(ts|js)$/i,/\/pages\/api\/.*\.(ts|js)$/i],ms=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],pg=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],fs=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],dg=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],mg=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],fg=[/\/commands?\/[^/]+\.(ts|js|py|php)$/i,/\/cli\/[^/]+\.(ts|js|py|php)$/i,/\/bin\/[^/]+\.(ts|js|py|php)$/i,/cli\.(ts|js|py|php)$/i,/main\.(ts|js|py|php)$/i],hg=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],gg=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],yg=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],vg=[/\/stores?\//i,/\/slices?\//i,/\/reducers?\//i,/\/atoms?\//i,/\/selectors?\//i,/\.(store|slice|reducer|atom|selector)\.(ts|js)$/i,/.*Slice\.(ts|js)$/i,/.*Store\.(ts|js)$/i],_g=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],bg=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],xg=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],Lr=[/\.(model|entity|schema|repository|repo|dao|migration|query|mutation|resolver|connection|db)\.(ts|js)$/i,/queries\.(ts|js)$/i,/mutations\.(ts|js)$/i,/resolvers\.(ts|js)$/i,/connection\.(ts|js)$/i,/\/models?\//i,/\/entities?\//i,/\/repositories?\//i,/\/repos?\//i,/\/data\//i,/\/database\//i,/\/prisma\//i,/\/drizzle\//i,/\/api\/.*client\.(ts|js|tsx)$/i,/(^|\/)[A-Z0-9_-]*API\.(tsx?|js|jsx)$/],hs=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],$g=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],Sg=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var gs,Eg,ys,wg,Qp=de(()=>{"use strict";gs=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],Eg=[/views\.py$/i,/forms\.py$/i,/serializers\.py$/i,/admin\.py$/i,/apps\.py$/i,/tasks\.py$/i,/middlewares?\.py$/i,/signals?\.py$/i,/context_processors\.py$/i],ys=[/models\.py$/i,/\/models\/.*\.py$/i,/\/migrations\/.*\.py$/i,/schema\.py$/i,/documents\.py$/i],wg=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var vs,Tg,_s,Rg,ed=de(()=>{"use strict";vs=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],Tg=[/\/services?\/.*\.php$/i,/\/providers?\/.*\.php$/i,/\/middleware\/.*\.php$/i,/\/jobs?\/.*\.php$/i,/\/listeners?\/.*\.php$/i,/\/events?\/.*\.php$/i,/\/observers?\/.*\.php$/i,/\/console\/commands\/.*\.php$/i,/\/actions?\/.*\.php$/i,/\/traits?\/.*\.php$/i,/\/concerns?\/.*\.php$/i,/\/contracts?\/.*\.php$/i],_s=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],Rg=["laravel","symfony","slim","cakephp","codeigniter"]});import Ng from"path";function Cr(n,e,r){let i=[],t="Unknown",o=0;r||(r=S$(n,e));let{inDegree:s,outDegree:a}=r,c=(d,m,f,h)=>{for(let _ of d)if(_.test(n))return i.push(`${h}: ${_.source}`),t=m,o+=f,!0;return!1},l=!1;if(l||(l=c(ds,"Entry",45,"Next.js entry")),l||(l=c(dg,"Entry",40,"MCP handler")),l||(l=c(fg,"Entry",40,"CLI command")),l||(l=c(Lr,"Data",45,"Data layer/Repository")),l||(l=c(vg,"Data",35,"State management")),l||(l=c(pg,"Logic",40,"React component")),l||(l=c(fs,"Logic",35,"Logic pattern")),l||(l=c(hg,"Logic",35,"Parser/AST")),l||(l=c(gg,"Logic",35,"Core module")),l||(l=c(yg,"Logic",30,"UI layer")),l||(l=c(xg,"Types",35,"Type definition")),l||(l=c(gs,"Entry",40,"Python Entry")),l||(l=c(ys,"Data",40,"Python Data")),l||(l=c(Eg,"Logic",35,"Python Logic")),l||(l=c(vs,"Entry",40,"PHP Entry")),l||(l=c(_s,"Data",40,"PHP Data")),l||(l=c(Tg,"Logic",35,"PHP Logic")),l||(l=c(_g,"Logic",35,"Hook/Context")),!l){for(let d of mg)if(d.test(n)){i.push(`MCP utility: ${d.source}`),/schemas?/i.test(n)?t="Types":/resources?/i.test(n)?t="Data":t="Utility",o+=35,l=!0;break}}l||c(bg,"Data",35,"Schema definition")&&(l=!0),l||(c(Lr,"Data",30,"Path matches data pattern")||c(hs,"Utility",25,"Path matches utility pattern")||c(ms,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let d of td)if(d.test(n)){i.push(`Test file: ${d.source}`),t="Test",o=50,l=!0;break}l||c(nd,"Infrastructure",40,"Infrastructure")&&(l=!0);for(let d of $$)d.test(n)&&(i.push(`Monorepo component: ${d.source}`),/\/apps\/[^/]+\/src\/pages\//i.test(n)&&(i.push("Monorepo App Entry"),t==="Unknown"&&(t="Entry"),o+=20),/\/packages\/[^/]+\/src\//i.test(n)&&(o+=10));let p=e.imports.getImportsForFile(n).map(d=>d.module_specifier.toLowerCase());for(let d of Sg)if(p.some(m=>m.includes(d))){i.push(`Imports JS data library: ${d}`),(t==="Unknown"||t==="Data")&&(t="Data",o+=25);break}for(let d of wg)if(p.some(m=>m.includes(d))){i.push(`Imports Python framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of Rg)if(p.some(m=>m.includes(d))){i.push(`Imports PHP framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of $g)if(p.some(m=>m.includes(d))){i.push(`Imports JS framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}if(s===0&&a>0&&(i.push("Entry point: nothing imports this file (in-degree=0)"),t==="Unknown"?(t="Entry",o+=30):t==="Entry"&&(o+=15)),s>5&&a<=2&&(i.push(`High reuse: ${s} files import this (candidate for Utility)`),t==="Unknown"?(t="Utility",o+=25):t==="Utility"&&(o+=10)),t==="Unknown"&&s>0&&a>0){let d=s/(s+a);d>.3&&d<.7&&(i.push(`Balanced traffic: in=${s}, out=${a} (likely Logic layer)`),t="Logic",o+=25)}return t==="Unknown"&&(i.push("No strong classification signals detected"),o=10),o=Math.min(o,100),{layer:t,confidence:o,signals:i}}function S$(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function rt(n,e){let r=n.files.getAllPaths().map(f=>({path:f})),i=new Map,t={Entry:[],Logic:[],Data:[],Utility:[],Infrastructure:[],Test:[],Types:[],Unknown:[]};for(let f of r){let h=Cr(f.path,n);i.set(f.path,h),t[h.layer].push({path:f.path,classification:h})}let o={Entry:zt(t.Entry,e),Logic:zt(t.Logic,e),Data:zt(t.Data,e),Utility:zt(t.Utility,e),Infrastructure:zt(t.Infrastructure,e),Test:zt(t.Test,e),Types:zt(t.Types,e),Unknown:zt(t.Unknown,e)},s={};r.forEach(f=>{let h=Ng.extname(f.path).toLowerCase();h&&(s[h]=(s[h]||0)+1)});let a={".ts":"TypeScript",".tsx":"Typescript (React)",".js":"JavaScript",".jsx":"JavaScript (React)",".py":"Python",".php":"PHP",".go":"Go",".rs":"Rust",".java":"Java",".cs":"C#",".rb":"Ruby",".vue":"Vue"},c={};Object.entries(s).forEach(([f,h])=>{let _=a[f];_&&(c[_]=(c[_]||0)+h)});let l=Object.entries(c).sort((f,h)=>h[1]-f[1]),u=l.length>0?l[0][0]:"Unknown",{pattern:p,patternConfidence:d,insights:m}=k$(o,r.length,n);return{pattern:p,patternConfidence:d,layers:o,insights:m,primaryStack:u}}function zt(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:Ng.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function k$(n,e,r){let i=[],t="Unknown",o=0,s=n.Entry.count/e*100,a=n.Logic.count/e*100,c=n.Data.count/e*100,l=n.Utility.count/e*100,u=n.Unknown.count/e*100;s>5&&a>10&&c>5&&u<40?(t="Layered",o=60+Math.min(30,(100-u)/3),i.push(`Clear layer separation: Entry (${s.toFixed(1)}%), Logic (${a.toFixed(1)}%), Data (${c.toFixed(1)}%)`)):l>20?(t="Modular",o=50+l/2,i.push(`High shared module usage: ${l.toFixed(1)}% utility files`)):u>60&&(t="Monolithic",o=40+u/4,i.push(`Limited architectural structure: ${u.toFixed(1)}% files with unclear layer assignment`));let p=r.configs.countByKind("Service");return p>3&&(t="Microservices",o=55+p*5,i.push(`Detected ${p} service definitions (likely microservices)`)),n.Entry.count===0&&i.push("\u26A0\uFE0F No clear entry points detected - consider adding route/controller files"),n.Data.count===0&&i.push("\u26A0\uFE0F No data layer detected - repository may not use traditional ORM patterns"),l>30&&i.push(`High utility concentration (${l.toFixed(1)}%) - good reusability`),{pattern:t,patternConfidence:Math.min(100,o),insights:i}}var td,nd,$$,Xt=de(()=>{"use strict";Xp();Qp();ed();td=[/\.(test|spec)\.(ts|tsx|js|jsx)$/i,/tests?\.py$/i,/\/__tests__\//i,/\/tests?\//i,/\.e2e\.(ts|js)$/i,/\.integration\.(ts|js)$/i],nd=[/Dockerfile/i,/docker-compose/i,/\.ya?ml$/i,/nginx\.conf/i,/\/infra\//i,/\/deploy\//i,/\/k8s\//i,/\/kubernetes\//i,/\/terraform\//i,/\/ansible\//i,/package\.json/i,/tsconfig.*\.json/i,/\.env/i],$$=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});var zg={};Ue(zg,{HologramService:()=>le});var We,le,Be=de(()=>{"use strict";Q();Xt();J();We=$.child({module:"hologram"}),le=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=j.getInstance(e)}updateTopography(e){We.debug({repoPath:this.repoPath},"Updating topography snapshot");let r=Object.values(e.layers).reduce((o,s)=>o+s.count,0),i={};for(let[o,s]of Object.entries(e.layers)){let a=r>0?s.count/r*100:0;i[o]={count:s.count,percentage:Math.round(a*10)/10,topFiles:s.topFiles.slice(0,3).map(c=>({path:c.path,confidence:c.confidence}))}}let t={pattern:e.pattern,patternConfidence:e.patternConfidence,layerDistribution:i,insights:e.insights,updatedAt:Date.now()};this.repos.hologram.upsertSection("topography",JSON.stringify(t)),We.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=rt(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){We.debug({repoPath:this.repoPath,count:e.length},"Updating gravity zones");let r={hotspots:e.slice(0,50),updatedAt:Date.now()};this.repos.hologram.upsertSection("gravity",JSON.stringify(r)),We.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){We.debug({repoPath:this.repoPath,count:e.length},"Updating ghost bridges");let r={bridges:e.slice(0,20),updatedAt:Date.now()};this.repos.hologram.upsertSection("ghosts",JSON.stringify(r)),We.info({repoPath:this.repoPath},"Ghost bridges updated")}getSnapshot(){let e=this.repos.hologram.getAllSections(),r={metadata:{repoPath:this.repoPath,lastUpdated:Date.now(),version:"1.0.0"}};for(let i of e)try{let t=JSON.parse(i.data);switch(i.section){case"topography":r.topography=t;break;case"gravity":r.gravity=t;break;case"ghosts":r.ghosts=t;break}}catch(t){We.error({repoPath:this.repoPath,section:i.section,error:t},"Failed to parse hologram section")}return r}getSection(e){let r=this.repos.hologram.getSection(e);if(!r)return null;try{return JSON.parse(r.data)}catch(i){return We.error({repoPath:this.repoPath,section:e,error:i},"Failed to parse section"),null}}computeGravityZones(){We.debug({repoPath:this.repoPath},"Computing gravity zones from import graph");let e=this.repos.files.getAllPaths(),r=new Map;for(let t of e){let o=Cr(t,this.repos);if(o.layer==="Test"||o.layer==="Unknown")continue;let s=this.repos.exports.findByFile(t);if(s.length===0)continue;let a=this.repos.imports.countDependents(t),c=this.repos.imports.countByFile(t),l=a*2+c;if(l>0){let u=s.find(d=>d.kind!=="TsTypeAliasDeclaration"&&d.kind!=="TsInterfaceDeclaration")||s[0],p=`${t}::${u.name}`;r.set(p,{symbol:u.name,filePath:t,inDegree:a,outDegree:c,gravity:l})}}let i=Array.from(r.values()).sort((t,o)=>o.gravity-t.gravity).slice(0,50);return We.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),We.info({repoPath:this.repoPath},"Hologram cleared")}}});var Gg={};Ue(Gg,{GraphExporterService:()=>sd});var Vg,sd,qg=de(()=>{"use strict";Q();J();Vg=$.child({module:"graph-exporter"}),sd=class{constructor(e){this.repoPath=e;this.repos=j.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;Vg.info({focusMissionId:t,depth:o,format:i,includeCompleted:r},"Generating mission graph");let a=this.buildMissionTree(t,r,o,s);return i==="json"?JSON.stringify(a,null,2):this.generateMermaidDiagram(a)}buildMissionTree(e,r,i,t){let o;if(e){let c=this.repos.missions.findById(e);o=c?[c]:[]}else o=this.repos.missions.findAll().filter(l=>!l.parent_id),r||(o=o.filter(l=>l.status!=="completed"));let s=0,a=[];for(let c of o){if(s>=t)break;let l=this.buildNode(c,r,i,1,{count:s,max:t});l&&(a.push(l),s+=this.countNodes(l))}return a}buildNode(e,r,i,t,o){if(t>i||o.count>=o.max)return null;let s;if(e.strategy_graph)try{let u=JSON.parse(e.strategy_graph);s=this.parseStrategySteps(u)}catch(u){Vg.debug({missionId:e.id,err:u},"Failed to parse strategy graph")}let a={id:e.id,name:e.name,status:e.status,goal:e.goal,branch:e.git_branch||void 0,children:[],steps:s},c=this.repos.missions.findByParentId(e.id),l=r?c:c.filter(u=>u.status!=="completed");for(let u of l){if(o.count>=o.max)break;let p=this.buildNode(u,r,i,t+1,o);p&&(a.children.push(p),o.count++)}return a}parseStrategySteps(e){let r=[];return Array.isArray(e)?e.map((i,t)=>({id:i.id||`step-${t}`,description:i.description||i.content||i.name||`Step ${t+1}`,status:i.status,dependencies:i.dependencies||i.deps})):e.steps&&Array.isArray(e.steps)?this.parseStrategySteps(e.steps):typeof e=="object"?Object.entries(e).map(([i,t])=>({id:i,description:t.description||t.content||i,status:t.status,dependencies:t.dependencies||t.deps})):r}countNodes(e){let r=1;for(let i of e.children)r+=this.countNodes(i);return r}generateMermaidDiagram(e){let r=["graph TD"];for(let i of e)this.addMermaidNode(i,r);return r.join(`
424
- `)}addMermaidNode(e,r,i){let t=`M${e.id}`,o=this.getStatusIcon(e.status),s=this.getStatusClass(e.status),a=`${o} ${e.name}`;if(r.push(` ${t}["${this.escapeMermaid(a)}"]:::${s}`),i&&r.push(` ${i} --> ${t}`),e.steps&&e.steps.length>0&&e.steps.length<=10)for(let c of e.steps){let l=`S${e.id}_${c.id}`,u=c.status||"pending",p=this.getStatusIcon(u),d=this.getStatusClass(u),m=`${p} ${c.description}`;if(r.push(` ${l}["${this.escapeMermaid(m)}"]:::${d}`),r.push(` ${t} -.-> ${l}`),c.dependencies&&c.dependencies.length>0)for(let f of c.dependencies){let h=`S${e.id}_${f}`;r.push(` ${h} --> ${l}`)}}for(let c of e.children)this.addMermaidNode(c,r,t);i||(r.push(""),r.push(" classDef completed fill:#90EE90,stroke:#2E8B57,stroke-width:2px"),r.push(" classDef inProgress fill:#87CEEB,stroke:#4682B4,stroke-width:2px"),r.push(" classDef planned fill:#FFE4B5,stroke:#DAA520,stroke-width:2px"),r.push(" classDef suspended fill:#D3D3D3,stroke:#808080,stroke-width:2px"),r.push(" classDef failed fill:#FFB6C1,stroke:#DC143C,stroke-width:2px"),r.push(" classDef pending fill:#FFF8DC,stroke:#B8860B,stroke-width:1px"))}getStatusIcon(e){return{completed:"\u2713","in-progress":"\u26A1",planned:"\u{1F4CB}",suspended:"\u23F8",failed:"\u2717",pending:"\u25CB",verifying:"\u{1F50D}"}[e]||"\u25CB"}getStatusClass(e){return{completed:"completed","in-progress":"inProgress",planned:"planned",suspended:"suspended",failed:"failed",pending:"pending",verifying:"inProgress"}[e]||"pending"}escapeMermaid(e){return e.replace(/"/g,"#quot;").replace(/\n/g," ").replace(/\[/g,"#91;").replace(/]/g,"#93;").slice(0,100)}}});import{Server as ek}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as tk}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as nk,ListToolsRequestSchema as rk,ListResourcesRequestSchema as ik,ReadResourceRequestSchema as ok}from"@modelcontextprotocol/sdk/types.js";var Od=[{name:"shadow_recon_onboard",description:"Initial onboarding for a repository. Indexes all files, extracts symbols, and detects services.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_topography",description:"Analyze architectural layers (Entry/Logic/Data/Utility). Returns layer breakdown and architectural insights.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_scout",description:"(Expert) Detect architectural drift, pattern violations, and gravity anomalies.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_tree",description:"Generate hierarchical file tree with file classifications and export summaries.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},subPath:{type:"string",description:"Relative path to focus tree on a specific subdirectory"},maxDepth:{type:"number",description:"Maximum directory depth to traverse"}},required:["repoPath"]}},{name:"shadow_recon_hologram",description:"Get the project hologram (persistent architectural snapshot) and gravity zones.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},compact:{type:"boolean",description:"Omit large arrays (gravity.hotspots) for lighter output"}},required:["repoPath"]}},{name:"shadow_search_concept",description:"Semantic/Vector-based intent search across file purpose and logic.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term or semantic intent"},limit:{type:"number",description:"Max results (default 10)"},offset:{type:"number",description:"Pagination offset"},skipSync:{type:"boolean",description:"Skip index sync before search"},compact:{type:"boolean",description:"Return compact output (no snippets)"},fileType:{type:"string",description:"Filter by extension(s)"},layer:{type:"string",enum:["Solid","Liquid","Virtual","Intel","Phantom"]},includeTests:{type:"boolean",description:"Include test files (Virtual)"}},required:["repoPath","query"]}},{name:"shadow_search_symbol",description:"Exact and fuzzy code symbol matching (classes, functions, methods).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Symbol name or partial name"},limit:{type:"number",description:"Max results"},offset:{type:"number",description:"Pagination offset"},skipSync:{type:"boolean",description:"Skip index sync"},fileType:{type:"string",description:"Filter by extension(s)"},matchMode:{type:"string",enum:["any","all","exact"],description:"Match mode for multi-word queries: 'any' (OR, default), 'all' (AND), 'exact' (phrase)"}},required:["repoPath","query"]}},{name:"shadow_search_config",description:"Environment and configuration discovery (ENV, Ports, Docker, YAML).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term for values/keys"},key:{type:"string",description:"Specific config key match"},kind:{type:"string",enum:["Service","Image","Port","Env"]},limit:{type:"number"},showUsage:{type:"boolean",description:"Cross-reference with code to show usage counts and identify orphaned vars (defined but never used)"}},required:["repoPath"]}},{name:"shadow_search_path",description:"Filename-keyword resolution using the search index.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Filename part or path keyword"},limit:{type:"number"},ranked:{type:"boolean",description:"Sort results by gravity (high-import files first) and show layer classification (Entry/Logic/Data)"}},required:["repoPath","query"]}},{name:"shadow_analyze_impact",description:"Calculate blast radius and Strategic Risk Scoring of changing a symbol.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string",description:"Symbol to analyze"},filePath:{type:"string",description:"Specific file where symbol is defined"},depth:{type:"number",description:"Traversal depth (default 3)"},limit:{type:"number",description:"Max results per symbol (default 50)"},offset:{type:"number",description:"Pagination offset"}},required:["repoPath","symbolName"]}},{name:"shadow_analyze_flow",description:"Execution call-chain tracing (AST-based) for a specific function/method.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string",description:"File to start trace from"},symbolName:{type:"string",description:"Function/method name"}},required:["repoPath","filePath"]}},{name:"shadow_analyze_deps",description:"Direct file import/export mapping and dependency graph inspection.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},direction:{type:"string",enum:["imports","imported_by"]}},required:["repoPath","filePath","direction"]}},{name:"shadow_analyze_debt",description:"Recursive dead-code detection and circular import identification. For dead-code mode: excludes migrations and fixtures by default, returns results with confidence scoring.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},mode:{type:"string",enum:["dead-code","circular-deps"]},limit:{type:"number"},includeTests:{type:"boolean"},excludePatterns:{type:"array",items:{type:"string"},description:"Custom glob patterns to exclude (e.g., '**/migrations/**')"},includeMigrations:{type:"boolean",description:"Include migration files (default: false)"},includeFixtures:{type:"boolean",description:"Include fixture/mock files (default: false)"},confidenceThreshold:{type:"string",enum:["all","high","medium"],description:"Filter by confidence: 'all' (default), 'high' (likely dead), 'medium' (possibly intentional)"}},required:["repoPath","mode"]}}];var Ad=[{name:"shadow_ops_plan",description:"Create a new development mission or strategic initiative with goals and strategy.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},name:{type:"string",description:"Mission name"},goal:{type:"string",description:"Objective and success criteria"},strategy:{type:"string",description:"JSON strategy (steps DAG)"},parentId:{type:"number",description:"ID of parent mission"},outcomeContract:{type:"string",description:"Success verification contract"},templateId:{type:"string",enum:["refactoring","feature","bug-fix"]},templateVars:{type:"object",description:"Template variables"}},required:["repoPath"]}},{name:"shadow_ops_track",description:"Update mission step status, record progress, and track completion.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},stepId:{type:"string"},status:{type:"string",enum:["pending","in-progress","completed","failed","skipped"]},contextPivot:{type:"string",description:"Rationale for status change"},updates:{type:"array",items:{type:"object",properties:{stepId:{type:"string"},status:{type:"string"},contextPivot:{type:"string"}}}}},required:["repoPath","missionId"]}},{name:"shadow_ops_log",description:"Record architectural decisions, discoveries, or blockers to the intent log.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},type:{type:"string",enum:["decision","blocker","discovery","fix"]},content:{type:"string"},symbolName:{type:"string",description:"Symbol related to this intent"}},required:["repoPath","missionId","type","content"]}},{name:"shadow_ops_briefing",description:"Active situational awareness - Get details on missions, decisions, and next steps.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Optional specific mission ID"},scope:{type:"string",enum:["mission","project"]},includeGroupedByParent:{type:"boolean"},activeMissionsLimit:{type:"number",description:"Limit active missions in output"},recentActivityLimit:{type:"number",description:"Limit recent activity logs"},compact:{type:"boolean",description:"Omit strategy_graph JSON for lighter output"}},required:["repoPath"]}},{name:"shadow_ops_synthesize",description:"Distill mission context and logs into an Architectural Decision Record (ADR).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"}},required:["repoPath","missionId"]}},{name:"shadow_ops_chronicle",description:"Archive feed of the repository narrative (initiatives and standalones).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},format:{type:"string",enum:["markdown","json"]},limit:{type:"number"},offset:{type:"number"},since:{type:"number"},until:{type:"number"}},required:["repoPath"]}},{name:"shadow_ops_context",description:'Session-start bundle in one call: hologram + chronicle (last 5) + briefing summary (counts, next_work_candidates). Use for "new chat, give me the world" without multiple round-trips.',inputSchema:{type:"object",properties:{repoPath:{type:"string"},compact:{type:"boolean",description:"Return lighter payload (omit full hologram.gravity.hotspots, strategy_graph)"}},required:["repoPath"]}},{name:"shadow_ops_health",description:"System health metrics and intelligence index status.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_ops_graph",description:"Visualize mission lineage and dependencies.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},depth:{type:"number"},limit:{type:"number"},format:{type:"string",enum:["mermaid","json"]}},required:["repoPath"]}},{name:"shadow_inspect_symbol",description:"Dense code retrieval for a single symbol with semantic folding and usage context.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string"},context:{type:"string",enum:["definition","full"]}},required:["repoPath","symbolName"]}},{name:"shadow_inspect_file",description:"Token-efficient summary of ALL symbols and exports in a file.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},detailLevel:{type:"string",enum:["structure","signatures","summaries","detailed"]}},required:["repoPath","filePath"]}},{name:"shadow_sync_trace",description:"Full lifecycle synchronization - Repairs index, analyzes changes, and re-hydrates state.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},sinceCommit:{type:"string"}},required:["repoPath"]}},{name:"shadow_sync_index",description:"Incremental code re-indexing to reflect latest file changes.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},deep:{type:"boolean",description:"Force full rebuild"}},required:["repoPath"]}},{name:"shadow_sync_repair",description:"NanoRepair only - Heals broken intent links and symbol shifts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_env_hooks",description:"Install and manage Git hooks for automated intelligence maintenance.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},action:{type:"string",enum:["install","remove","status"]},enableAutoRefresh:{type:"boolean"},enableSymbolHealing:{type:"boolean"}},required:["repoPath","action"]}},{name:"shadow_env_diagnose",description:"Missions and intelligence toolset health check.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_workspace_list",description:"Federated view of active missions across multiple repositories.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},status:{type:"string"}},required:["repoPaths"]}},{name:"shadow_workspace_link",description:"Establish intent-level dependencies between missions in different repos.",inputSchema:{type:"object",properties:{parentRepoPath:{type:"string"},parentMissionId:{type:"number"},childRepoPath:{type:"string"},childMissionId:{type:"number"},relationship:{type:"string"}},required:["parentRepoPath","parentMissionId","childRepoPath","childMissionId","relationship"]}},{name:"shadow_workspace_fuse",description:"Create unified cross-repo search indices using SQLite fusion.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},name:{type:"string"}},required:["repoPaths"]}}];var y={};Ue(y,{$brand:()=>ni,$input:()=>al,$output:()=>sl,NEVER:()=>Zs,TimePrecision:()=>pl,ZodAny:()=>ep,ZodArray:()=>ip,ZodBase64:()=>Po,ZodBase64URL:()=>No,ZodBigInt:()=>Dn,ZodBigIntFormat:()=>Oo,ZodBoolean:()=>zn,ZodCIDRv4:()=>To,ZodCIDRv6:()=>Ro,ZodCUID:()=>xo,ZodCUID2:()=>$o,ZodCatch:()=>wp,ZodCodec:()=>Zo,ZodCustom:()=>zr,ZodCustomStringFormat:()=>Pn,ZodDate:()=>Ir,ZodDefault:()=>bp,ZodDiscriminatedUnion:()=>sp,ZodE164:()=>zo,ZodEmail:()=>vo,ZodEmoji:()=>_o,ZodEnum:()=>Tn,ZodError:()=>Dx,ZodExactOptional:()=>yp,ZodFile:()=>hp,ZodFirstPartyTypeKind:()=>jp,ZodFunction:()=>Ap,ZodGUID:()=>$r,ZodIPv4:()=>wo,ZodIPv6:()=>Io,ZodISODate:()=>po,ZodISODateTime:()=>uo,ZodISODuration:()=>fo,ZodISOTime:()=>mo,ZodIntersection:()=>ap,ZodIssueCode:()=>Ax,ZodJWT:()=>Do,ZodKSUID:()=>Eo,ZodLazy:()=>zp,ZodLiteral:()=>fp,ZodMAC:()=>Vu,ZodMap:()=>dp,ZodNaN:()=>Tp,ZodNanoID:()=>bo,ZodNever:()=>np,ZodNonOptional:()=>Uo,ZodNull:()=>Xu,ZodNullable:()=>_p,ZodNumber:()=>Nn,ZodNumberFormat:()=>Gt,ZodObject:()=>Rr,ZodOptional:()=>Mo,ZodPipe:()=>Fo,ZodPrefault:()=>$p,ZodPromise:()=>Op,ZodReadonly:()=>Rp,ZodRealError:()=>Te,ZodRecord:()=>Nr,ZodSet:()=>mp,ZodString:()=>Rn,ZodStringFormat:()=>ie,ZodSuccess:()=>Ep,ZodSymbol:()=>Ku,ZodTemplateLiteral:()=>Np,ZodTransform:()=>gp,ZodTuple:()=>lp,ZodType:()=>K,ZodULID:()=>So,ZodURL:()=>wr,ZodUUID:()=>Qe,ZodUndefined:()=>Yu,ZodUnion:()=>Pr,ZodUnknown:()=>tp,ZodVoid:()=>rp,ZodXID:()=>ko,ZodXor:()=>op,_ZodString:()=>yo,_default:()=>xp,_function:()=>hh,any:()=>Vf,array:()=>Tr,base64:()=>Pf,base64url:()=>Nf,bigint:()=>Zf,boolean:()=>qu,catch:()=>Ip,check:()=>gh,cidrv4:()=>Tf,cidrv6:()=>Rf,clone:()=>Se,codec:()=>dh,coerce:()=>Mp,config:()=>pe,core:()=>dt,cuid:()=>bf,cuid2:()=>xf,custom:()=>yh,date:()=>qf,decode:()=>Uu,decodeAsync:()=>Zu,describe:()=>vh,discriminatedUnion:()=>th,e164:()=>zf,email:()=>uf,emoji:()=>vf,encode:()=>Mu,encodeAsync:()=>Fu,endsWith:()=>vn,enum:()=>Co,exactOptional:()=>vp,file:()=>ch,flattenError:()=>lr,float32:()=>jf,float64:()=>Mf,formatError:()=>ur,fromJSONSchema:()=>Eh,function:()=>hh,getErrorMap:()=>Cx,globalRegistry:()=>be,gt:()=>Ye,gte:()=>ke,guid:()=>pf,hash:()=>Cf,hex:()=>Lf,hostname:()=>Af,httpUrl:()=>yf,includes:()=>gn,instanceof:()=>bh,int:()=>go,int32:()=>Uf,int64:()=>Hf,intersection:()=>cp,ipv4:()=>Ef,ipv6:()=>If,iso:()=>In,json:()=>$h,jwt:()=>Df,keyof:()=>Kf,ksuid:()=>kf,lazy:()=>Dp,length:()=>Jt,literal:()=>ah,locales:()=>vr,looseObject:()=>Qf,looseRecord:()=>rh,lowercase:()=>fn,lt:()=>Ke,lte:()=>De,mac:()=>wf,map:()=>ih,maxLength:()=>Bt,maxSize:()=>Et,meta:()=>_h,mime:()=>_n,minLength:()=>pt,minSize:()=>Xe,multipleOf:()=>kt,nan:()=>ph,nanoid:()=>_f,nativeEnum:()=>sh,negative:()=>eo,never:()=>Ao,nonnegative:()=>no,nonoptional:()=>kp,nonpositive:()=>to,normalize:()=>bn,null:()=>Qu,nullable:()=>kr,nullish:()=>lh,number:()=>Gu,object:()=>Yf,optional:()=>Sr,overwrite:()=>Ze,parse:()=>Au,parseAsync:()=>Lu,partialRecord:()=>nh,pipe:()=>Er,positive:()=>Qi,prefault:()=>Sp,preprocess:()=>Sh,prettifyError:()=>ea,promise:()=>fh,property:()=>ro,readonly:()=>Pp,record:()=>pp,refine:()=>Lp,regex:()=>mn,regexes:()=>Ce,registry:()=>zi,safeDecode:()=>Wu,safeDecodeAsync:()=>Ju,safeEncode:()=>Hu,safeEncodeAsync:()=>Bu,safeParse:()=>Cu,safeParseAsync:()=>ju,set:()=>oh,setErrorMap:()=>Lx,size:()=>Wt,slugify:()=>kn,startsWith:()=>yn,strictObject:()=>Xf,string:()=>ho,stringFormat:()=>Of,stringbool:()=>xh,success:()=>uh,superRefine:()=>Cp,symbol:()=>Bf,templateLiteral:()=>mh,toJSONSchema:()=>ao,toLowerCase:()=>$n,toUpperCase:()=>Sn,transform:()=>jo,treeifyError:()=>Qs,trim:()=>xn,tuple:()=>up,uint32:()=>Ff,uint64:()=>Wf,ulid:()=>$f,undefined:()=>Jf,union:()=>Lo,unknown:()=>Vt,uppercase:()=>hn,url:()=>gf,util:()=>N,uuid:()=>df,uuidv4:()=>mf,uuidv6:()=>ff,uuidv7:()=>hf,void:()=>Gf,xid:()=>Sf,xor:()=>eh});var dt={};Ue(dt,{$ZodAny:()=>Tc,$ZodArray:()=>Dc,$ZodAsyncError:()=>Fe,$ZodBase64:()=>vc,$ZodBase64URL:()=>_c,$ZodBigInt:()=>Ei,$ZodBigIntFormat:()=>kc,$ZodBoolean:()=>fr,$ZodCIDRv4:()=>hc,$ZodCIDRv6:()=>gc,$ZodCUID:()=>rc,$ZodCUID2:()=>ic,$ZodCatch:()=>Yc,$ZodCheck:()=>oe,$ZodCheckBigIntFormat:()=>Da,$ZodCheckEndsWith:()=>Ba,$ZodCheckGreaterThan:()=>vi,$ZodCheckIncludes:()=>Ha,$ZodCheckLengthEquals:()=>Ma,$ZodCheckLessThan:()=>yi,$ZodCheckLowerCase:()=>Fa,$ZodCheckMaxLength:()=>Ca,$ZodCheckMaxSize:()=>Oa,$ZodCheckMimeType:()=>Va,$ZodCheckMinLength:()=>ja,$ZodCheckMinSize:()=>Aa,$ZodCheckMultipleOf:()=>Na,$ZodCheckNumberFormat:()=>za,$ZodCheckOverwrite:()=>Ga,$ZodCheckProperty:()=>Ja,$ZodCheckRegex:()=>Ua,$ZodCheckSizeEquals:()=>La,$ZodCheckStartsWith:()=>Wa,$ZodCheckStringFormat:()=>pn,$ZodCheckUpperCase:()=>Za,$ZodCodec:()=>gr,$ZodCustom:()=>ol,$ZodCustomStringFormat:()=>$c,$ZodDate:()=>zc,$ZodDefault:()=>Vc,$ZodDiscriminatedUnion:()=>Lc,$ZodE164:()=>bc,$ZodEmail:()=>Qa,$ZodEmoji:()=>tc,$ZodEncodeError:()=>_t,$ZodEnum:()=>Fc,$ZodError:()=>cr,$ZodExactOptional:()=>Bc,$ZodFile:()=>Hc,$ZodFunction:()=>nl,$ZodGUID:()=>Ya,$ZodIPv4:()=>dc,$ZodIPv6:()=>mc,$ZodISODate:()=>lc,$ZodISODateTime:()=>cc,$ZodISODuration:()=>pc,$ZodISOTime:()=>uc,$ZodIntersection:()=>Cc,$ZodJWT:()=>xc,$ZodKSUID:()=>ac,$ZodLazy:()=>il,$ZodLiteral:()=>Zc,$ZodMAC:()=>fc,$ZodMap:()=>Mc,$ZodNaN:()=>Xc,$ZodNanoID:()=>nc,$ZodNever:()=>Pc,$ZodNonOptional:()=>qc,$ZodNull:()=>Ic,$ZodNullable:()=>Jc,$ZodNumber:()=>ki,$ZodNumberFormat:()=>Sc,$ZodObject:()=>cm,$ZodObjectJIT:()=>Oc,$ZodOptional:()=>Ii,$ZodPipe:()=>Qc,$ZodPrefault:()=>Gc,$ZodPromise:()=>rl,$ZodReadonly:()=>el,$ZodRealError:()=>Ie,$ZodRecord:()=>jc,$ZodRegistry:()=>Ni,$ZodSet:()=>Uc,$ZodString:()=>Ht,$ZodStringFormat:()=>re,$ZodSuccess:()=>Kc,$ZodSymbol:()=>Ec,$ZodTemplateLiteral:()=>tl,$ZodTransform:()=>Wc,$ZodTuple:()=>wi,$ZodType:()=>q,$ZodULID:()=>oc,$ZodURL:()=>ec,$ZodUUID:()=>Xa,$ZodUndefined:()=>wc,$ZodUnion:()=>hr,$ZodUnknown:()=>Rc,$ZodVoid:()=>Nc,$ZodXID:()=>sc,$ZodXor:()=>Ac,$brand:()=>ni,$constructor:()=>b,$input:()=>al,$output:()=>sl,Doc:()=>mr,JSONSchema:()=>cf,JSONSchemaGenerator:()=>co,NEVER:()=>Zs,TimePrecision:()=>pl,_any:()=>zl,_array:()=>Ml,_base64:()=>qi,_base64url:()=>Ki,_bigint:()=>El,_boolean:()=>Sl,_catch:()=>Ex,_check:()=>af,_cidrv4:()=>Vi,_cidrv6:()=>Gi,_coercedBigint:()=>wl,_coercedBoolean:()=>kl,_coercedDate:()=>Cl,_coercedNumber:()=>yl,_coercedString:()=>ll,_cuid:()=>Ui,_cuid2:()=>Fi,_custom:()=>Fl,_date:()=>Ll,_decode:()=>ci,_decodeAsync:()=>ui,_default:()=>$x,_discriminatedUnion:()=>ux,_e164:()=>Yi,_email:()=>Di,_emoji:()=>ji,_encode:()=>ai,_encodeAsync:()=>li,_endsWith:()=>vn,_enum:()=>gx,_file:()=>Ul,_float32:()=>_l,_float64:()=>bl,_gt:()=>Ye,_gte:()=>ke,_guid:()=>_r,_includes:()=>gn,_int:()=>vl,_int32:()=>xl,_int64:()=>Il,_intersection:()=>px,_ipv4:()=>Bi,_ipv6:()=>Ji,_isoDate:()=>ml,_isoDateTime:()=>dl,_isoDuration:()=>hl,_isoTime:()=>fl,_jwt:()=>Xi,_ksuid:()=>Wi,_lazy:()=>Rx,_length:()=>Jt,_literal:()=>vx,_lowercase:()=>fn,_lt:()=>Ke,_lte:()=>De,_mac:()=>ul,_map:()=>fx,_max:()=>De,_maxLength:()=>Bt,_maxSize:()=>Et,_mime:()=>_n,_min:()=>ke,_minLength:()=>pt,_minSize:()=>Xe,_multipleOf:()=>kt,_nan:()=>jl,_nanoid:()=>Mi,_nativeEnum:()=>yx,_negative:()=>eo,_never:()=>Ol,_nonnegative:()=>no,_nonoptional:()=>Sx,_nonpositive:()=>to,_normalize:()=>bn,_null:()=>Nl,_nullable:()=>xx,_number:()=>gl,_optional:()=>bx,_overwrite:()=>Ze,_parse:()=>an,_parseAsync:()=>cn,_pipe:()=>wx,_positive:()=>Qi,_promise:()=>Px,_property:()=>ro,_readonly:()=>Ix,_record:()=>mx,_refine:()=>Zl,_regex:()=>mn,_safeDecode:()=>di,_safeDecodeAsync:()=>fi,_safeEncode:()=>pi,_safeEncodeAsync:()=>mi,_safeParse:()=>ln,_safeParseAsync:()=>un,_set:()=>hx,_size:()=>Wt,_slugify:()=>kn,_startsWith:()=>yn,_string:()=>cl,_stringFormat:()=>En,_stringbool:()=>Jl,_success:()=>kx,_superRefine:()=>Hl,_symbol:()=>Rl,_templateLiteral:()=>Tx,_toLowerCase:()=>$n,_toUpperCase:()=>Sn,_transform:()=>_x,_trim:()=>xn,_tuple:()=>dx,_uint32:()=>$l,_uint64:()=>Tl,_ulid:()=>Zi,_undefined:()=>Pl,_union:()=>cx,_unknown:()=>Dl,_uppercase:()=>hn,_url:()=>br,_uuid:()=>Oi,_uuidv4:()=>Ai,_uuidv6:()=>Li,_uuidv7:()=>Ci,_void:()=>Al,_xid:()=>Hi,_xor:()=>lx,clone:()=>Se,config:()=>pe,createStandardJSONSchemaMethod:()=>wn,createToJSONSchemaMethod:()=>Vl,decode:()=>D_,decodeAsync:()=>A_,describe:()=>Wl,encode:()=>z_,encodeAsync:()=>O_,extractDefs:()=>It,finalize:()=>Tt,flattenError:()=>lr,formatError:()=>ur,globalConfig:()=>tr,globalRegistry:()=>be,initializeContext:()=>wt,isValidBase64:()=>yc,isValidBase64URL:()=>im,isValidJWT:()=>om,locales:()=>vr,meta:()=>Bl,parse:()=>oi,parseAsync:()=>si,prettifyError:()=>ea,process:()=>ne,regexes:()=>Ce,registry:()=>zi,safeDecode:()=>C_,safeDecodeAsync:()=>M_,safeEncode:()=>L_,safeEncodeAsync:()=>j_,safeParse:()=>ta,safeParseAsync:()=>na,toDotPath:()=>Ud,toJSONSchema:()=>ao,treeifyError:()=>Qs,util:()=>N,version:()=>qa});var Zs=Object.freeze({status:"aborted"});function b(n,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(n))return;a._zod.traits.add(n),e(a,c);let l=s.prototype,u=Object.keys(l);for(let p=0;p<u.length;p++){let d=u[p];d in a||(a[d]=l[d].bind(a))}}let t=r?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:n});function s(a){var c;let l=r?.Parent?new o:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(n)}),Object.defineProperty(s,"name",{value:n}),s}var ni=Symbol("zod_brand"),Fe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_t=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},tr={};function pe(n){return n&&Object.assign(tr,n),tr}var N={};Ue(N,{BIGINT_FORMAT_RANGES:()=>Xs,Class:()=>Ws,NUMBER_FORMAT_RANGES:()=>Ys,aborted:()=>St,allowsEval:()=>Vs,assert:()=>u_,assertEqual:()=>s_,assertIs:()=>c_,assertNever:()=>l_,assertNotEqual:()=>a_,assignProp:()=>xt,base64ToUint8Array:()=>Cd,base64urlToUint8Array:()=>I_,cached:()=>on,captureStackTrace:()=>ii,cleanEnum:()=>w_,cleanRegex:()=>ir,clone:()=>Se,cloneDef:()=>d_,createTransparentProxy:()=>v_,defineLazy:()=>X,esc:()=>ri,escapeRegex:()=>Le,extend:()=>x_,finalizeIssue:()=>we,floatSafeRemainder:()=>Bs,getElementAtPath:()=>m_,getEnumValues:()=>rr,getLengthableOrigin:()=>ar,getParsedType:()=>y_,getSizableOrigin:()=>sr,hexToUint8Array:()=>R_,isObject:()=>Ft,isPlainObject:()=>$t,issue:()=>sn,joinValues:()=>S,jsonStringifyReplacer:()=>rn,merge:()=>S_,mergeDefs:()=>ut,normalizeParams:()=>z,nullish:()=>bt,numKeys:()=>g_,objectClone:()=>p_,omit:()=>b_,optionalKeys:()=>Ks,parsedType:()=>P,partial:()=>k_,pick:()=>__,prefixIssues:()=>ze,primitiveTypes:()=>qs,promiseAllObject:()=>f_,propertyKeyTypes:()=>or,randomString:()=>h_,required:()=>E_,safeExtend:()=>$_,shallowClone:()=>Gs,slugify:()=>Js,stringifyPrimitive:()=>R,uint8ArrayToBase64:()=>jd,uint8ArrayToBase64url:()=>T_,uint8ArrayToHex:()=>P_,unwrapMessage:()=>nr});function s_(n){return n}function a_(n){return n}function c_(n){}function l_(n){throw new Error("Unexpected value in exhaustive check")}function u_(n){}function rr(n){let e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,t])=>e.indexOf(+i)===-1).map(([i,t])=>t)}function S(n,e="|"){return n.map(r=>R(r)).join(e)}function rn(n,e){return typeof e=="bigint"?e.toString():e}function on(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function bt(n){return n==null}function ir(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function Bs(n,e){let r=(n.toString().split(".")[1]||"").length,i=e.toString(),t=(i.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(i)){let c=i.match(/\d?e-(\d?)/);c?.[1]&&(t=Number.parseInt(c[1]))}let o=r>t?r:t,s=Number.parseInt(n.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var Ld=Symbol("evaluating");function X(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==Ld)return i===void 0&&(i=Ld,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function p_(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function xt(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ut(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function d_(n){return ut(n._zod.def)}function m_(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function f_(n){let e=Object.keys(n),r=e.map(i=>n[i]);return Promise.all(r).then(i=>{let t={};for(let o=0;o<e.length;o++)t[e[o]]=i[o];return t})}function h_(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function ri(n){return JSON.stringify(n)}function Js(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ii="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Ft(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var Vs=on(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function $t(n){if(Ft(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ft(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Gs(n){return $t(n)?{...n}:Array.isArray(n)?[...n]:n}function g_(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var y_=n=>{let e=typeof n;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(n)?"array":n===null?"null":n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?"promise":typeof Map<"u"&&n instanceof Map?"map":typeof Set<"u"&&n instanceof Set?"set":typeof Date<"u"&&n instanceof Date?"date":typeof File<"u"&&n instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},or=new Set(["string","number","symbol"]),qs=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Le(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Se(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function z(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function v_(n){let e;return new Proxy({},{get(r,i,t){return e??(e=n()),Reflect.get(e,i,t)},set(r,i,t,o){return e??(e=n()),Reflect.set(e,i,t,o)},has(r,i){return e??(e=n()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=n()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=n()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=n()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,t){return e??(e=n()),Reflect.defineProperty(e,i,t)}})}function R(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function Ks(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var Ys={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Xs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function __(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ut(n._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return xt(this,"shape",s),s},checks:[]});return Se(n,o)}function b_(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ut(n._zod.def,{get shape(){let s={...n._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return xt(this,"shape",s),s},checks:[]});return Se(n,o)}function x_(n,e){if(!$t(e))throw new Error("Invalid input to extend: expected a plain object");let r=n._zod.def.checks;if(r&&r.length>0){let o=n._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=ut(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return xt(this,"shape",o),o}});return Se(n,t)}function $_(n,e){if(!$t(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ut(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return xt(this,"shape",i),i}});return Se(n,r)}function S_(n,e){let r=ut(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return xt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Se(n,r)}function k_(n,e,r){let t=e._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=ut(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=n?new n({type:"optional",innerType:a[l]}):a[l])}else for(let l in a)c[l]=n?new n({type:"optional",innerType:a[l]}):a[l];return xt(this,"shape",c),c},checks:[]});return Se(e,s)}function E_(n,e,r){let i=ut(e._zod.def,{get shape(){let t=e._zod.def.shape,o={...t};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new n({type:"nonoptional",innerType:t[s]}))}else for(let s in t)o[s]=new n({type:"nonoptional",innerType:t[s]});return xt(this,"shape",o),o}});return Se(e,i)}function St(n,e=0){if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function ze(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function nr(n){return typeof n=="string"?n:n?.message}function we(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=nr(n.inst?._zod.def?.error?.(n))??nr(e?.error?.(n))??nr(r.customError?.(n))??nr(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function sr(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function ar(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function P(n){let e=typeof n;switch(e){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function sn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function w_(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Cd(n){let e=atob(n),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function jd(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function I_(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Cd(e+r)}function T_(n){return jd(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function R_(n){let e=n.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function P_(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var Ws=class{constructor(...e){}};var Md=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,rn,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},cr=b("$ZodError",Md),Ie=b("$ZodError",Md,{Parent:Error});function lr(n,e=r=>r.message){let r={},i=[];for(let t of n.issues)t.path.length>0?(r[t.path[0]]=r[t.path[0]]||[],r[t.path[0]].push(e(t))):i.push(e(t));return{formErrors:i,fieldErrors:r}}function ur(n,e=r=>r.message){let r={_errors:[]},i=t=>{for(let o of t.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return i(n),r}function Qs(n,e=r=>r.message){let r={errors:[]},i=(t,o=[])=>{var s,a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,p=0;for(;p<l.length;){let d=l[p],m=p===l.length-1;typeof d=="string"?(u.properties??(u.properties={}),(s=u.properties)[d]??(s[d]={errors:[]}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),m&&u.errors.push(e(c)),p++}}};return i(n),r}function Ud(n){let e=[],r=n.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function ea(n){let e=[],r=[...n.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Ud(i.path)}`);return e.join(`
425
- `)}var an=n=>(e,r,i,t)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Fe;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>we(c,o,pe())));throw ii(a,t?.callee),a}return s.value},oi=an(Ie),cn=n=>async(e,r,i,t)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>we(c,o,pe())));throw ii(a,t?.callee),a}return s.value},si=cn(Ie),ln=n=>(e,r,i)=>{let t=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},t);if(o instanceof Promise)throw new Fe;return o.issues.length?{success:!1,error:new(n??cr)(o.issues.map(s=>we(s,t,pe())))}:{success:!0,data:o.value}},ta=ln(Ie),un=n=>async(e,r,i)=>{let t=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(s=>we(s,t,pe())))}:{success:!0,data:o.value}},na=un(Ie),ai=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return an(n)(e,r,t)},z_=ai(Ie),ci=n=>(e,r,i)=>an(n)(e,r,i),D_=ci(Ie),li=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return cn(n)(e,r,t)},O_=li(Ie),ui=n=>async(e,r,i)=>cn(n)(e,r,i),A_=ui(Ie),pi=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ln(n)(e,r,t)},L_=pi(Ie),di=n=>(e,r,i)=>ln(n)(e,r,i),C_=di(Ie),mi=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return un(n)(e,r,t)},j_=mi(Ie),fi=n=>async(e,r,i)=>un(n)(e,r,i),M_=fi(Ie);var Ce={};Ue(Ce,{base64:()=>va,base64url:()=>hi,bigint:()=>ka,boolean:()=>wa,browserEmail:()=>V_,cidrv4:()=>ga,cidrv6:()=>ya,cuid:()=>ra,cuid2:()=>ia,date:()=>ba,datetime:()=>$a,domain:()=>K_,duration:()=>la,e164:()=>_a,email:()=>pa,emoji:()=>da,extendedDuration:()=>U_,guid:()=>ua,hex:()=>Y_,hostname:()=>q_,html5Email:()=>W_,idnEmail:()=>J_,integer:()=>Ea,ipv4:()=>ma,ipv6:()=>fa,ksuid:()=>aa,lowercase:()=>Ra,mac:()=>ha,md5_base64:()=>Q_,md5_base64url:()=>eb,md5_hex:()=>X_,nanoid:()=>ca,null:()=>Ia,number:()=>gi,rfc5322Email:()=>B_,sha1_base64:()=>nb,sha1_base64url:()=>rb,sha1_hex:()=>tb,sha256_base64:()=>ob,sha256_base64url:()=>sb,sha256_hex:()=>ib,sha384_base64:()=>cb,sha384_base64url:()=>lb,sha384_hex:()=>ab,sha512_base64:()=>pb,sha512_base64url:()=>db,sha512_hex:()=>ub,string:()=>Sa,time:()=>xa,ulid:()=>oa,undefined:()=>Ta,unicodeEmail:()=>Fd,uppercase:()=>Pa,uuid:()=>Zt,uuid4:()=>F_,uuid6:()=>Z_,uuid7:()=>H_,xid:()=>sa});var ra=/^[cC][^\s-]{8,}$/,ia=/^[0-9a-z]+$/,oa=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sa=/^[0-9a-vA-V]{20}$/,aa=/^[A-Za-z0-9]{27}$/,ca=/^[a-zA-Z0-9_-]{21}$/,la=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,U_=/^[-+]?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)?)??$/,ua=/^([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})$/,Zt=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,F_=Zt(4),Z_=Zt(6),H_=Zt(7),pa=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,W_=/^[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])?)*$/,B_=/^(([^<>()\[\]\\.,;:\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,}))$/,Fd=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,J_=Fd,V_=/^[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])?)*$/,G_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function da(){return new RegExp(G_,"u")}var ma=/^(?:(?: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])$/,fa=/^(([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}|:))$/,ha=n=>{let e=Le(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},ga=/^((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])$/,ya=/^(([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])$/,va=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hi=/^[A-Za-z0-9_-]*$/,q_=/^(?=.{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])?)*\.?$/,K_=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,_a=/^\+[1-9]\d{6,14}$/,Zd="(?:(?:\\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])))",ba=new RegExp(`^${Zd}$`);function Hd(n){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xa(n){return new RegExp(`^${Hd(n)}$`)}function $a(n){let e=Hd({precision:n.precision}),r=["Z"];n.local&&r.push(""),n.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${Zd}T(?:${i})$`)}var Sa=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},ka=/^-?\d+n?$/,Ea=/^-?\d+$/,gi=/^-?\d+(?:\.\d+)?$/,wa=/^(?:true|false)$/i,Ia=/^null$/i;var Ta=/^undefined$/i;var Ra=/^[^A-Z]*$/,Pa=/^[^a-z]*$/,Y_=/^[0-9a-fA-F]*$/;function pr(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function dr(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var X_=/^[0-9a-fA-F]{32}$/,Q_=pr(22,"=="),eb=dr(22),tb=/^[0-9a-fA-F]{40}$/,nb=pr(27,"="),rb=dr(27),ib=/^[0-9a-fA-F]{64}$/,ob=pr(43,"="),sb=dr(43),ab=/^[0-9a-fA-F]{96}$/,cb=pr(64,""),lb=dr(64),ub=/^[0-9a-fA-F]{128}$/,pb=pr(86,"=="),db=dr(86);var oe=b("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),Bd={number:"number",bigint:"bigint",object:"date"},yi=b("$ZodCheckLessThan",(n,e)=>{oe.init(n,e);let r=Bd[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?t.maximum=e.value:t.exclusiveMaximum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),vi=b("$ZodCheckGreaterThan",(n,e)=>{oe.init(n,e);let r=Bd[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?t.minimum=e.value:t.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Na=b("$ZodCheckMultipleOf",(n,e)=>{oe.init(n,e),n._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Bs(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:n,continue:!e.abort})}}),za=b("$ZodCheckNumberFormat",(n,e)=>{oe.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=Ys[e.format];n._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=t,a.maximum=o,r&&(a.pattern=Ea)}),n._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:n});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}a<t&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:t,inclusive:!0,inst:n,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),Da=b("$ZodCheckBigIntFormat",(n,e)=>{oe.init(n,e);let[r,i]=Xs[e.format];n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),n._zod.check=t=>{let o=t.value;o<r&&t.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:n,continue:!e.abort}),o>i&&t.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:n,continue:!e.abort})}}),Oa=b("$ZodCheckMaxSize",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!bt(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;t.size<=e.maximum||i.issues.push({origin:sr(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Aa=b("$ZodCheckMinSize",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!bt(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;t.size>=e.minimum||i.issues.push({origin:sr(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),La=b("$ZodCheckSizeEquals",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!bt(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.size,t.maximum=e.size,t.size=e.size}),n._zod.check=i=>{let t=i.value,o=t.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:sr(t),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),Ca=b("$ZodCheckMaxLength",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!bt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;if(t.length<=e.maximum)return;let s=ar(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),ja=b("$ZodCheckMinLength",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!bt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;if(t.length>=e.minimum)return;let s=ar(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Ma=b("$ZodCheckLengthEquals",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!bt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.length,t.maximum=e.length,t.length=e.length}),n._zod.check=i=>{let t=i.value,o=t.length;if(o===e.length)return;let s=ar(t),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),pn=b("$ZodCheckStringFormat",(n,e)=>{var r,i;oe.init(n,e),n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=n._zod).check??(r.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:e.format,input:t.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),Ua=b("$ZodCheckRegex",(n,e)=>{pn.init(n,e),n._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),Fa=b("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=Ra),pn.init(n,e)}),Za=b("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=Pa),pn.init(n,e)}),Ha=b("$ZodCheckIncludes",(n,e)=>{oe.init(n,e);let r=Le(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,n._zod.onattach.push(t=>{let o=t._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=t=>{t.value.includes(e.includes,e.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:t.value,inst:n,continue:!e.abort})}}),Wa=b("$ZodCheckStartsWith",(n,e)=>{oe.init(n,e);let r=new RegExp(`^${Le(e.prefix)}.*`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),Ba=b("$ZodCheckEndsWith",(n,e)=>{oe.init(n,e);let r=new RegExp(`.*${Le(e.suffix)}$`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}});function Wd(n,e,r){n.issues.length&&e.issues.push(...ze(r,n.issues))}var Ja=b("$ZodCheckProperty",(n,e)=>{oe.init(n,e),n._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>Wd(t,r,e.property));Wd(i,r,e.property)}}),Va=b("$ZodCheckMimeType",(n,e)=>{oe.init(n,e);let r=new Set(e.mime);n._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),n._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:n,continue:!e.abort})}}),Ga=b("$ZodCheckOverwrite",(n,e)=>{oe.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var mr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
433
+ `,e,r)}deleteSection(e){this.run("DELETE FROM hologram_snapshot WHERE section = ?",e)}deleteAll(){this.run("DELETE FROM hologram_snapshot")}hasSection(e){return(this.get("SELECT COUNT(*) as count FROM hologram_snapshot WHERE section = ?",e)?.count??0)>0}}});var A,te=pe(()=>{"use strict";Kt();rg();ig();ag();cg();_g();bg();xg();Sg();kg();A=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=Oe(e),s=r.files?.database,a=!r.intentLogs||!r.searchHistory||!r.missions||!r.hologram;if(s===o&&o.open&&!a)return r;this.repositoryCache.delete(e)}let i=Oe(e),t={files:new os(i),exports:new ss(i),imports:new as(i),missions:new cs(i),intentLogs:new ds(i),configs:new ms(i),content:new fs(i),searchHistory:new hs(i),hologram:new gs(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),Wh(e)}static clearCache(e){this.repositoryCache.delete(e)}}});var $s,Ss,Pg,ks,Ng,zg,Dg,Og,Lg,Ag,Cg,jg,Mg,Ug,Gr,Es,Fg,Zg,pd=pe(()=>{"use strict";$s=[/\/pages\/(?!_)[^/]+\.(tsx?|jsx?)$/i,/\/pages\/.*\/index\.(tsx?|jsx?)$/i,/\/app\/.*\/page\.(tsx?|jsx?)$/i,/\/app\/.*\/layout\.(tsx?|jsx?)$/i,/\/app\/api\/.*\/route\.(ts|js)$/i,/\/pages\/api\/.*\.(ts|js)$/i],Ss=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],Pg=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],ks=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],Ng=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],zg=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],Dg=[/\/commands?\/[^/]+\.(ts|js|py|php)$/i,/\/cli\/[^/]+\.(ts|js|py|php)$/i,/\/bin\/[^/]+\.(ts|js|py|php)$/i,/cli\.(ts|js|py|php)$/i,/main\.(ts|js|py|php)$/i],Og=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],Lg=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],Ag=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],Cg=[/\/stores?\//i,/\/slices?\//i,/\/reducers?\//i,/\/atoms?\//i,/\/selectors?\//i,/\.(store|slice|reducer|atom|selector)\.(ts|js)$/i,/.*Slice\.(ts|js)$/i,/.*Store\.(ts|js)$/i],jg=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],Mg=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],Ug=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],Gr=[/\.(model|entity|schema|repository|repo|dao|migration|query|mutation|resolver|connection|db)\.(ts|js)$/i,/queries\.(ts|js)$/i,/mutations\.(ts|js)$/i,/resolvers\.(ts|js)$/i,/connection\.(ts|js)$/i,/\/models?\//i,/\/entities?\//i,/\/repositories?\//i,/\/repos?\//i,/\/data\//i,/\/database\//i,/\/prisma\//i,/\/drizzle\//i,/\/api\/.*client\.(ts|js|tsx)$/i,/(^|\/)[A-Z0-9_-]*API\.(tsx?|js|jsx)$/],Es=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],Fg=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],Zg=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var ws,Hg,Is,Bg,dd=pe(()=>{"use strict";ws=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],Hg=[/views\.py$/i,/forms\.py$/i,/serializers\.py$/i,/admin\.py$/i,/apps\.py$/i,/tasks\.py$/i,/middlewares?\.py$/i,/signals?\.py$/i,/context_processors\.py$/i],Is=[/models\.py$/i,/\/models\/.*\.py$/i,/\/migrations\/.*\.py$/i,/schema\.py$/i,/documents\.py$/i],Bg=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var Ts,Gg,Rs,Vg,md=pe(()=>{"use strict";Ts=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],Gg=[/\/services?\/.*\.php$/i,/\/providers?\/.*\.php$/i,/\/middleware\/.*\.php$/i,/\/jobs?\/.*\.php$/i,/\/listeners?\/.*\.php$/i,/\/events?\/.*\.php$/i,/\/observers?\/.*\.php$/i,/\/console\/commands\/.*\.php$/i,/\/actions?\/.*\.php$/i,/\/traits?\/.*\.php$/i,/\/concerns?\/.*\.php$/i,/\/contracts?\/.*\.php$/i],Rs=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],Vg=["laravel","symfony","slim","cakephp","codeigniter"]});import Kg from"path";function Vr(n,e,r){let i=[],t="Unknown",o=0;r||(r=iS(n,e));let{inDegree:s,outDegree:a}=r,c=(d,m,f,h)=>{for(let _ of d)if(_.test(n))return i.push(`${h}: ${_.source}`),t=m,o+=f,!0;return!1},l=!1;if(l||(l=c($s,"Entry",45,"Next.js entry")),l||(l=c(Ng,"Entry",40,"MCP handler")),l||(l=c(Dg,"Entry",40,"CLI command")),l||(l=c(Gr,"Data",45,"Data layer/Repository")),l||(l=c(Cg,"Data",35,"State management")),l||(l=c(Pg,"Logic",40,"React component")),l||(l=c(ks,"Logic",35,"Logic pattern")),l||(l=c(Og,"Logic",35,"Parser/AST")),l||(l=c(Lg,"Logic",35,"Core module")),l||(l=c(Ag,"Logic",30,"UI layer")),l||(l=c(Ug,"Types",35,"Type definition")),l||(l=c(ws,"Entry",40,"Python Entry")),l||(l=c(Is,"Data",40,"Python Data")),l||(l=c(Hg,"Logic",35,"Python Logic")),l||(l=c(Ts,"Entry",40,"PHP Entry")),l||(l=c(Rs,"Data",40,"PHP Data")),l||(l=c(Gg,"Logic",35,"PHP Logic")),l||(l=c(jg,"Logic",35,"Hook/Context")),!l){for(let d of zg)if(d.test(n)){i.push(`MCP utility: ${d.source}`),/schemas?/i.test(n)?t="Types":/resources?/i.test(n)?t="Data":t="Utility",o+=35,l=!0;break}}l||c(Mg,"Data",35,"Schema definition")&&(l=!0),l||(c(Gr,"Data",30,"Path matches data pattern")||c(Es,"Utility",25,"Path matches utility pattern")||c(Ss,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let d of fd)if(d.test(n)){i.push(`Test file: ${d.source}`),t="Test",o=50,l=!0;break}l||c(hd,"Infrastructure",40,"Infrastructure")&&(l=!0);for(let d of rS)d.test(n)&&(i.push(`Monorepo component: ${d.source}`),/\/apps\/[^/]+\/src\/pages\//i.test(n)&&(i.push("Monorepo App Entry"),t==="Unknown"&&(t="Entry"),o+=20),/\/packages\/[^/]+\/src\//i.test(n)&&(o+=10));let p=e.imports.getImportsForFile(n).map(d=>d.module_specifier.toLowerCase());for(let d of Zg)if(p.some(m=>m.includes(d))){i.push(`Imports JS data library: ${d}`),(t==="Unknown"||t==="Data")&&(t="Data",o+=25);break}for(let d of Bg)if(p.some(m=>m.includes(d))){i.push(`Imports Python framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of Vg)if(p.some(m=>m.includes(d))){i.push(`Imports PHP framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of Fg)if(p.some(m=>m.includes(d))){i.push(`Imports JS framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}if(s===0&&a>0&&(i.push("Entry point: nothing imports this file (in-degree=0)"),t==="Unknown"?(t="Entry",o+=30):t==="Entry"&&(o+=15)),s>5&&a<=2&&(i.push(`High reuse: ${s} files import this (candidate for Utility)`),t==="Unknown"?(t="Utility",o+=25):t==="Utility"&&(o+=10)),t==="Unknown"&&s>0&&a>0){let d=s/(s+a);d>.3&&d<.7&&(i.push(`Balanced traffic: in=${s}, out=${a} (likely Logic layer)`),t="Logic",o+=25)}return t==="Unknown"&&(i.push("No strong classification signals detected"),o=10),o=Math.min(o,100),{layer:t,confidence:o,signals:i}}function iS(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function st(n,e){let r=n.files.getAllPaths().map(f=>({path:f})),i=new Map,t={Entry:[],Logic:[],Data:[],Utility:[],Infrastructure:[],Test:[],Types:[],Unknown:[]};for(let f of r){let h=Vr(f.path,n);i.set(f.path,h),t[h.layer].push({path:f.path,classification:h})}let o={Entry:Ot(t.Entry,e),Logic:Ot(t.Logic,e),Data:Ot(t.Data,e),Utility:Ot(t.Utility,e),Infrastructure:Ot(t.Infrastructure,e),Test:Ot(t.Test,e),Types:Ot(t.Types,e),Unknown:Ot(t.Unknown,e)},s={};r.forEach(f=>{let h=Kg.extname(f.path).toLowerCase();h&&(s[h]=(s[h]||0)+1)});let a={".ts":"TypeScript",".tsx":"Typescript (React)",".js":"JavaScript",".jsx":"JavaScript (React)",".py":"Python",".php":"PHP",".go":"Go",".rs":"Rust",".java":"Java",".cs":"C#",".rb":"Ruby",".vue":"Vue"},c={};Object.entries(s).forEach(([f,h])=>{let _=a[f];_&&(c[_]=(c[_]||0)+h)});let l=Object.entries(c).sort((f,h)=>h[1]-f[1]),u=l.length>0?l[0][0]:"Unknown",{pattern:p,patternConfidence:d,insights:m}=oS(o,r.length,n);return{pattern:p,patternConfidence:d,layers:o,insights:m,primaryStack:u}}function Ot(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:Kg.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function oS(n,e,r){let i=[],t="Unknown",o=0,s=n.Entry.count/e*100,a=n.Logic.count/e*100,c=n.Data.count/e*100,l=n.Utility.count/e*100,u=n.Unknown.count/e*100;s>5&&a>10&&c>5&&u<40?(t="Layered",o=60+Math.min(30,(100-u)/3),i.push(`Clear layer separation: Entry (${s.toFixed(1)}%), Logic (${a.toFixed(1)}%), Data (${c.toFixed(1)}%)`)):l>20?(t="Modular",o=50+l/2,i.push(`High shared module usage: ${l.toFixed(1)}% utility files`)):u>60&&(t="Monolithic",o=40+u/4,i.push(`Limited architectural structure: ${u.toFixed(1)}% files with unclear layer assignment`));let p=r.configs.countByKind("Service");return p>3&&(t="Microservices",o=55+p*5,i.push(`Detected ${p} service definitions (likely microservices)`)),n.Entry.count===0&&i.push("\u26A0\uFE0F No clear entry points detected - consider adding route/controller files"),n.Data.count===0&&i.push("\u26A0\uFE0F No data layer detected - repository may not use traditional ORM patterns"),l>30&&i.push(`High utility concentration (${l.toFixed(1)}%) - good reusability`),{pattern:t,patternConfidence:Math.min(100,o),insights:i}}var fd,hd,rS,nn=pe(()=>{"use strict";pd();dd();md();fd=[/\.(test|spec)\.(ts|tsx|js|jsx)$/i,/tests?\.py$/i,/\/__tests__\//i,/\/tests?\//i,/\.e2e\.(ts|js)$/i,/\.integration\.(ts|js)$/i],hd=[/Dockerfile/i,/docker-compose/i,/\.ya?ml$/i,/nginx\.conf/i,/\/infra\//i,/\/deploy\//i,/\/k8s\//i,/\/kubernetes\//i,/\/terraform\//i,/\/ansible\//i,/package\.json/i,/tsconfig.*\.json/i,/\.env/i],rS=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});var Yg={};Ae(Yg,{HologramService:()=>de});var Je,de,Ge=pe(()=>{"use strict";te();nn();K();Je=x.child({module:"hologram"}),de=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=A.getInstance(e)}updateTopography(e){Je.debug({repoPath:this.repoPath},"Updating topography snapshot");let r=Object.values(e.layers).reduce((o,s)=>o+s.count,0),i={};for(let[o,s]of Object.entries(e.layers)){let a=r>0?s.count/r*100:0;i[o]={count:s.count,percentage:Math.round(a*10)/10,topFiles:s.topFiles.slice(0,3).map(c=>({path:c.path,confidence:c.confidence}))}}let t={pattern:e.pattern,patternConfidence:e.patternConfidence,layerDistribution:i,insights:e.insights,updatedAt:Date.now()};this.repos.hologram.upsertSection("topography",JSON.stringify(t)),Je.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=st(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){Je.debug({repoPath:this.repoPath,count:e.length},"Updating gravity zones");let r={hotspots:e.slice(0,50),updatedAt:Date.now()};this.repos.hologram.upsertSection("gravity",JSON.stringify(r)),Je.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){Je.debug({repoPath:this.repoPath,count:e.length},"Updating ghost bridges");let r={bridges:e.slice(0,20),updatedAt:Date.now()};this.repos.hologram.upsertSection("ghosts",JSON.stringify(r)),Je.info({repoPath:this.repoPath},"Ghost bridges updated")}getSnapshot(){let e=this.repos.hologram.getAllSections(),r={metadata:{repoPath:this.repoPath,lastUpdated:Date.now(),version:"1.0.0"}};for(let i of e)try{let t=JSON.parse(i.data);switch(i.section){case"topography":r.topography=t;break;case"gravity":r.gravity=t;break;case"ghosts":r.ghosts=t;break}}catch(t){Je.error({repoPath:this.repoPath,section:i.section,error:t},"Failed to parse hologram section")}return r}getSection(e){let r=this.repos.hologram.getSection(e);if(!r)return null;try{return JSON.parse(r.data)}catch(i){return Je.error({repoPath:this.repoPath,section:e,error:i},"Failed to parse section"),null}}computeGravityZones(){Je.debug({repoPath:this.repoPath},"Computing gravity zones from import graph");let e=this.repos.files.getAllPaths(),r=new Map;for(let t of e){let o=Vr(t,this.repos);if(o.layer==="Test"||o.layer==="Unknown")continue;let s=this.repos.exports.findByFile(t);if(s.length===0)continue;let a=this.repos.imports.countDependents(t),c=this.repos.imports.countByFile(t),l=a*2+c;if(l>0){let u=s.find(d=>d.kind!=="TsTypeAliasDeclaration"&&d.kind!=="TsInterfaceDeclaration")||s[0],p=`${t}::${u.name}`;r.set(p,{symbol:u.name,filePath:t,inDegree:a,outDegree:c,gravity:l})}}let i=Array.from(r.values()).sort((t,o)=>o.gravity-t.gravity).slice(0,50);return Je.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),Je.info({repoPath:this.repoPath},"Hologram cleared")}}});var my={};Ae(my,{GraphExporterService:()=>_d});var dy,_d,fy=pe(()=>{"use strict";te();K();dy=x.child({module:"graph-exporter"}),_d=class{constructor(e){this.repoPath=e;this.repos=A.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;dy.info({focusMissionId:t,depth:o,format:i,includeCompleted:r},"Generating mission graph");let a=this.buildMissionTree(t,r,o,s);return i==="json"?JSON.stringify(a,null,2):this.generateMermaidDiagram(a)}buildMissionTree(e,r,i,t){let o;if(e){let c=this.repos.missions.findById(e);o=c?[c]:[]}else o=this.repos.missions.findAll().filter(l=>!l.parent_id),r||(o=o.filter(l=>l.status!=="completed"));let s=0,a=[];for(let c of o){if(s>=t)break;let l=this.buildNode(c,r,i,1,{count:s,max:t});l&&(a.push(l),s+=this.countNodes(l))}return a}buildNode(e,r,i,t,o){if(t>i||o.count>=o.max)return null;let s;if(e.strategy_graph)try{let u=JSON.parse(e.strategy_graph);s=this.parseStrategySteps(u)}catch(u){dy.debug({missionId:e.id,err:u},"Failed to parse strategy graph")}let a={id:e.id,name:e.name,status:e.status,goal:e.goal,branch:e.git_branch||void 0,children:[],steps:s},c=this.repos.missions.findByParentId(e.id),l=r?c:c.filter(u=>u.status!=="completed");for(let u of l){if(o.count>=o.max)break;let p=this.buildNode(u,r,i,t+1,o);p&&(a.children.push(p),o.count++)}return a}parseStrategySteps(e){let r=[];return Array.isArray(e)?e.map((i,t)=>({id:i.id||`step-${t}`,description:i.description||i.content||i.name||`Step ${t+1}`,status:i.status,dependencies:i.dependencies||i.deps})):e.steps&&Array.isArray(e.steps)?this.parseStrategySteps(e.steps):typeof e=="object"?Object.entries(e).map(([i,t])=>({id:i,description:t.description||t.content||i,status:t.status,dependencies:t.dependencies||t.deps})):r}countNodes(e){let r=1;for(let i of e.children)r+=this.countNodes(i);return r}generateMermaidDiagram(e){let r=["graph TD"];for(let i of e)this.addMermaidNode(i,r);return r.join(`
434
+ `)}addMermaidNode(e,r,i){let t=`M${e.id}`,o=this.getStatusIcon(e.status),s=this.getStatusClass(e.status),a=`${o} ${e.name}`;if(r.push(` ${t}["${this.escapeMermaid(a)}"]:::${s}`),i&&r.push(` ${i} --> ${t}`),e.steps&&e.steps.length>0&&e.steps.length<=10)for(let c of e.steps){let l=`S${e.id}_${c.id}`,u=c.status||"pending",p=this.getStatusIcon(u),d=this.getStatusClass(u),m=`${p} ${c.description}`;if(r.push(` ${l}["${this.escapeMermaid(m)}"]:::${d}`),r.push(` ${t} -.-> ${l}`),c.dependencies&&c.dependencies.length>0)for(let f of c.dependencies){let h=`S${e.id}_${f}`;r.push(` ${h} --> ${l}`)}}for(let c of e.children)this.addMermaidNode(c,r,t);i||(r.push(""),r.push(" classDef completed fill:#90EE90,stroke:#2E8B57,stroke-width:2px"),r.push(" classDef inProgress fill:#87CEEB,stroke:#4682B4,stroke-width:2px"),r.push(" classDef planned fill:#FFE4B5,stroke:#DAA520,stroke-width:2px"),r.push(" classDef suspended fill:#D3D3D3,stroke:#808080,stroke-width:2px"),r.push(" classDef failed fill:#FFB6C1,stroke:#DC143C,stroke-width:2px"),r.push(" classDef pending fill:#FFF8DC,stroke:#B8860B,stroke-width:1px"))}getStatusIcon(e){return{completed:"\u2713","in-progress":"\u26A1",planned:"\u{1F4CB}",suspended:"\u23F8",failed:"\u2717",pending:"\u25CB",verifying:"\u{1F50D}"}[e]||"\u25CB"}getStatusClass(e){return{completed:"completed","in-progress":"inProgress",planned:"planned",suspended:"suspended",failed:"failed",pending:"pending",verifying:"inProgress"}[e]||"pending"}escapeMermaid(e){return e.replace(/"/g,"#quot;").replace(/\n/g," ").replace(/\[/g,"#91;").replace(/]/g,"#93;").slice(0,100)}}});import{Server as Nk}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as zk}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as Dk,ListToolsRequestSchema as Ok,ListResourcesRequestSchema as Lk,ReadResourceRequestSchema as Ak}from"@modelcontextprotocol/sdk/types.js";var Zd=[{name:"shadow_recon_onboard",description:"Initial onboarding for a repository. Indexes all files, extracts symbols, and detects services.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_topography",description:"Analyze architectural layers (Entry/Logic/Data/Utility). Returns layer breakdown and architectural insights.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_scout",description:"(Expert) Detect architectural drift, pattern violations, and gravity anomalies.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_tree",description:"Generate hierarchical file tree with file classifications and export summaries.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},subPath:{type:"string",description:"Relative path to focus tree on a specific subdirectory"},maxDepth:{type:"number",description:"Maximum directory depth to traverse"}},required:["repoPath"]}},{name:"shadow_recon_hologram",description:"Get the project hologram (persistent architectural snapshot) and gravity zones.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},compact:{type:"boolean",description:"Omit large arrays (gravity.hotspots) for lighter output"}},required:["repoPath"]}},{name:"shadow_search_concept",description:"Semantic/Vector-based intent search across file purpose and logic.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term or semantic intent"},limit:{type:"number",description:"Max results (default 10)"},offset:{type:"number",description:"Pagination offset"},compact:{type:"boolean",description:"Return compact output (no snippets)"},fileType:{type:"string",description:"Filter by extension(s)"},layer:{type:"string",enum:["Solid","Liquid","Virtual","Intel","Phantom"]},includeTests:{type:"boolean",description:"Include test files (Virtual)"}},required:["repoPath","query"]}},{name:"shadow_search_symbol",description:"Exact and fuzzy code symbol matching (classes, functions, methods).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Symbol name or partial name"},limit:{type:"number",description:"Max results"},offset:{type:"number",description:"Pagination offset"},fileType:{type:"string",description:"Filter by extension(s)"},matchMode:{type:"string",enum:["any","all","exact"],description:"Match mode for multi-word queries: 'any' (OR, default), 'all' (AND), 'exact' (phrase)"}},required:["repoPath","query"]}},{name:"shadow_search_config",description:"Environment and configuration discovery (ENV, Ports, Docker, YAML).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term for values/keys"},key:{type:"string",description:"Specific config key match"},kind:{type:"string",enum:["Service","Image","Port","Env"]},limit:{type:"number"},showUsage:{type:"boolean",description:"Cross-reference with code to show usage counts and identify orphaned vars (defined but never used)"}},required:["repoPath"]}},{name:"shadow_search_path",description:"Filename-keyword resolution using the search index.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Filename part or path keyword"},limit:{type:"number"},ranked:{type:"boolean",description:"Sort results by gravity (high-import files first) and show layer classification (Entry/Logic/Data)"}},required:["repoPath","query"]}},{name:"shadow_analyze_impact",description:"Calculate blast radius and Strategic Risk Scoring of changing a symbol.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string",description:"Symbol to analyze"},filePath:{type:"string",description:"Specific file where symbol is defined"},depth:{type:"number",description:"Traversal depth (default 3)"},limit:{type:"number",description:"Max results per symbol (default 50)"},offset:{type:"number",description:"Pagination offset"}},required:["repoPath","symbolName"]}},{name:"shadow_analyze_flow",description:"Execution call-chain tracing (AST-based) for a specific function/method.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string",description:"File to start trace from"},symbolName:{type:"string",description:"Function/method name"}},required:["repoPath","filePath"]}},{name:"shadow_analyze_deps",description:"Direct file import/export mapping and dependency graph inspection.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},direction:{type:"string",enum:["imports","imported_by"]}},required:["repoPath","filePath","direction"]}},{name:"shadow_analyze_debt",description:"Recursive dead-code detection and circular import identification. For dead-code mode: excludes migrations and fixtures by default, returns results with confidence scoring.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},mode:{type:"string",enum:["dead-code","circular-deps"]},limit:{type:"number"},includeTests:{type:"boolean"},excludePatterns:{type:"array",items:{type:"string"},description:"Custom glob patterns to exclude (e.g., '**/migrations/**')"},includeMigrations:{type:"boolean",description:"Include migration files (default: false)"},includeFixtures:{type:"boolean",description:"Include fixture/mock files (default: false)"},confidenceThreshold:{type:"string",enum:["all","high","medium"],description:"Filter by confidence: 'all' (default), 'high' (likely dead), 'medium' (possibly intentional)"}},required:["repoPath","mode"]}}];var Wd=[{name:"shadow_ops_plan",description:"Create a new development mission or strategic initiative with goals and strategy.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},name:{type:"string",description:"Mission name"},goal:{type:"string",description:"Objective and success criteria"},strategy:{type:"string",description:"JSON strategy (steps DAG)"},parentId:{type:"number",description:"ID of parent mission"},outcomeContract:{type:"string",description:"Success verification contract"},templateId:{type:"string",enum:["refactoring","feature","bug-fix"]},templateVars:{type:"object",description:"Template variables"}},required:["repoPath"]}},{name:"shadow_ops_track",description:"Update mission step status, record progress, and track completion.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},stepId:{type:"string"},status:{type:"string",enum:["pending","in-progress","completed","failed","skipped"]},contextPivot:{type:"string",description:"Rationale for status change"},updates:{type:"array",items:{type:"object",properties:{stepId:{type:"string"},status:{type:"string"},contextPivot:{type:"string"}}}}},required:["repoPath","missionId"]}},{name:"shadow_ops_log",description:"Record architectural decisions, discoveries, or blockers to the intent log.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},type:{type:"string",enum:["decision","blocker","discovery","fix"]},content:{type:"string"},symbolName:{type:"string",description:"Symbol related to this intent"}},required:["repoPath","missionId","type","content"]}},{name:"shadow_ops_briefing",description:"Active situational awareness - Get details on missions, decisions, and next steps.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Optional specific mission ID"},scope:{type:"string",enum:["mission","project"]},altitude:{type:"string",enum:["orbit","atmosphere","ground"],description:"Zoom level: orbit (~200 tokens, counts+candidates only), atmosphere (strategy+crystals, default), ground (raw logs+working set)"},includeGroupedByParent:{type:"boolean"},activeMissionsLimit:{type:"number",description:"Limit active missions in output"},recentActivityLimit:{type:"number",description:"Limit recent activity logs"},compact:{type:"boolean",description:"Omit strategy_graph JSON for lighter output"}},required:["repoPath"]}},{name:"shadow_ops_synthesize",description:"Distill mission context and logs into an Architectural Decision Record (ADR).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"}},required:["repoPath","missionId"]}},{name:"shadow_ops_chronicle",description:"Archive feed of the repository narrative (initiatives and standalones).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},format:{type:"string",enum:["markdown","json"]},limit:{type:"number"},offset:{type:"number"},since:{type:"number"},until:{type:"number"}},required:["repoPath"]}},{name:"shadow_ops_context",description:'Session-start bundle in one call: hologram + chronicle (last 5) + briefing summary (counts, next_work_candidates). Use for "new chat, give me the world" without multiple round-trips.',inputSchema:{type:"object",properties:{repoPath:{type:"string"},compact:{type:"boolean",description:"Return lighter payload (omit full hologram.gravity.hotspots, strategy_graph)"}},required:["repoPath"]}},{name:"shadow_ops_health",description:"System health metrics and intelligence index status.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_ops_crystallize",description:"Compress a mission's intent logs into a single crystal summary. Raw logs are marked as absorbed and replaced by one dense crystal node for token-efficient briefings.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"}},required:["repoPath","missionId"]}},{name:"shadow_ops_graph",description:"Visualize mission lineage and dependencies.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},depth:{type:"number"},limit:{type:"number"},format:{type:"string",enum:["mermaid","json"]}},required:["repoPath"]}},{name:"shadow_inspect_symbol",description:"Dense code retrieval for a single symbol with semantic folding and usage context.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string"},context:{type:"string",enum:["definition","full"]}},required:["repoPath","symbolName"]}},{name:"shadow_inspect_file",description:"Token-efficient summary of ALL symbols and exports in a file.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},detailLevel:{type:"string",enum:["structure","signatures","summaries","detailed"]}},required:["repoPath","filePath"]}},{name:"shadow_sync_trace",description:"Full lifecycle synchronization - Repairs index, analyzes changes, and re-hydrates state.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},sinceCommit:{type:"string"}},required:["repoPath"]}},{name:"shadow_sync_index",description:"Incremental code re-indexing to reflect latest file changes.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},deep:{type:"boolean",description:"Force full rebuild"}},required:["repoPath"]}},{name:"shadow_sync_repair",description:"NanoRepair only - Heals broken intent links and symbol shifts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_env_hooks",description:"Install and manage Git hooks for automated intelligence maintenance.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},action:{type:"string",enum:["install","remove","status"]},enableAutoRefresh:{type:"boolean"},enableSymbolHealing:{type:"boolean"}},required:["repoPath","action"]}},{name:"shadow_env_diagnose",description:"Missions and intelligence toolset health check.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_workspace_list",description:"Federated view of active missions across multiple repositories.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},status:{type:"string"}},required:["repoPaths"]}},{name:"shadow_workspace_link",description:"Establish intent-level dependencies between missions in different repos.",inputSchema:{type:"object",properties:{parentRepoPath:{type:"string"},parentMissionId:{type:"number"},childRepoPath:{type:"string"},childMissionId:{type:"number"},relationship:{type:"string"}},required:["parentRepoPath","parentMissionId","childRepoPath","childMissionId","relationship"]}},{name:"shadow_workspace_fuse",description:"Create unified cross-repo search indices using SQLite fusion.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},name:{type:"string"}},required:["repoPaths"]}}];var y={};Ae(y,{$brand:()=>pi,$input:()=>vl,$output:()=>yl,NEVER:()=>Qs,TimePrecision:()=>$l,ZodAny:()=>pp,ZodArray:()=>hp,ZodBase64:()=>Mo,ZodBase64URL:()=>Uo,ZodBigInt:()=>Mn,ZodBigIntFormat:()=>Wo,ZodBoolean:()=>jn,ZodCIDRv4:()=>Co,ZodCIDRv6:()=>jo,ZodCUID:()=>Po,ZodCUID2:()=>No,ZodCatch:()=>Cp,ZodCodec:()=>Yo,ZodCustom:()=>jr,ZodCustomStringFormat:()=>An,ZodDate:()=>Dr,ZodDefault:()=>Np,ZodDiscriminatedUnion:()=>yp,ZodE164:()=>Fo,ZodEmail:()=>Io,ZodEmoji:()=>To,ZodEnum:()=>On,ZodError:()=>Qx,ZodExactOptional:()=>Tp,ZodFile:()=>wp,ZodFirstPartyTypeKind:()=>qp,ZodFunction:()=>Jp,ZodGUID:()=>Tr,ZodIPv4:()=>Lo,ZodIPv6:()=>Ao,ZodISODate:()=>xo,ZodISODateTime:()=>bo,ZodISODuration:()=>So,ZodISOTime:()=>$o,ZodIntersection:()=>vp,ZodIssueCode:()=>t$,ZodJWT:()=>Zo,ZodKSUID:()=>Oo,ZodLazy:()=>Wp,ZodLiteral:()=>Ep,ZodMAC:()=>ip,ZodMap:()=>Sp,ZodNaN:()=>Mp,ZodNanoID:()=>Ro,ZodNever:()=>mp,ZodNonOptional:()=>qo,ZodNull:()=>lp,ZodNullable:()=>Pp,ZodNumber:()=>Cn,ZodNumberFormat:()=>qt,ZodObject:()=>Lr,ZodOptional:()=>Vo,ZodPipe:()=>Ko,ZodPrefault:()=>Dp,ZodPromise:()=>Bp,ZodReadonly:()=>Up,ZodRealError:()=>Te,ZodRecord:()=>Cr,ZodSet:()=>kp,ZodString:()=>Ln,ZodStringFormat:()=>ae,ZodSuccess:()=>Ap,ZodSymbol:()=>ap,ZodTemplateLiteral:()=>Zp,ZodTransform:()=>Ip,ZodTuple:()=>bp,ZodType:()=>X,ZodULID:()=>zo,ZodURL:()=>zr,ZodUUID:()=>nt,ZodUndefined:()=>cp,ZodUnion:()=>Ar,ZodUnknown:()=>dp,ZodVoid:()=>fp,ZodXID:()=>Do,ZodXor:()=>gp,_ZodString:()=>wo,_default:()=>zp,_function:()=>Sh,any:()=>th,array:()=>Or,base64:()=>jf,base64url:()=>Mf,bigint:()=>Kf,boolean:()=>sp,catch:()=>jp,check:()=>kh,cidrv4:()=>Af,cidrv6:()=>Cf,clone:()=>$e,codec:()=>bh,coerce:()=>Kp,config:()=>me,core:()=>mt,cuid:()=>Tf,cuid2:()=>Rf,custom:()=>Eh,date:()=>rh,decode:()=>Yu,decodeAsync:()=>Qu,describe:()=>wh,discriminatedUnion:()=>lh,e164:()=>Uf,email:()=>vf,emoji:()=>wf,encode:()=>Ku,encodeAsync:()=>Xu,endsWith:()=>kn,enum:()=>Jo,exactOptional:()=>Rp,file:()=>gh,flattenError:()=>hr,float32:()=>Jf,float64:()=>Gf,formatError:()=>gr,fromJSONSchema:()=>Dh,function:()=>Sh,getErrorMap:()=>r$,globalRegistry:()=>be,gt:()=>et,gte:()=>Se,guid:()=>_f,hash:()=>Bf,hex:()=>Hf,hostname:()=>Wf,httpUrl:()=>Ef,includes:()=>$n,instanceof:()=>Th,int:()=>Eo,int32:()=>Vf,int64:()=>Yf,intersection:()=>_p,ipv4:()=>Df,ipv6:()=>Lf,iso:()=>Dn,json:()=>Ph,jwt:()=>Ff,keyof:()=>ih,ksuid:()=>zf,lazy:()=>Hp,length:()=>Gt,literal:()=>hh,locales:()=>kr,looseObject:()=>ah,looseRecord:()=>ph,lowercase:()=>bn,lt:()=>Qe,lte:()=>De,mac:()=>Of,map:()=>dh,maxLength:()=>Jt,maxSize:()=>It,meta:()=>Ih,mime:()=>En,minLength:()=>dt,minSize:()=>tt,multipleOf:()=>wt,nan:()=>_h,nanoid:()=>If,nativeEnum:()=>fh,negative:()=>lo,never:()=>Ho,nonnegative:()=>po,nonoptional:()=>Lp,nonpositive:()=>uo,normalize:()=>wn,null:()=>up,nullable:()=>Pr,nullish:()=>yh,number:()=>op,object:()=>oh,optional:()=>Rr,overwrite:()=>We,parse:()=>Ju,parseAsync:()=>Gu,partialRecord:()=>uh,pipe:()=>Nr,positive:()=>co,prefault:()=>Op,preprocess:()=>Nh,prettifyError:()=>pa,promise:()=>$h,property:()=>mo,readonly:()=>Fp,record:()=>$p,refine:()=>Gp,regex:()=>_n,regexes:()=>je,registry:()=>Fi,safeDecode:()=>tp,safeDecodeAsync:()=>rp,safeEncode:()=>ep,safeEncodeAsync:()=>np,safeParse:()=>Vu,safeParseAsync:()=>qu,set:()=>mh,setErrorMap:()=>n$,size:()=>Bt,slugify:()=>Pn,startsWith:()=>Sn,strictObject:()=>sh,string:()=>ko,stringFormat:()=>Zf,stringbool:()=>Rh,success:()=>vh,superRefine:()=>Vp,symbol:()=>Qf,templateLiteral:()=>xh,toJSONSchema:()=>yo,toLowerCase:()=>Tn,toUpperCase:()=>Rn,transform:()=>Go,treeifyError:()=>ua,trim:()=>In,tuple:()=>xp,uint32:()=>qf,uint64:()=>Xf,ulid:()=>Pf,undefined:()=>eh,union:()=>Bo,unknown:()=>Vt,uppercase:()=>xn,url:()=>kf,util:()=>z,uuid:()=>bf,uuidv4:()=>xf,uuidv6:()=>$f,uuidv7:()=>Sf,void:()=>nh,xid:()=>Nf,xor:()=>ch});var mt={};Ae(mt,{$ZodAny:()=>Mc,$ZodArray:()=>Hc,$ZodAsyncError:()=>Ze,$ZodBase64:()=>Rc,$ZodBase64URL:()=>Pc,$ZodBigInt:()=>Oi,$ZodBigIntFormat:()=>Lc,$ZodBoolean:()=>br,$ZodCIDRv4:()=>wc,$ZodCIDRv6:()=>Ic,$ZodCUID:()=>fc,$ZodCUID2:()=>hc,$ZodCatch:()=>cl,$ZodCheck:()=>le,$ZodCheckBigIntFormat:()=>Ha,$ZodCheckEndsWith:()=>nc,$ZodCheckGreaterThan:()=>Ii,$ZodCheckIncludes:()=>ec,$ZodCheckLengthEquals:()=>Ka,$ZodCheckLessThan:()=>wi,$ZodCheckLowerCase:()=>Xa,$ZodCheckMaxLength:()=>Va,$ZodCheckMaxSize:()=>Ba,$ZodCheckMimeType:()=>ic,$ZodCheckMinLength:()=>qa,$ZodCheckMinSize:()=>Ja,$ZodCheckMultipleOf:()=>Za,$ZodCheckNumberFormat:()=>Wa,$ZodCheckOverwrite:()=>oc,$ZodCheckProperty:()=>rc,$ZodCheckRegex:()=>Ya,$ZodCheckSizeEquals:()=>Ga,$ZodCheckStartsWith:()=>tc,$ZodCheckStringFormat:()=>yn,$ZodCheckUpperCase:()=>Qa,$ZodCodec:()=>$r,$ZodCustom:()=>gl,$ZodCustomStringFormat:()=>Dc,$ZodDate:()=>Wc,$ZodDefault:()=>il,$ZodDiscriminatedUnion:()=>Gc,$ZodE164:()=>Nc,$ZodEmail:()=>uc,$ZodEmoji:()=>dc,$ZodEncodeError:()=>xt,$ZodEnum:()=>Xc,$ZodError:()=>fr,$ZodExactOptional:()=>nl,$ZodFile:()=>el,$ZodFunction:()=>ml,$ZodGUID:()=>cc,$ZodIPv4:()=>Sc,$ZodIPv6:()=>kc,$ZodISODate:()=>bc,$ZodISODateTime:()=>_c,$ZodISODuration:()=>$c,$ZodISOTime:()=>xc,$ZodIntersection:()=>Vc,$ZodJWT:()=>zc,$ZodKSUID:()=>vc,$ZodLazy:()=>hl,$ZodLiteral:()=>Qc,$ZodMAC:()=>Ec,$ZodMap:()=>Kc,$ZodNaN:()=>ll,$ZodNanoID:()=>mc,$ZodNever:()=>Fc,$ZodNonOptional:()=>sl,$ZodNull:()=>jc,$ZodNullable:()=>rl,$ZodNumber:()=>Di,$ZodNumberFormat:()=>Oc,$ZodObject:()=>gm,$ZodObjectJIT:()=>Bc,$ZodOptional:()=>Ai,$ZodPipe:()=>ul,$ZodPrefault:()=>ol,$ZodPromise:()=>fl,$ZodReadonly:()=>pl,$ZodRealError:()=>Ie,$ZodRecord:()=>qc,$ZodRegistry:()=>Ui,$ZodSet:()=>Yc,$ZodString:()=>Ht,$ZodStringFormat:()=>se,$ZodSuccess:()=>al,$ZodSymbol:()=>Ac,$ZodTemplateLiteral:()=>dl,$ZodTransform:()=>tl,$ZodTuple:()=>Li,$ZodType:()=>Y,$ZodULID:()=>gc,$ZodURL:()=>pc,$ZodUUID:()=>lc,$ZodUndefined:()=>Cc,$ZodUnion:()=>xr,$ZodUnknown:()=>Uc,$ZodVoid:()=>Zc,$ZodXID:()=>yc,$ZodXor:()=>Jc,$brand:()=>pi,$constructor:()=>$,$input:()=>vl,$output:()=>yl,Doc:()=>_r,JSONSchema:()=>gf,JSONSchemaGenerator:()=>vo,NEVER:()=>Qs,TimePrecision:()=>$l,_any:()=>Wl,_array:()=>Kl,_base64:()=>io,_base64url:()=>oo,_bigint:()=>Al,_boolean:()=>Ol,_catch:()=>Bx,_check:()=>hf,_cidrv4:()=>no,_cidrv6:()=>ro,_coercedBigint:()=>Cl,_coercedBoolean:()=>Ll,_coercedDate:()=>Vl,_coercedNumber:()=>Tl,_coercedString:()=>bl,_cuid:()=>qi,_cuid2:()=>Ki,_custom:()=>Xl,_date:()=>Gl,_decode:()=>yi,_decodeAsync:()=>_i,_default:()=>Zx,_discriminatedUnion:()=>Px,_e164:()=>so,_email:()=>Zi,_emoji:()=>Gi,_encode:()=>gi,_encodeAsync:()=>vi,_endsWith:()=>kn,_enum:()=>Ax,_file:()=>Yl,_float32:()=>Pl,_float64:()=>Nl,_gt:()=>et,_gte:()=>Se,_guid:()=>Er,_includes:()=>$n,_int:()=>Rl,_int32:()=>zl,_int64:()=>jl,_intersection:()=>Nx,_ipv4:()=>eo,_ipv6:()=>to,_isoDate:()=>kl,_isoDateTime:()=>Sl,_isoDuration:()=>wl,_isoTime:()=>El,_jwt:()=>ao,_ksuid:()=>Qi,_lazy:()=>qx,_length:()=>Gt,_literal:()=>jx,_lowercase:()=>bn,_lt:()=>Qe,_lte:()=>De,_mac:()=>xl,_map:()=>Ox,_max:()=>De,_maxLength:()=>Jt,_maxSize:()=>It,_mime:()=>En,_min:()=>Se,_minLength:()=>dt,_minSize:()=>tt,_multipleOf:()=>wt,_nan:()=>ql,_nanoid:()=>Vi,_nativeEnum:()=>Cx,_negative:()=>lo,_never:()=>Bl,_nonnegative:()=>po,_nonoptional:()=>Wx,_nonpositive:()=>uo,_normalize:()=>wn,_null:()=>Zl,_nullable:()=>Fx,_number:()=>Il,_optional:()=>Ux,_overwrite:()=>We,_parse:()=>mn,_parseAsync:()=>fn,_pipe:()=>Jx,_positive:()=>co,_promise:()=>Kx,_property:()=>mo,_readonly:()=>Gx,_record:()=>Dx,_refine:()=>Ql,_regex:()=>_n,_safeDecode:()=>xi,_safeDecodeAsync:()=>Si,_safeEncode:()=>bi,_safeEncodeAsync:()=>$i,_safeParse:()=>hn,_safeParseAsync:()=>gn,_set:()=>Lx,_size:()=>Bt,_slugify:()=>Pn,_startsWith:()=>Sn,_string:()=>_l,_stringFormat:()=>Nn,_stringbool:()=>ru,_success:()=>Hx,_superRefine:()=>eu,_symbol:()=>Ul,_templateLiteral:()=>Vx,_toLowerCase:()=>Tn,_toUpperCase:()=>Rn,_transform:()=>Mx,_trim:()=>In,_tuple:()=>zx,_uint32:()=>Dl,_uint64:()=>Ml,_ulid:()=>Yi,_undefined:()=>Fl,_union:()=>Tx,_unknown:()=>Hl,_uppercase:()=>xn,_url:()=>wr,_uuid:()=>Wi,_uuidv4:()=>Hi,_uuidv6:()=>Bi,_uuidv7:()=>Ji,_void:()=>Jl,_xid:()=>Xi,_xor:()=>Rx,clone:()=>$e,config:()=>me,createStandardJSONSchemaMethod:()=>zn,createToJSONSchemaMethod:()=>iu,decode:()=>Q_,decodeAsync:()=>tb,describe:()=>tu,encode:()=>X_,encodeAsync:()=>eb,extractDefs:()=>Rt,finalize:()=>Pt,flattenError:()=>hr,formatError:()=>gr,globalConfig:()=>ar,globalRegistry:()=>be,initializeContext:()=>Tt,isValidBase64:()=>Tc,isValidBase64URL:()=>dm,isValidJWT:()=>mm,locales:()=>kr,meta:()=>nu,parse:()=>fi,parseAsync:()=>hi,prettifyError:()=>pa,process:()=>ie,regexes:()=>je,registry:()=>Fi,safeDecode:()=>rb,safeDecodeAsync:()=>ob,safeEncode:()=>nb,safeEncodeAsync:()=>ib,safeParse:()=>da,safeParseAsync:()=>ma,toDotPath:()=>Vd,toJSONSchema:()=>yo,treeifyError:()=>ua,util:()=>z,version:()=>sc});var Qs=Object.freeze({status:"aborted"});function $(n,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(n))return;a._zod.traits.add(n),e(a,c);let l=s.prototype,u=Object.keys(l);for(let p=0;p<u.length;p++){let d=u[p];d in a||(a[d]=l[d].bind(a))}}let t=r?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:n});function s(a){var c;let l=r?.Parent?new o:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(n)}),Object.defineProperty(s,"name",{value:n}),s}var pi=Symbol("zod_brand"),Ze=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},ar={};function me(n){return n&&Object.assign(ar,n),ar}var z={};Ae(z,{BIGINT_FORMAT_RANGES:()=>la,Class:()=>ta,NUMBER_FORMAT_RANGES:()=>ca,aborted:()=>Et,allowsEval:()=>ia,assert:()=>P_,assertEqual:()=>w_,assertIs:()=>T_,assertNever:()=>R_,assertNotEqual:()=>I_,assignProp:()=>St,base64ToUint8Array:()=>Bd,base64urlToUint8Array:()=>G_,cached:()=>pn,captureStackTrace:()=>mi,cleanEnum:()=>J_,cleanRegex:()=>ur,clone:()=>$e,cloneDef:()=>z_,createTransparentProxy:()=>j_,defineLazy:()=>Q,esc:()=>di,escapeRegex:()=>Ce,extend:()=>F_,finalizeIssue:()=>we,floatSafeRemainder:()=>na,getElementAtPath:()=>D_,getEnumValues:()=>lr,getLengthableOrigin:()=>mr,getParsedType:()=>C_,getSizableOrigin:()=>dr,hexToUint8Array:()=>q_,isObject:()=>Zt,isPlainObject:()=>kt,issue:()=>dn,joinValues:()=>E,jsonStringifyReplacer:()=>un,merge:()=>W_,mergeDefs:()=>pt,normalizeParams:()=>D,nullish:()=>$t,numKeys:()=>A_,objectClone:()=>N_,omit:()=>U_,optionalKeys:()=>aa,parsedType:()=>N,partial:()=>H_,pick:()=>M_,prefixIssues:()=>ze,primitiveTypes:()=>sa,promiseAllObject:()=>O_,propertyKeyTypes:()=>pr,randomString:()=>L_,required:()=>B_,safeExtend:()=>Z_,shallowClone:()=>oa,slugify:()=>ra,stringifyPrimitive:()=>P,uint8ArrayToBase64:()=>Jd,uint8ArrayToBase64url:()=>V_,uint8ArrayToHex:()=>K_,unwrapMessage:()=>cr});function w_(n){return n}function I_(n){return n}function T_(n){}function R_(n){throw new Error("Unexpected value in exhaustive check")}function P_(n){}function lr(n){let e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,t])=>e.indexOf(+i)===-1).map(([i,t])=>t)}function E(n,e="|"){return n.map(r=>P(r)).join(e)}function un(n,e){return typeof e=="bigint"?e.toString():e}function pn(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function $t(n){return n==null}function ur(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function na(n,e){let r=(n.toString().split(".")[1]||"").length,i=e.toString(),t=(i.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(i)){let c=i.match(/\d?e-(\d?)/);c?.[1]&&(t=Number.parseInt(c[1]))}let o=r>t?r:t,s=Number.parseInt(n.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var Hd=Symbol("evaluating");function Q(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==Hd)return i===void 0&&(i=Hd,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function N_(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function St(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function pt(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function z_(n){return pt(n._zod.def)}function D_(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function O_(n){let e=Object.keys(n),r=e.map(i=>n[i]);return Promise.all(r).then(i=>{let t={};for(let o=0;o<e.length;o++)t[e[o]]=i[o];return t})}function L_(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function di(n){return JSON.stringify(n)}function ra(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mi="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Zt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var ia=pn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function kt(n){if(Zt(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Zt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function oa(n){return kt(n)?{...n}:Array.isArray(n)?[...n]:n}function A_(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var C_=n=>{let e=typeof n;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(n)?"array":n===null?"null":n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?"promise":typeof Map<"u"&&n instanceof Map?"map":typeof Set<"u"&&n instanceof Set?"set":typeof Date<"u"&&n instanceof Date?"date":typeof File<"u"&&n instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},pr=new Set(["string","number","symbol"]),sa=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ce(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function D(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function j_(n){let e;return new Proxy({},{get(r,i,t){return e??(e=n()),Reflect.get(e,i,t)},set(r,i,t,o){return e??(e=n()),Reflect.set(e,i,t,o)},has(r,i){return e??(e=n()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=n()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=n()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=n()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,t){return e??(e=n()),Reflect.defineProperty(e,i,t)}})}function P(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function aa(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var ca={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},la={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function M_(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=pt(n._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return St(this,"shape",s),s},checks:[]});return $e(n,o)}function U_(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=pt(n._zod.def,{get shape(){let s={...n._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return St(this,"shape",s),s},checks:[]});return $e(n,o)}function F_(n,e){if(!kt(e))throw new Error("Invalid input to extend: expected a plain object");let r=n._zod.def.checks;if(r&&r.length>0){let o=n._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=pt(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return St(this,"shape",o),o}});return $e(n,t)}function Z_(n,e){if(!kt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=pt(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return St(this,"shape",i),i}});return $e(n,r)}function W_(n,e){let r=pt(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return St(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return $e(n,r)}function H_(n,e,r){let t=e._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=pt(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=n?new n({type:"optional",innerType:a[l]}):a[l])}else for(let l in a)c[l]=n?new n({type:"optional",innerType:a[l]}):a[l];return St(this,"shape",c),c},checks:[]});return $e(e,s)}function B_(n,e,r){let i=pt(e._zod.def,{get shape(){let t=e._zod.def.shape,o={...t};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new n({type:"nonoptional",innerType:t[s]}))}else for(let s in t)o[s]=new n({type:"nonoptional",innerType:t[s]});return St(this,"shape",o),o}});return $e(e,i)}function Et(n,e=0){if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function ze(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function cr(n){return typeof n=="string"?n:n?.message}function we(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=cr(n.inst?._zod.def?.error?.(n))??cr(e?.error?.(n))??cr(r.customError?.(n))??cr(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function dr(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function mr(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function N(n){let e=typeof n;switch(e){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function dn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function J_(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Bd(n){let e=atob(n),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function Jd(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function G_(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Bd(e+r)}function V_(n){return Jd(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function q_(n){let e=n.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function K_(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var ta=class{constructor(...e){}};var Gd=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,un,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},fr=$("$ZodError",Gd),Ie=$("$ZodError",Gd,{Parent:Error});function hr(n,e=r=>r.message){let r={},i=[];for(let t of n.issues)t.path.length>0?(r[t.path[0]]=r[t.path[0]]||[],r[t.path[0]].push(e(t))):i.push(e(t));return{formErrors:i,fieldErrors:r}}function gr(n,e=r=>r.message){let r={_errors:[]},i=t=>{for(let o of t.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return i(n),r}function ua(n,e=r=>r.message){let r={errors:[]},i=(t,o=[])=>{var s,a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,p=0;for(;p<l.length;){let d=l[p],m=p===l.length-1;typeof d=="string"?(u.properties??(u.properties={}),(s=u.properties)[d]??(s[d]={errors:[]}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),m&&u.errors.push(e(c)),p++}}};return i(n),r}function Vd(n){let e=[],r=n.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function pa(n){let e=[],r=[...n.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Vd(i.path)}`);return e.join(`
435
+ `)}var mn=n=>(e,r,i,t)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Ze;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>we(c,o,me())));throw mi(a,t?.callee),a}return s.value},fi=mn(Ie),fn=n=>async(e,r,i,t)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>we(c,o,me())));throw mi(a,t?.callee),a}return s.value},hi=fn(Ie),hn=n=>(e,r,i)=>{let t=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},t);if(o instanceof Promise)throw new Ze;return o.issues.length?{success:!1,error:new(n??fr)(o.issues.map(s=>we(s,t,me())))}:{success:!0,data:o.value}},da=hn(Ie),gn=n=>async(e,r,i)=>{let t=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(s=>we(s,t,me())))}:{success:!0,data:o.value}},ma=gn(Ie),gi=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mn(n)(e,r,t)},X_=gi(Ie),yi=n=>(e,r,i)=>mn(n)(e,r,i),Q_=yi(Ie),vi=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return fn(n)(e,r,t)},eb=vi(Ie),_i=n=>async(e,r,i)=>fn(n)(e,r,i),tb=_i(Ie),bi=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return hn(n)(e,r,t)},nb=bi(Ie),xi=n=>(e,r,i)=>hn(n)(e,r,i),rb=xi(Ie),$i=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return gn(n)(e,r,t)},ib=$i(Ie),Si=n=>async(e,r,i)=>gn(n)(e,r,i),ob=Si(Ie);var je={};Ae(je,{base64:()=>Ra,base64url:()=>ki,bigint:()=>La,boolean:()=>Ca,browserEmail:()=>mb,cidrv4:()=>Ia,cidrv6:()=>Ta,cuid:()=>fa,cuid2:()=>ha,date:()=>Na,datetime:()=>Da,domain:()=>gb,duration:()=>ba,e164:()=>Pa,email:()=>$a,emoji:()=>Sa,extendedDuration:()=>sb,guid:()=>xa,hex:()=>yb,hostname:()=>hb,html5Email:()=>ub,idnEmail:()=>db,integer:()=>Aa,ipv4:()=>ka,ipv6:()=>Ea,ksuid:()=>va,lowercase:()=>Ua,mac:()=>wa,md5_base64:()=>_b,md5_base64url:()=>bb,md5_hex:()=>vb,nanoid:()=>_a,null:()=>ja,number:()=>Ei,rfc5322Email:()=>pb,sha1_base64:()=>$b,sha1_base64url:()=>Sb,sha1_hex:()=>xb,sha256_base64:()=>Eb,sha256_base64url:()=>wb,sha256_hex:()=>kb,sha384_base64:()=>Tb,sha384_base64url:()=>Rb,sha384_hex:()=>Ib,sha512_base64:()=>Nb,sha512_base64url:()=>zb,sha512_hex:()=>Pb,string:()=>Oa,time:()=>za,ulid:()=>ga,undefined:()=>Ma,unicodeEmail:()=>qd,uppercase:()=>Fa,uuid:()=>Wt,uuid4:()=>ab,uuid6:()=>cb,uuid7:()=>lb,xid:()=>ya});var fa=/^[cC][^\s-]{8,}$/,ha=/^[0-9a-z]+$/,ga=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ya=/^[0-9a-vA-V]{20}$/,va=/^[A-Za-z0-9]{27}$/,_a=/^[a-zA-Z0-9_-]{21}$/,ba=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sb=/^[-+]?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)?)??$/,xa=/^([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})$/,Wt=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ab=Wt(4),cb=Wt(6),lb=Wt(7),$a=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ub=/^[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])?)*$/,pb=/^(([^<>()\[\]\\.,;:\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,}))$/,qd=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,db=qd,mb=/^[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])?)*$/,fb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Sa(){return new RegExp(fb,"u")}var ka=/^(?:(?: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])$/,Ea=/^(([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}|:))$/,wa=n=>{let e=Ce(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Ia=/^((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])$/,Ta=/^(([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])$/,Ra=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ki=/^[A-Za-z0-9_-]*$/,hb=/^(?=.{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])?)*\.?$/,gb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Pa=/^\+[1-9]\d{6,14}$/,Kd="(?:(?:\\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])))",Na=new RegExp(`^${Kd}$`);function Yd(n){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function za(n){return new RegExp(`^${Yd(n)}$`)}function Da(n){let e=Yd({precision:n.precision}),r=["Z"];n.local&&r.push(""),n.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${Kd}T(?:${i})$`)}var Oa=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},La=/^-?\d+n?$/,Aa=/^-?\d+$/,Ei=/^-?\d+(?:\.\d+)?$/,Ca=/^(?:true|false)$/i,ja=/^null$/i;var Ma=/^undefined$/i;var Ua=/^[^A-Z]*$/,Fa=/^[^a-z]*$/,yb=/^[0-9a-fA-F]*$/;function yr(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function vr(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var vb=/^[0-9a-fA-F]{32}$/,_b=yr(22,"=="),bb=vr(22),xb=/^[0-9a-fA-F]{40}$/,$b=yr(27,"="),Sb=vr(27),kb=/^[0-9a-fA-F]{64}$/,Eb=yr(43,"="),wb=vr(43),Ib=/^[0-9a-fA-F]{96}$/,Tb=yr(64,""),Rb=vr(64),Pb=/^[0-9a-fA-F]{128}$/,Nb=yr(86,"=="),zb=vr(86);var le=$("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),Qd={number:"number",bigint:"bigint",object:"date"},wi=$("$ZodCheckLessThan",(n,e)=>{le.init(n,e);let r=Qd[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?t.maximum=e.value:t.exclusiveMaximum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Ii=$("$ZodCheckGreaterThan",(n,e)=>{le.init(n,e);let r=Qd[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?t.minimum=e.value:t.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Za=$("$ZodCheckMultipleOf",(n,e)=>{le.init(n,e),n._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):na(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:n,continue:!e.abort})}}),Wa=$("$ZodCheckNumberFormat",(n,e)=>{le.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=ca[e.format];n._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=t,a.maximum=o,r&&(a.pattern=Aa)}),n._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:n});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}a<t&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:t,inclusive:!0,inst:n,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),Ha=$("$ZodCheckBigIntFormat",(n,e)=>{le.init(n,e);let[r,i]=la[e.format];n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),n._zod.check=t=>{let o=t.value;o<r&&t.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:n,continue:!e.abort}),o>i&&t.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:n,continue:!e.abort})}}),Ba=$("$ZodCheckMaxSize",(n,e)=>{var r;le.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!$t(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;t.size<=e.maximum||i.issues.push({origin:dr(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Ja=$("$ZodCheckMinSize",(n,e)=>{var r;le.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!$t(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;t.size>=e.minimum||i.issues.push({origin:dr(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Ga=$("$ZodCheckSizeEquals",(n,e)=>{var r;le.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!$t(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.size,t.maximum=e.size,t.size=e.size}),n._zod.check=i=>{let t=i.value,o=t.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:dr(t),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),Va=$("$ZodCheckMaxLength",(n,e)=>{var r;le.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!$t(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;if(t.length<=e.maximum)return;let s=mr(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),qa=$("$ZodCheckMinLength",(n,e)=>{var r;le.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!$t(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;if(t.length>=e.minimum)return;let s=mr(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Ka=$("$ZodCheckLengthEquals",(n,e)=>{var r;le.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!$t(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.length,t.maximum=e.length,t.length=e.length}),n._zod.check=i=>{let t=i.value,o=t.length;if(o===e.length)return;let s=mr(t),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),yn=$("$ZodCheckStringFormat",(n,e)=>{var r,i;le.init(n,e),n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=n._zod).check??(r.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:e.format,input:t.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),Ya=$("$ZodCheckRegex",(n,e)=>{yn.init(n,e),n._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),Xa=$("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=Ua),yn.init(n,e)}),Qa=$("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=Fa),yn.init(n,e)}),ec=$("$ZodCheckIncludes",(n,e)=>{le.init(n,e);let r=Ce(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,n._zod.onattach.push(t=>{let o=t._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=t=>{t.value.includes(e.includes,e.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:t.value,inst:n,continue:!e.abort})}}),tc=$("$ZodCheckStartsWith",(n,e)=>{le.init(n,e);let r=new RegExp(`^${Ce(e.prefix)}.*`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),nc=$("$ZodCheckEndsWith",(n,e)=>{le.init(n,e);let r=new RegExp(`.*${Ce(e.suffix)}$`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}});function Xd(n,e,r){n.issues.length&&e.issues.push(...ze(r,n.issues))}var rc=$("$ZodCheckProperty",(n,e)=>{le.init(n,e),n._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>Xd(t,r,e.property));Xd(i,r,e.property)}}),ic=$("$ZodCheckMimeType",(n,e)=>{le.init(n,e);let r=new Set(e.mime);n._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),n._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:n,continue:!e.abort})}}),oc=$("$ZodCheckOverwrite",(n,e)=>{le.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var _r=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
426
436
  `).filter(s=>s),t=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(t)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,t=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,t.join(`
427
- `))}};var qa={major:4,minor:3,patch:5};var q=b("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=qa;let i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(let t of i)for(let o of t._zod.onattach)o(n);if(i.length===0)(r=n._zod).deferred??(r.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let t=(s,a,c)=>{let l=St(s),u;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let d=s.issues.length,m=p._zod.check(s);if(m instanceof Promise&&c?.async===!1)throw new Fe;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(l||(l=St(s,d)))});else{if(s.issues.length===d)continue;l||(l=St(s,d))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(St(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new Fe;return l.then(u=>n._zod.parse(u,c))}return n._zod.parse(l,c)};n._zod.run=(s,a)=>{if(a.skipChecks)return n._zod.parse(s,a);if(a.direction==="backward"){let l=n._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,s,a)):o(l,s,a)}let c=n._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Fe;return c.then(l=>t(l,i,a))}return t(c,i,a)}}X(n,"~standard",()=>({validate:t=>{try{let o=ta(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return na(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Ht=b("$ZodString",(n,e)=>{q.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??Sa(n._zod.bag),n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),re=b("$ZodStringFormat",(n,e)=>{pn.init(n,e),Ht.init(n,e)}),Ya=b("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=ua),re.init(n,e)}),Xa=b("$ZodUUID",(n,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Zt(i))}else e.pattern??(e.pattern=Zt());re.init(n,e)}),Qa=b("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=pa),re.init(n,e)}),ec=b("$ZodURL",(n,e)=>{re.init(n,e),n._zod.check=r=>{try{let i=r.value.trim(),t=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(t.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:n,continue:!e.abort})),e.normalize?r.value=t.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!e.abort})}}}),tc=b("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=da()),re.init(n,e)}),nc=b("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=ca),re.init(n,e)}),rc=b("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=ra),re.init(n,e)}),ic=b("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=ia),re.init(n,e)}),oc=b("$ZodULID",(n,e)=>{e.pattern??(e.pattern=oa),re.init(n,e)}),sc=b("$ZodXID",(n,e)=>{e.pattern??(e.pattern=sa),re.init(n,e)}),ac=b("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=aa),re.init(n,e)}),cc=b("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=$a(e)),re.init(n,e)}),lc=b("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=ba),re.init(n,e)}),uc=b("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=xa(e)),re.init(n,e)}),pc=b("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=la),re.init(n,e)}),dc=b("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=ma),re.init(n,e),n._zod.bag.format="ipv4"}),mc=b("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=fa),re.init(n,e),n._zod.bag.format="ipv6",n._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!e.abort})}}}),fc=b("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=ha(e.delimiter)),re.init(n,e),n._zod.bag.format="mac"}),hc=b("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=ga),re.init(n,e)}),gc=b("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=ya),re.init(n,e),n._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[t,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!e.abort})}}});function yc(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var vc=b("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=va),re.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{yc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function im(n){if(!hi.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return yc(r)}var _c=b("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=hi),re.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{im(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),bc=b("$ZodE164",(n,e)=>{e.pattern??(e.pattern=_a),re.init(n,e)});function om(n,e=null){try{let r=n.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||e&&(!("alg"in t)||t.alg!==e))}catch{return!1}}var xc=b("$ZodJWT",(n,e)=>{re.init(n,e),n._zod.check=r=>{om(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),$c=b("$ZodCustomStringFormat",(n,e)=>{re.init(n,e),n._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:n,continue:!e.abort})}}),ki=b("$ZodNumber",(n,e)=>{q.init(n,e),n._zod.pattern=n._zod.bag.pattern??gi,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let t=r.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return r;let o=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:t,inst:n,...o?{received:o}:{}}),r}}),Sc=b("$ZodNumberFormat",(n,e)=>{za.init(n,e),ki.init(n,e)}),fr=b("$ZodBoolean",(n,e)=>{q.init(n,e),n._zod.pattern=wa,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch{}let t=r.value;return typeof t=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:n}),r}}),Ei=b("$ZodBigInt",(n,e)=>{q.init(n,e),n._zod.pattern=ka,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:n}),r}}),kc=b("$ZodBigIntFormat",(n,e)=>{Da.init(n,e),Ei.init(n,e)}),Ec=b("$ZodSymbol",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:n}),r}}),wc=b("$ZodUndefined",(n,e)=>{q.init(n,e),n._zod.pattern=Ta,n._zod.values=new Set([void 0]),n._zod.optin="optional",n._zod.optout="optional",n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:n}),r}}),Ic=b("$ZodNull",(n,e)=>{q.init(n,e),n._zod.pattern=Ia,n._zod.values=new Set([null]),n._zod.parse=(r,i)=>{let t=r.value;return t===null||r.issues.push({expected:"null",code:"invalid_type",input:t,inst:n}),r}}),Tc=b("$ZodAny",(n,e)=>{q.init(n,e),n._zod.parse=r=>r}),Rc=b("$ZodUnknown",(n,e)=>{q.init(n,e),n._zod.parse=r=>r}),Pc=b("$ZodNever",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),Nc=b("$ZodVoid",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"void",code:"invalid_type",input:t,inst:n}),r}}),zc=b("$ZodDate",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let t=r.value,o=t instanceof Date;return o&&!Number.isNaN(t.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:t,...o?{received:"Invalid Date"}:{},inst:n}),r}});function Vd(n,e,r){n.issues.length&&e.issues.push(...ze(r,n.issues)),e.value[r]=n.value}var Dc=b("$ZodArray",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!Array.isArray(t))return r.issues.push({expected:"array",code:"invalid_type",input:t,inst:n}),r;r.value=Array(t.length);let o=[];for(let s=0;s<t.length;s++){let a=t[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(l=>Vd(l,r,s))):Vd(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Si(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...ze(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function sm(n){let e=Object.keys(n.shape);for(let i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Ks(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function am(n,e,r,i,t,o){let s=[],a=t.keySet,c=t.catchall._zod,l=c.def.type,u=c.optout==="optional";for(let p in e){if(a.has(p))continue;if(l==="never"){s.push(p);continue}let d=c.run({value:e[p],issues:[]},i);d instanceof Promise?n.push(d.then(m=>Si(m,r,p,e,u))):Si(d,r,p,e,u)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),n.length?Promise.all(n).then(()=>r):r}var cm=b("$ZodObject",(n,e)=>{if(q.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=on(()=>sm(e));X(n._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let p of u.values)c[l].add(p)}}return c});let t=Ft,o=e.catchall,s;n._zod.parse=(a,c)=>{s??(s=i.value);let l=a.value;if(!t(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:n}),a;a.value={};let u=[],p=s.shape;for(let d of s.keys){let m=p[d],f=m._zod.optout==="optional",h=m._zod.run({value:l[d],issues:[]},c);h instanceof Promise?u.push(h.then(_=>Si(_,a,d,l,f))):Si(h,a,d,l,f)}return o?am(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),Oc=b("$ZodObjectJIT",(n,e)=>{cm.init(n,e);let r=n._zod.parse,i=on(()=>sm(e)),t=d=>{let m=new mr(["shape","payload","ctx"]),f=i.value,h=x=>{let I=ri(x);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};m.write("const input = payload.value;");let _=Object.create(null),v=0;for(let x of f.keys)_[x]=`key_${v++}`;m.write("const newResult = {};");for(let x of f.keys){let I=_[x],E=ri(x),T=d[x]?._zod?.optout==="optional";m.write(`const ${I} = ${h(x)};`),T?m.write(`
428
- if (${I}.issues.length) {
429
- if (${E} in input) {
430
- payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
437
+ `))}};var sc={major:4,minor:3,patch:5};var Y=$("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=sc;let i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(let t of i)for(let o of t._zod.onattach)o(n);if(i.length===0)(r=n._zod).deferred??(r.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let t=(s,a,c)=>{let l=Et(s),u;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let d=s.issues.length,m=p._zod.check(s);if(m instanceof Promise&&c?.async===!1)throw new Ze;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(l||(l=Et(s,d)))});else{if(s.issues.length===d)continue;l||(l=Et(s,d))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(Et(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new Ze;return l.then(u=>n._zod.parse(u,c))}return n._zod.parse(l,c)};n._zod.run=(s,a)=>{if(a.skipChecks)return n._zod.parse(s,a);if(a.direction==="backward"){let l=n._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,s,a)):o(l,s,a)}let c=n._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Ze;return c.then(l=>t(l,i,a))}return t(c,i,a)}}Q(n,"~standard",()=>({validate:t=>{try{let o=da(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return ma(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Ht=$("$ZodString",(n,e)=>{Y.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??Oa(n._zod.bag),n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),se=$("$ZodStringFormat",(n,e)=>{yn.init(n,e),Ht.init(n,e)}),cc=$("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=xa),se.init(n,e)}),lc=$("$ZodUUID",(n,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Wt(i))}else e.pattern??(e.pattern=Wt());se.init(n,e)}),uc=$("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=$a),se.init(n,e)}),pc=$("$ZodURL",(n,e)=>{se.init(n,e),n._zod.check=r=>{try{let i=r.value.trim(),t=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(t.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:n,continue:!e.abort})),e.normalize?r.value=t.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!e.abort})}}}),dc=$("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=Sa()),se.init(n,e)}),mc=$("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=_a),se.init(n,e)}),fc=$("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=fa),se.init(n,e)}),hc=$("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=ha),se.init(n,e)}),gc=$("$ZodULID",(n,e)=>{e.pattern??(e.pattern=ga),se.init(n,e)}),yc=$("$ZodXID",(n,e)=>{e.pattern??(e.pattern=ya),se.init(n,e)}),vc=$("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=va),se.init(n,e)}),_c=$("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=Da(e)),se.init(n,e)}),bc=$("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=Na),se.init(n,e)}),xc=$("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=za(e)),se.init(n,e)}),$c=$("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=ba),se.init(n,e)}),Sc=$("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=ka),se.init(n,e),n._zod.bag.format="ipv4"}),kc=$("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=Ea),se.init(n,e),n._zod.bag.format="ipv6",n._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!e.abort})}}}),Ec=$("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=wa(e.delimiter)),se.init(n,e),n._zod.bag.format="mac"}),wc=$("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=Ia),se.init(n,e)}),Ic=$("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Ta),se.init(n,e),n._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[t,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!e.abort})}}});function Tc(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Rc=$("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=Ra),se.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{Tc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function dm(n){if(!ki.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Tc(r)}var Pc=$("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=ki),se.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{dm(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),Nc=$("$ZodE164",(n,e)=>{e.pattern??(e.pattern=Pa),se.init(n,e)});function mm(n,e=null){try{let r=n.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||e&&(!("alg"in t)||t.alg!==e))}catch{return!1}}var zc=$("$ZodJWT",(n,e)=>{se.init(n,e),n._zod.check=r=>{mm(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),Dc=$("$ZodCustomStringFormat",(n,e)=>{se.init(n,e),n._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:n,continue:!e.abort})}}),Di=$("$ZodNumber",(n,e)=>{Y.init(n,e),n._zod.pattern=n._zod.bag.pattern??Ei,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let t=r.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return r;let o=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:t,inst:n,...o?{received:o}:{}}),r}}),Oc=$("$ZodNumberFormat",(n,e)=>{Wa.init(n,e),Di.init(n,e)}),br=$("$ZodBoolean",(n,e)=>{Y.init(n,e),n._zod.pattern=Ca,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch{}let t=r.value;return typeof t=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:n}),r}}),Oi=$("$ZodBigInt",(n,e)=>{Y.init(n,e),n._zod.pattern=La,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:n}),r}}),Lc=$("$ZodBigIntFormat",(n,e)=>{Ha.init(n,e),Oi.init(n,e)}),Ac=$("$ZodSymbol",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:n}),r}}),Cc=$("$ZodUndefined",(n,e)=>{Y.init(n,e),n._zod.pattern=Ma,n._zod.values=new Set([void 0]),n._zod.optin="optional",n._zod.optout="optional",n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:n}),r}}),jc=$("$ZodNull",(n,e)=>{Y.init(n,e),n._zod.pattern=ja,n._zod.values=new Set([null]),n._zod.parse=(r,i)=>{let t=r.value;return t===null||r.issues.push({expected:"null",code:"invalid_type",input:t,inst:n}),r}}),Mc=$("$ZodAny",(n,e)=>{Y.init(n,e),n._zod.parse=r=>r}),Uc=$("$ZodUnknown",(n,e)=>{Y.init(n,e),n._zod.parse=r=>r}),Fc=$("$ZodNever",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),Zc=$("$ZodVoid",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"void",code:"invalid_type",input:t,inst:n}),r}}),Wc=$("$ZodDate",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let t=r.value,o=t instanceof Date;return o&&!Number.isNaN(t.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:t,...o?{received:"Invalid Date"}:{},inst:n}),r}});function tm(n,e,r){n.issues.length&&e.issues.push(...ze(r,n.issues)),e.value[r]=n.value}var Hc=$("$ZodArray",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!Array.isArray(t))return r.issues.push({expected:"array",code:"invalid_type",input:t,inst:n}),r;r.value=Array(t.length);let o=[];for(let s=0;s<t.length;s++){let a=t[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(l=>tm(l,r,s))):tm(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function zi(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...ze(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function fm(n){let e=Object.keys(n.shape);for(let i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=aa(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function hm(n,e,r,i,t,o){let s=[],a=t.keySet,c=t.catchall._zod,l=c.def.type,u=c.optout==="optional";for(let p in e){if(a.has(p))continue;if(l==="never"){s.push(p);continue}let d=c.run({value:e[p],issues:[]},i);d instanceof Promise?n.push(d.then(m=>zi(m,r,p,e,u))):zi(d,r,p,e,u)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),n.length?Promise.all(n).then(()=>r):r}var gm=$("$ZodObject",(n,e)=>{if(Y.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=pn(()=>fm(e));Q(n._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let p of u.values)c[l].add(p)}}return c});let t=Zt,o=e.catchall,s;n._zod.parse=(a,c)=>{s??(s=i.value);let l=a.value;if(!t(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:n}),a;a.value={};let u=[],p=s.shape;for(let d of s.keys){let m=p[d],f=m._zod.optout==="optional",h=m._zod.run({value:l[d],issues:[]},c);h instanceof Promise?u.push(h.then(_=>zi(_,a,d,l,f))):zi(h,a,d,l,f)}return o?hm(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),Bc=$("$ZodObjectJIT",(n,e)=>{gm.init(n,e);let r=n._zod.parse,i=pn(()=>fm(e)),t=d=>{let m=new _r(["shape","payload","ctx"]),f=i.value,h=b=>{let S=di(b);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");let _=Object.create(null),v=0;for(let b of f.keys)_[b]=`key_${v++}`;m.write("const newResult = {};");for(let b of f.keys){let S=_[b],k=di(b),R=d[b]?._zod?.optout==="optional";m.write(`const ${S} = ${h(b)};`),R?m.write(`
438
+ if (${S}.issues.length) {
439
+ if (${k} in input) {
440
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
431
441
  ...iss,
432
- path: iss.path ? [${E}, ...iss.path] : [${E}]
442
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
433
443
  })));
434
444
  }
435
445
  }
436
446
 
437
- if (${I}.value === undefined) {
438
- if (${E} in input) {
439
- newResult[${E}] = undefined;
447
+ if (${S}.value === undefined) {
448
+ if (${k} in input) {
449
+ newResult[${k}] = undefined;
440
450
  }
441
451
  } else {
442
- newResult[${E}] = ${I}.value;
452
+ newResult[${k}] = ${S}.value;
443
453
  }
444
454
 
445
455
  `):m.write(`
446
- if (${I}.issues.length) {
447
- payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
456
+ if (${S}.issues.length) {
457
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
448
458
  ...iss,
449
- path: iss.path ? [${E}, ...iss.path] : [${E}]
459
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
450
460
  })));
451
461
  }
452
462
 
453
- if (${I}.value === undefined) {
454
- if (${E} in input) {
455
- newResult[${E}] = undefined;
463
+ if (${S}.value === undefined) {
464
+ if (${k} in input) {
465
+ newResult[${k}] = undefined;
456
466
  }
457
467
  } else {
458
- newResult[${E}] = ${I}.value;
468
+ newResult[${k}] = ${S}.value;
459
469
  }
460
470
 
461
- `)}m.write("payload.value = newResult;"),m.write("return payload;");let g=m.compile();return(x,I)=>g(d,x,I)},o,s=Ft,a=!tr.jitless,l=a&&Vs.value,u=e.catchall,p;n._zod.parse=(d,m)=>{p??(p=i.value);let f=d.value;return s(f)?a&&l&&m?.async===!1&&m.jitless!==!0?(o||(o=t(e.shape)),d=o(d,m),u?am([],f,d,m,p,n):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:n}),d)}});function Gd(n,e,r,i){for(let o of n)if(o.issues.length===0)return e.value=o.value,e;let t=n.filter(o=>!St(o));return t.length===1?(e.value=t[0].value,t[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>we(s,i,pe())))}),e)}var hr=b("$ZodUnion",(n,e)=>{q.init(n,e),X(n._zod,"optin",()=>e.options.some(t=>t._zod.optin==="optional")?"optional":void 0),X(n._zod,"optout",()=>e.options.some(t=>t._zod.optout==="optional")?"optional":void 0),X(n._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),X(n._zod,"pattern",()=>{if(e.options.every(t=>t._zod.pattern)){let t=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${t.map(o=>ir(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(c=>Gd(c,t,n,o)):Gd(a,t,n,o)}});function qd(n,e,r,i){let t=n.filter(o=>o.issues.length===0);return t.length===1?(e.value=t[0].value,e):(t.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>we(s,i,pe())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Ac=b("$ZodXor",(n,e)=>{hr.init(n,e),e.inclusive=!1;let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);l instanceof Promise?(a.push(l),s=!0):a.push(l)}return s?Promise.all(a).then(c=>qd(c,t,n,o)):qd(a,t,n,o)}}),Lc=b("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,hr.init(n,e);let r=n._zod.parse;X(n._zod,"propValues",()=>{let t={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){t[a]||(t[a]=new Set);for(let l of c)t[a].add(l)}}return t});let i=on(()=>{let t=e.options,o=new Map;for(let s of t){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});n._zod.parse=(t,o)=>{let s=t.value;if(!Ft(s))return t.issues.push({code:"invalid_type",expected:"object",input:s,inst:n}),t;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(t,o):e.unionFallback?r(t,o):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:n}),t)}}),Cc=b("$ZodIntersection",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value,o=e.left._zod.run({value:t,issues:[]},i),s=e.right._zod.run({value:t,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>Kd(r,c,l)):Kd(r,o,s)}});function Ka(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if($t(n)&&$t(e)){let r=Object.keys(e),i=Object.keys(n).filter(o=>r.indexOf(o)!==-1),t={...n,...e};for(let o of i){let s=Ka(n[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};t[o]=s.data}return{valid:!0,data:t}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<n.length;i++){let t=n[i],o=e[i],s=Ka(t,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Kd(n,e,r){let i=new Map,t;for(let a of e.issues)if(a.code==="unrecognized_keys"){t??(t=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else n.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else n.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&t&&n.issues.push({...t,keys:o}),St(n))return n;let s=Ka(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return n.value=s.data,n}var wi=b("$ZodTuple",(n,e)=>{q.init(n,e);let r=e.items;n._zod.parse=(i,t)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:n,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=[...r].reverse().findIndex(u=>u._zod.optin!=="optional"),c=a===-1?0:r.length-a;if(!e.rest){let u=o.length>r.length,p=o.length<c-1;if(u||p)return i.issues.push({...u?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:n,origin:"array"}),i}let l=-1;for(let u of r){if(l++,l>=o.length&&l>=c)continue;let p=u._zod.run({value:o[l],issues:[]},t);p instanceof Promise?s.push(p.then(d=>_i(d,i,l))):_i(p,i,l)}if(e.rest){let u=o.slice(r.length);for(let p of u){l++;let d=e.rest._zod.run({value:p,issues:[]},t);d instanceof Promise?s.push(d.then(m=>_i(m,i,l))):_i(d,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function _i(n,e,r){n.issues.length&&e.issues.push(...ze(r,n.issues)),e.value[r]=n.value}var jc=b("$ZodRecord",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!$t(t))return r.issues.push({expected:"record",code:"invalid_type",input:t,inst:n}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.valueType._zod.run({value:t[l],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...ze(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...ze(l,u.issues)),r.value[l]=u.value)}let c;for(let l in t)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:t,inst:n,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&gi.test(a)&&c.issues.length&&c.issues.some(p=>p.code==="invalid_type"&&p.expected==="number")){let p=e.keyType._zod.run({value:Number(a),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){e.mode==="loose"?r.value[a]=t[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>we(p,i,pe())),input:a,path:[a],inst:n});continue}let u=e.valueType._zod.run({value:t[a],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...ze(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...ze(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Mc=b("$ZodMap",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:t,inst:n}),r;let o=[];r.value=new Map;for(let[s,a]of t){let c=e.keyType._zod.run({value:s,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,p])=>{Yd(u,p,r,s,t,n,i)})):Yd(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function Yd(n,e,r,i,t,o,s){n.issues.length&&(or.has(typeof i)?r.issues.push(...ze(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>we(a,s,pe()))})),e.issues.length&&(or.has(typeof i)?r.issues.push(...ze(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>we(a,s,pe()))})),r.value.set(n.value,e.value)}var Uc=b("$ZodSet",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Set))return r.issues.push({input:t,inst:n,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of t){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>Xd(c,r))):Xd(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function Xd(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var Fc=b("$ZodEnum",(n,e)=>{q.init(n,e);let r=rr(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>or.has(typeof t)).map(t=>typeof t=="string"?Le(t):t.toString()).join("|")})$`),n._zod.parse=(t,o)=>{let s=t.value;return i.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:n}),t}}),Zc=b("$ZodLiteral",(n,e)=>{if(q.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Le(i):i?Le(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,t)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),i}}),Hc=b("$ZodFile",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return t instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:t,inst:n}),r}}),Wc=b("$ZodTransform",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new _t(n.constructor.name);let t=e.transform(r.value,r);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(s=>(r.value=s,r));if(t instanceof Promise)throw new Fe;return r.value=t,r}});function Qd(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var Ii=b("$ZodOptional",(n,e)=>{q.init(n,e),n._zod.optin="optional",n._zod.optout="optional",X(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),X(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ir(r.source)})?$`):void 0}),n._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>Qd(o,r.value)):Qd(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),Bc=b("$ZodExactOptional",(n,e)=>{Ii.init(n,e),X(n._zod,"values",()=>e.innerType._zod.values),X(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),Jc=b("$ZodNullable",(n,e)=>{q.init(n,e),X(n._zod,"optin",()=>e.innerType._zod.optin),X(n._zod,"optout",()=>e.innerType._zod.optout),X(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ir(r.source)}|null)$`):void 0}),X(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),Vc=b("$ZodDefault",(n,e)=>{q.init(n,e),n._zod.optin="optional",X(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>em(o,e)):em(t,e)}});function em(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var Gc=b("$ZodPrefault",(n,e)=>{q.init(n,e),n._zod.optin="optional",X(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),qc=b("$ZodNonOptional",(n,e)=>{q.init(n,e),X(n._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),n._zod.parse=(r,i)=>{let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>tm(o,n)):tm(t,n)}});function tm(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}var Kc=b("$ZodSuccess",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new _t("ZodSuccess");let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.issues.length===0,r)):(r.value=t.issues.length===0,r)}}),Yc=b("$ZodCatch",(n,e)=>{q.init(n,e),X(n._zod,"optin",()=>e.innerType._zod.optin),X(n._zod,"optout",()=>e.innerType._zod.optout),X(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>we(s,i,pe()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=e.catchValue({...r,error:{issues:t.issues.map(o=>we(o,i,pe()))},input:r.value}),r.issues=[]),r)}}),Xc=b("$ZodNaN",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:n,expected:"nan",code:"invalid_type"}),r)}),Qc=b("$ZodPipe",(n,e)=>{q.init(n,e),X(n._zod,"values",()=>e.in._zod.values),X(n._zod,"optin",()=>e.in._zod.optin),X(n._zod,"optout",()=>e.out._zod.optout),X(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>bi(s,e.in,i)):bi(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>bi(o,e.out,i)):bi(t,e.out,i)}});function bi(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var gr=b("$ZodCodec",(n,e)=>{q.init(n,e),X(n._zod,"values",()=>e.in._zod.values),X(n._zod,"optin",()=>e.in._zod.optin),X(n._zod,"optout",()=>e.out._zod.optout),X(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>xi(s,e,i)):xi(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>xi(s,e,i)):xi(o,e,i)}}});function xi(n,e,r){if(n.issues.length)return n.aborted=!0,n;if((r.direction||"forward")==="forward"){let t=e.transform(n.value,n);return t instanceof Promise?t.then(o=>$i(n,o,e.out,r)):$i(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>$i(n,o,e.in,r)):$i(n,t,e.in,r)}}function $i(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var el=b("$ZodReadonly",(n,e)=>{q.init(n,e),X(n._zod,"propValues",()=>e.innerType._zod.propValues),X(n._zod,"values",()=>e.innerType._zod.values),X(n._zod,"optin",()=>e.innerType?._zod?.optin),X(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(nm):nm(t)}});function nm(n){return n.value=Object.freeze(n.value),n}var tl=b("$ZodTemplateLiteral",(n,e)=>{q.init(n,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let t=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(o,s))}else if(i===null||qs.has(typeof i))r.push(Le(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);n._zod.pattern=new RegExp(`^${r.join("")}$`),n._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:n,expected:"string",code:"invalid_type"}),i):(n._zod.pattern.lastIndex=0,n._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:n,code:"invalid_format",format:e.format??"template_literal",pattern:n._zod.pattern.source}),i)}),nl=b("$ZodFunction",(n,e)=>(q.init(n,e),n._def=e,n._zod.def=e,n.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let t=n._def.input?oi(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?oi(n._def.output,o):o}},n.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let t=n._def.input?await si(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await si(n._def.output,o):o}},n._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:n}),r):(n._def.output&&n._def.output._zod.def.type==="promise"?r.value=n.implementAsync(r.value):r.value=n.implement(r.value),r),n.input=(...r)=>{let i=n.constructor;return Array.isArray(r[0])?new i({type:"function",input:new wi({type:"tuple",items:r[0],rest:r[1]}),output:n._def.output}):new i({type:"function",input:r[0],output:n._def.output})},n.output=r=>{let i=n.constructor;return new i({type:"function",input:n._def.input,output:r})},n)),rl=b("$ZodPromise",(n,e)=>{q.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),il=b("$ZodLazy",(n,e)=>{q.init(n,e),X(n._zod,"innerType",()=>e.getter()),X(n._zod,"pattern",()=>n._zod.innerType?._zod?.pattern),X(n._zod,"propValues",()=>n._zod.innerType?._zod?.propValues),X(n._zod,"optin",()=>n._zod.innerType?._zod?.optin??void 0),X(n._zod,"optout",()=>n._zod.innerType?._zod?.optout??void 0),n._zod.parse=(r,i)=>n._zod.innerType._zod.run(r,i)}),ol=b("$ZodCustom",(n,e)=>{oe.init(n,e),q.init(n,e),n._zod.parse=(r,i)=>r,n._zod.check=r=>{let i=r.value,t=e.fn(i);if(t instanceof Promise)return t.then(o=>rm(o,r,i,n));rm(t,r,i,n)}});function rm(n,e,r,i){if(!n){let t={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),e.issues.push(sn(t))}}var vr={};Ue(vr,{ar:()=>lm,az:()=>um,be:()=>dm,bg:()=>mm,ca:()=>fm,cs:()=>hm,da:()=>gm,de:()=>ym,en:()=>Ti,eo:()=>vm,es:()=>_m,fa:()=>bm,fi:()=>xm,fr:()=>$m,frCA:()=>Sm,he:()=>km,hu:()=>Em,hy:()=>Im,id:()=>Tm,is:()=>Rm,it:()=>Pm,ja:()=>Nm,ka:()=>zm,kh:()=>Dm,km:()=>Ri,ko:()=>Om,lt:()=>Lm,mk:()=>Cm,ms:()=>jm,nl:()=>Mm,no:()=>Um,ota:()=>Fm,pl:()=>Hm,ps:()=>Zm,pt:()=>Wm,ru:()=>Jm,sl:()=>Vm,sv:()=>Gm,ta:()=>qm,th:()=>Km,tr:()=>Ym,ua:()=>Xm,uk:()=>Pi,ur:()=>Qm,uz:()=>ef,vi:()=>tf,yo:()=>of,zhCN:()=>nf,zhTW:()=>rf});var fb=()=>{let n={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(t){return n[t]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${t.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return t.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${R(t.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${t.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??t.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${t.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${t.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${t.keys.length>1?"\u0629":""}: ${S(t.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function lm(){return{localeError:fb()}}var hb=()=>{let n={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(t){return n[t]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${t.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return t.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${R(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??t.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${t.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${t.keys.length>1?"lar":""}: ${S(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${t.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function um(){return{localeError:hb()}}function pm(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var gb=()=>{let n={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(t){return n[t]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${t.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${R(t.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=pm(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=pm(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${t.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${S(t.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${t.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function dm(){return{localeError:gb()}}var yb=()=>{let n={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(t){return n[t]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${R(t.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${t.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u043E\u0432\u0435":""}: ${S(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${t.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function mm(){return{localeError:yb()}}var vb=()=>{let n={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(t){return n[t]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${t.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return t.values.length===1?`Valor inv\xE0lid: s'esperava ${R(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${S(t.values," o ")}`;case"too_big":{let o=t.inclusive?"com a m\xE0xim":"menys de",s=e(t.origin);return s?`Massa gran: s'esperava que ${t.origin??"el valor"} contingu\xE9s ${o} ${t.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(t.origin);return s?`Massa petit: s'esperava que ${t.origin} contingu\xE9s ${o} ${t.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${S(t.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${t.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${t.origin}`;default:return"Entrada inv\xE0lida"}}};function fm(){return{localeError:vb()}}var _b=()=>{let n={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(t){return n[t]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${t.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return t.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${R(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??t.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${t.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${S(t.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${t.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${t.origin}`;default:return"Neplatn\xFD vstup"}}};function hm(){return{localeError:_b()}}var bb=()=>{let n={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(t){return n[t]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldigt input: forventede instanceof ${t.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig v\xE6rdi: forventede ${R(t.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${t.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${S(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${t.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${t.origin}`;default:return"Ugyldigt input"}}};function gm(){return{localeError:bb()}}var xb=()=>{let n={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(t){return n[t]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${t.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return t.values.length===1?`Ung\xFCltige Eingabe: erwartet ${R(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ist`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ist`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??t.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${S(t.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${t.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${t.origin}`;default:return"Ung\xFCltige Eingabe"}}};function ym(){return{localeError:xb()}}var $b=()=>{let n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(t){return n[t]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${R(t.values[0])}`:`Invalid option: expected one of ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Too big: expected ${t.origin??"value"} to have ${o}${t.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${t.origin??"value"} to be ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Too small: expected ${t.origin} to have ${o}${t.minimum.toString()} ${s.unit}`:`Too small: expected ${t.origin} to be ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${t.divisor}`;case"unrecognized_keys":return`Unrecognized key${t.keys.length>1?"s":""}: ${S(t.keys,", ")}`;case"invalid_key":return`Invalid key in ${t.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${t.origin}`;default:return"Invalid input"}}};function Ti(){return{localeError:$b()}}var Sb=()=>{let n={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(t){return n[t]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${t.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return t.values.length===1?`Nevalida enigo: atendi\u011Dis ${R(t.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Tro malgranda: atendi\u011Dis ke ${t.origin} havu ${o}${t.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${t.origin} estu ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??t.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${t.divisor}`;case"unrecognized_keys":return`Nekonata${t.keys.length>1?"j":""} \u015Dlosilo${t.keys.length>1?"j":""}: ${S(t.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${t.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${t.origin}`;default:return"Nevalida enigo"}}};function vm(){return{localeError:Sb()}}var kb=()=>{let n={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(t){return n[t]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${t.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: se esperaba ${R(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${t.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${S(t.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[t.origin]??t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[t.origin]??t.origin}`;default:return"Entrada inv\xE1lida"}}};function _m(){return{localeError:kb()}}var Eb=()=>{let n={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(t){return n[t]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${t.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return t.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${R(t.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${S(t.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??t.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${t.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${t.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${S(t.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${t.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${t.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function bm(){return{localeError:Eb()}}var wb=()=>{let n={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(t){return n[t]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Virheellinen tyyppi: odotettiin instanceof ${t.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return t.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${R(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${t.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${t.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${S(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\xF6te"}}};function xm(){return{localeError:wb()}}var Ib=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN",number:"nombre",array:"tableau"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : instanceof ${t.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : ${R(t.values[0])} attendu`:`Option invalide : une valeur parmi ${S(t.values,"|")} attendue`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Trop grand : ${t.origin??"valeur"} doit ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${t.origin??"valeur"} doit \xEAtre ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Trop petit : ${t.origin} doit ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : ${t.origin} doit \xEAtre ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${S(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function $m(){return{localeError:Ib()}}var Tb=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : attendu instanceof ${t.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : attendu ${R(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u2264":"<",s=e(t.origin);return s?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${o}${t.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u2265":">",s=e(t.origin);return s?`Trop petit : attendu que ${t.origin} ait ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${t.origin} soit ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${S(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function Sm(){return{localeError:Tb()}}var Rb=()=>{let n={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?n[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??n.unknown.label},t=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,p=c[u??""]??i(u),d=P(l.input),m=c[d]??n[d]?.label??d;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${R(l.values[0])}`;let u=l.values.map(m=>R(m));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?"<=":"<",m=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let _=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?">=":">",m=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let p=a[u.format],d=p?.label??u.format,f=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${d} \u05DC\u05D0 ${f}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${S(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${t(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function km(){return{localeError:Rb()}}var Pb=()=>{let n={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(t){return n[t]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${t.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return t.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${R(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xFAl nagy: ${t.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${t.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${t.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} m\xE9rete t\xFAl kicsi ${o}${t.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} t\xFAl kicsi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??t.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${t.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${S(t.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${t.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${t.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Em(){return{localeError:Pb()}}function wm(n,e,r){return Math.abs(n)===1?e:r}function dn(n){if(!n)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=n[n.length-1];return n+(e.includes(r)?"\u0576":"\u0568")}var Nb=()=>{let n={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(t){return n[t]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${t.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return t.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${R(t.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=wm(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${dn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${dn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=wm(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${dn(t.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${dn(t.origin)} \u056C\u056B\u0576\u056B ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??t.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${t.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${t.keys.length>1?"\u0576\u0565\u0580":""}. ${S(t.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${dn(t.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${dn(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Im(){return{localeError:Nb()}}var zb=()=>{let n={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(t){return n[t]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak valid: diharapkan instanceof ${t.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${R(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: diharapkan ${t.origin} memiliki ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??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":""}: ${S(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 Tm(){return{localeError:zb()}}var Db=()=>{let n={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(t){return n[t]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${t.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return t.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${R(t.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} hafi ${o}${t.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} s\xE9 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} hafi ${o}${t.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} s\xE9 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??t.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${t.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${t.keys.length>1?"ir lyklar":"ur lykill"}: ${S(t.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${t.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${t.origin}`;default:return"Rangt gildi"}}};function Rm(){return{localeError:Db()}}var Ob=()=>{let n={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(t){return n[t]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input non valido: atteso instanceof ${t.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return t.values.length===1?`Input non valido: atteso ${R(t.values[0])}`:`Opzione non valida: atteso uno tra ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Troppo grande: ${t.origin??"valore"} deve avere ${o}${t.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Troppo piccolo: ${t.origin} deve avere ${o}${t.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${t.origin} deve essere ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??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"}: ${S(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 Pm(){return{localeError:Ob()}}var Ab=()=>{let n={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(t){return n[t]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${t.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return t.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${R(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${S(t.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=t.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(t.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=t.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(t.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${t.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${t.keys.length>1?"\u7FA4":""}: ${S(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Nm(){return{localeError:Ab()}}var Lb=()=>{let n={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(t){return n[t]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${t.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return t.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${R(t.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${S(t.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${t.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${t.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${S(t.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${t.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${t.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function zm(){return{localeError:Lb()}}var Cb=()=>{let n={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(t){return n[t]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${t.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return t.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${R(t.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${t.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${S(t.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Ri(){return{localeError:Cb()}}function Dm(){return Ri()}var jb=()=>{let n={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(t){return n[t]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${t.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return t.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${R(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${S(t.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=t.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()} ${o}${s}`}case"too_small":{let o=t.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??t.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${t.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${S(t.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${t.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${t.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Om(){return{localeError:jb()}}var yr=n=>n.charAt(0).toUpperCase()+n.slice(1);function Am(n){let e=Math.abs(n),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var Mb=()=>{let n={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(t,o,s,a){let c=n[t]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${t.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return t.values.length===1?`Privalo b\u016Bti ${R(t.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${S(t.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[t.origin]??t.origin,s=e(t.origin,Am(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${yr(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.maximum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${yr(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[t.origin]??t.origin,s=e(t.origin,Am(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${yr(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.minimum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${yr(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??t.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${t.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${t.keys.length>1?"i":"as"} rakt${t.keys.length>1?"ai":"as"}: ${S(t.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[t.origin]??t.origin;return`${yr(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Lm(){return{localeError:Mb()}}var Ub=()=>{let n={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(t){return n[t]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${t.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${R(t.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${S(t.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${t.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${t.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Cm(){return{localeError:Ub()}}var Fb=()=>{let n={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(t){return n[t]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak sah: dijangka instanceof ${t.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${R(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: dijangka ${t.origin??"nilai"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: dijangka ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${S(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 jm(){return{localeError:Fb()}}var Zb=()=>{let n={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(t){return n[t]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ongeldige invoer: verwacht instanceof ${t.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${R(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=t.origin==="date"?"laat":t.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} is`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=t.origin==="date"?"vroeg":t.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} is`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??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":""}: ${S(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 Mm(){return{localeError:Zb()}}var Hb=()=>{let n={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(t){return n[t]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventet instanceof ${t.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${R(t.values[0])}`:`Ugyldig valg: forventet en av ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${S(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function Um(){return{localeError:Hb()}}var Wb=()=>{let n={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(t){return n[t]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`F\xE2sit giren: umulan instanceof ${t.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`F\xE2sit giren: umulan ${R(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=t;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??t.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${t.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${t.keys.length>1?"s":""}: ${S(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${t.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Fm(){return{localeError:Wb()}}var Bb=()=>{let n={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(t){return n[t]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${t.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return t.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${R(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${S(t.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0648\u064A`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??t.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${t.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${t.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${S(t.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${t.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${t.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Zm(){return{localeError:Bb()}}var Jb=()=>{let n={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(t){return n[t]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${t.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return t.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${R(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??t.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${S(t.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${t.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${t.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Hm(){return{localeError:Jb()}}var Vb=()=>{let n={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(t){return n[t]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipo inv\xE1lido: esperado instanceof ${t.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: esperado ${R(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Muito grande: esperado que ${t.origin??"valor"} tivesse ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${t.origin??"valor"} fosse ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Muito pequeno: esperado que ${t.origin} tivesse ${o}${t.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${t.origin} fosse ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??t.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${S(t.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${t.origin}`;default:return"Campo inv\xE1lido"}}};function Wm(){return{localeError:Vb()}}function Bm(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var Gb=()=>{let n={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(t){return n[t]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${R(t.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Bm(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=Bm(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${t.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0438":""}: ${S(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${t.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Jm(){return{localeError:Gb()}}var qb=()=>{let n={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(t){return n[t]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${t.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return t.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${R(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} imelo ${o}${t.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${t.origin} imelo ${o}${t.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??t.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${S(t.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Vm(){return{localeError:qb()}}var Kb=()=>{let n={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(t){return n[t]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${t.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return t.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${R(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${S(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${t.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Gm(){return{localeError:Kb()}}var Yb=()=>{let n={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(t){return n[t]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${t.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return t.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${R(t.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${S(t.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${t.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${t.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${S(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function qm(){return{localeError:Yb()}}var Xb=()=>{let n={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(t){return n[t]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${t.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return t.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${R(t.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${t.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${S(t.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Km(){return{localeError:Xb()}}var Qb=()=>{let n={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(t){return n[t]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${t.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${R(t.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??t.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${t.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${t.keys.length>1?"lar":""}: ${S(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${t.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Ym(){return{localeError:Qb()}}var ex=()=>{let n={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(t){return n[t]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${t.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${R(t.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} \u0431\u0443\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0456":""}: ${S(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${t.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Pi(){return{localeError:ex()}}function Xm(){return Pi()}var tx=()=>{let n={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(t){return n[t]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${t.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return t.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${R(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${S(t.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${t.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u06D2 ${o}${t.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u0627 ${o}${t.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${t.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${t.keys.length>1?"\u0632":""}: ${S(t.keys,"\u060C ")}`;case"invalid_key":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Qm(){return{localeError:tx()}}var nx=()=>{let n={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function e(t){return n[t]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${t.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return t.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${R(t.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??t.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${t.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${t.keys.length>1?"lar":""}: ${S(t.keys,", ")}`;case"invalid_key":return`${t.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${t.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function ef(){return{localeError:nx()}}var rx=()=>{let n={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(t){return n[t]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${t.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return t.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${R(t.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??t.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${t.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${S(t.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function tf(){return{localeError:rx()}}var ix=()=>{let n={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(t){return n[t]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${t.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return t.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${R(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??t.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${t.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${S(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${t.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function nf(){return{localeError:ix()}}var ox=()=>{let n={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(t){return n[t]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${t.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return t.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${R(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${t.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${t.keys.length>1?"\u5011":""}\uFF1A${S(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function rf(){return{localeError:ox()}}var sx=()=>{let n={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(t){return n[t]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=P(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${t.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return t.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${R(t.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${S(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin??"iye"} ${s.verb} ${o}${t.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.maximum}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin} ${s.verb} ${o}${t.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.minimum}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??t.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${t.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${S(t.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${t.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${t.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function of(){return{localeError:sx()}}var sf,sl=Symbol("ZodOutput"),al=Symbol("ZodInput"),Ni=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let t={...i,...this._map.get(e)};return Object.keys(t).length?t:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function zi(){return new Ni}(sf=globalThis).__zod_globalRegistry??(sf.__zod_globalRegistry=zi());var be=globalThis.__zod_globalRegistry;function cl(n,e){return new n({type:"string",...z(e)})}function ll(n,e){return new n({type:"string",coerce:!0,...z(e)})}function Di(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...z(e)})}function _r(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...z(e)})}function Oi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...z(e)})}function Ai(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(e)})}function Li(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(e)})}function Ci(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(e)})}function br(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...z(e)})}function ji(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...z(e)})}function Mi(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(e)})}function Ui(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...z(e)})}function Fi(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(e)})}function Zi(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...z(e)})}function Hi(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...z(e)})}function Wi(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(e)})}function Bi(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(e)})}function Ji(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(e)})}function ul(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...z(e)})}function Vi(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(e)})}function Gi(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(e)})}function qi(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...z(e)})}function Ki(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...z(e)})}function Yi(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...z(e)})}function Xi(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...z(e)})}var pl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function dl(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(e)})}function ml(n,e){return new n({type:"string",format:"date",check:"string_format",...z(e)})}function fl(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...z(e)})}function hl(n,e){return new n({type:"string",format:"duration",check:"string_format",...z(e)})}function gl(n,e){return new n({type:"number",checks:[],...z(e)})}function yl(n,e){return new n({type:"number",coerce:!0,checks:[],...z(e)})}function vl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...z(e)})}function _l(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...z(e)})}function bl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...z(e)})}function xl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...z(e)})}function $l(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...z(e)})}function Sl(n,e){return new n({type:"boolean",...z(e)})}function kl(n,e){return new n({type:"boolean",coerce:!0,...z(e)})}function El(n,e){return new n({type:"bigint",...z(e)})}function wl(n,e){return new n({type:"bigint",coerce:!0,...z(e)})}function Il(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(e)})}function Tl(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(e)})}function Rl(n,e){return new n({type:"symbol",...z(e)})}function Pl(n,e){return new n({type:"undefined",...z(e)})}function Nl(n,e){return new n({type:"null",...z(e)})}function zl(n){return new n({type:"any"})}function Dl(n){return new n({type:"unknown"})}function Ol(n,e){return new n({type:"never",...z(e)})}function Al(n,e){return new n({type:"void",...z(e)})}function Ll(n,e){return new n({type:"date",...z(e)})}function Cl(n,e){return new n({type:"date",coerce:!0,...z(e)})}function jl(n,e){return new n({type:"nan",...z(e)})}function Ke(n,e){return new yi({check:"less_than",...z(e),value:n,inclusive:!1})}function De(n,e){return new yi({check:"less_than",...z(e),value:n,inclusive:!0})}function Ye(n,e){return new vi({check:"greater_than",...z(e),value:n,inclusive:!1})}function ke(n,e){return new vi({check:"greater_than",...z(e),value:n,inclusive:!0})}function Qi(n){return Ye(0,n)}function eo(n){return Ke(0,n)}function to(n){return De(0,n)}function no(n){return ke(0,n)}function kt(n,e){return new Na({check:"multiple_of",...z(e),value:n})}function Et(n,e){return new Oa({check:"max_size",...z(e),maximum:n})}function Xe(n,e){return new Aa({check:"min_size",...z(e),minimum:n})}function Wt(n,e){return new La({check:"size_equals",...z(e),size:n})}function Bt(n,e){return new Ca({check:"max_length",...z(e),maximum:n})}function pt(n,e){return new ja({check:"min_length",...z(e),minimum:n})}function Jt(n,e){return new Ma({check:"length_equals",...z(e),length:n})}function mn(n,e){return new Ua({check:"string_format",format:"regex",...z(e),pattern:n})}function fn(n){return new Fa({check:"string_format",format:"lowercase",...z(n)})}function hn(n){return new Za({check:"string_format",format:"uppercase",...z(n)})}function gn(n,e){return new Ha({check:"string_format",format:"includes",...z(e),includes:n})}function yn(n,e){return new Wa({check:"string_format",format:"starts_with",...z(e),prefix:n})}function vn(n,e){return new Ba({check:"string_format",format:"ends_with",...z(e),suffix:n})}function ro(n,e,r){return new Ja({check:"property",property:n,schema:e,...z(r)})}function _n(n,e){return new Va({check:"mime_type",mime:n,...z(e)})}function Ze(n){return new Ga({check:"overwrite",tx:n})}function bn(n){return Ze(e=>e.normalize(n))}function xn(){return Ze(n=>n.trim())}function $n(){return Ze(n=>n.toLowerCase())}function Sn(){return Ze(n=>n.toUpperCase())}function kn(){return Ze(n=>Js(n))}function Ml(n,e,r){return new n({type:"array",element:e,...z(r)})}function cx(n,e,r){return new n({type:"union",options:e,...z(r)})}function lx(n,e,r){return new n({type:"union",options:e,inclusive:!1,...z(r)})}function ux(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...z(i)})}function px(n,e,r){return new n({type:"intersection",left:e,right:r})}function dx(n,e,r,i){let t=r instanceof q,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...z(o)})}function mx(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...z(i)})}function fx(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...z(i)})}function hx(n,e,r){return new n({type:"set",valueType:e,...z(r)})}function gx(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...z(r)})}function yx(n,e,r){return new n({type:"enum",entries:e,...z(r)})}function vx(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...z(r)})}function Ul(n,e){return new n({type:"file",...z(e)})}function _x(n,e){return new n({type:"transform",transform:e})}function bx(n,e){return new n({type:"optional",innerType:e})}function xx(n,e){return new n({type:"nullable",innerType:e})}function $x(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Gs(r)}})}function Sx(n,e,r){return new n({type:"nonoptional",innerType:e,...z(r)})}function kx(n,e){return new n({type:"success",innerType:e})}function Ex(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function wx(n,e,r){return new n({type:"pipe",in:e,out:r})}function Ix(n,e){return new n({type:"readonly",innerType:e})}function Tx(n,e,r){return new n({type:"template_literal",parts:e,...z(r)})}function Rx(n,e){return new n({type:"lazy",getter:e})}function Px(n,e){return new n({type:"promise",innerType:e})}function Fl(n,e,r){let i=z(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function Zl(n,e,r){return new n({type:"custom",check:"custom",fn:e,...z(r)})}function Hl(n){let e=af(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(sn(i,r.value,e._zod.def));else{let t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),t.continue??(t.continue=!e._zod.def.abort),r.issues.push(sn(t))}},n(r.value,r)));return e}function af(n,e){let r=new oe({check:"custom",...z(e)});return r._zod.check=n,r}function Wl(n){let e=new oe({check:"describe"});return e._zod.onattach=[r=>{let i=be.get(r)??{};be.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function Bl(n){let e=new oe({check:"meta"});return e._zod.onattach=[r=>{let i=be.get(r)??{};be.add(r,{...i,...n})}],e._zod.check=()=>{},e}function Jl(n,e){let r=z(e),i=r.truthy??["true","1","yes","on","y","enabled"],t=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(t),a=n.Codec??gr,c=n.Boolean??fr,l=n.String??Ht,u=new l({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),d=new a({type:"pipe",in:u,out:p,transform:((m,f)=>{let h=m;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:f.value,inst:d,continue:!1}),{})}),reverseTransform:((m,f)=>m===!0?i[0]||"true":t[0]||"false"),error:r.error});return d}function En(n,e,r,i={}){let t=z(i),o={...z(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...t};return r instanceof RegExp&&(o.pattern=r),new n(o)}function wt(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??be,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function ne(n,e,r={path:[],schemaPath:[]}){var i;let t=n._zod.def,o=e.seen.get(n);if(o)return o.count++,r.schemaPath.includes(n)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(n,s);let a=n._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,n],path:r.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,s.schema,u);else{let d=s.schema,m=e.processors[t.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);m(n,e,d,u)}let p=n._zod.parent;p&&(s.ref||(s.ref=p),ne(p,e,u),e.seen.get(p).isParent=!0)}let c=e.metadataRegistry.get(n);return c&&Object.assign(s.schema,c),e.io==="input"&&Ee(n)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(n).schema}function It(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of n.seen.entries()){let a=n.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let t=s=>{let a=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let p=n.external.registry.get(s[0])?.id,d=n.external.uri??(f=>f);if(p)return{ref:d(p)};let m=s[1].defId??s[1].schema.id??`schema${n.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${a}/${m}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${n.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=t(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let p in u)delete u[p];u.$ref=c};if(n.cycles==="throw")for(let s of n.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
471
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");let g=m.compile();return(b,S)=>g(d,b,S)},o,s=Zt,a=!ar.jitless,l=a&&ia.value,u=e.catchall,p;n._zod.parse=(d,m)=>{p??(p=i.value);let f=d.value;return s(f)?a&&l&&m?.async===!1&&m.jitless!==!0?(o||(o=t(e.shape)),d=o(d,m),u?hm([],f,d,m,p,n):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:n}),d)}});function nm(n,e,r,i){for(let o of n)if(o.issues.length===0)return e.value=o.value,e;let t=n.filter(o=>!Et(o));return t.length===1?(e.value=t[0].value,t[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>we(s,i,me())))}),e)}var xr=$("$ZodUnion",(n,e)=>{Y.init(n,e),Q(n._zod,"optin",()=>e.options.some(t=>t._zod.optin==="optional")?"optional":void 0),Q(n._zod,"optout",()=>e.options.some(t=>t._zod.optout==="optional")?"optional":void 0),Q(n._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),Q(n._zod,"pattern",()=>{if(e.options.every(t=>t._zod.pattern)){let t=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${t.map(o=>ur(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(c=>nm(c,t,n,o)):nm(a,t,n,o)}});function rm(n,e,r,i){let t=n.filter(o=>o.issues.length===0);return t.length===1?(e.value=t[0].value,e):(t.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>we(s,i,me())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Jc=$("$ZodXor",(n,e)=>{xr.init(n,e),e.inclusive=!1;let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);l instanceof Promise?(a.push(l),s=!0):a.push(l)}return s?Promise.all(a).then(c=>rm(c,t,n,o)):rm(a,t,n,o)}}),Gc=$("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,xr.init(n,e);let r=n._zod.parse;Q(n._zod,"propValues",()=>{let t={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){t[a]||(t[a]=new Set);for(let l of c)t[a].add(l)}}return t});let i=pn(()=>{let t=e.options,o=new Map;for(let s of t){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});n._zod.parse=(t,o)=>{let s=t.value;if(!Zt(s))return t.issues.push({code:"invalid_type",expected:"object",input:s,inst:n}),t;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(t,o):e.unionFallback?r(t,o):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:n}),t)}}),Vc=$("$ZodIntersection",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value,o=e.left._zod.run({value:t,issues:[]},i),s=e.right._zod.run({value:t,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>im(r,c,l)):im(r,o,s)}});function ac(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(kt(n)&&kt(e)){let r=Object.keys(e),i=Object.keys(n).filter(o=>r.indexOf(o)!==-1),t={...n,...e};for(let o of i){let s=ac(n[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};t[o]=s.data}return{valid:!0,data:t}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<n.length;i++){let t=n[i],o=e[i],s=ac(t,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function im(n,e,r){let i=new Map,t;for(let a of e.issues)if(a.code==="unrecognized_keys"){t??(t=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else n.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else n.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&t&&n.issues.push({...t,keys:o}),Et(n))return n;let s=ac(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return n.value=s.data,n}var Li=$("$ZodTuple",(n,e)=>{Y.init(n,e);let r=e.items;n._zod.parse=(i,t)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:n,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=[...r].reverse().findIndex(u=>u._zod.optin!=="optional"),c=a===-1?0:r.length-a;if(!e.rest){let u=o.length>r.length,p=o.length<c-1;if(u||p)return i.issues.push({...u?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:n,origin:"array"}),i}let l=-1;for(let u of r){if(l++,l>=o.length&&l>=c)continue;let p=u._zod.run({value:o[l],issues:[]},t);p instanceof Promise?s.push(p.then(d=>Ti(d,i,l))):Ti(p,i,l)}if(e.rest){let u=o.slice(r.length);for(let p of u){l++;let d=e.rest._zod.run({value:p,issues:[]},t);d instanceof Promise?s.push(d.then(m=>Ti(m,i,l))):Ti(d,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function Ti(n,e,r){n.issues.length&&e.issues.push(...ze(r,n.issues)),e.value[r]=n.value}var qc=$("$ZodRecord",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!kt(t))return r.issues.push({expected:"record",code:"invalid_type",input:t,inst:n}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.valueType._zod.run({value:t[l],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...ze(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...ze(l,u.issues)),r.value[l]=u.value)}let c;for(let l in t)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:t,inst:n,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Ei.test(a)&&c.issues.length&&c.issues.some(p=>p.code==="invalid_type"&&p.expected==="number")){let p=e.keyType._zod.run({value:Number(a),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){e.mode==="loose"?r.value[a]=t[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>we(p,i,me())),input:a,path:[a],inst:n});continue}let u=e.valueType._zod.run({value:t[a],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...ze(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...ze(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Kc=$("$ZodMap",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:t,inst:n}),r;let o=[];r.value=new Map;for(let[s,a]of t){let c=e.keyType._zod.run({value:s,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,p])=>{om(u,p,r,s,t,n,i)})):om(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function om(n,e,r,i,t,o,s){n.issues.length&&(pr.has(typeof i)?r.issues.push(...ze(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>we(a,s,me()))})),e.issues.length&&(pr.has(typeof i)?r.issues.push(...ze(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>we(a,s,me()))})),r.value.set(n.value,e.value)}var Yc=$("$ZodSet",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Set))return r.issues.push({input:t,inst:n,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of t){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>sm(c,r))):sm(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function sm(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var Xc=$("$ZodEnum",(n,e)=>{Y.init(n,e);let r=lr(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>pr.has(typeof t)).map(t=>typeof t=="string"?Ce(t):t.toString()).join("|")})$`),n._zod.parse=(t,o)=>{let s=t.value;return i.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:n}),t}}),Qc=$("$ZodLiteral",(n,e)=>{if(Y.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ce(i):i?Ce(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,t)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),i}}),el=$("$ZodFile",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return t instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:t,inst:n}),r}}),tl=$("$ZodTransform",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new xt(n.constructor.name);let t=e.transform(r.value,r);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(s=>(r.value=s,r));if(t instanceof Promise)throw new Ze;return r.value=t,r}});function am(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var Ai=$("$ZodOptional",(n,e)=>{Y.init(n,e),n._zod.optin="optional",n._zod.optout="optional",Q(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Q(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ur(r.source)})?$`):void 0}),n._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>am(o,r.value)):am(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),nl=$("$ZodExactOptional",(n,e)=>{Ai.init(n,e),Q(n._zod,"values",()=>e.innerType._zod.values),Q(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),rl=$("$ZodNullable",(n,e)=>{Y.init(n,e),Q(n._zod,"optin",()=>e.innerType._zod.optin),Q(n._zod,"optout",()=>e.innerType._zod.optout),Q(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ur(r.source)}|null)$`):void 0}),Q(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),il=$("$ZodDefault",(n,e)=>{Y.init(n,e),n._zod.optin="optional",Q(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>cm(o,e)):cm(t,e)}});function cm(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var ol=$("$ZodPrefault",(n,e)=>{Y.init(n,e),n._zod.optin="optional",Q(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),sl=$("$ZodNonOptional",(n,e)=>{Y.init(n,e),Q(n._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),n._zod.parse=(r,i)=>{let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>lm(o,n)):lm(t,n)}});function lm(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}var al=$("$ZodSuccess",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new xt("ZodSuccess");let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.issues.length===0,r)):(r.value=t.issues.length===0,r)}}),cl=$("$ZodCatch",(n,e)=>{Y.init(n,e),Q(n._zod,"optin",()=>e.innerType._zod.optin),Q(n._zod,"optout",()=>e.innerType._zod.optout),Q(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>we(s,i,me()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=e.catchValue({...r,error:{issues:t.issues.map(o=>we(o,i,me()))},input:r.value}),r.issues=[]),r)}}),ll=$("$ZodNaN",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:n,expected:"nan",code:"invalid_type"}),r)}),ul=$("$ZodPipe",(n,e)=>{Y.init(n,e),Q(n._zod,"values",()=>e.in._zod.values),Q(n._zod,"optin",()=>e.in._zod.optin),Q(n._zod,"optout",()=>e.out._zod.optout),Q(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Ri(s,e.in,i)):Ri(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>Ri(o,e.out,i)):Ri(t,e.out,i)}});function Ri(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var $r=$("$ZodCodec",(n,e)=>{Y.init(n,e),Q(n._zod,"values",()=>e.in._zod.values),Q(n._zod,"optin",()=>e.in._zod.optin),Q(n._zod,"optout",()=>e.out._zod.optout),Q(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>Pi(s,e,i)):Pi(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Pi(s,e,i)):Pi(o,e,i)}}});function Pi(n,e,r){if(n.issues.length)return n.aborted=!0,n;if((r.direction||"forward")==="forward"){let t=e.transform(n.value,n);return t instanceof Promise?t.then(o=>Ni(n,o,e.out,r)):Ni(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>Ni(n,o,e.in,r)):Ni(n,t,e.in,r)}}function Ni(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var pl=$("$ZodReadonly",(n,e)=>{Y.init(n,e),Q(n._zod,"propValues",()=>e.innerType._zod.propValues),Q(n._zod,"values",()=>e.innerType._zod.values),Q(n._zod,"optin",()=>e.innerType?._zod?.optin),Q(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(um):um(t)}});function um(n){return n.value=Object.freeze(n.value),n}var dl=$("$ZodTemplateLiteral",(n,e)=>{Y.init(n,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let t=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(o,s))}else if(i===null||sa.has(typeof i))r.push(Ce(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);n._zod.pattern=new RegExp(`^${r.join("")}$`),n._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:n,expected:"string",code:"invalid_type"}),i):(n._zod.pattern.lastIndex=0,n._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:n,code:"invalid_format",format:e.format??"template_literal",pattern:n._zod.pattern.source}),i)}),ml=$("$ZodFunction",(n,e)=>(Y.init(n,e),n._def=e,n._zod.def=e,n.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let t=n._def.input?fi(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?fi(n._def.output,o):o}},n.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let t=n._def.input?await hi(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await hi(n._def.output,o):o}},n._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:n}),r):(n._def.output&&n._def.output._zod.def.type==="promise"?r.value=n.implementAsync(r.value):r.value=n.implement(r.value),r),n.input=(...r)=>{let i=n.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Li({type:"tuple",items:r[0],rest:r[1]}),output:n._def.output}):new i({type:"function",input:r[0],output:n._def.output})},n.output=r=>{let i=n.constructor;return new i({type:"function",input:n._def.input,output:r})},n)),fl=$("$ZodPromise",(n,e)=>{Y.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),hl=$("$ZodLazy",(n,e)=>{Y.init(n,e),Q(n._zod,"innerType",()=>e.getter()),Q(n._zod,"pattern",()=>n._zod.innerType?._zod?.pattern),Q(n._zod,"propValues",()=>n._zod.innerType?._zod?.propValues),Q(n._zod,"optin",()=>n._zod.innerType?._zod?.optin??void 0),Q(n._zod,"optout",()=>n._zod.innerType?._zod?.optout??void 0),n._zod.parse=(r,i)=>n._zod.innerType._zod.run(r,i)}),gl=$("$ZodCustom",(n,e)=>{le.init(n,e),Y.init(n,e),n._zod.parse=(r,i)=>r,n._zod.check=r=>{let i=r.value,t=e.fn(i);if(t instanceof Promise)return t.then(o=>pm(o,r,i,n));pm(t,r,i,n)}});function pm(n,e,r,i){if(!n){let t={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),e.issues.push(dn(t))}}var kr={};Ae(kr,{ar:()=>ym,az:()=>vm,be:()=>bm,bg:()=>xm,ca:()=>$m,cs:()=>Sm,da:()=>km,de:()=>Em,en:()=>Ci,eo:()=>wm,es:()=>Im,fa:()=>Tm,fi:()=>Rm,fr:()=>Pm,frCA:()=>Nm,he:()=>zm,hu:()=>Dm,hy:()=>Lm,id:()=>Am,is:()=>Cm,it:()=>jm,ja:()=>Mm,ka:()=>Um,kh:()=>Fm,km:()=>ji,ko:()=>Zm,lt:()=>Hm,mk:()=>Bm,ms:()=>Jm,nl:()=>Gm,no:()=>Vm,ota:()=>qm,pl:()=>Ym,ps:()=>Km,pt:()=>Xm,ru:()=>ef,sl:()=>tf,sv:()=>nf,ta:()=>rf,th:()=>of,tr:()=>sf,ua:()=>af,uk:()=>Mi,ur:()=>cf,uz:()=>lf,vi:()=>uf,yo:()=>mf,zhCN:()=>pf,zhTW:()=>df});var Ob=()=>{let n={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(t){return n[t]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${t.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return t.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${P(t.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${t.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??t.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${t.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${t.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${t.keys.length>1?"\u0629":""}: ${E(t.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function ym(){return{localeError:Ob()}}var Lb=()=>{let n={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(t){return n[t]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${t.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return t.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${P(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??t.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${t.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${t.keys.length>1?"lar":""}: ${E(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${t.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function vm(){return{localeError:Lb()}}function _m(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var Ab=()=>{let n={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(t){return n[t]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${t.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${P(t.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=_m(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=_m(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${t.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${E(t.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${t.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function bm(){return{localeError:Ab()}}var Cb=()=>{let n={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(t){return n[t]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${P(t.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${t.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u043E\u0432\u0435":""}: ${E(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${t.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function xm(){return{localeError:Cb()}}var jb=()=>{let n={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(t){return n[t]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${t.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return t.values.length===1?`Valor inv\xE0lid: s'esperava ${P(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${E(t.values," o ")}`;case"too_big":{let o=t.inclusive?"com a m\xE0xim":"menys de",s=e(t.origin);return s?`Massa gran: s'esperava que ${t.origin??"el valor"} contingu\xE9s ${o} ${t.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(t.origin);return s?`Massa petit: s'esperava que ${t.origin} contingu\xE9s ${o} ${t.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${E(t.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${t.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${t.origin}`;default:return"Entrada inv\xE0lida"}}};function $m(){return{localeError:jb()}}var Mb=()=>{let n={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(t){return n[t]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${t.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return t.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${P(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??t.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${t.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${E(t.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${t.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${t.origin}`;default:return"Neplatn\xFD vstup"}}};function Sm(){return{localeError:Mb()}}var Ub=()=>{let n={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(t){return n[t]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldigt input: forventede instanceof ${t.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig v\xE6rdi: forventede ${P(t.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${t.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${E(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${t.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${t.origin}`;default:return"Ugyldigt input"}}};function km(){return{localeError:Ub()}}var Fb=()=>{let n={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(t){return n[t]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${t.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return t.values.length===1?`Ung\xFCltige Eingabe: erwartet ${P(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ist`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ist`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??t.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${E(t.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${t.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${t.origin}`;default:return"Ung\xFCltige Eingabe"}}};function Em(){return{localeError:Fb()}}var Zb=()=>{let n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(t){return n[t]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${P(t.values[0])}`:`Invalid option: expected one of ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Too big: expected ${t.origin??"value"} to have ${o}${t.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${t.origin??"value"} to be ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Too small: expected ${t.origin} to have ${o}${t.minimum.toString()} ${s.unit}`:`Too small: expected ${t.origin} to be ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${t.divisor}`;case"unrecognized_keys":return`Unrecognized key${t.keys.length>1?"s":""}: ${E(t.keys,", ")}`;case"invalid_key":return`Invalid key in ${t.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${t.origin}`;default:return"Invalid input"}}};function Ci(){return{localeError:Zb()}}var Wb=()=>{let n={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(t){return n[t]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${t.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return t.values.length===1?`Nevalida enigo: atendi\u011Dis ${P(t.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Tro malgranda: atendi\u011Dis ke ${t.origin} havu ${o}${t.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${t.origin} estu ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??t.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${t.divisor}`;case"unrecognized_keys":return`Nekonata${t.keys.length>1?"j":""} \u015Dlosilo${t.keys.length>1?"j":""}: ${E(t.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${t.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${t.origin}`;default:return"Nevalida enigo"}}};function wm(){return{localeError:Wb()}}var Hb=()=>{let n={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(t){return n[t]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${t.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: se esperaba ${P(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${t.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${E(t.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[t.origin]??t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[t.origin]??t.origin}`;default:return"Entrada inv\xE1lida"}}};function Im(){return{localeError:Hb()}}var Bb=()=>{let n={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(t){return n[t]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${t.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return t.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${P(t.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${E(t.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??t.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${t.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${t.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${E(t.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${t.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${t.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Tm(){return{localeError:Bb()}}var Jb=()=>{let n={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(t){return n[t]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Virheellinen tyyppi: odotettiin instanceof ${t.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return t.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${P(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${t.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${t.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${E(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\xF6te"}}};function Rm(){return{localeError:Jb()}}var Gb=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN",number:"nombre",array:"tableau"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : instanceof ${t.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : ${P(t.values[0])} attendu`:`Option invalide : une valeur parmi ${E(t.values,"|")} attendue`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Trop grand : ${t.origin??"valeur"} doit ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${t.origin??"valeur"} doit \xEAtre ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Trop petit : ${t.origin} doit ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : ${t.origin} doit \xEAtre ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${E(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function Pm(){return{localeError:Gb()}}var Vb=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : attendu instanceof ${t.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : attendu ${P(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u2264":"<",s=e(t.origin);return s?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${o}${t.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u2265":">",s=e(t.origin);return s?`Trop petit : attendu que ${t.origin} ait ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${t.origin} soit ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${E(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function Nm(){return{localeError:Vb()}}var qb=()=>{let n={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?n[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??n.unknown.label},t=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,p=c[u??""]??i(u),d=N(l.input),m=c[d]??n[d]?.label??d;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${P(l.values[0])}`;let u=l.values.map(m=>P(m));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?"<=":"<",m=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let _=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?">=":">",m=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let p=a[u.format],d=p?.label??u.format,f=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${d} \u05DC\u05D0 ${f}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${E(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${t(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function zm(){return{localeError:qb()}}var Kb=()=>{let n={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(t){return n[t]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${t.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return t.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${P(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xFAl nagy: ${t.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${t.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${t.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} m\xE9rete t\xFAl kicsi ${o}${t.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} t\xFAl kicsi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??t.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${t.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${E(t.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${t.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${t.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Dm(){return{localeError:Kb()}}function Om(n,e,r){return Math.abs(n)===1?e:r}function vn(n){if(!n)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=n[n.length-1];return n+(e.includes(r)?"\u0576":"\u0568")}var Yb=()=>{let n={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(t){return n[t]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${t.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return t.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${P(t.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Om(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${vn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${vn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=Om(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${vn(t.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${vn(t.origin)} \u056C\u056B\u0576\u056B ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??t.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${t.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${t.keys.length>1?"\u0576\u0565\u0580":""}. ${E(t.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${vn(t.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${vn(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Lm(){return{localeError:Yb()}}var Xb=()=>{let n={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(t){return n[t]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak valid: diharapkan instanceof ${t.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${P(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: diharapkan ${t.origin} memiliki ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??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":""}: ${E(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 Am(){return{localeError:Xb()}}var Qb=()=>{let n={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(t){return n[t]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${t.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return t.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${P(t.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} hafi ${o}${t.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} s\xE9 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} hafi ${o}${t.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} s\xE9 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??t.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${t.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${t.keys.length>1?"ir lyklar":"ur lykill"}: ${E(t.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${t.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${t.origin}`;default:return"Rangt gildi"}}};function Cm(){return{localeError:Qb()}}var ex=()=>{let n={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(t){return n[t]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input non valido: atteso instanceof ${t.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return t.values.length===1?`Input non valido: atteso ${P(t.values[0])}`:`Opzione non valida: atteso uno tra ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Troppo grande: ${t.origin??"valore"} deve avere ${o}${t.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Troppo piccolo: ${t.origin} deve avere ${o}${t.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${t.origin} deve essere ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??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"}: ${E(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 jm(){return{localeError:ex()}}var tx=()=>{let n={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(t){return n[t]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${t.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return t.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${P(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${E(t.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=t.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(t.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=t.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(t.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${t.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${t.keys.length>1?"\u7FA4":""}: ${E(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Mm(){return{localeError:tx()}}var nx=()=>{let n={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(t){return n[t]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${t.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return t.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${P(t.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${E(t.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${t.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${t.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${E(t.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${t.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${t.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Um(){return{localeError:nx()}}var rx=()=>{let n={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(t){return n[t]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${t.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return t.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${P(t.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${t.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${E(t.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function ji(){return{localeError:rx()}}function Fm(){return ji()}var ix=()=>{let n={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(t){return n[t]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${t.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return t.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${P(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${E(t.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=t.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()} ${o}${s}`}case"too_small":{let o=t.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??t.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${t.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${E(t.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${t.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${t.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Zm(){return{localeError:ix()}}var Sr=n=>n.charAt(0).toUpperCase()+n.slice(1);function Wm(n){let e=Math.abs(n),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var ox=()=>{let n={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(t,o,s,a){let c=n[t]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${t.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return t.values.length===1?`Privalo b\u016Bti ${P(t.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${E(t.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[t.origin]??t.origin,s=e(t.origin,Wm(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${Sr(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.maximum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Sr(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[t.origin]??t.origin,s=e(t.origin,Wm(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${Sr(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.minimum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Sr(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??t.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${t.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${t.keys.length>1?"i":"as"} rakt${t.keys.length>1?"ai":"as"}: ${E(t.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[t.origin]??t.origin;return`${Sr(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Hm(){return{localeError:ox()}}var sx=()=>{let n={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(t){return n[t]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${t.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${P(t.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${E(t.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${t.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${t.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Bm(){return{localeError:sx()}}var ax=()=>{let n={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(t){return n[t]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak sah: dijangka instanceof ${t.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${P(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: dijangka ${t.origin??"nilai"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: dijangka ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${E(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 Jm(){return{localeError:ax()}}var cx=()=>{let n={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(t){return n[t]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ongeldige invoer: verwacht instanceof ${t.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${P(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=t.origin==="date"?"laat":t.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} is`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=t.origin==="date"?"vroeg":t.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} is`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??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":""}: ${E(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 Gm(){return{localeError:cx()}}var lx=()=>{let n={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(t){return n[t]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventet instanceof ${t.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${P(t.values[0])}`:`Ugyldig valg: forventet en av ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${E(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function Vm(){return{localeError:lx()}}var ux=()=>{let n={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(t){return n[t]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`F\xE2sit giren: umulan instanceof ${t.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`F\xE2sit giren: umulan ${P(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=t;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??t.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${t.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${t.keys.length>1?"s":""}: ${E(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${t.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function qm(){return{localeError:ux()}}var px=()=>{let n={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(t){return n[t]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${t.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return t.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${P(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${E(t.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0648\u064A`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??t.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${t.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${t.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${E(t.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${t.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${t.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Km(){return{localeError:px()}}var dx=()=>{let n={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(t){return n[t]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${t.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return t.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${P(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??t.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${E(t.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${t.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${t.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Ym(){return{localeError:dx()}}var mx=()=>{let n={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(t){return n[t]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipo inv\xE1lido: esperado instanceof ${t.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: esperado ${P(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Muito grande: esperado que ${t.origin??"valor"} tivesse ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${t.origin??"valor"} fosse ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Muito pequeno: esperado que ${t.origin} tivesse ${o}${t.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${t.origin} fosse ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??t.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${E(t.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${t.origin}`;default:return"Campo inv\xE1lido"}}};function Xm(){return{localeError:mx()}}function Qm(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var fx=()=>{let n={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(t){return n[t]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${P(t.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Qm(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=Qm(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${t.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0438":""}: ${E(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${t.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function ef(){return{localeError:fx()}}var hx=()=>{let n={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(t){return n[t]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${t.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return t.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${P(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} imelo ${o}${t.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${t.origin} imelo ${o}${t.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??t.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${E(t.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function tf(){return{localeError:hx()}}var gx=()=>{let n={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(t){return n[t]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${t.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return t.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${P(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${E(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${t.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function nf(){return{localeError:gx()}}var yx=()=>{let n={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(t){return n[t]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${t.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return t.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${P(t.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${E(t.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${t.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${t.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${E(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function rf(){return{localeError:yx()}}var vx=()=>{let n={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(t){return n[t]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${t.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return t.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${P(t.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${t.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${E(t.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function of(){return{localeError:vx()}}var _x=()=>{let n={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(t){return n[t]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${t.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${P(t.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??t.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${t.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${t.keys.length>1?"lar":""}: ${E(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${t.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function sf(){return{localeError:_x()}}var bx=()=>{let n={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(t){return n[t]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${t.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${P(t.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} \u0431\u0443\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0456":""}: ${E(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${t.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Mi(){return{localeError:bx()}}function af(){return Mi()}var xx=()=>{let n={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(t){return n[t]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${t.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return t.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${P(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${E(t.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${t.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u06D2 ${o}${t.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u0627 ${o}${t.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${t.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${t.keys.length>1?"\u0632":""}: ${E(t.keys,"\u060C ")}`;case"invalid_key":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function cf(){return{localeError:xx()}}var $x=()=>{let n={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function e(t){return n[t]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${t.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return t.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${P(t.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??t.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${t.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${t.keys.length>1?"lar":""}: ${E(t.keys,", ")}`;case"invalid_key":return`${t.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${t.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function lf(){return{localeError:$x()}}var Sx=()=>{let n={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(t){return n[t]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${t.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return t.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${P(t.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??t.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${t.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${E(t.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function uf(){return{localeError:Sx()}}var kx=()=>{let n={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(t){return n[t]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${t.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return t.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${P(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??t.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${t.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${E(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${t.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function pf(){return{localeError:kx()}}var Ex=()=>{let n={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(t){return n[t]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${t.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return t.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${P(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${t.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${t.keys.length>1?"\u5011":""}\uFF1A${E(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function df(){return{localeError:Ex()}}var wx=()=>{let n={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(t){return n[t]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=N(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${t.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return t.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${P(t.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${E(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin??"iye"} ${s.verb} ${o}${t.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.maximum}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin} ${s.verb} ${o}${t.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.minimum}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??t.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${t.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${E(t.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${t.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${t.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function mf(){return{localeError:wx()}}var ff,yl=Symbol("ZodOutput"),vl=Symbol("ZodInput"),Ui=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let t={...i,...this._map.get(e)};return Object.keys(t).length?t:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Fi(){return new Ui}(ff=globalThis).__zod_globalRegistry??(ff.__zod_globalRegistry=Fi());var be=globalThis.__zod_globalRegistry;function _l(n,e){return new n({type:"string",...D(e)})}function bl(n,e){return new n({type:"string",coerce:!0,...D(e)})}function Zi(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...D(e)})}function Er(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...D(e)})}function Wi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...D(e)})}function Hi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D(e)})}function Bi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D(e)})}function Ji(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D(e)})}function wr(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...D(e)})}function Gi(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...D(e)})}function Vi(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...D(e)})}function qi(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...D(e)})}function Ki(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...D(e)})}function Yi(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...D(e)})}function Xi(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...D(e)})}function Qi(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...D(e)})}function eo(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...D(e)})}function to(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...D(e)})}function xl(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...D(e)})}function no(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D(e)})}function ro(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D(e)})}function io(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...D(e)})}function oo(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...D(e)})}function so(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...D(e)})}function ao(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...D(e)})}var $l={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Sl(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D(e)})}function kl(n,e){return new n({type:"string",format:"date",check:"string_format",...D(e)})}function El(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...D(e)})}function wl(n,e){return new n({type:"string",format:"duration",check:"string_format",...D(e)})}function Il(n,e){return new n({type:"number",checks:[],...D(e)})}function Tl(n,e){return new n({type:"number",coerce:!0,checks:[],...D(e)})}function Rl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...D(e)})}function Pl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...D(e)})}function Nl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...D(e)})}function zl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...D(e)})}function Dl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...D(e)})}function Ol(n,e){return new n({type:"boolean",...D(e)})}function Ll(n,e){return new n({type:"boolean",coerce:!0,...D(e)})}function Al(n,e){return new n({type:"bigint",...D(e)})}function Cl(n,e){return new n({type:"bigint",coerce:!0,...D(e)})}function jl(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...D(e)})}function Ml(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...D(e)})}function Ul(n,e){return new n({type:"symbol",...D(e)})}function Fl(n,e){return new n({type:"undefined",...D(e)})}function Zl(n,e){return new n({type:"null",...D(e)})}function Wl(n){return new n({type:"any"})}function Hl(n){return new n({type:"unknown"})}function Bl(n,e){return new n({type:"never",...D(e)})}function Jl(n,e){return new n({type:"void",...D(e)})}function Gl(n,e){return new n({type:"date",...D(e)})}function Vl(n,e){return new n({type:"date",coerce:!0,...D(e)})}function ql(n,e){return new n({type:"nan",...D(e)})}function Qe(n,e){return new wi({check:"less_than",...D(e),value:n,inclusive:!1})}function De(n,e){return new wi({check:"less_than",...D(e),value:n,inclusive:!0})}function et(n,e){return new Ii({check:"greater_than",...D(e),value:n,inclusive:!1})}function Se(n,e){return new Ii({check:"greater_than",...D(e),value:n,inclusive:!0})}function co(n){return et(0,n)}function lo(n){return Qe(0,n)}function uo(n){return De(0,n)}function po(n){return Se(0,n)}function wt(n,e){return new Za({check:"multiple_of",...D(e),value:n})}function It(n,e){return new Ba({check:"max_size",...D(e),maximum:n})}function tt(n,e){return new Ja({check:"min_size",...D(e),minimum:n})}function Bt(n,e){return new Ga({check:"size_equals",...D(e),size:n})}function Jt(n,e){return new Va({check:"max_length",...D(e),maximum:n})}function dt(n,e){return new qa({check:"min_length",...D(e),minimum:n})}function Gt(n,e){return new Ka({check:"length_equals",...D(e),length:n})}function _n(n,e){return new Ya({check:"string_format",format:"regex",...D(e),pattern:n})}function bn(n){return new Xa({check:"string_format",format:"lowercase",...D(n)})}function xn(n){return new Qa({check:"string_format",format:"uppercase",...D(n)})}function $n(n,e){return new ec({check:"string_format",format:"includes",...D(e),includes:n})}function Sn(n,e){return new tc({check:"string_format",format:"starts_with",...D(e),prefix:n})}function kn(n,e){return new nc({check:"string_format",format:"ends_with",...D(e),suffix:n})}function mo(n,e,r){return new rc({check:"property",property:n,schema:e,...D(r)})}function En(n,e){return new ic({check:"mime_type",mime:n,...D(e)})}function We(n){return new oc({check:"overwrite",tx:n})}function wn(n){return We(e=>e.normalize(n))}function In(){return We(n=>n.trim())}function Tn(){return We(n=>n.toLowerCase())}function Rn(){return We(n=>n.toUpperCase())}function Pn(){return We(n=>ra(n))}function Kl(n,e,r){return new n({type:"array",element:e,...D(r)})}function Tx(n,e,r){return new n({type:"union",options:e,...D(r)})}function Rx(n,e,r){return new n({type:"union",options:e,inclusive:!1,...D(r)})}function Px(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...D(i)})}function Nx(n,e,r){return new n({type:"intersection",left:e,right:r})}function zx(n,e,r,i){let t=r instanceof Y,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...D(o)})}function Dx(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...D(i)})}function Ox(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...D(i)})}function Lx(n,e,r){return new n({type:"set",valueType:e,...D(r)})}function Ax(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...D(r)})}function Cx(n,e,r){return new n({type:"enum",entries:e,...D(r)})}function jx(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...D(r)})}function Yl(n,e){return new n({type:"file",...D(e)})}function Mx(n,e){return new n({type:"transform",transform:e})}function Ux(n,e){return new n({type:"optional",innerType:e})}function Fx(n,e){return new n({type:"nullable",innerType:e})}function Zx(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():oa(r)}})}function Wx(n,e,r){return new n({type:"nonoptional",innerType:e,...D(r)})}function Hx(n,e){return new n({type:"success",innerType:e})}function Bx(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function Jx(n,e,r){return new n({type:"pipe",in:e,out:r})}function Gx(n,e){return new n({type:"readonly",innerType:e})}function Vx(n,e,r){return new n({type:"template_literal",parts:e,...D(r)})}function qx(n,e){return new n({type:"lazy",getter:e})}function Kx(n,e){return new n({type:"promise",innerType:e})}function Xl(n,e,r){let i=D(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function Ql(n,e,r){return new n({type:"custom",check:"custom",fn:e,...D(r)})}function eu(n){let e=hf(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(dn(i,r.value,e._zod.def));else{let t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),t.continue??(t.continue=!e._zod.def.abort),r.issues.push(dn(t))}},n(r.value,r)));return e}function hf(n,e){let r=new le({check:"custom",...D(e)});return r._zod.check=n,r}function tu(n){let e=new le({check:"describe"});return e._zod.onattach=[r=>{let i=be.get(r)??{};be.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function nu(n){let e=new le({check:"meta"});return e._zod.onattach=[r=>{let i=be.get(r)??{};be.add(r,{...i,...n})}],e._zod.check=()=>{},e}function ru(n,e){let r=D(e),i=r.truthy??["true","1","yes","on","y","enabled"],t=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(t),a=n.Codec??$r,c=n.Boolean??br,l=n.String??Ht,u=new l({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),d=new a({type:"pipe",in:u,out:p,transform:((m,f)=>{let h=m;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:f.value,inst:d,continue:!1}),{})}),reverseTransform:((m,f)=>m===!0?i[0]||"true":t[0]||"false"),error:r.error});return d}function Nn(n,e,r,i={}){let t=D(i),o={...D(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...t};return r instanceof RegExp&&(o.pattern=r),new n(o)}function Tt(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??be,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function ie(n,e,r={path:[],schemaPath:[]}){var i;let t=n._zod.def,o=e.seen.get(n);if(o)return o.count++,r.schemaPath.includes(n)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(n,s);let a=n._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,n],path:r.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,s.schema,u);else{let d=s.schema,m=e.processors[t.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);m(n,e,d,u)}let p=n._zod.parent;p&&(s.ref||(s.ref=p),ie(p,e,u),e.seen.get(p).isParent=!0)}let c=e.metadataRegistry.get(n);return c&&Object.assign(s.schema,c),e.io==="input"&&ke(n)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(n).schema}function Rt(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of n.seen.entries()){let a=n.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let t=s=>{let a=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let p=n.external.registry.get(s[0])?.id,d=n.external.uri??(f=>f);if(p)return{ref:d(p)};let m=s[1].defId??s[1].schema.id??`schema${n.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${a}/${m}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${n.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=t(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let p in u)delete u[p];u.$ref=c};if(n.cycles==="throw")for(let s of n.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
462
472
 
463
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of n.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(n.external){let l=n.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(n.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&n.reused==="ref"){o(s);continue}}}function Tt(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let a=n.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){i(u);let d=n.seen.get(u),m=d.schema;if(m.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),s._zod.parent===u)for(let h in c)h==="$ref"||h==="allOf"||h in l||delete c[h];if(m.$ref)for(let h in c)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(c[h])===JSON.stringify(d.def[h])&&delete c[h]}let p=s._zod.parent;if(p&&p!==u){i(p);let d=n.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(let m in c)m==="$ref"||m==="allOf"||m in d.def&&JSON.stringify(c[m])===JSON.stringify(d.def[m])&&delete c[m]}n.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...n.seen.entries()].reverse())i(s[0]);let t={};if(n.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){let s=n.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");t.$id=n.external.uri(s)}Object.assign(t,r.def??r.schema);let o=n.external?.defs??{};for(let s of n.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?t.$defs=o:t.definitions=o);try{let s=JSON.parse(JSON.stringify(t));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:wn(e,"input",n.processors),output:wn(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Ee(n,e){let r=e??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);let i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Ee(i.element,r);if(i.type==="set")return Ee(i.valueType,r);if(i.type==="lazy")return Ee(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Ee(i.innerType,r);if(i.type==="intersection")return Ee(i.left,r)||Ee(i.right,r);if(i.type==="record"||i.type==="map")return Ee(i.keyType,r)||Ee(i.valueType,r);if(i.type==="pipe")return Ee(i.in,r)||Ee(i.out,r);if(i.type==="object"){for(let t in i.shape)if(Ee(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(Ee(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(Ee(t,r))return!0;return!!(i.rest&&Ee(i.rest,r))}return!1}var Vl=(n,e={})=>r=>{let i=wt({...r,processors:e});return ne(n,i),It(i,n),Tt(i,n)},wn=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=wt({...t??{},target:o,io:e,processors:r});return ne(n,s),It(s,n),Tt(s,n)};var Nx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gl=(n,e,r,i)=>{let t=r;t.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=n._zod.bag;if(typeof o=="number"&&(t.minLength=o),typeof s=="number"&&(t.maxLength=s),a&&(t.format=Nx[a]??a,t.format===""&&delete t.format,a==="time"&&delete t.format),l&&(t.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?t.pattern=u[0].source:u.length>1&&(t.allOf=[...u.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},ql=(n,e,r,i)=>{let t=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=n._zod.bag;typeof a=="string"&&a.includes("int")?t.type="integer":t.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.minimum=u,t.exclusiveMinimum=!0):t.exclusiveMinimum=u),typeof o=="number"&&(t.minimum=o,typeof u=="number"&&e.target!=="draft-04"&&(u>=o?delete t.minimum:delete t.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.maximum=l,t.exclusiveMaximum=!0):t.exclusiveMaximum=l),typeof s=="number"&&(t.maximum=s,typeof l=="number"&&e.target!=="draft-04"&&(l<=s?delete t.maximum:delete t.exclusiveMaximum)),typeof c=="number"&&(t.multipleOf=c)},Kl=(n,e,r,i)=>{r.type="boolean"},Yl=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Xl=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Ql=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},eu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},tu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},nu=(n,e,r,i)=>{r.not={}},ru=(n,e,r,i)=>{},iu=(n,e,r,i)=>{},ou=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},su=(n,e,r,i)=>{let t=n._zod.def,o=rr(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},au=(n,e,r,i)=>{let t=n._zod.def,o=[];for(let s of t.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},cu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},lu=(n,e,r,i)=>{let t=r,o=n._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=o.source},uu=(n,e,r,i)=>{let t=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=n._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(t,o)):(Object.assign(t,o),t.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(t,o)},pu=(n,e,r,i)=>{r.type="boolean"},du=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},fu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},gu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},yu=(n,e,r,i)=>{let t=r,o=n._zod.def,{minimum:s,maximum:a}=n._zod.bag;typeof s=="number"&&(t.minItems=s),typeof a=="number"&&(t.maxItems=a),t.type="array",t.items=ne(o.element,e,{...i,path:[...i.path,"items"]})},vu=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object",t.properties={};let s=o.shape;for(let l in s)t.properties[l]=ne(s[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(t.required=Array.from(c)),o.catchall?._zod.def.type==="never"?t.additionalProperties=!1:o.catchall?o.catchall&&(t.additionalProperties=ne(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},oo=(n,e,r,i)=>{let t=n._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>ne(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},_u=(n,e,r,i)=>{let t=n._zod.def,o=ne(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=ne(t.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},bu=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((d,m)=>ne(d,e,{...i,path:[...i.path,s,m]})),l=o.rest?ne(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(t.prefixItems=c,l&&(t.items=l)):e.target==="openapi-3.0"?(t.items={anyOf:c},l&&t.items.anyOf.push(l),t.minItems=c.length,l||(t.maxItems=c.length)):(t.items=c,l&&(t.additionalItems=l));let{minimum:u,maximum:p}=n._zod.bag;typeof u=="number"&&(t.minItems=u),typeof p=="number"&&(t.maxItems=p)},xu=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=ne(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});t.patternProperties={};for(let p of c)t.patternProperties[p.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(t.propertyNames=ne(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=ne(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(t.required=u)}},$u=(n,e,r,i)=>{let t=n._zod.def,o=ne(t.innerType,e,i),s=e.seen.get(n);e.target==="openapi-3.0"?(s.ref=t.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Su=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},ku=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.default=JSON.parse(JSON.stringify(t.defaultValue))},Eu=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(t.defaultValue)))},wu=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType;let s;try{s=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Iu=(n,e,r,i)=>{let t=n._zod.def,o=e.io==="input"?t.in._zod.def.type==="transform"?t.out:t.in:t.out;ne(o,e,i);let s=e.seen.get(n);s.ref=o},Tu=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.readOnly=!0},Ru=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},so=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Pu=(n,e,r,i)=>{let t=n._zod.innerType;ne(t,e,i);let o=e.seen.get(n);o.ref=t},io={string:Gl,number:ql,boolean:Kl,bigint:Yl,symbol:Xl,null:Ql,undefined:eu,void:tu,never:nu,any:ru,unknown:iu,date:ou,enum:su,literal:au,nan:cu,template_literal:lu,file:uu,success:pu,custom:du,function:mu,transform:fu,map:hu,set:gu,array:yu,object:vu,union:oo,intersection:_u,tuple:bu,record:xu,nullable:$u,nonoptional:Su,default:ku,prefault:Eu,catch:wu,pipe:Iu,readonly:Tu,promise:Ru,optional:so,lazy:Pu};function ao(n,e){if("_idmap"in n){let i=n,t=wt({...e,processors:io}),o={};for(let c of i._idmap.entries()){let[l,u]=c;ne(u,t)}let s={},a={registry:i,uri:e?.uri,defs:o};t.external=a;for(let c of i._idmap.entries()){let[l,u]=c;It(t,u),s[l]=Tt(t,u)}if(Object.keys(o).length>0){let c=t.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=wt({...e,processors:io});return ne(n,r),It(r,n),Tt(r,n)}var co=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=wt({processors:io,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return ne(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),It(this.ctx,e);let i=Tt(this.ctx,e),{"~standard":t,...o}=i;return o}};var cf={};var xr={};Ue(xr,{ZodAny:()=>ep,ZodArray:()=>ip,ZodBase64:()=>Po,ZodBase64URL:()=>No,ZodBigInt:()=>Dn,ZodBigIntFormat:()=>Oo,ZodBoolean:()=>zn,ZodCIDRv4:()=>To,ZodCIDRv6:()=>Ro,ZodCUID:()=>xo,ZodCUID2:()=>$o,ZodCatch:()=>wp,ZodCodec:()=>Zo,ZodCustom:()=>zr,ZodCustomStringFormat:()=>Pn,ZodDate:()=>Ir,ZodDefault:()=>bp,ZodDiscriminatedUnion:()=>sp,ZodE164:()=>zo,ZodEmail:()=>vo,ZodEmoji:()=>_o,ZodEnum:()=>Tn,ZodExactOptional:()=>yp,ZodFile:()=>hp,ZodFunction:()=>Ap,ZodGUID:()=>$r,ZodIPv4:()=>wo,ZodIPv6:()=>Io,ZodIntersection:()=>ap,ZodJWT:()=>Do,ZodKSUID:()=>Eo,ZodLazy:()=>zp,ZodLiteral:()=>fp,ZodMAC:()=>Vu,ZodMap:()=>dp,ZodNaN:()=>Tp,ZodNanoID:()=>bo,ZodNever:()=>np,ZodNonOptional:()=>Uo,ZodNull:()=>Xu,ZodNullable:()=>_p,ZodNumber:()=>Nn,ZodNumberFormat:()=>Gt,ZodObject:()=>Rr,ZodOptional:()=>Mo,ZodPipe:()=>Fo,ZodPrefault:()=>$p,ZodPromise:()=>Op,ZodReadonly:()=>Rp,ZodRecord:()=>Nr,ZodSet:()=>mp,ZodString:()=>Rn,ZodStringFormat:()=>ie,ZodSuccess:()=>Ep,ZodSymbol:()=>Ku,ZodTemplateLiteral:()=>Np,ZodTransform:()=>gp,ZodTuple:()=>lp,ZodType:()=>K,ZodULID:()=>So,ZodURL:()=>wr,ZodUUID:()=>Qe,ZodUndefined:()=>Yu,ZodUnion:()=>Pr,ZodUnknown:()=>tp,ZodVoid:()=>rp,ZodXID:()=>ko,ZodXor:()=>op,_ZodString:()=>yo,_default:()=>xp,_function:()=>hh,any:()=>Vf,array:()=>Tr,base64:()=>Pf,base64url:()=>Nf,bigint:()=>Zf,boolean:()=>qu,catch:()=>Ip,check:()=>gh,cidrv4:()=>Tf,cidrv6:()=>Rf,codec:()=>dh,cuid:()=>bf,cuid2:()=>xf,custom:()=>yh,date:()=>qf,describe:()=>vh,discriminatedUnion:()=>th,e164:()=>zf,email:()=>uf,emoji:()=>vf,enum:()=>Co,exactOptional:()=>vp,file:()=>ch,float32:()=>jf,float64:()=>Mf,function:()=>hh,guid:()=>pf,hash:()=>Cf,hex:()=>Lf,hostname:()=>Af,httpUrl:()=>yf,instanceof:()=>bh,int:()=>go,int32:()=>Uf,int64:()=>Hf,intersection:()=>cp,ipv4:()=>Ef,ipv6:()=>If,json:()=>$h,jwt:()=>Df,keyof:()=>Kf,ksuid:()=>kf,lazy:()=>Dp,literal:()=>ah,looseObject:()=>Qf,looseRecord:()=>rh,mac:()=>wf,map:()=>ih,meta:()=>_h,nan:()=>ph,nanoid:()=>_f,nativeEnum:()=>sh,never:()=>Ao,nonoptional:()=>kp,null:()=>Qu,nullable:()=>kr,nullish:()=>lh,number:()=>Gu,object:()=>Yf,optional:()=>Sr,partialRecord:()=>nh,pipe:()=>Er,prefault:()=>Sp,preprocess:()=>Sh,promise:()=>fh,readonly:()=>Pp,record:()=>pp,refine:()=>Lp,set:()=>oh,strictObject:()=>Xf,string:()=>ho,stringFormat:()=>Of,stringbool:()=>xh,success:()=>uh,superRefine:()=>Cp,symbol:()=>Bf,templateLiteral:()=>mh,transform:()=>jo,tuple:()=>up,uint32:()=>Ff,uint64:()=>Wf,ulid:()=>$f,undefined:()=>Jf,union:()=>Lo,unknown:()=>Vt,url:()=>gf,uuid:()=>df,uuidv4:()=>mf,uuidv6:()=>ff,uuidv7:()=>hf,void:()=>Gf,xid:()=>Sf,xor:()=>eh});var lo={};Ue(lo,{endsWith:()=>vn,gt:()=>Ye,gte:()=>ke,includes:()=>gn,length:()=>Jt,lowercase:()=>fn,lt:()=>Ke,lte:()=>De,maxLength:()=>Bt,maxSize:()=>Et,mime:()=>_n,minLength:()=>pt,minSize:()=>Xe,multipleOf:()=>kt,negative:()=>eo,nonnegative:()=>no,nonpositive:()=>to,normalize:()=>bn,overwrite:()=>Ze,positive:()=>Qi,property:()=>ro,regex:()=>mn,size:()=>Wt,slugify:()=>kn,startsWith:()=>yn,toLowerCase:()=>$n,toUpperCase:()=>Sn,trim:()=>xn,uppercase:()=>hn});var In={};Ue(In,{ZodISODate:()=>po,ZodISODateTime:()=>uo,ZodISODuration:()=>fo,ZodISOTime:()=>mo,date:()=>zu,datetime:()=>Nu,duration:()=>Ou,time:()=>Du});var uo=b("ZodISODateTime",(n,e)=>{cc.init(n,e),ie.init(n,e)});function Nu(n){return dl(uo,n)}var po=b("ZodISODate",(n,e)=>{lc.init(n,e),ie.init(n,e)});function zu(n){return ml(po,n)}var mo=b("ZodISOTime",(n,e)=>{uc.init(n,e),ie.init(n,e)});function Du(n){return fl(mo,n)}var fo=b("ZodISODuration",(n,e)=>{pc.init(n,e),ie.init(n,e)});function Ou(n){return hl(fo,n)}var lf=(n,e)=>{cr.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>ur(n,r)},flatten:{value:r=>lr(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,rn,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,rn,2)}},isEmpty:{get(){return n.issues.length===0}}})},Dx=b("ZodError",lf),Te=b("ZodError",lf,{Parent:Error});var Au=an(Te),Lu=cn(Te),Cu=ln(Te),ju=un(Te),Mu=ai(Te),Uu=ci(Te),Fu=li(Te),Zu=ui(Te),Hu=pi(Te),Wu=di(Te),Bu=mi(Te),Ju=fi(Te);var K=b("ZodType",(n,e)=>(q.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:wn(n,"input"),output:wn(n,"output")}}),n.toJSONSchema=Vl(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(N.mergeDefs(e,{checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),n.with=n.check,n.clone=(r,i)=>Se(n,r,i),n.brand=()=>n,n.register=((r,i)=>(r.add(n,i),n)),n.parse=(r,i)=>Au(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>Cu(n,r,i),n.parseAsync=async(r,i)=>Lu(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>ju(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>Mu(n,r,i),n.decode=(r,i)=>Uu(n,r,i),n.encodeAsync=async(r,i)=>Fu(n,r,i),n.decodeAsync=async(r,i)=>Zu(n,r,i),n.safeEncode=(r,i)=>Hu(n,r,i),n.safeDecode=(r,i)=>Wu(n,r,i),n.safeEncodeAsync=async(r,i)=>Bu(n,r,i),n.safeDecodeAsync=async(r,i)=>Ju(n,r,i),n.refine=(r,i)=>n.check(Lp(r,i)),n.superRefine=r=>n.check(Cp(r)),n.overwrite=r=>n.check(Ze(r)),n.optional=()=>Sr(n),n.exactOptional=()=>vp(n),n.nullable=()=>kr(n),n.nullish=()=>Sr(kr(n)),n.nonoptional=r=>kp(n,r),n.array=()=>Tr(n),n.or=r=>Lo([n,r]),n.and=r=>cp(n,r),n.transform=r=>Er(n,jo(r)),n.default=r=>xp(n,r),n.prefault=r=>Sp(n,r),n.catch=r=>Ip(n,r),n.pipe=r=>Er(n,r),n.readonly=()=>Pp(n),n.describe=r=>{let i=n.clone();return be.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return be.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return be.get(n);let i=n.clone();return be.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),yo=b("_ZodString",(n,e)=>{Ht.init(n,e),K.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Gl(n,i,t,o);let r=n._zod.bag;n.format=r.format??null,n.minLength=r.minimum??null,n.maxLength=r.maximum??null,n.regex=(...i)=>n.check(mn(...i)),n.includes=(...i)=>n.check(gn(...i)),n.startsWith=(...i)=>n.check(yn(...i)),n.endsWith=(...i)=>n.check(vn(...i)),n.min=(...i)=>n.check(pt(...i)),n.max=(...i)=>n.check(Bt(...i)),n.length=(...i)=>n.check(Jt(...i)),n.nonempty=(...i)=>n.check(pt(1,...i)),n.lowercase=i=>n.check(fn(i)),n.uppercase=i=>n.check(hn(i)),n.trim=()=>n.check(xn()),n.normalize=(...i)=>n.check(bn(...i)),n.toLowerCase=()=>n.check($n()),n.toUpperCase=()=>n.check(Sn()),n.slugify=()=>n.check(kn())}),Rn=b("ZodString",(n,e)=>{Ht.init(n,e),yo.init(n,e),n.email=r=>n.check(Di(vo,r)),n.url=r=>n.check(br(wr,r)),n.jwt=r=>n.check(Xi(Do,r)),n.emoji=r=>n.check(ji(_o,r)),n.guid=r=>n.check(_r($r,r)),n.uuid=r=>n.check(Oi(Qe,r)),n.uuidv4=r=>n.check(Ai(Qe,r)),n.uuidv6=r=>n.check(Li(Qe,r)),n.uuidv7=r=>n.check(Ci(Qe,r)),n.nanoid=r=>n.check(Mi(bo,r)),n.guid=r=>n.check(_r($r,r)),n.cuid=r=>n.check(Ui(xo,r)),n.cuid2=r=>n.check(Fi($o,r)),n.ulid=r=>n.check(Zi(So,r)),n.base64=r=>n.check(qi(Po,r)),n.base64url=r=>n.check(Ki(No,r)),n.xid=r=>n.check(Hi(ko,r)),n.ksuid=r=>n.check(Wi(Eo,r)),n.ipv4=r=>n.check(Bi(wo,r)),n.ipv6=r=>n.check(Ji(Io,r)),n.cidrv4=r=>n.check(Vi(To,r)),n.cidrv6=r=>n.check(Gi(Ro,r)),n.e164=r=>n.check(Yi(zo,r)),n.datetime=r=>n.check(Nu(r)),n.date=r=>n.check(zu(r)),n.time=r=>n.check(Du(r)),n.duration=r=>n.check(Ou(r))});function ho(n){return cl(Rn,n)}var ie=b("ZodStringFormat",(n,e)=>{re.init(n,e),yo.init(n,e)}),vo=b("ZodEmail",(n,e)=>{Qa.init(n,e),ie.init(n,e)});function uf(n){return Di(vo,n)}var $r=b("ZodGUID",(n,e)=>{Ya.init(n,e),ie.init(n,e)});function pf(n){return _r($r,n)}var Qe=b("ZodUUID",(n,e)=>{Xa.init(n,e),ie.init(n,e)});function df(n){return Oi(Qe,n)}function mf(n){return Ai(Qe,n)}function ff(n){return Li(Qe,n)}function hf(n){return Ci(Qe,n)}var wr=b("ZodURL",(n,e)=>{ec.init(n,e),ie.init(n,e)});function gf(n){return br(wr,n)}function yf(n){return br(wr,{protocol:/^https?$/,hostname:Ce.domain,...N.normalizeParams(n)})}var _o=b("ZodEmoji",(n,e)=>{tc.init(n,e),ie.init(n,e)});function vf(n){return ji(_o,n)}var bo=b("ZodNanoID",(n,e)=>{nc.init(n,e),ie.init(n,e)});function _f(n){return Mi(bo,n)}var xo=b("ZodCUID",(n,e)=>{rc.init(n,e),ie.init(n,e)});function bf(n){return Ui(xo,n)}var $o=b("ZodCUID2",(n,e)=>{ic.init(n,e),ie.init(n,e)});function xf(n){return Fi($o,n)}var So=b("ZodULID",(n,e)=>{oc.init(n,e),ie.init(n,e)});function $f(n){return Zi(So,n)}var ko=b("ZodXID",(n,e)=>{sc.init(n,e),ie.init(n,e)});function Sf(n){return Hi(ko,n)}var Eo=b("ZodKSUID",(n,e)=>{ac.init(n,e),ie.init(n,e)});function kf(n){return Wi(Eo,n)}var wo=b("ZodIPv4",(n,e)=>{dc.init(n,e),ie.init(n,e)});function Ef(n){return Bi(wo,n)}var Vu=b("ZodMAC",(n,e)=>{fc.init(n,e),ie.init(n,e)});function wf(n){return ul(Vu,n)}var Io=b("ZodIPv6",(n,e)=>{mc.init(n,e),ie.init(n,e)});function If(n){return Ji(Io,n)}var To=b("ZodCIDRv4",(n,e)=>{hc.init(n,e),ie.init(n,e)});function Tf(n){return Vi(To,n)}var Ro=b("ZodCIDRv6",(n,e)=>{gc.init(n,e),ie.init(n,e)});function Rf(n){return Gi(Ro,n)}var Po=b("ZodBase64",(n,e)=>{vc.init(n,e),ie.init(n,e)});function Pf(n){return qi(Po,n)}var No=b("ZodBase64URL",(n,e)=>{_c.init(n,e),ie.init(n,e)});function Nf(n){return Ki(No,n)}var zo=b("ZodE164",(n,e)=>{bc.init(n,e),ie.init(n,e)});function zf(n){return Yi(zo,n)}var Do=b("ZodJWT",(n,e)=>{xc.init(n,e),ie.init(n,e)});function Df(n){return Xi(Do,n)}var Pn=b("ZodCustomStringFormat",(n,e)=>{$c.init(n,e),ie.init(n,e)});function Of(n,e,r={}){return En(Pn,n,e,r)}function Af(n){return En(Pn,"hostname",Ce.hostname,n)}function Lf(n){return En(Pn,"hex",Ce.hex,n)}function Cf(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=Ce[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return En(Pn,i,t,e)}var Nn=b("ZodNumber",(n,e)=>{ki.init(n,e),K.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ql(n,i,t,o),n.gt=(i,t)=>n.check(Ye(i,t)),n.gte=(i,t)=>n.check(ke(i,t)),n.min=(i,t)=>n.check(ke(i,t)),n.lt=(i,t)=>n.check(Ke(i,t)),n.lte=(i,t)=>n.check(De(i,t)),n.max=(i,t)=>n.check(De(i,t)),n.int=i=>n.check(go(i)),n.safe=i=>n.check(go(i)),n.positive=i=>n.check(Ye(0,i)),n.nonnegative=i=>n.check(ke(0,i)),n.negative=i=>n.check(Ke(0,i)),n.nonpositive=i=>n.check(De(0,i)),n.multipleOf=(i,t)=>n.check(kt(i,t)),n.step=(i,t)=>n.check(kt(i,t)),n.finite=()=>n;let r=n._zod.bag;n.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),n.isFinite=!0,n.format=r.format??null});function Gu(n){return gl(Nn,n)}var Gt=b("ZodNumberFormat",(n,e)=>{Sc.init(n,e),Nn.init(n,e)});function go(n){return vl(Gt,n)}function jf(n){return _l(Gt,n)}function Mf(n){return bl(Gt,n)}function Uf(n){return xl(Gt,n)}function Ff(n){return $l(Gt,n)}var zn=b("ZodBoolean",(n,e)=>{fr.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Kl(n,r,i,t)});function qu(n){return Sl(zn,n)}var Dn=b("ZodBigInt",(n,e)=>{Ei.init(n,e),K.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Yl(n,i,t,o),n.gte=(i,t)=>n.check(ke(i,t)),n.min=(i,t)=>n.check(ke(i,t)),n.gt=(i,t)=>n.check(Ye(i,t)),n.gte=(i,t)=>n.check(ke(i,t)),n.min=(i,t)=>n.check(ke(i,t)),n.lt=(i,t)=>n.check(Ke(i,t)),n.lte=(i,t)=>n.check(De(i,t)),n.max=(i,t)=>n.check(De(i,t)),n.positive=i=>n.check(Ye(BigInt(0),i)),n.negative=i=>n.check(Ke(BigInt(0),i)),n.nonpositive=i=>n.check(De(BigInt(0),i)),n.nonnegative=i=>n.check(ke(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(kt(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function Zf(n){return El(Dn,n)}var Oo=b("ZodBigIntFormat",(n,e)=>{kc.init(n,e),Dn.init(n,e)});function Hf(n){return Il(Oo,n)}function Wf(n){return Tl(Oo,n)}var Ku=b("ZodSymbol",(n,e)=>{Ec.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Xl(n,r,i,t)});function Bf(n){return Rl(Ku,n)}var Yu=b("ZodUndefined",(n,e)=>{wc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>eu(n,r,i,t)});function Jf(n){return Pl(Yu,n)}var Xu=b("ZodNull",(n,e)=>{Ic.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ql(n,r,i,t)});function Qu(n){return Nl(Xu,n)}var ep=b("ZodAny",(n,e)=>{Tc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ru(n,r,i,t)});function Vf(){return zl(ep)}var tp=b("ZodUnknown",(n,e)=>{Rc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>iu(n,r,i,t)});function Vt(){return Dl(tp)}var np=b("ZodNever",(n,e)=>{Pc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>nu(n,r,i,t)});function Ao(n){return Ol(np,n)}var rp=b("ZodVoid",(n,e)=>{Nc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>tu(n,r,i,t)});function Gf(n){return Al(rp,n)}var Ir=b("ZodDate",(n,e)=>{zc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ou(n,i,t,o),n.min=(i,t)=>n.check(ke(i,t)),n.max=(i,t)=>n.check(De(i,t));let r=n._zod.bag;n.minDate=r.minimum?new Date(r.minimum):null,n.maxDate=r.maximum?new Date(r.maximum):null});function qf(n){return Ll(Ir,n)}var ip=b("ZodArray",(n,e)=>{Dc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>yu(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(pt(r,i)),n.nonempty=r=>n.check(pt(1,r)),n.max=(r,i)=>n.check(Bt(r,i)),n.length=(r,i)=>n.check(Jt(r,i)),n.unwrap=()=>n.element});function Tr(n,e){return Ml(ip,n,e)}function Kf(n){let e=n._zod.def.shape;return Co(Object.keys(e))}var Rr=b("ZodObject",(n,e)=>{Oc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>vu(n,r,i,t),N.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>Co(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:Vt()}),n.loose=()=>n.clone({...n._zod.def,catchall:Vt()}),n.strict=()=>n.clone({...n._zod.def,catchall:Ao()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>N.extend(n,r),n.safeExtend=r=>N.safeExtend(n,r),n.merge=r=>N.merge(n,r),n.pick=r=>N.pick(n,r),n.omit=r=>N.omit(n,r),n.partial=(...r)=>N.partial(Mo,n,r[0]),n.required=(...r)=>N.required(Uo,n,r[0])});function Yf(n,e){let r={type:"object",shape:n??{},...N.normalizeParams(e)};return new Rr(r)}function Xf(n,e){return new Rr({type:"object",shape:n,catchall:Ao(),...N.normalizeParams(e)})}function Qf(n,e){return new Rr({type:"object",shape:n,catchall:Vt(),...N.normalizeParams(e)})}var Pr=b("ZodUnion",(n,e)=>{hr.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>oo(n,r,i,t),n.options=e.options});function Lo(n,e){return new Pr({type:"union",options:n,...N.normalizeParams(e)})}var op=b("ZodXor",(n,e)=>{Pr.init(n,e),Ac.init(n,e),n._zod.processJSONSchema=(r,i,t)=>oo(n,r,i,t),n.options=e.options});function eh(n,e){return new op({type:"union",options:n,inclusive:!1,...N.normalizeParams(e)})}var sp=b("ZodDiscriminatedUnion",(n,e)=>{Pr.init(n,e),Lc.init(n,e)});function th(n,e,r){return new sp({type:"union",options:e,discriminator:n,...N.normalizeParams(r)})}var ap=b("ZodIntersection",(n,e)=>{Cc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>_u(n,r,i,t)});function cp(n,e){return new ap({type:"intersection",left:n,right:e})}var lp=b("ZodTuple",(n,e)=>{wi.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>bu(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function up(n,e,r){let i=e instanceof q,t=i?r:e,o=i?e:null;return new lp({type:"tuple",items:n,rest:o,...N.normalizeParams(t)})}var Nr=b("ZodRecord",(n,e)=>{jc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>xu(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function pp(n,e,r){return new Nr({type:"record",keyType:n,valueType:e,...N.normalizeParams(r)})}function nh(n,e,r){let i=Se(n);return i._zod.values=void 0,new Nr({type:"record",keyType:i,valueType:e,...N.normalizeParams(r)})}function rh(n,e,r){return new Nr({type:"record",keyType:n,valueType:e,mode:"loose",...N.normalizeParams(r)})}var dp=b("ZodMap",(n,e)=>{Mc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>hu(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType,n.min=(...r)=>n.check(Xe(...r)),n.nonempty=r=>n.check(Xe(1,r)),n.max=(...r)=>n.check(Et(...r)),n.size=(...r)=>n.check(Wt(...r))});function ih(n,e,r){return new dp({type:"map",keyType:n,valueType:e,...N.normalizeParams(r)})}var mp=b("ZodSet",(n,e)=>{Uc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>gu(n,r,i,t),n.min=(...r)=>n.check(Xe(...r)),n.nonempty=r=>n.check(Xe(1,r)),n.max=(...r)=>n.check(Et(...r)),n.size=(...r)=>n.check(Wt(...r))});function oh(n,e){return new mp({type:"set",valueType:n,...N.normalizeParams(e)})}var Tn=b("ZodEnum",(n,e)=>{Fc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(i,t,o)=>su(n,i,t,o),n.enum=e.entries,n.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));n.extract=(i,t)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Tn({...e,checks:[],...N.normalizeParams(t),entries:o})},n.exclude=(i,t)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Tn({...e,checks:[],...N.normalizeParams(t),entries:o})}});function Co(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new Tn({type:"enum",entries:r,...N.normalizeParams(e)})}function sh(n,e){return new Tn({type:"enum",entries:n,...N.normalizeParams(e)})}var fp=b("ZodLiteral",(n,e)=>{Zc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>au(n,r,i,t),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function ah(n,e){return new fp({type:"literal",values:Array.isArray(n)?n:[n],...N.normalizeParams(e)})}var hp=b("ZodFile",(n,e)=>{Hc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>uu(n,r,i,t),n.min=(r,i)=>n.check(Xe(r,i)),n.max=(r,i)=>n.check(Et(r,i)),n.mime=(r,i)=>n.check(_n(Array.isArray(r)?r:[r],i))});function ch(n){return Ul(hp,n)}var gp=b("ZodTransform",(n,e)=>{Wc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>fu(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new _t(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(N.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),r.issues.push(N.issue(s))}};let t=e.transform(r.value,r);return t instanceof Promise?t.then(o=>(r.value=o,r)):(r.value=t,r)}});function jo(n){return new gp({type:"transform",transform:n})}var Mo=b("ZodOptional",(n,e)=>{Ii.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>so(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Sr(n){return new Mo({type:"optional",innerType:n})}var yp=b("ZodExactOptional",(n,e)=>{Bc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>so(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function vp(n){return new yp({type:"optional",innerType:n})}var _p=b("ZodNullable",(n,e)=>{Jc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>$u(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function kr(n){return new _p({type:"nullable",innerType:n})}function lh(n){return Sr(kr(n))}var bp=b("ZodDefault",(n,e)=>{Vc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ku(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function xp(n,e){return new bp({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}var $p=b("ZodPrefault",(n,e)=>{Gc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Eu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Sp(n,e){return new $p({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}var Uo=b("ZodNonOptional",(n,e)=>{qc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Su(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function kp(n,e){return new Uo({type:"nonoptional",innerType:n,...N.normalizeParams(e)})}var Ep=b("ZodSuccess",(n,e)=>{Kc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>pu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function uh(n){return new Ep({type:"success",innerType:n})}var wp=b("ZodCatch",(n,e)=>{Yc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Ip(n,e){return new wp({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var Tp=b("ZodNaN",(n,e)=>{Xc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>cu(n,r,i,t)});function ph(n){return jl(Tp,n)}var Fo=b("ZodPipe",(n,e)=>{Qc.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Iu(n,r,i,t),n.in=e.in,n.out=e.out});function Er(n,e){return new Fo({type:"pipe",in:n,out:e})}var Zo=b("ZodCodec",(n,e)=>{Fo.init(n,e),gr.init(n,e)});function dh(n,e,r){return new Zo({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var Rp=b("ZodReadonly",(n,e)=>{el.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Tu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Pp(n){return new Rp({type:"readonly",innerType:n})}var Np=b("ZodTemplateLiteral",(n,e)=>{tl.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>lu(n,r,i,t)});function mh(n,e){return new Np({type:"template_literal",parts:n,...N.normalizeParams(e)})}var zp=b("ZodLazy",(n,e)=>{il.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Pu(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function Dp(n){return new zp({type:"lazy",getter:n})}var Op=b("ZodPromise",(n,e)=>{rl.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ru(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function fh(n){return new Op({type:"promise",innerType:n})}var Ap=b("ZodFunction",(n,e)=>{nl.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>mu(n,r,i,t)});function hh(n){return new Ap({type:"function",input:Array.isArray(n?.input)?up(n?.input):n?.input??Tr(Vt()),output:n?.output??Vt()})}var zr=b("ZodCustom",(n,e)=>{ol.init(n,e),K.init(n,e),n._zod.processJSONSchema=(r,i,t)=>du(n,r,i,t)});function gh(n){let e=new oe({check:"custom"});return e._zod.check=n,e}function yh(n,e){return Fl(zr,n??(()=>!0),e)}function Lp(n,e={}){return Zl(zr,n,e)}function Cp(n){return Hl(n)}var vh=Wl,_h=Bl;function bh(n,e={}){let r=new zr({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...N.normalizeParams(e)});return r._zod.bag.Class=n,r._zod.check=i=>{i.value instanceof n||i.issues.push({code:"invalid_type",expected:n.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var xh=(...n)=>Jl({Codec:Zo,Boolean:zn,String:Rn},...n);function $h(n){let e=Dp(()=>Lo([ho(n),Gu(),qu(),Qu(),Tr(e),pp(ho(),e)]));return e}function Sh(n,e){return Er(jo(n),e)}var Ax={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 Lx(n){pe({customError:n})}function Cx(){return pe().customError}var jp;jp||(jp={});var M={...xr,...lo,iso:In},jx=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Mx(n,e){let r=n.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function Ux(n,e){if(!n.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=n.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let t=r[1];if(!t||!e.defs[t])throw new Error(`Reference not found: ${n}`);return e.defs[t]}throw new Error(`Reference not found: ${n}`)}function kh(n,e){if(n.not!==void 0){if(typeof n.not=="object"&&Object.keys(n.not).length===0)return M.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(n.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(n.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(n.if!==void 0||n.then!==void 0||n.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(n.dependentSchemas!==void 0||n.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(n.$ref){let t=n.$ref;if(e.refs.has(t))return e.refs.get(t);if(e.processing.has(t))return M.lazy(()=>{if(!e.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return e.refs.get(t)});e.processing.add(t);let o=Ux(t,e),s=$e(o,e);return e.refs.set(t,s),e.processing.delete(t),s}if(n.enum!==void 0){let t=n.enum;if(e.version==="openapi-3.0"&&n.nullable===!0&&t.length===1&&t[0]===null)return M.null();if(t.length===0)return M.never();if(t.length===1)return M.literal(t[0]);if(t.every(s=>typeof s=="string"))return M.enum(t);let o=t.map(s=>M.literal(s));return o.length<2?o[0]:M.union([o[0],o[1],...o.slice(2)])}if(n.const!==void 0)return M.literal(n.const);let r=n.type;if(Array.isArray(r)){let t=r.map(o=>{let s={...n,type:o};return kh(s,e)});return t.length===0?M.never():t.length===1?t[0]:M.union(t)}if(!r)return M.any();let i;switch(r){case"string":{let t=M.string();if(n.format){let o=n.format;o==="email"?t=t.check(M.email()):o==="uri"||o==="uri-reference"?t=t.check(M.url()):o==="uuid"||o==="guid"?t=t.check(M.uuid()):o==="date-time"?t=t.check(M.iso.datetime()):o==="date"?t=t.check(M.iso.date()):o==="time"?t=t.check(M.iso.time()):o==="duration"?t=t.check(M.iso.duration()):o==="ipv4"?t=t.check(M.ipv4()):o==="ipv6"?t=t.check(M.ipv6()):o==="mac"?t=t.check(M.mac()):o==="cidr"?t=t.check(M.cidrv4()):o==="cidr-v6"?t=t.check(M.cidrv6()):o==="base64"?t=t.check(M.base64()):o==="base64url"?t=t.check(M.base64url()):o==="e164"?t=t.check(M.e164()):o==="jwt"?t=t.check(M.jwt()):o==="emoji"?t=t.check(M.emoji()):o==="nanoid"?t=t.check(M.nanoid()):o==="cuid"?t=t.check(M.cuid()):o==="cuid2"?t=t.check(M.cuid2()):o==="ulid"?t=t.check(M.ulid()):o==="xid"?t=t.check(M.xid()):o==="ksuid"&&(t=t.check(M.ksuid()))}typeof n.minLength=="number"&&(t=t.min(n.minLength)),typeof n.maxLength=="number"&&(t=t.max(n.maxLength)),n.pattern&&(t=t.regex(new RegExp(n.pattern))),i=t;break}case"number":case"integer":{let t=r==="integer"?M.number().int():M.number();typeof n.minimum=="number"&&(t=t.min(n.minimum)),typeof n.maximum=="number"&&(t=t.max(n.maximum)),typeof n.exclusiveMinimum=="number"?t=t.gt(n.exclusiveMinimum):n.exclusiveMinimum===!0&&typeof n.minimum=="number"&&(t=t.gt(n.minimum)),typeof n.exclusiveMaximum=="number"?t=t.lt(n.exclusiveMaximum):n.exclusiveMaximum===!0&&typeof n.maximum=="number"&&(t=t.lt(n.maximum)),typeof n.multipleOf=="number"&&(t=t.multipleOf(n.multipleOf)),i=t;break}case"boolean":{i=M.boolean();break}case"null":{i=M.null();break}case"object":{let t={},o=n.properties||{},s=new Set(n.required||[]);for(let[c,l]of Object.entries(o)){let u=$e(l,e);t[c]=s.has(c)?u:u.optional()}if(n.propertyNames){let c=$e(n.propertyNames,e),l=n.additionalProperties&&typeof n.additionalProperties=="object"?$e(n.additionalProperties,e):M.any();if(Object.keys(t).length===0){i=M.record(c,l);break}let u=M.object(t).passthrough(),p=M.looseRecord(c,l);i=M.intersection(u,p);break}if(n.patternProperties){let c=n.patternProperties,l=Object.keys(c),u=[];for(let d of l){let m=$e(c[d],e),f=M.string().regex(new RegExp(d));u.push(M.looseRecord(f,m))}let p=[];if(Object.keys(t).length>0&&p.push(M.object(t).passthrough()),p.push(...u),p.length===0)i=M.object({}).passthrough();else if(p.length===1)i=p[0];else{let d=M.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)d=M.intersection(d,p[m]);i=d}break}let a=M.object(t);n.additionalProperties===!1?i=a.strict():typeof n.additionalProperties=="object"?i=a.catchall($e(n.additionalProperties,e)):i=a.passthrough();break}case"array":{let t=n.prefixItems,o=n.items;if(t&&Array.isArray(t)){let s=t.map(c=>$e(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?$e(o,e):void 0;a?i=M.tuple(s).rest(a):i=M.tuple(s),typeof n.minItems=="number"&&(i=i.check(M.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(M.maxLength(n.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>$e(c,e)),a=n.additionalItems&&typeof n.additionalItems=="object"?$e(n.additionalItems,e):void 0;a?i=M.tuple(s).rest(a):i=M.tuple(s),typeof n.minItems=="number"&&(i=i.check(M.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(M.maxLength(n.maxItems)))}else if(o!==void 0){let s=$e(o,e),a=M.array(s);typeof n.minItems=="number"&&(a=a.min(n.minItems)),typeof n.maxItems=="number"&&(a=a.max(n.maxItems)),i=a}else i=M.array(M.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n.description&&(i=i.describe(n.description)),n.default!==void 0&&(i=i.default(n.default)),i}function $e(n,e){if(typeof n=="boolean")return n?M.any():M.never();let r=kh(n,e),i=n.type||n.enum!==void 0||n.const!==void 0;if(n.anyOf&&Array.isArray(n.anyOf)){let a=n.anyOf.map(l=>$e(l,e)),c=M.union(a);r=i?M.intersection(r,c):c}if(n.oneOf&&Array.isArray(n.oneOf)){let a=n.oneOf.map(l=>$e(l,e)),c=M.xor(a);r=i?M.intersection(r,c):c}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)r=i?r:M.any();else{let a=i?r:$e(n.allOf[0],e),c=i?0:1;for(let l=c;l<n.allOf.length;l++)a=M.intersection(a,$e(n.allOf[l],e));r=a}n.nullable===!0&&e.version==="openapi-3.0"&&(r=M.nullable(r)),n.readOnly===!0&&(r=M.readonly(r));let t={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in n&&(t[a]=n[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in n&&(t[a]=n[a]);for(let a of Object.keys(n))jx.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function Eh(n,e){if(typeof n=="boolean")return n?M.any():M.never();let r=Mx(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??be};return $e(n,t)}var Mp={};Ue(Mp,{bigint:()=>Wx,boolean:()=>Hx,date:()=>Bx,number:()=>Zx,string:()=>Fx});function Fx(n){return ll(Rn,n)}function Zx(n){return yl(Nn,n)}function Hx(n){return kl(zn,n)}function Wx(n){return wl(Dn,n)}function Bx(n){return Cl(Ir,n)}pe(Ti());var Ho=["**/node_modules/**","**/.git/**","**/dist/**","**/build/**","**/vendor/**","**/.next/**","**/.cache/**","**/coverage/**","**/*.min.js"],wh=["**/*.{ts,tsx,yaml,yml,php,py,go}","**/*.prisma","**/*.{graphql,gql}","**/Dockerfile*","**/.env*","**/package.json","**/lerna.json","**/turbo.json","**/pnpm-workspace.yaml"],ve={MAX_DEPTH:10,MIN_DEPTH:1,MAX_LIMIT:500,MIN_LIMIT:1,MAX_QUERY_LENGTH:500,DEFAULT_DEPTH:3,DEFAULT_LIMIT:10},Re={FILTERED_QUERY_LIMIT_MULTIPLIER:3,SCORE_BASE:1e3,EXACT_MATCH_BONUS:500,RECENT_FILE_BOOST:80,OLDER_FILE_BOOST:30,RECENT_FILE_THRESHOLD_DAYS:7,OLDER_FILE_THRESHOLD_DAYS:30,FUZZY_MATCH_LIMIT:30,ENABLE_LEXICAL_SCORING:process.env.ENABLE_LEXICAL_SCORING!=="false",LEXICAL_WEIGHT:parseFloat(process.env.LEXICAL_WEIGHT??String(.4)),GRAVITY_STRUCTURAL_WEIGHT:.5},Up={SECONDS_PER_DAY:86400,SECONDS_PER_YEAR:31536e3},Wo={DEFAULT_CONCURRENCY:parseInt(process.env.INDEX_CONCURRENCY??String(5),10)};var iI=y.object({repoPath:y.string(),mode:y.enum(["init","tree","topography","scout","hologram","tools"]),subPath:y.string().optional(),maxDepth:y.number().int().min(ve.MIN_DEPTH).max(ve.MAX_DEPTH).optional()}),oI=y.object({repoPath:y.string(),mode:y.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:y.string().max(ve.MAX_QUERY_LENGTH).optional(),key:y.string().optional(),kind:y.enum(["Service","Image","Port","Env"]).optional(),limit:y.number().int().min(ve.MIN_LIMIT).max(ve.MAX_LIMIT).optional(),offset:y.number().int().min(0).optional(),skipSync:y.boolean().optional(),compact:y.boolean().optional()}).refine(n=>!(n.mode==="concept"&&(!n.query||n.query.trim().length===0)),{message:"Concept search requires a non-empty query",path:["query"]}),sI=y.object({repoPath:y.string(),mode:y.enum(["symbol","file"]),filePath:y.string().optional(),detailLevel:y.enum(["structure","signatures","summaries","detailed"]).optional(),symbolName:y.string().optional(),context:y.enum(["definition","full"]).optional()}),aI=y.object({repoPath:y.string(),mode:y.enum(["impact","deps","flow","dead-code","circular-deps"]),filePath:y.string().optional(),symbolName:y.string().optional(),direction:y.enum(["imports","imported_by"]).optional(),depth:y.number().int().min(ve.MIN_DEPTH).max(ve.MAX_DEPTH).optional(),limit:y.number().int().min(ve.MIN_LIMIT).max(ve.MAX_LIMIT).optional(),includeTests:y.boolean().optional()}),cI=y.object({repoPath:y.string(),action:y.enum(["index","repair","trace"]),deep:y.boolean().optional(),sinceCommit:y.string().optional()}),lI=y.object({repoPath:y.string(),action:y.enum(["install","remove","status"]),enableAutoRefresh:y.boolean().optional(),enableSymbolHealing:y.boolean().optional()}),uI=y.object({action:y.enum(["list","link","fuse"]),repoPaths:y.array(y.string()).optional(),name:y.string().optional(),status:y.string().optional(),parentRepoPath:y.string().optional(),parentMissionId:y.number().optional(),childRepoPath:y.string().optional(),childMissionId:y.number().optional(),relationship:y.string().optional()});var Ih=[];var Th=[...Od,...Ad];import Ae from"path";import Jp from"fs";J();import ge from"path";import Fp from"fs";var Bo=$.child({module:"path-resolver"}),On=class{repoPath;constructor(e){this.repoPath=ge.isAbsolute(e)?ge.normalize(e):ge.resolve(process.cwd(),e)}resolve(e){if(!e)return this.repoPath;if(e.includes("\0"))throw Bo.error({inputPath:e},"Path contains null bytes - possible attack"),new Error("Invalid path: contains null bytes");let r;if(ge.isAbsolute(e)?r=ge.normalize(e):r=ge.join(this.repoPath,e),r=ge.normalize(r),!this.isWithinRoot(r))throw Bo.warn({inputPath:e,resolved:r},"Path traversal attempt blocked"),new Error(`Access denied: path '${e}' is outside the repository root`);return r}resolveAndValidate(e){try{let r=this.resolve(e);return Fp.existsSync(r)?r:(Bo.debug({inputPath:e,resolved:r},"Path does not exist"),null)}catch(r){return Bo.error({inputPath:e,error:r},"Error validating path"),null}}isWithinRoot(e){try{let r=ge.resolve(e),i=ge.resolve(this.repoPath),t=ge.relative(i,r);if(t.startsWith("..")||ge.isAbsolute(t))return!1;if(Fp.existsSync(r)){let s=Fp.realpathSync(r),a=ge.relative(i,s);if(a.startsWith("..")||ge.isAbsolute(a))return!1}return!0}catch{return!1}}getRelative(e){let r=ge.normalize(e);return ge.relative(this.repoPath,r)}resolveBatch(e){return e.map(r=>this.resolve(r))}static normalize(e){return ge.normalize(e)}static isPathWithinRoot(e,r){let i=ge.resolve(e),t=ge.resolve(r),o=ge.relative(i,t);return o===""||!o.startsWith("..")&&!ge.isAbsolute(o)}};function Rh(n){return new On(n)}var qx=/[\x00-\x1f\x7f]/g,Kx=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function An(n){if(typeof n!="string")throw new Error("Invalid path: expected string");if(n.includes("\0"))throw new Error("Invalid path: null bytes are not allowed");if(n.replace(qx,"").length!==n.length)throw new Error("Invalid path: control characters are not allowed");return n.trim()}function Ln(n,e=4096){if(typeof n!="string")return"";let r=n.replace(Kx,"").trim();return r.length>e?r.slice(0,e):r}qt();var Ar=`
473
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of n.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(n.external){let l=n.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(n.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&n.reused==="ref"){o(s);continue}}}function Pt(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let a=n.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){i(u);let d=n.seen.get(u),m=d.schema;if(m.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),s._zod.parent===u)for(let h in c)h==="$ref"||h==="allOf"||h in l||delete c[h];if(m.$ref)for(let h in c)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(c[h])===JSON.stringify(d.def[h])&&delete c[h]}let p=s._zod.parent;if(p&&p!==u){i(p);let d=n.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(let m in c)m==="$ref"||m==="allOf"||m in d.def&&JSON.stringify(c[m])===JSON.stringify(d.def[m])&&delete c[m]}n.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...n.seen.entries()].reverse())i(s[0]);let t={};if(n.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){let s=n.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");t.$id=n.external.uri(s)}Object.assign(t,r.def??r.schema);let o=n.external?.defs??{};for(let s of n.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?t.$defs=o:t.definitions=o);try{let s=JSON.parse(JSON.stringify(t));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:zn(e,"input",n.processors),output:zn(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ke(n,e){let r=e??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);let i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ke(i.element,r);if(i.type==="set")return ke(i.valueType,r);if(i.type==="lazy")return ke(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ke(i.innerType,r);if(i.type==="intersection")return ke(i.left,r)||ke(i.right,r);if(i.type==="record"||i.type==="map")return ke(i.keyType,r)||ke(i.valueType,r);if(i.type==="pipe")return ke(i.in,r)||ke(i.out,r);if(i.type==="object"){for(let t in i.shape)if(ke(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(ke(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(ke(t,r))return!0;return!!(i.rest&&ke(i.rest,r))}return!1}var iu=(n,e={})=>r=>{let i=Tt({...r,processors:e});return ie(n,i),Rt(i,n),Pt(i,n)},zn=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=Tt({...t??{},target:o,io:e,processors:r});return ie(n,s),Rt(s,n),Pt(s,n)};var Yx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ou=(n,e,r,i)=>{let t=r;t.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=n._zod.bag;if(typeof o=="number"&&(t.minLength=o),typeof s=="number"&&(t.maxLength=s),a&&(t.format=Yx[a]??a,t.format===""&&delete t.format,a==="time"&&delete t.format),l&&(t.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?t.pattern=u[0].source:u.length>1&&(t.allOf=[...u.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},su=(n,e,r,i)=>{let t=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=n._zod.bag;typeof a=="string"&&a.includes("int")?t.type="integer":t.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.minimum=u,t.exclusiveMinimum=!0):t.exclusiveMinimum=u),typeof o=="number"&&(t.minimum=o,typeof u=="number"&&e.target!=="draft-04"&&(u>=o?delete t.minimum:delete t.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.maximum=l,t.exclusiveMaximum=!0):t.exclusiveMaximum=l),typeof s=="number"&&(t.maximum=s,typeof l=="number"&&e.target!=="draft-04"&&(l<=s?delete t.maximum:delete t.exclusiveMaximum)),typeof c=="number"&&(t.multipleOf=c)},au=(n,e,r,i)=>{r.type="boolean"},cu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},lu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},uu=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},pu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},du=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},mu=(n,e,r,i)=>{r.not={}},fu=(n,e,r,i)=>{},hu=(n,e,r,i)=>{},gu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},yu=(n,e,r,i)=>{let t=n._zod.def,o=lr(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},vu=(n,e,r,i)=>{let t=n._zod.def,o=[];for(let s of t.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},_u=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},bu=(n,e,r,i)=>{let t=r,o=n._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=o.source},xu=(n,e,r,i)=>{let t=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=n._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(t,o)):(Object.assign(t,o),t.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(t,o)},$u=(n,e,r,i)=>{r.type="boolean"},Su=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ku=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Eu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},wu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Iu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Tu=(n,e,r,i)=>{let t=r,o=n._zod.def,{minimum:s,maximum:a}=n._zod.bag;typeof s=="number"&&(t.minItems=s),typeof a=="number"&&(t.maxItems=a),t.type="array",t.items=ie(o.element,e,{...i,path:[...i.path,"items"]})},Ru=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object",t.properties={};let s=o.shape;for(let l in s)t.properties[l]=ie(s[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(t.required=Array.from(c)),o.catchall?._zod.def.type==="never"?t.additionalProperties=!1:o.catchall?o.catchall&&(t.additionalProperties=ie(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},ho=(n,e,r,i)=>{let t=n._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>ie(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},Pu=(n,e,r,i)=>{let t=n._zod.def,o=ie(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=ie(t.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},Nu=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((d,m)=>ie(d,e,{...i,path:[...i.path,s,m]})),l=o.rest?ie(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(t.prefixItems=c,l&&(t.items=l)):e.target==="openapi-3.0"?(t.items={anyOf:c},l&&t.items.anyOf.push(l),t.minItems=c.length,l||(t.maxItems=c.length)):(t.items=c,l&&(t.additionalItems=l));let{minimum:u,maximum:p}=n._zod.bag;typeof u=="number"&&(t.minItems=u),typeof p=="number"&&(t.maxItems=p)},zu=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=ie(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});t.patternProperties={};for(let p of c)t.patternProperties[p.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(t.propertyNames=ie(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=ie(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(t.required=u)}},Du=(n,e,r,i)=>{let t=n._zod.def,o=ie(t.innerType,e,i),s=e.seen.get(n);e.target==="openapi-3.0"?(s.ref=t.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Ou=(n,e,r,i)=>{let t=n._zod.def;ie(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Lu=(n,e,r,i)=>{let t=n._zod.def;ie(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.default=JSON.parse(JSON.stringify(t.defaultValue))},Au=(n,e,r,i)=>{let t=n._zod.def;ie(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(t.defaultValue)))},Cu=(n,e,r,i)=>{let t=n._zod.def;ie(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType;let s;try{s=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},ju=(n,e,r,i)=>{let t=n._zod.def,o=e.io==="input"?t.in._zod.def.type==="transform"?t.out:t.in:t.out;ie(o,e,i);let s=e.seen.get(n);s.ref=o},Mu=(n,e,r,i)=>{let t=n._zod.def;ie(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.readOnly=!0},Uu=(n,e,r,i)=>{let t=n._zod.def;ie(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},go=(n,e,r,i)=>{let t=n._zod.def;ie(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Fu=(n,e,r,i)=>{let t=n._zod.innerType;ie(t,e,i);let o=e.seen.get(n);o.ref=t},fo={string:ou,number:su,boolean:au,bigint:cu,symbol:lu,null:uu,undefined:pu,void:du,never:mu,any:fu,unknown:hu,date:gu,enum:yu,literal:vu,nan:_u,template_literal:bu,file:xu,success:$u,custom:Su,function:ku,transform:Eu,map:wu,set:Iu,array:Tu,object:Ru,union:ho,intersection:Pu,tuple:Nu,record:zu,nullable:Du,nonoptional:Ou,default:Lu,prefault:Au,catch:Cu,pipe:ju,readonly:Mu,promise:Uu,optional:go,lazy:Fu};function yo(n,e){if("_idmap"in n){let i=n,t=Tt({...e,processors:fo}),o={};for(let c of i._idmap.entries()){let[l,u]=c;ie(u,t)}let s={},a={registry:i,uri:e?.uri,defs:o};t.external=a;for(let c of i._idmap.entries()){let[l,u]=c;Rt(t,u),s[l]=Pt(t,u)}if(Object.keys(o).length>0){let c=t.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Tt({...e,processors:fo});return ie(n,r),Rt(r,n),Pt(r,n)}var vo=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Tt({processors:fo,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return ie(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Rt(this.ctx,e);let i=Pt(this.ctx,e),{"~standard":t,...o}=i;return o}};var gf={};var Ir={};Ae(Ir,{ZodAny:()=>pp,ZodArray:()=>hp,ZodBase64:()=>Mo,ZodBase64URL:()=>Uo,ZodBigInt:()=>Mn,ZodBigIntFormat:()=>Wo,ZodBoolean:()=>jn,ZodCIDRv4:()=>Co,ZodCIDRv6:()=>jo,ZodCUID:()=>Po,ZodCUID2:()=>No,ZodCatch:()=>Cp,ZodCodec:()=>Yo,ZodCustom:()=>jr,ZodCustomStringFormat:()=>An,ZodDate:()=>Dr,ZodDefault:()=>Np,ZodDiscriminatedUnion:()=>yp,ZodE164:()=>Fo,ZodEmail:()=>Io,ZodEmoji:()=>To,ZodEnum:()=>On,ZodExactOptional:()=>Tp,ZodFile:()=>wp,ZodFunction:()=>Jp,ZodGUID:()=>Tr,ZodIPv4:()=>Lo,ZodIPv6:()=>Ao,ZodIntersection:()=>vp,ZodJWT:()=>Zo,ZodKSUID:()=>Oo,ZodLazy:()=>Wp,ZodLiteral:()=>Ep,ZodMAC:()=>ip,ZodMap:()=>Sp,ZodNaN:()=>Mp,ZodNanoID:()=>Ro,ZodNever:()=>mp,ZodNonOptional:()=>qo,ZodNull:()=>lp,ZodNullable:()=>Pp,ZodNumber:()=>Cn,ZodNumberFormat:()=>qt,ZodObject:()=>Lr,ZodOptional:()=>Vo,ZodPipe:()=>Ko,ZodPrefault:()=>Dp,ZodPromise:()=>Bp,ZodReadonly:()=>Up,ZodRecord:()=>Cr,ZodSet:()=>kp,ZodString:()=>Ln,ZodStringFormat:()=>ae,ZodSuccess:()=>Ap,ZodSymbol:()=>ap,ZodTemplateLiteral:()=>Zp,ZodTransform:()=>Ip,ZodTuple:()=>bp,ZodType:()=>X,ZodULID:()=>zo,ZodURL:()=>zr,ZodUUID:()=>nt,ZodUndefined:()=>cp,ZodUnion:()=>Ar,ZodUnknown:()=>dp,ZodVoid:()=>fp,ZodXID:()=>Do,ZodXor:()=>gp,_ZodString:()=>wo,_default:()=>zp,_function:()=>Sh,any:()=>th,array:()=>Or,base64:()=>jf,base64url:()=>Mf,bigint:()=>Kf,boolean:()=>sp,catch:()=>jp,check:()=>kh,cidrv4:()=>Af,cidrv6:()=>Cf,codec:()=>bh,cuid:()=>Tf,cuid2:()=>Rf,custom:()=>Eh,date:()=>rh,describe:()=>wh,discriminatedUnion:()=>lh,e164:()=>Uf,email:()=>vf,emoji:()=>wf,enum:()=>Jo,exactOptional:()=>Rp,file:()=>gh,float32:()=>Jf,float64:()=>Gf,function:()=>Sh,guid:()=>_f,hash:()=>Bf,hex:()=>Hf,hostname:()=>Wf,httpUrl:()=>Ef,instanceof:()=>Th,int:()=>Eo,int32:()=>Vf,int64:()=>Yf,intersection:()=>_p,ipv4:()=>Df,ipv6:()=>Lf,json:()=>Ph,jwt:()=>Ff,keyof:()=>ih,ksuid:()=>zf,lazy:()=>Hp,literal:()=>hh,looseObject:()=>ah,looseRecord:()=>ph,mac:()=>Of,map:()=>dh,meta:()=>Ih,nan:()=>_h,nanoid:()=>If,nativeEnum:()=>fh,never:()=>Ho,nonoptional:()=>Lp,null:()=>up,nullable:()=>Pr,nullish:()=>yh,number:()=>op,object:()=>oh,optional:()=>Rr,partialRecord:()=>uh,pipe:()=>Nr,prefault:()=>Op,preprocess:()=>Nh,promise:()=>$h,readonly:()=>Fp,record:()=>$p,refine:()=>Gp,set:()=>mh,strictObject:()=>sh,string:()=>ko,stringFormat:()=>Zf,stringbool:()=>Rh,success:()=>vh,superRefine:()=>Vp,symbol:()=>Qf,templateLiteral:()=>xh,transform:()=>Go,tuple:()=>xp,uint32:()=>qf,uint64:()=>Xf,ulid:()=>Pf,undefined:()=>eh,union:()=>Bo,unknown:()=>Vt,url:()=>kf,uuid:()=>bf,uuidv4:()=>xf,uuidv6:()=>$f,uuidv7:()=>Sf,void:()=>nh,xid:()=>Nf,xor:()=>ch});var _o={};Ae(_o,{endsWith:()=>kn,gt:()=>et,gte:()=>Se,includes:()=>$n,length:()=>Gt,lowercase:()=>bn,lt:()=>Qe,lte:()=>De,maxLength:()=>Jt,maxSize:()=>It,mime:()=>En,minLength:()=>dt,minSize:()=>tt,multipleOf:()=>wt,negative:()=>lo,nonnegative:()=>po,nonpositive:()=>uo,normalize:()=>wn,overwrite:()=>We,positive:()=>co,property:()=>mo,regex:()=>_n,size:()=>Bt,slugify:()=>Pn,startsWith:()=>Sn,toLowerCase:()=>Tn,toUpperCase:()=>Rn,trim:()=>In,uppercase:()=>xn});var Dn={};Ae(Dn,{ZodISODate:()=>xo,ZodISODateTime:()=>bo,ZodISODuration:()=>So,ZodISOTime:()=>$o,date:()=>Wu,datetime:()=>Zu,duration:()=>Bu,time:()=>Hu});var bo=$("ZodISODateTime",(n,e)=>{_c.init(n,e),ae.init(n,e)});function Zu(n){return Sl(bo,n)}var xo=$("ZodISODate",(n,e)=>{bc.init(n,e),ae.init(n,e)});function Wu(n){return kl(xo,n)}var $o=$("ZodISOTime",(n,e)=>{xc.init(n,e),ae.init(n,e)});function Hu(n){return El($o,n)}var So=$("ZodISODuration",(n,e)=>{$c.init(n,e),ae.init(n,e)});function Bu(n){return wl(So,n)}var yf=(n,e)=>{fr.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>gr(n,r)},flatten:{value:r=>hr(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,un,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,un,2)}},isEmpty:{get(){return n.issues.length===0}}})},Qx=$("ZodError",yf),Te=$("ZodError",yf,{Parent:Error});var Ju=mn(Te),Gu=fn(Te),Vu=hn(Te),qu=gn(Te),Ku=gi(Te),Yu=yi(Te),Xu=vi(Te),Qu=_i(Te),ep=bi(Te),tp=xi(Te),np=$i(Te),rp=Si(Te);var X=$("ZodType",(n,e)=>(Y.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:zn(n,"input"),output:zn(n,"output")}}),n.toJSONSchema=iu(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(z.mergeDefs(e,{checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),n.with=n.check,n.clone=(r,i)=>$e(n,r,i),n.brand=()=>n,n.register=((r,i)=>(r.add(n,i),n)),n.parse=(r,i)=>Ju(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>Vu(n,r,i),n.parseAsync=async(r,i)=>Gu(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>qu(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>Ku(n,r,i),n.decode=(r,i)=>Yu(n,r,i),n.encodeAsync=async(r,i)=>Xu(n,r,i),n.decodeAsync=async(r,i)=>Qu(n,r,i),n.safeEncode=(r,i)=>ep(n,r,i),n.safeDecode=(r,i)=>tp(n,r,i),n.safeEncodeAsync=async(r,i)=>np(n,r,i),n.safeDecodeAsync=async(r,i)=>rp(n,r,i),n.refine=(r,i)=>n.check(Gp(r,i)),n.superRefine=r=>n.check(Vp(r)),n.overwrite=r=>n.check(We(r)),n.optional=()=>Rr(n),n.exactOptional=()=>Rp(n),n.nullable=()=>Pr(n),n.nullish=()=>Rr(Pr(n)),n.nonoptional=r=>Lp(n,r),n.array=()=>Or(n),n.or=r=>Bo([n,r]),n.and=r=>_p(n,r),n.transform=r=>Nr(n,Go(r)),n.default=r=>zp(n,r),n.prefault=r=>Op(n,r),n.catch=r=>jp(n,r),n.pipe=r=>Nr(n,r),n.readonly=()=>Fp(n),n.describe=r=>{let i=n.clone();return be.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return be.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return be.get(n);let i=n.clone();return be.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),wo=$("_ZodString",(n,e)=>{Ht.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ou(n,i,t,o);let r=n._zod.bag;n.format=r.format??null,n.minLength=r.minimum??null,n.maxLength=r.maximum??null,n.regex=(...i)=>n.check(_n(...i)),n.includes=(...i)=>n.check($n(...i)),n.startsWith=(...i)=>n.check(Sn(...i)),n.endsWith=(...i)=>n.check(kn(...i)),n.min=(...i)=>n.check(dt(...i)),n.max=(...i)=>n.check(Jt(...i)),n.length=(...i)=>n.check(Gt(...i)),n.nonempty=(...i)=>n.check(dt(1,...i)),n.lowercase=i=>n.check(bn(i)),n.uppercase=i=>n.check(xn(i)),n.trim=()=>n.check(In()),n.normalize=(...i)=>n.check(wn(...i)),n.toLowerCase=()=>n.check(Tn()),n.toUpperCase=()=>n.check(Rn()),n.slugify=()=>n.check(Pn())}),Ln=$("ZodString",(n,e)=>{Ht.init(n,e),wo.init(n,e),n.email=r=>n.check(Zi(Io,r)),n.url=r=>n.check(wr(zr,r)),n.jwt=r=>n.check(ao(Zo,r)),n.emoji=r=>n.check(Gi(To,r)),n.guid=r=>n.check(Er(Tr,r)),n.uuid=r=>n.check(Wi(nt,r)),n.uuidv4=r=>n.check(Hi(nt,r)),n.uuidv6=r=>n.check(Bi(nt,r)),n.uuidv7=r=>n.check(Ji(nt,r)),n.nanoid=r=>n.check(Vi(Ro,r)),n.guid=r=>n.check(Er(Tr,r)),n.cuid=r=>n.check(qi(Po,r)),n.cuid2=r=>n.check(Ki(No,r)),n.ulid=r=>n.check(Yi(zo,r)),n.base64=r=>n.check(io(Mo,r)),n.base64url=r=>n.check(oo(Uo,r)),n.xid=r=>n.check(Xi(Do,r)),n.ksuid=r=>n.check(Qi(Oo,r)),n.ipv4=r=>n.check(eo(Lo,r)),n.ipv6=r=>n.check(to(Ao,r)),n.cidrv4=r=>n.check(no(Co,r)),n.cidrv6=r=>n.check(ro(jo,r)),n.e164=r=>n.check(so(Fo,r)),n.datetime=r=>n.check(Zu(r)),n.date=r=>n.check(Wu(r)),n.time=r=>n.check(Hu(r)),n.duration=r=>n.check(Bu(r))});function ko(n){return _l(Ln,n)}var ae=$("ZodStringFormat",(n,e)=>{se.init(n,e),wo.init(n,e)}),Io=$("ZodEmail",(n,e)=>{uc.init(n,e),ae.init(n,e)});function vf(n){return Zi(Io,n)}var Tr=$("ZodGUID",(n,e)=>{cc.init(n,e),ae.init(n,e)});function _f(n){return Er(Tr,n)}var nt=$("ZodUUID",(n,e)=>{lc.init(n,e),ae.init(n,e)});function bf(n){return Wi(nt,n)}function xf(n){return Hi(nt,n)}function $f(n){return Bi(nt,n)}function Sf(n){return Ji(nt,n)}var zr=$("ZodURL",(n,e)=>{pc.init(n,e),ae.init(n,e)});function kf(n){return wr(zr,n)}function Ef(n){return wr(zr,{protocol:/^https?$/,hostname:je.domain,...z.normalizeParams(n)})}var To=$("ZodEmoji",(n,e)=>{dc.init(n,e),ae.init(n,e)});function wf(n){return Gi(To,n)}var Ro=$("ZodNanoID",(n,e)=>{mc.init(n,e),ae.init(n,e)});function If(n){return Vi(Ro,n)}var Po=$("ZodCUID",(n,e)=>{fc.init(n,e),ae.init(n,e)});function Tf(n){return qi(Po,n)}var No=$("ZodCUID2",(n,e)=>{hc.init(n,e),ae.init(n,e)});function Rf(n){return Ki(No,n)}var zo=$("ZodULID",(n,e)=>{gc.init(n,e),ae.init(n,e)});function Pf(n){return Yi(zo,n)}var Do=$("ZodXID",(n,e)=>{yc.init(n,e),ae.init(n,e)});function Nf(n){return Xi(Do,n)}var Oo=$("ZodKSUID",(n,e)=>{vc.init(n,e),ae.init(n,e)});function zf(n){return Qi(Oo,n)}var Lo=$("ZodIPv4",(n,e)=>{Sc.init(n,e),ae.init(n,e)});function Df(n){return eo(Lo,n)}var ip=$("ZodMAC",(n,e)=>{Ec.init(n,e),ae.init(n,e)});function Of(n){return xl(ip,n)}var Ao=$("ZodIPv6",(n,e)=>{kc.init(n,e),ae.init(n,e)});function Lf(n){return to(Ao,n)}var Co=$("ZodCIDRv4",(n,e)=>{wc.init(n,e),ae.init(n,e)});function Af(n){return no(Co,n)}var jo=$("ZodCIDRv6",(n,e)=>{Ic.init(n,e),ae.init(n,e)});function Cf(n){return ro(jo,n)}var Mo=$("ZodBase64",(n,e)=>{Rc.init(n,e),ae.init(n,e)});function jf(n){return io(Mo,n)}var Uo=$("ZodBase64URL",(n,e)=>{Pc.init(n,e),ae.init(n,e)});function Mf(n){return oo(Uo,n)}var Fo=$("ZodE164",(n,e)=>{Nc.init(n,e),ae.init(n,e)});function Uf(n){return so(Fo,n)}var Zo=$("ZodJWT",(n,e)=>{zc.init(n,e),ae.init(n,e)});function Ff(n){return ao(Zo,n)}var An=$("ZodCustomStringFormat",(n,e)=>{Dc.init(n,e),ae.init(n,e)});function Zf(n,e,r={}){return Nn(An,n,e,r)}function Wf(n){return Nn(An,"hostname",je.hostname,n)}function Hf(n){return Nn(An,"hex",je.hex,n)}function Bf(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=je[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return Nn(An,i,t,e)}var Cn=$("ZodNumber",(n,e)=>{Di.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>su(n,i,t,o),n.gt=(i,t)=>n.check(et(i,t)),n.gte=(i,t)=>n.check(Se(i,t)),n.min=(i,t)=>n.check(Se(i,t)),n.lt=(i,t)=>n.check(Qe(i,t)),n.lte=(i,t)=>n.check(De(i,t)),n.max=(i,t)=>n.check(De(i,t)),n.int=i=>n.check(Eo(i)),n.safe=i=>n.check(Eo(i)),n.positive=i=>n.check(et(0,i)),n.nonnegative=i=>n.check(Se(0,i)),n.negative=i=>n.check(Qe(0,i)),n.nonpositive=i=>n.check(De(0,i)),n.multipleOf=(i,t)=>n.check(wt(i,t)),n.step=(i,t)=>n.check(wt(i,t)),n.finite=()=>n;let r=n._zod.bag;n.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),n.isFinite=!0,n.format=r.format??null});function op(n){return Il(Cn,n)}var qt=$("ZodNumberFormat",(n,e)=>{Oc.init(n,e),Cn.init(n,e)});function Eo(n){return Rl(qt,n)}function Jf(n){return Pl(qt,n)}function Gf(n){return Nl(qt,n)}function Vf(n){return zl(qt,n)}function qf(n){return Dl(qt,n)}var jn=$("ZodBoolean",(n,e)=>{br.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>au(n,r,i,t)});function sp(n){return Ol(jn,n)}var Mn=$("ZodBigInt",(n,e)=>{Oi.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>cu(n,i,t,o),n.gte=(i,t)=>n.check(Se(i,t)),n.min=(i,t)=>n.check(Se(i,t)),n.gt=(i,t)=>n.check(et(i,t)),n.gte=(i,t)=>n.check(Se(i,t)),n.min=(i,t)=>n.check(Se(i,t)),n.lt=(i,t)=>n.check(Qe(i,t)),n.lte=(i,t)=>n.check(De(i,t)),n.max=(i,t)=>n.check(De(i,t)),n.positive=i=>n.check(et(BigInt(0),i)),n.negative=i=>n.check(Qe(BigInt(0),i)),n.nonpositive=i=>n.check(De(BigInt(0),i)),n.nonnegative=i=>n.check(Se(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(wt(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function Kf(n){return Al(Mn,n)}var Wo=$("ZodBigIntFormat",(n,e)=>{Lc.init(n,e),Mn.init(n,e)});function Yf(n){return jl(Wo,n)}function Xf(n){return Ml(Wo,n)}var ap=$("ZodSymbol",(n,e)=>{Ac.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>lu(n,r,i,t)});function Qf(n){return Ul(ap,n)}var cp=$("ZodUndefined",(n,e)=>{Cc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>pu(n,r,i,t)});function eh(n){return Fl(cp,n)}var lp=$("ZodNull",(n,e)=>{jc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>uu(n,r,i,t)});function up(n){return Zl(lp,n)}var pp=$("ZodAny",(n,e)=>{Mc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>fu(n,r,i,t)});function th(){return Wl(pp)}var dp=$("ZodUnknown",(n,e)=>{Uc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>hu(n,r,i,t)});function Vt(){return Hl(dp)}var mp=$("ZodNever",(n,e)=>{Fc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>mu(n,r,i,t)});function Ho(n){return Bl(mp,n)}var fp=$("ZodVoid",(n,e)=>{Zc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>du(n,r,i,t)});function nh(n){return Jl(fp,n)}var Dr=$("ZodDate",(n,e)=>{Wc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>gu(n,i,t,o),n.min=(i,t)=>n.check(Se(i,t)),n.max=(i,t)=>n.check(De(i,t));let r=n._zod.bag;n.minDate=r.minimum?new Date(r.minimum):null,n.maxDate=r.maximum?new Date(r.maximum):null});function rh(n){return Gl(Dr,n)}var hp=$("ZodArray",(n,e)=>{Hc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Tu(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(dt(r,i)),n.nonempty=r=>n.check(dt(1,r)),n.max=(r,i)=>n.check(Jt(r,i)),n.length=(r,i)=>n.check(Gt(r,i)),n.unwrap=()=>n.element});function Or(n,e){return Kl(hp,n,e)}function ih(n){let e=n._zod.def.shape;return Jo(Object.keys(e))}var Lr=$("ZodObject",(n,e)=>{Bc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ru(n,r,i,t),z.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>Jo(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:Vt()}),n.loose=()=>n.clone({...n._zod.def,catchall:Vt()}),n.strict=()=>n.clone({...n._zod.def,catchall:Ho()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>z.extend(n,r),n.safeExtend=r=>z.safeExtend(n,r),n.merge=r=>z.merge(n,r),n.pick=r=>z.pick(n,r),n.omit=r=>z.omit(n,r),n.partial=(...r)=>z.partial(Vo,n,r[0]),n.required=(...r)=>z.required(qo,n,r[0])});function oh(n,e){let r={type:"object",shape:n??{},...z.normalizeParams(e)};return new Lr(r)}function sh(n,e){return new Lr({type:"object",shape:n,catchall:Ho(),...z.normalizeParams(e)})}function ah(n,e){return new Lr({type:"object",shape:n,catchall:Vt(),...z.normalizeParams(e)})}var Ar=$("ZodUnion",(n,e)=>{xr.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ho(n,r,i,t),n.options=e.options});function Bo(n,e){return new Ar({type:"union",options:n,...z.normalizeParams(e)})}var gp=$("ZodXor",(n,e)=>{Ar.init(n,e),Jc.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ho(n,r,i,t),n.options=e.options});function ch(n,e){return new gp({type:"union",options:n,inclusive:!1,...z.normalizeParams(e)})}var yp=$("ZodDiscriminatedUnion",(n,e)=>{Ar.init(n,e),Gc.init(n,e)});function lh(n,e,r){return new yp({type:"union",options:e,discriminator:n,...z.normalizeParams(r)})}var vp=$("ZodIntersection",(n,e)=>{Vc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Pu(n,r,i,t)});function _p(n,e){return new vp({type:"intersection",left:n,right:e})}var bp=$("ZodTuple",(n,e)=>{Li.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Nu(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function xp(n,e,r){let i=e instanceof Y,t=i?r:e,o=i?e:null;return new bp({type:"tuple",items:n,rest:o,...z.normalizeParams(t)})}var Cr=$("ZodRecord",(n,e)=>{qc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>zu(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function $p(n,e,r){return new Cr({type:"record",keyType:n,valueType:e,...z.normalizeParams(r)})}function uh(n,e,r){let i=$e(n);return i._zod.values=void 0,new Cr({type:"record",keyType:i,valueType:e,...z.normalizeParams(r)})}function ph(n,e,r){return new Cr({type:"record",keyType:n,valueType:e,mode:"loose",...z.normalizeParams(r)})}var Sp=$("ZodMap",(n,e)=>{Kc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wu(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType,n.min=(...r)=>n.check(tt(...r)),n.nonempty=r=>n.check(tt(1,r)),n.max=(...r)=>n.check(It(...r)),n.size=(...r)=>n.check(Bt(...r))});function dh(n,e,r){return new Sp({type:"map",keyType:n,valueType:e,...z.normalizeParams(r)})}var kp=$("ZodSet",(n,e)=>{Yc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Iu(n,r,i,t),n.min=(...r)=>n.check(tt(...r)),n.nonempty=r=>n.check(tt(1,r)),n.max=(...r)=>n.check(It(...r)),n.size=(...r)=>n.check(Bt(...r))});function mh(n,e){return new kp({type:"set",valueType:n,...z.normalizeParams(e)})}var On=$("ZodEnum",(n,e)=>{Xc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>yu(n,i,t,o),n.enum=e.entries,n.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));n.extract=(i,t)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new On({...e,checks:[],...z.normalizeParams(t),entries:o})},n.exclude=(i,t)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new On({...e,checks:[],...z.normalizeParams(t),entries:o})}});function Jo(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new On({type:"enum",entries:r,...z.normalizeParams(e)})}function fh(n,e){return new On({type:"enum",entries:n,...z.normalizeParams(e)})}var Ep=$("ZodLiteral",(n,e)=>{Qc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>vu(n,r,i,t),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function hh(n,e){return new Ep({type:"literal",values:Array.isArray(n)?n:[n],...z.normalizeParams(e)})}var wp=$("ZodFile",(n,e)=>{el.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>xu(n,r,i,t),n.min=(r,i)=>n.check(tt(r,i)),n.max=(r,i)=>n.check(It(r,i)),n.mime=(r,i)=>n.check(En(Array.isArray(r)?r:[r],i))});function gh(n){return Yl(wp,n)}var Ip=$("ZodTransform",(n,e)=>{tl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Eu(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new xt(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(z.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),r.issues.push(z.issue(s))}};let t=e.transform(r.value,r);return t instanceof Promise?t.then(o=>(r.value=o,r)):(r.value=t,r)}});function Go(n){return new Ip({type:"transform",transform:n})}var Vo=$("ZodOptional",(n,e)=>{Ai.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>go(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Rr(n){return new Vo({type:"optional",innerType:n})}var Tp=$("ZodExactOptional",(n,e)=>{nl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>go(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Rp(n){return new Tp({type:"optional",innerType:n})}var Pp=$("ZodNullable",(n,e)=>{rl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Du(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Pr(n){return new Pp({type:"nullable",innerType:n})}function yh(n){return Rr(Pr(n))}var Np=$("ZodDefault",(n,e)=>{il.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Lu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function zp(n,e){return new Np({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():z.shallowClone(e)}})}var Dp=$("ZodPrefault",(n,e)=>{ol.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Au(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Op(n,e){return new Dp({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():z.shallowClone(e)}})}var qo=$("ZodNonOptional",(n,e)=>{sl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ou(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Lp(n,e){return new qo({type:"nonoptional",innerType:n,...z.normalizeParams(e)})}var Ap=$("ZodSuccess",(n,e)=>{al.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>$u(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function vh(n){return new Ap({type:"success",innerType:n})}var Cp=$("ZodCatch",(n,e)=>{cl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Cu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function jp(n,e){return new Cp({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var Mp=$("ZodNaN",(n,e)=>{ll.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>_u(n,r,i,t)});function _h(n){return ql(Mp,n)}var Ko=$("ZodPipe",(n,e)=>{ul.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ju(n,r,i,t),n.in=e.in,n.out=e.out});function Nr(n,e){return new Ko({type:"pipe",in:n,out:e})}var Yo=$("ZodCodec",(n,e)=>{Ko.init(n,e),$r.init(n,e)});function bh(n,e,r){return new Yo({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var Up=$("ZodReadonly",(n,e)=>{pl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Mu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Fp(n){return new Up({type:"readonly",innerType:n})}var Zp=$("ZodTemplateLiteral",(n,e)=>{dl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>bu(n,r,i,t)});function xh(n,e){return new Zp({type:"template_literal",parts:n,...z.normalizeParams(e)})}var Wp=$("ZodLazy",(n,e)=>{hl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Fu(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function Hp(n){return new Wp({type:"lazy",getter:n})}var Bp=$("ZodPromise",(n,e)=>{fl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Uu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function $h(n){return new Bp({type:"promise",innerType:n})}var Jp=$("ZodFunction",(n,e)=>{ml.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ku(n,r,i,t)});function Sh(n){return new Jp({type:"function",input:Array.isArray(n?.input)?xp(n?.input):n?.input??Or(Vt()),output:n?.output??Vt()})}var jr=$("ZodCustom",(n,e)=>{gl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Su(n,r,i,t)});function kh(n){let e=new le({check:"custom"});return e._zod.check=n,e}function Eh(n,e){return Xl(jr,n??(()=>!0),e)}function Gp(n,e={}){return Ql(jr,n,e)}function Vp(n){return eu(n)}var wh=tu,Ih=nu;function Th(n,e={}){let r=new jr({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...z.normalizeParams(e)});return r._zod.bag.Class=n,r._zod.check=i=>{i.value instanceof n||i.issues.push({code:"invalid_type",expected:n.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Rh=(...n)=>ru({Codec:Yo,Boolean:jn,String:Ln},...n);function Ph(n){let e=Hp(()=>Bo([ko(n),op(),sp(),up(),Or(e),$p(ko(),e)]));return e}function Nh(n,e){return Nr(Go(n),e)}var t$={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 n$(n){me({customError:n})}function r$(){return me().customError}var qp;qp||(qp={});var F={...Ir,..._o,iso:Dn},i$=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function o$(n,e){let r=n.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function s$(n,e){if(!n.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=n.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let t=r[1];if(!t||!e.defs[t])throw new Error(`Reference not found: ${n}`);return e.defs[t]}throw new Error(`Reference not found: ${n}`)}function zh(n,e){if(n.not!==void 0){if(typeof n.not=="object"&&Object.keys(n.not).length===0)return F.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(n.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(n.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(n.if!==void 0||n.then!==void 0||n.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(n.dependentSchemas!==void 0||n.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(n.$ref){let t=n.$ref;if(e.refs.has(t))return e.refs.get(t);if(e.processing.has(t))return F.lazy(()=>{if(!e.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return e.refs.get(t)});e.processing.add(t);let o=s$(t,e),s=xe(o,e);return e.refs.set(t,s),e.processing.delete(t),s}if(n.enum!==void 0){let t=n.enum;if(e.version==="openapi-3.0"&&n.nullable===!0&&t.length===1&&t[0]===null)return F.null();if(t.length===0)return F.never();if(t.length===1)return F.literal(t[0]);if(t.every(s=>typeof s=="string"))return F.enum(t);let o=t.map(s=>F.literal(s));return o.length<2?o[0]:F.union([o[0],o[1],...o.slice(2)])}if(n.const!==void 0)return F.literal(n.const);let r=n.type;if(Array.isArray(r)){let t=r.map(o=>{let s={...n,type:o};return zh(s,e)});return t.length===0?F.never():t.length===1?t[0]:F.union(t)}if(!r)return F.any();let i;switch(r){case"string":{let t=F.string();if(n.format){let o=n.format;o==="email"?t=t.check(F.email()):o==="uri"||o==="uri-reference"?t=t.check(F.url()):o==="uuid"||o==="guid"?t=t.check(F.uuid()):o==="date-time"?t=t.check(F.iso.datetime()):o==="date"?t=t.check(F.iso.date()):o==="time"?t=t.check(F.iso.time()):o==="duration"?t=t.check(F.iso.duration()):o==="ipv4"?t=t.check(F.ipv4()):o==="ipv6"?t=t.check(F.ipv6()):o==="mac"?t=t.check(F.mac()):o==="cidr"?t=t.check(F.cidrv4()):o==="cidr-v6"?t=t.check(F.cidrv6()):o==="base64"?t=t.check(F.base64()):o==="base64url"?t=t.check(F.base64url()):o==="e164"?t=t.check(F.e164()):o==="jwt"?t=t.check(F.jwt()):o==="emoji"?t=t.check(F.emoji()):o==="nanoid"?t=t.check(F.nanoid()):o==="cuid"?t=t.check(F.cuid()):o==="cuid2"?t=t.check(F.cuid2()):o==="ulid"?t=t.check(F.ulid()):o==="xid"?t=t.check(F.xid()):o==="ksuid"&&(t=t.check(F.ksuid()))}typeof n.minLength=="number"&&(t=t.min(n.minLength)),typeof n.maxLength=="number"&&(t=t.max(n.maxLength)),n.pattern&&(t=t.regex(new RegExp(n.pattern))),i=t;break}case"number":case"integer":{let t=r==="integer"?F.number().int():F.number();typeof n.minimum=="number"&&(t=t.min(n.minimum)),typeof n.maximum=="number"&&(t=t.max(n.maximum)),typeof n.exclusiveMinimum=="number"?t=t.gt(n.exclusiveMinimum):n.exclusiveMinimum===!0&&typeof n.minimum=="number"&&(t=t.gt(n.minimum)),typeof n.exclusiveMaximum=="number"?t=t.lt(n.exclusiveMaximum):n.exclusiveMaximum===!0&&typeof n.maximum=="number"&&(t=t.lt(n.maximum)),typeof n.multipleOf=="number"&&(t=t.multipleOf(n.multipleOf)),i=t;break}case"boolean":{i=F.boolean();break}case"null":{i=F.null();break}case"object":{let t={},o=n.properties||{},s=new Set(n.required||[]);for(let[c,l]of Object.entries(o)){let u=xe(l,e);t[c]=s.has(c)?u:u.optional()}if(n.propertyNames){let c=xe(n.propertyNames,e),l=n.additionalProperties&&typeof n.additionalProperties=="object"?xe(n.additionalProperties,e):F.any();if(Object.keys(t).length===0){i=F.record(c,l);break}let u=F.object(t).passthrough(),p=F.looseRecord(c,l);i=F.intersection(u,p);break}if(n.patternProperties){let c=n.patternProperties,l=Object.keys(c),u=[];for(let d of l){let m=xe(c[d],e),f=F.string().regex(new RegExp(d));u.push(F.looseRecord(f,m))}let p=[];if(Object.keys(t).length>0&&p.push(F.object(t).passthrough()),p.push(...u),p.length===0)i=F.object({}).passthrough();else if(p.length===1)i=p[0];else{let d=F.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)d=F.intersection(d,p[m]);i=d}break}let a=F.object(t);n.additionalProperties===!1?i=a.strict():typeof n.additionalProperties=="object"?i=a.catchall(xe(n.additionalProperties,e)):i=a.passthrough();break}case"array":{let t=n.prefixItems,o=n.items;if(t&&Array.isArray(t)){let s=t.map(c=>xe(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?xe(o,e):void 0;a?i=F.tuple(s).rest(a):i=F.tuple(s),typeof n.minItems=="number"&&(i=i.check(F.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(F.maxLength(n.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>xe(c,e)),a=n.additionalItems&&typeof n.additionalItems=="object"?xe(n.additionalItems,e):void 0;a?i=F.tuple(s).rest(a):i=F.tuple(s),typeof n.minItems=="number"&&(i=i.check(F.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(F.maxLength(n.maxItems)))}else if(o!==void 0){let s=xe(o,e),a=F.array(s);typeof n.minItems=="number"&&(a=a.min(n.minItems)),typeof n.maxItems=="number"&&(a=a.max(n.maxItems)),i=a}else i=F.array(F.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n.description&&(i=i.describe(n.description)),n.default!==void 0&&(i=i.default(n.default)),i}function xe(n,e){if(typeof n=="boolean")return n?F.any():F.never();let r=zh(n,e),i=n.type||n.enum!==void 0||n.const!==void 0;if(n.anyOf&&Array.isArray(n.anyOf)){let a=n.anyOf.map(l=>xe(l,e)),c=F.union(a);r=i?F.intersection(r,c):c}if(n.oneOf&&Array.isArray(n.oneOf)){let a=n.oneOf.map(l=>xe(l,e)),c=F.xor(a);r=i?F.intersection(r,c):c}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)r=i?r:F.any();else{let a=i?r:xe(n.allOf[0],e),c=i?0:1;for(let l=c;l<n.allOf.length;l++)a=F.intersection(a,xe(n.allOf[l],e));r=a}n.nullable===!0&&e.version==="openapi-3.0"&&(r=F.nullable(r)),n.readOnly===!0&&(r=F.readonly(r));let t={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in n&&(t[a]=n[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in n&&(t[a]=n[a]);for(let a of Object.keys(n))i$.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function Dh(n,e){if(typeof n=="boolean")return n?F.any():F.never();let r=o$(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??be};return xe(n,t)}var Kp={};Ae(Kp,{bigint:()=>u$,boolean:()=>l$,date:()=>p$,number:()=>c$,string:()=>a$});function a$(n){return bl(Ln,n)}function c$(n){return Tl(Cn,n)}function l$(n){return Ll(jn,n)}function u$(n){return Cl(Mn,n)}function p$(n){return Vl(Dr,n)}me(Ci());var Xo=["**/node_modules/**","**/.git/**","**/dist/**","**/build/**","**/vendor/**","**/.next/**","**/.cache/**","**/coverage/**","**/*.min.js"],Oh=["**/*.{ts,tsx,yaml,yml,php,py,go}","**/*.prisma","**/*.{graphql,gql}","**/Dockerfile*","**/.env*","**/package.json","**/lerna.json","**/turbo.json","**/pnpm-workspace.yaml"],ve={MAX_DEPTH:10,MIN_DEPTH:1,MAX_LIMIT:500,MIN_LIMIT:1,MAX_QUERY_LENGTH:500,DEFAULT_DEPTH:3,DEFAULT_LIMIT:10},Re={FILTERED_QUERY_LIMIT_MULTIPLIER:3,SCORE_BASE:1e3,EXACT_MATCH_BONUS:500,RECENT_FILE_BOOST:80,OLDER_FILE_BOOST:30,RECENT_FILE_THRESHOLD_DAYS:7,OLDER_FILE_THRESHOLD_DAYS:30,FUZZY_MATCH_LIMIT:30,ENABLE_LEXICAL_SCORING:process.env.ENABLE_LEXICAL_SCORING!=="false",LEXICAL_WEIGHT:parseFloat(process.env.LEXICAL_WEIGHT??String(.4)),GRAVITY_STRUCTURAL_WEIGHT:.5},Yp={SECONDS_PER_DAY:86400,SECONDS_PER_YEAR:31536e3},Qo={DEFAULT_CONCURRENCY:parseInt(process.env.INDEX_CONCURRENCY??String(5),10)};var LI=y.object({repoPath:y.string(),mode:y.enum(["init","tree","topography","scout","hologram","tools"]),subPath:y.string().optional(),maxDepth:y.number().int().min(ve.MIN_DEPTH).max(ve.MAX_DEPTH).optional()}),AI=y.object({repoPath:y.string(),mode:y.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:y.string().max(ve.MAX_QUERY_LENGTH).optional(),key:y.string().optional(),kind:y.enum(["Service","Image","Port","Env"]).optional(),limit:y.number().int().min(ve.MIN_LIMIT).max(ve.MAX_LIMIT).optional(),offset:y.number().int().min(0).optional(),compact:y.boolean().optional()}).refine(n=>!(n.mode==="concept"&&(!n.query||n.query.trim().length===0)),{message:"Concept search requires a non-empty query",path:["query"]}),CI=y.object({repoPath:y.string(),mode:y.enum(["symbol","file"]),filePath:y.string().optional(),detailLevel:y.enum(["structure","signatures","summaries","detailed"]).optional(),symbolName:y.string().optional(),context:y.enum(["definition","full"]).optional()}),jI=y.object({repoPath:y.string(),mode:y.enum(["impact","deps","flow","dead-code","circular-deps"]),filePath:y.string().optional(),symbolName:y.string().optional(),direction:y.enum(["imports","imported_by"]).optional(),depth:y.number().int().min(ve.MIN_DEPTH).max(ve.MAX_DEPTH).optional(),limit:y.number().int().min(ve.MIN_LIMIT).max(ve.MAX_LIMIT).optional(),includeTests:y.boolean().optional()}),MI=y.object({repoPath:y.string(),action:y.enum(["index","repair","trace"]),deep:y.boolean().optional(),sinceCommit:y.string().optional()}),UI=y.object({repoPath:y.string(),action:y.enum(["install","remove","status"]),enableAutoRefresh:y.boolean().optional(),enableSymbolHealing:y.boolean().optional()}),FI=y.object({action:y.enum(["list","link","fuse"]),repoPaths:y.array(y.string()).optional(),name:y.string().optional(),status:y.string().optional(),parentRepoPath:y.string().optional(),parentMissionId:y.number().optional(),childRepoPath:y.string().optional(),childMissionId:y.number().optional(),relationship:y.string().optional()});var Lh=[];var Ah=[...Zd,...Wd];import Le from"path";import nd from"fs";K();import he from"path";import Xp from"fs";var es=x.child({module:"path-resolver"}),Un=class{repoPath;constructor(e){this.repoPath=he.isAbsolute(e)?he.normalize(e):he.resolve(process.cwd(),e)}resolve(e){if(!e)return this.repoPath;if(e.includes("\0"))throw es.error({inputPath:e},"Path contains null bytes - possible attack"),new Error("Invalid path: contains null bytes");let r;if(he.isAbsolute(e)?r=he.normalize(e):r=he.join(this.repoPath,e),r=he.normalize(r),!this.isWithinRoot(r))throw es.warn({inputPath:e,resolved:r},"Path traversal attempt blocked"),new Error(`Access denied: path '${e}' is outside the repository root`);return r}resolveAndValidate(e){try{let r=this.resolve(e);return Xp.existsSync(r)?r:(es.debug({inputPath:e,resolved:r},"Path does not exist"),null)}catch(r){return es.error({inputPath:e,error:r},"Error validating path"),null}}isWithinRoot(e){try{let r=he.resolve(e),i=he.resolve(this.repoPath),t=he.relative(i,r);if(t.startsWith("..")||he.isAbsolute(t))return!1;if(Xp.existsSync(r)){let s=Xp.realpathSync(r),a=he.relative(i,s);if(a.startsWith("..")||he.isAbsolute(a))return!1}return!0}catch{return!1}}getRelative(e){let r=he.normalize(e);return he.relative(this.repoPath,r)}resolveBatch(e){return e.map(r=>this.resolve(r))}static normalize(e){return he.normalize(e)}static isPathWithinRoot(e,r){let i=he.resolve(e),t=he.resolve(r),o=he.relative(i,t);return o===""||!o.startsWith("..")&&!he.isAbsolute(o)}};function Ch(n){return new Un(n)}var h$=/[\x00-\x1f\x7f]/g,g$=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function Fn(n){if(typeof n!="string")throw new Error("Invalid path: expected string");if(n.includes("\0"))throw new Error("Invalid path: null bytes are not allowed");if(n.replace(h$,"").length!==n.length)throw new Error("Invalid path: control characters are not allowed");return n.trim()}function Zn(n,e=4096){if(typeof n!="string")return"";let r=n.replace(g$,"").trim();return r.length>e?r.slice(0,e):r}Kt();var Fr=`
464
474
 
465
- To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function Pt(n,e,r){return{content:[{type:"text",text:`[${n}] ${e}`}],isError:!0,errorCode:n,errorDetails:r}}function c$(n){let e=Ae.isAbsolute(n)?Ae.normalize(n):Ae.resolve(process.cwd(),n),r=Ae.parse(e).root;for(;e!==r;){if(Jp.existsSync(Ae.join(e,".liquid-shadow.db"))||Jp.existsSync(Ae.join(e,".git"))||Jp.existsSync(Ae.join(e,"package.json")))return e;let i=Ae.dirname(e);if(i===e)break;e=i}return null}function je(n){let e=n?.repoPath?String(n.repoPath):void 0,r=n?.filePath?String(n.filePath):void 0;e&&(e=An(e)),r&&(r=An(r));let i;if(e)Ae.isAbsolute(e)||(e=Ae.resolve(process.cwd(),e)),i=e;else if(r){let s=Ae.resolve(process.cwd(),r);i=c$(Ae.dirname(s))||process.cwd()}else i=process.cwd();i=Ae.normalize(i);let t=Rh(i),o;return r&&(o=t.resolve(r)),{...n,repoPath:i,filePath:o,resolver:t}}function jh(n){if(!n.startsWith("repo://"))return null;let e=r=>r==="current"?"":r;if(n.endsWith("/dependency-graph")){let r=n.replace("repo://","").replace("/dependency-graph","");return{repoPath:e(r),resource:"dependency-graph"}}if(n.endsWith("/statistics")){let r=n.replace("repo://","").replace("/statistics","");return{repoPath:e(r),resource:"statistics"}}if(n.endsWith("/metrics")){let r=n.replace("repo://","").replace("/metrics","");return{repoPath:e(r),resource:"metrics"}}if(n.endsWith("/hologram")){let r=n.replace("repo://","").replace("/hologram","");return{repoPath:e(r),resource:"hologram"}}if(n.endsWith("/tools")){let r=n.replace("repo://","").replace("/tools","");return{repoPath:e(r),resource:"tools"}}return null}function Mh(n,e){if(!et(n)){let r=`Repository not indexed yet. Run initial indexing first:
475
+ To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function zt(n,e,r){return{content:[{type:"text",text:`[${n}] ${e}`}],isError:!0,errorCode:n,errorDetails:r}}function T$(n){let e=Le.isAbsolute(n)?Le.normalize(n):Le.resolve(process.cwd(),n),r=Le.parse(e).root;for(;e!==r;){if(nd.existsSync(Le.join(e,".liquid-shadow.db"))||nd.existsSync(Le.join(e,".git"))||nd.existsSync(Le.join(e,"package.json")))return e;let i=Le.dirname(e);if(i===e)break;e=i}return null}function Me(n){let e=n?.repoPath?String(n.repoPath):void 0,r=n?.filePath?String(n.filePath):void 0;e&&(e=Fn(e)),r&&(r=Fn(r));let i;if(e)Le.isAbsolute(e)||(e=Le.resolve(process.cwd(),e)),i=e;else if(r){let s=Le.resolve(process.cwd(),r);i=T$(Le.dirname(s))||process.cwd()}else i=process.cwd();i=Le.normalize(i);let t=Ch(i),o;return r&&(o=t.resolve(r)),{...n,repoPath:i,filePath:o,resolver:t}}function Jh(n){if(!n.startsWith("repo://"))return null;let e=r=>r==="current"?"":r;if(n.endsWith("/dependency-graph")){let r=n.replace("repo://","").replace("/dependency-graph","");return{repoPath:e(r),resource:"dependency-graph"}}if(n.endsWith("/statistics")){let r=n.replace("repo://","").replace("/statistics","");return{repoPath:e(r),resource:"statistics"}}if(n.endsWith("/metrics")){let r=n.replace("repo://","").replace("/metrics","");return{repoPath:e(r),resource:"metrics"}}if(n.endsWith("/hologram")){let r=n.replace("repo://","").replace("/hologram","");return{repoPath:e(r),resource:"hologram"}}if(n.endsWith("/tools")){let r=n.replace("repo://","").replace("/tools","");return{repoPath:e(r),resource:"tools"}}return null}function Gh(n,e){if(!rt(n)){let r=`Repository not indexed yet. Run initial indexing first:
466
476
 
467
477
  1. shadow_recon_onboard({ repoPath: "${n}" }) // one-time
468
478
  2. shadow_sync_trace({ repoPath: "${n}" }) // then sync
469
479
 
470
- After that, ${e} and other tools will work.`+Ar;return Pt("FILE_NOT_FOUND",r,{repoPath:n,toolName:e,requiresIndexing:!0})}return null}async function Uh(n){return{resources:Ih}}async function Fh(n){let e=n.params.uri;throw jh(e)?new Error(`Resource not found: ${e}`):new Error(`Invalid resource URI: ${e}`)}J();import{execSync as Kt}from"child_process";import Vp from"path";import Gp from"fs";function _e(n){try{if(!Gp.existsSync(Vp.join(n,".git")))return null;let e=Kt("git rev-parse --abbrev-ref HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return e==="HEAD"?Kt("git rev-parse --short HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():e.replace(/[\/\\:*"<>|?]/g,"-")}catch{return null}}function He(n){try{return Gp.existsSync(Vp.join(n,".git"))?Kt("git rev-parse HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():null}catch{return null}}function Zh(n,e=50){try{let r=Kt(`git rev-list --max-count=${e} HEAD`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return r?r.split(`
471
- `):[]}catch{return[]}}function Hh(n,e,r){try{return Kt(`git merge-tree --write-tree ${e} ${r}`,{cwd:n,stdio:["ignore","ignore","ignore"]}),!1}catch{return!0}}function Wh(n,e){try{if(!Gp.existsSync(Vp.join(n,".git")))return!0;let r=He(n);return!r||e&&e!==r&&Kt(`git diff --name-only ${e} ${r}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim()?!0:Kt("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim().length>0}catch{return!0}}J();var l$=$.child({module:"strategy-normalizer"}),ft=class{static normalize(e){if(!e)return{steps:[]};let r;if(typeof e=="string")try{r=JSON.parse(e)}catch(t){return l$.warn({strategyInput:e,err:t},"Failed to parse strategy JSON"),{steps:[]}}else r=e;return{steps:this.normalizeSteps(r)}}static normalizeSteps(e){return Array.isArray(e)?e.map((r,i)=>typeof r=="string"?{id:`step-${i}`,description:r,status:"pending"}:typeof r=="object"&&r!==null?{id:r.id||`step-${i}`,description:r.description||r.content||r.name||`Step ${i+1}`,status:r.status||"pending",dependencies:r.dependencies||r.deps,verification:r.verification,...r}:{id:`step-${i}`,description:String(r),status:"pending"}):e.steps&&Array.isArray(e.steps)?this.normalizeSteps(e.steps):typeof e=="object"?Object.entries(e).map(([r,i],t)=>typeof i=="string"?{id:r,description:i,status:"pending"}:typeof i=="object"&&i!==null?{id:r,description:i.description||i.content||i.name||r,status:i.status||"pending",dependencies:i.dependencies||i.deps,verification:i.verification,...i}:{id:r||`step-${t}`,description:String(i),status:"pending"}):[]}static stringify(e){return JSON.stringify(e,null,2)}static validate(e){let r=[];if(!e)return{valid:!0,errors:[]};try{let i=this.normalize(e),t=new Set;for(let o of i.steps)if(t.has(o.id)&&r.push(`Duplicate step ID: ${o.id}`),t.add(o.id),o.dependencies)for(let s of o.dependencies)t.has(s)||r.push(`Step "${o.id}" depends on non-existent step "${s}"`);return{valid:r.length===0,errors:r}}catch(i){return r.push(`Strategy validation failed: ${i instanceof Error?i.message:String(i)}`),{valid:!1,errors:r}}}};J();import qp from"fs";import Bh from"path";import u$ from"os";var p$=[{id:"step-0",description:"Analyze impact: identify dependents and call sites",status:"pending"},{id:"step-1",description:"Implement refactor and update call sites",status:"pending"},{id:"step-2",description:"Run tests and verify behavior; update docs if needed",status:"pending"}],d$=[{id:"step-0",description:"Capture requirements and acceptance criteria",status:"pending"},{id:"step-1",description:"Implement feature with tests",status:"pending"},{id:"step-2",description:"Integrate and verify end-to-end",status:"pending"}],m$=[{id:"step-0",description:"Reproduce the bug and document steps",status:"pending"},{id:"step-1",description:"Diagnose root cause and plan fix",status:"pending"},{id:"step-2",description:"Apply fix and add/update regression test",status:"pending"},{id:"step-3",description:"Verify fix and run full test suite",status:"pending"}],Jh=[{id:"refactoring",name:"Refactoring",description:"Impact analysis \u2192 implementation \u2192 verification",defaultGoal:"Refactor {{target}} safely with full impact analysis and verification.",steps:p$},{id:"feature",name:"Feature",description:"Requirements \u2192 implementation \u2192 testing",defaultGoal:"Implement {{target}} with clear requirements and end-to-end verification.",steps:d$},{id:"bug-fix",name:"Bug fix",description:"Reproduction \u2192 diagnosis \u2192 fix \u2192 regression test",defaultGoal:"Fix {{target}}: reproduce, diagnose, fix, and add regression test.",steps:m$}],Kp=new Map(Jh.map(n=>[n.id,n])),qo=!1;function f$(){if(qo)return;let n=Bh.join(u$.homedir(),".shadow","templates");if(!qp.existsSync(n)){$.debug({templatesDir:n},"Custom templates directory does not exist"),qo=!0;return}try{let e=qp.readdirSync(n).filter(r=>r.endsWith(".json"));for(let r of e)try{let i=Bh.join(n,r),t=qp.readFileSync(i,"utf8"),o=JSON.parse(t);if(!o.id||!o.name||!o.defaultGoal||!o.steps){$.warn({file:r,template:o},"Invalid custom template structure - skipping");continue}if(!Array.isArray(o.steps)||o.steps.length===0){$.warn({file:r},"Template has no steps - skipping");continue}if(Jh.some(s=>s.id===o.id)){$.warn({file:r,templateId:o.id},"Custom template ID conflicts with built-in - skipping");continue}Kp.set(o.id,o),$.info({file:r,templateId:o.id},"Loaded custom template")}catch(i){$.warn({file:r,error:i},"Failed to load custom template")}qo=!0}catch(e){$.warn({error:e,templatesDir:n},"Failed to read custom templates directory"),qo=!0}}function h$(n){return f$(),Kp.get(n)}function g$(n,e){let r=n;for(let[i,t]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),t);return r}function Vh(n,e,r={}){let i=h$(n);if(!i)throw new Error(`Unknown template: ${n}. Use one of: ${Array.from(Kp.keys()).join(", ")}`);let t=r.target||"scope",o=e||(n==="refactoring"?`Refactor ${t}`:n==="feature"?`Feature: ${t}`:`Fix: ${t}`),s=g$(i.defaultGoal,{...r,target:t}),a=ft.normalize({steps:i.steps}),c=ft.stringify(a);return{name:o,goal:s,strategy:c}}Q();Q();import{execSync as Cn}from"child_process";var os=class{constructor(e,r="refs/notes/shadow"){this.repoPath=e;this.ref=r}addNote(e,r){try{Cn(`git notes --ref ${this.ref} add -f -m '${r.replace(/'/g,"'\\''")}' ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch(i){throw new Error(`Failed to add git note to ${e}: ${i.message}`)}}getNote(e){try{return Cn(`git notes --ref ${this.ref} show ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim()}catch{return null}}listNotes(){let e=new Map;try{let r=Cn(`git notes --ref ${this.ref} list`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(!r)return e;let i=r.split(`
472
- `);for(let t of i){let[o,s]=t.split(" ");if(s){let a=this.getNote(s);a&&e.set(s,a)}}}catch{}return e}removeNote(e){try{Cn(`git notes --ref ${this.ref} remove ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}push(e="origin"){try{Cn(`git push ${e} ${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch(r){throw new Error(`Failed to push git notes to ${e}: ${r.message}`)}}fetch(e="origin"){try{Cn(`git fetch ${e} ${this.ref}:${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}};J();var jn=$.child({module:"persistence-service"}),nt=class{gitNotes;repoPath;constructor(e){this.repoPath=e,this.gitNotes=new os(e)}async syncMissionToGitNotes(e){let{missions:r,intentLogs:i}=j.getInstance(this.repoPath),t=r.findById(e);if(!t)throw new Error(`Mission ${e} not found`);if(!t.commit_sha){jn.warn({missionId:e},"Cannot sync mission without commit_sha");return}jn.info({missionId:e,commitSha:t.commit_sha},"Syncing mission to Git Notes");let o=r.getArtifacts(e),s=i.findByMission(e,1e3),a=s.find(u=>u.type==="adr"),c=s.filter(u=>u.type==="decision").map(u=>({content:u.content,symbol_name:u.symbol_name,created_at:u.created_at})),l={version:"1.0",mission:{name:t.name,goal:t.goal,status:t.status,strategy_graph:t.strategy_graph,git_branch:t.git_branch,commit_sha:t.commit_sha,parent_id:t.parent_id,verification_context:t.verification_context,outcome_contract:t.outcome_contract,created_at:t.created_at,updated_at:t.updated_at},artifacts:o,adr:a?a.content:null,decisions:c};this.gitNotes.addNote(t.commit_sha,JSON.stringify(l,null,2))}async syncAllToGitNotes(){let{missions:e}=j.getInstance(this.repoPath),r=e.findActive(),i=e.findRecentCompleted(10),t=[...r,...i];for(let o of t)try{await this.syncMissionToGitNotes(o.id)}catch(s){jn.error({missionId:o.id,error:s},"Failed to sync mission")}}async recoverFromGitNotes(){let e=this.gitNotes.listNotes(),{missions:r,intentLogs:i}=j.getInstance(this.repoPath),t=0,o=0;for(let[s,a]of e.entries())try{let c=JSON.parse(a);if(c.version!=="1.0")continue;if(r.findByCommitShas([s]).some(d=>d.name===c.mission.name)){jn.debug({commitSha:s,missionName:c.mission.name},"Mission already exists, skipping recovery");continue}let p=r.create({name:c.mission.name,goal:c.mission.goal,status:c.mission.status,strategy_graph:c.mission.strategy_graph,git_branch:c.mission.git_branch,commit_sha:s,parent_id:c.mission.parent_id,verification_context:c.mission.verification_context,outcome_contract:c.mission.outcome_contract});if(t++,c.adr&&(i.create({mission_id:Number(p),symbol_id:null,file_path:null,type:"adr",content:c.adr,confidence:1,symbol_name:null,signature:null,commit_sha:s}),o++),c.decisions&&c.decisions.length>0)for(let d of c.decisions)i.create({mission_id:Number(p),symbol_id:null,file_path:null,type:"decision",content:d.content,confidence:1,symbol_name:d.symbol_name,signature:null,commit_sha:s}),o++;jn.info({commitSha:s,missionName:c.mission.name,logsRecovered:o},"Re-hydrated mission from Git Notes")}catch(c){jn.error({commitSha:s,error:c},"Failed to parse Git Note for recovery")}return{missionsRecovered:t,logsRecovered:o}}};var ss=$.child({module:"mcp:tools:ops:plan"});async function sg(n){let{repoPath:e,name:r,goal:i,strategy:t,missionId:o,parentId:s,outcomeContract:a,templateId:c,templateVars:l}=n,{missions:u}=j.getInstance(e),p=_e(e),d=He(e);ss.info({repoPath:e,name:r,missionId:o,templateId:c},"Planning mission");try{let m=r,f=i,h=t;if(c){let x=Vh(c,r,l||{});m=m??x.name,f=f??x.goal,h=h??x.strategy}if(!m||!f)throw new Error("Mission requires name and goal (or templateId with optional templateVars).");let _=null;if(h){let x=ft.normalize(h);_=ft.stringify(x);let I=ft.validate(_);I.valid||ss.warn({errors:I.errors,strategy:h},"Strategy validation warnings detected")}let v,g;o?(u.update(o,{name:m,goal:f,strategy_graph:_,commit_sha:d,parent_id:s!==void 0?s:void 0,outcome_contract:a}),v=o,g=`Mission "${m}" updated.`):(v=u.create({name:m,goal:f,strategy_graph:_,status:"planned",git_branch:p,commit_sha:d,parent_id:s||null,verification_context:null,outcome_contract:a||null}),g=`Mission "${m}" planned.`);try{await new nt(e).syncMissionToGitNotes(Number(v))}catch(x){ss.warn({syncError:x,missionId:v},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:v,status:"planned",message:g,strategy_saved:!!h,contract_saved:!!a,from_template:c??void 0,commit:d},null,2)}]}}catch(m){throw ss.error({error:m,repoPath:e},"Failed to plan mission"),new Error(`Failed to plan mission: ${m instanceof Error?m.message:String(m)}`)}}J();Q();Q();J();J();var v$=$.child({module:"reasoning-engine"}),as=class{analyze(e){v$.debug({logCount:e.length},"Performing reasoning pass over intent logs");let r={context:[],decisions:[],consequences:[],recommendations:[],unclassified:[]};for(let i of e){let t=i.content.toLowerCase(),o=this.matchesContext(t,i.type),s=this.matchesDecision(t,i.type),a=this.matchesConsequence(t,i.type),c=this.matchesRecommendation(t,i.type);o?r.context.push(i.content):s?r.decisions.push(i.content):c?r.recommendations.push(i.content):a?r.consequences.push(i.content):i.type==="decision"?r.decisions.push(i.content):i.type==="discovery"||i.type==="fix"?r.consequences.push(i.content):r.unclassified.push(i.content)}return r}matchesContext(e,r){return["because","since","given","due to","context: ","problem: ","situation:"].some(t=>e.includes(t))||r==="blocker"}matchesDecision(e,r){return["decided","chose","implemented","integrated","using","selected","strategy:"].some(t=>e.includes(t))||r==="decision"}matchesConsequence(e,r){return["results in","enables","allows","impact: ","consequence: ","next steps: ","meaning"].some(t=>e.includes(t))||r==="fix"}matchesRecommendation(e,r){return["should","recommend","suggest","next work","future","consider","strategy advice"].some(t=>e.includes(t))}};var cs=$.child({module:"briefing-engine"}),Nt=class{intentLogs;missions;reasoningEngine;persistencePivot;constructor(e){let{intentLogs:r,missions:i}=j.getInstance(e);this.intentLogs=r,this.missions=i,this.reasoningEngine=new as,this.persistencePivot=new nt(e)}async distillMission(e,r=!0){cs.info({missionId:e},"Synthesizing mission intelligence into Tactical Briefing...");let i=this.gatherConsolidatedLogs(e);if(i.length===0)return{missionId:e,adr:"No intent logs found for this mission.",metrics:{totalLogs:0,symbolCount:0}};let t=this.reasoningEngine.analyze(i),o=new Set(i.map(a=>a.symbol_name).filter(Boolean)),s=`# Architectural Decision Record: Mission #${e}
480
+ After that, ${e} and other tools will work.`+Fr;return zt("FILE_NOT_FOUND",r,{repoPath:n,toolName:e,requiresIndexing:!0})}return null}async function Vh(n){return{resources:Lh}}async function qh(n){let e=n.params.uri;throw Jh(e)?new Error(`Resource not found: ${e}`):new Error(`Invalid resource URI: ${e}`)}K();import{execSync as Yt}from"child_process";import Zr from"path";import rd from"fs";function _e(n){try{if(!rd.existsSync(Zr.join(n,".git")))return null;let e=Yt("git rev-parse --abbrev-ref HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return e==="HEAD"?Yt("git rev-parse --short HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():e.replace(/[\/\\:*"<>|?]/g,"-")}catch{return null}}function He(n){try{return rd.existsSync(Zr.join(n,".git"))?Yt("git rev-parse HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():null}catch{return null}}function Yh(n,e=50){try{let r=Yt(`git rev-list --max-count=${e} HEAD`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return r?r.split(`
481
+ `):[]}catch{return[]}}function Xh(n,e,r){try{return Yt(`git merge-tree --write-tree ${e} ${r}`,{cwd:n,stdio:["ignore","ignore","ignore"]}),!1}catch{return!0}}var R$=new Set([".ts",".tsx",".yaml",".yml",".php",".py",".go",".prisma",".graphql",".gql"]),P$=new Set(["package.json","lerna.json","turbo.json","pnpm-workspace.yaml"]),N$=new Set(["node_modules",".git","dist","build","vendor",".next",".cache","coverage"]);function Kh(n){let e=n.split("/");for(let t of e)if(N$.has(t))return!1;if(n.endsWith(".min.js"))return!1;let r=Zr.basename(n);if(r.startsWith("Dockerfile")||r.startsWith(".env")||P$.has(r))return!0;let i=Zr.extname(r).toLowerCase();return R$.has(i)}function z$(n){let e=n.trim(),r=e.indexOf(" -> ");if(r!==-1)return e.substring(r+4);let i=e.split(/\s+/);return i.length>=2?i[i.length-1]:e}function Qh(n,e){try{if(!rd.existsSync(Zr.join(n,".git")))return!0;let r=He(n);if(!r)return!0;if(e&&e!==r){let t=Yt(`git diff --name-only ${e} ${r}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(t&&t.split(`
482
+ `).some(o=>o&&Kh(o)))return!0}let i=Yt("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return i?i.split(`
483
+ `).some(t=>t?Kh(z$(t)):!1):!1}catch{return!0}}K();var D$=x.child({module:"strategy-normalizer"}),ht=class{static normalize(e){if(!e)return{steps:[]};let r;if(typeof e=="string")try{r=JSON.parse(e)}catch(t){return D$.warn({strategyInput:e,err:t},"Failed to parse strategy JSON"),{steps:[]}}else r=e;return{steps:this.normalizeSteps(r)}}static normalizeSteps(e){return Array.isArray(e)?e.map((r,i)=>typeof r=="string"?{id:`step-${i}`,description:r,status:"pending"}:typeof r=="object"&&r!==null?{id:r.id||`step-${i}`,description:r.description||r.content||r.name||`Step ${i+1}`,status:r.status||"pending",dependencies:r.dependencies||r.deps,verification:r.verification,...r}:{id:`step-${i}`,description:String(r),status:"pending"}):e.steps&&Array.isArray(e.steps)?this.normalizeSteps(e.steps):typeof e=="object"?Object.entries(e).map(([r,i],t)=>typeof i=="string"?{id:r,description:i,status:"pending"}:typeof i=="object"&&i!==null?{id:r,description:i.description||i.content||i.name||r,status:i.status||"pending",dependencies:i.dependencies||i.deps,verification:i.verification,...i}:{id:r||`step-${t}`,description:String(i),status:"pending"}):[]}static stringify(e){return JSON.stringify(e,null,2)}static validate(e){let r=[];if(!e)return{valid:!0,errors:[]};try{let i=this.normalize(e),t=new Set;for(let o of i.steps)if(t.has(o.id)&&r.push(`Duplicate step ID: ${o.id}`),t.add(o.id),o.dependencies)for(let s of o.dependencies)t.has(s)||r.push(`Step "${o.id}" depends on non-existent step "${s}"`);return{valid:r.length===0,errors:r}}catch(i){return r.push(`Strategy validation failed: ${i instanceof Error?i.message:String(i)}`),{valid:!1,errors:r}}}};K();import id from"fs";import eg from"path";import O$ from"os";var L$=[{id:"step-0",description:"Analyze impact: identify dependents and call sites",status:"pending"},{id:"step-1",description:"Implement refactor and update call sites",status:"pending"},{id:"step-2",description:"Run tests and verify behavior; update docs if needed",status:"pending"}],A$=[{id:"step-0",description:"Capture requirements and acceptance criteria",status:"pending"},{id:"step-1",description:"Implement feature with tests",status:"pending"},{id:"step-2",description:"Integrate and verify end-to-end",status:"pending"}],C$=[{id:"step-0",description:"Reproduce the bug and document steps",status:"pending"},{id:"step-1",description:"Diagnose root cause and plan fix",status:"pending"},{id:"step-2",description:"Apply fix and add/update regression test",status:"pending"},{id:"step-3",description:"Verify fix and run full test suite",status:"pending"}],tg=[{id:"refactoring",name:"Refactoring",description:"Impact analysis \u2192 implementation \u2192 verification",defaultGoal:"Refactor {{target}} safely with full impact analysis and verification.",steps:L$},{id:"feature",name:"Feature",description:"Requirements \u2192 implementation \u2192 testing",defaultGoal:"Implement {{target}} with clear requirements and end-to-end verification.",steps:A$},{id:"bug-fix",name:"Bug fix",description:"Reproduction \u2192 diagnosis \u2192 fix \u2192 regression test",defaultGoal:"Fix {{target}}: reproduce, diagnose, fix, and add regression test.",steps:C$}],od=new Map(tg.map(n=>[n.id,n])),is=!1;function j$(){if(is)return;let n=eg.join(O$.homedir(),".shadow","templates");if(!id.existsSync(n)){x.debug({templatesDir:n},"Custom templates directory does not exist"),is=!0;return}try{let e=id.readdirSync(n).filter(r=>r.endsWith(".json"));for(let r of e)try{let i=eg.join(n,r),t=id.readFileSync(i,"utf8"),o=JSON.parse(t);if(!o.id||!o.name||!o.defaultGoal||!o.steps){x.warn({file:r,template:o},"Invalid custom template structure - skipping");continue}if(!Array.isArray(o.steps)||o.steps.length===0){x.warn({file:r},"Template has no steps - skipping");continue}if(tg.some(s=>s.id===o.id)){x.warn({file:r,templateId:o.id},"Custom template ID conflicts with built-in - skipping");continue}od.set(o.id,o),x.info({file:r,templateId:o.id},"Loaded custom template")}catch(i){x.warn({file:r,error:i},"Failed to load custom template")}is=!0}catch(e){x.warn({error:e,templatesDir:n},"Failed to read custom templates directory"),is=!0}}function M$(n){return j$(),od.get(n)}function U$(n,e){let r=n;for(let[i,t]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),t);return r}function ng(n,e,r={}){let i=M$(n);if(!i)throw new Error(`Unknown template: ${n}. Use one of: ${Array.from(od.keys()).join(", ")}`);let t=r.target||"scope",o=e||(n==="refactoring"?`Refactor ${t}`:n==="feature"?`Feature: ${t}`:`Fix: ${t}`),s=U$(i.defaultGoal,{...r,target:t}),a=ht.normalize({steps:i.steps}),c=ht.stringify(a);return{name:o,goal:s,strategy:c}}te();te();import{execSync as Jn}from"child_process";var ys=class{constructor(e,r="refs/notes/shadow"){this.repoPath=e;this.ref=r}addNote(e,r){try{Jn(`git notes --ref ${this.ref} add -f -m '${r.replace(/'/g,"'\\''")}' ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch(i){throw new Error(`Failed to add git note to ${e}: ${i.message}`)}}getNote(e){try{return Jn(`git notes --ref ${this.ref} show ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim()}catch{return null}}listNotes(){let e=new Map;try{let r=Jn(`git notes --ref ${this.ref} list`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(!r)return e;let i=r.split(`
484
+ `);for(let t of i){let[o,s]=t.split(" ");if(s){let a=this.getNote(s);a&&e.set(s,a)}}}catch{}return e}removeNote(e){try{Jn(`git notes --ref ${this.ref} remove ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}push(e="origin"){try{Jn(`git push ${e} ${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch(r){throw new Error(`Failed to push git notes to ${e}: ${r.message}`)}}fetch(e="origin"){try{Jn(`git fetch ${e} ${this.ref}:${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}};K();var Gn=x.child({module:"persistence-service"}),Be=class{gitNotes;repoPath;constructor(e){this.repoPath=e,this.gitNotes=new ys(e)}async syncMissionToGitNotes(e){let{missions:r,intentLogs:i}=A.getInstance(this.repoPath),t=r.findById(e);if(!t)throw new Error(`Mission ${e} not found`);if(!t.commit_sha){Gn.warn({missionId:e},"Cannot sync mission without commit_sha");return}Gn.info({missionId:e,commitSha:t.commit_sha},"Syncing mission to Git Notes");let o=r.getArtifacts(e),s=i.findByMission(e,1e3),a=s.find(u=>u.type==="adr"),c=s.filter(u=>u.type==="decision").map(u=>({content:u.content,symbol_name:u.symbol_name,created_at:u.created_at})),l={version:"1.0",mission:{name:t.name,goal:t.goal,status:t.status,strategy_graph:t.strategy_graph,git_branch:t.git_branch,commit_sha:t.commit_sha,parent_id:t.parent_id,verification_context:t.verification_context,outcome_contract:t.outcome_contract,created_at:t.created_at,updated_at:t.updated_at},artifacts:o,adr:a?a.content:null,decisions:c};this.gitNotes.addNote(t.commit_sha,JSON.stringify(l,null,2))}async syncAllToGitNotes(){let{missions:e}=A.getInstance(this.repoPath),r=e.findActive(),i=e.findRecentCompleted(10),t=[...r,...i];for(let o of t)try{await this.syncMissionToGitNotes(o.id)}catch(s){Gn.error({missionId:o.id,error:s},"Failed to sync mission")}}async recoverFromGitNotes(){let e=this.gitNotes.listNotes(),{missions:r,intentLogs:i}=A.getInstance(this.repoPath),t=0,o=0;for(let[s,a]of e.entries())try{let c=JSON.parse(a);if(c.version!=="1.0")continue;if(r.findByCommitShas([s]).some(d=>d.name===c.mission.name)){Gn.debug({commitSha:s,missionName:c.mission.name},"Mission already exists, skipping recovery");continue}let p=r.create({name:c.mission.name,goal:c.mission.goal,status:c.mission.status,strategy_graph:c.mission.strategy_graph,git_branch:c.mission.git_branch,commit_sha:s,parent_id:c.mission.parent_id,verification_context:c.mission.verification_context,outcome_contract:c.mission.outcome_contract});if(t++,c.adr&&(i.create({mission_id:Number(p),symbol_id:null,file_path:null,type:"adr",content:c.adr,confidence:1,symbol_name:null,signature:null,commit_sha:s}),o++),c.decisions&&c.decisions.length>0)for(let d of c.decisions)i.create({mission_id:Number(p),symbol_id:null,file_path:null,type:"decision",content:d.content,confidence:1,symbol_name:d.symbol_name,signature:null,commit_sha:s}),o++;Gn.info({commitSha:s,missionName:c.mission.name,logsRecovered:o},"Re-hydrated mission from Git Notes")}catch(c){Gn.error({commitSha:s,error:c},"Failed to parse Git Note for recovery")}return{missionsRecovered:t,logsRecovered:o}}};var vs=x.child({module:"mcp:tools:ops:plan"});async function Eg(n){let{repoPath:e,name:r,goal:i,strategy:t,missionId:o,parentId:s,outcomeContract:a,templateId:c,templateVars:l}=n,{missions:u}=A.getInstance(e),p=_e(e),d=He(e);vs.info({repoPath:e,name:r,missionId:o,templateId:c},"Planning mission");try{let m=r,f=i,h=t;if(c){let b=ng(c,r,l||{});m=m??b.name,f=f??b.goal,h=h??b.strategy}if(!m||!f)throw new Error("Mission requires name and goal (or templateId with optional templateVars).");let _=null;if(h){let b=ht.normalize(h);_=ht.stringify(b);let S=ht.validate(_);S.valid||vs.warn({errors:S.errors,strategy:h},"Strategy validation warnings detected")}let v,g;o?(u.update(o,{name:m,goal:f,strategy_graph:_,commit_sha:d,parent_id:s!==void 0?s:void 0,outcome_contract:a}),v=o,g=`Mission "${m}" updated.`):(v=u.create({name:m,goal:f,strategy_graph:_,status:"planned",git_branch:p,commit_sha:d,parent_id:s||null,verification_context:null,outcome_contract:a||null}),g=`Mission "${m}" planned.`);try{await new Be(e).syncMissionToGitNotes(Number(v))}catch(b){vs.warn({syncError:b,missionId:v},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:v,status:"planned",message:g,strategy_saved:!!h,contract_saved:!!a,from_template:c??void 0,commit:d},null,2)}]}}catch(m){throw vs.error({error:m,repoPath:e},"Failed to plan mission"),new Error(`Failed to plan mission: ${m instanceof Error?m.message:String(m)}`)}}K();te();te();K();K();var Q$=x.child({module:"reasoning-engine"}),Vn=class{analyze(e){Q$.debug({logCount:e.length},"Performing reasoning pass over intent logs");let r={context:[],decisions:[],consequences:[],recommendations:[],unclassified:[]};for(let i of e){let t=i.content.toLowerCase(),o=this.matchesContext(t,i.type),s=this.matchesDecision(t,i.type),a=this.matchesConsequence(t,i.type),c=this.matchesRecommendation(t,i.type);o?r.context.push(i.content):s?r.decisions.push(i.content):c?r.recommendations.push(i.content):a?r.consequences.push(i.content):i.type==="decision"?r.decisions.push(i.content):i.type==="discovery"||i.type==="fix"?r.consequences.push(i.content):r.unclassified.push(i.content)}return r}matchesContext(e,r){return["because","since","given","due to","context: ","problem: ","situation:"].some(t=>e.includes(t))||r==="blocker"}matchesDecision(e,r){return["decided","chose","implemented","integrated","using","selected","strategy:"].some(t=>e.includes(t))||r==="decision"}matchesConsequence(e,r){return["results in","enables","allows","impact: ","consequence: ","next steps: ","meaning"].some(t=>e.includes(t))||r==="fix"}matchesRecommendation(e,r){return["should","recommend","suggest","next work","future","consider","strategy advice"].some(t=>e.includes(t))}};var _s=x.child({module:"briefing-engine"}),gt=class{intentLogs;missions;reasoningEngine;persistencePivot;constructor(e){let{intentLogs:r,missions:i}=A.getInstance(e);this.intentLogs=r,this.missions=i,this.reasoningEngine=new Vn,this.persistencePivot=new Be(e)}async distillMission(e,r=!0){_s.info({missionId:e},"Synthesizing mission intelligence into Tactical Briefing...");let i=this.gatherConsolidatedLogs(e);if(i.length===0)return{missionId:e,adr:"No intent logs found for this mission.",metrics:{totalLogs:0,symbolCount:0}};let t=this.reasoningEngine.analyze(i),o=new Set(i.map(a=>a.symbol_name).filter(Boolean)),s=`# Architectural Decision Record: Mission #${e}
473
485
 
474
486
  `;if(s+=`## Summary of Intent
475
487
  `,s+=`Collected ${i.length} intent events across ${o.size} symbols.
@@ -491,9 +503,9 @@ After that, ${e} and other tools will work.`+Ar;return Pt("FILE_NOT_FOUND",r,{re
491
503
  `}),s+=`
492
504
  `),s+=`
493
505
  ---
494
- *Generated by Liquid Shadow Reasoning Engine v1*`,r){this.intentLogs.create({mission_id:e,type:"adr",content:s,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:null});try{await this.persistencePivot.syncMissionToGitNotes(e),cs.info({missionId:e},"Tactical Briefing synthesized, archived, and synced to Git Notes.")}catch(a){cs.error({missionId:e,error:a},"Failed to sync ADR to Git Notes")}}else cs.info({missionId:e},"Tactical Briefing synthesized (dry-run).");return{missionId:e,adr:s,metrics:{totalLogs:i.length,symbolCount:o.size}}}gatherConsolidatedLogs(e,r=0){let i=this.intentLogs.findByMission(e,500);if(r>2)return i;let t=this.missions.findByParentId(e);for(let o of t)i.push(...this.gatherConsolidatedLogs(o.id,r+1));return i.filter(o=>o.type!=="adr"&&o.type!=="system")}};J();import{Visitor as _$}from"@swc/core/Visitor.js";import*as ag from"@swc/core";var b$=$.child({module:"verification-engine"}),Yp=class extends _${foundUsage=!1;foundImport=!1;rule;currentFunctionName=null;constructor(e){super(),this.rule=e}visitImportDeclaration(e){return this.rule.type==="import"&&e.source.value===this.rule.target&&(this.foundImport=!0),super.visitImportDeclaration(e)}visitFunctionDeclaration(e){let r=this.currentFunctionName;this.currentFunctionName=e.identifier.value;let i=super.visitFunctionDeclaration(e);return this.currentFunctionName=r,i}visitCallExpression(e){return this.rule.type==="usage"&&e.callee.type==="Identifier"&&e.callee.value===this.rule.target&&(!this.rule.context||this.currentFunctionName===this.rule.context)&&(this.foundUsage=!0),super.visitCallExpression(e)}},ls=class{async verify(e,r){try{let i=await ag.parse(e,{syntax:"typescript",tsx:!0,comments:!1}),t=new Yp(r);t.visitProgram(i);let o=!1,s=[];if(r.type==="import")o=t.foundImport,o||s.push(`Required import "${r.target}" not found.`);else if(r.type==="usage"){if(o=t.foundUsage,!o){let a=r.context?` in function "${r.context}"`:"";s.push(`Required usage of "${r.target}"${a} not found.`)}}else r.type==="pattern"&&(o=new RegExp(r.target).test(e),o||s.push(`Required pattern "${r.target}" not found.`));return{passed:o,errors:s}}catch(i){return b$.error({error:i},"Verification failed due to parse error"),{passed:!1,errors:[`Parse error: ${i.message}`]}}}};import cg from"path";import us from"fs";var Mn=$.child({module:"mcp:tools:ops:track"});async function lg(n){let{repoPath:e,missionId:r,stepId:i,status:t,contextPivot:o,updates:s,artifacts:a}=n,{missions:c,intentLogs:l}=j.getInstance(e),u=He(e);Mn.info({repoPath:e,missionId:r,singleStep:i,batchCount:s?.length,artifactCount:a?.length},"Updating mission status");try{if(a&&Array.isArray(a))for(let m of a)c.addArtifact(r,m.type,m.identifier,m.metadata);let p=[];if(s&&Array.isArray(s)&&p.push(...s),i&&t&&p.push({stepId:i,status:t,contextPivot:o}),t&&!i){if(c.updateStatus(r,t,u||void 0),l.create({mission_id:r,type:"system",content:`Mission status changed to "${t}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),t==="completed")try{await new Nt(e).distillMission(r),Mn.info({missionId:r},"Auto-Synthesis completed successfully")}catch(m){Mn.warn({synthesisError:m,missionId:r},"Auto-Synthesis deferred or failed")}if(!p.length)return{content:[{type:"text",text:JSON.stringify({missionId:r,status:t,message:"Mission status updated successfully.",artifacts_added:a?.length||0,commit:u},null,2)}]}}if(p.length===0&&(!a||a.length===0))throw new Error("No updates provided. Must specify either 'updates', 'stepId'/'status', 'status' (top-level), or 'artifacts'.");let d=[];for(let m of p){let{stepId:f,status:h,contextPivot:_}=m,v=c.findById(r);if(!v)throw new Error(`Mission ID ${r} not found`);let g=JSON.parse(v.strategy_graph||"{}"),x=null;if(Array.isArray(g)?x=g.find(I=>I.id===f):g.nodes&&Array.isArray(g.nodes)?x=g.nodes.find(I=>I.id===f):g.steps?Array.isArray(g.steps)?x=g.steps.find(I=>I.id===f):x=g.steps[f]:g[f]&&(x=g[f]),!x)throw new Error(`Step ID "${f}" not found`);if(h==="completed"&&x.verification){let I=new ls,E=Array.isArray(x.verification)?x.verification:[x.verification];for(let w of E){let T=w.filePath;if(T&&!cg.isAbsolute(T)&&(T=cg.join(e,T)),T){if(!us.existsSync(T))throw new Error(`Verification failed: File not found at ${T}`);let O=await I.verify(us.readFileSync(T,"utf8"),w);if(!O.passed)throw new Error(`Verification failed: ${O.errors.join("")}`)}else{let O=c.getWorkingSet(r),V=!1;for(let k of O){if(!us.existsSync(k.file_path))continue;if((await I.verify(us.readFileSync(k.file_path,"utf8"),w)).passed){V=!0;break}}if(!V)throw new Error(`Verification failed for rule "${w.target}" in working set.`)}}}if(x.status=h,c.update(r,{strategy_graph:JSON.stringify(g),commit_sha:u}),l.create({mission_id:r,type:"system",content:`Step "${f}" updated to "${h}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),_)try{let I=JSON.parse(_);if(c.clearWorkingSet(r),I.files&&Array.isArray(I.files))for(let E of I.files)c.addToWorkingSet(r,E)}catch(I){Mn.warn({error:I},"Failed to apply context pivot")}d.push({stepId:f,status:h})}try{await new nt(e).syncMissionToGitNotes(r)}catch(m){Mn.warn({syncError:m,missionId:r},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:r,updates:d,artifacts_added:a?.length||0,message:"Status updated",commit:u},null,2)}]}}catch(p){throw Mn.error({error:p,repoPath:e},"Failed to update status"),new Error(`Failed to update status: ${p instanceof Error?p.message:String(p)}`)}}J();Q();Q();J();var ug=$.child({module:"lineage-service"}),Yt=class{repoPath;constructor(e){this.repoPath=e}getAncestorMissionIds(e=50){try{let r=Zh(this.repoPath,e);if(r.length===0)return[];let{missions:i}=j.getInstance(this.repoPath),o=i.findByCommitShas(r).map(s=>s.id);return o.length>0&&ug.debug({count:o.length},"Identified ancestor missions for gravity bleed"),o}catch(r){return ug.warn({err:r.message},"Failed to identify ancestor missions"),[]}}};Q();J();var x$=$.child({module:"collision-service"}),ps=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=_e(this.repoPath);if(!e)return[];let{missions:r,intentLogs:i}=j.getInstance(this.repoPath),t=r.findActive().filter(a=>a.git_branch&&a.git_branch!==e),o=[],s=new Set;for(let a of t){let c=a.git_branch;if(s.has(c))continue;s.add(c),x$.info({branch:c,currentBranch:e},"Checking predictive collisions"),Hh(this.repoPath,e,c)&&o.push({branch:c,type:"file",description:`Background merge-tree detected a file-level conflict between '${e}' and '${c}'.`});let u=r.findActive(e),p=new Set;for(let f of u)r.getWorkingSet(f.id).forEach(h=>p.add(h.file_path));let m=r.getWorkingSet(a.id).filter(f=>p.has(f.file_path));m.length>0&&o.push({branch:c,type:"intent",description:`Logical conflict: Mission '${a.name}' on '${c}' is modifying files you are currently working on.`,conflictingFiles:m.map(f=>f.file_path)})}return o}};Q();Be();J();import{execSync as Dg}from"child_process";import E$ from"path";var bs=$.child({module:"shadow-trace"}),Dt=class{intentLogs;exports;repoPath;hologramService;constructor(e){let{intentLogs:r,exports:i}=j.getInstance(e);this.intentLogs=r,this.exports=i,this.repoPath=e,this.hologramService=new le(e)}analyzeGhostChanges(e){let r=e?`${e}..HEAD`:"HEAD~1..HEAD",i=[];try{let o=Dg(`git diff --name-only ${r}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
495
- `).filter(s=>s.trim()!=="");if(o.length===0)return;bs.info({files:o.length,range:r},"Initiating Shadow Trace analysis...");for(let s of o){let a=E$.join(this.repoPath,s),l=Dg(`git diff -U0 ${r} -- ${s}`,{cwd:this.repoPath,encoding:"utf-8"}).matchAll(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/g);for(let u of l){let p=parseInt(u[2],10),d=this.exports.findAtLine(a,p);d&&(this.intentLogs.create({mission_id:0,file_path:a,symbol_id:d.id,type:"discovery",content:`Shadow Trace: Modified externally in ${r}`,confidence:.8,symbol_name:d.name,signature:d.signature,commit_sha:null}),bs.debug({symbol:d.name},"Logged ghost change"),i.push({from:"external",to:`${s}:${d.name}`,pattern:"git-delta",confidence:.8}))}}i.length>0&&this.hologramService.updateGhostBridges(i),bs.info("Shadow Trace complete.")}catch(t){bs.warn({err:t.message},"Shadow Trace failed: git diff error.")}}};Q();J();import{execSync as Og}from"child_process";var Qt=$.child({module:"nano-repair"}),Pe=class{intentLogs;exports;missions;repoPath;constructor(e){let{intentLogs:r,exports:i,missions:t}=j.getInstance(e);this.intentLogs=r,this.exports=i,this.missions=t,this.repoPath=e}detectAndRepairShifts(){let e=this.intentLogs.findRepairableOrphans();if(e.length===0)return{repaired:0,failed:0};Qt.info({count:e.length},"Detected orphaned intent logs. Attempting recovery...");let r=0,i=0;for(let t of e){let o=this.exports.findByNameAndFile(t.symbol_name,t.file_path);if(o.length>0){let a=o.find(c=>c.signature===t.signature)||o[0];this.intentLogs.update(t.id,{symbol_id:a.id}),Qt.info({logId:t.id,symbol:t.symbol_name},"Relinked symbol in same file"),r++;continue}let s=this.exports.findByNameGlobal(t.symbol_name);if(s.length>0){let a=s.filter(c=>c.file_path!==t.file_path);if(a.length>0){let c=a.find(l=>l.signature===t.signature)||a[0];this.intentLogs.update(t.id,{symbol_id:c.id,file_path:c.file_path}),Qt.info({logId:t.id,symbol:t.symbol_name,oldPath:t.file_path,newPath:c.file_path},"Detected Nano-Repair Shift (file move)"),r++;continue}}i++}return r>0&&Qt.info({repaired:r,failed:i},"Nano-Repair recovery complete"),{repaired:r,failed:i}}syncLifecycle(){let e="HEAD";try{e=Og("git rev-parse --abbrev-ref HEAD",{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return{suspended:0,resumed:0,completed:0}}if(!e)return{suspended:0,resumed:0,completed:0};let r=this.missions.findActive(),i=0;for(let s of r)s.git_branch&&s.git_branch!==e&&(this.missions.updateStatus(s.id,"suspended"),Qt.info({missionId:s.id,branch:s.git_branch,current:e},"Context Pivot: Suspended mission"),i++);this.missions.resumeByBranch(e);let t=[];try{t=Og(`git branch --merged "${e}"`,{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).split(`
496
- `).map(a=>a.trim().replace(/^\* /,"")).filter(a=>a&&a!==e)}catch{}let o=0;if(t.length>0){let s=this.missions.findMergedMissions(e,t);for(let a of s)this.missions.updateStatus(a.id,"completed"),Qt.info({missionId:a.id,branch:a.git_branch},"Merge Sentinel: Auto-completed mission"),o++}return(i>0||o>0)&&Qt.info({suspended:i,completed:o},"Git-Native Lifecycle Sync complete"),{suspended:i,resumed:-1,completed:o}}};var jr=$.child({module:"mcp:tools:ops:briefing"});async function xs(n){let{repoPath:e,missionId:r,scope:i="mission",activeMissionsLimit:t,recentActivityLimit:o=10,compact:s=!1}=n,{missions:a,intentLogs:c}=j.getInstance(e),l=He(e),u=_e(e);jr.info({repoPath:e,missionId:r,scope:i},"Generating briefing");try{if(i==="project"){let h=a.findActive(u||void 0),_=h.length;t&&h.length>t&&(h=h.slice(0,t));let v=a.findParentOnlyIds(h),g=new Set(v),x=h.filter(C=>!g.has(C.id)),I={};for(let C of h)C.parent_id!=null&&(I[C.parent_id]||(I[C.parent_id]=[]),I[C.parent_id].push(C));let E={},w=new Map(h.map(C=>[C.id,C])),T=Object.keys(I).map(Number),O=T.filter(C=>!w.has(C)),V=O.length>0?a.findByIds(O):[],k=new Map(w);for(let C of V)k.set(C.id,C);for(let C of T){let A=k.get(C);A&&(E[C]={id:A.id,name:A.name??"",goal:A.goal??"",status:A.status??"unknown"})}let D=s?h.map(C=>({...C,strategy_graph:void 0})):h,H=s?x.map(C=>({...C,strategy_graph:void 0})):x,L=c.findRecentDecisionActivity(o),Y={scope:"project",counts:a.getStats(),analytics:a.getAnalytics(),active_missions:D,parent_only_ids:v,missions_by_parent:s?Object.fromEntries(Object.entries(I).map(([C,A])=>[C,A.map(Z=>({...Z,strategy_graph:void 0}))])):I,parents_summary:Object.keys(E).length?E:void 0,close_parent_when_all_children_done:'When all children of a parent are completed, call shadow_ops_track({ missionId: <parent_id>, status: "completed" }) with no stepId.',next_work_candidates:H,recent_completed:a.findRecentCompleted(),recent_activity:L,meta:{current_branch:u,current_commit:l,activeMissionsTotal:_,activeMissionsShown:h.length,hasMoreMissions:t?_>t:!1}};if(i==="project"){let C=v.map(A=>{let Z=h.find(F=>F.id===A),W=I[A]??[];return{parent:Z,children:W}});Y.missions_grouped_by_parent=C}let U=x.length===0?{tool:"shadow_ops_plan",reason:"No open work; create a mission"}:{tool:"shadow_ops_track",reason:"Pick one from next_work_candidates and run /continue"};return{content:[{type:"text",text:JSON.stringify(Y,null,2)}],suggestedNext:U}}let p;if(r?p=a.findById(r):p=a.findActive(u||void 0)[0],!p)return{content:[{type:"text",text:"No active missions found. Ready for new assignment."}]};let d="No external shadow changes detected.";try{new Dt(e).analyzeGhostChanges(p.commit_sha||void 0),d="Shadow Trace completed: Checked for external modifications."}catch(h){jr.warn({error:h},"Ghost analysis failed")}let m={repaired:0,failed:0};try{m=new Pe(e).detectAndRepairShifts()}catch(h){jr.warn({error:h},"Symbol shift repair failed")}let f={mission:{id:p.id,name:p.name,goal:p.goal,status:p.status,last_updated:new Date(p.updated_at*1e3).toISOString(),git_branch:p.git_branch,commit_sha:p.commit_sha,outcome_contract:p.outcome_contract},artifacts:a.getArtifacts(p.id),shadow_trace:{ghost_analysis:d,symbols_repaired:m.repaired,symbols_missing:m.failed},context:{current_commit:l,working_set:a.getWorkingSet(p.id).map(h=>h.file_path)},strategy_snapshot:p.strategy_graph?JSON.parse(p.strategy_graph):null,recent_activity:c.findByMission(p.id,15),ancestor_activity:[],predictive_collisions:[]};try{let h=new ps(e);f.predictive_collisions=await h.analyzePotentialCollisions()}catch(h){jr.warn({error:h},"Predictive collision analysis failed")}if(i==="mission"){let v=new Yt(e).getAncestorMissionIds().filter(g=>g!==p?.id);if(v.length>0)for(let g of v){let x=c.findByMission(g,5);f.ancestor_activity.push(...x)}}return{content:[{type:"text",text:JSON.stringify(f,null,2)}]}}catch(p){throw jr.error({error:p,repoPath:e},"Failed to generate briefing"),new Error(`Failed to generate briefing: ${p instanceof Error?p.message:String(p)}`)}}Q();J();var Ag=$.child({module:"mcp:tools:ops:synthesize"});async function Lg(n){let{repoPath:e,missionId:r}=n;Ag.info({repoPath:e,missionId:r},"Synthesizing mission");let{missions:i}=j.getInstance(e);try{if(!i.findById(r))throw new Error(`Mission ${r} not found`);let s=await new Nt(e).distillMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,adr:s.adr,metrics:s.metrics},null,2)}]}}catch(t){throw Ag.error({error:t,repoPath:e},"Failed to synthesize ADR"),new Error(`Failed to synthesize ADR: ${t instanceof Error?t.message:String(t)}`)}}J();Q();J();var w$=$.child({module:"narrative-service"}),Un=class{missions;briefingEngine;repoPath;constructor(e){this.repoPath=e;let{missions:r}=j.getInstance(e);this.missions=r,this.briefingEngine=new Nt(e)}async generateChronicle(e={}){w$.info(e,"Generating Repo Chronicle...");let i=this.missions.findAll().filter(l=>l.parent_id===null&&l.status!=="planned");e.since&&(i=i.filter(l=>l.updated_at>=e.since)),e.until&&(i=i.filter(l=>l.updated_at<=e.until)),i.sort((l,u)=>u.updated_at-l.updated_at);let t=e.offset||0,o=e.limit||10;i=i.slice(t,t+o);let s=[],a=[],c=[];for(let l of i){let u=this.missions.findByParentId(l.id),p=u.length>0,d=await this.briefingEngine.distillMission(l.id,!1);if(p){let m=[];for(let h of u)m.push(await this.mapMissionToEpisode(h));m.unshift(await this.mapMissionToEpisode(l));let f={kind:"initiative",root_mission_id:l.id,title:l.name,strategy_graph:l.strategy_graph?JSON.parse(l.strategy_graph):{},episodes:m,synthesized_narrative:d.adr};s.push(f),c.push(f)}else{let m=await this.mapMissionToEpisode(l,d.adr);a.push(m),c.push(m)}}return{repo_path:this.repoPath,generated_at:Date.now(),initiatives:s,unattached_episodes:a,timeline:c}}async mapMissionToEpisode(e,r){let i=r;return i||(i=(await this.briefingEngine.distillMission(e.id,!1)).adr),{kind:"episode",mission_id:e.id,title:e.name,goal:e.goal,outcome:e.outcome_contract,intents:[],adr_summary:i}}renderChronicleMarkdown(e){let r=`# Repository Chronicle
506
+ *Generated by Liquid Shadow Reasoning Engine v1*`,r){this.intentLogs.create({mission_id:e,type:"adr",content:s,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:null});try{await this.persistencePivot.syncMissionToGitNotes(e),_s.info({missionId:e},"Tactical Briefing synthesized, archived, and synced to Git Notes.")}catch(a){_s.error({missionId:e,error:a},"Failed to sync ADR to Git Notes")}}else _s.info({missionId:e},"Tactical Briefing synthesized (dry-run).");return{missionId:e,adr:s,metrics:{totalLogs:i.length,symbolCount:o.size}}}gatherConsolidatedLogs(e,r=0){let i=this.intentLogs.findByMissionPreferCrystal(e,500);if(r>2)return i;let t=this.missions.findByParentId(e);for(let o of t)i.push(...this.gatherConsolidatedLogs(o.id,r+1));return i.filter(o=>o.type!=="adr"&&o.type!=="system")}};K();import{Visitor as eS}from"@swc/core/Visitor.js";import*as wg from"@swc/core";var tS=x.child({module:"verification-engine"}),ud=class extends eS{foundUsage=!1;foundImport=!1;rule;currentFunctionName=null;constructor(e){super(),this.rule=e}visitImportDeclaration(e){return this.rule.type==="import"&&e.source.value===this.rule.target&&(this.foundImport=!0),super.visitImportDeclaration(e)}visitFunctionDeclaration(e){let r=this.currentFunctionName;this.currentFunctionName=e.identifier.value;let i=super.visitFunctionDeclaration(e);return this.currentFunctionName=r,i}visitCallExpression(e){return this.rule.type==="usage"&&e.callee.type==="Identifier"&&e.callee.value===this.rule.target&&(!this.rule.context||this.currentFunctionName===this.rule.context)&&(this.foundUsage=!0),super.visitCallExpression(e)}},bs=class{async verify(e,r){try{let i=await wg.parse(e,{syntax:"typescript",tsx:!0,comments:!1}),t=new ud(r);t.visitProgram(i);let o=!1,s=[];if(r.type==="import")o=t.foundImport,o||s.push(`Required import "${r.target}" not found.`);else if(r.type==="usage"){if(o=t.foundUsage,!o){let a=r.context?` in function "${r.context}"`:"";s.push(`Required usage of "${r.target}"${a} not found.`)}}else r.type==="pattern"&&(o=new RegExp(r.target).test(e),o||s.push(`Required pattern "${r.target}" not found.`));return{passed:o,errors:s}}catch(i){return tS.error({error:i},"Verification failed due to parse error"),{passed:!1,errors:[`Parse error: ${i.message}`]}}}};import Ig from"path";import xs from"fs";var ot=x.child({module:"mcp:tools:ops:track"});async function Tg(n,e,r){let{missions:i,intentLogs:t}=A.getInstance(n),o=i.findById(e);if(!o?.parent_id)return;let s=i.findByParentId(o.parent_id);if(!s.every(l=>l.status==="completed"))return;let c=i.findById(o.parent_id);if(!(!c||c.status==="completed")){ot.info({parentId:c.id,childCount:s.length},"All children completed \u2014 cascading parent completion"),i.updateStatus(c.id,"completed",r||void 0),t.create({mission_id:c.id,type:"system",content:`Parent auto-completed: all ${s.length} child missions finished`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:r});try{await new gt(n).distillMission(c.id),ot.info({parentId:c.id},"Parent Auto-Synthesis completed")}catch(l){ot.warn({synthesisError:l,parentId:c.id},"Parent Auto-Synthesis deferred")}try{await new Be(n).syncMissionToGitNotes(c.id)}catch(l){ot.warn({syncError:l,parentId:c.id},"Parent Git Notes sync deferred")}await Tg(n,c.id,r)}}async function Rg(n){let{repoPath:e,missionId:r,stepId:i,status:t,contextPivot:o,updates:s,artifacts:a}=n,{missions:c,intentLogs:l}=A.getInstance(e),u=He(e);ot.info({repoPath:e,missionId:r,singleStep:i,batchCount:s?.length,artifactCount:a?.length},"Updating mission status");try{if(a&&Array.isArray(a))for(let m of a)c.addArtifact(r,m.type,m.identifier,m.metadata);let p=[];if(s&&Array.isArray(s)&&p.push(...s),i&&t&&p.push({stepId:i,status:t,contextPivot:o}),t&&!i){if(c.updateStatus(r,t,u||void 0),l.create({mission_id:r,type:"system",content:`Mission status changed to "${t}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),t==="completed"){try{await new gt(e).distillMission(r),ot.info({missionId:r},"Auto-Synthesis completed successfully")}catch(m){ot.warn({synthesisError:m,missionId:r},"Auto-Synthesis deferred or failed")}await Tg(e,r,u)}if(!p.length)return{content:[{type:"text",text:JSON.stringify({missionId:r,status:t,message:"Mission status updated successfully.",artifacts_added:a?.length||0,commit:u},null,2)}]}}if(p.length===0&&(!a||a.length===0))throw new Error("No updates provided. Must specify either 'updates', 'stepId'/'status', 'status' (top-level), or 'artifacts'.");let d=[];for(let m of p){let{stepId:f,status:h,contextPivot:_}=m,v=c.findById(r);if(!v)throw new Error(`Mission ID ${r} not found`);let g=JSON.parse(v.strategy_graph||"{}"),b=null;if(Array.isArray(g)?b=g.find(S=>S.id===f):g.nodes&&Array.isArray(g.nodes)?b=g.nodes.find(S=>S.id===f):g.steps?Array.isArray(g.steps)?b=g.steps.find(S=>S.id===f):b=g.steps[f]:g[f]&&(b=g[f]),!b)throw new Error(`Step ID "${f}" not found`);if(h==="completed"&&b.verification){let S=new bs,k=Array.isArray(b.verification)?b.verification:[b.verification];for(let w of k){let R=w.filePath;if(R&&!Ig.isAbsolute(R)&&(R=Ig.join(e,R)),R){if(!xs.existsSync(R))throw new Error(`Verification failed: File not found at ${R}`);let j=await S.verify(xs.readFileSync(R,"utf8"),w);if(!j.passed)throw new Error(`Verification failed: ${j.errors.join("")}`)}else{let j=c.getWorkingSet(r),B=!1;for(let T of j){if(!xs.existsSync(T.file_path))continue;if((await S.verify(xs.readFileSync(T.file_path,"utf8"),w)).passed){B=!0;break}}if(!B)throw new Error(`Verification failed for rule "${w.target}" in working set.`)}}}if(b.status=h,c.update(r,{strategy_graph:JSON.stringify(g),commit_sha:u}),l.create({mission_id:r,type:"system",content:`Step "${f}" updated to "${h}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),_)try{let S=JSON.parse(_);if(c.clearWorkingSet(r),S.files&&Array.isArray(S.files))for(let k of S.files)c.addToWorkingSet(r,k)}catch(S){ot.warn({error:S},"Failed to apply context pivot")}d.push({stepId:f,status:h})}try{await new Be(e).syncMissionToGitNotes(r)}catch(m){ot.warn({syncError:m,missionId:r},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:r,updates:d,artifacts_added:a?.length||0,message:"Status updated",commit:u},null,2)}]}}catch(p){throw ot.error({error:p,repoPath:e},"Failed to update status"),new Error(`Failed to update status: ${p instanceof Error?p.message:String(p)}`)}}K();te();te();K();var nS=x.child({module:"collision-service"}),Jr=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=_e(this.repoPath);if(!e)return[];let{missions:r,intentLogs:i}=A.getInstance(this.repoPath),t=r.findActive().filter(a=>a.git_branch&&a.git_branch!==e),o=[],s=new Set;for(let a of t){let c=a.git_branch;if(s.has(c))continue;s.add(c),nS.info({branch:c,currentBranch:e},"Checking predictive collisions"),Xh(this.repoPath,e,c)&&o.push({branch:c,type:"file",description:`Background merge-tree detected a file-level conflict between '${e}' and '${c}'.`});let u=r.findActive(e),p=new Set;for(let f of u)r.getWorkingSet(f.id).forEach(h=>p.add(h.file_path));let m=r.getWorkingSet(a.id).filter(f=>p.has(f.file_path));m.length>0&&o.push({branch:c,type:"intent",description:`Logical conflict: Mission '${a.name}' on '${c}' is modifying files you are currently working on.`,conflictingFiles:m.map(f=>f.file_path)})}return o}};te();Ge();K();import{execSync as Xg}from"child_process";import sS from"path";var Ps=x.child({module:"shadow-trace"}),Lt=class{intentLogs;exports;repoPath;hologramService;constructor(e){let{intentLogs:r,exports:i}=A.getInstance(e);this.intentLogs=r,this.exports=i,this.repoPath=e,this.hologramService=new de(e)}analyzeGhostChanges(e){let r=e?`${e}..HEAD`:"HEAD~1..HEAD",i=[];try{let o=Xg(`git diff --name-only ${r}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
507
+ `).filter(s=>s.trim()!=="");if(o.length===0)return;Ps.info({files:o.length,range:r},"Initiating Shadow Trace analysis...");for(let s of o){let a=sS.join(this.repoPath,s),l=Xg(`git diff -U0 ${r} -- ${s}`,{cwd:this.repoPath,encoding:"utf-8"}).matchAll(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/g);for(let u of l){let p=parseInt(u[2],10),d=this.exports.findAtLine(a,p);d&&(this.intentLogs.create({mission_id:0,file_path:a,symbol_id:d.id,type:"discovery",content:`Shadow Trace: Modified externally in ${r}`,confidence:.8,symbol_name:d.name,signature:d.signature,commit_sha:null}),Ps.debug({symbol:d.name},"Logged ghost change"),i.push({from:"external",to:`${s}:${d.name}`,pattern:"git-delta",confidence:.8}))}}i.length>0&&this.hologramService.updateGhostBridges(i),Ps.info("Shadow Trace complete.")}catch(t){Ps.warn({err:t.message},"Shadow Trace failed: git diff error.")}}};te();K();import{execSync as Qg}from"child_process";var rn=x.child({module:"nano-repair"}),Pe=class{intentLogs;exports;missions;repoPath;constructor(e){let{intentLogs:r,exports:i,missions:t}=A.getInstance(e);this.intentLogs=r,this.exports=i,this.missions=t,this.repoPath=e}detectAndRepairShifts(){let e=this.intentLogs.findRepairableOrphans();if(e.length===0)return{repaired:0,failed:0};rn.info({count:e.length},"Detected orphaned intent logs. Attempting recovery...");let r=0,i=0;for(let t of e){let o=this.exports.findByNameAndFile(t.symbol_name,t.file_path);if(o.length>0){let a=o.find(c=>c.signature===t.signature)||o[0];this.intentLogs.update(t.id,{symbol_id:a.id}),rn.info({logId:t.id,symbol:t.symbol_name},"Relinked symbol in same file"),r++;continue}let s=this.exports.findByNameGlobal(t.symbol_name);if(s.length>0){let a=s.filter(c=>c.file_path!==t.file_path);if(a.length>0){let c=a.find(l=>l.signature===t.signature)||a[0];this.intentLogs.update(t.id,{symbol_id:c.id,file_path:c.file_path}),rn.info({logId:t.id,symbol:t.symbol_name,oldPath:t.file_path,newPath:c.file_path},"Detected Nano-Repair Shift (file move)"),r++;continue}}i++}return r>0&&rn.info({repaired:r,failed:i},"Nano-Repair recovery complete"),{repaired:r,failed:i}}syncLifecycle(){let e="HEAD";try{e=Qg("git rev-parse --abbrev-ref HEAD",{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return{suspended:0,resumed:0,completed:0}}if(!e)return{suspended:0,resumed:0,completed:0};let r=this.missions.findActive(),i=0;for(let s of r)s.git_branch&&s.git_branch!==e&&(this.missions.updateStatus(s.id,"suspended"),rn.info({missionId:s.id,branch:s.git_branch,current:e},"Context Pivot: Suspended mission"),i++);this.missions.resumeByBranch(e);let t=[];try{t=Qg(`git branch --merged "${e}"`,{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).split(`
508
+ `).map(a=>a.trim().replace(/^\* /,"")).filter(a=>a&&a!==e)}catch{}let o=0;if(t.length>0){let s=this.missions.findMergedMissions(e,t);for(let a of s)this.missions.updateStatus(a.id,"completed"),rn.info({missionId:a.id,branch:a.git_branch},"Merge Sentinel: Auto-completed mission"),o++}return(i>0||o>0)&&rn.info({suspended:i,completed:o},"Git-Native Lifecycle Sync complete"),{suspended:i,resumed:-1,completed:o}}};var Ns=class n{constructor(e){this.intentLogs=e}static RECENCY_HALF_LIFE_HOURS=48;static WEIGHTS={recency:.4,activity:.3,statusBoost:.2,blockerBoost:.1};score(e){if(e.length===0)return[];let r=Math.floor(Date.now()/1e3),i=e.map(c=>c.id),t=this.intentLogs.countByMissions(i),o=this.intentLogs.findMissionsWithBlockers(i),s=Math.max(1,...Object.values(t));return e.map(c=>{let l=this.computeRecency(c.updated_at,r),u=(t[c.id]||0)/s,p=this.computeStatusBoost(c.status),d=o.has(c.id)?1:0,m=n.WEIGHTS,f=l*m.recency+u*m.activity+p*m.statusBoost+d*m.blockerBoost;return{mission:c,score:Math.round(f*1e3)/1e3,breakdown:{recency:Math.round(l*1e3)/1e3,activity:Math.round(u*1e3)/1e3,blockerBoost:d,statusBoost:p}}}).sort((c,l)=>l.score-c.score)}computeRecency(e,r){let i=Math.max(0,(r-e)/3600);return Math.pow(.5,i/n.RECENCY_HALF_LIFE_HOURS)}computeStatusBoost(e){switch(e){case"in-progress":return 1;case"verifying":return .8;case"planned":return .4;default:return 0}}};var on=x.child({module:"mcp:tools:ops:briefing"});async function zs(n){let{repoPath:e,missionId:r,scope:i="mission",altitude:t,activeMissionsLimit:o,recentActivityLimit:s,compact:a}=n,c=a??(t==="orbit"||t==="atmosphere"),l=s??(t==="orbit"?0:t==="ground"?20:10),{missions:u,intentLogs:p}=A.getInstance(e),d=He(e),m=_e(e);on.info({repoPath:e,missionId:r,scope:i},"Generating briefing");try{if(i==="project"){let b=u.findActive(m||void 0),S=b.length;o&&b.length>o&&(b=b.slice(0,o));let k=u.findParentOnlyIds(b),w=new Set(k),R=b.filter(G=>!w.has(G.id)),B=new Ns(p).score(R),T=.15,O=3,J=c&&B.length>O?B.filter((G,W)=>W<O||G.score>=T):B,V=J.map(G=>G.mission),q=new Map(J.map(G=>[G.mission.id,G.score])),I=G=>({id:G.id,name:G.name,goal:G.goal,status:G.status,relevance:q.get(G.id)}),C=V.length===0&&b.length===0?{tool:"shadow_ops_plan",reason:"No open work; create a mission"}:{tool:"shadow_ops_track",reason:"Select a mission from hierarchy or next_work_candidates to execute"};if(t==="orbit"){let G={scope:"project",altitude:"orbit",counts:u.getStats(),next_work_candidates:V.map(I),meta:{current_branch:m,activeMissionsTotal:S}};return{content:[{type:"text",text:JSON.stringify(G,null,2)}],suggestedNext:C}}let U={},M=[];for(let G of b)G.parent_id!=null?(U[G.parent_id]||(U[G.parent_id]=[]),U[G.parent_id].push(G)):M.push(G);let L=u.findRecentCompleted(5).map(I);if(t==="ground"){let G=l>0?p.findRecentDecisionActivity(l):void 0,W=k.map(Ee=>({parent:b.find(ye=>ye.id===Ee),children:U[Ee]??[]})),H=M.filter(Ee=>!w.has(Ee.id)),Fe={scope:"project",altitude:"ground",counts:u.getStats(),analytics:u.getAnalytics(),hierarchy:W.length>0?W:void 0,standalone_active:H.length>0?H:void 0,active_missions:W.length===0?b:void 0,next_work_candidates:V,recent_completed:L,recent_activity:G,meta:{current_branch:m,current_commit:d,activeMissionsTotal:S,active_limit_applied:!!o,relevance_filtered:J.length<B.length?{shown:J.length,total:B.length}:void 0}};return{content:[{type:"text",text:JSON.stringify(Fe,null,2)}],suggestedNext:C}}let Z=l>0?p.findRecentDecisionActivity(l):void 0,ee=b;c&&(ee=b.map(G=>({...G,strategy_graph:void 0,verification_context:void 0,outcome_contract:void 0})));let ce=k.map(G=>{let W=b.find(Fe=>Fe.id===G);return{parent:c?{...W,strategy_graph:void 0,verification_context:void 0}:W,children:U[G]??[]}}),ne=M.filter(G=>!w.has(G.id)),oe={scope:"project",altitude:"atmosphere",counts:u.getStats(),analytics:u.getAnalytics(),hierarchy:ce.length>0?ce:void 0,standalone_active:ne.length>0?ne:void 0,active_missions:ce.length===0?ee:void 0,next_work_candidates:V.map(I),recent_completed:L,recent_activity:Z,meta:{current_branch:m,current_commit:d,activeMissionsTotal:S,active_limit_applied:!!o,relevance_filtered:J.length<B.length?{shown:J.length,total:B.length}:void 0}};return{content:[{type:"text",text:JSON.stringify(oe,null,2)}],suggestedNext:C}}let f;if(r?f=u.findById(r):f=u.findActive(m||void 0)[0],!f)return{content:[{type:"text",text:"No active missions found. Ready for new assignment."}]};let h=null;try{f.strategy_graph&&(h=JSON.parse(f.strategy_graph))}catch{on.warn({missionId:f.id},"Failed to parse strategy graph")}if(t==="orbit"){let b={altitude:"orbit",mission:{id:f.id,name:f.name,goal:f.goal,status:f.status,last_updated:new Date(f.updated_at*1e3).toISOString()},strategy_snapshot:h};return{content:[{type:"text",text:JSON.stringify(b,null,2)}]}}let _="No external shadow changes detected.";try{new Lt(e).analyzeGhostChanges(f.commit_sha||void 0),_="Shadow Trace completed: Checked for external modifications."}catch(b){on.warn({error:b},"Ghost analysis failed")}let v={repaired:0,failed:0};try{v=new Pe(e).detectAndRepairShifts()}catch(b){on.warn({error:b},"Symbol shift repair failed")}if(t==="ground"){let b={altitude:"ground",mission:{id:f.id,name:f.name,goal:f.goal,status:f.status,last_updated:new Date(f.updated_at*1e3).toISOString(),git_branch:f.git_branch,commit_sha:f.commit_sha,outcome_contract:f.outcome_contract},artifacts:u.getArtifacts(f.id),shadow_trace:{ghost_analysis:_,symbols_repaired:v.repaired,symbols_missing:v.failed},context:{current_commit:d,working_set:u.getWorkingSet(f.id).map(S=>S.file_path)},strategy_snapshot:h,recent_activity:p.findByMission(f.id,l||20),ancestor_activity_summary:[],predictive_collisions:[]};try{let S=new Jr(e);b.predictive_collisions=await S.analyzePotentialCollisions()}catch(S){on.warn({error:S},"Predictive collision analysis failed")}if(f.parent_id){let S=p.findByMission(f.parent_id,5);b.ancestor_activity_summary=S.map(k=>({type:k.type,content:k.content,date:new Date(k.created_at*1e3).toISOString()}))}return{content:[{type:"text",text:JSON.stringify(b,null,2)}]}}let g={altitude:"atmosphere",mission:{id:f.id,name:f.name,goal:f.goal,status:f.status,last_updated:new Date(f.updated_at*1e3).toISOString(),git_branch:f.git_branch,commit_sha:f.commit_sha,outcome_contract:f.outcome_contract},artifacts:u.getArtifacts(f.id),shadow_trace:{ghost_analysis:_,symbols_repaired:v.repaired,symbols_missing:v.failed},context:{current_commit:d,working_set:u.getWorkingSet(f.id).map(b=>b.file_path)},strategy_snapshot:h,recent_activity:p.findByMissionPreferCrystal(f.id,15),ancestor_activity_summary:[],predictive_collisions:[]};try{let b=new Jr(e);g.predictive_collisions=await b.analyzePotentialCollisions()}catch(b){on.warn({error:b},"Predictive collision analysis failed")}if(f.parent_id){let b=p.findByMissionPreferCrystal(f.parent_id,3);g.ancestor_activity_summary=b.map(S=>({type:S.type,content:S.content,date:new Date(S.created_at*1e3).toISOString()}))}return{content:[{type:"text",text:JSON.stringify(g,null,2)}]}}catch(f){throw on.error({error:f,repoPath:e},"Failed to generate briefing"),new Error(`Failed to generate briefing: ${f instanceof Error?f.message:String(f)}`)}}te();K();var ey=x.child({module:"mcp:tools:ops:synthesize"});async function ty(n){let{repoPath:e,missionId:r}=n;ey.info({repoPath:e,missionId:r},"Synthesizing mission");let{missions:i}=A.getInstance(e);try{if(!i.findById(r))throw new Error(`Mission ${r} not found`);let s=await new gt(e).distillMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,adr:s.adr,metrics:s.metrics},null,2)}]}}catch(t){throw ey.error({error:t,repoPath:e},"Failed to synthesize ADR"),new Error(`Failed to synthesize ADR: ${t instanceof Error?t.message:String(t)}`)}}K();te();K();var aS=x.child({module:"narrative-service"}),qn=class{missions;briefingEngine;repoPath;constructor(e){this.repoPath=e;let{missions:r}=A.getInstance(e);this.missions=r,this.briefingEngine=new gt(e)}async generateChronicle(e={}){aS.info(e,"Generating Repo Chronicle...");let i=this.missions.findAll().filter(l=>l.parent_id===null&&l.status!=="planned");e.since&&(i=i.filter(l=>l.updated_at>=e.since)),e.until&&(i=i.filter(l=>l.updated_at<=e.until)),i.sort((l,u)=>u.updated_at-l.updated_at);let t=e.offset||0,o=e.limit||10;i=i.slice(t,t+o);let s=[],a=[],c=[];for(let l of i){let u=this.missions.findByParentId(l.id),p=u.length>0,d=await this.briefingEngine.distillMission(l.id,!1);if(p){let m=[];for(let h of u)m.push(await this.mapMissionToEpisode(h));m.unshift(await this.mapMissionToEpisode(l));let f={kind:"initiative",root_mission_id:l.id,title:l.name,strategy_graph:l.strategy_graph?JSON.parse(l.strategy_graph):{},episodes:e.compact?[]:m,synthesized_narrative:e.compact?this.truncateText(d.adr):d.adr||""};s.push(f),c.push(f)}else{let m=await this.mapMissionToEpisode(l,d.adr,e.compact);a.push(m),c.push(m)}}return{repo_path:this.repoPath,generated_at:Date.now(),initiatives:s,unattached_episodes:a,timeline:c}}async mapMissionToEpisode(e,r,i=!1){let t=r;return t||(t=(await this.briefingEngine.distillMission(e.id,!1)).adr),{kind:"episode",mission_id:e.id,title:e.name,goal:e.goal,outcome:e.outcome_contract,intents:[],adr_summary:i?this.truncateText(t):t}}truncateText(e,r=300){return e?e.length<=r?e:e.slice(0,r)+"... (truncated)":""}renderChronicleMarkdown(e){let r=`# Repository Chronicle
497
509
 
498
510
  `;if(r+=`*Generated at ${new Date(e.generated_at).toISOString()}*
499
511
 
@@ -504,9 +516,17 @@ After that, ${e} and other tools will work.`+Ar;return Pt("FILE_NOT_FOUND",r,{re
504
516
  `,r+=`${i.adr_summary}
505
517
 
506
518
  `),r+=`---
507
- `;return r}};var Cg=$.child({module:"mcp:tools:ops:chronicle"});async function jg(n){let{repoPath:e,format:r="markdown",...i}=n,t=new Un(e);Cg.info({repoPath:e,format:r,filters:i},"Generating Chronicle");try{let o=await t.generateChronicle(i),s={tool:"shadow_ops_briefing",reason:"Current backlog and next work"};return r==="json"?{content:[{type:"text",text:JSON.stringify(o,null,2)}],suggestedNext:s}:{content:[{type:"text",text:t.renderChronicleMarkdown(o)}],suggestedNext:s}}catch(o){throw Cg.error({error:o,repoPath:e},"Failed to generate chronicle"),new Error(`Failed to generate chronicle: ${o instanceof Error?o.message:String(o)}`)}}Be();async function Mg(n){let{repoPath:e,compact:r=!1}=n,t=new le(e).getSnapshot();r&&t.gravity?.hotspots&&(t={...t,gravity:{...t.gravity,hotspots:t.gravity.hotspots.slice(0,10),_truncated:t.gravity.hotspots.length>10,_totalHotspots:t.gravity.hotspots.length}});let s=await new Un(e).generateChronicle({limit:5}),c=(await xs({repoPath:e,scope:"project",compact:r,activeMissionsLimit:r?10:void 0,recentActivityLimit:r?5:10})).content?.[0],l=c&&c.type==="text"?c.text:"{}",u={};try{u=JSON.parse(l)}catch{}let p={counts:u.counts,next_work_candidates:u.next_work_candidates??[],active_count:Array.isArray(u.active_missions)?u.active_missions.length:0};return{content:[{type:"text",text:JSON.stringify({hologram:t,chronicle:s,briefing:p},null,2)}],suggestedNext:{tool:p.next_work_candidates.length>0?"shadow_ops_track":"shadow_ops_plan",reason:p.next_work_candidates.length>0?"Pick one from next_work_candidates and run /continue":"No open work; create a mission"}}}J();qt();var rd=class{startTime=Date.now();indexRuns=0;indexCacheHits=0;lastIndexDurationMs=null;lastIndexCompletedAt=null;lastRunPhases=[];queryCount=0;lastQueryLatencyMs=null;recentLatencySumMs=0;recentLatencyCount=0;recentLatencies=[];searchHistoryFailureCount=0;recordIndexStart(){this.indexRuns+=1}recordIndexCacheHit(){this.indexCacheHits+=1}recordIndexEnd(e){this.lastIndexDurationMs=e,this.lastIndexCompletedAt=Date.now()}recordIndexPhase(e,r){this.lastRunPhases.push({phase:e,durationMs:r})}clearIndexPhases(){this.lastRunPhases=[]}recordQueryStart(){let e=performance.now();return()=>{this.queryCount+=1;let r=performance.now()-e;if(this.lastQueryLatencyMs=r,this.recentLatencies.push(r),this.recentLatencies.length>100){let i=this.recentLatencies.shift();this.recentLatencySumMs=this.recentLatencySumMs-i+r}else this.recentLatencySumMs+=r,this.recentLatencyCount=this.recentLatencies.length}}recordSearchHistoryFailure(){this.searchHistoryFailureCount+=1}getSnapshot(){let e=this.recentLatencies.length,r=e>0?this.recentLatencies.reduce((i,t)=>i+t,0)/e:null;return{index:{runs:this.indexRuns,cacheHits:this.indexCacheHits,lastDurationMs:this.lastIndexDurationMs,lastCompletedAt:this.lastIndexCompletedAt,lastRunPhases:[...this.lastRunPhases]},query:{count:this.queryCount,lastLatencyMs:this.lastQueryLatencyMs,recentLatencySumMs:this.recentLatencySumMs,recentLatencyCount:e,avgLatencyMs:r,searchHistoryFailures:this.searchHistoryFailureCount},uptimeMs:Date.now()-this.startTime}}reset(){this.indexRuns=0,this.indexCacheHits=0,this.lastIndexDurationMs=null,this.lastIndexCompletedAt=null,this.lastRunPhases=[],this.queryCount=0,this.lastQueryLatencyMs=null,this.recentLatencySumMs=0,this.recentLatencyCount=0,this.recentLatencies=[],this.searchHistoryFailureCount=0}},Ot=new rd;function Ug(){Ot.recordIndexStart()}function id(){Ot.recordIndexCacheHit()}function Fg(n){Ot.recordIndexEnd(n)}function $s(n,e){Ot.recordIndexPhase(n,e)}function Zg(){Ot.clearIndexPhases()}function Fn(){return Ot.recordQueryStart()}function ht(){Ot.recordSearchHistoryFailure()}function Hg(){return Ot.getSnapshot()}import od from"path";var Wg=$.child({module:"mcp:tools:ops:health"});async function Bg(n){let e=n.repoPath,r=od.isAbsolute(e)?od.normalize(e):od.resolve(process.cwd(),e);Wg.info({repoPath:r},"Health check");let i=!1,t=!1;try{Oe(r),i=!0,t=et(r)}catch(c){Wg.debug({repoPath:r,error:c},"Health: DB check failed")}let o=Hg(),s={status:i?t?"ready":"index_pending":"db_unavailable",database:i,indexed:t,metrics:{index:o.index,query:o.query,uptimeMs:o.uptimeMs}},a=t?{tool:"shadow_recon_hologram",reason:"Architecture overview"}:{tool:"shadow_recon_onboard",reason:"Index the repo first"};return{content:[{type:"text",text:JSON.stringify(s,null,2)}],suggestedNext:a}}Q();J();var Mr=$.child({module:"mcp:tools:ops:log"});async function Jg(n){let{repoPath:e,missionId:r,type:i,content:t,filePath:o,symbolName:s}=n;Mr.info({repoPath:e,type:i,symbolName:s},"Logging intent");let{missions:a,exports:c,intentLogs:l}=j.getInstance(e);try{let u=r??null;if(u){if(!a.findById(u))throw new Error(`Mission ${u} not found. Use shadow_ops_briefing to see available missions.`)}else{let h=a.findActive();h.length>0?(u=h[0].id,Mr.debug({missionId:u},"Auto-resolved to active mission")):(u=null,Mr.debug("No active mission found, logging as system/unlinked intent"))}let p=null,d=null,m=s||null;if(s){let _=(o?c.findByNameAndFile(s,o):c.findByName(s))[0];_?(p=_.id,d=_.signature,m=_.name):Mr.warn({symbolName:s,filePath:o},"Symbol not found for intent linking")}let f=l.create({mission_id:u,symbol_id:p,file_path:o||null,type:i,content:t,confidence:1,symbol_name:m,signature:d,commit_sha:null});return{content:[{type:"text",text:JSON.stringify({logId:f,missionId:u,symbolId:p,status:"logged",message:p?`Intent linked to symbol "${s}"`:"Intent logged (unlinked)"},null,2)}]}}catch(u){throw Mr.error({error:u,repoPath:e},"Failed to log intent"),new Error(`Failed to log intent: ${u instanceof Error?u.message:String(u)}`)}}J();var Kg=$.child({module:"mcp:tools:ops:graph"});async function Yg(n){let{repoPath:e,missionId:r,depth:i,limit:t,format:o="mermaid"}=n;Kg.info({repoPath:e,missionId:r,format:o},"Generating mission graph");try{let{GraphExporterService:s}=await Promise.resolve().then(()=>(qg(),Gg));return{content:[{type:"text",text:await new s(e).generateGraph({includeCompleted:!0,format:o,focusMissionId:r,depth:i,limit:t})}]}}catch(s){throw Kg.error({error:s,repoPath:e},"Failed to generate mission graph"),new Error(`Failed to generate mission graph: ${s.message}`)}}import I$ from"fast-glob";import ad from"fs";import T$ from"ignore";import Xg from"path";async function cd(n,e=[]){let r=T$(),i=Xg.join(n,".gitignore");return ad.existsSync(i)&&r.add(ad.readFileSync(i,"utf8")),e.length>0&&r.add(e),(await I$(wh,{cwd:n,absolute:!0,ignore:Ho})).filter(s=>{let a=Xg.relative(n,s);return!r.ignores(a)}).map(s=>({path:s,mtime:ad.statSync(s).mtimeMs}))}import j$ from"@swc/core";import dd from"fs";function Qg(n){let e=n.split(`
508
- `),r=[],i=0;for(let t of e)r.push(i),i+=t.length+1;return r}function se(n,e){for(let r=0;r<e.length;r++)if(e[r+1]>n||r===e.length-1)return r+1;return 1}function ae(n,e){return e.slice(0,n).toString("utf8").length}function ey(n,e,r){let i=n.start-e,t=n.end-e;return i<0||t>r.length?"":r.slice(i,t).toString("utf8")}function ty(n){let e=[],r=/\/\*\*[\s\S]*?\*\//g,i;for(;(i=r.exec(n))!==null;)e.push({start:i.index,end:i.index+i[0].length,text:i[0]});return e}function it(n,e,r){for(let i of e){if(i.start===n)return i.text;if(i.start>n&&i.start<n+50){let t=r.substring(n,i.start);if(/^\s*$/.test(t))return i.text}if(i.end<=n&&i.end>n-50){let t=r.substring(i.end,n);if(/^\s*$/.test(t))return i.text}}return""}function ny(n){if(!n)return"";let r=n.replace(/\/\*\*|\*\/|\*/g,"").trim().split(`
509
- `)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function Ss(n,e,r){let i=n.toLowerCase(),t=e.toLowerCase();return i.includes("components/")||i.endsWith(".tsx")?"Component":i.startsWith("use")||t.startsWith("use")?"Hook":i.includes("models/")||t.endsWith("model")?"Model":i.includes("services/")||i.includes("controllers/")||i.includes("handlers/")||i.includes("mcp/")||i.endsWith("service.ts")||i.endsWith("controller.ts")||i.endsWith("handler.ts")||t.endsWith("service")||t.endsWith("controller")||t.endsWith("handler")?"Service":i.includes("repositories/")||i.includes("repos/")||i.endsWith("repository.ts")||i.endsWith("repo.ts")||t.endsWith("repository")||t.endsWith("repo")?"Repository":r==="TsInterfaceDeclaration"||r==="TsTypeAliasDeclaration"?"Type Definition":"Other"}function Ur(n){let e=[];return/\b(fetch|axios|superagent|got)\s*\(|import\s+.*\b(http|https|node-fetch)\b/i.test(n)&&e.push("Network"),(/\b(knex|prisma|typeorm|mongoose|sequelize|pg|mysql|sqlite3)\b/i.test(n)||/\b(SELECT\s+.*FROM|INSERT\s+INTO|UPDATE\s+.*SET|DELETE\s+FROM)\b/i.test(n)||/\.query\s*\(|\.execute\s*\(/i.test(n)&&/db|database|client|pool/i.test(n))&&e.push("Database"),(/\bfs\./i.test(n)||/\b(readFileSync|writeFileSync|readFile|writeFile|readdir)\b/.test(n)||/import\s+.*\bfs\b/.test(n))&&e.push("File System"),(/\b(localStorage|sessionStorage|indexedDB)\./.test(n)||/\bdocument\.cookie\b/.test(n))&&e.push("Browser Storage"),e}function ot(n,e){if(!n)return"";let r=n.replace(/^([\s\S]*?\*\/)?\s*/,"").replace(/^.*\} from ['"].*['"];?\s*/,"").replace(/^import .*['"];?\s*/,"").trim();if(e==="TsInterfaceDeclaration"||e==="TsTypeAliasDeclaration")return r;let i=0,t=0,o=r.length;for(let s=0;s<r.length;s++){let a=r[s];if(a==="(")i++;else if(a===")")i--;else if(a==="<")t++;else if(a===">")t--;else if(a==="{"){if(i===0&&t===0){o=s;break}}else if(a==="; "&&i===0&&t===0){o=s;break}else if(a==="="&&r[s+1]===">"&&i===0&&t===0){o=s+2;break}}return r.substring(0,o).trim()}function ry(n){let e=[];for(let r of n)r.type==="ImportDeclaration"&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ImportDefaultSpecifier"?"default":i.type==="ImportNamespaceSpecifier"?"*":i.local?.value||i.imported?.value||"*").join("","")}),r.type==="ExportAllDeclaration"&&e.push({module:r.source.value,name:"*"}),r.type==="ExportNamedDeclaration"&&r.source&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ExportSpecifier"?i.orig.value:"*").join(", ")});return e}function iy(n,e,r,i,t,o,s,a){let c=[];for(let l of n){if(l.type==="ExportDeclaration"){let u=l.declaration,p=u.type,d="";p==="VariableDeclaration"?d=u.declarations.map(g=>g.id.value).join("",""):d=u.id?.value||u.identifier?.value||"anonymous";let m=ae(l.span.start-e,r),f=ae(l.span.end-e,r),h=it(m,o,i),_=a(l.span),v=[];if(l.type==="ExportDeclaration"&&(p==="ClassDeclaration"||p==="ClassExpression")){let g=u.body||[];for(let x of g)if(x.type==="ClassMethod"||x.type==="ClassProperty"){let I=x.key.value;if(!I)continue;let E=ae(x.span.start-e,r),w=ae(x.span.end-e,r),T=a(x.span),O=it(E,o,i);v.push({name:I,kind:x.type,signature:ot(T,x.type),line:se(E,t),endLine:se(w,t),doc:O,classification:x.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(p==="FunctionDeclaration"&&u.body?.type==="BlockStatement")v=ld(u.body.stmts,e,r,i,t,o,a);else if(p==="VariableDeclaration"){for(let g of u.declarations)if(g.init&&(g.init.type==="ArrowFunctionExpression"||g.init.type==="FunctionExpression")&&g.init.body?.type==="BlockStatement"){v=ld(g.init.body.stmts,e,r,i,t,o,a);break}}c.push({name:d,kind:p,signature:ot(_,p),line:se(m,t),endLine:se(f,t),doc:h,classification:Ss(s,d,p),capabilities:JSON.stringify(Ur(_)),members:v})}if(l.type==="ExportNamedDeclaration"){for(let u of l.specifiers)if(u.type==="ExportSpecifier"){let p=ae(l.span.start-e,r),d=ae(l.span.end-e,r),m=it(p,o,i);c.push({name:u.exported?.value||u.orig.value,kind:"ExportSpecifier",signature:`export { ${u.orig.value} }`,line:se(p,t),endLine:se(d,t),doc:m,classification:"Export mapping",capabilities:"[]"})}}if(l.type==="ExportDefaultDeclaration"){let u=ae(l.span.start-e,r),p=ae(l.span.end-e,r),d=it(u,o,i),m=a(l.span),f=[];if(l.decl.type==="ClassExpression"||l.decl.type==="ClassDeclaration"){let h=l.decl.body||[];for(let _ of h)if(_.type==="ClassMethod"||_.type==="ClassProperty"){let v=_.key.value;if(!v)continue;let g=ae(_.span.start-e,r),x=ae(_.span.end-e,r),I=a(_.span),E=it(g,o,i);f.push({name:v,kind:_.type,signature:ot(I,_.type),line:se(g,t),endLine:se(x,t),doc:E,classification:_.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(l.decl.type==="FunctionExpression"||l.decl.type==="FunctionDeclaration"||l.decl.type==="ArrowFunctionExpression")&&l.decl.body?.type==="BlockStatement"&&(f=ld(l.decl.body.stmts,e,r,i,t,o,a));c.push({name:"default",kind:"DefaultExport",signature:ot(m,"DefaultExport"),line:se(u,t),endLine:se(p,t),doc:d,classification:"Default Export",capabilities:JSON.stringify(Ur(m)),members:f})}if(l.type==="ExportAllDeclaration"){let u=ae(l.span.start-e,r),p=ae(l.span.end-e,r),d=l.source.value,m=it(u,o,i);c.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${d}"`,line:se(u,t),endLine:se(p,t),doc:m,classification:"Re-export",capabilities:"[]"})}}return c}function ld(n,e,r,i,t,o,s){let a=[];for(let c of n){if(c.type==="VariableDeclaration")for(let l of c.declarations){let u=[],p=d=>{if(d.type==="Identifier")u.push({name:d.value,span:d.span});else if(d.type==="ArrayPattern")for(let m of d.elements)m&&p(m);else if(d.type==="ObjectPattern")for(let m of d.properties)m.type==="AssignmentPatternProperty"?u.push({name:m.key.value,span:m.span}):m.type==="KeyValuePatternProperty"&&p(m.value)};p(l.id);for(let d of u){let m=ae(d.span.start-e,r),f=ae(d.span.end-e,r),h=s(d.span),_=it(m,o,i);a.push({name:d.name,kind:"VariableDeclaration",signature:ot(h,"VariableDeclaration"),line:se(m,t),endLine:se(f,t),doc:_,classification:"Internal Variable",capabilities:"[]"})}}if(c.type==="FunctionDeclaration"){let l=c.identifier?.value||c.ident?.value||"anonymous",u=ae(c.span.start-e,r),p=ae(c.span.end-e,r),d=s(c.span),m=it(u,o,i);a.push({name:l,kind:"FunctionDeclaration",signature:ot(d,"FunctionDeclaration"),line:se(u,t),endLine:se(p,t),doc:m,classification:"Internal Function",capabilities:"[]"})}if(c.type==="ReturnStatement"&&c.argument?.type==="ObjectExpression")for(let l of c.argument.properties){let u="",p=l.span||l.key?.span||l.ident?.span;if(l.type==="KeyValueProperty"){let d=l.key;u=d?.value||d?.raw||(d?.type==="Identifier"?d.value:"")}else l.type==="MethodProperty"?u=l.key?.value||l.key?.raw||"":l.type==="ShorthandProperty"?u=l.ident?.value||"":l.type==="Identifier"&&(u=l.value||"");if(u&&p){let d=ae(p.start-e,r),m=ae(p.end-e,r),f=s(p),h=it(d,o,i);a.push({name:u,kind:"ReturnProperty",signature:ot(f,"ReturnProperty"),line:se(d,t),endLine:se(m,t),doc:h,classification:"Return Member",capabilities:"[]"})}}if(c.type==="ExpressionStatement"&&c.expression.type==="CallExpression"){let l=c.expression;if(l.callee.type==="MemberExpression"&&(l.callee.property?.value==="on"||l.callee.property?.value==="once")){let u=l.arguments[0]?.expression?.value,p=l.arguments[1]?.expression;if(u&&p&&(p.type==="ArrowFunctionExpression"||p.type==="FunctionExpression")){let d=ae(p.span.start-e,r),m=ae(p.span.end-e,r),f=s(p.span);a.push({name:`on:${u}`,kind:p.type,signature:ot(f,p.type),line:se(d,t),endLine:se(m,t),doc:"",classification:"Event Handler",capabilities:"[]"})}}if(l.callee.type==="Identifier"&&l.callee.value==="addRoute"&&l.arguments.length>=3){let u=l.arguments[2].expression;if(u.type==="StringLiteral"){let p=u.value,d=ae(l.span.start-e,r),m=ae(l.span.end-e,r),f=s(l.span);a.push({name:p,kind:"HTTP Route",signature:ot(f,"HTTP Route"),line:se(d,t),endLine:se(m,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:p})})}}}}return a}function oy(n,e,r,i,t){let o=[];function s(a){if(!(!a||typeof a!="object")){if(a.type==="CallExpression"){let c=R$(a);if(c){let l=ae(a.span.start-e,r);o.push({...c,line:se(l,i),snippet:t(a.span)})}}for(let c of Object.keys(a)){if(c==="span")continue;let l=a[c];Array.isArray(l)?l.forEach(s):typeof l=="object"&&s(l)}}}return n.forEach(s),o}function R$(n){let{callee:e,arguments:r}=n;if(!r||r.length===0)return null;if(e.type==="Identifier"&&e.value,e.type==="Identifier"&&e.value==="addRoute"&&r.length>=3){let i=r[2].expression;if(i.type==="StringLiteral")return{type:"api_route",name:i.value,direction:"consume"}}if(e.type==="MemberExpression"&&e.property?.type==="Identifier"){let i=e.property.value;if(i==="emit"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"produce"};if(i==="on"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"consume"};if(["get","post","put","delete","patch"].includes(i)&&r[0].expression.type==="StringLiteral"){let o=r[0].expression.value,s=e.object.type==="Identifier"?e.object.value:"";if(["axios","http","request","appApi","restApi","adminApi","client"].includes(s))return{type:"api_route",name:o,direction:"produce"};if(o.startsWith("/"))return{type:"api_route",name:o,direction:"consume"}}}return e.type==="Identifier"&&e.value==="fetch"&&r[0].expression.type==="StringLiteral"?{type:"api_route",name:r[0].expression.value,direction:"produce"}:null}function Fr(n){let{classification:e,capabilities:r,exports:i,fileName:t}=n,o={Network:"API integration",Database:"data persistence","File System":"file I/O operations","Browser Storage":"client-side storage"},s=r.map(f=>o[f]).filter(Boolean).join(" and "),c={Component:(f,h)=>{let _=h.find(g=>g.kind==="FunctionDeclaration"||g.kind==="ClassDeclaration")?.name,v=_?`React component: ${_}`:"React UI component";return f?`${v} with ${f}`:v},Hook:(f,h)=>{let _=h.find(g=>g.name.startsWith("use"))?.name,v=_?`Custom React hook: ${_}`:"Custom React hook";return f?`${v} for ${f}`:v},Service:(f,h)=>{let v=`Service layer: ${h[0]?.name||"Service"}`;return f?`${v} handling ${f}`:v},Repository:(f,h)=>`Data repository: ${h[0]?.name||"Repository"} for ${f||"data access"}`,"Type Definition":(f,h)=>`Type definitions: ${h.slice(0,3).map(v=>v.name).join("")}${h.length>3?"...":""}`,Model:(f,h)=>`Data model: ${h[0]?.name||"Model"}`,"HTTP Route":(f,h)=>{let _=h.filter(v=>v.classification==="Service Boundary");return _.length>0?`API endpoints: ${_.slice(0,3).map(v=>v.name).join("")}`:"API route handler"},"Micro IR (PHP)":(f,h)=>{let _=h.some(g=>g.classification==="Service Boundary"),v=h.find(g=>g.kind==="ClassDeclaration")?.name;return _?"PHP controller with API routes":v?`PHP class: ${v}`:"PHP module"},"Micro IR (Python)":(f,h)=>{let _=h.some(g=>g.classification==="Service Boundary"),v=h.find(g=>g.kind==="ClassDeclaration")?.name;return _?"Python API handler with routes":v?`Python class: ${v}`:"Python module"},"Micro IR (Go/TS) ":(f,h)=>{let _=h.some(g=>g.kind==="TypeDeclaration"),v=h.filter(g=>g.kind==="FunctionDeclaration");return _&&v.length>0?`Go package: types and ${v.length} function(s)`:_?"Go package: type definitions":v.length>0?`Go package: ${v[0].name} and ${v.length} function(s)`:"Go module"},"Micro IR (Rust/TS) ":(f,h)=>{let _=h.find(x=>x.kind==="TraitDeclaration")?.name,v=h.find(x=>x.kind==="StructDeclaration")?.name,g=h.filter(x=>x.kind==="FunctionDeclaration");return _?f.includes("Rust trait")?`Rust module: trait ${_}`:`Rust module: ${_}`:v?`Rust module: struct ${v}`:g.length>0?`Rust module: ${g.length} function(s)`:"Rust module"}}[e];if(c)return c(s,i);if(i.length===0)return t?`Module: ${t}`:"Module with no exports";let l=i.filter(f=>f.kind==="FunctionDeclaration"),u=i.filter(f=>f.kind==="ClassDeclaration"),p=i.filter(f=>f.kind==="TsInterfaceDeclaration"||f.kind==="TsTypeAliasDeclaration"),d=[];if(u.length>0&&d.push(`Class: ${u[0].name}`),l.length>0){let f=l.slice(0,2).map(h=>h.name).join("");d.push(`Functions: ${f}`)}p.length>0&&d.push(`Types: ${p.length}`);let m=d.length>0?d.join(" | "):`Module with ${i.length} export(s)`;return s?`${m} \u2014 ${s}`:m}function sy(n){let e=new Set;function r(i){if(!(!i||typeof i!="object")){i.typeAnnotation&&me(i.typeAnnotation,e),(i.type==="TsTypeReference"||i.type==="TsTypeAnnotation")&&me(i,e);for(let t in i){if(t==="span"||t==="comments"||t==="interpreter")continue;let o=i[t];o&&typeof o=="object"&&(Array.isArray(o)?o.forEach(r):r(o))}}}return n.forEach(i=>r(i)),Array.from(e)}function me(n,e){if(n){if(n.type==="TsTypeAnnotation"){me(n.typeAnnotation,e);return}n.type==="TsTypeReference"&&(n.typeName?.type==="Identifier"&&e.add(n.typeName.value),n.typeName?.type==="TsQualifiedName"&&ay(n.typeName,e),n.typeParams&&me(n.typeParams,e)),n.type==="TsArrayType"&&me(n.elementType,e),n.type==="TsUnionType"&&n.types?.forEach(r=>me(r,e)),n.type==="TsIntersectionType"&&n.types?.forEach(r=>me(r,e)),n.type==="TsTupleType"&&n.elemTypes?.forEach(r=>me(r.ty,e)),(n.type==="TsFunctionType"||n.type==="TsConstructorType")&&(n.params?.forEach(r=>me(r.typeAnnotation,e)),n.typeAnnotation&&me(n.typeAnnotation,e)),n.type==="TsTypeParameterDeclaration"&&n.params?.forEach(r=>{r.constraint&&me(r.constraint,e),r.default&&me(r.default,e)}),n.type==="TsTypeParameterInstantiation"&&n.params?.forEach(r=>me(r,e)),n.type==="TsMappedType"&&n.typeAnnotation&&me(n.typeAnnotation,e),n.type==="TsIndexedAccessType"&&(me(n.objectType,e),me(n.indexType,e)),n.type==="TsConditionalType"&&(me(n.checkType,e),me(n.extendsType,e),me(n.trueType,e),me(n.falseType,e)),n.type==="TsTypeLiteral"&&n.members?.forEach(r=>{r.typeAnnotation&&me(r.typeAnnotation,e)})}}function ay(n,e){n.type==="TsQualifiedName"?(n.left&&ay(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import my from"path";import pd from"path";J();import py from"path";import A$ from"fs";import{fileURLToPath as L$}from"url";import*as en from"web-tree-sitter";import{fileURLToPath as P$}from"node:url";import{dirname as ud,join as ly,resolve as N$}from"node:path";import{existsSync as z$}from"node:fs";var D$=P$(import.meta.url),cy=ud(D$);function O$(){let n=cy;for(;n!==ud(n);){if(z$(ly(n,"package.json")))return n;n=ud(n)}return N$(cy,"..","..")}function Zn(...n){return ly(O$(),...n)}var eN=py.dirname(L$(import.meta.url)),uy=$.child({module:"parser:tree-sitter"}),ks=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=en.Parser||en;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=Zn("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!A$.existsSync(r))return uy.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await en.Language.load(r);return this.languages.set(e,i),i}catch(i){return uy.error({err:i,ext:e},"Failed to load language grammar"),null}}getLangName(e){switch(e.toLowerCase()){case".php":return"php";case".py":return"python";case".go":return"go";case".rs":return"rust";default:return""}}getQueries(e){switch(e.toLowerCase()){case".php":return`
519
+ `;return r}};var ny=x.child({module:"mcp:tools:ops:chronicle"});async function ry(n){let{repoPath:e,format:r="markdown",...i}=n,t=new qn(e);ny.info({repoPath:e,format:r,filters:i},"Generating Chronicle");try{let o=await t.generateChronicle(i),s={tool:"shadow_ops_briefing",reason:"Current backlog and next work"};return r==="json"?{content:[{type:"text",text:JSON.stringify(o,null,2)}],suggestedNext:s}:{content:[{type:"text",text:t.renderChronicleMarkdown(o)}],suggestedNext:s}}catch(o){throw ny.error({error:o,repoPath:e},"Failed to generate chronicle"),new Error(`Failed to generate chronicle: ${o instanceof Error?o.message:String(o)}`)}}Ge();async function iy(n){let{repoPath:e,compact:r=!0}=n,t=new de(e).getSnapshot();r&&t.gravity?.hotspots&&(t={...t,gravity:{...t.gravity,hotspots:t.gravity.hotspots.slice(0,10),_truncated:t.gravity.hotspots.length>10,_totalHotspots:t.gravity.hotspots.length}});let a={...await new qn(e).generateChronicle({limit:5,compact:r}),initiatives:[],unattached_episodes:[]},l=(await zs({repoPath:e,scope:"project",altitude:r?"orbit":"atmosphere",compact:r,activeMissionsLimit:r?10:void 0,recentActivityLimit:r?5:10})).content?.[0],u=l&&l.type==="text"?l.text:"{}",p={};try{p=JSON.parse(u)}catch{}let d={counts:p.counts,next_work_candidates:p.next_work_candidates??[],active_count:Array.isArray(p.active_missions)?p.active_missions.length:0};return{content:[{type:"text",text:JSON.stringify({hologram:t,chronicle:a,briefing:d},null,2)}],suggestedNext:{tool:d.next_work_candidates.length>0?"shadow_ops_track":"shadow_ops_plan",reason:d.next_work_candidates.length>0?"Pick one from next_work_candidates and run /continue":"No open work; create a mission"}}}K();Kt();var gd=class{startTime=Date.now();indexRuns=0;indexCacheHits=0;lastIndexDurationMs=null;lastIndexCompletedAt=null;lastRunPhases=[];queryCount=0;lastQueryLatencyMs=null;recentLatencySumMs=0;recentLatencyCount=0;recentLatencies=[];searchHistoryFailureCount=0;recordIndexStart(){this.indexRuns+=1}recordIndexCacheHit(){this.indexCacheHits+=1}recordIndexEnd(e){this.lastIndexDurationMs=e,this.lastIndexCompletedAt=Date.now()}recordIndexPhase(e,r){this.lastRunPhases.push({phase:e,durationMs:r})}clearIndexPhases(){this.lastRunPhases=[]}recordQueryStart(){let e=performance.now();return()=>{this.queryCount+=1;let r=performance.now()-e;if(this.lastQueryLatencyMs=r,this.recentLatencies.push(r),this.recentLatencies.length>100){let i=this.recentLatencies.shift();this.recentLatencySumMs=this.recentLatencySumMs-i+r}else this.recentLatencySumMs+=r,this.recentLatencyCount=this.recentLatencies.length}}recordSearchHistoryFailure(){this.searchHistoryFailureCount+=1}getSnapshot(){let e=this.recentLatencies.length,r=e>0?this.recentLatencies.reduce((i,t)=>i+t,0)/e:null;return{index:{runs:this.indexRuns,cacheHits:this.indexCacheHits,lastDurationMs:this.lastIndexDurationMs,lastCompletedAt:this.lastIndexCompletedAt,lastRunPhases:[...this.lastRunPhases]},query:{count:this.queryCount,lastLatencyMs:this.lastQueryLatencyMs,recentLatencySumMs:this.recentLatencySumMs,recentLatencyCount:e,avgLatencyMs:r,searchHistoryFailures:this.searchHistoryFailureCount},uptimeMs:Date.now()-this.startTime}}reset(){this.indexRuns=0,this.indexCacheHits=0,this.lastIndexDurationMs=null,this.lastIndexCompletedAt=null,this.lastRunPhases=[],this.queryCount=0,this.lastQueryLatencyMs=null,this.recentLatencySumMs=0,this.recentLatencyCount=0,this.recentLatencies=[],this.searchHistoryFailureCount=0}},At=new gd;function oy(){At.recordIndexStart()}function yd(){At.recordIndexCacheHit()}function sy(n){At.recordIndexEnd(n)}function qr(n,e){At.recordIndexPhase(n,e)}function ay(){At.clearIndexPhases()}function Kn(){return At.recordQueryStart()}function yt(){At.recordSearchHistoryFailure()}function cy(){return At.getSnapshot()}import vd from"path";var ly=x.child({module:"mcp:tools:ops:health"});async function uy(n){let e=n.repoPath,r=vd.isAbsolute(e)?vd.normalize(e):vd.resolve(process.cwd(),e);ly.info({repoPath:r},"Health check");let i=!1,t=!1;try{Oe(r),i=!0,t=rt(r)}catch(c){ly.debug({repoPath:r,error:c},"Health: DB check failed")}let o=cy(),s={status:i?t?"ready":"index_pending":"db_unavailable",database:i,indexed:t,metrics:{index:o.index,query:o.query,uptimeMs:o.uptimeMs}},a=t?{tool:"shadow_recon_hologram",reason:"Architecture overview"}:{tool:"shadow_recon_onboard",reason:"Index the repo first"};return{content:[{type:"text",text:JSON.stringify(s,null,2)}],suggestedNext:a}}te();K();var Kr=x.child({module:"mcp:tools:ops:log"});async function py(n){let{repoPath:e,missionId:r,type:i,content:t,filePath:o,symbolName:s}=n;Kr.info({repoPath:e,type:i,symbolName:s},"Logging intent");let{missions:a,exports:c,intentLogs:l}=A.getInstance(e);try{let u=r??null;if(u){if(!a.findById(u))throw new Error(`Mission ${u} not found. Use shadow_ops_briefing to see available missions.`)}else{let h=a.findActive();h.length>0?(u=h[0].id,Kr.debug({missionId:u},"Auto-resolved to active mission")):(u=null,Kr.debug("No active mission found, logging as system/unlinked intent"))}let p=null,d=null,m=s||null;if(s){let _=(o?c.findByNameAndFile(s,o):c.findByName(s))[0];_?(p=_.id,d=_.signature,m=_.name):Kr.warn({symbolName:s,filePath:o},"Symbol not found for intent linking")}let f=l.create({mission_id:u,symbol_id:p,file_path:o||null,type:i,content:t,confidence:1,symbol_name:m,signature:d,commit_sha:null});return{content:[{type:"text",text:JSON.stringify({logId:f,missionId:u,symbolId:p,status:"logged",message:p?`Intent linked to symbol "${s}"`:"Intent logged (unlinked)"},null,2)}]}}catch(u){throw Kr.error({error:u,repoPath:e},"Failed to log intent"),new Error(`Failed to log intent: ${u instanceof Error?u.message:String(u)}`)}}K();var hy=x.child({module:"mcp:tools:ops:graph"});async function gy(n){let{repoPath:e,missionId:r,depth:i,limit:t,format:o="mermaid"}=n;hy.info({repoPath:e,missionId:r,format:o},"Generating mission graph");try{let{GraphExporterService:s}=await Promise.resolve().then(()=>(fy(),my));return{content:[{type:"text",text:await new s(e).generateGraph({includeCompleted:!0,format:o,focusMissionId:r,depth:i,limit:t})}]}}catch(s){throw hy.error({error:s,repoPath:e},"Failed to generate mission graph"),new Error(`Failed to generate mission graph: ${s.message}`)}}te();K();var yy=x.child({module:"mcp:tools:ops:crystallize"});async function vy(n){let{repoPath:e,missionId:r}=n;yy.info({repoPath:e,missionId:r},"Crystallizing mission logs");let{intentLogs:i,missions:t}=A.getInstance(e),o=t.findById(r);if(!o)throw new Error(`Mission ${r} not found`);let s=i.findRawByMission(r);if(s.length===0){let m=i.findCrystalByMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,status:m?"already_crystallized":"no_logs",message:m?"Mission already has a crystal with no new raw logs to absorb.":"No raw intent logs found for this mission.",crystalId:m?.id??null},null,2)}]}}let c=new Vn().analyze(s),l=new Set(s.map(m=>m.symbol_name).filter(Boolean)),u=new Set(s.map(m=>m.type)),p=`[Crystal] Mission #${r}: ${o.name}
520
+ `;p+=`Compressed ${s.length} logs across ${l.size} symbols.
521
+ `,p+=`Types: ${[...u].join(", ")}
522
+
523
+ `,c.decisions.length>0&&(p+=`Decisions: ${c.decisions.join(" | ")}
524
+ `),c.context.length>0&&(p+=`Context: ${c.context.join(" | ")}
525
+ `),c.consequences.length>0&&(p+=`Consequences: ${c.consequences.join(" | ")}
526
+ `),c.recommendations.length>0&&(p+=`Recommendations: ${c.recommendations.join(" | ")}
527
+ `);let d=i.crystallize(r,p.trim());return yy.info({missionId:r,crystalId:d,absorbed:s.length},"Crystallization complete"),{content:[{type:"text",text:JSON.stringify({missionId:r,crystalId:d,absorbed:s.length,symbolsCompressed:l.size,status:"crystallized"},null,2)}]}}import cS from"fast-glob";import _y from"fs";import lS from"ignore";import by from"path";async function bd(n,e=[]){let r=lS(),i=by.join(n,".gitignore");return _y.existsSync(i)&&r.add(_y.readFileSync(i,"utf8")),e.length>0&&r.add(e),(await cS(Oh,{cwd:n,absolute:!0,ignore:Xo,stats:!0})).filter(s=>{let a=by.relative(n,s.path);return!r.ignores(a)}).map(s=>({path:s.path,mtime:s.stats.mtimeMs}))}import Sd from"@swc/core";import Oy from"fs";function xy(n){let e=n.split(`
528
+ `),r=[],i=0;for(let t of e)r.push(i),i+=t.length+1;return r}function ue(n,e){for(let r=0;r<e.length;r++)if(e[r+1]>n||r===e.length-1)return r+1;return 1}function Ds(n,e){return e.slice(0,n).toString("utf8").length}function $y(n){if(n.toString("utf8").length===n.length)return i=>i;let r=new Map;return i=>{let t=r.get(i);return t===void 0&&(t=n.slice(0,i).toString("utf8").length,r.set(i,t)),t}}function Sy(n,e,r){let i=n.start-e,t=n.end-e;return i<0||t>r.length?"":r.slice(i,t).toString("utf8")}function ky(n){let e=[],r=/\/\*\*[\s\S]*?\*\//g,i;for(;(i=r.exec(n))!==null;)e.push({start:i.index,end:i.index+i[0].length,text:i[0]});return e}function at(n,e,r){for(let i of e){if(i.start===n)return i.text;if(i.start>n&&i.start<n+50){let t=r.substring(n,i.start);if(/^\s*$/.test(t))return i.text}if(i.end<=n&&i.end>n-50){let t=r.substring(i.end,n);if(/^\s*$/.test(t))return i.text}}return""}function Ey(n){if(!n)return"";let r=n.replace(/\/\*\*|\*\/|\*/g,"").trim().split(`
529
+ `)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function Os(n,e,r){let i=n.toLowerCase(),t=e.toLowerCase();return i.includes("components/")||i.endsWith(".tsx")?"Component":i.startsWith("use")||t.startsWith("use")?"Hook":i.includes("models/")||t.endsWith("model")?"Model":i.includes("services/")||i.includes("controllers/")||i.includes("handlers/")||i.includes("mcp/")||i.endsWith("service.ts")||i.endsWith("controller.ts")||i.endsWith("handler.ts")||t.endsWith("service")||t.endsWith("controller")||t.endsWith("handler")?"Service":i.includes("repositories/")||i.includes("repos/")||i.endsWith("repository.ts")||i.endsWith("repo.ts")||t.endsWith("repository")||t.endsWith("repo")?"Repository":r==="TsInterfaceDeclaration"||r==="TsTypeAliasDeclaration"?"Type Definition":"Other"}function Yr(n){let e=[];return/\b(fetch|axios|superagent|got)\s*\(|import\s+.*\b(http|https|node-fetch)\b/i.test(n)&&e.push("Network"),(/\b(knex|prisma|typeorm|mongoose|sequelize|pg|mysql|sqlite3)\b/i.test(n)||/\b(SELECT\s+.*FROM|INSERT\s+INTO|UPDATE\s+.*SET|DELETE\s+FROM)\b/i.test(n)||/\.query\s*\(|\.execute\s*\(/i.test(n)&&/db|database|client|pool/i.test(n))&&e.push("Database"),(/\bfs\./i.test(n)||/\b(readFileSync|writeFileSync|readFile|writeFile|readdir)\b/.test(n)||/import\s+.*\bfs\b/.test(n))&&e.push("File System"),(/\b(localStorage|sessionStorage|indexedDB)\./.test(n)||/\bdocument\.cookie\b/.test(n))&&e.push("Browser Storage"),e}function ct(n,e){if(!n)return"";let r=n.replace(/^([\s\S]*?\*\/)?\s*/,"").replace(/^.*\} from ['"].*['"];?\s*/,"").replace(/^import .*['"];?\s*/,"").trim();if(e==="TsInterfaceDeclaration"||e==="TsTypeAliasDeclaration")return r;let i=0,t=0,o=r.length;for(let s=0;s<r.length;s++){let a=r[s];if(a==="(")i++;else if(a===")")i--;else if(a==="<")t++;else if(a===">")t--;else if(a==="{"){if(i===0&&t===0){o=s;break}}else if(a==="; "&&i===0&&t===0){o=s;break}else if(a==="="&&r[s+1]===">"&&i===0&&t===0){o=s+2;break}}return r.substring(0,o).trim()}function wy(n){let e=[];for(let r of n)r.type==="ImportDeclaration"&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ImportDefaultSpecifier"?"default":i.type==="ImportNamespaceSpecifier"?"*":i.local?.value||i.imported?.value||"*").join("","")}),r.type==="ExportAllDeclaration"&&e.push({module:r.source.value,name:"*"}),r.type==="ExportNamedDeclaration"&&r.source&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ExportSpecifier"?i.orig.value:"*").join(", ")});return e}function Iy(n,e,r,i,t,o,s,a,c){let l=c??(p=>Ds(p,r)),u=[];for(let p of n){if(p.type==="ExportDeclaration"){let d=p.declaration,m=d.type,f="";m==="VariableDeclaration"?f=d.declarations.map(S=>S.id.value).join("",""):f=d.id?.value||d.identifier?.value||"anonymous";let h=l(p.span.start-e),_=l(p.span.end-e),v=at(h,o,i),g=a(p.span),b=[];if(p.type==="ExportDeclaration"&&(m==="ClassDeclaration"||m==="ClassExpression")){let S=d.body||[];for(let k of S)if(k.type==="ClassMethod"||k.type==="ClassProperty"){let w=k.key.value;if(!w)continue;let R=l(k.span.start-e),j=l(k.span.end-e),B=a(k.span),T=at(R,o,i);b.push({name:w,kind:k.type,signature:ct(B,k.type),line:ue(R,t),endLine:ue(j,t),doc:T,classification:k.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(m==="FunctionDeclaration"&&d.body?.type==="BlockStatement")b=xd(d.body.stmts,e,r,i,t,o,a,l);else if(m==="VariableDeclaration"){for(let S of d.declarations)if(S.init&&(S.init.type==="ArrowFunctionExpression"||S.init.type==="FunctionExpression")&&S.init.body?.type==="BlockStatement"){b=xd(S.init.body.stmts,e,r,i,t,o,a,l);break}}u.push({name:f,kind:m,signature:ct(g,m),line:ue(h,t),endLine:ue(_,t),doc:v,classification:Os(s,f,m),capabilities:JSON.stringify(Yr(g)),members:b})}if(p.type==="ExportNamedDeclaration"){for(let d of p.specifiers)if(d.type==="ExportSpecifier"){let m=l(p.span.start-e),f=l(p.span.end-e),h=at(m,o,i);u.push({name:d.exported?.value||d.orig.value,kind:"ExportSpecifier",signature:`export { ${d.orig.value} }`,line:ue(m,t),endLine:ue(f,t),doc:h,classification:"Export mapping",capabilities:"[]"})}}if(p.type==="ExportDefaultDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=at(d,o,i),h=a(p.span),_=[];if(p.decl.type==="ClassExpression"||p.decl.type==="ClassDeclaration"){let v=p.decl.body||[];for(let g of v)if(g.type==="ClassMethod"||g.type==="ClassProperty"){let b=g.key.value;if(!b)continue;let S=l(g.span.start-e),k=l(g.span.end-e),w=a(g.span),R=at(S,o,i);_.push({name:b,kind:g.type,signature:ct(w,g.type),line:ue(S,t),endLine:ue(k,t),doc:R,classification:g.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(p.decl.type==="FunctionExpression"||p.decl.type==="FunctionDeclaration"||p.decl.type==="ArrowFunctionExpression")&&p.decl.body?.type==="BlockStatement"&&(_=xd(p.decl.body.stmts,e,r,i,t,o,a,l));u.push({name:"default",kind:"DefaultExport",signature:ct(h,"DefaultExport"),line:ue(d,t),endLine:ue(m,t),doc:f,classification:"Default Export",capabilities:JSON.stringify(Yr(h)),members:_})}if(p.type==="ExportAllDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=p.source.value,h=at(d,o,i);u.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${f}"`,line:ue(d,t),endLine:ue(m,t),doc:h,classification:"Re-export",capabilities:"[]"})}}return u}function xd(n,e,r,i,t,o,s,a){let c=[];for(let l of n){if(l.type==="VariableDeclaration")for(let u of l.declarations){let p=[],d=m=>{if(m.type==="Identifier")p.push({name:m.value,span:m.span});else if(m.type==="ArrayPattern")for(let f of m.elements)f&&d(f);else if(m.type==="ObjectPattern")for(let f of m.properties)f.type==="AssignmentPatternProperty"?p.push({name:f.key.value,span:f.span}):f.type==="KeyValuePatternProperty"&&d(f.value)};d(u.id);for(let m of p){let f=a(m.span.start-e),h=a(m.span.end-e),_=s(m.span),v=at(f,o,i);c.push({name:m.name,kind:"VariableDeclaration",signature:ct(_,"VariableDeclaration"),line:ue(f,t),endLine:ue(h,t),doc:v,classification:"Internal Variable",capabilities:"[]"})}}if(l.type==="FunctionDeclaration"){let u=l.identifier?.value||l.ident?.value||"anonymous",p=a(l.span.start-e),d=a(l.span.end-e),m=s(l.span),f=at(p,o,i);c.push({name:u,kind:"FunctionDeclaration",signature:ct(m,"FunctionDeclaration"),line:ue(p,t),endLine:ue(d,t),doc:f,classification:"Internal Function",capabilities:"[]"})}if(l.type==="ReturnStatement"&&l.argument?.type==="ObjectExpression")for(let u of l.argument.properties){let p="",d=u.span||u.key?.span||u.ident?.span;if(u.type==="KeyValueProperty"){let m=u.key;p=m?.value||m?.raw||(m?.type==="Identifier"?m.value:"")}else u.type==="MethodProperty"?p=u.key?.value||u.key?.raw||"":u.type==="ShorthandProperty"?p=u.ident?.value||"":u.type==="Identifier"&&(p=u.value||"");if(p&&d){let m=a(d.start-e),f=a(d.end-e),h=s(d),_=at(m,o,i);c.push({name:p,kind:"ReturnProperty",signature:ct(h,"ReturnProperty"),line:ue(m,t),endLine:ue(f,t),doc:_,classification:"Return Member",capabilities:"[]"})}}if(l.type==="ExpressionStatement"&&l.expression.type==="CallExpression"){let u=l.expression;if(u.callee.type==="MemberExpression"&&(u.callee.property?.value==="on"||u.callee.property?.value==="once")){let p=u.arguments[0]?.expression?.value,d=u.arguments[1]?.expression;if(p&&d&&(d.type==="ArrowFunctionExpression"||d.type==="FunctionExpression")){let m=a(d.span.start-e),f=a(d.span.end-e),h=s(d.span);c.push({name:`on:${p}`,kind:d.type,signature:ct(h,d.type),line:ue(m,t),endLine:ue(f,t),doc:"",classification:"Event Handler",capabilities:"[]"})}}if(u.callee.type==="Identifier"&&u.callee.value==="addRoute"&&u.arguments.length>=3){let p=u.arguments[2].expression;if(p.type==="StringLiteral"){let d=p.value,m=a(u.span.start-e),f=a(u.span.end-e),h=s(u.span);c.push({name:d,kind:"HTTP Route",signature:ct(h,"HTTP Route"),line:ue(m,t),endLine:ue(f,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:d})})}}}}return c}function Ty(n,e,r,i,t,o){let s=o??(l=>Ds(l,r)),a=[];function c(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let u=uS(l);if(u){let p=s(l.span.start-e);a.push({...u,line:ue(p,i),snippet:t(l.span)})}}for(let u of Object.keys(l)){if(u==="span")continue;let p=l[u];Array.isArray(p)?p.forEach(c):typeof p=="object"&&c(p)}}}return n.forEach(c),a}function uS(n){let{callee:e,arguments:r}=n;if(!r||r.length===0)return null;if(e.type==="Identifier"&&e.value,e.type==="Identifier"&&e.value==="addRoute"&&r.length>=3){let i=r[2].expression;if(i.type==="StringLiteral")return{type:"api_route",name:i.value,direction:"consume"}}if(e.type==="MemberExpression"&&e.property?.type==="Identifier"){let i=e.property.value;if(i==="emit"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"produce"};if(i==="on"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"consume"};if(["get","post","put","delete","patch"].includes(i)&&r[0].expression.type==="StringLiteral"){let o=r[0].expression.value,s=e.object.type==="Identifier"?e.object.value:"";if(["axios","http","request","appApi","restApi","adminApi","client"].includes(s))return{type:"api_route",name:o,direction:"produce"};if(o.startsWith("/"))return{type:"api_route",name:o,direction:"consume"}}}return e.type==="Identifier"&&e.value==="fetch"&&r[0].expression.type==="StringLiteral"?{type:"api_route",name:r[0].expression.value,direction:"produce"}:null}function Xr(n){let{classification:e,capabilities:r,exports:i,fileName:t}=n,o={Network:"API integration",Database:"data persistence","File System":"file I/O operations","Browser Storage":"client-side storage"},s=r.map(f=>o[f]).filter(Boolean).join(" and "),c={Component:(f,h)=>{let _=h.find(g=>g.kind==="FunctionDeclaration"||g.kind==="ClassDeclaration")?.name,v=_?`React component: ${_}`:"React UI component";return f?`${v} with ${f}`:v},Hook:(f,h)=>{let _=h.find(g=>g.name.startsWith("use"))?.name,v=_?`Custom React hook: ${_}`:"Custom React hook";return f?`${v} for ${f}`:v},Service:(f,h)=>{let v=`Service layer: ${h[0]?.name||"Service"}`;return f?`${v} handling ${f}`:v},Repository:(f,h)=>`Data repository: ${h[0]?.name||"Repository"} for ${f||"data access"}`,"Type Definition":(f,h)=>`Type definitions: ${h.slice(0,3).map(v=>v.name).join("")}${h.length>3?"...":""}`,Model:(f,h)=>`Data model: ${h[0]?.name||"Model"}`,"HTTP Route":(f,h)=>{let _=h.filter(v=>v.classification==="Service Boundary");return _.length>0?`API endpoints: ${_.slice(0,3).map(v=>v.name).join("")}`:"API route handler"},"Micro IR (PHP)":(f,h)=>{let _=h.some(g=>g.classification==="Service Boundary"),v=h.find(g=>g.kind==="ClassDeclaration")?.name;return _?"PHP controller with API routes":v?`PHP class: ${v}`:"PHP module"},"Micro IR (Python)":(f,h)=>{let _=h.some(g=>g.classification==="Service Boundary"),v=h.find(g=>g.kind==="ClassDeclaration")?.name;return _?"Python API handler with routes":v?`Python class: ${v}`:"Python module"},"Micro IR (Go/TS) ":(f,h)=>{let _=h.some(g=>g.kind==="TypeDeclaration"),v=h.filter(g=>g.kind==="FunctionDeclaration");return _&&v.length>0?`Go package: types and ${v.length} function(s)`:_?"Go package: type definitions":v.length>0?`Go package: ${v[0].name} and ${v.length} function(s)`:"Go module"},"Micro IR (Rust/TS) ":(f,h)=>{let _=h.find(b=>b.kind==="TraitDeclaration")?.name,v=h.find(b=>b.kind==="StructDeclaration")?.name,g=h.filter(b=>b.kind==="FunctionDeclaration");return _?f.includes("Rust trait")?`Rust module: trait ${_}`:`Rust module: ${_}`:v?`Rust module: struct ${v}`:g.length>0?`Rust module: ${g.length} function(s)`:"Rust module"}}[e];if(c)return c(s,i);if(i.length===0)return t?`Module: ${t}`:"Module with no exports";let l=i.filter(f=>f.kind==="FunctionDeclaration"),u=i.filter(f=>f.kind==="ClassDeclaration"),p=i.filter(f=>f.kind==="TsInterfaceDeclaration"||f.kind==="TsTypeAliasDeclaration"),d=[];if(u.length>0&&d.push(`Class: ${u[0].name}`),l.length>0){let f=l.slice(0,2).map(h=>h.name).join("");d.push(`Functions: ${f}`)}p.length>0&&d.push(`Types: ${p.length}`);let m=d.length>0?d.join(" | "):`Module with ${i.length} export(s)`;return s?`${m} \u2014 ${s}`:m}function Ry(n){let e=new Set;function r(i){if(!(!i||typeof i!="object")){i.typeAnnotation&&fe(i.typeAnnotation,e),(i.type==="TsTypeReference"||i.type==="TsTypeAnnotation")&&fe(i,e);for(let t in i){if(t==="span"||t==="comments"||t==="interpreter")continue;let o=i[t];o&&typeof o=="object"&&(Array.isArray(o)?o.forEach(r):r(o))}}}return n.forEach(i=>r(i)),Array.from(e)}function fe(n,e){if(n){if(n.type==="TsTypeAnnotation"){fe(n.typeAnnotation,e);return}n.type==="TsTypeReference"&&(n.typeName?.type==="Identifier"&&e.add(n.typeName.value),n.typeName?.type==="TsQualifiedName"&&Py(n.typeName,e),n.typeParams&&fe(n.typeParams,e)),n.type==="TsArrayType"&&fe(n.elementType,e),n.type==="TsUnionType"&&n.types?.forEach(r=>fe(r,e)),n.type==="TsIntersectionType"&&n.types?.forEach(r=>fe(r,e)),n.type==="TsTupleType"&&n.elemTypes?.forEach(r=>fe(r.ty,e)),(n.type==="TsFunctionType"||n.type==="TsConstructorType")&&(n.params?.forEach(r=>fe(r.typeAnnotation,e)),n.typeAnnotation&&fe(n.typeAnnotation,e)),n.type==="TsTypeParameterDeclaration"&&n.params?.forEach(r=>{r.constraint&&fe(r.constraint,e),r.default&&fe(r.default,e)}),n.type==="TsTypeParameterInstantiation"&&n.params?.forEach(r=>fe(r,e)),n.type==="TsMappedType"&&n.typeAnnotation&&fe(n.typeAnnotation,e),n.type==="TsIndexedAccessType"&&(fe(n.objectType,e),fe(n.indexType,e)),n.type==="TsConditionalType"&&(fe(n.checkType,e),fe(n.extendsType,e),fe(n.trueType,e),fe(n.falseType,e)),n.type==="TsTypeLiteral"&&n.members?.forEach(r=>{r.typeAnnotation&&fe(r.typeAnnotation,e)})}}function Py(n,e){n.type==="TsQualifiedName"?(n.left&&Py(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import Ly from"path";import $d from"path";K();Wr();import zy from"path";import pS from"fs";import{fileURLToPath as dS}from"url";import*as sn from"web-tree-sitter";var W0=zy.dirname(dS(import.meta.url)),Ny=x.child({module:"parser:tree-sitter"}),Ls=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=sn.Parser||sn;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=Dt("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!pS.existsSync(r))return Ny.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await sn.Language.load(r);return this.languages.set(e,i),i}catch(i){return Ny.error({err:i,ext:e},"Failed to load language grammar"),null}}getLangName(e){switch(e.toLowerCase()){case".php":return"php";case".py":return"python";case".go":return"go";case".rs":return"rust";default:return""}}getQueries(e){switch(e.toLowerCase()){case".php":return`
510
530
  (function_definition name: (name) @name) @func
511
531
  (class_declaration name: (name) @name) @class
512
532
  (interface_declaration name: (name) @name) @interface
@@ -530,28 +550,28 @@ After that, ${e} and other tools will work.`+Ar;return Pt("FILE_NOT_FOUND",r,{re
530
550
  (trait_item name: (_type_identifier) @name) @trait
531
551
  (type_item name: (_type_identifier) @name) @type
532
552
  (use_declaration argument: (_) @name) @import
533
- `;default:return""}}mapKind(e,r){if(e==="import")return"ImportDeclaration";if(r===".php"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration";if(e==="interface")return"InterfaceDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="method")return"MethodDeclaration"}if(r===".py"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration"}if(r===".go"){if(e==="func")return"FunctionDeclaration";if(e==="type")return"TypeDeclaration"}if(r===".rs"){if(e==="func")return"FunctionDeclaration";if(e==="struct")return"StructDeclaration";if(e==="enum")return"EnumDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="type")return"TypeDeclaration"}return"Unknown"}mapClassification(e){return e==="import"?"Dependency":e==="func"||e==="method"?"Function":e==="class"||e==="interface"||e==="trait"||e==="struct"||e==="enum"||e==="type"?"Class":"Other"}async parse(e,r){await this.ensureInitialized();let i=py.extname(e).toLowerCase(),t=await this.getLanguage(i);if(!t||!this.parser)return[];this.parser.setLanguage(t);let o=this.parser.parse(r),s=r.split(`
534
- `),a=this.getQueries(i);if(!a)return[];let l=new en.Query(t,a).matches(o.rootNode),u=[];for(let p of l){let d=p.captures.find(h=>h.name==="name")?.node,m=p.captures[0].node,f=p.captures[0].name;if(d){let h=m.startPosition.row+1,_=m.endPosition.row+1,v=s[m.startPosition.row].trim();u.push({name:d.text,kind:this.mapKind(f,i),classification:this.mapClassification(f),signature:v,line:h,endLine:_,doc:"",capabilities:"{}"})}}return u}};var Es=class{parse(e,r=!1){let i=[],t=[],o=e.split(`
535
- `),s="",a="",c=0,l=0,u=-1,p=-1,d=[],m=[],f=!1,h=r?"api":"",_="",v=/^namespace\s+([a-zA-Z0-9_\\]+);/,g=/^(?:abstract\s+)?(?:readonly\s+)?class\s+([a-zA-Z0-9_]+)/,x=/^interface\s+([a-zA-Z0-9_]+)/,I=/^trait\s+([a-zA-Z0-9_]+)/,E=/^(?:public|protected|private|static|\s)*function\s+([a-zA-Z0-9_]+)\s*\(/,w=/^use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/,T=/^#\[([a-zA-Z0-9_\\]+)(?:\((.*)\))?\]/,O=/(?:Route::|router->|\$router->|->)(get|post|put|delete|patch|match)\s*\(\s*(?:uri\s*:\s*)?['"]([^'"]+)['"]/,V=/->prefix\s*\(\s*(?:prefix\s*:\s*)?['"]([^'"]+)['"]/;for(let k=0;k<o.length;k++){let D=o[k].trim();if(!D)continue;let H=(D.match(/{/g)||[]).length,L=(D.match(/}/g)||[]).length,Y=l;if(l+=H-L,a&&l<=p){let G=i.find(B=>B.name===a&&B.line===c);G&&(G.endLine=k+1),a="",p=-1}if(s&&l<=u){let G=i.find(B=>B.name===s&&(B.kind==="ClassDeclaration"||B.kind==="TraitDeclaration"||B.kind==="InterfaceDeclaration"));G&&(G.endLine=k+1),s="",u=-1}let U=D.match(V);if(U&&(h=U[1]),D.includes("});")&&(h=""),D.startsWith("/**")){f=!0,m=[];continue}if(f){D.endsWith("*/")?f=!1:m.push(D.replace(/^\*\s?/,""));continue}let C=D.match(T);if(C){d.push(C[1]);continue}let A=D.match(v);if(A){_=A[1]||"",d=[],m=[];continue}let Z=D.match(g);if(Z){s=Z[1],u=l-H;let G={attributes:d};_&&(G.namespace=_),i.push({name:s,kind:"ClassDeclaration",classification:"Class",signature:`class ${s}`,line:k+1,endLine:k+1,doc:m.join(`
536
- `).trim(),capabilities:JSON.stringify(G),members:[]}),d=[],m=[];continue}let W=D.match(x);if(W){let G=W[1];s=G,u=l-H,i.push({name:G,kind:"InterfaceDeclaration",classification:"Interface",signature:`interface ${G}`,line:k+1,endLine:k+1,doc:m.join(`
537
- `).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let F=D.match(I);if(F){let G=F[1];s=G,u=l-H,i.push({name:G,kind:"TraitDeclaration",classification:"Trait",signature:`trait ${G}`,line:k+1,endLine:k+1,doc:m.join(`
538
- `).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let te=D.match(E);if(te){let G=te[1],B=!!s;a=G,c=k+1,p=l-H;let Ut=!1,ct={};for(let xe of d)xe.toLowerCase().includes("route")&&(Ut=!0,ct={type:"route",method:"GET",path:"/"});let lt=m.join(`
539
- `).trim();if(Ut){let xe=ct.path||"/";i.push({name:xe,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${G}`,line:k+1,endLine:k+1,doc:lt,capabilities:JSON.stringify({type:"route",handler:s?`${s}@${G}`:G,...ct})}),t.push({type:"api_route",name:xe,direction:"consume",line:k+1,snippet:D})}i.push({name:G,kind:B?"MethodDeclaration":"FunctionDeclaration",classification:B?"Method":"Function",signature:`${B?s+":: ":""}${G}`,line:k+1,endLine:k+1,doc:lt,capabilities:JSON.stringify({attributes:d})}),d=[],m=[];continue}let fe=D.match(w);if(fe){let G=fe[1]||"",B=fe[2]||G.split("\\").pop()||"";i.push({name:B,kind:"ImportSpecifier",classification:"Dependency",signature:`use ${G}`,line:k+1,endLine:k+1,doc:"",capabilities:JSON.stringify({type:"use",namespace:G})}),d=[],m=[];continue}let ue=D.match(O);if(ue){let G=ue[1].toUpperCase(),B=ue[2];if(D.includes("Route::")||D.includes("router->")||D.includes("action")||D.includes(",")&&!D.includes("view(")){if(h){let vt=h.startsWith("/")?h:`/${h}`,Fs=B.startsWith("/")?B:`/${B}`;B=(vt+Fs).replace(/\/+/g,"/")}let ct=null,lt=D.match(/\[\s*([a-zA-Z0-9_]+)::class\s*,\s*['"]([^'"]+)['"]\s*\]/);if(lt)ct=`${lt[1]}@${lt[2]}`;else if(D.includes("::class")){let vt=D.match(/([a-zA-Z0-9_]+)::class/);vt&&(ct=vt[1])}let xe=D;!D.endsWith(");")&&k+1<o.length&&(xe+=" "+o[k+1].trim(),!xe.endsWith(");")&&k+2<o.length&&(xe+=" "+o[k+2].trim())),i.push({name:B,kind:"HTTP Route",classification:"Service Boundary",signature:xe,line:k+1,endLine:k+1,doc:"",capabilities:JSON.stringify({type:"route",method:G,path:B,handler:ct})}),t.push({type:"api_route",name:B,direction:"consume",line:k+1,snippet:xe,method:G,url:B}),m=[];continue}}let he=/(?:\$client|client|Http)::(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)|(?:\$client|client)->(request|get|post|put|delete|patch)\s*\(\s*([^,)]+)/,ce=D.match(he);if(ce){let G=(ce[1]||ce[3]).toUpperCase(),B=(ce[2]||ce[4]).trim();(B.startsWith("'")&&B.endsWith("'")||B.startsWith('"')&&B.endsWith('"'))&&(B=B.substring(1,B.length-1)),t.push({type:"api_route",name:B,direction:"produce",line:k+1,snippet:D,method:G,url:B})}!D.startsWith("#[")&&!D.startsWith("//")&&!D.startsWith("*")&&!f&&(d=[],m=[])}return{nodes:i,events:t}}};var ws=class{currentRoutePrefix="";parse(e){this.currentRoutePrefix="";let r=[],i=[],t=e.split(`
540
- `),o=[{indent:-1,name:"root",type:"root"}],s=[],a=/^class\s+([a-zA-Z0-9_]+)/,c=/^async\s+def\s+([a-zA-Z0-9_]+)|^def\s+([a-zA-Z0-9_]+)/,l=/^(?:from\s+([a-zA-Z0-9_\.]+)\s+import|import\s+([a-zA-Z0-9_\.]+))/,u=/^@(.*)/;function p(v){return v.trim().split(/[.(]/)[0]?.trim()||v}function d(v){let g=v.decorators.map(I=>p(I.raw)),x={decorators:v.decorators,decoratorNames:g};return v.async===!0&&(x.async=!0),JSON.stringify(x)}let m=!1,f="",h=[],_=[];for(let v=0;v<t.length;v++){let g=t[v],x=g.trim();if(!x||x.startsWith("#"))continue;let I=/^([a-zA-Z0-9_]+)\s*=\s*(?:APIRouter|Blueprint)\s*\(\s*(?:prefix\s*=\s*)?['"]([^'"]+)['"]/,E=x.match(I);if(E&&(this.currentRoutePrefix=E[2]),m){if(x.endsWith(f)||x.includes(f)){m=!1;let Z=x.replace(f,"").trim();Z&&h.push(Z);let W=o[o.length-1];W.node&&(W.node.doc=h.join(`
541
- `).trim()),h=[]}else h.push(x);continue}let w=g.search(/\S/),T=g.trim(),O=T.match(/^(['"]{3})/);if(O){let Z=O[1],W=o[o.length-1];if(W.node&&!W.node.doc){if(T.substring(3).includes(Z)){let F=T.replace(new RegExp(Z,"g"),"").trim();W.node.doc=F}else{m=!0,f=Z;let F=T.substring(3).trim();F&&h.push(F)}continue}}for(;o.length>1&&o[o.length-1].indent>=w;)o.pop();let V=o[o.length-1],k=T.match(u);if(k){s.push({raw:k[1].trim(),line:v+1});continue}let D=T.match(a);if(D){let Z=D[1],W={name:Z,kind:"ClassDeclaration",classification:"Class",signature:`class ${Z}`,line:v+1,endLine:v+1,doc:"",capabilities:d({decorators:s}),members:[]};_.push(W),V.node?(V.node.members||(V.node.members=[]),V.node.members.push(W)):r.push(W),o.push({indent:w,name:Z,type:"class",node:W}),s=[];continue}let H=T.match(c);if(H){let Z=!!H[1],W=H[1]||H[2],F=V.type==="class",te=!1,fe={};for(let B of s)if(B.raw.match(/(?:app|router)\.(get|post|put|delete|patch)/)){te=!0;let ct=["get","post","put","delete","patch"].find(vt=>B.raw.toLowerCase().includes(`.${vt}`))?.toUpperCase()||"GET",lt=B.raw.match(/['"]([^'"]+)['"]/),xe=lt?lt[1]:"/";if(this.currentRoutePrefix){let vt=this.currentRoutePrefix.endsWith("/")?this.currentRoutePrefix.slice(0,-1):this.currentRoutePrefix,Fs=xe.startsWith("/")?xe:`/${xe}`;xe=vt+Fs}fe={type:"route",method:ct,path:xe}}if(te){let B=fe.path||"",Ut={name:B||W,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${W}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({handler:F?`${V.name}.${W}`:W,async:Z,...fe})};_.push(Ut),r.push(Ut),i.push({type:"api_route",name:B,direction:"consume",line:v+1,snippet:T})}let ue=s.some(B=>B.raw==="staticmethod"),he=s.some(B=>B.raw==="classmethod"),ce=`${Z?"async ":""}${F?(ue?"@staticmethod ":he?"@classmethod ":"")+V.name+".":""}${W}`,G={name:W,kind:Z&&F?"AsyncMethodDeclaration":Z?"AsyncFunctionDeclaration":F?"MethodDeclaration":"FunctionDeclaration",classification:F?ue||he?"Static Method":"Method":"Function",signature:ce,line:v+1,endLine:v+1,doc:"",capabilities:d({decorators:s,async:Z}),members:[]};_.push(G),V.node?(V.node.members||(V.node.members=[]),V.node.members.push(G)):r.push(G),o.push({indent:w,name:W,type:"function",node:G}),s=[];continue}let L=/^(?:path|re_path|url)\s*\(\s*['"]([^'"]+)['"]/,Y=T.match(L);if(Y){let Z=Y[1].replace(/^\^/,""),W={name:Z,kind:"HTTP Route",classification:"Service Boundary",signature:T.trim(),line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"route",method:"GET",path:Z})};_.push(W),r.push(W),i.push({type:"api_route",name:Z,direction:"consume",line:v+1,snippet:T});continue}let U=/(?:requests|httpx|client|http)\.(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)/,C=T.match(U);if(C){let Z=C[1].toUpperCase(),W=C[2].trim();(W.startsWith("'")&&W.endsWith("'")||W.startsWith('"')&&W.endsWith('"'))&&(W=W.substring(1,W.length-1)),i.push({type:"api_route",name:W,direction:"produce",line:v+1,snippet:T,method:Z,url:W})}let A=T.match(l);if(A){let Z=A[1]||A[2],W={name:Z,kind:"ImportSpecifier",classification:"Dependency",signature:`import ${Z}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"import",module:Z})};_.push(W),r.push(W),s=[];continue}s=[],V.node&&(V.node.endLine=v+1)}return{nodes:_,events:i}}};var dy=[{extension:[".php"],rules:[]},{extension:[".py"],rules:[]},{extension:[".go"],rules:[{regex:/func\s+([a-zA-Z0-9_]+)\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function",signature:n[0]})},{regex:/func\s+\([^\)]+\)\s+([a-zA-Z0-9_]+)\(/g,onMatch:n=>({name:n[1],kind:"MethodDeclaration",classification:"Method",signature:n[0]})},{regex:/import\s+['"]([^'"]+)['"]/g,onMatch:n=>({name:n[1],kind:"ImportSpecifier",classification:"Dependency",signature:n[0],meta:{type:"import",path:n[1]}})}]},{extension:[".rs"],rules:[{regex:/fn\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function",signature:n[0]})},{regex:/struct\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"StructDeclaration",classification:"Class",signature:n[0]})},{regex:/enum\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"EnumDeclaration",classification:"Class",signature:n[0]})},{regex:/trait\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"TraitDeclaration",classification:"Class",signature:n[0]})},{regex:/use\s+([a-zA-Z0-9_:]+(?:\s+as\s+[a-zA-Z0-9_]+)?);/g,onMatch:n=>({name:n[1].trim(),kind:"ImportDeclaration",classification:"Dependency",signature:n[0],meta:{type:"import",path:n[1].trim()}})}]},{extension:[".ts",".tsx",".js",".jsx",".mjs",".cjs"],rules:[{regex:/(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function"})},{regex:/(?:export\s+)?class\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"ClassDeclaration",classification:"Class"})},{regex:/(?:export\s+)?interface\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"InterfaceDeclaration",classification:"Interface"})},{regex:/(?:export\s+)?const\s+([a-zA-Z0-9_]+)\s*=/g,onMatch:n=>({name:n[1],kind:"VariableDeclaration",classification:"Constant"})},{regex:/import\s+.*\s+from\s+['"]([^'"]+)['"]/g,onMatch:n=>({name:n[1],kind:"ImportDeclaration",classification:"Dependency",meta:{path:n[1]}})}]}];function C$(n,e){let r=[];if(n===".go"&&e.some(i=>i.kind==="TypeDeclaration")&&r.push("Go type"),n===".rs"&&(e.some(i=>i.kind==="TraitDeclaration")&&r.push("Rust trait"),e.some(i=>i.kind==="StructDeclaration")&&r.push("Rust struct"),e.some(i=>i.kind==="EnumDeclaration")&&r.push("Rust enum")),n===".py"){for(let i of e)if(i.capabilities)try{if(JSON.parse(i.capabilities).decoratorNames?.length){r.push("Python decorators");break}}catch{}e.some(i=>i.kind==="AsyncFunctionDeclaration"||i.kind==="AsyncMethodDeclaration")&&r.push("Async")}return r}var Is=class{phpParser=new Es;pythonParser=new ws;treeSitterParser=new ks;supports(e){return dy.some(r=>r.extension.includes(e.toLowerCase()))}async parse(e,r){let i=pd.extname(e).toLowerCase(),t=[],o=[];if(i===".php"||i===".py"||i===".go"||i===".rs"){if(i===".py"){let c=this.pythonParser.parse(r);t=c.nodes,o=c.events}else if(i===".php"){let c=e.toLowerCase().endsWith("api.php"),l=this.phpParser.parse(r,c);t=l.nodes,o=l.events}else try{t=await this.treeSitterParser.parse(e,r)}catch{}if(t.length>0){let c=i===".php"?"Micro IR (PHP/TS) ":i===".py"?"Micro IR (Python/TS) ":i===".go"?"Micro IR (Go/TS) ":"Micro IR (Rust/TS) ",l=t.filter(m=>m.classification!=="Dependency"),u=t.filter(m=>m.classification==="Dependency"),p=C$(i,t),d=Fr({classification:c,capabilities:p,exports:l.map(m=>({name:m.name,kind:m.kind,classification:m.classification})),fileName:pd.basename(e)});return{exports:l,imports:u.map(m=>({module:m.name,name:m.name,kind:m.kind,classification:m.classification})),events:o,classification:c,summary:d||`${i.substring(1).toUpperCase()} module`,parseStatus:"success"}}}let s=dy.find(c=>c.extension.includes(i));if(!s)return{exports:[],imports:[],classification:"Unknown",summary:"",parseStatus:"failed",parseError:`Unsupported file extension: ${i}`};for(let c of s.rules){c.regex.lastIndex=0;let l;for(;(l=c.regex.exec(r))!==null;){let u=c.onMatch(l),p=r.substring(0,l.index).split(`
542
- `).length;t.push({name:u.name||"anonymous",kind:u.kind||"Unknown",classification:u.classification||"Other",signature:u.signature||l[0],line:p,endLine:p,doc:"",capabilities:JSON.stringify(u.meta||{})})}}let a=Fr({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(c=>({name:c.name,kind:c.kind,classification:c.classification})),fileName:pd.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:a||"Module",parseStatus:t.length>0?"success":"partial"}}};J();var md=new Is;async function Zr(n){let e=my.extname(n);if(md.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=dd.readFileSync(n,"utf-8");return await md.parse(n,o)}catch(o){return $.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",parseStatus:"failed",parseError:o.message}}let r;try{r=dd.readFileSync(n)}catch(o){return{exports:[],imports:[],classification:"Error",summary:"",parseStatus:"failed",parseError:`File read error: ${o.message}`}}let i=r.toString("utf8"),t=Qg(i);try{let o=n.endsWith(".tsx"),s=j$.parseSync(i,{syntax:"typescript",tsx:o,decorators:!0,comments:!0}),a=s.span.start,c=ty(i),l=v=>ey(v,a,r),u=ry(s.body),p=sy(s.body);p.length>0&&$.debug({filePath:n,count:p.length},"Extracted type references"),p.forEach(v=>{u.push({module:"__type_reference__",name:v})});let d=iy(s.body,a,r,i,t,c,n,l),m=oy(s.body,a,r,t,l),f=Ss(n,"","Module"),h=c.length>0&&c[0].start===0?c[0].text:d.find(v=>v.doc)?.doc||"",_=ny(h);if(!_&&d.length>0){let v=Ur(i);_=Fr({classification:f,capabilities:v,exports:d.map(g=>({name:g.name,kind:g.kind,classification:g.classification})),fileName:my.basename(n)})}return{exports:d,imports:u,events:m,classification:f,summary:_,parseStatus:"success"}}catch(o){$.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=dd.readFileSync(n,"utf-8"),a=await md.parse(n,s);return{...a,classification:a.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${o.message}`}}catch(s){return $.error({filePath:n,error:s.message},"All parsing strategies failed"),{exports:[],imports:[],classification:"Error",summary:"",parseStatus:"failed",parseError:`All parsing strategies failed: ${s.message}`}}}}import Ts from"path";var M$=50;function Hr(n,e,r,i){let t={name:Ts.basename(e)||e,type:"directory",path:e,children:[]};return n.forEach(o=>{let a=Ts.relative(e,o.path).split(Ts.sep),c=t;for(let l=0;l<a.length;l++){let u=a[l];if(i!==void 0&&l>=i)return;let p=l===a.length-1;if(i===1&&l===0&&p)return;let d=i!==void 0&&l===i-1&&!p,m=Ts.join(e,...a.slice(0,l+1)),f=c.children?.find(h=>h.name===u);if(!f){if(c.children&&c.children.length>=M$){c.children.find(v=>v.type==="truncated")||c.children.push({name:"... (truncated) ",type:"truncated",path:"",children:void 0});return}f={name:u,type:p?"file":"directory",path:m,children:p||d?void 0:[],summary:p?{classification:o.classification,summaryText:o.summary,exports:o.exports,imports:o.imports,chunks:o.chunks}:void 0},f.summary&&(r==="structure"||r==="signatures")&&(delete f.summary.chunks,delete f.summary.imports),c.children?.push(f)}c=f}}),t}J();import Py from"p-limit";qt();import pS from"path";import bd from"fs";import dS from"os";import Ve from"path";import Bn from"fs";import{loadConfig as Z$,createMatchPath as H$}from"tsconfig-paths";import At from"path";import Wr from"fs";var Lt=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function fy(n){let e;try{e=Wr.statSync(n).isDirectory()?n:At.dirname(n)}catch(r){throw r.code==="ENOENT"?new Lt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Lt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Lt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==At.dirname(e);){let r=At.join(e,"tsconfig.json");if(Wr.existsSync(r))return e;e=At.dirname(e)}return null}function hy(n){let e;try{e=Wr.statSync(n).isDirectory()?n:At.dirname(n)}catch(r){throw r.code==="ENOENT"?new Lt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Lt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Lt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==At.dirname(e);){let r=At.join(e,"package.json");if(Wr.existsSync(r))try{if(JSON.parse(Wr.readFileSync(r,"utf8")).workspaces)return e}catch{}e=At.dirname(e)}return null}import Hn from"path";import tn from"fs";function gy(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=Hn.join(n,o);if(!tn.existsSync(s))continue;let a=tn.readdirSync(s);for(let c of a){let l=Hn.join(s,c,"package.json");if(tn.existsSync(l))try{let u=JSON.parse(tn.readFileSync(l,"utf8"));u.name&&r.set(u.name,{name:u.name,path:Hn.dirname(l),main:u.main||"dist/index.js"})}catch{}}}return r}function yy(n){let e=new Map;try{let r=JSON.parse(tn.readFileSync(n,"utf8")),i={...r.dependencies,...r.devDependencies};for(let[t,o]of Object.entries(i))if(typeof o=="string"&&o.startsWith("file:")){let s=o.substring(5),a=Hn.dirname(n),c=Hn.resolve(a,s),l=Hn.join(c,"package.json");if(tn.existsSync(l))try{let u=JSON.parse(tn.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import vy from"path";import Je from"fs";var U$=[".ts",".tsx",".d.ts",".js",".jsx"];function Me(n){let e=vy.extname(n);if(e===".js"||e===".jsx"){let r=n.slice(0,-e.length),i=e===".jsx"?[".tsx",".ts"]:[".ts",".tsx"];for(let t of i){let o=r+t;if(Je.existsSync(o)&&Je.statSync(o).isFile())return o}if(Je.existsSync(n)&&Je.statSync(n).isFile())return n}if(Je.existsSync(n)&&Je.statSync(n).isFile())return n;for(let r of U$){let i=n+r;if(Je.existsSync(i)&&Je.statSync(i).isFile())return i}if(Je.existsSync(n)&&Je.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=vy.join(n,"index"+r);if(Je.existsSync(i))return i}return""}import Wn from"path";import F$ from"fs";function fd(n,e,r){if(n.startsWith(".")){let t=Wn.dirname(e),o=Wn.resolve(t,n),s=Me(o);return s?{resolved:!0,resolvedPath:s}:{resolved:!1,error:`File not found at relative path: ${o}`,suggestion:"Check if the file exists and has a supported extension (.ts, .tsx, .js, .jsx)"}}let i=Br(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=Me(o);return s?{resolved:!0,resolvedPath:s}:{resolved:!1,error:`Path alias matched to '${o}' but file does not exist`,suggestion:"Check if the target file exists or if the alias mapping in tsconfig.json is correct"}}}if(!n.startsWith("@")){let o=Wn.resolve(i.baseUrl,n),s=Me(o);if(s)return{resolved:!0,resolvedPath:s}}let t=i.workspacePackages.get(n);if(t){let o=Wn.join(t.path,"src/index.ts");if(F$.existsSync(o))return{resolved:!0,resolvedPath:o};let s=Wn.join(t.path,t.main),a=Me(s);return a?{resolved:!0,resolvedPath:a}:{resolved:!1,error:`Workspace package '${n}' found at ${t.path} but entry point not found`,suggestion:`Check main field in ${Wn.join(t.path,"package.json")}`}}}else return{resolved:!1,error:"No tsconfig.json found",suggestion:"Ensure a tsconfig.json exists in the project root or parent directories"};return n.startsWith("@")?{resolved:!1,error:`Path alias '${n}' not found in tsconfig.json paths`,suggestion:'Check tsconfig.json "paths" configuration'}:{resolved:!1,error:"Module not found (treated as external) ",suggestion:"Install dependency or check import path"}}var Rs=new Map;function Br(n){let e=fy(n);if(!e)return null;if(Rs.has(e))return Rs.get(e)||null;let r=Z$(e);if(r.resultType==="failed")return Rs.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?Ve.dirname(i.configFileAbsolutePath):e);let o=H$(t,i.paths,i.mainFields,i.addMatchAll),s=hy(e),a=new Map;if(s){let p=Ve.join(s,"package.json");if(Bn.existsSync(p))try{let d=JSON.parse(Bn.readFileSync(p,"utf8"));a=gy(s,d)}catch{}}let c=Ve.join(e,"package.json");Bn.existsSync(c)&&yy(c).forEach((d,m)=>a.set(m,d));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=Ve.join(e,"package.json");if(Bn.existsSync(u))try{let p=JSON.parse(Bn.readFileSync(u,"utf8"));if(p.imports){for(let[d,m]of Object.entries(p.imports))if(typeof m=="string"||typeof m=="object"&&m!==null){let f=m;Array.isArray(m)&&(f=m[0]),typeof f=="object"&&(f=f.default||f.node),typeof f=="string"&&l.imports.set(d,f)}}}catch{}return Rs.set(e,l),l}function Jr(n,e,r){if(!n)return"";if(n.includes(".")&&!n.startsWith(".")&&!n.startsWith("/")&&!n.endsWith(".js")&&!n.endsWith(".ts")&&!n.endsWith(".json")){let t=n.split(".")[0];if(t&&t!==n){let o=Jr(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=Ve.dirname(e),o=Ve.resolve(t,n);return Me(o)}let i=Br(e);if(i){let t=i.matchPath(n);if(t)return Me(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=Ve.resolve(i.baseUrl,n),a=Me(s);if(a)return a}for(let[s,a]of i.imports.entries())if(s.includes("*")){let c="^"+s.replace(/[\\^$+.()|[\]{}]/g,"\\$&").replace(/\*/g,"(.*)")+"$",l=new RegExp(c),u=n.match(l);if(u){let p=u[1],d=a.replace("*",p),m=Ve.resolve(i.baseUrl,d);return Me(m)}}else if(s===n){let c=Ve.resolve(i.baseUrl,a);return Me(c)}let o=i.workspacePackages.get(n);if(o){let s=Ve.join(o.path,"src/index.ts");if(Bn.existsSync(s))return s;let a=Ve.join(o.path,o.main),c=Me(a);if(c)return c}}return""}import W$ from"fs";import B$ from"path";import by from"js-yaml";function _y(n){let e=B$.basename(n),r=W$.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return q$(r,n);if(e.endsWith(".graphql")||e.endsWith(".gql"))return K$(r,n);let t="Configuration";return e==="lerna.json"?X$(r,n):e==="turbo.json"?Q$(r,n):e==="pnpm-workspace.yaml"?eS(r,n):(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",J$(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",V$(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",G$(r,i)):e==="package.json"&&(t="Project Manifest",Y$(r,i)),{configs:i,classification:t})}function J$(n,e){let r=n.split(`
543
- `);for(let i of r){let t=i.trim();if(t.startsWith("FROM "))e.push({key:"base_image",value:t.substring(5).trim(),kind:"Image"});else if(t.startsWith("EXPOSE "))e.push({key:"port",value:t.substring(7).trim(),kind:"Port"});else if(t.startsWith("ENV ")){let o=t.substring(4).trim().split(/\s+|=/);if(o[0]){let s=o[0],a=o.slice(1).join("= ").trim()||"undefined",c="Env";(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function V$(n,e){try{let r=by.load(n);if(!r||typeof r!="object")return;if(r.services&&typeof r.services=="object")for(let[t,o]of Object.entries(r.services)){if(!o||typeof o!="object")continue;let s=o;if(e.push({key:`service:${t}`,value:t,kind:"Service"}),s.image&&e.push({key:`service:${t}:image`,value:String(s.image),kind:"Image"}),Array.isArray(s.ports)&&s.ports.forEach(a=>{e.push({key:`service:${t}:port`,value:String(a),kind:"Port"})}),s.environment){if(Array.isArray(s.environment))s.environment.forEach(a=>{let[c,...l]=a.split("= ");c&&l.length>0&&e.push({key:`service:${t}:env:${c}`,value:l.join("= "),kind:"Env"})});else if(typeof s.environment=="object")for(let[a,c]of Object.entries(s.environment))e.push({key:`service:${t}:env:${a}`,value:String(c),kind:"Env"})}if(Array.isArray(s.depends_on))s.depends_on.forEach(a=>{e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})});else if(s.depends_on&&typeof s.depends_on=="object")for(let a of Object.keys(s.depends_on))e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})}let i=(t,o="")=>{if(!(!t||typeof t!="object"||Array.isArray(t)))for(let[s,a]of Object.entries(t)){let c=o?`${o}.${s}`:s;if(r.services&&(c.startsWith("services.")||c==="services")){a&&typeof a=="object"&&!Array.isArray(a)&&i(a,c);continue}if(a&&typeof a=="object"&&!Array.isArray(a))i(a,c);else{let l=String(a),u="Env";s.toLowerCase().includes("image")&&(u="Image"),s.toLowerCase().includes("port")&&(u="Port"),s.toLowerCase().includes("service")&&(u="Service"),(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(u="Service"),e.push({key:c,value:l.length>100?l.substring(0,97)+"...":l,kind:u})}}};i(r)}catch{let i=n.match(/^\s{2}([a-z0-9_-]+):/gm);i&&i.forEach(t=>{let o=t.trim().replace(" : ","");o!=="services"&&o!=="version"&&o!=="volumes"&&o!=="networks"&&e.push({key:"service",value:o,kind:"Service"})})}}function G$(n,e){let r=n.split(`
544
- `);for(let i of r){let t=i.trim();if(t&&!t.startsWith("#")){let o=t.split("=");if(o[0]){let s=o[0].trim(),a=o.slice(1).join("=");a=a.trim().replace(/^['"](.*)['"]$/,"$1");let c="Env";(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function q$(n,e){let r=[],i="Contract (Prisma) ",t=/^model\s+(\w+)/gm,o;for(;(o=t.exec(n))!==null;)r.push({key:"model",value:o[1],kind:"Database Model"});let s=/^enum\s+(\w+)/gm;for(;(o=s.exec(n))!==null;)r.push({key:"enum",value:o[1],kind:"Database Enum"});let a=/provider\s*=\s*"([^"]+)"/,c=n.match(a);return c&&r.push({key:"datasource_provider",value:c[1],kind:"Database Config"}),{classification:i,configs:r}}function K$(n,e){let r=[],i="Contract (GraphQL) ",t=/^(?:type|input|interface|enum)\s+(\w+)/gm,o;for(;(o=t.exec(n))!==null;){let s=o[0],a="GraphQL Type";s.startsWith("input")&&(a="GraphQL Input"),s.startsWith("interface")&&(a="GraphQL Interface"),s.startsWith("enum")&&(a="GraphQL Enum"),r.push({key:"type_definition",value:o[1],kind:a})}return{classification:i,configs:r}}function Y$(n,e){try{let r=JSON.parse(n);if(r.name&&e.push({key:"name",value:r.name,kind:"Service"}),r.description&&e.push({key:"description",value:r.description,kind:"Service"}),r.workspaces){let o=Array.isArray(r.workspaces)?r.workspaces.join("",""):JSON.stringify(r.workspaces);e.push({key:"workspaces",value:o,kind:"Env"})}if(r.scripts){let o=["start","dev","build","test","docker"];for(let s of Object.keys(r.scripts))o.some(a=>s.includes(a))&&e.push({key:`script:${s}`,value:r.scripts[s],kind:"Env"})}let i={...r.dependencies,...r.devDependencies},t=["react","vue","svelte","angular","next","nuxt","express","fastify","nestjs","remix","vite","webpack","tailwindcss","database"];for(let o of Object.keys(i))if(t.some(s=>o.includes(s))){let s=i[o].replace(/[\^~]/,"");e.push({key:`dep:${o}`,value:s,kind:"Service"})}}catch{}}function X$(n,e){let r=[],i="Monorepo (Lerna) ";try{let t=JSON.parse(n);r.push({key:"monorepo_type",value:"lerna",kind:"Monorepo"}),t.version&&r.push({key:"lerna_version",value:t.version,kind:"Monorepo"}),t.packages&&(Array.isArray(t.packages)?t.packages:[t.packages]).forEach(s=>{r.push({key:"package_glob",value:s,kind:"Monorepo"})}),t.npmClient&&r.push({key:"npm_client",value:t.npmClient,kind:"Monorepo"})}catch{}return{configs:r,classification:i}}function Q$(n,e){let r=[],i="Monorepo (Turborepo) ";try{let t=JSON.parse(n);if(r.push({key:"monorepo_type",value:"turborepo",kind:"Monorepo"}),t.pipeline)for(let o of Object.keys(t.pipeline)){r.push({key:`pipeline:${o}`,value:o,kind:"Monorepo"});let s=t.pipeline[o];s.dependsOn&&r.push({key:`pipeline:${o}:depends_on`,value:s.dependsOn.join("",""),kind:"Dependency"})}if(t.tasks)for(let o of Object.keys(t.tasks))r.push({key:`task:${o}`,value:o,kind:"Monorepo"})}catch{}return{configs:r,classification:i}}function eS(n,e){let r=[],i="Monorepo (pnpm) ";try{let t=by.load(n);r.push({key:"monorepo_type",value:"pnpm",kind:"Monorepo"}),t&&t.packages&&(Array.isArray(t.packages)?t.packages:[t.packages]).forEach(s=>{r.push({key:"package_glob",value:s,kind:"Monorepo"})})}catch{}return{configs:r,classification:i}}J();import xy from"fs";import tS from"path";import $y from"js-yaml";var Sy={ignore:[],include:[],maxDepth:10},nS=[{name:".liquid-shadow.yaml",parse:n=>$y.load(n)??{}},{name:".liquid-shadow.yml",parse:n=>$y.load(n)??{}},{name:".ls.json",parse:n=>JSON.parse(n)},{name:".liquid-shadow.json",parse:n=>JSON.parse(n)},{name:".ls.rc",parse:n=>JSON.parse(n)},{name:".liquid-shadow.rc",parse:n=>JSON.parse(n)}];function Ps(n){for(let{name:e,parse:r}of nS){let i=tS.join(n,e);if(xy.existsSync(i))try{let t=xy.readFileSync(i,"utf8"),o=r(t);return $.info({repoPath:n,configFile:e},"Loaded repository configuration"),{...Sy,...o}}catch(t){$.error({repoPath:n,file:e,err:t},"Failed to parse configuration file")}}return Sy}Q();J();J();import{Worker as rS}from"node:worker_threads";import{cpus as iS}from"node:os";import{fileURLToPath as oS}from"node:url";import{dirname as sS,join as ky}from"node:path";import{existsSync as Ey}from"node:fs";var Iy=oS(import.meta.url),wy=sS(Iy);function aS(){if(Iy.endsWith(".ts")){let e=ky(wy,"worker.ts");if(Ey(e))return e}let n=ky(wy,"worker.js");return Ey(n)?n:Zn("dist/logic/domain/embeddings/worker.js")}var Vr=class{workers=[];taskQueue=[];pendingTasks=new Map;taskIdCounter=0;initialized=!1;initPromise;shutdownRequested=!1;numWorkers;cacheDir;initTimeout;constructor(e={}){this.numWorkers=e.numWorkers??Math.max(1,iS().length-1),this.cacheDir=e.cacheDir??"./.cache",this.initTimeout=e.initTimeout??6e4}async initialize(){if(!this.initialized)return this.initPromise?this.initPromise:(this.initPromise=this._doInitialize(),this.initPromise)}async _doInitialize(){let e;try{$.info({numWorkers:this.numWorkers},"Initializing embedding worker pool");let r=new Promise((i,t)=>{e=setTimeout(()=>t(new Error(`Worker pool initialization timed out after ${this.initTimeout}ms`)),this.initTimeout)});if(await Promise.race([this._initializeWorkers(),r]),e&&clearTimeout(e),this.shutdownRequested){this.initialized=!1,this.initPromise=void 0,$.debug("Initialization completed but shutdown was requested");return}this.initialized=!0,$.info({numWorkers:this.workers.length},"Embedding worker pool ready")}catch(r){throw e&&clearTimeout(e),this.initPromise=void 0,this.initialized=!1,await this.shutdown(),r}}async _initializeWorkers(){let e=aS();$.debug({workerPath:e},"Resolved worker path");for(let r=0;r<this.numWorkers;r++)await this.createWorker(e,r),await new Promise(i=>setTimeout(i,50))}async createWorker(e,r){return new Promise((i,t)=>{let o=setTimeout(()=>{t(new Error(`Worker ${r} initialization timed out`))},this.initTimeout),s=new rS(e,{workerData:{cacheDir:this.cacheDir},execArgv:process.execArgv}),a={worker:s,busy:!1,currentTaskId:null};s.on("message",c=>{if(c.type==="ready"){if(clearTimeout(o),this.shutdownRequested){$.debug({workerIndex:r},"Worker ready but shutdown requested, terminating"),s.terminate().catch(()=>{}),i();return}this.workers.push(a),$.debug({workerIndex:r},"Worker ready"),i()}else c.type==="result"&&c.id?this.handleTaskComplete(a,c.id,c.embeddings||[]):c.type==="error"&&c.id&&this.handleTaskError(a,c.id,new Error(c.error||"Unknown error"))}),s.on("error",c=>{if(clearTimeout(o),$.error({err:c,workerIndex:r},"Worker error"),a.currentTaskId&&this.handleTaskError(a,a.currentTaskId,c),!this.initialized){t(c);return}let l=this.workers.indexOf(a);l!==-1&&this.workers.splice(l,1),!this.shutdownRequested&&this.initialized&&this.createWorker(e,r).catch(u=>{$.error({err:u},"Failed to replace crashed worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&$.warn({workerIndex:r,code:c},"Worker exited unexpectedly")})})}handleTaskComplete(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.resolve(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}handleTaskError(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.reject(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}processQueue(){if(this.taskQueue.length===0)return;let e=this.workers.find(i=>!i.busy);if(!e)return;let r=this.taskQueue.shift();r&&(e.busy=!0,e.currentTaskId=r.id,this.pendingTasks.set(r.id,r),e.worker.postMessage({type:"embed",id:r.id,texts:r.texts}))}async generateEmbeddings(e,r=32,i){if(this.initialized||await this.initialize(),e.length===0)return[];let t=[];for(let l=0;l<e.length;l+=r)t.push(e.slice(l,l+r));let o=new Array(t.length),s=0,a=t.map((l,u)=>new Promise((p,d)=>{let f={id:`task_${++this.taskIdCounter}`,texts:l,resolve:h=>{if(o[u]=h,s++,i){let _=Math.min(s*r,e.length);i(_,e.length)}p()},reject:h=>{if(o[u]=new Array(l.length).fill(null),s++,$.warn({err:h,chunkIndex:u},"Chunk embedding failed"),i){let _=Math.min(s*r,e.length);i(_,e.length)}p()}};this.taskQueue.push(f),this.processQueue()}));await Promise.all(a);let c=[];for(let l of o)c.push(...l);return $.info({total:e.length,successful:c.filter(l=>l!==null).length,workers:this.workers.length},"Parallel embedding generation complete"),c}get workerCount(){return this.workers.length}get busyWorkers(){return this.workers.filter(e=>e.busy).length}get queueSize(){return this.taskQueue.length}get isInitialized(){return this.initialized}async shutdown(){if(this.shutdownRequested=!0,this.initPromise)try{await this.initPromise}catch{}if(!this.initialized&&this.workers.length===0){this.shutdownRequested=!1,this.initPromise=void 0;return}$.info({numWorkers:this.workers.length},"Shutting down embedding worker pool");let e=this.workers.map(r=>new Promise(i=>{r.worker.postMessage({type:"shutdown"}),r.worker.once("exit",()=>i()),setTimeout(()=>{r.worker.terminate().then(()=>i())},5e3)}));await Promise.all(e),this.workers=[],this.taskQueue=[],this.pendingTasks.clear(),this.initialized=!1,this.shutdownRequested=!1,$.info("Embedding worker pool shutdown complete")}},Jn=null;function hd(n){return Jn||(Jn=new Vr(n)),Jn}async function Vn(){Jn&&(await Jn.shutdown(),Jn=null)}var Gr=null;async function cS(){return Gr||(Gr=await import("@xenova/transformers"),Gr.env.cacheDir="./.cache",Gr.env.allowLocalModels=!1),Gr}var lS=128,Ty=!1;function Gn(n){Ty=n,$.info({useWorkerThreads:n},"Worker thread mode updated")}var gd=null;async function Ry(){return gd||(gd=(async()=>{$.info("Loading embedding model (all-MiniLM-L6-v2)...");let{pipeline:n}=await cS();return await n("feature-extraction","Xenova/all-MiniLM-L6-v2")})()),gd}async function yd(n){try{let r=await(await Ry())(n,{pooling:"mean",normalize:!0});return Array.from(r.data)}catch(e){return $.error({err:e},"Failed to generate embedding"),null}}async function vd(n,e=lS,r){return n.length===0?[]:Ty?hd().generateEmbeddings(n,e,r):uS(n,e,r)}async function uS(n,e,r){let i=new Array(n.length).fill(null),t=await Ry();for(let o=0;o<n.length;o+=e){let s=Math.min(o+e,n.length),a=n.slice(o,s);try{let c=await t(a,{pooling:"mean",normalize:!0}),[l,u]=c.dims;for(let p=0;p<l;p++){let d=p*u,m=d+u;i[o+p]=Array.from(c.data.slice(d,m))}}catch(c){$.error({err:c,batchStart:o,batchEnd:s},"Single-threaded batch embedding failed, falling back to sequential for this chunk");for(let l=0;l<a.length;l++)try{let u=a[l];if(!u||u.trim().length===0)continue;let p=await t(u,{pooling:"mean",normalize:!0});i[o+l]=Array.from(p.data)}catch{i[o+l]=null}}r&&r(s,n.length)}return $.debug({total:n.length,successful:i.filter(o=>o!==null).length},"Batch embedding complete"),i}function _d(n,e){let r=0,i=0,t=0;for(let o=0;o<n.length;o++)r+=n[o]*e[o],i+=n[o]*n[o],t+=e[o]*e[o];return r/(Math.sqrt(i)*Math.sqrt(t))}var Oz=dS.cpus().length||4,mS=Wo.DEFAULT_CONCURRENCY;async function ee(n,e=mS,r=!1,i=!0,t){let o=j.getInstance(n),s=o.files.database,a=Ps(n),c=a.concurrency??e;if(Ug(),!r&&et(n)){let v=Oh(n),g=He(n);if(v&&!Wh(n,v))return id(),$.debug({repoPath:n,commit:g},"Index is current, skipping re-index (fast-path)"),s}Br(n);let l=o.files.findAll(),u=new Map(l.map(v=>[v.path,{mtime:v.mtime,hash:v.content_hash}])),p=Date.now();t?.({phase:"scan",current:0,total:0,message:"Scanning repository..."});let d=await cd(n,a.ignore),m=new Map(d.map(v=>[v.path,v.mtime])),f=l.filter(v=>!m.has(v.path)).map(v=>v.path),h=l.length===0,_=[];if(r||h)_.push(...d);else{let v=d.filter(E=>{let w=u.get(E.path);return!w||w.mtime!==E.mtime}),g=Py(c*4),x=v.map(E=>g(async()=>{let w=u.get(E.path);if(!w||!w.hash)return E;try{let T=await bd.promises.readFile(E.path,"utf8");return Dh(T,w.hash)?E:(o.files.updateMtime(E.path,E.mtime),null)}catch{return null}})),I=await Promise.all(x);_.push(...I.filter(E=>E!==null))}if(f.length===0&&_.length===0){if(id(),h){let v=He(n);Bp(n,v||void 0)}return s}if(h?$.info({totalFiles:d.length},"Starting initial repository indexing..."):$.info({toDelete:f.length,toProcess:_.length},"Syncing repository updates..."),f.length>0&&o.files.deletePaths(f),_.length>0){Zg(),i?Gn(!0):Gn(!1);let v=Py(c),g=0,x=_.length,I=_.map(V=>v(async()=>{try{let k=pS.basename(V.path);if(/\.(ts|tsx|php|py|go|js|jsx|mjs|cjs)$/.test(k)){let H=await Zr(V.path),L=bd.readFileSync(V.path,"utf8");return g++,(g%50===0||g===x)&&$.info({completed:g,total:x},"Parsing files..."),t?.({phase:"parse",current:g,total:x,message:`Parsing ${k}`}),{meta:V,...H,content:L,embedding:null,kind:"code"}}else{let H=_y(V.path),L=bd.readFileSync(V.path,"utf8");return g++,(g%50===0||g===x)&&$.info({completed:g,total:x},"Parsing configs..."),t?.({phase:"parse",current:g,total:x,message:`Parsing config ${k}`}),{meta:V,...H,content:L,embedding:null,kind:"config"}}}catch(k){return g++,$.error({path:V.path,error:k},"Failed to parse file"),{meta:V,exports:[],imports:[],content:"",kind:"error"}}}));$.info({total:x},"Phase 1: Parsing all files...");let E=Date.now(),w=(await Promise.all(I)).filter(Boolean),T=Date.now()-E;if($s("parse",T),$.info({count:w.length,time:`${(T/1e3).toFixed(1)}s`},"Phase 1 complete"),i){$.info("Phase 2: Generating file semantic embeddings..."),t?.({phase:"embed",current:0,total:w.length,message:"Generating embeddings..."});let V=Date.now(),k=[];if(w.forEach((H,L)=>{"summary"in H&&H.summary&&k.push({fileIdx:L,text:H.summary})}),k.length>0){$.info({count:k.length}," \u2192 Generating file summary embeddings...");let H=k.map(Y=>Y.text),L=await vd(H,128);k.forEach((Y,U)=>{w[Y.fileIdx].embedding=L[U]}),$.info({count:k.length}," \u2713 File summaries complete")}let D=Date.now()-V;$s("embed",D),$.info({time:`${(D/1e3).toFixed(1)}s`},"Phase 2 complete")}t?.({phase:"persist",current:0,total:w.length,message:"Saving to database..."});let O=Date.now();o.files.batchSaveIndexResults(w,n,Wp,Jr),$s("persist",Date.now()-O)}if(h||_.length>0){let v=He(n);Bp(n,v||void 0)}return(_.length>0||f.length>0)&&new Pe(n).detectAndRepairShifts(),Fg(Date.now()-p),t?.({phase:"complete",current:_.length,total:_.length,message:"Indexing complete"}),s}J();import Ny from"path";import fS from"ignore";import zy from"fs";Q();async function xd(n,e=Wo.DEFAULT_CONCURRENCY,r="detailed",i,t){$.info({repo:n,level:r,subPath:i},"Ensuring cache is up-to-date..."),await ee(n,e);let{files:o,exports:s,imports:a}=j.getInstance(n),c=i?o.findInSubPath(n,i):o.findAll(),l=Ps(n),u=fS(),p=Ny.join(n,".gitignore");if(zy.existsSync(p)&&u.add(zy.readFileSync(p,"utf8")),l.ignore&&l.ignore.length>0&&u.add(l.ignore),u.add(Ho),c=c.filter(g=>{let x=Ny.relative(n,g.path);return!u.ignores(x)}),$.info({count:c.length},"Fetching data from DB..."),r==="lite"){let g=c.map(x=>({path:x.path,mtime:x.mtime}));return Hr(g,n,r,t)}if(r==="summaries"){let g=c.map(x=>({path:x.path,mtime:x.mtime,classification:x.classification||void 0,summary:x.summary||void 0}));return Hr(g,n,r,t)}let d=c.map(g=>g.path),m=s.findByFiles(d),f=r==="detailed"?a.findByFiles(d):[],h=new Map;for(let g of m){let x=h.get(g.file_path)||[];x.push(g),h.set(g.file_path,x)}let _=new Map;for(let g of f){let x=_.get(g.file_path)||[];x.push(g),_.set(g.file_path,x)}let v=c.map(g=>{let I=(h.get(g.path)||[]).map(w=>({name:w.name,kind:w.kind,signature:w.signature,line:w.start_line}));r==="structure"?I=I.map(w=>({name:w.name,kind:w.kind,line:w.line})):r==="signatures"&&(I=I.map(w=>({name:w.name,kind:w.kind,signature:w.signature,line:w.line})));let E=[];return r==="detailed"&&(E=(_.get(g.path)||[]).map(T=>({module:T.module_specifier,resolved_path:T.resolved_path}))),{path:g.path,mtime:g.mtime,classification:g.classification||void 0,summary:g.summary||void 0,exports:I,imports:E.length>0?E:void 0,chunks:[]}});return $.info({count:v.length},"Building hierarchical project tree..."),Hr(v,n,r,t)}Q();var qr=class{static extractSnippet(e,r,i=300){if(!e||!r)return"";let t=r.toLowerCase().split(/\s+/).filter(d=>d.length>2&&!["the","and","for","with","from"].includes(d));if(t.length===0)return e.slice(0,i)+"...";let o=e.split(`
553
+ `;default:return""}}mapKind(e,r){if(e==="import")return"ImportDeclaration";if(r===".php"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration";if(e==="interface")return"InterfaceDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="method")return"MethodDeclaration"}if(r===".py"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration"}if(r===".go"){if(e==="func")return"FunctionDeclaration";if(e==="type")return"TypeDeclaration"}if(r===".rs"){if(e==="func")return"FunctionDeclaration";if(e==="struct")return"StructDeclaration";if(e==="enum")return"EnumDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="type")return"TypeDeclaration"}return"Unknown"}mapClassification(e){return e==="import"?"Dependency":e==="func"||e==="method"?"Function":e==="class"||e==="interface"||e==="trait"||e==="struct"||e==="enum"||e==="type"?"Class":"Other"}async parse(e,r){await this.ensureInitialized();let i=zy.extname(e).toLowerCase(),t=await this.getLanguage(i);if(!t||!this.parser)return[];this.parser.setLanguage(t);let o=this.parser.parse(r),s=r.split(`
554
+ `),a=this.getQueries(i);if(!a)return[];let l=new sn.Query(t,a).matches(o.rootNode),u=[];for(let p of l){let d=p.captures.find(h=>h.name==="name")?.node,m=p.captures[0].node,f=p.captures[0].name;if(d){let h=m.startPosition.row+1,_=m.endPosition.row+1,v=s[m.startPosition.row].trim();u.push({name:d.text,kind:this.mapKind(f,i),classification:this.mapClassification(f),signature:v,line:h,endLine:_,doc:"",capabilities:"{}"})}}return u}};var As=class{parse(e,r=!1){let i=[],t=[],o=e.split(`
555
+ `),s="",a="",c=0,l=0,u=-1,p=-1,d=[],m=[],f=!1,h=r?"api":"",_="",v=/^namespace\s+([a-zA-Z0-9_\\]+);/,g=/^(?:abstract\s+)?(?:readonly\s+)?class\s+([a-zA-Z0-9_]+)/,b=/^interface\s+([a-zA-Z0-9_]+)/,S=/^trait\s+([a-zA-Z0-9_]+)/,k=/^(?:public|protected|private|static|\s)*function\s+([a-zA-Z0-9_]+)\s*\(/,w=/^use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/,R=/^#\[([a-zA-Z0-9_\\]+)(?:\((.*)\))?\]/,j=/(?:Route::|router->|\$router->|->)(get|post|put|delete|patch|match)\s*\(\s*(?:uri\s*:\s*)?['"]([^'"]+)['"]/,B=/->prefix\s*\(\s*(?:prefix\s*:\s*)?['"]([^'"]+)['"]/;for(let T=0;T<o.length;T++){let O=o[T].trim();if(!O)continue;let J=(O.match(/{/g)||[]).length,V=(O.match(/}/g)||[]).length,q=l;if(l+=J-V,a&&l<=p){let W=i.find(H=>H.name===a&&H.line===c);W&&(W.endLine=T+1),a="",p=-1}if(s&&l<=u){let W=i.find(H=>H.name===s&&(H.kind==="ClassDeclaration"||H.kind==="TraitDeclaration"||H.kind==="InterfaceDeclaration"));W&&(W.endLine=T+1),s="",u=-1}let I=O.match(B);if(I&&(h=I[1]),O.includes("});")&&(h=""),O.startsWith("/**")){f=!0,m=[];continue}if(f){O.endsWith("*/")?f=!1:m.push(O.replace(/^\*\s?/,""));continue}let C=O.match(R);if(C){d.push(C[1]);continue}let U=O.match(v);if(U){_=U[1]||"",d=[],m=[];continue}let M=O.match(g);if(M){s=M[1],u=l-J;let W={attributes:d};_&&(W.namespace=_),i.push({name:s,kind:"ClassDeclaration",classification:"Class",signature:`class ${s}`,line:T+1,endLine:T+1,doc:m.join(`
556
+ `).trim(),capabilities:JSON.stringify(W),members:[]}),d=[],m=[];continue}let L=O.match(b);if(L){let W=L[1];s=W,u=l-J,i.push({name:W,kind:"InterfaceDeclaration",classification:"Interface",signature:`interface ${W}`,line:T+1,endLine:T+1,doc:m.join(`
557
+ `).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let Z=O.match(S);if(Z){let W=Z[1];s=W,u=l-J,i.push({name:W,kind:"TraitDeclaration",classification:"Trait",signature:`trait ${W}`,line:T+1,endLine:T+1,doc:m.join(`
558
+ `).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let ee=O.match(k);if(ee){let W=ee[1],H=!!s;a=W,c=T+1,p=l-J;let Fe=!1,Ee={};for(let ye of d)ye.toLowerCase().includes("route")&&(Fe=!0,Ee={type:"route",method:"GET",path:"/"});let Xe=m.join(`
559
+ `).trim();if(Fe){let ye=Ee.path||"/";i.push({name:ye,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${W}`,line:T+1,endLine:T+1,doc:Xe,capabilities:JSON.stringify({type:"route",handler:s?`${s}@${W}`:W,...Ee})}),t.push({type:"api_route",name:ye,direction:"consume",line:T+1,snippet:O})}i.push({name:W,kind:H?"MethodDeclaration":"FunctionDeclaration",classification:H?"Method":"Function",signature:`${H?s+":: ":""}${W}`,line:T+1,endLine:T+1,doc:Xe,capabilities:JSON.stringify({attributes:d})}),d=[],m=[];continue}let ce=O.match(w);if(ce){let W=ce[1]||"",H=ce[2]||W.split("\\").pop()||"";i.push({name:H,kind:"ImportSpecifier",classification:"Dependency",signature:`use ${W}`,line:T+1,endLine:T+1,doc:"",capabilities:JSON.stringify({type:"use",namespace:W})}),d=[],m=[];continue}let ne=O.match(j);if(ne){let W=ne[1].toUpperCase(),H=ne[2];if(O.includes("Route::")||O.includes("router->")||O.includes("action")||O.includes(",")&&!O.includes("view(")){if(h){let bt=h.startsWith("/")?h:`/${h}`,Xs=H.startsWith("/")?H:`/${H}`;H=(bt+Xs).replace(/\/+/g,"/")}let Ee=null,Xe=O.match(/\[\s*([a-zA-Z0-9_]+)::class\s*,\s*['"]([^'"]+)['"]\s*\]/);if(Xe)Ee=`${Xe[1]}@${Xe[2]}`;else if(O.includes("::class")){let bt=O.match(/([a-zA-Z0-9_]+)::class/);bt&&(Ee=bt[1])}let ye=O;!O.endsWith(");")&&T+1<o.length&&(ye+=" "+o[T+1].trim(),!ye.endsWith(");")&&T+2<o.length&&(ye+=" "+o[T+2].trim())),i.push({name:H,kind:"HTTP Route",classification:"Service Boundary",signature:ye,line:T+1,endLine:T+1,doc:"",capabilities:JSON.stringify({type:"route",method:W,path:H,handler:Ee})}),t.push({type:"api_route",name:H,direction:"consume",line:T+1,snippet:ye,method:W,url:H}),m=[];continue}}let oe=/(?:\$client|client|Http)::(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)|(?:\$client|client)->(request|get|post|put|delete|patch)\s*\(\s*([^,)]+)/,G=O.match(oe);if(G){let W=(G[1]||G[3]).toUpperCase(),H=(G[2]||G[4]).trim();(H.startsWith("'")&&H.endsWith("'")||H.startsWith('"')&&H.endsWith('"'))&&(H=H.substring(1,H.length-1)),t.push({type:"api_route",name:H,direction:"produce",line:T+1,snippet:O,method:W,url:H})}!O.startsWith("#[")&&!O.startsWith("//")&&!O.startsWith("*")&&!f&&(d=[],m=[])}return{nodes:i,events:t}}};var Cs=class{currentRoutePrefix="";parse(e){this.currentRoutePrefix="";let r=[],i=[],t=e.split(`
560
+ `),o=[{indent:-1,name:"root",type:"root"}],s=[],a=/^class\s+([a-zA-Z0-9_]+)/,c=/^async\s+def\s+([a-zA-Z0-9_]+)|^def\s+([a-zA-Z0-9_]+)/,l=/^(?:from\s+([a-zA-Z0-9_\.]+)\s+import|import\s+([a-zA-Z0-9_\.]+))/,u=/^@(.*)/;function p(v){return v.trim().split(/[.(]/)[0]?.trim()||v}function d(v){let g=v.decorators.map(S=>p(S.raw)),b={decorators:v.decorators,decoratorNames:g};return v.async===!0&&(b.async=!0),JSON.stringify(b)}let m=!1,f="",h=[],_=[];for(let v=0;v<t.length;v++){let g=t[v],b=g.trim();if(!b||b.startsWith("#"))continue;let S=/^([a-zA-Z0-9_]+)\s*=\s*(?:APIRouter|Blueprint)\s*\(\s*(?:prefix\s*=\s*)?['"]([^'"]+)['"]/,k=b.match(S);if(k&&(this.currentRoutePrefix=k[2]),m){if(b.endsWith(f)||b.includes(f)){m=!1;let M=b.replace(f,"").trim();M&&h.push(M);let L=o[o.length-1];L.node&&(L.node.doc=h.join(`
561
+ `).trim()),h=[]}else h.push(b);continue}let w=g.search(/\S/),R=g.trim(),j=R.match(/^(['"]{3})/);if(j){let M=j[1],L=o[o.length-1];if(L.node&&!L.node.doc){if(R.substring(3).includes(M)){let Z=R.replace(new RegExp(M,"g"),"").trim();L.node.doc=Z}else{m=!0,f=M;let Z=R.substring(3).trim();Z&&h.push(Z)}continue}}for(;o.length>1&&o[o.length-1].indent>=w;)o.pop();let B=o[o.length-1],T=R.match(u);if(T){s.push({raw:T[1].trim(),line:v+1});continue}let O=R.match(a);if(O){let M=O[1],L={name:M,kind:"ClassDeclaration",classification:"Class",signature:`class ${M}`,line:v+1,endLine:v+1,doc:"",capabilities:d({decorators:s}),members:[]};_.push(L),B.node?(B.node.members||(B.node.members=[]),B.node.members.push(L)):r.push(L),o.push({indent:w,name:M,type:"class",node:L}),s=[];continue}let J=R.match(c);if(J){let M=!!J[1],L=J[1]||J[2],Z=B.type==="class",ee=!1,ce={};for(let H of s)if(H.raw.match(/(?:app|router)\.(get|post|put|delete|patch)/)){ee=!0;let Ee=["get","post","put","delete","patch"].find(bt=>H.raw.toLowerCase().includes(`.${bt}`))?.toUpperCase()||"GET",Xe=H.raw.match(/['"]([^'"]+)['"]/),ye=Xe?Xe[1]:"/";if(this.currentRoutePrefix){let bt=this.currentRoutePrefix.endsWith("/")?this.currentRoutePrefix.slice(0,-1):this.currentRoutePrefix,Xs=ye.startsWith("/")?ye:`/${ye}`;ye=bt+Xs}ce={type:"route",method:Ee,path:ye}}if(ee){let H=ce.path||"",Fe={name:H||L,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${L}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({handler:Z?`${B.name}.${L}`:L,async:M,...ce})};_.push(Fe),r.push(Fe),i.push({type:"api_route",name:H,direction:"consume",line:v+1,snippet:R})}let ne=s.some(H=>H.raw==="staticmethod"),oe=s.some(H=>H.raw==="classmethod"),G=`${M?"async ":""}${Z?(ne?"@staticmethod ":oe?"@classmethod ":"")+B.name+".":""}${L}`,W={name:L,kind:M&&Z?"AsyncMethodDeclaration":M?"AsyncFunctionDeclaration":Z?"MethodDeclaration":"FunctionDeclaration",classification:Z?ne||oe?"Static Method":"Method":"Function",signature:G,line:v+1,endLine:v+1,doc:"",capabilities:d({decorators:s,async:M}),members:[]};_.push(W),B.node?(B.node.members||(B.node.members=[]),B.node.members.push(W)):r.push(W),o.push({indent:w,name:L,type:"function",node:W}),s=[];continue}let V=/^(?:path|re_path|url)\s*\(\s*['"]([^'"]+)['"]/,q=R.match(V);if(q){let M=q[1].replace(/^\^/,""),L={name:M,kind:"HTTP Route",classification:"Service Boundary",signature:R.trim(),line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"route",method:"GET",path:M})};_.push(L),r.push(L),i.push({type:"api_route",name:M,direction:"consume",line:v+1,snippet:R});continue}let I=/(?:requests|httpx|client|http)\.(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)/,C=R.match(I);if(C){let M=C[1].toUpperCase(),L=C[2].trim();(L.startsWith("'")&&L.endsWith("'")||L.startsWith('"')&&L.endsWith('"'))&&(L=L.substring(1,L.length-1)),i.push({type:"api_route",name:L,direction:"produce",line:v+1,snippet:R,method:M,url:L})}let U=R.match(l);if(U){let M=U[1]||U[2],L={name:M,kind:"ImportSpecifier",classification:"Dependency",signature:`import ${M}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"import",module:M})};_.push(L),r.push(L),s=[];continue}s=[],B.node&&(B.node.endLine=v+1)}return{nodes:_,events:i}}};var Dy=[{extension:[".php"],rules:[]},{extension:[".py"],rules:[]},{extension:[".go"],rules:[{regex:/func\s+([a-zA-Z0-9_]+)\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function",signature:n[0]})},{regex:/func\s+\([^\)]+\)\s+([a-zA-Z0-9_]+)\(/g,onMatch:n=>({name:n[1],kind:"MethodDeclaration",classification:"Method",signature:n[0]})},{regex:/import\s+['"]([^'"]+)['"]/g,onMatch:n=>({name:n[1],kind:"ImportSpecifier",classification:"Dependency",signature:n[0],meta:{type:"import",path:n[1]}})}]},{extension:[".rs"],rules:[{regex:/fn\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function",signature:n[0]})},{regex:/struct\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"StructDeclaration",classification:"Class",signature:n[0]})},{regex:/enum\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"EnumDeclaration",classification:"Class",signature:n[0]})},{regex:/trait\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"TraitDeclaration",classification:"Class",signature:n[0]})},{regex:/use\s+([a-zA-Z0-9_:]+(?:\s+as\s+[a-zA-Z0-9_]+)?);/g,onMatch:n=>({name:n[1].trim(),kind:"ImportDeclaration",classification:"Dependency",signature:n[0],meta:{type:"import",path:n[1].trim()}})}]},{extension:[".ts",".tsx",".js",".jsx",".mjs",".cjs"],rules:[{regex:/(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function"})},{regex:/(?:export\s+)?class\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"ClassDeclaration",classification:"Class"})},{regex:/(?:export\s+)?interface\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"InterfaceDeclaration",classification:"Interface"})},{regex:/(?:export\s+)?const\s+([a-zA-Z0-9_]+)\s*=/g,onMatch:n=>({name:n[1],kind:"VariableDeclaration",classification:"Constant"})},{regex:/import\s+.*\s+from\s+['"]([^'"]+)['"]/g,onMatch:n=>({name:n[1],kind:"ImportDeclaration",classification:"Dependency",meta:{path:n[1]}})}]}];function mS(n,e){let r=[];if(n===".go"&&e.some(i=>i.kind==="TypeDeclaration")&&r.push("Go type"),n===".rs"&&(e.some(i=>i.kind==="TraitDeclaration")&&r.push("Rust trait"),e.some(i=>i.kind==="StructDeclaration")&&r.push("Rust struct"),e.some(i=>i.kind==="EnumDeclaration")&&r.push("Rust enum")),n===".py"){for(let i of e)if(i.capabilities)try{if(JSON.parse(i.capabilities).decoratorNames?.length){r.push("Python decorators");break}}catch{}e.some(i=>i.kind==="AsyncFunctionDeclaration"||i.kind==="AsyncMethodDeclaration")&&r.push("Async")}return r}var js=class{phpParser=new As;pythonParser=new Cs;treeSitterParser=new Ls;supports(e){return Dy.some(r=>r.extension.includes(e.toLowerCase()))}async parse(e,r){let i=$d.extname(e).toLowerCase(),t=[],o=[];if(i===".php"||i===".py"||i===".go"||i===".rs"){if(i===".py"){let c=this.pythonParser.parse(r);t=c.nodes,o=c.events}else if(i===".php"){let c=e.toLowerCase().endsWith("api.php"),l=this.phpParser.parse(r,c);t=l.nodes,o=l.events}else try{t=await this.treeSitterParser.parse(e,r)}catch{}if(t.length>0){let c=i===".php"?"Micro IR (PHP/TS) ":i===".py"?"Micro IR (Python/TS) ":i===".go"?"Micro IR (Go/TS) ":"Micro IR (Rust/TS) ",l=t.filter(m=>m.classification!=="Dependency"),u=t.filter(m=>m.classification==="Dependency"),p=mS(i,t),d=Xr({classification:c,capabilities:p,exports:l.map(m=>({name:m.name,kind:m.kind,classification:m.classification})),fileName:$d.basename(e)});return{exports:l,imports:u.map(m=>({module:m.name,name:m.name,kind:m.kind,classification:m.classification})),events:o,classification:c,summary:d||`${i.substring(1).toUpperCase()} module`,parseStatus:"success"}}}let s=Dy.find(c=>c.extension.includes(i));if(!s)return{exports:[],imports:[],classification:"Unknown",summary:"",parseStatus:"failed",parseError:`Unsupported file extension: ${i}`};for(let c of s.rules){c.regex.lastIndex=0;let l;for(;(l=c.regex.exec(r))!==null;){let u=c.onMatch(l),p=r.substring(0,l.index).split(`
562
+ `).length;t.push({name:u.name||"anonymous",kind:u.kind||"Unknown",classification:u.classification||"Other",signature:u.signature||l[0],line:p,endLine:p,doc:"",capabilities:JSON.stringify(u.meta||{})})}}let a=Xr({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(c=>({name:c.name,kind:c.kind,classification:c.classification})),fileName:$d.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:a||"Module",parseStatus:t.length>0?"success":"partial"}}};K();var kd=new js;async function Qr(n){let e=Ly.extname(n);if(kd.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=await Oy.promises.readFile(n,"utf-8");return{...await kd.parse(n,o),content:o}}catch(o){return x.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:o.message}}let r;try{r=await Oy.promises.readFile(n)}catch(o){return{exports:[],imports:[],classification:"Error",summary:"",content:"",parseStatus:"failed",parseError:`File read error: ${o.message}`}}let i=r.toString("utf8"),t=xy(i);try{let o=n.endsWith(".tsx"),s=n.endsWith(".d.ts")||n.endsWith(".d.tsx"),a,c={syntax:"typescript",tsx:o,decorators:!0,comments:!0};if(s)try{a=Sd.parseSync(i,c)}catch{a=Sd.parseSync(i,{...c,isModule:!1})}else a=Sd.parseSync(i,c);let l=a.span.start,u=$y(r),p=ky(i),d=S=>Sy(S,l,r),m=wy(a.body),f=Ry(a.body);f.length>0&&x.debug({filePath:n,count:f.length},"Extracted type references"),f.forEach(S=>{m.push({module:"__type_reference__",name:S})});let h=Iy(a.body,l,r,i,t,p,n,d,u),_=Ty(a.body,l,r,t,d,u),v=Os(n,"","Module"),g=p.length>0&&p[0].start===0?p[0].text:h.find(S=>S.doc)?.doc||"",b=Ey(g);if(!b&&h.length>0){let S=Yr(i);b=Xr({classification:v,capabilities:S,exports:h.map(k=>({name:k.name,kind:k.kind,classification:k.classification})),fileName:Ly.basename(n)})}return{exports:h,imports:m,events:_,classification:v,summary:b,content:i,parseStatus:"success"}}catch(o){x.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=await kd.parse(n,i);return{...s,content:i,classification:s.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${o.message}`}}catch(s){return x.error({filePath:n,error:s.message},"All parsing strategies failed"),{exports:[],imports:[],classification:"Error",summary:"",content:i,parseStatus:"failed",parseError:`All parsing strategies failed: ${s.message}`}}}}import Ms from"path";var fS=50;function ei(n,e,r,i){let t={name:Ms.basename(e)||e,type:"directory",path:e,children:[]};return n.forEach(o=>{let a=Ms.relative(e,o.path).split(Ms.sep),c=t;for(let l=0;l<a.length;l++){let u=a[l];if(i!==void 0&&l>=i)return;let p=l===a.length-1;if(i===1&&l===0&&p)return;let d=i!==void 0&&l===i-1&&!p,m=Ms.join(e,...a.slice(0,l+1)),f=c.children?.find(h=>h.name===u);if(!f){if(c.children&&c.children.length>=fS){c.children.find(v=>v.type==="truncated")||c.children.push({name:"... (truncated) ",type:"truncated",path:"",children:void 0});return}f={name:u,type:p?"file":"directory",path:m,children:p||d?void 0:[],summary:p?{classification:o.classification,summaryText:o.summary,exports:o.exports,imports:o.imports,chunks:o.chunks}:void 0},f.summary&&(r==="structure"||r==="signatures")&&(delete f.summary.chunks,delete f.summary.imports),c.children?.push(f)}c=f}}),t}K();import Id from"p-limit";Kt();import Td from"path";import FS from"fs";import ZS from"os";import qe from"path";import Qn from"fs";import{loadConfig as yS,createMatchPath as vS}from"tsconfig-paths";import Ct from"path";import ti from"fs";var jt=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function Ay(n){let e;try{e=ti.statSync(n).isDirectory()?n:Ct.dirname(n)}catch(r){throw r.code==="ENOENT"?new jt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new jt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new jt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Ct.dirname(e);){let r=Ct.join(e,"tsconfig.json");if(ti.existsSync(r))return e;e=Ct.dirname(e)}return null}function Cy(n){let e;try{e=ti.statSync(n).isDirectory()?n:Ct.dirname(n)}catch(r){throw r.code==="ENOENT"?new jt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new jt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new jt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Ct.dirname(e);){let r=Ct.join(e,"package.json");if(ti.existsSync(r))try{if(JSON.parse(ti.readFileSync(r,"utf8")).workspaces)return e}catch{}e=Ct.dirname(e)}return null}import Yn from"path";import an from"fs";function jy(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=Yn.join(n,o);if(!an.existsSync(s))continue;let a=an.readdirSync(s);for(let c of a){let l=Yn.join(s,c,"package.json");if(an.existsSync(l))try{let u=JSON.parse(an.readFileSync(l,"utf8"));u.name&&r.set(u.name,{name:u.name,path:Yn.dirname(l),main:u.main||"dist/index.js"})}catch{}}}return r}function My(n){let e=new Map;try{let r=JSON.parse(an.readFileSync(n,"utf8")),i={...r.dependencies,...r.devDependencies};for(let[t,o]of Object.entries(i))if(typeof o=="string"&&o.startsWith("file:")){let s=o.substring(5),a=Yn.dirname(n),c=Yn.resolve(a,s),l=Yn.join(c,"package.json");if(an.existsSync(l))try{let u=JSON.parse(an.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import Uy from"path";import Ve from"fs";var hS=[".ts",".tsx",".d.ts",".js",".jsx"];function Ue(n){let e=Uy.extname(n);if(e===".js"||e===".jsx"){let r=n.slice(0,-e.length),i=e===".jsx"?[".tsx",".ts"]:[".ts",".tsx"];for(let t of i){let o=r+t;if(Ve.existsSync(o)&&Ve.statSync(o).isFile())return o}if(Ve.existsSync(n)&&Ve.statSync(n).isFile())return n}if(Ve.existsSync(n)&&Ve.statSync(n).isFile())return n;for(let r of hS){let i=n+r;if(Ve.existsSync(i)&&Ve.statSync(i).isFile())return i}if(Ve.existsSync(n)&&Ve.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=Uy.join(n,"index"+r);if(Ve.existsSync(i))return i}return""}import Xn from"path";import gS from"fs";function Ed(n,e,r){if(n.startsWith(".")){let t=Xn.dirname(e),o=Xn.resolve(t,n),s=Ue(o);return s?{resolved:!0,resolvedPath:s}:{resolved:!1,error:`File not found at relative path: ${o}`,suggestion:"Check if the file exists and has a supported extension (.ts, .tsx, .js, .jsx)"}}let i=ni(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=Ue(o);return s?{resolved:!0,resolvedPath:s}:{resolved:!1,error:`Path alias matched to '${o}' but file does not exist`,suggestion:"Check if the target file exists or if the alias mapping in tsconfig.json is correct"}}}if(!n.startsWith("@")){let o=Xn.resolve(i.baseUrl,n),s=Ue(o);if(s)return{resolved:!0,resolvedPath:s}}let t=i.workspacePackages.get(n);if(t){let o=Xn.join(t.path,"src/index.ts");if(gS.existsSync(o))return{resolved:!0,resolvedPath:o};let s=Xn.join(t.path,t.main),a=Ue(s);return a?{resolved:!0,resolvedPath:a}:{resolved:!1,error:`Workspace package '${n}' found at ${t.path} but entry point not found`,suggestion:`Check main field in ${Xn.join(t.path,"package.json")}`}}}else return{resolved:!1,error:"No tsconfig.json found",suggestion:"Ensure a tsconfig.json exists in the project root or parent directories"};return n.startsWith("@")?{resolved:!1,error:`Path alias '${n}' not found in tsconfig.json paths`,suggestion:'Check tsconfig.json "paths" configuration'}:{resolved:!1,error:"Module not found (treated as external) ",suggestion:"Install dependency or check import path"}}var Us=new Map;function ni(n){let e=Ay(n);if(!e)return null;if(Us.has(e))return Us.get(e)||null;let r=yS(e);if(r.resultType==="failed")return Us.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?qe.dirname(i.configFileAbsolutePath):e);let o=vS(t,i.paths,i.mainFields,i.addMatchAll),s=Cy(e),a=new Map;if(s){let p=qe.join(s,"package.json");if(Qn.existsSync(p))try{let d=JSON.parse(Qn.readFileSync(p,"utf8"));a=jy(s,d)}catch{}}let c=qe.join(e,"package.json");Qn.existsSync(c)&&My(c).forEach((d,m)=>a.set(m,d));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=qe.join(e,"package.json");if(Qn.existsSync(u))try{let p=JSON.parse(Qn.readFileSync(u,"utf8"));if(p.imports){for(let[d,m]of Object.entries(p.imports))if(typeof m=="string"||typeof m=="object"&&m!==null){let f=m;Array.isArray(m)&&(f=m[0]),typeof f=="object"&&(f=f.default||f.node),typeof f=="string"&&l.imports.set(d,f)}}}catch{}return Us.set(e,l),l}function cn(n,e,r){if(!n)return"";if(n.includes(".")&&!n.startsWith(".")&&!n.startsWith("/")&&!n.endsWith(".js")&&!n.endsWith(".ts")&&!n.endsWith(".json")){let t=n.split(".")[0];if(t&&t!==n){let o=cn(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=qe.dirname(e),o=qe.resolve(t,n);return Ue(o)}let i=ni(e);if(i){let t=i.matchPath(n);if(t)return Ue(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=qe.resolve(i.baseUrl,n),a=Ue(s);if(a)return a}for(let[s,a]of i.imports.entries())if(s.includes("*")){let c="^"+s.replace(/[\\^$+.()|[\]{}]/g,"\\$&").replace(/\*/g,"(.*)")+"$",l=new RegExp(c),u=n.match(l);if(u){let p=u[1],d=a.replace("*",p),m=qe.resolve(i.baseUrl,d);return Ue(m)}}else if(s===n){let c=qe.resolve(i.baseUrl,a);return Ue(c)}let o=i.workspacePackages.get(n);if(o){let s=qe.join(o.path,"src/index.ts");if(Qn.existsSync(s))return s;let a=qe.join(o.path,o.main),c=Ue(a);if(c)return c}}return""}import _S from"fs";import bS from"path";import Zy from"js-yaml";function Fy(n){let e=bS.basename(n),r=_S.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return{...kS(r,n),content:r};if(e.endsWith(".graphql")||e.endsWith(".gql"))return{...ES(r,n),content:r};let t="Configuration";return e==="lerna.json"?{...IS(r,n),content:r}:e==="turbo.json"?{...TS(r,n),content:r}:e==="pnpm-workspace.yaml"?{...RS(r,n),content:r}:(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",xS(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",$S(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",SS(r,i)):e==="package.json"&&(t="Project Manifest",wS(r,i)),{configs:i,classification:t,content:r})}function xS(n,e){let r=n.split(`
563
+ `);for(let i of r){let t=i.trim();if(t.startsWith("FROM "))e.push({key:"base_image",value:t.substring(5).trim(),kind:"Image"});else if(t.startsWith("EXPOSE "))e.push({key:"port",value:t.substring(7).trim(),kind:"Port"});else if(t.startsWith("ENV ")){let o=t.substring(4).trim().split(/\s+|=/);if(o[0]){let s=o[0],a=o.slice(1).join("= ").trim()||"undefined",c="Env";(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function $S(n,e){try{let r=Zy.load(n);if(!r||typeof r!="object")return;if(r.services&&typeof r.services=="object")for(let[t,o]of Object.entries(r.services)){if(!o||typeof o!="object")continue;let s=o;if(e.push({key:`service:${t}`,value:t,kind:"Service"}),s.image&&e.push({key:`service:${t}:image`,value:String(s.image),kind:"Image"}),Array.isArray(s.ports)&&s.ports.forEach(a=>{e.push({key:`service:${t}:port`,value:String(a),kind:"Port"})}),s.environment){if(Array.isArray(s.environment))s.environment.forEach(a=>{let[c,...l]=a.split("= ");c&&l.length>0&&e.push({key:`service:${t}:env:${c}`,value:l.join("= "),kind:"Env"})});else if(typeof s.environment=="object")for(let[a,c]of Object.entries(s.environment))e.push({key:`service:${t}:env:${a}`,value:String(c),kind:"Env"})}if(Array.isArray(s.depends_on))s.depends_on.forEach(a=>{e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})});else if(s.depends_on&&typeof s.depends_on=="object")for(let a of Object.keys(s.depends_on))e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})}let i=(t,o="")=>{if(!(!t||typeof t!="object"||Array.isArray(t)))for(let[s,a]of Object.entries(t)){let c=o?`${o}.${s}`:s;if(r.services&&(c.startsWith("services.")||c==="services")){a&&typeof a=="object"&&!Array.isArray(a)&&i(a,c);continue}if(a&&typeof a=="object"&&!Array.isArray(a))i(a,c);else{let l=String(a),u="Env";s.toLowerCase().includes("image")&&(u="Image"),s.toLowerCase().includes("port")&&(u="Port"),s.toLowerCase().includes("service")&&(u="Service"),(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(u="Service"),e.push({key:c,value:l.length>100?l.substring(0,97)+"...":l,kind:u})}}};i(r)}catch{let i=n.match(/^\s{2}([a-z0-9_-]+):/gm);i&&i.forEach(t=>{let o=t.trim().replace(" : ","");o!=="services"&&o!=="version"&&o!=="volumes"&&o!=="networks"&&e.push({key:"service",value:o,kind:"Service"})})}}function SS(n,e){let r=n.split(`
564
+ `);for(let i of r){let t=i.trim();if(t&&!t.startsWith("#")){let o=t.split("=");if(o[0]){let s=o[0].trim(),a=o.slice(1).join("=");a=a.trim().replace(/^['"](.*)['"]$/,"$1");let c="Env";(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function kS(n,e){let r=[],i="Contract (Prisma) ",t=/^model\s+(\w+)/gm,o;for(;(o=t.exec(n))!==null;)r.push({key:"model",value:o[1],kind:"Database Model"});let s=/^enum\s+(\w+)/gm;for(;(o=s.exec(n))!==null;)r.push({key:"enum",value:o[1],kind:"Database Enum"});let a=/provider\s*=\s*"([^"]+)"/,c=n.match(a);return c&&r.push({key:"datasource_provider",value:c[1],kind:"Database Config"}),{classification:i,configs:r,content:n}}function ES(n,e){let r=[],i="Contract (GraphQL) ",t=/^(?:type|input|interface|enum)\s+(\w+)/gm,o;for(;(o=t.exec(n))!==null;){let s=o[0],a="GraphQL Type";s.startsWith("input")&&(a="GraphQL Input"),s.startsWith("interface")&&(a="GraphQL Interface"),s.startsWith("enum")&&(a="GraphQL Enum"),r.push({key:"type_definition",value:o[1],kind:a})}return{classification:i,configs:r,content:n}}function wS(n,e){try{let r=JSON.parse(n);if(r.name&&e.push({key:"name",value:r.name,kind:"Service"}),r.description&&e.push({key:"description",value:r.description,kind:"Service"}),r.workspaces){let o=Array.isArray(r.workspaces)?r.workspaces.join("",""):JSON.stringify(r.workspaces);e.push({key:"workspaces",value:o,kind:"Env"})}if(r.scripts){let o=["start","dev","build","test","docker"];for(let s of Object.keys(r.scripts))o.some(a=>s.includes(a))&&e.push({key:`script:${s}`,value:r.scripts[s],kind:"Env"})}let i={...r.dependencies,...r.devDependencies},t=["react","vue","svelte","angular","next","nuxt","express","fastify","nestjs","remix","vite","webpack","tailwindcss","database"];for(let o of Object.keys(i))if(t.some(s=>o.includes(s))){let s=i[o].replace(/[\^~]/,"");e.push({key:`dep:${o}`,value:s,kind:"Service"})}}catch{}}function IS(n,e){let r=[],i="Monorepo (Lerna) ";try{let t=JSON.parse(n);r.push({key:"monorepo_type",value:"lerna",kind:"Monorepo"}),t.version&&r.push({key:"lerna_version",value:t.version,kind:"Monorepo"}),t.packages&&(Array.isArray(t.packages)?t.packages:[t.packages]).forEach(s=>{r.push({key:"package_glob",value:s,kind:"Monorepo"})}),t.npmClient&&r.push({key:"npm_client",value:t.npmClient,kind:"Monorepo"})}catch{}return{configs:r,classification:i,content:n}}function TS(n,e){let r=[],i="Monorepo (Turborepo) ";try{let t=JSON.parse(n);if(r.push({key:"monorepo_type",value:"turborepo",kind:"Monorepo"}),t.pipeline)for(let o of Object.keys(t.pipeline)){r.push({key:`pipeline:${o}`,value:o,kind:"Monorepo"});let s=t.pipeline[o];s.dependsOn&&r.push({key:`pipeline:${o}:depends_on`,value:s.dependsOn.join("",""),kind:"Dependency"})}if(t.tasks)for(let o of Object.keys(t.tasks))r.push({key:`task:${o}`,value:o,kind:"Monorepo"})}catch{}return{configs:r,classification:i,content:n}}function RS(n,e){let r=[],i="Monorepo (pnpm) ";try{let t=Zy.load(n);r.push({key:"monorepo_type",value:"pnpm",kind:"Monorepo"}),t&&t.packages&&(Array.isArray(t.packages)?t.packages:[t.packages]).forEach(s=>{r.push({key:"package_glob",value:s,kind:"Monorepo"})})}catch{}return{configs:r,classification:i,content:n}}K();import Wy from"fs";import PS from"path";import Hy from"js-yaml";var By={ignore:[],include:[],maxDepth:10},NS=[{name:".liquid-shadow.yaml",parse:n=>Hy.load(n)??{}},{name:".liquid-shadow.yml",parse:n=>Hy.load(n)??{}},{name:".ls.json",parse:n=>JSON.parse(n)},{name:".liquid-shadow.json",parse:n=>JSON.parse(n)},{name:".ls.rc",parse:n=>JSON.parse(n)},{name:".liquid-shadow.rc",parse:n=>JSON.parse(n)}];function Fs(n){for(let{name:e,parse:r}of NS){let i=PS.join(n,e);if(Wy.existsSync(i))try{let t=Wy.readFileSync(i,"utf8"),o=r(t);return x.debug({repoPath:n,configFile:e},"Loaded repository configuration"),{...By,...o}}catch(t){x.error({repoPath:n,file:e,err:t},"Failed to parse configuration file")}}return By}te();tn();K();Wr();import{Worker as zS}from"node:worker_threads";import{cpus as DS}from"node:os";import{fileURLToPath as OS}from"node:url";import{dirname as LS,join as AS}from"node:path";import{existsSync as CS}from"node:fs";var Jy=OS(import.meta.url),jS=LS(Jy),MS=Jy.endsWith(".ts");function US(){if(MS)return null;let n=AS(jS,"worker.js");return CS(n)?n:Dt("dist/logic/parser/worker.js")}var wd=class{workers=[];taskQueue=[];pendingTasks=new Map;taskIdCounter=0;initialized=!1;initPromise;shutdownRequested=!1;numWorkers;initTimeout;constructor(e={}){this.numWorkers=e.numWorkers??Math.max(1,Math.min(4,DS().length-1)),this.initTimeout=e.initTimeout??3e4}async initialize(){if(!this.initialized)return this.initPromise?this.initPromise:(this.initPromise=this._doInitialize(),this.initPromise)}async _doInitialize(){let e;try{x.info({numWorkers:this.numWorkers},"Initializing parser worker pool");let r=new Promise((i,t)=>{e=setTimeout(()=>t(new Error(`Parser pool initialization timed out after ${this.initTimeout}ms`)),this.initTimeout)});if(await Promise.race([this._initializeWorkers(),r]),e&&clearTimeout(e),this.shutdownRequested){this.initialized=!1,this.initPromise=void 0;return}this.initialized=!0,x.info({numWorkers:this.workers.length},"Parser worker pool ready")}catch(r){throw e&&clearTimeout(e),this.initPromise=void 0,this.initialized=!1,await this.shutdown(),r}}async _initializeWorkers(){let e=US();if(!e)throw new Error("Parser worker pool not available in development mode (tsx). Use main-thread fallback.");x.debug({workerPath:e},"Resolved parser worker path");let r=[];for(let i=0;i<this.numWorkers;i++)r.push(this.createWorker(e,i));await Promise.all(r)}async createWorker(e,r){return new Promise((i,t)=>{let o=setTimeout(()=>{t(new Error(`Parser worker ${r} initialization timed out`))},this.initTimeout),s=new zS(e,{execArgv:process.execArgv}),a={worker:s,busy:!1,currentTaskId:null};s.on("message",c=>{if(c.type==="ready"){if(clearTimeout(o),this.shutdownRequested){s.terminate().catch(()=>{}),i();return}this.workers.push(a),x.debug({workerIndex:r},"Parser worker ready"),i()}else c.type==="result"&&c.id?this.handleTaskComplete(a,c.id,c.result):c.type==="error"&&c.id&&this.handleTaskError(a,c.id,new Error(c.error||"Unknown error"))}),s.on("error",c=>{if(clearTimeout(o),x.error({err:c,workerIndex:r},"Parser worker error"),a.currentTaskId&&this.handleTaskError(a,a.currentTaskId,c),!this.initialized){t(c);return}let l=this.workers.indexOf(a);l!==-1&&this.workers.splice(l,1),!this.shutdownRequested&&this.initialized&&this.createWorker(e,r).catch(u=>{x.error({err:u},"Failed to replace crashed parser worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&x.warn({workerIndex:r,code:c},"Parser worker exited unexpectedly")})})}handleTaskComplete(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.resolve(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}handleTaskError(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.reject(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}processQueue(){if(this.taskQueue.length===0)return;let e=this.workers.find(i=>!i.busy);if(!e)return;let r=this.taskQueue.shift();r&&(e.busy=!0,e.currentTaskId=r.id,this.pendingTasks.set(r.id,r),e.worker.postMessage({type:"parse",id:r.id,filePath:r.filePath}))}async parseFile(e){return this.initialized||await this.initialize(),new Promise((r,i)=>{let o={id:`parse_${++this.taskIdCounter}`,filePath:e,resolve:r,reject:i};this.taskQueue.push(o),this.processQueue()})}get workerCount(){return this.workers.length}get busyWorkers(){return this.workers.filter(e=>e.busy).length}get queueSize(){return this.taskQueue.length}get isInitialized(){return this.initialized}async shutdown(){if(this.shutdownRequested=!0,this.initPromise)try{await this.initPromise}catch{}if(!this.initialized&&this.workers.length===0){this.shutdownRequested=!1,this.initPromise=void 0;return}x.info({numWorkers:this.workers.length},"Shutting down parser worker pool");let e=this.workers.map(r=>new Promise(i=>{r.worker.postMessage({type:"shutdown"}),r.worker.once("exit",()=>i()),setTimeout(()=>{r.worker.terminate().then(()=>i())},5e3)}));await Promise.all(e),this.workers=[],this.taskQueue=[],this.pendingTasks.clear(),this.initialized=!1,this.shutdownRequested=!1,this.initPromise=void 0,x.info("Parser worker pool shutdown complete")}},er=null;function Gy(n){return er||(er=new wd(n)),er}async function Vy(){er&&(await er.shutdown(),er=null)}var WS=ZS.cpus().length||4,HS=Qo.DEFAULT_CONCURRENCY;async function re(n,e=HS,r=!1,i=!0,t){let o=A.getInstance(n),s=o.files.database,a=Fs(n),c=a.concurrency??e;if(oy(),!r&&rt(n)){let v=Zh(n),g=He(n);if(v&&!Qh(n,v))return yd(),x.debug({repoPath:n,commit:g},"Index is current, skipping re-index (fast-path)"),s}ni(n);let l=o.files.findAll(),u=new Map(l.map(v=>[v.path,{mtime:v.mtime,hash:v.content_hash}])),p=Date.now();t?.({phase:"scan",current:0,total:0,message:"Scanning repository..."});let d=await bd(n,a.ignore),m=new Map(d.map(v=>[v.path,v.mtime])),f=l.filter(v=>!m.has(v.path)).map(v=>v.path),h=l.length===0,_=[];if(r||h)_.push(...d);else{let v=d.filter(k=>{let w=u.get(k.path);return!w||w.mtime!==k.mtime}),g=Id(c*4),b=v.map(k=>g(async()=>{let w=u.get(k.path);if(!w||!w.hash)return k;try{let R=await FS.promises.readFile(k.path,"utf8");return Fh(R,w.hash)?k:(o.files.updateMtime(k.path,k.mtime),null)}catch{return null}})),S=await Promise.all(b);_.push(...S.filter(k=>k!==null))}if(f.length===0&&_.length===0){yd();let v=He(n);return td(n,v||void 0),s}if(h?x.info({totalFiles:d.length},"Starting initial repository indexing..."):x.info({toDelete:f.length,toProcess:_.length},"Syncing repository updates..."),f.length>0&&o.files.deletePaths(f),_.length>0){ay(),i?(en(!0),Xt().initialize().catch(()=>{})):en(!1);let v=/\.(ts|tsx|php|py|go|js|jsx|mjs|cjs)$/,g=[],b=[];for(let I of _)v.test(Td.basename(I.path))?g.push(I):b.push(I);let S=0,k=_.length,w=!1,R=Gy();try{await R.initialize(),w=!0,x.info({workers:R.workerCount},"Parser worker pool active")}catch(I){x.warn({err:I},"Parser worker pool failed to initialize, falling back to main-thread parsing"),w=!1}let j=(I,C)=>{let U=C.imports?.map(L=>({...L,resolved_path:cn(L.module,I.path,n)})),M=C.content?Wn(C.content):null;return S++,(S%50===0||S===k)&&x.info({completed:S,total:k},"Parsing files..."),t?.({phase:"parse",current:S,total:k,message:`Parsing ${Td.basename(I.path)}`}),{meta:I,...C,imports:U,embedding:null,kind:"code",contentHash:M}},B;if(w)B=g.map(I=>R.parseFile(I.path).then(C=>j(I,C),C=>(S++,x.error({path:I.path,error:C},"Worker parse failed"),{meta:I,exports:[],imports:[],content:"",kind:"error"})));else{let I=h?Math.max(c,Math.min(WS-1,16)):c,C=Id(I);B=g.map(U=>C(async()=>{try{let M=await Qr(U.path);return j(U,M)}catch(M){return S++,x.error({path:U.path,error:M},"Failed to parse file"),{meta:U,exports:[],imports:[],content:"",kind:"error"}}}))}let T=Id(c),O=b.map(I=>T(async()=>{try{let C=Fy(I.path),U=C.content?Wn(C.content):null;return S++,(S%50===0||S===k)&&x.info({completed:S,total:k},"Parsing configs..."),t?.({phase:"parse",current:S,total:k,message:`Parsing config ${Td.basename(I.path)}`}),{meta:I,...C,embedding:null,kind:"config",contentHash:U}}catch(C){return S++,x.error({path:I.path,error:C},"Failed to parse config"),{meta:I,exports:[],imports:[],content:"",kind:"error"}}}));x.info({total:k,codeFiles:g.length,configFiles:b.length,useParserPool:w},"Phase 1: Parsing all files...");let J=Date.now(),V=(await Promise.all([...B,...O])).filter(Boolean),q=Date.now()-J;if(qr("parse",q),x.info({count:V.length,time:`${(q/1e3).toFixed(1)}s`},"Phase 1 complete"),w&&Vy().catch(()=>{}),s.pragma("synchronous = NORMAL"),s.pragma("cache_size = -64000"),i){let I=[];V.forEach((ne,oe)=>{"summary"in ne&&ne.summary&&I.push({fileIdx:oe,text:ne.summary})}),x.info("Phase 2+3: Generating embeddings + persisting in parallel..."),t?.({phase:"embed",current:0,total:V.length,message:"Generating embeddings..."});let C=Date.now(),U=(async()=>{if(I.length>0){x.info({count:I.length}," \u2192 Generating file summary embeddings...");let ne=I.map(G=>G.text),oe=await ps(ne,256);return x.info({count:I.length}," \u2713 File summaries complete"),oe}return[]})();t?.({phase:"persist",current:0,total:V.length,message:"Saving to database..."});let M=Date.now();o.files.batchSaveIndexResults(V,n,Wn,cn);let L=Date.now()-M;qr("persist",L),x.info({time:`${(L/1e3).toFixed(1)}s`},"Structural persist complete");let Z=await U,ee=Date.now()-C;if(qr("embed",ee),x.info({time:`${(ee/1e3).toFixed(1)}s`},"Embeddings complete"),Z.length>0){let ne=s.prepare("UPDATE files SET embedding = ? WHERE path = ?"),oe=s.transaction(W=>{for(let H of W)ne.run(H.embedding?JSON.stringify(H.embedding):null,H.path)}),G=I.map((W,H)=>({path:V[W.fileIdx].meta.path,embedding:Z[H]}));oe(G),x.info({count:G.length},"Embedding column updated")}let ce=await o.intentLogs.backfillEmbeddings(64);ce>0&&x.info({count:ce}," \u2713 Intent log embeddings backfilled")}else{t?.({phase:"persist",current:0,total:V.length,message:"Saving to database..."});let I=Date.now();o.files.batchSaveIndexResults(V,n,Wn,cn),qr("persist",Date.now()-I)}s.pragma("synchronous = FULL"),s.pragma("cache_size = -2000")}if(h||_.length>0){let v=He(n);td(n,v||void 0)}return(_.length>0||f.length>0)&&new Pe(n).detectAndRepairShifts(),sy(Date.now()-p),t?.({phase:"complete",current:_.length,total:_.length,message:"Indexing complete"}),s}K();import qy from"path";import BS from"ignore";import Ky from"fs";te();async function Rd(n,e=Qo.DEFAULT_CONCURRENCY,r="detailed",i,t){x.info({repo:n,level:r,subPath:i},"Ensuring cache is up-to-date..."),await re(n,e);let{files:o,exports:s,imports:a}=A.getInstance(n),c=i?o.findInSubPath(n,i):o.findAll(),l=Fs(n),u=BS(),p=qy.join(n,".gitignore");if(Ky.existsSync(p)&&u.add(Ky.readFileSync(p,"utf8")),l.ignore&&l.ignore.length>0&&u.add(l.ignore),u.add(Xo),c=c.filter(g=>{let b=qy.relative(n,g.path);return!u.ignores(b)}),x.info({count:c.length},"Fetching data from DB..."),r==="lite"){let g=c.map(b=>({path:b.path,mtime:b.mtime}));return ei(g,n,r,t)}if(r==="summaries"){let g=c.map(b=>({path:b.path,mtime:b.mtime,classification:b.classification||void 0,summary:b.summary||void 0}));return ei(g,n,r,t)}let d=c.map(g=>g.path),m=s.findByFiles(d),f=r==="detailed"?a.findByFiles(d):[],h=new Map;for(let g of m){let b=h.get(g.file_path)||[];b.push(g),h.set(g.file_path,b)}let _=new Map;for(let g of f){let b=_.get(g.file_path)||[];b.push(g),_.set(g.file_path,b)}let v=c.map(g=>{let S=(h.get(g.path)||[]).map(w=>({name:w.name,kind:w.kind,signature:w.signature,line:w.start_line}));r==="structure"?S=S.map(w=>({name:w.name,kind:w.kind,line:w.line})):r==="signatures"&&(S=S.map(w=>({name:w.name,kind:w.kind,signature:w.signature,line:w.line})));let k=[];return r==="detailed"&&(k=(_.get(g.path)||[]).map(R=>({module:R.module_specifier,resolved_path:R.resolved_path}))),{path:g.path,mtime:g.mtime,classification:g.classification||void 0,summary:g.summary||void 0,exports:S,imports:k.length>0?k:void 0,chunks:[]}});return x.info({count:v.length},"Building hierarchical project tree..."),ei(v,n,r,t)}tn();te();var ri=class{static extractSnippet(e,r,i=300){if(!e||!r)return"";let t=r.toLowerCase().split(/\s+/).filter(d=>d.length>2&&!["the","and","for","with","from"].includes(d));if(t.length===0)return e.slice(0,i)+"...";let o=e.split(`
545
565
  `),s=new Array(o.length).fill(0);for(let d=0;d<o.length;d++){let m=o[d].toLowerCase(),f=0,h=0;for(let _ of t)m.includes(_)&&(f++,h++);(m.includes("export ")||m.includes("class ")||m.includes("function ")||m.includes("interface "))&&(f+=1),s[d]=h*10+f}let a=0,c=-1,l=5;for(let d=0;d<=o.length-l;d++){let m=0;for(let f=0;f<l;f++)m+=s[d+f];m>c&&(c=m,a=d)}if(c<=0)return e.slice(0,i).trim()+"...";let p=o.slice(a,a+l).join(`
546
566
  `).trim();return a>0&&(p=`...
547
567
  `+p),a+l<o.length&&(p=p+`
548
- ...`),p.length>i?p.slice(0,i)+"...":p}static calculateLexicalScore(e,r){if(!e||!r)return 0;let i=r.toLowerCase().split(/\s+/).filter(s=>s.length>2&&!["the","and","for","with","from"].includes(s));if(i.length===0)return 0;let t=0,o=e.toLowerCase();for(let s of i)if(o.includes(s)){t+=1;let a=new RegExp(`\\b${s}`,"gi"),c=o.match(a);c&&(t+=Math.min(c.length*.2,2)),new RegExp(`(class|function|export|interface|enum|type)\\s+${s}`,"i").test(e)&&(t+=1.5)}return t/i.length}};Q();J();var Ct=$.child({module:"clean-sweep"}),$d=class{files;intentLogs;constructor(e){let{files:r,intentLogs:i}=j.getInstance(e);this.files=r,this.intentLogs=i}pruneOrphans(){Ct.info("Starting orphan pruning...");let e=0,r=0,i=this.intentLogs.findOrphans();Ct.info({orphanCount:i.length},"Found orphaned logs");for(let s of i)s.file_path&&this.files.exists(s.file_path)?(this.intentLogs.markAsLapsed(s.id),r++,Ct.debug({logId:s.id,symbolName:s.symbol_name},"Converted to lapsed intent")):(this.intentLogs.delete(s.id),e++,Ct.debug({logId:s.id},"Deleted orphaned log"));let t=this.intentLogs.findLogsForMissingFiles();for(let s of t)this.intentLogs.delete(s.id),e++;let o=this.intentLogs.findRecentDecisionActivity(1e3).length;return Ct.info({deleted:e,converted:r},"Orphan pruning complete"),{deleted:e,converted:r,retained:o}}},Sd=class{lambda;constructor(e=.01){this.lambda=e}calculateScore(e,r){let t=(Math.floor(Date.now()/1e3)-r)/(3600*24),o=Math.exp(-this.lambda*t);return e*o}scoreResults(e){return e.map(r=>({...r,decayed_score:this.calculateScore(r.score,r.created_at)}))}},kd=class{missions;constructor(e){let{missions:r}=j.getInstance(e);this.missions=r}findColdMissions(){let e=Math.floor(Date.now()/1e3)-604800,r=this.missions.findColdMissions(e,10);return Ct.info({count:r.length},"Found cold missions for compaction"),r}markDistilled(e){this.missions.update(e,{status:"distilled"})}},qn=class{pruner;scorer;compactor;constructor(e){this.pruner=new $d(e),this.scorer=new Sd,this.compactor=new kd(e)}runMaintenance(){Ct.info("Initiating Clean Sweep maintenance protocol...");let e=this.pruner.pruneOrphans(),r=this.compactor.findColdMissions();return Ct.info("Clean Sweep maintenance complete"),{pruning:e,compaction:{eligible:r.length}}}getScorer(){return this.scorer}getCompactor(){return this.compactor}};var hS={Solid:1,Liquid:.8,Virtual:.4,Intel:.2,Phantom:.05},Ge=class{static classify(e,r){let i=e.toLowerCase();if(r?.content){let t=r.content;if(t.includes("describe(")||t.includes("test(")||t.includes("it(")||t.includes("expect(")||t.includes('from "@jest/globals"')||t.includes('from "vitest"'))return"Virtual"}return r?.exports&&(r.exports.some(o=>o.kind==="ClassDeclaration"||o.kind==="Class")||r.exports.length>5),i.includes("/dist/")||i.includes("/build/")||i.includes("/.generated/")||i.includes("/node_modules/")||i.endsWith(".map")||i.endsWith(".log")?"Phantom":i.includes("/test/")||i.includes("/tests/")||i.includes("/__tests__/")||i.includes("/__mocks__/")||i.includes(".spec.")||i.includes(".test.")||i.includes("/e2e/")||i.includes("/test-utils/")?"Virtual":i.includes("/examples/")||i.includes("/fixtures/")||i.includes("/mocks/")||i.includes("/stories/")||i.includes("/samples/")||i.includes("/docs/")?"Intel":i.includes("/src/")||i.includes("/lib/")||i.includes("/app/")||i.includes("/core/")||i.includes("/logic/")||i.includes("/domain/")||i.includes("/services/")||i.includes("/controllers/")||i.includes("/handlers/")||i.includes("/repositories/")||i.includes("/models/")||i.includes("/packages/")&&!i.includes("/packages/config/")||i.includes("/backends/")||r?.exports&&(r.exports.some(t=>t.kind==="ClassDeclaration"||t.kind==="Class")||r.exports.length>5)?"Solid":"Liquid"}static mapClassificationToTier(e){let r=e.toLowerCase();return r==="service"||r==="repository"||r==="model"||r==="controller"||r==="handler"||r==="component"||r==="hook"||r==="titanium"||r==="solid"?"Solid":r==="test"||r==="iron"||r==="virtual"?"Virtual":r==="lead"||r==="intel"?"Intel":r==="ghost"||r==="error"||r==="phantom"?"Phantom":"Liquid"}static getMultiplier(e,r){let i=r?this.mapClassificationToTier(r):this.classify(e);return hS[i]}};J();function gS(n,e){let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=n.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let t=1;t<=n.length;t++)e.charAt(i-1)===n.charAt(t-1)?r[i][t]=r[i-1][t-1]:r[i][t]=Math.min(r[i-1][t-1]+1,r[i][t-1]+1,r[i-1][t]+1);return r[e.length][n.length]}function yS(n,e){let r=gS(n.toLowerCase(),e.toLowerCase()),i=Math.max(n.length,e.length);return Math.round((i-r)/i*100)}function Dy(n){let e=[],r="";for(let i=0;i<n.length;i++){let t=n[i],o=t>="A"&&t<="Z",s=t>="a"&&t<="z";o&&r.length>0?(e.push(r),r=t):s||o?r+=t:r.length>0&&(e.push(r),r="")}return r.length>0&&e.push(r),e}function vS(n,e){let r=Dy(e),i=n.toLowerCase();if(r.map(s=>s[0].toLowerCase()).join("")===i)return!0;let o=0;for(let s of r){if(o>=n.length)break;let a=s.toLowerCase();if(a.startsWith(i.slice(o))){o=n.length;break}a[0]===i[o]&&o++}return o===n.length}function _S(n,e){return Dy(e).map(t=>t[0].toLowerCase()).join("")===n.toLowerCase()}function bS(n,e){let r=n.toLowerCase(),i=e.toLowerCase();if(n===e)return{matchType:"exact",score:100};if(r===i)return{matchType:"exact-case-insensitive",score:98};if(i.startsWith(r))return{matchType:"prefix",score:90+n.length/e.length*8};if(i.endsWith(r))return{matchType:"suffix",score:80+n.length/e.length*8};if(i.includes(r)){let o=n.length/e.length,s=i.indexOf(r)/e.length;return{matchType:"substring",score:70+o*10-s*5}}return _S(n,e)?{matchType:"acronym",score:75}:vS(n,e)?{matchType:"camel-case",score:65}:{matchType:"levenshtein",score:yS(n,e)*.6}}function Kr(n,e,r=50,i=5){let t=[];for(let o of e){let{matchType:s,score:a}=bS(n,o);if(a>=r){let l={exact:1e3,"exact-case-insensitive":900,prefix:800,suffix:700,substring:600,acronym:550,"camel-case":500,levenshtein:100}[s]+a;t.push({match:o,score:a,matchType:s,rank:l})}}return t.sort((o,s)=>s.rank!==o.rank?s.rank-o.rank:s.score!==o.score?s.score-o.score:o.match.length-s.match.length),t.slice(0,i)}Be();var st=class n{constructor(e){this.repoPath=e}get filesRepo(){return j.getInstance(this.repoPath).files}get exportsRepo(){return j.getInstance(this.repoPath).exports}static normalizeFileType(e){if(e==null)return;let r=Array.isArray(e)?e:e.split(",").map(i=>i.trim().replace(/^\./,""));return r.filter(Boolean).length?r:void 0}static matchesFilters(e,r,i,t){if(r.fileType?.length){let o=e.replace(/^.*\./,"").toLowerCase();if(!r.fileType.some(s=>s.toLowerCase()===o))return!1}if(r.layer!=null||r.excludeLayers&&r.excludeLayers.length>0){let o=t!=null?Ge.mapClassificationToTier(t):Ge.classify(e);if(r.layer!=null&&o!==r.layer||r.excludeLayers?.includes(o))return!1}return!0}async searchByPath(e,r,i,t,o,s=!1){let a=e.toLowerCase().split(/\s+/).filter(Boolean),c=this.filesRepo.findByPathKeywords(a,Math.min((r??50)*(o?Re.FILTERED_QUERY_LIMIT_MULTIPLIER:1),ve.MAX_LIMIT));o&&(c=c.filter(p=>n.matchesFilters(p.path,t,p.mtime,p.classification)),c=c.slice(0,r??50));let l=p=>p.replace(this.repoPath,"").replace(/^\//,"");if(c.length===0)return{content:[{type:"text",text:`No indexed files match path/filename: "${e}".
568
+ ...`),p.length>i?p.slice(0,i)+"...":p}static calculateLexicalScore(e,r){if(!e||!r)return 0;let i=r.toLowerCase().split(/\s+/).filter(s=>s.length>2&&!["the","and","for","with","from"].includes(s));if(i.length===0)return 0;let t=0,o=e.toLowerCase();for(let s of i)if(o.includes(s)){t+=1;let a=new RegExp(`\\b${s}`,"gi"),c=o.match(a);c&&(t+=Math.min(c.length*.2,2)),new RegExp(`(class|function|export|interface|enum|type)\\s+${s}`,"i").test(e)&&(t+=1.5)}return t/i.length}};tn();te();K();var Mt=x.child({module:"clean-sweep"}),Pd=class{files;intentLogs;constructor(e){let{files:r,intentLogs:i}=A.getInstance(e);this.files=r,this.intentLogs=i}pruneOrphans(){Mt.info("Starting orphan pruning...");let e=0,r=0,i=this.intentLogs.findOrphans();Mt.info({orphanCount:i.length},"Found orphaned logs");for(let s of i)s.file_path&&this.files.exists(s.file_path)?(this.intentLogs.markAsLapsed(s.id),r++,Mt.debug({logId:s.id,symbolName:s.symbol_name},"Converted to lapsed intent")):(this.intentLogs.delete(s.id),e++,Mt.debug({logId:s.id},"Deleted orphaned log"));let t=this.intentLogs.findLogsForMissingFiles();for(let s of t)this.intentLogs.delete(s.id),e++;let o=this.intentLogs.findRecentDecisionActivity(1e3).length;return Mt.info({deleted:e,converted:r},"Orphan pruning complete"),{deleted:e,converted:r,retained:o}}},Nd=class{lambda;constructor(e=.01){this.lambda=e}calculateScore(e,r){let t=(Math.floor(Date.now()/1e3)-r)/(3600*24),o=Math.exp(-this.lambda*t);return e*o}scoreResults(e){return e.map(r=>({...r,decayed_score:this.calculateScore(r.score,r.created_at)}))}},zd=class{missions;constructor(e){let{missions:r}=A.getInstance(e);this.missions=r}findColdMissions(){let e=Math.floor(Date.now()/1e3)-604800,r=this.missions.findColdMissions(e,10);return Mt.info({count:r.length},"Found cold missions for compaction"),r}markDistilled(e){this.missions.update(e,{status:"distilled"})}},tr=class{pruner;scorer;compactor;constructor(e){this.pruner=new Pd(e),this.scorer=new Nd,this.compactor=new zd(e)}runMaintenance(){Mt.info("Initiating Clean Sweep maintenance protocol...");let e=this.pruner.pruneOrphans(),r=this.compactor.findColdMissions();return Mt.info("Clean Sweep maintenance complete"),{pruning:e,compaction:{eligible:r.length}}}getScorer(){return this.scorer}getCompactor(){return this.compactor}};te();K();var Yy=x.child({module:"lineage-service"}),ii=class{repoPath;constructor(e){this.repoPath=e}getAncestorMissionIds(e=50){try{let r=Yh(this.repoPath,e);if(r.length===0)return[];let{missions:i}=A.getInstance(this.repoPath),o=i.findByCommitShas(r).map(s=>s.id);return o.length>0&&Yy.debug({count:o.length},"Identified ancestor missions for gravity bleed"),o}catch(r){return Yy.warn({err:r.message},"Failed to identify ancestor missions"),[]}}};var JS={Solid:1,Liquid:.8,Virtual:.4,Intel:.2,Phantom:.05},Ke=class{static classify(e,r){let i=e.toLowerCase();if(r?.content){let t=r.content;if(t.includes("describe(")||t.includes("test(")||t.includes("it(")||t.includes("expect(")||t.includes('from "@jest/globals"')||t.includes('from "vitest"'))return"Virtual"}return r?.exports&&(r.exports.some(o=>o.kind==="ClassDeclaration"||o.kind==="Class")||r.exports.length>5),i.includes("/dist/")||i.includes("/build/")||i.includes("/.generated/")||i.includes("/node_modules/")||i.endsWith(".map")||i.endsWith(".log")?"Phantom":i.includes("/test/")||i.includes("/tests/")||i.includes("/__tests__/")||i.includes("/__mocks__/")||i.includes(".spec.")||i.includes(".test.")||i.includes("/e2e/")||i.includes("/test-utils/")?"Virtual":i.includes("/examples/")||i.includes("/fixtures/")||i.includes("/mocks/")||i.includes("/stories/")||i.includes("/samples/")||i.includes("/docs/")?"Intel":i.includes("/src/")||i.includes("/lib/")||i.includes("/app/")||i.includes("/core/")||i.includes("/logic/")||i.includes("/domain/")||i.includes("/services/")||i.includes("/controllers/")||i.includes("/handlers/")||i.includes("/repositories/")||i.includes("/models/")||i.includes("/packages/")&&!i.includes("/packages/config/")||i.includes("/backends/")||r?.exports&&(r.exports.some(t=>t.kind==="ClassDeclaration"||t.kind==="Class")||r.exports.length>5)?"Solid":"Liquid"}static mapClassificationToTier(e){let r=e.toLowerCase();return r==="service"||r==="repository"||r==="model"||r==="controller"||r==="handler"||r==="component"||r==="hook"||r==="titanium"||r==="solid"?"Solid":r==="test"||r==="iron"||r==="virtual"?"Virtual":r==="lead"||r==="intel"?"Intel":r==="ghost"||r==="error"||r==="phantom"?"Phantom":"Liquid"}static getMultiplier(e,r){let i=r?this.mapClassificationToTier(r):this.classify(e);return JS[i]}};K();function GS(n,e){let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=n.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let t=1;t<=n.length;t++)e.charAt(i-1)===n.charAt(t-1)?r[i][t]=r[i-1][t-1]:r[i][t]=Math.min(r[i-1][t-1]+1,r[i][t-1]+1,r[i-1][t]+1);return r[e.length][n.length]}function VS(n,e){let r=GS(n.toLowerCase(),e.toLowerCase()),i=Math.max(n.length,e.length);return Math.round((i-r)/i*100)}function Xy(n){let e=[],r="";for(let i=0;i<n.length;i++){let t=n[i],o=t>="A"&&t<="Z",s=t>="a"&&t<="z";o&&r.length>0?(e.push(r),r=t):s||o?r+=t:r.length>0&&(e.push(r),r="")}return r.length>0&&e.push(r),e}function qS(n,e){let r=Xy(e),i=n.toLowerCase();if(r.map(s=>s[0].toLowerCase()).join("")===i)return!0;let o=0;for(let s of r){if(o>=n.length)break;let a=s.toLowerCase();if(a.startsWith(i.slice(o))){o=n.length;break}a[0]===i[o]&&o++}return o===n.length}function KS(n,e){return Xy(e).map(t=>t[0].toLowerCase()).join("")===n.toLowerCase()}function YS(n,e){let r=n.toLowerCase(),i=e.toLowerCase();if(n===e)return{matchType:"exact",score:100};if(r===i)return{matchType:"exact-case-insensitive",score:98};if(i.startsWith(r))return{matchType:"prefix",score:90+n.length/e.length*8};if(i.endsWith(r))return{matchType:"suffix",score:80+n.length/e.length*8};if(i.includes(r)){let o=n.length/e.length,s=i.indexOf(r)/e.length;return{matchType:"substring",score:70+o*10-s*5}}return KS(n,e)?{matchType:"acronym",score:75}:qS(n,e)?{matchType:"camel-case",score:65}:{matchType:"levenshtein",score:VS(n,e)*.6}}function oi(n,e,r=50,i=5){let t=[];for(let o of e){let{matchType:s,score:a}=YS(n,o);if(a>=r){let l={exact:1e3,"exact-case-insensitive":900,prefix:800,suffix:700,substring:600,acronym:550,"camel-case":500,levenshtein:100}[s]+a;t.push({match:o,score:a,matchType:s,rank:l})}}return t.sort((o,s)=>s.rank!==o.rank?s.rank-o.rank:s.score!==o.score?s.score-o.score:o.match.length-s.match.length),t.slice(0,i)}Ge();var lt=class n{constructor(e){this.repoPath=e}get filesRepo(){return A.getInstance(this.repoPath).files}get exportsRepo(){return A.getInstance(this.repoPath).exports}get intentLogsRepo(){return A.getInstance(this.repoPath).intentLogs}static normalizeFileType(e){if(e==null)return;let r=Array.isArray(e)?e:e.split(",").map(i=>i.trim().replace(/^\./,""));return r.filter(Boolean).length?r:void 0}static matchesFilters(e,r,i,t){if(r.fileType?.length){let o=e.replace(/^.*\./,"").toLowerCase();if(!r.fileType.some(s=>s.toLowerCase()===o))return!1}if(r.layer!=null||r.excludeLayers&&r.excludeLayers.length>0){let o=t!=null?Ke.mapClassificationToTier(t):Ke.classify(e);if(r.layer!=null&&o!==r.layer||r.excludeLayers?.includes(o))return!1}return!0}async searchByPath(e,r,i,t,o,s=!1){let a=e.toLowerCase().split(/\s+/).filter(Boolean),c=this.filesRepo.findByPathKeywords(a,Math.min((r??50)*(o?Re.FILTERED_QUERY_LIMIT_MULTIPLIER:1),ve.MAX_LIMIT));o&&(c=c.filter(p=>n.matchesFilters(p.path,t,p.mtime,p.classification)),c=c.slice(0,r??50));let l=p=>p.replace(this.repoPath,"").replace(/^\//,"");if(c.length===0)return{content:[{type:"text",text:`No indexed files match path/filename: "${e}".
549
569
 
550
- If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};if(s){let d=new le(this.repoPath).getSection("gravity"),m=new Map;if(d?.hotspots)for(let _ of d.hotspots){let v=m.get(_.filePath)||0;m.set(_.filePath,v+_.gravity)}let f=c.map(_=>{let v=m.get(_.path)||0,g=_.classification?Ge.mapClassificationToTier(_.classification):Ge.classify(_.path);return{..._,gravity:v,layer:g}});return f.sort((_,v)=>v.gravity-_.gravity),{content:[{type:"text",text:`# Resolved paths: "${e}" (Ranked by Gravity)
570
+ If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};if(s){let d=new de(this.repoPath).getSection("gravity"),m=new Map;if(d?.hotspots)for(let _ of d.hotspots){let v=m.get(_.filePath)||0;m.set(_.filePath,v+_.gravity)}let f=c.map(_=>{let v=m.get(_.path)||0,g=_.classification?Ke.mapClassificationToTier(_.classification):Ke.classify(_.path);return{..._,gravity:v,layer:g}});return f.sort((_,v)=>v.gravity-_.gravity),{content:[{type:"text",text:`# Resolved paths: "${e}" (Ranked by Gravity)
551
571
 
552
572
  ${f.length} file(s):
553
573
 
554
- `+f.map((_,v)=>{let g=_.gravity>50?" \u269B\uFE0F":_.gravity>0?" \u2022":"",x=_.gravity>0?` [G:${Math.round(_.gravity)}]`:"";return`${v+1}. \`${l(_.path)}\` (${_.layer})${g}${x}`}).join(`
574
+ `+f.map((_,v)=>{let g=_.gravity>50?" \u269B\uFE0F":_.gravity>0?" \u2022":"",b=_.gravity>0?` [G:${Math.round(_.gravity)}]`:"";return`${v+1}. \`${l(_.path)}\` (${_.layer})${g}${b}`}).join(`
555
575
  `)+`
556
576
 
557
577
  > **Legend**: \u269B\uFE0F = High-gravity hotspot (>50), \u2022 = Has gravity, G = Gravity score`}]}}return{content:[{type:"text",text:`# Resolved paths: "${e}"
@@ -559,31 +579,39 @@ ${f.length} file(s):
559
579
  ${c.length} file(s):
560
580
 
561
581
  `+c.map((p,d)=>`${d+1}. \`${l(p.path)}\`${p.classification?` (${p.classification})`:""}`).join(`
562
- `)}]}}async searchByConcept(e,r,i,t,o,s=!1){$.info({repoPath:this.repoPath,query:e},"Searching by concept (Semantic Analysis)...");let a=await yd(e),c=g=>g.replace(this.repoPath,"").replace(/^\//,"");if(a){let g=await this.findConceptMatches(e,a,t,o,r*2,0);if(g.length>0){let x=g.length,I=g.slice(i,i+r),w=i+r<x?`
563
- > **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",T=s?`
564
- > _Compact mode: snippets omitted_`:x>20&&!s?"\n> \u{1F4A1} **Tip**: Use `compact: true` to reduce output size (omits snippets).":"",O=`# Semantic Concept Search: "${e}"
582
+ `)}]}}async searchByConcept(e,r,i,t,o,s=!1){x.info({repoPath:this.repoPath,query:e},"Searching by concept (Semantic Analysis)...");let a=await us(e),c=g=>g.replace(this.repoPath,"").replace(/^\//,"");if(a){let g=await this.findConceptMatches(e,a,t,o,r*2,0),b=this.findIntentLogMatches(a,5);if(g.length>0||b.length>0){let S=g.length,k=g.slice(i,i+r),R=i+r<S?`
583
+ > **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",j=s?`
584
+ > _Compact mode: snippets omitted_`:S>20&&!s?"\n> \u{1F4A1} **Tip**: Use `compact: true` to reduce output size (omits snippets).":"",B=`# Semantic Concept Search: "${e}"
565
585
 
566
- Showing ${I.length} of ${x} relevant file(s) (offset: ${i}, limit: ${r})${w}${T}
586
+ Showing ${k.length} of ${S} relevant file(s) (offset: ${i}, limit: ${r})${R}${j}
567
587
 
568
- `,k=new le(this.repoPath).getSection("gravity"),D=new Map;if(k?.hotspots)for(let L of k.hotspots)D.set(L.filePath,L.gravity);return{content:[{type:"text",text:s?O+I.map((L,Y)=>{let U=c(L.path),C=Math.round((L.decayedScore||0)*100),Z=D.get(L.path)?" \u269B\uFE0F":"";return`${i+Y+1}. \`${U}\`${Z} (${C}%) - ${L.summary||"No summary"}`}).join(`
569
- `):O+I.map((L,Y)=>{let U=c(L.path),C=Math.round((L.decayedScore||0)*100),A=D.get(L.path),Z=A?" \u269B\uFE0F **CORE**":"",W=A&&A>50?`
570
- > \u26A0\uFE0F **STRATEGIC RISK**: High-gravity hotspot (${A.toFixed(0)}). Modifications may have significant architectural impact.`:"";return`## ${i+Y+1}. ${U}${Z} (${C}% Match)
571
- > **Rationale**: ${L.rationale}${W}
588
+ `,O=new de(this.repoPath).getSection("gravity"),J=new Map;if(O?.hotspots)for(let q of O.hotspots)J.set(q.filePath,q.gravity);let V=s?B+k.map((q,I)=>{let C=c(q.path),U=Math.round((q.decayedScore||0)*100),L=J.get(q.path)?" \u269B\uFE0F":"";return`${i+I+1}. \`${C}\`${L} (${U}%) - ${q.summary||"No summary"}`}).join(`
589
+ `):B+k.map((q,I)=>{let C=c(q.path),U=Math.round((q.decayedScore||0)*100),M=J.get(q.path),L=M?" \u269B\uFE0F **CORE**":"",Z=M&&M>50?`
590
+ > \u26A0\uFE0F **STRATEGIC RISK**: High-gravity hotspot (${M.toFixed(0)}). Modifications may have significant architectural impact.`:"";return`## ${i+I+1}. ${C}${L} (${U}% Match)
591
+ > **Rationale**: ${q.rationale}${Z}
572
592
 
573
- `+(L.snippet?`**Matched Snippet**:
593
+ `+(q.snippet?`**Matched Snippet**:
574
594
  \`\`\`typescript
575
- ${L.snippet}
595
+ ${q.snippet}
576
596
  \`\`\`
577
597
 
578
- `:"")+`**Summary**: ${L.summary||"No summary available"}
598
+ `:"")+`**Summary**: ${q.summary||"No summary available"}
579
599
  `}).join(`
580
- `)}]}}}let l=e.replace(/[^\w\s]/g," ").trim(),u=this.filesRepo.findFts(l,(r+i)*(o?Re.FILTERED_QUERY_LIMIT_MULTIPLIER:1));o&&(u=u.filter(g=>n.matchesFilters(g.path,t,g.mtime,g.classification)));let p=u.slice(i,i+r);if(p.length===0&&i===0){let g=this.filesRepo.getStats(),x=e.toLowerCase().split(/\s+/),I=this.filesRepo.findByPathKeywords(x,r);return o&&(I=I.filter(E=>n.matchesFilters(E.path,t,E.mtime,E.classification))),I.length>0?{content:[{type:"text",text:`# Concept Search: "${e}"
600
+ `);return b.length>0&&(V+=`
601
+
602
+ ---
603
+ ## Intent Vectors (${b.length} matching decision(s))
604
+
605
+ `,V+=b.map((q,I)=>{let C=Math.round((q.score||0)*100),U=q.symbolName?` \`${q.symbolName}\``:"",M=q.missionId?` [Mission #${q.missionId}]`:"",L=q.content.length>200?q.content.slice(0,200)+"...":q.content;return s?`${I+1}. **[${q.type}]**${U}${M} (${C}%) - ${L}`:`### ${I+1}. [${q.type}]${U}${M} (${C}% Match)
606
+ > ${L}
607
+ `}).join(`
608
+ `)),{content:[{type:"text",text:V}]}}}let l=e.replace(/[^\w\s]/g," ").trim(),u=this.filesRepo.findFts(l,(r+i)*(o?Re.FILTERED_QUERY_LIMIT_MULTIPLIER:1));o&&(u=u.filter(g=>n.matchesFilters(g.path,t,g.mtime,g.classification)));let p=u.slice(i,i+r);if(p.length===0&&i===0){let g=this.filesRepo.getStats(),b=e.toLowerCase().split(/\s+/),S=this.filesRepo.findByPathKeywords(b,r);return o&&(S=S.filter(k=>n.matchesFilters(k.path,t,k.mtime,k.classification))),S.length>0?{content:[{type:"text",text:`# Concept Search: "${e}"
581
609
 
582
610
  \u26A0\uFE0F No semantic matches in file summaries (${g.withSummary}/${g.total} indexed).
583
611
 
584
- Found ${I.length} file(s) with matching paths:
612
+ Found ${S.length} file(s) with matching paths:
585
613
 
586
- `+I.map((w,T)=>`${T+1}. \`${c(w.path)}\` (${w.classification||"Unknown"})`).join(`
614
+ `+S.map((w,R)=>`${R+1}. \`${c(w.path)}\` (${w.classification||"Unknown"})`).join(`
587
615
  `)}]}:{content:[{type:"text",text:`No files found matching concept: "${e}"
588
616
 
589
617
  Summary Stats: ${g.withSummary}/${g.total} summaries.
@@ -594,41 +622,41 @@ Try a symbol search: shadow_search_symbol({ query: "${e}", repoPath })`}]}}let d
594
622
 
595
623
  Showing ${p.length} of ${d} relevant file(s)${f}${h}
596
624
 
597
- `;return{content:[{type:"text",text:s?_+p.map((g,x)=>`${i+x+1}. \`${c(g.path)}\``).join(`
598
- `):_+p.map((g,x)=>`## ${i+x+1}. ${c(g.path)}
625
+ `;return{content:[{type:"text",text:s?_+p.map((g,b)=>`${i+b+1}. \`${c(g.path)}\``).join(`
626
+ `):_+p.map((g,b)=>`## ${i+b+1}. ${c(g.path)}
599
627
 
600
628
  **Summary**: ${g.summary||"No summary available"}
601
629
  `).join(`
602
- `)}]}}async searchBySymbol(e,r,i,t,o,s="any"){let a=e.toLowerCase(),c=k=>k.replace(this.repoPath,"").replace(/^\//,""),l=this.buildFtsQuery(e,s),u;try{u=this.exportsRepo.findFts(l,r+50)}catch{u=this.exportsRepo.findByPartialName(e,r+50)}if(u.length===0){let k=this.exportsRepo.getAllNames(5e3),D=e.trim().split(/\s+/).filter(L=>L.length>0);if(D.length>1){let L=new Map;for(let U of D){let C=Kr(U,k,40,20);for(let A of C){let Z=L.get(A.match);Z?(Z.terms.push(U),Z.bestScore=Math.max(Z.bestScore,A.score)):L.set(A.match,{terms:[U],bestScore:A.score})}}let Y=Array.from(L.entries()).sort((U,C)=>C[1].terms.length!==U[1].terms.length?C[1].terms.length-U[1].terms.length:C[1].bestScore-U[1].bestScore).slice(0,10);if(Y.length>0){let U=Y.map(([C,A])=>{let Z=A.terms.join(", ");return` \u2022 \`${C}\` (matches: ${Z}, ${Math.round(A.bestScore)}%)`}).join(`
630
+ `)}]}}async searchBySymbol(e,r,i,t,o,s="any"){let a=e.toLowerCase(),c=T=>T.replace(this.repoPath,"").replace(/^\//,""),l=this.buildFtsQuery(e,s),u;try{u=this.exportsRepo.findFts(l,r+50)}catch{u=this.exportsRepo.findByPartialName(e,r+50)}if(u.length===0){let T=this.exportsRepo.getAllNames(5e3),O=e.trim().split(/\s+/).filter(V=>V.length>0);if(O.length>1){let V=new Map;for(let I of O){let C=oi(I,T,40,20);for(let U of C){let M=V.get(U.match);M?(M.terms.push(I),M.bestScore=Math.max(M.bestScore,U.score)):V.set(U.match,{terms:[I],bestScore:U.score})}}let q=Array.from(V.entries()).sort((I,C)=>C[1].terms.length!==I[1].terms.length?C[1].terms.length-I[1].terms.length:C[1].bestScore-I[1].bestScore).slice(0,10);if(q.length>0){let I=q.map(([C,U])=>{let M=U.terms.join(", ");return` \u2022 \`${C}\` (matches: ${M}, ${Math.round(U.bestScore)}%)`}).join(`
603
631
  `);return{content:[{type:"text",text:`No symbols found matching all terms: "${e}"
604
632
 
605
633
  **Partial matches:**
606
- ${U}
634
+ ${I}
607
635
 
608
- \u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let L=Kr(e,k,50,5);if(L.length>0){let Y=L.map(U=>` \u2022 \`${U.match}\` (${Math.round(U.score)}% ${U.matchType} match)`).join(`
636
+ \u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let V=oi(e,T,50,5);if(V.length>0){let q=V.map(I=>` \u2022 \`${I.match}\` (${Math.round(I.score)}% ${I.matchType} match)`).join(`
609
637
  `);return{content:[{type:"text",text:`No symbols found matching: "${e}"
610
638
 
611
639
  **Did you mean?**
612
- ${Y}
640
+ ${q}
613
641
 
614
642
  \u{1F4A1} Try shadow_search_symbol with fuzzy, or shadow_search_concept for semantic search.`}]}}}return{content:[{type:"text",text:`No symbols found matching: "${e}"
615
643
 
616
- \u{1F4A1} Try shadow_search_symbol (fuzzy) or shadow_search_concept for semantic search.`}]}}o&&(u=u.filter(k=>{let D=this.filesRepo.findByPath(k.file_path);return n.matchesFilters(k.file_path,t,D?.mtime,D?.classification)}));let p=new Yt(this.repoPath),d=new le(this.repoPath),m=p.getAncestorMissionIds(),f=_e(this.repoPath)||void 0,h=this.exportsRepo.getGravityMap(m,f),_=d.getSection("gravity"),v=new Map;if(_?.hotspots)for(let k of _.hotspots)v.set(`${k.filePath}::${k.symbol}`,k.gravity);let g="\u{1F525}",x="\u26A1",I="\u269B\uFE0F",E=u.map((k,D)=>{let H=h[k.id],L=v.get(`${k.file_path}::${k.name}`),Y=this.filesRepo.findByPath(k.file_path),U=Ge.getMultiplier(k.file_path,Y?.classification),C=(Re.SCORE_BASE-D)*U;H&&(C+=H.score*Re.SCORE_BASE),L&&(C+=L*Re.SCORE_BASE*Re.GRAVITY_STRUCTURAL_WEIGHT),k.name.toLowerCase()===a&&(C+=Re.EXACT_MATCH_BONUS*U);let A=Y?.mtime;if(A!=null){let W=A>1e10?A/1e3:A,F=(Date.now()/1e3-W)/Up.SECONDS_PER_DAY;F<Re.RECENT_FILE_THRESHOLD_DAYS?C+=Re.RECENT_FILE_BOOST:F<Re.OLDER_FILE_THRESHOLD_DAYS&&(C+=Re.OLDER_FILE_BOOST)}let Z=[];return H&&Z.push(...H.reasons),L&&Z.push(`Structural Hotspot (Gravity: ${L.toFixed(1)})`),{...k,activeGravity:H,structuralGravity:L,sortScore:C,reasons:Z}}).sort((k,D)=>D.sortScore-k.sortScore).slice(i,i+r),w=u.length,T=i+r<w,O=E.map((k,D)=>{let H=c(k.file_path),L=this.filesRepo.getContent(k.file_path),Y="";if(L){let A=L.split(`
617
- `);Y=A.slice(Math.max(0,k.start_line-2),Math.min(A.length,k.start_line+3)).join(`
618
- `).trim()}let U=[];k.activeGravity&&(k.activeGravity.reasons.some(A=>A.includes("Working Set"))?U.push(g):k.activeGravity.reasons.some(A=>A.includes("Recent Intent"))&&U.push(x)),k.structuralGravity&&U.push(I);let C=U.length>0?` ${U.join("")}`:"";return{relPath:H,name:k.name,kind:k.kind,signature:k.signature,line:k.start_line,snippet:Y,badgeStr:C,gravityReasons:k.reasons}});return{content:[{type:"text",text:`# Symbol Search Results: "${e}"
644
+ \u{1F4A1} Try shadow_search_symbol (fuzzy) or shadow_search_concept for semantic search.`}]}}o&&(u=u.filter(T=>{let O=this.filesRepo.findByPath(T.file_path);return n.matchesFilters(T.file_path,t,O?.mtime,O?.classification)}));let p=new ii(this.repoPath),d=new de(this.repoPath),m=p.getAncestorMissionIds(),f=_e(this.repoPath)||void 0,h=this.exportsRepo.getGravityMap(m,f),_=d.getSection("gravity"),v=new Map;if(_?.hotspots)for(let T of _.hotspots)v.set(`${T.filePath}::${T.symbol}`,T.gravity);let g="\u{1F525}",b="\u26A1",S="\u269B\uFE0F",k=u.map((T,O)=>{let J=h[T.id],V=v.get(`${T.file_path}::${T.name}`),q=this.filesRepo.findByPath(T.file_path),I=Ke.getMultiplier(T.file_path,q?.classification),C=(Re.SCORE_BASE-O)*I;J&&(C+=J.score*Re.SCORE_BASE),V&&(C+=V*Re.SCORE_BASE*Re.GRAVITY_STRUCTURAL_WEIGHT),T.name.toLowerCase()===a&&(C+=Re.EXACT_MATCH_BONUS*I);let U=q?.mtime;if(U!=null){let L=U>1e10?U/1e3:U,Z=(Date.now()/1e3-L)/Yp.SECONDS_PER_DAY;Z<Re.RECENT_FILE_THRESHOLD_DAYS?C+=Re.RECENT_FILE_BOOST:Z<Re.OLDER_FILE_THRESHOLD_DAYS&&(C+=Re.OLDER_FILE_BOOST)}let M=[];return J&&M.push(...J.reasons),V&&M.push(`Structural Hotspot (Gravity: ${V.toFixed(1)})`),{...T,activeGravity:J,structuralGravity:V,sortScore:C,reasons:M}}).sort((T,O)=>O.sortScore-T.sortScore).slice(i,i+r),w=u.length,R=i+r<w,j=k.map((T,O)=>{let J=c(T.file_path),V=this.filesRepo.getContent(T.file_path),q="";if(V){let U=V.split(`
645
+ `);q=U.slice(Math.max(0,T.start_line-2),Math.min(U.length,T.start_line+3)).join(`
646
+ `).trim()}let I=[];T.activeGravity&&(T.activeGravity.reasons.some(U=>U.includes("Working Set"))?I.push(g):T.activeGravity.reasons.some(U=>U.includes("Recent Intent"))&&I.push(b)),T.structuralGravity&&I.push(S);let C=I.length>0?` ${I.join("")}`:"";return{relPath:J,name:T.name,kind:T.kind,signature:T.signature,line:T.start_line,snippet:q,badgeStr:C,gravityReasons:T.reasons}});return{content:[{type:"text",text:`# Symbol Search Results: "${e}"
619
647
 
620
- Showing ${O.length} matching symbol(s)${T?` (use offset=${i+r} for more)`:""}:
648
+ Showing ${j.length} matching symbol(s)${R?` (use offset=${i+r} for more)`:""}:
621
649
 
622
- `+O.map((k,D)=>{let H=`## ${i+D+1}. \`${k.name}\` (${k.kind})${k.badgeStr}
623
- **File**: \`${k.relPath}:${k.line}\`
624
- `;return k.gravityReasons&&(H+=`> *${k.gravityReasons.join(", ")}*
625
- `),k.signature&&(H+=`**Signature**: \`${k.signature}\`
626
- `),k.snippet&&(H+=`
650
+ `+j.map((T,O)=>{let J=`## ${i+O+1}. \`${T.name}\` (${T.kind})${T.badgeStr}
651
+ **File**: \`${T.relPath}:${T.line}\`
652
+ `;return T.gravityReasons&&(J+=`> *${T.gravityReasons.join(", ")}*
653
+ `),T.signature&&(J+=`**Signature**: \`${T.signature}\`
654
+ `),T.snippet&&(J+=`
627
655
  \`\`\`typescript
628
- ${k.snippet}
656
+ ${T.snippet}
629
657
  \`\`\`
630
- `),H}).join(`
631
- `)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=_e(this.repoPath)||void 0;if(!r)return[];let c=this.filesRepo.findWithEmbeddings(),u=new qn(this.repoPath).getScorer(),d=new Yt(this.repoPath).getAncestorMissionIds(),m=[];for(let h of c)try{let _=JSON.parse(h.embedding),v=_d(r,_),g=this.filesRepo.getContent(h.path),x=Re.ENABLE_LEXICAL_SCORING&&g?qr.calculateLexicalScore(g,e):0,I=x>0?.1:.18;if(v>I){if(t&&!n.matchesFilters(h.path,i,h.mtime,h.classification))continue;let E=h.mtime>2e9?Math.floor(h.mtime/1e3):h.mtime,w=Math.floor(Date.now()/1e3)-Up.SECONDS_PER_YEAR,T=Ge.getMultiplier(h.path,h.classification),O=u.calculateScore(v,E||w);O*=T;let k=this.filesRepo.getGravityMap(d,a)[h.path],D=h.classification?Ge.mapClassificationToTier(h.classification):Ge.classify(h.path,{content:g??void 0}),H=`Similarity: ${(v*100).toFixed(0)}%, Tier: ${D}${T!==1?` (${T}x)`:""}`;x>0&&(O+=x*Re.LEXICAL_WEIGHT,H+=` | Lexical: +${x.toFixed(1)}`),k&&(O+=k.score,H+=` | \u{1F525} Gravity: +${k.score.toFixed(1)} (${k.reasons.join(", ")})`);let L=g?qr.extractSnippet(g,e):void 0;m.push({path:h.path,summary:h.summary||"",score:v,decayedScore:O,rationale:H,snippet:L})}}catch{}let f=new Map;for(let h of m){let _=h.path.split("/").pop()?.split(".")[0].replace(/(Controller|Service|Repository|Component|View|Page|Handler|Wrapper|Client|DTO|Interface)$/i,"").toLowerCase();_&&_.length>3&&(f.has(_)||f.set(_,[]),f.get(_).push(h))}for(let[h,_]of f.entries())if(new Set(_.map(g=>g.path.split(".").pop())).size>1)for(let g of _)g.decayedScore=(g.decayedScore||0)+.15,g.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${h}')`;return m.sort((h,_)=>(_.decayedScore||0)-(h.decayedScore||0)),m}buildFtsQuery(e,r){let i=e.trim();if(!i.includes(" "))return`"${i}" OR ${i}*`;let t=i.split(/\s+/).filter(o=>o.length>0);switch(r){case"exact":return`"${i}"`;case"all":return t.map(o=>`${o}*`).join(" ");default:return t.map(o=>`${o}*`).join(" OR ")}}};J();Q();function Kn(n){let{fileType:e,layer:r}=n,i={fileType:st.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}async function Oy(n){let e=Ln(n.query??""),r={...n,query:e},i=Fn();try{let{repoPath:t}=je(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,compact:c=!1}=r;await ee(t);let{filters:l,hasFilters:u}=Kn(r),d=await new st(t).searchByConcept(o,s,a,l,u,c);return xS(t,o,"concept"),i(),d}catch(t){return $.error({error:t,args:n},"Concept Search failed"),i(),await ht(),{content:[{type:"text",text:`Concept Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function xS(n,e,r){try{let i=j.getInstance(n),t=_e(n);i.searchHistory.record(e,r,t)}catch(i){let t=_e(n);$.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),ht()}}J();Q();async function Ay(n){let e=Ln(n.query??""),r={...n,query:e},i=Fn();try{let{repoPath:t}=je(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,matchMode:c="any"}=r;await ee(t);let{filters:l,hasFilters:u}=Kn(r),d=await new st(t).searchBySymbol(o,s,a,l,u,c);return $S(t,o,"symbol"),i(),d}catch(t){return $.error({error:t,args:n},"Symbol Search failed"),i(),await ht(),{content:[{type:"text",text:`Symbol Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function $S(n,e,r){try{let i=j.getInstance(n),t=_e(n);i.searchHistory.record(e,r,t)}catch(i){let t=_e(n);$.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),ht()}}Q();J();import Yr from"path";function Ly(n,e){let r=n.findContentByToken(e,100);return{count:r.length,files:r}}async function Cy(n){let{repoPath:e,query:r,key:i="",kind:t,limit:o=50,showUsage:s=!1}=n,a=i||r;if(!a&&!t)return{content:[{type:"text",text:'Error: Either "key" or "kind" parameter is required.'}]};await ee(e);let c=j.getInstance(e),{configs:l,files:u}=c;if(a){$.info({repoPath:e,key:a},"Searching for config key in DB...");let f=l.findByKey(a,o);if(f.length===0)return{content:[{type:"text",text:`No configuration found for key: ${a}`}]};if(s){let v=f.map(E=>{let w=Ly(u,E.key),T=w.count===0?"\u26A0\uFE0F ORPHANED":`\u2713 ${w.count} usage(s)`;return{file:Yr.relative(e,E.file_path),key:E.key,value:E.value,kind:E.kind,usageCount:w.count,usageFiles:w.files.slice(0,5).map(O=>Yr.relative(e,O)),status:T}});v.sort((E,w)=>E.usageCount===0&&w.usageCount>0?-1:w.usageCount===0&&E.usageCount>0?1:E.usageCount-w.usageCount);let g=v.filter(E=>E.usageCount===0).length;return{content:[{type:"text",text:(g>0?`# Configuration Search: "${a}" (with Usage Analysis)
658
+ `),J}).join(`
659
+ `)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=_e(this.repoPath)||void 0;if(!r)return[];let c=this.filesRepo.findWithEmbeddings(),u=new tr(this.repoPath).getScorer(),d=new ii(this.repoPath).getAncestorMissionIds(),m=[];for(let h of c)try{let _=JSON.parse(h.embedding),v=Br(r,_),g=this.filesRepo.getContent(h.path),b=Re.ENABLE_LEXICAL_SCORING&&g?ri.calculateLexicalScore(g,e):0,S=1;if(g){let w=/\b(class|function|const|let|var|enum)\s+\w+/.test(g);if(/export\s+/.test(g)&&!w){let j=g.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");/\b(class|function|const|let|var|enum)\s+\w+/.test(j)||(S=.1)}}let k=b>0?.1:.18;if(v>k){if(t&&!n.matchesFilters(h.path,i,h.mtime,h.classification))continue;let w=h.mtime>2e9?Math.floor(h.mtime/1e3):h.mtime,R=Math.floor(Date.now()/1e3)-Yp.SECONDS_PER_YEAR,j=Ke.getMultiplier(h.path,h.classification),B=u.calculateScore(v,w||R);B*=j;let O=this.filesRepo.getGravityMap(d,a)[h.path],J=h.classification?Ke.mapClassificationToTier(h.classification):Ke.classify(h.path,{content:g??void 0}),V=`Similarity: ${(v*100).toFixed(0)}%, Tier: ${J}${j!==1?` (${j}x)`:""}`;b>0&&(B+=b*Re.LEXICAL_WEIGHT,V+=` | Lexical: +${b.toFixed(1)}`),O&&(B+=O.score,V+=` | \u{1F525} Gravity: +${O.score.toFixed(1)} (${O.reasons.join(", ")})`),S<1&&(B*=S,V+=` | \u{1F4C9} Barrel: x${S}`);let q=g?ri.extractSnippet(g,e):void 0;m.push({path:h.path,summary:h.summary||"",score:v,decayedScore:B,rationale:V,snippet:q})}}catch{}let f=new Map;for(let h of m){let _=h.path.split("/").pop()?.split(".")[0].replace(/(Controller|Service|Repository|Component|View|Page|Handler|Wrapper|Client|DTO|Interface)$/i,"").toLowerCase();_&&_.length>3&&(f.has(_)||f.set(_,[]),f.get(_).push(h))}for(let[h,_]of f.entries())if(new Set(_.map(g=>g.path.split(".").pop())).size>1)for(let g of _)g.decayedScore=(g.decayedScore||0)+.15,g.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${h}')`;return m.sort((h,_)=>(_.decayedScore||0)-(h.decayedScore||0)),m}findIntentLogMatches(e,r){let i=this.intentLogsRepo.findWithEmbeddings(),t=[];for(let o of i)try{let s=JSON.parse(o.embedding),a=Br(e,s);a>.25&&t.push({id:o.id,missionId:o.mission_id,type:o.type,content:o.content,symbolName:o.symbol_name,filePath:o.file_path,score:a,decayedScore:a,rationale:`Similarity: ${(a*100).toFixed(0)}%`,createdAt:o.created_at})}catch{}return t.sort((o,s)=>(s.decayedScore||0)-(o.decayedScore||0)),t.slice(0,r)}buildFtsQuery(e,r){let i=e.trim();if(!i.includes(" "))return`"${i}" OR ${i}*`;let t=i.split(/\s+/).filter(o=>o.length>0);switch(r){case"exact":return`"${i}"`;case"all":return t.map(o=>`${o}*`).join(" ");default:return t.map(o=>`${o}*`).join(" OR ")}}};K();te();function nr(n){let{fileType:e,layer:r}=n,i={fileType:lt.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}async function Qy(n){let e=Zn(n.query??""),r={...n,query:e},i=Kn();try{let{repoPath:t}=Me(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,compact:c=!1}=r;await re(t);let{filters:l,hasFilters:u}=nr(r),d=await new lt(t).searchByConcept(o,s,a,l,u,c);return XS(t,o,"concept"),i(),d}catch(t){return x.error({error:t,args:n},"Concept Search failed"),i(),await yt(),{content:[{type:"text",text:`Concept Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function XS(n,e,r){try{let i=A.getInstance(n),t=_e(n);i.searchHistory.record(e,r,t)}catch(i){let t=_e(n);x.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),yt()}}K();te();async function ev(n){let e=Zn(n.query??""),r={...n,query:e},i=Kn();try{let{repoPath:t}=Me(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,matchMode:c="any"}=r;await re(t);let{filters:l,hasFilters:u}=nr(r),d=await new lt(t).searchBySymbol(o,s,a,l,u,c);return QS(t,o,"symbol"),i(),d}catch(t){return x.error({error:t,args:n},"Symbol Search failed"),i(),await yt(),{content:[{type:"text",text:`Symbol Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function QS(n,e,r){try{let i=A.getInstance(n),t=_e(n);i.searchHistory.record(e,r,t)}catch(i){let t=_e(n);x.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),yt()}}te();K();import si from"path";function tv(n,e){let r=n.findContentByToken(e,100);return{count:r.length,files:r}}async function nv(n){let{repoPath:e,query:r,key:i="",kind:t,limit:o=50,showUsage:s=!1}=n,a=i||r;if(!a&&!t)return{content:[{type:"text",text:'Error: Either "key" or "kind" parameter is required.'}]};await re(e);let c=A.getInstance(e),{configs:l,files:u}=c;if(a){x.info({repoPath:e,key:a},"Searching for config key in DB...");let f=l.findByKey(a,o);if(f.length===0)return{content:[{type:"text",text:`No configuration found for key: ${a}`}]};if(s){let v=f.map(k=>{let w=tv(u,k.key),R=w.count===0?"\u26A0\uFE0F ORPHANED":`\u2713 ${w.count} usage(s)`;return{file:si.relative(e,k.file_path),key:k.key,value:k.value,kind:k.kind,usageCount:w.count,usageFiles:w.files.slice(0,5).map(j=>si.relative(e,j)),status:R}});v.sort((k,w)=>k.usageCount===0&&w.usageCount>0?-1:w.usageCount===0&&k.usageCount>0?1:k.usageCount-w.usageCount);let g=v.filter(k=>k.usageCount===0).length;return{content:[{type:"text",text:(g>0?`# Configuration Search: "${a}" (with Usage Analysis)
632
660
 
633
661
  \u26A0\uFE0F **${g} orphaned var(s)** (defined but never used in code)
634
662
 
@@ -638,18 +666,18 @@ Found ${f.length} match(es):
638
666
 
639
667
  Found ${f.length} match(es), all in use:
640
668
 
641
- `)+v.map(E=>{let w=`## ${E.file} (${E.kind}) ${E.status}
642
- **${E.key}**: \`${E.value}\``;return E.usageCount>0&&E.usageFiles.length>0&&(w+=`
643
- > Used in: ${E.usageFiles.map(T=>`\`${T}\``).join(", ")}${E.usageCount>5?` (+${E.usageCount-5} more)`:""}`),w}).join(`
669
+ `)+v.map(k=>{let w=`## ${k.file} (${k.kind}) ${k.status}
670
+ **${k.key}**: \`${k.value}\``;return k.usageCount>0&&k.usageFiles.length>0&&(w+=`
671
+ > Used in: ${k.usageFiles.map(R=>`\`${R}\``).join(", ")}${k.usageCount>5?` (+${k.usageCount-5} more)`:""}`),w}).join(`
644
672
 
645
- `)}]}}let h=f.map(v=>({file:Yr.relative(e,v.file_path),key:v.key,value:v.value,kind:v.kind}));return{content:[{type:"text",text:`# Configuration Search: "${a}"
673
+ `)}]}}let h=f.map(v=>({file:si.relative(e,v.file_path),key:v.key,value:v.value,kind:v.kind}));return{content:[{type:"text",text:`# Configuration Search: "${a}"
646
674
 
647
675
  Found ${f.length} match(es):
648
676
 
649
677
  `+h.map(v=>`## ${v.file} (${v.kind})
650
678
  **${v.key}**: \`${v.value}\``).join(`
651
679
 
652
- `)+"\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars."}]}}let p=l.findByKind(t||null,o);if(s){let f=p.map(g=>{let x=Ly(u,g.key);return{file:Yr.relative(e,g.file_path),key:g.key,value:g.value,kind:g.kind,usageCount:x.count,status:x.count===0?"ORPHANED":"in-use"}});f.sort((g,x)=>g.usageCount===0&&x.usageCount>0?-1:x.usageCount===0&&g.usageCount>0?1:g.usageCount-x.usageCount);let h=f.filter(g=>g.usageCount===0).length,_=f.length,v=`# Config Discovery (${t||"all"}) with Usage Analysis
680
+ `)+"\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars."}]}}let p=l.findByKind(t||null,o);if(s){let f=p.map(g=>{let b=tv(u,g.key);return{file:si.relative(e,g.file_path),key:g.key,value:g.value,kind:g.kind,usageCount:b.count,status:b.count===0?"ORPHANED":"in-use"}});f.sort((g,b)=>g.usageCount===0&&b.usageCount>0?-1:b.usageCount===0&&g.usageCount>0?1:g.usageCount-b.usageCount);let h=f.filter(g=>g.usageCount===0).length,_=f.length,v=`# Config Discovery (${t||"all"}) with Usage Analysis
653
681
 
654
682
  `;return v+=`**Summary**: ${_} config(s) found, ${h} orphaned
655
683
 
@@ -661,9 +689,9 @@ Found ${f.length} match(es):
661
689
  `,v+=f.filter(g=>g.usageCount>0).map(g=>`- \`${g.key}\` (${g.usageCount} usages)`).join(`
662
690
  `),p.length===o&&(v+=`
663
691
 
664
- > Results limited to ${o} entries. Use the 'limit' parameter to see more.`),{content:[{type:"text",text:v}]}}let d=p.map(f=>({...f,file:Yr.relative(e,f.file_path)})),m=JSON.stringify(d,null,2);return p.length===o&&(m=`Results limited to ${o} entries. Use the 'limit' parameter to see more.
692
+ > Results limited to ${o} entries. Use the 'limit' parameter to see more.`),{content:[{type:"text",text:v}]}}let d=p.map(f=>({...f,file:si.relative(e,f.file_path)})),m=JSON.stringify(d,null,2);return p.length===o&&(m=`Results limited to ${o} entries. Use the 'limit' parameter to see more.
665
693
 
666
- `+m),m+="\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars.",{content:[{type:"text",text:m}]}}J();Q();async function jy(n){let e=Ln(n.query??""),r={...n,query:e},i=Fn();try{let{repoPath:t}=je(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,ranked:c=!1}=r;await ee(t);let{filters:l,hasFilters:u}=Kn(r),d=await new st(t).searchByPath(o,s,a,l,u,c);return SS(t,o,"path"),i(),d}catch(t){return $.error({error:t,args:n},"Path Search failed"),i(),await ht(),{content:[{type:"text",text:`Path Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function SS(n,e,r){try{let i=j.getInstance(n),t=_e(n);i.searchHistory.record(e,r,t)}catch(i){let t=_e(n);$.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),ht()}}Q();import gt from"path";import Id from"fs";J();import DS from"path";J();qt();import kS from"better-sqlite3";import Yn from"path";import My from"fs";import ES from"os";import wS from"crypto";var IS=$.child({module:"fusion-connection"}),Ns=5,TS=1,Uy=["files","exports","imports","configs","schema_migrations"],zs=class{fusionDb;attachedRepos=new Map;fusionDbPath;name;constructor(e){this.name=e.name,this.fusionDbPath=this.getFusionDbPath(e.name),IS.info({name:e.name,path:this.fusionDbPath},"Initializing fused index connection");let r=Yn.dirname(this.fusionDbPath);My.existsSync(r)||My.mkdirSync(r,{recursive:!0}),this.fusionDb=new kS(this.fusionDbPath),this.fusionDb.pragma("journal_mode = WAL"),this.fusionDb.pragma("busy_timeout = 5000"),this.initFusionSchema();for(let i of e.repoPaths)this.attachRepo(i)}getFusionDbPath(e){let r=ES.homedir(),i=Yn.join(r,".mcp-liquid-shadow","fused"),t=e.replace(/[^a-zA-Z0-9-_]/g,"_");return Yn.join(i,`${t}.db`)}initFusionSchema(){this.fusionDb.exec(`
694
+ `+m),m+="\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars.",{content:[{type:"text",text:m}]}}K();te();async function rv(n){let e=Zn(n.query??""),r={...n,query:e},i=Kn();try{let{repoPath:t}=Me(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,ranked:c=!1}=r;await re(t);let{filters:l,hasFilters:u}=nr(r),d=await new lt(t).searchByPath(o,s,a,l,u,c);return ek(t,o,"path"),i(),d}catch(t){return x.error({error:t,args:n},"Path Search failed"),i(),await yt(),{content:[{type:"text",text:`Path Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function ek(n,e,r){try{let i=A.getInstance(n),t=_e(n);i.searchHistory.record(e,r,t)}catch(i){let t=_e(n);x.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),yt()}}te();import vt from"path";import Ld from"fs";K();import uk from"path";K();Kt();import tk from"better-sqlite3";import rr from"path";import iv from"fs";import nk from"os";import rk from"crypto";var ik=x.child({module:"fusion-connection"}),Zs=5,ok=1,ov=["files","exports","imports","configs","schema_migrations"],Ws=class{fusionDb;attachedRepos=new Map;fusionDbPath;name;constructor(e){this.name=e.name,this.fusionDbPath=this.getFusionDbPath(e.name),ik.info({name:e.name,path:this.fusionDbPath},"Initializing fused index connection");let r=rr.dirname(this.fusionDbPath);iv.existsSync(r)||iv.mkdirSync(r,{recursive:!0}),this.fusionDb=new tk(this.fusionDbPath),this.fusionDb.pragma("journal_mode = WAL"),this.fusionDb.pragma("busy_timeout = 5000"),this.initFusionSchema();for(let i of e.repoPaths)this.attachRepo(i)}getFusionDbPath(e){let r=nk.homedir(),i=rr.join(r,".mcp-liquid-shadow","fused"),t=e.replace(/[^a-zA-Z0-9-_]/g,"_");return rr.join(i,`${t}.db`)}initFusionSchema(){this.fusionDb.exec(`
667
695
  CREATE TABLE IF NOT EXISTS fused_repos (
668
696
  alias TEXT PRIMARY KEY,
669
697
  repo_path TEXT NOT NULL UNIQUE,
@@ -697,17 +725,17 @@ Found ${f.length} match(es):
697
725
 
698
726
  CREATE INDEX IF NOT EXISTS idx_virtual_edges_source ON virtual_edges(source_repo, source_file_path);
699
727
  CREATE INDEX IF NOT EXISTS idx_virtual_edges_target ON virtual_edges(target_repo, target_file_path);
700
- `),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(TS.toString())}attachRepo(e){let r=Yn.resolve(e);if(this.attachedRepos.has(r))return;if(!et(r))throw new Error(`Repository "${r}" is not indexed. Run shadow_recon_onboard({ repoPath: "${r}" }) then shadow_sync_trace({ repoPath: "${r}" }).`);let i=Oe(r),t=i.name;this.validateSchemaCompatibility(i,r);let o=this.getSchemaVersion(i),s=this.generateAlias(r),a=3,c=100;for(let l=1;l<=a;l++)try{this.fusionDb.exec(`ATTACH DATABASE '${t}' AS ${s}`);let u={alias:s,repoPath:r,dbPath:t,schemaVersion:o,attached:!0};this.attachedRepos.set(r,u),this.fusionDb.prepare(`INSERT OR REPLACE INTO fused_repos (alias, repo_path, db_path, schema_version, attached_at, last_validated_at)
701
- VALUES (?, ?, ?, ?, unixepoch(), unixepoch())`).run(s,r,t,o);return}catch(u){let p=u instanceof Error?u.message.toLowerCase():String(u).toLowerCase();if((p.includes("locked")||p.includes("busy"))&&l<a){this.sleep(c*l);continue}throw u}}checkHealth(){let e=[];for(let r of this.attachedRepos.values())try{this.fusionDb.prepare(`SELECT 1 FROM ${r.alias}.files LIMIT 1`).get(),e.push({alias:r.alias,repoPath:r.repoPath,accessible:!0})}catch(i){e.push({alias:r.alias,repoPath:r.repoPath,accessible:!1,error:i instanceof Error?i.message:String(i)})}return{healthy:e.every(r=>r.accessible),repos:e}}detachRepo(e){let r=Yn.resolve(e),i=this.attachedRepos.get(r);i&&(this.fusionDb.exec(`DETACH DATABASE ${i.alias}`),this.attachedRepos.delete(r),this.fusionDb.prepare("DELETE FROM fused_repos WHERE repo_path = ?").run(r))}refreshRepo(e){this.detachRepo(e),this.attachRepo(e)}refreshAll(){let e=Array.from(this.attachedRepos.keys());for(let r of e)this.refreshRepo(r)}validateSchemas(){let e=Array.from(this.attachedRepos.values()).map(r=>{let i=Oe(r.repoPath),t=Uy.filter(s=>!this.checkTableExists(i,s)),o=this.getSchemaVersion(i);return{alias:r.alias,repoPath:r.repoPath,schemaVersion:o,compatible:o>=Ns&&t.length===0,missingTables:t}});return{valid:e.every(r=>r.compatible),minVersion:Ns,repos:e}}getAttachedRepos(){return Array.from(this.attachedRepos.values())}prepare(e){return this.fusionDb.prepare(e)}exec(e){this.fusionDb.exec(e)}close(){for(let e of this.attachedRepos.values())try{this.fusionDb.exec(`DETACH DATABASE ${e.alias}`)}catch{}this.attachedRepos.clear(),this.fusionDb.open&&this.fusionDb.close()}generateAlias(e){let r=Yn.basename(e).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=wS.createHash("sha256").update(e).digest("hex").substring(0,6);return`repo_${r}_${i}`}getSchemaVersion(e){try{return e.prepare("SELECT MAX(version) as version FROM schema_migrations").get()?.version||0}catch{return 0}}validateSchemaCompatibility(e,r){let i=this.getSchemaVersion(e);if(i<Ns)throw new Error(`Schema version mismatch for ${r}. Expected >= ${Ns}, got ${i}.`);let t=Uy.filter(o=>!this.checkTableExists(e,o));if(t.length>0)throw new Error(`Missing tables in ${r}: ${t.join(", ")}`)}checkTableExists(e,r){try{return!!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(r)}catch{return!1}}sleep(e){let r=Date.now()+e;for(;Date.now()<r;);}get nameValue(){return this.name}get dbPath(){return this.fusionDbPath}};J();var jt=$.child({module:"edge-scanner"});function Ed(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function RS(n){if(!n)return null;try{let e=JSON.parse(n);return e.path||e.name||null}catch{return null}}function PS(n,e){let r=Ed(n),i=Ed(e);if(r===i)return!0;let t=i.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\$[^/]+/g,"[^/]+");return new RegExp(`^${t}$`).test(r)}function NS(n){jt.info("Starting HTTP gap detection scan");let e=n.getAttachedRepos();if(e.length<2)return jt.warn("Need at least 2 repos for cross-repo dependency detection"),0;let r=[];for(let o of e)try{let s=`
728
+ `),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(ok.toString())}attachRepo(e){let r=rr.resolve(e);if(this.attachedRepos.has(r))return;if(!rt(r))throw new Error(`Repository "${r}" is not indexed. Run shadow_recon_onboard({ repoPath: "${r}" }) then shadow_sync_trace({ repoPath: "${r}" }).`);let i=Oe(r),t=i.name;this.validateSchemaCompatibility(i,r);let o=this.getSchemaVersion(i),s=this.generateAlias(r),a=3,c=100;for(let l=1;l<=a;l++)try{this.fusionDb.exec(`ATTACH DATABASE '${t}' AS ${s}`);let u={alias:s,repoPath:r,dbPath:t,schemaVersion:o,attached:!0};this.attachedRepos.set(r,u),this.fusionDb.prepare(`INSERT OR REPLACE INTO fused_repos (alias, repo_path, db_path, schema_version, attached_at, last_validated_at)
729
+ VALUES (?, ?, ?, ?, unixepoch(), unixepoch())`).run(s,r,t,o);return}catch(u){let p=u instanceof Error?u.message.toLowerCase():String(u).toLowerCase();if((p.includes("locked")||p.includes("busy"))&&l<a){this.sleep(c*l);continue}throw u}}checkHealth(){let e=[];for(let r of this.attachedRepos.values())try{this.fusionDb.prepare(`SELECT 1 FROM ${r.alias}.files LIMIT 1`).get(),e.push({alias:r.alias,repoPath:r.repoPath,accessible:!0})}catch(i){e.push({alias:r.alias,repoPath:r.repoPath,accessible:!1,error:i instanceof Error?i.message:String(i)})}return{healthy:e.every(r=>r.accessible),repos:e}}detachRepo(e){let r=rr.resolve(e),i=this.attachedRepos.get(r);i&&(this.fusionDb.exec(`DETACH DATABASE ${i.alias}`),this.attachedRepos.delete(r),this.fusionDb.prepare("DELETE FROM fused_repos WHERE repo_path = ?").run(r))}refreshRepo(e){this.detachRepo(e),this.attachRepo(e)}refreshAll(){let e=Array.from(this.attachedRepos.keys());for(let r of e)this.refreshRepo(r)}validateSchemas(){let e=Array.from(this.attachedRepos.values()).map(r=>{let i=Oe(r.repoPath),t=ov.filter(s=>!this.checkTableExists(i,s)),o=this.getSchemaVersion(i);return{alias:r.alias,repoPath:r.repoPath,schemaVersion:o,compatible:o>=Zs&&t.length===0,missingTables:t}});return{valid:e.every(r=>r.compatible),minVersion:Zs,repos:e}}getAttachedRepos(){return Array.from(this.attachedRepos.values())}prepare(e){return this.fusionDb.prepare(e)}exec(e){this.fusionDb.exec(e)}close(){for(let e of this.attachedRepos.values())try{this.fusionDb.exec(`DETACH DATABASE ${e.alias}`)}catch{}this.attachedRepos.clear(),this.fusionDb.open&&this.fusionDb.close()}generateAlias(e){let r=rr.basename(e).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=rk.createHash("sha256").update(e).digest("hex").substring(0,6);return`repo_${r}_${i}`}getSchemaVersion(e){try{return e.prepare("SELECT MAX(version) as version FROM schema_migrations").get()?.version||0}catch{return 0}}validateSchemaCompatibility(e,r){let i=this.getSchemaVersion(e);if(i<Zs)throw new Error(`Schema version mismatch for ${r}. Expected >= ${Zs}, got ${i}.`);let t=ov.filter(o=>!this.checkTableExists(e,o));if(t.length>0)throw new Error(`Missing tables in ${r}: ${t.join(", ")}`)}checkTableExists(e,r){try{return!!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(r)}catch{return!1}}sleep(e){let r=Date.now()+e;for(;Date.now()<r;);}get nameValue(){return this.name}get dbPath(){return this.fusionDbPath}};K();var Ut=x.child({module:"edge-scanner"});function Dd(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function sk(n){if(!n)return null;try{let e=JSON.parse(n);return e.path||e.name||null}catch{return null}}function ak(n,e){let r=Dd(n),i=Dd(e);if(r===i)return!0;let t=i.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\$[^/]+/g,"[^/]+");return new RegExp(`^${t}$`).test(r)}function ck(n){Ut.info("Starting HTTP gap detection scan");let e=n.getAttachedRepos();if(e.length<2)return Ut.warn("Need at least 2 repos for cross-repo dependency detection"),0;let r=[];for(let o of e)try{let s=`
702
730
  SELECT id, name, file_path, capabilities
703
731
  FROM ${o.alias}.exports
704
732
  WHERE kind = 'HTTP Route'
705
- `,a=n.executeRawQuery(s);for(let c of a){let l=RS(c.capabilities)||c.name;l&&l.startsWith("/")&&r.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,symbolId:c.id,routePath:l})}}catch(s){jt.warn({repo:o.alias,error:s},"Failed to query backend routes")}jt.debug({count:r.length},"Found backend routes");let i=[];for(let o of e)try{let s=`
733
+ `,a=n.executeRawQuery(s);for(let c of a){let l=sk(c.capabilities)||c.name;l&&l.startsWith("/")&&r.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,symbolId:c.id,routePath:l})}}catch(s){Ut.warn({repo:o.alias,error:s},"Failed to query backend routes")}Ut.debug({count:r.length},"Found backend routes");let i=[];for(let o of e)try{let s=`
706
734
  SELECT file_path, name
707
735
  FROM ${o.alias}.event_synapses
708
736
  WHERE type = 'api_route' AND direction = 'produce'
709
- `,a=n.executeRawQuery(s);for(let c of a){let l=Ed(c.name);l&&l.startsWith("/")&&i.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,routePath:l})}}catch(s){jt.warn({repo:o.alias,error:s},"Failed to query frontend API calls")}jt.debug({count:i.length},"Found frontend API calls");let t=0;for(let o of i)for(let s of r)if(o.repoPath!==s.repoPath&&PS(o.routePath,s.routePath))try{n.addVirtualEdge({sourceRepo:o.repoPath,sourceFilePath:o.filePath,targetRepo:s.repoPath,targetFilePath:s.filePath,targetSymbolId:s.symbolId,relationship:"api_call",metadata:{frontendPath:o.routePath,backendPath:s.routePath,method:s.method},confidence:1}),t++}catch(a){jt.debug({source:o.filePath,target:s.filePath,error:a},"Skipped duplicate edge")}return jt.info({edgesCreated:t,backendRoutes:r.length,frontendCalls:i.length},"HTTP gap detection scan completed"),t}function Fy(n){let e=NS(n);return{httpGaps:e,totalEdges:e}}J();var zS=$.child({module:"fusion-index-service"}),Ds=class{constructor(e){this.connection=e}executeFederatedQuery(e,...r){return this.connection.prepare(e).all(...r).map(o=>{let{_repo_alias:s,_repo_path:a,...c}=o;return{repo:s,repoPath:a,data:c}})}executeRawQuery(e,...r){return this.connection.prepare(e).all(...r)}buildAdvancedQuery(e){let r=this.connection.getAttachedRepos();if(r.length===0)throw new Error("No repositories attached");let{table:i,tableAlias:t,columns:o,joins:s,where:a,groupBy:c,having:l,orderBy:u,limit:p,offset:d}=e,m=t||i.charAt(0),f=o.join(", "),_=r.map(v=>{let g=`${v.alias}.${i} ${m}`,x="";s&&s.length>0&&(x=s.map(T=>{let O=T.alias||T.table.charAt(0);return`${T.type} JOIN ${v.alias}.${T.table} ${O} ON ${T.on}`}).join(`
710
- `));let I=a?`WHERE ${a}`:"",E=c&&c.length>0?`GROUP BY ${c.join(", ")}`:"",w=l?`HAVING ${l}`:"";return`SELECT '${v.alias}' as _repo_alias, '${v.repoPath}' as _repo_path, ${f} FROM ${g} ${x} ${I} ${E} ${w}`.trim()}).join(`
737
+ `,a=n.executeRawQuery(s);for(let c of a){let l=Dd(c.name);l&&l.startsWith("/")&&i.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,routePath:l})}}catch(s){Ut.warn({repo:o.alias,error:s},"Failed to query frontend API calls")}Ut.debug({count:i.length},"Found frontend API calls");let t=0;for(let o of i)for(let s of r)if(o.repoPath!==s.repoPath&&ak(o.routePath,s.routePath))try{n.addVirtualEdge({sourceRepo:o.repoPath,sourceFilePath:o.filePath,targetRepo:s.repoPath,targetFilePath:s.filePath,targetSymbolId:s.symbolId,relationship:"api_call",metadata:{frontendPath:o.routePath,backendPath:s.routePath,method:s.method},confidence:1}),t++}catch(a){Ut.debug({source:o.filePath,target:s.filePath,error:a},"Skipped duplicate edge")}return Ut.info({edgesCreated:t,backendRoutes:r.length,frontendCalls:i.length},"HTTP gap detection scan completed"),t}function sv(n){let e=ck(n);return{httpGaps:e,totalEdges:e}}K();var lk=x.child({module:"fusion-index-service"}),Hs=class{constructor(e){this.connection=e}executeFederatedQuery(e,...r){return this.connection.prepare(e).all(...r).map(o=>{let{_repo_alias:s,_repo_path:a,...c}=o;return{repo:s,repoPath:a,data:c}})}executeRawQuery(e,...r){return this.connection.prepare(e).all(...r)}buildAdvancedQuery(e){let r=this.connection.getAttachedRepos();if(r.length===0)throw new Error("No repositories attached");let{table:i,tableAlias:t,columns:o,joins:s,where:a,groupBy:c,having:l,orderBy:u,limit:p,offset:d}=e,m=t||i.charAt(0),f=o.join(", "),_=r.map(v=>{let g=`${v.alias}.${i} ${m}`,b="";s&&s.length>0&&(b=s.map(R=>{let j=R.alias||R.table.charAt(0);return`${R.type} JOIN ${v.alias}.${R.table} ${j} ON ${R.on}`}).join(`
738
+ `));let S=a?`WHERE ${a}`:"",k=c&&c.length>0?`GROUP BY ${c.join(", ")}`:"",w=l?`HAVING ${l}`:"";return`SELECT '${v.alias}' as _repo_alias, '${v.repoPath}' as _repo_path, ${f} FROM ${g} ${b} ${S} ${k} ${w}`.trim()}).join(`
711
739
  UNION ALL
712
740
  `);return u&&(_=`SELECT * FROM (${_}) AS federated_results ORDER BY ${u}`),p!==void 0&&(_+=` LIMIT ${p}`),d!==void 0&&(_+=` OFFSET ${d}`),_}buildFtsQuery(e,r,i,t,o=50){let s=this.connection.getAttachedRepos();if(s.length===0)throw new Error("No repositories attached");let a=i.replace(/"/g,'""'),c=t.map(u=>`c.${u}`).join(", ");return`${s.map(u=>`
713
741
  SELECT '${u.alias}' as _repo_alias, '${u.repoPath}' as _repo_path, ${c}, bm25(${u.alias}.${e}) as _fts_rank
@@ -731,14 +759,14 @@ WHERE i.resolved_path IS NOT NULL`);return r.join(`
731
759
  INSERT INTO virtual_edges
732
760
  (source_repo, source_file_path, source_symbol_id, target_repo, target_file_path, target_symbol_id, relationship, metadata, confidence, updated_at)
733
761
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, unixepoch())
734
- `).run(e.sourceRepo,e.sourceFilePath,e.sourceSymbolId||null,e.targetRepo,e.targetFilePath,e.targetSymbolId||null,e.relationship,e.metadata?JSON.stringify(e.metadata):null,e.confidence??1).lastInsertRowid}scanEdges(){return zS.info({name:this.connection.nameValue},"Starting edge scan"),Fy(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}};var Zy=$.child({module:"fused-index"}),wd=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new zs(e),this.service=new Ds(this.connection)}attachRepo(e){this.connection.attachRepo(e)}detachRepo(e){this.connection.detachRepo(e)}refreshRepo(e){this.connection.refreshRepo(e)}getAttachedRepos(){return this.connection.getAttachedRepos()}checkHealth(){return this.connection.checkHealth()}close(){this.connection.close(),Zy.info({name:this.configName},"Fused index closed")}getStatus(){let e=this.service.executeRawQuery("SELECT COUNT(*) as count FROM virtual_edges");return{name:this.connection.nameValue,path:this.connection.dbPath,attachedRepos:this.connection.getAttachedRepos().length,repos:this.connection.getAttachedRepos(),virtualEdgesCount:e[0]?.count||0}}searchExports(e,r=50){return this.service.searchExports(e,r)}searchFiles(e,r=50){return this.service.searchFiles(e,r)}getVirtualEdges(e,r){return this.service.getVirtualEdges(e,r)}addVirtualEdge(e){return this.service.addVirtualEdge(e)}scanEdges(){return this.service.scanEdges()}buildUnionQuery(e,r,i){return this.service.buildUnionQuery(e,r,i)}executeFederatedQuery(e,...r){return this.service.executeFederatedQuery(e,...r)}executeRawQuery(e,...r){return this.service.executeRawQuery(e,...r)}buildAdvancedQuery(e){return this.service.buildAdvancedQuery(e)}buildFtsQuery(e,r,i,t,o){return this.service.buildFtsQuery(e,r,i,t,o)}buildCrossRepoImportsQuery(){return this.service.buildCrossRepoImportsQuery()}refreshAll(){this.connection.refreshAll()}validateSchemas(){return Zy.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},Os=new Map;function Hy(n){let e=Os.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>DS.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),Os.delete(n.name)}let r=new wd(n);return Os.set(n.name,r),r}function Wy(){return Array.from(Os.keys())}import{Visitor as OS}from"@swc/core/Visitor.js";var Xn=class extends OS{calls=new Set;apiCalls=[];imports=new Map;axiosInstances=new Map([["axios",""],["http",""],["appApi",""],["restApi",""],["adminApi",""]]);visitImportDeclaration(e){let r=e.source.value;for(let i of e.specifiers)(i.type==="ImportDefaultSpecifier"||i.type==="ImportSpecifier")&&this.imports.set(i.local.value,r);return super.visitImportDeclaration(e)}visitCallExpression(e){if(e.callee.type==="Identifier"){let r=e.callee.value;this.calls.add(r),(r==="axios"||r==="http")&&e.arguments.length>0&&this.extractApiCallFromConfig(e.arguments[0].expression)}else if(e.callee.type==="MemberExpression"){let r=e.callee.property.value,i=o=>{if(!o)return"?";if(o.type==="Identifier")return o.value;if(o.type==="ThisExpression")return"this";if(o.type==="MemberExpression"){let s=i(o.object),a=o.property.value||"?";return`${s}.${a}`}return o.type==="TsNonNullExpression"||o.type==="TsAsExpression"||o.type==="ParenthesisExpression"?i(o.expression):"?"},t=i(e.callee.object);if(t!=="?"&&r){if(this.calls.add(`${t}.${r}`),t==="axios"||t==="http"||this.axiosInstances.has(t)){let o=this.axiosInstances.get(t)||"";this.extractApiCall(r,e.arguments,o)}if((t.toLowerCase().includes("pubsub")||t==="pubSubClient"||t.endsWith(".pubSubClient"))&&r!=="subscribe"){let o=r;if((r==="publish"||r==="publishMessage"||r==="publishTaskByNameAndPayload")&&e.arguments.length>0)for(let s of e.arguments){let a=s.expression;if(a.type==="ObjectExpression"){let c=a.properties.find(l=>l.key?.type==="Identifier"&&(l.key.value==="action"||l.key.value==="type")||l.key?.type==="StringLiteral"&&(l.key.value==="action"||l.key.value==="type"));if(c&&c.value?.type==="StringLiteral"){o=c.value.value;break}}if(a.type==="CallExpression"&&a.callee.type==="MemberExpression"&&a.callee.object.value==="JSON"&&a.callee.property.value==="stringify"&&a.arguments.length>0){let c=a.arguments[0].expression;if(c.type==="ObjectExpression"){let l=c.properties.find(u=>u.key?.type==="Identifier"&&(u.key.value==="action"||u.key.value==="type")||u.key?.type==="StringLiteral"&&(u.key.value==="action"||u.key.value==="type"));if(l&&l.value?.type==="StringLiteral"){o=l.value.value;break}}}}this.apiCalls.push({method:"PUBSUB",url:o})}}}return e.callee.type==="Identifier"&&e.callee.value==="fetch"&&this.extractApiCall("GET",e.arguments),super.visitCallExpression(e)}visitNewExpression(e){return e.callee.type==="Identifier"&&this.calls.add(e.callee.value),super.visitNewExpression(e)}visitVariableDeclarator(e){if(e.init&&e.init.type==="CallExpression"){let r=e.init.callee;if(r.type==="MemberExpression"&&r.property.value==="create"&&r.object.value==="axios"){let t=e.init.arguments[0]?.expression;if(t&&t.type==="ObjectExpression"){let o=t.properties.find(s=>s.key.value==="baseURL");if(o){let s="?";o.value.type==="StringLiteral"?s=o.value.value:o.value.type==="Identifier"&&(s=`\${${o.value.value}}`),e.id.type==="Identifier"&&this.axiosInstances.set(e.id.value,s)}}}}return super.visitVariableDeclarator(e)}extractApiCallFromConfig(e){if(e&&e.type==="ObjectExpression"){let r=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="url"||t.key.type==="StringLiteral"&&t.key.value==="url"),i=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="method"||t.key.type==="StringLiteral"&&t.key.value==="method");if(r&&r.value){let t=i?.value?.value||"GET",o=this.resolveUrlValue(r.value);o!=="?"&&this.apiCalls.push({method:t.toUpperCase(),url:o})}}}resolveUrlValue(e){return e.type==="StringLiteral"?e.value:e.type==="TemplateLiteral"?e.quasis.map(r=>r.cooked).join("*"):"?"}visitTsType(e){return e}extractApiCall(e,r,i=""){if(r.length>0){let t=r[0].expression,o=this.resolveUrlValue(t);if(o!=="?"){if(i&&i!=="?"){let s=i.endsWith("/")||o.startsWith("/")?"":"/";o=`${i}${s}${o}`}this.apiCalls.push({method:e.toUpperCase(),url:o})}}}},Mt=class{calls=new Set;apiCalls=[];imports=new Map;visit(e,r){if(r===".php"){let i=/(?:([a-zA-Z0-9_$->:\(\)]*)?(?:->|::))?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&!["$this","self","parent"].includes(o)&&this.calls.add(`${o}${o.includes("::")?"::":"->"}${s}`),["save","delete","update","create","first","all","where","get","find"].includes(s)&&o&&!["Log","Route","Cache","Config","Http"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}->${s}()`}),s==="publish"&&o&&(o.includes("topic")||o.includes("pubSub"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="Http"||o==="client"||o.endsWith("request")||o.includes("Client")||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if(r===".py"){let i=/(?:([a-zA-Z0-9_\.]+)\.)?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&o!=="self"&&o!=="cls"&&this.calls.add(`${o}.${s}`),["save","delete","update","create","first","all","filter","get"].includes(s)&&o&&!["logger","os","sys"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}.${s}()`}),s==="publish"&&o&&(o.includes("publisher")||o.includes("client"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="requests"||o==="httpx"||o==="client"||o==="http"||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if([".ts",".tsx",".js",".jsx"].includes(r)){let i=/import\s+[\s\S]*?from\s+['"](.*?)['"];?/g,t;for(;(t=i.exec(e))!==null;)this.imports.set("*",t[1]);let o=/(?:([a-zA-Z0-9_$]+)\.)?([a-zA-Z0-9_$]+)\s*\(/g,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=s[2];a?(this.calls.add(`${a}.${c}`),(a.toLowerCase().includes("pubsub")||a==="pubSubClient")&&c!=="subscribe"&&this.apiCalls.push({method:"PUBSUB",url:c})):this.calls.add(c)}}else{let i=/\.([a-zA-Z0-9_]+)\s*\(/g,t;for(;(t=i.exec(e))!==null;)this.calls.add(t[1])}if(r===".php"){let i=/use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/g,t;for(;(t=i.exec(e))!==null;){let o=t[1],s=o.split("\\"),a=t[2]||s[s.length-1];this.imports.set(a,o)}}else if(r===".py"){let i=/from\s+([a-zA-Z0-9_\.]+)\s+import\s+([a-zA-Z0-9_,\s]+)/g,t;for(;(t=i.exec(e))!==null;){let a=t[1];t[2].split(",").map(l=>l.trim()).forEach(l=>{this.imports.set(l,a)})}let o=/^import\s+([a-zA-Z0-9_\.]+)/gm,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=a.split("."),l=c[c.length-1];this.imports.set(l,a)}}}};Be();import AS from"@swc/core";async function LS(n,e){try{if(!Id.existsSync(n))return!1;let r=Id.readFileSync(n,"utf8"),i=gt.extname(n).toLowerCase(),t=new Set;if(i===".ts"||i===".tsx"||i===".js"||i===".jsx"){let o=new Xn;try{let s=await AS.parse(r,{syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"});o.visitModule(s),t=o.calls}catch{return r.includes(e)}}else{let o=new Mt;o.visit(r,i),t=o.calls}if(t.has(e))return!0;for(let o of t){if(o===e)return!0;let s=o.split(/(?:\.|->|::)+/),a=s[s.length-1],c=e.split(/(?:\.|->|::)+/),l=c[c.length-1];if(a===l)return!0}return!1}catch{return!1}}async function By(n){let{repoPath:e,filePath:r,symbolName:i,depth:t=3,limit:o=50,offset:s=0}=n;await ee(e);let{exports:a,files:c,imports:l}=j.getInstance(e),u=r?a.findByNameAndFile(i,r):a.findByNameGlobal(i);if(u.length===0)return{content:[{type:"text",text:`Symbol "${i}" not found.`}],isError:!0};let p=[];for(let d of u){let m=l.findImpactDependents(d.file_path,`%${i}%`,t),f=[],h=new Set;for(let U of m){let C=gt.relative(e,U.consumer_path);if(h.has(C))continue;let A=`Imports ${U.imported_symbols}`,Z=await LS(U.consumer_path,d.name);Z?A+=" (\u2705 Verified Call)":A+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",h.add(C),f.push({type:"IMPORT",file:C,depth:U.depth,details:A,verified:Z})}let _=a.findRoutesByCapability(i);d.kind==="HTTP Route"&&_.push({name:d.name,file_path:d.file_path,signature:d.signature});for(let U of _){let A=U.name.split("/").filter(W=>W.length>3&&!W.includes("{")&&!W.includes("$")&&!W.includes("<")).sort((W,F)=>F.length-W.length)[0];if(!A||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(A.toLowerCase()))continue;let Z=c.findContentByToken(A,10);for(let W of Z){let F=gt.relative(e,W);!h.has(F)&&W!==d.file_path&&(h.add(F),f.push({type:"API_USAGE",file:F,depth:2,details:`Likely calls route ${U.name} (matched token '${A}')`,verified:!1}))}}let v=c.findContentByToken(i,20);for(let U of v){let C=gt.relative(e,U);!h.has(C)&&U!==d.file_path&&(h.add(C),f.push({type:"POTENTIAL_USAGE",file:C,depth:2,details:`Contains keyword '${i}' (Dynamic/Implicit usage)`,verified:!0}))}if(d.kind==="HTTP Route")try{let U=Wy();for(let C of U)try{let Z=(await import("os")).homedir(),W=gt.join(Z,".mcp-liquid-shadow","fused"),F=C.replace(/[^a-zA-Z0-9-_]/g,"_"),te=gt.join(W,`${F}.db`);if(!Id.existsSync(te))continue;let fe=(await import("better-sqlite3")).default,ue=new fe(te),he=ue.prepare("SELECT source_repo, source_file_path, relationship, metadata FROM virtual_edges WHERE target_repo = ? AND target_file_path = ? AND relationship = 'api_call'").all(e,d.file_path);ue.close();for(let ce of he){let G=gt.relative(ce.source_repo,ce.source_file_path),B=`${ce.source_repo}:${G}`;h.has(B)||(h.add(B),f.push({type:"CROSS_REPO_API_CALL",file:B,depth:1,details:`Cross-repo API call from ${gt.basename(ce.source_repo)}`,verified:!0}))}}catch{continue}}catch{}f.sort((U,C)=>U.verified&&!C.verified?-1:!U.verified&&C.verified?1:U.depth!==C.depth?U.depth-C.depth:U.file.localeCompare(C.file));let g=f.length,x=f.slice(s,s+o),I=s+o<g,O=(new le(e).getSnapshot().gravity?.hotspots||[]).find(U=>U.filePath===d.file_path&&U.symbol===d.name)?.gravity||0,V=g,k=f.filter(U=>U.type==="CROSS_REPO_API_CALL").length,D=O/50+V/15+k*2,H="LOW",L="Peripheral symbol with limited usage.";D>=8?(H="CRITICAL",L=`Core architectural pillar (Gravity: ${O}). Modification will destabilize ${V} dependents.`):D>=4?(H="HIGH",L=`High-gravity symbol with significant blast radius (${V} files).`):D>=1.5&&(H="MEDIUM",L="Standard library symbol with moderate dependency chain.");let Y={symbol:i,definedIn:gt.relative(e,d.file_path),riskScore:{score:Math.min(10,Math.round(D*10)/10),level:H,rationale:L},impact:x,pagination:{total:g,offset:s,limit:o,hasMore:I}};p.push(Y)}return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}Q();J();import Vy from"@swc/core";import Xr from"fs";import qe from"path";var CS=new Set(["api","v1","v2","v3","http","https","localhost","admin","internal","public","private","app","src","get","post","put","delete","patch","user","users","id","search","list","create","update","data"]);function Jy(n,e){let r=e,i=e.match(/\$\{([^}]+)\}/g);if(i)for(let u of i){let p=u.substring(2,u.length-1),d=n.configs.findEnvValue(p);d&&(r=r.replace(u,d))}let t=r.split("?")[0].split("#")[0];try{t.includes("://")&&(t=new URL(t).pathname)}catch{}t.length>1&&t.endsWith("/")&&(t=t.substring(0,t.length-1));let o=[],s=t.replace(/\*/g,"%").replace(/:[^/]+/g,"%").replace(/\{[^}]+\}/g,"%"),a=n.files.findSynapses({type:"api_route",name:s.includes("%")?s:t,direction:"consume",limit:10});for(let u of a){let p=u.name.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\*/g,"[^/]+");new RegExp(`^${p.replace(/\//g,"\\/")}$`).test(t.replace(/\*/g,"test-val"))&&o.push({file_path:u.file_path,start_line:u.line_number||0,signature:`[Synapse] ${u.name}`,score:1e3})}let c=t.split(/[^a-zA-Z0-9-_]/).filter(u=>u.length>=3&&!CS.has(u.toLowerCase())&&!/^\d+$/.test(u));if(c.length>0){let p=[...c].sort((m,f)=>f.length-m.length)[0],d=n.exports.findRoutesByToken(p,20);for(let m of d){let f=50,h=(m.signature||m.name||"").toLowerCase();(m.name||"").toLowerCase().includes(t.replace(/\*/g,"").toLowerCase())&&(f+=200);for(let v of c)h.includes(v.toLowerCase())&&(f+=20);o.push({file_path:m.file_path,start_line:m.start_line,signature:`[Boundary] ${m.signature||m.name}`,capabilities:m.capabilities||void 0,score:f})}}if(o.length<3){let u=c.map(p=>p.replace(/[^a-zA-Z0-9_]/g,"")).filter(p=>p.length>0).join(" AND ");if(u.length>0){let p=n.content.search(u);for(let d of p){let m=0,f=d.file_path.toLowerCase(),h=d.snippet.toLowerCase();(f.includes("route")||f.includes("controller"))&&(m+=10),(f.includes("src/api")||f.includes("services/api"))&&(m+=5),(h.includes("addroute")||h.includes("@get"))&&(m+=15),(h.includes("axios.")||h.includes("fetch("))&&(m-=10),(f.includes(".spec.")||f.includes(".test."))&&(m-=20),m>0&&o.push({file_path:d.file_path,start_line:0,signature:`[FTS Match] ${d.snippet.replace(/\n/g," ")}`,score:m})}}}let l=new Map;return o.sort((u,p)=>p.score-u.score).forEach(u=>{l.has(u.file_path)||l.set(u.file_path,u)}),Array.from(l.values()).slice(0,3)}var jS=4,Qr=50,MS=2,US=new Set(["push","pop","shift","unshift","slice","splice","map","filter","reduce","reduceRight","forEach","find","findIndex","includes","indexOf","lastIndexOf","every","some","flat","flatMap","fill","copyWithin","entries","keys","values","join","concat","sort","reverse","at","with","toSorted","toReversed","toSpliced","toString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","charAt","charCodeAt","codePointAt","split","substring","substr","trim","trimStart","trimEnd","padStart","padEnd","repeat","replace","replaceAll","match","matchAll","search","toLowerCase","toUpperCase","localeCompare","normalize","startsWith","endsWith","then","catch","finally","get","set","has","delete","clear","size","length","call","apply","bind"]);async function Gy(n){let{repoPath:e,filePath:r,symbolName:i}=je(n);if(!r)return{isError:!0,content:[{type:"text",text:"Error: 'filePath' is required."}]};let t=r;await ee(e);let o=j.getInstance(e);if(!Xr.existsSync(t))return{isError:!0,content:[{type:"text",text:`File not found: ${t}`}]};let s,a=qe.basename(t),c;if(i){let d=o.exports.findByNameAndFile(i,t);if(d.length>0){let m=d[0];s={start:m.start_line,end:m.end_line},a=m.name,c=m.start_line}}let l={type:s?"function":"file",name:a,path:qe.relative(e,t),line:c,children:[]},u=new Set;u.add(t+(i?`:${i}`:""));let p={count:0,truncated:!1};return await Qn(t,l,e,o,u,1,p,s),p.truncated&&l.children.push({type:"function",name:"\u26A0\uFE0F Output Truncated",details:`Trace limited to ${Qr} nodes. Use summarize_file on specific files for deeper analysis.`,children:[]}),{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}async function Qn(n,e,r,i,t,o,s,a){if(!(o>jS)){if(s.count>=Qr){s.truncated=!0;return}try{let c=Xr.readFileSync(n,"utf8"),l=qe.extname(n).toLowerCase(),p=(c.match(/import\s+[\s\S]*?from\s+['"].*?['"];?/gm)||[]).join(`
762
+ `).run(e.sourceRepo,e.sourceFilePath,e.sourceSymbolId||null,e.targetRepo,e.targetFilePath,e.targetSymbolId||null,e.relationship,e.metadata?JSON.stringify(e.metadata):null,e.confidence??1).lastInsertRowid}scanEdges(){return lk.info({name:this.connection.nameValue},"Starting edge scan"),sv(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}};var av=x.child({module:"fused-index"}),Od=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new Ws(e),this.service=new Hs(this.connection)}attachRepo(e){this.connection.attachRepo(e)}detachRepo(e){this.connection.detachRepo(e)}refreshRepo(e){this.connection.refreshRepo(e)}getAttachedRepos(){return this.connection.getAttachedRepos()}checkHealth(){return this.connection.checkHealth()}close(){this.connection.close(),av.info({name:this.configName},"Fused index closed")}getStatus(){let e=this.service.executeRawQuery("SELECT COUNT(*) as count FROM virtual_edges");return{name:this.connection.nameValue,path:this.connection.dbPath,attachedRepos:this.connection.getAttachedRepos().length,repos:this.connection.getAttachedRepos(),virtualEdgesCount:e[0]?.count||0}}searchExports(e,r=50){return this.service.searchExports(e,r)}searchFiles(e,r=50){return this.service.searchFiles(e,r)}getVirtualEdges(e,r){return this.service.getVirtualEdges(e,r)}addVirtualEdge(e){return this.service.addVirtualEdge(e)}scanEdges(){return this.service.scanEdges()}buildUnionQuery(e,r,i){return this.service.buildUnionQuery(e,r,i)}executeFederatedQuery(e,...r){return this.service.executeFederatedQuery(e,...r)}executeRawQuery(e,...r){return this.service.executeRawQuery(e,...r)}buildAdvancedQuery(e){return this.service.buildAdvancedQuery(e)}buildFtsQuery(e,r,i,t,o){return this.service.buildFtsQuery(e,r,i,t,o)}buildCrossRepoImportsQuery(){return this.service.buildCrossRepoImportsQuery()}refreshAll(){this.connection.refreshAll()}validateSchemas(){return av.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},Bs=new Map;function cv(n){let e=Bs.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>uk.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),Bs.delete(n.name)}let r=new Od(n);return Bs.set(n.name,r),r}function lv(){return Array.from(Bs.keys())}import{Visitor as pk}from"@swc/core/Visitor.js";var ir=class extends pk{calls=new Set;apiCalls=[];imports=new Map;axiosInstances=new Map([["axios",""],["http",""],["appApi",""],["restApi",""],["adminApi",""]]);visitImportDeclaration(e){let r=e.source.value;for(let i of e.specifiers)(i.type==="ImportDefaultSpecifier"||i.type==="ImportSpecifier")&&this.imports.set(i.local.value,r);return super.visitImportDeclaration(e)}visitCallExpression(e){if(e.callee.type==="Identifier"){let r=e.callee.value;this.calls.add(r),(r==="axios"||r==="http")&&e.arguments.length>0&&this.extractApiCallFromConfig(e.arguments[0].expression)}else if(e.callee.type==="MemberExpression"){let r=e.callee.property.value,i=o=>{if(!o)return"?";if(o.type==="Identifier")return o.value;if(o.type==="ThisExpression")return"this";if(o.type==="MemberExpression"){let s=i(o.object),a=o.property.value||"?";return`${s}.${a}`}return o.type==="TsNonNullExpression"||o.type==="TsAsExpression"||o.type==="ParenthesisExpression"?i(o.expression):"?"},t=i(e.callee.object);if(t!=="?"&&r){if(this.calls.add(`${t}.${r}`),t==="axios"||t==="http"||this.axiosInstances.has(t)){let o=this.axiosInstances.get(t)||"";this.extractApiCall(r,e.arguments,o)}if((t.toLowerCase().includes("pubsub")||t==="pubSubClient"||t.endsWith(".pubSubClient"))&&r!=="subscribe"){let o=r;if((r==="publish"||r==="publishMessage"||r==="publishTaskByNameAndPayload")&&e.arguments.length>0)for(let s of e.arguments){let a=s.expression;if(a.type==="ObjectExpression"){let c=a.properties.find(l=>l.key?.type==="Identifier"&&(l.key.value==="action"||l.key.value==="type")||l.key?.type==="StringLiteral"&&(l.key.value==="action"||l.key.value==="type"));if(c&&c.value?.type==="StringLiteral"){o=c.value.value;break}}if(a.type==="CallExpression"&&a.callee.type==="MemberExpression"&&a.callee.object.value==="JSON"&&a.callee.property.value==="stringify"&&a.arguments.length>0){let c=a.arguments[0].expression;if(c.type==="ObjectExpression"){let l=c.properties.find(u=>u.key?.type==="Identifier"&&(u.key.value==="action"||u.key.value==="type")||u.key?.type==="StringLiteral"&&(u.key.value==="action"||u.key.value==="type"));if(l&&l.value?.type==="StringLiteral"){o=l.value.value;break}}}}this.apiCalls.push({method:"PUBSUB",url:o})}}}return e.callee.type==="Identifier"&&e.callee.value==="fetch"&&this.extractApiCall("GET",e.arguments),super.visitCallExpression(e)}visitNewExpression(e){return e.callee.type==="Identifier"&&this.calls.add(e.callee.value),super.visitNewExpression(e)}visitVariableDeclarator(e){if(e.init&&e.init.type==="CallExpression"){let r=e.init.callee;if(r.type==="MemberExpression"&&r.property.value==="create"&&r.object.value==="axios"){let t=e.init.arguments[0]?.expression;if(t&&t.type==="ObjectExpression"){let o=t.properties.find(s=>s.key.value==="baseURL");if(o){let s="?";o.value.type==="StringLiteral"?s=o.value.value:o.value.type==="Identifier"&&(s=`\${${o.value.value}}`),e.id.type==="Identifier"&&this.axiosInstances.set(e.id.value,s)}}}}return super.visitVariableDeclarator(e)}extractApiCallFromConfig(e){if(e&&e.type==="ObjectExpression"){let r=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="url"||t.key.type==="StringLiteral"&&t.key.value==="url"),i=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="method"||t.key.type==="StringLiteral"&&t.key.value==="method");if(r&&r.value){let t=i?.value?.value||"GET",o=this.resolveUrlValue(r.value);o!=="?"&&this.apiCalls.push({method:t.toUpperCase(),url:o})}}}resolveUrlValue(e){return e.type==="StringLiteral"?e.value:e.type==="TemplateLiteral"?e.quasis.map(r=>r.cooked).join("*"):"?"}visitTsType(e){return e}extractApiCall(e,r,i=""){if(r.length>0){let t=r[0].expression,o=this.resolveUrlValue(t);if(o!=="?"){if(i&&i!=="?"){let s=i.endsWith("/")||o.startsWith("/")?"":"/";o=`${i}${s}${o}`}this.apiCalls.push({method:e.toUpperCase(),url:o})}}}},Ft=class{calls=new Set;apiCalls=[];imports=new Map;visit(e,r){if(r===".php"){let i=/(?:([a-zA-Z0-9_$->:\(\)]*)?(?:->|::))?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&!["$this","self","parent"].includes(o)&&this.calls.add(`${o}${o.includes("::")?"::":"->"}${s}`),["save","delete","update","create","first","all","where","get","find"].includes(s)&&o&&!["Log","Route","Cache","Config","Http"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}->${s}()`}),s==="publish"&&o&&(o.includes("topic")||o.includes("pubSub"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="Http"||o==="client"||o.endsWith("request")||o.includes("Client")||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if(r===".py"){let i=/(?:([a-zA-Z0-9_\.]+)\.)?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&o!=="self"&&o!=="cls"&&this.calls.add(`${o}.${s}`),["save","delete","update","create","first","all","filter","get"].includes(s)&&o&&!["logger","os","sys"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}.${s}()`}),s==="publish"&&o&&(o.includes("publisher")||o.includes("client"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="requests"||o==="httpx"||o==="client"||o==="http"||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if([".ts",".tsx",".js",".jsx"].includes(r)){let i=/import\s+[\s\S]*?from\s+['"](.*?)['"];?/g,t;for(;(t=i.exec(e))!==null;)this.imports.set("*",t[1]);let o=/(?:([a-zA-Z0-9_$]+)\.)?([a-zA-Z0-9_$]+)\s*\(/g,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=s[2];a?(this.calls.add(`${a}.${c}`),(a.toLowerCase().includes("pubsub")||a==="pubSubClient")&&c!=="subscribe"&&this.apiCalls.push({method:"PUBSUB",url:c})):this.calls.add(c)}}else{let i=/\.([a-zA-Z0-9_]+)\s*\(/g,t;for(;(t=i.exec(e))!==null;)this.calls.add(t[1])}if(r===".php"){let i=/use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/g,t;for(;(t=i.exec(e))!==null;){let o=t[1],s=o.split("\\"),a=t[2]||s[s.length-1];this.imports.set(a,o)}}else if(r===".py"){let i=/from\s+([a-zA-Z0-9_\.]+)\s+import\s+([a-zA-Z0-9_,\s]+)/g,t;for(;(t=i.exec(e))!==null;){let a=t[1];t[2].split(",").map(l=>l.trim()).forEach(l=>{this.imports.set(l,a)})}let o=/^import\s+([a-zA-Z0-9_\.]+)/gm,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=a.split("."),l=c[c.length-1];this.imports.set(l,a)}}}};Ge();import dk from"@swc/core";async function mk(n,e){try{if(!Ld.existsSync(n))return!1;let r=Ld.readFileSync(n,"utf8"),i=vt.extname(n).toLowerCase(),t=new Set;if(i===".ts"||i===".tsx"||i===".js"||i===".jsx"){let o=new ir;try{let s=await dk.parse(r,{syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"});o.visitModule(s),t=o.calls}catch{return r.includes(e)}}else{let o=new Ft;o.visit(r,i),t=o.calls}if(t.has(e))return!0;for(let o of t){if(o===e)return!0;let s=o.split(/(?:\.|->|::)+/),a=s[s.length-1],c=e.split(/(?:\.|->|::)+/),l=c[c.length-1];if(a===l)return!0}return!1}catch{return!1}}async function uv(n){let{repoPath:e,filePath:r,symbolName:i,depth:t=3,limit:o=50,offset:s=0}=n;await re(e);let{exports:a,files:c,imports:l}=A.getInstance(e),u=r?a.findByNameAndFile(i,r):a.findByNameGlobal(i);if(u.length===0)return{content:[{type:"text",text:`Symbol "${i}" not found.`}],isError:!0};let p=[];for(let d of u){let m=l.findImpactDependents(d.file_path,`%${i}%`,t),f=[],h=new Set;for(let I of m){let C=vt.relative(e,I.consumer_path);if(h.has(C))continue;let U=`Imports ${I.imported_symbols}`,M=await mk(I.consumer_path,d.name);M?U+=" (\u2705 Verified Call)":U+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",h.add(C),f.push({type:"IMPORT",file:C,depth:I.depth,details:U,verified:M})}let _=a.findRoutesByCapability(i);d.kind==="HTTP Route"&&_.push({name:d.name,file_path:d.file_path,signature:d.signature});for(let I of _){let U=I.name.split("/").filter(L=>L.length>3&&!L.includes("{")&&!L.includes("$")&&!L.includes("<")).sort((L,Z)=>Z.length-L.length)[0];if(!U||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(U.toLowerCase()))continue;let M=c.findContentByToken(U,10);for(let L of M){let Z=vt.relative(e,L);!h.has(Z)&&L!==d.file_path&&(h.add(Z),f.push({type:"API_USAGE",file:Z,depth:2,details:`Likely calls route ${I.name} (matched token '${U}')`,verified:!1}))}}let v=c.findContentByToken(i,20);for(let I of v){let C=vt.relative(e,I);!h.has(C)&&I!==d.file_path&&(h.add(C),f.push({type:"POTENTIAL_USAGE",file:C,depth:2,details:`Contains keyword '${i}' (Dynamic/Implicit usage)`,verified:!0}))}if(d.kind==="HTTP Route")try{let I=lv();for(let C of I)try{let M=(await import("os")).homedir(),L=vt.join(M,".mcp-liquid-shadow","fused"),Z=C.replace(/[^a-zA-Z0-9-_]/g,"_"),ee=vt.join(L,`${Z}.db`);if(!Ld.existsSync(ee))continue;let ce=(await import("better-sqlite3")).default,ne=new ce(ee),oe=ne.prepare("SELECT source_repo, source_file_path, relationship, metadata FROM virtual_edges WHERE target_repo = ? AND target_file_path = ? AND relationship = 'api_call'").all(e,d.file_path);ne.close();for(let G of oe){let W=vt.relative(G.source_repo,G.source_file_path),H=`${G.source_repo}:${W}`;h.has(H)||(h.add(H),f.push({type:"CROSS_REPO_API_CALL",file:H,depth:1,details:`Cross-repo API call from ${vt.basename(G.source_repo)}`,verified:!0}))}}catch{continue}}catch{}f.sort((I,C)=>I.verified&&!C.verified?-1:!I.verified&&C.verified?1:I.depth!==C.depth?I.depth-C.depth:I.file.localeCompare(C.file));let g=f.length,b=f.slice(s,s+o),S=s+o<g,j=(new de(e).getSnapshot().gravity?.hotspots||[]).find(I=>I.filePath===d.file_path&&I.symbol===d.name)?.gravity||0,B=g,T=f.filter(I=>I.type==="CROSS_REPO_API_CALL").length,O=j/50+B/15+T*2,J="LOW",V="Peripheral symbol with limited usage.";O>=8?(J="CRITICAL",V=`Core architectural pillar (Gravity: ${j}). Modification will destabilize ${B} dependents.`):O>=4?(J="HIGH",V=`High-gravity symbol with significant blast radius (${B} files).`):O>=1.5&&(J="MEDIUM",V="Standard library symbol with moderate dependency chain.");let q={symbol:i,definedIn:vt.relative(e,d.file_path),riskScore:{score:Math.min(10,Math.round(O*10)/10),level:J,rationale:V},impact:b,pagination:{total:g,offset:s,limit:o,hasMore:S}};p.push(q)}return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}te();K();import dv from"@swc/core";import ai from"fs";import Ye from"path";var fk=new Set(["api","v1","v2","v3","http","https","localhost","admin","internal","public","private","app","src","get","post","put","delete","patch","user","users","id","search","list","create","update","data"]);function pv(n,e){let r=e,i=e.match(/\$\{([^}]+)\}/g);if(i)for(let u of i){let p=u.substring(2,u.length-1),d=n.configs.findEnvValue(p);d&&(r=r.replace(u,d))}let t=r.split("?")[0].split("#")[0];try{t.includes("://")&&(t=new URL(t).pathname)}catch{}t.length>1&&t.endsWith("/")&&(t=t.substring(0,t.length-1));let o=[],s=t.replace(/\*/g,"%").replace(/:[^/]+/g,"%").replace(/\{[^}]+\}/g,"%"),a=n.files.findSynapses({type:"api_route",name:s.includes("%")?s:t,direction:"consume",limit:10});for(let u of a){let p=u.name.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\*/g,"[^/]+");new RegExp(`^${p.replace(/\//g,"\\/")}$`).test(t.replace(/\*/g,"test-val"))&&o.push({file_path:u.file_path,start_line:u.line_number||0,signature:`[Synapse] ${u.name}`,score:1e3})}let c=t.split(/[^a-zA-Z0-9-_]/).filter(u=>u.length>=3&&!fk.has(u.toLowerCase())&&!/^\d+$/.test(u));if(c.length>0){let p=[...c].sort((m,f)=>f.length-m.length)[0],d=n.exports.findRoutesByToken(p,20);for(let m of d){let f=50,h=(m.signature||m.name||"").toLowerCase();(m.name||"").toLowerCase().includes(t.replace(/\*/g,"").toLowerCase())&&(f+=200);for(let v of c)h.includes(v.toLowerCase())&&(f+=20);o.push({file_path:m.file_path,start_line:m.start_line,signature:`[Boundary] ${m.signature||m.name}`,capabilities:m.capabilities||void 0,score:f})}}if(o.length<3){let u=c.map(p=>p.replace(/[^a-zA-Z0-9_]/g,"")).filter(p=>p.length>0).join(" AND ");if(u.length>0){let p=n.content.search(u);for(let d of p){let m=0,f=d.file_path.toLowerCase(),h=d.snippet.toLowerCase();(f.includes("route")||f.includes("controller"))&&(m+=10),(f.includes("src/api")||f.includes("services/api"))&&(m+=5),(h.includes("addroute")||h.includes("@get"))&&(m+=15),(h.includes("axios.")||h.includes("fetch("))&&(m-=10),(f.includes(".spec.")||f.includes(".test."))&&(m-=20),m>0&&o.push({file_path:d.file_path,start_line:0,signature:`[FTS Match] ${d.snippet.replace(/\n/g," ")}`,score:m})}}}let l=new Map;return o.sort((u,p)=>p.score-u.score).forEach(u=>{l.has(u.file_path)||l.set(u.file_path,u)}),Array.from(l.values()).slice(0,3)}var hk=4,ci=50,gk=2,yk=new Set(["push","pop","shift","unshift","slice","splice","map","filter","reduce","reduceRight","forEach","find","findIndex","includes","indexOf","lastIndexOf","every","some","flat","flatMap","fill","copyWithin","entries","keys","values","join","concat","sort","reverse","at","with","toSorted","toReversed","toSpliced","toString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","charAt","charCodeAt","codePointAt","split","substring","substr","trim","trimStart","trimEnd","padStart","padEnd","repeat","replace","replaceAll","match","matchAll","search","toLowerCase","toUpperCase","localeCompare","normalize","startsWith","endsWith","then","catch","finally","get","set","has","delete","clear","size","length","call","apply","bind"]);async function mv(n){let{repoPath:e,filePath:r,symbolName:i}=Me(n);if(!r)return{isError:!0,content:[{type:"text",text:"Error: 'filePath' is required."}]};let t=r;await re(e);let o=A.getInstance(e);if(!ai.existsSync(t))return{isError:!0,content:[{type:"text",text:`File not found: ${t}`}]};let s,a=Ye.basename(t),c;if(i){let d=o.exports.findByNameAndFile(i,t);if(d.length>0){let m=d[0];s={start:m.start_line,end:m.end_line},a=m.name,c=m.start_line}}let l={type:s?"function":"file",name:a,path:Ye.relative(e,t),line:c,children:[]},u=new Set;u.add(t+(i?`:${i}`:""));let p={count:0,truncated:!1};return await or(t,l,e,o,u,1,p,s),p.truncated&&l.children.push({type:"function",name:"\u26A0\uFE0F Output Truncated",details:`Trace limited to ${ci} nodes. Use summarize_file on specific files for deeper analysis.`,children:[]}),{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}async function or(n,e,r,i,t,o,s,a){if(!(o>hk)){if(s.count>=ci){s.truncated=!0;return}try{let c=ai.readFileSync(n,"utf8"),l=Ye.extname(n).toLowerCase(),p=(c.match(/import\s+[\s\S]*?from\s+['"].*?['"];?/gm)||[]).join(`
735
763
  `);a&&(c=c.split(`
736
764
  `).slice(a.start-1,a.end).join(`
737
- `));let d;if(l===".ts"||l===".tsx"||l===".js"||l===".jsx"){d=new Xn;let _={syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"};try{let v=a?`${p}
738
- ${c}`:c,g=await Vy.parse(v,_);d.visitModule(g)}catch{if(a)try{let g=`${p}
765
+ `));let d;if(l===".ts"||l===".tsx"||l===".js"||l===".jsx"){d=new ir;let _={syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"};try{let v=a?`${p}
766
+ ${c}`:c,g=await dv.parse(v,_);d.visitModule(g)}catch{if(a)try{let g=`${p}
739
767
  class TraceContext {
740
768
  ${c}
741
- }`,x=await Vy.parse(g,_);d.visitModule(x)}catch{let x=new Mt,I=l;x.visit(c,I),d.calls=x.calls,d.apiCalls=x.apiCalls,d.imports=x.imports}else{let g=new Mt;g.visit(c,l),d.calls=g.calls,d.apiCalls=g.apiCalls,d.imports=g.imports}}}else d=new Mt,d.visit(c,l);$.info({file:qe.basename(n),calls:d.calls.size,apiCalls:d.apiCalls.length,depth:o},"Analyzed file");let m=d.apiCalls.slice(0,10);for(let _ of m){if(s.count>=Qr)break;if(s.count++,_.method==="PUBSUB"){let I={type:"event_trigger",name:`PubSub Event: ${_.url}`,details:"Detected via PubSub client usage",children:[]};e.children.push(I);let E=i.exports.findByNameGlobal(_.url).concat(i.exports.findByMethodName(_.url));if(_.url.length>10){let T=_.url.replace(/To[A-Z][a-zA-Z]+$/,"");if(T!==_.url){let O=i.exports.findByNameGlobal(T).concat(i.exports.findByMethodName(T));E.push(...O)}}let w=new Set;for(let T of E){if(w.has(T.file_path)||T.file_path===n)continue;if(w.add(T.file_path),s.count>=Qr)break;s.count++;let O={type:"subscriber",name:`${T.name} (${qe.basename(T.file_path)})`,path:qe.relative(r,T.file_path),line:T.start_line,details:"Potential Subscriber / Handler",children:[]};I.children.push(O),Xr.existsSync(T.file_path)&&!t.has(T.file_path)&&(t.add(T.file_path),await Qn(T.file_path,O,r,i,t,o+1,s))}continue}let v={type:"api_call",name:`${_.method} ${_.url}`,details:"Detected via string literal analysis",children:[]};e.children.push(v);let x=Jy(i,_.url).slice(0,MS);for(let I of x){if(s.count>=Qr)break;s.count++;let E={type:"route",name:I.signature||"Route Handler",path:I.file_path,line:I.start_line,children:[]};if(v.children.push(E),Xr.existsSync(I.file_path)&&!t.has(I.file_path)&&(t.add(I.file_path),await Qn(I.file_path,E,r,i,t,o+1,s)),I.capabilities)try{let w=JSON.parse(I.capabilities);if(w.handler){let[T,O]=w.handler.split("@");if(T){let k=T.split("\\").pop();if(k){let D=i.exports.findClassByName(k);if(D){let H=i.exports.findByNameAndFile(O||"",D.file_path),L,Y=D.start_line;H.length>0&&(L={start:H[0].start_line,end:H[0].end_line},Y=H[0].start_line);let U={type:"component",name:`${k}${O?" :: "+O:""}`,path:qe.relative(r,D.file_path),line:Y,details:"Controller Logic (Macro IR)",children:[]};E.children.push(U),t.has(D.file_path+(O?`:${O}`:""))||(t.add(D.file_path+(O?`:${O}`:"")),await Qn(D.file_path,U,r,i,t,o+1,s,L))}}}}}catch{}}}let f=d.calls,h=Array.from(f).sort();for(let _ of h)if(d.imports.has(_)){let v=d.imports.get(_);if(!v.startsWith(".")){if(["react","react-dom"].includes(v))continue;e.children.push({type:"function",name:_,details:`External: ${v}`,children:[]});continue}let g=Jr(v,n,r);if(g&&Xr.existsSync(g))if(t.has(g))e.children.push({type:"function",name:_,details:"Circular / Already Visited",path:qe.relative(r,g),children:[]});else{t.add(g);let x={type:"file",name:_,details:`Imported from ${qe.basename(g)}`,path:qe.relative(r,g),children:[]};e.children.push(x),await Qn(g,x,r,i,t,o+1,s)}}else if(!["log","info","error","warn","print"].includes(_)){let v=i.exports.findByNameGlobal(_);if(v.length===0){let g=_.split(/(?:\.|->|::)+/);if(g.length>1){let x=g[g.length-1];US.has(x)||(v=i.exports.findByMethodName(x))}}if(v.length>0){let g=v.find(I=>I.file_path===n),x=g||(v.length===1?v[0]:null);if(x){let I=`${x.file_path}:${x.name}`;if(!t.has(I)){t.add(I);let E={type:"component",name:_,details:`Resolved via global index${g?" (local)":""}`,path:qe.relative(r,x.file_path),line:x.start_line,children:[]};e.children.push(E),await Qn(x.file_path,E,r,i,t,o+1,s,{start:x.start_line,end:x.end_line})}}}}}catch(c){$.error({filePath:n,error:c.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:c.message,children:[]})}}}Q();import qy from"path";async function Yy(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await ee(e);let{imports:s}=j.getInstance(e);if(i==="imports"){let c=s.findByFile(r).map(d=>{let m={module:d.module_specifier,symbols:d.imported_symbols,resolvedPath:d.resolved_path,relativePath:d.resolved_path?qy.relative(e,d.resolved_path):null,isExternal:!d.resolved_path};if(!d.resolved_path){let f=fd(d.module_specifier,r,e);if(!f.resolved)return{...m,resolutionError:f.error,suggestion:f.suggestion}}return m}),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:Ky(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}else{let c=s.findDependents(r).map(d=>({file:d.file_path,relativePath:qy.relative(e,d.file_path),importStatement:d.module_specifier,importedSymbols:d.imported_symbols})),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:Ky(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}}function Ky(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}Q();import Xy from"path";import FS from"fs";async function Qy(n){let{repoPath:e,mode:r,limit:i=50,includeMigrations:t=!1,includeFixtures:o=!1,excludePatterns:s=[],confidenceThreshold:a="all"}=n;await ee(e);let{exports:c,imports:l}=j.getInstance(e);if(r==="dead-code"){let d=c.findDeadExports({limit:i,includeTests:!0,includeMigrations:t,includeFixtures:o,excludePatterns:s,confidenceThreshold:a}).map(g=>({name:g.name,kind:g.kind,file:Xy.relative(e,g.file_path),line:g.start_line,confidence:g.confidence,reason:g.reason})),m={high:{},medium:{},low:{}};for(let g of d)m[g.confidence][g.file]||(m[g.confidence][g.file]=[]),m[g.confidence][g.file].push({name:g.name,kind:g.kind,line:g.line,reason:g.reason});let f=[],h=Object.values(m.high).flat().length,_=Object.values(m.medium).flat().length,v=Object.values(m.low).flat().length;return f.push(`# Dead Export Analysis
769
+ }`,b=await dv.parse(g,_);d.visitModule(b)}catch{let b=new Ft,S=l;b.visit(c,S),d.calls=b.calls,d.apiCalls=b.apiCalls,d.imports=b.imports}else{let g=new Ft;g.visit(c,l),d.calls=g.calls,d.apiCalls=g.apiCalls,d.imports=g.imports}}}else d=new Ft,d.visit(c,l);x.info({file:Ye.basename(n),calls:d.calls.size,apiCalls:d.apiCalls.length,depth:o},"Analyzed file");let m=d.apiCalls.slice(0,10);for(let _ of m){if(s.count>=ci)break;if(s.count++,_.method==="PUBSUB"){let S={type:"event_trigger",name:`PubSub Event: ${_.url}`,details:"Detected via PubSub client usage",children:[]};e.children.push(S);let k=i.exports.findByNameGlobal(_.url).concat(i.exports.findByMethodName(_.url));if(_.url.length>10){let R=_.url.replace(/To[A-Z][a-zA-Z]+$/,"");if(R!==_.url){let j=i.exports.findByNameGlobal(R).concat(i.exports.findByMethodName(R));k.push(...j)}}let w=new Set;for(let R of k){if(w.has(R.file_path)||R.file_path===n)continue;if(w.add(R.file_path),s.count>=ci)break;s.count++;let j={type:"subscriber",name:`${R.name} (${Ye.basename(R.file_path)})`,path:Ye.relative(r,R.file_path),line:R.start_line,details:"Potential Subscriber / Handler",children:[]};S.children.push(j),ai.existsSync(R.file_path)&&!t.has(R.file_path)&&(t.add(R.file_path),await or(R.file_path,j,r,i,t,o+1,s))}continue}let v={type:"api_call",name:`${_.method} ${_.url}`,details:"Detected via string literal analysis",children:[]};e.children.push(v);let b=pv(i,_.url).slice(0,gk);for(let S of b){if(s.count>=ci)break;s.count++;let k={type:"route",name:S.signature||"Route Handler",path:S.file_path,line:S.start_line,children:[]};if(v.children.push(k),ai.existsSync(S.file_path)&&!t.has(S.file_path)&&(t.add(S.file_path),await or(S.file_path,k,r,i,t,o+1,s)),S.capabilities)try{let w=JSON.parse(S.capabilities);if(w.handler){let[R,j]=w.handler.split("@");if(R){let T=R.split("\\").pop();if(T){let O=i.exports.findClassByName(T);if(O){let J=i.exports.findByNameAndFile(j||"",O.file_path),V,q=O.start_line;J.length>0&&(V={start:J[0].start_line,end:J[0].end_line},q=J[0].start_line);let I={type:"component",name:`${T}${j?" :: "+j:""}`,path:Ye.relative(r,O.file_path),line:q,details:"Controller Logic (Macro IR)",children:[]};k.children.push(I),t.has(O.file_path+(j?`:${j}`:""))||(t.add(O.file_path+(j?`:${j}`:"")),await or(O.file_path,I,r,i,t,o+1,s,V))}}}}}catch{}}}let f=d.calls,h=Array.from(f).sort();for(let _ of h)if(d.imports.has(_)){let v=d.imports.get(_);if(!v.startsWith(".")){if(["react","react-dom"].includes(v))continue;e.children.push({type:"function",name:_,details:`External: ${v}`,children:[]});continue}let g=cn(v,n,r);if(g&&ai.existsSync(g))if(t.has(g))e.children.push({type:"function",name:_,details:"Circular / Already Visited",path:Ye.relative(r,g),children:[]});else{t.add(g);let b={type:"file",name:_,details:`Imported from ${Ye.basename(g)}`,path:Ye.relative(r,g),children:[]};e.children.push(b),await or(g,b,r,i,t,o+1,s)}}else if(!["log","info","error","warn","print"].includes(_)){let v=i.exports.findByNameGlobal(_);if(v.length===0){let g=_.split(/(?:\.|->|::)+/);if(g.length>1){let b=g[g.length-1];yk.has(b)||(v=i.exports.findByMethodName(b))}}if(v.length>0){let g=v.find(S=>S.file_path===n),b=g||(v.length===1?v[0]:null);if(b){let S=`${b.file_path}:${b.name}`;if(!t.has(S)){t.add(S);let k={type:"component",name:_,details:`Resolved via global index${g?" (local)":""}`,path:Ye.relative(r,b.file_path),line:b.start_line,children:[]};e.children.push(k),await or(b.file_path,k,r,i,t,o+1,s,{start:b.start_line,end:b.end_line})}}}}}catch(c){x.error({filePath:n,error:c.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:c.message,children:[]})}}}te();import fv from"path";async function gv(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await re(e);let{imports:s}=A.getInstance(e);if(i==="imports"){let c=s.findByFile(r).map(d=>{let m={module:d.module_specifier,symbols:d.imported_symbols,resolvedPath:d.resolved_path,relativePath:d.resolved_path?fv.relative(e,d.resolved_path):null,isExternal:!d.resolved_path};if(!d.resolved_path){let f=Ed(d.module_specifier,r,e);if(!f.resolved)return{...m,resolutionError:f.error,suggestion:f.suggestion}}return m}),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:hv(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}else{let c=s.findDependents(r).map(d=>({file:d.file_path,relativePath:fv.relative(e,d.file_path),importStatement:d.module_specifier,importedSymbols:d.imported_symbols})),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:hv(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}}function hv(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}te();import yv from"path";import vk from"fs";async function vv(n){let{repoPath:e,mode:r,limit:i=50,includeMigrations:t=!1,includeFixtures:o=!1,excludePatterns:s=[],confidenceThreshold:a="all"}=n;await re(e);let{exports:c,imports:l}=A.getInstance(e);if(r==="dead-code"){let d=c.findDeadExports({limit:i,includeTests:!0,includeMigrations:t,includeFixtures:o,excludePatterns:s,confidenceThreshold:a}).map(g=>({name:g.name,kind:g.kind,file:yv.relative(e,g.file_path),line:g.start_line,confidence:g.confidence,reason:g.reason})),m={high:{},medium:{},low:{}};for(let g of d)m[g.confidence][g.file]||(m[g.confidence][g.file]=[]),m[g.confidence][g.file].push({name:g.name,kind:g.kind,line:g.line,reason:g.reason});let f=[],h=Object.values(m.high).flat().length,_=Object.values(m.medium).flat().length,v=Object.values(m.low).flat().length;return f.push(`# Dead Export Analysis
742
770
  `),f.push(`Found ${d.length} potentially unused exports.`),f.push(`- **High confidence** (likely dead): ${h}`),f.push(`- **Medium confidence** (possibly intentional): ${_}`),f.push(`- **Low confidence** (likely intentional): ${v}
743
771
  `),h>0&&(f.push(`## High Confidence (Likely Dead)
744
772
  `),f.push(JSON.stringify(m.high,null,2))),_>0&&a!=="high"&&(f.push(`
@@ -746,12 +774,12 @@ ${c}
746
774
  `),f.push(JSON.stringify(m.medium,null,2))),v>0&&a==="all"&&(f.push(`
747
775
  ## Low Confidence (Likely Intentional)
748
776
  `),f.push(JSON.stringify(m.low,null,2))),{content:[{type:"text",text:f.join(`
749
- `)}]}}else if(r==="circular-deps"){let v=function(E,w){if(f.length>=p)return!1;h.add(E),_.add(E),w.push(E);let T=m.get(E)||new Set;for(let O of T)if(h.has(O)){if(_.has(O)){let V=w.indexOf(O);if(V>=0){let k=w.slice(V);k.push(O),f.push(k)}}}else if(v(O,[...w]))return!0;return _.delete(E),!1};var u=v;let p=typeof i=="number"?i:20,d=l.getAllResolved(),m=new Map;for(let E of d)m.has(E.file_path)||m.set(E.file_path,new Set),m.get(E.file_path).add(E.resolved_path);let f=[],h=new Set,_=new Set;for(let E of m.keys())!h.has(E)&&f.length<p&&v(E,[]);let g=[],x=new Map;for(let E of d){let w=`${E.file_path}|${E.resolved_path}`;x.has(w)||x.set(w,[]),x.get(w).push(E)}for(let E of f){let w=!1;for(let T=0;T<E.length-1;T++){let O=E[T],V=E[T+1],k=x.get(`${O}|${V}`);if(k){for(let D of k)try{let H=FS.readFileSync(O,"utf8"),L=D.module_specifier.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Y=new RegExp(`import\\s+type\\s+.*from\\s+['"]${L}['"]`,"i"),U=new RegExp(`import\\s+\\{.*type\\s+.*\\}.*from\\s+['"]${L}['"]`,"s");if(Y.test(H)||U.test(H)){w=!0;break}let C=D.imported_symbols.split(",").map(A=>A.trim());for(let A of C){if(!A||A==="*")continue;let Z=A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\(\\s*\\)\\s*=>\\s*${Z}`).test(H)){w=!0;break}}}catch{}if(w)break}}w||g.push(E)}let I=g.map((E,w)=>({id:w+1,length:E.length-1,chain:E.map(T=>Xy.relative(e,T))}));return{content:[{type:"text",text:`# Circular Dependency Analysis
777
+ `)}]}}else if(r==="circular-deps"){let v=function(k,w){if(f.length>=p)return!1;h.add(k),_.add(k),w.push(k);let R=m.get(k)||new Set;for(let j of R)if(h.has(j)){if(_.has(j)){let B=w.indexOf(j);if(B>=0){let T=w.slice(B);T.push(j),f.push(T)}}}else if(v(j,[...w]))return!0;return _.delete(k),!1};var u=v;let p=typeof i=="number"?i:20,d=l.getAllResolved(),m=new Map;for(let k of d)m.has(k.file_path)||m.set(k.file_path,new Set),m.get(k.file_path).add(k.resolved_path);let f=[],h=new Set,_=new Set;for(let k of m.keys())!h.has(k)&&f.length<p&&v(k,[]);let g=[],b=new Map;for(let k of d){let w=`${k.file_path}|${k.resolved_path}`;b.has(w)||b.set(w,[]),b.get(w).push(k)}for(let k of f){let w=!1;for(let R=0;R<k.length-1;R++){let j=k[R],B=k[R+1],T=b.get(`${j}|${B}`);if(T){for(let O of T)try{let J=vk.readFileSync(j,"utf8"),V=O.module_specifier.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),q=new RegExp(`import\\s+type\\s+.*from\\s+['"]${V}['"]`,"i"),I=new RegExp(`import\\s+\\{.*type\\s+.*\\}.*from\\s+['"]${V}['"]`,"s");if(q.test(J)||I.test(J)){w=!0;break}let C=O.imported_symbols.split(",").map(U=>U.trim());for(let U of C){if(!U||U==="*")continue;let M=U.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\(\\s*\\)\\s*=>\\s*${M}`).test(J)){w=!0;break}}}catch{}if(w)break}}w||g.push(k)}let S=g.map((k,w)=>({id:w+1,length:k.length-1,chain:k.map(R=>yv.relative(e,R))}));return{content:[{type:"text",text:`# Circular Dependency Analysis
750
778
 
751
779
  Found ${g.length} circular dependency chain(s).
752
780
 
753
- ${JSON.stringify(I,null,2)}`}]}}return{isError:!0,content:[{type:"text",text:"Invalid mode"}]}}async function ev(n){let{repoPath:e,subPath:r,maxDepth:i=5}=n,t=5e4,o=[{level:"signatures",depth:i},{level:"summaries",depth:i,meta:{warning:"Export lists omitted for token efficiency.",action:"Use 'shadow_inspect_file' on specific files to see exports."}},{level:"structure",depth:i,meta:{warning:"Detailed signatures omitted due to repo size.",action:"Use 'shadow_inspect_file' on specific files to see details."}},{level:"summaries",depth:2,meta:{warning:"Repository is large. Showing top 2 levels with summaries only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore deeper."}},{level:"structure",depth:2,meta:{warning:"Repository is large. Showing top 2 levels structure only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}},{level:"lite",depth:1,meta:{warning:"Repository is massive. Showing root files only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}}];for(let s of o){let a=await xd(e,5,s.level,r,s.depth);s.meta&&(a._meta=s.meta);let c=JSON.stringify(a,null,2);if(c.length<=t)return{content:[{type:"text",text:c}]}}return{content:[{type:"text",text:`Warning: The repository at ${r||"root"} is massive (exceeds ${t} chars even at minimal depth).
754
- Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_search_symbol' to find what you need.`}]}}Be();async function tv(n){let{repoPath:e,compact:r=!1}=n,t=new le(e).getSnapshot();if(r&&t.gravity?.hotspots){let o=t.gravity.hotspots.length;t={...t,gravity:{...t.gravity,hotspots:t.gravity.hotspots.slice(0,20),_truncated:o>20,_totalHotspots:o}}}return{content:[{type:"text",text:JSON.stringify(t,null,2)}],suggestedNext:{tool:"shadow_ops_chronicle",reason:"Recent decisions and ADRs"}}}Q();Xt();Be();function nv(n){switch(n){case"Entry":return"\u{1F6AA}";case"Logic":return"\u2699\uFE0F";case"Data":return"\u{1F4BE}";case"Utility":return"\u{1F527}";case"Infrastructure":return"\u{1F3D7}\uFE0F";case"Test":return"\u{1F9EA}";case"Types":return"\u{1F4DD}";case"Unknown":return"\u2753"}}async function rv(n){let{repoPath:e}=n;await ee(e);let r=j.getInstance(e),i=rt(r,e);new le(e).updateTopography(i);let o=["Entry","Logic","Data","Utility","Infrastructure","Test","Types","Unknown"],s=`# \u{1F3D7}\uFE0F Architecture Summary
781
+ ${JSON.stringify(S,null,2)}`}]}}return{isError:!0,content:[{type:"text",text:"Invalid mode"}]}}async function _v(n){let{repoPath:e,subPath:r,maxDepth:i=5}=n,t=5e4,o=[{level:"signatures",depth:i},{level:"summaries",depth:i,meta:{warning:"Export lists omitted for token efficiency.",action:"Use 'shadow_inspect_file' on specific files to see exports."}},{level:"structure",depth:i,meta:{warning:"Detailed signatures omitted due to repo size.",action:"Use 'shadow_inspect_file' on specific files to see details."}},{level:"summaries",depth:2,meta:{warning:"Repository is large. Showing top 2 levels with summaries only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore deeper."}},{level:"structure",depth:2,meta:{warning:"Repository is large. Showing top 2 levels structure only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}},{level:"lite",depth:1,meta:{warning:"Repository is massive. Showing root files only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}}];for(let s of o){let a=await Rd(e,5,s.level,r,s.depth);s.meta&&(a._meta=s.meta);let c=JSON.stringify(a,null,2);if(c.length<=t)return{content:[{type:"text",text:c}]}}return{content:[{type:"text",text:`Warning: The repository at ${r||"root"} is massive (exceeds ${t} chars even at minimal depth).
782
+ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_search_symbol' to find what you need.`}]}}Ge();async function bv(n){let{repoPath:e,compact:r=!1}=n,t=new de(e).getSnapshot();if(r&&t.gravity?.hotspots){let o=t.gravity.hotspots.length;t={...t,gravity:{...t.gravity,hotspots:t.gravity.hotspots.slice(0,20),_truncated:o>20,_totalHotspots:o}}}return{content:[{type:"text",text:JSON.stringify(t,null,2)}],suggestedNext:{tool:"shadow_ops_chronicle",reason:"Recent decisions and ADRs"}}}te();nn();Ge();function xv(n){switch(n){case"Entry":return"\u{1F6AA}";case"Logic":return"\u2699\uFE0F";case"Data":return"\u{1F4BE}";case"Utility":return"\u{1F527}";case"Infrastructure":return"\u{1F3D7}\uFE0F";case"Test":return"\u{1F9EA}";case"Types":return"\u{1F4DD}";case"Unknown":return"\u2753"}}async function $v(n){let{repoPath:e}=n;await re(e);let r=A.getInstance(e),i=st(r,e);new de(e).updateTopography(i);let o=["Entry","Logic","Data","Utility","Infrastructure","Test","Types","Unknown"],s=`# \u{1F3D7}\uFE0F Architecture Summary
755
783
 
756
784
  `;if(s+=`## Detected Pattern: **${i.pattern}**
757
785
  `,s+=`Confidence: ${i.patternConfidence.toFixed(0)}%
@@ -763,18 +791,18 @@ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_sea
763
791
 
764
792
  `,s+=`| Layer | Files | % of Total |
765
793
  `,s+=`|-------|------:|:----------:|
766
- `;let a=o.reduce((c,l)=>c+i.layers[l].count,0);for(let c of o){let l=i.layers[c],u=a>0?(l.count/a*100).toFixed(1):"0.0",p=nv(c);s+=`| ${p} ${c} | ${l.count} | ${u}% |
794
+ `;let a=o.reduce((c,l)=>c+i.layers[l].count,0);for(let c of o){let l=i.layers[c],u=a>0?(l.count/a*100).toFixed(1):"0.0",p=xv(c);s+=`| ${p} ${c} | ${l.count} | ${u}% |
767
795
  `}s+=`
768
796
  ## Top Files by Layer
769
797
 
770
- `;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=nv(c);if(s+=`### ${u} ${c} (${l.count} files)
798
+ `;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=xv(c);if(s+=`### ${u} ${c} (${l.count} files)
771
799
  `,l.topFiles.length>0)for(let p of l.topFiles)s+=`- \`${p.path}\` (${p.confidence}% conf)
772
800
  `,p.signals.length>0&&(s+=` - ${p.signals.join("; ")}
773
801
  `);else s+=`- _No files classified with high confidence_
774
802
  `;s+=`
775
803
  `}return s+=`---
776
804
  `,s+=`**Next Steps:**
777
- `,s+="- Use `shadow_inspect_file` to explore files in each layer\n",s+="- Use `shadow_analyze_flow` to trace execution from Entry \u2192 Logic \u2192 Data\n",s+="- Use `shadow_analyze_deps` to understand layer boundaries\n",{content:[{type:"text",text:s}],suggestedNext:{tool:"shadow_recon_tree",reason:"Explore a subPath or use shadow_inspect_file"}}}Q();Xt();Be();import yt from"path";async function iv(n){let{repoPath:e}=n;await ee(e);let r=j.getInstance(e),i=rt(r,e),o=new le(e).getSnapshot(),s=[],a=[],c=Object.values(i.layers.Entry.topFiles).map(d=>d.path),l=new Set(Object.values(i.layers.Data.topFiles).map(d=>d.path));for(let d of c){let m=yt.isAbsolute(d)?d:yt.join(e,d),f=r.imports.findByFile(m);for(let h of f)h.resolved_path&&l.has(yt.relative(e,h.resolved_path))&&s.push(`\u2694\uFE0F LAYER BYPASS: \`${yt.relative(e,d)}\` directly imports Data layer \`${yt.relative(e,h.resolved_path)}\`. Should go through Logic.`)}let u=o.gravity?.hotspots||[];for(let d of u){let m=Cr(d.filePath,r);(m.layer==="Utility"||m.layer==="Unknown")&&d.gravity>50&&a.push(`\u{1F6A8} GRAVITY ANOMALY: \`${yt.relative(e,d.filePath)}\` has high gravity (${d.gravity.toFixed(0)}) but is classified as ${m.layer}. Consider promoting to Core Logic.`)}for(let d of c){let m=yt.isAbsolute(d)?d:yt.join(e,d),f=r.exports.findByFile(m);f.length>10&&a.push(`\u{1F388} ENTRY BLOAT: \`${yt.relative(e,d)}\` exports ${f.length} symbols. Entry handlers should be thin interfaces.`)}let p=`# \u{1F575}\uFE0F Architectural Scout Report
805
+ `,s+="- Use `shadow_inspect_file` to explore files in each layer\n",s+="- Use `shadow_analyze_flow` to trace execution from Entry \u2192 Logic \u2192 Data\n",s+="- Use `shadow_analyze_deps` to understand layer boundaries\n",{content:[{type:"text",text:s}],suggestedNext:{tool:"shadow_recon_tree",reason:"Explore a subPath or use shadow_inspect_file"}}}te();nn();Ge();import _t from"path";async function Sv(n){let{repoPath:e}=n;await re(e);let r=A.getInstance(e),i=st(r,e),o=new de(e).getSnapshot(),s=[],a=[],c=Object.values(i.layers.Entry.topFiles).map(d=>d.path),l=new Set(Object.values(i.layers.Data.topFiles).map(d=>d.path));for(let d of c){let m=_t.isAbsolute(d)?d:_t.join(e,d),f=r.imports.findByFile(m);for(let h of f)h.resolved_path&&l.has(_t.relative(e,h.resolved_path))&&s.push(`\u2694\uFE0F LAYER BYPASS: \`${_t.relative(e,d)}\` directly imports Data layer \`${_t.relative(e,h.resolved_path)}\`. Should go through Logic.`)}let u=o.gravity?.hotspots||[];for(let d of u){let m=Vr(d.filePath,r);(m.layer==="Utility"||m.layer==="Unknown")&&d.gravity>50&&a.push(`\u{1F6A8} GRAVITY ANOMALY: \`${_t.relative(e,d.filePath)}\` has high gravity (${d.gravity.toFixed(0)}) but is classified as ${m.layer}. Consider promoting to Core Logic.`)}for(let d of c){let m=_t.isAbsolute(d)?d:_t.join(e,d),f=r.exports.findByFile(m);f.length>10&&a.push(`\u{1F388} ENTRY BLOAT: \`${_t.relative(e,d)}\` exports ${f.length} symbols. Entry handlers should be thin interfaces.`)}let p=`# \u{1F575}\uFE0F Architectural Scout Report
778
806
 
779
807
  `;return s.length===0&&a.length===0?p+=`\u2705 No significant architectural drift detected. The structure remains "Legit".
780
808
  `:(s.length>0&&(p+=`## \u274C Structural Violations
@@ -783,43 +811,43 @@ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_sea
783
811
  `),a.length>0&&(p+=`## \u26A0\uFE0F Architectural Warnings
784
812
  `,a.forEach(d=>p+=`- ${d}
785
813
  `),p+=`
786
- `)),{content:[{type:"text",text:p}]}}Q();J();import at from"path";Q();J();Xt();Xp();Qp();ed();import{execSync as ov}from"child_process";var As=$.child({module:"heritage-analyzer"}),Ls=class{repos;repoPath;constructor(e){this.repos=j.getInstance(e),this.repoPath=e}analyzeHeritage(e=20){try{As.info({limit:e},"Analyzing repository heritage...");let r=ov(`git log -n ${e} --pretty=format:"%H|%at|%an|%s"`,{cwd:this.repoPath,encoding:"utf-8"});if(!r)return;let i=r.split(`
787
- `).filter(Boolean);for(let t of i){let[o,s,a,c]=t.split("|"),l=this.analyzeCommitImpact(o);if(l.significant){let u=Array.from(l.layers).join(", "),p=`Heritage: ${c} (by ${a}). Touched ${l.fileCount} files across [${u}].`;this.repos.intentLogs.importHeritage(p,o,parseInt(s,10),.7),As.debug({sha:o,subject:c},"Logged heritage move")}}As.info("Heritage analysis complete.")}catch(r){As.warn({err:r.message},"Failed to run heritage analysis")}}analyzeCommitImpact(e){let r=new Set,i=0;try{let o=ov(`git diff-tree --no-commit-id --name-only -r ${e}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
788
- `).filter(Boolean);i=o.length;for(let c of o){let l=this.classifyPathOnly(c);l!=="Unknown"&&r.add(l)}let s=r.has("Entry")||r.has("Data")||r.has("Infrastructure"),a=r.size>=2||i>5;return{significant:s||a,layers:r,fileCount:i}}catch{return{significant:!1,layers:r,fileCount:0}}}classifyPathOnly(e){let r=e.startsWith("/")?e:"/"+e;return td.some(i=>i.test(r))?"Test":ms.some(i=>i.test(r))||ds.some(i=>i.test(r))?"Entry":Lr.some(i=>i.test(r))?"Data":hs.some(i=>i.test(r))?"Utility":gs.some(i=>i.test(r))?"Entry":ys.some(i=>i.test(r))?"Data":vs.some(i=>i.test(r))?"Entry":_s.some(i=>i.test(r))?"Data":nd.some(i=>i.test(r))?"Infrastructure":/\.(service|logic|usecase|interactor|manager)\.(ts|js|php|py)$/i.test(r)||fs.some(i=>i.test(r))?"Logic":"Unknown"}};Be();Xt();async function sv(n){let{repoPath:e}=n;$.info({repoPath:e},"Setting up repository..."),$.info({repoPath:e}," Ensuring index is up-to-date...");let r=Date.now();await ee(e,void 0,!1,!0,F=>{let te=F.total>0?Math.round(F.current/F.total*100):0;$.info({phase:F.phase,progress:`${F.current}/${F.total}`,percentage:`${te}%`},F.message||`Indexing progress: ${F.phase}`)});let t=((Date.now()-r)/1e3).toFixed(1);$.info({repoPath:e,indexTime:`${t}s`}," Index check complete"),await Vn();let o=j.getInstance(e);$.info({repoPath:e},"Populating Project Hologram...");let s=new le(e),a=rt(o,e);s.updateTopography(a);let c=s.computeGravityZones();s.updateGravityZones(c),$.info({repoPath:e,sections:2},"Project Hologram populated (topography + gravity)");let l=o.files.getCount(),u=o.exports.getCount(),p=o.configs.getAll(),d=o.files.getTopDirectories(e),m=[],f=[],h="Standalone",_=F=>o.files.findPackageJsonChildren(F),v=F=>{let te=at.join(F,"package.json"),fe=p.filter(G=>G.file_path===te),ue=[],he=G=>fe.some(B=>B.key.startsWith("dep: ")&&B.key.includes(G));he("react")&&ue.push("React"),he("vue")&&ue.push("Vue"),he("next")&&ue.push("Next.js"),he("fastify")&&ue.push("Fastify"),he("express")&&ue.push("Express"),he("nestjs")&&ue.push("NestJS"),(he("prisma")||he("typeorm"))&&ue.push("DB");let ce=fe.find(G=>G.key==="description")?.value||"";return{stack:ue.join(", "),description:ce.length>80?ce.substring(0,77)+"...":ce}},g=at.join(e,"apps"),x=at.join(e,"packages"),I=at.join(e,"services"),E=o.files.hasFilesPattern(g+"/%"),w=o.files.hasFilesPattern(x+"/%"),T=o.files.hasFilesPattern(I+"/%"),O=(F,te)=>{let fe=_(F);fe.length>0&&(m.push(`| **${te}/ (Directory)** | \uFE0F **DO NOT SUMMARIZE FULL DIR** | |`),fe.forEach(ue=>{let he=at.dirname(ue.path),ce=at.basename(he);if(ce.startsWith("_")||ce.includes("template"))return;let G=at.relative(e,he),B=v(he);m.push(`| \u2514\u2500 \`${G}\` | ${B.stack||"Module"} | ${B.description} |`),f.push(G)}))};E||w||T?(h="Monorepo",O(g,"apps"),O(I,"services"),O(x,"packages")):d.forEach(F=>{let te=F.root;if(!te||te.startsWith("."))return;let fe=v(at.join(e,te));m.push(`| \`${te}/\` | ${fe.stack||"Module"} | ${fe.description} |`)});let V=at.join(e,"package.json"),D=p.find(F=>F.key==="name"&&F.kind==="Service"&&F.file_path===V)?.value||at.basename(e),H=p.filter(F=>F.kind==="Service"&&!F.file_path.endsWith("package.json")),L=H.map(F=>F.value).filter(F=>!["postgres","redis","db","worker"].includes(F.toLowerCase())).slice(0,5),Y=L.length>0?`Service Cluster: ${L.join(", ")}${H.length>5?` (+${H.length-5} others)`:""}`:"",U=l<100?"small":"large",C=U==="small"?"You can safely use `shadow_recon_tree` to view the full tree.":' **AVOID summarizing large directories like `apps/` or `services/` as a whole.**\n Instead, look for a specific component in the map below and use `shadow_recon_tree({ subPath: "apps/my-app" })` on it.\n\uFE0F **Prefer Search:** Use `shadow_search_symbol` for directly finding symbols.',A="";try{let te=new Pe(e).detectAndRepairShifts(),fe=new Dt(e),ue=o.missions.findLastMission();fe.analyzeGhostChanges(ue?.commit_sha||void 0),o.intentLogs.countByType("heritage")===0&&new Ls(e).analyzeHeritage(20);let ce=o.intentLogs.countByType("heritage"),G=o.intentLogs.countByType("discovery");ce>0||G>0||te.repaired>0?A=`
814
+ `)),{content:[{type:"text",text:p}]}}te();K();import ut from"path";te();K();nn();pd();dd();md();import{execSync as kv}from"child_process";var Js=x.child({module:"heritage-analyzer"}),Gs=class{repos;repoPath;constructor(e){this.repos=A.getInstance(e),this.repoPath=e}analyzeHeritage(e=20){try{Js.info({limit:e},"Analyzing repository heritage...");let r=kv(`git log -n ${e} --pretty=format:"%H|%at|%an|%s"`,{cwd:this.repoPath,encoding:"utf-8"});if(!r)return;let i=r.split(`
815
+ `).filter(Boolean);for(let t of i){let[o,s,a,c]=t.split("|"),l=this.analyzeCommitImpact(o);if(l.significant){let u=Array.from(l.layers).join(", "),p=`Heritage: ${c} (by ${a}). Touched ${l.fileCount} files across [${u}].`;this.repos.intentLogs.importHeritage(p,o,parseInt(s,10),.7),Js.debug({sha:o,subject:c},"Logged heritage move")}}Js.info("Heritage analysis complete.")}catch(r){Js.warn({err:r.message},"Failed to run heritage analysis")}}analyzeCommitImpact(e){let r=new Set,i=0;try{let o=kv(`git diff-tree --no-commit-id --name-only -r ${e}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
816
+ `).filter(Boolean);i=o.length;for(let c of o){let l=this.classifyPathOnly(c);l!=="Unknown"&&r.add(l)}let s=r.has("Entry")||r.has("Data")||r.has("Infrastructure"),a=r.size>=2||i>5;return{significant:s||a,layers:r,fileCount:i}}catch{return{significant:!1,layers:r,fileCount:0}}}classifyPathOnly(e){let r=e.startsWith("/")?e:"/"+e;return fd.some(i=>i.test(r))?"Test":Ss.some(i=>i.test(r))||$s.some(i=>i.test(r))?"Entry":Gr.some(i=>i.test(r))?"Data":Es.some(i=>i.test(r))?"Utility":ws.some(i=>i.test(r))?"Entry":Is.some(i=>i.test(r))?"Data":Ts.some(i=>i.test(r))?"Entry":Rs.some(i=>i.test(r))?"Data":hd.some(i=>i.test(r))?"Infrastructure":/\.(service|logic|usecase|interactor|manager)\.(ts|js|php|py)$/i.test(r)||ks.some(i=>i.test(r))?"Logic":"Unknown"}};Ge();nn();async function Ev(n){let{repoPath:e}=n;x.info({repoPath:e},"Setting up repository..."),x.info({repoPath:e}," Ensuring index is up-to-date...");let r=Date.now();await re(e,void 0,!1,!0,Z=>{let ee=Z.total>0?Math.round(Z.current/Z.total*100):0;x.info({phase:Z.phase,progress:`${Z.current}/${Z.total}`,percentage:`${ee}%`},Z.message||`Indexing progress: ${Z.phase}`)});let t=((Date.now()-r)/1e3).toFixed(1);x.info({repoPath:e,indexTime:`${t}s`}," Index check complete"),await Qt();let o=A.getInstance(e);x.info({repoPath:e},"Populating Project Hologram...");let s=new de(e),a=st(o,e);s.updateTopography(a);let c=s.computeGravityZones();s.updateGravityZones(c),x.info({repoPath:e,sections:2},"Project Hologram populated (topography + gravity)");let l=o.files.getCount(),u=o.exports.getCount(),p=o.configs.getAll(),d=o.files.getTopDirectories(e),m=[],f=[],h="Standalone",_=Z=>o.files.findPackageJsonChildren(Z),v=Z=>{let ee=ut.join(Z,"package.json"),ce=p.filter(W=>W.file_path===ee),ne=[],oe=W=>ce.some(H=>H.key.startsWith("dep: ")&&H.key.includes(W));oe("react")&&ne.push("React"),oe("vue")&&ne.push("Vue"),oe("next")&&ne.push("Next.js"),oe("fastify")&&ne.push("Fastify"),oe("express")&&ne.push("Express"),oe("nestjs")&&ne.push("NestJS"),(oe("prisma")||oe("typeorm"))&&ne.push("DB");let G=ce.find(W=>W.key==="description")?.value||"";return{stack:ne.join(", "),description:G.length>80?G.substring(0,77)+"...":G}},g=ut.join(e,"apps"),b=ut.join(e,"packages"),S=ut.join(e,"services"),k=o.files.hasFilesPattern(g+"/%"),w=o.files.hasFilesPattern(b+"/%"),R=o.files.hasFilesPattern(S+"/%"),j=(Z,ee)=>{let ce=_(Z);ce.length>0&&(m.push(`| **${ee}/ (Directory)** | \uFE0F **DO NOT SUMMARIZE FULL DIR** | |`),ce.forEach(ne=>{let oe=ut.dirname(ne.path),G=ut.basename(oe);if(G.startsWith("_")||G.includes("template"))return;let W=ut.relative(e,oe),H=v(oe);m.push(`| \u2514\u2500 \`${W}\` | ${H.stack||"Module"} | ${H.description} |`),f.push(W)}))};k||w||R?(h="Monorepo",j(g,"apps"),j(S,"services"),j(b,"packages")):d.forEach(Z=>{let ee=Z.root;if(!ee||ee.startsWith("."))return;let ce=v(ut.join(e,ee));m.push(`| \`${ee}/\` | ${ce.stack||"Module"} | ${ce.description} |`)});let B=ut.join(e,"package.json"),O=p.find(Z=>Z.key==="name"&&Z.kind==="Service"&&Z.file_path===B)?.value||ut.basename(e),J=p.filter(Z=>Z.kind==="Service"&&!Z.file_path.endsWith("package.json")),V=J.map(Z=>Z.value).filter(Z=>!["postgres","redis","db","worker"].includes(Z.toLowerCase())).slice(0,5),q=V.length>0?`Service Cluster: ${V.join(", ")}${J.length>5?` (+${J.length-5} others)`:""}`:"",I=l<100?"small":"large",C=I==="small"?"You can safely use `shadow_recon_tree` to view the full tree.":' **AVOID summarizing large directories like `apps/` or `services/` as a whole.**\n Instead, look for a specific component in the map below and use `shadow_recon_tree({ subPath: "apps/my-app" })` on it.\n\uFE0F **Prefer Search:** Use `shadow_search_symbol` for directly finding symbols.',U="";try{let ee=new Pe(e).detectAndRepairShifts(),ce=new Lt(e),ne=o.missions.findLastMission();ce.analyzeGhostChanges(ne?.commit_sha||void 0),o.intentLogs.countByType("heritage")===0&&new Gs(e).analyzeHeritage(20);let G=o.intentLogs.countByType("heritage"),W=o.intentLogs.countByType("discovery");G>0||W>0||ee.repaired>0?U=`
789
817
  ## Shadow Engine Insights
790
- `+(ce>0?`* **Architectural Heritage**: Bootstrapped ${ce} significant historical moves.
791
- `:"")+(G>0?`* **Recent Changes**: Detected ${G} external modifications.
792
- `:"")+(te.repaired>0?`* **Symbol Healing**: Automatically repaired ${te.repaired} orphaned intent links.
793
- `:""):A=`
818
+ `+(G>0?`* **Architectural Heritage**: Bootstrapped ${G} significant historical moves.
819
+ `:"")+(W>0?`* **Recent Changes**: Detected ${W} external modifications.
820
+ `:"")+(ee.repaired>0?`* **Symbol Healing**: Automatically repaired ${ee.repaired} orphaned intent links.
821
+ `:""):U=`
794
822
  ## Shadow Engine Status: **Active**
795
823
  * **Integrity**: Git River matches Symbol Index.
796
824
  * **Heritage**: Ready to track developer intent.
797
- `}catch(F){A=`
825
+ `}catch(Z){U=`
798
826
  ## Shadow Engine Status: **Offline**
799
- * Error: ${F instanceof Error?F.message:"Unknown"}
800
- `}try{let te=new qn(e).runMaintenance();(te.pruning.deleted>0||te.pruning.converted>0)&&(A+=`
827
+ * Error: ${Z instanceof Error?Z.message:"Unknown"}
828
+ `}try{let ee=new tr(e).runMaintenance();(ee.pruning.deleted>0||ee.pruning.converted>0)&&(U+=`
801
829
  ### Clean Sweep Cycle
802
- * **Pruned**: ${te.pruning.deleted} orphaned logs deleted, ${te.pruning.converted} converted to lapsed.
803
- `+(te.compaction.eligible>0?`* **Compaction**: ${te.compaction.eligible} cold missions eligible for briefing synthesis.
804
- `:""))}catch(F){$.warn({error:F},"Metabolism maintenance failed")}let Z="";try{let F=o.missions.findActiveByPriority();F?Z=`
805
- ## Active Mission: **${F.name}** (#${F.id})
830
+ * **Pruned**: ${ee.pruning.deleted} orphaned logs deleted, ${ee.pruning.converted} converted to lapsed.
831
+ `+(ee.compaction.eligible>0?`* **Compaction**: ${ee.compaction.eligible} cold missions eligible for briefing synthesis.
832
+ `:""))}catch(Z){x.warn({error:Z},"Metabolism maintenance failed")}let M="";try{let Z=o.missions.findActiveByPriority();Z?M=`
833
+ ## Active Mission: **${Z.name}** (#${Z.id})
806
834
  * Use \`shadow_ops_briefing\` to resume context.
807
- `:Z=`
835
+ `:M=`
808
836
  ## Mission Status: **Idle**
809
837
  * No active mission. Use \`shadow_ops_plan\` to begin task tracking.
810
838
  `}catch{}return{content:[{type:"text",text:`
811
- # Repository Indexed: ${D}
839
+ # Repository Indexed: ${O}
812
840
 
813
841
  \u23F1\uFE0F **Initial deep index completed in ${t}s** (one-time operation - future syncs are instant)
814
842
 
815
843
  ## \u{1F3D7}\uFE0F Architecture: ${h}
816
- ${Y?`> ${Y}
844
+ ${q?`> ${q}
817
845
  `:""}
818
846
 
819
- ${A}
820
- ${Z}
847
+ ${U}
848
+ ${M}
821
849
 
822
- This is a ${U} repository with ${l} files.
850
+ This is a ${I} repository with ${l} files.
823
851
 
824
852
  ## System Overview
825
853
  | Statistic | Value |
@@ -849,15 +877,15 @@ ${C}
849
877
 
850
878
  ---
851
879
  **Ready.** What would you like to investigate first?
852
- `}]}}Q();import av from"path";import ZS from"fs";function HS(n,e,r){let i=n.split(`
853
- `),t=[],o=0;for(let p=0;p<Math.min(i.length,50);p++){let d=i[p].trim();if(d.startsWith("import ")||d.startsWith("from ")||d.startsWith("export ")&&d.includes(" from "))o=p+1;else if(d&&!d.startsWith("//")&&!d.startsWith("/*")&&!d.startsWith("*")&&d!==""&&o>0)break}o>0&&(t.push(...i.slice(0,o)),t.push(""));let s=[...r].sort((p,d)=>p.startLine-d.startLine),a=0,c=0;for(let p of s)if(p.isTarget){t.push(`// \u2501\u2501\u2501 REQUESTED: ${p.name} \u2501\u2501\u2501`);let d=i.slice(p.startLine-1,p.endLine);t.push(...d),t.push("// \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),c++}else{let d=p.signature||WS(i,p.startLine-1,p.kind);d&&(t.push(`${d}`),t.push(` /* implementation: ${p.lineCount} lines */`),t.push(""),a++)}let l=s[s.length-1];if(l)for(let p=l.endLine;p<i.length;p++){let d=i[p].trim();if(d==="}"||d==="};"){t.push(i[p]);break}else if(d&&!d.startsWith("//"))break}return{foldedSource:t.join(`
854
- `),totalOriginalLines:i.length,foldedToLines:t.length,siblingsShown:c,siblingsFolded:a}}function WS(n,e,r){let i=n[e];if(r.includes("Function")||r.includes("Method")||r.includes("Arrow")){let t="";for(let o=e;o<Math.min(e+5,n.length);o++)if(t+=n[o],t.includes("{")||t.includes("=>")){let s=t.indexOf("{");s>0&&(t=t.substring(0,s).trim());break}return t.trim()}return i}async function Td(n){let{repoPath:e,filePath:r,resolver:i}=je(n),t=String(n.symbolName),o=n.context||"definition";if(r&&!i.isWithinRoot(r))return{content:[{type:"text",text:`Error: Access denied. Path ${r} is outside the repository root.`}],isError:!0};await ee(e);let s=j.getInstance(e),a=[];if(t.includes(".")){let[w,T]=t.split(".");a=s.exports.findMemberCandidates(w,T,r)}else a=s.exports.findDefinitionCandidates(t,r);if(a.length===0){let w=s.exports.findPotentialParents(t);if(w.length>0){let k=w.map(D=>`\`${D.name}\` (in ${i.getRelative(D.file_path)})`).join(", ");return{content:[{type:"text",text:`Symbol "${t}" not found as a top-level export.
855
- However, it likely exists inside: ${k}.
856
- Try: shadow_inspect_symbol({ symbolName: "${w[0].name}", context: "full" }) to see the class body.`}]}}let O=s.exports.findFuzzyCandidates(t).map(k=>k.name),V=Kr(t,O,50,3);if(V.length>0){let k=V.map(D=>` \u2022 \`${D.match}\` (${D.score}% match)`).join(`
880
+ `}]}}te();import wv from"path";import _k from"fs";function bk(n,e,r){let i=n.split(`
881
+ `),t=[],o=0;for(let p=0;p<Math.min(i.length,50);p++){let d=i[p].trim();if(d.startsWith("import ")||d.startsWith("from ")||d.startsWith("export ")&&d.includes(" from "))o=p+1;else if(d&&!d.startsWith("//")&&!d.startsWith("/*")&&!d.startsWith("*")&&d!==""&&o>0)break}o>0&&(t.push(...i.slice(0,o)),t.push(""));let s=[...r].sort((p,d)=>p.startLine-d.startLine),a=0,c=0;for(let p of s)if(p.isTarget){t.push(`// \u2501\u2501\u2501 REQUESTED: ${p.name} \u2501\u2501\u2501`);let d=i.slice(p.startLine-1,p.endLine);t.push(...d),t.push("// \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),c++}else{let d=p.signature||xk(i,p.startLine-1,p.kind);d&&(t.push(`${d}`),t.push(` /* implementation: ${p.lineCount} lines */`),t.push(""),a++)}let l=s[s.length-1];if(l)for(let p=l.endLine;p<i.length;p++){let d=i[p].trim();if(d==="}"||d==="};"){t.push(i[p]);break}else if(d&&!d.startsWith("//"))break}return{foldedSource:t.join(`
882
+ `),totalOriginalLines:i.length,foldedToLines:t.length,siblingsShown:c,siblingsFolded:a}}function xk(n,e,r){let i=n[e];if(r.includes("Function")||r.includes("Method")||r.includes("Arrow")){let t="";for(let o=e;o<Math.min(e+5,n.length);o++)if(t+=n[o],t.includes("{")||t.includes("=>")){let s=t.indexOf("{");s>0&&(t=t.substring(0,s).trim());break}return t.trim()}return i}async function Ad(n){let{repoPath:e,filePath:r,resolver:i}=Me(n),t=String(n.symbolName),o=n.context||"definition";if(r&&!i.isWithinRoot(r))return{content:[{type:"text",text:`Error: Access denied. Path ${r} is outside the repository root.`}],isError:!0};await re(e);let s=A.getInstance(e),a=[];if(t.includes(".")){let[w,R]=t.split(".");a=s.exports.findMemberCandidates(w,R,r)}else a=s.exports.findDefinitionCandidates(t,r);if(a.length===0){let w=s.exports.findPotentialParents(t);if(w.length>0){let T=w.map(O=>`\`${O.name}\` (in ${i.getRelative(O.file_path)})`).join(", ");return{content:[{type:"text",text:`Symbol "${t}" not found as a top-level export.
883
+ However, it likely exists inside: ${T}.
884
+ Try: shadow_inspect_symbol({ symbolName: "${w[0].name}", context: "full" }) to see the class body.`}]}}let j=s.exports.findFuzzyCandidates(t).map(T=>T.name),B=oi(t,j,50,3);if(B.length>0){let T=B.map(O=>` \u2022 \`${O.match}\` (${O.score}% match)`).join(`
857
885
  `);return{content:[{type:"text",text:`Error: Symbol "${t}" not found in the index.
858
886
 
859
887
  Suggestions:
860
- ${k}
888
+ ${T}
861
889
 
862
890
  Next steps:
863
891
  \u2022 Search semantically: shadow_search_concept({ query: "${t}" })
@@ -866,8 +894,8 @@ Next steps:
866
894
  Next steps:
867
895
  \u2022 Search for it: shadow_search_concept({ query: "${t}" })
868
896
  \u2022 Try with file path: shadow_inspect_symbol({ symbolName: "${t}", filePath: "..." })
869
- `}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let w=s.imports.findImportSource(c.file_path,t);if(w&&w.resolved_path)return Td({...n,filePath:w.resolved_path})}let l=ZS.readFileSync(c.file_path,"utf8"),u=l.split(`
870
- `),p=c.end_line-c.start_line+1,d=150,m,f=!1,h=null;if(o==="definition"&&p>d){let T=s.exports.findSiblings(c.file_path).map(O=>({name:O.name,kind:O.kind,signature:O.signature||"",startLine:O.start_line,endLine:O.end_line,lineCount:O.end_line-O.start_line+1,isTarget:O.name===c.name&&O.start_line===c.start_line,parentName:O.parent_name}));if(T.length>1){h=HS(l,{name:c.name,startLine:c.start_line,endLine:c.end_line},T);let O=i.getRelative(c.file_path);m=h.foldedSource+`
897
+ `}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let w=s.imports.findImportSource(c.file_path,t);if(w&&w.resolved_path)return Ad({...n,filePath:w.resolved_path})}let l=_k.readFileSync(c.file_path,"utf8"),u=l.split(`
898
+ `),p=c.end_line-c.start_line+1,d=150,m,f=!1,h=null;if(o==="definition"&&p>d){let R=s.exports.findSiblings(c.file_path).map(j=>({name:j.name,kind:j.kind,signature:j.signature||"",startLine:j.start_line,endLine:j.end_line,lineCount:j.end_line-j.start_line+1,isTarget:j.name===c.name&&j.start_line===c.start_line,parentName:j.parent_name}));if(R.length>1){h=bk(l,{name:c.name,startLine:c.start_line,endLine:c.end_line},R);let j=i.getRelative(c.file_path);m=h.foldedSource+`
871
899
 
872
900
  \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
873
901
  \u{1F4CA} Semantic Fold Applied (context: "definition")
@@ -877,21 +905,21 @@ Next steps:
877
905
  Target Symbol: ${c.name}
878
906
  \u{1F4A1} Need more context?
879
907
  \u2022 Full symbol + dependencies + usage: shadow_inspect_symbol({ symbolName: "${c.name}", context: "full" })
880
- \u2022 ALL symbols in this file: shadow_inspect_file({ filePath: "${O}", detailLevel: "signatures" })
908
+ \u2022 ALL symbols in this file: shadow_inspect_file({ filePath: "${j}", detailLevel: "signatures" })
881
909
  \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501`,f=!0}else m=u.slice(c.start_line-1,c.start_line-1+d).join(`
882
910
  `)+`
883
911
 
884
912
  ... (truncated ${p-d} lines)`,f=!0}else m=u.slice(c.start_line-1,c.end_line).join(`
885
- `);let _=c.parent_name?`${c.parent_name}.${c.name}`:c.name,v=s.exports.findHydratedById(c.id),g={name:_,kind:c.kind,file:i.getRelative(c.file_path),startLine:c.start_line,endLine:c.end_line,totalLines:p,...f&&{truncated:!0,previewLines:d},classification:c.classification,intelligence:v?{working_set_of:v.active_missions.map(w=>`Mission #${w.id}: ${w.name}`),total_intents:v.intent_log_count,latest_intent:v.recent_intents[0]?`${v.recent_intents[0].type}: ${v.recent_intents[0].content}`:null}:void 0,source:m};if(o==="definition")return{content:[{type:"text",text:JSON.stringify(g,null,2)}]};let x={definition:g,dependencies:s.imports.getImportsForFile(c.file_path).map(w=>({module:w.module_specifier,symbols:w.imported_symbols,relativePath:w.resolved_path?av.relative(e,w.resolved_path):null}))},I=[c.file_path],E=s.imports.findVerifiedDependents(I,t);return x.verifiedUsages=E.slice(0,10).map(w=>({file:av.relative(e,w.file_path),classification:w.classification,importedSymbols:w.imported_symbols})),{content:[{type:"text",text:JSON.stringify(x,null,2)}]}}Q();import cv from"path";async function lv(n){let{repoPath:e,filePath:r}=je(n);if(!r)return{content:[{type:"text",text:"Error: filePath is required"}],isError:!0};let i=n.detailLevel||"signatures";await ee(e);let{files:t,exports:o}=j.getInstance(e),s=t.findByPath(r),a=cv.basename(r),c=/\.(ts|tsx|php|py|go)$/.test(a),l;c?l=await Zr(r):l={exports:o.findByFile(r),imports:[]},i==="structure"?(l.exports=l.exports.map(m=>{let f={name:m.name,kind:m.kind,line:m.start_line,classification:m.classification};return m.members&&m.members.length>0?{...f,members:m.members.map(h=>({name:`${m.name}.${h.name}`,kind:h.kind,line:h.start_line}))}:f}),delete l.imports):i==="signatures"&&(l.exports=l.exports.map(m=>{let f={name:m.name,kind:m.kind,signature:m.signature,line:m.start_line,classification:m.classification,capabilities:JSON.parse(m.capabilities||"[]")};return m.members&&m.members.length>0?{...f,members:m.members.map(h=>({name:`${m.name}.${h.name}`,kind:h.kind,signature:h.signature,line:h.start_line}))}:f}),delete l.imports);let u=cv.relative(e,r),p=l.exports?.length||0,d="";return i==="structure"&&p>0?d=`
913
+ `);let _=c.parent_name?`${c.parent_name}.${c.name}`:c.name,v=s.exports.findHydratedById(c.id),g={name:_,kind:c.kind,file:i.getRelative(c.file_path),startLine:c.start_line,endLine:c.end_line,totalLines:p,...f&&{truncated:!0,previewLines:d},classification:c.classification,intelligence:v?{working_set_of:v.active_missions.map(w=>`Mission #${w.id}: ${w.name}`),total_intents:v.intent_log_count,latest_intent:v.recent_intents[0]?`${v.recent_intents[0].type}: ${v.recent_intents[0].content}`:null}:void 0,source:m};if(o==="definition")return{content:[{type:"text",text:JSON.stringify(g,null,2)}]};let b={definition:g,dependencies:s.imports.getImportsForFile(c.file_path).map(w=>({module:w.module_specifier,symbols:w.imported_symbols,relativePath:w.resolved_path?wv.relative(e,w.resolved_path):null}))},S=[c.file_path],k=s.imports.findVerifiedDependents(S,t);return b.verifiedUsages=k.slice(0,10).map(w=>({file:wv.relative(e,w.file_path),classification:w.classification,importedSymbols:w.imported_symbols})),{content:[{type:"text",text:JSON.stringify(b,null,2)}]}}te();import Iv from"path";async function Tv(n){let{repoPath:e,filePath:r}=Me(n);if(!r)return{content:[{type:"text",text:"Error: filePath is required"}],isError:!0};let i=n.detailLevel||"signatures";await re(e);let{files:t,exports:o}=A.getInstance(e),s=t.findByPath(r),a=Iv.basename(r),c=/\.(ts|tsx|php|py|go)$/.test(a),l;c?l=await Qr(r):l={exports:o.findByFile(r),imports:[]},i==="structure"?(l.exports=l.exports.map(m=>{let f={name:m.name,kind:m.kind,line:m.start_line,classification:m.classification};return m.members&&m.members.length>0?{...f,members:m.members.map(h=>({name:`${m.name}.${h.name}`,kind:h.kind,line:h.start_line}))}:f}),delete l.imports):i==="signatures"&&(l.exports=l.exports.map(m=>{let f={name:m.name,kind:m.kind,signature:m.signature,line:m.start_line,classification:m.classification,capabilities:JSON.parse(m.capabilities||"[]")};return m.members&&m.members.length>0?{...f,members:m.members.map(h=>({name:`${m.name}.${h.name}`,kind:h.kind,signature:h.signature,line:h.start_line}))}:f}),delete l.imports);let u=Iv.relative(e,r),p=l.exports?.length||0,d="";return i==="structure"&&p>0?d=`
886
914
 
887
915
  \u{1F4A1} Showing ${p} symbol names. For full signatures: shadow_inspect_file({ filePath: "${u}", detailLevel: "signatures" })`:i==="signatures"&&p>0&&(d=`
888
916
 
889
- \u{1F4A1} Showing ${p} complete signatures. To inspect a specific symbol: shadow_inspect_symbol({ symbolName: "...", context: "full" })`),{content:[{type:"text",text:JSON.stringify({...l,fileDescription:s?.summary||"",classification:s?.classification||"Unknown"},null,2)+d}]}}Q();Xt();async function uv(n){let{repoPath:e}=n;try{await ee(e),new Dt(e).analyzeGhostChanges();let i=new Pe(e),t=i.detectAndRepairShifts(),o=i.syncLifecycle(),a=await new nt(e).recoverFromGitNotes(),{HologramService:c}=await Promise.resolve().then(()=>(Be(),zg)),l=new c(e),u=rt(j.getInstance(e),e);l.updateTopography(u);let p=l.computeGravityZones();l.updateGravityZones(p);let d="Shadow Sync complete. Code changes indexed and intent logs updated.";return d+=`
917
+ \u{1F4A1} Showing ${p} complete signatures. To inspect a specific symbol: shadow_inspect_symbol({ symbolName: "...", context: "full" })`),{content:[{type:"text",text:JSON.stringify({...l,fileDescription:s?.summary||"",classification:s?.classification||"Unknown"},null,2)+d}]}}te();nn();async function Rv(n){let{repoPath:e}=n;try{await re(e),new Lt(e).analyzeGhostChanges();let i=new Pe(e),t=i.detectAndRepairShifts(),o=i.syncLifecycle(),a=await new Be(e).recoverFromGitNotes(),{HologramService:c}=await Promise.resolve().then(()=>(Ge(),Yg)),l=new c(e),u=st(A.getInstance(e),e);l.updateTopography(u);let p=l.computeGravityZones();l.updateGravityZones(p);let d="Shadow Sync complete. Code changes indexed and intent logs updated.";return d+=`
890
918
  \u269B\uFE0F Hologram: Refreshed architectural map (${p.length} hotspots).`,t.repaired>0&&(d+=`
891
919
  \u2728 Nano-Repair: Fixed ${t.repaired} links.`),a.missionsRecovered>0&&(d+=`
892
- \u{1F9EC} Re-hydration: Recovered ${a.missionsRecovered} missions.`),{content:[{type:"text",text:d}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}Be();async function pv(n){let{repoPath:e,deep:r}=n;try{await ee(e,5,r);let i=new Pe(e),t=i.detectAndRepairShifts(),o=i.syncLifecycle(),s=new le(e);s.refreshTopography();let a=s.computeGravityZones();s.updateGravityZones(a);let c=`Repository at ${e} has been ${r?"deeply ":""}re-indexed.`;return t.repaired>0&&(c+=`
920
+ \u{1F9EC} Re-hydration: Recovered ${a.missionsRecovered} missions.`),{content:[{type:"text",text:d}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}Ge();async function Pv(n){let{repoPath:e,deep:r}=n;try{await re(e,5,r);let i=new Pe(e),t=i.detectAndRepairShifts(),o=i.syncLifecycle(),s=new de(e);s.refreshTopography();let a=s.computeGravityZones();s.updateGravityZones(a);let c=`Repository at ${e} has been ${r?"deeply ":""}re-indexed.`;return t.repaired>0&&(c+=`
893
921
  \u2728 Nano-Repair: Fixed ${t.repaired} links.`),c+=`
894
- \u269B\uFE0F Hologram: Refreshed architectural map (${a.length} hotspots).`,{content:[{type:"text",text:c}]}}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}}async function dv(n){let{repoPath:e}=n;try{let i=new Pe(e).detectAndRepairShifts();return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}catch(r){return{content:[{type:"text",text:`Error tracing shifts: ${r.message}`}],isError:!0}}}J();import Ne from"fs";import nn from"path";var er=$.child({module:"git-hooks"}),Cs={"post-merge":`#!/bin/sh
922
+ \u269B\uFE0F Hologram: Refreshed architectural map (${a.length} hotspots).`,{content:[{type:"text",text:c}]}}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}}async function Nv(n){let{repoPath:e}=n;try{let i=new Pe(e).detectAndRepairShifts();return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}catch(r){return{content:[{type:"text",text:`Error tracing shifts: ${r.message}`}],isError:!0}}}K();import Ne from"fs";import ln from"path";var sr=x.child({module:"git-hooks"}),Vs={"post-merge":`#!/bin/sh
895
923
  # Liquid Shadow: Auto-refresh index after merge/pull
896
924
  # Generated by liquid-shadow
897
925
 
@@ -925,20 +953,20 @@ REPO_PATH="$(git rev-parse --show-toplevel)"
925
953
  nohup npx @precisionutilityguild/liquid-shadow sync "$REPO_PATH" > /dev/null 2>&1 &
926
954
 
927
955
  exit 0
928
- `};function mv(n){let{repoPath:e,enableAutoRefresh:r=!0,enableSymbolHealing:i=!0}=n,t=nn.join(e,".git","hooks"),o=[],s=[],a=[];if(!Ne.existsSync(nn.join(e,".git")))return a.push("Not a git repository"),{installed:o,skipped:s,errors:a};Ne.existsSync(t)||Ne.mkdirSync(t,{recursive:!0});let c=[];r&&c.push("post-merge","post-checkout"),i&&c.push("post-commit");for(let l of c){let u=nn.join(t,l),p=Cs[l];if(!p){a.push(`No template found for hook: ${l}`);continue}try{if(Ne.existsSync(u)){let d=Ne.readFileSync(u,"utf-8");if(d.includes("liquid-shadow")||d.includes("mcp-liquid-shadow")){s.push(l),er.info({hookName:l},"Hook already installed, skipping");continue}let m=`${u}.backup-${Date.now()}`;Ne.copyFileSync(u,m),er.info({hookName:l,backupPath:m},"Backed up existing hook")}Ne.writeFileSync(u,p,{mode:493}),o.push(l),er.info({hookName:l},"Installed git hook")}catch(d){a.push(`Failed to install ${l}: ${d}`),er.error({hookName:l,err:d},"Failed to install hook")}}return{installed:o,skipped:s,errors:a}}function fv(n){let e=nn.join(n,".git","hooks"),r=[],i=[];if(!Ne.existsSync(e))return{removed:r,errors:i};let t=Object.keys(Cs);for(let o of t){let s=nn.join(e,o);try{if(Ne.existsSync(s)){let a=Ne.readFileSync(s,"utf-8");(a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow"))&&(Ne.unlinkSync(s),r.push(o),er.info({hookName:o},"Removed git hook"))}}catch(a){i.push(`Failed to remove ${o}: ${a}`),er.error({hookName:o,err:a},"Failed to remove hook")}}return{removed:r,errors:i}}function js(n){let e=nn.join(n,".git","hooks"),r=[],i=[];if(!Ne.existsSync(e))return{installed:r,notInstalled:Object.keys(Cs)};let t=Object.keys(Cs);for(let o of t){let s=nn.join(e,o);if(Ne.existsSync(s)){let a=Ne.readFileSync(s,"utf-8");a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow")?r.push(o):i.push(o)}else i.push(o)}return{installed:r,notInstalled:i}}J();var Rd=$.child({module:"mcp:tools:env:hooks"});async function hv(n){let{repoPath:e,action:r,enableAutoRefresh:i,enableSymbolHealing:t}=n;if(r==="install"){Rd.info({repoPath:e,enableAutoRefresh:i,enableSymbolHealing:t},"Installing git hooks");let o=mv({repoPath:e,enableAutoRefresh:i??!0,enableSymbolHealing:t??!0}),s=["# Git Hooks Installation","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
956
+ `};function zv(n){let{repoPath:e,enableAutoRefresh:r=!0,enableSymbolHealing:i=!0}=n,t=ln.join(e,".git","hooks"),o=[],s=[],a=[];if(!Ne.existsSync(ln.join(e,".git")))return a.push("Not a git repository"),{installed:o,skipped:s,errors:a};Ne.existsSync(t)||Ne.mkdirSync(t,{recursive:!0});let c=[];r&&c.push("post-merge","post-checkout"),i&&c.push("post-commit");for(let l of c){let u=ln.join(t,l),p=Vs[l];if(!p){a.push(`No template found for hook: ${l}`);continue}try{if(Ne.existsSync(u)){let d=Ne.readFileSync(u,"utf-8");if(d.includes("liquid-shadow")||d.includes("mcp-liquid-shadow")){s.push(l),sr.info({hookName:l},"Hook already installed, skipping");continue}let m=`${u}.backup-${Date.now()}`;Ne.copyFileSync(u,m),sr.info({hookName:l,backupPath:m},"Backed up existing hook")}Ne.writeFileSync(u,p,{mode:493}),o.push(l),sr.info({hookName:l},"Installed git hook")}catch(d){a.push(`Failed to install ${l}: ${d}`),sr.error({hookName:l,err:d},"Failed to install hook")}}return{installed:o,skipped:s,errors:a}}function Dv(n){let e=ln.join(n,".git","hooks"),r=[],i=[];if(!Ne.existsSync(e))return{removed:r,errors:i};let t=Object.keys(Vs);for(let o of t){let s=ln.join(e,o);try{if(Ne.existsSync(s)){let a=Ne.readFileSync(s,"utf-8");(a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow"))&&(Ne.unlinkSync(s),r.push(o),sr.info({hookName:o},"Removed git hook"))}}catch(a){i.push(`Failed to remove ${o}: ${a}`),sr.error({hookName:o,err:a},"Failed to remove hook")}}return{removed:r,errors:i}}function qs(n){let e=ln.join(n,".git","hooks"),r=[],i=[];if(!Ne.existsSync(e))return{installed:r,notInstalled:Object.keys(Vs)};let t=Object.keys(Vs);for(let o of t){let s=ln.join(e,o);if(Ne.existsSync(s)){let a=Ne.readFileSync(s,"utf-8");a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow")?r.push(o):i.push(o)}else i.push(o)}return{installed:r,notInstalled:i}}K();var Cd=x.child({module:"mcp:tools:env:hooks"});async function Ov(n){let{repoPath:e,action:r,enableAutoRefresh:i,enableSymbolHealing:t}=n;if(r==="install"){Cd.info({repoPath:e,enableAutoRefresh:i,enableSymbolHealing:t},"Installing git hooks");let o=zv({repoPath:e,enableAutoRefresh:i??!0,enableSymbolHealing:t??!0}),s=["# Git Hooks Installation","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
929
957
  `):"- None","",`## \u23ED\uFE0F Skipped (${o.skipped.length})`,o.skipped.length>0?o.skipped.map(a=>`- \`${a}\` (already installed)`).join(`
930
958
  `):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
931
959
  `)),s.push("")),s.push("---"),s.push("**What happens now?**"),(i??!0)&&s.push("- After `git pull` or `git checkout`: Index auto-refreshes in background"),(t??!0)&&s.push("- After `git commit`: Symbol shift detection runs automatically"),{content:[{type:"text",text:s.join(`
932
- `)}]}}if(r==="remove"){Rd.info({repoPath:e},"Uninstalling git hooks");let o=fv(e),s=["# Git Hooks Uninstallation","",`## Removed (${o.removed.length})`,o.removed.length>0?o.removed.map(a=>`- \`${a}\``).join(`
960
+ `)}]}}if(r==="remove"){Cd.info({repoPath:e},"Uninstalling git hooks");let o=Dv(e),s=["# Git Hooks Uninstallation","",`## Removed (${o.removed.length})`,o.removed.length>0?o.removed.map(a=>`- \`${a}\``).join(`
933
961
  `):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
934
962
  `))),{content:[{type:"text",text:s.join(`
935
- `)}]}}if(r==="status"){Rd.info({repoPath:e},"Checking git hooks status");let o=js(e);return{content:[{type:"text",text:["# Git Hooks Status","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
963
+ `)}]}}if(r==="status"){Cd.info({repoPath:e},"Checking git hooks status");let o=qs(e);return{content:[{type:"text",text:["# Git Hooks Status","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
936
964
  `):"- None","",`## Not Installed (${o.notInstalled.length})`,o.notInstalled.length>0?o.notInstalled.map(a=>`- \`${a}\``).join(`
937
965
  `):"- None","","---",'**To install hooks**: Use `shadow_env_hooks({ action: "install" })`'].join(`
938
- `)}]}}return{content:[{type:"text",text:`Unknown action: ${r}`}],isError:!0}}qt();import Ms from"path";import gv from"fs";J();var BS=$.child({module:"mcp:tools:env:diagnose"});async function yv(n){let{repoPath:e}=n,r=Ms.isAbsolute(e)?Ms.normalize(e):Ms.resolve(process.cwd(),e);BS.info({repoPath:r},"Running MCP diagnose");let i=["# MCP Server Health Check","",`**Repository path**: \`${r}\``,""],t=!1;try{t=gv.statSync(r).isDirectory()}catch{}i.push("## 1. Path"),i.push(t?"\u2705 Directory exists":"\u274C Path missing or not a directory"),i.push("");let o=Ms.join(r,".git"),s=t&&gv.existsSync(o);i.push("## 2. Git repository"),i.push(s?"\u2705 `.git` found":"\u274C Not a Git repository (or path invalid)"),i.push("");let a=!1,c=!1;if(t)try{Oe(r),a=!0,c=et(r)}catch{}i.push("## 3. Database & index"),i.push(a?"\u2705 Database connected":"\u274C Database not available"),i.push(c?"\u2705 Repository indexed":"\u26A0\uFE0F Not indexed yet"),i.push("");let l=t?js(r):{installed:[],notInstalled:[]};return i.push("## 4. Git hooks"),i.push(l.installed.length>0?`\u2705 Installed: ${l.installed.join(", ")}`:"\u26A0\uFE0F No Shadow hooks installed"),i.push(""),i.push("## 5. Next steps"),t?c?i.push("- Index is ready. Use shadow_search_*, shadow_inspect_*, shadow_analyze_*."):i.push("- Run **shadow_recon_onboard** to populate the index."):i.push("- Use a valid repository path."),{content:[{type:"text",text:i.join(`
939
- `)}]}}Q();J();import JS from"path";import VS from"fs";var vv=$.child({module:"mcp:tools:workspace:list"});async function _v(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;vv.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(VS.existsSync(a))try{let{missions:c}=j.getInstance(a),l=c.findAll(r);for(let u of l){let p=c.getLinks(u.id);o.push({...u,repo_path:a,repo_name:JS.basename(a),cross_repo_links:p})}}catch(c){vv.error({error:c,repoPath:a},"Failed to query repo missions")}if(o.sort((a,c)=>{let l=d=>d==="in-progress"?0:d==="verifying"?1:2,u=l(a.status),p=l(c.status);return u!==p?u-p:(a.created_at||0)-(c.created_at||0)}),t||o.length>50&&!i){let a=i||20,c=o.slice(0,a),l=o.reduce((p,d)=>(p[d.status]=(p[d.status]||0)+1,p),{}),u=o.reduce((p,d)=>(p[d.repo_name]=(p[d.repo_name]||0)+1,p),{});return{content:[{type:"text",text:JSON.stringify({summary:{total_missions:o.length,by_status:l,by_repo:u,showing_top:a},top_missions:c,hint:`Showing top ${a} of ${o.length} missions. Use limit to adjust or summarize:false for full list.`},null,2)}]}}let s=i?o.slice(0,i):o;return{content:[{type:"text",text:JSON.stringify({total_missions:o.length,showing:s.length,missions:s},null,2)}]}}Q();J();var GS=$.child({module:"mcp:tools:workspace:link"});async function bv(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;GS.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=j.getInstance(e),{missions:a}=j.getInstance(i);try{let c=s.findById(r),l=a.findById(t);if(!c)throw new Error(`Parent mission ${r} not found`);if(!l)throw new Error(`Child mission ${t} not found`);return s.createLink(r,i,t,o,"parent"),a.createLink(t,e,r,o,"child"),{content:[{type:"text",text:JSON.stringify({status:"linked",relationship:o},null,2)}]}}catch(c){throw new Error(`Failed to link: ${c.message}`)}}J();var qS=$.child({module:"mcp:tools:workspace:fuse"});async function xv(n){let{repoPaths:e,name:r}=n;qS.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=Hy({repoPaths:e,name:r||`workspace-${Date.now()}`});return{content:[{type:"text",text:JSON.stringify({message:"Fused index created",status:i.getStatus()},null,2)}]}}catch(i){throw new Error(`Failed to fuse: ${i.message}`)}}var $v=y.object({repoPath:y.string(),name:y.string().optional(),goal:y.string().optional(),strategy:y.string().optional(),missionId:y.number().optional(),parentId:y.number().optional(),outcomeContract:y.string().optional(),templateId:y.string().optional(),templateVars:y.record(y.string(),y.string()).optional()}),Sv=y.object({repoPath:y.string(),missionId:y.number(),stepId:y.string().optional(),status:y.enum(["pending","in-progress","completed","failed","skipped"]).optional(),contextPivot:y.string().optional(),updates:y.array(y.object({stepId:y.string(),status:y.enum(["pending","in-progress","completed","failed","skipped"]),contextPivot:y.string().optional()})).optional(),artifacts:y.array(y.object({type:y.string(),identifier:y.string(),metadata:y.record(y.string(),y.any()).optional()})).optional()}),kv=y.object({repoPath:y.string(),missionId:y.number().optional(),scope:y.enum(["mission","project"]).optional(),activeMissionsLimit:y.number().int().positive().optional(),recentActivityLimit:y.number().int().positive().optional(),compact:y.boolean().optional()}),Ev=y.object({repoPath:y.string(),missionId:y.number(),type:y.enum(["decision","blocker","discovery","fix"]),content:y.string(),filePath:y.string().optional(),symbolName:y.string().optional()}),wv=y.object({repoPath:y.string(),missionId:y.number()}),Iv=y.object({repoPath:y.string(),format:y.enum(["markdown","json"]).optional(),limit:y.number().optional(),offset:y.number().optional(),since:y.number().optional(),until:y.number().optional()}),Tv=y.object({repoPath:y.string()}),Rv=y.object({repoPath:y.string(),compact:y.boolean().optional()}),Pv=y.object({repoPath:y.string(),missionId:y.number().optional(),depth:y.number().optional(),limit:y.number().optional(),format:y.enum(["mermaid","json"]).optional()}),Nv=y.object({repoPath:y.string(),subPath:y.string().optional(),maxDepth:y.number().int().optional()}),zv=y.object({repoPath:y.string(),compact:y.boolean().optional()}),Dv=y.object({repoPath:y.string()}),Ov=y.object({repoPath:y.string()}),Av=y.object({repoPath:y.string()}),Lv=y.object({repoPath:y.string(),query:y.string(),limit:y.number().int().optional(),offset:y.number().int().optional(),compact:y.boolean().optional(),fileType:y.string().optional(),layer:y.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional()}),Cv=y.object({repoPath:y.string(),query:y.string(),limit:y.number().int().optional(),offset:y.number().int().optional(),fileType:y.string().optional(),layer:y.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),matchMode:y.enum(["any","all","exact"]).optional()}),jv=y.object({repoPath:y.string(),query:y.string().optional(),key:y.string().optional(),kind:y.enum(["Service","Image","Port","Env"]).optional(),limit:y.number().int().optional(),showUsage:y.boolean().optional()}),Mv=y.object({repoPath:y.string(),query:y.string(),limit:y.number().int().optional(),offset:y.number().int().optional(),fileType:y.string().optional(),layer:y.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),ranked:y.boolean().optional()}),Uv=y.object({repoPath:y.string(),filePath:y.string().optional(),symbolName:y.string(),depth:y.number().int().optional(),limit:y.number().int().positive().optional(),offset:y.number().int().nonnegative().optional()}),Fv=y.object({repoPath:y.string(),filePath:y.string(),symbolName:y.string().optional()}),Zv=y.object({repoPath:y.string(),filePath:y.string(),direction:y.enum(["imports","imported_by"]),limit:y.number().int().positive().optional(),offset:y.number().int().nonnegative().optional()}),Hv=y.object({repoPath:y.string(),mode:y.enum(["dead-code","circular-deps"]),limit:y.number().int().optional(),excludePatterns:y.array(y.string()).optional(),includeMigrations:y.boolean().optional(),includeFixtures:y.boolean().optional(),confidenceThreshold:y.enum(["all","high","medium"]).optional()}),Wv=y.object({repoPath:y.string(),symbolName:y.string(),filePath:y.string().optional(),context:y.enum(["definition","full"]).optional()}),Bv=y.object({repoPath:y.string(),filePath:y.string(),detailLevel:y.enum(["structure","signatures","summaries","detailed"]).optional()}),Jv=y.object({repoPath:y.string()}),Vv=y.object({repoPath:y.string(),deep:y.boolean().optional()}),Gv=y.object({repoPath:y.string()}),qv=y.object({repoPath:y.string(),action:y.enum(["install","remove","status"]),enableAutoRefresh:y.boolean().optional(),enableSymbolHealing:y.boolean().optional()}),Kv=y.object({repoPath:y.string()}),Yv=y.object({repoPaths:y.array(y.string()),status:y.string().optional(),limit:y.number().int().positive().optional(),summarize:y.boolean().optional()}),Xv=y.object({parentRepoPath:y.string(),parentMissionId:y.number(),childRepoPath:y.string(),childMissionId:y.number(),relationship:y.string()}),Qv=y.object({repoPaths:y.array(y.string()),name:y.string().optional()});J();var KS=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function Us(n,e){if(!(!n||typeof n!="object"))for(let r in n)typeof n[r]=="string"?["filePath","subPath","path","repoPath","parentRepoPath","childRepoPath"].includes(r)&&(n[r]=e.resolve(n[r])):Array.isArray(n[r])?n[r].forEach(i=>Us(i,e)):typeof n[r]=="object"&&Us(n[r],e)}function e_(n){if(!(!n||typeof n!="object")){for(let e of KS)if(typeof n[e]=="string")try{n[e]=An(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?An(e):e))}}function t_(n,e){return async r=>{let i=$.child({handler:n});try{e_(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),Pt("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new On(r.repoPath);Us(r,o)}i.info({args:r},"Handling tool call");let t=await e(r);return i.debug("Tool call successful"),t}catch(t){i.error({err:t},"Error in tool handler");let o=t.message?.includes("Access denied"),s=`Handler '${n}' failed: ${t.message}`;return!o&&r?.repoPath&&(s+=Ar),Pt(o?"FORBIDDEN":"INTERNAL_ERROR",s,{stack:t.stack})}}}function n_(n,e,r){return async i=>{let t=$.child({handler:n});try{e_(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),Pt("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new On(i.repoPath);Us(i,s)}t.info({args:i},"Handling tool call with validation");let o=e.safeParse(i);if(!o.success){let s=o.error.issues.map(a=>`${a.path.length>0?`${a.path.join(".")}: `:""}${a.message}`).join(", ");return t.warn({validationIssues:o.error.issues},"Validation failed"),Pt("VALIDATION_ERROR",`Validation error: ${s}`,{issues:o.error.issues})}try{let s=await r(o.data);return t.debug("Tool call successful"),s}catch(s){t.error({err:s},"Error in tool handler");let a=s.message?.includes("Access denied"),c=`Handler '${n}' failed: ${s.message}`,l=o.data;return!a&&l?.repoPath&&(c+=Ar),Pt(a?"FORBIDDEN":"INTERNAL_ERROR",c,{stack:s.stack})}}}function ei(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=Mh(i,e);return t||n(r)}}var YS={shadow_ops_plan:{default:sg},shadow_ops_track:{default:lg},shadow_ops_briefing:{default:xs},shadow_ops_log:{default:Jg},shadow_ops_synthesize:{default:Lg},shadow_ops_chronicle:{default:jg},shadow_ops_context:{default:ei(Mg,"shadow_ops_context")},shadow_ops_health:{default:Bg},shadow_ops_graph:{default:Yg},shadow_recon_tree:{default:ev},shadow_recon_hologram:{default:tv},shadow_recon_topography:{default:rv},shadow_recon_scout:{default:iv},shadow_recon_onboard:{default:sv},shadow_search_concept:{default:Oy},shadow_search_symbol:{default:Ay},shadow_search_config:{default:Cy},shadow_search_path:{default:jy},shadow_analyze_impact:{default:By},shadow_analyze_flow:{default:Gy},shadow_analyze_deps:{default:Yy},shadow_analyze_debt:{default:Qy},shadow_inspect_symbol:{default:ei(Td,"shadow_inspect_symbol")},shadow_inspect_file:{default:ei(lv,"shadow_inspect_file")},shadow_sync_trace:{default:ei(uv,"shadow_sync_trace")},shadow_sync_index:{default:pv},shadow_sync_repair:{default:ei(dv,"shadow_sync_repair")},shadow_env_hooks:{default:hv},shadow_env_diagnose:{default:yv},shadow_workspace_list:{default:_v},shadow_workspace_link:{default:bv},shadow_workspace_fuse:{default:xv}},XS={shadow_ops_plan:$v,shadow_ops_track:Sv,shadow_ops_briefing:kv,shadow_ops_log:Ev,shadow_ops_synthesize:wv,shadow_ops_chronicle:Iv,shadow_ops_context:Rv,shadow_ops_health:Tv,shadow_ops_graph:Pv,shadow_recon_tree:Nv,shadow_recon_hologram:zv,shadow_recon_topography:Dv,shadow_recon_scout:Ov,shadow_recon_onboard:Av,shadow_search_concept:Lv,shadow_search_symbol:Cv,shadow_search_config:jv,shadow_search_path:Mv,shadow_analyze_impact:Uv,shadow_analyze_flow:Fv,shadow_analyze_deps:Zv,shadow_analyze_debt:Hv,shadow_inspect_symbol:Wv,shadow_inspect_file:Bv,shadow_sync_trace:Jv,shadow_sync_index:Vv,shadow_sync_repair:Gv,shadow_env_hooks:qv,shadow_env_diagnose:Kv,shadow_workspace_list:Yv,shadow_workspace_link:Xv,shadow_workspace_fuse:Qv},Pd=new Map;for(let[n,e]of Object.entries(YS)){let r=XS[n];r?Pd.set(n,n_(n,r,async i=>{if(e.default)return e.default(i);let t=i.mode||i.action;if(!t){let s=Object.keys(e);return{content:[{type:"text",text:`Missing required parameter "mode" or "action" for tool ${n}.
966
+ `)}]}}return{content:[{type:"text",text:`Unknown action: ${r}`}],isError:!0}}Kt();import Ks from"path";import Lv from"fs";K();var $k=x.child({module:"mcp:tools:env:diagnose"});async function Av(n){let{repoPath:e}=n,r=Ks.isAbsolute(e)?Ks.normalize(e):Ks.resolve(process.cwd(),e);$k.info({repoPath:r},"Running MCP diagnose");let i=["# MCP Server Health Check","",`**Repository path**: \`${r}\``,""],t=!1;try{t=Lv.statSync(r).isDirectory()}catch{}i.push("## 1. Path"),i.push(t?"\u2705 Directory exists":"\u274C Path missing or not a directory"),i.push("");let o=Ks.join(r,".git"),s=t&&Lv.existsSync(o);i.push("## 2. Git repository"),i.push(s?"\u2705 `.git` found":"\u274C Not a Git repository (or path invalid)"),i.push("");let a=!1,c=!1;if(t)try{Oe(r),a=!0,c=rt(r)}catch{}i.push("## 3. Database & index"),i.push(a?"\u2705 Database connected":"\u274C Database not available"),i.push(c?"\u2705 Repository indexed":"\u26A0\uFE0F Not indexed yet"),i.push("");let l=t?qs(r):{installed:[],notInstalled:[]};return i.push("## 4. Git hooks"),i.push(l.installed.length>0?`\u2705 Installed: ${l.installed.join(", ")}`:"\u26A0\uFE0F No Shadow hooks installed"),i.push(""),i.push("## 5. Next steps"),t?c?i.push("- Index is ready. Use shadow_search_*, shadow_inspect_*, shadow_analyze_*."):i.push("- Run **shadow_recon_onboard** to populate the index."):i.push("- Use a valid repository path."),{content:[{type:"text",text:i.join(`
967
+ `)}]}}te();K();import Sk from"path";import kk from"fs";var Cv=x.child({module:"mcp:tools:workspace:list"});async function jv(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;Cv.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(kk.existsSync(a))try{let{missions:c}=A.getInstance(a),l=c.findAll(r);for(let u of l){let p=c.getLinks(u.id);o.push({...u,repo_path:a,repo_name:Sk.basename(a),cross_repo_links:p})}}catch(c){Cv.error({error:c,repoPath:a},"Failed to query repo missions")}if(o.sort((a,c)=>{let l=d=>d==="in-progress"?0:d==="verifying"?1:2,u=l(a.status),p=l(c.status);return u!==p?u-p:(a.created_at||0)-(c.created_at||0)}),t||o.length>50&&!i){let a=i||20,c=o.slice(0,a),l=o.reduce((p,d)=>(p[d.status]=(p[d.status]||0)+1,p),{}),u=o.reduce((p,d)=>(p[d.repo_name]=(p[d.repo_name]||0)+1,p),{});return{content:[{type:"text",text:JSON.stringify({summary:{total_missions:o.length,by_status:l,by_repo:u,showing_top:a},top_missions:c,hint:`Showing top ${a} of ${o.length} missions. Use limit to adjust or summarize:false for full list.`},null,2)}]}}let s=i?o.slice(0,i):o;return{content:[{type:"text",text:JSON.stringify({total_missions:o.length,showing:s.length,missions:s},null,2)}]}}te();K();var Ek=x.child({module:"mcp:tools:workspace:link"});async function Mv(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;Ek.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=A.getInstance(e),{missions:a}=A.getInstance(i);try{let c=s.findById(r),l=a.findById(t);if(!c)throw new Error(`Parent mission ${r} not found`);if(!l)throw new Error(`Child mission ${t} not found`);return s.createLink(r,i,t,o,"parent"),a.createLink(t,e,r,o,"child"),{content:[{type:"text",text:JSON.stringify({status:"linked",relationship:o},null,2)}]}}catch(c){throw new Error(`Failed to link: ${c.message}`)}}K();var wk=x.child({module:"mcp:tools:workspace:fuse"});async function Uv(n){let{repoPaths:e,name:r}=n;wk.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=cv({repoPaths:e,name:r||`workspace-${Date.now()}`});return{content:[{type:"text",text:JSON.stringify({message:"Fused index created",status:i.getStatus()},null,2)}]}}catch(i){throw new Error(`Failed to fuse: ${i.message}`)}}var Fv=y.object({repoPath:y.string(),name:y.string().optional(),goal:y.string().optional(),strategy:y.string().optional(),missionId:y.number().optional(),parentId:y.number().optional(),outcomeContract:y.string().optional(),templateId:y.string().optional(),templateVars:y.record(y.string(),y.string()).optional()}),Zv=y.object({repoPath:y.string(),missionId:y.number(),stepId:y.string().optional(),status:y.enum(["pending","in-progress","completed","failed","skipped"]).optional(),contextPivot:y.string().optional(),updates:y.array(y.object({stepId:y.string(),status:y.enum(["pending","in-progress","completed","failed","skipped"]),contextPivot:y.string().optional()})).optional(),artifacts:y.array(y.object({type:y.string(),identifier:y.string(),metadata:y.record(y.string(),y.any()).optional()})).optional()}),Wv=y.object({repoPath:y.string(),missionId:y.number().optional(),scope:y.enum(["mission","project"]).optional(),altitude:y.enum(["orbit","atmosphere","ground"]).optional(),activeMissionsLimit:y.number().int().positive().optional(),recentActivityLimit:y.number().int().positive().optional(),compact:y.boolean().optional()}),Hv=y.object({repoPath:y.string(),missionId:y.number(),type:y.enum(["decision","blocker","discovery","fix"]),content:y.string(),filePath:y.string().optional(),symbolName:y.string().optional()}),Bv=y.object({repoPath:y.string(),missionId:y.number()}),Jv=y.object({repoPath:y.string(),format:y.enum(["markdown","json"]).optional(),limit:y.number().optional(),offset:y.number().optional(),since:y.number().optional(),until:y.number().optional()}),Gv=y.object({repoPath:y.string()}),Vv=y.object({repoPath:y.string(),compact:y.boolean().optional()}),qv=y.object({repoPath:y.string(),missionId:y.number()}),Kv=y.object({repoPath:y.string(),missionId:y.number().optional(),depth:y.number().optional(),limit:y.number().optional(),format:y.enum(["mermaid","json"]).optional()}),Yv=y.object({repoPath:y.string(),subPath:y.string().optional(),maxDepth:y.number().int().optional()}),Xv=y.object({repoPath:y.string(),compact:y.boolean().optional()}),Qv=y.object({repoPath:y.string()}),e_=y.object({repoPath:y.string()}),t_=y.object({repoPath:y.string()}),n_=y.object({repoPath:y.string(),query:y.string(),limit:y.number().int().optional(),offset:y.number().int().optional(),compact:y.boolean().optional(),fileType:y.string().optional(),layer:y.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional()}),r_=y.object({repoPath:y.string(),query:y.string(),limit:y.number().int().optional(),offset:y.number().int().optional(),fileType:y.string().optional(),layer:y.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),matchMode:y.enum(["any","all","exact"]).optional()}),i_=y.object({repoPath:y.string(),query:y.string().optional(),key:y.string().optional(),kind:y.enum(["Service","Image","Port","Env"]).optional(),limit:y.number().int().optional(),showUsage:y.boolean().optional()}),o_=y.object({repoPath:y.string(),query:y.string(),limit:y.number().int().optional(),offset:y.number().int().optional(),fileType:y.string().optional(),layer:y.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),ranked:y.boolean().optional()}),s_=y.object({repoPath:y.string(),filePath:y.string().optional(),symbolName:y.string(),depth:y.number().int().optional(),limit:y.number().int().positive().optional(),offset:y.number().int().nonnegative().optional()}),a_=y.object({repoPath:y.string(),filePath:y.string(),symbolName:y.string().optional()}),c_=y.object({repoPath:y.string(),filePath:y.string(),direction:y.enum(["imports","imported_by"]),limit:y.number().int().positive().optional(),offset:y.number().int().nonnegative().optional()}),l_=y.object({repoPath:y.string(),mode:y.enum(["dead-code","circular-deps"]),limit:y.number().int().optional(),excludePatterns:y.array(y.string()).optional(),includeMigrations:y.boolean().optional(),includeFixtures:y.boolean().optional(),confidenceThreshold:y.enum(["all","high","medium"]).optional()}),u_=y.object({repoPath:y.string(),symbolName:y.string(),filePath:y.string().optional(),context:y.enum(["definition","full"]).optional()}),p_=y.object({repoPath:y.string(),filePath:y.string(),detailLevel:y.enum(["structure","signatures","summaries","detailed"]).optional()}),d_=y.object({repoPath:y.string()}),m_=y.object({repoPath:y.string(),deep:y.boolean().optional()}),f_=y.object({repoPath:y.string()}),h_=y.object({repoPath:y.string(),action:y.enum(["install","remove","status"]),enableAutoRefresh:y.boolean().optional(),enableSymbolHealing:y.boolean().optional()}),g_=y.object({repoPath:y.string()}),y_=y.object({repoPaths:y.array(y.string()),status:y.string().optional(),limit:y.number().int().positive().optional(),summarize:y.boolean().optional()}),v_=y.object({parentRepoPath:y.string(),parentMissionId:y.number(),childRepoPath:y.string(),childMissionId:y.number(),relationship:y.string()}),__=y.object({repoPaths:y.array(y.string()),name:y.string().optional()});K();var Ik=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function Ys(n,e){if(!(!n||typeof n!="object"))for(let r in n)typeof n[r]=="string"?["filePath","subPath","path","repoPath","parentRepoPath","childRepoPath"].includes(r)&&(n[r]=e.resolve(n[r])):Array.isArray(n[r])?n[r].forEach(i=>Ys(i,e)):typeof n[r]=="object"&&Ys(n[r],e)}function b_(n){if(!(!n||typeof n!="object")){for(let e of Ik)if(typeof n[e]=="string")try{n[e]=Fn(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?Fn(e):e))}}function x_(n,e){return async r=>{let i=x.child({handler:n});try{b_(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),zt("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new Un(r.repoPath);Ys(r,o)}i.info({args:r},"Handling tool call");let t=await e(r);return i.debug("Tool call successful"),t}catch(t){i.error({err:t},"Error in tool handler");let o=t.message?.includes("Access denied"),s=`Handler '${n}' failed: ${t.message}`;return!o&&r?.repoPath&&(s+=Fr),zt(o?"FORBIDDEN":"INTERNAL_ERROR",s,{stack:t.stack})}}}function $_(n,e,r){return async i=>{let t=x.child({handler:n});try{b_(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),zt("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new Un(i.repoPath);Ys(i,s)}t.info({args:i},"Handling tool call with validation");let o=e.safeParse(i);if(!o.success){let s=o.error.issues.map(a=>`${a.path.length>0?`${a.path.join(".")}: `:""}${a.message}`).join(", ");return t.warn({validationIssues:o.error.issues},"Validation failed"),zt("VALIDATION_ERROR",`Validation error: ${s}`,{issues:o.error.issues})}try{let s=await r(o.data);return t.debug("Tool call successful"),s}catch(s){t.error({err:s},"Error in tool handler");let a=s.message?.includes("Access denied"),c=`Handler '${n}' failed: ${s.message}`,l=o.data;return!a&&l?.repoPath&&(c+=Fr),zt(a?"FORBIDDEN":"INTERNAL_ERROR",c,{stack:s.stack})}}}function li(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=Gh(i,e);return t||n(r)}}var Tk={shadow_ops_plan:{default:Eg},shadow_ops_track:{default:Rg},shadow_ops_briefing:{default:zs},shadow_ops_log:{default:py},shadow_ops_synthesize:{default:ty},shadow_ops_chronicle:{default:ry},shadow_ops_context:{default:li(iy,"shadow_ops_context")},shadow_ops_health:{default:uy},shadow_ops_graph:{default:gy},shadow_ops_crystallize:{default:vy},shadow_recon_tree:{default:_v},shadow_recon_hologram:{default:bv},shadow_recon_topography:{default:$v},shadow_recon_scout:{default:Sv},shadow_recon_onboard:{default:Ev},shadow_search_concept:{default:Qy},shadow_search_symbol:{default:ev},shadow_search_config:{default:nv},shadow_search_path:{default:rv},shadow_analyze_impact:{default:uv},shadow_analyze_flow:{default:mv},shadow_analyze_deps:{default:gv},shadow_analyze_debt:{default:vv},shadow_inspect_symbol:{default:li(Ad,"shadow_inspect_symbol")},shadow_inspect_file:{default:li(Tv,"shadow_inspect_file")},shadow_sync_trace:{default:li(Rv,"shadow_sync_trace")},shadow_sync_index:{default:Pv},shadow_sync_repair:{default:li(Nv,"shadow_sync_repair")},shadow_env_hooks:{default:Ov},shadow_env_diagnose:{default:Av},shadow_workspace_list:{default:jv},shadow_workspace_link:{default:Mv},shadow_workspace_fuse:{default:Uv}},Rk={shadow_ops_plan:Fv,shadow_ops_track:Zv,shadow_ops_briefing:Wv,shadow_ops_log:Hv,shadow_ops_synthesize:Bv,shadow_ops_chronicle:Jv,shadow_ops_context:Vv,shadow_ops_health:Gv,shadow_ops_graph:Kv,shadow_ops_crystallize:qv,shadow_recon_tree:Yv,shadow_recon_hologram:Xv,shadow_recon_topography:Qv,shadow_recon_scout:e_,shadow_recon_onboard:t_,shadow_search_concept:n_,shadow_search_symbol:r_,shadow_search_config:i_,shadow_search_path:o_,shadow_analyze_impact:s_,shadow_analyze_flow:a_,shadow_analyze_deps:c_,shadow_analyze_debt:l_,shadow_inspect_symbol:u_,shadow_inspect_file:p_,shadow_sync_trace:d_,shadow_sync_index:m_,shadow_sync_repair:f_,shadow_env_hooks:h_,shadow_env_diagnose:g_,shadow_workspace_list:y_,shadow_workspace_link:v_,shadow_workspace_fuse:__},jd=new Map;for(let[n,e]of Object.entries(Tk)){let r=Rk[n];r?jd.set(n,$_(n,r,async i=>{if(e.default)return e.default(i);let t=i.mode||i.action;if(!t){let s=Object.keys(e);return{content:[{type:"text",text:`Missing required parameter "mode" or "action" for tool ${n}.
940
968
 
941
969
  \u{1F4A1} Solution: Specify one of: ${s.join(", ")}`}],isError:!0}}let o=e[t];if(!o){let s=Object.keys(e);return{content:[{type:"text",text:`Invalid mode/action "${t}" for tool ${n}.
942
970
 
943
- \u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):Pd.set(n,t_(n,async i=>{if(e.default)return e.default(i);let t=i.mode||i.action;if(!t)throw new Error(`Missing mode/action for tool ${n}`);let o=e[t];if(!o)throw new Error(`Unknown mode/action '${t}' for tool ${n}`);return o(i)}))}async function r_(n,e){let r=Pd.get(n);if(!r)throw new Error(`Tool not found: ${n}`);return r(e)}var Nd=class{maxRequests;windowMs;timestamps=[];constructor(e={}){this.maxRequests=e.maxRequests??120,this.windowMs=e.windowMs??6e4}prune(e){let r=e-this.windowMs;this.timestamps=this.timestamps.filter(i=>i>r)}allow(){let e=Date.now();return this.prune(e),this.timestamps.length>=this.maxRequests?!1:(this.timestamps.push(e),!0)}reset(){this.timestamps=[]}get count(){return this.prune(Date.now()),this.timestamps.length}},QS=new Nd({maxRequests:parseInt(process.env.MCP_RATE_LIMIT_MAX??String(120),10),windowMs:parseInt(process.env.MCP_RATE_LIMIT_WINDOW_MS??String(6e4),10)});function i_(){return QS}J();import{readFileSync as sk}from"fs";var zd;try{zd=JSON.parse(sk(Zn("package.json"),"utf-8"))}catch(n){$.error({err:n},"Failed to parse package.json, using defaults"),zd={name:"liquid-shadow-mcp",version:"0.0.0"}}var ti=new ek({name:"liquid-shadow-mcp",version:zd.version},{capabilities:{tools:{},resources:{}}});ti.setRequestHandler(rk,async()=>({tools:Th}));ti.setRequestHandler(ik,Uh);ti.setRequestHandler(ok,Fh);var ak=i_();ti.setRequestHandler(nk,async n=>{let{name:e,arguments:r}=n.params;if(!ak.allow())return $.warn({name:e},"Rate limit exceeded"),{content:[{type:"text",text:"Rate limit exceeded. Too many requests. Please retry later. Configure with MCP_RATE_LIMIT_MAX and MCP_RATE_LIMIT_WINDOW_MS."}],isError:!0};try{return await r_(e,r)}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}});async function Dd(){$.info("Shutting down gracefully...");try{await Vn(),$.info("Worker pool shutdown complete")}catch(n){$.error({error:n},"Error during cleanup")}}process.on("SIGTERM",async()=>{await Dd(),process.exit(0)});process.on("SIGINT",async()=>{await Dd(),process.exit(0)});async function ck(){Gn(!0);let n=new tk;await ti.connect(n)}ck().catch(async n=>{process.stderr.write(`Server error: ${n.message}
944
- `),await Dd(),process.exit(1)});
971
+ \u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):jd.set(n,x_(n,async i=>{if(e.default)return e.default(i);let t=i.mode||i.action;if(!t)throw new Error(`Missing mode/action for tool ${n}`);let o=e[t];if(!o)throw new Error(`Unknown mode/action '${t}' for tool ${n}`);return o(i)}))}async function S_(n,e){let r=jd.get(n);if(!r)throw new Error(`Tool not found: ${n}`);return r(e)}var Md=class{maxRequests;windowMs;timestamps=[];constructor(e={}){this.maxRequests=e.maxRequests??120,this.windowMs=e.windowMs??6e4}prune(e){let r=e-this.windowMs;this.timestamps=this.timestamps.filter(i=>i>r)}allow(){let e=Date.now();return this.prune(e),this.timestamps.length>=this.maxRequests?!1:(this.timestamps.push(e),!0)}reset(){this.timestamps=[]}get count(){return this.prune(Date.now()),this.timestamps.length}},Pk=new Md({maxRequests:parseInt(process.env.MCP_RATE_LIMIT_MAX??String(120),10),windowMs:parseInt(process.env.MCP_RATE_LIMIT_WINDOW_MS??String(6e4),10)});function k_(){return Pk}tn();Wr();K();import{readFileSync as Ck}from"fs";var Ud;try{Ud=JSON.parse(Ck(Dt("package.json"),"utf-8"))}catch(n){x.error({err:n},"Failed to parse package.json, using defaults"),Ud={name:"liquid-shadow-mcp",version:"0.0.0"}}var ui=new Nk({name:"liquid-shadow-mcp",version:Ud.version},{capabilities:{tools:{},resources:{}}});ui.setRequestHandler(Ok,async()=>({tools:Ah}));ui.setRequestHandler(Lk,Vh);ui.setRequestHandler(Ak,qh);var jk=k_();ui.setRequestHandler(Dk,async n=>{let{name:e,arguments:r}=n.params;if(!jk.allow())return x.warn({name:e},"Rate limit exceeded"),{content:[{type:"text",text:"Rate limit exceeded. Too many requests. Please retry later. Configure with MCP_RATE_LIMIT_MAX and MCP_RATE_LIMIT_WINDOW_MS."}],isError:!0};try{return await S_(e,r)}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}});async function Fd(){x.info("Shutting down gracefully...");try{await Qt(),x.info("Worker pool shutdown complete")}catch(n){x.error({error:n},"Error during cleanup")}}process.on("SIGTERM",async()=>{await Fd(),process.exit(0)});process.on("SIGINT",async()=>{await Fd(),process.exit(0)});async function Mk(){en(!0);let n=new zk;await ui.connect(n)}Mk().catch(async n=>{process.stderr.write(`Server error: ${n.message}
972
+ `),await Fd(),process.exit(1)});