@precisionutilityguild/liquid-shadow 1.0.4 → 1.0.5

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.
Files changed (33) hide show
  1. package/README.md +2 -2
  2. package/dist/data/migrations/000_baseline.sql +277 -0
  3. package/dist/entry/cli/index.js +408 -336
  4. package/dist/entry/mcp/server.js +260 -242
  5. package/dist/index.js +265 -247
  6. package/dist/logic/domain/embeddings/worker.js +1 -1
  7. package/dist/logic/parser/index.js +14 -13
  8. package/dist/skills/shadow_audit/SKILL.md +40 -0
  9. package/dist/skills/shadow_chronicle/SKILL.md +40 -0
  10. package/dist/skills/shadow_continue/SKILL.md +55 -0
  11. package/dist/skills/shadow_crystallize/SKILL.md +41 -0
  12. package/dist/skills/shadow_mission/SKILL.md +50 -0
  13. package/dist/skills/shadow_onboard/SKILL.md +35 -0
  14. package/dist/skills/shadow_research/SKILL.md +34 -0
  15. package/dist/skills/shadow_sync/SKILL.md +18 -0
  16. package/dist/skills/shadow_synthesize/SKILL.md +47 -0
  17. package/dist/skills/shadow_trace_impact/SKILL.md +55 -0
  18. package/dist/skills/shadow_understand/SKILL.md +51 -0
  19. package/dist/skills/shadow_workspace/SKILL.md +30 -0
  20. package/dist/web-manifest.json +1 -1
  21. package/package.json +3 -2
  22. package/skills/shadow_audit/SKILL.md +40 -0
  23. package/skills/shadow_chronicle/SKILL.md +40 -0
  24. package/skills/shadow_continue/SKILL.md +55 -0
  25. package/skills/shadow_crystallize/SKILL.md +41 -0
  26. package/skills/shadow_mission/SKILL.md +50 -0
  27. package/skills/shadow_onboard/SKILL.md +35 -0
  28. package/skills/shadow_research/SKILL.md +34 -0
  29. package/skills/shadow_sync/SKILL.md +18 -0
  30. package/skills/shadow_synthesize/SKILL.md +47 -0
  31. package/skills/shadow_trace_impact/SKILL.md +55 -0
  32. package/skills/shadow_understand/SKILL.md +51 -0
  33. package/skills/shadow_workspace/SKILL.md +30 -0
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{for(var r in e)L_(n,r,{get:e[r],enumerable:!0})};import SS from"pino";var $S,wS,b,B=pe(()=>{"use strict";$S={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},wS=SS({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(n,e){return{level:n,severity:$S[e]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),b=wS});import Br from"fs";import ld from"path";import{fileURLToPath as IS}from"url";function PS(n){n.exec(`
2
+ var ob=Object.defineProperty;var me=(n,e)=>()=>(n&&(e=n(n=0)),e);var Fe=(n,e)=>{for(var r in e)ob(n,r,{get:e[r],enumerable:!0})};import GS from"pino";var JS,VS,$,V=me(()=>{"use strict";JS={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},VS=GS({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(n,e){return{level:n,severity:JS[e]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),$=VS});import on from"fs";import us from"path";import{fileURLToPath as YS}from"url";function e$(){let n=QS;if(on.readdirSync(n).some(i=>i.match(/^\d{3}_.*\.sql$/)))return n;let r=us.resolve(n,"../../data/migrations");return on.existsSync(r)&&on.readdirSync(r).some(i=>i.match(/^\d{3}_.*\.sql$/))?r:n}function t$(n){n.exec(`
3
3
  CREATE TABLE IF NOT EXISTS schema_migrations (
4
- version INTEGER PRIMARY KEY,
5
- name TEXT NOT NULL,
6
- applied_at REAL DEFAULT (unixepoch())
4
+ version INTEGER PRIMARY KEY,
5
+ name TEXT NOT NULL,
6
+ applied_at REAL DEFAULT (unixepoch())
7
7
  );
8
- `)}function NS(n){PS(n);let e=n.prepare("SELECT version FROM schema_migrations ORDER BY version").all();return new Set(e.map(r=>r.version))}function zS(){let n=RS;if(!Br.readdirSync(n).some(o=>o.match(/^\d{3}_.*\.sql$/))){let o=ld.resolve(n,"../../data/migrations");Br.existsSync(o)&&Br.readdirSync(o).some(a=>a.match(/^\d{3}_.*\.sql$/))&&(n=o)}let i=Br.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=Br.readFileSync(ld.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 DS(n,e){Jr.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)})(),Jr.info({version:e.version},"Migration applied successfully")}function Lg(n){let e=NS(n),i=zS().filter(t=>!e.has(t.version));if(i.length===0){Jr.debug("No pending migrations");return}Jr.info({count:i.length},"Running pending migrations");for(let t of i)DS(n,t);Jr.info("All migrations complete")}var Jr,TS,RS,Og=pe(()=>{"use strict";B();Jr=b.child({module:"migrations"}),TS=IS(import.meta.url),RS=ld.dirname(TS)});import AS from"better-sqlite3";import os from"path";import ud from"fs";import Cg from"crypto";import LS from"os";function as(n){let e=LS.homedir(),r=os.join(e,".mcp-liquid-shadow"),i=os.join(r,"dbs");ud.existsSync(i)||ud.mkdirSync(i,{recursive:!0});let t=Cg.createHash("sha256").update(n).digest("hex").substring(0,12),s=`${os.basename(n).replace(/[^a-zA-Z0-9-_]/g,"_")}_${t}.db`;return os.join(i,s)}function jg(n,e){let r=e||as(n);gt.debug({repoPath:n,dbPath:r},"Initializing database");let i=new AS(r);return i.pragma("journal_mode = WAL"),i.pragma("busy_timeout = 5000"),Lg(i),ss.set(n,r),At.set(r,i),gt.debug({repoPath:n,dbPath:r},"Database initialized successfully"),i}function nn(n){return Cg.createHash("sha256").update(n,"utf8").digest("hex")}function pd(n,e){return e?nn(n)!==e:!0}function Ne(n){let e=ss.get(n)||as(n),r=At.get(e);if(r){if(r.open)return r;At.delete(e)}let i=jg(n);return At.set(e,i),i}function qe(n){let e=as(n);if(!ud.existsSync(e))return!1;try{let r=Ne(n);return r.prepare(`
8
+ `)}function n$(n){t$(n);let e=n.prepare("SELECT version FROM schema_migrations ORDER BY version").all();return new Set(e.map(r=>r.version))}function r$(n){return on.readdirSync(n).filter(r=>r.match(/^\d{3}_.*\.sql$/)&&!r.startsWith("000_")).sort().map(r=>{let i=r.match(/^(\d{3})_(.+)\.sql$/),t=parseInt(i[1],10),o=i[2],a=on.readFileSync(us.join(n,r),"utf-8").split(/^-- DOWN$/m);return{version:t,name:o,up:a[0].trim(),down:a[1]?.trim()}})}function i$(n,e){At.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)})(),At.info({version:e.version},"Migration applied successfully")}function o$(n,e,r){let i=us.join(e,"000_baseline.sql");if(!on.existsSync(i)){At.warn("000_baseline.sql not found \u2014 falling back to incremental migrations");return}At.info("Fresh database detected \u2014 applying consolidated baseline schema");let t=on.readFileSync(i,"utf-8");n.transaction(()=>{n.exec(t);let o=n.prepare("INSERT OR IGNORE INTO schema_migrations (version, name) VALUES (?, ?)");for(let s of r)o.run(s.version,s.name)})(),At.info({stamped:r.length},"Baseline applied \u2014 incremental migrations stamped")}function Gg(n){let e=n$(n),r=e$(),i=r$(r);if(e.size===0){o$(n,r,i);return}let t=i.filter(o=>!e.has(o.version));if(t.length===0){At.debug("No pending migrations");return}At.info({count:t.length},"Running pending migrations");for(let o of t)i$(n,o);At.info("All migrations complete")}var At,XS,QS,Jg=me(()=>{"use strict";V();At=$.child({module:"migrations"}),XS=YS(import.meta.url),QS=us.dirname(XS)});import s$ from"better-sqlite3";import ps from"path";import yd from"fs";import Vg from"crypto";import a$ from"os";function ms(n){let e=a$.homedir(),r=ps.join(e,".mcp-liquid-shadow"),i=ps.join(r,"dbs");yd.existsSync(i)||yd.mkdirSync(i,{recursive:!0});let t=Vg.createHash("sha256").update(n).digest("hex").substring(0,12),s=`${ps.basename(n).replace(/[^a-zA-Z0-9-_]/g,"_")}_${t}.db`;return ps.join(i,s)}function qg(n,e){let r=e||ms(n);vt.debug({repoPath:n,dbPath:r},"Initializing database");let i=new s$(r);return i.pragma("journal_mode = WAL"),i.pragma("busy_timeout = 5000"),Gg(i),ds.set(n,r),Lt.set(r,i),vt.debug({repoPath:n,dbPath:r},"Database initialized successfully"),i}function sn(n){return Vg.createHash("sha256").update(n,"utf8").digest("hex")}function vd(n,e){return e?sn(n)!==e:!0}function Le(n){let e=ds.get(n)||ms(n),r=Lt.get(e);if(r){if(r.open)return r;Lt.delete(e)}let i=qg(n);return Lt.set(e,i),i}function et(n){let e=ms(n);if(!yd.existsSync(e))return!1;try{let r=Le(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 gt.debug({repoPath:n,error:r},"Error checking index status"),!1}}function cs(n,e){let r=Ne(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)})(),gt.debug({repoPath:n,commitSha:e},"Repository marked as indexed")}function dd(n){try{return Ne(n).prepare(`
11
+ `).get()?.value==="true"?!0:r.prepare("SELECT COUNT(*) as count FROM files").get().count>0}catch(r){return vt.debug({repoPath:n,error:r},"Error checking index status"),!1}}function fs(n,e){let r=Le(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)})(),vt.debug({repoPath:n,commitSha:e},"Repository marked as indexed")}function _d(n){try{return Le(n).prepare(`
12
12
  SELECT value FROM index_metadata
13
13
  WHERE key = 'last_indexed_commit'
14
- `).get()?.value||null}catch(e){return gt.debug({repoPath:n,error:e},"Error getting last indexed commit"),null}}function md(n){let e=ss.get(n)||as(n),r=At.get(e);r&&(r.open&&(gt.debug({repoPath:n,dbPath:e},"Closing database connection"),r.close()),At.delete(e)),ss.delete(n)}function Mg(){for(let[n,e]of At.entries())try{e.open&&(gt.debug({dbPath:n},"Closing database connection"),e.close())}catch(r){gt.error({dbPath:n,err:r},"Error closing database execution")}At.clear()}var gt,At,ss,Ug,Lt=pe(()=>{"use strict";B();Og();gt=b.child({module:"db"});At=new Map,ss=new Map;process.on("exit",()=>Mg());Ug=n=>{gt.debug({signal:n},"Received termination signal, closing databases"),Mg(),process.exit(0)};process.on("SIGINT",()=>Ug("SIGINT"));process.on("SIGTERM",()=>Ug("SIGTERM"))});var ge,ot=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 JS from"path";var us,Xg=pe(()=>{"use strict";ot();us=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=JS.resolve(e,r),t=i.endsWith("/")?i:i+"/";return this.all(`
14
+ `).get()?.value||null}catch(e){return vt.debug({repoPath:n,error:e},"Error getting last indexed commit"),null}}function bd(n){let e=ds.get(n)||ms(n),r=Lt.get(e);r&&(r.open&&(vt.debug({repoPath:n,dbPath:e},"Closing database connection"),r.close()),Lt.delete(e)),ds.delete(n)}function Kg(){for(let[n,e]of Lt.entries())try{e.open&&(vt.debug({dbPath:n},"Closing database connection"),e.close())}catch(r){vt.error({dbPath:n,err:r},"Error closing database execution")}Lt.clear()}var vt,Lt,ds,Yg,Ot=me(()=>{"use strict";V();Jg();vt=$.child({module:"db"});Lt=new Map,ds=new Map;process.on("exit",()=>Kg());Yg=n=>{vt.debug({signal:n},"Received termination signal, closing databases"),Kg(),process.exit(0)};process.on("SIGINT",()=>Yg("SIGINT"));process.on("SIGTERM",()=>Yg("SIGTERM"))});var ve,lt=me(()=>{"use strict";ve=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 v$ from"path";var gs,ly=me(()=>{"use strict";lt();gs=class extends ve{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=v$.resolve(e,r),t=i.endsWith("/")?i:i+"/";return this.all(`
15
15
  SELECT * FROM files
16
16
  WHERE (path LIKE ? OR path = ?)
17
17
  ORDER BY path ASC
@@ -26,7 +26,16 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
26
26
  SELECT * FROM files
27
27
  WHERE ${i}
28
28
  LIMIT ?
29
- `,...e.map(t=>`%${t}%`),r)}getContent(e){return this.get("SELECT content FROM file_content WHERE file_path = ?",e)?.content}findContentByToken(e,r=10){return this.all(`
29
+ `,...e.map(t=>`%${t}%`),r)}findContentFts(e,r=50){let i=this.buildContentFtsQuery(e);return i?this.all(`
30
+ SELECT
31
+ files.*,
32
+ bm25(content_fts, 0.2, 1.0) AS bm25_rank
33
+ FROM content_fts
34
+ JOIN files ON files.path = content_fts.file_path
35
+ WHERE content_fts MATCH ?
36
+ ORDER BY bm25_rank ASC
37
+ LIMIT ?
38
+ `,i,Math.max(1,Math.min(r,1e3))):[]}getContent(e){return this.get("SELECT content FROM file_content WHERE file_path = ?",e)?.content}findContentByToken(e,r=10){return this.all(`
30
39
  SELECT file_path
31
40
  FROM content_fts
32
41
  WHERE content_fts MATCH ?
@@ -48,14 +57,14 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
48
57
  OR m.id IN (${e.length>0?e.join(","):"-1"})
49
58
  )
50
59
  AND ws.file_path IS NOT NULL
51
- `,o=[];r&&o.push(r);let s=this.all(t,...o);for(let l of s){i[l.file_path]||(i[l.file_path]={score:1,reasons:[]});let u=l.status==="in-progress"||l.status==="verifying"?1:.5;i[l.file_path].score+=u;let p=l.status==="in-progress"||l.status==="verifying"?"Working Set":"Lineage Bleed";i[l.file_path].reasons.push(`${p}: ${l.mission_name}`)}let a=Math.floor(Date.now()/1e3)-86400,c=this.all(`
60
+ `,o=[];r&&o.push(r);let s=this.all(t,...o);for(let l of s){i[l.file_path]||(i[l.file_path]={score:1,reasons:[]});let u=l.status==="in-progress"||l.status==="verifying"?1:.5;i[l.file_path].score+=u;let d=l.status==="in-progress"||l.status==="verifying"?"Working Set":"Lineage Bleed";i[l.file_path].reasons.push(`${d}: ${l.mission_name}`)}let a=Math.floor(Date.now()/1e3)-86400,c=this.all(`
52
61
  SELECT file_path, type, mission_id
53
62
  FROM intent_logs
54
63
  WHERE (created_at > ? OR mission_id IN (${e.length>0?e.join(","):"-1"}))
55
64
  AND file_path IS NOT NULL
56
65
  ORDER BY created_at DESC
57
66
  LIMIT 100
58
- `,a);for(let l of c){i[l.file_path]||(i[l.file_path]={score:1,reasons:[]});let u=l.mission_id?e.includes(l.mission_id):!1,p=u?.1:.2;i[l.file_path].score<5&&(i[l.file_path].score+=p);let d=u?`Lineage Intent: ${l.type}`:`Recent Intent: ${l.type}`;!i[l.file_path].reasons.includes(d)&&i[l.file_path].reasons.length<5&&i[l.file_path].reasons.push(d)}return i}getCount(){return this.get("SELECT COUNT(*) as count FROM files")?.count||0}getTopDirectories(e,r=8){return this.all(`
67
+ `,a);for(let l of c){i[l.file_path]||(i[l.file_path]={score:1,reasons:[]});let u=l.mission_id?e.includes(l.mission_id):!1,d=u?.1:.2;i[l.file_path].score<5&&(i[l.file_path].score+=d);let p=u?`Lineage Intent: ${l.type}`:`Recent Intent: ${l.type}`;!i[l.file_path].reasons.includes(p)&&i[l.file_path].reasons.length<5&&i[l.file_path].reasons.push(p)}return i}getCount(){return this.get("SELECT COUNT(*) as count FROM files")?.count||0}getTopDirectories(e,r=8){return this.all(`
59
68
  SELECT
60
69
  SUBSTR(path, LENGTH(?) + 2,
61
70
  INSTR(SUBSTR(path, LENGTH(?) + 2), '/') - 1
@@ -78,7 +87,7 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
78
87
  SUBSTR(path, LENGTH(?) + 2) as relPath
79
88
  FROM files
80
89
  WHERE path LIKE ? || '/%/package.json'
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(`
90
+ `,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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"),d=this.db.prepare("INSERT INTO imports (file_path, module_specifier, imported_symbols, resolved_path) VALUES (?, ?, ?, ?)"),p=this.db.prepare("INSERT INTO configs (file_path, key, value, kind) VALUES (?, ?, ?, ?)"),f=this.db.prepare("INSERT INTO file_content (file_path, content) VALUES (?, ?)"),m=this.db.prepare("INSERT INTO event_synapses (file_path, type, name, direction, line_number, code_snippet) VALUES (?, ?, ?, ?, ?, ?)"),h=this.db.prepare(`
82
91
  INSERT INTO files (path, mtime, last_scanned_at, classification, summary, embedding, content_hash)
83
92
  VALUES (?, ?, ?, ?, ?, ?, ?)
84
93
  ON CONFLICT(path) DO UPDATE SET
@@ -88,7 +97,7 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
88
97
  summary=excluded.summary,
89
98
  embedding=excluded.embedding,
90
99
  content_hash=excluded.content_hash
91
- `),_=this.db.transaction(y=>{for(let w of y){let{meta:S,exports:$,imports:E,configs:T,events:R,content:U,classification:I,summary:A,embedding:Z,contentHash:J}=w;o.run(S.path),s.run(S.path),a.run(S.path),c.run(S.path),l.run(S.path);let O=J??(U&&i?i(U):null);if(h.run(S.path,S.mtime,Date.now(),I||"Unknown",A||"",Z?JSON.stringify(Z):null,O),$){let P=(H,G,F)=>{for(let M of G){let ue=M.embedding?JSON.stringify(M.embedding):null,V=u.run(H,M.name,M.kind,M.signature,M.doc||"",M.line,M.endLine||M.line,M.classification||"Other",M.capabilities||"[]",F,ue);M.members&&M.members.length>0&&P(H,M.members,V.lastInsertRowid)}};P(S.path,$,null)}if(E)for(let P of E){let H=P.resolved_path!==void 0?P.resolved_path:t?.(P.module,S.path,r)??"";p.run(S.path,P.module,P.name,H)}if(T)for(let P of T)d.run(S.path,P.key,P.value,P.kind);if(U!==void 0&&m.run(S.path,U),R)for(let P of R)f.run(S.path,P.type,P.name,P.direction,P.line,P.snippet)}}),v=500;for(let y=0;y<e.length;y+=v)_(e.slice(y,y+v))}getLatestScanTime(){return this.get("SELECT MAX(last_scanned_at) as t FROM files")?.t||null}}});var ps,Qg=pe(()=>{"use strict";ot();ps=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(`
100
+ `),_=this.db.transaction(g=>{for(let b of g){let{meta:x,exports:k,imports:S,configs:P,events:R,content:U,classification:E,summary:I,embedding:N,contentHash:j}=b;o.run(x.path),s.run(x.path),a.run(x.path),c.run(x.path),l.run(x.path);let D=j??(U&&i?i(U):null);if(h.run(x.path,x.mtime,Date.now(),E||"Unknown",I||"",N?JSON.stringify(N):null,D),k){let z=(H,G,W)=>{for(let Z of G){let Y=Z.embedding?JSON.stringify(Z.embedding):null,J=u.run(H,Z.name,Z.kind,Z.signature,Z.doc||"",Z.line,Z.endLine||Z.line,Z.classification||"Other",Z.capabilities||"[]",W,Y);Z.members&&Z.members.length>0&&z(H,Z.members,J.lastInsertRowid)}};z(x.path,k,null)}if(S)for(let z of S){let H=z.resolved_path!==void 0?z.resolved_path:t?.(z.module,x.path,r)??"";d.run(x.path,z.module,z.name,H)}if(P)for(let z of P)p.run(x.path,z.key,z.value,z.kind);if(U!==void 0&&f.run(x.path,U),R)for(let z of R)m.run(x.path,z.type,z.name,z.direction,z.line,z.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}buildContentFtsQuery(e){let r=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>=2).slice(0,12);if(r.length===0)return"";if(r.length===1)return`${r[0]}*`;let i=`"${r.join(" ")}"`,t=r.map(o=>`${o}*`).join(" OR ");return`${i} OR ${t}`}}});var ys,uy=me(()=>{"use strict";lt();ys=class n extends ve{static HTTP_METHOD_EXPORTS=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]);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(`
92
101
  SELECT * FROM exports
93
102
  WHERE file_path = ? AND start_line <= ? AND end_line >= ?
94
103
  ORDER BY (end_line - start_line) ASC -- Get innermost symbol
@@ -179,7 +188,7 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
179
188
  SELECT * FROM exports
180
189
  WHERE lower(name) LIKE ?
181
190
  LIMIT ?
182
- `,`%${e.toLowerCase()}%`,r)}getAllNames(e=5e3){return this.all("SELECT DISTINCT name FROM exports WHERE parent_id IS NULL LIMIT ?",e).map(i=>i.name)}countByFile(e){return this.get("SELECT COUNT(*) as count FROM exports WHERE file_path = ?",e)?.count||0}findDeadExports(e={}){let{limit:r=50,includeTests:i=!1,includeMigrations:t=!1,includeFixtures:o=!1,excludePatterns:s=[],confidenceThreshold:a="all"}=e,c=[];i||(c.push("e.file_path NOT LIKE '%/test/%'"),c.push("e.file_path NOT LIKE '%/tests/%'"),c.push("e.file_path NOT LIKE '%/__tests__/%'"),c.push("e.file_path NOT LIKE '%.spec.%'"),c.push("e.file_path NOT LIKE '%.test.%'")),t||(c.push("e.file_path NOT LIKE '%/migrations/%'"),c.push("e.file_path NOT LIKE '%/migration/%'"),c.push("e.file_path NOT LIKE '%Migration.%'")),o||(c.push("e.file_path NOT LIKE '%/__fixtures__/%'"),c.push("e.file_path NOT LIKE '%/__mocks__/%'"),c.push("e.file_path NOT LIKE '%/fixtures/%'"),c.push("e.file_path NOT LIKE '%/mocks/%'"),c.push("e.file_path NOT LIKE '%.fixture.%'"),c.push("e.file_path NOT LIKE '%.mock.%'"));for(let m of s){let f=m.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_");c.push(`e.file_path NOT LIKE '${f}'`)}let l=c.length>0?`AND ${c.join(" AND ")}`:"",p=this.all(`
191
+ `,`%${e.toLowerCase()}%`,r)}getAllNames(e=5e3){return this.all("SELECT DISTINCT name FROM exports WHERE parent_id IS NULL LIMIT ?",e).map(i=>i.name)}countByFile(e){return this.get("SELECT COUNT(*) as count FROM exports WHERE file_path = ?",e)?.count||0}findDeadExports(e={}){let{limit:r=50,includeTests:i=!1,includeMigrations:t=!1,includeFixtures:o=!1,excludePatterns:s=[],confidenceThreshold:a="all"}=e,c=[];i||(c.push("e.file_path NOT LIKE '%/test/%'"),c.push("e.file_path NOT LIKE '%/tests/%'"),c.push("e.file_path NOT LIKE '%/__tests__/%'"),c.push("e.file_path NOT LIKE '%.spec.%'"),c.push("e.file_path NOT LIKE '%.test.%'")),t||(c.push("e.file_path NOT LIKE '%/migrations/%'"),c.push("e.file_path NOT LIKE '%/migration/%'"),c.push("e.file_path NOT LIKE '%Migration.%'")),o||(c.push("e.file_path NOT LIKE '%/__fixtures__/%'"),c.push("e.file_path NOT LIKE '%/__mocks__/%'"),c.push("e.file_path NOT LIKE '%/fixtures/%'"),c.push("e.file_path NOT LIKE '%/mocks/%'"),c.push("e.file_path NOT LIKE '%.fixture.%'"),c.push("e.file_path NOT LIKE '%.mock.%'"));for(let m of s){let h=m.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_");c.push(`e.file_path NOT LIKE '${h}'`)}let l=c.length>0?`AND ${c.join(" AND ")}`:"",p=this.all(`
183
192
  SELECT e.name, e.kind, e.file_path, e.start_line
184
193
  FROM exports e
185
194
  WHERE e.kind IN (
@@ -189,11 +198,18 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
189
198
  )
190
199
  AND e.parent_id IS NULL
191
200
  ${l}
192
- AND NOT EXISTS (SELECT 1 FROM imports i WHERE i.imported_symbols LIKE '%' || e.name || '%')
201
+ AND NOT EXISTS (
202
+ SELECT 1
203
+ FROM imports i
204
+ WHERE REPLACE(i.imported_symbols, ' ', '') = e.name
205
+ OR REPLACE(i.imported_symbols, ' ', '') LIKE e.name || ',%'
206
+ OR REPLACE(i.imported_symbols, ' ', '') LIKE '%,' || e.name
207
+ OR REPLACE(i.imported_symbols, ' ', '') LIKE '%,' || e.name || ',%'
208
+ )
193
209
  AND NOT EXISTS (SELECT 1 FROM imports i WHERE i.resolved_path = e.file_path AND i.imported_symbols LIKE '%*%')
194
210
  ORDER BY e.file_path, e.start_line
195
211
  LIMIT ?
196
- `,r*2).map(m=>{let{confidence:f,reason:h}=this.scoreDeadExportConfidence(m);return{...m,confidence:f,reason:h}}),d=p;return a==="high"?d=p.filter(m=>m.confidence==="high"):a==="medium"&&(d=p.filter(m=>m.confidence==="high"||m.confidence==="medium")),d.slice(0,r)}scoreDeadExportConfidence(e){let r=e.file_path.toLowerCase(),i=e.name;return r.includes("/index.")||r.endsWith("index.ts")||r.endsWith("index.js")?{confidence:"low",reason:"Barrel/index file - likely re-export"}:e.kind==="TsInterfaceDeclaration"||e.kind==="TsTypeAliasDeclaration"?{confidence:"medium",reason:"Type definition - may be used externally"}:r.includes("/entry/")||r.includes("/bin/")||r.includes("main.")||r.includes("server.")||r.includes("cli.")?{confidence:"medium",reason:"Entry point - may be invoked externally"}:i.startsWith("create")||i.endsWith("Factory")||i.endsWith("Builder")?{confidence:"medium",reason:"Factory/builder pattern - may be used dynamically"}:i.startsWith("use")&&i.length>3?{confidence:"medium",reason:"Hook pattern - may be used in components"}:{confidence:"high",reason:"No detected usage"}}getGravityMap(e=[],r){let i={},t=`
212
+ `,r*2).filter(m=>!this.isFrameworkEntrypointExport(m)).map(m=>{let{confidence:h,reason:_}=this.scoreDeadExportConfidence(m);return{...m,confidence:h,reason:_}}),f=p;return a==="high"?f=p.filter(m=>m.confidence==="high"):a==="medium"&&(f=p.filter(m=>m.confidence==="high"||m.confidence==="medium")),f.slice(0,r)}scoreDeadExportConfidence(e){let r=e.file_path.toLowerCase(),i=e.name;return r.includes("/index.")||r.endsWith("index.ts")||r.endsWith("index.js")?{confidence:"low",reason:"Barrel/index file - likely re-export"}:e.kind==="TsInterfaceDeclaration"||e.kind==="TsTypeAliasDeclaration"?{confidence:"medium",reason:"Type definition - may be used externally"}:r.includes("/entry/")||r.includes("/bin/")||r.includes("main.")||r.includes("server.")||r.includes("cli.")?{confidence:"medium",reason:"Entry point - may be invoked externally"}:(r.includes("/components/")||r.endsWith(".tsx")||r.endsWith(".jsx"))&&/^[A-Z][A-Za-z0-9_]*$/.test(i)?{confidence:"medium",reason:"Component export - may be used by runtime composition"}:(r.includes("/contexts/")||r.includes("/context/"))&&(/Provider$/.test(i)||i.startsWith("use"))?{confidence:"medium",reason:"Context/provider export - may be wired dynamically"}:i.startsWith("create")||i.endsWith("Factory")||i.endsWith("Builder")?{confidence:"medium",reason:"Factory/builder pattern - may be used dynamically"}:i.startsWith("use")&&i.length>3?{confidence:"medium",reason:"Hook pattern - may be used in components"}:{confidence:"high",reason:"No detected usage"}}isFrameworkEntrypointExport(e){let i=e.file_path.toLowerCase().replace(/\\/g,"/"),t=e.name;return!!(/(^|\/)(src\/)?app\/.*\/route\.(t|j)sx?$/.test(i)&&n.HTTP_METHOD_EXPORTS.has(t)||/(^|\/)(src\/)?app\/.*\/(page|layout|loading|error|not-found|default|template)\.(t|j)sx?$/.test(i)||/(^|\/)(src\/)?middleware\.(t|j)sx?$/.test(i)||i.includes("/routes/")&&["loader","action","meta","headers"].includes(t))}getGravityMap(e=[],r){let i={},t=`
197
213
  SELECT ws.symbol_id, m.name as mission_name, m.status
198
214
  FROM working_set ws
199
215
  JOIN missions m ON ws.mission_id = m.id
@@ -202,14 +218,14 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
202
218
  OR m.id IN (${e.length>0?e.join(","):"-1"})
203
219
  )
204
220
  AND ws.symbol_id IS NOT NULL
205
- `,o=[];r&&o.push(r);let s=this.all(t,...o);for(let l of s){i[l.symbol_id]||(i[l.symbol_id]={score:1,reasons:[]});let u=l.status==="in-progress"||l.status==="verifying"?1:.5;i[l.symbol_id].score+=u;let p=l.status==="in-progress"||l.status==="verifying"?"Working Set":"Lineage Bleed";i[l.symbol_id].reasons.push(`${p}: ${l.mission_name}`)}let a=Math.floor(Date.now()/1e3)-86400,c=this.all(`
221
+ `,o=[];r&&o.push(r);let s=this.all(t,...o);for(let l of s){i[l.symbol_id]||(i[l.symbol_id]={score:1,reasons:[]});let u=l.status==="in-progress"||l.status==="verifying"?1:.5;i[l.symbol_id].score+=u;let d=l.status==="in-progress"||l.status==="verifying"?"Working Set":"Lineage Bleed";i[l.symbol_id].reasons.push(`${d}: ${l.mission_name}`)}let a=Math.floor(Date.now()/1e3)-86400,c=this.all(`
206
222
  SELECT symbol_id, type, mission_id
207
223
  FROM intent_logs
208
224
  WHERE (created_at > ? OR mission_id IN (${e.length>0?e.join(","):"-1"}))
209
225
  AND symbol_id IS NOT NULL
210
226
  ORDER BY created_at DESC
211
227
  LIMIT 200
212
- `,a);for(let l of c){i[l.symbol_id]||(i[l.symbol_id]={score:1,reasons:[]});let u=l.mission_id?e.includes(l.mission_id):!1,p=u?.1:.2;i[l.symbol_id].score<5&&(i[l.symbol_id].score+=p);let d=u?`Lineage Intent: ${l.type}`:`Recent Intent: ${l.type}`;!i[l.symbol_id].reasons.includes(d)&&i[l.symbol_id].reasons.length<5&&i[l.symbol_id].reasons.push(d)}return i}getCount(){return this.get("SELECT COUNT(*) as count FROM exports")?.count||0}getKindDistribution(e=5){return this.all(`
228
+ `,a);for(let l of c){i[l.symbol_id]||(i[l.symbol_id]={score:1,reasons:[]});let u=l.mission_id?e.includes(l.mission_id):!1,d=u?.1:.2;i[l.symbol_id].score<5&&(i[l.symbol_id].score+=d);let p=u?`Lineage Intent: ${l.type}`:`Recent Intent: ${l.type}`;!i[l.symbol_id].reasons.includes(p)&&i[l.symbol_id].reasons.length<5&&i[l.symbol_id].reasons.push(p)}return i}getCount(){return this.get("SELECT COUNT(*) as count FROM exports")?.count||0}getKindDistribution(e=5){return this.all(`
213
229
  SELECT kind, COUNT(*) as c
214
230
  FROM exports
215
231
  WHERE kind IS NOT NULL AND kind != ''
@@ -222,7 +238,7 @@ var L_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ce=(n,e)=>{
222
238
  OR name LIKE ?
223
239
  OR name LIKE ?
224
240
  LIMIT 10
225
- `,e,`%.${e}`,`%::${e}`)}}});var ey,ty=pe(()=>{"use strict";ey=`
241
+ `,e,`%.${e}`,`%::${e}`)}}});var py,dy=me(()=>{"use strict";py=`
226
242
  WITH RECURSIVE dependency_chain AS (
227
243
  -- Base case: Direct dependents of the target symbol
228
244
  -- Meaning: Files that import the file where the symbol is defined
@@ -273,7 +289,7 @@ SELECT DISTINCT
273
289
  dc.imported_symbols
274
290
  FROM dependency_chain dc
275
291
  ORDER BY dc.depth, dc.consumer_path;
276
- `});var ds,ny=pe(()=>{"use strict";ot();ty();ds=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(`
292
+ `});var vs,my=me(()=>{"use strict";lt();dy();vs=class extends ve{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(`
277
293
  SELECT * FROM imports
278
294
  WHERE resolved_path IS NOT NULL AND resolved_path != ''
279
295
  `)}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(`
@@ -299,7 +315,7 @@ ORDER BY dc.depth, dc.consumer_path;
299
315
  SELECT COUNT(*) as count FROM imports
300
316
  WHERE resolved_path IN (${i})
301
317
  AND (imported_symbols LIKE ? OR imported_symbols = '' OR imported_symbols = '*')
302
- `,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(ey,e,r,i,r)}getCount(){return this.get("SELECT COUNT(*) as count FROM imports")?.count||0}}});var qr,Sd=pe(()=>{"use strict";ot();qr=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
318
+ `,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(py,e,r,i,r)}getCount(){return this.get("SELECT COUNT(*) as count FROM imports")?.count||0}}});var ti,Rd=me(()=>{"use strict";lt();ti=class extends ve{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
303
319
  CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
304
320
  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
305
321
  CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
@@ -329,7 +345,7 @@ ORDER BY dc.depth, dc.consumer_path;
329
345
  SELECT AVG(updated_at - created_at) AS avg_duration
330
346
  FROM missions
331
347
  WHERE status = 'completed' AND updated_at > created_at
332
- `),t=i?.avg_duration!=null?Math.round(i.avg_duration):null,o=Math.floor(Date.now()/1e3)-168*3600,s=Math.floor(Date.now()/1e3)-720*3600,a=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",o),c=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",s),l=a?.n??0,u=c?.n??0,p=`${l} completed in last 7 days, ${u} in last 30 days.`;if(t!=null){let d=Math.round(t/60);p+=` Avg mission duration: ${d} min.`}return{completionRate:r,averageDurationSeconds:t,completedLast7Days:l,completedLast30Days:u,velocityNote:p}}suspendByBranch(e){this.run(`UPDATE missions
348
+ `),t=i?.avg_duration!=null?Math.round(i.avg_duration):null,o=Math.floor(Date.now()/1e3)-168*3600,s=Math.floor(Date.now()/1e3)-720*3600,a=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",o),c=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",s),l=a?.n??0,u=c?.n??0,d=`${l} completed in last 7 days, ${u} in last 30 days.`;if(t!=null){let p=Math.round(t/60);d+=` Avg mission duration: ${p} min.`}return{completionRate:r,averageDurationSeconds:t,completedLast7Days:l,completedLast30Days:u,velocityNote:d}}suspendByBranch(e){this.run(`UPDATE missions
333
349
  SET status = 'suspended', updated_at = unixepoch()
334
350
  WHERE git_branch = ? AND status IN ('in-progress', 'planned', 'verifying')`,e)}resumeByBranch(e){this.run(`UPDATE missions
335
351
  SET status = 'in-progress', updated_at = unixepoch()
@@ -354,7 +370,7 @@ ORDER BY dc.depth, dc.consumer_path;
354
370
  SELECT linked_repo_path, linked_mission_id, relationship, direction
355
371
  FROM cross_repo_links
356
372
  WHERE mission_id = ?
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 GS}from"node:url";import{dirname as $d,join as iy,resolve as VS}from"node:path";import{existsSync as qS}from"node:fs";function YS(){let n=ry;for(;n!==$d(n);){if(qS(iy(n,"package.json")))return n;n=$d(n)}return VS(ry,"..","..")}function Ct(...n){return iy(YS(),...n)}var KS,ry,Kr=pe(()=>{"use strict";KS=GS(import.meta.url),ry=$d(KS)});import{Worker as XS}from"node:worker_threads";import{cpus as QS}from"node:os";import{fileURLToPath as e$}from"node:url";import{dirname as t$,join as oy}from"node:path";import{existsSync as sy}from"node:fs";function n$(){if(cy.endsWith(".ts")){let e=oy(ay,"worker.ts");if(sy(e))return e}let n=oy(ay,"worker.js");return sy(n)?n:Ct("dist/logic/domain/embeddings/worker.js")}function on(n){return qn||(qn=new Kn(n)),qn}async function sn(){qn&&(await qn.shutdown(),qn=null)}var cy,ay,Kn,qn,ly=pe(()=>{"use strict";B();Kr();cy=e$(import.meta.url),ay=t$(cy);Kn=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,QS().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{b.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,b.debug("Initialization completed but shutdown was requested");return}this.initialized=!0,b.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=n$();b.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 XS(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){b.debug({workerIndex:r},"Worker ready but shutdown requested, terminating"),s.terminate().catch(()=>{}),i();return}this.workers.push(a),b.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),b.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=>{b.error({err:u},"Failed to replace crashed worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&b.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++,b.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 b.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}b.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,b.info("Embedding worker pool shutdown complete")}},qn=null});var Xr={};Ce(Xr,{EmbeddingPriorityQueue:()=>ms,EmbeddingWorkerPool:()=>Kn,cosineSimilarity:()=>gs,generateEmbedding:()=>fs,generateEmbeddingsBatch:()=>hs,getDefaultPool:()=>on,setUseWorkerThreads:()=>an,shutdownDefaultPool:()=>sn});async function r$(){return Yr||(Yr=await import("@xenova/transformers"),Yr.env.cacheDir="./.cache",Yr.env.allowLocalModels=!0),Yr}function an(n){kd=n,b.info({useWorkerThreads:n},"Worker thread mode updated")}async function py(){return wd||(wd=(async()=>{b.info("Loading embedding model (all-MiniLM-L6-v2)...");let{pipeline:n}=await r$();return await n("feature-extraction","Xenova/all-MiniLM-L6-v2")})()),wd}async function fs(n){try{let r=await(await py())(n,{pooling:"mean",normalize:!0});return Array.from(r.data)}catch(e){return b.error({err:e},"Failed to generate embedding"),null}}async function hs(n,e=uy,r){return n.length===0?[]:kd?on().generateEmbeddings(n,e,r):dy(n,e,r)}async function dy(n,e,r){let i=new Array(n.length).fill(null),t=await py();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){b.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 b.debug({total:n.length,successful:i.filter(o=>o!==null).length},"Batch embedding complete"),i}function gs(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 Yr,uy,kd,wd,ms,vt=pe(()=>{"use strict";B();ly();Yr=null;uy=128,kd=!1;wd=null;ms=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=uy,r){if(this.processing)return b.warn("Queue processing already in progress"),this.results;this.processing=!0;let i=this.queue.length;try{kd?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 dy(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 on().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 ys,my=pe(()=>{"use strict";ot();B();ys=class n extends ge{findByMission(e,r=50){return this.all(`
373
+ `,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 _$}from"node:url";import{dirname as Pd,join as hy,resolve as b$}from"node:path";import{existsSync as x$}from"node:fs";function $$(){let n=fy;for(;n!==Pd(n);){if(x$(hy(n,"package.json")))return n;n=Pd(n)}return b$(fy,"..","..")}function Mt(...n){return hy($$(),...n)}var S$,fy,ni=me(()=>{"use strict";S$=_$(import.meta.url),fy=Pd(S$)});import{Worker as w$}from"node:worker_threads";import{cpus as k$}from"node:os";import{fileURLToPath as E$}from"node:url";import{dirname as I$,join as gy}from"node:path";import{existsSync as yy}from"node:fs";function T$(){if(_y.endsWith(".ts")){let e=gy(vy,"worker.ts");if(yy(e))return e}let n=gy(vy,"worker.js");return yy(n)?n:Mt("dist/logic/domain/embeddings/worker.js")}function cn(n){return er||(er=new tr(n)),er}async function ln(){er&&(await er.shutdown(),er=null)}var _y,vy,tr,er,by=me(()=>{"use strict";V();ni();_y=E$(import.meta.url),vy=I$(_y);tr=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,k$().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=T$();$.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 w$(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=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((d,p)=>{let m={id:`task_${++this.taskIdCounter}`,texts:l,resolve:h=>{if(o[u]=h,s++,i){let _=Math.min(s*r,e.length);i(_,e.length)}d()},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)}d()}};this.taskQueue.push(m),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")}},er=null});var oi={};Fe(oi,{EmbeddingPriorityQueue:()=>bs,EmbeddingWorkerPool:()=>tr,cosineSimilarity:()=>$s,generateEmbedding:()=>xs,generateEmbeddingsBatch:()=>Ss,getDefaultPool:()=>cn,setUseWorkerThreads:()=>un,shutdownDefaultPool:()=>ln});async function R$(){return ri||(ri=await import("@xenova/transformers"),ri.env.cacheDir="./.cache",ri.env.allowLocalModels=!0),ri}function un(n){zd=n,$.info({useWorkerThreads:n},"Worker thread mode updated")}function xy(n=!1){let e=(ii||"").toLowerCase(),r={};return ii&&(r.dtype=ii),n?(r.quantized=!1,r):(e==="fp32"||e==="fp16"||e==="float32"||e==="float16"?r.quantized=!1:e.startsWith("q")&&(r.quantized=!0),r)}async function P$(){$.info({model:_s,dtype:ii},"Loading embedding model...");let{pipeline:n}=await R$(),e=xy(!1);try{return await n("feature-extraction",_s,e)}catch(r){let i=r?.message||"";if(!(i.includes("/onnx/model_quantized.onnx")||i.includes("model_quantized.onnx")))throw r;return $.warn({model:_s,dtype:ii},"Quantized ONNX artifact missing, retrying with unquantized ONNX"),await n("feature-extraction",_s,xy(!0))}}async function $y(){return Nd||(Nd=P$()),Nd}async function xs(n){try{let r=await(await $y())(n,{pooling:"mean",normalize:!0});return Array.from(r.data)}catch(e){return $.error({err:e},"Failed to generate embedding"),null}}async function Ss(n,e=Sy,r){return n.length===0?[]:zd?cn().generateEmbeddings(n,e,r):wy(n,e,r)}async function wy(n,e,r){let i=new Array(n.length).fill(null),t=await $y();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 d=0;d<l;d++){let p=d*u,f=p+u;i[o+d]=Array.from(c.data.slice(p,f))}}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 d=await t(u,{pooling:"mean",normalize:!0});i[o+l]=Array.from(d.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 $s(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 _s,ii,ri,Sy,zd,Nd,bs,bt=me(()=>{"use strict";V();by();_s=process.env.EMBEDDING_MODEL??"Xenova/all-MiniLM-L6-v2",ii=process.env.EMBEDDING_DTYPE??"fp32",ri=null;Sy=128,zd=!1;Nd=null;bs=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=Sy,r){if(this.processing)return $.warn("Queue processing already in progress"),this.results;this.processing=!0;let i=this.queue.length;try{zd?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 wy(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 cn().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 ws,ky=me(()=>{"use strict";lt();V();ws=class n extends ve{findByMission(e,r=50){return this.all(`
358
374
  SELECT
359
375
  id, mission_id, symbol_id, file_path, type, content, confidence,
360
376
  symbol_name, signature, commit_sha, is_crystallized, crystal_id,
@@ -375,7 +391,7 @@ ORDER BY dc.depth, dc.consumer_path;
375
391
  `,e)}create(e){let r=this.insert(`
376
392
  INSERT INTO intent_logs (mission_id, symbol_id, file_path, type, content, confidence, symbol_name, signature, commit_sha)
377
393
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
378
- `,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=>{b.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(()=>(vt(),Xr)),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')")}async findSemanticMatches(e,r,i){let{cosineSimilarity:t}=await Promise.resolve().then(()=>(vt(),Xr)),o=this.findWithEmbeddings();if(o.length>5e3)return b.warn({count:o.length},"Intent log count exceeds brute-force vector scan limit (5000). Skipping semantic recall."),[];let s=[];for(let a of o)if(!(i&&a.symbol_id===i))try{let c=JSON.parse(a.embedding),l=t(e,c);l>.25&&s.push({id:a.id,mission_id:a.mission_id,type:a.type,content:a.content,symbol_name:a.symbol_name,file_path:a.file_path,similarity:l,created_at:a.created_at})}catch{}return s.sort((a,c)=>c.similarity-a.similarity).slice(0,r)}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(`
394
+ `,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=>{$.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(()=>(bt(),oi)),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')")}async findSemanticMatches(e,r,i){let{cosineSimilarity:t}=await Promise.resolve().then(()=>(bt(),oi)),o=this.findWithEmbeddings();if(o.length>5e3)return $.warn({count:o.length},"Intent log count exceeds brute-force vector scan limit (5000). Skipping semantic recall."),[];let s=[];for(let a of o)if(!(i&&a.symbol_id===i))try{let c=JSON.parse(a.embedding),l=t(e,c);l>.25&&s.push({id:a.id,mission_id:a.mission_id,type:a.type,content:a.content,symbol_name:a.symbol_name,file_path:a.file_path,similarity:l,created_at:a.created_at})}catch{}return s.sort((a,c)=>c.similarity-a.similarity).slice(0,r)}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(`
379
395
  SELECT id, file_path, symbol_name, signature
380
396
  FROM intent_logs
381
397
  WHERE symbol_id IS NULL AND symbol_name IS NOT NULL
@@ -399,7 +415,7 @@ ORDER BY dc.depth, dc.consumer_path;
399
415
  WHERE id = ?
400
416
  `,e)}importHeritage(e,r,i,t){this.run(`
401
417
  INSERT INTO intent_logs (type, content, commit_sha, created_at, confidence, mission_id)
402
- VALUES ('heritage', ?, ?, ?, ?, 0)
418
+ VALUES ('heritage', ?, ?, ?, ?, NULL)
403
419
  `,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
404
420
  id, mission_id, symbol_id, file_path, type, content, confidence,
405
421
  symbol_name, signature, commit_sha, is_crystallized, crystal_id,
@@ -438,77 +454,77 @@ ORDER BY dc.depth, dc.consumer_path;
438
454
  FROM intent_logs
439
455
  WHERE mission_id = ? AND is_crystallized = 0 AND type NOT IN ('adr', 'system', 'crystal', 'lapsed')
440
456
  AND created_at > ?
441
- 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(()=>(vt(),Xr)),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++)}),b.info({total:o.length,embedded:l},"Intent log embedding backfill complete"),l}}});var vs,fy=pe(()=>{"use strict";ot();vs=class extends ge{findByKey(e,r=20){return this.all(`
457
+ 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(()=>(bt(),oi)),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++)}),$.info({total:o.length,embedded:l},"Intent log embedding backfill complete"),l}}});var ks,Ey=me(()=>{"use strict";lt();ks=class extends ve{findByKey(e,r=20){return this.all(`
442
458
  SELECT file_path, key, value, kind
443
459
  FROM configs
444
460
  WHERE key LIKE ? OR value LIKE ?
445
461
  LIMIT ?
446
- `,`%${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 _s,hy=pe(()=>{"use strict";ot();_s=class extends ge{search(e,r=10){return this.all(`
462
+ `,`%${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 Es,Iy=me(()=>{"use strict";lt();Es=class extends ve{search(e,r=10){return this.all(`
447
463
  SELECT file_path, snippet(content_fts, 1, '<b>', '</b>', '...', 20) as snippet
448
464
  FROM content_fts
449
465
  WHERE content_fts MATCH ?
450
466
  LIMIT ?
451
- `,e,r)}}});var gy,bs,yy=pe(()=>{"use strict";ot();gy=500,bs=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
452
- 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)<=gy||this.run(`DELETE FROM search_history WHERE id NOT IN (
467
+ `,e,r)}}});var Ty,Is,Ry=me(()=>{"use strict";lt();Ty=500,Is=class extends ve{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
468
+ 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)<=Ty||this.run(`DELETE FROM search_history WHERE id NOT IN (
453
469
  SELECT id FROM search_history ORDER BY created_at DESC LIMIT ?
454
- )`,gy)}}});var xs,vy=pe(()=>{"use strict";ot();xs=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(`
470
+ )`,Ty)}}});var Ts,Py=me(()=>{"use strict";lt();Ts=class extends ve{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(`
455
471
  INSERT INTO hologram_snapshot (section, data, updated_at)
456
472
  VALUES (?, ?, unixepoch())
457
473
  ON CONFLICT(section) DO UPDATE SET
458
474
  data = excluded.data,
459
475
  updated_at = excluded.updated_at
460
- `,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 C,Q=pe(()=>{"use strict";Lt();Xg();Qg();ny();Sd();my();fy();hy();yy();vy();C=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=Ne(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=Ne(e),t={files:new us(i),exports:new ps(i),imports:new ds(i),missions:new qr(i),intentLogs:new ys(i),configs:new vs(i),content:new _s(i),searchHistory:new bs(i),hologram:new xs(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),md(e)}static clearCache(e){this.repositoryCache.delete(e)}}});var Is,Ts,wy,Rs,ky,Ey,Iy,Ty,Ry,Py,Ny,zy,Dy,Ay,ei,Ps,Ly,Oy,Id=pe(()=>{"use strict";Is=[/\/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],Ts=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],wy=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],Rs=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],ky=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],Ey=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],Iy=[/\/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],Ty=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],Ry=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],Py=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],Ny=[/\/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],zy=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],Dy=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],Ay=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],ei=[/\.(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)$/],Ps=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],Ly=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],Oy=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var Ns,jy,zs,My,Td=pe(()=>{"use strict";Ns=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],jy=[/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],zs=[/models\.py$/i,/\/models\/.*\.py$/i,/\/migrations\/.*\.py$/i,/schema\.py$/i,/documents\.py$/i],My=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var Ds,Fy,As,Zy,Rd=pe(()=>{"use strict";Ds=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],Fy=[/\/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],As=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],Zy=["laravel","symfony","slim","cakephp","codeigniter"]});import Wy from"path";function Qn(n,e,r){let i=[],t="Unknown",o=0;r||(r=c$(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(Is,"Entry",45,"Next.js entry")),l||(l=c(ky,"Entry",40,"MCP handler")),l||(l=c(Iy,"Entry",40,"CLI command")),l||(l=c(ei,"Data",45,"Data layer/Repository")),l||(l=c(Ny,"Data",35,"State management")),l||(l=c(wy,"Logic",40,"React component")),l||(l=c(Rs,"Logic",35,"Logic pattern")),l||(l=c(Ty,"Logic",35,"Parser/AST")),l||(l=c(Ry,"Logic",35,"Core module")),l||(l=c(Py,"Logic",30,"UI layer")),l||(l=c(Ay,"Types",35,"Type definition")),l||(l=c(Ns,"Entry",40,"Python Entry")),l||(l=c(zs,"Data",40,"Python Data")),l||(l=c(jy,"Logic",35,"Python Logic")),l||(l=c(Ds,"Entry",40,"PHP Entry")),l||(l=c(As,"Data",40,"PHP Data")),l||(l=c(Fy,"Logic",35,"PHP Logic")),l||(l=c(zy,"Logic",35,"Hook/Context")),!l){for(let d of Ey)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(Dy,"Data",35,"Schema definition")&&(l=!0),l||(c(ei,"Data",30,"Path matches data pattern")||c(Ps,"Utility",25,"Path matches utility pattern")||c(Ts,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let d of Pd)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 a$)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 Oy)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 My)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 Zy)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 Ly)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 c$(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function We(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=Qn(f.path,n);i.set(f.path,h),t[h.layer].push({path:f.path,classification:h})}let o={Entry:jt(t.Entry,e),Logic:jt(t.Logic,e),Data:jt(t.Data,e),Utility:jt(t.Utility,e),Infrastructure:jt(t.Infrastructure,e),Test:jt(t.Test,e),Types:jt(t.Types,e),Unknown:jt(t.Unknown,e)},s={};r.forEach(f=>{let h=Wy.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}=l$(o,r.length,n);return{pattern:p,patternConfidence:d,layers:o,insights:m,primaryStack:u}}function jt(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:Wy.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function l$(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 Pd,Nd,a$,_t=pe(()=>{"use strict";Id();Td();Rd();Pd=[/\.(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],a$=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});var By={};Ce(By,{HologramService:()=>ce});var Ke,ce,Oe=pe(()=>{"use strict";Q();_t();B();Ke=b.child({module:"hologram"}),ce=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=C.getInstance(e)}updateTopography(e){Ke.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)),Ke.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=We(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){Ke.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)),Ke.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){Ke.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)),Ke.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){Ke.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 Ke.error({repoPath:this.repoPath,section:e,error:i},"Failed to parse section"),null}}computeGravityZones(){Ke.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=Qn(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 Ke.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),Ke.info({repoPath:this.repoPath},"Hologram cleared")}}});var av={};Ce(av,{GraphExporterService:()=>Ms});var sv,Ms,Ld=pe(()=>{"use strict";Q();B();sv=b.child({module:"graph-exporter"}),Ms=class{constructor(e){this.repoPath=e;this.repos=C.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;sv.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){sv.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(`
461
- `)}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 Ow}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as Cw}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as jw,ListToolsRequestSchema as Mw,ListResourcesRequestSchema as Uw,ReadResourceRequestSchema as Fw}from"@modelcontextprotocol/sdk/types.js";var Um=[{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 Fm=[{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",description:"Mission to attach this log to. Optional \u2014 if omitted, auto-resolves to the active mission or logs as standalone."},type:{type:"string",enum:["decision","blocker","discovery","fix"]},content:{type:"string"},filePath:{type:"string",description:"File path to associate with this log"},symbolName:{type:"string",description:"Symbol related to this intent"},standalone:{type:"boolean",description:"If true, log is anchored to symbolName only (no mission). Requires symbolName."}},required:["repoPath","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_working_set_check",description:"Checks which files are in active mission working sets to detect parallel editing conflicts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePaths:{type:"array",items:{type:"string"}}},required:["repoPath","filePaths"]}},{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 g={};Ce(g,{$brand:()=>hi,$input:()=>Il,$output:()=>El,NEVER:()=>ca,TimePrecision:()=>Nl,ZodAny:()=>bp,ZodArray:()=>wp,ZodBase64:()=>Ho,ZodBase64URL:()=>Wo,ZodBigInt:()=>Gn,ZodBigIntFormat:()=>Go,ZodBoolean:()=>Jn,ZodCIDRv4:()=>Fo,ZodCIDRv6:()=>Zo,ZodCUID:()=>Ao,ZodCUID2:()=>Lo,ZodCatch:()=>Jp,ZodCodec:()=>ts,ZodCustom:()=>Wr,ZodCustomStringFormat:()=>Wn,ZodDate:()=>Mr,ZodDefault:()=>Up,ZodDiscriminatedUnion:()=>Ep,ZodE164:()=>Bo,ZodEmail:()=>No,ZodEmoji:()=>zo,ZodEnum:()=>Zn,ZodError:()=>lS,ZodExactOptional:()=>Cp,ZodFile:()=>Lp,ZodFirstPartyTypeKind:()=>id,ZodFunction:()=>td,ZodGUID:()=>Ar,ZodIPv4:()=>Mo,ZodIPv6:()=>Uo,ZodISODate:()=>ko,ZodISODateTime:()=>wo,ZodISODuration:()=>Io,ZodISOTime:()=>Eo,ZodIntersection:()=>Ip,ZodIssueCode:()=>pS,ZodJWT:()=>Jo,ZodKSUID:()=>jo,ZodLazy:()=>Xp,ZodLiteral:()=>Ap,ZodMAC:()=>mp,ZodMap:()=>zp,ZodNaN:()=>Vp,ZodNanoID:()=>Do,ZodNever:()=>Sp,ZodNonOptional:()=>Qo,ZodNull:()=>vp,ZodNullable:()=>Mp,ZodNumber:()=>Bn,ZodNumberFormat:()=>Qt,ZodObject:()=>Fr,ZodOptional:()=>Xo,ZodPipe:()=>es,ZodPrefault:()=>Zp,ZodPromise:()=>ed,ZodReadonly:()=>qp,ZodRealError:()=>Re,ZodRecord:()=>Hr,ZodSet:()=>Dp,ZodString:()=>Hn,ZodStringFormat:()=>ie,ZodSuccess:()=>Bp,ZodSymbol:()=>gp,ZodTemplateLiteral:()=>Yp,ZodTransform:()=>Op,ZodTuple:()=>Rp,ZodType:()=>Y,ZodULID:()=>Oo,ZodURL:()=>jr,ZodUUID:()=>it,ZodUndefined:()=>yp,ZodUnion:()=>Zr,ZodUnknown:()=>xp,ZodVoid:()=>$p,ZodXID:()=>Co,ZodXor:()=>kp,_ZodString:()=>Po,_default:()=>Fp,_function:()=>xg,any:()=>Qh,array:()=>Ur,base64:()=>Oh,base64url:()=>Ch,bigint:()=>Vh,boolean:()=>hp,catch:()=>Gp,check:()=>Sg,cidrv4:()=>Ah,cidrv6:()=>Lh,clone:()=>Se,codec:()=>vg,coerce:()=>od,config:()=>me,core:()=>ht,cuid:()=>Eh,cuid2:()=>Ih,custom:()=>$g,date:()=>tg,decode:()=>sp,decodeAsync:()=>cp,describe:()=>wg,discriminatedUnion:()=>ag,e164:()=>jh,email:()=>gh,emoji:()=>wh,encode:()=>op,encodeAsync:()=>ap,endsWith:()=>zn,enum:()=>Ko,exactOptional:()=>jp,file:()=>fg,flattenError:()=>xr,float32:()=>Wh,float64:()=>Bh,formatError:()=>Sr,fromJSONSchema:()=>Ng,function:()=>xg,getErrorMap:()=>mS,globalRegistry:()=>_e,gt:()=>nt,gte:()=>$e,guid:()=>yh,hash:()=>Hh,hex:()=>Zh,hostname:()=>Fh,httpUrl:()=>$h,includes:()=>Pn,instanceof:()=>Eg,int:()=>Ro,int32:()=>Jh,int64:()=>qh,intersection:()=>Tp,ipv4:()=>Nh,ipv6:()=>Dh,iso:()=>Fn,json:()=>Tg,jwt:()=>Mh,keyof:()=>ng,ksuid:()=>Ph,lazy:()=>Qp,length:()=>Yt,literal:()=>mg,locales:()=>Pr,looseObject:()=>og,looseRecord:()=>lg,lowercase:()=>Tn,lt:()=>tt,lte:()=>Ae,mac:()=>zh,map:()=>ug,maxLength:()=>Kt,maxSize:()=>Pt,meta:()=>kg,mime:()=>Dn,minLength:()=>ft,minSize:()=>rt,multipleOf:()=>Rt,nan:()=>yg,nanoid:()=>kh,nativeEnum:()=>dg,negative:()=>fo,never:()=>Vo,nonnegative:()=>go,nonoptional:()=>Wp,nonpositive:()=>ho,normalize:()=>An,null:()=>_p,nullable:()=>Or,nullish:()=>hg,number:()=>fp,object:()=>rg,optional:()=>Lr,overwrite:()=>Ve,parse:()=>tp,parseAsync:()=>np,partialRecord:()=>cg,pipe:()=>Cr,positive:()=>mo,prefault:()=>Hp,preprocess:()=>Rg,prettifyError:()=>ba,promise:()=>bg,property:()=>yo,readonly:()=>Kp,record:()=>Np,refine:()=>nd,regex:()=>In,regexes:()=>Me,registry:()=>Bi,safeDecode:()=>up,safeDecodeAsync:()=>dp,safeEncode:()=>lp,safeEncodeAsync:()=>pp,safeParse:()=>rp,safeParseAsync:()=>ip,set:()=>pg,setErrorMap:()=>dS,size:()=>qt,slugify:()=>jn,startsWith:()=>Nn,strictObject:()=>ig,string:()=>To,stringFormat:()=>Uh,stringbool:()=>Ig,success:()=>gg,superRefine:()=>rd,symbol:()=>Yh,templateLiteral:()=>_g,toJSONSchema:()=>xo,toLowerCase:()=>On,toUpperCase:()=>Cn,transform:()=>Yo,treeifyError:()=>_a,trim:()=>Ln,tuple:()=>Pp,uint32:()=>Gh,uint64:()=>Kh,ulid:()=>Th,undefined:()=>Xh,union:()=>qo,unknown:()=>Xt,uppercase:()=>Rn,url:()=>Sh,util:()=>D,uuid:()=>vh,uuidv4:()=>_h,uuidv6:()=>bh,uuidv7:()=>xh,void:()=>eg,xid:()=>Rh,xor:()=>sg});var ht={};Ce(ht,{$ZodAny:()=>Vc,$ZodArray:()=>Qc,$ZodAsyncError:()=>Ge,$ZodBase64:()=>jc,$ZodBase64URL:()=>Mc,$ZodBigInt:()=>ji,$ZodBigIntFormat:()=>Wc,$ZodBoolean:()=>Er,$ZodCIDRv4:()=>Lc,$ZodCIDRv6:()=>Oc,$ZodCUID:()=>$c,$ZodCUID2:()=>wc,$ZodCatch:()=>yl,$ZodCheck:()=>oe,$ZodCheckBigIntFormat:()=>Qa,$ZodCheckEndsWith:()=>pc,$ZodCheckGreaterThan:()=>Ni,$ZodCheckIncludes:()=>lc,$ZodCheckLengthEquals:()=>oc,$ZodCheckLessThan:()=>Pi,$ZodCheckLowerCase:()=>ac,$ZodCheckMaxLength:()=>rc,$ZodCheckMaxSize:()=>ec,$ZodCheckMimeType:()=>mc,$ZodCheckMinLength:()=>ic,$ZodCheckMinSize:()=>tc,$ZodCheckMultipleOf:()=>Ya,$ZodCheckNumberFormat:()=>Xa,$ZodCheckOverwrite:()=>fc,$ZodCheckProperty:()=>dc,$ZodCheckRegex:()=>sc,$ZodCheckSizeEquals:()=>nc,$ZodCheckStartsWith:()=>uc,$ZodCheckStringFormat:()=>kn,$ZodCheckUpperCase:()=>cc,$ZodCodec:()=>Tr,$ZodCustom:()=>kl,$ZodCustomStringFormat:()=>Zc,$ZodDate:()=>Xc,$ZodDefault:()=>ml,$ZodDiscriminatedUnion:()=>nl,$ZodE164:()=>Uc,$ZodEmail:()=>_c,$ZodEmoji:()=>xc,$ZodEncodeError:()=>wt,$ZodEnum:()=>al,$ZodError:()=>br,$ZodExactOptional:()=>pl,$ZodFile:()=>ll,$ZodFunction:()=>Sl,$ZodGUID:()=>yc,$ZodIPv4:()=>zc,$ZodIPv6:()=>Dc,$ZodISODate:()=>Rc,$ZodISODateTime:()=>Tc,$ZodISODuration:()=>Nc,$ZodISOTime:()=>Pc,$ZodIntersection:()=>rl,$ZodJWT:()=>Fc,$ZodKSUID:()=>Ic,$ZodLazy:()=>wl,$ZodLiteral:()=>cl,$ZodMAC:()=>Ac,$ZodMap:()=>ol,$ZodNaN:()=>vl,$ZodNanoID:()=>Sc,$ZodNever:()=>Kc,$ZodNonOptional:()=>hl,$ZodNull:()=>Gc,$ZodNullable:()=>dl,$ZodNumber:()=>Ci,$ZodNumberFormat:()=>Hc,$ZodObject:()=>hf,$ZodObjectJIT:()=>el,$ZodOptional:()=>Ui,$ZodPipe:()=>_l,$ZodPrefault:()=>fl,$ZodPromise:()=>$l,$ZodReadonly:()=>bl,$ZodRealError:()=>Te,$ZodRecord:()=>il,$ZodRegistry:()=>Wi,$ZodSet:()=>sl,$ZodString:()=>Vt,$ZodStringFormat:()=>re,$ZodSuccess:()=>gl,$ZodSymbol:()=>Bc,$ZodTemplateLiteral:()=>xl,$ZodTransform:()=>ul,$ZodTuple:()=>Mi,$ZodType:()=>K,$ZodULID:()=>kc,$ZodURL:()=>bc,$ZodUUID:()=>vc,$ZodUndefined:()=>Jc,$ZodUnion:()=>Ir,$ZodUnknown:()=>qc,$ZodVoid:()=>Yc,$ZodXID:()=>Ec,$ZodXor:()=>tl,$brand:()=>hi,$constructor:()=>x,$input:()=>Il,$output:()=>El,Doc:()=>kr,JSONSchema:()=>fh,JSONSchemaGenerator:()=>So,NEVER:()=>ca,TimePrecision:()=>Nl,_any:()=>Xl,_array:()=>ou,_base64:()=>co,_base64url:()=>lo,_bigint:()=>Bl,_boolean:()=>Hl,_catch:()=>tS,_check:()=>mh,_cidrv4:()=>so,_cidrv6:()=>ao,_coercedBigint:()=>Jl,_coercedBoolean:()=>Wl,_coercedDate:()=>ru,_coercedNumber:()=>Cl,_coercedString:()=>Rl,_cuid:()=>Qi,_cuid2:()=>eo,_custom:()=>au,_date:()=>nu,_decode:()=>xi,_decodeAsync:()=>$i,_default:()=>Xx,_discriminatedUnion:()=>Ux,_e164:()=>uo,_email:()=>Ji,_emoji:()=>Yi,_encode:()=>bi,_encodeAsync:()=>Si,_endsWith:()=>zn,_enum:()=>Jx,_file:()=>su,_float32:()=>Ml,_float64:()=>Ul,_gt:()=>nt,_gte:()=>$e,_guid:()=>Nr,_includes:()=>Pn,_int:()=>jl,_int32:()=>Fl,_int64:()=>Gl,_intersection:()=>Fx,_ipv4:()=>io,_ipv6:()=>oo,_isoDate:()=>Dl,_isoDateTime:()=>zl,_isoDuration:()=>Ll,_isoTime:()=>Al,_jwt:()=>po,_ksuid:()=>ro,_lazy:()=>oS,_length:()=>Yt,_literal:()=>Vx,_lowercase:()=>Tn,_lt:()=>tt,_lte:()=>Ae,_mac:()=>Pl,_map:()=>Wx,_max:()=>Ae,_maxLength:()=>Kt,_maxSize:()=>Pt,_mime:()=>Dn,_min:()=>$e,_minLength:()=>ft,_minSize:()=>rt,_multipleOf:()=>Rt,_nan:()=>iu,_nanoid:()=>Xi,_nativeEnum:()=>Gx,_negative:()=>fo,_never:()=>eu,_nonnegative:()=>go,_nonoptional:()=>Qx,_nonpositive:()=>ho,_normalize:()=>An,_null:()=>Yl,_nullable:()=>Yx,_number:()=>Ol,_optional:()=>Kx,_overwrite:()=>Ve,_parse:()=>xn,_parseAsync:()=>Sn,_pipe:()=>nS,_positive:()=>mo,_promise:()=>sS,_property:()=>yo,_readonly:()=>rS,_record:()=>Hx,_refine:()=>cu,_regex:()=>In,_safeDecode:()=>ki,_safeDecodeAsync:()=>Ii,_safeEncode:()=>wi,_safeEncodeAsync:()=>Ei,_safeParse:()=>$n,_safeParseAsync:()=>wn,_set:()=>Bx,_size:()=>qt,_slugify:()=>jn,_startsWith:()=>Nn,_string:()=>Tl,_stringFormat:()=>Mn,_stringbool:()=>du,_success:()=>eS,_superRefine:()=>lu,_symbol:()=>ql,_templateLiteral:()=>iS,_toLowerCase:()=>On,_toUpperCase:()=>Cn,_transform:()=>qx,_trim:()=>Ln,_tuple:()=>Zx,_uint32:()=>Zl,_uint64:()=>Vl,_ulid:()=>to,_undefined:()=>Kl,_union:()=>jx,_unknown:()=>Ql,_uppercase:()=>Rn,_url:()=>zr,_uuid:()=>Gi,_uuidv4:()=>Vi,_uuidv6:()=>qi,_uuidv7:()=>Ki,_void:()=>tu,_xid:()=>no,_xor:()=>Mx,clone:()=>Se,config:()=>me,createStandardJSONSchemaMethod:()=>Un,createToJSONSchemaMethod:()=>mu,decode:()=>lb,decodeAsync:()=>pb,describe:()=>uu,encode:()=>cb,encodeAsync:()=>ub,extractDefs:()=>zt,finalize:()=>Dt,flattenError:()=>xr,formatError:()=>Sr,globalConfig:()=>mr,globalRegistry:()=>_e,initializeContext:()=>Nt,isValidBase64:()=>Cc,isValidBase64URL:()=>pf,isValidJWT:()=>df,locales:()=>Pr,meta:()=>pu,parse:()=>vi,parseAsync:()=>_i,prettifyError:()=>ba,process:()=>ne,regexes:()=>Me,registry:()=>Bi,safeDecode:()=>mb,safeDecodeAsync:()=>hb,safeEncode:()=>db,safeEncodeAsync:()=>fb,safeParse:()=>xa,safeParseAsync:()=>Sa,toDotPath:()=>Jm,toJSONSchema:()=>xo,treeifyError:()=>_a,util:()=>D,version:()=>hc});var ca=Object.freeze({status:"aborted"});function x(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 hi=Symbol("zod_brand"),Ge=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},wt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},mr={};function me(n){return n&&Object.assign(mr,n),mr}var D={};Ce(D,{BIGINT_FORMAT_RANGES:()=>va,Class:()=>ua,NUMBER_FORMAT_RANGES:()=>ya,aborted:()=>Tt,allowsEval:()=>ma,assert:()=>U_,assertEqual:()=>O_,assertIs:()=>j_,assertNever:()=>M_,assertNotEqual:()=>C_,assignProp:()=>Et,base64ToUint8Array:()=>Hm,base64urlToUint8Array:()=>rb,cached:()=>_n,captureStackTrace:()=>yi,cleanEnum:()=>nb,cleanRegex:()=>gr,clone:()=>Se,cloneDef:()=>Z_,createTransparentProxy:()=>V_,defineLazy:()=>X,esc:()=>gi,escapeRegex:()=>je,extend:()=>Y_,finalizeIssue:()=>Ie,floatSafeRemainder:()=>pa,getElementAtPath:()=>H_,getEnumValues:()=>hr,getLengthableOrigin:()=>_r,getParsedType:()=>G_,getSizableOrigin:()=>vr,hexToUint8Array:()=>ob,isObject:()=>Jt,isPlainObject:()=>It,issue:()=>bn,joinValues:()=>k,jsonStringifyReplacer:()=>vn,merge:()=>Q_,mergeDefs:()=>mt,normalizeParams:()=>L,nullish:()=>kt,numKeys:()=>J_,objectClone:()=>F_,omit:()=>K_,optionalKeys:()=>ga,parsedType:()=>z,partial:()=>eb,pick:()=>q_,prefixIssues:()=>De,primitiveTypes:()=>ha,promiseAllObject:()=>W_,propertyKeyTypes:()=>yr,randomString:()=>B_,required:()=>tb,safeExtend:()=>X_,shallowClone:()=>fa,slugify:()=>da,stringifyPrimitive:()=>N,uint8ArrayToBase64:()=>Wm,uint8ArrayToBase64url:()=>ib,uint8ArrayToHex:()=>sb,unwrapMessage:()=>fr});function O_(n){return n}function C_(n){return n}function j_(n){}function M_(n){throw new Error("Unexpected value in exhaustive check")}function U_(n){}function hr(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 k(n,e="|"){return n.map(r=>N(r)).join(e)}function vn(n,e){return typeof e=="bigint"?e.toString():e}function _n(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function kt(n){return n==null}function gr(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function pa(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 Zm=Symbol("evaluating");function X(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==Zm)return i===void 0&&(i=Zm,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function F_(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function Et(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function mt(...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 mt(n._zod.def)}function H_(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function W_(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 B_(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function gi(n){return JSON.stringify(n)}function da(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var yi="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Jt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var ma=_n(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function It(n){if(Jt(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Jt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function fa(n){return It(n)?{...n}:Array.isArray(n)?[...n]:n}function J_(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var G_=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}`)}},yr=new Set(["string","number","symbol"]),ha=new Set(["string","number","bigint","boolean","symbol","undefined"]);function je(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 L(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 N(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function ga(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var ya={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]},va={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function q_(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=mt(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 Et(this,"shape",s),s},checks:[]});return Se(n,o)}function K_(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=mt(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 Et(this,"shape",s),s},checks:[]});return Se(n,o)}function Y_(n,e){if(!It(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=mt(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return Et(this,"shape",o),o}});return Se(n,t)}function X_(n,e){if(!It(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=mt(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return Et(this,"shape",i),i}});return Se(n,r)}function Q_(n,e){let r=mt(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return Et(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Se(n,r)}function eb(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=mt(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 Et(this,"shape",c),c},checks:[]});return Se(e,s)}function tb(n,e,r){let i=mt(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 Et(this,"shape",o),o}});return Se(e,i)}function Tt(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 De(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function fr(n){return typeof n=="string"?n:n?.message}function Ie(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=fr(n.inst?._zod.def?.error?.(n))??fr(e?.error?.(n))??fr(r.customError?.(n))??fr(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function vr(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function _r(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function z(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 bn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function nb(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Hm(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 Wm(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function rb(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Hm(e+r)}function ib(n){return Wm(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ob(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 sb(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var ua=class{constructor(...e){}};var Bm=(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,vn,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},br=x("$ZodError",Bm),Te=x("$ZodError",Bm,{Parent:Error});function xr(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 Sr(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 _a(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 Jm(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 ba(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 ${Jm(i.path)}`);return e.join(`
462
- `)}var xn=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 Ge;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>Ie(c,o,me())));throw yi(a,t?.callee),a}return s.value},vi=xn(Te),Sn=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=>Ie(c,o,me())));throw yi(a,t?.callee),a}return s.value},_i=Sn(Te),$n=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 Ge;return o.issues.length?{success:!1,error:new(n??br)(o.issues.map(s=>Ie(s,t,me())))}:{success:!0,data:o.value}},xa=$n(Te),wn=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=>Ie(s,t,me())))}:{success:!0,data:o.value}},Sa=wn(Te),bi=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return xn(n)(e,r,t)},cb=bi(Te),xi=n=>(e,r,i)=>xn(n)(e,r,i),lb=xi(Te),Si=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Sn(n)(e,r,t)},ub=Si(Te),$i=n=>async(e,r,i)=>Sn(n)(e,r,i),pb=$i(Te),wi=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return $n(n)(e,r,t)},db=wi(Te),ki=n=>(e,r,i)=>$n(n)(e,r,i),mb=ki(Te),Ei=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return wn(n)(e,r,t)},fb=Ei(Te),Ii=n=>async(e,r,i)=>wn(n)(e,r,i),hb=Ii(Te);var Me={};Ce(Me,{base64:()=>ja,base64url:()=>Ti,bigint:()=>Wa,boolean:()=>Ja,browserEmail:()=>$b,cidrv4:()=>Oa,cidrv6:()=>Ca,cuid:()=>$a,cuid2:()=>wa,date:()=>Ua,datetime:()=>Za,domain:()=>Eb,duration:()=>Ra,e164:()=>Ma,email:()=>Na,emoji:()=>za,extendedDuration:()=>gb,guid:()=>Pa,hex:()=>Ib,hostname:()=>kb,html5Email:()=>bb,idnEmail:()=>Sb,integer:()=>Ba,ipv4:()=>Da,ipv6:()=>Aa,ksuid:()=>Ia,lowercase:()=>qa,mac:()=>La,md5_base64:()=>Rb,md5_base64url:()=>Pb,md5_hex:()=>Tb,nanoid:()=>Ta,null:()=>Ga,number:()=>Ri,rfc5322Email:()=>xb,sha1_base64:()=>zb,sha1_base64url:()=>Db,sha1_hex:()=>Nb,sha256_base64:()=>Lb,sha256_base64url:()=>Ob,sha256_hex:()=>Ab,sha384_base64:()=>jb,sha384_base64url:()=>Mb,sha384_hex:()=>Cb,sha512_base64:()=>Fb,sha512_base64url:()=>Zb,sha512_hex:()=>Ub,string:()=>Ha,time:()=>Fa,ulid:()=>ka,undefined:()=>Va,unicodeEmail:()=>Gm,uppercase:()=>Ka,uuid:()=>Gt,uuid4:()=>yb,uuid6:()=>vb,uuid7:()=>_b,xid:()=>Ea});var $a=/^[cC][^\s-]{8,}$/,wa=/^[0-9a-z]+$/,ka=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ea=/^[0-9a-vA-V]{20}$/,Ia=/^[A-Za-z0-9]{27}$/,Ta=/^[a-zA-Z0-9_-]{21}$/,Ra=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gb=/^[-+]?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)?)??$/,Pa=/^([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})$/,Gt=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)$/,yb=Gt(4),vb=Gt(6),_b=Gt(7),Na=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bb=/^[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])?)*$/,xb=/^(([^<>()\[\]\\.,;:\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,}))$/,Gm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Sb=Gm,$b=/^[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])?)*$/,wb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function za(){return new RegExp(wb,"u")}var Da=/^(?:(?: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])$/,Aa=/^(([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}|:))$/,La=n=>{let e=je(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Oa=/^((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])$/,Ca=/^(([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])$/,ja=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ti=/^[A-Za-z0-9_-]*$/,kb=/^(?=.{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])?)*\.?$/,Eb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ma=/^\+[1-9]\d{6,14}$/,Vm="(?:(?:\\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])))",Ua=new RegExp(`^${Vm}$`);function qm(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 Fa(n){return new RegExp(`^${qm(n)}$`)}function Za(n){let e=qm({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(`^${Vm}T(?:${i})$`)}var Ha=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Wa=/^-?\d+n?$/,Ba=/^-?\d+$/,Ri=/^-?\d+(?:\.\d+)?$/,Ja=/^(?:true|false)$/i,Ga=/^null$/i;var Va=/^undefined$/i;var qa=/^[^A-Z]*$/,Ka=/^[^a-z]*$/,Ib=/^[0-9a-fA-F]*$/;function $r(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function wr(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var Tb=/^[0-9a-fA-F]{32}$/,Rb=$r(22,"=="),Pb=wr(22),Nb=/^[0-9a-fA-F]{40}$/,zb=$r(27,"="),Db=wr(27),Ab=/^[0-9a-fA-F]{64}$/,Lb=$r(43,"="),Ob=wr(43),Cb=/^[0-9a-fA-F]{96}$/,jb=$r(64,""),Mb=wr(64),Ub=/^[0-9a-fA-F]{128}$/,Fb=$r(86,"=="),Zb=wr(86);var oe=x("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),Ym={number:"number",bigint:"bigint",object:"date"},Pi=x("$ZodCheckLessThan",(n,e)=>{oe.init(n,e);let r=Ym[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})}}),Ni=x("$ZodCheckGreaterThan",(n,e)=>{oe.init(n,e);let r=Ym[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})}}),Ya=x("$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):pa(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})}}),Xa=x("$ZodCheckNumberFormat",(n,e)=>{oe.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=ya[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=Ba)}),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})}}),Qa=x("$ZodCheckBigIntFormat",(n,e)=>{oe.init(n,e);let[r,i]=va[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})}}),ec=x("$ZodCheckMaxSize",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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:vr(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),tc=x("$ZodCheckMinSize",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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:vr(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),nc=x("$ZodCheckSizeEquals",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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:vr(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})}}),rc=x("$ZodCheckMaxLength",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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=_r(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),ic=x("$ZodCheckMinLength",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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=_r(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),oc=x("$ZodCheckLengthEquals",(n,e)=>{var r;oe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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=_r(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})}}),kn=x("$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=()=>{})}),sc=x("$ZodCheckRegex",(n,e)=>{kn.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})}}),ac=x("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=qa),kn.init(n,e)}),cc=x("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=Ka),kn.init(n,e)}),lc=x("$ZodCheckIncludes",(n,e)=>{oe.init(n,e);let r=je(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})}}),uc=x("$ZodCheckStartsWith",(n,e)=>{oe.init(n,e);let r=new RegExp(`^${je(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})}}),pc=x("$ZodCheckEndsWith",(n,e)=>{oe.init(n,e);let r=new RegExp(`.*${je(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 Km(n,e,r){n.issues.length&&e.issues.push(...De(r,n.issues))}var dc=x("$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=>Km(t,r,e.property));Km(i,r,e.property)}}),mc=x("$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})}}),fc=x("$ZodCheckOverwrite",(n,e)=>{oe.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var kr=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(`
476
+ `,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 M,ee=me(()=>{"use strict";Ot();ly();uy();my();Rd();ky();Ey();Iy();Ry();Py();M=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=Le(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=Le(e),t={files:new gs(i),exports:new ys(i),imports:new vs(i),missions:new ti(i),intentLogs:new ws(i),configs:new ks(i),content:new Es(i),searchHistory:new Is(i),hologram:new Ts(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),bd(e)}static clearCache(e){this.repositoryCache.delete(e)}}});var As,Ls,Oy,Os,Cy,My,jy,Uy,Fy,Zy,Hy,Wy,By,Gy,ai,Cs,Jy,Vy,Ad=me(()=>{"use strict";As=[/\/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],Ls=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],Oy=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],Os=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],Cy=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],My=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],jy=[/\/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],Uy=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],Fy=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],Zy=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],Hy=[/\/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],Wy=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],By=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],Gy=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],ai=[/\.(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)$/],Cs=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],Jy=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],Vy=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var Ms,Ky,js,Yy,Ld=me(()=>{"use strict";Ms=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],Ky=[/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],js=[/models\.py$/i,/\/models\/.*\.py$/i,/\/migrations\/.*\.py$/i,/schema\.py$/i,/documents\.py$/i],Yy=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var Us,Qy,Fs,ev,Od=me(()=>{"use strict";Us=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],Qy=[/\/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],Fs=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],ev=["laravel","symfony","slim","cakephp","codeigniter"]});import nv from"path";function Ut(n,e,r){let i=[],t="Unknown",o=0;r||(r=L$(n,e));let{inDegree:s,outDegree:a}=r,c=(p,f,m,h)=>{for(let _ of p)if(_.test(n))return i.push(`${h}: ${_.source}`),t=f,o+=m,!0;return!1},l=!1;if(l||(l=c(As,"Entry",45,"Next.js entry")),l||(l=c(Cy,"Entry",40,"MCP handler")),l||(l=c(jy,"Entry",40,"CLI command")),l||(l=c(ai,"Data",45,"Data layer/Repository")),l||(l=c(Hy,"Data",35,"State management")),l||(l=c(Oy,"Logic",40,"React component")),l||(l=c(Os,"Logic",35,"Logic pattern")),l||(l=c(Uy,"Logic",35,"Parser/AST")),l||(l=c(Fy,"Logic",35,"Core module")),l||(l=c(Zy,"Logic",30,"UI layer")),l||(l=c(Gy,"Types",35,"Type definition")),l||(l=c(Ms,"Entry",40,"Python Entry")),l||(l=c(js,"Data",40,"Python Data")),l||(l=c(Ky,"Logic",35,"Python Logic")),l||(l=c(Us,"Entry",40,"PHP Entry")),l||(l=c(Fs,"Data",40,"PHP Data")),l||(l=c(Qy,"Logic",35,"PHP Logic")),l||(l=c(Wy,"Logic",35,"Hook/Context")),!l){for(let p of My)if(p.test(n)){i.push(`MCP utility: ${p.source}`),/schemas?/i.test(n)?t="Types":/resources?/i.test(n)?t="Data":t="Utility",o+=35,l=!0;break}}l||c(By,"Data",35,"Schema definition")&&(l=!0),l||(c(ai,"Data",30,"Path matches data pattern")||c(Cs,"Utility",25,"Path matches utility pattern")||c(Ls,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let p of Cd)if(p.test(n)){i.push(`Test file: ${p.source}`),t="Test",o=50,l=!0;break}l||c(Md,"Infrastructure",40,"Infrastructure")&&(l=!0);for(let p of A$)p.test(n)&&(i.push(`Monorepo component: ${p.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 d=e.imports.getImportsForFile(n).map(p=>p.module_specifier.toLowerCase());for(let p of Vy)if(d.some(f=>f.includes(p))){i.push(`Imports JS data library: ${p}`),(t==="Unknown"||t==="Data")&&(t="Data",o+=25);break}for(let p of Yy)if(d.some(f=>f.includes(p))){i.push(`Imports Python framework: ${p}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let p of ev)if(d.some(f=>f.includes(p))){i.push(`Imports PHP framework: ${p}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let p of Jy)if(d.some(f=>f.includes(p))){i.push(`Imports JS framework: ${p}`),(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 p=s/(s+a);p>.3&&p<.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 L$(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function Ve(n,e){let r=n.files.getAllPaths().map(m=>({path:m})),i=new Map,t={Entry:[],Logic:[],Data:[],Utility:[],Infrastructure:[],Test:[],Types:[],Unknown:[]};for(let m of r){let h=Ut(m.path,n);i.set(m.path,h),t[h.layer].push({path:m.path,classification:h})}let o={Entry:jt(t.Entry,e),Logic:jt(t.Logic,e),Data:jt(t.Data,e),Utility:jt(t.Utility,e),Infrastructure:jt(t.Infrastructure,e),Test:jt(t.Test,e),Types:jt(t.Types,e),Unknown:jt(t.Unknown,e)},s={};r.forEach(m=>{let h=nv.extname(m.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(([m,h])=>{let _=a[m];_&&(c[_]=(c[_]||0)+h)});let l=Object.entries(c).sort((m,h)=>h[1]-m[1]),u=l.length>0?l[0][0]:"Unknown",{pattern:d,patternConfidence:p,insights:f}=O$(o,r.length,n);return{pattern:d,patternConfidence:p,layers:o,insights:f,primaryStack:u}}function jt(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:nv.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function O$(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 d=r.configs.countByKind("Service");return d>3&&(t="Microservices",o=55+d*5,i.push(`Detected ${d} 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 Cd,Md,A$,pt=me(()=>{"use strict";Ad();Ld();Od();Cd=[/\.(test|spec)\.(ts|tsx|js|jsx)$/i,/tests?\.py$/i,/\/__tests__\//i,/\/tests?\//i,/\.e2e\.(ts|js)$/i,/\.integration\.(ts|js)$/i],Md=[/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],A$=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});var rv={};Fe(rv,{HologramService:()=>pe});var tt,pe,Ue=me(()=>{"use strict";ee();pt();V();tt=$.child({module:"hologram"}),pe=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=M.getInstance(e)}updateTopography(e){tt.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)),tt.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=Ve(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){tt.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)),tt.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){tt.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)),tt.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){tt.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 tt.error({repoPath:this.repoPath,section:e,error:i},"Failed to parse section"),null}}computeGravityZones(){tt.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=Ut(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(p=>p.kind!=="TsTypeAliasDeclaration"&&p.kind!=="TsInterfaceDeclaration")||s[0],d=`${t}::${u.name}`;r.set(d,{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 tt.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),tt.info({repoPath:this.repoPath},"Hologram cleared")}}});var _v={};Fe(_v,{GraphExporterService:()=>Gs});var vv,Gs,Zd=me(()=>{"use strict";ee();V();vv=$.child({module:"graph-exporter"}),Gs=class{constructor(e){this.repoPath=e;this.repos=M.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;vv.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){vv.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 d=this.buildNode(u,r,i,t+1,o);d&&(a.children.push(d),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(`
477
+ `)}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",d=this.getStatusIcon(u),p=this.getStatusClass(u),f=`${d} ${c.description}`;if(r.push(` ${l}["${this.escapeMermaid(f)}"]:::${p}`),r.push(` ${t} -.-> ${l}`),c.dependencies&&c.dependencies.length>0)for(let m of c.dependencies){let h=`S${e.id}_${m}`;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 jk}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as Uk}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as Fk,ListToolsRequestSchema as Zk,ListResourcesRequestSchema as Hk,ReadResourceRequestSchema as Wk}from"@modelcontextprotocol/sdk/types.js";var Ym=[{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 Xm=[{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",description:"Mission to attach this log to. Optional \u2014 if omitted, auto-resolves to the active mission or logs as standalone."},type:{type:"string",enum:["decision","blocker","discovery","fix"]},content:{type:"string"},filePath:{type:"string",description:"File path to associate with this log"},symbolName:{type:"string",description:"Symbol related to this intent"},standalone:{type:"boolean",description:"If true, log is anchored to symbolName only (no mission). Requires symbolName."}},required:["repoPath","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_working_set_check",description:"Checks which files are in active mission working sets to detect parallel editing conflicts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePaths:{type:"array",items:{type:"string"}}},required:["repoPath","filePaths"]}},{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={};Fe(y,{$brand:()=>bi,$input:()=>Ll,$output:()=>Al,NEVER:()=>ga,TimePrecision:()=>jl,ZodAny:()=>Tp,ZodArray:()=>zp,ZodBase64:()=>Vo,ZodBase64URL:()=>qo,ZodBigInt:()=>Xn,ZodBigIntFormat:()=>Xo,ZodBoolean:()=>Yn,ZodCIDRv4:()=>Go,ZodCIDRv6:()=>Jo,ZodCUID:()=>jo,ZodCUID2:()=>Uo,ZodCatch:()=>ed,ZodCodec:()=>ss,ZodCustom:()=>Xr,ZodCustomStringFormat:()=>qn,ZodDate:()=>Jr,ZodDefault:()=>Vp,ZodDiscriminatedUnion:()=>Ap,ZodE164:()=>Ko,ZodEmail:()=>Oo,ZodEmoji:()=>Co,ZodEnum:()=>Jn,ZodError:()=>DS,ZodExactOptional:()=>Bp,ZodFile:()=>Hp,ZodFirstPartyTypeKind:()=>dd,ZodFunction:()=>ld,ZodGUID:()=>Zr,ZodIPv4:()=>Wo,ZodIPv6:()=>Bo,ZodISODate:()=>Po,ZodISODateTime:()=>Ro,ZodISODuration:()=>zo,ZodISOTime:()=>No,ZodIntersection:()=>Lp,ZodIssueCode:()=>LS,ZodJWT:()=>Yo,ZodKSUID:()=>Ho,ZodLazy:()=>sd,ZodLiteral:()=>Zp,ZodMAC:()=>xp,ZodMap:()=>Up,ZodNaN:()=>nd,ZodNanoID:()=>Mo,ZodNever:()=>Pp,ZodNonOptional:()=>is,ZodNull:()=>Ep,ZodNullable:()=>Jp,ZodNumber:()=>Kn,ZodNumberFormat:()=>tn,ZodObject:()=>qr,ZodOptional:()=>rs,ZodPipe:()=>os,ZodPrefault:()=>Kp,ZodPromise:()=>cd,ZodReadonly:()=>rd,ZodRealError:()=>Ae,ZodRecord:()=>Yr,ZodSet:()=>Fp,ZodString:()=>Vn,ZodStringFormat:()=>se,ZodSuccess:()=>Qp,ZodSymbol:()=>wp,ZodTemplateLiteral:()=>od,ZodTransform:()=>Wp,ZodTuple:()=>Cp,ZodType:()=>X,ZodULID:()=>Fo,ZodURL:()=>Gr,ZodUUID:()=>ct,ZodUndefined:()=>kp,ZodUnion:()=>Kr,ZodUnknown:()=>Rp,ZodVoid:()=>Np,ZodXID:()=>Zo,ZodXor:()=>Dp,_ZodString:()=>Lo,_default:()=>qp,_function:()=>zg,any:()=>ug,array:()=>Vr,base64:()=>Jh,base64url:()=>Vh,bigint:()=>og,boolean:()=>$p,catch:()=>td,check:()=>Dg,cidrv4:()=>Bh,cidrv6:()=>Gh,clone:()=>Ee,codec:()=>Rg,coerce:()=>md,config:()=>fe,core:()=>yt,cuid:()=>Ch,cuid2:()=>Mh,custom:()=>Ag,date:()=>dg,decode:()=>fp,decodeAsync:()=>gp,describe:()=>Lg,discriminatedUnion:()=>vg,e164:()=>qh,email:()=>Ih,emoji:()=>Lh,encode:()=>mp,encodeAsync:()=>hp,endsWith:()=>Cn,enum:()=>ts,exactOptional:()=>Gp,file:()=>kg,flattenError:()=>Rr,float32:()=>tg,float64:()=>ng,formatError:()=>Pr,fromJSONSchema:()=>Zg,function:()=>zg,getErrorMap:()=>CS,globalRegistry:()=>$e,gt:()=>st,gte:()=>Ie,guid:()=>Th,hash:()=>eg,hex:()=>Qh,hostname:()=>Xh,httpUrl:()=>Ah,includes:()=>Ln,instanceof:()=>Cg,int:()=>Ao,int32:()=>rg,int64:()=>sg,intersection:()=>Op,ipv4:()=>Zh,ipv6:()=>Wh,iso:()=>Gn,json:()=>jg,jwt:()=>Kh,keyof:()=>mg,ksuid:()=>Fh,lazy:()=>ad,length:()=>Qt,literal:()=>wg,locales:()=>Mr,looseObject:()=>gg,looseRecord:()=>bg,lowercase:()=>Dn,lt:()=>ot,lte:()=>Me,mac:()=>Hh,map:()=>xg,maxLength:()=>Xt,maxSize:()=>Pt,meta:()=>Og,mime:()=>Mn,minLength:()=>gt,minSize:()=>at,multipleOf:()=>Rt,nan:()=>Tg,nanoid:()=>Oh,nativeEnum:()=>$g,negative:()=>_o,never:()=>Qo,nonnegative:()=>xo,nonoptional:()=>Xp,nonpositive:()=>bo,normalize:()=>jn,null:()=>Ip,nullable:()=>Wr,nullish:()=>Eg,number:()=>Sp,object:()=>fg,optional:()=>Hr,overwrite:()=>Qe,parse:()=>lp,parseAsync:()=>up,partialRecord:()=>_g,pipe:()=>Br,positive:()=>vo,prefault:()=>Yp,preprocess:()=>Ug,prettifyError:()=>Ta,promise:()=>Ng,property:()=>So,readonly:()=>id,record:()=>jp,refine:()=>ud,regex:()=>zn,regexes:()=>He,registry:()=>Ki,safeDecode:()=>vp,safeDecodeAsync:()=>bp,safeEncode:()=>yp,safeEncodeAsync:()=>_p,safeParse:()=>pp,safeParseAsync:()=>dp,set:()=>Sg,setErrorMap:()=>OS,size:()=>Yt,slugify:()=>Hn,startsWith:()=>On,strictObject:()=>hg,string:()=>Do,stringFormat:()=>Yh,stringbool:()=>Mg,success:()=>Ig,superRefine:()=>pd,symbol:()=>cg,templateLiteral:()=>Pg,toJSONSchema:()=>Eo,toLowerCase:()=>Fn,toUpperCase:()=>Zn,transform:()=>ns,treeifyError:()=>Ia,trim:()=>Un,tuple:()=>Mp,uint32:()=>ig,uint64:()=>ag,ulid:()=>jh,undefined:()=>lg,union:()=>es,unknown:()=>en,uppercase:()=>An,url:()=>Dh,util:()=>O,uuid:()=>Rh,uuidv4:()=>Ph,uuidv6:()=>Nh,uuidv7:()=>zh,void:()=>pg,xid:()=>Uh,xor:()=>yg});var yt={};Fe(yt,{$ZodAny:()=>nl,$ZodArray:()=>al,$ZodAsyncError:()=>Xe,$ZodBase64:()=>Gc,$ZodBase64URL:()=>Jc,$ZodBigInt:()=>Hi,$ZodBigIntFormat:()=>Xc,$ZodBoolean:()=>Ar,$ZodCIDRv4:()=>Hc,$ZodCIDRv6:()=>Wc,$ZodCUID:()=>Nc,$ZodCUID2:()=>zc,$ZodCatch:()=>kl,$ZodCheck:()=>ce,$ZodCheckBigIntFormat:()=>ac,$ZodCheckEndsWith:()=>_c,$ZodCheckGreaterThan:()=>Oi,$ZodCheckIncludes:()=>yc,$ZodCheckLengthEquals:()=>mc,$ZodCheckLessThan:()=>Li,$ZodCheckLowerCase:()=>hc,$ZodCheckMaxLength:()=>pc,$ZodCheckMaxSize:()=>cc,$ZodCheckMimeType:()=>xc,$ZodCheckMinLength:()=>dc,$ZodCheckMinSize:()=>lc,$ZodCheckMultipleOf:()=>oc,$ZodCheckNumberFormat:()=>sc,$ZodCheckOverwrite:()=>Sc,$ZodCheckProperty:()=>bc,$ZodCheckRegex:()=>fc,$ZodCheckSizeEquals:()=>uc,$ZodCheckStartsWith:()=>vc,$ZodCheckStringFormat:()=>Pn,$ZodCheckUpperCase:()=>gc,$ZodCodec:()=>Or,$ZodCustom:()=>Dl,$ZodCustomStringFormat:()=>Kc,$ZodDate:()=>sl,$ZodDefault:()=>xl,$ZodDiscriminatedUnion:()=>ul,$ZodE164:()=>Vc,$ZodEmail:()=>Ic,$ZodEmoji:()=>Rc,$ZodEncodeError:()=>wt,$ZodEnum:()=>hl,$ZodError:()=>Tr,$ZodExactOptional:()=>_l,$ZodFile:()=>yl,$ZodFunction:()=>Pl,$ZodGUID:()=>kc,$ZodIPv4:()=>Uc,$ZodIPv6:()=>Fc,$ZodISODate:()=>Cc,$ZodISODateTime:()=>Oc,$ZodISODuration:()=>jc,$ZodISOTime:()=>Mc,$ZodIntersection:()=>pl,$ZodJWT:()=>qc,$ZodKSUID:()=>Lc,$ZodLazy:()=>zl,$ZodLiteral:()=>gl,$ZodMAC:()=>Zc,$ZodMap:()=>ml,$ZodNaN:()=>El,$ZodNanoID:()=>Pc,$ZodNever:()=>il,$ZodNonOptional:()=>$l,$ZodNull:()=>tl,$ZodNullable:()=>bl,$ZodNumber:()=>Zi,$ZodNumberFormat:()=>Yc,$ZodObject:()=>Ef,$ZodObjectJIT:()=>cl,$ZodOptional:()=>Bi,$ZodPipe:()=>Il,$ZodPrefault:()=>Sl,$ZodPromise:()=>Nl,$ZodReadonly:()=>Tl,$ZodRealError:()=>De,$ZodRecord:()=>dl,$ZodRegistry:()=>qi,$ZodSet:()=>fl,$ZodString:()=>Kt,$ZodStringFormat:()=>oe,$ZodSuccess:()=>wl,$ZodSymbol:()=>Qc,$ZodTemplateLiteral:()=>Rl,$ZodTransform:()=>vl,$ZodTuple:()=>Wi,$ZodType:()=>K,$ZodULID:()=>Dc,$ZodURL:()=>Tc,$ZodUUID:()=>Ec,$ZodUndefined:()=>el,$ZodUnion:()=>Lr,$ZodUnknown:()=>rl,$ZodVoid:()=>ol,$ZodXID:()=>Ac,$ZodXor:()=>ll,$brand:()=>bi,$constructor:()=>w,$input:()=>Ll,$output:()=>Al,Doc:()=>Dr,JSONSchema:()=>kh,JSONSchemaGenerator:()=>Io,NEVER:()=>ga,TimePrecision:()=>jl,_any:()=>su,_array:()=>mu,_base64:()=>fo,_base64url:()=>ho,_bigint:()=>Ql,_boolean:()=>Yl,_catch:()=>kS,_check:()=>wh,_cidrv4:()=>po,_cidrv6:()=>mo,_coercedBigint:()=>eu,_coercedBoolean:()=>Xl,_coercedDate:()=>pu,_coercedNumber:()=>Bl,_coercedString:()=>Cl,_cuid:()=>io,_cuid2:()=>oo,_custom:()=>hu,_date:()=>uu,_decode:()=>Ei,_decodeAsync:()=>Ti,_default:()=>SS,_discriminatedUnion:()=>uS,_e164:()=>go,_email:()=>Yi,_emoji:()=>no,_encode:()=>ki,_encodeAsync:()=>Ii,_endsWith:()=>Cn,_enum:()=>gS,_file:()=>fu,_float32:()=>Jl,_float64:()=>Vl,_gt:()=>st,_gte:()=>Ie,_guid:()=>jr,_includes:()=>Ln,_int:()=>Gl,_int32:()=>ql,_int64:()=>tu,_intersection:()=>pS,_ipv4:()=>lo,_ipv6:()=>uo,_isoDate:()=>Fl,_isoDateTime:()=>Ul,_isoDuration:()=>Hl,_isoTime:()=>Zl,_jwt:()=>yo,_ksuid:()=>co,_lazy:()=>RS,_length:()=>Qt,_literal:()=>vS,_lowercase:()=>Dn,_lt:()=>ot,_lte:()=>Me,_mac:()=>Ml,_map:()=>fS,_max:()=>Me,_maxLength:()=>Xt,_maxSize:()=>Pt,_mime:()=>Mn,_min:()=>Ie,_minLength:()=>gt,_minSize:()=>at,_multipleOf:()=>Rt,_nan:()=>du,_nanoid:()=>ro,_nativeEnum:()=>yS,_negative:()=>_o,_never:()=>cu,_nonnegative:()=>xo,_nonoptional:()=>$S,_nonpositive:()=>bo,_normalize:()=>jn,_null:()=>ou,_nullable:()=>xS,_number:()=>Wl,_optional:()=>bS,_overwrite:()=>Qe,_parse:()=>En,_parseAsync:()=>In,_pipe:()=>ES,_positive:()=>vo,_promise:()=>PS,_property:()=>So,_readonly:()=>IS,_record:()=>mS,_refine:()=>gu,_regex:()=>zn,_safeDecode:()=>Pi,_safeDecodeAsync:()=>zi,_safeEncode:()=>Ri,_safeEncodeAsync:()=>Ni,_safeParse:()=>Tn,_safeParseAsync:()=>Rn,_set:()=>hS,_size:()=>Yt,_slugify:()=>Hn,_startsWith:()=>On,_string:()=>Ol,_stringFormat:()=>Wn,_stringbool:()=>bu,_success:()=>wS,_superRefine:()=>yu,_symbol:()=>ru,_templateLiteral:()=>TS,_toLowerCase:()=>Fn,_toUpperCase:()=>Zn,_transform:()=>_S,_trim:()=>Un,_tuple:()=>dS,_uint32:()=>Kl,_uint64:()=>nu,_ulid:()=>so,_undefined:()=>iu,_union:()=>cS,_unknown:()=>au,_uppercase:()=>An,_url:()=>Ur,_uuid:()=>Xi,_uuidv4:()=>Qi,_uuidv6:()=>eo,_uuidv7:()=>to,_void:()=>lu,_xid:()=>ao,_xor:()=>lS,clone:()=>Ee,config:()=>fe,createStandardJSONSchemaMethod:()=>Bn,createToJSONSchemaMethod:()=>xu,decode:()=>Db,decodeAsync:()=>Lb,describe:()=>vu,encode:()=>zb,encodeAsync:()=>Ab,extractDefs:()=>zt,finalize:()=>Dt,flattenError:()=>Rr,formatError:()=>Pr,globalConfig:()=>xr,globalRegistry:()=>$e,initializeContext:()=>Nt,isValidBase64:()=>Bc,isValidBase64URL:()=>Sf,isValidJWT:()=>$f,locales:()=>Mr,meta:()=>_u,parse:()=>$i,parseAsync:()=>wi,prettifyError:()=>Ta,process:()=>re,regexes:()=>He,registry:()=>Ki,safeDecode:()=>Cb,safeDecodeAsync:()=>jb,safeEncode:()=>Ob,safeEncodeAsync:()=>Mb,safeParse:()=>Ra,safeParseAsync:()=>Pa,toDotPath:()=>rf,toJSONSchema:()=>Eo,treeifyError:()=>Ia,util:()=>O,version:()=>$c});var ga=Object.freeze({status:"aborted"});function w(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 d=0;d<u.length;d++){let p=u[d];p in a||(a[p]=l[p].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 bi=Symbol("zod_brand"),Xe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},wt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},xr={};function fe(n){return n&&Object.assign(xr,n),xr}var O={};Fe(O,{BIGINT_FORMAT_RANGES:()=>Ea,Class:()=>va,NUMBER_FORMAT_RANGES:()=>ka,aborted:()=>Tt,allowsEval:()=>xa,assert:()=>ub,assertEqual:()=>sb,assertIs:()=>cb,assertNever:()=>lb,assertNotEqual:()=>ab,assignProp:()=>Et,base64ToUint8Array:()=>ef,base64urlToUint8Array:()=>Ib,cached:()=>wn,captureStackTrace:()=>Si,cleanEnum:()=>Eb,cleanRegex:()=>wr,clone:()=>Ee,cloneDef:()=>db,createTransparentProxy:()=>vb,defineLazy:()=>Q,esc:()=>xi,escapeRegex:()=>Ze,extend:()=>xb,finalizeIssue:()=>ze,floatSafeRemainder:()=>_a,getElementAtPath:()=>mb,getEnumValues:()=>$r,getLengthableOrigin:()=>Ir,getParsedType:()=>yb,getSizableOrigin:()=>Er,hexToUint8Array:()=>Rb,isObject:()=>Vt,isPlainObject:()=>It,issue:()=>kn,joinValues:()=>T,jsonStringifyReplacer:()=>$n,merge:()=>$b,mergeDefs:()=>ht,normalizeParams:()=>C,nullish:()=>kt,numKeys:()=>gb,objectClone:()=>pb,omit:()=>bb,optionalKeys:()=>wa,parsedType:()=>L,partial:()=>wb,pick:()=>_b,prefixIssues:()=>Ce,primitiveTypes:()=>$a,promiseAllObject:()=>fb,propertyKeyTypes:()=>kr,randomString:()=>hb,required:()=>kb,safeExtend:()=>Sb,shallowClone:()=>Sa,slugify:()=>ba,stringifyPrimitive:()=>A,uint8ArrayToBase64:()=>tf,uint8ArrayToBase64url:()=>Tb,uint8ArrayToHex:()=>Pb,unwrapMessage:()=>Sr});function sb(n){return n}function ab(n){return n}function cb(n){}function lb(n){throw new Error("Unexpected value in exhaustive check")}function ub(n){}function $r(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 T(n,e="|"){return n.map(r=>A(r)).join(e)}function $n(n,e){return typeof e=="bigint"?e.toString():e}function wn(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function kt(n){return n==null}function wr(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function _a(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 Qm=Symbol("evaluating");function Q(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==Qm)return i===void 0&&(i=Qm,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function pb(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function Et(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ht(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function db(n){return ht(n._zod.def)}function mb(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function fb(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 hb(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function xi(n){return JSON.stringify(n)}function ba(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Si="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Vt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var xa=wn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function It(n){if(Vt(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Vt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sa(n){return It(n)?{...n}:Array.isArray(n)?[...n]:n}function gb(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var yb=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}`)}},kr=new Set(["string","number","symbol"]),$a=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ze(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function C(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 vb(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 A(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function wa(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var ka={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]},Ea={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _b(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=ht(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 Et(this,"shape",s),s},checks:[]});return Ee(n,o)}function bb(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=ht(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 Et(this,"shape",s),s},checks:[]});return Ee(n,o)}function xb(n,e){if(!It(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=ht(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return Et(this,"shape",o),o}});return Ee(n,t)}function Sb(n,e){if(!It(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ht(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return Et(this,"shape",i),i}});return Ee(n,r)}function $b(n,e){let r=ht(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return Et(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Ee(n,r)}function wb(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=ht(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 Et(this,"shape",c),c},checks:[]});return Ee(e,s)}function kb(n,e,r){let i=ht(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 Et(this,"shape",o),o}});return Ee(e,i)}function Tt(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 Ce(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function Sr(n){return typeof n=="string"?n:n?.message}function ze(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=Sr(n.inst?._zod.def?.error?.(n))??Sr(e?.error?.(n))??Sr(r.customError?.(n))??Sr(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Er(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function Ir(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function L(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 kn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function Eb(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ef(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 tf(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function Ib(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return ef(e+r)}function Tb(n){return tf(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Rb(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 Pb(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var va=class{constructor(...e){}};var nf=(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,$n,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},Tr=w("$ZodError",nf),De=w("$ZodError",nf,{Parent:Error});function Rr(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 Pr(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 Ia(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,d=0;for(;d<l.length;){let p=l[d],f=d===l.length-1;typeof p=="string"?(u.properties??(u.properties={}),(s=u.properties)[p]??(s[p]={errors:[]}),u=u.properties[p]):(u.items??(u.items=[]),(a=u.items)[p]??(a[p]={errors:[]}),u=u.items[p]),f&&u.errors.push(e(c)),d++}}};return i(n),r}function rf(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 Ta(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 ${rf(i.path)}`);return e.join(`
478
+ `)}var En=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 Xe;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>ze(c,o,fe())));throw Si(a,t?.callee),a}return s.value},$i=En(De),In=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=>ze(c,o,fe())));throw Si(a,t?.callee),a}return s.value},wi=In(De),Tn=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 Xe;return o.issues.length?{success:!1,error:new(n??Tr)(o.issues.map(s=>ze(s,t,fe())))}:{success:!0,data:o.value}},Ra=Tn(De),Rn=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=>ze(s,t,fe())))}:{success:!0,data:o.value}},Pa=Rn(De),ki=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return En(n)(e,r,t)},zb=ki(De),Ei=n=>(e,r,i)=>En(n)(e,r,i),Db=Ei(De),Ii=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return In(n)(e,r,t)},Ab=Ii(De),Ti=n=>async(e,r,i)=>In(n)(e,r,i),Lb=Ti(De),Ri=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Tn(n)(e,r,t)},Ob=Ri(De),Pi=n=>(e,r,i)=>Tn(n)(e,r,i),Cb=Pi(De),Ni=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Rn(n)(e,r,t)},Mb=Ni(De),zi=n=>async(e,r,i)=>Rn(n)(e,r,i),jb=zi(De);var He={};Fe(He,{base64:()=>Ga,base64url:()=>Di,bigint:()=>Xa,boolean:()=>ec,browserEmail:()=>Jb,cidrv4:()=>Wa,cidrv6:()=>Ba,cuid:()=>Na,cuid2:()=>za,date:()=>Va,datetime:()=>Ka,domain:()=>Kb,duration:()=>Ca,e164:()=>Ja,email:()=>ja,emoji:()=>Ua,extendedDuration:()=>Ub,guid:()=>Ma,hex:()=>Yb,hostname:()=>qb,html5Email:()=>Wb,idnEmail:()=>Gb,integer:()=>Qa,ipv4:()=>Fa,ipv6:()=>Za,ksuid:()=>La,lowercase:()=>rc,mac:()=>Ha,md5_base64:()=>Qb,md5_base64url:()=>ex,md5_hex:()=>Xb,nanoid:()=>Oa,null:()=>tc,number:()=>Ai,rfc5322Email:()=>Bb,sha1_base64:()=>nx,sha1_base64url:()=>rx,sha1_hex:()=>tx,sha256_base64:()=>ox,sha256_base64url:()=>sx,sha256_hex:()=>ix,sha384_base64:()=>cx,sha384_base64url:()=>lx,sha384_hex:()=>ax,sha512_base64:()=>px,sha512_base64url:()=>dx,sha512_hex:()=>ux,string:()=>Ya,time:()=>qa,ulid:()=>Da,undefined:()=>nc,unicodeEmail:()=>of,uppercase:()=>ic,uuid:()=>qt,uuid4:()=>Fb,uuid6:()=>Zb,uuid7:()=>Hb,xid:()=>Aa});var Na=/^[cC][^\s-]{8,}$/,za=/^[0-9a-z]+$/,Da=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Aa=/^[0-9a-vA-V]{20}$/,La=/^[A-Za-z0-9]{27}$/,Oa=/^[a-zA-Z0-9_-]{21}$/,Ca=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ub=/^[-+]?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)?)??$/,Ma=/^([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})$/,qt=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)$/,Fb=qt(4),Zb=qt(6),Hb=qt(7),ja=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Wb=/^[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])?)*$/,Bb=/^(([^<>()\[\]\\.,;:\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,}))$/,of=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Gb=of,Jb=/^[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])?)*$/,Vb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ua(){return new RegExp(Vb,"u")}var Fa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Za=/^(([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=Ze(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Wa=/^((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])$/,Ba=/^(([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])$/,Ga=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Di=/^[A-Za-z0-9_-]*$/,qb=/^(?=.{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])?)*\.?$/,Kb=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ja=/^\+[1-9]\d{6,14}$/,sf="(?:(?:\\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])))",Va=new RegExp(`^${sf}$`);function af(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 qa(n){return new RegExp(`^${af(n)}$`)}function Ka(n){let e=af({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(`^${sf}T(?:${i})$`)}var Ya=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Xa=/^-?\d+n?$/,Qa=/^-?\d+$/,Ai=/^-?\d+(?:\.\d+)?$/,ec=/^(?:true|false)$/i,tc=/^null$/i;var nc=/^undefined$/i;var rc=/^[^A-Z]*$/,ic=/^[^a-z]*$/,Yb=/^[0-9a-fA-F]*$/;function Nr(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function zr(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var Xb=/^[0-9a-fA-F]{32}$/,Qb=Nr(22,"=="),ex=zr(22),tx=/^[0-9a-fA-F]{40}$/,nx=Nr(27,"="),rx=zr(27),ix=/^[0-9a-fA-F]{64}$/,ox=Nr(43,"="),sx=zr(43),ax=/^[0-9a-fA-F]{96}$/,cx=Nr(64,""),lx=zr(64),ux=/^[0-9a-fA-F]{128}$/,px=Nr(86,"=="),dx=zr(86);var ce=w("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),lf={number:"number",bigint:"bigint",object:"date"},Li=w("$ZodCheckLessThan",(n,e)=>{ce.init(n,e);let r=lf[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})}}),Oi=w("$ZodCheckGreaterThan",(n,e)=>{ce.init(n,e);let r=lf[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})}}),oc=w("$ZodCheckMultipleOf",(n,e)=>{ce.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):_a(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})}}),sc=w("$ZodCheckNumberFormat",(n,e)=>{ce.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=ka[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=Qa)}),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})}}),ac=w("$ZodCheckBigIntFormat",(n,e)=>{ce.init(n,e);let[r,i]=Ea[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})}}),cc=w("$ZodCheckMaxSize",(n,e)=>{var r;ce.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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:Er(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),lc=w("$ZodCheckMinSize",(n,e)=>{var r;ce.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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:Er(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),uc=w("$ZodCheckSizeEquals",(n,e)=>{var r;ce.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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:Er(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})}}),pc=w("$ZodCheckMaxLength",(n,e)=>{var r;ce.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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=Ir(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),dc=w("$ZodCheckMinLength",(n,e)=>{var r;ce.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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=Ir(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),mc=w("$ZodCheckLengthEquals",(n,e)=>{var r;ce.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!kt(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=Ir(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=w("$ZodCheckStringFormat",(n,e)=>{var r,i;ce.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=()=>{})}),fc=w("$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})}}),hc=w("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=rc),Pn.init(n,e)}),gc=w("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=ic),Pn.init(n,e)}),yc=w("$ZodCheckIncludes",(n,e)=>{ce.init(n,e);let r=Ze(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})}}),vc=w("$ZodCheckStartsWith",(n,e)=>{ce.init(n,e);let r=new RegExp(`^${Ze(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})}}),_c=w("$ZodCheckEndsWith",(n,e)=>{ce.init(n,e);let r=new RegExp(`.*${Ze(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 cf(n,e,r){n.issues.length&&e.issues.push(...Ce(r,n.issues))}var bc=w("$ZodCheckProperty",(n,e)=>{ce.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=>cf(t,r,e.property));cf(i,r,e.property)}}),xc=w("$ZodCheckMimeType",(n,e)=>{ce.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})}}),Sc=w("$ZodCheckOverwrite",(n,e)=>{ce.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var Dr=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(`
463
479
  `).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(`
464
- `))}};var hc={major:4,minor:3,patch:6};var K=x("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=hc;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=Tt(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 Ge;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(l||(l=Tt(s,d)))});else{if(s.issues.length===d)continue;l||(l=Tt(s,d))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(Tt(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new Ge;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 Ge;return c.then(l=>t(l,i,a))}return t(c,i,a)}}X(n,"~standard",()=>({validate:t=>{try{let o=xa(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Sa(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Vt=x("$ZodString",(n,e)=>{K.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??Ha(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=x("$ZodStringFormat",(n,e)=>{kn.init(n,e),Vt.init(n,e)}),yc=x("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=Pa),re.init(n,e)}),vc=x("$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=Gt(i))}else e.pattern??(e.pattern=Gt());re.init(n,e)}),_c=x("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=Na),re.init(n,e)}),bc=x("$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})}}}),xc=x("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=za()),re.init(n,e)}),Sc=x("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=Ta),re.init(n,e)}),$c=x("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=$a),re.init(n,e)}),wc=x("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=wa),re.init(n,e)}),kc=x("$ZodULID",(n,e)=>{e.pattern??(e.pattern=ka),re.init(n,e)}),Ec=x("$ZodXID",(n,e)=>{e.pattern??(e.pattern=Ea),re.init(n,e)}),Ic=x("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=Ia),re.init(n,e)}),Tc=x("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=Za(e)),re.init(n,e)}),Rc=x("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=Ua),re.init(n,e)}),Pc=x("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=Fa(e)),re.init(n,e)}),Nc=x("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=Ra),re.init(n,e)}),zc=x("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=Da),re.init(n,e),n._zod.bag.format="ipv4"}),Dc=x("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=Aa),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})}}}),Ac=x("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=La(e.delimiter)),re.init(n,e),n._zod.bag.format="mac"}),Lc=x("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=Oa),re.init(n,e)}),Oc=x("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Ca),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 Cc(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var jc=x("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=ja),re.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{Cc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function pf(n){if(!Ti.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Cc(r)}var Mc=x("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=Ti),re.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{pf(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),Uc=x("$ZodE164",(n,e)=>{e.pattern??(e.pattern=Ma),re.init(n,e)});function df(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 Fc=x("$ZodJWT",(n,e)=>{re.init(n,e),n._zod.check=r=>{df(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),Zc=x("$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})}}),Ci=x("$ZodNumber",(n,e)=>{K.init(n,e),n._zod.pattern=n._zod.bag.pattern??Ri,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}}),Hc=x("$ZodNumberFormat",(n,e)=>{Xa.init(n,e),Ci.init(n,e)}),Er=x("$ZodBoolean",(n,e)=>{K.init(n,e),n._zod.pattern=Ja,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}}),ji=x("$ZodBigInt",(n,e)=>{K.init(n,e),n._zod.pattern=Wa,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}}),Wc=x("$ZodBigIntFormat",(n,e)=>{Qa.init(n,e),ji.init(n,e)}),Bc=x("$ZodSymbol",(n,e)=>{K.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}}),Jc=x("$ZodUndefined",(n,e)=>{K.init(n,e),n._zod.pattern=Va,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}}),Gc=x("$ZodNull",(n,e)=>{K.init(n,e),n._zod.pattern=Ga,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}}),Vc=x("$ZodAny",(n,e)=>{K.init(n,e),n._zod.parse=r=>r}),qc=x("$ZodUnknown",(n,e)=>{K.init(n,e),n._zod.parse=r=>r}),Kc=x("$ZodNever",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),Yc=x("$ZodVoid",(n,e)=>{K.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}}),Xc=x("$ZodDate",(n,e)=>{K.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 Qm(n,e,r){n.issues.length&&e.issues.push(...De(r,n.issues)),e.value[r]=n.value}var Qc=x("$ZodArray",(n,e)=>{K.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=>Qm(l,r,s))):Qm(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Oi(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...De(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function mf(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=ga(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function ff(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=>Oi(m,r,p,e,u))):Oi(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 hf=x("$ZodObject",(n,e)=>{if(K.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=_n(()=>mf(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=Jt,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(_=>Oi(_,a,d,l,f))):Oi(h,a,d,l,f)}return o?ff(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),el=x("$ZodObjectJIT",(n,e)=>{hf.init(n,e);let r=n._zod.parse,i=_n(()=>mf(e)),t=d=>{let m=new kr(["shape","payload","ctx"]),f=i.value,h=w=>{let S=gi(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");let _=Object.create(null),v=0;for(let w of f.keys)_[w]=`key_${v++}`;m.write("const newResult = {};");for(let w of f.keys){let S=_[w],$=gi(w),T=d[w]?._zod?.optout==="optional";m.write(`const ${S} = ${h(w)};`),T?m.write(`
465
- if (${S}.issues.length) {
466
- if (${$} in input) {
467
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
480
+ `))}};var $c={major:4,minor:3,patch:6};var K=w("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=$c;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=Tt(s),u;for(let d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(l)continue;let p=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new Xe;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(l||(l=Tt(s,p)))});else{if(s.issues.length===p)continue;l||(l=Tt(s,p))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(Tt(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new Xe;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 Xe;return c.then(l=>t(l,i,a))}return t(c,i,a)}}Q(n,"~standard",()=>({validate:t=>{try{let o=Ra(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Pa(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Kt=w("$ZodString",(n,e)=>{K.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??Ya(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}}),oe=w("$ZodStringFormat",(n,e)=>{Pn.init(n,e),Kt.init(n,e)}),kc=w("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=Ma),oe.init(n,e)}),Ec=w("$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=qt(i))}else e.pattern??(e.pattern=qt());oe.init(n,e)}),Ic=w("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=ja),oe.init(n,e)}),Tc=w("$ZodURL",(n,e)=>{oe.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})}}}),Rc=w("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=Ua()),oe.init(n,e)}),Pc=w("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=Oa),oe.init(n,e)}),Nc=w("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=Na),oe.init(n,e)}),zc=w("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=za),oe.init(n,e)}),Dc=w("$ZodULID",(n,e)=>{e.pattern??(e.pattern=Da),oe.init(n,e)}),Ac=w("$ZodXID",(n,e)=>{e.pattern??(e.pattern=Aa),oe.init(n,e)}),Lc=w("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=La),oe.init(n,e)}),Oc=w("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=Ka(e)),oe.init(n,e)}),Cc=w("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=Va),oe.init(n,e)}),Mc=w("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=qa(e)),oe.init(n,e)}),jc=w("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=Ca),oe.init(n,e)}),Uc=w("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=Fa),oe.init(n,e),n._zod.bag.format="ipv4"}),Fc=w("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=Za),oe.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})}}}),Zc=w("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=Ha(e.delimiter)),oe.init(n,e),n._zod.bag.format="mac"}),Hc=w("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=Wa),oe.init(n,e)}),Wc=w("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Ba),oe.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 Bc(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Gc=w("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=Ga),oe.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{Bc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function Sf(n){if(!Di.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Bc(r)}var Jc=w("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=Di),oe.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{Sf(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),Vc=w("$ZodE164",(n,e)=>{e.pattern??(e.pattern=Ja),oe.init(n,e)});function $f(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 qc=w("$ZodJWT",(n,e)=>{oe.init(n,e),n._zod.check=r=>{$f(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),Kc=w("$ZodCustomStringFormat",(n,e)=>{oe.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})}}),Zi=w("$ZodNumber",(n,e)=>{K.init(n,e),n._zod.pattern=n._zod.bag.pattern??Ai,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}}),Yc=w("$ZodNumberFormat",(n,e)=>{sc.init(n,e),Zi.init(n,e)}),Ar=w("$ZodBoolean",(n,e)=>{K.init(n,e),n._zod.pattern=ec,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}}),Hi=w("$ZodBigInt",(n,e)=>{K.init(n,e),n._zod.pattern=Xa,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}}),Xc=w("$ZodBigIntFormat",(n,e)=>{ac.init(n,e),Hi.init(n,e)}),Qc=w("$ZodSymbol",(n,e)=>{K.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}}),el=w("$ZodUndefined",(n,e)=>{K.init(n,e),n._zod.pattern=nc,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}}),tl=w("$ZodNull",(n,e)=>{K.init(n,e),n._zod.pattern=tc,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}}),nl=w("$ZodAny",(n,e)=>{K.init(n,e),n._zod.parse=r=>r}),rl=w("$ZodUnknown",(n,e)=>{K.init(n,e),n._zod.parse=r=>r}),il=w("$ZodNever",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),ol=w("$ZodVoid",(n,e)=>{K.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}}),sl=w("$ZodDate",(n,e)=>{K.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 pf(n,e,r){n.issues.length&&e.issues.push(...Ce(r,n.issues)),e.value[r]=n.value}var al=w("$ZodArray",(n,e)=>{K.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=>pf(l,r,s))):pf(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Fi(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...Ce(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function wf(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=wa(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function kf(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 d in e){if(a.has(d))continue;if(l==="never"){s.push(d);continue}let p=c.run({value:e[d],issues:[]},i);p instanceof Promise?n.push(p.then(f=>Fi(f,r,d,e,u))):Fi(p,r,d,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 Ef=w("$ZodObject",(n,e)=>{if(K.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=wn(()=>wf(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 d of u.values)c[l].add(d)}}return c});let t=Vt,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=[],d=s.shape;for(let p of s.keys){let f=d[p],m=f._zod.optout==="optional",h=f._zod.run({value:l[p],issues:[]},c);h instanceof Promise?u.push(h.then(_=>Fi(_,a,p,l,m))):Fi(h,a,p,l,m)}return o?kf(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),cl=w("$ZodObjectJIT",(n,e)=>{Ef.init(n,e);let r=n._zod.parse,i=wn(()=>wf(e)),t=p=>{let f=new Dr(["shape","payload","ctx"]),m=i.value,h=b=>{let x=xi(b);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};f.write("const input = payload.value;");let _=Object.create(null),v=0;for(let b of m.keys)_[b]=`key_${v++}`;f.write("const newResult = {};");for(let b of m.keys){let x=_[b],k=xi(b),P=p[b]?._zod?.optout==="optional";f.write(`const ${x} = ${h(b)};`),P?f.write(`
481
+ if (${x}.issues.length) {
482
+ if (${k} in input) {
483
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
468
484
  ...iss,
469
- path: iss.path ? [${$}, ...iss.path] : [${$}]
485
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
470
486
  })));
471
487
  }
472
488
  }
473
489
 
474
- if (${S}.value === undefined) {
475
- if (${$} in input) {
476
- newResult[${$}] = undefined;
490
+ if (${x}.value === undefined) {
491
+ if (${k} in input) {
492
+ newResult[${k}] = undefined;
477
493
  }
478
494
  } else {
479
- newResult[${$}] = ${S}.value;
495
+ newResult[${k}] = ${x}.value;
480
496
  }
481
497
 
482
- `):m.write(`
483
- if (${S}.issues.length) {
484
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
498
+ `):f.write(`
499
+ if (${x}.issues.length) {
500
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
485
501
  ...iss,
486
- path: iss.path ? [${$}, ...iss.path] : [${$}]
502
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
487
503
  })));
488
504
  }
489
505
 
490
- if (${S}.value === undefined) {
491
- if (${$} in input) {
492
- newResult[${$}] = undefined;
506
+ if (${x}.value === undefined) {
507
+ if (${k} in input) {
508
+ newResult[${k}] = undefined;
493
509
  }
494
510
  } else {
495
- newResult[${$}] = ${S}.value;
511
+ newResult[${k}] = ${x}.value;
496
512
  }
497
513
 
498
- `)}m.write("payload.value = newResult;"),m.write("return payload;");let y=m.compile();return(w,S)=>y(d,w,S)},o,s=Jt,a=!mr.jitless,l=a&&ma.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?ff([],f,d,m,p,n):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:n}),d)}});function ef(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=>!Tt(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=>Ie(s,i,me())))}),e)}var Ir=x("$ZodUnion",(n,e)=>{K.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=>gr(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=>ef(c,t,n,o)):ef(a,t,n,o)}});function tf(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=>Ie(s,i,me())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var tl=x("$ZodXor",(n,e)=>{Ir.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=>tf(c,t,n,o)):tf(a,t,n,o)}}),nl=x("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,Ir.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=_n(()=>{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(!Jt(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)}}),rl=x("$ZodIntersection",(n,e)=>{K.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])=>nf(r,c,l)):nf(r,o,s)}});function gc(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(It(n)&&It(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=gc(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=gc(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 nf(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}),Tt(n))return n;let s=gc(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 Mi=x("$ZodTuple",(n,e)=>{K.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=>zi(d,i,l))):zi(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=>zi(m,i,l))):zi(d,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function zi(n,e,r){n.issues.length&&e.issues.push(...De(r,n.issues)),e.value[r]=n.value}var il=x("$ZodRecord",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!It(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(...De(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...De(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"&&Ri.test(a)&&c.issues.length){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=>Ie(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(...De(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...De(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),ol=x("$ZodMap",(n,e)=>{K.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])=>{rf(u,p,r,s,t,n,i)})):rf(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function rf(n,e,r,i,t,o,s){n.issues.length&&(yr.has(typeof i)?r.issues.push(...De(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>Ie(a,s,me()))})),e.issues.length&&(yr.has(typeof i)?r.issues.push(...De(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>Ie(a,s,me()))})),r.value.set(n.value,e.value)}var sl=x("$ZodSet",(n,e)=>{K.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=>of(c,r))):of(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function of(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var al=x("$ZodEnum",(n,e)=>{K.init(n,e);let r=hr(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>yr.has(typeof t)).map(t=>typeof t=="string"?je(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}}),cl=x("$ZodLiteral",(n,e)=>{if(K.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"?je(i):i?je(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}}),ll=x("$ZodFile",(n,e)=>{K.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}}),ul=x("$ZodTransform",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new wt(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 Ge;return r.value=t,r}});function sf(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var Ui=x("$ZodOptional",(n,e)=>{K.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(`^(${gr(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=>sf(o,r.value)):sf(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),pl=x("$ZodExactOptional",(n,e)=>{Ui.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)}),dl=x("$ZodNullable",(n,e)=>{K.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(`^(${gr(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)}),ml=x("$ZodDefault",(n,e)=>{K.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=>af(o,e)):af(t,e)}});function af(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var fl=x("$ZodPrefault",(n,e)=>{K.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))}),hl=x("$ZodNonOptional",(n,e)=>{K.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=>cf(o,n)):cf(t,n)}});function cf(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 gl=x("$ZodSuccess",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new wt("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)}}),yl=x("$ZodCatch",(n,e)=>{K.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=>Ie(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=>Ie(o,i,me()))},input:r.value}),r.issues=[]),r)}}),vl=x("$ZodNaN",(n,e)=>{K.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)}),_l=x("$ZodPipe",(n,e)=>{K.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=>Di(s,e.in,i)):Di(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>Di(o,e.out,i)):Di(t,e.out,i)}});function Di(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var Tr=x("$ZodCodec",(n,e)=>{K.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=>Ai(s,e,i)):Ai(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Ai(s,e,i)):Ai(o,e,i)}}});function Ai(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=>Li(n,o,e.out,r)):Li(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>Li(n,o,e.in,r)):Li(n,t,e.in,r)}}function Li(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var bl=x("$ZodReadonly",(n,e)=>{K.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(lf):lf(t)}});function lf(n){return n.value=Object.freeze(n.value),n}var xl=x("$ZodTemplateLiteral",(n,e)=>{K.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||ha.has(typeof i))r.push(je(`${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)}),Sl=x("$ZodFunction",(n,e)=>(K.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?vi(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?vi(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 _i(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await _i(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 Mi({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)),$l=x("$ZodPromise",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),wl=x("$ZodLazy",(n,e)=>{K.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)}),kl=x("$ZodCustom",(n,e)=>{oe.init(n,e),K.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=>uf(o,r,i,n));uf(t,r,i,n)}});function uf(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(bn(t))}}var Pr={};Ce(Pr,{ar:()=>gf,az:()=>yf,be:()=>_f,bg:()=>bf,ca:()=>xf,cs:()=>Sf,da:()=>$f,de:()=>wf,en:()=>Fi,eo:()=>kf,es:()=>Ef,fa:()=>If,fi:()=>Tf,fr:()=>Rf,frCA:()=>Pf,he:()=>Nf,hu:()=>zf,hy:()=>Af,id:()=>Lf,is:()=>Of,it:()=>Cf,ja:()=>jf,ka:()=>Mf,kh:()=>Uf,km:()=>Zi,ko:()=>Ff,lt:()=>Hf,mk:()=>Wf,ms:()=>Bf,nl:()=>Jf,no:()=>Gf,ota:()=>Vf,pl:()=>Kf,ps:()=>qf,pt:()=>Yf,ru:()=>Qf,sl:()=>eh,sv:()=>th,ta:()=>nh,th:()=>rh,tr:()=>ih,ua:()=>oh,uk:()=>Hi,ur:()=>sh,uz:()=>ah,vi:()=>ch,yo:()=>ph,zhCN:()=>lh,zhTW:()=>uh});var Wb=()=>{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=z(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 ${N(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: ${k(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":""}: ${k(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 gf(){return{localeError:Wb()}}var Bb=()=>{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=z(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 ${N(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${k(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":""}: ${k(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 yf(){return{localeError:Bb()}}function vf(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 Jb=()=>{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=z(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 ${N(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 ${k(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=vf(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=vf(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"}: ${k(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 _f(){return{localeError:Jb()}}var Gb=()=>{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=z(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 ${N(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 ${k(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":""}: ${k(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 bf(){return{localeError:Gb()}}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=z(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 ${N(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${k(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":""}: ${k(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 xf(){return{localeError:Vb()}}var qb=()=>{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=z(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 ${N(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${k(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: ${k(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 Sf(){return{localeError:qb()}}var Kb=()=>{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=z(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 ${N(t.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${k(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"}: ${k(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 $f(){return{localeError:Kb()}}var Yb=()=>{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=z(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 ${N(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${k(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"}: ${k(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 wf(){return{localeError:Yb()}}var Xb=()=>{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=z(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${N(t.values[0])}`:`Invalid option: expected one of ${k(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":""}: ${k(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 Fi(){return{localeError:Xb()}}var Qb=()=>{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=z(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 ${N(t.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${k(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":""}: ${k(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 kf(){return{localeError:Qb()}}var ex=()=>{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=z(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 ${N(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${k(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":""}: ${k(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 Ef(){return{localeError:ex()}}var tx=()=>{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=z(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 ${N(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 ${k(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: ${k(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 If(){return{localeError:tx()}}var nx=()=>{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=z(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 ${N(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${k(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"}: ${k(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 Tf(){return{localeError:nx()}}var rx=()=>{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=z(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 : ${N(t.values[0])} attendu`:`Option invalide : une valeur parmi ${k(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":""} : ${k(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 Rf(){return{localeError:rx()}}var ix=()=>{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=z(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 ${N(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${k(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":""} : ${k(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 Pf(){return{localeError:ix()}}var ox=()=>{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=z(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 ${N(l.values[0])}`;let u=l.values.map(m=>N(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"}: ${k(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 Nf(){return{localeError:ox()}}var sx=()=>{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=z(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 ${N(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${k(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":""}: ${k(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 zf(){return{localeError:sx()}}function Df(n,e,r){return Math.abs(n)===1?e:r}function En(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 ax=()=>{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=z(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 ${N(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 ${k(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Df(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 ${En(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 ${En(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=Df(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 ${En(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 ${En(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":""}. ${k(t.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${En(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 ${En(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Af(){return{localeError:ax()}}var cx=()=>{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=z(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 ${N(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${k(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":""}: ${k(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 Lf(){return{localeError:cx()}}var lx=()=>{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=z(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 ${N(t.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${k(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"}: ${k(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 Of(){return{localeError:lx()}}var ux=()=>{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=z(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 ${N(t.values[0])}`:`Opzione non valida: atteso uno tra ${k(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"}: ${k(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 Cf(){return{localeError:ux()}}var px=()=>{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=z(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: ${N(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${k(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":""}: ${k(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 jf(){return{localeError:px()}}var dx=()=>{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=z(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 ${N(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 ${k(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"}: ${k(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 Mf(){return{localeError:dx()}}var mx=()=>{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=z(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 ${N(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 ${k(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 ${k(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 Zi(){return{localeError:mx()}}function Uf(){return Zi()}var fx=()=>{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=z(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 ${N(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${k(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: ${k(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 Ff(){return{localeError:fx()}}var Rr=n=>n.charAt(0).toUpperCase()+n.slice(1);function Zf(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 hx=()=>{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=z(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 ${N(t.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${k(t.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[t.origin]??t.origin,s=e(t.origin,Zf(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${Rr(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`${Rr(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,Zf(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${Rr(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`${Rr(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"}: ${k(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`${Rr(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Hf(){return{localeError:hx()}}var gx=()=>{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=z(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 ${N(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 ${k(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"}: ${k(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 Wf(){return{localeError:gx()}}var yx=()=>{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=z(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 ${N(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${k(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: ${k(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 Bf(){return{localeError:yx()}}var vx=()=>{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=z(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 ${N(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${k(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":""}: ${k(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 Jf(){return{localeError:vx()}}var _x=()=>{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=z(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 ${N(t.values[0])}`:`Ugyldig valg: forventet en av ${k(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"}: ${k(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 Gf(){return{localeError:_x()}}var bx=()=>{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=z(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 ${N(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${k(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":""}: ${k(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 Vf(){return{localeError:bx()}}var xx=()=>{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=z(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 ${N(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${k(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"}: ${k(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 qf(){return{localeError:xx()}}var Sx=()=>{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=z(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 ${N(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${k(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":""}: ${k(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 Kf(){return{localeError:Sx()}}var $x=()=>{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=z(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 ${N(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${k(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":""}: ${k(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 Yf(){return{localeError:$x()}}function Xf(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 wx=()=>{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=z(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 ${N(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 ${k(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Xf(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=Xf(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":""}: ${k(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 Qf(){return{localeError:wx()}}var kx=()=>{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=z(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 ${N(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${k(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"}: ${k(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 eh(){return{localeError:kx()}}var Ex=()=>{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=z(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 ${N(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${k(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"}: ${k(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 th(){return{localeError:Ex()}}var Ix=()=>{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=z(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 ${N(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 ${k(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":""}: ${k(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 nh(){return{localeError:Ix()}}var Tx=()=>{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=z(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 ${N(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 ${k(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: ${k(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 rh(){return{localeError:Tx()}}var Rx=()=>{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=z(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 ${N(t.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${k(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":""}: ${k(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 ih(){return{localeError:Rx()}}var Px=()=>{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=z(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 ${N(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 ${k(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":""}: ${k(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 Hi(){return{localeError:Px()}}function oh(){return Hi()}var Nx=()=>{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=z(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: ${N(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${k(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":""}: ${k(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 sh(){return{localeError:Nx()}}var zx=()=>{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=z(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 ${N(t.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${k(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":""}: ${k(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 ah(){return{localeError:zx()}}var Dx=()=>{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=z(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 ${N(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 ${k(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: ${k(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 ch(){return{localeError:Dx()}}var Ax=()=>{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=z(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 ${N(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${k(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): ${k(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 lh(){return{localeError:Ax()}}var Lx=()=>{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=z(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 ${N(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${k(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${k(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 uh(){return{localeError:Lx()}}var Ox=()=>{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=z(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 ${N(t.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${k(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: ${k(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 ph(){return{localeError:Ox()}}var dh,El=Symbol("ZodOutput"),Il=Symbol("ZodInput"),Wi=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 Bi(){return new Wi}(dh=globalThis).__zod_globalRegistry??(dh.__zod_globalRegistry=Bi());var _e=globalThis.__zod_globalRegistry;function Tl(n,e){return new n({type:"string",...L(e)})}function Rl(n,e){return new n({type:"string",coerce:!0,...L(e)})}function Ji(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...L(e)})}function Nr(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...L(e)})}function Gi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...L(e)})}function Vi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...L(e)})}function qi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...L(e)})}function Ki(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...L(e)})}function zr(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...L(e)})}function Yi(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...L(e)})}function Xi(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...L(e)})}function Qi(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...L(e)})}function eo(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...L(e)})}function to(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...L(e)})}function no(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...L(e)})}function ro(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...L(e)})}function io(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...L(e)})}function oo(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...L(e)})}function Pl(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...L(e)})}function so(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...L(e)})}function ao(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...L(e)})}function co(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...L(e)})}function lo(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...L(e)})}function uo(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...L(e)})}function po(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...L(e)})}var Nl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function zl(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...L(e)})}function Dl(n,e){return new n({type:"string",format:"date",check:"string_format",...L(e)})}function Al(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...L(e)})}function Ll(n,e){return new n({type:"string",format:"duration",check:"string_format",...L(e)})}function Ol(n,e){return new n({type:"number",checks:[],...L(e)})}function Cl(n,e){return new n({type:"number",coerce:!0,checks:[],...L(e)})}function jl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...L(e)})}function Ml(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...L(e)})}function Ul(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...L(e)})}function Fl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...L(e)})}function Zl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...L(e)})}function Hl(n,e){return new n({type:"boolean",...L(e)})}function Wl(n,e){return new n({type:"boolean",coerce:!0,...L(e)})}function Bl(n,e){return new n({type:"bigint",...L(e)})}function Jl(n,e){return new n({type:"bigint",coerce:!0,...L(e)})}function Gl(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...L(e)})}function Vl(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...L(e)})}function ql(n,e){return new n({type:"symbol",...L(e)})}function Kl(n,e){return new n({type:"undefined",...L(e)})}function Yl(n,e){return new n({type:"null",...L(e)})}function Xl(n){return new n({type:"any"})}function Ql(n){return new n({type:"unknown"})}function eu(n,e){return new n({type:"never",...L(e)})}function tu(n,e){return new n({type:"void",...L(e)})}function nu(n,e){return new n({type:"date",...L(e)})}function ru(n,e){return new n({type:"date",coerce:!0,...L(e)})}function iu(n,e){return new n({type:"nan",...L(e)})}function tt(n,e){return new Pi({check:"less_than",...L(e),value:n,inclusive:!1})}function Ae(n,e){return new Pi({check:"less_than",...L(e),value:n,inclusive:!0})}function nt(n,e){return new Ni({check:"greater_than",...L(e),value:n,inclusive:!1})}function $e(n,e){return new Ni({check:"greater_than",...L(e),value:n,inclusive:!0})}function mo(n){return nt(0,n)}function fo(n){return tt(0,n)}function ho(n){return Ae(0,n)}function go(n){return $e(0,n)}function Rt(n,e){return new Ya({check:"multiple_of",...L(e),value:n})}function Pt(n,e){return new ec({check:"max_size",...L(e),maximum:n})}function rt(n,e){return new tc({check:"min_size",...L(e),minimum:n})}function qt(n,e){return new nc({check:"size_equals",...L(e),size:n})}function Kt(n,e){return new rc({check:"max_length",...L(e),maximum:n})}function ft(n,e){return new ic({check:"min_length",...L(e),minimum:n})}function Yt(n,e){return new oc({check:"length_equals",...L(e),length:n})}function In(n,e){return new sc({check:"string_format",format:"regex",...L(e),pattern:n})}function Tn(n){return new ac({check:"string_format",format:"lowercase",...L(n)})}function Rn(n){return new cc({check:"string_format",format:"uppercase",...L(n)})}function Pn(n,e){return new lc({check:"string_format",format:"includes",...L(e),includes:n})}function Nn(n,e){return new uc({check:"string_format",format:"starts_with",...L(e),prefix:n})}function zn(n,e){return new pc({check:"string_format",format:"ends_with",...L(e),suffix:n})}function yo(n,e,r){return new dc({check:"property",property:n,schema:e,...L(r)})}function Dn(n,e){return new mc({check:"mime_type",mime:n,...L(e)})}function Ve(n){return new fc({check:"overwrite",tx:n})}function An(n){return Ve(e=>e.normalize(n))}function Ln(){return Ve(n=>n.trim())}function On(){return Ve(n=>n.toLowerCase())}function Cn(){return Ve(n=>n.toUpperCase())}function jn(){return Ve(n=>da(n))}function ou(n,e,r){return new n({type:"array",element:e,...L(r)})}function jx(n,e,r){return new n({type:"union",options:e,...L(r)})}function Mx(n,e,r){return new n({type:"union",options:e,inclusive:!1,...L(r)})}function Ux(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...L(i)})}function Fx(n,e,r){return new n({type:"intersection",left:e,right:r})}function Zx(n,e,r,i){let t=r instanceof K,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...L(o)})}function Hx(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...L(i)})}function Wx(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...L(i)})}function Bx(n,e,r){return new n({type:"set",valueType:e,...L(r)})}function Jx(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...L(r)})}function Gx(n,e,r){return new n({type:"enum",entries:e,...L(r)})}function Vx(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...L(r)})}function su(n,e){return new n({type:"file",...L(e)})}function qx(n,e){return new n({type:"transform",transform:e})}function Kx(n,e){return new n({type:"optional",innerType:e})}function Yx(n,e){return new n({type:"nullable",innerType:e})}function Xx(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():fa(r)}})}function Qx(n,e,r){return new n({type:"nonoptional",innerType:e,...L(r)})}function eS(n,e){return new n({type:"success",innerType:e})}function tS(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function nS(n,e,r){return new n({type:"pipe",in:e,out:r})}function rS(n,e){return new n({type:"readonly",innerType:e})}function iS(n,e,r){return new n({type:"template_literal",parts:e,...L(r)})}function oS(n,e){return new n({type:"lazy",getter:e})}function sS(n,e){return new n({type:"promise",innerType:e})}function au(n,e,r){let i=L(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function cu(n,e,r){return new n({type:"custom",check:"custom",fn:e,...L(r)})}function lu(n){let e=mh(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(bn(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(bn(t))}},n(r.value,r)));return e}function mh(n,e){let r=new oe({check:"custom",...L(e)});return r._zod.check=n,r}function uu(n){let e=new oe({check:"describe"});return e._zod.onattach=[r=>{let i=_e.get(r)??{};_e.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function pu(n){let e=new oe({check:"meta"});return e._zod.onattach=[r=>{let i=_e.get(r)??{};_e.add(r,{...i,...n})}],e._zod.check=()=>{},e}function du(n,e){let r=L(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??Tr,c=n.Boolean??Er,l=n.String??Vt,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 Mn(n,e,r,i={}){let t=L(i),o={...L(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 Nt(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??_e,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"&&we(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 zt(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>
514
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let g=f.compile();return(b,x)=>g(p,b,x)},o,s=Vt,a=!xr.jitless,l=a&&xa.value,u=e.catchall,d;n._zod.parse=(p,f)=>{d??(d=i.value);let m=p.value;return s(m)?a&&l&&f?.async===!1&&f.jitless!==!0?(o||(o=t(e.shape)),p=o(p,f),u?kf([],m,p,f,d,n):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:n}),p)}});function df(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=>!Tt(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=>ze(s,i,fe())))}),e)}var Lr=w("$ZodUnion",(n,e)=>{K.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=>wr(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=>df(c,t,n,o)):df(a,t,n,o)}});function mf(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=>ze(s,i,fe())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var ll=w("$ZodXor",(n,e)=>{Lr.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=>mf(c,t,n,o)):mf(a,t,n,o)}}),ul=w("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,Lr.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=wn(()=>{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(!Vt(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)}}),pl=w("$ZodIntersection",(n,e)=>{K.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])=>ff(r,c,l)):ff(r,o,s)}});function wc(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(It(n)&&It(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=wc(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=wc(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 ff(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}),Tt(n))return n;let s=wc(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=w("$ZodTuple",(n,e)=>{K.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,d=o.length<c-1;if(u||d)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 d=u._zod.run({value:o[l],issues:[]},t);d instanceof Promise?s.push(d.then(p=>Ci(p,i,l))):Ci(d,i,l)}if(e.rest){let u=o.slice(r.length);for(let d of u){l++;let p=e.rest._zod.run({value:d,issues:[]},t);p instanceof Promise?s.push(p.then(f=>Ci(f,i,l))):Ci(p,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function Ci(n,e,r){n.issues.length&&e.issues.push(...Ce(r,n.issues)),e.value[r]=n.value}var dl=w("$ZodRecord",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!It(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(d=>{d.issues.length&&r.issues.push(...Ce(l,d.issues)),r.value[l]=d.value})):(u.issues.length&&r.issues.push(...Ce(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"&&Ai.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=t[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>ze(d,i,fe())),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(d=>{d.issues.length&&r.issues.push(...Ce(a,d.issues)),r.value[c.value]=d.value})):(u.issues.length&&r.issues.push(...Ce(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),ml=w("$ZodMap",(n,e)=>{K.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,d])=>{hf(u,d,r,s,t,n,i)})):hf(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function hf(n,e,r,i,t,o,s){n.issues.length&&(kr.has(typeof i)?r.issues.push(...Ce(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>ze(a,s,fe()))})),e.issues.length&&(kr.has(typeof i)?r.issues.push(...Ce(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>ze(a,s,fe()))})),r.value.set(n.value,e.value)}var fl=w("$ZodSet",(n,e)=>{K.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=>gf(c,r))):gf(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function gf(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var hl=w("$ZodEnum",(n,e)=>{K.init(n,e);let r=$r(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>kr.has(typeof t)).map(t=>typeof t=="string"?Ze(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}}),gl=w("$ZodLiteral",(n,e)=>{if(K.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"?Ze(i):i?Ze(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}}),yl=w("$ZodFile",(n,e)=>{K.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}}),vl=w("$ZodTransform",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new wt(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 Xe;return r.value=t,r}});function yf(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var Bi=w("$ZodOptional",(n,e)=>{K.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(`^(${wr(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=>yf(o,r.value)):yf(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),_l=w("$ZodExactOptional",(n,e)=>{Bi.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)}),bl=w("$ZodNullable",(n,e)=>{K.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(`^(${wr(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)}),xl=w("$ZodDefault",(n,e)=>{K.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=>vf(o,e)):vf(t,e)}});function vf(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var Sl=w("$ZodPrefault",(n,e)=>{K.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))}),$l=w("$ZodNonOptional",(n,e)=>{K.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=>_f(o,n)):_f(t,n)}});function _f(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 wl=w("$ZodSuccess",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new wt("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)}}),kl=w("$ZodCatch",(n,e)=>{K.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=>ze(s,i,fe()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=e.catchValue({...r,error:{issues:t.issues.map(o=>ze(o,i,fe()))},input:r.value}),r.issues=[]),r)}}),El=w("$ZodNaN",(n,e)=>{K.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)}),Il=w("$ZodPipe",(n,e)=>{K.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=>Mi(s,e.in,i)):Mi(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>Mi(o,e.out,i)):Mi(t,e.out,i)}});function Mi(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var Or=w("$ZodCodec",(n,e)=>{K.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=>ji(s,e,i)):ji(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>ji(s,e,i)):ji(o,e,i)}}});function ji(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=>Ui(n,o,e.out,r)):Ui(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>Ui(n,o,e.in,r)):Ui(n,t,e.in,r)}}function Ui(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var Tl=w("$ZodReadonly",(n,e)=>{K.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(bf):bf(t)}});function bf(n){return n.value=Object.freeze(n.value),n}var Rl=w("$ZodTemplateLiteral",(n,e)=>{K.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||$a.has(typeof i))r.push(Ze(`${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)}),Pl=w("$ZodFunction",(n,e)=>(K.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?$i(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?$i(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 wi(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await wi(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)),Nl=w("$ZodPromise",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),zl=w("$ZodLazy",(n,e)=>{K.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)}),Dl=w("$ZodCustom",(n,e)=>{ce.init(n,e),K.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=>xf(o,r,i,n));xf(t,r,i,n)}});function xf(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(kn(t))}}var Mr={};Fe(Mr,{ar:()=>If,az:()=>Tf,be:()=>Pf,bg:()=>Nf,ca:()=>zf,cs:()=>Df,da:()=>Af,de:()=>Lf,en:()=>Gi,eo:()=>Of,es:()=>Cf,fa:()=>Mf,fi:()=>jf,fr:()=>Uf,frCA:()=>Ff,he:()=>Zf,hu:()=>Hf,hy:()=>Bf,id:()=>Gf,is:()=>Jf,it:()=>Vf,ja:()=>qf,ka:()=>Kf,kh:()=>Yf,km:()=>Ji,ko:()=>Xf,lt:()=>eh,mk:()=>th,ms:()=>nh,nl:()=>rh,no:()=>ih,ota:()=>oh,pl:()=>ah,ps:()=>sh,pt:()=>ch,ru:()=>uh,sl:()=>ph,sv:()=>dh,ta:()=>mh,th:()=>fh,tr:()=>hh,ua:()=>gh,uk:()=>Vi,ur:()=>yh,uz:()=>vh,vi:()=>_h,yo:()=>Sh,zhCN:()=>bh,zhTW:()=>xh});var fx=()=>{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=L(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 ${A(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: ${T(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":""}: ${T(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 If(){return{localeError:fx()}}var hx=()=>{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=L(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 ${A(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${T(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":""}: ${T(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 Tf(){return{localeError:hx()}}function Rf(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 gx=()=>{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=L(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 ${A(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 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Rf(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=Rf(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"}: ${T(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 Pf(){return{localeError:gx()}}var yx=()=>{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=L(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 ${A(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 ${T(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":""}: ${T(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 Nf(){return{localeError:yx()}}var vx=()=>{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=L(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 ${A(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${T(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":""}: ${T(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 zf(){return{localeError:vx()}}var _x=()=>{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=L(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 ${A(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${T(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: ${T(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 Df(){return{localeError:_x()}}var bx=()=>{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=L(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 ${A(t.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${T(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"}: ${T(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 Af(){return{localeError:bx()}}var xx=()=>{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=L(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 ${A(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${T(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"}: ${T(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 Lf(){return{localeError:xx()}}var Sx=()=>{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=L(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${A(t.values[0])}`:`Invalid option: expected one of ${T(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":""}: ${T(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 Gi(){return{localeError:Sx()}}var $x=()=>{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=L(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 ${A(t.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${T(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":""}: ${T(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 Of(){return{localeError:$x()}}var wx=()=>{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=L(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 ${A(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${T(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":""}: ${T(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 Cf(){return{localeError:wx()}}var kx=()=>{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=L(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 ${A(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 ${T(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: ${T(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 Mf(){return{localeError:kx()}}var Ex=()=>{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=L(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 ${A(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${T(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"}: ${T(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 jf(){return{localeError:Ex()}}var Ix=()=>{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=L(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 : ${A(t.values[0])} attendu`:`Option invalide : une valeur parmi ${T(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":""} : ${T(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 Uf(){return{localeError:Ix()}}var Tx=()=>{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=L(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 ${A(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(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":""} : ${T(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 Ff(){return{localeError:Tx()}}var Rx=()=>{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,d=c[u??""]??i(u),p=L(l.input),f=c[p]??n[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${A(l.values[0])}`;let u=l.values.map(f=>A(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=t(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=t(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let _=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${T(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 Zf(){return{localeError:Rx()}}var Px=()=>{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=L(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 ${A(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${T(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":""}: ${T(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 Hf(){return{localeError:Px()}}function Wf(n,e,r){return Math.abs(n)===1?e:r}function Nn(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 Nx=()=>{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=L(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 ${A(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 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Wf(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 ${Nn(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 ${Nn(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=Wf(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 ${Nn(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 ${Nn(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":""}. ${T(t.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Nn(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 ${Nn(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Bf(){return{localeError:Nx()}}var zx=()=>{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=L(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 ${A(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(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":""}: ${T(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 Gf(){return{localeError:zx()}}var Dx=()=>{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=L(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 ${A(t.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${T(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"}: ${T(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 Jf(){return{localeError:Dx()}}var Ax=()=>{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=L(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 ${A(t.values[0])}`:`Opzione non valida: atteso uno tra ${T(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"}: ${T(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 Vf(){return{localeError:Ax()}}var Lx=()=>{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=L(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: ${A(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${T(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":""}: ${T(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 qf(){return{localeError:Lx()}}var Ox=()=>{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=L(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 ${A(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 ${T(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"}: ${T(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 Kf(){return{localeError:Ox()}}var Cx=()=>{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=L(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 ${A(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 ${T(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 ${T(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:Cx()}}function Yf(){return Ji()}var Mx=()=>{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=L(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 ${A(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${T(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: ${T(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 Xf(){return{localeError:Mx()}}var Cr=n=>n.charAt(0).toUpperCase()+n.slice(1);function Qf(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 jx=()=>{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=L(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 ${A(t.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${T(t.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[t.origin]??t.origin,s=e(t.origin,Qf(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${Cr(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`${Cr(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,Qf(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${Cr(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`${Cr(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"}: ${T(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`${Cr(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function eh(){return{localeError:jx()}}var Ux=()=>{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=L(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 ${A(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 ${T(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"}: ${T(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 th(){return{localeError:Ux()}}var Fx=()=>{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=L(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 ${A(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(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: ${T(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 nh(){return{localeError:Fx()}}var Zx=()=>{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=L(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 ${A(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${T(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":""}: ${T(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 rh(){return{localeError:Zx()}}var Hx=()=>{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=L(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 ${A(t.values[0])}`:`Ugyldig valg: forventet en av ${T(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"}: ${T(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 ih(){return{localeError:Hx()}}var Wx=()=>{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=L(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 ${A(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${T(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":""}: ${T(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 oh(){return{localeError:Wx()}}var Bx=()=>{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=L(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 ${A(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${T(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"}: ${T(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 sh(){return{localeError:Bx()}}var Gx=()=>{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=L(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 ${A(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${T(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":""}: ${T(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 ah(){return{localeError:Gx()}}var Jx=()=>{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=L(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 ${A(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${T(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":""}: ${T(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 ch(){return{localeError:Jx()}}function lh(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 Vx=()=>{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=L(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 ${A(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 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=lh(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=lh(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":""}: ${T(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 uh(){return{localeError:Vx()}}var qx=()=>{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=L(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 ${A(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${T(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"}: ${T(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 ph(){return{localeError:qx()}}var Kx=()=>{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=L(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 ${A(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${T(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"}: ${T(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 dh(){return{localeError:Kx()}}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=L(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 ${A(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 ${T(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":""}: ${T(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 mh(){return{localeError:Yx()}}var Xx=()=>{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=L(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 ${A(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 ${T(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: ${T(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 fh(){return{localeError:Xx()}}var Qx=()=>{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=L(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 ${A(t.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${T(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":""}: ${T(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 hh(){return{localeError:Qx()}}var eS=()=>{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=L(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 ${A(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 ${T(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":""}: ${T(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 Vi(){return{localeError:eS()}}function gh(){return Vi()}var tS=()=>{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=L(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: ${A(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${T(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":""}: ${T(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 yh(){return{localeError:tS()}}var nS=()=>{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=L(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 ${A(t.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${T(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":""}: ${T(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 vh(){return{localeError:nS()}}var rS=()=>{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=L(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 ${A(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 ${T(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: ${T(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 _h(){return{localeError:rS()}}var iS=()=>{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=L(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 ${A(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${T(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): ${T(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 bh(){return{localeError:iS()}}var oS=()=>{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=L(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 ${A(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${T(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${T(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 xh(){return{localeError:oS()}}var sS=()=>{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=L(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 ${A(t.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${T(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: ${T(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 Sh(){return{localeError:sS()}}var $h,Al=Symbol("ZodOutput"),Ll=Symbol("ZodInput"),qi=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 Ki(){return new qi}($h=globalThis).__zod_globalRegistry??($h.__zod_globalRegistry=Ki());var $e=globalThis.__zod_globalRegistry;function Ol(n,e){return new n({type:"string",...C(e)})}function Cl(n,e){return new n({type:"string",coerce:!0,...C(e)})}function Yi(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...C(e)})}function jr(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...C(e)})}function Xi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...C(e)})}function Qi(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(e)})}function eo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(e)})}function to(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(e)})}function Ur(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...C(e)})}function no(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...C(e)})}function ro(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(e)})}function io(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...C(e)})}function oo(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(e)})}function so(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...C(e)})}function ao(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...C(e)})}function co(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(e)})}function lo(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(e)})}function uo(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(e)})}function Ml(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...C(e)})}function po(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(e)})}function mo(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(e)})}function fo(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...C(e)})}function ho(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...C(e)})}function go(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...C(e)})}function yo(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...C(e)})}var jl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Ul(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(e)})}function Fl(n,e){return new n({type:"string",format:"date",check:"string_format",...C(e)})}function Zl(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...C(e)})}function Hl(n,e){return new n({type:"string",format:"duration",check:"string_format",...C(e)})}function Wl(n,e){return new n({type:"number",checks:[],...C(e)})}function Bl(n,e){return new n({type:"number",coerce:!0,checks:[],...C(e)})}function Gl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...C(e)})}function Jl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...C(e)})}function Vl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...C(e)})}function ql(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...C(e)})}function Kl(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...C(e)})}function Yl(n,e){return new n({type:"boolean",...C(e)})}function Xl(n,e){return new n({type:"boolean",coerce:!0,...C(e)})}function Ql(n,e){return new n({type:"bigint",...C(e)})}function eu(n,e){return new n({type:"bigint",coerce:!0,...C(e)})}function tu(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(e)})}function nu(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(e)})}function ru(n,e){return new n({type:"symbol",...C(e)})}function iu(n,e){return new n({type:"undefined",...C(e)})}function ou(n,e){return new n({type:"null",...C(e)})}function su(n){return new n({type:"any"})}function au(n){return new n({type:"unknown"})}function cu(n,e){return new n({type:"never",...C(e)})}function lu(n,e){return new n({type:"void",...C(e)})}function uu(n,e){return new n({type:"date",...C(e)})}function pu(n,e){return new n({type:"date",coerce:!0,...C(e)})}function du(n,e){return new n({type:"nan",...C(e)})}function ot(n,e){return new Li({check:"less_than",...C(e),value:n,inclusive:!1})}function Me(n,e){return new Li({check:"less_than",...C(e),value:n,inclusive:!0})}function st(n,e){return new Oi({check:"greater_than",...C(e),value:n,inclusive:!1})}function Ie(n,e){return new Oi({check:"greater_than",...C(e),value:n,inclusive:!0})}function vo(n){return st(0,n)}function _o(n){return ot(0,n)}function bo(n){return Me(0,n)}function xo(n){return Ie(0,n)}function Rt(n,e){return new oc({check:"multiple_of",...C(e),value:n})}function Pt(n,e){return new cc({check:"max_size",...C(e),maximum:n})}function at(n,e){return new lc({check:"min_size",...C(e),minimum:n})}function Yt(n,e){return new uc({check:"size_equals",...C(e),size:n})}function Xt(n,e){return new pc({check:"max_length",...C(e),maximum:n})}function gt(n,e){return new dc({check:"min_length",...C(e),minimum:n})}function Qt(n,e){return new mc({check:"length_equals",...C(e),length:n})}function zn(n,e){return new fc({check:"string_format",format:"regex",...C(e),pattern:n})}function Dn(n){return new hc({check:"string_format",format:"lowercase",...C(n)})}function An(n){return new gc({check:"string_format",format:"uppercase",...C(n)})}function Ln(n,e){return new yc({check:"string_format",format:"includes",...C(e),includes:n})}function On(n,e){return new vc({check:"string_format",format:"starts_with",...C(e),prefix:n})}function Cn(n,e){return new _c({check:"string_format",format:"ends_with",...C(e),suffix:n})}function So(n,e,r){return new bc({check:"property",property:n,schema:e,...C(r)})}function Mn(n,e){return new xc({check:"mime_type",mime:n,...C(e)})}function Qe(n){return new Sc({check:"overwrite",tx:n})}function jn(n){return Qe(e=>e.normalize(n))}function Un(){return Qe(n=>n.trim())}function Fn(){return Qe(n=>n.toLowerCase())}function Zn(){return Qe(n=>n.toUpperCase())}function Hn(){return Qe(n=>ba(n))}function mu(n,e,r){return new n({type:"array",element:e,...C(r)})}function cS(n,e,r){return new n({type:"union",options:e,...C(r)})}function lS(n,e,r){return new n({type:"union",options:e,inclusive:!1,...C(r)})}function uS(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...C(i)})}function pS(n,e,r){return new n({type:"intersection",left:e,right:r})}function dS(n,e,r,i){let t=r instanceof K,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...C(o)})}function mS(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...C(i)})}function fS(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...C(i)})}function hS(n,e,r){return new n({type:"set",valueType:e,...C(r)})}function gS(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...C(r)})}function yS(n,e,r){return new n({type:"enum",entries:e,...C(r)})}function vS(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...C(r)})}function fu(n,e){return new n({type:"file",...C(e)})}function _S(n,e){return new n({type:"transform",transform:e})}function bS(n,e){return new n({type:"optional",innerType:e})}function xS(n,e){return new n({type:"nullable",innerType:e})}function SS(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Sa(r)}})}function $S(n,e,r){return new n({type:"nonoptional",innerType:e,...C(r)})}function wS(n,e){return new n({type:"success",innerType:e})}function kS(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function ES(n,e,r){return new n({type:"pipe",in:e,out:r})}function IS(n,e){return new n({type:"readonly",innerType:e})}function TS(n,e,r){return new n({type:"template_literal",parts:e,...C(r)})}function RS(n,e){return new n({type:"lazy",getter:e})}function PS(n,e){return new n({type:"promise",innerType:e})}function hu(n,e,r){let i=C(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function gu(n,e,r){return new n({type:"custom",check:"custom",fn:e,...C(r)})}function yu(n){let e=wh(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(kn(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(kn(t))}},n(r.value,r)));return e}function wh(n,e){let r=new ce({check:"custom",...C(e)});return r._zod.check=n,r}function vu(n){let e=new ce({check:"describe"});return e._zod.onattach=[r=>{let i=$e.get(r)??{};$e.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function _u(n){let e=new ce({check:"meta"});return e._zod.onattach=[r=>{let i=$e.get(r)??{};$e.add(r,{...i,...n})}],e._zod.check=()=>{},e}function bu(n,e){let r=C(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(f=>typeof f=="string"?f.toLowerCase():f),t=t.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(t),a=n.Codec??Or,c=n.Boolean??Ar,l=n.String??Kt,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let h=f;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?i[0]||"true":t[0]||"false"),error:r.error});return p}function Wn(n,e,r,i={}){let t=C(i),o={...C(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 Nt(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??$e,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 re(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 p=s.schema,f=e.processors[t.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);f(n,e,p,u)}let d=n._zod.parent;d&&(s.ref||(s.ref=d),re(d,e,u),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(n);return c&&Object.assign(s.schema,c),e.io==="input"&&Te(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 zt(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 d=n.external.registry.get(s[0])?.id,p=n.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${n.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${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 d in u)delete u[d];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>
499
515
 
500
- 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 Dt(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&&d.def)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:Un(e,"input",n.processors),output:Un(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function we(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 we(i.element,r);if(i.type==="set")return we(i.valueType,r);if(i.type==="lazy")return we(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 we(i.innerType,r);if(i.type==="intersection")return we(i.left,r)||we(i.right,r);if(i.type==="record"||i.type==="map")return we(i.keyType,r)||we(i.valueType,r);if(i.type==="pipe")return we(i.in,r)||we(i.out,r);if(i.type==="object"){for(let t in i.shape)if(we(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(we(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(we(t,r))return!0;return!!(i.rest&&we(i.rest,r))}return!1}var mu=(n,e={})=>r=>{let i=Nt({...r,processors:e});return ne(n,i),zt(i,n),Dt(i,n)},Un=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=Nt({...t??{},target:o,io:e,processors:r});return ne(n,s),zt(s,n),Dt(s,n)};var aS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fu=(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=aS[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}))])}},hu=(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)},gu=(n,e,r,i)=>{r.type="boolean"},yu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},vu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},_u=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},bu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},xu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Su=(n,e,r,i)=>{r.not={}},$u=(n,e,r,i)=>{},wu=(n,e,r,i)=>{},ku=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Eu=(n,e,r,i)=>{let t=n._zod.def,o=hr(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},Iu=(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},Tu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Ru=(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},Pu=(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)},Nu=(n,e,r,i)=>{r.type="boolean"},zu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Du=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Au=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Lu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ou=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Cu=(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"]})},ju=(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)},_o=(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},Mu=(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},Uu=(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)},Fu=(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)}},Zu=(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"}]},Hu=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},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,r.default=JSON.parse(JSON.stringify(t.defaultValue))},Bu=(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)))},Ju=(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},Gu=(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},Vu=(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},qu=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},bo=(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.innerType;ne(t,e,i);let o=e.seen.get(n);o.ref=t},vo={string:fu,number:hu,boolean:gu,bigint:yu,symbol:vu,null:_u,undefined:bu,void:xu,never:Su,any:$u,unknown:wu,date:ku,enum:Eu,literal:Iu,nan:Tu,template_literal:Ru,file:Pu,success:Nu,custom:zu,function:Du,transform:Au,map:Lu,set:Ou,array:Cu,object:ju,union:_o,intersection:Mu,tuple:Uu,record:Fu,nullable:Zu,nonoptional:Hu,default:Wu,prefault:Bu,catch:Ju,pipe:Gu,readonly:Vu,promise:qu,optional:bo,lazy:Ku};function xo(n,e){if("_idmap"in n){let i=n,t=Nt({...e,processors:vo}),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;zt(t,u),s[l]=Dt(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=Nt({...e,processors:vo});return ne(n,r),zt(r,n),Dt(r,n)}var So=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=Nt({processors:vo,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)),zt(this.ctx,e);let i=Dt(this.ctx,e),{"~standard":t,...o}=i;return o}};var fh={};var Dr={};Ce(Dr,{ZodAny:()=>bp,ZodArray:()=>wp,ZodBase64:()=>Ho,ZodBase64URL:()=>Wo,ZodBigInt:()=>Gn,ZodBigIntFormat:()=>Go,ZodBoolean:()=>Jn,ZodCIDRv4:()=>Fo,ZodCIDRv6:()=>Zo,ZodCUID:()=>Ao,ZodCUID2:()=>Lo,ZodCatch:()=>Jp,ZodCodec:()=>ts,ZodCustom:()=>Wr,ZodCustomStringFormat:()=>Wn,ZodDate:()=>Mr,ZodDefault:()=>Up,ZodDiscriminatedUnion:()=>Ep,ZodE164:()=>Bo,ZodEmail:()=>No,ZodEmoji:()=>zo,ZodEnum:()=>Zn,ZodExactOptional:()=>Cp,ZodFile:()=>Lp,ZodFunction:()=>td,ZodGUID:()=>Ar,ZodIPv4:()=>Mo,ZodIPv6:()=>Uo,ZodIntersection:()=>Ip,ZodJWT:()=>Jo,ZodKSUID:()=>jo,ZodLazy:()=>Xp,ZodLiteral:()=>Ap,ZodMAC:()=>mp,ZodMap:()=>zp,ZodNaN:()=>Vp,ZodNanoID:()=>Do,ZodNever:()=>Sp,ZodNonOptional:()=>Qo,ZodNull:()=>vp,ZodNullable:()=>Mp,ZodNumber:()=>Bn,ZodNumberFormat:()=>Qt,ZodObject:()=>Fr,ZodOptional:()=>Xo,ZodPipe:()=>es,ZodPrefault:()=>Zp,ZodPromise:()=>ed,ZodReadonly:()=>qp,ZodRecord:()=>Hr,ZodSet:()=>Dp,ZodString:()=>Hn,ZodStringFormat:()=>ie,ZodSuccess:()=>Bp,ZodSymbol:()=>gp,ZodTemplateLiteral:()=>Yp,ZodTransform:()=>Op,ZodTuple:()=>Rp,ZodType:()=>Y,ZodULID:()=>Oo,ZodURL:()=>jr,ZodUUID:()=>it,ZodUndefined:()=>yp,ZodUnion:()=>Zr,ZodUnknown:()=>xp,ZodVoid:()=>$p,ZodXID:()=>Co,ZodXor:()=>kp,_ZodString:()=>Po,_default:()=>Fp,_function:()=>xg,any:()=>Qh,array:()=>Ur,base64:()=>Oh,base64url:()=>Ch,bigint:()=>Vh,boolean:()=>hp,catch:()=>Gp,check:()=>Sg,cidrv4:()=>Ah,cidrv6:()=>Lh,codec:()=>vg,cuid:()=>Eh,cuid2:()=>Ih,custom:()=>$g,date:()=>tg,describe:()=>wg,discriminatedUnion:()=>ag,e164:()=>jh,email:()=>gh,emoji:()=>wh,enum:()=>Ko,exactOptional:()=>jp,file:()=>fg,float32:()=>Wh,float64:()=>Bh,function:()=>xg,guid:()=>yh,hash:()=>Hh,hex:()=>Zh,hostname:()=>Fh,httpUrl:()=>$h,instanceof:()=>Eg,int:()=>Ro,int32:()=>Jh,int64:()=>qh,intersection:()=>Tp,ipv4:()=>Nh,ipv6:()=>Dh,json:()=>Tg,jwt:()=>Mh,keyof:()=>ng,ksuid:()=>Ph,lazy:()=>Qp,literal:()=>mg,looseObject:()=>og,looseRecord:()=>lg,mac:()=>zh,map:()=>ug,meta:()=>kg,nan:()=>yg,nanoid:()=>kh,nativeEnum:()=>dg,never:()=>Vo,nonoptional:()=>Wp,null:()=>_p,nullable:()=>Or,nullish:()=>hg,number:()=>fp,object:()=>rg,optional:()=>Lr,partialRecord:()=>cg,pipe:()=>Cr,prefault:()=>Hp,preprocess:()=>Rg,promise:()=>bg,readonly:()=>Kp,record:()=>Np,refine:()=>nd,set:()=>pg,strictObject:()=>ig,string:()=>To,stringFormat:()=>Uh,stringbool:()=>Ig,success:()=>gg,superRefine:()=>rd,symbol:()=>Yh,templateLiteral:()=>_g,transform:()=>Yo,tuple:()=>Pp,uint32:()=>Gh,uint64:()=>Kh,ulid:()=>Th,undefined:()=>Xh,union:()=>qo,unknown:()=>Xt,url:()=>Sh,uuid:()=>vh,uuidv4:()=>_h,uuidv6:()=>bh,uuidv7:()=>xh,void:()=>eg,xid:()=>Rh,xor:()=>sg});var $o={};Ce($o,{endsWith:()=>zn,gt:()=>nt,gte:()=>$e,includes:()=>Pn,length:()=>Yt,lowercase:()=>Tn,lt:()=>tt,lte:()=>Ae,maxLength:()=>Kt,maxSize:()=>Pt,mime:()=>Dn,minLength:()=>ft,minSize:()=>rt,multipleOf:()=>Rt,negative:()=>fo,nonnegative:()=>go,nonpositive:()=>ho,normalize:()=>An,overwrite:()=>Ve,positive:()=>mo,property:()=>yo,regex:()=>In,size:()=>qt,slugify:()=>jn,startsWith:()=>Nn,toLowerCase:()=>On,toUpperCase:()=>Cn,trim:()=>Ln,uppercase:()=>Rn});var Fn={};Ce(Fn,{ZodISODate:()=>ko,ZodISODateTime:()=>wo,ZodISODuration:()=>Io,ZodISOTime:()=>Eo,date:()=>Xu,datetime:()=>Yu,duration:()=>ep,time:()=>Qu});var wo=x("ZodISODateTime",(n,e)=>{Tc.init(n,e),ie.init(n,e)});function Yu(n){return zl(wo,n)}var ko=x("ZodISODate",(n,e)=>{Rc.init(n,e),ie.init(n,e)});function Xu(n){return Dl(ko,n)}var Eo=x("ZodISOTime",(n,e)=>{Pc.init(n,e),ie.init(n,e)});function Qu(n){return Al(Eo,n)}var Io=x("ZodISODuration",(n,e)=>{Nc.init(n,e),ie.init(n,e)});function ep(n){return Ll(Io,n)}var hh=(n,e)=>{br.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>Sr(n,r)},flatten:{value:r=>xr(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,vn,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,vn,2)}},isEmpty:{get(){return n.issues.length===0}}})},lS=x("ZodError",hh),Re=x("ZodError",hh,{Parent:Error});var tp=xn(Re),np=Sn(Re),rp=$n(Re),ip=wn(Re),op=bi(Re),sp=xi(Re),ap=Si(Re),cp=$i(Re),lp=wi(Re),up=ki(Re),pp=Ei(Re),dp=Ii(Re);var Y=x("ZodType",(n,e)=>(K.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:Un(n,"input"),output:Un(n,"output")}}),n.toJSONSchema=mu(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(D.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)=>tp(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>rp(n,r,i),n.parseAsync=async(r,i)=>np(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>ip(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>op(n,r,i),n.decode=(r,i)=>sp(n,r,i),n.encodeAsync=async(r,i)=>ap(n,r,i),n.decodeAsync=async(r,i)=>cp(n,r,i),n.safeEncode=(r,i)=>lp(n,r,i),n.safeDecode=(r,i)=>up(n,r,i),n.safeEncodeAsync=async(r,i)=>pp(n,r,i),n.safeDecodeAsync=async(r,i)=>dp(n,r,i),n.refine=(r,i)=>n.check(nd(r,i)),n.superRefine=r=>n.check(rd(r)),n.overwrite=r=>n.check(Ve(r)),n.optional=()=>Lr(n),n.exactOptional=()=>jp(n),n.nullable=()=>Or(n),n.nullish=()=>Lr(Or(n)),n.nonoptional=r=>Wp(n,r),n.array=()=>Ur(n),n.or=r=>qo([n,r]),n.and=r=>Tp(n,r),n.transform=r=>Cr(n,Yo(r)),n.default=r=>Fp(n,r),n.prefault=r=>Hp(n,r),n.catch=r=>Gp(n,r),n.pipe=r=>Cr(n,r),n.readonly=()=>Kp(n),n.describe=r=>{let i=n.clone();return _e.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return _e.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return _e.get(n);let i=n.clone();return _e.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),Po=x("_ZodString",(n,e)=>{Vt.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>fu(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(In(...i)),n.includes=(...i)=>n.check(Pn(...i)),n.startsWith=(...i)=>n.check(Nn(...i)),n.endsWith=(...i)=>n.check(zn(...i)),n.min=(...i)=>n.check(ft(...i)),n.max=(...i)=>n.check(Kt(...i)),n.length=(...i)=>n.check(Yt(...i)),n.nonempty=(...i)=>n.check(ft(1,...i)),n.lowercase=i=>n.check(Tn(i)),n.uppercase=i=>n.check(Rn(i)),n.trim=()=>n.check(Ln()),n.normalize=(...i)=>n.check(An(...i)),n.toLowerCase=()=>n.check(On()),n.toUpperCase=()=>n.check(Cn()),n.slugify=()=>n.check(jn())}),Hn=x("ZodString",(n,e)=>{Vt.init(n,e),Po.init(n,e),n.email=r=>n.check(Ji(No,r)),n.url=r=>n.check(zr(jr,r)),n.jwt=r=>n.check(po(Jo,r)),n.emoji=r=>n.check(Yi(zo,r)),n.guid=r=>n.check(Nr(Ar,r)),n.uuid=r=>n.check(Gi(it,r)),n.uuidv4=r=>n.check(Vi(it,r)),n.uuidv6=r=>n.check(qi(it,r)),n.uuidv7=r=>n.check(Ki(it,r)),n.nanoid=r=>n.check(Xi(Do,r)),n.guid=r=>n.check(Nr(Ar,r)),n.cuid=r=>n.check(Qi(Ao,r)),n.cuid2=r=>n.check(eo(Lo,r)),n.ulid=r=>n.check(to(Oo,r)),n.base64=r=>n.check(co(Ho,r)),n.base64url=r=>n.check(lo(Wo,r)),n.xid=r=>n.check(no(Co,r)),n.ksuid=r=>n.check(ro(jo,r)),n.ipv4=r=>n.check(io(Mo,r)),n.ipv6=r=>n.check(oo(Uo,r)),n.cidrv4=r=>n.check(so(Fo,r)),n.cidrv6=r=>n.check(ao(Zo,r)),n.e164=r=>n.check(uo(Bo,r)),n.datetime=r=>n.check(Yu(r)),n.date=r=>n.check(Xu(r)),n.time=r=>n.check(Qu(r)),n.duration=r=>n.check(ep(r))});function To(n){return Tl(Hn,n)}var ie=x("ZodStringFormat",(n,e)=>{re.init(n,e),Po.init(n,e)}),No=x("ZodEmail",(n,e)=>{_c.init(n,e),ie.init(n,e)});function gh(n){return Ji(No,n)}var Ar=x("ZodGUID",(n,e)=>{yc.init(n,e),ie.init(n,e)});function yh(n){return Nr(Ar,n)}var it=x("ZodUUID",(n,e)=>{vc.init(n,e),ie.init(n,e)});function vh(n){return Gi(it,n)}function _h(n){return Vi(it,n)}function bh(n){return qi(it,n)}function xh(n){return Ki(it,n)}var jr=x("ZodURL",(n,e)=>{bc.init(n,e),ie.init(n,e)});function Sh(n){return zr(jr,n)}function $h(n){return zr(jr,{protocol:/^https?$/,hostname:Me.domain,...D.normalizeParams(n)})}var zo=x("ZodEmoji",(n,e)=>{xc.init(n,e),ie.init(n,e)});function wh(n){return Yi(zo,n)}var Do=x("ZodNanoID",(n,e)=>{Sc.init(n,e),ie.init(n,e)});function kh(n){return Xi(Do,n)}var Ao=x("ZodCUID",(n,e)=>{$c.init(n,e),ie.init(n,e)});function Eh(n){return Qi(Ao,n)}var Lo=x("ZodCUID2",(n,e)=>{wc.init(n,e),ie.init(n,e)});function Ih(n){return eo(Lo,n)}var Oo=x("ZodULID",(n,e)=>{kc.init(n,e),ie.init(n,e)});function Th(n){return to(Oo,n)}var Co=x("ZodXID",(n,e)=>{Ec.init(n,e),ie.init(n,e)});function Rh(n){return no(Co,n)}var jo=x("ZodKSUID",(n,e)=>{Ic.init(n,e),ie.init(n,e)});function Ph(n){return ro(jo,n)}var Mo=x("ZodIPv4",(n,e)=>{zc.init(n,e),ie.init(n,e)});function Nh(n){return io(Mo,n)}var mp=x("ZodMAC",(n,e)=>{Ac.init(n,e),ie.init(n,e)});function zh(n){return Pl(mp,n)}var Uo=x("ZodIPv6",(n,e)=>{Dc.init(n,e),ie.init(n,e)});function Dh(n){return oo(Uo,n)}var Fo=x("ZodCIDRv4",(n,e)=>{Lc.init(n,e),ie.init(n,e)});function Ah(n){return so(Fo,n)}var Zo=x("ZodCIDRv6",(n,e)=>{Oc.init(n,e),ie.init(n,e)});function Lh(n){return ao(Zo,n)}var Ho=x("ZodBase64",(n,e)=>{jc.init(n,e),ie.init(n,e)});function Oh(n){return co(Ho,n)}var Wo=x("ZodBase64URL",(n,e)=>{Mc.init(n,e),ie.init(n,e)});function Ch(n){return lo(Wo,n)}var Bo=x("ZodE164",(n,e)=>{Uc.init(n,e),ie.init(n,e)});function jh(n){return uo(Bo,n)}var Jo=x("ZodJWT",(n,e)=>{Fc.init(n,e),ie.init(n,e)});function Mh(n){return po(Jo,n)}var Wn=x("ZodCustomStringFormat",(n,e)=>{Zc.init(n,e),ie.init(n,e)});function Uh(n,e,r={}){return Mn(Wn,n,e,r)}function Fh(n){return Mn(Wn,"hostname",Me.hostname,n)}function Zh(n){return Mn(Wn,"hex",Me.hex,n)}function Hh(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=Me[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return Mn(Wn,i,t,e)}var Bn=x("ZodNumber",(n,e)=>{Ci.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>hu(n,i,t,o),n.gt=(i,t)=>n.check(nt(i,t)),n.gte=(i,t)=>n.check($e(i,t)),n.min=(i,t)=>n.check($e(i,t)),n.lt=(i,t)=>n.check(tt(i,t)),n.lte=(i,t)=>n.check(Ae(i,t)),n.max=(i,t)=>n.check(Ae(i,t)),n.int=i=>n.check(Ro(i)),n.safe=i=>n.check(Ro(i)),n.positive=i=>n.check(nt(0,i)),n.nonnegative=i=>n.check($e(0,i)),n.negative=i=>n.check(tt(0,i)),n.nonpositive=i=>n.check(Ae(0,i)),n.multipleOf=(i,t)=>n.check(Rt(i,t)),n.step=(i,t)=>n.check(Rt(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 fp(n){return Ol(Bn,n)}var Qt=x("ZodNumberFormat",(n,e)=>{Hc.init(n,e),Bn.init(n,e)});function Ro(n){return jl(Qt,n)}function Wh(n){return Ml(Qt,n)}function Bh(n){return Ul(Qt,n)}function Jh(n){return Fl(Qt,n)}function Gh(n){return Zl(Qt,n)}var Jn=x("ZodBoolean",(n,e)=>{Er.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>gu(n,r,i,t)});function hp(n){return Hl(Jn,n)}var Gn=x("ZodBigInt",(n,e)=>{ji.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>yu(n,i,t,o),n.gte=(i,t)=>n.check($e(i,t)),n.min=(i,t)=>n.check($e(i,t)),n.gt=(i,t)=>n.check(nt(i,t)),n.gte=(i,t)=>n.check($e(i,t)),n.min=(i,t)=>n.check($e(i,t)),n.lt=(i,t)=>n.check(tt(i,t)),n.lte=(i,t)=>n.check(Ae(i,t)),n.max=(i,t)=>n.check(Ae(i,t)),n.positive=i=>n.check(nt(BigInt(0),i)),n.negative=i=>n.check(tt(BigInt(0),i)),n.nonpositive=i=>n.check(Ae(BigInt(0),i)),n.nonnegative=i=>n.check($e(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(Rt(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function Vh(n){return Bl(Gn,n)}var Go=x("ZodBigIntFormat",(n,e)=>{Wc.init(n,e),Gn.init(n,e)});function qh(n){return Gl(Go,n)}function Kh(n){return Vl(Go,n)}var gp=x("ZodSymbol",(n,e)=>{Bc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>vu(n,r,i,t)});function Yh(n){return ql(gp,n)}var yp=x("ZodUndefined",(n,e)=>{Jc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>bu(n,r,i,t)});function Xh(n){return Kl(yp,n)}var vp=x("ZodNull",(n,e)=>{Gc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>_u(n,r,i,t)});function _p(n){return Yl(vp,n)}var bp=x("ZodAny",(n,e)=>{Vc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>$u(n,r,i,t)});function Qh(){return Xl(bp)}var xp=x("ZodUnknown",(n,e)=>{qc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wu(n,r,i,t)});function Xt(){return Ql(xp)}var Sp=x("ZodNever",(n,e)=>{Kc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Su(n,r,i,t)});function Vo(n){return eu(Sp,n)}var $p=x("ZodVoid",(n,e)=>{Yc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>xu(n,r,i,t)});function eg(n){return tu($p,n)}var Mr=x("ZodDate",(n,e)=>{Xc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ku(n,i,t,o),n.min=(i,t)=>n.check($e(i,t)),n.max=(i,t)=>n.check(Ae(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 tg(n){return nu(Mr,n)}var wp=x("ZodArray",(n,e)=>{Qc.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Cu(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(ft(r,i)),n.nonempty=r=>n.check(ft(1,r)),n.max=(r,i)=>n.check(Kt(r,i)),n.length=(r,i)=>n.check(Yt(r,i)),n.unwrap=()=>n.element});function Ur(n,e){return ou(wp,n,e)}function ng(n){let e=n._zod.def.shape;return Ko(Object.keys(e))}var Fr=x("ZodObject",(n,e)=>{el.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ju(n,r,i,t),D.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>Ko(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:Xt()}),n.loose=()=>n.clone({...n._zod.def,catchall:Xt()}),n.strict=()=>n.clone({...n._zod.def,catchall:Vo()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>D.extend(n,r),n.safeExtend=r=>D.safeExtend(n,r),n.merge=r=>D.merge(n,r),n.pick=r=>D.pick(n,r),n.omit=r=>D.omit(n,r),n.partial=(...r)=>D.partial(Xo,n,r[0]),n.required=(...r)=>D.required(Qo,n,r[0])});function rg(n,e){let r={type:"object",shape:n??{},...D.normalizeParams(e)};return new Fr(r)}function ig(n,e){return new Fr({type:"object",shape:n,catchall:Vo(),...D.normalizeParams(e)})}function og(n,e){return new Fr({type:"object",shape:n,catchall:Xt(),...D.normalizeParams(e)})}var Zr=x("ZodUnion",(n,e)=>{Ir.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>_o(n,r,i,t),n.options=e.options});function qo(n,e){return new Zr({type:"union",options:n,...D.normalizeParams(e)})}var kp=x("ZodXor",(n,e)=>{Zr.init(n,e),tl.init(n,e),n._zod.processJSONSchema=(r,i,t)=>_o(n,r,i,t),n.options=e.options});function sg(n,e){return new kp({type:"union",options:n,inclusive:!1,...D.normalizeParams(e)})}var Ep=x("ZodDiscriminatedUnion",(n,e)=>{Zr.init(n,e),nl.init(n,e)});function ag(n,e,r){return new Ep({type:"union",options:e,discriminator:n,...D.normalizeParams(r)})}var Ip=x("ZodIntersection",(n,e)=>{rl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Mu(n,r,i,t)});function Tp(n,e){return new Ip({type:"intersection",left:n,right:e})}var Rp=x("ZodTuple",(n,e)=>{Mi.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Uu(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function Pp(n,e,r){let i=e instanceof K,t=i?r:e,o=i?e:null;return new Rp({type:"tuple",items:n,rest:o,...D.normalizeParams(t)})}var Hr=x("ZodRecord",(n,e)=>{il.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Fu(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function Np(n,e,r){return new Hr({type:"record",keyType:n,valueType:e,...D.normalizeParams(r)})}function cg(n,e,r){let i=Se(n);return i._zod.values=void 0,new Hr({type:"record",keyType:i,valueType:e,...D.normalizeParams(r)})}function lg(n,e,r){return new Hr({type:"record",keyType:n,valueType:e,mode:"loose",...D.normalizeParams(r)})}var zp=x("ZodMap",(n,e)=>{ol.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Lu(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType,n.min=(...r)=>n.check(rt(...r)),n.nonempty=r=>n.check(rt(1,r)),n.max=(...r)=>n.check(Pt(...r)),n.size=(...r)=>n.check(qt(...r))});function ug(n,e,r){return new zp({type:"map",keyType:n,valueType:e,...D.normalizeParams(r)})}var Dp=x("ZodSet",(n,e)=>{sl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ou(n,r,i,t),n.min=(...r)=>n.check(rt(...r)),n.nonempty=r=>n.check(rt(1,r)),n.max=(...r)=>n.check(Pt(...r)),n.size=(...r)=>n.check(qt(...r))});function pg(n,e){return new Dp({type:"set",valueType:n,...D.normalizeParams(e)})}var Zn=x("ZodEnum",(n,e)=>{al.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Eu(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 Zn({...e,checks:[],...D.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 Zn({...e,checks:[],...D.normalizeParams(t),entries:o})}});function Ko(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new Zn({type:"enum",entries:r,...D.normalizeParams(e)})}function dg(n,e){return new Zn({type:"enum",entries:n,...D.normalizeParams(e)})}var Ap=x("ZodLiteral",(n,e)=>{cl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Iu(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 mg(n,e){return new Ap({type:"literal",values:Array.isArray(n)?n:[n],...D.normalizeParams(e)})}var Lp=x("ZodFile",(n,e)=>{ll.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Pu(n,r,i,t),n.min=(r,i)=>n.check(rt(r,i)),n.max=(r,i)=>n.check(Pt(r,i)),n.mime=(r,i)=>n.check(Dn(Array.isArray(r)?r:[r],i))});function fg(n){return su(Lp,n)}var Op=x("ZodTransform",(n,e)=>{ul.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Au(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new wt(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(D.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(D.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 Yo(n){return new Op({type:"transform",transform:n})}var Xo=x("ZodOptional",(n,e)=>{Ui.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>bo(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Lr(n){return new Xo({type:"optional",innerType:n})}var Cp=x("ZodExactOptional",(n,e)=>{pl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>bo(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function jp(n){return new Cp({type:"optional",innerType:n})}var Mp=x("ZodNullable",(n,e)=>{dl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Zu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Or(n){return new Mp({type:"nullable",innerType:n})}function hg(n){return Lr(Or(n))}var Up=x("ZodDefault",(n,e)=>{ml.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Wu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function Fp(n,e){return new Up({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var Zp=x("ZodPrefault",(n,e)=>{fl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Bu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Hp(n,e){return new Zp({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var Qo=x("ZodNonOptional",(n,e)=>{hl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Hu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Wp(n,e){return new Qo({type:"nonoptional",innerType:n,...D.normalizeParams(e)})}var Bp=x("ZodSuccess",(n,e)=>{gl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Nu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function gg(n){return new Bp({type:"success",innerType:n})}var Jp=x("ZodCatch",(n,e)=>{yl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ju(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Gp(n,e){return new Jp({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var Vp=x("ZodNaN",(n,e)=>{vl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Tu(n,r,i,t)});function yg(n){return iu(Vp,n)}var es=x("ZodPipe",(n,e)=>{_l.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Gu(n,r,i,t),n.in=e.in,n.out=e.out});function Cr(n,e){return new es({type:"pipe",in:n,out:e})}var ts=x("ZodCodec",(n,e)=>{es.init(n,e),Tr.init(n,e)});function vg(n,e,r){return new ts({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var qp=x("ZodReadonly",(n,e)=>{bl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Vu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Kp(n){return new qp({type:"readonly",innerType:n})}var Yp=x("ZodTemplateLiteral",(n,e)=>{xl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ru(n,r,i,t)});function _g(n,e){return new Yp({type:"template_literal",parts:n,...D.normalizeParams(e)})}var Xp=x("ZodLazy",(n,e)=>{wl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ku(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function Qp(n){return new Xp({type:"lazy",getter:n})}var ed=x("ZodPromise",(n,e)=>{$l.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>qu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function bg(n){return new ed({type:"promise",innerType:n})}var td=x("ZodFunction",(n,e)=>{Sl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Du(n,r,i,t)});function xg(n){return new td({type:"function",input:Array.isArray(n?.input)?Pp(n?.input):n?.input??Ur(Xt()),output:n?.output??Xt()})}var Wr=x("ZodCustom",(n,e)=>{kl.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>zu(n,r,i,t)});function Sg(n){let e=new oe({check:"custom"});return e._zod.check=n,e}function $g(n,e){return au(Wr,n??(()=>!0),e)}function nd(n,e={}){return cu(Wr,n,e)}function rd(n){return lu(n)}var wg=uu,kg=pu;function Eg(n,e={}){let r=new Wr({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...D.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 Ig=(...n)=>du({Codec:ts,Boolean:Jn,String:Hn},...n);function Tg(n){let e=Qp(()=>qo([To(n),fp(),hp(),_p(),Ur(e),Np(To(),e)]));return e}function Rg(n,e){return Cr(Yo(n),e)}var pS={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 dS(n){me({customError:n})}function mS(){return me().customError}var id;id||(id={});var j={...Dr,...$o,iso:Fn},fS=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 hS(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 gS(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 Pg(n,e){if(n.not!==void 0){if(typeof n.not=="object"&&Object.keys(n.not).length===0)return j.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 j.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=gS(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 j.null();if(t.length===0)return j.never();if(t.length===1)return j.literal(t[0]);if(t.every(s=>typeof s=="string"))return j.enum(t);let o=t.map(s=>j.literal(s));return o.length<2?o[0]:j.union([o[0],o[1],...o.slice(2)])}if(n.const!==void 0)return j.literal(n.const);let r=n.type;if(Array.isArray(r)){let t=r.map(o=>{let s={...n,type:o};return Pg(s,e)});return t.length===0?j.never():t.length===1?t[0]:j.union(t)}if(!r)return j.any();let i;switch(r){case"string":{let t=j.string();if(n.format){let o=n.format;o==="email"?t=t.check(j.email()):o==="uri"||o==="uri-reference"?t=t.check(j.url()):o==="uuid"||o==="guid"?t=t.check(j.uuid()):o==="date-time"?t=t.check(j.iso.datetime()):o==="date"?t=t.check(j.iso.date()):o==="time"?t=t.check(j.iso.time()):o==="duration"?t=t.check(j.iso.duration()):o==="ipv4"?t=t.check(j.ipv4()):o==="ipv6"?t=t.check(j.ipv6()):o==="mac"?t=t.check(j.mac()):o==="cidr"?t=t.check(j.cidrv4()):o==="cidr-v6"?t=t.check(j.cidrv6()):o==="base64"?t=t.check(j.base64()):o==="base64url"?t=t.check(j.base64url()):o==="e164"?t=t.check(j.e164()):o==="jwt"?t=t.check(j.jwt()):o==="emoji"?t=t.check(j.emoji()):o==="nanoid"?t=t.check(j.nanoid()):o==="cuid"?t=t.check(j.cuid()):o==="cuid2"?t=t.check(j.cuid2()):o==="ulid"?t=t.check(j.ulid()):o==="xid"?t=t.check(j.xid()):o==="ksuid"&&(t=t.check(j.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"?j.number().int():j.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=j.boolean();break}case"null":{i=j.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):j.any();if(Object.keys(t).length===0){i=j.record(c,l);break}let u=j.object(t).passthrough(),p=j.looseRecord(c,l);i=j.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=j.string().regex(new RegExp(d));u.push(j.looseRecord(f,m))}let p=[];if(Object.keys(t).length>0&&p.push(j.object(t).passthrough()),p.push(...u),p.length===0)i=j.object({}).passthrough();else if(p.length===1)i=p[0];else{let d=j.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)d=j.intersection(d,p[m]);i=d}break}let a=j.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=j.tuple(s).rest(a):i=j.tuple(s),typeof n.minItems=="number"&&(i=i.check(j.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(j.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=j.tuple(s).rest(a):i=j.tuple(s),typeof n.minItems=="number"&&(i=i.check(j.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(j.maxLength(n.maxItems)))}else if(o!==void 0){let s=xe(o,e),a=j.array(s);typeof n.minItems=="number"&&(a=a.min(n.minItems)),typeof n.maxItems=="number"&&(a=a.max(n.maxItems)),i=a}else i=j.array(j.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?j.any():j.never();let r=Pg(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=j.union(a);r=i?j.intersection(r,c):c}if(n.oneOf&&Array.isArray(n.oneOf)){let a=n.oneOf.map(l=>xe(l,e)),c=j.xor(a);r=i?j.intersection(r,c):c}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)r=i?r:j.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=j.intersection(a,xe(n.allOf[l],e));r=a}n.nullable===!0&&e.version==="openapi-3.0"&&(r=j.nullable(r)),n.readOnly===!0&&(r=j.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))fS.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function Ng(n,e){if(typeof n=="boolean")return n?j.any():j.never();let r=hS(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??_e};return xe(n,t)}var od={};Ce(od,{bigint:()=>bS,boolean:()=>_S,date:()=>xS,number:()=>vS,string:()=>yS});function yS(n){return Rl(Hn,n)}function vS(n){return Cl(Bn,n)}function _S(n){return Wl(Jn,n)}function bS(n){return Jl(Gn,n)}function xS(n){return ru(Mr,n)}me(Fi());var ns=["**/node_modules/**","**/.git/**","**/dist/**","**/build/**","**/vendor/**","**/.next/**","**/.cache/**","**/coverage/**","**/*.min.js"],zg=["**/*.{ts,tsx,yaml,yml,php,py,go}","**/*.prisma","**/*.{graphql,gql}","**/Dockerfile*","**/.env*","**/package.json","**/lerna.json","**/turbo.json","**/pnpm-workspace.yaml"],ye={MAX_DEPTH:10,MIN_DEPTH:1,MAX_LIMIT:500,MIN_LIMIT:1,MAX_QUERY_LENGTH:500,DEFAULT_DEPTH:3,DEFAULT_LIMIT:10},Pe={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},sd={SECONDS_PER_DAY:86400,SECONDS_PER_YEAR:31536e3},rs={DEFAULT_CONCURRENCY:parseInt(process.env.INDEX_CONCURRENCY??String(5),10)};var UI=g.object({repoPath:g.string(),mode:g.enum(["init","tree","topography","scout","hologram","tools"]),subPath:g.string().optional(),maxDepth:g.number().int().min(ye.MIN_DEPTH).max(ye.MAX_DEPTH).optional()}),FI=g.object({repoPath:g.string(),mode:g.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:g.string().max(ye.MAX_QUERY_LENGTH).optional(),key:g.string().optional(),kind:g.enum(["Service","Image","Port","Env"]).optional(),limit:g.number().int().min(ye.MIN_LIMIT).max(ye.MAX_LIMIT).optional(),offset:g.number().int().min(0).optional(),compact:g.boolean().optional()}).refine(n=>!(n.mode==="concept"&&(!n.query||n.query.trim().length===0)),{message:"Concept search requires a non-empty query",path:["query"]}),ZI=g.object({repoPath:g.string(),mode:g.enum(["symbol","file"]),filePath:g.string().optional(),detailLevel:g.enum(["structure","signatures","summaries","detailed"]).optional(),symbolName:g.string().optional(),context:g.enum(["definition","full"]).optional()}),HI=g.object({repoPath:g.string(),mode:g.enum(["impact","deps","flow","dead-code","circular-deps"]),filePath:g.string().optional(),symbolName:g.string().optional(),direction:g.enum(["imports","imported_by"]).optional(),depth:g.number().int().min(ye.MIN_DEPTH).max(ye.MAX_DEPTH).optional(),limit:g.number().int().min(ye.MIN_LIMIT).max(ye.MAX_LIMIT).optional(),includeTests:g.boolean().optional()}),WI=g.object({repoPath:g.string(),action:g.enum(["index","repair","trace"]),deep:g.boolean().optional(),sinceCommit:g.string().optional()}),BI=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),JI=g.object({action:g.enum(["list","link","fuse"]),repoPaths:g.array(g.string()).optional(),name:g.string().optional(),status:g.string().optional(),parentRepoPath:g.string().optional(),parentMissionId:g.number().optional(),childRepoPath:g.string().optional(),childMissionId:g.number().optional(),relationship:g.string().optional()});var Dg=[];var ad=[...Um,...Fm];import Le from"path";import fd from"fs";B();import he from"path";import cd from"fs";var is=b.child({module:"path-resolver"}),Vn=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 is.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 is.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 cd.existsSync(r)?r:(is.debug({inputPath:e,resolved:r},"Path does not exist"),null)}catch(r){return is.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(cd.existsSync(r)){let s=cd.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 Ag(n){return new Vn(n)}var kS=/[\x00-\x1f\x7f]/g,ES=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function en(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(kS,"").length!==n.length)throw new Error("Invalid path: control characters are not allowed");return n.trim()}function tn(n,e=4096){if(typeof n!="string")return"";let r=n.replace(ES,"").trim();return r.length>e?r.slice(0,e):r}Lt();var Gr=`
516
+ 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 Dt(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 p=n.seen.get(u),f=p.schema;if(f.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(f)):Object.assign(c,f),Object.assign(c,l),s._zod.parent===u)for(let h in c)h==="$ref"||h==="allOf"||h in l||delete c[h];if(f.$ref&&p.def)for(let h in c)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(c[h])===JSON.stringify(p.def[h])&&delete c[h]}let d=s._zod.parent;if(d&&d!==u){i(d);let p=n.seen.get(d);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let f in c)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(c[f])===JSON.stringify(p.def[f])&&delete c[f]}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:Bn(e,"input",n.processors),output:Bn(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Te(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 Te(i.element,r);if(i.type==="set")return Te(i.valueType,r);if(i.type==="lazy")return Te(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 Te(i.innerType,r);if(i.type==="intersection")return Te(i.left,r)||Te(i.right,r);if(i.type==="record"||i.type==="map")return Te(i.keyType,r)||Te(i.valueType,r);if(i.type==="pipe")return Te(i.in,r)||Te(i.out,r);if(i.type==="object"){for(let t in i.shape)if(Te(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(Te(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(Te(t,r))return!0;return!!(i.rest&&Te(i.rest,r))}return!1}var xu=(n,e={})=>r=>{let i=Nt({...r,processors:e});return re(n,i),zt(i,n),Dt(i,n)},Bn=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=Nt({...t??{},target:o,io:e,processors:r});return re(n,s),zt(s,n),Dt(s,n)};var NS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Su=(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=NS[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(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},$u=(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)},wu=(n,e,r,i)=>{r.type="boolean"},ku=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Eu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Iu=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Tu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Ru=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Pu=(n,e,r,i)=>{r.not={}},Nu=(n,e,r,i)=>{},zu=(n,e,r,i)=>{},Du=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Au=(n,e,r,i)=>{let t=n._zod.def,o=$r(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},Lu=(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},Ou=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Cu=(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},Mu=(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)},ju=(n,e,r,i)=>{r.type="boolean"},Uu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Fu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Zu=(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")},Wu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Bu=(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=re(o.element,e,{...i,path:[...i.path,"items"]})},Gu=(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]=re(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=re(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},wo=(n,e,r,i)=>{let t=n._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>re(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},Ju=(n,e,r,i)=>{let t=n._zod.def,o=re(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=re(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},Vu=(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((p,f)=>re(p,e,{...i,path:[...i.path,s,f]})),l=o.rest?re(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:d}=n._zod.bag;typeof u=="number"&&(t.minItems=u),typeof d=="number"&&(t.maxItems=d)},qu=(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=re(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});t.patternProperties={};for(let d of c)t.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(t.propertyNames=re(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=re(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(t.required=u)}},Ku=(n,e,r,i)=>{let t=n._zod.def,o=re(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"}]},Yu=(n,e,r,i)=>{let t=n._zod.def;re(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Xu=(n,e,r,i)=>{let t=n._zod.def;re(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.default=JSON.parse(JSON.stringify(t.defaultValue))},Qu=(n,e,r,i)=>{let t=n._zod.def;re(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)))},ep=(n,e,r,i)=>{let t=n._zod.def;re(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},tp=(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;re(o,e,i);let s=e.seen.get(n);s.ref=o},np=(n,e,r,i)=>{let t=n._zod.def;re(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.readOnly=!0},rp=(n,e,r,i)=>{let t=n._zod.def;re(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},ko=(n,e,r,i)=>{let t=n._zod.def;re(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},ip=(n,e,r,i)=>{let t=n._zod.innerType;re(t,e,i);let o=e.seen.get(n);o.ref=t},$o={string:Su,number:$u,boolean:wu,bigint:ku,symbol:Eu,null:Iu,undefined:Tu,void:Ru,never:Pu,any:Nu,unknown:zu,date:Du,enum:Au,literal:Lu,nan:Ou,template_literal:Cu,file:Mu,success:ju,custom:Uu,function:Fu,transform:Zu,map:Hu,set:Wu,array:Bu,object:Gu,union:wo,intersection:Ju,tuple:Vu,record:qu,nullable:Ku,nonoptional:Yu,default:Xu,prefault:Qu,catch:ep,pipe:tp,readonly:np,promise:rp,optional:ko,lazy:ip};function Eo(n,e){if("_idmap"in n){let i=n,t=Nt({...e,processors:$o}),o={};for(let c of i._idmap.entries()){let[l,u]=c;re(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;zt(t,u),s[l]=Dt(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=Nt({...e,processors:$o});return re(n,r),zt(r,n),Dt(r,n)}var Io=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=Nt({processors:$o,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 re(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)),zt(this.ctx,e);let i=Dt(this.ctx,e),{"~standard":t,...o}=i;return o}};var kh={};var Fr={};Fe(Fr,{ZodAny:()=>Tp,ZodArray:()=>zp,ZodBase64:()=>Vo,ZodBase64URL:()=>qo,ZodBigInt:()=>Xn,ZodBigIntFormat:()=>Xo,ZodBoolean:()=>Yn,ZodCIDRv4:()=>Go,ZodCIDRv6:()=>Jo,ZodCUID:()=>jo,ZodCUID2:()=>Uo,ZodCatch:()=>ed,ZodCodec:()=>ss,ZodCustom:()=>Xr,ZodCustomStringFormat:()=>qn,ZodDate:()=>Jr,ZodDefault:()=>Vp,ZodDiscriminatedUnion:()=>Ap,ZodE164:()=>Ko,ZodEmail:()=>Oo,ZodEmoji:()=>Co,ZodEnum:()=>Jn,ZodExactOptional:()=>Bp,ZodFile:()=>Hp,ZodFunction:()=>ld,ZodGUID:()=>Zr,ZodIPv4:()=>Wo,ZodIPv6:()=>Bo,ZodIntersection:()=>Lp,ZodJWT:()=>Yo,ZodKSUID:()=>Ho,ZodLazy:()=>sd,ZodLiteral:()=>Zp,ZodMAC:()=>xp,ZodMap:()=>Up,ZodNaN:()=>nd,ZodNanoID:()=>Mo,ZodNever:()=>Pp,ZodNonOptional:()=>is,ZodNull:()=>Ep,ZodNullable:()=>Jp,ZodNumber:()=>Kn,ZodNumberFormat:()=>tn,ZodObject:()=>qr,ZodOptional:()=>rs,ZodPipe:()=>os,ZodPrefault:()=>Kp,ZodPromise:()=>cd,ZodReadonly:()=>rd,ZodRecord:()=>Yr,ZodSet:()=>Fp,ZodString:()=>Vn,ZodStringFormat:()=>se,ZodSuccess:()=>Qp,ZodSymbol:()=>wp,ZodTemplateLiteral:()=>od,ZodTransform:()=>Wp,ZodTuple:()=>Cp,ZodType:()=>X,ZodULID:()=>Fo,ZodURL:()=>Gr,ZodUUID:()=>ct,ZodUndefined:()=>kp,ZodUnion:()=>Kr,ZodUnknown:()=>Rp,ZodVoid:()=>Np,ZodXID:()=>Zo,ZodXor:()=>Dp,_ZodString:()=>Lo,_default:()=>qp,_function:()=>zg,any:()=>ug,array:()=>Vr,base64:()=>Jh,base64url:()=>Vh,bigint:()=>og,boolean:()=>$p,catch:()=>td,check:()=>Dg,cidrv4:()=>Bh,cidrv6:()=>Gh,codec:()=>Rg,cuid:()=>Ch,cuid2:()=>Mh,custom:()=>Ag,date:()=>dg,describe:()=>Lg,discriminatedUnion:()=>vg,e164:()=>qh,email:()=>Ih,emoji:()=>Lh,enum:()=>ts,exactOptional:()=>Gp,file:()=>kg,float32:()=>tg,float64:()=>ng,function:()=>zg,guid:()=>Th,hash:()=>eg,hex:()=>Qh,hostname:()=>Xh,httpUrl:()=>Ah,instanceof:()=>Cg,int:()=>Ao,int32:()=>rg,int64:()=>sg,intersection:()=>Op,ipv4:()=>Zh,ipv6:()=>Wh,json:()=>jg,jwt:()=>Kh,keyof:()=>mg,ksuid:()=>Fh,lazy:()=>ad,literal:()=>wg,looseObject:()=>gg,looseRecord:()=>bg,mac:()=>Hh,map:()=>xg,meta:()=>Og,nan:()=>Tg,nanoid:()=>Oh,nativeEnum:()=>$g,never:()=>Qo,nonoptional:()=>Xp,null:()=>Ip,nullable:()=>Wr,nullish:()=>Eg,number:()=>Sp,object:()=>fg,optional:()=>Hr,partialRecord:()=>_g,pipe:()=>Br,prefault:()=>Yp,preprocess:()=>Ug,promise:()=>Ng,readonly:()=>id,record:()=>jp,refine:()=>ud,set:()=>Sg,strictObject:()=>hg,string:()=>Do,stringFormat:()=>Yh,stringbool:()=>Mg,success:()=>Ig,superRefine:()=>pd,symbol:()=>cg,templateLiteral:()=>Pg,transform:()=>ns,tuple:()=>Mp,uint32:()=>ig,uint64:()=>ag,ulid:()=>jh,undefined:()=>lg,union:()=>es,unknown:()=>en,url:()=>Dh,uuid:()=>Rh,uuidv4:()=>Ph,uuidv6:()=>Nh,uuidv7:()=>zh,void:()=>pg,xid:()=>Uh,xor:()=>yg});var To={};Fe(To,{endsWith:()=>Cn,gt:()=>st,gte:()=>Ie,includes:()=>Ln,length:()=>Qt,lowercase:()=>Dn,lt:()=>ot,lte:()=>Me,maxLength:()=>Xt,maxSize:()=>Pt,mime:()=>Mn,minLength:()=>gt,minSize:()=>at,multipleOf:()=>Rt,negative:()=>_o,nonnegative:()=>xo,nonpositive:()=>bo,normalize:()=>jn,overwrite:()=>Qe,positive:()=>vo,property:()=>So,regex:()=>zn,size:()=>Yt,slugify:()=>Hn,startsWith:()=>On,toLowerCase:()=>Fn,toUpperCase:()=>Zn,trim:()=>Un,uppercase:()=>An});var Gn={};Fe(Gn,{ZodISODate:()=>Po,ZodISODateTime:()=>Ro,ZodISODuration:()=>zo,ZodISOTime:()=>No,date:()=>sp,datetime:()=>op,duration:()=>cp,time:()=>ap});var Ro=w("ZodISODateTime",(n,e)=>{Oc.init(n,e),se.init(n,e)});function op(n){return Ul(Ro,n)}var Po=w("ZodISODate",(n,e)=>{Cc.init(n,e),se.init(n,e)});function sp(n){return Fl(Po,n)}var No=w("ZodISOTime",(n,e)=>{Mc.init(n,e),se.init(n,e)});function ap(n){return Zl(No,n)}var zo=w("ZodISODuration",(n,e)=>{jc.init(n,e),se.init(n,e)});function cp(n){return Hl(zo,n)}var Eh=(n,e)=>{Tr.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>Pr(n,r)},flatten:{value:r=>Rr(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,$n,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,$n,2)}},isEmpty:{get(){return n.issues.length===0}}})},DS=w("ZodError",Eh),Ae=w("ZodError",Eh,{Parent:Error});var lp=En(Ae),up=In(Ae),pp=Tn(Ae),dp=Rn(Ae),mp=ki(Ae),fp=Ei(Ae),hp=Ii(Ae),gp=Ti(Ae),yp=Ri(Ae),vp=Pi(Ae),_p=Ni(Ae),bp=zi(Ae);var X=w("ZodType",(n,e)=>(K.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:Bn(n,"input"),output:Bn(n,"output")}}),n.toJSONSchema=xu(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(O.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)=>Ee(n,r,i),n.brand=()=>n,n.register=((r,i)=>(r.add(n,i),n)),n.parse=(r,i)=>lp(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>pp(n,r,i),n.parseAsync=async(r,i)=>up(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>dp(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>mp(n,r,i),n.decode=(r,i)=>fp(n,r,i),n.encodeAsync=async(r,i)=>hp(n,r,i),n.decodeAsync=async(r,i)=>gp(n,r,i),n.safeEncode=(r,i)=>yp(n,r,i),n.safeDecode=(r,i)=>vp(n,r,i),n.safeEncodeAsync=async(r,i)=>_p(n,r,i),n.safeDecodeAsync=async(r,i)=>bp(n,r,i),n.refine=(r,i)=>n.check(ud(r,i)),n.superRefine=r=>n.check(pd(r)),n.overwrite=r=>n.check(Qe(r)),n.optional=()=>Hr(n),n.exactOptional=()=>Gp(n),n.nullable=()=>Wr(n),n.nullish=()=>Hr(Wr(n)),n.nonoptional=r=>Xp(n,r),n.array=()=>Vr(n),n.or=r=>es([n,r]),n.and=r=>Op(n,r),n.transform=r=>Br(n,ns(r)),n.default=r=>qp(n,r),n.prefault=r=>Yp(n,r),n.catch=r=>td(n,r),n.pipe=r=>Br(n,r),n.readonly=()=>id(n),n.describe=r=>{let i=n.clone();return $e.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return $e.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return $e.get(n);let i=n.clone();return $e.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),Lo=w("_ZodString",(n,e)=>{Kt.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Su(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(zn(...i)),n.includes=(...i)=>n.check(Ln(...i)),n.startsWith=(...i)=>n.check(On(...i)),n.endsWith=(...i)=>n.check(Cn(...i)),n.min=(...i)=>n.check(gt(...i)),n.max=(...i)=>n.check(Xt(...i)),n.length=(...i)=>n.check(Qt(...i)),n.nonempty=(...i)=>n.check(gt(1,...i)),n.lowercase=i=>n.check(Dn(i)),n.uppercase=i=>n.check(An(i)),n.trim=()=>n.check(Un()),n.normalize=(...i)=>n.check(jn(...i)),n.toLowerCase=()=>n.check(Fn()),n.toUpperCase=()=>n.check(Zn()),n.slugify=()=>n.check(Hn())}),Vn=w("ZodString",(n,e)=>{Kt.init(n,e),Lo.init(n,e),n.email=r=>n.check(Yi(Oo,r)),n.url=r=>n.check(Ur(Gr,r)),n.jwt=r=>n.check(yo(Yo,r)),n.emoji=r=>n.check(no(Co,r)),n.guid=r=>n.check(jr(Zr,r)),n.uuid=r=>n.check(Xi(ct,r)),n.uuidv4=r=>n.check(Qi(ct,r)),n.uuidv6=r=>n.check(eo(ct,r)),n.uuidv7=r=>n.check(to(ct,r)),n.nanoid=r=>n.check(ro(Mo,r)),n.guid=r=>n.check(jr(Zr,r)),n.cuid=r=>n.check(io(jo,r)),n.cuid2=r=>n.check(oo(Uo,r)),n.ulid=r=>n.check(so(Fo,r)),n.base64=r=>n.check(fo(Vo,r)),n.base64url=r=>n.check(ho(qo,r)),n.xid=r=>n.check(ao(Zo,r)),n.ksuid=r=>n.check(co(Ho,r)),n.ipv4=r=>n.check(lo(Wo,r)),n.ipv6=r=>n.check(uo(Bo,r)),n.cidrv4=r=>n.check(po(Go,r)),n.cidrv6=r=>n.check(mo(Jo,r)),n.e164=r=>n.check(go(Ko,r)),n.datetime=r=>n.check(op(r)),n.date=r=>n.check(sp(r)),n.time=r=>n.check(ap(r)),n.duration=r=>n.check(cp(r))});function Do(n){return Ol(Vn,n)}var se=w("ZodStringFormat",(n,e)=>{oe.init(n,e),Lo.init(n,e)}),Oo=w("ZodEmail",(n,e)=>{Ic.init(n,e),se.init(n,e)});function Ih(n){return Yi(Oo,n)}var Zr=w("ZodGUID",(n,e)=>{kc.init(n,e),se.init(n,e)});function Th(n){return jr(Zr,n)}var ct=w("ZodUUID",(n,e)=>{Ec.init(n,e),se.init(n,e)});function Rh(n){return Xi(ct,n)}function Ph(n){return Qi(ct,n)}function Nh(n){return eo(ct,n)}function zh(n){return to(ct,n)}var Gr=w("ZodURL",(n,e)=>{Tc.init(n,e),se.init(n,e)});function Dh(n){return Ur(Gr,n)}function Ah(n){return Ur(Gr,{protocol:/^https?$/,hostname:He.domain,...O.normalizeParams(n)})}var Co=w("ZodEmoji",(n,e)=>{Rc.init(n,e),se.init(n,e)});function Lh(n){return no(Co,n)}var Mo=w("ZodNanoID",(n,e)=>{Pc.init(n,e),se.init(n,e)});function Oh(n){return ro(Mo,n)}var jo=w("ZodCUID",(n,e)=>{Nc.init(n,e),se.init(n,e)});function Ch(n){return io(jo,n)}var Uo=w("ZodCUID2",(n,e)=>{zc.init(n,e),se.init(n,e)});function Mh(n){return oo(Uo,n)}var Fo=w("ZodULID",(n,e)=>{Dc.init(n,e),se.init(n,e)});function jh(n){return so(Fo,n)}var Zo=w("ZodXID",(n,e)=>{Ac.init(n,e),se.init(n,e)});function Uh(n){return ao(Zo,n)}var Ho=w("ZodKSUID",(n,e)=>{Lc.init(n,e),se.init(n,e)});function Fh(n){return co(Ho,n)}var Wo=w("ZodIPv4",(n,e)=>{Uc.init(n,e),se.init(n,e)});function Zh(n){return lo(Wo,n)}var xp=w("ZodMAC",(n,e)=>{Zc.init(n,e),se.init(n,e)});function Hh(n){return Ml(xp,n)}var Bo=w("ZodIPv6",(n,e)=>{Fc.init(n,e),se.init(n,e)});function Wh(n){return uo(Bo,n)}var Go=w("ZodCIDRv4",(n,e)=>{Hc.init(n,e),se.init(n,e)});function Bh(n){return po(Go,n)}var Jo=w("ZodCIDRv6",(n,e)=>{Wc.init(n,e),se.init(n,e)});function Gh(n){return mo(Jo,n)}var Vo=w("ZodBase64",(n,e)=>{Gc.init(n,e),se.init(n,e)});function Jh(n){return fo(Vo,n)}var qo=w("ZodBase64URL",(n,e)=>{Jc.init(n,e),se.init(n,e)});function Vh(n){return ho(qo,n)}var Ko=w("ZodE164",(n,e)=>{Vc.init(n,e),se.init(n,e)});function qh(n){return go(Ko,n)}var Yo=w("ZodJWT",(n,e)=>{qc.init(n,e),se.init(n,e)});function Kh(n){return yo(Yo,n)}var qn=w("ZodCustomStringFormat",(n,e)=>{Kc.init(n,e),se.init(n,e)});function Yh(n,e,r={}){return Wn(qn,n,e,r)}function Xh(n){return Wn(qn,"hostname",He.hostname,n)}function Qh(n){return Wn(qn,"hex",He.hex,n)}function eg(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=He[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return Wn(qn,i,t,e)}var Kn=w("ZodNumber",(n,e)=>{Zi.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>$u(n,i,t,o),n.gt=(i,t)=>n.check(st(i,t)),n.gte=(i,t)=>n.check(Ie(i,t)),n.min=(i,t)=>n.check(Ie(i,t)),n.lt=(i,t)=>n.check(ot(i,t)),n.lte=(i,t)=>n.check(Me(i,t)),n.max=(i,t)=>n.check(Me(i,t)),n.int=i=>n.check(Ao(i)),n.safe=i=>n.check(Ao(i)),n.positive=i=>n.check(st(0,i)),n.nonnegative=i=>n.check(Ie(0,i)),n.negative=i=>n.check(ot(0,i)),n.nonpositive=i=>n.check(Me(0,i)),n.multipleOf=(i,t)=>n.check(Rt(i,t)),n.step=(i,t)=>n.check(Rt(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 Sp(n){return Wl(Kn,n)}var tn=w("ZodNumberFormat",(n,e)=>{Yc.init(n,e),Kn.init(n,e)});function Ao(n){return Gl(tn,n)}function tg(n){return Jl(tn,n)}function ng(n){return Vl(tn,n)}function rg(n){return ql(tn,n)}function ig(n){return Kl(tn,n)}var Yn=w("ZodBoolean",(n,e)=>{Ar.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wu(n,r,i,t)});function $p(n){return Yl(Yn,n)}var Xn=w("ZodBigInt",(n,e)=>{Hi.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ku(n,i,t,o),n.gte=(i,t)=>n.check(Ie(i,t)),n.min=(i,t)=>n.check(Ie(i,t)),n.gt=(i,t)=>n.check(st(i,t)),n.gte=(i,t)=>n.check(Ie(i,t)),n.min=(i,t)=>n.check(Ie(i,t)),n.lt=(i,t)=>n.check(ot(i,t)),n.lte=(i,t)=>n.check(Me(i,t)),n.max=(i,t)=>n.check(Me(i,t)),n.positive=i=>n.check(st(BigInt(0),i)),n.negative=i=>n.check(ot(BigInt(0),i)),n.nonpositive=i=>n.check(Me(BigInt(0),i)),n.nonnegative=i=>n.check(Ie(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(Rt(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function og(n){return Ql(Xn,n)}var Xo=w("ZodBigIntFormat",(n,e)=>{Xc.init(n,e),Xn.init(n,e)});function sg(n){return tu(Xo,n)}function ag(n){return nu(Xo,n)}var wp=w("ZodSymbol",(n,e)=>{Qc.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Eu(n,r,i,t)});function cg(n){return ru(wp,n)}var kp=w("ZodUndefined",(n,e)=>{el.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Tu(n,r,i,t)});function lg(n){return iu(kp,n)}var Ep=w("ZodNull",(n,e)=>{tl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Iu(n,r,i,t)});function Ip(n){return ou(Ep,n)}var Tp=w("ZodAny",(n,e)=>{nl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Nu(n,r,i,t)});function ug(){return su(Tp)}var Rp=w("ZodUnknown",(n,e)=>{rl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>zu(n,r,i,t)});function en(){return au(Rp)}var Pp=w("ZodNever",(n,e)=>{il.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Pu(n,r,i,t)});function Qo(n){return cu(Pp,n)}var Np=w("ZodVoid",(n,e)=>{ol.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ru(n,r,i,t)});function pg(n){return lu(Np,n)}var Jr=w("ZodDate",(n,e)=>{sl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Du(n,i,t,o),n.min=(i,t)=>n.check(Ie(i,t)),n.max=(i,t)=>n.check(Me(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 dg(n){return uu(Jr,n)}var zp=w("ZodArray",(n,e)=>{al.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Bu(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(gt(r,i)),n.nonempty=r=>n.check(gt(1,r)),n.max=(r,i)=>n.check(Xt(r,i)),n.length=(r,i)=>n.check(Qt(r,i)),n.unwrap=()=>n.element});function Vr(n,e){return mu(zp,n,e)}function mg(n){let e=n._zod.def.shape;return ts(Object.keys(e))}var qr=w("ZodObject",(n,e)=>{cl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Gu(n,r,i,t),O.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>ts(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:en()}),n.loose=()=>n.clone({...n._zod.def,catchall:en()}),n.strict=()=>n.clone({...n._zod.def,catchall:Qo()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>O.extend(n,r),n.safeExtend=r=>O.safeExtend(n,r),n.merge=r=>O.merge(n,r),n.pick=r=>O.pick(n,r),n.omit=r=>O.omit(n,r),n.partial=(...r)=>O.partial(rs,n,r[0]),n.required=(...r)=>O.required(is,n,r[0])});function fg(n,e){let r={type:"object",shape:n??{},...O.normalizeParams(e)};return new qr(r)}function hg(n,e){return new qr({type:"object",shape:n,catchall:Qo(),...O.normalizeParams(e)})}function gg(n,e){return new qr({type:"object",shape:n,catchall:en(),...O.normalizeParams(e)})}var Kr=w("ZodUnion",(n,e)=>{Lr.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wo(n,r,i,t),n.options=e.options});function es(n,e){return new Kr({type:"union",options:n,...O.normalizeParams(e)})}var Dp=w("ZodXor",(n,e)=>{Kr.init(n,e),ll.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wo(n,r,i,t),n.options=e.options});function yg(n,e){return new Dp({type:"union",options:n,inclusive:!1,...O.normalizeParams(e)})}var Ap=w("ZodDiscriminatedUnion",(n,e)=>{Kr.init(n,e),ul.init(n,e)});function vg(n,e,r){return new Ap({type:"union",options:e,discriminator:n,...O.normalizeParams(r)})}var Lp=w("ZodIntersection",(n,e)=>{pl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ju(n,r,i,t)});function Op(n,e){return new Lp({type:"intersection",left:n,right:e})}var Cp=w("ZodTuple",(n,e)=>{Wi.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Vu(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function Mp(n,e,r){let i=e instanceof K,t=i?r:e,o=i?e:null;return new Cp({type:"tuple",items:n,rest:o,...O.normalizeParams(t)})}var Yr=w("ZodRecord",(n,e)=>{dl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>qu(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function jp(n,e,r){return new Yr({type:"record",keyType:n,valueType:e,...O.normalizeParams(r)})}function _g(n,e,r){let i=Ee(n);return i._zod.values=void 0,new Yr({type:"record",keyType:i,valueType:e,...O.normalizeParams(r)})}function bg(n,e,r){return new Yr({type:"record",keyType:n,valueType:e,mode:"loose",...O.normalizeParams(r)})}var Up=w("ZodMap",(n,e)=>{ml.init(n,e),X.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(at(...r)),n.nonempty=r=>n.check(at(1,r)),n.max=(...r)=>n.check(Pt(...r)),n.size=(...r)=>n.check(Yt(...r))});function xg(n,e,r){return new Up({type:"map",keyType:n,valueType:e,...O.normalizeParams(r)})}var Fp=w("ZodSet",(n,e)=>{fl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Wu(n,r,i,t),n.min=(...r)=>n.check(at(...r)),n.nonempty=r=>n.check(at(1,r)),n.max=(...r)=>n.check(Pt(...r)),n.size=(...r)=>n.check(Yt(...r))});function Sg(n,e){return new Fp({type:"set",valueType:n,...O.normalizeParams(e)})}var Jn=w("ZodEnum",(n,e)=>{hl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Au(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 Jn({...e,checks:[],...O.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 Jn({...e,checks:[],...O.normalizeParams(t),entries:o})}});function ts(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new Jn({type:"enum",entries:r,...O.normalizeParams(e)})}function $g(n,e){return new Jn({type:"enum",entries:n,...O.normalizeParams(e)})}var Zp=w("ZodLiteral",(n,e)=>{gl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Lu(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 wg(n,e){return new Zp({type:"literal",values:Array.isArray(n)?n:[n],...O.normalizeParams(e)})}var Hp=w("ZodFile",(n,e)=>{yl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Mu(n,r,i,t),n.min=(r,i)=>n.check(at(r,i)),n.max=(r,i)=>n.check(Pt(r,i)),n.mime=(r,i)=>n.check(Mn(Array.isArray(r)?r:[r],i))});function kg(n){return fu(Hp,n)}var Wp=w("ZodTransform",(n,e)=>{vl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Zu(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new wt(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(O.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(O.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 ns(n){return new Wp({type:"transform",transform:n})}var rs=w("ZodOptional",(n,e)=>{Bi.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ko(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Hr(n){return new rs({type:"optional",innerType:n})}var Bp=w("ZodExactOptional",(n,e)=>{_l.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ko(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Gp(n){return new Bp({type:"optional",innerType:n})}var Jp=w("ZodNullable",(n,e)=>{bl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ku(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Wr(n){return new Jp({type:"nullable",innerType:n})}function Eg(n){return Hr(Wr(n))}var Vp=w("ZodDefault",(n,e)=>{xl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Xu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function qp(n,e){return new Vp({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():O.shallowClone(e)}})}var Kp=w("ZodPrefault",(n,e)=>{Sl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Qu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Yp(n,e){return new Kp({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():O.shallowClone(e)}})}var is=w("ZodNonOptional",(n,e)=>{$l.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Yu(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Xp(n,e){return new is({type:"nonoptional",innerType:n,...O.normalizeParams(e)})}var Qp=w("ZodSuccess",(n,e)=>{wl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ju(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Ig(n){return new Qp({type:"success",innerType:n})}var ed=w("ZodCatch",(n,e)=>{kl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ep(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function td(n,e){return new ed({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var nd=w("ZodNaN",(n,e)=>{El.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ou(n,r,i,t)});function Tg(n){return du(nd,n)}var os=w("ZodPipe",(n,e)=>{Il.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>tp(n,r,i,t),n.in=e.in,n.out=e.out});function Br(n,e){return new os({type:"pipe",in:n,out:e})}var ss=w("ZodCodec",(n,e)=>{os.init(n,e),Or.init(n,e)});function Rg(n,e,r){return new ss({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var rd=w("ZodReadonly",(n,e)=>{Tl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>np(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function id(n){return new rd({type:"readonly",innerType:n})}var od=w("ZodTemplateLiteral",(n,e)=>{Rl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Cu(n,r,i,t)});function Pg(n,e){return new od({type:"template_literal",parts:n,...O.normalizeParams(e)})}var sd=w("ZodLazy",(n,e)=>{zl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ip(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function ad(n){return new sd({type:"lazy",getter:n})}var cd=w("ZodPromise",(n,e)=>{Nl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>rp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Ng(n){return new cd({type:"promise",innerType:n})}var ld=w("ZodFunction",(n,e)=>{Pl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Fu(n,r,i,t)});function zg(n){return new ld({type:"function",input:Array.isArray(n?.input)?Mp(n?.input):n?.input??Vr(en()),output:n?.output??en()})}var Xr=w("ZodCustom",(n,e)=>{Dl.init(n,e),X.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Uu(n,r,i,t)});function Dg(n){let e=new ce({check:"custom"});return e._zod.check=n,e}function Ag(n,e){return hu(Xr,n??(()=>!0),e)}function ud(n,e={}){return gu(Xr,n,e)}function pd(n){return yu(n)}var Lg=vu,Og=_u;function Cg(n,e={}){let r=new Xr({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...O.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 Mg=(...n)=>bu({Codec:ss,Boolean:Yn,String:Vn},...n);function jg(n){let e=ad(()=>es([Do(n),Sp(),$p(),Ip(),Vr(e),jp(Do(),e)]));return e}function Ug(n,e){return Br(ns(n),e)}var LS={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 OS(n){fe({customError:n})}function CS(){return fe().customError}var dd;dd||(dd={});var F={...Fr,...To,iso:Gn},MS=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 jS(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 US(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 Fg(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=US(t,e),s=we(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 Fg(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=we(l,e);t[c]=s.has(c)?u:u.optional()}if(n.propertyNames){let c=we(n.propertyNames,e),l=n.additionalProperties&&typeof n.additionalProperties=="object"?we(n.additionalProperties,e):F.any();if(Object.keys(t).length===0){i=F.record(c,l);break}let u=F.object(t).passthrough(),d=F.looseRecord(c,l);i=F.intersection(u,d);break}if(n.patternProperties){let c=n.patternProperties,l=Object.keys(c),u=[];for(let p of l){let f=we(c[p],e),m=F.string().regex(new RegExp(p));u.push(F.looseRecord(m,f))}let d=[];if(Object.keys(t).length>0&&d.push(F.object(t).passthrough()),d.push(...u),d.length===0)i=F.object({}).passthrough();else if(d.length===1)i=d[0];else{let p=F.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)p=F.intersection(p,d[f]);i=p}break}let a=F.object(t);n.additionalProperties===!1?i=a.strict():typeof n.additionalProperties=="object"?i=a.catchall(we(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=>we(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?we(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=>we(c,e)),a=n.additionalItems&&typeof n.additionalItems=="object"?we(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=we(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 we(n,e){if(typeof n=="boolean")return n?F.any():F.never();let r=Fg(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=>we(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=>we(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:we(n.allOf[0],e),c=i?0:1;for(let l=c;l<n.allOf.length;l++)a=F.intersection(a,we(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))MS.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function Zg(n,e){if(typeof n=="boolean")return n?F.any():F.never();let r=jS(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??$e};return we(n,t)}var md={};Fe(md,{bigint:()=>WS,boolean:()=>HS,date:()=>BS,number:()=>ZS,string:()=>FS});function FS(n){return Cl(Vn,n)}function ZS(n){return Bl(Kn,n)}function HS(n){return Xl(Yn,n)}function WS(n){return eu(Xn,n)}function BS(n){return pu(Jr,n)}fe(Gi());var as=["**/node_modules/**","**/.git/**","**/dist/**","**/build/**","**/vendor/**","**/.next/**","**/.cache/**","**/coverage/**","**/*.min.js"],Hg=["**/*.{ts,tsx,yaml,yml,php,py,go}","**/*.prisma","**/*.{graphql,gql}","**/Dockerfile*","**/.env*","**/package.json","**/lerna.json","**/turbo.json","**/pnpm-workspace.yaml"],ue={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},fd={SECONDS_PER_DAY:86400,SECONDS_PER_YEAR:31536e3},cs={DEFAULT_CONCURRENCY:parseInt(process.env.INDEX_CONCURRENCY??String(5),10)};var WT=y.object({repoPath:y.string(),mode:y.enum(["init","tree","topography","scout","hologram","tools"]),subPath:y.string().optional(),maxDepth:y.number().int().min(ue.MIN_DEPTH).max(ue.MAX_DEPTH).optional()}),BT=y.object({repoPath:y.string(),mode:y.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:y.string().max(ue.MAX_QUERY_LENGTH).optional(),key:y.string().optional(),kind:y.enum(["Service","Image","Port","Env"]).optional(),limit:y.number().int().min(ue.MIN_LIMIT).max(ue.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"]}),GT=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()}),JT=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(ue.MIN_DEPTH).max(ue.MAX_DEPTH).optional(),limit:y.number().int().min(ue.MIN_LIMIT).max(ue.MAX_LIMIT).optional(),includeTests:y.boolean().optional()}),VT=y.object({repoPath:y.string(),action:y.enum(["index","repair","trace"]),deep:y.boolean().optional(),sinceCommit:y.string().optional()}),qT=y.object({repoPath:y.string(),action:y.enum(["install","remove","status"]),enableAutoRefresh:y.boolean().optional(),enableSymbolHealing:y.boolean().optional()}),KT=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 Wg=[];var hd=[...Ym,...Xm];import je from"path";import xd from"fs";V();import ye from"path";import gd from"fs";var ls=$.child({module:"path-resolver"}),Qn=class{repoPath;constructor(e){this.repoPath=ye.isAbsolute(e)?ye.normalize(e):ye.resolve(process.cwd(),e)}resolve(e){if(!e)return this.repoPath;if(e.includes("\0"))throw ls.error({inputPath:e},"Path contains null bytes - possible attack"),new Error("Invalid path: contains null bytes");let r;if(ye.isAbsolute(e)?r=ye.normalize(e):r=ye.join(this.repoPath,e),r=ye.normalize(r),!this.isWithinRoot(r))throw ls.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 gd.existsSync(r)?r:(ls.debug({inputPath:e,resolved:r},"Path does not exist"),null)}catch(r){return ls.error({inputPath:e,error:r},"Error validating path"),null}}isWithinRoot(e){try{let r=ye.resolve(e),i=ye.resolve(this.repoPath),t=ye.relative(i,r);if(t.startsWith("..")||ye.isAbsolute(t))return!1;if(gd.existsSync(r)){let s=gd.realpathSync(r),a=ye.relative(i,s);if(a.startsWith("..")||ye.isAbsolute(a))return!1}return!0}catch{return!1}}getRelative(e){let r=ye.normalize(e);return ye.relative(this.repoPath,r)}resolveBatch(e){return e.map(r=>this.resolve(r))}static normalize(e){return ye.normalize(e)}static isPathWithinRoot(e,r){let i=ye.resolve(e),t=ye.resolve(r),o=ye.relative(i,t);return o===""||!o.startsWith("..")&&!ye.isAbsolute(o)}};function Bg(n){return new Qn(n)}var qS=/[\x00-\x1f\x7f]/g,KS=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function nn(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(qS,"").length!==n.length)throw new Error("Invalid path: control characters are not allowed");return n.trim()}function rn(n,e=4096){if(typeof n!="string")return"";let r=n.replace(KS,"").trim();return r.length>e?r.slice(0,e):r}Ot();var Qr=`
501
517
 
502
- To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function Ot(n,e,r){return{content:[{type:"text",text:`[${n}] ${e}`}],isError:!0,errorCode:n,errorDetails:r}}function CS(n){let e=Le.isAbsolute(n)?Le.normalize(n):Le.resolve(process.cwd(),n),r=Le.parse(e).root;for(;e!==r;){if(fd.existsSync(Le.join(e,".liquid-shadow.db"))||fd.existsSync(Le.join(e,".git"))||fd.existsSync(Le.join(e,"package.json")))return e;let i=Le.dirname(e);if(i===e)break;e=i}return null}function Ue(n){let e=n?.repoPath?String(n.repoPath):void 0,r=n?.filePath?String(n.filePath):void 0;e&&(e=en(e)),r&&(r=en(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=CS(Le.dirname(s))||process.cwd()}else i=process.cwd();i=Le.normalize(i);let t=Ag(i),o;return r&&(o=t.resolve(r)),{...n,repoPath:i,filePath:o,resolver:t}}function Fg(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 Zg(n,e){if(!qe(n)){let r=`Repository not indexed yet. Run initial indexing first:
518
+ To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function Ct(n,e,r){return{content:[{type:"text",text:`[${n}] ${e}`}],isError:!0,errorCode:n,errorDetails:r}}function l$(n){let e=je.isAbsolute(n)?je.normalize(n):je.resolve(process.cwd(),n),r=je.parse(e).root;for(;e!==r;){if(xd.existsSync(je.join(e,".liquid-shadow.db"))||xd.existsSync(je.join(e,".git"))||xd.existsSync(je.join(e,"package.json")))return e;let i=je.dirname(e);if(i===e)break;e=i}return null}function We(n){let e=n?.repoPath?String(n.repoPath):void 0,r=n?.filePath?String(n.filePath):void 0;e&&(e=nn(e)),r&&(r=nn(r));let i;if(e)je.isAbsolute(e)||(e=je.resolve(process.cwd(),e)),i=e;else if(r){let s=je.resolve(process.cwd(),r);i=l$(je.dirname(s))||process.cwd()}else i=process.cwd();i=je.normalize(i);let t=Bg(i),o;return r&&(o=t.resolve(r)),{...n,repoPath:i,filePath:o,resolver:t}}function Xg(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 Qg(n,e){if(!et(n)){let r=`Repository not indexed yet. Run initial indexing first:
503
519
 
504
520
  1. shadow_recon_onboard({ repoPath: "${n}" }) // one-time
505
521
  2. shadow_sync_trace({ repoPath: "${n}" }) // then sync
506
522
 
507
- After that, ${e} and other tools will work.`+Gr;return Ot("FILE_NOT_FOUND",r,{repoPath:n,toolName:e,requiresIndexing:!0})}return null}async function Hg(n){return{resources:Dg}}async function Wg(n){let e=n.params.uri;throw Fg(e)?new Error(`Resource not found: ${e}`):new Error(`Invalid resource URI: ${e}`)}B();import{execSync as rn}from"child_process";import Vr from"path";import hd from"fs";function ve(n){try{if(!hd.existsSync(Vr.join(n,".git")))return null;let e=rn("git rev-parse --abbrev-ref HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return e==="HEAD"?rn("git rev-parse --short HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():e.replace(/[\/\\:*"<>|?]/g,"-")}catch{return null}}function Fe(n){try{return hd.existsSync(Vr.join(n,".git"))?rn("git rev-parse HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():null}catch{return null}}function gd(n,e=50){try{let r=rn(`git rev-list --max-count=${e} HEAD`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return r?r.split(`
508
- `):[]}catch{return[]}}function yd(n,e,r){try{return rn(`git merge-tree --write-tree ${e} ${r}`,{cwd:n,stdio:["ignore","ignore","ignore"]}),!1}catch{return!0}}var Jg=new Set([".ts",".tsx",".yaml",".yml",".php",".py",".go",".prisma",".graphql",".gql"]),Gg=new Set(["package.json","lerna.json","turbo.json","pnpm-workspace.yaml"]),Vg=new Set(["node_modules",".git","dist","build","vendor",".next",".cache","coverage"]);function Bg(n){let e=n.split("/");for(let t of e)if(Vg.has(t))return!1;if(n.endsWith(".min.js"))return!1;let r=Vr.basename(n);if(r.startsWith("Dockerfile")||r.startsWith(".env")||Gg.has(r))return!0;let i=Vr.extname(r).toLowerCase();return Jg.has(i)}function jS(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 vd(n,e){try{if(!hd.existsSync(Vr.join(n,".git")))return!0;let r=Fe(n);if(!r)return!0;if(e&&e!==r){let t=rn(`git diff --name-only ${e} ${r}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(t&&t.split(`
509
- `).some(o=>o&&Bg(o)))return!0}let i=rn("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return i?i.split(`
510
- `).some(t=>t?Bg(jS(t)):!1):!1}catch{return!0}}B();var MS=b.child({module:"strategy-normalizer"}),yt=class{static normalize(e){if(!e)return{steps:[]};let r;if(typeof e=="string")try{r=JSON.parse(e)}catch(t){return MS.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}}}};B();import _d from"fs";import qg from"path";import US from"os";var FS=[{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"}],ZS=[{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"}],HS=[{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"}],Kg=[{id:"refactoring",name:"Refactoring",description:"Impact analysis \u2192 implementation \u2192 verification",defaultGoal:"Refactor {{target}} safely with full impact analysis and verification.",steps:FS},{id:"feature",name:"Feature",description:"Requirements \u2192 implementation \u2192 testing",defaultGoal:"Implement {{target}} with clear requirements and end-to-end verification.",steps:ZS},{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:HS}],bd=new Map(Kg.map(n=>[n.id,n])),ls=!1;function WS(){if(ls)return;let n=qg.join(US.homedir(),".shadow","templates");if(!_d.existsSync(n)){b.debug({templatesDir:n},"Custom templates directory does not exist"),ls=!0;return}try{let e=_d.readdirSync(n).filter(r=>r.endsWith(".json"));for(let r of e)try{let i=qg.join(n,r),t=_d.readFileSync(i,"utf8"),o=JSON.parse(t);if(!o.id||!o.name||!o.defaultGoal||!o.steps){b.warn({file:r,template:o},"Invalid custom template structure - skipping");continue}if(!Array.isArray(o.steps)||o.steps.length===0){b.warn({file:r},"Template has no steps - skipping");continue}if(Kg.some(s=>s.id===o.id)){b.warn({file:r,templateId:o.id},"Custom template ID conflicts with built-in - skipping");continue}bd.set(o.id,o),b.info({file:r,templateId:o.id},"Loaded custom template")}catch(i){b.warn({file:r,error:i},"Failed to load custom template")}ls=!0}catch(e){b.warn({error:e,templatesDir:n},"Failed to read custom templates directory"),ls=!0}}function Yg(n){return WS(),bd.get(n)}function BS(n,e){let r=n;for(let[i,t]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),t);return r}function xd(n,e,r={}){let i=Yg(n);if(!i)throw new Error(`Unknown template: ${n}. Use one of: ${Array.from(bd.keys()).join(", ")}`);let t=r.target||"scope",o=e||(n==="refactoring"?`Refactor ${t}`:n==="feature"?`Feature: ${t}`:`Fix: ${t}`),s=BS(i.defaultGoal,{...r,target:t}),a=yt.normalize({steps:i.steps}),c=yt.stringify(a);return{name:o,goal:s,strategy:c}}Q();Q();import{execSync as Yn}from"child_process";var Qr=class{constructor(e,r="refs/notes/shadow"){this.repoPath=e;this.ref=r}addNote(e,r){try{Yn(`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 Yn(`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=Yn(`git notes --ref ${this.ref} list`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(!r)return e;let i=r.split(`
511
- `);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{Yn(`git notes --ref ${this.ref} remove ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}push(e="origin"){try{Yn(`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{Yn(`git fetch ${e} ${this.ref}:${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}};B();var Xn=b.child({module:"persistence-service"}),Ze=class{gitNotes;repoPath;constructor(e){this.repoPath=e,this.gitNotes=new Qr(e)}async syncMissionToGitNotes(e){let{missions:r,intentLogs:i}=C.getInstance(this.repoPath),t=r.findById(e);if(!t)throw new Error(`Mission ${e} not found`);if(!t.commit_sha){Xn.warn({missionId:e},"Cannot sync mission without commit_sha");return}Xn.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}=C.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){Xn.error({missionId:o.id,error:s},"Failed to sync mission")}}async recoverFromGitNotes(){let e=this.gitNotes.listNotes(),{missions:r,intentLogs:i}=C.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)){Xn.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++;Xn.info({commitSha:s,missionName:c.mission.name,logsRecovered:o},"Re-hydrated mission from Git Notes")}catch(c){Xn.error({commitSha:s,error:c},"Failed to parse Git Note for recovery")}return{missionsRecovered:t,logsRecovered:o}}};var Ss=b.child({module:"mcp:tools:ops:plan"});async function _y(n){let{repoPath:e,name:r,goal:i,strategy:t,missionId:o,parentId:s,outcomeContract:a,templateId:c,templateVars:l}=n,{missions:u}=C.getInstance(e),p=ve(e),d=Fe(e);Ss.info({repoPath:e,name:r,missionId:o,templateId:c},"Planning mission");try{let m=r,f=i,h=t;if(c){let w=xd(c,r,l||{});m=m??w.name,f=f??w.goal,h=h??w.strategy}if(!m||!f)throw new Error("Mission requires name and goal (or templateId with optional templateVars).");let _=null;if(h){let w=yt.normalize(h);_=yt.stringify(w);let S=yt.validate(_);S.valid||Ss.warn({errors:S.errors,strategy:h},"Strategy validation warnings detected")}let v,y;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,y=`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}),y=`Mission "${m}" planned.`);try{await new Ze(e).syncMissionToGitNotes(Number(v))}catch(w){Ss.warn({syncError:w,missionId:v},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:v,status:"planned",message:y,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)}`)}}B();Q();Q();B();B();var i$=b.child({module:"reasoning-engine"}),cn=class{analyze(e){i$.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=b.child({module:"briefing-engine"}),st=class{intentLogs;missions;reasoningEngine;persistencePivot;constructor(e){let{intentLogs:r,missions:i}=C.getInstance(e);this.intentLogs=r,this.missions=i,this.reasoningEngine=new cn,this.persistencePivot=new Ze(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}
523
+ After that, ${e} and other tools will work.`+Qr;return Ct("FILE_NOT_FOUND",r,{repoPath:n,toolName:e,requiresIndexing:!0})}return null}async function ey(n){return{resources:Wg}}async function ty(n){let e=n.params.uri;throw Xg(e)?new Error(`Resource not found: ${e}`):new Error(`Invalid resource URI: ${e}`)}V();import{execSync as an}from"child_process";import ei from"path";import Sd from"fs";function be(n){try{if(!Sd.existsSync(ei.join(n,".git")))return null;let e=an("git rev-parse --abbrev-ref HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return e==="HEAD"?an("git rev-parse --short HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():e.replace(/[\/\\:*"<>|?]/g,"-")}catch{return null}}function Be(n){try{return Sd.existsSync(ei.join(n,".git"))?an("git rev-parse HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():null}catch{return null}}function $d(n,e=50){try{let r=an(`git rev-list --max-count=${e} HEAD`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return r?r.split(`
524
+ `):[]}catch{return[]}}function wd(n,e,r){try{return an(`git merge-tree --write-tree ${e} ${r}`,{cwd:n,stdio:["ignore","ignore","ignore"]}),!1}catch{return!0}}var ry=new Set([".ts",".tsx",".yaml",".yml",".php",".py",".go",".prisma",".graphql",".gql"]),iy=new Set(["package.json","lerna.json","turbo.json","pnpm-workspace.yaml"]),oy=new Set(["node_modules",".git","dist","build","vendor",".next",".cache","coverage"]);function ny(n){let e=n.split("/");for(let t of e)if(oy.has(t))return!1;if(n.endsWith(".min.js"))return!1;let r=ei.basename(n);if(r.startsWith("Dockerfile")||r.startsWith(".env")||iy.has(r))return!0;let i=ei.extname(r).toLowerCase();return ry.has(i)}function u$(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 kd(n,e){try{if(!Sd.existsSync(ei.join(n,".git")))return!0;let r=Be(n);if(!r)return!0;if(e&&e!==r){let t=an(`git diff --name-only ${e} ${r}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(t&&t.split(`
525
+ `).some(o=>o&&ny(o)))return!0}let i=an("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return i?i.split(`
526
+ `).some(t=>t?ny(u$(t)):!1):!1}catch{return!0}}V();var p$=$.child({module:"strategy-normalizer"}),_t=class{static normalize(e){if(!e)return{steps:[]};let r;if(typeof e=="string")try{r=JSON.parse(e)}catch(t){return p$.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}}}};V();import Ed from"fs";import sy from"path";import d$ from"os";var m$=[{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"}],f$=[{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"}],h$=[{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"}],ay=[{id:"refactoring",name:"Refactoring",description:"Impact analysis \u2192 implementation \u2192 verification",defaultGoal:"Refactor {{target}} safely with full impact analysis and verification.",steps:m$},{id:"feature",name:"Feature",description:"Requirements \u2192 implementation \u2192 testing",defaultGoal:"Implement {{target}} with clear requirements and end-to-end verification.",steps:f$},{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:h$}],Id=new Map(ay.map(n=>[n.id,n])),hs=!1;function g$(){if(hs)return;let n=sy.join(d$.homedir(),".shadow","templates");if(!Ed.existsSync(n)){$.debug({templatesDir:n},"Custom templates directory does not exist"),hs=!0;return}try{let e=Ed.readdirSync(n).filter(r=>r.endsWith(".json"));for(let r of e)try{let i=sy.join(n,r),t=Ed.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(ay.some(s=>s.id===o.id)){$.warn({file:r,templateId:o.id},"Custom template ID conflicts with built-in - skipping");continue}Id.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")}hs=!0}catch(e){$.warn({error:e,templatesDir:n},"Failed to read custom templates directory"),hs=!0}}function cy(n){return g$(),Id.get(n)}function y$(n,e){let r=n;for(let[i,t]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),t);return r}function Td(n,e,r={}){let i=cy(n);if(!i)throw new Error(`Unknown template: ${n}. Use one of: ${Array.from(Id.keys()).join(", ")}`);let t=r.target||"scope",o=e||(n==="refactoring"?`Refactor ${t}`:n==="feature"?`Feature: ${t}`:`Fix: ${t}`),s=y$(i.defaultGoal,{...r,target:t}),a=_t.normalize({steps:i.steps}),c=_t.stringify(a);return{name:o,goal:s,strategy:c}}ee();ee();import{execSync as nr}from"child_process";var si=class{constructor(e,r="refs/notes/shadow"){this.repoPath=e;this.ref=r}addNote(e,r){try{nr(`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 nr(`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=nr(`git notes --ref ${this.ref} list`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(!r)return e;let i=r.split(`
527
+ `);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{nr(`git notes --ref ${this.ref} remove ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}push(e="origin"){try{nr(`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{nr(`git fetch ${e} ${this.ref}:${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}};V();var rr=$.child({module:"persistence-service"}),Ge=class{gitNotes;repoPath;constructor(e){this.repoPath=e,this.gitNotes=new si(e)}async syncMissionToGitNotes(e){let{missions:r,intentLogs:i}=M.getInstance(this.repoPath),t=r.findById(e);if(!t)throw new Error(`Mission ${e} not found`);if(!t.commit_sha){rr.warn({missionId:e},"Cannot sync mission without commit_sha");return}rr.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}=M.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){rr.error({missionId:o.id,error:s},"Failed to sync mission")}}async recoverFromGitNotes(){let e=this.gitNotes.listNotes(),{missions:r,intentLogs:i}=M.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(p=>p.name===c.mission.name)){rr.debug({commitSha:s,missionName:c.mission.name},"Mission already exists, skipping recovery");continue}let d=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(d),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 p of c.decisions)i.create({mission_id:Number(d),symbol_id:null,file_path:null,type:"decision",content:p.content,confidence:1,symbol_name:p.symbol_name,signature:null,commit_sha:s}),o++;rr.info({commitSha:s,missionName:c.mission.name,logsRecovered:o},"Re-hydrated mission from Git Notes")}catch(c){rr.error({commitSha:s,error:c},"Failed to parse Git Note for recovery")}return{missionsRecovered:t,logsRecovered:o}}};var Rs=$.child({module:"mcp:tools:ops:plan"});async function Ny(n){let{repoPath:e,name:r,goal:i,strategy:t,missionId:o,parentId:s,outcomeContract:a,templateId:c,templateVars:l}=n,{missions:u}=M.getInstance(e),d=be(e),p=Be(e);Rs.info({repoPath:e,name:r,missionId:o,templateId:c},"Planning mission");try{let f=r,m=i,h=t;if(c){let b=Td(c,r,l||{});f=f??b.name,m=m??b.goal,h=h??b.strategy}if(!f||!m)throw new Error("Mission requires name and goal (or templateId with optional templateVars).");let _=null;if(h){let b=_t.normalize(h);_=_t.stringify(b);let x=_t.validate(_);x.valid||Rs.warn({errors:x.errors,strategy:h},"Strategy validation warnings detected")}let v,g;o?(u.update(o,{name:f,goal:m,strategy_graph:_,commit_sha:p,parent_id:s!==void 0?s:void 0,outcome_contract:a}),v=o,g=`Mission "${f}" updated.`):(v=u.create({name:f,goal:m,strategy_graph:_,status:"planned",git_branch:d,commit_sha:p,parent_id:s||null,verification_context:null,outcome_contract:a||null}),g=`Mission "${f}" planned.`);try{await new Ge(e).syncMissionToGitNotes(Number(v))}catch(b){Rs.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:p},null,2)}]}}catch(f){throw Rs.error({error:f,repoPath:e},"Failed to plan mission"),new Error(`Failed to plan mission: ${f instanceof Error?f.message:String(f)}`)}}V();ee();ee();V();V();var N$=$.child({module:"reasoning-engine"}),pn=class{analyze(e){N$.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 Ps=$.child({module:"briefing-engine"}),ut=class{intentLogs;missions;reasoningEngine;persistencePivot;constructor(e){let{intentLogs:r,missions:i}=M.getInstance(e);this.intentLogs=r,this.missions=i,this.reasoningEngine=new pn,this.persistencePivot=new Ge(e)}async distillMission(e,r=!0){Ps.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}
512
528
 
513
529
  `;if(s+=`## Summary of Intent
514
530
  `,s+=`Collected ${i.length} intent events across ${o.size} symbols.
@@ -530,9 +546,9 @@ After that, ${e} and other tools will work.`+Gr;return Ot("FILE_NOT_FOUND",r,{re
530
546
  `}),s+=`
531
547
  `),s+=`
532
548
  ---
533
- *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")}};B();import{Visitor as o$}from"@swc/core/Visitor.js";import*as by from"@swc/core";var s$=b.child({module:"verification-engine"}),Ed=class extends o${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)}},ws=class{async verify(e,r){try{let i=await by.parse(e,{syntax:"typescript",tsx:!0,comments:!1}),t=new Ed(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 s$.error({error:i},"Verification failed due to parse error"),{passed:!1,errors:[`Parse error: ${i.message}`]}}}};import xy from"path";import ks from"fs";var He=b.child({module:"mcp:tools:ops:track"});async function Sy(n,e,r){let{missions:i,intentLogs:t}=C.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")){He.info({parentId:c.id,childCount:s.length},"All children completed \u2014 cascading parent completion"),i.updateStatus(c.id,"completed",r||void 0),i.clearWorkingSet(c.id),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 st(n).distillMission(c.id),He.info({parentId:c.id},"Parent Auto-Synthesis completed")}catch(l){He.warn({synthesisError:l,parentId:c.id},"Parent Auto-Synthesis deferred")}try{await new Ze(n).syncMissionToGitNotes(c.id)}catch(l){He.warn({syncError:l,parentId:c.id},"Parent Git Notes sync deferred")}await Sy(n,c.id,r)}}async function $y(n){let{repoPath:e,missionId:r,stepId:i,status:t,contextPivot:o,updates:s,artifacts:a}=n,{missions:c,intentLogs:l}=C.getInstance(e),u=Fe(e);He.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),t==="completed"&&c.clearWorkingSet(r),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 st(e).distillMission(r),He.info({missionId:r},"Auto-Synthesis completed successfully")}catch(m){He.warn({synthesisError:m,missionId:r},"Auto-Synthesis deferred or failed")}await Sy(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 y=JSON.parse(v.strategy_graph||"{}"),w=null;if(Array.isArray(y)?w=y.find(S=>S.id===f):y.nodes&&Array.isArray(y.nodes)?w=y.nodes.find(S=>S.id===f):y.steps?Array.isArray(y.steps)?w=y.steps.find(S=>S.id===f):w=y.steps[f]:y[f]&&(w=y[f]),!w)throw new Error(`Step ID "${f}" not found`);if(h==="completed"&&w.verification){let S=new ws,$=Array.isArray(w.verification)?w.verification:[w.verification];for(let E of $){let T=E;if(typeof E=="string"&&(T={type:"pattern",target:E}),!T||!T.target){He.warn({rule:E},"Skipping invalid verification rule (missing target)");continue}let R=T.filePath;if(R&&!xy.isAbsolute(R)&&(R=xy.join(e,R)),R){if(!ks.existsSync(R))throw new Error(`Verification failed: File not found at ${R}`);let U=await S.verify(ks.readFileSync(R,"utf8"),T);if(!U.passed)throw new Error(`Verification failed: ${U.errors.join("")}`)}else{let U=c.getWorkingSet(r),I=!1;U.length===0&&He.warn("No working set files to verify against for rule");for(let A of U){if(!ks.existsSync(A.file_path))continue;if((await S.verify(ks.readFileSync(A.file_path,"utf8"),T)).passed){I=!0;break}}if(!I)throw new Error(`Verification failed: Rule "${T.target}" not satisfied in any working set file.`)}}}if(w.status=h,c.update(r,{strategy_graph:JSON.stringify(y),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 $ of S.files)c.addToWorkingSet(r,$)}catch(S){He.warn({error:S},"Failed to apply context pivot")}d.push({stepId:f,status:h})}try{await new Ze(e).syncMissionToGitNotes(r)}catch(m){He.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 He.error({error:p,repoPath:e},"Failed to update status"),new Error(`Failed to update status: ${p instanceof Error?p.message:String(p)}`)}}B();Q();var Es=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}}};Q();Oe();B();import{execSync as Jy}from"child_process";import u$ from"path";var Ls=b.child({module:"shadow-trace"}),bt=class{intentLogs;exports;repoPath;hologramService;constructor(e){let{intentLogs:r,exports:i}=C.getInstance(e);this.intentLogs=r,this.exports=i,this.repoPath=e,this.hologramService=new ce(e)}analyzeGhostChanges(e){let r=e?`${e}..HEAD`:"HEAD~1..HEAD",i=[];try{let o=Jy(`git diff --name-only ${r}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
534
- `).filter(s=>s.trim()!=="");if(o.length===0)return;Ls.info({files:o.length,range:r},"Initiating Shadow Trace analysis...");for(let s of o){let a=u$.join(this.repoPath,s),l=Jy(`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}),Ls.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),Ls.info("Shadow Trace complete.")}catch(t){Ls.warn({err:t.message},"Shadow Trace failed: git diff error.")}}};Q();B();import{execSync as Gy}from"child_process";var ln=b.child({module:"nano-repair"}),ke=class{intentLogs;exports;missions;repoPath;constructor(e){let{intentLogs:r,exports:i,missions:t}=C.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};ln.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}),ln.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}),ln.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&&ln.info({repaired:r,failed:i},"Nano-Repair recovery complete"),{repaired:r,failed:i}}syncLifecycle(){let e="HEAD";try{e=Gy("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"),ln.info({missionId:s.id,branch:s.git_branch,current:e},"Context Pivot: Suspended mission"),i++);this.missions.resumeByBranch(e);let t=[];try{t=Gy(`git branch --merged "${e}"`,{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).split(`
535
- `).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"),ln.info({missionId:a.id,branch:a.git_branch},"Merge Sentinel: Auto-completed mission"),o++}return(i>0||o>0)&&ln.info({suspended:i,completed:o},"Git-Native Lifecycle Sync complete"),{suspended:i,resumed:-1,completed:o}}};Q();B();var p$=b.child({module:"collision-service"}),Os=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=ve(this.repoPath);if(!e)return[];let{missions:r,intentLogs:i}=C.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),p$.info({branch:c,currentBranch:e},"Checking predictive collisions"),yd(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}};var er=class{constructor(e){this.repoPath=e}async getBriefing(e={}){let{missionId:r,scope:i="mission",altitude:t,activeMissionsLimit:o,recentActivityLimit:s,compact:a}=e,c=a??(t==="orbit"||t==="atmosphere"),l=s??(t==="orbit"?0:t==="ground"?20:10),{missions:u,intentLogs:p}=C.getInstance(this.repoPath),d=Fe(this.repoPath),m=ve(this.repoPath);return i==="project"?this.getProjectBriefing({altitude:t,activeMissionsLimit:o,recentActivityLimit:l,compact:c,currentBranch:m,currentCommit:d}):this.getMissionBriefing({missionId:r,altitude:t,recentActivityLimit:l,currentBranch:m,currentCommit:d})}async getProjectBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=C.getInstance(r),{altitude:o,activeMissionsLimit:s,recentActivityLimit:a,compact:c,currentBranch:l,currentCommit:u}=e,p=i.findActive(l||void 0),d=p.length;s&&p.length>s&&(p=p.slice(0,s));let m=i.findParentOnlyIds(p),f=new Set(m),h=p.filter(O=>!f.has(O.id)),v=new Es(t).score(h),y=.15,w=3,S=c&&v.length>w?v.filter((O,P)=>P<w||O.score>=y):v,$=S.map(O=>O.mission),E=new Map(S.map(O=>[O.mission.id,O.score])),T=O=>({id:O.id,name:O.name,goal:O.goal,status:O.status,relevance:E.get(O.id)});if(o==="orbit")return{scope:"project",altitude:"orbit",counts:i.getStats(),next_work_candidates:$.map(T),meta:{current_branch:l,activeMissionsTotal:d}};let R={},U=[];for(let O of p)O.parent_id!=null?(R[O.parent_id]||(R[O.parent_id]=[]),R[O.parent_id].push(O)):U.push(O);let I=i.findRecentCompleted(5).map(T),A=a>0?t.findRecentDecisionActivity(a):void 0,Z=m.map(O=>{let P=p.find(G=>G.id===O);return{parent:c?{...P,strategy_graph:void 0,verification_context:void 0}:P,children:R[O]??[]}}),J=U.filter(O=>!f.has(O.id));return{scope:"project",altitude:o||"atmosphere",counts:i.getStats(),analytics:i.getAnalytics(),hierarchy:Z.length>0?Z:void 0,standalone_active:J.length>0?J:void 0,active_missions:Z.length===0?c?p.map(O=>({...O,strategy_graph:void 0})):p:void 0,next_work_candidates:$.map(T),recent_completed:I,recent_activity:A,meta:{current_branch:l,current_commit:u,activeMissionsTotal:d,active_limit_applied:!!s,relevance_filtered:S.length<v.length?{shown:S.length,total:v.length}:void 0}}}async getMissionBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=C.getInstance(r),{missionId:o,altitude:s,recentActivityLimit:a,currentBranch:c,currentCommit:l}=e,u;if(o?u=i.findById(o):u=i.findActive(c||void 0)[0],!u)return null;let p=null;try{u.strategy_graph&&(p=JSON.parse(u.strategy_graph))}catch{}if(s==="orbit")return{altitude:"orbit",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString()},strategy_snapshot:p};let d="No external shadow changes detected.";try{new bt(r).analyzeGhostChanges(u.commit_sha||void 0),d="Shadow Trace completed: Checked for external modifications."}catch{}let m={repaired:0,failed:0};try{m=new ke(r).detectAndRepairShifts()}catch{}let f={altitude:s||"atmosphere",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString(),git_branch:u.git_branch,commit_sha:u.commit_sha,outcome_contract:u.outcome_contract},artifacts:i.getArtifacts(u.id),shadow_trace:{ghost_analysis:d,symbols_repaired:m.repaired,symbols_missing:m.failed},context:{current_commit:l,working_set:i.getWorkingSet(u.id).map(h=>h.file_path)},strategy_snapshot:p,recent_activity:s==="ground"?t.findByMission(u.id,a||20):t.findByMissionPreferCrystal(u.id,15),ancestor_activity_summary:[],predictive_collisions:[]};try{let h=new Os(r);f.predictive_collisions=await h.analyzePotentialCollisions()}catch{}if(u.parent_id){let h=s==="ground"?t.findByMission(u.parent_id,5):t.findByMissionPreferCrystal(u.parent_id,3);f.ancestor_activity_summary=h.map(_=>({type:_.type,content:_.content,date:new Date(_.created_at*1e3).toISOString()}))}return f}};var Vy=b.child({module:"mcp:tools:ops:briefing"});async function Cs(n){let{repoPath:e,scope:r="mission"}=n;Vy.info({repoPath:e,missionId:n.missionId,scope:r},"Generating briefing");try{let t=await new er(e).getBriefing(n);if(!t&&r==="mission")return{content:[{type:"text",text:"No active missions found. Ready for new assignment."}]};let o;if(r==="project"){let s=t.counts;o=t.next_work_candidates.length===0&&s.active===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"}}return{content:[{type:"text",text:JSON.stringify(t,null,2)}],suggestedNext:o}}catch(i){throw Vy.error({error:i,repoPath:e},"Failed to generate briefing"),new Error(`Failed to generate briefing: ${i instanceof Error?i.message:String(i)}`)}}Q();B();var qy=b.child({module:"mcp:tools:ops:synthesize"});async function Ky(n){let{repoPath:e,missionId:r}=n;qy.info({repoPath:e,missionId:r},"Synthesizing mission");let{missions:i}=C.getInstance(e);try{if(!i.findById(r))throw new Error(`Mission ${r} not found`);let s=await new st(e).distillMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,adr:s.adr,metrics:s.metrics},null,2)}]}}catch(t){throw qy.error({error:t,repoPath:e},"Failed to synthesize ADR"),new Error(`Failed to synthesize ADR: ${t instanceof Error?t.message:String(t)}`)}}B();Q();B();var d$=b.child({module:"narrative-service"}),un=class{missions;briefingEngine;repoPath;constructor(e){this.repoPath=e;let{missions:r}=C.getInstance(e);this.missions=r,this.briefingEngine=new st(e)}async generateChronicle(e={}){d$.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
549
+ *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),Ps.info({missionId:e},"Tactical Briefing synthesized, archived, and synced to Git Notes.")}catch(a){Ps.error({missionId:e,error:a},"Failed to sync ADR to Git Notes")}}else Ps.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")}};V();import{Visitor as z$}from"@swc/core/Visitor.js";import*as zy from"@swc/core";var D$=$.child({module:"verification-engine"}),Dd=class extends z${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)}},Ns=class{async verify(e,r){try{let i=await zy.parse(e,{syntax:"typescript",tsx:!0,comments:!1}),t=new Dd(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 D$.error({error:i},"Verification failed due to parse error"),{passed:!1,errors:[`Parse error: ${i.message}`]}}}};import Dy from"path";import zs from"fs";var Je=$.child({module:"mcp:tools:ops:track"});async function Ay(n,e,r){let{missions:i,intentLogs:t}=M.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")){Je.info({parentId:c.id,childCount:s.length},"All children completed \u2014 cascading parent completion"),i.updateStatus(c.id,"completed",r||void 0),i.clearWorkingSet(c.id),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 ut(n).distillMission(c.id),Je.info({parentId:c.id},"Parent Auto-Synthesis completed")}catch(l){Je.warn({synthesisError:l,parentId:c.id},"Parent Auto-Synthesis deferred")}try{await new Ge(n).syncMissionToGitNotes(c.id)}catch(l){Je.warn({syncError:l,parentId:c.id},"Parent Git Notes sync deferred")}await Ay(n,c.id,r)}}async function Ly(n){let{repoPath:e,missionId:r,stepId:i,status:t,contextPivot:o,updates:s,artifacts:a}=n,{missions:c,intentLogs:l}=M.getInstance(e),u=Be(e);Je.info({repoPath:e,missionId:r,singleStep:i,batchCount:s?.length,artifactCount:a?.length},"Updating mission status");try{if(a&&Array.isArray(a))for(let f of a)c.addArtifact(r,f.type,f.identifier,f.metadata);let d=[];if(s&&Array.isArray(s)&&d.push(...s),i&&t&&d.push({stepId:i,status:t,contextPivot:o}),t&&!i){if(c.updateStatus(r,t,u||void 0),t==="completed"&&c.clearWorkingSet(r),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 ut(e).distillMission(r),Je.info({missionId:r},"Auto-Synthesis completed successfully")}catch(f){Je.warn({synthesisError:f,missionId:r},"Auto-Synthesis deferred or failed")}await Ay(e,r,u)}if(!d.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(d.length===0&&(!a||a.length===0))throw new Error("No updates provided. Must specify either 'updates', 'stepId'/'status', 'status' (top-level), or 'artifacts'.");let p=[];for(let f of d){let{stepId:m,status:h,contextPivot:_}=f,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(x=>x.id===m):g.nodes&&Array.isArray(g.nodes)?b=g.nodes.find(x=>x.id===m):g.steps?Array.isArray(g.steps)?b=g.steps.find(x=>x.id===m):b=g.steps[m]:g[m]&&(b=g[m]),!b)throw new Error(`Step ID "${m}" not found`);if(h==="completed"&&b.verification){let x=new Ns,k=Array.isArray(b.verification)?b.verification:[b.verification];for(let S of k){let P=S;if(typeof S=="string"&&(P={type:"pattern",target:S}),!P||!P.target){Je.warn({rule:S},"Skipping invalid verification rule (missing target)");continue}let R=P.filePath;if(R&&!Dy.isAbsolute(R)&&(R=Dy.join(e,R)),R){if(!zs.existsSync(R))throw new Error(`Verification failed: File not found at ${R}`);let U=await x.verify(zs.readFileSync(R,"utf8"),P);if(!U.passed)throw new Error(`Verification failed: ${U.errors.join("")}`)}else{let U=c.getWorkingSet(r),E=!1;U.length===0&&Je.warn("No working set files to verify against for rule");for(let I of U){if(!zs.existsSync(I.file_path))continue;if((await x.verify(zs.readFileSync(I.file_path,"utf8"),P)).passed){E=!0;break}}if(!E)throw new Error(`Verification failed: Rule "${P.target}" not satisfied in any working set file.`)}}}if(b.status=h,c.update(r,{strategy_graph:JSON.stringify(g),commit_sha:u}),l.create({mission_id:r,type:"system",content:`Step "${m}" updated to "${h}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),_)try{let x=JSON.parse(_);if(c.clearWorkingSet(r),x.files&&Array.isArray(x.files))for(let k of x.files)c.addToWorkingSet(r,k)}catch(x){Je.warn({error:x},"Failed to apply context pivot")}p.push({stepId:m,status:h})}try{await new Ge(e).syncMissionToGitNotes(r)}catch(f){Je.warn({syncError:f,missionId:r},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:r,updates:p,artifacts_added:a?.length||0,message:"Status updated",commit:u},null,2)}]}}catch(d){throw Je.error({error:d,repoPath:e},"Failed to update status"),new Error(`Failed to update status: ${d instanceof Error?d.message:String(d)}`)}}V();ee();var Ds=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,d=this.computeStatusBoost(c.status),p=o.has(c.id)?1:0,f=n.WEIGHTS,m=l*f.recency+u*f.activity+d*f.statusBoost+p*f.blockerBoost;return{mission:c,score:Math.round(m*1e3)/1e3,breakdown:{recency:Math.round(l*1e3)/1e3,activity:Math.round(u*1e3)/1e3,blockerBoost:p,statusBoost:d}}}).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}}};ee();Ue();V();import{execSync as iv}from"child_process";import C$ from"path";var Zs=$.child({module:"shadow-trace"}),xt=class{intentLogs;exports;repoPath;hologramService;constructor(e){let{intentLogs:r,exports:i}=M.getInstance(e);this.intentLogs=r,this.exports=i,this.repoPath=e,this.hologramService=new pe(e)}analyzeGhostChanges(e){let r=e?`${e}..HEAD`:"HEAD~1..HEAD",i=[];try{let o=iv(`git diff --name-only ${r}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
550
+ `).filter(s=>s.trim()!=="");if(o.length===0)return;Zs.info({files:o.length,range:r},"Initiating Shadow Trace analysis...");for(let s of o){let a=C$.join(this.repoPath,s),l=iv(`git diff -U0 ${r} -- ${s}`,{cwd:this.repoPath,encoding:"utf-8"}).matchAll(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/g);for(let u of l){let d=parseInt(u[2],10),p=this.exports.findAtLine(a,d);p&&(this.intentLogs.create({mission_id:0,file_path:a,symbol_id:p.id,type:"discovery",content:`Shadow Trace: Modified externally in ${r}`,confidence:.8,symbol_name:p.name,signature:p.signature,commit_sha:null}),Zs.debug({symbol:p.name},"Logged ghost change"),i.push({from:"external",to:`${s}:${p.name}`,pattern:"git-delta",confidence:.8}))}}i.length>0&&this.hologramService.updateGhostBridges(i),Zs.info("Shadow Trace complete.")}catch(t){Zs.warn({err:t.message},"Shadow Trace failed: git diff error.")}}};ee();V();import{execSync as ov}from"child_process";var dn=$.child({module:"nano-repair"}),Pe=class{intentLogs;exports;missions;repoPath;constructor(e){let{intentLogs:r,exports:i,missions:t}=M.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};dn.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}),dn.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}),dn.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&&dn.info({repaired:r,failed:i},"Nano-Repair recovery complete"),{repaired:r,failed:i}}syncLifecycle(){let e="HEAD";try{e=ov("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"),dn.info({missionId:s.id,branch:s.git_branch,current:e},"Context Pivot: Suspended mission"),i++);this.missions.resumeByBranch(e);let t=[];try{t=ov(`git branch --merged "${e}"`,{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).split(`
551
+ `).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"),dn.info({missionId:a.id,branch:a.git_branch},"Merge Sentinel: Auto-completed mission"),o++}return(i>0||o>0)&&dn.info({suspended:i,completed:o},"Git-Native Lifecycle Sync complete"),{suspended:i,resumed:-1,completed:o}}};ee();V();var M$=$.child({module:"collision-service"}),Hs=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=be(this.repoPath);if(!e)return[];let{missions:r,intentLogs:i}=M.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),M$.info({branch:c,currentBranch:e},"Checking predictive collisions"),wd(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),d=new Set;for(let m of u)r.getWorkingSet(m.id).forEach(h=>d.add(h.file_path));let f=r.getWorkingSet(a.id).filter(m=>d.has(m.file_path));f.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:f.map(m=>m.file_path)})}return o}};var ir=class{constructor(e){this.repoPath=e}async getBriefing(e={}){let{missionId:r,scope:i="mission",altitude:t,activeMissionsLimit:o,recentActivityLimit:s,compact:a}=e,c=a??(t==="orbit"||t==="atmosphere"),l=s??(t==="orbit"?0:t==="ground"?20:10),{missions:u,intentLogs:d}=M.getInstance(this.repoPath),p=Be(this.repoPath),f=be(this.repoPath);return i==="project"?this.getProjectBriefing({altitude:t,activeMissionsLimit:o,recentActivityLimit:l,compact:c,currentBranch:f,currentCommit:p}):this.getMissionBriefing({missionId:r,altitude:t,recentActivityLimit:l,currentBranch:f,currentCommit:p})}async getProjectBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=M.getInstance(r),{altitude:o,activeMissionsLimit:s,recentActivityLimit:a,compact:c,currentBranch:l,currentCommit:u}=e,d=i.findActive(l||void 0),p=d.length;s&&d.length>s&&(d=d.slice(0,s));let f=i.findParentOnlyIds(d),m=new Set(f),h=d.filter(D=>!m.has(D.id)),v=new Ds(t).score(h),g=.15,b=3,x=c&&v.length>b?v.filter((D,z)=>z<b||D.score>=g):v,k=x.map(D=>D.mission),S=new Map(x.map(D=>[D.mission.id,D.score])),P=D=>({id:D.id,name:D.name,goal:D.goal,status:D.status,relevance:S.get(D.id)});if(o==="orbit")return{scope:"project",altitude:"orbit",counts:i.getStats(),next_work_candidates:k.map(P),meta:{current_branch:l,activeMissionsTotal:p}};let R={},U=[];for(let D of d)D.parent_id!=null?(R[D.parent_id]||(R[D.parent_id]=[]),R[D.parent_id].push(D)):U.push(D);let E=i.findRecentCompleted(5).map(P),I=a>0?t.findRecentDecisionActivity(a):void 0,N=f.map(D=>{let z=d.find(G=>G.id===D);return{parent:c?{...z,strategy_graph:void 0,verification_context:void 0}:z,children:R[D]??[]}}),j=U.filter(D=>!m.has(D.id));return{scope:"project",altitude:o||"atmosphere",counts:i.getStats(),analytics:i.getAnalytics(),hierarchy:N.length>0?N:void 0,standalone_active:j.length>0?j:void 0,active_missions:N.length===0?c?d.map(D=>({...D,strategy_graph:void 0})):d:void 0,next_work_candidates:k.map(P),recent_completed:E,recent_activity:I,meta:{current_branch:l,current_commit:u,activeMissionsTotal:p,active_limit_applied:!!s,relevance_filtered:x.length<v.length?{shown:x.length,total:v.length}:void 0}}}async getMissionBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=M.getInstance(r),{missionId:o,altitude:s,recentActivityLimit:a,currentBranch:c,currentCommit:l}=e,u;if(o?u=i.findById(o):u=i.findActive(c||void 0)[0],!u)return null;let d=null;try{u.strategy_graph&&(d=JSON.parse(u.strategy_graph))}catch{}if(s==="orbit")return{altitude:"orbit",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString()},strategy_snapshot:d};let p="No external shadow changes detected.";try{new xt(r).analyzeGhostChanges(u.commit_sha||void 0),p="Shadow Trace completed: Checked for external modifications."}catch{}let f={repaired:0,failed:0};try{f=new Pe(r).detectAndRepairShifts()}catch{}let m={altitude:s||"atmosphere",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString(),git_branch:u.git_branch,commit_sha:u.commit_sha,outcome_contract:u.outcome_contract},artifacts:i.getArtifacts(u.id),shadow_trace:{ghost_analysis:p,symbols_repaired:f.repaired,symbols_missing:f.failed},context:{current_commit:l,working_set:i.getWorkingSet(u.id).map(h=>h.file_path)},strategy_snapshot:d,recent_activity:s==="ground"?t.findByMission(u.id,a||20):t.findByMissionPreferCrystal(u.id,15),ancestor_activity_summary:[],predictive_collisions:[]};try{let h=new Hs(r);m.predictive_collisions=await h.analyzePotentialCollisions()}catch{}if(u.parent_id){let h=s==="ground"?t.findByMission(u.parent_id,5):t.findByMissionPreferCrystal(u.parent_id,3);m.ancestor_activity_summary=h.map(_=>({type:_.type,content:_.content,date:new Date(_.created_at*1e3).toISOString()}))}return m}};var sv=$.child({module:"mcp:tools:ops:briefing"});async function Ws(n){let{repoPath:e,scope:r="mission"}=n;sv.info({repoPath:e,missionId:n.missionId,scope:r},"Generating briefing");try{let t=await new ir(e).getBriefing(n);if(!t&&r==="mission")return{content:[{type:"text",text:"No active missions found. Ready for new assignment."}]};let o;if(r==="project"){let s=t.counts;o=t.next_work_candidates.length===0&&s.active===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"}}return{content:[{type:"text",text:JSON.stringify(t,null,2)}],suggestedNext:o}}catch(i){throw sv.error({error:i,repoPath:e},"Failed to generate briefing"),new Error(`Failed to generate briefing: ${i instanceof Error?i.message:String(i)}`)}}ee();V();var av=$.child({module:"mcp:tools:ops:synthesize"});async function cv(n){let{repoPath:e,missionId:r}=n;av.info({repoPath:e,missionId:r},"Synthesizing mission");let{missions:i}=M.getInstance(e);try{if(!i.findById(r))throw new Error(`Mission ${r} not found`);let s=await new ut(e).distillMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,adr:s.adr,metrics:s.metrics},null,2)}]}}catch(t){throw av.error({error:t,repoPath:e},"Failed to synthesize ADR"),new Error(`Failed to synthesize ADR: ${t instanceof Error?t.message:String(t)}`)}}V();ee();V();var j$=$.child({module:"narrative-service"}),mn=class{missions;briefingEngine;repoPath;constructor(e){this.repoPath=e;let{missions:r}=M.getInstance(e);this.missions=r,this.briefingEngine=new ut(e)}async generateChronicle(e={}){j$.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),d=u.length>0,p=await this.briefingEngine.distillMission(l.id,!1);if(d){let f=[];for(let h of u)f.push(await this.mapMissionToEpisode(h));f.unshift(await this.mapMissionToEpisode(l));let m={kind:"initiative",root_mission_id:l.id,title:l.name,strategy_graph:l.strategy_graph?JSON.parse(l.strategy_graph):{},episodes:e.compact?[]:f,synthesized_narrative:e.compact?this.truncateText(p.adr):p.adr||""};s.push(m),c.push(m)}else{let f=await this.mapMissionToEpisode(l,p.adr,e.compact);a.push(f),c.push(f)}}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
536
552
 
537
553
  `;if(r+=`*Generated at ${new Date(e.generated_at).toISOString()}*
538
554
 
@@ -543,23 +559,23 @@ After that, ${e} and other tools will work.`+Gr;return Ot("FILE_NOT_FOUND",r,{re
543
559
  `,r+=`${i.adr_summary}
544
560
 
545
561
  `),r+=`---
546
- `;return r}};var Yy=b.child({module:"mcp:tools:ops:chronicle"});async function Xy(n){let{repoPath:e,format:r="markdown",...i}=n,t=new un(e);Yy.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 Yy.error({error:o,repoPath:e},"Failed to generate chronicle"),new Error(`Failed to generate chronicle: ${o instanceof Error?o.message:String(o)}`)}}Oe();async function Qy(n){let{repoPath:e,compact:r=!0}=n,t=new ce(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 un(e).generateChronicle({limit:5,compact:r}),initiatives:[],unattached_episodes:[]},l=(await Cs({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"}}}B();Lt();var zd=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}},Mt=new zd;function ev(){Mt.recordIndexStart()}function js(){Mt.recordIndexCacheHit()}function tv(n){Mt.recordIndexEnd(n)}function ti(n,e){Mt.recordIndexPhase(n,e)}function nv(){Mt.clearIndexPhases()}function pn(){return Mt.recordQueryStart()}function at(){Mt.recordSearchHistoryFailure()}function Dd(){return Mt.getSnapshot()}import Ad from"path";var rv=b.child({module:"mcp:tools:ops:health"});async function iv(n){let e=n.repoPath,r=Ad.isAbsolute(e)?Ad.normalize(e):Ad.resolve(process.cwd(),e);rv.info({repoPath:r},"Health check");let i=!1,t=!1;try{Ne(r),i=!0,t=qe(r)}catch(c){rv.debug({repoPath:r,error:c},"Health: DB check failed")}let o=Dd(),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();B();var ni=b.child({module:"mcp:tools:ops:log"});async function ov(n){let{repoPath:e,missionId:r,type:i,content:t,filePath:o,symbolName:s,standalone:a}=n;ni.info({repoPath:e,type:i,symbolName:s,standalone:a},"Logging intent");let{missions:c,exports:l,intentLogs:u}=C.getInstance(e);try{let p=r??null;if(a){if(!s)throw new Error('Standalone intent logs must be anchored to a symbol. Please provide "symbolName".');p=null}else if(p){if(!c.findById(p))throw new Error(`Mission ${p} not found. Use shadow_ops_briefing to see available missions.`)}else{let _=c.findActive();_.length>0?(p=_.find(v=>v.status==="in-progress")?.id||_[0].id,ni.debug({missionId:p},"Auto-resolved to active mission")):(p=null,ni.debug("No active mission found, logging as system/unlinked intent"))}let d=null,m=null,f=s||null;if(s){let v=(o?l.findByNameAndFile(s,o):l.findByName(s))[0];v?(d=v.id,m=v.signature,f=v.name):ni.warn({symbolName:s,filePath:o},"Symbol not found for intent linking")}let h=u.create({mission_id:p,symbol_id:d,file_path:o||null,type:i,content:t,confidence:1,symbol_name:f,signature:m,commit_sha:null});return{content:[{type:"text",text:JSON.stringify({logId:h,missionId:p,symbolId:d,status:"logged",message:d?`Intent linked to symbol "${s}"`:"Intent logged (unlinked)"},null,2)}]}}catch(p){throw ni.error({error:p,repoPath:e},"Failed to log intent"),new Error(`Failed to log intent: ${p instanceof Error?p.message:String(p)}`)}}B();var cv=b.child({module:"mcp:tools:ops:graph"});async function lv(n){let{repoPath:e,missionId:r,depth:i,limit:t,format:o="mermaid"}=n;cv.info({repoPath:e,missionId:r,format:o},"Generating mission graph");try{let{GraphExporterService:s}=await Promise.resolve().then(()=>(Ld(),av));return{content:[{type:"text",text:await new s(e).generateGraph({includeCompleted:!0,format:o,focusMissionId:r,depth:i,limit:t})}]}}catch(s){throw cv.error({error:s,repoPath:e},"Failed to generate mission graph"),new Error(`Failed to generate mission graph: ${s.message}`)}}Q();B();var uv=b.child({module:"mcp:tools:ops:crystallize"});async function pv(n){let{repoPath:e,missionId:r,symbolId:i}=n;uv.info({repoPath:e,missionId:r,symbolId:i},"Crystallizing logs");let{intentLogs:t,missions:o,exports:s}=C.getInstance(e);if(typeof r=="number"){let a=o.findById(r);if(!a)throw new Error(`Mission ${r} not found`);let c=t.findRawByMission(r);if(c.length===0){let h=t.findCrystalByMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,status:h?"already_crystallized":"no_logs",message:h?"Mission already has a crystal with no new raw logs to absorb.":"No raw intent logs found for this mission.",crystalId:h?.id??null},null,2)}]}}let u=new cn().analyze(c),p=new Set(c.map(h=>h.symbol_name).filter(Boolean)),d=new Set(c.map(h=>h.type)),m=`[Crystal] Mission #${r}: ${a.name}
547
- `;m+=`Compressed ${c.length} logs across ${p.size} symbols.
548
- `,m+=`Types: ${[...d].join(", ")}
549
-
550
- `,u.decisions.length>0&&(m+=`Decisions: ${u.decisions.join(" | ")}
551
- `),u.context.length>0&&(m+=`Context: ${u.context.join(" | ")}
552
- `),u.consequences.length>0&&(m+=`Consequences: ${u.consequences.join(" | ")}
553
- `),u.recommendations.length>0&&(m+=`Recommendations: ${u.recommendations.join(" | ")}
554
- `);let f=t.crystallize(r,m.trim());return uv.info({missionId:r,crystalId:f,absorbed:c.length},"Crystallization complete"),{content:[{type:"text",text:JSON.stringify({missionId:r,crystalId:f,absorbed:c.length,symbolsCompressed:p.size,status:"crystallized"},null,2)}]}}if(typeof i=="number"){let a=s.findHydratedById(i);if(!s.findById(i))throw new Error(`Symbol ${i} not found in index`);let l=t.findRawBySymbol(i);if(l.length===0)return{content:[{type:"text",text:JSON.stringify({symbolId:i,status:"no_logs",message:"No raw standalone intent logs found for this symbol."},null,2)}]};let p=new cn().analyze(l),d=new Set(l.map(h=>h.type)),m=`[Crystal] Symbol #${i}: ${a?.name||"Unknown"}
555
- `;m+=`Compressed ${l.length} standalone insights.
556
- `,m+=`Types: ${[...d].join(", ")}
557
-
558
- `,p.decisions.length>0&&(m+=`Decisions: ${p.decisions.join(" | ")}
559
- `),p.context.length>0&&(m+=`Context: ${p.context.join(" | ")}
560
- `);let f=t.crystallizeBySymbol(i,m.trim());return{content:[{type:"text",text:JSON.stringify({symbolId:i,crystalId:f,absorbed:l.length,status:"crystallized"},null,2)}]}}throw new Error("Must provide either missionId or symbolId to crystallize.")}B();Q();import Us from"path";var m$=b.child({module:"mcp:tools:ops:working-set-check"});async function dv(n){let{repoPath:e,filePaths:r}=n,{missions:i}=C.getInstance(e),t=i.findActive(),o=[];for(let s of t){let a=i.getWorkingSet(s.id);for(let c of a)if(r.includes(c.file_path))o.push({file_path:c.file_path,mission_id:s.id,mission_name:s.name});else{let l=Us.isAbsolute(c.file_path)?c.file_path:Us.join(e,c.file_path);for(let u of r){let p=Us.isAbsolute(u)?u:Us.join(e,u);if(l===p){o.push({file_path:c.file_path,mission_id:s.id,mission_name:s.name});break}}}}return m$.info({repoPath:e,conflictsCount:o.length},"Working set check completed"),{content:[{type:"text",text:JSON.stringify({conflicts:o},null,2)}]}}import f$ from"fast-glob";import mv from"fs";import h$ from"ignore";import fv from"path";async function Od(n,e=[]){let r=h$(),i=fv.join(n,".gitignore");return mv.existsSync(i)&&r.add(mv.readFileSync(i,"utf8")),e.length>0&&r.add(e),(await f$(zg,{cwd:n,absolute:!0,ignore:ns,stats:!0})).filter(s=>{let a=fv.relative(n,s.path);return!r.ignores(a)}).map(s=>({path:s.path,mtime:s.stats.mtimeMs}))}import Md from"@swc/core";import Tv from"fs";function hv(n){let e=n.split(`
561
- `),r=[],i=0;for(let t of e)r.push(i),i+=t.length+1;return r}function le(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 Fs(n,e){return e.slice(0,n).toString("utf8").length}function gv(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 yv(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 vv(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 ct(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 _v(n){if(!n)return"";let r=n.replace(/\/\*\*|\*\/|\*/g,"").trim().split(`
562
- `)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function Zs(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 ri(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 lt(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 bv(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 xv(n,e,r,i,t,o,s,a,c){let l=c??(p=>Fs(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=ct(h,o,i),y=a(p.span),w=[];if(p.type==="ExportDeclaration"&&(m==="ClassDeclaration"||m==="ClassExpression")){let S=d.body||[];for(let $ of S)if($.type==="ClassMethod"||$.type==="ClassProperty"){let E=$.key.value;if(!E)continue;let T=l($.span.start-e),R=l($.span.end-e),U=a($.span),I=ct(T,o,i);w.push({name:E,kind:$.type,signature:lt(U,$.type),line:le(T,t),endLine:le(R,t),doc:I,classification:$.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(m==="FunctionDeclaration"&&d.body?.type==="BlockStatement")w=Cd(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"){w=Cd(S.init.body.stmts,e,r,i,t,o,a,l);break}}u.push({name:f,kind:m,signature:lt(y,m),line:le(h,t),endLine:le(_,t),doc:v,classification:Zs(s,f,m),capabilities:JSON.stringify(ri(y)),members:w})}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=ct(m,o,i);u.push({name:d.exported?.value||d.orig.value,kind:"ExportSpecifier",signature:`export { ${d.orig.value} }`,line:le(m,t),endLine:le(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=ct(d,o,i),h=a(p.span),_=[];if(p.decl.type==="ClassExpression"||p.decl.type==="ClassDeclaration"){let v=p.decl.body||[];for(let y of v)if(y.type==="ClassMethod"||y.type==="ClassProperty"){let w=y.key.value;if(!w)continue;let S=l(y.span.start-e),$=l(y.span.end-e),E=a(y.span),T=ct(S,o,i);_.push({name:w,kind:y.type,signature:lt(E,y.type),line:le(S,t),endLine:le($,t),doc:T,classification:y.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(p.decl.type==="FunctionExpression"||p.decl.type==="FunctionDeclaration"||p.decl.type==="ArrowFunctionExpression")&&p.decl.body?.type==="BlockStatement"&&(_=Cd(p.decl.body.stmts,e,r,i,t,o,a,l));u.push({name:"default",kind:"DefaultExport",signature:lt(h,"DefaultExport"),line:le(d,t),endLine:le(m,t),doc:f,classification:"Default Export",capabilities:JSON.stringify(ri(h)),members:_})}if(p.type==="ExportAllDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=p.source.value,h=ct(d,o,i);u.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${f}"`,line:le(d,t),endLine:le(m,t),doc:h,classification:"Re-export",capabilities:"[]"})}}return u}function Cd(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=ct(f,o,i);c.push({name:m.name,kind:"VariableDeclaration",signature:lt(_,"VariableDeclaration"),line:le(f,t),endLine:le(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=ct(p,o,i);c.push({name:u,kind:"FunctionDeclaration",signature:lt(m,"FunctionDeclaration"),line:le(p,t),endLine:le(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),_=ct(m,o,i);c.push({name:p,kind:"ReturnProperty",signature:lt(h,"ReturnProperty"),line:le(m,t),endLine:le(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:lt(h,d.type),line:le(m,t),endLine:le(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:lt(h,"HTTP Route"),line:le(m,t),endLine:le(f,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:d})})}}}}return c}function Sv(n,e,r,i,t,o){let s=o??(l=>Fs(l,r)),a=[];function c(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let u=g$(l);if(u){let p=s(l.span.start-e);a.push({...u,line:le(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 g$(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 ii(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(y=>y.kind==="FunctionDeclaration"||y.kind==="ClassDeclaration")?.name,v=_?`React component: ${_}`:"React UI component";return f?`${v} with ${f}`:v},Hook:(f,h)=>{let _=h.find(y=>y.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(y=>y.classification==="Service Boundary"),v=h.find(y=>y.kind==="ClassDeclaration")?.name;return _?"PHP controller with API routes":v?`PHP class: ${v}`:"PHP module"},"Micro IR (Python)":(f,h)=>{let _=h.some(y=>y.classification==="Service Boundary"),v=h.find(y=>y.kind==="ClassDeclaration")?.name;return _?"Python API handler with routes":v?`Python class: ${v}`:"Python module"},"Micro IR (Go/TS) ":(f,h)=>{let _=h.some(y=>y.kind==="TypeDeclaration"),v=h.filter(y=>y.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(w=>w.kind==="TraitDeclaration")?.name,v=h.find(w=>w.kind==="StructDeclaration")?.name,y=h.filter(w=>w.kind==="FunctionDeclaration");return _?f.includes("Rust trait")?`Rust module: trait ${_}`:`Rust module: ${_}`:v?`Rust module: struct ${v}`:y.length>0?`Rust module: ${y.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 $v(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"&&wv(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 wv(n,e){n.type==="TsQualifiedName"?(n.left&&wv(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import Rv from"path";import jd from"path";B();Kr();import Ev from"path";import y$ from"fs";import{fileURLToPath as v$}from"url";import*as dn from"web-tree-sitter";var eN=Ev.dirname(v$(import.meta.url)),kv=b.child({module:"parser:tree-sitter"}),Hs=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=dn.Parser||dn;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=Ct("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!y$.existsSync(r))return kv.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await dn.Language.load(r);return this.languages.set(e,i),i}catch(i){return kv.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`
562
+ `;return r}};var lv=$.child({module:"mcp:tools:ops:chronicle"});async function uv(n){let{repoPath:e,format:r="markdown",...i}=n,t=new mn(e);lv.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 lv.error({error:o,repoPath:e},"Failed to generate chronicle"),new Error(`Failed to generate chronicle: ${o instanceof Error?o.message:String(o)}`)}}Ue();async function pv(n){let{repoPath:e,compact:r=!0}=n,t=new pe(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 mn(e).generateChronicle({limit:5,compact:r}),initiatives:[],unattached_episodes:[]},l=(await Ws({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:"{}",d={};try{d=JSON.parse(u)}catch{}let p={counts:d.counts,next_work_candidates:d.next_work_candidates??[],active_count:Array.isArray(d.active_missions)?d.active_missions.length:0};return{content:[{type:"text",text:JSON.stringify({hologram:t,chronicle:a,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"}}}V();Ot();var jd=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}},Ft=new jd;function dv(){Ft.recordIndexStart()}function Bs(){Ft.recordIndexCacheHit()}function mv(n){Ft.recordIndexEnd(n)}function ci(n,e){Ft.recordIndexPhase(n,e)}function fv(){Ft.clearIndexPhases()}function fn(){return Ft.recordQueryStart()}function dt(){Ft.recordSearchHistoryFailure()}function Ud(){return Ft.getSnapshot()}import Fd from"path";var hv=$.child({module:"mcp:tools:ops:health"});async function gv(n){let e=n.repoPath,r=Fd.isAbsolute(e)?Fd.normalize(e):Fd.resolve(process.cwd(),e);hv.info({repoPath:r},"Health check");let i=!1,t=!1;try{Le(r),i=!0,t=et(r)}catch(c){hv.debug({repoPath:r,error:c},"Health: DB check failed")}let o=Ud(),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}}ee();V();var li=$.child({module:"mcp:tools:ops:log"});async function yv(n){let{repoPath:e,missionId:r,type:i,content:t,filePath:o,symbolName:s,standalone:a}=n;li.info({repoPath:e,type:i,symbolName:s,standalone:a},"Logging intent");let{missions:c,exports:l,intentLogs:u}=M.getInstance(e);try{let d=r??null;if(a){if(!s)throw new Error('Standalone intent logs must be anchored to a symbol. Please provide "symbolName".');d=null}else if(d){if(!c.findById(d))throw new Error(`Mission ${d} not found. Use shadow_ops_briefing to see available missions.`)}else{let _=c.findActive();_.length>0?(d=_.find(v=>v.status==="in-progress")?.id||_[0].id,li.debug({missionId:d},"Auto-resolved to active mission")):(d=null,li.debug("No active mission found, logging as system/unlinked intent"))}let p=null,f=null,m=s||null;if(s){let v=(o?l.findByNameAndFile(s,o):l.findByName(s))[0];v?(p=v.id,f=v.signature,m=v.name):li.warn({symbolName:s,filePath:o},"Symbol not found for intent linking")}let h=u.create({mission_id:d,symbol_id:p,file_path:o||null,type:i,content:t,confidence:1,symbol_name:m,signature:f,commit_sha:null});return{content:[{type:"text",text:JSON.stringify({logId:h,missionId:d,symbolId:p,status:"logged",message:p?`Intent linked to symbol "${s}"`:"Intent logged (unlinked)"},null,2)}]}}catch(d){throw li.error({error:d,repoPath:e},"Failed to log intent"),new Error(`Failed to log intent: ${d instanceof Error?d.message:String(d)}`)}}V();var bv=$.child({module:"mcp:tools:ops:graph"});async function xv(n){let{repoPath:e,missionId:r,depth:i,limit:t,format:o="mermaid"}=n;bv.info({repoPath:e,missionId:r,format:o},"Generating mission graph");try{let{GraphExporterService:s}=await Promise.resolve().then(()=>(Zd(),_v));return{content:[{type:"text",text:await new s(e).generateGraph({includeCompleted:!0,format:o,focusMissionId:r,depth:i,limit:t})}]}}catch(s){throw bv.error({error:s,repoPath:e},"Failed to generate mission graph"),new Error(`Failed to generate mission graph: ${s.message}`)}}ee();V();var Sv=$.child({module:"mcp:tools:ops:crystallize"});async function $v(n){let{repoPath:e,missionId:r,symbolId:i}=n;Sv.info({repoPath:e,missionId:r,symbolId:i},"Crystallizing logs");let{intentLogs:t,missions:o,exports:s}=M.getInstance(e);if(typeof r=="number"){let a=o.findById(r);if(!a)throw new Error(`Mission ${r} not found`);let c=t.findRawByMission(r);if(c.length===0){let h=t.findCrystalByMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,status:h?"already_crystallized":"no_logs",message:h?"Mission already has a crystal with no new raw logs to absorb.":"No raw intent logs found for this mission.",crystalId:h?.id??null},null,2)}]}}let u=new pn().analyze(c),d=new Set(c.map(h=>h.symbol_name).filter(Boolean)),p=new Set(c.map(h=>h.type)),f=`[Crystal] Mission #${r}: ${a.name}
563
+ `;f+=`Compressed ${c.length} logs across ${d.size} symbols.
564
+ `,f+=`Types: ${[...p].join(", ")}
565
+
566
+ `,u.decisions.length>0&&(f+=`Decisions: ${u.decisions.join(" | ")}
567
+ `),u.context.length>0&&(f+=`Context: ${u.context.join(" | ")}
568
+ `),u.consequences.length>0&&(f+=`Consequences: ${u.consequences.join(" | ")}
569
+ `),u.recommendations.length>0&&(f+=`Recommendations: ${u.recommendations.join(" | ")}
570
+ `);let m=t.crystallize(r,f.trim());return Sv.info({missionId:r,crystalId:m,absorbed:c.length},"Crystallization complete"),{content:[{type:"text",text:JSON.stringify({missionId:r,crystalId:m,absorbed:c.length,symbolsCompressed:d.size,status:"crystallized"},null,2)}]}}if(typeof i=="number"){let a=s.findHydratedById(i);if(!s.findById(i))throw new Error(`Symbol ${i} not found in index`);let l=t.findRawBySymbol(i);if(l.length===0)return{content:[{type:"text",text:JSON.stringify({symbolId:i,status:"no_logs",message:"No raw standalone intent logs found for this symbol."},null,2)}]};let d=new pn().analyze(l),p=new Set(l.map(h=>h.type)),f=`[Crystal] Symbol #${i}: ${a?.name||"Unknown"}
571
+ `;f+=`Compressed ${l.length} standalone insights.
572
+ `,f+=`Types: ${[...p].join(", ")}
573
+
574
+ `,d.decisions.length>0&&(f+=`Decisions: ${d.decisions.join(" | ")}
575
+ `),d.context.length>0&&(f+=`Context: ${d.context.join(" | ")}
576
+ `);let m=t.crystallizeBySymbol(i,f.trim());return{content:[{type:"text",text:JSON.stringify({symbolId:i,crystalId:m,absorbed:l.length,status:"crystallized"},null,2)}]}}throw new Error("Must provide either missionId or symbolId to crystallize.")}V();ee();import Js from"path";var U$=$.child({module:"mcp:tools:ops:working-set-check"});async function wv(n){let{repoPath:e,filePaths:r}=n,{missions:i}=M.getInstance(e),t=i.findActive(),o=[];for(let s of t){let a=i.getWorkingSet(s.id);for(let c of a)if(r.includes(c.file_path))o.push({file_path:c.file_path,mission_id:s.id,mission_name:s.name});else{let l=Js.isAbsolute(c.file_path)?c.file_path:Js.join(e,c.file_path);for(let u of r){let d=Js.isAbsolute(u)?u:Js.join(e,u);if(l===d){o.push({file_path:c.file_path,mission_id:s.id,mission_name:s.name});break}}}}return U$.info({repoPath:e,conflictsCount:o.length},"Working set check completed"),{content:[{type:"text",text:JSON.stringify({conflicts:o},null,2)}]}}import F$ from"fast-glob";import kv from"fs";import Z$ from"ignore";import Ev from"path";async function Hd(n,e=[]){let r=Z$(),i=Ev.join(n,".gitignore");return kv.existsSync(i)&&r.add(kv.readFileSync(i,"utf8")),e.length>0&&r.add(e),(await F$(Hg,{cwd:n,absolute:!0,ignore:as,stats:!0})).filter(s=>{let a=Ev.relative(n,s.path);return!r.ignores(a)}).map(s=>({path:s.path,mtime:s.stats.mtimeMs}))}import Zv from"fs";function Iv(n){let e=n.split(`
577
+ `),r=[],i=0;for(let t of e)r.push(i),i+=t.length+1;return r}function de(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 Vs(n,e){return e.slice(0,n).toString("utf8").length}function Tv(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 Rv(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 Pv(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 mt(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 Nv(n){if(!n)return"";let r=n.replace(/\/\*\*|\*\/|\*/g,"").trim().split(`
578
+ `)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function qs(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 ui(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 qe(n,e){if(!n)return"";let r=n.trimStart();for(;/^\/\*[\s\S]*?\*\//.test(r);)r=r.replace(/^\/\*[\s\S]*?\*\/\s*/,"");for(;/^\/\/[^\n]*\n/.test(r);)r=r.replace(/^\/\/[^\n]*\n\s*/,"");if(r=r.replace(/^(?:import[^\n]*\n)+/,"").replace(/^(?:export\s+\{[^}]*\}\s+from\s+['"][^'"]+['"];?\s*\n?)+/,"").trim(),e==="TsInterfaceDeclaration"||e==="TsTypeAliasDeclaration")return r;let i=0,t=0,o=r.length;for(let a=0;a<r.length;a++){let c=r[a];if(c==="(")i++;else if(c===")")i--;else if(c==="<")t++;else if(c===">")t--;else if(c==="{"){if(i===0&&t===0){o=a;break}}else if(c===";"&&i===0&&t===0){o=a;break}else if(c==="="&&r[a+1]===">"&&i===0&&t===0){o=a+2;break}}let s=r.substring(0,o).trim();return s.length>500?s.slice(0,497)+"...":s}function zv(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 H$(n,e){for(let r of n){if((r.type==="FunctionDeclaration"||r.type==="ClassDeclaration")&&(r.identifier?.value||r.id?.value)===e)return r.span;if(r.type==="VariableDeclaration"){for(let i of r.declarations)if(i.id?.type==="Identifier"&&i.id.value===e)return i.span||r.span}if((r.type==="TsTypeAliasDeclaration"||r.type==="TsInterfaceDeclaration"||r.type==="TsEnumDeclaration")&&(r.id?.value||r.identifier?.value)===e)return r.span;if(r.type==="ExportDeclaration"){let i=r.declaration;if(!i)continue;if((i.type==="FunctionDeclaration"||i.type==="ClassDeclaration")&&(i.identifier?.value||i.id?.value)===e)return i.span||r.span;if(i.type==="VariableDeclaration"){for(let t of i.declarations)if(t.id?.type==="Identifier"&&t.id.value===e)return t.span||i.span||r.span}}}return null}function Dv(n,e,r,i,t,o,s,a,c){let l=c??(d=>Vs(d,r)),u=[];for(let d of n){if(d.type==="ExportDeclaration"){let p=d.declaration,f=p.type,m="";f==="VariableDeclaration"?m=p.declarations.map(x=>x.id.value).join("",""):m=p.id?.value||p.identifier?.value||"anonymous";let h=l(d.span.start-e),_=l(d.span.end-e),v=mt(h,o,i),g=a(d.span),b=[];if(d.type==="ExportDeclaration"&&(f==="ClassDeclaration"||f==="ClassExpression")){let x=p.body||[];for(let k of x)if(k.type==="ClassMethod"||k.type==="ClassProperty"){let S=k.key.value;if(!S)continue;let P=l(k.span.start-e),R=l(k.span.end-e),U=a(k.span),E=mt(P,o,i);b.push({name:S,kind:k.type,signature:qe(U,k.type),line:de(P,t),endLine:de(R,t),doc:E,classification:k.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(f==="FunctionDeclaration"&&p.body?.type==="BlockStatement")b=Wd(p.body.stmts,e,r,i,t,o,a,l);else if(f==="VariableDeclaration"){for(let x of p.declarations)if(x.init&&(x.init.type==="ArrowFunctionExpression"||x.init.type==="FunctionExpression")&&x.init.body?.type==="BlockStatement"){b=Wd(x.init.body.stmts,e,r,i,t,o,a,l);break}}u.push({name:m,kind:f,signature:qe(g,f),line:de(h,t),endLine:de(_,t),doc:v,classification:qs(s,m,f),capabilities:JSON.stringify(ui(g)),members:b})}if(d.type==="ExportNamedDeclaration"){for(let p of d.specifiers)if(p.type==="ExportSpecifier"){let f=p.orig.value,m=p.exported?.value||f,_=H$(n,f)||d.span,v=l(_.start-e),g=l(_.end-e),b=mt(v,o,i);u.push({name:m,kind:"ExportSpecifier",signature:`export { ${f} }`,line:de(v,t),endLine:de(g,t),doc:b,classification:"Export mapping",capabilities:"[]"})}}if(d.type==="ExportDefaultDeclaration"){let p=l(d.span.start-e),f=l(d.span.end-e),m=mt(p,o,i),h=a(d.span),_=[];if(d.decl.type==="ClassExpression"||d.decl.type==="ClassDeclaration"){let v=d.decl.body||[];for(let g of v)if(g.type==="ClassMethod"||g.type==="ClassProperty"){let b=g.key.value;if(!b)continue;let x=l(g.span.start-e),k=l(g.span.end-e),S=a(g.span),P=mt(x,o,i);_.push({name:b,kind:g.type,signature:qe(S,g.type),line:de(x,t),endLine:de(k,t),doc:P,classification:g.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(d.decl.type==="FunctionExpression"||d.decl.type==="FunctionDeclaration"||d.decl.type==="ArrowFunctionExpression")&&d.decl.body?.type==="BlockStatement"&&(_=Wd(d.decl.body.stmts,e,r,i,t,o,a,l));u.push({name:"default",kind:"DefaultExport",signature:qe(h,"DefaultExport"),line:de(p,t),endLine:de(f,t),doc:m,classification:"Default Export",capabilities:JSON.stringify(ui(h)),members:_})}if(d.type==="ExportAllDeclaration"){let p=l(d.span.start-e),f=l(d.span.end-e),m=d.source.value,h=mt(p,o,i);u.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${m}"`,line:de(p,t),endLine:de(f,t),doc:h,classification:"Re-export",capabilities:"[]"})}}return u}function Wd(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 d=[],p=m=>{if(m.type==="Identifier")d.push({name:m.value,span:m.span});else if(m.type==="ArrayPattern")for(let h of m.elements)h&&p(h);else if(m.type==="ObjectPattern")for(let h of m.properties)h.type==="AssignmentPatternProperty"?d.push({name:h.key.value,span:h.span}):h.type==="KeyValuePatternProperty"&&p(h.value)};p(u.id);let f=u.init&&(u.init.type==="ArrowFunctionExpression"||u.init.type==="FunctionExpression");for(let m of d){let h=f?u.init.span||u.span||m.span:u.span||m.span,_=f?u.init.type:"VariableDeclaration",v=f?"Internal Function":"Internal Variable",g=a(h.start-e),b=a(h.end-e),x=s(h),k=mt(g,o,i);c.push({name:m.name,kind:_,signature:qe(x,_),line:de(g,t),endLine:de(b,t),doc:k,classification:v,capabilities:"[]"})}}if(l.type==="FunctionDeclaration"){let u=l.identifier?.value||l.ident?.value||"anonymous",d=a(l.span.start-e),p=a(l.span.end-e),f=s(l.span),m=mt(d,o,i);c.push({name:u,kind:"FunctionDeclaration",signature:qe(f,"FunctionDeclaration"),line:de(d,t),endLine:de(p,t),doc:m,classification:"Internal Function",capabilities:"[]"})}if(l.type==="ReturnStatement"&&l.argument?.type==="ObjectExpression")for(let u of l.argument.properties){let d="",p=u.span||u.key?.span||u.ident?.span;if(u.type==="KeyValueProperty"){let f=u.key;d=f?.value||f?.raw||(f?.type==="Identifier"?f.value:"")}else u.type==="MethodProperty"?d=u.key?.value||u.key?.raw||"":u.type==="ShorthandProperty"?d=u.ident?.value||"":u.type==="Identifier"&&(d=u.value||"");if(d&&p){let f=a(p.start-e),m=a(p.end-e),h=s(p),_=mt(f,o,i);c.push({name:d,kind:"ReturnProperty",signature:qe(h,"ReturnProperty"),line:de(f,t),endLine:de(m,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 d=u.arguments[0]?.expression?.value,p=u.arguments[1]?.expression;if(d&&p&&(p.type==="ArrowFunctionExpression"||p.type==="FunctionExpression")){let f=a(p.span.start-e),m=a(p.span.end-e),h=s(p.span);c.push({name:`on:${d}`,kind:p.type,signature:qe(h,p.type),line:de(f,t),endLine:de(m,t),doc:"",classification:"Event Handler",capabilities:"[]"})}}if(u.callee.type==="Identifier"&&u.callee.value==="addRoute"&&u.arguments.length>=3){let d=u.arguments[2].expression;if(d.type==="StringLiteral"){let p=d.value,f=a(u.span.start-e),m=a(u.span.end-e),h=s(u.span);c.push({name:p,kind:"HTTP Route",signature:qe(h,"HTTP Route"),line:de(f,t),endLine:de(m,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:p})})}}}}return c}function Av(n,e,r,i,t,o){let s=o??(l=>Vs(l,r)),a=[];function c(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let u=W$(l);if(u){let d=s(l.span.start-e);a.push({...u,line:de(d,i),snippet:t(l.span)})}}for(let u of Object.keys(l)){if(u==="span")continue;let d=l[u];Array.isArray(d)?d.forEach(c):typeof d=="object"&&c(d)}}}return n.forEach(c),a}function W$(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 pi(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(m=>o[m]).filter(Boolean).join(" and "),c={Component:(m,h)=>{let _=h.find(g=>g.kind==="FunctionDeclaration"||g.kind==="ClassDeclaration")?.name,v=_?`React component: ${_}`:"React UI component";return m?`${v} with ${m}`:v},Hook:(m,h)=>{let _=h.find(g=>g.name.startsWith("use"))?.name,v=_?`Custom React hook: ${_}`:"Custom React hook";return m?`${v} for ${m}`:v},Service:(m,h)=>{let v=`Service layer: ${h[0]?.name||"Service"}`;return m?`${v} handling ${m}`:v},Repository:(m,h)=>`Data repository: ${h[0]?.name||"Repository"} for ${m||"data access"}`,"Type Definition":(m,h)=>`Type definitions: ${h.slice(0,3).map(v=>v.name).join("")}${h.length>3?"...":""}`,Model:(m,h)=>`Data model: ${h[0]?.name||"Model"}`,"HTTP Route":(m,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)":(m,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)":(m,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) ":(m,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) ":(m,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 _?m.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(m=>m.kind==="FunctionDeclaration"),u=i.filter(m=>m.kind==="ClassDeclaration"),d=i.filter(m=>m.kind==="TsInterfaceDeclaration"||m.kind==="TsTypeAliasDeclaration"),p=[];if(u.length>0&&p.push(`Class: ${u[0].name}`),l.length>0){let m=l.slice(0,2).map(h=>h.name).join("");p.push(`Functions: ${m}`)}d.length>0&&p.push(`Types: ${d.length}`);let f=p.length>0?p.join(" | "):`Module with ${i.length} export(s)`;return s?`${f} \u2014 ${s}`:f}function Lv(n){let e=new Set;function r(i){if(!(!i||typeof i!="object")){i.typeAnnotation&&he(i.typeAnnotation,e),(i.type==="TsTypeReference"||i.type==="TsTypeAnnotation")&&he(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 he(n,e){if(n){if(n.type==="TsTypeAnnotation"){he(n.typeAnnotation,e);return}n.type==="TsTypeReference"&&(n.typeName?.type==="Identifier"&&e.add(n.typeName.value),n.typeName?.type==="TsQualifiedName"&&Ov(n.typeName,e),n.typeParams&&he(n.typeParams,e)),n.type==="TsArrayType"&&he(n.elementType,e),n.type==="TsUnionType"&&n.types?.forEach(r=>he(r,e)),n.type==="TsIntersectionType"&&n.types?.forEach(r=>he(r,e)),n.type==="TsTupleType"&&n.elemTypes?.forEach(r=>he(r.ty,e)),(n.type==="TsFunctionType"||n.type==="TsConstructorType")&&(n.params?.forEach(r=>he(r.typeAnnotation,e)),n.typeAnnotation&&he(n.typeAnnotation,e)),n.type==="TsTypeParameterDeclaration"&&n.params?.forEach(r=>{r.constraint&&he(r.constraint,e),r.default&&he(r.default,e)}),n.type==="TsTypeParameterInstantiation"&&n.params?.forEach(r=>he(r,e)),n.type==="TsMappedType"&&n.typeAnnotation&&he(n.typeAnnotation,e),n.type==="TsIndexedAccessType"&&(he(n.objectType,e),he(n.indexType,e)),n.type==="TsConditionalType"&&(he(n.checkType,e),he(n.extendsType,e),he(n.trueType,e),he(n.falseType,e)),n.type==="TsTypeLiteral"&&n.members?.forEach(r=>{r.typeAnnotation&&he(r.typeAnnotation,e)})}}function Ov(n,e){n.type==="TsQualifiedName"?(n.left&&Ov(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import Hv from"path";import Bd from"path";V();ni();import Mv from"path";import B$ from"fs";import{fileURLToPath as G$}from"url";import*as hn from"web-tree-sitter";var iz=Mv.dirname(G$(import.meta.url)),Cv=$.child({module:"parser:tree-sitter"}),Ks=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=hn.Parser||hn;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=Mt("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!B$.existsSync(r))return Cv.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await hn.Language.load(r);return this.languages.set(e,i),i}catch(i){return Cv.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`
563
579
  (function_definition name: (name) @name) @func
564
580
  (class_declaration name: (name) @name) @class
565
581
  (interface_declaration name: (name) @name) @interface
@@ -583,115 +599,108 @@ After that, ${e} and other tools will work.`+Gr;return Ot("FILE_NOT_FOUND",r,{re
583
599
  (trait_item name: (_type_identifier) @name) @trait
584
600
  (type_item name: (_type_identifier) @name) @type
585
601
  (use_declaration argument: (_) @name) @import
586
- `;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=Ev.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(`
587
- `),a=this.getQueries(i);if(!a)return[];let l=new dn.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 Ws=class{parse(e,r=!1){let i=[],t=[],o=e.split(`
588
- `),s="",a="",c=0,l=0,u=-1,p=-1,d=[],m=[],f=!1,h=r?"api":"",_="",v=/^namespace\s+([a-zA-Z0-9_\\]+);/,y=/^(?:abstract\s+)?(?:readonly\s+)?class\s+([a-zA-Z0-9_]+)/,w=/^interface\s+([a-zA-Z0-9_]+)/,S=/^trait\s+([a-zA-Z0-9_]+)/,$=/^(?:public|protected|private|static|\s)*function\s+([a-zA-Z0-9_]+)\s*\(/,E=/^use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/,T=/^#\[([a-zA-Z0-9_\\]+)(?:\((.*)\))?\]/,R=/(?:Route::|router->|\$router->|->)(get|post|put|delete|patch|match)\s*\(\s*(?:uri\s*:\s*)?['"]([^'"]+)['"]/,U=/->prefix\s*\(\s*(?:prefix\s*:\s*)?['"]([^'"]+)['"]/;for(let I=0;I<o.length;I++){let A=o[I].trim();if(!A)continue;let Z=(A.match(/{/g)||[]).length,J=(A.match(/}/g)||[]).length,O=l;if(l+=Z-J,a&&l<=p){let q=i.find(W=>W.name===a&&W.line===c);q&&(q.endLine=I+1),a="",p=-1}if(s&&l<=u){let q=i.find(W=>W.name===s&&(W.kind==="ClassDeclaration"||W.kind==="TraitDeclaration"||W.kind==="InterfaceDeclaration"));q&&(q.endLine=I+1),s="",u=-1}let P=A.match(U);if(P&&(h=P[1]),A.includes("});")&&(h=""),A.startsWith("/**")){f=!0,m=[];continue}if(f){A.endsWith("*/")?f=!1:m.push(A.replace(/^\*\s?/,""));continue}let H=A.match(T);if(H){d.push(H[1]);continue}let G=A.match(v);if(G){_=G[1]||"",d=[],m=[];continue}let F=A.match(y);if(F){s=F[1],u=l-Z;let q={attributes:d};_&&(q.namespace=_),i.push({name:s,kind:"ClassDeclaration",classification:"Class",signature:`class ${s}`,line:I+1,endLine:I+1,doc:m.join(`
589
- `).trim(),capabilities:JSON.stringify(q),members:[]}),d=[],m=[];continue}let M=A.match(w);if(M){let q=M[1];s=q,u=l-Z,i.push({name:q,kind:"InterfaceDeclaration",classification:"Interface",signature:`interface ${q}`,line:I+1,endLine:I+1,doc:m.join(`
590
- `).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let ue=A.match(S);if(ue){let q=ue[1];s=q,u=l-Z,i.push({name:q,kind:"TraitDeclaration",classification:"Trait",signature:`trait ${q}`,line:I+1,endLine:I+1,doc:m.join(`
591
- `).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let V=A.match($);if(V){let q=V[1],W=!!s;a=q,c=I+1,p=l-Z;let Ee=!1,pt={};for(let be of d)be.toLowerCase().includes("route")&&(Ee=!0,pt={type:"route",method:"GET",path:"/"});let dt=m.join(`
592
- `).trim();if(Ee){let be=pt.path||"/";i.push({name:be,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${q}`,line:I+1,endLine:I+1,doc:dt,capabilities:JSON.stringify({type:"route",handler:s?`${s}@${q}`:q,...pt})}),t.push({type:"api_route",name:be,direction:"consume",line:I+1,snippet:A})}i.push({name:q,kind:W?"MethodDeclaration":"FunctionDeclaration",classification:W?"Method":"Function",signature:`${W?s+":: ":""}${q}`,line:I+1,endLine:I+1,doc:dt,capabilities:JSON.stringify({attributes:d})}),d=[],m=[];continue}let te=A.match(E);if(te){let q=te[1]||"",W=te[2]||q.split("\\").pop()||"";i.push({name:W,kind:"ImportSpecifier",classification:"Dependency",signature:`use ${q}`,line:I+1,endLine:I+1,doc:"",capabilities:JSON.stringify({type:"use",namespace:q})}),d=[],m=[];continue}let ae=A.match(R);if(ae){let q=ae[1].toUpperCase(),W=ae[2];if(A.includes("Route::")||A.includes("router->")||A.includes("action")||A.includes(",")&&!A.includes("view(")){if(h){let $t=h.startsWith("/")?h:`/${h}`,aa=W.startsWith("/")?W:`/${W}`;W=($t+aa).replace(/\/+/g,"/")}let pt=null,dt=A.match(/\[\s*([a-zA-Z0-9_]+)::class\s*,\s*['"]([^'"]+)['"]\s*\]/);if(dt)pt=`${dt[1]}@${dt[2]}`;else if(A.includes("::class")){let $t=A.match(/([a-zA-Z0-9_]+)::class/);$t&&(pt=$t[1])}let be=A;!A.endsWith(");")&&I+1<o.length&&(be+=" "+o[I+1].trim(),!be.endsWith(");")&&I+2<o.length&&(be+=" "+o[I+2].trim())),i.push({name:W,kind:"HTTP Route",classification:"Service Boundary",signature:be,line:I+1,endLine:I+1,doc:"",capabilities:JSON.stringify({type:"route",method:q,path:W,handler:pt})}),t.push({type:"api_route",name:W,direction:"consume",line:I+1,snippet:be,method:q,url:W}),m=[];continue}}let de=/(?:\$client|client|Http)::(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)|(?:\$client|client)->(request|get|post|put|delete|patch)\s*\(\s*([^,)]+)/,se=A.match(de);if(se){let q=(se[1]||se[3]).toUpperCase(),W=(se[2]||se[4]).trim();(W.startsWith("'")&&W.endsWith("'")||W.startsWith('"')&&W.endsWith('"'))&&(W=W.substring(1,W.length-1)),t.push({type:"api_route",name:W,direction:"produce",line:I+1,snippet:A,method:q,url:W})}!A.startsWith("#[")&&!A.startsWith("//")&&!A.startsWith("*")&&!f&&(d=[],m=[])}return{nodes:i,events:t}}};var Bs=class{currentRoutePrefix="";parse(e){this.currentRoutePrefix="";let r=[],i=[],t=e.split(`
593
- `),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 y=v.decorators.map(S=>p(S.raw)),w={decorators:v.decorators,decoratorNames:y};return v.async===!0&&(w.async=!0),JSON.stringify(w)}let m=!1,f="",h=[],_=[];for(let v=0;v<t.length;v++){let y=t[v],w=y.trim();if(!w||w.startsWith("#"))continue;let S=/^([a-zA-Z0-9_]+)\s*=\s*(?:APIRouter|Blueprint)\s*\(\s*(?:prefix\s*=\s*)?['"]([^'"]+)['"]/,$=w.match(S);if($&&(this.currentRoutePrefix=$[2]),m){if(w.endsWith(f)||w.includes(f)){m=!1;let F=w.replace(f,"").trim();F&&h.push(F);let M=o[o.length-1];M.node&&(M.node.doc=h.join(`
594
- `).trim()),h=[]}else h.push(w);continue}let E=y.search(/\S/),T=y.trim(),R=T.match(/^(['"]{3})/);if(R){let F=R[1],M=o[o.length-1];if(M.node&&!M.node.doc){if(T.substring(3).includes(F)){let ue=T.replace(new RegExp(F,"g"),"").trim();M.node.doc=ue}else{m=!0,f=F;let ue=T.substring(3).trim();ue&&h.push(ue)}continue}}for(;o.length>1&&o[o.length-1].indent>=E;)o.pop();let U=o[o.length-1],I=T.match(u);if(I){s.push({raw:I[1].trim(),line:v+1});continue}let A=T.match(a);if(A){let F=A[1],M={name:F,kind:"ClassDeclaration",classification:"Class",signature:`class ${F}`,line:v+1,endLine:v+1,doc:"",capabilities:d({decorators:s}),members:[]};_.push(M),U.node?(U.node.members||(U.node.members=[]),U.node.members.push(M)):r.push(M),o.push({indent:E,name:F,type:"class",node:M}),s=[];continue}let Z=T.match(c);if(Z){let F=!!Z[1],M=Z[1]||Z[2],ue=U.type==="class",V=!1,te={};for(let W of s)if(W.raw.match(/(?:app|router)\.(get|post|put|delete|patch)/)){V=!0;let pt=["get","post","put","delete","patch"].find($t=>W.raw.toLowerCase().includes(`.${$t}`))?.toUpperCase()||"GET",dt=W.raw.match(/['"]([^'"]+)['"]/),be=dt?dt[1]:"/";if(this.currentRoutePrefix){let $t=this.currentRoutePrefix.endsWith("/")?this.currentRoutePrefix.slice(0,-1):this.currentRoutePrefix,aa=be.startsWith("/")?be:`/${be}`;be=$t+aa}te={type:"route",method:pt,path:be}}if(V){let W=te.path||"",Ee={name:W||M,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${M}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({handler:ue?`${U.name}.${M}`:M,async:F,...te})};_.push(Ee),r.push(Ee),i.push({type:"api_route",name:W,direction:"consume",line:v+1,snippet:T})}let ae=s.some(W=>W.raw==="staticmethod"),de=s.some(W=>W.raw==="classmethod"),se=`${F?"async ":""}${ue?(ae?"@staticmethod ":de?"@classmethod ":"")+U.name+".":""}${M}`,q={name:M,kind:F&&ue?"AsyncMethodDeclaration":F?"AsyncFunctionDeclaration":ue?"MethodDeclaration":"FunctionDeclaration",classification:ue?ae||de?"Static Method":"Method":"Function",signature:se,line:v+1,endLine:v+1,doc:"",capabilities:d({decorators:s,async:F}),members:[]};_.push(q),U.node?(U.node.members||(U.node.members=[]),U.node.members.push(q)):r.push(q),o.push({indent:E,name:M,type:"function",node:q}),s=[];continue}let J=/^(?:path|re_path|url)\s*\(\s*['"]([^'"]+)['"]/,O=T.match(J);if(O){let F=O[1].replace(/^\^/,""),M={name:F,kind:"HTTP Route",classification:"Service Boundary",signature:T.trim(),line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"route",method:"GET",path:F})};_.push(M),r.push(M),i.push({type:"api_route",name:F,direction:"consume",line:v+1,snippet:T});continue}let P=/(?:requests|httpx|client|http)\.(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)/,H=T.match(P);if(H){let F=H[1].toUpperCase(),M=H[2].trim();(M.startsWith("'")&&M.endsWith("'")||M.startsWith('"')&&M.endsWith('"'))&&(M=M.substring(1,M.length-1)),i.push({type:"api_route",name:M,direction:"produce",line:v+1,snippet:T,method:F,url:M})}let G=T.match(l);if(G){let F=G[1]||G[2],M={name:F,kind:"ImportSpecifier",classification:"Dependency",signature:`import ${F}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"import",module:F})};_.push(M),r.push(M),s=[];continue}s=[],U.node&&(U.node.endLine=v+1)}return{nodes:_,events:i}}};var Iv=[{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 _$(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 Ws;pythonParser=new Bs;treeSitterParser=new Hs;supports(e){return Iv.some(r=>r.extension.includes(e.toLowerCase()))}async parse(e,r){let i=jd.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=_$(i,t),d=ii({classification:c,capabilities:p,exports:l.map(m=>({name:m.name,kind:m.kind,classification:m.classification})),fileName:jd.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=Iv.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(`
595
- `).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=ii({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(c=>({name:c.name,kind:c.kind,classification:c.classification})),fileName:jd.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:a||"Module",parseStatus:t.length>0?"success":"partial"}}};B();var Ud=new Js;async function oi(n){let e=Rv.extname(n);if(Ud.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=await Tv.promises.readFile(n,"utf-8");return{...await Ud.parse(n,o),content:o}}catch(o){return b.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:o.message}}let r;try{r=await Tv.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=hv(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=Md.parseSync(i,c)}catch{a=Md.parseSync(i,{...c,isModule:!1})}else a=Md.parseSync(i,c);let l=a.span.start,u=gv(r),p=vv(i),d=S=>yv(S,l,r),m=bv(a.body),f=$v(a.body);f.length>0&&b.debug({filePath:n,count:f.length},"Extracted type references"),f.forEach(S=>{m.push({module:"__type_reference__",name:S})});let h=xv(a.body,l,r,i,t,p,n,d,u),_=Sv(a.body,l,r,t,d,u),v=Zs(n,"","Module"),y=p.length>0&&p[0].start===0?p[0].text:h.find(S=>S.doc)?.doc||"",w=_v(y);if(!w&&h.length>0){let S=ri(i);w=ii({classification:v,capabilities:S,exports:h.map($=>({name:$.name,kind:$.kind,classification:$.classification})),fileName:Rv.basename(n)})}return{exports:h,imports:m,events:_,classification:v,summary:w,content:i,parseStatus:"success"}}catch(o){b.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=await Ud.parse(n,i);return{...s,content:i,classification:s.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${o.message}`}}catch(s){return b.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 Gs from"path";var b$=50;function si(n,e,r,i){let t={name:Gs.basename(e)||e,type:"directory",path:e,children:[]};return n.forEach(o=>{let a=Gs.relative(e,o.path).split(Gs.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=Gs.join(e,...a.slice(0,l+1)),f=c.children?.find(h=>h.name===u);if(!f){if(c.children&&c.children.length>=b$){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}B();import Zd from"p-limit";Lt();import Hd from"path";import G$ from"fs";import V$ from"os";import Xe from"path";import ir from"fs";import{loadConfig as $$,createMatchPath as w$}from"tsconfig-paths";import Ut from"path";import ai from"fs";var Ft=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function Pv(n){let e;try{e=ai.statSync(n).isDirectory()?n:Ut.dirname(n)}catch(r){throw r.code==="ENOENT"?new Ft("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Ft("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Ft("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Ut.dirname(e);){let r=Ut.join(e,"tsconfig.json");if(ai.existsSync(r))return e;e=Ut.dirname(e)}return null}function Nv(n){let e;try{e=ai.statSync(n).isDirectory()?n:Ut.dirname(n)}catch(r){throw r.code==="ENOENT"?new Ft("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Ft("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Ft("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Ut.dirname(e);){let r=Ut.join(e,"package.json");if(ai.existsSync(r))try{if(JSON.parse(ai.readFileSync(r,"utf8")).workspaces)return e}catch{}e=Ut.dirname(e)}return null}import tr from"path";import mn from"fs";function zv(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=tr.join(n,o);if(!mn.existsSync(s))continue;let a=mn.readdirSync(s);for(let c of a){let l=tr.join(s,c,"package.json");if(mn.existsSync(l))try{let u=JSON.parse(mn.readFileSync(l,"utf8"));u.name&&r.set(u.name,{name:u.name,path:tr.dirname(l),main:u.main||"dist/index.js"})}catch{}}}return r}function Dv(n){let e=new Map;try{let r=JSON.parse(mn.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=tr.dirname(n),c=tr.resolve(a,s),l=tr.join(c,"package.json");if(mn.existsSync(l))try{let u=JSON.parse(mn.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import Av from"path";import Ye from"fs";var x$=[".ts",".tsx",".d.ts",".js",".jsx"];function Be(n){let e=Av.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(Ye.existsSync(o)&&Ye.statSync(o).isFile())return o}if(Ye.existsSync(n)&&Ye.statSync(n).isFile())return n}if(Ye.existsSync(n)&&Ye.statSync(n).isFile())return n;for(let r of x$){let i=n+r;if(Ye.existsSync(i)&&Ye.statSync(i).isFile())return i}if(Ye.existsSync(n)&&Ye.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=Av.join(n,"index"+r);if(Ye.existsSync(i))return i}return""}import nr from"path";import S$ from"fs";function Vs(n,e,r){if(n.startsWith(".")){let t=nr.dirname(e),o=nr.resolve(t,n),s=Be(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=rr(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=Be(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=nr.resolve(i.baseUrl,n),s=Be(o);if(s)return{resolved:!0,resolvedPath:s}}let t=i.workspacePackages.get(n);if(t){let o=nr.join(t.path,"src/index.ts");if(S$.existsSync(o))return{resolved:!0,resolvedPath:o};let s=nr.join(t.path,t.main),a=Be(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 ${nr.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 qs=new Map;function rr(n){let e=Pv(n);if(!e)return null;if(qs.has(e))return qs.get(e)||null;let r=$$(e);if(r.resultType==="failed")return qs.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?Xe.dirname(i.configFileAbsolutePath):e);let o=w$(t,i.paths,i.mainFields,i.addMatchAll),s=Nv(e),a=new Map;if(s){let p=Xe.join(s,"package.json");if(ir.existsSync(p))try{let d=JSON.parse(ir.readFileSync(p,"utf8"));a=zv(s,d)}catch{}}let c=Xe.join(e,"package.json");ir.existsSync(c)&&Dv(c).forEach((d,m)=>a.set(m,d));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=Xe.join(e,"package.json");if(ir.existsSync(u))try{let p=JSON.parse(ir.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 qs.set(e,l),l}function Zt(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=Zt(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=Xe.dirname(e),o=Xe.resolve(t,n);return Be(o)}let i=rr(e);if(i){let t=i.matchPath(n);if(t)return Be(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=Xe.resolve(i.baseUrl,n),a=Be(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=Xe.resolve(i.baseUrl,d);return Be(m)}}else if(s===n){let c=Xe.resolve(i.baseUrl,a);return Be(c)}let o=i.workspacePackages.get(n);if(o){let s=Xe.join(o.path,"src/index.ts");if(ir.existsSync(s))return s;let a=Xe.join(o.path,o.main),c=Be(a);if(c)return c}}return""}import k$ from"fs";import E$ from"path";import Ov from"js-yaml";function Lv(n){let e=E$.basename(n),r=k$.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return{...P$(r,n),content:r};if(e.endsWith(".graphql")||e.endsWith(".gql"))return{...N$(r,n),content:r};let t="Configuration";return e==="lerna.json"?{...D$(r,n),content:r}:e==="turbo.json"?{...A$(r,n),content:r}:e==="pnpm-workspace.yaml"?{...L$(r,n),content:r}:(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",I$(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",T$(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",R$(r,i)):e==="package.json"&&(t="Project Manifest",z$(r,i)),{configs:i,classification:t,content:r})}function I$(n,e){let r=n.split(`
596
- `);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 T$(n,e){try{let r=Ov.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 if(a!=null){let l=String(a);if(l==="[object Object]"||l.includes("[object Object]"))continue;let u="Env",p=/^[a-z0-9_-]+$/i.test(l),d=l.includes("://");s.toLowerCase().includes("service")&&(p||d)&&(u="Service"),s.toLowerCase().includes("image")&&(u="Image"),s.toLowerCase().includes("port")&&(u="Port"),(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&d&&(u="Service"),e.push({key:c,value:l.length>200?l.substring(0,197)+"...":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 R$(n,e){let r=n.split(`
597
- `);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",l=a.includes("://");(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&l&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function P$(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 N$(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 z$(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:"Env"}),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:"Dependency"})}}catch{}}function D$(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 A$(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 L$(n,e){let r=[],i="Monorepo (pnpm) ";try{let t=Ov.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}}B();import Cv from"fs";import O$ from"path";import jv from"js-yaml";var Mv={ignore:[],include:[],maxDepth:10},C$=[{name:".liquid-shadow.yaml",parse:n=>jv.load(n)??{}},{name:".liquid-shadow.yml",parse:n=>jv.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 Ks(n){for(let{name:e,parse:r}of C$){let i=O$.join(n,e);if(Cv.existsSync(i))try{let t=Cv.readFileSync(i,"utf8"),o=r(t);return b.debug({repoPath:n,configFile:e},"Loaded repository configuration"),{...Mv,...o}}catch(t){b.error({repoPath:n,file:e,err:t},"Failed to parse configuration file")}}return Mv}Q();vt();B();Kr();import{Worker as j$}from"node:worker_threads";import{cpus as M$}from"node:os";import{fileURLToPath as U$}from"node:url";import{dirname as F$,join as Z$}from"node:path";import{existsSync as H$}from"node:fs";var Uv=U$(import.meta.url),W$=F$(Uv),B$=Uv.endsWith(".ts");function J$(){if(B$)return null;let n=Z$(W$,"worker.js");return H$(n)?n:Ct("dist/logic/parser/worker.js")}var Fd=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,M$().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{b.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,b.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=J$();if(!e)throw new Error("Parser worker pool not available in development mode (tsx). Use main-thread fallback.");b.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 j$(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),b.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),b.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=>{b.error({err:u},"Failed to replace crashed parser worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&b.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}b.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,b.info("Parser worker pool shutdown complete")}},or=null;function Fv(n){return or||(or=new Fd(n)),or}async function Zv(){or&&(await or.shutdown(),or=null)}Q();B();_t();Id();Td();Rd();import{execSync as Hv}from"child_process";var Ys=b.child({module:"heritage-analyzer"}),fn=class{repos;repoPath;constructor(e){this.repos=C.getInstance(e),this.repoPath=e}analyzeHeritage(e=20){try{Ys.info({limit:e},"Analyzing repository heritage...");let r=Hv(`git log -n ${e} --pretty=format:"%H|%at|%an|%s"`,{cwd:this.repoPath,encoding:"utf-8"});if(!r)return;let i=r.split(`
598
- `).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),Ys.debug({sha:o,subject:c},"Logged heritage move")}}Ys.info("Heritage analysis complete.")}catch(r){Ys.warn({err:r.message},"Failed to run heritage analysis")}}analyzeCommitImpact(e){let r=new Set,i=0;try{let o=Hv(`git diff-tree --no-commit-id --name-only -r ${e}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
599
- `).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 Pd.some(i=>i.test(r))?"Test":Ts.some(i=>i.test(r))||Is.some(i=>i.test(r))?"Entry":ei.some(i=>i.test(r))?"Data":Ps.some(i=>i.test(r))?"Utility":Ns.some(i=>i.test(r))?"Entry":zs.some(i=>i.test(r))?"Data":Ds.some(i=>i.test(r))?"Entry":As.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)||Rs.some(i=>i.test(r))?"Logic":"Unknown"}};var q$=V$.cpus().length||4,K$=rs.DEFAULT_CONCURRENCY;async function ee(n,e=K$,r=!1,i=!0,t){let o=C.getInstance(n),s=o.files.database,a=Ks(n),c=a.concurrency??e;if(ev(),!r&&qe(n)){let v=dd(n),y=Fe(n);if(v&&!vd(n,v))return js(),b.debug({repoPath:n,commit:y},"Index is current, skipping re-index (fast-path)"),s}rr(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 Od(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($=>{let E=u.get($.path);return!E||E.mtime!==$.mtime}),y=Zd(c*4),w=v.map($=>y(async()=>{let E=u.get($.path);if(!E||!E.hash)return $;try{let T=await G$.promises.readFile($.path,"utf8");return pd(T,E.hash)?$:(o.files.updateMtime($.path,$.mtime),null)}catch{return null}})),S=await Promise.all(w);_.push(...S.filter($=>$!==null))}if(f.length===0&&_.length===0){js();let v=Fe(n);return cs(n,v||void 0),s}if(h?b.info({totalFiles:d.length},"Starting initial repository indexing..."):b.info({toDelete:f.length,toProcess:_.length},"Syncing repository updates..."),f.length>0&&o.files.deletePaths(f),_.length>0){nv(),i?(an(!0),on().initialize().catch(()=>{})):an(!1);let v=/\.(ts|tsx|php|py|go|js|jsx|mjs|cjs)$/,y=[],w=[];for(let P of _)v.test(Hd.basename(P.path))?y.push(P):w.push(P);let S=0,$=_.length,E=!1,T=Fv();try{await T.initialize(),E=!0,b.info({workers:T.workerCount},"Parser worker pool active")}catch(P){b.warn({err:P},"Parser worker pool failed to initialize, falling back to main-thread parsing"),E=!1}let R=(P,H)=>{let G=H.imports?.map(M=>({...M,resolved_path:Zt(M.module,P.path,n)})),F=H.content?nn(H.content):null;return S++,(S%50===0||S===$)&&b.info({completed:S,total:$},"Parsing files..."),t?.({phase:"parse",current:S,total:$,message:`Parsing ${Hd.basename(P.path)}`}),{meta:P,...H,imports:G,embedding:null,kind:"code",contentHash:F}},U;if(E)U=y.map(P=>T.parseFile(P.path).then(H=>R(P,H),H=>(S++,b.error({path:P.path,error:H},"Worker parse failed"),{meta:P,exports:[],imports:[],content:"",kind:"error"})));else{let P=h?Math.max(c,Math.min(q$-1,16)):c,H=Zd(P);U=y.map(G=>H(async()=>{try{let F=await oi(G.path);return R(G,F)}catch(F){return S++,b.error({path:G.path,error:F},"Failed to parse file"),{meta:G,exports:[],imports:[],content:"",kind:"error"}}}))}let I=Zd(c),A=w.map(P=>I(async()=>{try{let H=Lv(P.path),G=H.content?nn(H.content):null;return S++,(S%50===0||S===$)&&b.info({completed:S,total:$},"Parsing configs..."),t?.({phase:"parse",current:S,total:$,message:`Parsing config ${Hd.basename(P.path)}`}),{meta:P,...H,embedding:null,kind:"config",contentHash:G}}catch(H){return S++,b.error({path:P.path,error:H},"Failed to parse config"),{meta:P,exports:[],imports:[],content:"",kind:"error"}}}));b.info({total:$,codeFiles:y.length,configFiles:w.length,useParserPool:E},"Phase 1: Parsing all files...");let Z=Date.now(),J=(await Promise.all([...U,...A])).filter(Boolean),O=Date.now()-Z;if(ti("parse",O),b.info({count:J.length,time:`${(O/1e3).toFixed(1)}s`},"Phase 1 complete"),E&&Zv().catch(()=>{}),s.pragma("synchronous = NORMAL"),s.pragma("cache_size = -64000"),i){let P=[];J.forEach((ae,de)=>{"summary"in ae&&ae.summary&&P.push({fileIdx:de,text:ae.summary})}),b.info("Phase 2+3: Generating embeddings + persisting in parallel..."),t?.({phase:"embed",current:0,total:J.length,message:"Generating embeddings..."});let H=Date.now(),G=(async()=>{if(P.length>0){b.info({count:P.length}," \u2192 Generating file summary embeddings...");let ae=P.map(se=>se.text),de=await hs(ae,256);return b.info({count:P.length}," \u2713 File summaries complete"),de}return[]})();t?.({phase:"persist",current:0,total:J.length,message:"Saving to database..."});let F=Date.now();o.files.batchSaveIndexResults(J,n,nn,Zt);let M=Date.now()-F;ti("persist",M),b.info({time:`${(M/1e3).toFixed(1)}s`},"Structural persist complete");let ue=await G,V=Date.now()-H;if(ti("embed",V),b.info({time:`${(V/1e3).toFixed(1)}s`},"Embeddings complete"),ue.length>0){let ae=s.prepare("UPDATE files SET embedding = ? WHERE path = ?"),de=s.transaction(q=>{for(let W of q)ae.run(W.embedding?JSON.stringify(W.embedding):null,W.path)}),se=P.map((q,W)=>({path:J[q.fileIdx].meta.path,embedding:ue[W]}));de(se),b.info({count:se.length},"Embedding column updated")}let te=await o.intentLogs.backfillEmbeddings(64);te>0&&b.info({count:te}," \u2713 Intent log embeddings backfilled")}else{t?.({phase:"persist",current:0,total:J.length,message:"Saving to database..."});let P=Date.now();o.files.batchSaveIndexResults(J,n,nn,Zt),ti("persist",Date.now()-P)}s.pragma("synchronous = FULL"),s.pragma("cache_size = -2000")}if(h||_.length>0){let v=Fe(n);cs(n,v||void 0)}if((_.length>0||f.length>0)&&new ke(n).detectAndRepairShifts(),h||i)try{new fn(n).analyzeHeritage(50)}catch(v){b.warn({err:v.message},"Heritage sync deferred")}return tv(Date.now()-p),t?.({phase:"complete",current:_.length,total:_.length,message:"Indexing complete"}),s}B();import Wv from"path";import Y$ from"ignore";import Bv from"fs";Q();async function Wd(n,e=rs.DEFAULT_CONCURRENCY,r="detailed",i,t){b.info({repo:n,level:r,subPath:i},"Ensuring cache is up-to-date..."),await ee(n,e);let{files:o,exports:s,imports:a}=C.getInstance(n),c=i?o.findInSubPath(n,i):o.findAll(),l=Ks(n),u=Y$(),p=Wv.join(n,".gitignore");if(Bv.existsSync(p)&&u.add(Bv.readFileSync(p,"utf8")),l.ignore&&l.ignore.length>0&&u.add(l.ignore),u.add(ns),c=c.filter(y=>{let w=Wv.relative(n,y.path);return!u.ignores(w)}),b.info({count:c.length},"Fetching data from DB..."),r==="lite"){let y=c.map(w=>({path:w.path,mtime:w.mtime}));return si(y,n,r,t)}if(r==="summaries"){let y=c.map(w=>({path:w.path,mtime:w.mtime,classification:w.classification||void 0,summary:w.summary||void 0}));return si(y,n,r,t)}let d=c.map(y=>y.path),m=s.findByFiles(d),f=r==="detailed"?a.findByFiles(d):[],h=new Map;for(let y of m){let w=h.get(y.file_path)||[];w.push(y),h.set(y.file_path,w)}let _=new Map;for(let y of f){let w=_.get(y.file_path)||[];w.push(y),_.set(y.file_path,w)}let v=c.map(y=>{let S=(h.get(y.path)||[]).map(E=>({name:E.name,kind:E.kind,signature:E.signature,line:E.start_line}));r==="structure"?S=S.map(E=>({name:E.name,kind:E.kind,line:E.line})):r==="signatures"&&(S=S.map(E=>({name:E.name,kind:E.kind,signature:E.signature,line:E.line})));let $=[];return r==="detailed"&&($=(_.get(y.path)||[]).map(T=>({module:T.module_specifier,resolved_path:T.resolved_path}))),{path:y.path,mtime:y.mtime,classification:y.classification||void 0,summary:y.summary||void 0,exports:S,imports:$.length>0?$:void 0,chunks:[]}});return b.info({count:v.length},"Building hierarchical project tree..."),si(v,n,r,t)}vt();Q();Q();var ci=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(`
600
- `),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(`
601
- `).trim();return a>0&&(p=`...
602
- `+p),a+l<o.length&&(p=p+`
603
- ...`),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}};vt();Q();B();var Ht=b.child({module:"clean-sweep"}),Bd=class{files;intentLogs;constructor(e){let{files:r,intentLogs:i}=C.getInstance(e);this.files=r,this.intentLogs=i}pruneOrphans(){Ht.info("Starting orphan pruning...");let e=0,r=0,i=this.intentLogs.findOrphans();Ht.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++,Ht.debug({logId:s.id,symbolName:s.symbol_name},"Converted to lapsed intent")):(this.intentLogs.delete(s.id),e++,Ht.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 Ht.info({deleted:e,converted:r},"Orphan pruning complete"),{deleted:e,converted:r,retained:o}}},Xs=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)}))}},Jd=class{missions;constructor(e){let{missions:r}=C.getInstance(e);this.missions=r}findColdMissions(){let e=Math.floor(Date.now()/1e3)-604800,r=this.missions.findColdMissions(e,10);return Ht.info({count:r.length},"Found cold missions for compaction"),r}markDistilled(e){this.missions.update(e,{status:"distilled"})}},hn=class{pruner;scorer;compactor;constructor(e){this.pruner=new Bd(e),this.scorer=new Xs,this.compactor=new Jd(e)}runMaintenance(){Ht.info("Initiating Clean Sweep maintenance protocol...");let e=this.pruner.pruneOrphans(),r=this.compactor.findColdMissions();return Ht.info("Clean Sweep maintenance complete"),{pruning:e,compaction:{eligible:r.length}}}getScorer(){return this.scorer}getCompactor(){return this.compactor}};Q();B();var Jv=b.child({module:"lineage-service"}),li=class{repoPath;constructor(e){this.repoPath=e}getAncestorMissionIds(e=50){try{let r=gd(this.repoPath,e);if(r.length===0)return[];let{missions:i}=C.getInstance(this.repoPath),o=i.findByCommitShas(r).map(s=>s.id);return o.length>0&&Jv.debug({count:o.length},"Identified ancestor missions for gravity bleed"),o}catch(r){return Jv.warn({err:r.message},"Failed to identify ancestor missions"),[]}}};var X$={Solid:1,Liquid:.8,Virtual:.4,Intel:.2,Phantom:.05},Qe=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 X$[i]}};B();function Q$(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 ew(n,e){let r=Q$(n.toLowerCase(),e.toLowerCase()),i=Math.max(n.length,e.length);return Math.round((i-r)/i*100)}function Gv(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 tw(n,e){let r=Gv(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 nw(n,e){return Gv(e).map(t=>t[0].toLowerCase()).join("")===n.toLowerCase()}function rw(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 nw(n,e)?{matchType:"acronym",score:75}:tw(n,e)?{matchType:"camel-case",score:65}:{matchType:"levenshtein",score:ew(n,e)*.6}}function sr(n,e,r=50,i=5){let t=[];for(let o of e){let{matchType:s,score:a}=rw(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)}Oe();var Je=class n{constructor(e){this.repoPath=e}get filesRepo(){return C.getInstance(this.repoPath).files}get exportsRepo(){return C.getInstance(this.repoPath).exports}get intentLogsRepo(){return C.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?Qe.mapClassificationToTier(t):Qe.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?Pe.FILTERED_QUERY_LIMIT_MULTIPLIER:1),ye.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}".
604
-
605
- If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};if(s){let d=new ce(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,y=_.classification?Qe.mapClassificationToTier(_.classification):Qe.classify(_.path);return{..._,gravity:v,layer:y}});return f.sort((_,v)=>v.gravity-_.gravity),{content:[{type:"text",text:`# Resolved paths: "${e}" (Ranked by Gravity)
606
-
607
- ${f.length} file(s):
608
-
609
- `+f.map((_,v)=>{let y=_.gravity>50?" \u269B\uFE0F":_.gravity>0?" \u2022":"",w=_.gravity>0?` [G:${Math.round(_.gravity)}]`:"";return`${v+1}. \`${l(_.path)}\` (${_.layer})${y}${w}`}).join(`
602
+ `;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=Mv.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(`
603
+ `),a=this.getQueries(i);if(!a)return[];let l=new hn.Query(t,a).matches(o.rootNode),u=[];for(let d of l){let p=d.captures.find(h=>h.name==="name")?.node,f=d.captures[0].node,m=d.captures[0].name;if(p){let h=f.startPosition.row+1,_=f.endPosition.row+1,v=s[f.startPosition.row].trim();u.push({name:p.text,kind:this.mapKind(m,i),classification:this.mapClassification(m),signature:v,line:h,endLine:_,doc:"",capabilities:"{}"})}}return u}};var Ys=class{parse(e,r=!1){let i=[],t=[],o=e.split(`
604
+ `),s="",a="",c=0,l=0,u=-1,d=-1,p=[],f=[],m=!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_]+)/,x=/^trait\s+([a-zA-Z0-9_]+)/,k=/^(?:public|protected|private|static|\s)*function\s+([a-zA-Z0-9_]+)\s*\(/,S=/^use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/,P=/^#\[([a-zA-Z0-9_\\]+)(?:\((.*)\))?\]/,R=/(?:Route::|router->|\$router->|->)(get|post|put|delete|patch|match)\s*\(\s*(?:uri\s*:\s*)?['"]([^'"]+)['"]/,U=/->prefix\s*\(\s*(?:prefix\s*:\s*)?['"]([^'"]+)['"]/;for(let E=0;E<o.length;E++){let I=o[E].trim();if(!I)continue;let N=(I.match(/{/g)||[]).length,j=(I.match(/}/g)||[]).length,D=l;if(l+=N-j,a&&l<=d){let q=i.find(B=>B.name===a&&B.line===c);q&&(q.endLine=E+1),a="",d=-1}if(s&&l<=u){let q=i.find(B=>B.name===s&&(B.kind==="ClassDeclaration"||B.kind==="TraitDeclaration"||B.kind==="InterfaceDeclaration"));q&&(q.endLine=E+1),s="",u=-1}let z=I.match(U);if(z&&(h=z[1]),I.includes("});")&&(h=""),I.startsWith("/**")){m=!0,f=[];continue}if(m){I.endsWith("*/")?m=!1:f.push(I.replace(/^\*\s?/,""));continue}let H=I.match(P);if(H){p.push(H[1]);continue}let G=I.match(v);if(G){_=G[1]||"",p=[],f=[];continue}let W=I.match(g);if(W){s=W[1],u=l-N;let q={attributes:p};_&&(q.namespace=_),i.push({name:s,kind:"ClassDeclaration",classification:"Class",signature:`class ${s}`,line:E+1,endLine:E+1,doc:f.join(`
605
+ `).trim(),capabilities:JSON.stringify(q),members:[]}),p=[],f=[];continue}let Z=I.match(b);if(Z){let q=Z[1];s=q,u=l-N,i.push({name:q,kind:"InterfaceDeclaration",classification:"Interface",signature:`interface ${q}`,line:E+1,endLine:E+1,doc:f.join(`
606
+ `).trim(),capabilities:JSON.stringify({attributes:p}),members:[]}),p=[],f=[];continue}let Y=I.match(x);if(Y){let q=Y[1];s=q,u=l-N,i.push({name:q,kind:"TraitDeclaration",classification:"Trait",signature:`trait ${q}`,line:E+1,endLine:E+1,doc:f.join(`
607
+ `).trim(),capabilities:JSON.stringify({attributes:p}),members:[]}),p=[],f=[];continue}let J=I.match(k);if(J){let q=J[1],B=!!s;a=q,c=E+1,d=l-N;let Se=!1,_e={};for(let xe of p)xe.toLowerCase().includes("route")&&(Se=!0,_e={type:"route",method:"GET",path:"/"});let Ne=f.join(`
608
+ `).trim();if(Se){let xe=_e.path||"/";i.push({name:xe,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${q}`,line:E+1,endLine:E+1,doc:Ne,capabilities:JSON.stringify({type:"route",handler:s?`${s}@${q}`:q,..._e})}),t.push({type:"api_route",name:xe,direction:"consume",line:E+1,snippet:I})}i.push({name:q,kind:B?"MethodDeclaration":"FunctionDeclaration",classification:B?"Method":"Function",signature:`${B?s+":: ":""}${q}`,line:E+1,endLine:E+1,doc:Ne,capabilities:JSON.stringify({attributes:p})}),p=[],f=[];continue}let te=I.match(S);if(te){let q=te[1]||"",B=te[2]||q.split("\\").pop()||"";i.push({name:B,kind:"ImportSpecifier",classification:"Dependency",signature:`use ${q}`,line:E+1,endLine:E+1,doc:"",capabilities:JSON.stringify({type:"use",namespace:q})}),p=[],f=[];continue}let ae=I.match(R);if(ae){let q=ae[1].toUpperCase(),B=ae[2];if(I.includes("Route::")||I.includes("router->")||I.includes("action")||I.includes(",")&&!I.includes("view(")){if(h){let ge=h.startsWith("/")?h:`/${h}`,_r=B.startsWith("/")?B:`/${B}`;B=(ge+_r).replace(/\/+/g,"/")}let _e=null,Ne=I.match(/\[\s*([a-zA-Z0-9_]+)::class\s*,\s*['"]([^'"]+)['"]\s*\]/);if(Ne)_e=`${Ne[1]}@${Ne[2]}`;else if(I.includes("::class")){let ge=I.match(/([a-zA-Z0-9_]+)::class/);ge&&(_e=ge[1])}let xe=I;!I.endsWith(");")&&E+1<o.length&&(xe+=" "+o[E+1].trim(),!xe.endsWith(");")&&E+2<o.length&&(xe+=" "+o[E+2].trim())),i.push({name:B,kind:"HTTP Route",classification:"Service Boundary",signature:xe,line:E+1,endLine:E+1,doc:"",capabilities:JSON.stringify({type:"route",method:q,path:B,handler:_e})}),t.push({type:"api_route",name:B,direction:"consume",line:E+1,snippet:xe,method:q,url:B}),f=[];continue}}let le=/(?:\$client|client|Http)::(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)|(?:\$client|client)->(request|get|post|put|delete|patch)\s*\(\s*([^,)]+)/,ie=I.match(le);if(ie){let q=(ie[1]||ie[3]).toUpperCase(),B=(ie[2]||ie[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:E+1,snippet:I,method:q,url:B})}!I.startsWith("#[")&&!I.startsWith("//")&&!I.startsWith("*")&&!m&&(p=[],f=[])}return{nodes:i,events:t}}};var Xs=class{currentRoutePrefix="";parse(e){this.currentRoutePrefix="";let r=[],i=[],t=e.split(`
609
+ `),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 d(v){return v.trim().split(/[.(]/)[0]?.trim()||v}function p(v){let g=v.decorators.map(x=>d(x.raw)),b={decorators:v.decorators,decoratorNames:g};return v.async===!0&&(b.async=!0),JSON.stringify(b)}let f=!1,m="",h=[],_=[];for(let v=0;v<t.length;v++){let g=t[v],b=g.trim();if(!b||b.startsWith("#"))continue;let x=/^([a-zA-Z0-9_]+)\s*=\s*(?:APIRouter|Blueprint)\s*\(\s*(?:prefix\s*=\s*)?['"]([^'"]+)['"]/,k=b.match(x);if(k&&(this.currentRoutePrefix=k[2]),f){if(b.endsWith(m)||b.includes(m)){f=!1;let W=b.replace(m,"").trim();W&&h.push(W);let Z=o[o.length-1];Z.node&&(Z.node.doc=h.join(`
610
+ `).trim()),h=[]}else h.push(b);continue}let S=g.search(/\S/),P=g.trim(),R=P.match(/^(['"]{3})/);if(R){let W=R[1],Z=o[o.length-1];if(Z.node&&!Z.node.doc){if(P.substring(3).includes(W)){let Y=P.replace(new RegExp(W,"g"),"").trim();Z.node.doc=Y}else{f=!0,m=W;let Y=P.substring(3).trim();Y&&h.push(Y)}continue}}for(;o.length>1&&o[o.length-1].indent>=S;)o.pop();let U=o[o.length-1],E=P.match(u);if(E){s.push({raw:E[1].trim(),line:v+1});continue}let I=P.match(a);if(I){let W=I[1],Z={name:W,kind:"ClassDeclaration",classification:"Class",signature:`class ${W}`,line:v+1,endLine:v+1,doc:"",capabilities:p({decorators:s}),members:[]};_.push(Z),U.node?(U.node.members||(U.node.members=[]),U.node.members.push(Z)):r.push(Z),o.push({indent:S,name:W,type:"class",node:Z}),s=[];continue}let N=P.match(c);if(N){let W=!!N[1],Z=N[1]||N[2],Y=U.type==="class",J=!1,te={};for(let B of s)if(B.raw.match(/(?:app|router)\.(get|post|put|delete|patch)/)){J=!0;let _e=["get","post","put","delete","patch"].find(ge=>B.raw.toLowerCase().includes(`.${ge}`))?.toUpperCase()||"GET",Ne=B.raw.match(/['"]([^'"]+)['"]/),xe=Ne?Ne[1]:"/";if(this.currentRoutePrefix){let ge=this.currentRoutePrefix.endsWith("/")?this.currentRoutePrefix.slice(0,-1):this.currentRoutePrefix,_r=xe.startsWith("/")?xe:`/${xe}`;xe=ge+_r}te={type:"route",method:_e,path:xe}}if(J){let B=te.path||"",Se={name:B||Z,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${Z}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({handler:Y?`${U.name}.${Z}`:Z,async:W,...te})};_.push(Se),r.push(Se),i.push({type:"api_route",name:B,direction:"consume",line:v+1,snippet:P})}let ae=s.some(B=>B.raw==="staticmethod"),le=s.some(B=>B.raw==="classmethod"),ie=`${W?"async ":""}${Y?(ae?"@staticmethod ":le?"@classmethod ":"")+U.name+".":""}${Z}`,q={name:Z,kind:W&&Y?"AsyncMethodDeclaration":W?"AsyncFunctionDeclaration":Y?"MethodDeclaration":"FunctionDeclaration",classification:Y?ae||le?"Static Method":"Method":"Function",signature:ie,line:v+1,endLine:v+1,doc:"",capabilities:p({decorators:s,async:W}),members:[]};_.push(q),U.node?(U.node.members||(U.node.members=[]),U.node.members.push(q)):r.push(q),o.push({indent:S,name:Z,type:"function",node:q}),s=[];continue}let j=/^(?:path|re_path|url)\s*\(\s*['"]([^'"]+)['"]/,D=P.match(j);if(D){let W=D[1].replace(/^\^/,""),Z={name:W,kind:"HTTP Route",classification:"Service Boundary",signature:P.trim(),line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"route",method:"GET",path:W})};_.push(Z),r.push(Z),i.push({type:"api_route",name:W,direction:"consume",line:v+1,snippet:P});continue}let z=/(?:requests|httpx|client|http)\.(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)/,H=P.match(z);if(H){let W=H[1].toUpperCase(),Z=H[2].trim();(Z.startsWith("'")&&Z.endsWith("'")||Z.startsWith('"')&&Z.endsWith('"'))&&(Z=Z.substring(1,Z.length-1)),i.push({type:"api_route",name:Z,direction:"produce",line:v+1,snippet:P,method:W,url:Z})}let G=P.match(l);if(G){let W=G[1]||G[2],Z={name:W,kind:"ImportSpecifier",classification:"Dependency",signature:`import ${W}`,line:v+1,endLine:v+1,doc:"",capabilities:JSON.stringify({type:"import",module:W})};_.push(Z),r.push(Z),s=[];continue}s=[],U.node&&(U.node.endLine=v+1)}return{nodes:_,events:i}}};function J$(n,e){let r=0,i=!1;for(let t=e;t<n.length;t++){let o=n[t];for(let s of o)if(s==="{")r++,i=!0;else if(s==="}"&&(r--,i&&r<=0))return t+1;if(!i&&t>e&&/[;}]$/.test(o.trim()))return t+1}return Math.min(n.length,e+41)}var jv=[{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 V$(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 Qs=class{phpParser=new Ys;pythonParser=new Xs;treeSitterParser=new Ks;supports(e){return jv.some(r=>r.extension.includes(e.toLowerCase()))}async parse(e,r){let i=Bd.extname(e).toLowerCase(),t=[],o=[];if(i===".php"||i===".py"||i===".go"||i===".rs"){if(i===".py"){let l=this.pythonParser.parse(r);t=l.nodes,o=l.events}else if(i===".php"){let l=e.toLowerCase().endsWith("api.php"),u=this.phpParser.parse(r,l);t=u.nodes,o=u.events}else try{t=await this.treeSitterParser.parse(e,r)}catch{}if(t.length>0){let l=i===".php"?"Micro IR (PHP/TS) ":i===".py"?"Micro IR (Python/TS) ":i===".go"?"Micro IR (Go/TS) ":"Micro IR (Rust/TS) ",u=t.filter(m=>m.classification!=="Dependency"),d=t.filter(m=>m.classification==="Dependency"),p=V$(i,t),f=pi({classification:l,capabilities:p,exports:u.map(m=>({name:m.name,kind:m.kind,classification:m.classification})),fileName:Bd.basename(e)});return{exports:u,imports:d.map(m=>({module:m.name,name:m.name,kind:m.kind,classification:m.classification})),events:o,classification:l,summary:f||`${i.substring(1).toUpperCase()} module`,parseStatus:"success"}}}let s=jv.find(l=>l.extension.includes(i));if(!s)return{exports:[],imports:[],classification:"Unknown",summary:"",parseStatus:"failed",parseError:`Unsupported file extension: ${i}`};let a=r.split(`
611
+ `);for(let l of s.rules){l.regex.lastIndex=0;let u;for(;(u=l.regex.exec(r))!==null;){let d=l.onMatch(u),p=r.substring(0,u.index).split(`
612
+ `).length,f=J$(a,p-1);t.push({name:d.name||"anonymous",kind:d.kind||"Unknown",classification:d.classification||"Other",signature:d.signature||u[0],line:p,endLine:f,doc:"",capabilities:JSON.stringify(d.meta||{})})}}let c=pi({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(l=>({name:l.name,kind:l.kind,classification:l.classification})),fileName:Bd.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:c||"Module",parseStatus:t.length>0?"success":"partial"}}};V();import*as Gd from"@swc/core";function Uv(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.parse=="function"&&typeof e.parseSync=="function"}function q$(){if(Uv(Gd))return Gd;let n=Gd;if(Uv(n.default))return n.default;throw new Error("SWC runtime unavailable: couldn't resolve parse/parseSync from @swc/core exports")}var Fv=q$();function di(n,e,r){return Fv.parse(n,e,r)}function ea(n,e,r){return Fv.parseSync(n,e,r)}var Jd=new Qs;async function or(n){let e=Hv.extname(n);if(Jd.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=await Zv.promises.readFile(n,"utf-8");return{...await Jd.parse(n,o),content:o}}catch(o){return $.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:o.message}}let r;try{r=await Zv.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=Iv(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=ea(i,c)}catch{a=ea(i,{...c,isModule:!1})}else a=ea(i,c);let l=a.span.start,u=Tv(r),d=Pv(i),p=k=>Rv(k,l,r),f=zv(a.body),m=Lv(a.body);m.length>0&&$.debug({filePath:n,count:m.length},"Extracted type references"),m.forEach(k=>{f.push({module:"__type_reference__",name:k})});let h=Dv(a.body,l,r,i,t,d,n,p,u),_=Av(a.body,l,r,t,p,u),v=qs(n,"","Module"),b=d.length>0&&i.slice(0,d[0].start).trim().length===0?d[0].text:h.find(k=>k.doc)?.doc||"",x=Nv(b);if(!x&&h.length>0){let k=ui(i);x=pi({classification:v,capabilities:k,exports:h.map(S=>({name:S.name,kind:S.kind,classification:S.classification})),fileName:Hv.basename(n)})}return{exports:h,imports:f,events:_,classification:v,summary:x,content:i,parseStatus:"success"}}catch(o){$.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=await Jd.parse(n,i);return{...s,content:i,classification:s.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:"",content:i,parseStatus:"failed",parseError:`All parsing strategies failed: ${s.message}`}}}}import ta from"path";var K$=50;function mi(n,e,r,i){let t={name:ta.basename(e)||e,type:"directory",path:e,children:[]};return n.forEach(o=>{let a=ta.relative(e,o.path).split(ta.sep),c=t;for(let l=0;l<a.length;l++){let u=a[l];if(i!==void 0&&l>=i)return;let d=l===a.length-1;if(i===1&&l===0&&d)return;let p=i!==void 0&&l===i-1&&!d,f=ta.join(e,...a.slice(0,l+1)),m=c.children?.find(h=>h.name===u);if(!m){if(c.children&&c.children.length>=K$){c.children.find(v=>v.type==="truncated")||c.children.push({name:"... (truncated) ",type:"truncated",path:"",children:void 0});return}m={name:u,type:d?"file":"directory",path:f,children:d||p?void 0:[],summary:d?{classification:o.classification,summaryText:o.summary,exports:o.exports,imports:o.imports,chunks:o.chunks}:void 0},m.summary&&(r==="structure"||r==="signatures")&&(delete m.summary.chunks,delete m.summary.imports),c.children?.push(m)}c=m}}),t}V();import qd from"p-limit";Ot();import Kd from"path";import $w from"fs";import ww from"os";import rt from"path";import lr from"fs";import{loadConfig as Q$,createMatchPath as ew}from"tsconfig-paths";import Zt from"path";import fi from"fs";var Ht=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function Wv(n){let e;try{e=fi.statSync(n).isDirectory()?n:Zt.dirname(n)}catch(r){throw r.code==="ENOENT"?new Ht("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Ht("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Ht("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Zt.dirname(e);){let r=Zt.join(e,"tsconfig.json");if(fi.existsSync(r))return e;e=Zt.dirname(e)}return null}function Bv(n){let e;try{e=fi.statSync(n).isDirectory()?n:Zt.dirname(n)}catch(r){throw r.code==="ENOENT"?new Ht("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Ht("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Ht("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Zt.dirname(e);){let r=Zt.join(e,"package.json");if(fi.existsSync(r))try{if(JSON.parse(fi.readFileSync(r,"utf8")).workspaces)return e}catch{}e=Zt.dirname(e)}return null}import sr from"path";import gn from"fs";function Gv(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=sr.join(n,o);if(!gn.existsSync(s))continue;let a=gn.readdirSync(s);for(let c of a){let l=sr.join(s,c,"package.json");if(gn.existsSync(l))try{let u=JSON.parse(gn.readFileSync(l,"utf8"));u.name&&r.set(u.name,{name:u.name,path:sr.dirname(l),main:u.main||"dist/index.js"})}catch{}}}return r}function Jv(n){let e=new Map;try{let r=JSON.parse(gn.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=sr.dirname(n),c=sr.resolve(a,s),l=sr.join(c,"package.json");if(gn.existsSync(l))try{let u=JSON.parse(gn.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import Vv from"path";import nt from"fs";var Y$=[".ts",".tsx",".d.ts",".js",".jsx"];function Ke(n){let e=Vv.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(nt.existsSync(o)&&nt.statSync(o).isFile())return o}if(nt.existsSync(n)&&nt.statSync(n).isFile())return n}if(nt.existsSync(n)&&nt.statSync(n).isFile())return n;for(let r of Y$){let i=n+r;if(nt.existsSync(i)&&nt.statSync(i).isFile())return i}if(nt.existsSync(n)&&nt.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=Vv.join(n,"index"+r);if(nt.existsSync(i))return i}return""}import ar from"path";import X$ from"fs";function na(n,e,r){if(n.startsWith(".")){let t=ar.dirname(e),o=ar.resolve(t,n),s=Ke(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=cr(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=Ke(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=ar.resolve(i.baseUrl,n),s=Ke(o);if(s)return{resolved:!0,resolvedPath:s}}let t=i.workspacePackages.get(n);if(t){let o=ar.join(t.path,"src/index.ts");if(X$.existsSync(o))return{resolved:!0,resolvedPath:o};let s=ar.join(t.path,t.main),a=Ke(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 ${ar.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 ra=new Map;function cr(n){let e=Wv(n);if(!e)return null;if(ra.has(e))return ra.get(e)||null;let r=Q$(e);if(r.resultType==="failed")return ra.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?rt.dirname(i.configFileAbsolutePath):e);let o=ew(t,i.paths,i.mainFields,i.addMatchAll),s=Bv(e),a=new Map;if(s){let d=rt.join(s,"package.json");if(lr.existsSync(d))try{let p=JSON.parse(lr.readFileSync(d,"utf8"));a=Gv(s,p)}catch{}}let c=rt.join(e,"package.json");lr.existsSync(c)&&Jv(c).forEach((p,f)=>a.set(f,p));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=rt.join(e,"package.json");if(lr.existsSync(u))try{let d=JSON.parse(lr.readFileSync(u,"utf8"));if(d.imports){for(let[p,f]of Object.entries(d.imports))if(typeof f=="string"||typeof f=="object"&&f!==null){let m=f;Array.isArray(f)&&(m=f[0]),typeof m=="object"&&(m=m.default||m.node),typeof m=="string"&&l.imports.set(p,m)}}}catch{}return ra.set(e,l),l}function Wt(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=Wt(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=rt.dirname(e),o=rt.resolve(t,n);return Ke(o)}let i=cr(e);if(i){let t=i.matchPath(n);if(t)return Ke(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=rt.resolve(i.baseUrl,n),a=Ke(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 d=u[1],p=a.replace("*",d),f=rt.resolve(i.baseUrl,p);return Ke(f)}}else if(s===n){let c=rt.resolve(i.baseUrl,a);return Ke(c)}let o=i.workspacePackages.get(n);if(o){let s=rt.join(o.path,"src/index.ts");if(lr.existsSync(s))return s;let a=rt.join(o.path,o.main),c=Ke(a);if(c)return c}}return""}import tw from"fs";import nw from"path";import Kv from"js-yaml";function qv(n){let e=nw.basename(n),r=tw.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return{...sw(r,n),content:r};if(e.endsWith(".graphql")||e.endsWith(".gql"))return{...aw(r,n),content:r};let t="Configuration";return e==="lerna.json"?{...lw(r,n),content:r}:e==="turbo.json"?{...uw(r,n),content:r}:e==="pnpm-workspace.yaml"?{...pw(r,n),content:r}:(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",rw(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",iw(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",ow(r,i)):e==="package.json"&&(t="Project Manifest",cw(r,i)),{configs:i,classification:t,content:r})}function rw(n,e){let r=n.split(`
613
+ `);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 iw(n,e){try{let r=Kv.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 if(a!=null){let l=String(a);if(l==="[object Object]"||l.includes("[object Object]"))continue;let u="Env",d=/^[a-z0-9_-]+$/i.test(l),p=l.includes("://");s.toLowerCase().includes("service")&&(d||p)&&(u="Service"),s.toLowerCase().includes("image")&&(u="Image"),s.toLowerCase().includes("port")&&(u="Port"),(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&p&&(u="Service"),e.push({key:c,value:l.length>200?l.substring(0,197)+"...":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 ow(n,e){let r=n.split(`
614
+ `);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",l=a.includes("://");(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&l&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function sw(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 aw(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 cw(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:"Env"}),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:"Dependency"})}}catch{}}function lw(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 uw(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 pw(n,e){let r=[],i="Monorepo (pnpm) ";try{let t=Kv.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}}V();import Yv from"fs";import dw from"path";import Xv from"js-yaml";var Qv={ignore:[],include:[],maxDepth:10},mw=[{name:".liquid-shadow.yaml",parse:n=>Xv.load(n)??{}},{name:".liquid-shadow.yml",parse:n=>Xv.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 ia(n){for(let{name:e,parse:r}of mw){let i=dw.join(n,e);if(Yv.existsSync(i))try{let t=Yv.readFileSync(i,"utf8"),o=r(t);return $.debug({repoPath:n,configFile:e},"Loaded repository configuration"),{...Qv,...o}}catch(t){$.error({repoPath:n,file:e,err:t},"Failed to parse configuration file")}}return Qv}ee();bt();V();ni();import{Worker as fw}from"node:worker_threads";import{cpus as hw}from"node:os";import{fileURLToPath as gw}from"node:url";import{dirname as yw,join as vw}from"node:path";import{existsSync as _w}from"node:fs";var e_=gw(import.meta.url),bw=yw(e_),xw=e_.endsWith(".ts");function Sw(){if(xw)return null;let n=vw(bw,"worker.js");return _w(n)?n:Mt("dist/logic/parser/worker.js")}var Vd=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,hw().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{$.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,$.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=Sw();if(!e)throw new Error("Parser worker pool not available in development mode (tsx). Use main-thread fallback.");$.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 fw(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),$.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),$.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=>{$.error({err:u},"Failed to replace crashed parser worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&$.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}$.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,$.info("Parser worker pool shutdown complete")}},ur=null;function t_(n){return ur||(ur=new Vd(n)),ur}async function n_(){ur&&(await ur.shutdown(),ur=null)}ee();V();pt();Ad();Ld();Od();import{execSync as r_}from"child_process";var oa=$.child({module:"heritage-analyzer"}),yn=class{repos;repoPath;constructor(e){this.repos=M.getInstance(e),this.repoPath=e}analyzeHeritage(e=20){try{oa.info({limit:e},"Analyzing repository heritage...");let r=r_(`git log -n ${e} --pretty=format:"%H|%at|%an|%s"`,{cwd:this.repoPath,encoding:"utf-8"});if(!r)return;let i=r.split(`
615
+ `).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(", "),d=`Heritage: ${c} (by ${a}). Touched ${l.fileCount} files across [${u}].`;this.repos.intentLogs.importHeritage(d,o,parseInt(s,10),.7),oa.debug({sha:o,subject:c},"Logged heritage move")}}oa.info("Heritage analysis complete.")}catch(r){oa.warn({err:r.message},"Failed to run heritage analysis")}}analyzeCommitImpact(e){let r=new Set,i=0;try{let o=r_(`git diff-tree --no-commit-id --name-only -r ${e}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
616
+ `).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 Cd.some(i=>i.test(r))?"Test":Ls.some(i=>i.test(r))||As.some(i=>i.test(r))?"Entry":ai.some(i=>i.test(r))?"Data":Cs.some(i=>i.test(r))?"Utility":Ms.some(i=>i.test(r))?"Entry":js.some(i=>i.test(r))?"Data":Us.some(i=>i.test(r))?"Entry":Fs.some(i=>i.test(r))?"Data":Md.some(i=>i.test(r))?"Infrastructure":/\.(service|logic|usecase|interactor|manager)\.(ts|js|php|py)$/i.test(r)||Os.some(i=>i.test(r))?"Logic":"Unknown"}};var kw=ww.cpus().length||4,Ew=cs.DEFAULT_CONCURRENCY;function s_(n,e=[]){if(!Array.isArray(n))return e;for(let r of n)!r||typeof r!="object"||(e.push(r),Array.isArray(r.members)&&r.members.length>0&&s_(r.members,e));return e}function i_(n){if(typeof n!="number"||!Number.isFinite(n))return null;let e=Math.trunc(n);return e>0?e:null}function a_(n){let e=typeof n?.content=="string"&&n.content.length>0?n.content.split(`
617
+ `).length:0,r=s_(n?.exports),i=0,t=0,o=0,s=0;for(let a of r){let c=i_(a?.line??a?.start_line),l=i_(a?.endLine??a?.end_line??c);if(!c||!l||l<c||e>0&&l>e){t++;continue}i++,l>c&&s++,e>0&&c===e&&l===e&&o++}return{total:r.length,valid:i,invalid:t,eofCollapsed:o,multiLine:s,lineCount:e}}function Iw(n){let e=a_(n);if(e.total===0||e.lineCount===0)return!1;if(e.invalid>0)return!0;let r=e.eofCollapsed/e.total;return e.eofCollapsed>=3&&r>=.5||e.total>=2&&e.eofCollapsed===e.total}function o_(n){let e=a_(n);return e.valid*2+e.multiLine*2-e.eofCollapsed*3-e.invalid*4}async function ne(n,e=Ew,r=!1,i=!0,t){let o=M.getInstance(n),s=o.files.database,a=ia(n),c=a.concurrency??e;if(dv(),!r&&et(n)){let v=_d(n),g=Be(n);if(v&&!kd(n,v))return Bs(),$.debug({repoPath:n,commit:g},"Index is current, skipping re-index (fast-path)"),s}cr(n);let l=o.files.findAll(),u=new Map(l.map(v=>[v.path,{mtime:v.mtime,hash:v.content_hash}])),d=Date.now();t?.({phase:"scan",current:0,total:0,message:"Scanning repository..."});let p=await Hd(n,a.ignore),f=new Map(p.map(v=>[v.path,v.mtime])),m=l.filter(v=>!f.has(v.path)).map(v=>v.path),h=l.length===0,_=[];if(r||h)_.push(...p);else{let v=p.filter(k=>{let S=u.get(k.path);return!S||S.mtime!==k.mtime}),g=qd(c*4),b=v.map(k=>g(async()=>{let S=u.get(k.path);if(!S||!S.hash)return k;try{let P=await $w.promises.readFile(k.path,"utf8");return vd(P,S.hash)?k:(o.files.updateMtime(k.path,k.mtime),null)}catch{return null}})),x=await Promise.all(b);_.push(...x.filter(k=>k!==null))}if(m.length===0&&_.length===0){Bs();let v=Be(n);return fs(n,v||void 0),s}if(h?$.info({totalFiles:p.length},"Starting initial repository indexing..."):$.info({toDelete:m.length,toProcess:_.length},"Syncing repository updates..."),m.length>0&&o.files.deletePaths(m),_.length>0){fv(),i?(un(!0),cn().initialize().catch(()=>{})):un(!1);let v=/\.(ts|tsx|php|py|go|js|jsx|mjs|cjs)$/,g=[],b=[];for(let z of _)v.test(Kd.basename(z.path))?g.push(z):b.push(z);let x=0,k=_.length,S=!1,P=t_();try{await P.initialize(),S=!0,$.info({workers:P.workerCount},"Parser worker pool active")}catch(z){$.warn({err:z},"Parser worker pool failed to initialize, falling back to main-thread parsing"),S=!1}let R=async(z,H)=>{let G=H;if(S&&Iw(H))try{let Y=await or(z.path);o_(Y)>o_(H)&&($.warn({filePath:z.path},"Detected suspicious worker parse ranges; using main-thread parse output"),G=Y)}catch(Y){$.warn({filePath:z.path,err:Y instanceof Error?Y.message:String(Y)},"Main-thread parse retry failed after suspicious worker parse")}let W=G.imports?.map(Y=>({...Y,resolved_path:Wt(Y.module,z.path,n)})),Z=G.content?sn(G.content):null;return x++,(x%50===0||x===k)&&$.info({completed:x,total:k},"Parsing files..."),t?.({phase:"parse",current:x,total:k,message:`Parsing ${Kd.basename(z.path)}`}),{meta:z,...G,imports:W,embedding:null,kind:"code",contentHash:Z}},U;if(S)U=g.map(z=>P.parseFile(z.path).then(H=>R(z,H),H=>(x++,$.error({path:z.path,error:H},"Worker parse failed"),{meta:z,exports:[],imports:[],content:"",kind:"error"})));else{let z=h?Math.max(c,Math.min(kw-1,16)):c,H=qd(z);U=g.map(G=>H(async()=>{try{let W=await or(G.path);return R(G,W)}catch(W){return x++,$.error({path:G.path,error:W},"Failed to parse file"),{meta:G,exports:[],imports:[],content:"",kind:"error"}}}))}let E=qd(c),I=b.map(z=>E(async()=>{try{let H=qv(z.path),G=H.content?sn(H.content):null;return x++,(x%50===0||x===k)&&$.info({completed:x,total:k},"Parsing configs..."),t?.({phase:"parse",current:x,total:k,message:`Parsing config ${Kd.basename(z.path)}`}),{meta:z,...H,embedding:null,kind:"config",contentHash:G}}catch(H){return x++,$.error({path:z.path,error:H},"Failed to parse config"),{meta:z,exports:[],imports:[],content:"",kind:"error"}}}));$.info({total:k,codeFiles:g.length,configFiles:b.length,useParserPool:S},"Phase 1: Parsing all files...");let N=Date.now(),j=(await Promise.all([...U,...I])).filter(Boolean),D=Date.now()-N;if(ci("parse",D),$.info({count:j.length,time:`${(D/1e3).toFixed(1)}s`},"Phase 1 complete"),S&&n_().catch(()=>{}),s.pragma("synchronous = NORMAL"),s.pragma("cache_size = -64000"),i){let z=[];j.forEach((ae,le)=>{"summary"in ae&&ae.summary&&z.push({fileIdx:le,text:ae.summary})}),$.info("Phase 2+3: Generating embeddings + persisting in parallel..."),t?.({phase:"embed",current:0,total:j.length,message:"Generating embeddings..."});let H=Date.now(),G=(async()=>{if(z.length>0){$.info({count:z.length}," \u2192 Generating file summary embeddings...");let ae=z.map(ie=>ie.text),le=await Ss(ae,256);return $.info({count:z.length}," \u2713 File summaries complete"),le}return[]})();t?.({phase:"persist",current:0,total:j.length,message:"Saving to database..."});let W=Date.now();o.files.batchSaveIndexResults(j,n,sn,Wt);let Z=Date.now()-W;ci("persist",Z),$.info({time:`${(Z/1e3).toFixed(1)}s`},"Structural persist complete");let Y=await G,J=Date.now()-H;if(ci("embed",J),$.info({time:`${(J/1e3).toFixed(1)}s`},"Embeddings complete"),Y.length>0){let ae=s.prepare("UPDATE files SET embedding = ? WHERE path = ?"),le=s.transaction(q=>{for(let B of q)ae.run(B.embedding?JSON.stringify(B.embedding):null,B.path)}),ie=z.map((q,B)=>({path:j[q.fileIdx].meta.path,embedding:Y[B]}));le(ie),$.info({count:ie.length},"Embedding column updated")}let te=await o.intentLogs.backfillEmbeddings(64);te>0&&$.info({count:te}," \u2713 Intent log embeddings backfilled")}else{t?.({phase:"persist",current:0,total:j.length,message:"Saving to database..."});let z=Date.now();o.files.batchSaveIndexResults(j,n,sn,Wt),ci("persist",Date.now()-z)}s.pragma("synchronous = FULL"),s.pragma("cache_size = -2000")}if(h||_.length>0){let v=Be(n);fs(n,v||void 0)}if((_.length>0||m.length>0)&&new Pe(n).detectAndRepairShifts(),h||i)try{new yn(n).analyzeHeritage(50)}catch(v){$.warn({err:v.message},"Heritage sync deferred")}return mv(Date.now()-d),t?.({phase:"complete",current:_.length,total:_.length,message:"Indexing complete"}),s}V();import c_ from"path";import Tw from"ignore";import l_ from"fs";ee();async function Yd(n,e=cs.DEFAULT_CONCURRENCY,r="detailed",i,t){$.info({repo:n,level:r,subPath:i},"Ensuring cache is up-to-date..."),await ne(n,e);let{files:o,exports:s,imports:a}=M.getInstance(n),c=i?o.findInSubPath(n,i):o.findAll(),l=ia(n),u=Tw(),d=c_.join(n,".gitignore");if(l_.existsSync(d)&&u.add(l_.readFileSync(d,"utf8")),l.ignore&&l.ignore.length>0&&u.add(l.ignore),u.add(as),c=c.filter(g=>{let b=c_.relative(n,g.path);return!u.ignores(b)}),$.info({count:c.length},"Fetching data from DB..."),r==="lite"){let g=c.map(b=>({path:b.path,mtime:b.mtime}));return mi(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 mi(g,n,r,t)}let p=c.map(g=>g.path),f=s.findByFiles(p),m=r==="detailed"?a.findByFiles(p):[],h=new Map;for(let g of f){let b=h.get(g.file_path)||[];b.push(g),h.set(g.file_path,b)}let _=new Map;for(let g of m){let b=_.get(g.file_path)||[];b.push(g),_.set(g.file_path,b)}let v=c.map(g=>{let x=(h.get(g.path)||[]).map(S=>({name:S.name,kind:S.kind,signature:S.signature,line:S.start_line}));r==="structure"?x=x.map(S=>({name:S.name,kind:S.kind,line:S.line})):r==="signatures"&&(x=x.map(S=>({name:S.name,kind:S.kind,signature:S.signature,line:S.line})));let k=[];return r==="detailed"&&(k=(_.get(g.path)||[]).map(P=>({module:P.module_specifier,resolved_path:P.resolved_path}))),{path:g.path,mtime:g.mtime,classification:g.classification||void 0,summary:g.summary||void 0,exports:x,imports:k.length>0?k:void 0,chunks:[]}});return $.info({count:v.length},"Building hierarchical project tree..."),mi(v,n,r,t)}bt();ee();ee();var vn=class n{static extractKeywords(e){if(!e)return[];let r=new Set(["the","and","for","with","from","this","that","into","onto","http","https","www","com","org","net","api"]),t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>2&&!r.has(o));return Array.from(new Set(t))}static calculateKeywordCoverageFromKeywords(e,r){if(!e||!r||r.length===0)return 0;let i=e.toLowerCase();return r.filter(o=>i.includes(o)).length/r.length}static calculateKeywordCoverage(e,r){return n.calculateKeywordCoverageFromKeywords(e,n.extractKeywords(r))}static extractSnippet(e,r,i=300){if(!e||!r)return"";let t=n.extractKeywords(r);if(t.length===0)return e.slice(0,i)+"...";let o=e.split(`
618
+ `),s=new Array(o.length).fill(0);for(let p=0;p<o.length;p++){let f=o[p].toLowerCase(),m=0,h=0;for(let _ of t)f.includes(_)&&(m++,h++);(f.includes("export ")||f.includes("class ")||f.includes("function ")||f.includes("interface "))&&(m+=1),s[p]=h*10+m}let a=0,c=-1,l=5;for(let p=0;p<=o.length-l;p++){let f=0;for(let m=0;m<l;m++)f+=s[p+m];f>c&&(c=f,a=p)}if(c<=0)return e.slice(0,i).trim()+"...";let d=o.slice(a,a+l).join(`
619
+ `).trim();return a>0&&(d=`...
620
+ `+d),a+l<o.length&&(d=d+`
621
+ ...`),d.length>i?d.slice(0,i)+"...":d}static calculateLexicalScore(e,r){if(!e||!r)return 0;let i=n.extractKeywords(r);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}};bt();ee();V();var Bt=$.child({module:"clean-sweep"}),Xd=class{files;intentLogs;constructor(e){let{files:r,intentLogs:i}=M.getInstance(e);this.files=r,this.intentLogs=i}pruneOrphans(){Bt.info("Starting orphan pruning...");let e=0,r=0,i=this.intentLogs.findOrphans();Bt.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++,Bt.debug({logId:s.id,symbolName:s.symbol_name},"Converted to lapsed intent")):(this.intentLogs.delete(s.id),e++,Bt.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 Bt.info({deleted:e,converted:r},"Orphan pruning complete"),{deleted:e,converted:r,retained:o}}},sa=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)}))}},Qd=class{missions;constructor(e){let{missions:r}=M.getInstance(e);this.missions=r}findColdMissions(){let e=Math.floor(Date.now()/1e3)-604800,r=this.missions.findColdMissions(e,10);return Bt.info({count:r.length},"Found cold missions for compaction"),r}markDistilled(e){this.missions.update(e,{status:"distilled"})}},_n=class{pruner;scorer;compactor;constructor(e){this.pruner=new Xd(e),this.scorer=new sa,this.compactor=new Qd(e)}runMaintenance(){Bt.info("Initiating Clean Sweep maintenance protocol...");let e=this.pruner.pruneOrphans(),r=this.compactor.findColdMissions();return Bt.info("Clean Sweep maintenance complete"),{pruning:e,compaction:{eligible:r.length}}}getScorer(){return this.scorer}getCompactor(){return this.compactor}};ee();V();var u_=$.child({module:"lineage-service"}),hi=class{repoPath;constructor(e){this.repoPath=e}getAncestorMissionIds(e=50){try{let r=$d(this.repoPath,e);if(r.length===0)return[];let{missions:i}=M.getInstance(this.repoPath),o=i.findByCommitShas(r).map(s=>s.id);return o.length>0&&u_.debug({count:o.length},"Identified ancestor missions for gravity bleed"),o}catch(r){return u_.warn({err:r.message},"Failed to identify ancestor missions"),[]}}};var Rw={Solid:1,Liquid:.8,Virtual:.4,Intel:.2,Phantom:.05},it=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 Rw[i]}};V();function Pw(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 Nw(n,e){let r=Pw(n.toLowerCase(),e.toLowerCase()),i=Math.max(n.length,e.length);return Math.round((i-r)/i*100)}function p_(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 zw(n,e){let r=p_(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 Dw(n,e){return p_(e).map(t=>t[0].toLowerCase()).join("")===n.toLowerCase()}function Aw(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 Dw(n,e)?{matchType:"acronym",score:75}:zw(n,e)?{matchType:"camel-case",score:65}:{matchType:"levenshtein",score:Nw(n,e)*.6}}function pr(n,e,r=50,i=5){let t=[];for(let o of e){let{matchType:s,score:a}=Aw(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)}Ue();var Ye=class n{constructor(e){this.repoPath=e}get filesRepo(){return M.getInstance(this.repoPath).files}get exportsRepo(){return M.getInstance(this.repoPath).exports}get intentLogsRepo(){return M.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?it.mapClassificationToTier(t):it.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=this.extractPathKeywords(e),c=this.isLikelySymbolQuery(e),l=this.filesRepo.findByPathKeywords(a,Math.min((r??50)*(o?Re.FILTERED_QUERY_LIMIT_MULTIPLIER:1),ue.MAX_LIMIT)).map(g=>({...g,source:"path",keywordHits:this.countPathKeywordHits(g.path,a),relevance:this.scorePathResult(g.path,a,"path",c)}));o&&(l=l.filter(g=>n.matchesFilters(g.path,t,g.mtime,g.classification))),c&&a.length>=3&&(l=l.filter(g=>g.source==="symbol"||g.keywordHits>=2));let u=this.findSymbolBackedPaths(e,a,r*3),d=new Set(l.map(g=>g.path));for(let g of u){if(d.has(g))continue;let b=this.filesRepo.findByPath(g);b&&(o&&!n.matchesFilters(b.path,t,b.mtime,b.classification)||(l.push({...b,source:"symbol",keywordHits:this.countPathKeywordHits(b.path,a),relevance:this.scorePathResult(b.path,a,"symbol",c)}),d.add(g)))}l.sort((g,b)=>b.relevance-g.relevance),o||(l=l.slice(0,Math.min(r*4,ue.MAX_LIMIT)));let p=l.length;if(p===0)return{content:[{type:"text",text:`No indexed files match path/filename: "${e}".
622
+
623
+ If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};let f=g=>g.replace(this.repoPath,"").replace(/^\//,"");if(s){let b=new pe(this.repoPath).getSection("gravity"),x=new Map;if(b?.hotspots)for(let E of b.hotspots){let I=x.get(E.filePath)||0;x.set(E.filePath,I+E.gravity)}let k=l.map(E=>{let I=x.get(E.path)||0,N=E.classification?it.mapClassificationToTier(E.classification):it.classify(E.path);return{...E,gravity:I,layer:N}});k.sort((E,I)=>I.gravity!==E.gravity?I.gravity-E.gravity:I.relevance!==E.relevance?I.relevance-E.relevance:E.path.localeCompare(I.path));let S=k.slice(i,i+r),P=i+r<p;if(S.length===0)return{content:[{type:"text",text:`No results at offset ${i}. Total matches: ${p}.`}]};let R=P?`
624
+ > **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"";return{content:[{type:"text",text:`# Resolved paths: "${e}" (Ranked by Gravity)
625
+
626
+ Showing ${S.length} of ${p} file(s) (offset: ${i}, limit: ${r})${R}
627
+
628
+ `+S.map((E,I)=>{let N=E.gravity>50?" \u269B\uFE0F":E.gravity>0?" \u2022":"",j=E.gravity>0?` [G:${Math.round(E.gravity)}]`:"",D=E.source==="symbol"?" [via symbol]":"";return`${i+I+1}. \`${f(E.path)}\` (${E.layer})${N}${j}${D}`}).join(`
610
629
  `)+`
611
630
 
612
- > **Legend**: \u269B\uFE0F = High-gravity hotspot (>50), \u2022 = Has gravity, G = Gravity score`}]}}return{content:[{type:"text",text:`# Resolved paths: "${e}"
631
+ > **Legend**: \u269B\uFE0F = High-gravity hotspot (>50), \u2022 = Has gravity, G = Gravity score`}]}}let m=l.slice(i,i+r),h=i+r<p;if(m.length===0)return{content:[{type:"text",text:`No results at offset ${i}. Total matches: ${p}.`}]};let _=h?`
632
+ > **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"";return{content:[{type:"text",text:`# Resolved paths: "${e}"
613
633
 
614
- ${c.length} file(s):
634
+ Showing ${m.length} of ${p} file(s) (offset: ${i}, limit: ${r})${_}
615
635
 
616
- `+c.map((p,d)=>`${d+1}. \`${l(p.path)}\`${p.classification?` (${p.classification})`:""}`).join(`
617
- `)}]}}async searchByConcept(e,r,i,t,o,s=!1){b.info({repoPath:this.repoPath,query:e},"Searching by concept (Semantic Analysis)...");let a=await fs(e),c=y=>y.replace(this.repoPath,"").replace(/^\//,"");if(a){let y=await this.findConceptMatches(e,a,t,o,r*2,0),w=await this.findIntentLogMatches(a,5);if(y.length>0||w.length>0){let S=y.length,$=y.slice(i,i+r),T=i+r<S?`
618
- > **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",R=s?`
619
- > _Compact mode: snippets omitted_`:S>20&&!s?"\n> \u{1F4A1} **Tip**: Use `compact: true` to reduce output size (omits snippets).":"",U=`# Semantic Concept Search: "${e}"
636
+ `+m.map((g,b)=>{let x=g.source==="symbol"?" [via symbol]":"";return`${i+b+1}. \`${f(g.path)}\`${g.classification?` (${g.classification})`:""}${x}`}).join(`
637
+ `)}]}}async searchByConcept(e,r,i,t,o,s=!1){$.info({repoPath:this.repoPath,query:e},"Searching by concept (Semantic Analysis)...");let a=await xs(e),c=p=>p.replace(this.repoPath,"").replace(/^\//,""),l=Math.min(Math.max((r+i)*2,r),ue.MAX_LIMIT),u=await this.findConceptMatches(e,a,t,o,l,0),d=a?await this.findIntentLogMatches(a,5):[];if(u.length>0||d.length>0){let p=u.length,f=u.slice(i,i+r),h=i+r<p?`
638
+ > **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",_=s?`
639
+ > _Compact mode: snippets omitted_`:p>20&&!s?"\n> \u{1F4A1} **Tip**: Use `compact: true` to reduce output size (omits snippets).":"",v=`# Semantic Concept Search: "${e}"
620
640
 
621
- Showing ${$.length} of ${S} relevant file(s) (offset: ${i}, limit: ${r})${T}${R}
641
+ Showing ${f.length} of ${p} relevant file(s) (offset: ${i}, limit: ${r})${h}${_}
622
642
 
623
- `,A=new ce(this.repoPath).getSection("gravity"),Z=new Map;if(A?.hotspots)for(let O of A.hotspots)Z.set(O.filePath,O.gravity);let J=s?U+$.map((O,P)=>{let H=c(O.path),G=Math.round((O.decayedScore||0)*100),M=Z.get(O.path)?" \u269B\uFE0F":"";return`${i+P+1}. \`${H}\`${M} (${G}%) - ${O.summary||"No summary"}`}).join(`
624
- `):U+$.map((O,P)=>{let H=c(O.path),G=Math.round((O.decayedScore||0)*100),F=Z.get(O.path),M=F?" \u269B\uFE0F **CORE**":"",ue=F&&F>50?`
625
- > \u26A0\uFE0F **STRATEGIC RISK**: High-gravity hotspot (${F.toFixed(0)}). Modifications may have significant architectural impact.`:"";return`## ${i+P+1}. ${H}${M} (${G}% Match)
626
- > **Rationale**: ${O.rationale}${ue}
643
+ `,b=new pe(this.repoPath).getSection("gravity"),x=new Map;if(b?.hotspots)for(let S of b.hotspots)x.set(S.filePath,S.gravity);let k=s?v+f.map((S,P)=>{let R=c(S.path),U=Math.round((S.score||0)*100),I=x.get(S.path)?" \u269B\uFE0F":"";return`${i+P+1}. \`${R}\`${I} (${U}%) - ${S.summary||"No summary"}`}).join(`
644
+ `):v+f.map((S,P)=>{let R=c(S.path),U=Math.round((S.score||0)*100),E=x.get(S.path),I=E?" \u269B\uFE0F **CORE**":"",N=E&&E>50?`
645
+ > \u26A0\uFE0F **STRATEGIC RISK**: High-gravity hotspot (${E.toFixed(0)}). Modifications may have significant architectural impact.`:"";return`## ${i+P+1}. ${R}${I} (${U}% Match)
646
+ > **Rationale**: ${S.rationale}${N}
627
647
 
628
- `+(O.snippet?`**Matched Snippet**:
648
+ `+(S.snippet?`**Matched Snippet**:
629
649
  \`\`\`typescript
630
- ${O.snippet}
650
+ ${S.snippet}
631
651
  \`\`\`
632
652
 
633
- `:"")+`**Summary**: ${O.summary||"No summary available"}
653
+ `:"")+`**Summary**: ${S.summary||"No summary available"}
634
654
  `}).join(`
635
- `);return w.length>0&&(J+=`
655
+ `);return d.length>0&&(k+=`
636
656
 
637
657
  ---
638
- ## Intent Vectors (${w.length} matching decision(s))
658
+ ## Intent Vectors (${d.length} matching decision(s))
639
659
 
640
- `,J+=w.map((O,P)=>{let H=Math.round((O.score||0)*100),G=O.symbolName?` \`${O.symbolName}\``:"",F=O.missionId?` [Mission #${O.missionId}]`:"",M=O.content.length>200?O.content.slice(0,200)+"...":O.content;return s?`${P+1}. **[${O.type}]**${G}${F} (${H}%) - ${M}`:`### ${P+1}. [${O.type}]${G}${F} (${H}% Match)
641
- > ${M}
660
+ `,k+=d.map((S,P)=>{let R=Math.round((S.score||0)*100),U=S.symbolName?` \`${S.symbolName}\``:"",E=S.missionId?` [Mission #${S.missionId}]`:"",I=S.content.length>200?S.content.slice(0,200)+"...":S.content;return s?`${P+1}. **[${S.type}]**${U}${E} (${R}%) - ${I}`:`### ${P+1}. [${S.type}]${U}${E} (${R}% Match)
661
+ > ${I}
642
662
  `}).join(`
643
- `)),{content:[{type:"text",text:J}]}}}let l=e.replace(/[^\w\s]/g," ").trim(),u=this.filesRepo.findFts(l,(r+i)*(o?Pe.FILTERED_QUERY_LIMIT_MULTIPLIER:1));o&&(u=u.filter(y=>n.matchesFilters(y.path,t,y.mtime,y.classification)));let p=u.slice(i,i+r);if(p.length===0&&i===0){let y=this.filesRepo.getStats(),w=e.toLowerCase().split(/\s+/),S=this.filesRepo.findByPathKeywords(w,r);return o&&(S=S.filter($=>n.matchesFilters($.path,t,$.mtime,$.classification))),S.length>0?{content:[{type:"text",text:`# Concept Search: "${e}"
644
-
645
- \u26A0\uFE0F No semantic matches in file summaries (${y.withSummary}/${y.total} indexed).
663
+ `)),{content:[{type:"text",text:k}]}}if(i===0){let p=this.filesRepo.getStats(),f=e.toLowerCase().split(/\s+/),m=this.filesRepo.findByPathKeywords(f,r);if(o&&(m=m.filter(h=>n.matchesFilters(h.path,t,h.mtime,h.classification))),m.length>0)return{content:[{type:"text",text:`# Concept Search: "${e}"
646
664
 
647
- Found ${S.length} file(s) with matching paths:
665
+ \u26A0\uFE0F No hybrid matches (${p.withSummary}/${p.total} summaries indexed).
648
666
 
649
- `+S.map((E,T)=>`${T+1}. \`${c(E.path)}\` (${E.classification||"Unknown"})`).join(`
650
- `)}]}:{content:[{type:"text",text:`No files found matching concept: "${e}"
667
+ Found ${m.length} file(s) with matching paths:
651
668
 
652
- Summary Stats: ${y.withSummary}/${y.total} summaries.
669
+ `+m.map((_,v)=>`${v+1}. \`${c(_.path)}\` (${_.classification||"Unknown"})`).join(`
670
+ `)}]}}return{content:[{type:"text",text:`No files found matching concept: "${e}"
653
671
 
654
- Try a symbol search: shadow_search_symbol({ query: "${e}", repoPath })`}]}}let d=u.length,f=i+r<d?`
655
- > Use \`offset: ${i+r}\` for more results.`:"",h=s?`
656
- > _Compact mode_`:d>20&&!s?"\n> \u{1F4A1} Use `compact: true` to reduce output size.":"",_=`# Concept Search (FTS Fallback): "${e}"
657
-
658
- Showing ${p.length} of ${d} relevant file(s)${f}${h}
659
-
660
- `;return{content:[{type:"text",text:s?_+p.map((y,w)=>`${i+w+1}. \`${c(y.path)}\``).join(`
661
- `):_+p.map((y,w)=>`## ${i+w+1}. ${c(y.path)}
662
-
663
- **Summary**: ${y.summary||"No summary available"}
664
- `).join(`
665
- `)}]}}async searchBySymbol(e,r,i,t,o,s="any"){let a=e.toLowerCase(),c=I=>I.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 I=this.exportsRepo.getAllNames(5e3),A=e.trim().split(/\s+/).filter(J=>J.length>0);if(A.length>1){let J=new Map;for(let P of A){let H=sr(P,I,40,20);for(let G of H){let F=J.get(G.match);F?(F.terms.push(P),F.bestScore=Math.max(F.bestScore,G.score)):J.set(G.match,{terms:[P],bestScore:G.score})}}let O=Array.from(J.entries()).sort((P,H)=>H[1].terms.length!==P[1].terms.length?H[1].terms.length-P[1].terms.length:H[1].bestScore-P[1].bestScore).slice(0,10);if(O.length>0){let P=O.map(([H,G])=>{let F=G.terms.join(", ");return` \u2022 \`${H}\` (matches: ${F}, ${Math.round(G.bestScore)}%)`}).join(`
672
+ Try a symbol search: shadow_search_symbol({ query: "${e}", repoPath })`}]}}async searchBySymbol(e,r,i,t,o,s="any"){let a=e.toLowerCase(),c=E=>E.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 E=this.exportsRepo.getAllNames(5e3),I=e.trim().split(/\s+/).filter(j=>j.length>0);if(I.length>1){let j=new Map;for(let z of I){let H=pr(z,E,40,20);for(let G of H){let W=j.get(G.match);W?(W.terms.push(z),W.bestScore=Math.max(W.bestScore,G.score)):j.set(G.match,{terms:[z],bestScore:G.score})}}let D=Array.from(j.entries()).sort((z,H)=>H[1].terms.length!==z[1].terms.length?H[1].terms.length-z[1].terms.length:H[1].bestScore-z[1].bestScore).slice(0,10);if(D.length>0){let z=D.map(([H,G])=>{let W=G.terms.join(", ");return` \u2022 \`${H}\` (matches: ${W}, ${Math.round(G.bestScore)}%)`}).join(`
666
673
  `);return{content:[{type:"text",text:`No symbols found matching all terms: "${e}"
667
674
 
668
675
  **Partial matches:**
669
- ${P}
676
+ ${z}
670
677
 
671
- \u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let J=sr(e,I,50,5);if(J.length>0){let O=J.map(P=>` \u2022 \`${P.match}\` (${Math.round(P.score)}% ${P.matchType} match)`).join(`
678
+ \u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let j=pr(e,E,50,5);if(j.length>0){let D=j.map(z=>` \u2022 \`${z.match}\` (${Math.round(z.score)}% ${z.matchType} match)`).join(`
672
679
  `);return{content:[{type:"text",text:`No symbols found matching: "${e}"
673
680
 
674
681
  **Did you mean?**
675
- ${O}
682
+ ${D}
676
683
 
677
684
  \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}"
678
685
 
679
- \u{1F4A1} Try shadow_search_symbol (fuzzy) or shadow_search_concept for semantic search.`}]}}o&&(u=u.filter(I=>{let A=this.filesRepo.findByPath(I.file_path);return n.matchesFilters(I.file_path,t,A?.mtime,A?.classification)}));let p=new li(this.repoPath),d=new ce(this.repoPath),m=p.getAncestorMissionIds(),f=ve(this.repoPath)||void 0,h=this.exportsRepo.getGravityMap(m,f),_=d.getSection("gravity"),v=new Map;if(_?.hotspots)for(let I of _.hotspots)v.set(`${I.filePath}::${I.symbol}`,I.gravity);let y="\u{1F525}",w="\u26A1",S="\u269B\uFE0F",$=u.map((I,A)=>{let Z=h[I.id],J=v.get(`${I.file_path}::${I.name}`),O=this.filesRepo.findByPath(I.file_path),P=Qe.getMultiplier(I.file_path,O?.classification),H=(Pe.SCORE_BASE-A)*P;Z&&(H+=Z.score*Pe.SCORE_BASE),J&&(H+=J*Pe.SCORE_BASE*Pe.GRAVITY_STRUCTURAL_WEIGHT),I.name.toLowerCase()===a&&(H+=Pe.EXACT_MATCH_BONUS*P);let G=O?.mtime;if(G!=null){let M=G>1e10?G/1e3:G,ue=(Date.now()/1e3-M)/sd.SECONDS_PER_DAY;ue<Pe.RECENT_FILE_THRESHOLD_DAYS?H+=Pe.RECENT_FILE_BOOST:ue<Pe.OLDER_FILE_THRESHOLD_DAYS&&(H+=Pe.OLDER_FILE_BOOST)}let F=[];return Z&&F.push(...Z.reasons),J&&F.push(`Structural Hotspot (Gravity: ${J.toFixed(1)})`),{...I,activeGravity:Z,structuralGravity:J,sortScore:H,reasons:F}}).sort((I,A)=>A.sortScore-I.sortScore).slice(i,i+r),E=u.length,T=i+r<E,R=$.map((I,A)=>{let Z=c(I.file_path),J=this.filesRepo.getContent(I.file_path),O="";if(J){let G=J.split(`
680
- `);O=G.slice(Math.max(0,I.start_line-2),Math.min(G.length,I.start_line+3)).join(`
681
- `).trim()}let P=[];I.activeGravity&&(I.activeGravity.reasons.some(G=>G.includes("Working Set"))?P.push(y):I.activeGravity.reasons.some(G=>G.includes("Recent Intent"))&&P.push(w)),I.structuralGravity&&P.push(S);let H=P.length>0?` ${P.join("")}`:"";return{relPath:Z,name:I.name,kind:I.kind,signature:I.signature,line:I.start_line,snippet:O,badgeStr:H,gravityReasons:I.reasons}});return{content:[{type:"text",text:`# Symbol Search Results: "${e}"
686
+ \u{1F4A1} Try shadow_search_symbol (fuzzy) or shadow_search_concept for semantic search.`}]}}o&&(u=u.filter(E=>{let I=this.filesRepo.findByPath(E.file_path);return n.matchesFilters(E.file_path,t,I?.mtime,I?.classification)}));let d=new hi(this.repoPath),p=new pe(this.repoPath),f=d.getAncestorMissionIds(),m=be(this.repoPath)||void 0,h=this.exportsRepo.getGravityMap(f,m),_=p.getSection("gravity"),v=new Map;if(_?.hotspots)for(let E of _.hotspots)v.set(`${E.filePath}::${E.symbol}`,E.gravity);let g="\u{1F525}",b="\u26A1",x="\u269B\uFE0F",k=u.map((E,I)=>{let N=h[E.id],j=v.get(`${E.file_path}::${E.name}`),D=this.filesRepo.findByPath(E.file_path),z=it.getMultiplier(E.file_path,D?.classification),H=(Re.SCORE_BASE-I)*z;N&&(H+=N.score*Re.SCORE_BASE),j&&(H+=j*Re.SCORE_BASE*Re.GRAVITY_STRUCTURAL_WEIGHT),E.name.toLowerCase()===a&&(H+=Re.EXACT_MATCH_BONUS*z);let G=D?.mtime;if(G!=null){let Z=G>1e10?G/1e3:G,Y=(Date.now()/1e3-Z)/fd.SECONDS_PER_DAY;Y<Re.RECENT_FILE_THRESHOLD_DAYS?H+=Re.RECENT_FILE_BOOST:Y<Re.OLDER_FILE_THRESHOLD_DAYS&&(H+=Re.OLDER_FILE_BOOST)}let W=[];return N&&W.push(...N.reasons),j&&W.push(`Structural Hotspot (Gravity: ${j.toFixed(1)})`),{...E,activeGravity:N,structuralGravity:j,sortScore:H,reasons:W}}).sort((E,I)=>I.sortScore-E.sortScore).slice(i,i+r),S=u.length,P=i+r<S,R=k.map((E,I)=>{let N=c(E.file_path),j=this.filesRepo.getContent(E.file_path),D="";if(j){let G=j.split(`
687
+ `);D=G.slice(Math.max(0,E.start_line-2),Math.min(G.length,E.start_line+3)).join(`
688
+ `).trim()}let z=[];E.activeGravity&&(E.activeGravity.reasons.some(G=>G.includes("Working Set"))?z.push(g):E.activeGravity.reasons.some(G=>G.includes("Recent Intent"))&&z.push(b)),E.structuralGravity&&z.push(x);let H=z.length>0?` ${z.join("")}`:"";return{relPath:N,name:E.name,kind:E.kind,signature:E.signature,line:E.start_line,snippet:D,badgeStr:H,gravityReasons:E.reasons}});return{content:[{type:"text",text:`# Symbol Search Results: "${e}"
682
689
 
683
- Showing ${R.length} matching symbol(s)${T?` (use offset=${i+r} for more)`:""}:
690
+ Showing ${R.length} matching symbol(s)${P?` (use offset=${i+r} for more)`:""}:
684
691
 
685
- `+R.map((I,A)=>{let Z=`## ${i+A+1}. \`${I.name}\` (${I.kind})${I.badgeStr}
686
- **File**: \`${I.relPath}:${I.line}\`
687
- `;return I.gravityReasons&&(Z+=`> *${I.gravityReasons.join(", ")}*
688
- `),I.signature&&(Z+=`**Signature**: \`${I.signature}\`
689
- `),I.snippet&&(Z+=`
692
+ `+R.map((E,I)=>{let N=`## ${i+I+1}. \`${E.name}\` (${E.kind})${E.badgeStr}
693
+ **File**: \`${E.relPath}:${E.line}\`
694
+ `;return E.gravityReasons&&(N+=`> *${E.gravityReasons.join(", ")}*
695
+ `),E.signature&&(N+=`**Signature**: \`${E.signature}\`
696
+ `),E.snippet&&(N+=`
690
697
  \`\`\`typescript
691
- ${I.snippet}
698
+ ${E.snippet}
692
699
  \`\`\`
693
- `),Z}).join(`
694
- `)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=ve(this.repoPath)||void 0;if(!r)return[];let c=this.filesRepo.findWithEmbeddings(),u=new hn(this.repoPath).getScorer(),d=new li(this.repoPath).getAncestorMissionIds(),m=[];for(let h of c)try{let _=JSON.parse(h.embedding),v=gs(r,_),y=this.filesRepo.getContent(h.path),w=Pe.ENABLE_LEXICAL_SCORING&&y?ci.calculateLexicalScore(y,e):0,S=1;if(y){let E=/\b(class|function|const|let|var|enum)\s+\w+/.test(y);if(/export\s+/.test(y)&&!E){let R=y.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");/\b(class|function|const|let|var|enum)\s+\w+/.test(R)||(S=.1)}}let $=w>0?.1:.18;if(v>$){if(t&&!n.matchesFilters(h.path,i,h.mtime,h.classification))continue;let E=h.mtime>2e9?Math.floor(h.mtime/1e3):h.mtime,T=Math.floor(Date.now()/1e3)-sd.SECONDS_PER_YEAR,R=Qe.getMultiplier(h.path,h.classification),U=u.calculateScore(v,E||T);U*=R;let A=this.filesRepo.getGravityMap(d,a)[h.path],Z=h.classification?Qe.mapClassificationToTier(h.classification):Qe.classify(h.path,{content:y??void 0}),J=`Similarity: ${(v*100).toFixed(0)}%, Tier: ${Z}${R!==1?` (${R}x)`:""}`;w>0&&(U+=w*Pe.LEXICAL_WEIGHT,J+=` | Lexical: +${w.toFixed(1)}`),A&&(U+=A.score,J+=` | \u{1F525} Gravity: +${A.score.toFixed(1)} (${A.reasons.join(", ")})`),S<1&&(U*=S,J+=` | \u{1F4C9} Barrel: x${S}`);let O=y?ci.extractSnippet(y,e):void 0;m.push({path:h.path,summary:h.summary||"",score:v,decayedScore:U,rationale:J,snippet:O})}}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(y=>y.path.split(".").pop())).size>1)for(let y of _)y.decayedScore=(y.decayedScore||0)+.15,y.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${h}')`;return m.sort((h,_)=>(_.decayedScore||0)-(h.decayedScore||0)),m}async findIntentLogMatches(e,r){return(await this.intentLogsRepo.findSemanticMatches(e,r)).map(t=>({id:t.id,missionId:t.mission_id,type:t.type,content:t.content,symbolName:t.symbol_name,filePath:t.file_path,score:t.similarity,decayedScore:t.similarity,rationale:`Similarity: ${(t.similarity*100).toFixed(0)}%`,createdAt:t.created_at}))}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 ")}}};Oe();_t();function gn(n){let{fileType:e,layer:r}=n,i={fileType:Je.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}Q();Oe();import{Visitor as iw}from"@swc/core/Visitor.js";var ar=class extends iw{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})}}}},Wt=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)}}}};B();import fw from"path";B();Lt();import ow from"better-sqlite3";import cr from"path";import Vv from"fs";import sw from"os";import aw from"crypto";var cw=b.child({module:"fusion-connection"}),Qs=5,lw=1,qv=["files","exports","imports","configs","schema_migrations"],ea=class{fusionDb;attachedRepos=new Map;fusionDbPath;name;constructor(e){this.name=e.name,this.fusionDbPath=this.getFusionDbPath(e.name),cw.info({name:e.name,path:this.fusionDbPath},"Initializing fused index connection");let r=cr.dirname(this.fusionDbPath);Vv.existsSync(r)||Vv.mkdirSync(r,{recursive:!0}),this.fusionDb=new ow(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=sw.homedir(),i=cr.join(r,".mcp-liquid-shadow","fused"),t=e.replace(/[^a-zA-Z0-9-_]/g,"_");return cr.join(i,`${t}.db`)}initFusionSchema(){this.fusionDb.exec(`
700
+ `),N}).join(`
701
+ `)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=be(this.repoPath)||void 0,l=new _n(this.repoPath).getScorer(),d=new hi(this.repoPath).getAncestorMissionIds(),p=this.filesRepo.getGravityMap(d,a),f=vn.extractKeywords(e),m=f.length>=3,h=this.extractOrderedConceptTerms(e),_=this.buildNgrams(h,2,3),v=m?this.collectConceptSymbolHintPaths(f,Math.max(o*10,100)):new Set,g=Math.min(Math.max((o+s)*6,Re.FILTERED_QUERY_LIMIT_MULTIPLIER*20),ue.MAX_LIMIT),[b,x]=await Promise.all([Promise.resolve(r?this.filesRepo.findWithEmbeddings():[]),Promise.resolve(this.filesRepo.findContentFts(e,g))]),k=[];if(r){for(let I of b)try{let N=JSON.parse(I.embedding),j=$s(r,N);k.push({row:I,similarity:j,vectorRank:0})}catch{}k.sort((I,N)=>N.similarity-I.similarity);for(let I=0;I<k.length;I++)k[I].vectorRank=I+1}let S=this.rrfMerge(k.slice(0,g).map(I=>({path:I.row.path,rank:I.vectorRank,score:I.similarity,row:I.row})),x.slice(0,g).map((I,N)=>({path:I.path,rank:N+1,bm25Rank:I.bm25_rank,row:I})),60);if(S.length===0)return[];let P=new Map;for(let I of k)P.set(I.row.path,I.similarity);let R=[],U=new Map;for(let I of S){let N=I.row,j=P.get(N.path)||0,D=I.ftsRank!==null,z=I.vectorRank!==null,H=this.filesRepo.getContent(N.path),G=Re.ENABLE_LEXICAL_SCORING&&H?vn.calculateLexicalScore(H,e):0,W=H?vn.calculateKeywordCoverageFromKeywords(H,f):0,Z=f.length>0?Math.round(W*f.length):0,Y=this.calculatePhraseCoverage(`${N.path}
702
+ ${N.summary||""}
703
+ ${H||""}`,_),J=v.has(N.path),te=1;if(H){let br=/\b(class|function|const|let|var|enum)\s+\w+/.test(H);if(/export\s+/.test(H)&&!br){let ib=H.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");/\b(class|function|const|let|var|enum)\s+\w+/.test(ib)||(te=.1)}}let ae=J?.08:G>0||Y>0||D?.14:m?.22:.18;if(z&&j<=ae&&!D)continue;if(f.length>0&&G===0&&!D){if(m){if(!J&&(Z===0&&Y===0&&j<.4||Z<=1&&Y===0&&j<.34||Z===1&&j<.3))continue}else if(Z===0&&j<.24)continue}if(m&&!J&&Y===0&&Z<=1&&j<.3&&!D||t&&!n.matchesFilters(N.path,i,N.mtime,N.classification))continue;let le=N.mtime>2e9?Math.floor(N.mtime/1e3):N.mtime,ie=Math.floor(Date.now()/1e3)-fd.SECONDS_PER_YEAR,q=it.getMultiplier(N.path,N.classification),B=z?l.calculateScore(j,le||ie):0,Se=I.fusedScore*60,_e=(Se+B*.2)*q,Ne=p[N.path],xe=N.classification?it.mapClassificationToTier(N.classification):it.classify(N.path,{content:H??void 0}),ge=`vector_rank: ${this.formatRank(I.vectorRank)} | fts_rank: ${this.formatRank(I.ftsRank)} | fused_score: ${I.fusedScore.toFixed(6)} | Similarity: ${(j*100).toFixed(0)}%, Tier: ${xe}${q!==1?` (${q}x)`:""}`;if(J&&(ge+=" | SymbolHint"),G>0&&(_e+=G*Re.LEXICAL_WEIGHT,ge+=` | Lexical: +${G.toFixed(1)}`),f.length>0)if(W>0){let br=m?W*.45:W*.35;_e+=br,ge+=` | Keywords: ${(W*100).toFixed(0)}%`}else ge+=" | Keywords: 0%",m&&!D&&(_e*=.55,ge+=" (penalty)");if(_.length>0)if(Y>0){let br=m?Y*.8:Y*.35;_e+=br,ge+=` | Phrases: ${(Y*100).toFixed(0)}%`}else m&&!D&&(_e*=.72,ge+=" | Phrases: 0% (penalty)");Ne&&(_e+=Ne.score,ge+=` | \u{1F525} Gravity: +${Ne.score.toFixed(1)} (${Ne.reasons.join(", ")})`),m&&this.isGenericConceptPath(N.path)&&Z<=1&&Y===0&&!D&&(_e*=.75,ge+=" | Generic path penalty"),te<1&&(_e*=te,ge+=` | \u{1F4C9} Barrel: x${te}`);let _r=H?vn.extractSnippet(H,e):void 0,rb=Math.max(j,Math.min(1,Se));R.push({path:N.path,summary:N.summary||"",score:rb,fusedScore:I.fusedScore,vectorRank:I.vectorRank,ftsRank:I.ftsRank,decayedScore:_e,rationale:ge,snippet:_r}),U.set(N.path,{lexicalScore:G,keywordCoverage:W,matchedKeywordCount:Z,phraseCoverage:Y})}if(R.length>0&&f.length>0){let I=this.exportsRepo.findByFiles(R.map(j=>j.path)),N=new Map;for(let j of I){let D=N.get(j.file_path)??[];D.push(j.name),N.set(j.file_path,D)}for(let j of R){let D=this.calculateIdentifierOverlap(f,N.get(j.path)??[]);if(D>0){let z=m?D*.8:D*.25;j.decayedScore=(j.decayedScore||0)+z,j.rationale+=` | Symbols: ${(D*100).toFixed(0)}%`}else m&&this.isGenericConceptPath(j.path)&&(j.decayedScore=(j.decayedScore||0)*.82,j.rationale+=" | Symbols: 0% (generic penalty)")}}let E=new Map;for(let I of R){let N=I.path.split("/").pop()?.split(".")[0].replace(/(Controller|Service|Repository|Component|View|Page|Handler|Wrapper|Client|DTO|Interface)$/i,"").toLowerCase();N&&N.length>3&&(E.has(N)||E.set(N,[]),E.get(N).push(I))}for(let[I,N]of E.entries())if(new Set(N.map(D=>D.path.split(".").pop())).size>1)for(let D of N)D.decayedScore=(D.decayedScore||0)+.15,D.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${I}')`;if(m&&R.length>1){let I=Math.min(Math.max(o*4,Re.FILTERED_QUERY_LIMIT_MULTIPLIER*20),R.length),N=[...R].sort((D,z)=>(z.decayedScore||0)-(D.decayedScore||0)).slice(0,I),j=this.computeBm25LikeConfirmation(N.map(D=>D.path),f);for(let D of N){let z=j.get(D.path)||0,H=U.get(D.path);if(z>0){let G=Math.min(.95,z*.18);D.decayedScore=(D.decayedScore||0)+G,D.rationale+=` | LexConfirm: +${G.toFixed(2)}`}else H&&H.matchedKeywordCount<=1&&H.phraseCoverage===0&&H.lexicalScore===0&&(D.decayedScore=(D.decayedScore||0)*.85,D.rationale+=" | LexConfirm: 0 (penalty)")}}return R.sort((I,N)=>(N.decayedScore||0)-(I.decayedScore||0)),R.slice(s,s+Math.min(o,ue.MAX_LIMIT))}async findIntentLogMatches(e,r){return(await this.intentLogsRepo.findSemanticMatches(e,r)).map(t=>({id:t.id,missionId:t.mission_id,type:t.type,content:t.content,symbolName:t.symbol_name,filePath:t.file_path,score:t.similarity,decayedScore:t.similarity,rationale:`Similarity: ${(t.similarity*100).toFixed(0)}%`,createdAt:t.created_at}))}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 ")}}extractPathKeywords(e){let r=e.trim();if(!r)return[];let i=r.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_\/.-]+/).map(o=>o.trim()).filter(o=>o.length>=2),t=new Set;t.add(r.toLowerCase());for(let o of i)t.add(o);return Array.from(t)}isLikelySymbolQuery(e){let r=e.trim();return!r||/[\/\\]/.test(r)?!1:/^[a-z]+(?:[A-Z][a-z0-9]+)+$/.test(r)||!r.includes(" ")&&/[A-Z]/.test(r)}countPathKeywordHits(e,r){let i=e.toLowerCase(),t=r.filter(s=>s.length>=3),o=0;for(let s of t)i.includes(s.toLowerCase())&&(o+=1);return o}scorePathResult(e,r,i,t){let s=this.countPathKeywordHits(e,r)*10;i==="symbol"&&(s+=25);let a=e.toLowerCase(),c=a.includes("/.env")||a.endsWith(".env")||a.endsWith(".yml")||a.endsWith(".yaml")||a.endsWith(".json")||a.endsWith(".md");return t&&c&&(s-=20),t&&a.includes("/tests/")&&(s-=15),s}findSymbolBackedPaths(e,r,i){let t=e.trim().toLowerCase();if(!t)return[];if(/[\/\\]/.test(t))return[];let o=Array.from(new Set([t,...r])).filter(c=>c.length>=3).slice(0,6);if(o.length===0)return[];let s=o.flatMap(c=>{let l=c===t?Math.min(i,60):Math.min(i,30);return this.exportsRepo.findByPartialName(c,l)}),a=new Map;for(let c of s){let l=c.name.toLowerCase(),u=0;l===t&&(u+=6),l.startsWith(t)&&(u+=4),l.includes(t)&&(u+=3);for(let p of r)p.length>=3&&l.includes(p)&&(u+=1);if(u===0)continue;let d=a.get(c.file_path)||0;u>d&&a.set(c.file_path,u)}return Array.from(a.entries()).sort((c,l)=>l[1]-c[1]).slice(0,Math.min(i,ue.MAX_LIMIT)).map(([c])=>c)}rrfMerge(e,r,i){let t=new Map,o=1.2,s=.8;for(let a of e){let c=t.get(a.path)||{path:a.path,row:a.row,vectorRank:null,ftsRank:null,fusedScore:0};c.vectorRank=a.rank,c.fusedScore+=o/(i+a.rank),t.set(a.path,c)}for(let a of r){let c=t.get(a.path)||{path:a.path,row:a.row,vectorRank:null,ftsRank:null,fusedScore:0};c.ftsRank=a.rank,c.fusedScore+=s/(i+a.rank),t.set(a.path,c)}return Array.from(t.values()).sort((a,c)=>c.fusedScore-a.fusedScore)}formatRank(e){return e==null?"none":String(e)}extractOrderedConceptTerms(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(r=>r.trim()).filter(r=>r.length>=3):[]}buildNgrams(e,r,i){if(e.length<r)return[];let t=[];for(let o=r;o<=i&&!(e.length<o);o++)for(let s=0;s<=e.length-o;s++)t.push(e.slice(s,s+o).join(" "));return Array.from(new Set(t))}calculatePhraseCoverage(e,r){if(!e||r.length===0)return 0;let i=e.toLowerCase(),t=0;for(let o of r)i.includes(o)&&(t+=1);return t/r.length}calculateIdentifierOverlap(e,r){if(e.length===0||r.length===0)return 0;let i=new Set(e.map(s=>s.toLowerCase())),t=new Set;for(let s of r){let a=s.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(c=>c.trim()).filter(c=>c.length>=3);for(let c of a)t.add(c)}let o=0;for(let s of i)t.has(s)&&(o+=1);return o/i.size}isGenericConceptPath(e){let r=e.toLowerCase();return/(?:^|\/)(index|utils?|helpers?|common|shared|types?|constants?|models?)(?:\/|\.|$)/.test(r)}computeBm25LikeConfirmation(e,r){let i=Array.from(new Set(r.map(d=>d.toLowerCase()).filter(d=>d.length>=3)));if(e.length===0||i.length===0)return new Map;let t=new Set(i),o=[],s=new Map;for(let d of e){let f=(this.filesRepo.getContent(d)??"").toLowerCase().split(/[^a-z0-9_]+/).map(h=>h.trim()).filter(Boolean),m=new Map;for(let h of f)t.has(h)&&m.set(h,(m.get(h)||0)+1);for(let h of i)(m.get(h)||0)>0&&s.set(h,(s.get(h)||0)+1);o.push({path:d,frequencies:m,length:Math.max(f.length,1)})}let a=o.reduce((d,p)=>d+p.length,0)/Math.max(o.length,1),c=1.2,l=.75,u=new Map;for(let d of o){let p=0;for(let f of i){let m=d.frequencies.get(f)||0;if(m===0)continue;let h=s.get(f)||0,_=Math.log(1+(o.length-h+.5)/(h+.5)),v=m*(c+1)/(m+c*(1-l+l*(d.length/Math.max(a,1))));p+=_*v}u.set(d.path,p)}return u}collectConceptSymbolHintPaths(e,r){let i=Array.from(new Set(e.filter(o=>o.length>=4&&!this.isLowSignalConceptKeyword(o)))).slice(0,6);if(i.length===0)return new Set;let t=new Map;for(let o of i){let s=this.exportsRepo.findByPartialName(o,Math.min(r,80));for(let a of s){let c=a.name.toLowerCase(),l=0;c===o&&(l+=3),c.startsWith(o)&&(l+=2),c.includes(o)&&(l+=1),l!==0&&t.set(a.file_path,(t.get(a.file_path)||0)+l)}}return new Set(Array.from(t.entries()).sort((o,s)=>s[1]-o[1]).slice(0,Math.min(r,ue.MAX_LIMIT)).map(([o])=>o))}isLowSignalConceptKeyword(e){return new Set(["type","types","data","update","create","list","item","value","model","helper"]).has(e.toLowerCase())}};Ue();pt();function bn(n){let{fileType:e,layer:r}=n,i={fileType:Ye.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}ee();Ue();import{Visitor as Lw}from"@swc/core/Visitor.js";var dr=class extends Lw{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})}}}},Gt=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*)?['"]([^'"]+)['"]/),d=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:d})}}}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*)?['"]([^'"]+)['"]/),d=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:d})}}}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)}}}};V();import Bw from"path";V();Ot();import Ow from"better-sqlite3";import mr from"path";import d_ from"fs";import Cw from"os";import Mw from"crypto";var jw=$.child({module:"fusion-connection"}),aa=5,Uw=1,m_=["files","exports","imports","configs","schema_migrations"],ca=class{fusionDb;attachedRepos=new Map;fusionDbPath;name;constructor(e){this.name=e.name,this.fusionDbPath=this.getFusionDbPath(e.name),jw.info({name:e.name,path:this.fusionDbPath},"Initializing fused index connection");let r=mr.dirname(this.fusionDbPath);d_.existsSync(r)||d_.mkdirSync(r,{recursive:!0}),this.fusionDb=new Ow(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=Cw.homedir(),i=mr.join(r,".mcp-liquid-shadow","fused"),t=e.replace(/[^a-zA-Z0-9-_]/g,"_");return mr.join(i,`${t}.db`)}initFusionSchema(){this.fusionDb.exec(`
695
704
  CREATE TABLE IF NOT EXISTS fused_repos (
696
705
  alias TEXT PRIMARY KEY,
697
706
  repo_path TEXT NOT NULL UNIQUE,
@@ -725,19 +734,19 @@ ${I.snippet}
725
734
 
726
735
  CREATE INDEX IF NOT EXISTS idx_virtual_edges_source ON virtual_edges(source_repo, source_file_path);
727
736
  CREATE INDEX IF NOT EXISTS idx_virtual_edges_target ON virtual_edges(target_repo, target_file_path);
728
- `),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(lw.toString())}attachRepo(e){let r=cr.resolve(e);if(this.attachedRepos.has(r))return;if(!qe(r))throw new Error(`Repository "${r}" is not indexed. Run shadow_recon_onboard({ repoPath: "${r}" }) then shadow_sync_trace({ repoPath: "${r}" }).`);let i=Ne(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=cr.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=Ne(r.repoPath),t=qv.filter(s=>!this.checkTableExists(i,s)),o=this.getSchemaVersion(i);return{alias:r.alias,repoPath:r.repoPath,schemaVersion:o,compatible:o>=Qs&&t.length===0,missingTables:t}});return{valid:e.every(r=>r.compatible),minVersion:Qs,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=cr.basename(e).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=aw.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<Qs)throw new Error(`Schema version mismatch for ${r}. Expected >= ${Qs}, got ${i}.`);let t=qv.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}};B();var Bt=b.child({module:"edge-scanner"});function Gd(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function uw(n){if(!n)return null;try{let e=JSON.parse(n);return e.path||e.name||null}catch{return null}}function pw(n,e){let r=Gd(n),i=Gd(e);if(r===i)return!0;let t=i.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\$[^/]+/g,"[^/]+");return new RegExp(`^${t}$`).test(r)}function dw(n){Bt.info("Starting HTTP gap detection scan");let e=n.getAttachedRepos();if(e.length<2)return Bt.warn("Need at least 2 repos for cross-repo dependency detection"),0;let r=[];for(let o of e)try{let s=`
737
+ `),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(Uw.toString())}attachRepo(e){let r=mr.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=Le(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)
738
+ VALUES (?, ?, ?, ?, unixepoch(), unixepoch())`).run(s,r,t,o);return}catch(u){let d=u instanceof Error?u.message.toLowerCase():String(u).toLowerCase();if((d.includes("locked")||d.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=mr.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=Le(r.repoPath),t=m_.filter(s=>!this.checkTableExists(i,s)),o=this.getSchemaVersion(i);return{alias:r.alias,repoPath:r.repoPath,schemaVersion:o,compatible:o>=aa&&t.length===0,missingTables:t}});return{valid:e.every(r=>r.compatible),minVersion:aa,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=mr.basename(e).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=Mw.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<aa)throw new Error(`Schema version mismatch for ${r}. Expected >= ${aa}, got ${i}.`);let t=m_.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}};V();var Jt=$.child({module:"edge-scanner"});function em(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function Fw(n){if(!n)return null;try{let e=JSON.parse(n);return e.path||e.name||null}catch{return null}}function Zw(n,e){let r=em(n),i=em(e);if(r===i)return!0;let t=i.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\$[^/]+/g,"[^/]+");return new RegExp(`^${t}$`).test(r)}function Hw(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=`
730
739
  SELECT id, name, file_path, capabilities
731
740
  FROM ${o.alias}.exports
732
741
  WHERE kind = 'HTTP Route'
733
- `,a=n.executeRawQuery(s);for(let c of a){let l=uw(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){Bt.warn({repo:o.alias,error:s},"Failed to query backend routes")}Bt.debug({count:r.length},"Found backend routes");let i=[];for(let o of e)try{let s=`
742
+ `,a=n.executeRawQuery(s);for(let c of a){let l=Fw(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=`
734
743
  SELECT file_path, name
735
744
  FROM ${o.alias}.event_synapses
736
745
  WHERE type = 'api_route' AND direction = 'produce'
737
- `,a=n.executeRawQuery(s);for(let c of a){let l=Gd(c.name);l&&l.startsWith("/")&&i.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,routePath:l})}}catch(s){Bt.warn({repo:o.alias,error:s},"Failed to query frontend API calls")}Bt.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&&pw(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){Bt.debug({source:o.filePath,target:s.filePath,error:a},"Skipped duplicate edge")}return Bt.info({edgesCreated:t,backendRoutes:r.length,frontendCalls:i.length},"HTTP gap detection scan completed"),t}function Kv(n){let e=dw(n);return{httpGaps:e,totalEdges:e}}B();var mw=b.child({module:"fusion-index-service"}),ta=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 y=`${v.alias}.${i} ${m}`,w="";s&&s.length>0&&(w=s.map(T=>{let R=T.alias||T.table.charAt(0);return`${T.type} JOIN ${v.alias}.${T.table} ${R} ON ${T.on}`}).join(`
738
- `));let S=a?`WHERE ${a}`:"",$=c&&c.length>0?`GROUP BY ${c.join(", ")}`:"",E=l?`HAVING ${l}`:"";return`SELECT '${v.alias}' as _repo_alias, '${v.repoPath}' as _repo_path, ${f} FROM ${y} ${w} ${S} ${$} ${E}`.trim()}).join(`
746
+ `,a=n.executeRawQuery(s);for(let c of a){let l=em(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&&Zw(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 f_(n){let e=Hw(n);return{httpGaps:e,totalEdges:e}}V();var Ww=$.child({module:"fusion-index-service"}),la=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:d,offset:p}=e,f=t||i.charAt(0),m=o.join(", "),_=r.map(v=>{let g=`${v.alias}.${i} ${f}`,b="";s&&s.length>0&&(b=s.map(P=>{let R=P.alias||P.table.charAt(0);return`${P.type} JOIN ${v.alias}.${P.table} ${R} ON ${P.on}`}).join(`
747
+ `));let x=a?`WHERE ${a}`:"",k=c&&c.length>0?`GROUP BY ${c.join(", ")}`:"",S=l?`HAVING ${l}`:"";return`SELECT '${v.alias}' as _repo_alias, '${v.repoPath}' as _repo_path, ${m} FROM ${g} ${b} ${x} ${k} ${S}`.trim()}).join(`
739
748
  UNION ALL
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=>`
749
+ `);return u&&(_=`SELECT * FROM (${_}) AS federated_results ORDER BY ${u}`),d!==void 0&&(_+=` LIMIT ${d}`),p!==void 0&&(_+=` OFFSET ${p}`),_}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=>`
741
750
  SELECT '${u.alias}' as _repo_alias, '${u.repoPath}' as _repo_path, ${c}, bm25(${u.alias}.${e}) as _fts_rank
742
751
  FROM ${u.alias}.${e} fts
743
752
  JOIN ${u.alias}.${r} c ON fts.rowid = c.id
@@ -759,7 +768,7 @@ WHERE i.resolved_path IS NOT NULL`);return r.join(`
759
768
  INSERT INTO virtual_edges
760
769
  (source_repo, source_file_path, source_symbol_id, target_repo, target_file_path, target_symbol_id, relationship, metadata, confidence, updated_at)
761
770
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, unixepoch())
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 mw.info({name:this.connection.nameValue},"Starting edge scan"),Kv(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}};var Yv=b.child({module:"fused-index"}),ra=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new ea(e),this.service=new ta(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(),Yv.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 Yv.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},na=new Map;function Vd(n){let e=na.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>fw.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),na.delete(n.name)}let r=new ra(n);return na.set(n.name,r),r}function qd(){return Array.from(na.keys())}import xt from"path";import Kd from"fs";import hw from"@swc/core";var lr=class{constructor(e){this.repoPath=e}async analyze(e,r={}){let{filePath:i,depth:t=3,limit:o=50,offset:s=0}=r,a=C.getInstance(this.repoPath),c=i?a.exports.findByNameAndFile(e,i):a.exports.findByNameGlobal(e);if(c.length===0)return[];let l=[];for(let u of c){let p=a.imports.findImpactDependents(u.file_path,`%${e}%`,t),d=[],m=new Set;for(let S of p){let $=xt.relative(this.repoPath,S.consumer_path);if(m.has($))continue;let E=`Imports ${S.imported_symbols}`,T=await this.verifySymbolUsage(S.consumer_path,u.name);T?E+=" (\u2705 Verified Call)":E+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",m.add($),d.push({type:"IMPORT",file:$,depth:S.depth,details:E,verified:T})}let f=a.exports.findRoutesByCapability(e);u.kind==="HTTP Route"&&f.push({name:u.name,file_path:u.file_path,signature:u.signature});for(let S of f){let E=S.name.split("/").filter(R=>R.length>3&&!R.includes("{")&&!R.includes("$")&&!R.includes("<")).sort((R,U)=>U.length-R.length)[0];if(!E||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(E.toLowerCase()))continue;let T=a.files.findContentByToken(E,10);for(let R of T){let U=xt.relative(this.repoPath,R);!m.has(U)&&R!==u.file_path&&(m.add(U),d.push({type:"API_USAGE",file:U,depth:2,details:`Likely calls route ${S.name} (matched token '${E}')`,verified:!1}))}}let h=a.files.findContentByToken(e,20);for(let S of h){let $=xt.relative(this.repoPath,S);!m.has($)&&S!==u.file_path&&(m.add($),d.push({type:"POTENTIAL_USAGE",file:$,depth:2,details:`Contains keyword '${e}' (Dynamic/Implicit usage)`,verified:!0}))}u.kind==="HTTP Route"&&await this.addCrossRepoImpact(d,m,u),d.sort((S,$)=>S.verified&&!$.verified?-1:!S.verified&&$.verified?1:S.depth!==$.depth?S.depth-$.depth:S.file.localeCompare($.file));let _=d.length,v=d.slice(s,s+o),y=s+o<_,w=this.calculateRiskScore(u,_,d);l.push({symbol:e,definedIn:xt.relative(this.repoPath,u.file_path),riskScore:w,impact:v,pagination:{total:_,offset:s,limit:o,hasMore:y}})}return l}async verifySymbolUsage(e,r){try{if(!Kd.existsSync(e))return!1;let i=Kd.readFileSync(e,"utf8"),t=xt.extname(e).toLowerCase(),o=new Set;if(t===".ts"||t===".tsx"||t===".js"||t===".jsx"){let s=new ar;try{let a=await hw.parse(i,{syntax:"typescript",tsx:e.endsWith(".tsx"),target:"es2020"});s.visitModule(a),o=s.calls}catch{return i.includes(r)}}else{let s=new Wt;s.visit(i,t),o=s.calls}if(o.has(r))return!0;for(let s of o){if(s===r)return!0;let a=s.split(/(?:\.|->|::)+/),c=a[a.length-1],l=r.split(/(?:\.|->|::)+/),u=l[l.length-1];if(c===u)return!0}return!1}catch{return!1}}async addCrossRepoImpact(e,r,i){try{let t=qd();for(let o of t)try{let a=(await import("os")).homedir(),c=xt.join(a,".mcp-liquid-shadow","fused"),l=o.replace(/[^a-zA-Z0-9-_]/g,"_"),u=xt.join(c,`${l}.db`);if(!Kd.existsSync(u))continue;let p=(await import("better-sqlite3")).default,d=new p(u),m=d.prepare("SELECT source_repo, source_file_path, relationship, metadata FROM virtual_edges WHERE target_repo = ? AND target_file_path = ? AND relationship = 'api_call'").all(this.repoPath,i.file_path);d.close();for(let f of m){let h=xt.relative(f.source_repo,f.source_file_path),_=`${f.source_repo}:${h}`;r.has(_)||(r.add(_),e.push({type:"CROSS_REPO_API_CALL",file:_,depth:1,details:`Cross-repo API call from ${xt.basename(f.source_repo)}`,verified:!0}))}}catch{continue}}catch{}}calculateRiskScore(e,r,i){let a=(new ce(this.repoPath).getSnapshot().gravity?.hotspots||[]).find(d=>d.filePath===e.file_path&&d.symbol===e.name)?.gravity||0,c=i.filter(d=>d.type==="CROSS_REPO_API_CALL").length,l=a/50+r/15+c*2,u="LOW",p="Peripheral symbol with limited usage.";return l>=8?(u="CRITICAL",p=`Core architectural pillar (Gravity: ${a.toFixed(0)}). Modification will destabilize ${r} dependents.`):l>=4?(u="HIGH",p=`High-gravity symbol with significant blast radius (${r} files).`):l>=1.5&&(u="MEDIUM",p="Standard library symbol with moderate dependency chain."),{score:Math.min(10,Math.round(l*10)/10),level:u,rationale:p}}};var Yd=g.object({repoPath:g.string(),name:g.string().optional(),goal:g.string().optional(),strategy:g.string().optional(),missionId:g.number().optional(),parentId:g.number().optional(),outcomeContract:g.string().optional(),templateId:g.string().optional(),templateVars:g.record(g.string(),g.string()).optional()}),Xd=g.object({repoPath:g.string(),missionId:g.number(),stepId:g.string().optional(),status:g.enum(["pending","in-progress","completed","failed","skipped"]).optional(),contextPivot:g.string().optional(),updates:g.array(g.object({stepId:g.string(),status:g.enum(["pending","in-progress","completed","failed","skipped"]),contextPivot:g.string().optional()})).optional(),artifacts:g.array(g.object({type:g.string(),identifier:g.string(),metadata:g.record(g.string(),g.any()).optional()})).optional()}),Qd=g.object({repoPath:g.string(),missionId:g.number().optional(),scope:g.enum(["mission","project"]).optional(),altitude:g.enum(["orbit","atmosphere","ground"]).optional(),activeMissionsLimit:g.number().int().positive().optional(),recentActivityLimit:g.number().int().positive().optional(),compact:g.boolean().optional()}),em=g.object({repoPath:g.string(),missionId:g.number().optional(),type:g.enum(["decision","blocker","discovery","fix"]),content:g.string(),filePath:g.string().optional(),symbolName:g.string().optional(),standalone:g.boolean().optional()}),tm=g.object({repoPath:g.string(),missionId:g.number()}),nm=g.object({repoPath:g.string(),format:g.enum(["markdown","json"]).optional(),limit:g.number().optional(),offset:g.number().optional(),since:g.number().optional(),until:g.number().optional()}),rm=g.object({repoPath:g.string()}),im=g.object({repoPath:g.string(),compact:g.boolean().optional()}),om=g.object({repoPath:g.string(),missionId:g.number().optional(),symbolId:g.number().optional()}),sm=g.object({repoPath:g.string(),missionId:g.number().optional(),depth:g.number().optional(),limit:g.number().optional(),format:g.enum(["mermaid","json"]).optional()}),Xv=g.object({repoPath:g.string(),filePaths:g.array(g.string())}),am=g.object({repoPath:g.string(),subPath:g.string().optional(),maxDepth:g.number().int().optional()}),cm=g.object({repoPath:g.string(),compact:g.boolean().optional()}),lm=g.object({repoPath:g.string()}),um=g.object({repoPath:g.string()}),pm=g.object({repoPath:g.string()}),dm=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),compact:g.boolean().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional()}),mm=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),matchMode:g.enum(["any","all","exact"]).optional()}),fm=g.object({repoPath:g.string(),query:g.string().optional(),key:g.string().optional(),kind:g.enum(["Service","Image","Port","Env"]).optional(),limit:g.number().int().optional(),showUsage:g.boolean().optional()}),hm=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),ranked:g.boolean().optional()}),gm=g.object({repoPath:g.string(),filePath:g.string().optional(),symbolName:g.string(),depth:g.number().int().optional(),limit:g.number().int().positive().optional(),offset:g.number().int().nonnegative().optional()}),ym=g.object({repoPath:g.string(),filePath:g.string(),symbolName:g.string().optional()}),vm=g.object({repoPath:g.string(),filePath:g.string(),direction:g.enum(["imports","imported_by"]),limit:g.number().int().positive().optional(),offset:g.number().int().nonnegative().optional()}),_m=g.object({repoPath:g.string(),mode:g.enum(["dead-code","circular-deps"]),limit:g.number().int().optional(),excludePatterns:g.array(g.string()).optional(),includeMigrations:g.boolean().optional(),includeFixtures:g.boolean().optional(),confidenceThreshold:g.enum(["all","high","medium"]).optional()}),bm=g.object({repoPath:g.string(),symbolName:g.string(),filePath:g.string().optional(),context:g.enum(["definition","full"]).optional()}),xm=g.object({repoPath:g.string(),filePath:g.string(),detailLevel:g.enum(["structure","signatures","summaries","detailed"]).optional()}),Sm=g.object({repoPath:g.string()}),$m=g.object({repoPath:g.string(),deep:g.boolean().optional()}),wm=g.object({repoPath:g.string()}),km=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),Em=g.object({repoPath:g.string()}),Im=g.object({repoPaths:g.array(g.string()),status:g.string().optional(),limit:g.number().int().positive().optional(),summarize:g.boolean().optional()}),Tm=g.object({parentRepoPath:g.string(),parentMissionId:g.number(),childRepoPath:g.string(),childMissionId:g.number(),relationship:g.string()}),Rm=g.object({repoPaths:g.array(g.string()),name:g.string().optional()});Q();Sd();Lt();_t();Oe();Ld();B();import ze from"fs";import yn from"path";var ur=b.child({module:"git-hooks"}),ia={"post-merge":`#!/bin/sh
771
+ `).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 Ww.info({name:this.connection.nameValue},"Starting edge scan"),f_(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}};var h_=$.child({module:"fused-index"}),pa=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new ca(e),this.service=new la(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(),h_.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 h_.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},ua=new Map;function tm(n){let e=ua.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>Bw.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),ua.delete(n.name)}let r=new pa(n);return ua.set(n.name,r),r}function nm(){return Array.from(ua.keys())}import St from"path";import rm from"fs";var fr=class{constructor(e){this.repoPath=e}async analyze(e,r={}){let{filePath:i,depth:t=3,limit:o=50,offset:s=0}=r,a=M.getInstance(this.repoPath),c=i?a.exports.findByNameAndFile(e,i):a.exports.findByNameGlobal(e);if(c.length===0)return[];let l=[];for(let u of c){let d=a.imports.findImpactDependents(u.file_path,`%${e}%`,t),p=[],f=new Set;for(let x of d){let k=St.relative(this.repoPath,x.consumer_path);if(f.has(k))continue;let S=`Imports ${x.imported_symbols}`,P=await this.verifySymbolUsage(x.consumer_path,u.name);P?S+=" (\u2705 Verified Call)":S+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",f.add(k),p.push({type:"IMPORT",file:k,depth:x.depth,details:S,verified:P})}let m=a.exports.findRoutesByCapability(e);u.kind==="HTTP Route"&&m.push({name:u.name,file_path:u.file_path,signature:u.signature});for(let x of m){let S=x.name.split("/").filter(R=>R.length>3&&!R.includes("{")&&!R.includes("$")&&!R.includes("<")).sort((R,U)=>U.length-R.length)[0];if(!S||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(S.toLowerCase()))continue;let P=a.files.findContentByToken(S,10);for(let R of P){let U=St.relative(this.repoPath,R);!f.has(U)&&R!==u.file_path&&(f.add(U),p.push({type:"API_USAGE",file:U,depth:2,details:`Likely calls route ${x.name} (matched token '${S}')`,verified:!1}))}}let h=a.files.findContentByToken(e,20);for(let x of h){let k=St.relative(this.repoPath,x);!f.has(k)&&x!==u.file_path&&(f.add(k),p.push({type:"POTENTIAL_USAGE",file:k,depth:2,details:`Contains keyword '${e}' (Dynamic/Implicit usage)`,verified:!0}))}u.kind==="HTTP Route"&&await this.addCrossRepoImpact(p,f,u),p.sort((x,k)=>x.verified&&!k.verified?-1:!x.verified&&k.verified?1:x.depth!==k.depth?x.depth-k.depth:x.file.localeCompare(k.file));let _=p.length,v=p.slice(s,s+o),g=s+o<_,b=this.calculateRiskScore(u,_,p);l.push({symbol:e,definedIn:St.relative(this.repoPath,u.file_path),riskScore:b,impact:v,pagination:{total:_,offset:s,limit:o,hasMore:g}})}return l}async verifySymbolUsage(e,r){try{if(!rm.existsSync(e))return!1;let i=rm.readFileSync(e,"utf8"),t=St.extname(e).toLowerCase(),o=new Set;if(t===".ts"||t===".tsx"||t===".js"||t===".jsx"){let s=new dr;try{let a=await di(i,{syntax:"typescript",tsx:e.endsWith(".tsx"),target:"es2020"});s.visitModule(a),o=s.calls}catch{return i.includes(r)}}else{let s=new Gt;s.visit(i,t),o=s.calls}if(o.has(r))return!0;for(let s of o){if(s===r)return!0;let a=s.split(/(?:\.|->|::)+/),c=a[a.length-1],l=r.split(/(?:\.|->|::)+/),u=l[l.length-1];if(c===u)return!0}return!1}catch{return!1}}async addCrossRepoImpact(e,r,i){try{let t=nm();for(let o of t)try{let a=(await import("os")).homedir(),c=St.join(a,".mcp-liquid-shadow","fused"),l=o.replace(/[^a-zA-Z0-9-_]/g,"_"),u=St.join(c,`${l}.db`);if(!rm.existsSync(u))continue;let d=(await import("better-sqlite3")).default,p=new d(u),f=p.prepare("SELECT source_repo, source_file_path, relationship, metadata FROM virtual_edges WHERE target_repo = ? AND target_file_path = ? AND relationship = 'api_call'").all(this.repoPath,i.file_path);p.close();for(let m of f){let h=St.relative(m.source_repo,m.source_file_path),_=`${m.source_repo}:${h}`;r.has(_)||(r.add(_),e.push({type:"CROSS_REPO_API_CALL",file:_,depth:1,details:`Cross-repo API call from ${St.basename(m.source_repo)}`,verified:!0}))}}catch{continue}}catch{}}calculateRiskScore(e,r,i){let a=(new pe(this.repoPath).getSnapshot().gravity?.hotspots||[]).find(p=>p.filePath===e.file_path&&p.symbol===e.name)?.gravity||0,c=i.filter(p=>p.type==="CROSS_REPO_API_CALL").length,l=a/50+r/15+c*2,u="LOW",d="Peripheral symbol with limited usage.";return l>=8?(u="CRITICAL",d=`Core architectural pillar (Gravity: ${a.toFixed(0)}). Modification will destabilize ${r} dependents.`):l>=4?(u="HIGH",d=`High-gravity symbol with significant blast radius (${r} files).`):l>=1.5&&(u="MEDIUM",d="Standard library symbol with moderate dependency chain."),{score:Math.min(10,Math.round(l*10)/10),level:u,rationale:d}}};var im=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()}),om=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()}),sm=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()}),am=y.object({repoPath:y.string(),missionId:y.number().optional(),type:y.enum(["decision","blocker","discovery","fix"]),content:y.string(),filePath:y.string().optional(),symbolName:y.string().optional(),standalone:y.boolean().optional()}),cm=y.object({repoPath:y.string(),missionId:y.number()}),lm=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()}),um=y.object({repoPath:y.string()}),pm=y.object({repoPath:y.string(),compact:y.boolean().optional()}),dm=y.object({repoPath:y.string(),missionId:y.number().optional(),symbolId:y.number().optional()}),mm=y.object({repoPath:y.string(),missionId:y.number().optional(),depth:y.number().optional(),limit:y.number().optional(),format:y.enum(["mermaid","json"]).optional()}),g_=y.object({repoPath:y.string(),filePaths:y.array(y.string())}),fm=y.object({repoPath:y.string(),subPath:y.string().optional(),maxDepth:y.number().int().optional()}),hm=y.object({repoPath:y.string(),compact:y.boolean().optional()}),gm=y.object({repoPath:y.string()}),ym=y.object({repoPath:y.string()}),vm=y.object({repoPath:y.string()}),_m=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()}),bm=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()}),xm=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()}),Sm=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()}),$m=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()}),wm=y.object({repoPath:y.string(),filePath:y.string(),symbolName:y.string().optional()}),km=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()}),Em=y.object({repoPath:y.string(),mode:y.enum(["dead-code","circular-deps"]),limit:y.number().int().optional(),includeTests:y.boolean().optional(),excludePatterns:y.array(y.string()).optional(),includeMigrations:y.boolean().optional(),includeFixtures:y.boolean().optional(),confidenceThreshold:y.enum(["all","high","medium"]).optional()}),Im=y.object({repoPath:y.string(),symbolName:y.string(),filePath:y.string().optional(),context:y.enum(["definition","full"]).optional()}),Tm=y.object({repoPath:y.string(),filePath:y.string(),detailLevel:y.enum(["structure","signatures","summaries","detailed"]).optional()}),Rm=y.object({repoPath:y.string()}),Pm=y.object({repoPath:y.string(),deep:y.boolean().optional()}),Nm=y.object({repoPath:y.string()}),zm=y.object({repoPath:y.string(),action:y.enum(["install","remove","status"]),enableAutoRefresh:y.boolean().optional(),enableSymbolHealing:y.boolean().optional()}),Dm=y.object({repoPath:y.string()}),Am=y.object({repoPaths:y.array(y.string()),status:y.string().optional(),limit:y.number().int().positive().optional(),summarize:y.boolean().optional()}),Lm=y.object({parentRepoPath:y.string(),parentMissionId:y.number(),childRepoPath:y.string(),childMissionId:y.number(),relationship:y.string()}),Om=y.object({repoPaths:y.array(y.string()),name:y.string().optional()});ee();Rd();Ot();pt();Ue();Zd();V();import Oe from"fs";import xn from"path";var hr=$.child({module:"git-hooks"}),da={"post-merge":`#!/bin/sh
763
772
  # Liquid Shadow: Auto-refresh index after merge/pull
764
773
  # Generated by liquid-shadow
765
774
 
@@ -793,62 +802,67 @@ REPO_PATH="$(git rev-parse --show-toplevel)"
793
802
  nohup npx @precisionutilityguild/liquid-shadow sync "$REPO_PATH" > /dev/null 2>&1 &
794
803
 
795
804
  exit 0
796
- `};function Nm(n){let{repoPath:e,enableAutoRefresh:r=!0,enableSymbolHealing:i=!0}=n,t=yn.join(e,".git","hooks"),o=[],s=[],a=[];if(!ze.existsSync(yn.join(e,".git")))return a.push("Not a git repository"),{installed:o,skipped:s,errors:a};ze.existsSync(t)||ze.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=yn.join(t,l),p=ia[l];if(!p){a.push(`No template found for hook: ${l}`);continue}try{if(ze.existsSync(u)){let d=ze.readFileSync(u,"utf-8");if(d.includes("liquid-shadow")||d.includes("mcp-liquid-shadow")){s.push(l),ur.info({hookName:l},"Hook already installed, skipping");continue}let m=`${u}.backup-${Date.now()}`;ze.copyFileSync(u,m),ur.info({hookName:l,backupPath:m},"Backed up existing hook")}ze.writeFileSync(u,p,{mode:493}),o.push(l),ur.info({hookName:l},"Installed git hook")}catch(d){a.push(`Failed to install ${l}: ${d}`),ur.error({hookName:l,err:d},"Failed to install hook")}}return{installed:o,skipped:s,errors:a}}function zm(n){let e=yn.join(n,".git","hooks"),r=[],i=[];if(!ze.existsSync(e))return{removed:r,errors:i};let t=Object.keys(ia);for(let o of t){let s=yn.join(e,o);try{if(ze.existsSync(s)){let a=ze.readFileSync(s,"utf-8");(a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow"))&&(ze.unlinkSync(s),r.push(o),ur.info({hookName:o},"Removed git hook"))}}catch(a){i.push(`Failed to remove ${o}: ${a}`),ur.error({hookName:o,err:a},"Failed to remove hook")}}return{removed:r,errors:i}}function ui(n){let e=yn.join(n,".git","hooks"),r=[],i=[];if(!ze.existsSync(e))return{installed:r,notInstalled:Object.keys(ia)};let t=Object.keys(ia);for(let o of t){let s=yn.join(e,o);if(ze.existsSync(s)){let a=ze.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}}var gw=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 Dm(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&&!gw.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)}B();Q();async function Qv(n){let e=tn(n.query??""),r={...n,query:e},i=pn();try{let{repoPath:t}=Ue(r),{query:o,limit:s=ye.DEFAULT_LIMIT,offset:a=0,compact:c=!1}=r;await ee(t);let{filters:l,hasFilters:u}=gn(r),d=await new Je(t).searchByConcept(o,s,a,l,u,c);return yw(t,o,"concept"),i(),d}catch(t){return b.error({error:t,args:n},"Concept Search failed"),i(),await at(),{content:[{type:"text",text:`Concept Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function yw(n,e,r){try{let i=C.getInstance(n),t=ve(n);i.searchHistory.record(e,r,t)}catch(i){let t=ve(n);b.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),at()}}B();Q();async function e_(n){let e=tn(n.query??""),r={...n,query:e},i=pn();try{let{repoPath:t}=Ue(r),{query:o,limit:s=ye.DEFAULT_LIMIT,offset:a=0,matchMode:c="any"}=r;await ee(t);let{filters:l,hasFilters:u}=gn(r),d=await new Je(t).searchBySymbol(o,s,a,l,u,c);return vw(t,o,"symbol"),i(),d}catch(t){return b.error({error:t,args:n},"Symbol Search failed"),i(),await at(),{content:[{type:"text",text:`Symbol Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function vw(n,e,r){try{let i=C.getInstance(n),t=ve(n);i.searchHistory.record(e,r,t)}catch(i){let t=ve(n);b.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),at()}}Q();B();import pi from"path";function t_(n,e){let r=n.findContentByToken(e,100);return{count:r.length,files:r}}async function n_(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=C.getInstance(e),{configs:l,files:u}=c;if(a){b.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($=>{let E=t_(u,$.key),T=E.count===0?"\u26A0\uFE0F ORPHANED":`\u2713 ${E.count} usage(s)`;return{file:pi.relative(e,$.file_path),key:$.key,value:$.value,kind:$.kind,usageCount:E.count,usageFiles:E.files.slice(0,5).map(R=>pi.relative(e,R)),status:T}});v.sort(($,E)=>$.usageCount===0&&E.usageCount>0?-1:E.usageCount===0&&$.usageCount>0?1:$.usageCount-E.usageCount);let y=v.filter($=>$.usageCount===0).length;return{content:[{type:"text",text:(y>0?`# Configuration Search: "${a}" (with Usage Analysis)
805
+ `};function Mm(n){let{repoPath:e,enableAutoRefresh:r=!0,enableSymbolHealing:i=!0}=n,t=xn.join(e,".git","hooks"),o=[],s=[],a=[];if(!Oe.existsSync(xn.join(e,".git")))return a.push("Not a git repository"),{installed:o,skipped:s,errors:a};Oe.existsSync(t)||Oe.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=xn.join(t,l),d=da[l];if(!d){a.push(`No template found for hook: ${l}`);continue}try{if(Oe.existsSync(u)){let p=Oe.readFileSync(u,"utf-8");if(p.includes("liquid-shadow")||p.includes("mcp-liquid-shadow")){s.push(l),hr.info({hookName:l},"Hook already installed, skipping");continue}let f=`${u}.backup-${Date.now()}`;Oe.copyFileSync(u,f),hr.info({hookName:l,backupPath:f},"Backed up existing hook")}Oe.writeFileSync(u,d,{mode:493}),o.push(l),hr.info({hookName:l},"Installed git hook")}catch(p){a.push(`Failed to install ${l}: ${p}`),hr.error({hookName:l,err:p},"Failed to install hook")}}return{installed:o,skipped:s,errors:a}}function jm(n){let e=xn.join(n,".git","hooks"),r=[],i=[];if(!Oe.existsSync(e))return{removed:r,errors:i};let t=Object.keys(da);for(let o of t){let s=xn.join(e,o);try{if(Oe.existsSync(s)){let a=Oe.readFileSync(s,"utf-8");(a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow"))&&(Oe.unlinkSync(s),r.push(o),hr.info({hookName:o},"Removed git hook"))}}catch(a){i.push(`Failed to remove ${o}: ${a}`),hr.error({hookName:o,err:a},"Failed to remove hook")}}return{removed:r,errors:i}}function gi(n){let e=xn.join(n,".git","hooks"),r=[],i=[];if(!Oe.existsSync(e))return{installed:r,notInstalled:Object.keys(da)};let t=Object.keys(da);for(let o of t){let s=xn.join(e,o);if(Oe.existsSync(s)){let a=Oe.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}}var Gw=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"]),Jw=new Set(["GET","POST","PUT","DELETE","PATCH"]),Vw=[/\bRoute::(?:get|post|put|delete|patch)\b/i,/\brouter\.(?:get|post|put|delete|patch)\s*\(/i,/\bapp\.(?:get|post|put|delete|patch)\s*\(/i,/\bfastify\.(?:get|post|put|delete|patch)\s*\(/i,/\baddRoute\s*\(/i,/\bHTTPMethods\.(?:GET|POST|PUT|DELETE|PATCH)\b/i,/\bpath\s*\(/i,/\bre_path\s*\(/i,/@(?:GET|POST|PUT|DELETE|PATCH|Route)\b/i,/@(?:Get|Post|Put|Delete|Patch|RequestMapping)\b/];function qw(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yi(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function Um(n){let e=yi(n).replace(/:[^/]+/g,"__SEG__").replace(/\{[^}]+\}/g,"__SEG__").replace(/\$[^/]+/g,"__SEG__").replace(/\*/g,"__SEG__"),r=qw(e).replace(/__SEG__/g,"[^/]+");return new RegExp(`^${r}$`)}function y_(n){let e=[/(HTTPMethods\.)?(GET|POST|PUT|DELETE|PATCH)\b/i,/Route::(get|post|put|delete|patch)\b/i,/@(GET|POST|PUT|DELETE|PATCH)\b/i],r;for(let i of e){let t=n.match(i);if(t?.[2]){r=t[2].toUpperCase();break}if(t?.[1]){r=t[1].toUpperCase();break}}return r&&Jw.has(r)?r:null}function Kw(n){return n.replace(/<[^>]+>/g," ")}function Yw(n){return Vw.some(e=>e.test(n))}function Xw(n){let e=[],r=/['"`]([^'"`]*\/[^'"`]*)['"`]/g,i=null;for(;(i=r.exec(n))!==null;){let t=i[1].trim();t&&e.push(t)}return e}function Qw(n){let e=n.replace(/^\^/,"").replace(/\$$/,"");if(e.includes("://"))try{e=new URL(e).pathname}catch{}if(!e.startsWith("/")){let r=e.indexOf("/");if(r===-1)return null;e=e.slice(r)}return yi(e)}function ek(n,e){let r=Xw(n);for(let i of r){let t=Qw(i);if(!t)continue;let o=Um(t),s=e.replace(/\*/g,"test-val");if(o.test(s)||!/[:{*$]/.test(t)&&s.startsWith(`${t}/`))return!0}return!1}function tk(n,e){if(e)try{let t=JSON.parse(e);if(typeof t.path=="string"&&t.path.startsWith("/"))return yi(t.path)}catch{}let r=/['"]([^'"]+)['"]/g,i=null;for(;(i=r.exec(n))!==null;){let t=i[1].trim();if(t){if(t=t.replace(/^\^/,"").replace(/\$$/,""),!t.startsWith("/")){if(!t.includes("/")&&!t.includes(":"))continue;t=`/${t}`}return yi(t)}}return null}function nk(n,e){let r=n.toLowerCase();return e.reduce((i,t)=>i+(r.includes(t.toLowerCase())?20:0),0)}function Fm(n,e,r){let i=e,t=e.match(/\$\{([^}]+)\}/g);if(t)for(let f of t){let m=f.substring(2,f.length-1),h=n.configs.findEnvValue(m);h&&(i=i.replace(f,h))}let o=i.split("?")[0].split("#")[0];try{o.includes("://")&&(o=new URL(o).pathname)}catch{}o=yi(o);let s=r?.toUpperCase(),a=[],c=!1,l=o.replace(/\*/g,"%").replace(/:[^/]+/g,"%").replace(/\{[^}]+\}/g,"%"),u=n.files.findSynapses({type:"api_route",name:l.includes("%")?l:o,direction:"consume",limit:10});for(let f of u)Um(f.name).test(o.replace(/\*/g,"test-val"))&&(a.push({file_path:f.file_path,start_line:f.line_number||0,signature:`[Synapse] ${f.name}`,score:1e3}),c=!0);let d=o.split(/[^a-zA-Z0-9-_]/).filter(f=>f.length>=3&&!Gw.has(f.toLowerCase())&&!/^\d+$/.test(f));if(d.length>0){let h=[...d].sort((v,g)=>g.length-v.length).slice(0,2).flatMap(v=>n.exports.findRoutesByToken(v,20)),_=new Set;for(let v of h){let g=`${v.file_path}:${v.start_line}:${v.name}`;if(_.has(g))continue;_.add(g);let b=v.signature||v.name||"",x=y_(b);if(s&&x&&s!==x)continue;let k=tk(b,v.capabilities);if(s&&!x&&!k)continue;let S=40;if(k){if(!Um(k).test(o.replace(/\*/g,"test-val")))continue;S+=280,c=!0}s&&x&&s===x&&(S+=120,c=!0),S+=nk(`${b} ${k||""}`,d),a.push({file_path:v.file_path,start_line:v.start_line,signature:`[Boundary] ${b}`,capabilities:v.capabilities||void 0,score:S})}}if(a.length<3&&!c){let f=d.map(m=>m.replace(/[^a-zA-Z0-9_]/g,"")).filter(m=>m.length>0).join(" AND ");if(f.length>0){let m=n.content.search(f);for(let h of m){let _=Kw(h.snippet);if(!Yw(_)||!ek(_,o))continue;let v=y_(_);if(s&&v&&v!==s)continue;let g=0,b=h.file_path.toLowerCase(),x=_.toLowerCase();(b.includes("route")||b.includes("controller"))&&(g+=10),(b.includes("src/api")||b.includes("services/api"))&&(g+=5),(x.includes("addroute")||x.includes("@get"))&&(g+=15),(x.includes("axios.")||x.includes("fetch("))&&(g-=10),(b.includes(".spec.")||b.includes(".test."))&&(g-=20),s&&x.includes(s.toLowerCase())&&(g+=20),g>0&&a.push({file_path:h.file_path,start_line:0,signature:`[FTS Match] ${_.replace(/\n/g," ")}`,score:g})}}}let p=new Map;return a.sort((f,m)=>m.score-f.score).forEach(f=>{p.has(f.file_path)||p.set(f.file_path,f)}),Array.from(p.values()).slice(0,c?2:3)}V();ee();async function v_(n){let e=rn(n.query??""),r={...n,query:e},i=fn();try{let{repoPath:t}=We(r),{query:o,limit:s=ue.DEFAULT_LIMIT,offset:a=0,compact:c=!1}=r;await ne(t);let{filters:l,hasFilters:u}=bn(r),p=await new Ye(t).searchByConcept(o,s,a,l,u,c);return rk(t,o,"concept"),i(),p}catch(t){return $.error({error:t,args:n},"Concept Search failed"),i(),await dt(),{content:[{type:"text",text:`Concept Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function rk(n,e,r){try{let i=M.getInstance(n),t=be(n);i.searchHistory.record(e,r,t)}catch(i){let t=be(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"),dt()}}V();ee();async function __(n){let e=rn(n.query??""),r={...n,query:e},i=fn();try{let{repoPath:t}=We(r),{query:o,limit:s=ue.DEFAULT_LIMIT,offset:a=0,matchMode:c="any"}=r;await ne(t);let{filters:l,hasFilters:u}=bn(r),p=await new Ye(t).searchBySymbol(o,s,a,l,u,c);return ik(t,o,"symbol"),i(),p}catch(t){return $.error({error:t,args:n},"Symbol Search failed"),i(),await dt(),{content:[{type:"text",text:`Symbol Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function ik(n,e,r){try{let i=M.getInstance(n),t=be(n);i.searchHistory.record(e,r,t)}catch(i){let t=be(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"),dt()}}ee();V();import gr from"path";function b_(n,e){let r=n.findContentByToken(e,100);return{count:r.length,files:r}}async function x_(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 ne(e);let c=M.getInstance(e),{configs:l,files:u}=c;if(a){$.info({repoPath:e,key:a},"Searching for config key in DB...");let m=l.findByKey(a,o);if(m.length===0)return{content:[{type:"text",text:`No configuration found for key: ${a}`}]};if(s){let v=m.map(k=>{let S=b_(u,k.key),P=S.count===0?"\u26A0\uFE0F ORPHANED":`\u2713 ${S.count} usage(s)`;return{file:gr.relative(e,k.file_path),key:k.key,value:k.value,kind:k.kind,usageCount:S.count,usageFiles:S.files.slice(0,5).map(R=>gr.relative(e,R)),status:P}});v.sort((k,S)=>k.usageCount===0&&S.usageCount>0?-1:S.usageCount===0&&k.usageCount>0?1:k.usageCount-S.usageCount);let g=v.filter(k=>k.usageCount===0).length;return{content:[{type:"text",text:(g>0?`# Configuration Search: "${a}" (with Usage Analysis)
797
806
 
798
- \u26A0\uFE0F **${y} orphaned var(s)** (defined but never used in code)
807
+ \u26A0\uFE0F **${g} orphaned var(s)** (defined but never used in code)
799
808
 
800
- Found ${f.length} match(es):
809
+ Found ${m.length} match(es):
801
810
 
802
811
  `:`# Configuration Search: "${a}" (with Usage Analysis)
803
812
 
804
- Found ${f.length} match(es), all in use:
813
+ Found ${m.length} match(es), all in use:
805
814
 
806
- `)+v.map($=>{let E=`## ${$.file} (${$.kind}) ${$.status}
807
- **${$.key}**: \`${$.value}\``;return $.usageCount>0&&$.usageFiles.length>0&&(E+=`
808
- > Used in: ${$.usageFiles.map(T=>`\`${T}\``).join(", ")}${$.usageCount>5?` (+${$.usageCount-5} more)`:""}`),E}).join(`
815
+ `)+v.map(k=>{let S=`## ${k.file} (${k.kind}) ${k.status}
816
+ **${k.key}**: \`${k.value}\``;return k.usageCount>0&&k.usageFiles.length>0&&(S+=`
817
+ > Used in: ${k.usageFiles.map(P=>`\`${P}\``).join(", ")}${k.usageCount>5?` (+${k.usageCount-5} more)`:""}`),S}).join(`
809
818
 
810
- `)}]}}let h=f.map(v=>({file:pi.relative(e,v.file_path),key:v.key,value:v.value,kind:v.kind}));return{content:[{type:"text",text:`# Configuration Search: "${a}"
819
+ `)}]}}let h=m.map(v=>({file:gr.relative(e,v.file_path),key:v.key,value:v.value,kind:v.kind}));return{content:[{type:"text",text:`# Configuration Search: "${a}"
811
820
 
812
- Found ${f.length} match(es):
821
+ Found ${m.length} match(es):
813
822
 
814
823
  `+h.map(v=>`## ${v.file} (${v.kind})
815
824
  **${v.key}**: \`${v.value}\``).join(`
816
825
 
817
- `)+"\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(y=>{let w=t_(u,y.key);return{file:pi.relative(e,y.file_path),key:y.key,value:y.value,kind:y.kind,usageCount:w.count,status:w.count===0?"ORPHANED":"in-use"}});f.sort((y,w)=>y.usageCount===0&&w.usageCount>0?-1:w.usageCount===0&&y.usageCount>0?1:y.usageCount-w.usageCount);let h=f.filter(y=>y.usageCount===0).length,_=f.length,v=`# Config Discovery (${t||"all"}) with Usage Analysis
826
+ `)+"\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars."}]}}let d=l.findByKind(t||null,o);if(s){let m=d.map(g=>{let b=b_(u,g.key);return{file:gr.relative(e,g.file_path),key:g.key,value:g.value,kind:g.kind,usageCount:b.count,usageFiles:b.files.slice(0,3).map(x=>gr.relative(e,x)),status:b.count===0?"ORPHANED":"in-use"}});m.sort((g,b)=>g.usageCount===0&&b.usageCount>0?-1:b.usageCount===0&&g.usageCount>0?1:g.usageCount-b.usageCount);let h=m.filter(g=>g.usageCount===0).length,_=m.length,v=`# Config Discovery (${t||"all"}) with Usage Analysis
818
827
 
819
828
  `;return v+=`**Summary**: ${_} config(s) found, ${h} orphaned
820
829
 
821
830
  `,h>0&&(v+=`## \u26A0\uFE0F Orphaned (${h})
822
- `,v+=f.filter(y=>y.usageCount===0).map(y=>`- \`${y.key}\` in ${y.file}`).join(`
831
+ `,v+=m.filter(g=>g.usageCount===0).map(g=>`- \`${g.key}\` in ${g.file}`).join(`
823
832
  `),v+=`
824
833
 
825
834
  `),v+=`## \u2713 In Use (${_-h})
826
- `,v+=f.filter(y=>y.usageCount>0).map(y=>`- \`${y.key}\` (${y.usageCount} usages)`).join(`
827
- `),p.length===o&&(v+=`
835
+ `,v+=m.filter(g=>g.usageCount>0).map(g=>{let b=g.usageFiles.length>0?`, used in ${g.usageFiles.map(x=>`\`${x}\``).join(", ")}${g.usageCount>3?` (+${g.usageCount-3} more)`:""}`:"";return`- \`${g.key}\`=\`${g.value}\` in \`${g.file}\` (${g.usageCount} usages${b})`}).join(`
836
+ `),d.length===o&&(v+=`
828
837
 
829
- > Results limited to ${o} entries. Use the 'limit' parameter to see more.`),{content:[{type:"text",text:v}]}}let d=p.map(f=>({...f,file:pi.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.
838
+ > Results limited to ${o} entries. Use the 'limit' parameter to see more.`),{content:[{type:"text",text:v}]}}let p=d.map(m=>({...m,file:gr.relative(e,m.file_path)})),f=JSON.stringify(p,null,2);return d.length===o&&(f=`Results limited to ${o} entries. Use the 'limit' parameter to see more.
830
839
 
831
- `+m),m+="\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars.",{content:[{type:"text",text:m}]}}B();Q();async function r_(n){let e=tn(n.query??""),r={...n,query:e},i=pn();try{let{repoPath:t}=Ue(r),{query:o,limit:s=ye.DEFAULT_LIMIT,offset:a=0,ranked:c=!1}=r;await ee(t);let{filters:l,hasFilters:u}=gn(r),d=await new Je(t).searchByPath(o,s,a,l,u,c);return _w(t,o,"path"),i(),d}catch(t){return b.error({error:t,args:n},"Path Search failed"),i(),await at(),{content:[{type:"text",text:`Path Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function _w(n,e,r){try{let i=C.getInstance(n),t=ve(n);i.searchHistory.record(e,r,t)}catch(i){let t=ve(n);b.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),at()}}B();async function i_(n){let{repoPath:e,filePath:r,symbolName:i,depth:t=3,limit:o=50,offset:s=0}=n;await ee(e);try{let c=await new lr(e).analyze(i,{filePath:r,depth:t,limit:o,offset:s});return c.length===0?{content:[{type:"text",text:`Symbol "${i}" not found.`}],isError:!0}:{content:[{type:"text",text:JSON.stringify(c,null,2)}]}}catch(a){return b.error({error:a,args:n},"Impact Analysis failed"),{content:[{type:"text",text:`Impact Analysis failed: ${a instanceof Error?a.message:String(a)}`}],isError:!0}}}Q();B();import o_ from"@swc/core";import di from"fs";import et from"path";var bw=4,mi=50,xw=2,Sw=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 s_(n){let{repoPath:e,filePath:r,symbolName:i}=Ue(n);if(!r)return{isError:!0,content:[{type:"text",text:"Error: 'filePath' is required."}]};let t=r;await ee(e);let o=C.getInstance(e);if(!di.existsSync(t))return{isError:!0,content:[{type:"text",text:`File not found: ${t}`}]};let s,a=et.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:et.relative(e,t),line:c,children:[]},u=new Set;u.add(t+(i?`:${i}`:""));let p={count:0,truncated:!1};return await pr(t,l,e,o,u,1,p,s),p.truncated&&l.children.push({type:"function",name:"\u26A0\uFE0F Output Truncated",details:`Trace limited to ${mi} nodes. Use summarize_file on specific files for deeper analysis.`,children:[]}),{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}async function pr(n,e,r,i,t,o,s,a){if(!(o>bw)){if(s.count>=mi){s.truncated=!0;return}try{let c=di.readFileSync(n,"utf8"),l=et.extname(n).toLowerCase(),p=(c.match(/import\s+[\s\S]*?from\s+['"].*?['"];?/gm)||[]).join(`
840
+ `+f),f+="\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars.",{content:[{type:"text",text:f}]}}V();ee();async function S_(n){let e=rn(n.query??""),r={...n,query:e},i=fn();try{let{repoPath:t}=We(r),{query:o,limit:s=ue.DEFAULT_LIMIT,offset:a=0,ranked:c=!1}=r;await ne(t);let{filters:l,hasFilters:u}=bn(r),p=await new Ye(t).searchByPath(o,s,a,l,u,c);return ok(t,o,"path"),i(),p}catch(t){return $.error({error:t,args:n},"Path Search failed"),i(),await dt(),{content:[{type:"text",text:`Path Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function ok(n,e,r){try{let i=M.getInstance(n),t=be(n);i.searchHistory.record(e,r,t)}catch(i){let t=be(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"),dt()}}V();async function $_(n){let{repoPath:e,filePath:r,symbolName:i,depth:t=3,limit:o=50,offset:s=0}=n;await ne(e);try{let c=await new fr(e).analyze(i,{filePath:r,depth:t,limit:o,offset:s});return c.length===0?{content:[{type:"text",text:`Symbol "${i}" not found.`}],isError:!0}:{content:[{type:"text",text:JSON.stringify(c,null,2)}]}}catch(a){return $.error({error:a,args:n},"Impact Analysis failed"),{content:[{type:"text",text:`Impact Analysis failed: ${a instanceof Error?a.message:String(a)}`}],isError:!0}}}ee();V();import Sn from"fs";import ke from"path";var sk=4,vi=50,ak=2,ck=4,lk=new Set(["publish","publishmessage","publishtaskbynameandpayload"]),uk=new Set(["Error","TypeError","RangeError","ReferenceError","SyntaxError","Promise","Map","Set","WeakMap","WeakSet","Date","Array","Object","String","Number","Boolean","RegExp","URL","URLSearchParams"]),pk=new Set(["error","errors","request","response","result","results","value","values","item","data","payload","message","messages","text","description","name","id","type","status","code"]),k_=new Set(["req","res","request","response","error","err","event","item","row","data","value","obj","window","document","console","json","math"]),dk=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"]);function mk(n,e){return ke.resolve(n)===ke.resolve(e)}function fk(n){if(uk.has(n))return!0;let e=n.trim().toLowerCase();if(pk.has(e))return!0;let r=n.split(/(?:\.|->|::)+/).filter(Boolean);if(r.length>1){let i=r[0].replace(/^\$+/,"").toLowerCase();if(k_.has(i))return!0}return!1}function w_(n){let e=n.trim();if(!e)return"";let r=e.indexOf("/"),i=r>=0?e.slice(r):e;return i.length>1&&i.endsWith("/")?i.slice(0,-1):i}function hk(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hm(n){let e=n.split(/(?:\.|::|->)+/).filter(Boolean);return e.length>0?e[e.length-1]:n.trim()}function gk(n,e){let r=0,i=!1;for(let t=e;t<n.length;t++){let o=n[t];for(let a of o)if(a==="{")r++,i=!0;else if(a==="}"&&(r--,i&&r<=0))return{start:e+1,end:t+1};let s=o.trim();if(!i&&/[;}]$/.test(s))return{start:e+1,end:t+1}}return{start:e+1,end:Math.min(n.length,e+40)}}function Zm(n,e){let r=Hm(e);if(!r)return null;try{let i=Sn.readFileSync(n,"utf8").split(`
841
+ `),t=hk(r),o=[new RegExp(`^\\s*(?:export\\s+)?(?:async\\s+)?function\\s+${t}\\b`),new RegExp(`^\\s*(?:(?:public|private|protected|static|readonly|async|abstract|get|set)\\s+)*${t}\\s*(?:<[^>]*>)?\\s*\\(`),new RegExp(`^\\s*(?:(?:public|private|protected|static|readonly|async|abstract)\\s+)*${t}\\s*[:=]\\s*(?:async\\s*)?(?:\\([^)]*\\)\\s*=>|function\\b)`),new RegExp(`^\\s*(?:export\\s+)?class\\s+${t}\\b`)];for(let s=0;s<i.length;s++){let a=i[s];if(a.includes(r)&&o.some(c=>c.test(a)))return gk(i,s)}}catch{return null}return null}function E_(n,e,r){try{let i=Sn.readFileSync(n,"utf8").split(`
842
+ `);if(e.start<1||e.end<e.start||e.start>i.length||e.end>i.length||!i.slice(e.start-1,e.end).join(`
843
+ `).trim())return!0;if(e.start===e.end){let o=i[e.start-1]?.trim()||"",s=o.replace(/\s+/g,"");if(!s||/^[{}()[\];,]+$/.test(s))return!0;let a=Hm(r);if(a&&!o.includes(a))return!0}return!1}catch{return!0}}function ma(n,e,r){if(e){if(!r)return e;if(E_(n,e,r)){let i=Zm(n,r);if(i)return i}return e}}function yk(n,e,r){let i=n.exports.findByNameAndFile(r,e);if(i.length>0)return i[0];let t=n.exports.findByFile(e);if(t.length===0)return null;if(r.includes("/")){let a=w_(r),c=t.find(l=>!l?.name||typeof l.name!="string"?!1:w_(l.name)===a);if(c)return c}let o=r.split(/(?:\.|::|->)+/).filter(Boolean);if(o.length>1){let a=o[o.length-1],c=n.exports.findByNameAndFile(a,e);if(c.length===1)return c[0]}return t.find(a=>typeof a?.name=="string"&&(a.name===r||a.name.includes(r)))||null}async function I_(n){let{repoPath:e,filePath:r,symbolName:i}=We(n);if(!r)return{isError:!0,content:[{type:"text",text:"Error: 'filePath' is required."}]};let t=r;await ne(e);let o=M.getInstance(e);if(!Sn.existsSync(t))return{isError:!0,content:[{type:"text",text:`File not found: ${t}`}]};let s,a=ke.basename(t),c;if(i){let p=Hm(i),f=yk(o,t,i);if(f){let m=f;s={start:m.start_line,end:m.end_line},a=m.name,c=m.start_line}else{let m=Zm(t,i);if(m)s=m,c=m.start,a=p||i;else{let h=o.exports.findByFile(t).map(_=>_.name).filter(_=>!!_).slice(0,10);return{isError:!0,content:[{type:"text",text:`Symbol not found in file: "${i}"
844
+ File: ${ke.relative(e,t)}
845
+ `+(h.length>0?`Top symbols in file: ${h.join(", ")}`:"No indexed symbols found for this file.")}]}}}if(s&&E_(t,s,i)){let m=Zm(t,i);m&&($.warn({filePath:t,symbolName:i,start:s.start,end:s.end},"Indexed symbol range appears degenerate; using source-inferred range for flow"),s=m,c=m.start,a===ke.basename(t)&&(a=p||i))}}let l={type:s?"function":"file",name:a,path:ke.relative(e,t),line:c,children:[]},u=new Set;u.add(t+(i?`:${i}`:""));let d={count:0,truncated:!1};return await yr(t,l,e,o,u,1,d,s),d.truncated&&l.children.push({type:"function",name:"\u26A0\uFE0F Output Truncated",details:`Trace limited to ${vi} nodes. Use summarize_file on specific files for deeper analysis.`,children:[]}),{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}async function yr(n,e,r,i,t,o,s,a){if(!(o>sk)){if(s.count>=vi){s.truncated=!0;return}try{let c=Sn.readFileSync(n,"utf8"),l=ke.extname(n).toLowerCase(),d=(c.match(/import\s+[\s\S]*?from\s+['"].*?['"];?/gm)||[]).join(`
832
846
  `);a&&(c=c.split(`
833
847
  `).slice(a.start-1,a.end).join(`
834
- `));let d;if(l===".ts"||l===".tsx"||l===".js"||l===".jsx"){d=new ar;let _={syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"};try{let v=a?`${p}
835
- ${c}`:c,y=await o_.parse(v,_);d.visitModule(y)}catch{if(a)try{let y=`${p}
848
+ `));let p;if(l===".ts"||l===".tsx"||l===".js"||l===".jsx"){p=new dr;let _={syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"};try{let v=a?`${d}
849
+ ${c}`:c,g=await di(v,_);p.visitModule(g)}catch{if(a)try{let g=`${d}
836
850
  class TraceContext {
837
851
  ${c}
838
- }`,w=await o_.parse(y,_);d.visitModule(w)}catch{let w=new Wt,S=l;w.visit(c,S),d.calls=w.calls,d.apiCalls=w.apiCalls,d.imports=w.imports}else{let y=new Wt;y.visit(c,l),d.calls=y.calls,d.apiCalls=y.apiCalls,d.imports=y.imports}}}else d=new Wt,d.visit(c,l);b.info({file:et.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>=mi)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 $=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 R=i.exports.findByNameGlobal(T).concat(i.exports.findByMethodName(T));$.push(...R)}}let E=new Set;for(let T of $){if(E.has(T.file_path)||T.file_path===n)continue;if(E.add(T.file_path),s.count>=mi)break;s.count++;let R={type:"subscriber",name:`${T.name} (${et.basename(T.file_path)})`,path:et.relative(r,T.file_path),line:T.start_line,details:"Potential Subscriber / Handler",children:[]};S.children.push(R),di.existsSync(T.file_path)&&!t.has(T.file_path)&&(t.add(T.file_path),await pr(T.file_path,R,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 w=Dm(i,_.url).slice(0,xw);for(let S of w){if(s.count>=mi)break;s.count++;let $={type:"route",name:S.signature||"Route Handler",path:S.file_path,line:S.start_line,children:[]};if(v.children.push($),di.existsSync(S.file_path)&&!t.has(S.file_path)&&(t.add(S.file_path),await pr(S.file_path,$,r,i,t,o+1,s)),S.capabilities)try{let E=JSON.parse(S.capabilities);if(E.handler){let[T,R]=E.handler.split("@");if(T){let I=T.split("\\").pop();if(I){let A=i.exports.findClassByName(I);if(A){let Z=i.exports.findByNameAndFile(R||"",A.file_path),J,O=A.start_line;Z.length>0&&(J={start:Z[0].start_line,end:Z[0].end_line},O=Z[0].start_line);let P={type:"component",name:`${I}${R?" :: "+R:""}`,path:et.relative(r,A.file_path),line:O,details:"Controller Logic (Macro IR)",children:[]};$.children.push(P),t.has(A.file_path+(R?`:${R}`:""))||(t.add(A.file_path+(R?`:${R}`:"")),await pr(A.file_path,P,r,i,t,o+1,s,J))}}}}}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 y=Zt(v,n,r);if(y&&di.existsSync(y))if(t.has(y))e.children.push({type:"function",name:_,details:"Circular / Already Visited",path:et.relative(r,y),children:[]});else{t.add(y);let w={type:"file",name:_,details:`Imported from ${et.basename(y)}`,path:et.relative(r,y),children:[]};e.children.push(w),await pr(y,w,r,i,t,o+1,s)}}else if(!["log","info","error","warn","print"].includes(_)){let v=i.exports.findByNameGlobal(_);if(v.length===0){let y=_.split(/(?:\.|->|::)+/);if(y.length>1){let w=y[y.length-1];Sw.has(w)||(v=i.exports.findByMethodName(w))}}if(v.length>0){let y=v.find(S=>S.file_path===n),w=y||(v.length===1?v[0]:null);if(w){let S=`${w.file_path}:${w.name}`;if(!t.has(S)){t.add(S);let $={type:"component",name:_,details:`Resolved via global index${y?" (local)":""}`,path:et.relative(r,w.file_path),line:w.start_line,children:[]};e.children.push($),await pr(w.file_path,$,r,i,t,o+1,s,{start:w.start_line,end:w.end_line})}}}}}catch(c){b.error({filePath:n,error:c.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:c.message,children:[]})}}}Q();import a_ from"path";async function l_(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await ee(e);let{imports:s}=C.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?a_.relative(e,d.resolved_path):null,isExternal:!d.resolved_path};if(!d.resolved_path){let f=Vs(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:c_(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:a_.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:c_(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 c_(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}Q();import u_ from"path";import $w from"fs";async function p_(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}=C.getInstance(e);if(r==="dead-code"){let d=c.findDeadExports({limit:i,includeTests:!0,includeMigrations:t,includeFixtures:o,excludePatterns:s,confidenceThreshold:a}).map(y=>({name:y.name,kind:y.kind,file:u_.relative(e,y.file_path),line:y.start_line,confidence:y.confidence,reason:y.reason})),m={high:{},medium:{},low:{}};for(let y of d)m[y.confidence][y.file]||(m[y.confidence][y.file]=[]),m[y.confidence][y.file].push({name:y.name,kind:y.kind,line:y.line,reason:y.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
839
- `),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}
840
- `),h>0&&(f.push(`## High Confidence (Likely Dead)
841
- `),f.push(JSON.stringify(m.high,null,2))),_>0&&a!=="high"&&(f.push(`
852
+ }`,b=await di(g,_);p.visitModule(b)}catch{let b=new Gt,x=l;b.visit(c,x),p.calls=b.calls,p.apiCalls=b.apiCalls,p.imports=b.imports}else{let g=new Gt;g.visit(c,l),p.calls=g.calls,p.apiCalls=g.apiCalls,p.imports=g.imports}}}else p=new Gt,p.visit(c,l);$.info({file:ke.basename(n),calls:p.calls.size,apiCalls:p.apiCalls.length,depth:o},"Analyzed file");let f=p.apiCalls.slice(0,10);for(let _ of f){if(s.count>=vi)break;if(s.count++,_.method==="PUBSUB"){let x={type:"event_trigger",name:`PubSub Event: ${_.url}`,details:"Detected via PubSub client usage",children:[]};e.children.push(x);let k=_.url.toLowerCase();if(lk.has(k)){x.children.push({type:"subscriber",name:"PubSub fan-out omitted",details:"Generic publish call without concrete event/action; skipping global subscriber expansion to avoid false links.",children:[]});continue}let S=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 U=i.exports.findByNameGlobal(R).concat(i.exports.findByMethodName(R));S.push(...U)}}let P=new Set;for(let R of S.slice(0,ck)){if(P.has(R.file_path)||R.file_path===n)continue;if(P.add(R.file_path),s.count>=vi)break;s.count++;let U={type:"subscriber",name:`${R.name} (${ke.basename(R.file_path)})`,path:ke.relative(r,R.file_path),line:R.start_line,details:"Potential Subscriber / Handler",children:[]};x.children.push(U),Sn.existsSync(R.file_path)&&!t.has(R.file_path)&&(t.add(R.file_path),await yr(R.file_path,U,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=Fm(i,_.url,_.method).slice(0,ak);for(let x of b){if(mk(x.file_path,n))continue;if(s.count>=vi)break;s.count++;let k={type:"route",name:x.signature||"Route Handler",path:x.file_path,line:x.start_line,children:[]};if(v.children.push(k),Sn.existsSync(x.file_path)&&!t.has(x.file_path)&&(t.add(x.file_path),await yr(x.file_path,k,r,i,t,o+1,s)),x.capabilities)try{let S=JSON.parse(x.capabilities);if(S.handler){let[P,R]=S.handler.split("@");if(P){let E=P.split("\\").pop();if(E){let I=i.exports.findClassByName(E);if(I){let N=i.exports.findByNameAndFile(R||"",I.file_path),j,D=I.start_line;N.length>0&&(j=ma(I.file_path,{start:N[0].start_line,end:N[0].end_line},R||""),j||(j={start:N[0].start_line,end:N[0].end_line}),D=j.start);let z={type:"component",name:`${E}${R?" :: "+R:""}`,path:ke.relative(r,I.file_path),line:D,details:"Controller Logic (Macro IR)",children:[]};k.children.push(z),t.has(I.file_path+(R?`:${R}`:""))||(t.add(I.file_path+(R?`:${R}`:"")),await yr(I.file_path,z,r,i,t,o+1,s,j))}}}}}catch{}}}let m=p.calls,h=Array.from(m).sort();for(let _ of h)if(p.imports.has(_)){let v=p.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=Wt(v,n,r);if(g&&Sn.existsSync(g)){let b=i.exports.findByNameAndFile(_,g),x=b.length>0?b[0]:null,k=x?`${g}:${x.name}`:g;if(t.has(k))e.children.push({type:"function",name:_,details:"Circular / Already Visited",path:ke.relative(r,g),line:x?.start_line,children:[]});else{t.add(k);let S={type:x?"component":"file",name:_,details:x?`Imported symbol from ${ke.basename(g)}`:`Imported from ${ke.basename(g)}`,path:ke.relative(r,g),line:x?.start_line,children:[]};e.children.push(S);let P=x?ma(g,{start:x.start_line,end:x.end_line},_):void 0;await yr(g,S,r,i,t,o+1,s,P)}}}else if(!["log","info","error","warn","print"].includes(_)&&!fk(_)){let v=i.exports.findByNameGlobal(_);if(v.length===0){let g=_.split(/(?:\.|->|::)+/);if(g.length>1){let b=g[0]?.replace(/^\$+/,"").toLowerCase(),x=g[g.length-1];!dk.has(x)&&!(b&&k_.has(b))&&(v=i.exports.findByMethodName(x))}}if(v.length>0){let g=v.find(x=>x.file_path===n),b=g||(v.length===1?v[0]:null);if(b){let x=`${b.file_path}:${b.name}`;if(!t.has(x)){t.add(x);let k={type:"component",name:_,details:`Resolved via global index${g?" (local)":""}`,path:ke.relative(r,b.file_path),line:ma(b.file_path,{start:b.start_line,end:b.end_line},_)?.start,children:[]};e.children.push(k);let S=ma(b.file_path,{start:b.start_line,end:b.end_line},_)||{start:b.start_line,end:b.end_line};await yr(b.file_path,k,r,i,t,o+1,s,S)}}}}}catch(c){$.error({filePath:n,error:c.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:c.message,children:[]})}}}ee();import T_ from"path";async function P_(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await ne(e);let{imports:s}=M.getInstance(e);if(i==="imports"){let c=s.findByFile(r).filter(p=>p.module_specifier!=="__type_reference__").map(p=>{let f={module:p.module_specifier,symbols:p.imported_symbols,resolvedPath:p.resolved_path,relativePath:p.resolved_path?T_.relative(e,p.resolved_path):null,isExternal:!p.resolved_path};if(!p.resolved_path){let m=na(p.module_specifier,r,e);if(!m.resolved)return{...f,resolutionError:m.error,suggestion:m.suggestion}}return f}),l=[...c].sort((p,f)=>(p.relativePath||"").localeCompare(f.relativePath||"")),d={results:R_(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(d,null,2)}]}}else{let c=s.findDependents(r).map(p=>({file:p.file_path,relativePath:T_.relative(e,p.file_path),importStatement:p.module_specifier,importedSymbols:p.imported_symbols})),l=[...c].sort((p,f)=>(p.relativePath||"").localeCompare(f.relativePath||"")),d={results:R_(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(d,null,2)}]}}}function R_(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}ee();import N_ from"path";import vk from"fs";async function z_(n){let{repoPath:e,mode:r,limit:i=50,includeTests:t=!1,includeMigrations:o=!1,includeFixtures:s=!1,excludePatterns:a=[],confidenceThreshold:c="all"}=n;await ne(e);let{exports:l,imports:u}=M.getInstance(e);if(r==="dead-code"){let f=l.findDeadExports({limit:i,includeTests:t,includeMigrations:o,includeFixtures:s,excludePatterns:a,confidenceThreshold:c}).map(b=>({name:b.name,kind:b.kind,file:N_.relative(e,b.file_path),line:b.start_line,confidence:b.confidence,reason:b.reason})),m={high:{},medium:{},low:{}};for(let b of f)m[b.confidence][b.file]||(m[b.confidence][b.file]=[]),m[b.confidence][b.file].push({name:b.name,kind:b.kind,line:b.line,reason:b.reason});let h=[],_=Object.values(m.high).flat().length,v=Object.values(m.medium).flat().length,g=Object.values(m.low).flat().length;return h.push(`# Dead Export Analysis
853
+ `),h.push(`Found ${f.length} potentially unused exports.`),h.push(`- **High confidence** (likely dead): ${_}`),h.push(`- **Medium confidence** (possibly intentional): ${v}`),h.push(`- **Low confidence** (likely intentional): ${g}
854
+ `),_>0&&(h.push(`## High Confidence (Likely Dead)
855
+ `),h.push(JSON.stringify(m.high,null,2))),v>0&&c!=="high"&&(h.push(`
842
856
  ## Medium Confidence (Possibly Intentional)
843
- `),f.push(JSON.stringify(m.medium,null,2))),v>0&&a==="all"&&(f.push(`
857
+ `),h.push(JSON.stringify(m.medium,null,2))),g>0&&c==="all"&&(h.push(`
844
858
  ## Low Confidence (Likely Intentional)
845
- `),f.push(JSON.stringify(m.low,null,2))),{content:[{type:"text",text:f.join(`
846
- `)}]}}else if(r==="circular-deps"){let v=function($,E){if(f.length>=p)return!1;h.add($),_.add($),E.push($);let T=m.get($)||new Set;for(let R of T)if(h.has(R)){if(_.has(R)){let U=E.indexOf(R);if(U>=0){let I=E.slice(U);I.push(R),f.push(I)}}}else if(v(R,[...E]))return!0;return _.delete($),!1};var u=v;let p=typeof i=="number"?i:20,d=l.getAllResolved(),m=new Map;for(let $ of d)m.has($.file_path)||m.set($.file_path,new Set),m.get($.file_path).add($.resolved_path);let f=[],h=new Set,_=new Set;for(let $ of m.keys())!h.has($)&&f.length<p&&v($,[]);let y=[],w=new Map;for(let $ of d){let E=`${$.file_path}|${$.resolved_path}`;w.has(E)||w.set(E,[]),w.get(E).push($)}for(let $ of f){let E=!1;for(let T=0;T<$.length-1;T++){let R=$[T],U=$[T+1],I=w.get(`${R}|${U}`);if(I){for(let A of I)try{let Z=$w.readFileSync(R,"utf8"),J=A.module_specifier.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),O=new RegExp(`import\\s+type\\s+.*from\\s+['"]${J}['"]`,"i"),P=new RegExp(`import\\s+\\{.*type\\s+.*\\}.*from\\s+['"]${J}['"]`,"s");if(O.test(Z)||P.test(Z)){E=!0;break}let H=A.imported_symbols.split(",").map(G=>G.trim());for(let G of H){if(!G||G==="*")continue;let F=G.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\(\\s*\\)\\s*=>\\s*${F}`).test(Z)){E=!0;break}}}catch{}if(E)break}}E||y.push($)}let S=y.map(($,E)=>({id:E+1,length:$.length-1,chain:$.map(T=>u_.relative(e,T))}));return{content:[{type:"text",text:`# Circular Dependency Analysis
859
+ `),h.push(JSON.stringify(m.low,null,2))),{content:[{type:"text",text:h.join(`
860
+ `)}]}}else if(r==="circular-deps"){let g=function(S,P){if(h.length>=p)return!1;_.add(S),v.add(S),P.push(S);let R=m.get(S)||new Set;for(let U of R)if(_.has(U)){if(v.has(U)){let E=P.indexOf(U);if(E>=0){let I=P.slice(E);I.push(U),h.push(I)}}}else if(g(U,[...P]))return!0;return v.delete(S),!1};var d=g;let p=typeof i=="number"?i:20,f=u.getAllResolved(),m=new Map;for(let S of f)m.has(S.file_path)||m.set(S.file_path,new Set),m.get(S.file_path).add(S.resolved_path);let h=[],_=new Set,v=new Set;for(let S of m.keys())!_.has(S)&&h.length<p&&g(S,[]);let b=[],x=new Map;for(let S of f){let P=`${S.file_path}|${S.resolved_path}`;x.has(P)||x.set(P,[]),x.get(P).push(S)}for(let S of h){let P=!1;for(let R=0;R<S.length-1;R++){let U=S[R],E=S[R+1],I=x.get(`${U}|${E}`);if(I){for(let N of I)try{let j=vk.readFileSync(U,"utf8"),D=N.module_specifier.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),z=new RegExp(`import\\s+type\\s+.*from\\s+['"]${D}['"]`,"i"),H=new RegExp(`import\\s+\\{.*type\\s+.*\\}.*from\\s+['"]${D}['"]`,"s");if(z.test(j)||H.test(j)){P=!0;break}let G=N.imported_symbols.split(",").map(W=>W.trim());for(let W of G){if(!W||W==="*")continue;let Z=W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\(\\s*\\)\\s*=>\\s*${Z}`).test(j)){P=!0;break}}}catch{}if(P)break}}P||b.push(S)}let k=b.map((S,P)=>({id:P+1,length:S.length-1,chain:S.map(R=>N_.relative(e,R))}));return{content:[{type:"text",text:`# Circular Dependency Analysis
847
861
 
848
- Found ${y.length} circular dependency chain(s).
862
+ Found ${b.length} circular dependency chain(s).
849
863
 
850
- ${JSON.stringify(S,null,2)}`}]}}return{isError:!0,content:[{type:"text",text:"Invalid mode"}]}}async function d_(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 Wd(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).
851
- Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_search_symbol' to find what you need.`}]}}Oe();async function m_(n){let{repoPath:e,compact:r=!1}=n,t=new ce(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();_t();Oe();function f_(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 h_(n){let{repoPath:e}=n;await ee(e);let r=C.getInstance(e),i=We(r,e);new ce(e).updateTopography(i);let o=["Entry","Logic","Data","Utility","Infrastructure","Test","Types","Unknown"],s=`# \u{1F3D7}\uFE0F Architecture Summary
864
+ ${JSON.stringify(k,null,2)}`}]}}return{isError:!0,content:[{type:"text",text:"Invalid mode"}]}}async function D_(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 Yd(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).
865
+ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_search_symbol' to find what you need.`}]}}Ue();async function A_(n){let{repoPath:e,compact:r=!1}=n,t=new pe(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"}}}ee();pt();Ue();function L_(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 O_(n){let{repoPath:e}=n;await ne(e);let r=M.getInstance(e),i=Ve(r,e);new pe(e).updateTopography(i);let o=["Entry","Logic","Data","Utility","Infrastructure","Test","Types","Unknown"],s=`# \u{1F3D7}\uFE0F Architecture Summary
852
866
 
853
867
  `;if(s+=`## Detected Pattern: **${i.pattern}**
854
868
  `,s+=`Confidence: ${i.patternConfidence.toFixed(0)}%
@@ -860,59 +874,59 @@ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_sea
860
874
 
861
875
  `,s+=`| Layer | Files | % of Total |
862
876
  `,s+=`|-------|------:|:----------:|
863
- `;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=f_(c);s+=`| ${p} ${c} | ${l.count} | ${u}% |
877
+ `;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",d=L_(c);s+=`| ${d} ${c} | ${l.count} | ${u}% |
864
878
  `}s+=`
865
879
  ## Top Files by Layer
866
880
 
867
- `;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=f_(c);if(s+=`### ${u} ${c} (${l.count} files)
868
- `,l.topFiles.length>0)for(let p of l.topFiles)s+=`- \`${p.path}\` (${p.confidence}% conf)
869
- `,p.signals.length>0&&(s+=` - ${p.signals.join("; ")}
881
+ `;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=L_(c);if(s+=`### ${u} ${c} (${l.count} files)
882
+ `,l.topFiles.length>0)for(let d of l.topFiles)s+=`- \`${d.path}\` (${d.confidence}% conf)
883
+ `,d.signals.length>0&&(s+=` - ${d.signals.join("; ")}
870
884
  `);else s+=`- _No files classified with high confidence_
871
885
  `;s+=`
872
886
  `}return s+=`---
873
887
  `,s+=`**Next Steps:**
874
- `,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();_t();Oe();import St from"path";async function g_(n){let{repoPath:e}=n;await ee(e);let r=C.getInstance(e),i=We(r,e),o=new ce(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=St.isAbsolute(d)?d:St.join(e,d),f=r.imports.findByFile(m);for(let h of f)h.resolved_path&&l.has(St.relative(e,h.resolved_path))&&s.push(`\u2694\uFE0F LAYER BYPASS: \`${St.relative(e,d)}\` directly imports Data layer \`${St.relative(e,h.resolved_path)}\`. Should go through Logic.`)}let u=o.gravity?.hotspots||[];for(let d of u){let m=Qn(d.filePath,r);(m.layer==="Utility"||m.layer==="Unknown")&&d.gravity>50&&a.push(`\u{1F6A8} GRAVITY ANOMALY: \`${St.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=St.isAbsolute(d)?d:St.join(e,d),f=r.exports.findByFile(m);f.length>10&&a.push(`\u{1F388} ENTRY BLOAT: \`${St.relative(e,d)}\` exports ${f.length} symbols. Entry handlers should be thin interfaces.`)}let p=`# \u{1F575}\uFE0F Architectural Scout Report
875
-
876
- `;return s.length===0&&a.length===0?p+=`\u2705 No significant architectural drift detected. The structure remains "Legit".
877
- `:(s.length>0&&(p+=`## \u274C Structural Violations
878
- `,s.forEach(d=>p+=`- ${d}
879
- `),p+=`
880
- `),a.length>0&&(p+=`## \u26A0\uFE0F Architectural Warnings
881
- `,a.forEach(d=>p+=`- ${d}
882
- `),p+=`
883
- `)),{content:[{type:"text",text:p}]}}Q();B();import ut from"path";Oe();_t();async function y_(n){let{repoPath:e}=n;b.info({repoPath:e},"Setting up repository..."),b.info({repoPath:e}," Ensuring index is up-to-date...");let r=Date.now();await ee(e,void 0,!1,!0,V=>{let te=V.total>0?Math.round(V.current/V.total*100):0;b.info({phase:V.phase,progress:`${V.current}/${V.total}`,percentage:`${te}%`},V.message||`Indexing progress: ${V.phase}`)});let t=((Date.now()-r)/1e3).toFixed(1);b.info({repoPath:e,indexTime:`${t}s`}," Index check complete"),await sn();let o=C.getInstance(e);b.info({repoPath:e},"Populating Project Hologram...");let s=new ce(e),a=We(o,e);s.updateTopography(a);let c=s.computeGravityZones();s.updateGravityZones(c),b.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",_=V=>o.files.findPackageJsonChildren(V),v=V=>{let te=ut.join(V,"package.json"),ae=p.filter(W=>W.file_path===te),de=[],se=W=>ae.some(Ee=>Ee.key.startsWith("dep: ")&&Ee.key.includes(W));se("react")&&de.push("React"),se("vue")&&de.push("Vue"),se("next")&&de.push("Next.js"),se("fastify")&&de.push("Fastify"),se("express")&&de.push("Express"),se("nestjs")&&de.push("NestJS"),(se("prisma")||se("typeorm"))&&de.push("DB");let q=ae.find(W=>W.key==="description")?.value||"";return{stack:de.join(", "),description:q.length>80?q.substring(0,77)+"...":q}},y=ut.join(e,"apps"),w=ut.join(e,"packages"),S=ut.join(e,"services"),$=o.files.hasFilesPattern(y+"/%"),E=o.files.hasFilesPattern(w+"/%"),T=o.files.hasFilesPattern(S+"/%"),R=(V,te)=>{let ae=_(V);ae.length>0&&(m.push(`| **${te}/ (Directory)** | \uFE0F **DO NOT SUMMARIZE FULL DIR** | |`),ae.forEach(de=>{let se=ut.dirname(de.path),q=ut.basename(se);if(q.startsWith("_")||q.includes("template"))return;let W=ut.relative(e,se),Ee=v(se);m.push(`| \u2514\u2500 \`${W}\` | ${Ee.stack||"Module"} | ${Ee.description} |`),f.push(W)}))};$||E||T?(h="Monorepo",R(y,"apps"),R(S,"services"),R(w,"packages")):d.forEach(V=>{let te=V.root;if(!te||te.startsWith("."))return;let ae=v(ut.join(e,te));m.push(`| \`${te}/\` | ${ae.stack||"Module"} | ${ae.description} |`)});let U=ut.join(e,"package.json"),A=p.find(V=>V.key==="name"&&V.kind==="Service"&&V.file_path===U)?.value||ut.basename(e),Z=p.filter(V=>V.kind==="Service"&&(V.key.startsWith("service:")||V.file==="docker-compose.yml")),J=[...new Set(Z.map(V=>V.value).filter(V=>V&&typeof V=="string"&&!V.includes("[object Object]")&&!["postgres","redis","db","worker","undefined"].includes(V.toLowerCase())))],O=J.slice(0,5),P=O.length>0?`Service Cluster: ${O.join(", ")}${J.length>5?` (+${J.length-5} others)`:""}`:"",H=l<100?"small":"large",G=H==="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.',F="";try{let te=new ke(e).detectAndRepairShifts(),ae=new bt(e),de=o.missions.findLastMission();ae.analyzeGhostChanges(de?.commit_sha||void 0),o.intentLogs.countByType("heritage")===0&&new fn(e).analyzeHeritage(20);let q=o.intentLogs.countByType("heritage"),W=o.intentLogs.countByType("discovery");q>0||W>0||te.repaired>0?F=`
888
+ `,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"}}}ee();pt();Ue();import $t from"path";async function C_(n){let{repoPath:e}=n;await ne(e);let r=M.getInstance(e),i=Ve(r,e),o=new pe(e).getSnapshot(),s=[],a=[],c=Object.values(i.layers.Entry.topFiles).map(p=>p.path),l=new Set(Object.values(i.layers.Data.topFiles).map(p=>p.path));for(let p of c){let f=$t.isAbsolute(p)?p:$t.join(e,p),m=r.imports.findByFile(f);for(let h of m)h.resolved_path&&l.has($t.relative(e,h.resolved_path))&&s.push(`\u2694\uFE0F LAYER BYPASS: \`${$t.relative(e,p)}\` directly imports Data layer \`${$t.relative(e,h.resolved_path)}\`. Should go through Logic.`)}let u=o.gravity?.hotspots||[];for(let p of u){let f=Ut(p.filePath,r);(f.layer==="Utility"||f.layer==="Unknown")&&p.gravity>50&&a.push(`\u{1F6A8} GRAVITY ANOMALY: \`${$t.relative(e,p.filePath)}\` has high gravity (${p.gravity.toFixed(0)}) but is classified as ${f.layer}. Consider promoting to Core Logic.`)}for(let p of c){let f=$t.isAbsolute(p)?p:$t.join(e,p),m=r.exports.findByFile(f);m.length>10&&a.push(`\u{1F388} ENTRY BLOAT: \`${$t.relative(e,p)}\` exports ${m.length} symbols. Entry handlers should be thin interfaces.`)}let d=`# \u{1F575}\uFE0F Architectural Scout Report
889
+
890
+ `;return s.length===0&&a.length===0?d+=`\u2705 No significant architectural drift detected. The structure remains "Legit".
891
+ `:(s.length>0&&(d+=`## \u274C Structural Violations
892
+ `,s.forEach(p=>d+=`- ${p}
893
+ `),d+=`
894
+ `),a.length>0&&(d+=`## \u26A0\uFE0F Architectural Warnings
895
+ `,a.forEach(p=>d+=`- ${p}
896
+ `),d+=`
897
+ `)),{content:[{type:"text",text:d}]}}ee();V();import ft from"path";Ue();pt();async function M_(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 ne(e,void 0,!1,!0,J=>{let te=J.total>0?Math.round(J.current/J.total*100):0;$.info({phase:J.phase,progress:`${J.current}/${J.total}`,percentage:`${te}%`},J.message||`Indexing progress: ${J.phase}`)});let t=((Date.now()-r)/1e3).toFixed(1);$.info({repoPath:e,indexTime:`${t}s`}," Index check complete"),await ln();let o=M.getInstance(e);$.info({repoPath:e},"Populating Project Hologram...");let s=new pe(e),a=Ve(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(),d=o.configs.getAll(),p=o.files.getTopDirectories(e),f=[],m=[],h="Standalone",_=J=>o.files.findPackageJsonChildren(J),v=J=>{let te=ft.join(J,"package.json"),ae=d.filter(B=>B.file_path===te),le=[],ie=B=>ae.some(Se=>Se.key.startsWith("dep: ")&&Se.key.includes(B));ie("react")&&le.push("React"),ie("vue")&&le.push("Vue"),ie("next")&&le.push("Next.js"),ie("fastify")&&le.push("Fastify"),ie("express")&&le.push("Express"),ie("nestjs")&&le.push("NestJS"),(ie("prisma")||ie("typeorm"))&&le.push("DB");let q=ae.find(B=>B.key==="description")?.value||"";return{stack:le.join(", "),description:q.length>80?q.substring(0,77)+"...":q}},g=ft.join(e,"apps"),b=ft.join(e,"packages"),x=ft.join(e,"services"),k=o.files.hasFilesPattern(g+"/%"),S=o.files.hasFilesPattern(b+"/%"),P=o.files.hasFilesPattern(x+"/%"),R=(J,te)=>{let ae=_(J);ae.length>0&&(f.push(`| **${te}/ (Directory)** | \uFE0F **DO NOT SUMMARIZE FULL DIR** | |`),ae.forEach(le=>{let ie=ft.dirname(le.path),q=ft.basename(ie);if(q.startsWith("_")||q.includes("template"))return;let B=ft.relative(e,ie),Se=v(ie);f.push(`| \u2514\u2500 \`${B}\` | ${Se.stack||"Module"} | ${Se.description} |`),m.push(B)}))};k||S||P?(h="Monorepo",R(g,"apps"),R(x,"services"),R(b,"packages")):p.forEach(J=>{let te=J.root;if(!te||te.startsWith("."))return;let ae=v(ft.join(e,te));f.push(`| \`${te}/\` | ${ae.stack||"Module"} | ${ae.description} |`)});let U=ft.join(e,"package.json"),I=d.find(J=>J.key==="name"&&J.kind==="Service"&&J.file_path===U)?.value||ft.basename(e),N=d.filter(J=>J.kind==="Service"&&(J.key.startsWith("service:")||J.file==="docker-compose.yml")),j=[...new Set(N.map(J=>J.value).filter(J=>J&&typeof J=="string"&&!J.includes("[object Object]")&&!["postgres","redis","db","worker","undefined"].includes(J.toLowerCase())))],D=j.slice(0,5),z=D.length>0?`Service Cluster: ${D.join(", ")}${j.length>5?` (+${j.length-5} others)`:""}`:"",H=l<100?"small":"large",G=H==="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.',W="";try{let te=new Pe(e).detectAndRepairShifts(),ae=new xt(e),le=o.missions.findLastMission();ae.analyzeGhostChanges(le?.commit_sha||void 0),o.intentLogs.countByType("heritage")===0&&new yn(e).analyzeHeritage(20);let q=o.intentLogs.countByType("heritage"),B=o.intentLogs.countByType("discovery");q>0||B>0||te.repaired>0?W=`
884
898
  ## Shadow Engine Insights
885
899
  `+(q>0?`* **Architectural Heritage**: Bootstrapped ${q} significant historical moves.
886
- `:"")+(W>0?`* **Recent Changes**: Detected ${W} external modifications.
900
+ `:"")+(B>0?`* **Recent Changes**: Detected ${B} external modifications.
887
901
  `:"")+(te.repaired>0?`* **Symbol Healing**: Automatically repaired ${te.repaired} orphaned intent links.
888
- `:""):F=`
902
+ `:""):W=`
889
903
  ## Shadow Engine Status: **Active**
890
904
  * **Integrity**: Git River matches Symbol Index.
891
905
  * **Heritage**: Ready to track developer intent.
892
- `}catch(V){F=`
906
+ `}catch(J){W=`
893
907
  ## Shadow Engine Status: **Offline**
894
- * Error: ${V instanceof Error?V.message:"Unknown"}
895
- `}try{let te=new hn(e).runMaintenance();(te.pruning.deleted>0||te.pruning.converted>0)&&(F+=`
908
+ * Error: ${J instanceof Error?J.message:"Unknown"}
909
+ `}try{let te=new _n(e).runMaintenance();(te.pruning.deleted>0||te.pruning.converted>0)&&(W+=`
896
910
  ### Clean Sweep Cycle
897
911
  * **Pruned**: ${te.pruning.deleted} orphaned logs deleted, ${te.pruning.converted} converted to lapsed.
898
912
  `+(te.compaction.eligible>0?`* **Compaction**: ${te.compaction.eligible} cold missions eligible for briefing synthesis.
899
- `:""))}catch(V){b.warn({error:V},"Metabolism maintenance failed")}let M="";try{let V=o.missions.findActiveByPriority();V?M=`
900
- ## Active Mission: **${V.name}** (#${V.id})
913
+ `:""))}catch(J){$.warn({error:J},"Metabolism maintenance failed")}let Z="";try{let J=o.missions.findActiveByPriority();J?Z=`
914
+ ## Active Mission: **${J.name}** (#${J.id})
901
915
  * Use \`shadow_ops_briefing\` to resume context.
902
- `:M=`
916
+ `:Z=`
903
917
  ## Mission Status: **Idle**
904
918
  * No active mission. Use \`shadow_ops_plan\` to begin task tracking.
905
919
  `}catch{}return{content:[{type:"text",text:`
906
- # Repository Indexed: ${A}
920
+ # Repository Indexed: ${I}
907
921
 
908
922
  \u23F1\uFE0F **Initial deep index completed in ${t}s** (one-time operation - future syncs are instant)
909
923
 
910
924
  ## \u{1F3D7}\uFE0F Architecture: ${h}
911
- ${P?`> ${P}
925
+ ${z?`> ${z}
912
926
  `:""}
913
927
 
914
- ${F}
915
- ${M}
928
+ ${W}
929
+ ${Z}
916
930
 
917
931
  This is a ${H} repository with ${l} files.
918
932
 
@@ -926,9 +940,9 @@ This is a ${H} repository with ${l} files.
926
940
  ## Component Map
927
941
  | Component | Tech Stack | Description |
928
942
  |-----------|------------|-------------|
929
- ${m.length>20?m.slice(0,20).join(`
943
+ ${f.length>20?f.slice(0,20).join(`
930
944
  `)+`
931
- | ... | ... | (*${m.length-20} more components hidden*) |`:m.join(`
945
+ | ... | ... | (*${f.length-20} more components hidden*) |`:f.join(`
932
946
  `)}
933
947
 
934
948
  ## Recommended Exploration Strategy
@@ -944,15 +958,15 @@ ${G}
944
958
 
945
959
  ---
946
960
  **Ready.** What would you like to investigate first?
947
- `}]}}Q();import v_ from"path";import ww from"fs";function kw(n,e,r){let i=n.split(`
948
- `),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||Ew(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(`
949
- `),totalOriginalLines:i.length,foldedToLines:t.length,siblingsShown:c,siblingsFolded:a}}function Ew(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 Am(n){let{repoPath:e,filePath:r,resolver:i}=Ue(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=C.getInstance(e),a=[];if(t.includes(".")){let[E,T]=t.split(".");a=s.exports.findMemberCandidates(E,T,r)}else a=s.exports.findDefinitionCandidates(t,r);if(a.length===0){let E=s.exports.findPotentialParents(t);if(E.length>0){let I=E.map(A=>`\`${A.name}\` (in ${i.getRelative(A.file_path)})`).join(", ");return{content:[{type:"text",text:`Symbol "${t}" not found as a top-level export.
950
- However, it likely exists inside: ${I}.
951
- Try: shadow_inspect_symbol({ symbolName: "${E[0].name}", context: "full" }) to see the class body.`}]}}let R=s.exports.findFuzzyCandidates(t).map(I=>I.name),U=sr(t,R,50,3);if(U.length>0){let I=U.map(A=>` \u2022 \`${A.match}\` (${A.score}% match)`).join(`
961
+ `}]}}ee();import j_ from"path";import _k from"fs";function bk(n,e,r){let i=n.split(`
962
+ `),t=[],o=0;for(let d=0;d<Math.min(i.length,50);d++){let p=i[d].trim();if(p.startsWith("import ")||p.startsWith("from ")||p.startsWith("export ")&&p.includes(" from "))o=d+1;else if(p&&!p.startsWith("//")&&!p.startsWith("/*")&&!p.startsWith("*")&&p!==""&&o>0)break}o>0&&(t.push(...i.slice(0,o)),t.push(""));let s=[...r].sort((d,p)=>d.startLine-p.startLine),a=0,c=0;for(let d of s)if(d.isTarget){t.push(`// \u2501\u2501\u2501 REQUESTED: ${d.name} \u2501\u2501\u2501`);let p=i.slice(d.startLine-1,d.endLine);t.push(...p),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 p=d.signature||xk(i,d.startLine-1,d.kind);p&&(t.push(`${p}`),t.push(` /* implementation: ${d.lineCount} lines */`),t.push(""),a++)}let l=s[s.length-1];if(l)for(let d=l.endLine;d<i.length;d++){let p=i[d].trim();if(p==="}"||p==="};"){t.push(i[d]);break}else if(p&&!p.startsWith("//"))break}return{foldedSource:t.join(`
963
+ `),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 Wm(n){let{repoPath:e,filePath:r,resolver:i}=We(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 ne(e);let s=M.getInstance(e),a=[];if(t.includes(".")){let[S,P]=t.split(".");a=s.exports.findMemberCandidates(S,P,r)}else a=s.exports.findDefinitionCandidates(t,r);if(a.length===0){let S=s.exports.findPotentialParents(t);if(S.length>0){let E=S.map(I=>`\`${I.name}\` (in ${i.getRelative(I.file_path)})`).join(", ");return{content:[{type:"text",text:`Symbol "${t}" not found as a top-level export.
964
+ However, it likely exists inside: ${E}.
965
+ Try: shadow_inspect_symbol({ symbolName: "${S[0].name}", context: "full" }) to see the class body.`}]}}let R=s.exports.findFuzzyCandidates(t).map(E=>E.name),U=pr(t,R,50,3);if(U.length>0){let E=U.map(I=>` \u2022 \`${I.match}\` (${I.score}% match)`).join(`
952
966
  `);return{content:[{type:"text",text:`Error: Symbol "${t}" not found in the index.
953
967
 
954
968
  Suggestions:
955
- ${I}
969
+ ${E}
956
970
 
957
971
  Next steps:
958
972
  \u2022 Search semantically: shadow_search_concept({ query: "${t}" })
@@ -961,8 +975,8 @@ Next steps:
961
975
  Next steps:
962
976
  \u2022 Search for it: shadow_search_concept({ query: "${t}" })
963
977
  \u2022 Try with file path: shadow_inspect_symbol({ symbolName: "${t}", filePath: "..." })
964
- `}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let E=s.imports.findImportSource(c.file_path,t);if(E&&E.resolved_path)return Am({...n,filePath:E.resolved_path})}let l=ww.readFileSync(c.file_path,"utf8"),u=l.split(`
965
- `),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(R=>({name:R.name,kind:R.kind,signature:R.signature||"",startLine:R.start_line,endLine:R.end_line,lineCount:R.end_line-R.start_line+1,isTarget:R.name===c.name&&R.start_line===c.start_line,parentName:R.parent_name}));if(T.length>1){h=kw(l,{name:c.name,startLine:c.start_line,endLine:c.end_line},T);let R=i.getRelative(c.file_path);m=h.foldedSource+`
978
+ `}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let S=s.imports.findImportSource(c.file_path,t);if(S&&S.resolved_path)return Wm({...n,filePath:S.resolved_path})}let l=_k.readFileSync(c.file_path,"utf8"),u=l.split(`
979
+ `),d=c.end_line-c.start_line+1,p=150,f,m=!1,h=null;if(o==="definition"&&d>p){let P=s.exports.findSiblings(c.file_path).map(R=>({name:R.name,kind:R.kind,signature:R.signature||"",startLine:R.start_line,endLine:R.end_line,lineCount:R.end_line-R.start_line+1,isTarget:R.name===c.name&&R.start_line===c.start_line,parentName:R.parent_name}));if(P.length>1){h=bk(l,{name:c.name,startLine:c.start_line,endLine:c.end_line},P);let R=i.getRelative(c.file_path);f=h.foldedSource+`
966
980
 
967
981
  \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
968
982
  \u{1F4CA} Semantic Fold Applied (context: "definition")
@@ -973,35 +987,39 @@ Target Symbol: ${c.name}
973
987
  \u{1F4A1} Need more context?
974
988
  \u2022 Full symbol + dependencies + usage: shadow_inspect_symbol({ symbolName: "${c.name}", context: "full" })
975
989
  \u2022 ALL symbols in this file: shadow_inspect_file({ filePath: "${R}", detailLevel: "signatures" })
976
- \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(`
990
+ \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`,m=!0}else f=u.slice(c.start_line-1,c.start_line-1+p).join(`
977
991
  `)+`
978
992
 
979
- ... (truncated ${p-d} lines)`,f=!0}else m=u.slice(c.start_line-1,c.end_line).join(`
980
- `);let _=c.parent_name?`${c.parent_name}.${c.name}`:c.name,v=s.exports.findHydratedById(c.id),y={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,source:m};if(v&&v.recent_intents&&v.recent_intents.length>0){let E={},T=Date.now();for(let R of v.recent_intents){if(R.is_crystallized&&R.type!=="crystal")continue;let U=R.created_at;U<1e10&&(U*=1e3);let I=new Date(U).getTime(),A=T-I,Z="just now";if(A>0){let J=Math.floor(A/1e3),O=Math.floor(J/60),P=Math.floor(O/60),H=Math.floor(P/24);H>0?Z=`${H}d ago`:P>0?Z=`${P}h ago`:O>0?Z=`${O}m ago`:Z=`${J}s ago`}E[R.type]||(E[R.type]=[]),E[R.type].push(`[${Z}] ${R.content}`)}y.intelligence={working_set_of:v.active_missions.map(R=>`Mission #${R.id}: ${R.name}`),total_intents:v.intent_log_count,recent_activity:E}}else v&&(y.intelligence={working_set_of:v.active_missions.map(E=>`Mission #${E.id}: ${E.name}`),total_intents:v.intent_log_count,recent_activity:null});try{let{generateEmbedding:E}=await Promise.resolve().then(()=>(vt(),Xr)),T=`Symbol: ${y.name}
993
+ ... (truncated ${d-p} lines)`,m=!0}else f=u.slice(c.start_line-1,c.end_line).join(`
994
+ `);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:d,...m&&{truncated:!0,previewLines:p},classification:c.classification,source:f};if(v&&v.recent_intents&&v.recent_intents.length>0){let S={},P=Date.now();for(let R of v.recent_intents){if(R.is_crystallized&&R.type!=="crystal")continue;let U=R.created_at;U<1e10&&(U*=1e3);let E=new Date(U).getTime(),I=P-E,N="just now";if(I>0){let j=Math.floor(I/1e3),D=Math.floor(j/60),z=Math.floor(D/60),H=Math.floor(z/24);H>0?N=`${H}d ago`:z>0?N=`${z}h ago`:D>0?N=`${D}m ago`:N=`${j}s ago`}S[R.type]||(S[R.type]=[]),S[R.type].push(`[${N}] ${R.content}`)}g.intelligence={working_set_of:v.active_missions.map(R=>`Mission #${R.id}: ${R.name}`),total_intents:v.intent_log_count,recent_activity:S}}else v&&(g.intelligence={working_set_of:v.active_missions.map(S=>`Mission #${S.id}: ${S.name}`),total_intents:v.intent_log_count,recent_activity:null});try{let{generateEmbedding:S}=await Promise.resolve().then(()=>(bt(),oi)),P=`Symbol: ${g.name}
981
995
  Signature: ${c.signature||""}
982
- File: ${y.file}`,R=await E(T);if(R){let U=s.intentLogs.findSemanticMatches(R,3,c.id),I=new Promise(Z=>setTimeout(()=>Z([]),100)),A=await Promise.race([U,I]);A&&A.length>0&&(y.intelligence||(y.intelligence={}),y.intelligence.related_knowledge=A.map(Z=>({type:Z.type,content:Z.content,from_symbol:Z.symbol_name,similarity:`${(Z.similarity*100).toFixed(0)}%`})))}}catch{}if(o==="definition")return{content:[{type:"text",text:JSON.stringify(y,null,2)}]};let w={definition:y,dependencies:s.imports.getImportsForFile(c.file_path).map(E=>({module:E.module_specifier,symbols:E.imported_symbols,relativePath:E.resolved_path?v_.relative(e,E.resolved_path):null}))},S=[c.file_path],$=s.imports.findVerifiedDependents(S,t);return w.verifiedUsages=$.slice(0,10).map(E=>({file:v_.relative(e,E.file_path),classification:E.classification,importedSymbols:E.imported_symbols})),{content:[{type:"text",text:JSON.stringify(w,null,2)}]}}Q();import __ from"path";async function b_(n){let{repoPath:e,filePath:r}=Ue(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}=C.getInstance(e),s=t.findByPath(r),a=__.basename(r),c=/\.(ts|tsx|php|py|go)$/.test(a),l;c?l=await oi(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=__.relative(e,r),p=l.exports?.length||0,d="";return i==="structure"&&p>0?d=`
983
-
984
- \u{1F4A1} Showing ${p} symbol names. For full signatures: shadow_inspect_file({ filePath: "${u}", detailLevel: "signatures" })`:i==="signatures"&&p>0&&(d=`
985
-
986
- \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();_t();async function x_(n){let{repoPath:e}=n;try{await ee(e),new bt(e).analyzeGhostChanges();let i=new ke(e),t=i.detectAndRepairShifts(),o=i.syncLifecycle(),a=await new Ze(e).recoverFromGitNotes(),{HologramService:c}=await Promise.resolve().then(()=>(Oe(),By)),l=new c(e),u=We(C.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+=`
987
- \u269B\uFE0F Hologram: Refreshed architectural map (${p.length} hotspots).`,t.repaired>0&&(d+=`
988
- \u2728 Nano-Repair: Fixed ${t.repaired} links.`),a.missionsRecovered>0&&(d+=`
989
- \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}}}Oe();async function S_(n){let{repoPath:e,deep:r}=n;try{await ee(e,5,r);let i=new ke(e),t=i.detectAndRepairShifts(),o=i.syncLifecycle(),s=new ce(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+=`
990
- \u2728 Nano-Repair: Fixed ${t.repaired} links.`),c+=`
991
- \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 $_(n){let{repoPath:e}=n;try{let i=new ke(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}}}B();var Lm=b.child({module:"mcp:tools:env:hooks"});async function w_(n){let{repoPath:e,action:r,enableAutoRefresh:i,enableSymbolHealing:t}=n;if(r==="install"){Lm.info({repoPath:e,enableAutoRefresh:i,enableSymbolHealing:t},"Installing git hooks");let o=Nm({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(`
996
+ File: ${g.file}`,R=await S(P);if(R){let U=s.intentLogs.findSemanticMatches(R,3,c.id),E=new Promise(N=>setTimeout(()=>N([]),100)),I=await Promise.race([U,E]);I&&I.length>0&&(g.intelligence||(g.intelligence={}),g.intelligence.related_knowledge=I.map(N=>({type:N.type,content:N.content,from_symbol:N.symbol_name,similarity:`${(N.similarity*100).toFixed(0)}%`})))}}catch{}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(S=>({module:S.module_specifier,symbols:S.imported_symbols,relativePath:S.resolved_path?j_.relative(e,S.resolved_path):null}))},x=[c.file_path],k=s.imports.findVerifiedDependents(x,t);return b.verifiedUsages=k.slice(0,10).map(S=>({file:j_.relative(e,S.file_path),classification:S.classification,importedSymbols:S.imported_symbols})),{content:[{type:"text",text:JSON.stringify(b,null,2)}]}}ee();pt();import Sk from"fs";import U_ from"path";var $k=new Set(["ClassDeclaration","FunctionDeclaration","TsInterfaceDeclaration","TsTypeAliasDeclaration","TsEnumDeclaration","VariableDeclaration"]);function F_(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bm(n,e,r){let i=r.trim();return!!(!i||i.length>8e3||/^\w{1,4}\s+['"].*['"];?$/.test(i)&&!i.startsWith("export ")||i.includes(`
997
+ import `)&&!i.startsWith("import ")||e&&$k.has(e)&&n&&!new RegExp(`\\b${F_(n)}\\b`).test(i))}function wk(n,e){let r=Math.max(0,(n.start_line||1)-1),i=Math.min(e.length,Math.max(r+1,(n.end_line||n.start_line||1)+1,r+120)),t=e.slice(r,i).join(`
998
+ `),o=qe(t,n.kind);return o?o.length>800?`${o.slice(0,797)}...`:o:n.signature||""}function kk(n,e,r){if(!n)return null;let i=F_(n),t=[];e==="TsTypeAliasDeclaration"&&t.push(new RegExp(`^\\s*export\\s+type\\s+${i}\\b`)),e==="TsInterfaceDeclaration"&&t.push(new RegExp(`^\\s*export\\s+interface\\s+${i}\\b`)),e==="FunctionDeclaration"&&t.push(new RegExp(`^\\s*(?:export\\s+)?(?:async\\s+)?function\\s+${i}\\b`)),e==="ClassDeclaration"&&t.push(new RegExp(`^\\s*(?:export\\s+)?(?:abstract\\s+)?class\\s+${i}\\b`)),e==="VariableDeclaration"&&t.push(new RegExp(`^\\s*(?:export\\s+)?(?:const|let|var)\\s+${i}\\b`)),t.push(new RegExp(`\\b${i}\\b`));for(let o of t)for(let s=0;s<r.length;s++)if(o.test(r[s]))return s+1;return null}function Ek(n,e,r){let i=Math.max(0,n-1);if(e==="TsTypeAliasDeclaration"||e==="VariableDeclaration"||e==="TsEnumDeclaration"){for(let t=i;t<r.length;t++){if(r[t].includes(";"))return t+1;if(/^\s*export\s+(type|interface|class|function|const|let|var)\b/.test(r[t])&&t>i)return t}return Math.min(r.length,n+20)}if(e==="TsInterfaceDeclaration"||e==="ClassDeclaration"||e==="FunctionDeclaration"){let t=0,o=!1;for(let s=i;s<r.length;s++){let a=r[s];for(let c of a)c==="{"?(t+=1,o=!0):c==="}"&&(t-=1);if(o&&t<=0)return s+1}return Math.min(r.length,n+120)}return Math.min(r.length,n+40)}function Ik(n){return Array.isArray(n)?n.filter(e=>e.module!=="__type_reference__"):n}function Tk(n,e){return n?e==="TsTypeAliasDeclaration"?`type ${n}`:e==="TsInterfaceDeclaration"?`interface ${n}`:e==="FunctionDeclaration"?`function ${n}()`:e==="ClassDeclaration"?`class ${n}`:e==="VariableDeclaration"?`const ${n}`:`${e||"symbol"} ${n}`:e||"symbol"}function Rk(n,e){if(!n||e!=="TsTypeAliasDeclaration"&&e!=="TsInterfaceDeclaration")return n;let r=n.indexOf(`
999
+ export `);return r<=0?n:n.slice(0,r).trim()}async function Z_(n){let{repoPath:e,filePath:r}=We(n);if(!r)return{content:[{type:"text",text:"Error: filePath is required"}],isError:!0};let i=n.detailLevel||"signatures";await ne(e);let{files:t,exports:o}=M.getInstance(e),s=t.findByPath(r),a=U_.basename(r),c=/\.(ts|tsx|php|py|go)$/.test(a),l;c?l=await or(r):l={exports:o.findByFile(r),imports:[]};let u=null;if(c)try{u=Sk.readFileSync(r,"utf8").split(`
1000
+ `)}catch{u=null}Array.isArray(l.exports)&&u&&(l.exports=l.exports.map(m=>{let h=typeof m.signature=="string"?m.signature:"",_=m.start_line??m.line??1,v=m.end_line??m.endLine??_;if(Bm(m.name||"",m.kind,h)){let b=kk(m.name||"",m.kind,u),x=b??_,k=b?Ek(x,m.kind,u):v,S=wk({name:m.name||"",kind:m.kind,signature:h,start_line:x,end_line:k},u),P=Rk(S,m.kind),R=Bm(m.name||"",m.kind,P)?Tk(m.name||"",m.kind):P;return{...m,signature:R,start_line:x,end_line:k,line:x,endLine:k,members:Array.isArray(m.members)?m.members.filter(U=>{let E=typeof U.signature=="string"?U.signature:"";return!Bm(U.name||"",U.kind,E)}):m.members}}return m})),l.imports=Ik(l.imports),i==="structure"?(l.exports=l.exports.map(m=>{let h={name:m.name,kind:m.kind,line:m.start_line,classification:m.classification};return m.members&&m.members.length>0?{...h,members:m.members.map(_=>({name:`${m.name}.${_.name}`,kind:_.kind,line:_.start_line}))}:h}),delete l.imports):i==="signatures"&&(l.exports=l.exports.map(m=>{let h={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?{...h,members:m.members.map(_=>({name:`${m.name}.${_.name}`,kind:_.kind,signature:_.signature,line:_.start_line}))}:h}),delete l.imports);let d=U_.relative(e,r),p=l.exports?.length||0,f="";return i==="structure"&&p>0?f=`
1001
+
1002
+ \u{1F4A1} Showing ${p} symbol names. For full signatures: shadow_inspect_file({ filePath: "${d}", detailLevel: "signatures" })`:i==="signatures"&&p>0&&(f=`
1003
+
1004
+ \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&&s.classification!=="Unknown"?s.classification:Ut(r,M.getInstance(e)).layer},null,2)+f}]}}ee();pt();async function H_(n){let{repoPath:e}=n;try{await ne(e),new xt(e).analyzeGhostChanges();let i=new Pe(e),t=i.detectAndRepairShifts(),o=i.syncLifecycle(),a=await new Ge(e).recoverFromGitNotes(),{HologramService:c}=await Promise.resolve().then(()=>(Ue(),rv)),l=new c(e),u=Ve(M.getInstance(e),e);l.updateTopography(u);let d=l.computeGravityZones();l.updateGravityZones(d);let p="Shadow Sync complete. Code changes indexed and intent logs updated.";return p+=`
1005
+ \u269B\uFE0F Hologram: Refreshed architectural map (${d.length} hotspots).`,t.repaired>0&&(p+=`
1006
+ \u2728 Nano-Repair: Fixed ${t.repaired} links.`),a.missionsRecovered>0&&(p+=`
1007
+ \u{1F9EC} Re-hydration: Recovered ${a.missionsRecovered} missions.`),{content:[{type:"text",text:p}]}}catch(r){return{content:[{type:"text",text:`Error: ${r.message}`}],isError:!0}}}Ue();async function W_(n){let{repoPath:e,deep:r}=n;try{let i=r===!0;await ne(e,5,i,i);let t=new Pe(e),o=t.detectAndRepairShifts(),s=t.syncLifecycle(),a=new pe(e);a.refreshTopography();let c=a.computeGravityZones();a.updateGravityZones(c);let l=`Repository at ${e} has been ${r?"deeply ":""}re-indexed.`;return o.repaired>0&&(l+=`
1008
+ \u2728 Nano-Repair: Fixed ${o.repaired} links.`),l+=`
1009
+ \u269B\uFE0F Hologram: Refreshed architectural map (${c.length} hotspots).`,{content:[{type:"text",text:l}]}}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}}async function B_(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}}}V();var Gm=$.child({module:"mcp:tools:env:hooks"});async function G_(n){let{repoPath:e,action:r,enableAutoRefresh:i,enableSymbolHealing:t}=n;if(r==="install"){Gm.info({repoPath:e,enableAutoRefresh:i,enableSymbolHealing:t},"Installing git hooks");let o=Mm({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(`
992
1010
  `):"- None","",`## \u23ED\uFE0F Skipped (${o.skipped.length})`,o.skipped.length>0?o.skipped.map(a=>`- \`${a}\` (already installed)`).join(`
993
1011
  `):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
994
1012
  `)),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(`
995
- `)}]}}if(r==="remove"){Lm.info({repoPath:e},"Uninstalling git hooks");let o=zm(e),s=["# Git Hooks Uninstallation","",`## Removed (${o.removed.length})`,o.removed.length>0?o.removed.map(a=>`- \`${a}\``).join(`
1013
+ `)}]}}if(r==="remove"){Gm.info({repoPath:e},"Uninstalling git hooks");let o=jm(e),s=["# Git Hooks Uninstallation","",`## Removed (${o.removed.length})`,o.removed.length>0?o.removed.map(a=>`- \`${a}\``).join(`
996
1014
  `):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
997
1015
  `))),{content:[{type:"text",text:s.join(`
998
- `)}]}}if(r==="status"){Lm.info({repoPath:e},"Checking git hooks status");let o=ui(e);return{content:[{type:"text",text:["# Git Hooks Status","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
1016
+ `)}]}}if(r==="status"){Gm.info({repoPath:e},"Checking git hooks status");let o=gi(e);return{content:[{type:"text",text:["# Git Hooks Status","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
999
1017
  `):"- None","",`## Not Installed (${o.notInstalled.length})`,o.notInstalled.length>0?o.notInstalled.map(a=>`- \`${a}\``).join(`
1000
1018
  `):"- None","","---",'**To install hooks**: Use `shadow_env_hooks({ action: "install" })`'].join(`
1001
- `)}]}}return{content:[{type:"text",text:`Unknown action: ${r}`}],isError:!0}}Lt();import oa from"path";import k_ from"fs";B();var Iw=b.child({module:"mcp:tools:env:diagnose"});async function E_(n){let{repoPath:e}=n,r=oa.isAbsolute(e)?oa.normalize(e):oa.resolve(process.cwd(),e);Iw.info({repoPath:r},"Running MCP diagnose");let i=["# MCP Server Health Check","",`**Repository path**: \`${r}\``,""],t=!1;try{t=k_.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=oa.join(r,".git"),s=t&&k_.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{Ne(r),a=!0,c=qe(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?ui(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(`
1002
- `)}]}}Q();B();import Tw from"path";import Rw from"fs";var I_=b.child({module:"mcp:tools:workspace:list"});async function T_(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;I_.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(Rw.existsSync(a))try{let{missions:c}=C.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:Tw.basename(a),cross_repo_links:p})}}catch(c){I_.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();B();var Pw=b.child({module:"mcp:tools:workspace:link"});async function R_(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;Pw.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=C.getInstance(e),{missions:a}=C.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}`)}}B();var Nw=b.child({module:"mcp:tools:workspace:fuse"});async function P_(n){let{repoPaths:e,name:r}=n;Nw.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=Vd({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}`)}}B();var zw=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function sa(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=>sa(i,e)):typeof n[r]=="object"&&sa(n[r],e)}function N_(n){if(!(!n||typeof n!="object")){for(let e of zw)if(typeof n[e]=="string")try{n[e]=en(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?en(e):e))}}function z_(n,e){return async r=>{let i=b.child({handler:n});try{N_(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),Ot("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new Vn(r.repoPath);sa(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+=Gr),Ot(o?"FORBIDDEN":"INTERNAL_ERROR",s,{stack:t.stack})}}}function D_(n,e,r){return async i=>{let t=b.child({handler:n});try{N_(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),Ot("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new Vn(i.repoPath);sa(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"),Ot("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+=Gr),Ot(a?"FORBIDDEN":"INTERNAL_ERROR",c,{stack:s.stack})}}}function dr(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=Zg(i,e);return t||n(r)}}var Dw={shadow_ops_plan:{default:_y},shadow_ops_track:{default:$y},shadow_ops_briefing:{default:Cs},shadow_ops_log:{default:ov},shadow_ops_synthesize:{default:Ky},shadow_ops_chronicle:{default:Xy},shadow_ops_context:{default:dr(Qy,"shadow_ops_context")},shadow_ops_health:{default:iv},shadow_ops_graph:{default:lv},shadow_ops_crystallize:{default:pv},shadow_working_set_check:{default:dr(dv,"shadow_working_set_check")},shadow_recon_tree:{default:d_},shadow_recon_hologram:{default:m_},shadow_recon_topography:{default:h_},shadow_recon_scout:{default:g_},shadow_recon_onboard:{default:y_},shadow_search_concept:{default:Qv},shadow_search_symbol:{default:e_},shadow_search_config:{default:n_},shadow_search_path:{default:r_},shadow_analyze_impact:{default:i_},shadow_analyze_flow:{default:s_},shadow_analyze_deps:{default:l_},shadow_analyze_debt:{default:p_},shadow_inspect_symbol:{default:dr(Am,"shadow_inspect_symbol")},shadow_inspect_file:{default:dr(b_,"shadow_inspect_file")},shadow_sync_trace:{default:dr(x_,"shadow_sync_trace")},shadow_sync_index:{default:S_},shadow_sync_repair:{default:dr($_,"shadow_sync_repair")},shadow_env_hooks:{default:w_},shadow_env_diagnose:{default:E_},shadow_workspace_list:{default:T_},shadow_workspace_link:{default:R_},shadow_workspace_fuse:{default:P_}},Aw={shadow_ops_plan:Yd,shadow_ops_track:Xd,shadow_ops_briefing:Qd,shadow_ops_log:em,shadow_ops_synthesize:tm,shadow_ops_chronicle:nm,shadow_ops_context:im,shadow_ops_health:rm,shadow_ops_graph:sm,shadow_ops_crystallize:om,shadow_working_set_check:Xv,shadow_recon_tree:am,shadow_recon_hologram:cm,shadow_recon_topography:lm,shadow_recon_scout:um,shadow_recon_onboard:pm,shadow_search_concept:dm,shadow_search_symbol:mm,shadow_search_config:fm,shadow_search_path:hm,shadow_analyze_impact:gm,shadow_analyze_flow:ym,shadow_analyze_deps:vm,shadow_analyze_debt:_m,shadow_inspect_symbol:bm,shadow_inspect_file:xm,shadow_sync_trace:Sm,shadow_sync_index:$m,shadow_sync_repair:wm,shadow_env_hooks:km,shadow_env_diagnose:Em,shadow_workspace_list:Im,shadow_workspace_link:Tm,shadow_workspace_fuse:Rm},Om=new Map;for(let[n,e]of Object.entries(Dw)){let r=Aw[n];r?Om.set(n,D_(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}.
1019
+ `)}]}}return{content:[{type:"text",text:`Unknown action: ${r}`}],isError:!0}}Ot();import fa from"path";import J_ from"fs";V();var Pk=$.child({module:"mcp:tools:env:diagnose"});async function V_(n){let{repoPath:e}=n,r=fa.isAbsolute(e)?fa.normalize(e):fa.resolve(process.cwd(),e);Pk.info({repoPath:r},"Running MCP diagnose");let i=["# MCP Server Health Check","",`**Repository path**: \`${r}\``,""],t=!1;try{t=J_.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=fa.join(r,".git"),s=t&&J_.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{Le(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?gi(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(`
1020
+ `)}]}}ee();V();import Nk from"path";import zk from"fs";var q_=$.child({module:"mcp:tools:workspace:list"});async function K_(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;q_.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(zk.existsSync(a))try{let{missions:c}=M.getInstance(a),l=c.findAll(r);for(let u of l){let d=c.getLinks(u.id);o.push({...u,repo_path:a,repo_name:Nk.basename(a),cross_repo_links:d})}}catch(c){q_.error({error:c,repoPath:a},"Failed to query repo missions")}if(o.sort((a,c)=>{let l=p=>p==="in-progress"?0:p==="verifying"?1:2,u=l(a.status),d=l(c.status);return u!==d?u-d:(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((d,p)=>(d[p.status]=(d[p.status]||0)+1,d),{}),u=o.reduce((d,p)=>(d[p.repo_name]=(d[p.repo_name]||0)+1,d),{});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)}]}}ee();V();var Dk=$.child({module:"mcp:tools:workspace:link"});async function Y_(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;Dk.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=M.getInstance(e),{missions:a}=M.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}`)}}V();var Ak=$.child({module:"mcp:tools:workspace:fuse"});async function X_(n){let{repoPaths:e,name:r}=n;Ak.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=tm({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}`)}}V();var Lk=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function ha(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=>ha(i,e)):typeof n[r]=="object"&&ha(n[r],e)}function Q_(n){if(!(!n||typeof n!="object")){for(let e of Lk)if(typeof n[e]=="string")try{n[e]=nn(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?nn(e):e))}}function eb(n,e){return async r=>{let i=$.child({handler:n});try{Q_(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),Ct("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new Qn(r.repoPath);ha(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+=Qr),Ct(o?"FORBIDDEN":"INTERNAL_ERROR",s,{stack:t.stack})}}}function tb(n,e,r){return async i=>{let t=$.child({handler:n});try{Q_(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),Ct("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new Qn(i.repoPath);ha(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"),Ct("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+=Qr),Ct(a?"FORBIDDEN":"INTERNAL_ERROR",c,{stack:s.stack})}}}function vr(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=Qg(i,e);return t||n(r)}}var Ok={shadow_ops_plan:{default:Ny},shadow_ops_track:{default:Ly},shadow_ops_briefing:{default:Ws},shadow_ops_log:{default:yv},shadow_ops_synthesize:{default:cv},shadow_ops_chronicle:{default:uv},shadow_ops_context:{default:vr(pv,"shadow_ops_context")},shadow_ops_health:{default:gv},shadow_ops_graph:{default:xv},shadow_ops_crystallize:{default:$v},shadow_working_set_check:{default:vr(wv,"shadow_working_set_check")},shadow_recon_tree:{default:D_},shadow_recon_hologram:{default:A_},shadow_recon_topography:{default:O_},shadow_recon_scout:{default:C_},shadow_recon_onboard:{default:M_},shadow_search_concept:{default:v_},shadow_search_symbol:{default:__},shadow_search_config:{default:x_},shadow_search_path:{default:S_},shadow_analyze_impact:{default:$_},shadow_analyze_flow:{default:I_},shadow_analyze_deps:{default:P_},shadow_analyze_debt:{default:z_},shadow_inspect_symbol:{default:vr(Wm,"shadow_inspect_symbol")},shadow_inspect_file:{default:vr(Z_,"shadow_inspect_file")},shadow_sync_trace:{default:vr(H_,"shadow_sync_trace")},shadow_sync_index:{default:W_},shadow_sync_repair:{default:vr(B_,"shadow_sync_repair")},shadow_env_hooks:{default:G_},shadow_env_diagnose:{default:V_},shadow_workspace_list:{default:K_},shadow_workspace_link:{default:Y_},shadow_workspace_fuse:{default:X_}},Ck={shadow_ops_plan:im,shadow_ops_track:om,shadow_ops_briefing:sm,shadow_ops_log:am,shadow_ops_synthesize:cm,shadow_ops_chronicle:lm,shadow_ops_context:pm,shadow_ops_health:um,shadow_ops_graph:mm,shadow_ops_crystallize:dm,shadow_working_set_check:g_,shadow_recon_tree:fm,shadow_recon_hologram:hm,shadow_recon_topography:gm,shadow_recon_scout:ym,shadow_recon_onboard:vm,shadow_search_concept:_m,shadow_search_symbol:bm,shadow_search_config:xm,shadow_search_path:Sm,shadow_analyze_impact:$m,shadow_analyze_flow:wm,shadow_analyze_deps:km,shadow_analyze_debt:Em,shadow_inspect_symbol:Im,shadow_inspect_file:Tm,shadow_sync_trace:Rm,shadow_sync_index:Pm,shadow_sync_repair:Nm,shadow_env_hooks:zm,shadow_env_diagnose:Dm,shadow_workspace_list:Am,shadow_workspace_link:Lm,shadow_workspace_fuse:Om},Jm=new Map;for(let[n,e]of Object.entries(Ok)){let r=Ck[n];r?Jm.set(n,tb(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}.
1003
1021
 
1004
1022
  \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}.
1005
1023
 
1006
- \u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):Om.set(n,z_(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 Pm(n,e){let r=Om.get(n);if(!r)throw new Error(`Tool not found: ${n}`);return r(e)}var Cm=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}},Lw=new Cm({maxRequests:parseInt(process.env.MCP_RATE_LIMIT_MAX??String(120),10),windowMs:parseInt(process.env.MCP_RATE_LIMIT_WINDOW_MS??String(6e4),10)});function A_(){return Lw}vt();Kr();B();import{readFileSync as Zw}from"fs";var jm;try{jm=JSON.parse(Zw(Ct("package.json"),"utf-8"))}catch(n){b.error({err:n},"Failed to parse package.json, using defaults"),jm={name:"liquid-shadow-mcp",version:"0.0.0"}}var fi=new Ow({name:"liquid-shadow-mcp",version:jm.version},{capabilities:{tools:{},resources:{}}});fi.setRequestHandler(Mw,async()=>({tools:ad}));fi.setRequestHandler(Uw,Hg);fi.setRequestHandler(Fw,Wg);var Hw=A_();fi.setRequestHandler(jw,async n=>{let{name:e,arguments:r}=n.params;if(!Hw.allow())return b.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 Pm(e,r)}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}});async function Mm(){b.info("Shutting down gracefully...");try{await sn(),b.info("Worker pool shutdown complete")}catch(n){b.error({error:n},"Error during cleanup")}}process.on("SIGTERM",async()=>{await Mm(),process.exit(0)});process.on("SIGINT",async()=>{await Mm(),process.exit(0)});async function Ww(){an(!0);let n=new Cw;await fi.connect(n)}Ww().catch(async n=>{process.stderr.write(`Server error: ${n.message}
1007
- `),await Mm(),process.exit(1)});
1024
+ \u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):Jm.set(n,eb(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 Cm(n,e){let r=Jm.get(n);if(!r)throw new Error(`Tool not found: ${n}`);return r(e)}var Vm=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}},Mk=new Vm({maxRequests:parseInt(process.env.MCP_RATE_LIMIT_MAX??String(120),10),windowMs:parseInt(process.env.MCP_RATE_LIMIT_WINDOW_MS??String(6e4),10)});function nb(){return Mk}bt();ni();V();import{readFileSync as Bk}from"fs";var qm;try{qm=JSON.parse(Bk(Mt("package.json"),"utf-8"))}catch(n){$.error({err:n},"Failed to parse package.json, using defaults"),qm={name:"liquid-shadow-mcp",version:"0.0.0"}}var _i=new jk({name:"liquid-shadow-mcp",version:qm.version},{capabilities:{tools:{},resources:{}}});_i.setRequestHandler(Zk,async()=>({tools:hd}));_i.setRequestHandler(Hk,ey);_i.setRequestHandler(Wk,ty);var Gk=nb();_i.setRequestHandler(Fk,async n=>{let{name:e,arguments:r}=n.params;if(!Gk.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 Cm(e,r)}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}});async function Km(){$.info("Shutting down gracefully...");try{await ln(),$.info("Worker pool shutdown complete")}catch(n){$.error({error:n},"Error during cleanup")}}process.on("SIGTERM",async()=>{await Km(),process.exit(0)});process.on("SIGINT",async()=>{await Km(),process.exit(0)});async function Jk(){un(!0);let n=new Uk;await _i.connect(n)}Jk().catch(async n=>{process.stderr.write(`Server error: ${n.message}
1025
+ `),await Km(),process.exit(1)});