@precisionutilityguild/liquid-shadow 1.0.6 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/data/migrations/000_baseline.sql +10 -0
- package/dist/data/migrations/013_file_claims.sql +18 -0
- package/dist/entry/cli/index.js +314 -259
- package/dist/entry/ember/index.js +81 -28
- package/dist/entry/mcp/server.js +281 -226
- package/dist/index.js +282 -227
- package/dist/logic/parser/index.js +16 -14
- package/dist/skills/shadow_sync/SKILL.md +1 -1
- package/dist/web-manifest.json +28 -25
- package/package.json +1 -1
- package/skills/shadow_sync/SKILL.md +1 -1
package/dist/entry/mcp/server.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var Zx=Object.defineProperty;var ue=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ke=(n,e)=>{for(var r in e)Zx(n,r,{get:e[r],enumerable:!0})};import Pw from"pino";var Cw,Nw,E,X=ue(()=>{"use strict";Cw={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},Nw=Pw({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(n,e){return{level:n,severity:Cw[e]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),E=Nw});import Rn from"fs";import zs from"path";import{fileURLToPath as Hw}from"url";function Jw(){let n=Gw;if(Rn.readdirSync(n).some(i=>i.match(/^\d{3}_.*\.sql$/)))return n;let r=zs.resolve(n,"../../data/migrations");return Rn.existsSync(r)&&Rn.readdirSync(r).some(i=>i.match(/^\d{3}_.*\.sql$/))?r:n}function Vw(n){n.exec(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
4
4
|
version INTEGER PRIMARY KEY,
|
|
5
5
|
name TEXT NOT NULL,
|
|
6
6
|
applied_at REAL DEFAULT (unixepoch())
|
|
7
7
|
);
|
|
8
|
-
`)}function
|
|
8
|
+
`)}function qw(n){Vw(n);let e=n.prepare("SELECT version FROM schema_migrations ORDER BY version").all();return new Set(e.map(r=>r.version))}function Kw(n){return Rn.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=Rn.readFileSync(zs.join(n,r),"utf-8").split(/^-- DOWN$/m);return{version:t,name:o,up:a[0].trim(),down:a[1]?.trim()}})}function Yw(n,e){on.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)})(),on.info({version:e.version},"Migration applied successfully")}function Xw(n,e,r){let i=zs.join(e,"000_baseline.sql");if(!Rn.existsSync(i)){on.warn("000_baseline.sql not found \u2014 falling back to incremental migrations");return}on.info("Fresh database detected \u2014 applying consolidated baseline schema");let t=Rn.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)})(),on.info({stamped:r.length},"Baseline applied \u2014 incremental migrations stamped")}function iy(n){let e=qw(n),r=Jw(),i=Kw(r);if(e.size===0){Xw(n,r,i);return}let t=i.filter(o=>!e.has(o.version));if(t.length===0){on.debug("No pending migrations");return}on.info({count:t.length},"Running pending migrations");for(let o of t)Yw(n,o);on.info("All migrations complete")}var on,Bw,Gw,oy=ue(()=>{"use strict";X();on=E.child({module:"migrations"}),Bw=Hw(import.meta.url),Gw=zs.dirname(Bw)});import Qw from"better-sqlite3";import Ds from"path";import qd from"fs";import sy from"crypto";import eE from"os";function Os(n){let e=eE.homedir(),r=Ds.join(e,".mcp-liquid-shadow"),i=Ds.join(r,"dbs");qd.existsSync(i)||qd.mkdirSync(i,{recursive:!0});let t=sy.createHash("sha256").update(n).digest("hex").substring(0,12),s=`${Ds.basename(n).replace(/[^a-zA-Z0-9-_]/g,"_")}_${t}.db`;return Ds.join(i,s)}function tE(n,e){let r=e||Os(n);jt.debug({repoPath:n,dbPath:r},"Initializing database");let i=new Qw(r);return i.pragma("journal_mode = WAL"),i.pragma("busy_timeout = 5000"),iy(i),Ls.set(n,r),sn.set(r,i),jt.debug({repoPath:n,dbPath:r},"Database initialized successfully"),i}function gr(n){return sy.createHash("sha256").update(n,"utf8").digest("hex")}function ay(n,e){return e?gr(n)!==e:!0}function Ae(n){let e=Ls.get(n)||Os(n),r=sn.get(e);if(r){if(r.open)return r;sn.delete(e)}let i=tE(n);return sn.set(e,i),i}function Et(n){let e=Os(n);if(!qd.existsSync(e))return!1;try{let r=Ae(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
|
|
11
|
+
`).get()?.value==="true"?!0:r.prepare("SELECT COUNT(*) as count FROM files").get().count>0}catch(r){return jt.debug({repoPath:n,error:r},"Error checking index status"),!1}}function Kd(n,e){let r=Ae(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)})(),jt.debug({repoPath:n,commitSha:e},"Repository marked as indexed")}function Ms(n){try{return Ae(n).prepare(`
|
|
12
12
|
SELECT value FROM index_metadata
|
|
13
13
|
WHERE key = 'last_indexed_commit'
|
|
14
|
-
`).get()?.value||null}catch(e){return
|
|
14
|
+
`).get()?.value||null}catch(e){return jt.debug({repoPath:n,error:e},"Error getting last indexed commit"),null}}function cy(n){let e=Ls.get(n)||Os(n),r=sn.get(e);r&&(r.open&&(jt.debug({repoPath:n,dbPath:e},"Closing database connection"),r.close()),sn.delete(e)),Ls.delete(n)}function ly(){for(let[n,e]of sn.entries())try{e.open&&(jt.debug({dbPath:n},"Closing database connection"),e.close())}catch(r){jt.error({dbPath:n,err:r},"Error closing database execution")}sn.clear()}var jt,sn,Ls,uy,Ft=ue(()=>{"use strict";X();oy();jt=E.child({module:"db"});sn=new Map,Ls=new Map;process.on("exit",()=>ly());uy=n=>{jt.debug({signal:n},"Received termination signal, closing databases"),ly(),process.exit(0)};process.on("SIGINT",()=>uy("SIGINT"));process.on("SIGTERM",()=>uy("SIGTERM"))});var we,ft=ue(()=>{"use strict";we=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)()}}});function rE(n,e){if(!n)return!1;let r=n.trim();return!r||nE.has(r.toLowerCase())||e.has(r)?!1:/^[A-Za-z_$][A-Za-z0-9_$.]*$/.test(r)}function iE(n){return n.split(/[,|&]/).map(e=>e.trim()).filter(Boolean)}function oE(n){let e=n.replace(/^[({\[]+/,"").replace(/[)}\]]+$/,"").replace(/^readonly\s+/,"").trim();return e&&e.match(/^([A-Za-z_$][A-Za-z0-9_$.]*)/)?.[1]||null}function sE(n){let e=[],r=0,i="",t=!1;for(let o of n){if(o==="<"&&(r++,r===1)){t=!0,i="";continue}if(o===">"&&(r>0&&r--,r===0&&t)){t=!1,i.trim()&&e.push(i),i="";continue}t&&(i+=o)}return e}function aE(n){let e=new Set;for(let r of n){let i=r.split(",").map(t=>t.trim());for(let t of i){let o=t.match(/^([A-Za-z_$][A-Za-z0-9_$]*)/);o?.[1]&&e.add(o[1])}}return e}function Yd(n,e){let r=[];for(let i of iE(n)){let t=oE(i);t&&rE(t,e)&&r.push(t)}return r}function py(n){if(!n)return[];let e=n.replace(/\s+/g," ").trim();if(!e)return[];let r=sE(e),i=aE(r),t=[],o=new Set,s=(l,u,p)=>{let d=`${l}:${u}`;o.has(d)||(o.add(d),t.push({relationship:l,targetName:u,...p?{metadata:p}:{}}))},a=e.match(/\bextends\s+(.+?)(?=\bimplements\b|\{|=|$)/);if(a?.[1]){let l=Yd(a[1],i);for(let u of l)s("extends",u,a[1].trim())}let c=e.match(/\bimplements\s+(.+?)(?=\{|=|$)/);if(c?.[1]){let l=Yd(c[1],i);for(let u of l)s("implements",u,c[1].trim())}for(let l of r){let u=/([A-Za-z_$][A-Za-z0-9_$]*)\s+extends\s+([^,>]+)/g,p=null;for(;(p=u.exec(l))!==null;){let d=p[2]?.trim();if(!d)continue;let m=Yd(d,i);for(let f of m)s("constrained_by",f,d)}}return t}var nE,dy=ue(()=>{"use strict";nE=new Set(["any","unknown","never","void","null","undefined","string","number","boolean","symbol","object","bigint","readonly","keyof","infer","extends","implements","class","interface","type","function","new"])});import cE from"path";var js,my=ue(()=>{"use strict";ft();dy();js=class extends we{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=cE.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
|
|
@@ -87,7 +87,7 @@ var mx=Object.defineProperty;var se=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
|
|
|
87
87
|
SUBSTR(path, LENGTH(?) + 2) as relPath
|
|
88
88
|
FROM files
|
|
89
89
|
WHERE path LIKE ? || '/%/package.json'
|
|
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("DELETE FROM type_graph_edges WHERE file_path = ?"),p=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 (?, ?, ?, ?)"),m=this.db.prepare("INSERT INTO configs (file_path, key, value, kind) VALUES (?, ?, ?, ?)"),f=this.db.prepare("INSERT INTO file_content (file_path, content) VALUES (?, ?)"),
|
|
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("DELETE FROM type_graph_edges WHERE file_path = ?"),p=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 (?, ?, ?, ?)"),m=this.db.prepare("INSERT INTO configs (file_path, key, value, kind) VALUES (?, ?, ?, ?)"),f=this.db.prepare("INSERT INTO file_content (file_path, content) VALUES (?, ?)"),g=this.db.prepare("INSERT INTO event_synapses (file_path, type, name, direction, line_number, code_snippet) VALUES (?, ?, ?, ?, ?, ?)"),$=this.db.prepare("INSERT INTO type_graph_edges (file_path, source_symbol_id, source_symbol_name, target_symbol_name, relationship, line_number, metadata) VALUES (?, ?, ?, ?, ?, ?, ?)"),y=this.db.prepare(`
|
|
91
91
|
INSERT INTO files (path, mtime, last_scanned_at, classification, summary, embedding, content_hash)
|
|
92
92
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
93
93
|
ON CONFLICT(path) DO UPDATE SET
|
|
@@ -97,7 +97,7 @@ var mx=Object.defineProperty;var se=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
|
|
|
97
97
|
summary=excluded.summary,
|
|
98
98
|
embedding=excluded.embedding,
|
|
99
99
|
content_hash=excluded.content_hash
|
|
100
|
-
`),
|
|
100
|
+
`),v=this.db.transaction(S=>{for(let w of S){let{meta:T,exports:z,imports:D,configs:C,events:I,content:A,classification:M,summary:H,embedding:Y,contentHash:O}=w;o.run(T.path),s.run(T.path),a.run(T.path),c.run(T.path),l.run(T.path),u.run(T.path);let q=O??(A&&i?i(A):null);if(y.run(T.path,T.mtime,Date.now(),M||"Unknown",H||"",Y?JSON.stringify(Y):null,q),z){let L=(G,re,J)=>{for(let _ of re){let x=_.embedding?JSON.stringify(_.embedding):null,j=p.run(G,_.name,_.kind,_.signature,_.doc||"",_.line,_.endLine||_.line,_.classification||"Other",_.capabilities||"[]",J,x),P=Number(j.lastInsertRowid);if(Number.isFinite(P)){let B=py(_.signature);for(let K of B)K.targetName!==_.name&&$.run(G,P,_.name,K.targetName,K.relationship,_.line,K.metadata||null)}_.members&&_.members.length>0&&L(G,_.members,j.lastInsertRowid)}};L(T.path,z,null)}if(D)for(let L of D){let G=L.resolved_path!==void 0?L.resolved_path:t?.(L.module,T.path,r)??"";d.run(T.path,L.module,L.name,G)}if(C)for(let L of C)m.run(T.path,L.key,L.value,L.kind);if(A!==void 0&&f.run(T.path,A),I)for(let L of I)g.run(T.path,L.type,L.name,L.direction,L.line,L.snippet)}}),b=500;for(let S=0;S<e.length;S+=b)v(e.slice(S,S+b))}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 Fs,fy=ue(()=>{"use strict";ft();Fs=class n extends we{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(`
|
|
101
101
|
SELECT * FROM exports
|
|
102
102
|
WHERE file_path = ? AND start_line <= ? AND end_line >= ?
|
|
103
103
|
ORDER BY (end_line - start_line) ASC -- Get innermost symbol
|
|
@@ -194,7 +194,7 @@ var mx=Object.defineProperty;var se=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
|
|
|
194
194
|
SELECT * FROM exports
|
|
195
195
|
WHERE lower(name) LIKE ?
|
|
196
196
|
LIMIT ?
|
|
197
|
-
`,`%${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 f of s){let
|
|
197
|
+
`,`%${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 f of s){let g=f.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_");c.push(`e.file_path NOT LIKE '${g}'`)}let l=c.length>0?`AND ${c.join(" AND ")}`:"",d=this.all(`
|
|
198
198
|
SELECT e.name, e.kind, e.file_path, e.start_line
|
|
199
199
|
FROM exports e
|
|
200
200
|
WHERE e.kind IN (
|
|
@@ -215,7 +215,7 @@ var mx=Object.defineProperty;var se=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
|
|
|
215
215
|
AND NOT EXISTS (SELECT 1 FROM imports i WHERE i.resolved_path = e.file_path AND i.imported_symbols LIKE '%*%')
|
|
216
216
|
ORDER BY e.file_path, e.start_line
|
|
217
217
|
LIMIT ?
|
|
218
|
-
`,r*2).filter(f=>!this.isFrameworkEntrypointExport(f)).map(f=>{let{confidence:
|
|
218
|
+
`,r*2).filter(f=>!this.isFrameworkEntrypointExport(f)).map(f=>{let{confidence:g,reason:$}=this.scoreDeadExportConfidence(f);return{...f,confidence:g,reason:$}}),m=d;return a==="high"?m=d.filter(f=>f.confidence==="high"):a==="medium"&&(m=d.filter(f=>f.confidence==="high"||f.confidence==="medium")),m.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=`
|
|
219
219
|
SELECT ws.symbol_id, m.name as mission_name, m.status
|
|
220
220
|
FROM working_set ws
|
|
221
221
|
JOIN missions m ON ws.mission_id = m.id
|
|
@@ -270,7 +270,7 @@ var mx=Object.defineProperty;var se=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ue=(n,e)=>{
|
|
|
270
270
|
'inbound' AS direction
|
|
271
271
|
FROM type_graph_edges
|
|
272
272
|
WHERE target_symbol_name = ?
|
|
273
|
-
`,u=[e];o&&(l+=" AND relationship = ?",u.push(o)),l+=" ORDER BY file_path ASC, line_number ASC, source_symbol_name ASC LIMIT ?",u.push(a),c.push(...this.all(l,...u))}return c.slice(0,a)}findTypeGraphEdgesBySymbolId(e,r={}){let i=this.findById(e);return i?this.findTypeGraphEdges(i.name,{...r,filePath:i.file_path}):[]}}});var
|
|
273
|
+
`,u=[e];o&&(l+=" AND relationship = ?",u.push(o)),l+=" ORDER BY file_path ASC, line_number ASC, source_symbol_name ASC LIMIT ?",u.push(a),c.push(...this.all(l,...u))}return c.slice(0,a)}findTypeGraphEdgesBySymbolId(e,r={}){let i=this.findById(e);return i?this.findTypeGraphEdges(i.name,{...r,filePath:i.file_path}):[]}}});var hy,gy=ue(()=>{"use strict";hy=`
|
|
274
274
|
WITH RECURSIVE dependency_chain AS (
|
|
275
275
|
-- Base case: Direct dependents of the target symbol
|
|
276
276
|
-- Meaning: Files that import the file where the symbol is defined
|
|
@@ -321,7 +321,7 @@ SELECT DISTINCT
|
|
|
321
321
|
dc.imported_symbols
|
|
322
322
|
FROM dependency_chain dc
|
|
323
323
|
ORDER BY dc.depth, dc.consumer_path;
|
|
324
|
-
`});var
|
|
324
|
+
`});var Us,yy=ue(()=>{"use strict";ft();gy();Us=class extends we{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(`
|
|
325
325
|
SELECT * FROM imports
|
|
326
326
|
WHERE resolved_path IS NOT NULL AND resolved_path != ''
|
|
327
327
|
`)}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(`
|
|
@@ -347,7 +347,7 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
347
347
|
SELECT COUNT(*) as count FROM imports
|
|
348
348
|
WHERE resolved_path IN (${i})
|
|
349
349
|
AND (imported_symbols LIKE ? OR imported_symbols = '' OR imported_symbols = '*')
|
|
350
|
-
`,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(
|
|
350
|
+
`,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(hy,e,r,i,r)}getCount(){return this.get("SELECT COUNT(*) as count FROM imports")?.count||0}}});import{fileURLToPath as lE}from"node:url";import{dirname as Xd,join as _y,resolve as uE}from"node:path";import{existsSync as pE}from"node:fs";function mE(){let n=by;for(;n!==Xd(n);){if(pE(_y(n,"package.json")))return n;n=Xd(n)}return uE(by,"..","..")}function et(...n){return _y(mE(),...n)}var dE,by,Pn=ue(()=>{"use strict";dE=lE(import.meta.url),by=Xd(dE)});import{Worker as fE}from"node:worker_threads";import{cpus as hE}from"node:os";import{fileURLToPath as gE}from"node:url";import{dirname as yE,join as vy}from"node:path";import{existsSync as xy}from"node:fs";function bE(){if($y.endsWith(".ts")){let e=vy(Sy,"worker.ts");if(xy(e))return e}let n=vy(Sy,"worker.js");return xy(n)?n:et("dist/logic/domain/embeddings/worker.js")}function br(n){return yr||(yr=new wi(n)),yr}async function _r(){yr&&(await yr.shutdown(),yr=null)}var $y,Sy,wi,yr,wy=ue(()=>{"use strict";X();Pn();$y=gE(import.meta.url),Sy=yE($y);wi=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(2,hE().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{E.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,E.debug("Initialization completed but shutdown was requested");return}this.initialized=!0,E.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=bE();E.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 fE(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){E.debug({workerIndex:r},"Worker ready but shutdown requested, terminating"),s.terminate().catch(()=>{}),i();return}this.workers.push(a),E.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),E.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=>{E.error({err:u},"Failed to replace crashed worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&E.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:g=>{if(o[u]=g,s++,i){let $=Math.min(s*r,e.length);i($,e.length)}p()},reject:g=>{if(o[u]=new Array(l.length).fill(null),s++,E.warn({err:g,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 E.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}E.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,E.info("Embedding worker pool shutdown complete")}},yr=null});var kt={};Ke(kt,{EmbeddingPriorityQueue:()=>em,EmbeddingWorkerPool:()=>wi,cosineSimilarity:()=>Zs,generateEmbedding:()=>nm,generateEmbeddingsBatch:()=>rm,getDefaultPool:()=>br,setUseWorkerThreads:()=>vr,shutdownDefaultPool:()=>_r});async function _E(){return Ei||(Ei=await import("@xenova/transformers"),Ei.env.cacheDir="./.cache",Ei.env.allowLocalModels=!0),Ei}function vr(n){tm=n,E.info({useWorkerThreads:n},"Worker thread mode updated")}function Ey(n=!1){let e=(ki||"").toLowerCase(),r={};return ki&&(r.dtype=ki),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 vE(){E.info({model:Ws,dtype:ki},"Loading embedding model...");let{pipeline:n}=await _E(),e=Ey(!1);try{return await n("feature-extraction",Ws,e)}catch(r){let i=r?.message||"";if(!(i.includes("/onnx/model_quantized.onnx")||i.includes("model_quantized.onnx")))throw r;return E.warn({model:Ws,dtype:ki},"Quantized ONNX artifact missing, retrying with unquantized ONNX"),await n("feature-extraction",Ws,Ey(!0))}}async function Iy(){return Qd||(Qd=vE()),Qd}async function nm(n){try{let r=await(await Iy())(n,{pooling:"mean",normalize:!0});return Array.from(r.data)}catch(e){return E.error({err:e},"Failed to generate embedding"),null}}async function rm(n,e=ky,r){return n.length===0?[]:tm?br().generateEmbeddings(n,e,r):Ty(n,e,r)}async function Ty(n,e,r){let i=new Array(n.length).fill(null),t=await Iy();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){E.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 E.debug({total:n.length,successful:i.filter(o=>o!==null).length},"Batch embedding complete"),i}function Zs(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 Ws,ki,Ei,ky,tm,Qd,em,Je=ue(()=>{"use strict";X();wy();Ws=process.env.EMBEDDING_MODEL??"Xenova/all-MiniLM-L6-v2",ki=process.env.EMBEDDING_DTYPE??"fp32",Ei=null;ky=128,tm=!1;Qd=null;em=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=ky,r){if(this.processing)return E.warn("Queue processing already in progress"),this.results;this.processing=!0;let i=this.queue.length;try{tm?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 Ty(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 br().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 Hs,Ry=ue(()=>{"use strict";ft();Hs=class extends we{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
|
|
351
351
|
CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
|
|
352
352
|
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
|
|
353
353
|
CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
|
|
@@ -438,7 +438,7 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
438
438
|
SELECT linked_repo_path, linked_mission_id, relationship, direction
|
|
439
439
|
FROM cross_repo_links
|
|
440
440
|
WHERE mission_id = ?
|
|
441
|
-
`,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")}addHandoff(e,r){let i=JSON.stringify(r),t=e??0,o=this.insert("INSERT INTO mission_artifacts (mission_id, type, identifier, metadata) VALUES (?, ?, ?, ?)",t,"handoff",r.kind,i),s=[`[handoff:${r.kind}]`,...r.findings.map(a=>a.statement),...r.risks.map(a=>a.description),...r.gaps].filter(Boolean).join(" ");return Promise.resolve().then(()=>(
|
|
441
|
+
`,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")}addHandoff(e,r){let i=JSON.stringify(r),t=e??0,o=this.insert("INSERT INTO mission_artifacts (mission_id, type, identifier, metadata) VALUES (?, ?, ?, ?)",t,"handoff",r.kind,i),s=[`[handoff:${r.kind}]`,...r.findings.map(a=>a.statement),...r.risks.map(a=>a.description),...r.gaps].filter(Boolean).join(" ");return Promise.resolve().then(()=>(Je(),kt)).then(({generateEmbedding:a})=>a(s)).then(a=>{a&&this.run("UPDATE mission_artifacts SET embedding = ? WHERE id = ?",JSON.stringify(a),o)}).catch(()=>{}),o}getHandoffs(e,r,i=20){let t=["type = 'handoff'"],o=[];e!==void 0&&(t.push("mission_id = ?"),o.push(e??0)),r&&(t.push("identifier = ?"),o.push(r));let s=`SELECT * FROM mission_artifacts WHERE ${t.join(" AND ")} ORDER BY created_at DESC LIMIT ?`;return o.push(i),this.all(s,...o)}async findSemanticHandoffs(e,r=5){let{cosineSimilarity:i}=await Promise.resolve().then(()=>(Je(),kt)),t=this.all("SELECT * FROM mission_artifacts WHERE type = 'handoff' AND embedding IS NOT NULL"),o=[];for(let s of t)try{let a=JSON.parse(s.embedding),c=i(e,a);c>.3&&o.push({...s,similarity:c})}catch{}return o.sort((s,a)=>a.similarity-s.similarity).slice(0,r)}}});var Bs,Py=ue(()=>{"use strict";ft();X();Bs=class n extends we{findByMission(e,r=50){return this.all(`
|
|
442
442
|
SELECT
|
|
443
443
|
id, mission_id, symbol_id, file_path, type, content, confidence,
|
|
444
444
|
symbol_name, signature, commit_sha, is_crystallized, crystal_id,
|
|
@@ -459,7 +459,7 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
459
459
|
`,e)}create(e){let r=this.insert(`
|
|
460
460
|
INSERT INTO intent_logs (mission_id, symbol_id, file_path, type, content, confidence, symbol_name, signature, commit_sha)
|
|
461
461
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
462
|
-
`,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=>{
|
|
462
|
+
`,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=>{E.debug({err:i,intentLogId:r},"Failed to generate intent log embedding")}),r}static EMBEDDABLE_TYPES=new Set(["decision","discovery","fix","blocker","note","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(()=>(Je(),kt)),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(()=>(Je(),kt)),o=this.findWithEmbeddings();if(o.length>5e3)return E.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(`
|
|
463
463
|
SELECT id, file_path, symbol_name, signature
|
|
464
464
|
FROM intent_logs
|
|
465
465
|
WHERE symbol_id IS NULL AND symbol_name IS NOT NULL
|
|
@@ -522,28 +522,81 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
522
522
|
FROM intent_logs
|
|
523
523
|
WHERE mission_id = ? AND is_crystallized = 0 AND type NOT IN ('adr', 'system', 'crystal', 'lapsed')
|
|
524
524
|
AND created_at > ?
|
|
525
|
-
ORDER BY created_at DESC LIMIT ?`,e,i.created_at,r-1);return[i,...t]}return this.findByMission(e,r)}async findSemanticTheme(e,r,i=200){let{cosineSimilarity:t}=await Promise.resolve().then(()=>(
|
|
526
|
-
VALUES (NULL, 'crystal', ?, 1.0, 0, NULL, NULL, NULL, NULL, NULL)`,i);if(r.length>0){let o=r.map(()=>"?").join(",");this.run(`UPDATE intent_logs SET is_crystallized = 1, crystal_id = ? WHERE id IN (${o})`,t,...r)}return t})}async backfillEmbeddings(e=64,r){let{generateEmbeddingsBatch:i}=await Promise.resolve().then(()=>(
|
|
525
|
+
ORDER BY created_at DESC LIMIT ?`,e,i.created_at,r-1);return[i,...t]}return this.findByMission(e,r)}async findSemanticTheme(e,r,i=200){let{cosineSimilarity:t}=await Promise.resolve().then(()=>(Je(),kt)),o=this.findWithEmbeddings(),s=[];for(let a of o)if(n.EMBEDDABLE_TYPES.has(a.type)&&!(r&&a.mission_id!==null&&!r.includes(a.mission_id)))try{let c=JSON.parse(a.embedding),l=t(e,c);l>.35&&s.push({...a,_similarity:l})}catch{}return s.sort((a,c)=>c._similarity-a._similarity).slice(0,i).map(({_similarity:a,...c})=>c)}crystallizeTheme(e,r,i){return this.transaction(()=>{let t=this.insert(`INSERT INTO intent_logs (mission_id, type, content, confidence, is_crystallized, symbol_id, file_path, symbol_name, signature, commit_sha)
|
|
526
|
+
VALUES (NULL, 'crystal', ?, 1.0, 0, NULL, NULL, NULL, NULL, NULL)`,i);if(r.length>0){let o=r.map(()=>"?").join(",");this.run(`UPDATE intent_logs SET is_crystallized = 1, crystal_id = ? WHERE id IN (${o})`,t,...r)}return t})}async backfillEmbeddings(e=64,r){let{generateEmbeddingsBatch:i}=await Promise.resolve().then(()=>(Je(),kt)),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++)}),E.info({total:o.length,embedded:l},"Intent log embedding backfill complete"),l}}});var Gs,Cy=ue(()=>{"use strict";ft();Gs=class extends we{findByKey(e,r=20){return this.all(`
|
|
527
527
|
SELECT file_path, key, value, kind
|
|
528
528
|
FROM configs
|
|
529
529
|
WHERE key LIKE ? OR value LIKE ?
|
|
530
530
|
LIMIT ?
|
|
531
|
-
`,`%${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
|
|
531
|
+
`,`%${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 Js,Ny=ue(()=>{"use strict";ft();Js=class extends we{search(e,r=10){return this.all(`
|
|
532
532
|
SELECT file_path, snippet(content_fts, 1, '<b>', '</b>', '...', 20) as snippet
|
|
533
533
|
FROM content_fts
|
|
534
534
|
WHERE content_fts MATCH ?
|
|
535
535
|
LIMIT ?
|
|
536
|
-
`,e,r)}}});var
|
|
537
|
-
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)<=
|
|
536
|
+
`,e,r)}}});var Ay,Vs,zy=ue(()=>{"use strict";ft();Ay=500,Vs=class extends we{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
|
|
537
|
+
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)<=Ay||this.run(`DELETE FROM search_history WHERE id NOT IN (
|
|
538
538
|
SELECT id FROM search_history ORDER BY created_at DESC LIMIT ?
|
|
539
|
-
)`,
|
|
539
|
+
)`,Ay)}}});var qs,Dy=ue(()=>{"use strict";ft();qs=class extends we{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(`
|
|
540
540
|
INSERT INTO hologram_snapshot (section, data, updated_at)
|
|
541
541
|
VALUES (?, ?, unixepoch())
|
|
542
542
|
ON CONFLICT(section) DO UPDATE SET
|
|
543
543
|
data = excluded.data,
|
|
544
544
|
updated_at = excluded.updated_at
|
|
545
|
-
`,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 z,ee=se(()=>{"use strict";Tt();Wg();Hg();Jg();oy();sy();ay();cy();uy();py();z=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=Te(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=Te(e),t={files:new ks(i),exports:new Is(i),imports:new Ts(i),missions:new Ns(i),intentLogs:new Cs(i),configs:new zs(i),content:new As(i),searchHistory:new Ds(i),hologram:new Ls(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),Mg(e)}static clearCache(e){this.repositoryCache.delete(e)}}});function Gw(n){try{return JSON.stringify(n)}catch{return String(n)}}function gt(n){if(n instanceof Error)return n.message;if(typeof n=="string")return n;if(n&&typeof n=="object"&&"message"in n){let e=n.message;if(typeof e=="string"&&e.trim())return e}return Gw(n)}function we(n){if(n instanceof Error){let e;return"cause"in n&&n.cause!==void 0&&(e=gt(n.cause)),{errorName:n.name||"Error",errorMessage:n.message,errorStack:n.stack,...e?{errorCause:e}:{}}}return n&&typeof n=="object"?{errorName:n.constructor?.name||"Object",errorMessage:gt(n)}:{errorName:typeof n,errorMessage:gt(n)}}var cr=se(()=>{"use strict"});var Zs,Ws,yy,Hs,by,vy,_y,xy,Sy,$y,wy,Ey,ky,Iy,hi,Bs,Ty,Ry,Hd=se(()=>{"use strict";Zs=[/\/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],Ws=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],yy=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],Hs=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],by=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],vy=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],_y=[/\/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],xy=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],Sy=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],$y=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],wy=[/\/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],Ey=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],ky=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],Iy=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],hi=[/\.(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)$/],Bs=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],Ty=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],Ry=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var Gs,Ny,Js,Cy,Bd=se(()=>{"use strict";Gs=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],Ny=[/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],Cy=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var Vs,Ay,qs,Dy,Gd=se(()=>{"use strict";Vs=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],Ay=[/\/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],qs=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],Dy=["laravel","symfony","slim","cakephp","codeigniter"]});import Oy from"path";function yn(n,e,r){let i=[],t="Unknown",o=0;r||(r=eE(n,e));let{inDegree:s,outDegree:a}=r,c=(d,m,f,h)=>{for(let v of d)if(v.test(n))return i.push(`${h}: ${v.source}`),t=m,o+=f,!0;return!1},l=!1;if(l||(l=c(Zs,"Entry",45,"Next.js entry")),l||(l=c(by,"Entry",40,"MCP handler")),l||(l=c(_y,"Entry",40,"CLI command")),l||(l=c(hi,"Data",45,"Data layer/Repository")),l||(l=c(wy,"Data",35,"State management")),l||(l=c(yy,"Logic",40,"React component")),l||(l=c(Hs,"Logic",35,"Logic pattern")),l||(l=c(xy,"Logic",35,"Parser/AST")),l||(l=c(Sy,"Logic",35,"Core module")),l||(l=c($y,"Logic",30,"UI layer")),l||(l=c(Iy,"Types",35,"Type definition")),l||(l=c(Gs,"Entry",40,"Python Entry")),l||(l=c(Js,"Data",40,"Python Data")),l||(l=c(Ny,"Logic",35,"Python Logic")),l||(l=c(Vs,"Entry",40,"PHP Entry")),l||(l=c(qs,"Data",40,"PHP Data")),l||(l=c(Ay,"Logic",35,"PHP Logic")),l||(l=c(Ey,"Logic",35,"Hook/Context")),!l){for(let d of vy)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(ky,"Data",35,"Schema definition")&&(l=!0),l||(c(hi,"Data",30,"Path matches data pattern")||c(Bs,"Utility",25,"Path matches utility pattern")||c(Ws,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let d of Jd)if(d.test(n)){i.push(`Test file: ${d.source}`),t="Test",o=50,l=!0;break}l||c(Vd,"Infrastructure",40,"Infrastructure")&&(l=!0);for(let d of Qw)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 Ry)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 Cy)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 Dy)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 Ty)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 eE(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function yt(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=yn(f.path,n);i.set(f.path,h),t[h.layer].push({path:f.path,classification:h})}let o={Entry:Gt(t.Entry,e),Logic:Gt(t.Logic,e),Data:Gt(t.Data,e),Utility:Gt(t.Utility,e),Infrastructure:Gt(t.Infrastructure,e),Test:Gt(t.Test,e),Types:Gt(t.Types,e),Unknown:Gt(t.Unknown,e)},s={};r.forEach(f=>{let h=Oy.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 v=a[f];v&&(c[v]=(c[v]||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}=tE(o,r.length,n);return{pattern:p,patternConfidence:d,layers:o,insights:m,primaryStack:u}}function Gt(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:Oy.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function tE(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 Jd,Vd,Qw,Jt=se(()=>{"use strict";Hd();Bd();Gd();Jd=[/\.(test|spec)\.(ts|tsx|js|jsx)$/i,/tests?\.py$/i,/\/__tests__\//i,/\/tests?\//i,/\.e2e\.(ts|js)$/i,/\.integration\.(ts|js)$/i],Vd=[/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],Qw=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});var My={};Ue(My,{HologramService:()=>he});var nt,he,rt=se(()=>{"use strict";ee();Jt();Q();cr();nt=S.child({module:"hologram"}),he=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=z.getInstance(e)}updateTopography(e){nt.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)),nt.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=yt(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){nt.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)),nt.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){nt.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)),nt.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){nt.debug({repoPath:this.repoPath,section:i.section,...we(t)},"Skipping malformed 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 nt.debug({repoPath:this.repoPath,section:e,...we(i)},"Skipping malformed hologram section"),null}}computeGravityZones(){nt.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=yn(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 nt.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),nt.info({repoPath:this.repoPath},"Hologram cleared")}}});var ab={};Ue(ab,{GraphExporterService:()=>Qd});var sb,Qd,cb=se(()=>{"use strict";ee();Q();sb=S.child({module:"graph-exporter"}),Qd=class{constructor(e){this.repoPath=e;this.repos=z.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;sb.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){sb.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(`
|
|
546
|
-
|
|
545
|
+
`,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 Ks,Ly=ue(()=>{"use strict";ft();Ks=class extends we{claimFile(e,r){try{this.run(`
|
|
546
|
+
INSERT INTO file_claims (file_path, mission_id, claimed_at, updated_at)
|
|
547
|
+
VALUES (?, ?, unixepoch(), unixepoch())
|
|
548
|
+
`,e,r);let i=this.getClaim(e);if(!i)throw new Error(`Failed to hydrate claim after insert for file ${e}`);return{status:"claimed",claim:i}}catch{let i=this.getClaim(e);if(!i)throw new Error(`Failed to read existing claim for file ${e}`);return i.mission_id===r?(this.run("UPDATE file_claims SET updated_at = unixepoch() WHERE file_path = ?",e),{status:"already_claimed",claim:this.getClaim(e)??i}):{status:"conflict",claim:i}}}releaseFile(e,r){let i=this.getClaim(e);return i?r!==void 0&&i.mission_id!==r?{released:!1,reason:"not_owner",claim:i}:(this.run("DELETE FROM file_claims WHERE file_path = ?",e),{released:!0}):{released:!1,reason:"not_found"}}releaseAllForMission(e){return this.run("DELETE FROM file_claims WHERE mission_id = ?",e)}getClaim(e){return this.get(`
|
|
549
|
+
SELECT
|
|
550
|
+
fc.file_path,
|
|
551
|
+
fc.mission_id,
|
|
552
|
+
fc.claimed_at,
|
|
553
|
+
fc.updated_at,
|
|
554
|
+
m.name AS mission_name,
|
|
555
|
+
m.status AS mission_status,
|
|
556
|
+
m.git_branch AS mission_branch
|
|
557
|
+
FROM file_claims fc
|
|
558
|
+
LEFT JOIN missions m ON m.id = fc.mission_id
|
|
559
|
+
WHERE fc.file_path = ?
|
|
560
|
+
`,e)}getClaimsForMission(e){return this.all(`
|
|
561
|
+
SELECT
|
|
562
|
+
fc.file_path,
|
|
563
|
+
fc.mission_id,
|
|
564
|
+
fc.claimed_at,
|
|
565
|
+
fc.updated_at,
|
|
566
|
+
m.name AS mission_name,
|
|
567
|
+
m.status AS mission_status,
|
|
568
|
+
m.git_branch AS mission_branch
|
|
569
|
+
FROM file_claims fc
|
|
570
|
+
LEFT JOIN missions m ON m.id = fc.mission_id
|
|
571
|
+
WHERE fc.mission_id = ?
|
|
572
|
+
ORDER BY fc.file_path ASC
|
|
573
|
+
`,e)}listClaims(){return this.all(`
|
|
574
|
+
SELECT
|
|
575
|
+
fc.file_path,
|
|
576
|
+
fc.mission_id,
|
|
577
|
+
fc.claimed_at,
|
|
578
|
+
fc.updated_at,
|
|
579
|
+
m.name AS mission_name,
|
|
580
|
+
m.status AS mission_status,
|
|
581
|
+
m.git_branch AS mission_branch
|
|
582
|
+
FROM file_claims fc
|
|
583
|
+
LEFT JOIN missions m ON m.id = fc.mission_id
|
|
584
|
+
ORDER BY fc.updated_at DESC, fc.file_path ASC
|
|
585
|
+
`)}getClaimsByFiles(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`
|
|
586
|
+
SELECT
|
|
587
|
+
fc.file_path,
|
|
588
|
+
fc.mission_id,
|
|
589
|
+
fc.claimed_at,
|
|
590
|
+
fc.updated_at,
|
|
591
|
+
m.name AS mission_name,
|
|
592
|
+
m.status AS mission_status,
|
|
593
|
+
m.git_branch AS mission_branch
|
|
594
|
+
FROM file_claims fc
|
|
595
|
+
LEFT JOIN missions m ON m.id = fc.mission_id
|
|
596
|
+
WHERE fc.file_path IN (${r})
|
|
597
|
+
ORDER BY fc.file_path ASC
|
|
598
|
+
`,...e)}}});var N,ee=ue(()=>{"use strict";Ft();my();fy();yy();Ry();Py();Cy();Ny();zy();Dy();Ly();N=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=Ae(e),s=r.files?.database,c=!r.intentLogs||!r.searchHistory||!r.missions||!r.hologram||!r.claims;if(s===o&&o.open&&!c)return r;this.repositoryCache.delete(e)}let i=Ae(e),t={files:new js(i),exports:new Fs(i),imports:new Us(i),missions:new Hs(i),intentLogs:new Bs(i),configs:new Gs(i),content:new Js(i),searchHistory:new Vs(i),hologram:new qs(i),claims:new Ks(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),cy(e)}static clearCache(e){this.repositoryCache.delete(e)}}});function xE(n){try{return JSON.stringify(n)}catch{return String(n)}}function It(n){if(n instanceof Error)return n.message;if(typeof n=="string")return n;if(n&&typeof n=="object"&&"message"in n){let e=n.message;if(typeof e=="string"&&e.trim())return e}return xE(n)}function Re(n){if(n instanceof Error){let e;return"cause"in n&&n.cause!==void 0&&(e=It(n.cause)),{errorName:n.name||"Error",errorMessage:n.message,errorStack:n.stack,...e?{errorCause:e}:{}}}return n&&typeof n=="object"?{errorName:n.constructor?.name||"Object",errorMessage:It(n)}:{errorName:typeof n,errorMessage:It(n)}}var Sr=ue(()=>{"use strict"});var na,ra,Zy,ia,Hy,By,Gy,Jy,Vy,qy,Ky,Yy,Xy,Qy,Ti,oa,eb,tb,sm=ue(()=>{"use strict";na=[/\/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],ra=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],Zy=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],ia=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],Hy=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],By=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],Gy=[/\/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],Jy=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],Vy=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],qy=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],Ky=[/\/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],Yy=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],Xy=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],Qy=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],Ti=[/\.(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)$/],oa=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],eb=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],tb=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var sa,rb,aa,ib,am=ue(()=>{"use strict";sa=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],rb=[/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],aa=[/models\.py$/i,/\/models\/.*\.py$/i,/\/migrations\/.*\.py$/i,/schema\.py$/i,/documents\.py$/i],ib=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var ca,sb,la,ab,cm=ue(()=>{"use strict";ca=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],sb=[/\/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],la=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],ab=["laravel","symfony","slim","cakephp","codeigniter"]});import lb from"path";function Cn(n,e,r){let i=[],t="Unknown",o=0;r||(r=RE(n,e));let{inDegree:s,outDegree:a}=r,c=(d,m,f,g)=>{for(let $ of d)if($.test(n))return i.push(`${g}: ${$.source}`),t=m,o+=f,!0;return!1},l=!1;if(l||(l=c(na,"Entry",45,"Next.js entry")),l||(l=c(Hy,"Entry",40,"MCP handler")),l||(l=c(Gy,"Entry",40,"CLI command")),l||(l=c(Ti,"Data",45,"Data layer/Repository")),l||(l=c(Ky,"Data",35,"State management")),l||(l=c(Zy,"Logic",40,"React component")),l||(l=c(ia,"Logic",35,"Logic pattern")),l||(l=c(Jy,"Logic",35,"Parser/AST")),l||(l=c(Vy,"Logic",35,"Core module")),l||(l=c(qy,"Logic",30,"UI layer")),l||(l=c(Qy,"Types",35,"Type definition")),l||(l=c(sa,"Entry",40,"Python Entry")),l||(l=c(aa,"Data",40,"Python Data")),l||(l=c(rb,"Logic",35,"Python Logic")),l||(l=c(ca,"Entry",40,"PHP Entry")),l||(l=c(la,"Data",40,"PHP Data")),l||(l=c(sb,"Logic",35,"PHP Logic")),l||(l=c(Yy,"Logic",35,"Hook/Context")),!l){for(let d of By)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(Xy,"Data",35,"Schema definition")&&(l=!0),l||(c(Ti,"Data",30,"Path matches data pattern")||c(oa,"Utility",25,"Path matches utility pattern")||c(ra,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let d of lm)if(d.test(n)){i.push(`Test file: ${d.source}`),t="Test",o=50,l=!0;break}l||c(um,"Infrastructure",40,"Infrastructure")&&(l=!0);for(let d of TE)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 tb)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 ib)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 ab)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 eb)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 RE(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function Tt(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 g=Cn(f.path,n);i.set(f.path,g),t[g.layer].push({path:f.path,classification:g})}let o={Entry:an(t.Entry,e),Logic:an(t.Logic,e),Data:an(t.Data,e),Utility:an(t.Utility,e),Infrastructure:an(t.Infrastructure,e),Test:an(t.Test,e),Types:an(t.Types,e),Unknown:an(t.Unknown,e)},s={};r.forEach(f=>{let g=lb.extname(f.path).toLowerCase();g&&(s[g]=(s[g]||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,g])=>{let $=a[f];$&&(c[$]=(c[$]||0)+g)});let l=Object.entries(c).sort((f,g)=>g[1]-f[1]),u=l.length>0?l[0][0]:"Unknown",{pattern:p,patternConfidence:d,insights:m}=PE(o,r.length,n);return{pattern:p,patternConfidence:d,layers:o,insights:m,primaryStack:u}}function an(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:lb.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function PE(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 lm,um,TE,cn=ue(()=>{"use strict";sm();am();cm();lm=[/\.(test|spec)\.(ts|tsx|js|jsx)$/i,/tests?\.py$/i,/\/__tests__\//i,/\/tests?\//i,/\.e2e\.(ts|js)$/i,/\.integration\.(ts|js)$/i],um=[/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],TE=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});var ub={};Ke(ub,{HologramService:()=>Se});var gt,Se,yt=ue(()=>{"use strict";ee();cn();X();Sr();gt=E.child({module:"hologram"}),Se=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=N.getInstance(e)}updateTopography(e){gt.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)),gt.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=Tt(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){gt.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)),gt.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){gt.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)),gt.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){gt.debug({repoPath:this.repoPath,section:i.section,...Re(t)},"Skipping malformed 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 gt.debug({repoPath:this.repoPath,section:e,...Re(i)},"Skipping malformed hologram section"),null}}computeGravityZones(){gt.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=Cn(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 gt.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),gt.info({repoPath:this.repoPath},"Hologram cleared")}}});var Ab={};Ke(Ab,{GraphExporterService:()=>gm});var Nb,gm,zb=ue(()=>{"use strict";ee();X();Nb=E.child({module:"graph-exporter"}),gm=class{constructor(e){this.repoPath=e;this.repos=N.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;Nb.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){Nb.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(`
|
|
599
|
+
`)}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 g=`S${e.id}_${f}`;r.push(` ${g} --> ${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 aI from"better-sqlite3";import jr from"path";import H_ from"fs";import cI from"os";import lI from"crypto";var B_,Ia,uI,G_,Pm,Ta,J_=ue(()=>{"use strict";X();Ft();B_=E.child({module:"fusion-connection"}),Ia=5,uI=1,G_=["files","exports","imports","configs","schema_migrations"],Pm=3,Ta=class{fusionDb;attachedRepos=new Map;fusionDbPath;name;constructor(e){this.name=e.name,this.fusionDbPath=this.getFusionDbPath(e.name),B_.info({name:e.name,path:this.fusionDbPath},"Initializing fused index connection");let r=jr.dirname(this.fusionDbPath);H_.existsSync(r)||H_.mkdirSync(r,{recursive:!0}),this.fusionDb=new aI(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=cI.homedir(),i=jr.join(r,".mcp-liquid-shadow","fused"),t=e.replace(/[^a-zA-Z0-9-_]/g,"_");return jr.join(i,`${t}.db`)}initFusionSchema(){this.fusionDb.exec(`
|
|
547
600
|
CREATE TABLE IF NOT EXISTS fused_repos (
|
|
548
601
|
alias TEXT PRIMARY KEY,
|
|
549
602
|
repo_path TEXT NOT NULL UNIQUE,
|
|
@@ -577,19 +630,19 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
577
630
|
|
|
578
631
|
CREATE INDEX IF NOT EXISTS idx_virtual_edges_source ON virtual_edges(source_repo, source_file_path);
|
|
579
632
|
CREATE INDEX IF NOT EXISTS idx_virtual_edges_target ON virtual_edges(target_repo, target_file_path);
|
|
580
|
-
`),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(
|
|
581
|
-
VALUES (?, ?, ?, ?, unixepoch(), unixepoch())`).run(s,r,t,o);return}catch(c){if(this.isLockContentionError(c)&&a<
|
|
633
|
+
`),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(uI.toString())}attachRepo(e){let r=jr.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=Ae(r),t=i.name;this.validateSchemaCompatibility(i,r);let o=this.getSchemaVersion(i),s=this.generateAlias(r);for(let a=1;a<=Pm;a++)try{this.fusionDb.exec(`ATTACH DATABASE '${t}' AS ${s}`);let c={alias:s,repoPath:r,dbPath:t,schemaVersion:o,attached:!0};this.attachedRepos.set(r,c),this.fusionDb.prepare(`INSERT OR REPLACE INTO fused_repos (alias, repo_path, db_path, schema_version, attached_at, last_validated_at)
|
|
634
|
+
VALUES (?, ?, ?, ?, unixepoch(), unixepoch())`).run(s,r,t,o);return}catch(c){if(this.isLockContentionError(c)&&a<Pm){B_.warn({repoPath:r,attempt:a,maxAttempts:Pm},"Attach failed due to lock contention; retrying");continue}throw c}}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=jr.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=Ae(r.repoPath),t=G_.filter(s=>!this.checkTableExists(i,s)),o=this.getSchemaVersion(i);return{alias:r.alias,repoPath:r.repoPath,schemaVersion:o,compatible:o>=Ia&&t.length===0,missingTables:t}});return{valid:e.every(r=>r.compatible),minVersion:Ia,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=jr.basename(e).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=lI.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<Ia)throw new Error(`Schema version mismatch for ${r}. Expected >= ${Ia}, got ${i}.`);let t=G_.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}}isLockContentionError(e){let r=e instanceof Error?e.message.toLowerCase():String(e).toLowerCase();return r.includes("locked")||r.includes("busy")}get nameValue(){return this.name}get dbPath(){return this.fusionDbPath}}});function Cm(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function pI(n){if(!n)return null;try{let e=JSON.parse(n);return e.path||e.name||null}catch{return null}}function dI(n,e){let r=Cm(n),i=Cm(e);if(r===i)return!0;let t=i.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\$[^/]+/g,"[^/]+");return new RegExp(`^${t}$`).test(r)}function mI(n){bn.info("Starting HTTP gap detection scan");let e=n.getAttachedRepos();if(e.length<2)return bn.warn("Need at least 2 repos for cross-repo dependency detection"),0;let r=[];for(let o of e)try{let s=`
|
|
582
635
|
SELECT id, name, file_path, capabilities
|
|
583
636
|
FROM ${o.alias}.exports
|
|
584
637
|
WHERE kind = 'HTTP Route'
|
|
585
|
-
`,a=n.executeRawQuery(s);for(let c of a){let l=
|
|
638
|
+
`,a=n.executeRawQuery(s);for(let c of a){let l=pI(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){bn.warn({repo:o.alias,error:s},"Failed to query backend routes")}bn.debug({count:r.length},"Found backend routes");let i=[];for(let o of e)try{let s=`
|
|
586
639
|
SELECT file_path, name
|
|
587
640
|
FROM ${o.alias}.event_synapses
|
|
588
641
|
WHERE type = 'api_route' AND direction = 'produce'
|
|
589
|
-
`,a=n.executeRawQuery(s);for(let c of a){let l=
|
|
590
|
-
`));let
|
|
642
|
+
`,a=n.executeRawQuery(s);for(let c of a){let l=Cm(c.name);l&&l.startsWith("/")&&i.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,routePath:l})}}catch(s){bn.warn({repo:o.alias,error:s},"Failed to query frontend API calls")}bn.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&&dI(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){bn.debug({source:o.filePath,target:s.filePath,error:a},"Skipped duplicate edge")}return bn.info({edgesCreated:t,backendRoutes:r.length,frontendCalls:i.length},"HTTP gap detection scan completed"),t}function V_(n){let e=mI(n);return{httpGaps:e,totalEdges:e}}var bn,q_=ue(()=>{"use strict";X();bn=E.child({module:"edge-scanner"})});var fI,Ra,K_=ue(()=>{"use strict";q_();X();fI=E.child({module:"fusion-index-service"}),Ra=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(y=>{let v=`${y.alias}.${i} ${m}`,b="";s&&s.length>0&&(b=s.map(z=>{let D=z.alias||z.table.charAt(0);return`${z.type} JOIN ${y.alias}.${z.table} ${D} ON ${z.on}`}).join(`
|
|
643
|
+
`));let S=a?`WHERE ${a}`:"",w=c&&c.length>0?`GROUP BY ${c.join(", ")}`:"",T=l?`HAVING ${l}`:"";return`SELECT '${y.alias}' as _repo_alias, '${y.repoPath}' as _repo_path, ${f} FROM ${v} ${b} ${S} ${w} ${T}`.trim()}).join(`
|
|
591
644
|
UNION ALL
|
|
592
|
-
`);return u&&(
|
|
645
|
+
`);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=>`
|
|
593
646
|
SELECT '${u.alias}' as _repo_alias, '${u.repoPath}' as _repo_path, ${c}, bm25(${u.alias}.${e}) as _fts_rank
|
|
594
647
|
FROM ${u.alias}.${e} fts
|
|
595
648
|
JOIN ${u.alias}.${r} c ON fts.rowid = c.id
|
|
@@ -611,52 +664,52 @@ WHERE i.resolved_path IS NOT NULL`);return r.join(`
|
|
|
611
664
|
INSERT INTO virtual_edges
|
|
612
665
|
(source_repo, source_file_path, source_symbol_id, target_repo, target_file_path, target_symbol_id, relationship, metadata, confidence, updated_at)
|
|
613
666
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, unixepoch())
|
|
614
|
-
`).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 Ok.info({name:this.connection.nameValue},"Starting edge scan"),gv(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}}});var _v={};Ue(_v,{FusedIndexManager:()=>ga,closeFusedIndex:()=>jk,getFusedIndex:()=>hm,listFusedIndexes:()=>gm});import Mk from"path";function hm(n){let e=kr.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>Mk.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),kr.delete(n.name)}let r=new ga(n);return kr.set(n.name,r),r}function jk(n){let e=kr.get(n);e&&(e.close(),kr.delete(n))}function gm(){return Array.from(kr.keys())}var vv,ga,kr,ya=se(()=>{"use strict";Q();hv();bv();vv=S.child({module:"fused-index"}),ga=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new fa(e),this.service=new ha(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(),vv.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 vv.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},kr=new Map});import{Server as hT}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as gT}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as yT,ListToolsRequestSchema as bT}from"@modelcontextprotocol/sdk/types.js";var zm=[{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)"},tokenBudget:{type:"number",description:"Optional token budget for adaptive folding of low-relevance matches"},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_explain_diff",description:"Explain a diff in one pass: changed symbols, blast radius, type relations, and verification test hints.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},baseCommit:{type:"string",description:"Optional base commit/ref for diff range"},headCommit:{type:"string",description:"Optional head commit/ref for diff range"},staged:{type:"boolean",description:"Analyze staged diff (default true)"},includeUntracked:{type:"boolean",description:"Include untracked files in diff"},maxSymbols:{type:"number",description:"Max changed symbols to explain (default 20)"},impactDepth:{type:"number",description:"Impact traversal depth for each symbol"},impactLimit:{type:"number",description:"Max impact rows per symbol"}},required:["repoPath"]}},{name:"shadow_analyze_type_graph",description:"Query indexed type graph edges (extends, implements, generic constraints) for a symbol.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string",description:"Optional file scope for outbound edges"},direction:{type:"string",enum:["outbound","inbound","both"]},relationship:{type:"string",enum:["extends","implements","constrained_by"]},limit:{type:"number"}},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"]}},{name:"shadow_analyze_mesh",description:'Query the event mesh \u2014 find all producers and consumers of a named event, API route, or pubsub topic across the codebase. For socket events use type="socket_event", for HTTP routes use type="api_route", for pubsub use type="pubsub_topic". Leave type unset to search across all categories. Set includeCrossRepo:true when a fused workspace index exists to include cross-repo edges.',inputSchema:{type:"object",properties:{repoPath:{type:"string"},topic:{type:"string",description:"Event name, route path, or topic name to look up. Supports partial match."},type:{type:"string",enum:["socket_event","api_route","pubsub_topic"],description:"Optional: restrict to one synapse type"},includeCrossRepo:{type:"boolean",description:"Include cross-repo virtual edges from fused index (default false)"},format:{type:"string",enum:["json","text"],description:"Output format (default json)"}},required:["repoPath","topic"]}}];var Am=[{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)"},missionId:{type:"number",description:"Existing mission ID to update in place"},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","planned","in-progress","verifying","completed","failed","skipped","suspended"]},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","note","system","adr"],description:"Intent category (architectural, operational, or narrative)."},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 mission-unlinked (repo-level or symbol/file anchored)."}},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"},branch:{type:"string",description:"Optional git branch scope for mission timeline"}},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)"},branch:{type:"string",description:"Optional branch scope for chronicle/context results"},includeSessionDelta:{type:"boolean",description:'If true, include optional "since last session" drift summary in response'},sinceCommit:{type:"string",description:"Optional baseline commit for drift summary (defaults to last indexed commit)"}},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_crystallize_theme",description:'Cluster semantically related intent logs across all missions by a theme phrase and compress them into a single thematic crystal. Unlike shadow_ops_crystallize which compresses one mission, this crosses mission boundaries. Use for architectural themes that span multiple missions e.g. "authentication decisions" or "database connection handling".',inputSchema:{type:"object",properties:{repoPath:{type:"string"},theme:{type:"string",description:'Theme phrase to search semantically e.g. "authentication decisions"'},missionIds:{type:"array",items:{type:"number"},description:"Optional: restrict to these mission IDs only"},limit:{type:"number",description:"Max logs to match (default 200)"}},required:["repoPath","theme"]}},{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. Lifecycle status mutation is opt-in via flags.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},sinceCommit:{type:"string"},enableContextPivot:{type:"boolean",description:"Opt-in: suspend missions on other branches and resume current branch"},enableMergeSentinel:{type:"boolean",description:"Opt-in: auto-complete missions whose branch is merged into current branch"}},required:["repoPath"]}},{name:"shadow_sync_index",description:"Incremental code re-indexing to reflect latest file changes. Lifecycle status mutation is opt-in via flags.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},deep:{type:"boolean",description:"Force full rebuild"},enableContextPivot:{type:"boolean",description:"Opt-in: suspend missions on other branches and resume current branch"},enableMergeSentinel:{type:"boolean",description:"Opt-in: auto-complete missions whose branch is merged into current branch"}},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"]}},{name:"shadow_ops_handoff",description:"Write a typed findings artifact at the end of an agent run. Call this as the final action of a RECON or analysis session to persist structured findings, risks, and mission links that any subsequent agent can query. Findings are embedded for semantic search.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Mission this handoff is for (optional \u2014 omit for repo-level handoffs)"},kind:{type:"string",enum:["recon_report","risk_assessment","impact_map","debt_scan","custom"]},findings:{type:"array",items:{type:"object",properties:{statement:{type:"string"},confidence:{type:"number"},refs:{type:"object"}},required:["statement","confidence"]},description:"Structured findings. Each must have a statement and confidence 0-1."},risks:{type:"array",items:{type:"object",properties:{severity:{type:"string",enum:["low","medium","high","critical"]},description:{type:"string"},refs:{type:"object"}},required:["severity","description"]}},missionsCreated:{type:"array",items:{type:"number"},description:"Shadow mission IDs created during this agent run"},gaps:{type:"array",items:{type:"string"},description:"What could not be determined"},confidence:{type:"number",description:"Overall run confidence 0-1"},agentTag:{type:"string",description:"Optional agent identifier"}},required:["repoPath","kind","findings"]}},{name:"shadow_ops_handoff_read",description:"Read typed handoff artifacts written by previous agent runs. Provide a query string for semantic search across findings, or missionId/kind to filter directly.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},kind:{type:"string",enum:["recon_report","risk_assessment","impact_map","debt_scan","custom"]},query:{type:"string",description:"Semantic search query \u2014 finds handoffs whose findings match this concept"},limit:{type:"number"}},required:["repoPath"]}}];var g={};Ue(g,{$brand:()=>Pi,$input:()=>Kl,$output:()=>ql,NEVER:()=>Na,TimePrecision:()=>eu,ZodAny:()=>Wp,ZodArray:()=>Jp,ZodBase64:()=>is,ZodBase64URL:()=>os,ZodBigInt:()=>tr,ZodBigIntFormat:()=>cs,ZodBoolean:()=>er,ZodCIDRv4:()=>ns,ZodCIDRv6:()=>rs,ZodCUID:()=>qo,ZodCUID2:()=>Ko,ZodCatch:()=>hd,ZodCodec:()=>gs,ZodCustom:()=>li,ZodCustomStringFormat:()=>Xn,ZodDate:()=>ii,ZodDefault:()=>ld,ZodDiscriminatedUnion:()=>qp,ZodE164:()=>ss,ZodEmail:()=>Go,ZodEmoji:()=>Jo,ZodEnum:()=>Kn,ZodError:()=>U$,ZodExactOptional:()=>sd,ZodFile:()=>id,ZodFirstPartyTypeKind:()=>Id,ZodFunction:()=>wd,ZodGUID:()=>Qr,ZodIPv4:()=>es,ZodIPv6:()=>ts,ZodISODate:()=>Fo,ZodISODateTime:()=>jo,ZodISODuration:()=>Zo,ZodISOTime:()=>Uo,ZodIntersection:()=>Kp,ZodIssueCode:()=>W$,ZodJWT:()=>as,ZodKSUID:()=>Qo,ZodLazy:()=>xd,ZodLiteral:()=>rd,ZodMAC:()=>Lp,ZodMap:()=>td,ZodNaN:()=>yd,ZodNanoID:()=>Vo,ZodNever:()=>Bp,ZodNonOptional:()=>fs,ZodNull:()=>Up,ZodNullable:()=>cd,ZodNumber:()=>Qn,ZodNumberFormat:()=>fn,ZodObject:()=>si,ZodOptional:()=>ms,ZodPipe:()=>hs,ZodPrefault:()=>pd,ZodPromise:()=>$d,ZodReadonly:()=>bd,ZodRealError:()=>Oe,ZodRecord:()=>ci,ZodSet:()=>nd,ZodString:()=>Yn,ZodStringFormat:()=>le,ZodSuccess:()=>fd,ZodSymbol:()=>jp,ZodTemplateLiteral:()=>_d,ZodTransform:()=>od,ZodTuple:()=>Xp,ZodType:()=>re,ZodULID:()=>Yo,ZodURL:()=>ri,ZodUUID:()=>dt,ZodUndefined:()=>Fp,ZodUnion:()=>ai,ZodUnknown:()=>Hp,ZodVoid:()=>Gp,ZodXID:()=>Xo,ZodXor:()=>Vp,_ZodString:()=>Bo,_default:()=>ud,_function:()=>fg,any:()=>Gh,array:()=>oi,base64:()=>Rh,base64url:()=>Ph,bigint:()=>Uh,boolean:()=>Mp,catch:()=>gd,check:()=>hg,cidrv4:()=>Ih,cidrv6:()=>Th,clone:()=>Ne,codec:()=>pg,coerce:()=>Td,config:()=>ge,core:()=>Et,cuid:()=>vh,cuid2:()=>_h,custom:()=>gg,date:()=>Vh,decode:()=>Rp,decodeAsync:()=>Np,describe:()=>yg,discriminatedUnion:()=>eg,e164:()=>Nh,email:()=>lh,emoji:()=>yh,encode:()=>Tp,encodeAsync:()=>Pp,endsWith:()=>Fn,enum:()=>ps,exactOptional:()=>ad,file:()=>ag,flattenError:()=>Fr,float32:()=>Oh,float64:()=>Mh,formatError:()=>Ur,fromJSONSchema:()=>wg,function:()=>fg,getErrorMap:()=>B$,globalRegistry:()=>Ee,gt:()=>ut,gte:()=>Ce,guid:()=>uh,hash:()=>Lh,hex:()=>Dh,hostname:()=>Ah,httpUrl:()=>gh,includes:()=>Mn,instanceof:()=>vg,int:()=>Ho,int32:()=>jh,int64:()=>Zh,intersection:()=>Yp,ipv4:()=>wh,ipv6:()=>kh,iso:()=>qn,json:()=>xg,jwt:()=>Ch,keyof:()=>qh,ksuid:()=>$h,lazy:()=>Sd,length:()=>dn,literal:()=>sg,locales:()=>qr,looseObject:()=>Xh,looseRecord:()=>ng,lowercase:()=>Ln,lt:()=>lt,lte:()=>We,mac:()=>Eh,map:()=>rg,maxLength:()=>pn,maxSize:()=>Ft,meta:()=>bg,mime:()=>Un,minLength:()=>wt,minSize:()=>pt,multipleOf:()=>jt,nan:()=>ug,nanoid:()=>bh,nativeEnum:()=>og,negative:()=>Ro,never:()=>ls,nonnegative:()=>No,nonoptional:()=>md,nonpositive:()=>Po,normalize:()=>Zn,null:()=>Zp,nullable:()=>ti,nullish:()=>cg,number:()=>Op,object:()=>Kh,optional:()=>ei,overwrite:()=>et,parse:()=>wp,parseAsync:()=>Ep,partialRecord:()=>tg,pipe:()=>ni,positive:()=>To,prefault:()=>dd,preprocess:()=>Sg,prettifyError:()=>Wa,promise:()=>mg,property:()=>Co,readonly:()=>vd,record:()=>ed,refine:()=>Ed,regex:()=>Dn,regexes:()=>qe,registry:()=>so,safeDecode:()=>zp,safeDecodeAsync:()=>Dp,safeEncode:()=>Cp,safeEncodeAsync:()=>Ap,safeParse:()=>kp,safeParseAsync:()=>Ip,set:()=>ig,setErrorMap:()=>H$,size:()=>un,slugify:()=>Gn,startsWith:()=>jn,strictObject:()=>Yh,string:()=>Wo,stringFormat:()=>zh,stringbool:()=>_g,success:()=>lg,superRefine:()=>kd,symbol:()=>Hh,templateLiteral:()=>dg,toJSONSchema:()=>Lo,toLowerCase:()=>Hn,toUpperCase:()=>Bn,transform:()=>ds,treeifyError:()=>Za,trim:()=>Wn,tuple:()=>Qp,uint32:()=>Fh,uint64:()=>Wh,ulid:()=>xh,undefined:()=>Bh,union:()=>us,unknown:()=>mn,uppercase:()=>On,url:()=>hh,util:()=>U,uuid:()=>ph,uuidv4:()=>dh,uuidv6:()=>mh,uuidv7:()=>fh,void:()=>Jh,xid:()=>Sh,xor:()=>Qh});var Et={};Ue(Et,{$ZodAny:()=>yl,$ZodArray:()=>Sl,$ZodAsyncError:()=>Qe,$ZodBase64:()=>al,$ZodBase64URL:()=>cl,$ZodBigInt:()=>Qi,$ZodBigIntFormat:()=>ml,$ZodBoolean:()=>Br,$ZodCIDRv4:()=>il,$ZodCIDRv6:()=>ol,$ZodCUID:()=>Gc,$ZodCUID2:()=>Jc,$ZodCatch:()=>Fl,$ZodCheck:()=>ue,$ZodCheckBigIntFormat:()=>Sc,$ZodCheckEndsWith:()=>Ac,$ZodCheckGreaterThan:()=>Gi,$ZodCheckIncludes:()=>Cc,$ZodCheckLengthEquals:()=>Tc,$ZodCheckLessThan:()=>Bi,$ZodCheckLowerCase:()=>Pc,$ZodCheckMaxLength:()=>kc,$ZodCheckMaxSize:()=>$c,$ZodCheckMimeType:()=>Lc,$ZodCheckMinLength:()=>Ic,$ZodCheckMinSize:()=>wc,$ZodCheckMultipleOf:()=>_c,$ZodCheckNumberFormat:()=>xc,$ZodCheckOverwrite:()=>Oc,$ZodCheckProperty:()=>Dc,$ZodCheckRegex:()=>Rc,$ZodCheckSizeEquals:()=>Ec,$ZodCheckStartsWith:()=>zc,$ZodCheckStringFormat:()=>zn,$ZodCheckUpperCase:()=>Nc,$ZodCodec:()=>Jr,$ZodCustom:()=>Vl,$ZodCustomStringFormat:()=>pl,$ZodDate:()=>xl,$ZodDefault:()=>Ll,$ZodDiscriminatedUnion:()=>El,$ZodE164:()=>ll,$ZodEmail:()=>Zc,$ZodEmoji:()=>Hc,$ZodEncodeError:()=>At,$ZodEnum:()=>Pl,$ZodError:()=>jr,$ZodExactOptional:()=>Al,$ZodFile:()=>Cl,$ZodFunction:()=>Bl,$ZodGUID:()=>Fc,$ZodIPv4:()=>tl,$ZodIPv6:()=>nl,$ZodISODate:()=>Xc,$ZodISODateTime:()=>Yc,$ZodISODuration:()=>el,$ZodISOTime:()=>Qc,$ZodIntersection:()=>kl,$ZodJWT:()=>ul,$ZodKSUID:()=>Kc,$ZodLazy:()=>Jl,$ZodLiteral:()=>Nl,$ZodMAC:()=>rl,$ZodMap:()=>Tl,$ZodNaN:()=>Ul,$ZodNanoID:()=>Bc,$ZodNever:()=>vl,$ZodNonOptional:()=>Ml,$ZodNull:()=>gl,$ZodNullable:()=>Dl,$ZodNumber:()=>Xi,$ZodNumberFormat:()=>dl,$ZodObject:()=>cf,$ZodObjectJIT:()=>$l,$ZodOptional:()=>to,$ZodPipe:()=>Zl,$ZodPrefault:()=>Ol,$ZodPromise:()=>Gl,$ZodReadonly:()=>Wl,$ZodRealError:()=>Le,$ZodRecord:()=>Il,$ZodRegistry:()=>oo,$ZodSet:()=>Rl,$ZodString:()=>ln,$ZodStringFormat:()=>ce,$ZodSuccess:()=>jl,$ZodSymbol:()=>fl,$ZodTemplateLiteral:()=>Hl,$ZodTransform:()=>zl,$ZodTuple:()=>eo,$ZodType:()=>te,$ZodULID:()=>Vc,$ZodURL:()=>Wc,$ZodUUID:()=>Uc,$ZodUndefined:()=>hl,$ZodUnion:()=>Gr,$ZodUnknown:()=>bl,$ZodVoid:()=>_l,$ZodXID:()=>qc,$ZodXor:()=>wl,$brand:()=>Pi,$constructor:()=>w,$input:()=>Kl,$output:()=>ql,Doc:()=>Hr,JSONSchema:()=>ah,JSONSchemaGenerator:()=>Oo,NEVER:()=>Na,TimePrecision:()=>eu,_any:()=>xu,_array:()=>Tu,_base64:()=>wo,_base64url:()=>Eo,_bigint:()=>fu,_boolean:()=>du,_catch:()=>z$,_check:()=>sh,_cidrv4:()=>So,_cidrv6:()=>$o,_coercedBigint:()=>hu,_coercedBoolean:()=>mu,_coercedDate:()=>ku,_coercedNumber:()=>su,_coercedString:()=>Xl,_cuid:()=>ho,_cuid2:()=>go,_custom:()=>Pu,_date:()=>Eu,_decode:()=>Li,_decodeAsync:()=>Mi,_default:()=>P$,_discriminatedUnion:()=>b$,_e164:()=>ko,_email:()=>ao,_emoji:()=>mo,_encode:()=>Di,_encodeAsync:()=>Oi,_endsWith:()=>Fn,_enum:()=>w$,_file:()=>Ru,_float32:()=>cu,_float64:()=>lu,_gt:()=>ut,_gte:()=>Ce,_guid:()=>Kr,_includes:()=>Mn,_int:()=>au,_int32:()=>uu,_int64:()=>gu,_intersection:()=>v$,_ipv4:()=>_o,_ipv6:()=>xo,_isoDate:()=>nu,_isoDateTime:()=>tu,_isoDuration:()=>iu,_isoTime:()=>ru,_jwt:()=>Io,_ksuid:()=>vo,_lazy:()=>O$,_length:()=>dn,_literal:()=>k$,_lowercase:()=>Ln,_lt:()=>lt,_lte:()=>We,_mac:()=>Ql,_map:()=>S$,_max:()=>We,_maxLength:()=>pn,_maxSize:()=>Ft,_mime:()=>Un,_min:()=>Ce,_minLength:()=>wt,_minSize:()=>pt,_multipleOf:()=>jt,_nan:()=>Iu,_nanoid:()=>fo,_nativeEnum:()=>E$,_negative:()=>Ro,_never:()=>$u,_nonnegative:()=>No,_nonoptional:()=>N$,_nonpositive:()=>Po,_normalize:()=>Zn,_null:()=>_u,_nullable:()=>R$,_number:()=>ou,_optional:()=>T$,_overwrite:()=>et,_parse:()=>Rn,_parseAsync:()=>Pn,_pipe:()=>A$,_positive:()=>To,_promise:()=>M$,_property:()=>Co,_readonly:()=>D$,_record:()=>x$,_refine:()=>Nu,_regex:()=>Dn,_safeDecode:()=>Fi,_safeDecodeAsync:()=>Zi,_safeEncode:()=>ji,_safeEncodeAsync:()=>Ui,_safeParse:()=>Nn,_safeParseAsync:()=>Cn,_set:()=>$$,_size:()=>un,_slugify:()=>Gn,_startsWith:()=>jn,_string:()=>Yl,_stringFormat:()=>Jn,_stringbool:()=>Du,_success:()=>C$,_superRefine:()=>Cu,_symbol:()=>bu,_templateLiteral:()=>L$,_toLowerCase:()=>Hn,_toUpperCase:()=>Bn,_transform:()=>I$,_trim:()=>Wn,_tuple:()=>_$,_uint32:()=>pu,_uint64:()=>yu,_ulid:()=>yo,_undefined:()=>vu,_union:()=>g$,_unknown:()=>Su,_uppercase:()=>On,_url:()=>Yr,_uuid:()=>co,_uuidv4:()=>lo,_uuidv6:()=>uo,_uuidv7:()=>po,_void:()=>wu,_xid:()=>bo,_xor:()=>y$,clone:()=>Ne,config:()=>ge,createStandardJSONSchemaMethod:()=>Vn,createToJSONSchemaMethod:()=>Lu,decode:()=>Ux,decodeAsync:()=>Wx,describe:()=>zu,encode:()=>Fx,encodeAsync:()=>Zx,extractDefs:()=>Zt,finalize:()=>Wt,flattenError:()=>Fr,formatError:()=>Ur,globalConfig:()=>Cr,globalRegistry:()=>Ee,initializeContext:()=>Ut,isValidBase64:()=>sl,isValidBase64URL:()=>rf,isValidJWT:()=>of,locales:()=>qr,meta:()=>Au,parse:()=>zi,parseAsync:()=>Ai,prettifyError:()=>Wa,process:()=>ae,regexes:()=>qe,registry:()=>so,safeDecode:()=>Bx,safeDecodeAsync:()=>Jx,safeEncode:()=>Hx,safeEncodeAsync:()=>Gx,safeParse:()=>Ha,safeParseAsync:()=>Ba,toDotPath:()=>jm,toJSONSchema:()=>Lo,treeifyError:()=>Za,util:()=>U,version:()=>Mc});var Na=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 p=0;p<u.length;p++){let d=u[p];d in a||(a[d]=l[d].bind(a))}}let t=r?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:n});function s(a){var c;let l=r?.Parent?new o:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(n)}),Object.defineProperty(s,"name",{value:n}),s}var Pi=Symbol("zod_brand"),Qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},At=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Cr={};function ge(n){return n&&Object.assign(Cr,n),Cr}var U={};Ue(U,{BIGINT_FORMAT_RANGES:()=>Ua,Class:()=>za,NUMBER_FORMAT_RANGES:()=>Fa,aborted:()=>Mt,allowsEval:()=>La,assert:()=>bx,assertEqual:()=>fx,assertIs:()=>gx,assertNever:()=>yx,assertNotEqual:()=>hx,assignProp:()=>Lt,base64ToUint8Array:()=>Lm,base64urlToUint8Array:()=>Dx,cached:()=>In,captureStackTrace:()=>Ci,cleanEnum:()=>Ax,cleanRegex:()=>Dr,clone:()=>Ne,cloneDef:()=>_x,createTransparentProxy:()=>kx,defineLazy:()=>ie,esc:()=>Ni,escapeRegex:()=>Ve,extend:()=>Rx,finalizeIssue:()=>De,floatSafeRemainder:()=>Aa,getElementAtPath:()=>xx,getEnumValues:()=>Ar,getLengthableOrigin:()=>Mr,getParsedType:()=>Ex,getSizableOrigin:()=>Or,hexToUint8Array:()=>Ox,isObject:()=>an,isPlainObject:()=>Ot,issue:()=>Tn,joinValues:()=>T,jsonStringifyReplacer:()=>kn,merge:()=>Nx,mergeDefs:()=>$t,normalizeParams:()=>Z,nullish:()=>Dt,numKeys:()=>wx,objectClone:()=>vx,omit:()=>Tx,optionalKeys:()=>ja,parsedType:()=>F,partial:()=>Cx,pick:()=>Ix,prefixIssues:()=>Ze,primitiveTypes:()=>Ma,promiseAllObject:()=>Sx,propertyKeyTypes:()=>Lr,randomString:()=>$x,required:()=>zx,safeExtend:()=>Px,shallowClone:()=>Oa,slugify:()=>Da,stringifyPrimitive:()=>j,uint8ArrayToBase64:()=>Om,uint8ArrayToBase64url:()=>Lx,uint8ArrayToHex:()=>Mx,unwrapMessage:()=>zr});function fx(n){return n}function hx(n){return n}function gx(n){}function yx(n){throw new Error("Unexpected value in exhaustive check")}function bx(n){}function Ar(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=>j(r)).join(e)}function kn(n,e){return typeof e=="bigint"?e.toString():e}function In(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Dt(n){return n==null}function Dr(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function Aa(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 Dm=Symbol("evaluating");function ie(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==Dm)return i===void 0&&(i=Dm,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function vx(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function Lt(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $t(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function _x(n){return $t(n._zod.def)}function xx(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function Sx(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 $x(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function Ni(n){return JSON.stringify(n)}function Da(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ci="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function an(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var La=In(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function Ot(n){if(an(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(an(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Oa(n){return Ot(n)?{...n}:Array.isArray(n)?[...n]:n}function wx(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var Ex=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}`)}},Lr=new Set(["string","number","symbol"]),Ma=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ve(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ne(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function Z(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function kx(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 j(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function ja(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var Fa={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]},Ua={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ix(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=$t(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 Lt(this,"shape",s),s},checks:[]});return Ne(n,o)}function Tx(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=$t(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 Lt(this,"shape",s),s},checks:[]});return Ne(n,o)}function Rx(n,e){if(!Ot(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=$t(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return Lt(this,"shape",o),o}});return Ne(n,t)}function Px(n,e){if(!Ot(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=$t(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return Lt(this,"shape",i),i}});return Ne(n,r)}function Nx(n,e){let r=$t(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return Lt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Ne(n,r)}function Cx(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=$t(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 Lt(this,"shape",c),c},checks:[]});return Ne(e,s)}function zx(n,e,r){let i=$t(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 Lt(this,"shape",o),o}});return Ne(e,i)}function Mt(n,e=0){if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function Ze(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function zr(n){return typeof n=="string"?n:n?.message}function De(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=zr(n.inst?._zod.def?.error?.(n))??zr(e?.error?.(n))??zr(r.customError?.(n))??zr(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Or(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function Mr(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function F(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 Tn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function Ax(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Lm(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 Om(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function Dx(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Lm(e+r)}function Lx(n){return Om(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ox(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 Mx(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var za=class{constructor(...e){}};var Mm=(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,kn,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},jr=w("$ZodError",Mm),Le=w("$ZodError",Mm,{Parent:Error});function Fr(n,e=r=>r.message){let r={},i=[];for(let t of n.issues)t.path.length>0?(r[t.path[0]]=r[t.path[0]]||[],r[t.path[0]].push(e(t))):i.push(e(t));return{formErrors:i,fieldErrors:r}}function Ur(n,e=r=>r.message){let r={_errors:[]},i=t=>{for(let o of t.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return i(n),r}function Za(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 Wa(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(`
|
|
615
|
-
`)}var Rn=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 Qe;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>De(c,o,ge())));throw Ci(a,t?.callee),a}return s.value},zi=Rn(Le),Pn=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=>De(c,o,ge())));throw Ci(a,t?.callee),a}return s.value},Ai=Pn(Le),Nn=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 Qe;return o.issues.length?{success:!1,error:new(n??jr)(o.issues.map(s=>De(s,t,ge())))}:{success:!0,data:o.value}},Ha=Nn(Le),Cn=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=>De(s,t,ge())))}:{success:!0,data:o.value}},Ba=Cn(Le),Di=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Rn(n)(e,r,t)},Fx=Di(Le),Li=n=>(e,r,i)=>Rn(n)(e,r,i),Ux=Li(Le),Oi=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Pn(n)(e,r,t)},Zx=Oi(Le),Mi=n=>async(e,r,i)=>Pn(n)(e,r,i),Wx=Mi(Le),ji=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Nn(n)(e,r,t)},Hx=ji(Le),Fi=n=>(e,r,i)=>Nn(n)(e,r,i),Bx=Fi(Le),Ui=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Cn(n)(e,r,t)},Gx=Ui(Le),Zi=n=>async(e,r,i)=>Cn(n)(e,r,i),Jx=Zi(Le);var qe={};Ue(qe,{base64:()=>ac,base64url:()=>Wi,bigint:()=>mc,boolean:()=>hc,browserEmail:()=>tS,cidrv4:()=>oc,cidrv6:()=>sc,cuid:()=>Ga,cuid2:()=>Ja,date:()=>lc,datetime:()=>pc,domain:()=>iS,duration:()=>Xa,e164:()=>cc,email:()=>ec,emoji:()=>tc,extendedDuration:()=>Vx,guid:()=>Qa,hex:()=>oS,hostname:()=>rS,html5Email:()=>Xx,idnEmail:()=>eS,integer:()=>fc,ipv4:()=>nc,ipv6:()=>rc,ksuid:()=>Ka,lowercase:()=>bc,mac:()=>ic,md5_base64:()=>aS,md5_base64url:()=>cS,md5_hex:()=>sS,nanoid:()=>Ya,null:()=>gc,number:()=>Hi,rfc5322Email:()=>Qx,sha1_base64:()=>uS,sha1_base64url:()=>pS,sha1_hex:()=>lS,sha256_base64:()=>mS,sha256_base64url:()=>fS,sha256_hex:()=>dS,sha384_base64:()=>gS,sha384_base64url:()=>yS,sha384_hex:()=>hS,sha512_base64:()=>vS,sha512_base64url:()=>_S,sha512_hex:()=>bS,string:()=>dc,time:()=>uc,ulid:()=>Va,undefined:()=>yc,unicodeEmail:()=>Fm,uppercase:()=>vc,uuid:()=>cn,uuid4:()=>qx,uuid6:()=>Kx,uuid7:()=>Yx,xid:()=>qa});var Ga=/^[cC][^\s-]{8,}$/,Ja=/^[0-9a-z]+$/,Va=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qa=/^[0-9a-vA-V]{20}$/,Ka=/^[A-Za-z0-9]{27}$/,Ya=/^[a-zA-Z0-9_-]{21}$/,Xa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Vx=/^[-+]?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)?)??$/,Qa=/^([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})$/,cn=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)$/,qx=cn(4),Kx=cn(6),Yx=cn(7),ec=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xx=/^[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])?)*$/,Qx=/^(([^<>()\[\]\\.,;:\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,}))$/,Fm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,eS=Fm,tS=/^[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])?)*$/,nS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function tc(){return new RegExp(nS,"u")}var nc=/^(?:(?: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])$/,rc=/^(([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}|:))$/,ic=n=>{let e=Ve(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},oc=/^((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])$/,sc=/^(([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])$/,ac=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wi=/^[A-Za-z0-9_-]*$/,rS=/^(?=.{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])?)*\.?$/,iS=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,cc=/^\+[1-9]\d{6,14}$/,Um="(?:(?:\\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])))",lc=new RegExp(`^${Um}$`);function Zm(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 uc(n){return new RegExp(`^${Zm(n)}$`)}function pc(n){let e=Zm({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(`^${Um}T(?:${i})$`)}var dc=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},mc=/^-?\d+n?$/,fc=/^-?\d+$/,Hi=/^-?\d+(?:\.\d+)?$/,hc=/^(?:true|false)$/i,gc=/^null$/i;var yc=/^undefined$/i;var bc=/^[^A-Z]*$/,vc=/^[^a-z]*$/,oS=/^[0-9a-fA-F]*$/;function Zr(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function Wr(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var sS=/^[0-9a-fA-F]{32}$/,aS=Zr(22,"=="),cS=Wr(22),lS=/^[0-9a-fA-F]{40}$/,uS=Zr(27,"="),pS=Wr(27),dS=/^[0-9a-fA-F]{64}$/,mS=Zr(43,"="),fS=Wr(43),hS=/^[0-9a-fA-F]{96}$/,gS=Zr(64,""),yS=Wr(64),bS=/^[0-9a-fA-F]{128}$/,vS=Zr(86,"=="),_S=Wr(86);var ue=w("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),Hm={number:"number",bigint:"bigint",object:"date"},Bi=w("$ZodCheckLessThan",(n,e)=>{ue.init(n,e);let r=Hm[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})}}),Gi=w("$ZodCheckGreaterThan",(n,e)=>{ue.init(n,e);let r=Hm[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})}}),_c=w("$ZodCheckMultipleOf",(n,e)=>{ue.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):Aa(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})}}),xc=w("$ZodCheckNumberFormat",(n,e)=>{ue.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=Fa[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=fc)}),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})}}),Sc=w("$ZodCheckBigIntFormat",(n,e)=>{ue.init(n,e);let[r,i]=Ua[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})}}),$c=w("$ZodCheckMaxSize",(n,e)=>{var r;ue.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Dt(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:Or(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),wc=w("$ZodCheckMinSize",(n,e)=>{var r;ue.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Dt(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:Or(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Ec=w("$ZodCheckSizeEquals",(n,e)=>{var r;ue.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Dt(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:Or(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})}}),kc=w("$ZodCheckMaxLength",(n,e)=>{var r;ue.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Dt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;if(t.length<=e.maximum)return;let s=Mr(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Ic=w("$ZodCheckMinLength",(n,e)=>{var r;ue.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Dt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;if(t.length>=e.minimum)return;let s=Mr(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Tc=w("$ZodCheckLengthEquals",(n,e)=>{var r;ue.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Dt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.length,t.maximum=e.length,t.length=e.length}),n._zod.check=i=>{let t=i.value,o=t.length;if(o===e.length)return;let s=Mr(t),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),zn=w("$ZodCheckStringFormat",(n,e)=>{var r,i;ue.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=()=>{})}),Rc=w("$ZodCheckRegex",(n,e)=>{zn.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})}}),Pc=w("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=bc),zn.init(n,e)}),Nc=w("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=vc),zn.init(n,e)}),Cc=w("$ZodCheckIncludes",(n,e)=>{ue.init(n,e);let r=Ve(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})}}),zc=w("$ZodCheckStartsWith",(n,e)=>{ue.init(n,e);let r=new RegExp(`^${Ve(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})}}),Ac=w("$ZodCheckEndsWith",(n,e)=>{ue.init(n,e);let r=new RegExp(`.*${Ve(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 Wm(n,e,r){n.issues.length&&e.issues.push(...Ze(r,n.issues))}var Dc=w("$ZodCheckProperty",(n,e)=>{ue.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=>Wm(t,r,e.property));Wm(i,r,e.property)}}),Lc=w("$ZodCheckMimeType",(n,e)=>{ue.init(n,e);let r=new Set(e.mime);n._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),n._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:n,continue:!e.abort})}}),Oc=w("$ZodCheckOverwrite",(n,e)=>{ue.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var Hr=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(`
|
|
667
|
+
`).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 fI.info({name:this.connection.nameValue},"Starting edge scan"),V_(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}}});var X_={};Ke(X_,{FusedIndexManager:()=>Pa,closeFusedIndex:()=>gI,getFusedIndex:()=>Nm,listFusedIndexes:()=>Am});import hI from"path";function Nm(n){let e=Fr.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>hI.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),Fr.delete(n.name)}let r=new Pa(n);return Fr.set(n.name,r),r}function gI(n){let e=Fr.get(n);e&&(e.close(),Fr.delete(n))}function Am(){return Array.from(Fr.keys())}var Y_,Pa,Fr,Ca=ue(()=>{"use strict";X();J_();K_();Y_=E.child({module:"fused-index"}),Pa=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new Ta(e),this.service=new Ra(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(),Y_.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 Y_.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},Fr=new Map});import{Server as GT}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as JT}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as VT,ListToolsRequestSchema as qT}from"@modelcontextprotocol/sdk/types.js";var rf=[{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)"},tokenBudget:{type:"number",description:"Optional token budget for adaptive folding of low-relevance matches"},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_explain_diff",description:"Explain a diff in one pass: changed symbols, blast radius, type relations, and verification test hints.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},baseCommit:{type:"string",description:"Optional base commit/ref for diff range"},headCommit:{type:"string",description:"Optional head commit/ref for diff range"},staged:{type:"boolean",description:"Analyze staged diff (default true)"},includeUntracked:{type:"boolean",description:"Include untracked files in diff"},maxSymbols:{type:"number",description:"Max changed symbols to explain (default 20)"},impactDepth:{type:"number",description:"Impact traversal depth for each symbol"},impactLimit:{type:"number",description:"Max impact rows per symbol"}},required:["repoPath"]}},{name:"shadow_analyze_type_graph",description:"Query indexed type graph edges (extends, implements, generic constraints) for a symbol.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string",description:"Optional file scope for outbound edges"},direction:{type:"string",enum:["outbound","inbound","both"]},relationship:{type:"string",enum:["extends","implements","constrained_by"]},limit:{type:"number"}},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"]}},{name:"shadow_analyze_mesh",description:'Query the event mesh \u2014 find all producers and consumers of a named event, API route, or pubsub topic across the codebase. For socket events use type="socket_event", for HTTP routes use type="api_route", for pubsub use type="pubsub_topic". Leave type unset to search across all categories. Set includeCrossRepo:true when a fused workspace index exists to include cross-repo edges.',inputSchema:{type:"object",properties:{repoPath:{type:"string"},topic:{type:"string",description:"Event name, route path, or topic name to look up. Supports partial match."},type:{type:"string",enum:["socket_event","api_route","pubsub_topic"],description:"Optional: restrict to one synapse type"},includeCrossRepo:{type:"boolean",description:"Include cross-repo virtual edges from fused index (default false)"},format:{type:"string",enum:["json","text"],description:"Output format (default json)"}},required:["repoPath","topic"]}}];var of=[{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)"},workingSet:{type:"array",items:{type:"string"},description:"Files expected to be touched by this mission"},missionId:{type:"number",description:"Existing mission ID to update in place"},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","planned","in-progress","verifying","completed","failed","skipped","suspended"]},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","note","system","adr"],description:"Intent category (architectural, operational, or narrative)."},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 mission-unlinked (repo-level or symbol/file anchored)."}},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"},branch:{type:"string",description:"Optional git branch scope for mission timeline"}},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)"},branch:{type:"string",description:"Optional branch scope for chronicle/context results"},includeSessionDelta:{type:"boolean",description:'If true, include optional "since last session" drift summary in response'},sinceCommit:{type:"string",description:"Optional baseline commit for drift summary (defaults to last indexed commit)"}},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_crystallize_theme",description:'Cluster semantically related intent logs across all missions by a theme phrase and compress them into a single thematic crystal. Unlike shadow_ops_crystallize which compresses one mission, this crosses mission boundaries. Use for architectural themes that span multiple missions e.g. "authentication decisions" or "database connection handling".',inputSchema:{type:"object",properties:{repoPath:{type:"string"},theme:{type:"string",description:'Theme phrase to search semantically e.g. "authentication decisions"'},missionIds:{type:"array",items:{type:"number"},description:"Optional: restrict to these mission IDs only"},limit:{type:"number",description:"Max logs to match (default 200)"}},required:["repoPath","theme"]}},{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_ops_claim",description:"Claim a file for a mission using SQLite-backed atomic coordination.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},filePaths:{type:"array",items:{type:"string"},description:"Files to claim for this mission"},filePath:{type:"string",description:"Backward-compatible single file input"},agentTag:{type:"string",description:"Optional agent identifier"}},required:["repoPath","missionId"]}},{name:"shadow_ops_release",description:"Release a previously claimed file.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Owner mission; required for targeted and release-all operations"},filePaths:{type:"array",items:{type:"string"},description:"Optional files to release; omit to release all mission claims"},filePath:{type:"string",description:"Backward-compatible single file input"}},required:["repoPath","missionId"]}},{name:"shadow_ops_dispatch_plan",description:"Analyze child-mission overlap and produce dependency-safe execution waves for parallel dispatch.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},parentMissionId:{type:"number",description:"Analyze all child missions under this parent mission"},missionId:{type:"number",description:"Backward-compatible alias for parentMissionId"},missionIds:{type:"array",items:{type:"number"},description:"Optional explicit mission set to analyze"},includeClaimCheck:{type:"boolean",description:"Include external claim analysis (default true)"}},required:["repoPath"]}},{name:"shadow_inspect_symbol",description:"Dense code retrieval for a single symbol with semantic folding and usage context.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string"},context:{type:"string",enum:["definition","full"]}},required:["repoPath","symbolName"]}},{name:"shadow_inspect_file",description:"Token-efficient summary of ALL symbols and exports in a file.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},detailLevel:{type:"string",enum:["structure","signatures","summaries","detailed"]}},required:["repoPath","filePath"]}},{name:"shadow_sync_trace",description:"Full lifecycle synchronization - Repairs index, analyzes changes, and re-hydrates state. Lifecycle status mutation is opt-in via flags.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},sinceCommit:{type:"string"},enableContextPivot:{type:"boolean",description:"Opt-in: suspend missions on other branches and resume current branch"},enableMergeSentinel:{type:"boolean",description:"Opt-in: auto-complete missions whose branch is merged into current branch"}},required:["repoPath"]}},{name:"shadow_sync_index",description:"Incremental code re-indexing to reflect latest file changes. Lifecycle status mutation is opt-in via flags.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},deep:{type:"boolean",description:"Force full rebuild"},enableContextPivot:{type:"boolean",description:"Opt-in: suspend missions on other branches and resume current branch"},enableMergeSentinel:{type:"boolean",description:"Opt-in: auto-complete missions whose branch is merged into current branch"}},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"]}},{name:"shadow_ops_handoff",description:"Write a typed findings artifact at the end of an agent run. Call this as the final action of a RECON or analysis session to persist structured findings, risks, and mission links that any subsequent agent can query. Findings are embedded for semantic search.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Mission this handoff is for (optional \u2014 omit for repo-level handoffs)"},kind:{type:"string",enum:["recon_report","risk_assessment","impact_map","debt_scan","custom"]},findings:{type:"array",items:{type:"object",properties:{statement:{type:"string"},confidence:{type:"number"},refs:{type:"object"}},required:["statement","confidence"]},description:"Structured findings. Each must have a statement and confidence 0-1."},risks:{type:"array",items:{type:"object",properties:{severity:{type:"string",enum:["low","medium","high","critical"]},description:{type:"string"},refs:{type:"object"}},required:["severity","description"]}},missionsCreated:{type:"array",items:{type:"number"},description:"Shadow mission IDs created during this agent run"},gaps:{type:"array",items:{type:"string"},description:"What could not be determined"},confidence:{type:"number",description:"Overall run confidence 0-1"},agentTag:{type:"string",description:"Optional agent identifier"}},required:["repoPath","kind","findings"]}},{name:"shadow_ops_handoff_read",description:"Read typed handoff artifacts written by previous agent runs. Provide a query string for semantic search across findings, or missionId/kind to filter directly.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},kind:{type:"string",enum:["recon_report","risk_assessment","impact_map","debt_scan","custom"]},query:{type:"string",description:"Semantic search query \u2014 finds handoffs whose findings match this concept"},limit:{type:"number"}},required:["repoPath"]}}];var h={};Ke(h,{$brand:()=>Wi,$input:()=>du,$output:()=>pu,NEVER:()=>Ja,TimePrecision:()=>gu,ZodAny:()=>od,ZodArray:()=>ld,ZodBase64:()=>gs,ZodBase64URL:()=>ys,ZodBigInt:()=>hr,ZodBigIntFormat:()=>vs,ZodBoolean:()=>fr,ZodCIDRv4:()=>fs,ZodCIDRv6:()=>hs,ZodCUID:()=>as,ZodCUID2:()=>cs,ZodCatch:()=>Cd,ZodCodec:()=>Ts,ZodCustom:()=>Si,ZodCustomStringFormat:()=>dr,ZodDate:()=>yi,ZodDefault:()=>Ed,ZodDiscriminatedUnion:()=>pd,ZodE164:()=>bs,ZodEmail:()=>is,ZodEmoji:()=>os,ZodEnum:()=>ur,ZodError:()=>yw,ZodExactOptional:()=>Sd,ZodFile:()=>vd,ZodFirstPartyTypeKind:()=>Zd,ZodFunction:()=>Fd,ZodGUID:()=>di,ZodIPv4:()=>ds,ZodIPv6:()=>ms,ZodISODate:()=>Xo,ZodISODateTime:()=>Yo,ZodISODuration:()=>es,ZodISOTime:()=>Qo,ZodIntersection:()=>dd,ZodIssueCode:()=>_w,ZodJWT:()=>_s,ZodKSUID:()=>ps,ZodLazy:()=>Od,ZodLiteral:()=>_d,ZodMAC:()=>Xp,ZodMap:()=>yd,ZodNaN:()=>Ad,ZodNanoID:()=>ss,ZodNever:()=>ad,ZodNonOptional:()=>ks,ZodNull:()=>rd,ZodNullable:()=>wd,ZodNumber:()=>mr,ZodNumberFormat:()=>Tn,ZodObject:()=>_i,ZodOptional:()=>Es,ZodPipe:()=>Is,ZodPrefault:()=>Id,ZodPromise:()=>jd,ZodReadonly:()=>zd,ZodRealError:()=>Ge,ZodRecord:()=>xi,ZodSet:()=>bd,ZodString:()=>pr,ZodStringFormat:()=>fe,ZodSuccess:()=>Pd,ZodSymbol:()=>td,ZodTemplateLiteral:()=>Ld,ZodTransform:()=>xd,ZodTuple:()=>fd,ZodType:()=>ie,ZodULID:()=>ls,ZodURL:()=>gi,ZodUUID:()=>wt,ZodUndefined:()=>nd,ZodUnion:()=>vi,ZodUnknown:()=>sd,ZodVoid:()=>cd,ZodXID:()=>us,ZodXor:()=>ud,_ZodString:()=>rs,_default:()=>kd,_function:()=>Mg,any:()=>gg,array:()=>bi,base64:()=>Qh,base64url:()=>eg,bigint:()=>pg,boolean:()=>ed,catch:()=>Nd,check:()=>jg,cidrv4:()=>Yh,cidrv6:()=>Xh,clone:()=>Me,codec:()=>Dg,coerce:()=>Hd,config:()=>$e,core:()=>Ot,cuid:()=>Zh,cuid2:()=>Hh,custom:()=>Fg,date:()=>bg,decode:()=>Bp,decodeAsync:()=>Jp,describe:()=>Ug,discriminatedUnion:()=>wg,e164:()=>tg,email:()=>Ah,emoji:()=>Uh,encode:()=>Hp,encodeAsync:()=>Gp,endsWith:()=>er,enum:()=>$s,exactOptional:()=>$d,file:()=>Cg,flattenError:()=>Qr,float32:()=>ag,float64:()=>cg,formatError:()=>ei,fromJSONSchema:()=>Vg,function:()=>Mg,getErrorMap:()=>xw,globalRegistry:()=>Pe,gt:()=>St,gte:()=>je,guid:()=>zh,hash:()=>sg,hex:()=>og,hostname:()=>ig,httpUrl:()=>Fh,includes:()=>Xn,instanceof:()=>Zg,int:()=>ns,int32:()=>lg,int64:()=>dg,intersection:()=>md,ipv4:()=>Vh,ipv6:()=>Kh,iso:()=>lr,json:()=>Bg,jwt:()=>ng,keyof:()=>_g,ksuid:()=>Jh,lazy:()=>Md,length:()=>kn,literal:()=>Pg,locales:()=>ci,looseObject:()=>Sg,looseRecord:()=>kg,lowercase:()=>Kn,lt:()=>xt,lte:()=>Xe,mac:()=>qh,map:()=>Ig,maxLength:()=>En,maxSize:()=>en,meta:()=>Wg,mime:()=>tr,minLength:()=>Lt,minSize:()=>$t,multipleOf:()=>Qt,nan:()=>zg,nanoid:()=>Wh,nativeEnum:()=>Rg,negative:()=>Uo,never:()=>xs,nonnegative:()=>Zo,nonoptional:()=>Rd,nonpositive:()=>Wo,normalize:()=>nr,null:()=>id,nullable:()=>fi,nullish:()=>Ng,number:()=>Qp,object:()=>vg,optional:()=>mi,overwrite:()=>mt,parse:()=>Fp,parseAsync:()=>Up,partialRecord:()=>Eg,pipe:()=>hi,positive:()=>Fo,prefault:()=>Td,preprocess:()=>Gg,prettifyError:()=>oc,promise:()=>Og,property:()=>Ho,readonly:()=>Dd,record:()=>gd,refine:()=>Ud,regex:()=>qn,regexes:()=>st,registry:()=>_o,safeDecode:()=>qp,safeDecodeAsync:()=>Yp,safeEncode:()=>Vp,safeEncodeAsync:()=>Kp,safeParse:()=>Wp,safeParseAsync:()=>Zp,set:()=>Tg,setErrorMap:()=>vw,size:()=>wn,slugify:()=>sr,startsWith:()=>Qn,strictObject:()=>xg,string:()=>ts,stringFormat:()=>rg,stringbool:()=>Hg,success:()=>Ag,superRefine:()=>Wd,symbol:()=>fg,templateLiteral:()=>Lg,toJSONSchema:()=>Vo,toLowerCase:()=>ir,toUpperCase:()=>or,transform:()=>ws,treeifyError:()=>ic,trim:()=>rr,tuple:()=>hd,uint32:()=>ug,uint64:()=>mg,ulid:()=>Bh,undefined:()=>hg,union:()=>Ss,unknown:()=>In,uppercase:()=>Yn,url:()=>jh,util:()=>W,uuid:()=>Dh,uuidv4:()=>Lh,uuidv6:()=>Oh,uuidv7:()=>Mh,void:()=>yg,xid:()=>Gh,xor:()=>$g});var Ot={};Ke(Ot,{$ZodAny:()=>Al,$ZodArray:()=>Ml,$ZodAsyncError:()=>dt,$ZodBase64:()=>$l,$ZodBase64URL:()=>wl,$ZodBigInt:()=>po,$ZodBigIntFormat:()=>Rl,$ZodBoolean:()=>ii,$ZodCIDRv4:()=>vl,$ZodCIDRv6:()=>xl,$ZodCUID:()=>cl,$ZodCUID2:()=>ll,$ZodCatch:()=>nu,$ZodCheck:()=>he,$ZodCheckBigIntFormat:()=>Mc,$ZodCheckEndsWith:()=>Kc,$ZodCheckGreaterThan:()=>io,$ZodCheckIncludes:()=>Vc,$ZodCheckLengthEquals:()=>Hc,$ZodCheckLessThan:()=>ro,$ZodCheckLowerCase:()=>Gc,$ZodCheckMaxLength:()=>Wc,$ZodCheckMaxSize:()=>jc,$ZodCheckMimeType:()=>Xc,$ZodCheckMinLength:()=>Zc,$ZodCheckMinSize:()=>Fc,$ZodCheckMultipleOf:()=>Lc,$ZodCheckNumberFormat:()=>Oc,$ZodCheckOverwrite:()=>Qc,$ZodCheckProperty:()=>Yc,$ZodCheckRegex:()=>Bc,$ZodCheckSizeEquals:()=>Uc,$ZodCheckStartsWith:()=>qc,$ZodCheckStringFormat:()=>Jn,$ZodCheckUpperCase:()=>Jc,$ZodCodec:()=>si,$ZodCustom:()=>uu,$ZodCustomStringFormat:()=>Il,$ZodDate:()=>Ol,$ZodDefault:()=>Xl,$ZodDiscriminatedUnion:()=>Ul,$ZodE164:()=>El,$ZodEmail:()=>il,$ZodEmoji:()=>sl,$ZodEncodeError:()=>Vt,$ZodEnum:()=>Gl,$ZodError:()=>Xr,$ZodExactOptional:()=>Kl,$ZodFile:()=>Vl,$ZodFunction:()=>au,$ZodGUID:()=>nl,$ZodIPv4:()=>yl,$ZodIPv6:()=>bl,$ZodISODate:()=>fl,$ZodISODateTime:()=>ml,$ZodISODuration:()=>gl,$ZodISOTime:()=>hl,$ZodIntersection:()=>Wl,$ZodJWT:()=>kl,$ZodKSUID:()=>dl,$ZodLazy:()=>lu,$ZodLiteral:()=>Jl,$ZodMAC:()=>_l,$ZodMap:()=>Hl,$ZodNaN:()=>ru,$ZodNanoID:()=>al,$ZodNever:()=>Dl,$ZodNonOptional:()=>eu,$ZodNull:()=>Nl,$ZodNullable:()=>Yl,$ZodNumber:()=>uo,$ZodNumberFormat:()=>Tl,$ZodObject:()=>Nf,$ZodObjectJIT:()=>jl,$ZodOptional:()=>fo,$ZodPipe:()=>iu,$ZodPrefault:()=>Ql,$ZodPromise:()=>cu,$ZodReadonly:()=>ou,$ZodRealError:()=>Be,$ZodRecord:()=>Zl,$ZodRegistry:()=>bo,$ZodSet:()=>Bl,$ZodString:()=>$n,$ZodStringFormat:()=>me,$ZodSuccess:()=>tu,$ZodSymbol:()=>Pl,$ZodTemplateLiteral:()=>su,$ZodTransform:()=>ql,$ZodTuple:()=>mo,$ZodType:()=>ne,$ZodULID:()=>ul,$ZodURL:()=>ol,$ZodUUID:()=>rl,$ZodUndefined:()=>Cl,$ZodUnion:()=>oi,$ZodUnknown:()=>zl,$ZodVoid:()=>Ll,$ZodXID:()=>pl,$ZodXor:()=>Fl,$brand:()=>Wi,$constructor:()=>k,$input:()=>du,$output:()=>pu,Doc:()=>ri,JSONSchema:()=>Ch,JSONSchemaGenerator:()=>qo,NEVER:()=>Ja,TimePrecision:()=>gu,_any:()=>Ou,_array:()=>Hu,_base64:()=>Lo,_base64url:()=>Oo,_bigint:()=>Pu,_boolean:()=>Tu,_catch:()=>lw,_check:()=>Ph,_cidrv4:()=>zo,_cidrv6:()=>Do,_coercedBigint:()=>Cu,_coercedBoolean:()=>Ru,_coercedDate:()=>Wu,_coercedNumber:()=>Su,_coercedString:()=>fu,_cuid:()=>Io,_cuid2:()=>To,_custom:()=>Gu,_date:()=>Uu,_decode:()=>Vi,_decodeAsync:()=>Ki,_default:()=>sw,_discriminatedUnion:()=>V$,_e164:()=>Mo,_email:()=>vo,_emoji:()=>Eo,_encode:()=>Ji,_encodeAsync:()=>qi,_endsWith:()=>er,_enum:()=>ew,_file:()=>Bu,_float32:()=>wu,_float64:()=>Eu,_gt:()=>St,_gte:()=>je,_guid:()=>li,_includes:()=>Xn,_int:()=>$u,_int32:()=>ku,_int64:()=>Nu,_intersection:()=>q$,_ipv4:()=>No,_ipv6:()=>Ao,_isoDate:()=>bu,_isoDateTime:()=>yu,_isoDuration:()=>vu,_isoTime:()=>_u,_jwt:()=>jo,_ksuid:()=>Co,_lazy:()=>mw,_length:()=>kn,_literal:()=>nw,_lowercase:()=>Kn,_lt:()=>xt,_lte:()=>Xe,_mac:()=>hu,_map:()=>X$,_max:()=>Xe,_maxLength:()=>En,_maxSize:()=>en,_mime:()=>tr,_min:()=>je,_minLength:()=>Lt,_minSize:()=>$t,_multipleOf:()=>Qt,_nan:()=>Zu,_nanoid:()=>ko,_nativeEnum:()=>tw,_negative:()=>Uo,_never:()=>ju,_nonnegative:()=>Zo,_nonoptional:()=>aw,_nonpositive:()=>Wo,_normalize:()=>nr,_null:()=>Lu,_nullable:()=>ow,_number:()=>xu,_optional:()=>iw,_overwrite:()=>mt,_parse:()=>Zn,_parseAsync:()=>Hn,_pipe:()=>uw,_positive:()=>Fo,_promise:()=>fw,_property:()=>Ho,_readonly:()=>pw,_record:()=>Y$,_refine:()=>Ju,_regex:()=>qn,_safeDecode:()=>Xi,_safeDecodeAsync:()=>eo,_safeEncode:()=>Yi,_safeEncodeAsync:()=>Qi,_safeParse:()=>Bn,_safeParseAsync:()=>Gn,_set:()=>Q$,_size:()=>wn,_slugify:()=>sr,_startsWith:()=>Qn,_string:()=>mu,_stringFormat:()=>ar,_stringbool:()=>Yu,_success:()=>cw,_superRefine:()=>Vu,_symbol:()=>zu,_templateLiteral:()=>dw,_toLowerCase:()=>ir,_toUpperCase:()=>or,_transform:()=>rw,_trim:()=>rr,_tuple:()=>K$,_uint32:()=>Iu,_uint64:()=>Au,_ulid:()=>Ro,_undefined:()=>Du,_union:()=>G$,_unknown:()=>Mu,_uppercase:()=>Yn,_url:()=>ui,_uuid:()=>xo,_uuidv4:()=>So,_uuidv6:()=>$o,_uuidv7:()=>wo,_void:()=>Fu,_xid:()=>Po,_xor:()=>J$,clone:()=>Me,config:()=>$e,createStandardJSONSchemaMethod:()=>cr,createToJSONSchemaMethod:()=>Xu,decode:()=>yS,decodeAsync:()=>_S,describe:()=>qu,encode:()=>gS,encodeAsync:()=>bS,extractDefs:()=>nn,finalize:()=>rn,flattenError:()=>Qr,formatError:()=>ei,globalConfig:()=>Br,globalRegistry:()=>Pe,initializeContext:()=>tn,isValidBase64:()=>Sl,isValidBase64URL:()=>Tf,isValidJWT:()=>Rf,locales:()=>ci,meta:()=>Ku,parse:()=>Bi,parseAsync:()=>Gi,prettifyError:()=>oc,process:()=>pe,regexes:()=>st,registry:()=>_o,safeDecode:()=>xS,safeDecodeAsync:()=>$S,safeEncode:()=>vS,safeEncodeAsync:()=>SS,safeParse:()=>sc,safeParseAsync:()=>ac,toDotPath:()=>uf,toJSONSchema:()=>Vo,treeifyError:()=>ic,util:()=>W,version:()=>el});var Ja=Object.freeze({status:"aborted"});function k(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 Wi=Symbol("zod_brand"),dt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Vt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Br={};function $e(n){return n&&Object.assign(Br,n),Br}var W={};Ke(W,{BIGINT_FORMAT_RANGES:()=>rc,Class:()=>qa,NUMBER_FORMAT_RANGES:()=>nc,aborted:()=>Xt,allowsEval:()=>Xa,assert:()=>Vx,assertEqual:()=>Hx,assertIs:()=>Gx,assertNever:()=>Jx,assertNotEqual:()=>Bx,assignProp:()=>Kt,base64ToUint8Array:()=>af,base64urlToUint8Array:()=>pS,cached:()=>Un,captureStackTrace:()=>Hi,cleanEnum:()=>uS,cleanRegex:()=>Vr,clone:()=>Me,cloneDef:()=>Kx,createTransparentProxy:()=>nS,defineLazy:()=>se,esc:()=>Zi,escapeRegex:()=>ot,extend:()=>oS,finalizeIssue:()=>He,floatSafeRemainder:()=>Ka,getElementAtPath:()=>Yx,getEnumValues:()=>Jr,getLengthableOrigin:()=>Yr,getParsedType:()=>tS,getSizableOrigin:()=>Kr,hexToUint8Array:()=>mS,isObject:()=>xn,isPlainObject:()=>Yt,issue:()=>Wn,joinValues:()=>R,jsonStringifyReplacer:()=>Fn,merge:()=>aS,mergeDefs:()=>Dt,normalizeParams:()=>Z,nullish:()=>qt,numKeys:()=>eS,objectClone:()=>qx,omit:()=>iS,optionalKeys:()=>tc,parsedType:()=>U,partial:()=>cS,pick:()=>rS,prefixIssues:()=>Ye,primitiveTypes:()=>ec,promiseAllObject:()=>Xx,propertyKeyTypes:()=>qr,randomString:()=>Qx,required:()=>lS,safeExtend:()=>sS,shallowClone:()=>Qa,slugify:()=>Ya,stringifyPrimitive:()=>F,uint8ArrayToBase64:()=>cf,uint8ArrayToBase64url:()=>dS,uint8ArrayToHex:()=>fS,unwrapMessage:()=>Gr});function Hx(n){return n}function Bx(n){return n}function Gx(n){}function Jx(n){throw new Error("Unexpected value in exhaustive check")}function Vx(n){}function Jr(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 R(n,e="|"){return n.map(r=>F(r)).join(e)}function Fn(n,e){return typeof e=="bigint"?e.toString():e}function Un(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function qt(n){return n==null}function Vr(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function Ka(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 sf=Symbol("evaluating");function se(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==sf)return i===void 0&&(i=sf,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function qx(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function Kt(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Dt(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function Kx(n){return Dt(n._zod.def)}function Yx(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function Xx(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 Qx(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function Zi(n){return JSON.stringify(n)}function Ya(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Hi="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function xn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var Xa=Un(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function Yt(n){if(xn(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(xn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Qa(n){return Yt(n)?{...n}:Array.isArray(n)?[...n]:n}function eS(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var tS=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}`)}},qr=new Set(["string","number","symbol"]),ec=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ot(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Me(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function Z(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function nS(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 F(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function tc(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var nc={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]},rc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rS(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=Dt(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 Kt(this,"shape",s),s},checks:[]});return Me(n,o)}function iS(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=Dt(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 Kt(this,"shape",s),s},checks:[]});return Me(n,o)}function oS(n,e){if(!Yt(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=Dt(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return Kt(this,"shape",o),o}});return Me(n,t)}function sS(n,e){if(!Yt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Dt(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return Kt(this,"shape",i),i}});return Me(n,r)}function aS(n,e){let r=Dt(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return Kt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Me(n,r)}function cS(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=Dt(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 Kt(this,"shape",c),c},checks:[]});return Me(e,s)}function lS(n,e,r){let i=Dt(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 Kt(this,"shape",o),o}});return Me(e,i)}function Xt(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 Ye(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function Gr(n){return typeof n=="string"?n:n?.message}function He(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=Gr(n.inst?._zod.def?.error?.(n))??Gr(e?.error?.(n))??Gr(r.customError?.(n))??Gr(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Kr(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function Yr(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function U(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 Wn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function uS(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function af(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 cf(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function pS(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return af(e+r)}function dS(n){return cf(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mS(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 fS(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var qa=class{constructor(...e){}};var lf=(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,Fn,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},Xr=k("$ZodError",lf),Be=k("$ZodError",lf,{Parent:Error});function Qr(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 ei(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 ic(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 uf(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 oc(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 ${uf(i.path)}`);return e.join(`
|
|
668
|
+
`)}var Zn=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 dt;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>He(c,o,$e())));throw Hi(a,t?.callee),a}return s.value},Bi=Zn(Be),Hn=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=>He(c,o,$e())));throw Hi(a,t?.callee),a}return s.value},Gi=Hn(Be),Bn=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 dt;return o.issues.length?{success:!1,error:new(n??Xr)(o.issues.map(s=>He(s,t,$e())))}:{success:!0,data:o.value}},sc=Bn(Be),Gn=n=>async(e,r,i)=>{let t=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(s=>He(s,t,$e())))}:{success:!0,data:o.value}},ac=Gn(Be),Ji=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Zn(n)(e,r,t)},gS=Ji(Be),Vi=n=>(e,r,i)=>Zn(n)(e,r,i),yS=Vi(Be),qi=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Hn(n)(e,r,t)},bS=qi(Be),Ki=n=>async(e,r,i)=>Hn(n)(e,r,i),_S=Ki(Be),Yi=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Bn(n)(e,r,t)},vS=Yi(Be),Xi=n=>(e,r,i)=>Bn(n)(e,r,i),xS=Xi(Be),Qi=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Gn(n)(e,r,t)},SS=Qi(Be),eo=n=>async(e,r,i)=>Gn(n)(e,r,i),$S=eo(Be);var st={};Ke(st,{base64:()=>$c,base64url:()=>to,bigint:()=>Rc,boolean:()=>Cc,browserEmail:()=>CS,cidrv4:()=>xc,cidrv6:()=>Sc,cuid:()=>cc,cuid2:()=>lc,date:()=>Ec,datetime:()=>Ic,domain:()=>zS,duration:()=>fc,e164:()=>wc,email:()=>gc,emoji:()=>yc,extendedDuration:()=>wS,guid:()=>hc,hex:()=>DS,hostname:()=>AS,html5Email:()=>TS,idnEmail:()=>PS,integer:()=>Pc,ipv4:()=>bc,ipv6:()=>_c,ksuid:()=>dc,lowercase:()=>zc,mac:()=>vc,md5_base64:()=>OS,md5_base64url:()=>MS,md5_hex:()=>LS,nanoid:()=>mc,null:()=>Nc,number:()=>no,rfc5322Email:()=>RS,sha1_base64:()=>FS,sha1_base64url:()=>US,sha1_hex:()=>jS,sha256_base64:()=>ZS,sha256_base64url:()=>HS,sha256_hex:()=>WS,sha384_base64:()=>GS,sha384_base64url:()=>JS,sha384_hex:()=>BS,sha512_base64:()=>qS,sha512_base64url:()=>KS,sha512_hex:()=>VS,string:()=>Tc,time:()=>kc,ulid:()=>uc,undefined:()=>Ac,unicodeEmail:()=>pf,uppercase:()=>Dc,uuid:()=>Sn,uuid4:()=>ES,uuid6:()=>kS,uuid7:()=>IS,xid:()=>pc});var cc=/^[cC][^\s-]{8,}$/,lc=/^[0-9a-z]+$/,uc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pc=/^[0-9a-vA-V]{20}$/,dc=/^[A-Za-z0-9]{27}$/,mc=/^[a-zA-Z0-9_-]{21}$/,fc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wS=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hc=/^([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})$/,Sn=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)$/,ES=Sn(4),kS=Sn(6),IS=Sn(7),gc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,TS=/^[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])?)*$/,RS=/^(([^<>()\[\]\\.,;:\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,}))$/,pf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,PS=pf,CS=/^[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])?)*$/,NS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yc(){return new RegExp(NS,"u")}var bc=/^(?:(?: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])$/,_c=/^(([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}|:))$/,vc=n=>{let e=ot(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},xc=/^((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])$/,Sc=/^(([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])$/,$c=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,to=/^[A-Za-z0-9_-]*$/,AS=/^(?=.{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])?)*\.?$/,zS=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,wc=/^\+[1-9]\d{6,14}$/,df="(?:(?:\\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])))",Ec=new RegExp(`^${df}$`);function mf(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 kc(n){return new RegExp(`^${mf(n)}$`)}function Ic(n){let e=mf({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(`^${df}T(?:${i})$`)}var Tc=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Rc=/^-?\d+n?$/,Pc=/^-?\d+$/,no=/^-?\d+(?:\.\d+)?$/,Cc=/^(?:true|false)$/i,Nc=/^null$/i;var Ac=/^undefined$/i;var zc=/^[^A-Z]*$/,Dc=/^[^a-z]*$/,DS=/^[0-9a-fA-F]*$/;function ti(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function ni(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var LS=/^[0-9a-fA-F]{32}$/,OS=ti(22,"=="),MS=ni(22),jS=/^[0-9a-fA-F]{40}$/,FS=ti(27,"="),US=ni(27),WS=/^[0-9a-fA-F]{64}$/,ZS=ti(43,"="),HS=ni(43),BS=/^[0-9a-fA-F]{96}$/,GS=ti(64,""),JS=ni(64),VS=/^[0-9a-fA-F]{128}$/,qS=ti(86,"=="),KS=ni(86);var he=k("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),hf={number:"number",bigint:"bigint",object:"date"},ro=k("$ZodCheckLessThan",(n,e)=>{he.init(n,e);let r=hf[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})}}),io=k("$ZodCheckGreaterThan",(n,e)=>{he.init(n,e);let r=hf[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})}}),Lc=k("$ZodCheckMultipleOf",(n,e)=>{he.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):Ka(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})}}),Oc=k("$ZodCheckNumberFormat",(n,e)=>{he.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=nc[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=Pc)}),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})}}),Mc=k("$ZodCheckBigIntFormat",(n,e)=>{he.init(n,e);let[r,i]=rc[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})}}),jc=k("$ZodCheckMaxSize",(n,e)=>{var r;he.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!qt(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:Kr(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Fc=k("$ZodCheckMinSize",(n,e)=>{var r;he.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!qt(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:Kr(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Uc=k("$ZodCheckSizeEquals",(n,e)=>{var r;he.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!qt(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:Kr(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})}}),Wc=k("$ZodCheckMaxLength",(n,e)=>{var r;he.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!qt(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=Yr(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Zc=k("$ZodCheckMinLength",(n,e)=>{var r;he.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!qt(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=Yr(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Hc=k("$ZodCheckLengthEquals",(n,e)=>{var r;he.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!qt(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=Yr(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})}}),Jn=k("$ZodCheckStringFormat",(n,e)=>{var r,i;he.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=()=>{})}),Bc=k("$ZodCheckRegex",(n,e)=>{Jn.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})}}),Gc=k("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=zc),Jn.init(n,e)}),Jc=k("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=Dc),Jn.init(n,e)}),Vc=k("$ZodCheckIncludes",(n,e)=>{he.init(n,e);let r=ot(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})}}),qc=k("$ZodCheckStartsWith",(n,e)=>{he.init(n,e);let r=new RegExp(`^${ot(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})}}),Kc=k("$ZodCheckEndsWith",(n,e)=>{he.init(n,e);let r=new RegExp(`.*${ot(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 ff(n,e,r){n.issues.length&&e.issues.push(...Ye(r,n.issues))}var Yc=k("$ZodCheckProperty",(n,e)=>{he.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=>ff(t,r,e.property));ff(i,r,e.property)}}),Xc=k("$ZodCheckMimeType",(n,e)=>{he.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})}}),Qc=k("$ZodCheckOverwrite",(n,e)=>{he.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var ri=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(`
|
|
616
669
|
`).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(`
|
|
617
|
-
`))}};var Mc={major:4,minor:3,patch:6};var te=w("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=Mc;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=Mt(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 Qe;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(l||(l=Mt(s,d)))});else{if(s.issues.length===d)continue;l||(l=Mt(s,d))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(Mt(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new Qe;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 Qe;return c.then(l=>t(l,i,a))}return t(c,i,a)}}ie(n,"~standard",()=>({validate:t=>{try{let o=Ha(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Ba(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),ln=w("$ZodString",(n,e)=>{te.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??dc(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}}),ce=w("$ZodStringFormat",(n,e)=>{zn.init(n,e),ln.init(n,e)}),Fc=w("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=Qa),ce.init(n,e)}),Uc=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=cn(i))}else e.pattern??(e.pattern=cn());ce.init(n,e)}),Zc=w("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=ec),ce.init(n,e)}),Wc=w("$ZodURL",(n,e)=>{ce.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})}}}),Hc=w("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=tc()),ce.init(n,e)}),Bc=w("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=Ya),ce.init(n,e)}),Gc=w("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=Ga),ce.init(n,e)}),Jc=w("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=Ja),ce.init(n,e)}),Vc=w("$ZodULID",(n,e)=>{e.pattern??(e.pattern=Va),ce.init(n,e)}),qc=w("$ZodXID",(n,e)=>{e.pattern??(e.pattern=qa),ce.init(n,e)}),Kc=w("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=Ka),ce.init(n,e)}),Yc=w("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=pc(e)),ce.init(n,e)}),Xc=w("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=lc),ce.init(n,e)}),Qc=w("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=uc(e)),ce.init(n,e)}),el=w("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=Xa),ce.init(n,e)}),tl=w("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=nc),ce.init(n,e),n._zod.bag.format="ipv4"}),nl=w("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=rc),ce.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})}}}),rl=w("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=ic(e.delimiter)),ce.init(n,e),n._zod.bag.format="mac"}),il=w("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=oc),ce.init(n,e)}),ol=w("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=sc),ce.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 sl(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var al=w("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=ac),ce.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{sl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function rf(n){if(!Wi.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return sl(r)}var cl=w("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=Wi),ce.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{rf(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),ll=w("$ZodE164",(n,e)=>{e.pattern??(e.pattern=cc),ce.init(n,e)});function of(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 ul=w("$ZodJWT",(n,e)=>{ce.init(n,e),n._zod.check=r=>{of(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),pl=w("$ZodCustomStringFormat",(n,e)=>{ce.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})}}),Xi=w("$ZodNumber",(n,e)=>{te.init(n,e),n._zod.pattern=n._zod.bag.pattern??Hi,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}}),dl=w("$ZodNumberFormat",(n,e)=>{xc.init(n,e),Xi.init(n,e)}),Br=w("$ZodBoolean",(n,e)=>{te.init(n,e),n._zod.pattern=hc,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}}),Qi=w("$ZodBigInt",(n,e)=>{te.init(n,e),n._zod.pattern=mc,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}}),ml=w("$ZodBigIntFormat",(n,e)=>{Sc.init(n,e),Qi.init(n,e)}),fl=w("$ZodSymbol",(n,e)=>{te.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}}),hl=w("$ZodUndefined",(n,e)=>{te.init(n,e),n._zod.pattern=yc,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}}),gl=w("$ZodNull",(n,e)=>{te.init(n,e),n._zod.pattern=gc,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}}),yl=w("$ZodAny",(n,e)=>{te.init(n,e),n._zod.parse=r=>r}),bl=w("$ZodUnknown",(n,e)=>{te.init(n,e),n._zod.parse=r=>r}),vl=w("$ZodNever",(n,e)=>{te.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),_l=w("$ZodVoid",(n,e)=>{te.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}}),xl=w("$ZodDate",(n,e)=>{te.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 Gm(n,e,r){n.issues.length&&e.issues.push(...Ze(r,n.issues)),e.value[r]=n.value}var Sl=w("$ZodArray",(n,e)=>{te.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=>Gm(l,r,s))):Gm(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Yi(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...Ze(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function sf(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=ja(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function af(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=>Yi(m,r,p,e,u))):Yi(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 cf=w("$ZodObject",(n,e)=>{if(te.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=In(()=>sf(e));ie(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=an,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(v=>Yi(v,a,d,l,f))):Yi(h,a,d,l,f)}return o?af(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),$l=w("$ZodObjectJIT",(n,e)=>{cf.init(n,e);let r=n._zod.parse,i=In(()=>sf(e)),t=d=>{let m=new Hr(["shape","payload","ctx"]),f=i.value,h=_=>{let x=Ni(_);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};m.write("const input = payload.value;");let v=Object.create(null),y=0;for(let _ of f.keys)v[_]=`key_${y++}`;m.write("const newResult = {};");for(let _ of f.keys){let x=v[_],E=Ni(_),N=d[_]?._zod?.optout==="optional";m.write(`const ${x} = ${h(_)};`),N?m.write(`
|
|
618
|
-
if (${
|
|
619
|
-
if (${
|
|
620
|
-
payload.issues = payload.issues.concat(${
|
|
670
|
+
`))}};var el={major:4,minor:3,patch:6};var ne=k("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=el;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=Xt(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 dt;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(l||(l=Xt(s,d)))});else{if(s.issues.length===d)continue;l||(l=Xt(s,d))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(Xt(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new dt;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 dt;return c.then(l=>t(l,i,a))}return t(c,i,a)}}se(n,"~standard",()=>({validate:t=>{try{let o=sc(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return ac(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),$n=k("$ZodString",(n,e)=>{ne.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??Tc(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}}),me=k("$ZodStringFormat",(n,e)=>{Jn.init(n,e),$n.init(n,e)}),nl=k("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=hc),me.init(n,e)}),rl=k("$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=Sn(i))}else e.pattern??(e.pattern=Sn());me.init(n,e)}),il=k("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=gc),me.init(n,e)}),ol=k("$ZodURL",(n,e)=>{me.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})}}}),sl=k("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=yc()),me.init(n,e)}),al=k("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=mc),me.init(n,e)}),cl=k("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=cc),me.init(n,e)}),ll=k("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=lc),me.init(n,e)}),ul=k("$ZodULID",(n,e)=>{e.pattern??(e.pattern=uc),me.init(n,e)}),pl=k("$ZodXID",(n,e)=>{e.pattern??(e.pattern=pc),me.init(n,e)}),dl=k("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=dc),me.init(n,e)}),ml=k("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=Ic(e)),me.init(n,e)}),fl=k("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=Ec),me.init(n,e)}),hl=k("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=kc(e)),me.init(n,e)}),gl=k("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=fc),me.init(n,e)}),yl=k("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=bc),me.init(n,e),n._zod.bag.format="ipv4"}),bl=k("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=_c),me.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})}}}),_l=k("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=vc(e.delimiter)),me.init(n,e),n._zod.bag.format="mac"}),vl=k("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=xc),me.init(n,e)}),xl=k("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Sc),me.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 Sl(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var $l=k("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=$c),me.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{Sl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function Tf(n){if(!to.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Sl(r)}var wl=k("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=to),me.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{Tf(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),El=k("$ZodE164",(n,e)=>{e.pattern??(e.pattern=wc),me.init(n,e)});function Rf(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 kl=k("$ZodJWT",(n,e)=>{me.init(n,e),n._zod.check=r=>{Rf(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),Il=k("$ZodCustomStringFormat",(n,e)=>{me.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})}}),uo=k("$ZodNumber",(n,e)=>{ne.init(n,e),n._zod.pattern=n._zod.bag.pattern??no,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}}),Tl=k("$ZodNumberFormat",(n,e)=>{Oc.init(n,e),uo.init(n,e)}),ii=k("$ZodBoolean",(n,e)=>{ne.init(n,e),n._zod.pattern=Cc,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}}),po=k("$ZodBigInt",(n,e)=>{ne.init(n,e),n._zod.pattern=Rc,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}}),Rl=k("$ZodBigIntFormat",(n,e)=>{Mc.init(n,e),po.init(n,e)}),Pl=k("$ZodSymbol",(n,e)=>{ne.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}}),Cl=k("$ZodUndefined",(n,e)=>{ne.init(n,e),n._zod.pattern=Ac,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}}),Nl=k("$ZodNull",(n,e)=>{ne.init(n,e),n._zod.pattern=Nc,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}}),Al=k("$ZodAny",(n,e)=>{ne.init(n,e),n._zod.parse=r=>r}),zl=k("$ZodUnknown",(n,e)=>{ne.init(n,e),n._zod.parse=r=>r}),Dl=k("$ZodNever",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),Ll=k("$ZodVoid",(n,e)=>{ne.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}}),Ol=k("$ZodDate",(n,e)=>{ne.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 yf(n,e,r){n.issues.length&&e.issues.push(...Ye(r,n.issues)),e.value[r]=n.value}var Ml=k("$ZodArray",(n,e)=>{ne.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=>yf(l,r,s))):yf(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function lo(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...Ye(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function Pf(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=tc(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Cf(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=>lo(m,r,p,e,u))):lo(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 Nf=k("$ZodObject",(n,e)=>{if(ne.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=Un(()=>Pf(e));se(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=xn,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",g=m._zod.run({value:l[d],issues:[]},c);g instanceof Promise?u.push(g.then($=>lo($,a,d,l,f))):lo(g,a,d,l,f)}return o?Cf(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),jl=k("$ZodObjectJIT",(n,e)=>{Nf.init(n,e);let r=n._zod.parse,i=Un(()=>Pf(e)),t=d=>{let m=new ri(["shape","payload","ctx"]),f=i.value,g=b=>{let S=Zi(b);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");let $=Object.create(null),y=0;for(let b of f.keys)$[b]=`key_${y++}`;m.write("const newResult = {};");for(let b of f.keys){let S=$[b],w=Zi(b),z=d[b]?._zod?.optout==="optional";m.write(`const ${S} = ${g(b)};`),z?m.write(`
|
|
671
|
+
if (${S}.issues.length) {
|
|
672
|
+
if (${w} in input) {
|
|
673
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
621
674
|
...iss,
|
|
622
|
-
path: iss.path ? [${
|
|
675
|
+
path: iss.path ? [${w}, ...iss.path] : [${w}]
|
|
623
676
|
})));
|
|
624
677
|
}
|
|
625
678
|
}
|
|
626
679
|
|
|
627
|
-
if (${
|
|
628
|
-
if (${
|
|
629
|
-
newResult[${
|
|
680
|
+
if (${S}.value === undefined) {
|
|
681
|
+
if (${w} in input) {
|
|
682
|
+
newResult[${w}] = undefined;
|
|
630
683
|
}
|
|
631
684
|
} else {
|
|
632
|
-
newResult[${
|
|
685
|
+
newResult[${w}] = ${S}.value;
|
|
633
686
|
}
|
|
634
687
|
|
|
635
688
|
`):m.write(`
|
|
636
|
-
if (${
|
|
637
|
-
payload.issues = payload.issues.concat(${
|
|
689
|
+
if (${S}.issues.length) {
|
|
690
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
638
691
|
...iss,
|
|
639
|
-
path: iss.path ? [${
|
|
692
|
+
path: iss.path ? [${w}, ...iss.path] : [${w}]
|
|
640
693
|
})));
|
|
641
694
|
}
|
|
642
695
|
|
|
643
|
-
if (${
|
|
644
|
-
if (${
|
|
645
|
-
newResult[${
|
|
696
|
+
if (${S}.value === undefined) {
|
|
697
|
+
if (${w} in input) {
|
|
698
|
+
newResult[${w}] = undefined;
|
|
646
699
|
}
|
|
647
700
|
} else {
|
|
648
|
-
newResult[${
|
|
701
|
+
newResult[${w}] = ${S}.value;
|
|
649
702
|
}
|
|
650
703
|
|
|
651
|
-
`)}m.write("payload.value = newResult;"),m.write("return payload;");let b=m.compile();return(_,x)=>b(d,_,x)},o,s=an,a=!Cr.jitless,l=a&&La.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?af([],f,d,m,p,n):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:n}),d)}});function Jm(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=>!Mt(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=>De(s,i,ge())))}),e)}var Gr=w("$ZodUnion",(n,e)=>{te.init(n,e),ie(n._zod,"optin",()=>e.options.some(t=>t._zod.optin==="optional")?"optional":void 0),ie(n._zod,"optout",()=>e.options.some(t=>t._zod.optout==="optional")?"optional":void 0),ie(n._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),ie(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=>Dr(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=>Jm(c,t,n,o)):Jm(a,t,n,o)}});function Vm(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=>De(s,i,ge())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var wl=w("$ZodXor",(n,e)=>{Gr.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=>Vm(c,t,n,o)):Vm(a,t,n,o)}}),El=w("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,Gr.init(n,e);let r=n._zod.parse;ie(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=In(()=>{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(!an(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)}}),kl=w("$ZodIntersection",(n,e)=>{te.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])=>qm(r,c,l)):qm(r,o,s)}});function jc(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(Ot(n)&&Ot(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=jc(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=jc(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 qm(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}),Mt(n))return n;let s=jc(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 eo=w("$ZodTuple",(n,e)=>{te.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=>Ji(d,i,l))):Ji(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=>Ji(m,i,l))):Ji(d,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function Ji(n,e,r){n.issues.length&&e.issues.push(...Ze(r,n.issues)),e.value[r]=n.value}var Il=w("$ZodRecord",(n,e)=>{te.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!Ot(t))return r.issues.push({expected:"record",code:"invalid_type",input:t,inst:n}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.valueType._zod.run({value:t[l],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Ze(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...Ze(l,u.issues)),r.value[l]=u.value)}let c;for(let l in t)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:t,inst:n,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Hi.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=>De(p,i,ge())),input:a,path:[a],inst:n});continue}let u=e.valueType._zod.run({value:t[a],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Ze(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...Ze(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Tl=w("$ZodMap",(n,e)=>{te.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])=>{Km(u,p,r,s,t,n,i)})):Km(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function Km(n,e,r,i,t,o,s){n.issues.length&&(Lr.has(typeof i)?r.issues.push(...Ze(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>De(a,s,ge()))})),e.issues.length&&(Lr.has(typeof i)?r.issues.push(...Ze(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>De(a,s,ge()))})),r.value.set(n.value,e.value)}var Rl=w("$ZodSet",(n,e)=>{te.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=>Ym(c,r))):Ym(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function Ym(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var Pl=w("$ZodEnum",(n,e)=>{te.init(n,e);let r=Ar(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>Lr.has(typeof t)).map(t=>typeof t=="string"?Ve(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}}),Nl=w("$ZodLiteral",(n,e)=>{if(te.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"?Ve(i):i?Ve(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}}),Cl=w("$ZodFile",(n,e)=>{te.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}}),zl=w("$ZodTransform",(n,e)=>{te.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new At(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 Qe;return r.value=t,r}});function Xm(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var to=w("$ZodOptional",(n,e)=>{te.init(n,e),n._zod.optin="optional",n._zod.optout="optional",ie(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ie(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Dr(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=>Xm(o,r.value)):Xm(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),Al=w("$ZodExactOptional",(n,e)=>{to.init(n,e),ie(n._zod,"values",()=>e.innerType._zod.values),ie(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),Dl=w("$ZodNullable",(n,e)=>{te.init(n,e),ie(n._zod,"optin",()=>e.innerType._zod.optin),ie(n._zod,"optout",()=>e.innerType._zod.optout),ie(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Dr(r.source)}|null)$`):void 0}),ie(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)}),Ll=w("$ZodDefault",(n,e)=>{te.init(n,e),n._zod.optin="optional",ie(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=>Qm(o,e)):Qm(t,e)}});function Qm(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var Ol=w("$ZodPrefault",(n,e)=>{te.init(n,e),n._zod.optin="optional",ie(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))}),Ml=w("$ZodNonOptional",(n,e)=>{te.init(n,e),ie(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=>ef(o,n)):ef(t,n)}});function ef(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 jl=w("$ZodSuccess",(n,e)=>{te.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new At("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)}}),Fl=w("$ZodCatch",(n,e)=>{te.init(n,e),ie(n._zod,"optin",()=>e.innerType._zod.optin),ie(n._zod,"optout",()=>e.innerType._zod.optout),ie(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=>De(s,i,ge()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=e.catchValue({...r,error:{issues:t.issues.map(o=>De(o,i,ge()))},input:r.value}),r.issues=[]),r)}}),Ul=w("$ZodNaN",(n,e)=>{te.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)}),Zl=w("$ZodPipe",(n,e)=>{te.init(n,e),ie(n._zod,"values",()=>e.in._zod.values),ie(n._zod,"optin",()=>e.in._zod.optin),ie(n._zod,"optout",()=>e.out._zod.optout),ie(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=>Vi(s,e.in,i)):Vi(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>Vi(o,e.out,i)):Vi(t,e.out,i)}});function Vi(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var Jr=w("$ZodCodec",(n,e)=>{te.init(n,e),ie(n._zod,"values",()=>e.in._zod.values),ie(n._zod,"optin",()=>e.in._zod.optin),ie(n._zod,"optout",()=>e.out._zod.optout),ie(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=>qi(s,e,i)):qi(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>qi(s,e,i)):qi(o,e,i)}}});function qi(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=>Ki(n,o,e.out,r)):Ki(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>Ki(n,o,e.in,r)):Ki(n,t,e.in,r)}}function Ki(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var Wl=w("$ZodReadonly",(n,e)=>{te.init(n,e),ie(n._zod,"propValues",()=>e.innerType._zod.propValues),ie(n._zod,"values",()=>e.innerType._zod.values),ie(n._zod,"optin",()=>e.innerType?._zod?.optin),ie(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(tf):tf(t)}});function tf(n){return n.value=Object.freeze(n.value),n}var Hl=w("$ZodTemplateLiteral",(n,e)=>{te.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||Ma.has(typeof i))r.push(Ve(`${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)}),Bl=w("$ZodFunction",(n,e)=>(te.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?zi(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?zi(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 Ai(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await Ai(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 eo({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)),Gl=w("$ZodPromise",(n,e)=>{te.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),Jl=w("$ZodLazy",(n,e)=>{te.init(n,e),ie(n._zod,"innerType",()=>e.getter()),ie(n._zod,"pattern",()=>n._zod.innerType?._zod?.pattern),ie(n._zod,"propValues",()=>n._zod.innerType?._zod?.propValues),ie(n._zod,"optin",()=>n._zod.innerType?._zod?.optin??void 0),ie(n._zod,"optout",()=>n._zod.innerType?._zod?.optout??void 0),n._zod.parse=(r,i)=>n._zod.innerType._zod.run(r,i)}),Vl=w("$ZodCustom",(n,e)=>{ue.init(n,e),te.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=>nf(o,r,i,n));nf(t,r,i,n)}});function nf(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(Tn(t))}}var qr={};Ue(qr,{ar:()=>lf,az:()=>uf,be:()=>df,bg:()=>mf,ca:()=>ff,cs:()=>hf,da:()=>gf,de:()=>yf,en:()=>no,eo:()=>bf,es:()=>vf,fa:()=>_f,fi:()=>xf,fr:()=>Sf,frCA:()=>$f,he:()=>wf,hu:()=>Ef,hy:()=>If,id:()=>Tf,is:()=>Rf,it:()=>Pf,ja:()=>Nf,ka:()=>Cf,kh:()=>zf,km:()=>ro,ko:()=>Af,lt:()=>Lf,mk:()=>Of,ms:()=>Mf,nl:()=>jf,no:()=>Ff,ota:()=>Uf,pl:()=>Wf,ps:()=>Zf,pt:()=>Hf,ru:()=>Gf,sl:()=>Jf,sv:()=>Vf,ta:()=>qf,th:()=>Kf,tr:()=>Yf,ua:()=>Xf,uk:()=>io,ur:()=>Qf,uz:()=>eh,vi:()=>th,yo:()=>ih,zhCN:()=>nh,zhTW:()=>rh});var SS=()=>{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=F(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 ${j(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 lf(){return{localeError:SS()}}var $S=()=>{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=F(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 ${j(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 uf(){return{localeError:$S()}}function pf(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 wS=()=>{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=F(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 ${j(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=pf(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=pf(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 df(){return{localeError:wS()}}var ES=()=>{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=F(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 ${j(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 mf(){return{localeError:ES()}}var kS=()=>{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=F(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 ${j(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 ff(){return{localeError:kS()}}var IS=()=>{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=F(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 ${j(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 hf(){return{localeError:IS()}}var TS=()=>{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=F(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 ${j(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 gf(){return{localeError:TS()}}var RS=()=>{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=F(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 ${j(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 yf(){return{localeError:RS()}}var PS=()=>{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=F(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${j(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 no(){return{localeError:PS()}}var NS=()=>{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=F(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 ${j(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 bf(){return{localeError:NS()}}var CS=()=>{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=F(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 ${j(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 vf(){return{localeError:CS()}}var zS=()=>{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=F(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 ${j(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 _f(){return{localeError:zS()}}var AS=()=>{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=F(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 ${j(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 xf(){return{localeError:AS()}}var DS=()=>{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=F(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 : ${j(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 Sf(){return{localeError:DS()}}var LS=()=>{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=F(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 ${j(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 $f(){return{localeError:LS()}}var OS=()=>{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=F(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 ${j(l.values[0])}`;let u=l.values.map(m=>j(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 v=(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 ${v}`}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"}: ${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 wf(){return{localeError:OS()}}var MS=()=>{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=F(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 ${j(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 Ef(){return{localeError:MS()}}function kf(n,e,r){return Math.abs(n)===1?e:r}function An(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 jS=()=>{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=F(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 ${j(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=kf(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 ${An(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 ${An(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=kf(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 ${An(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 ${An(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 ${An(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 ${An(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function If(){return{localeError:jS()}}var FS=()=>{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=F(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 ${j(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 Tf(){return{localeError:FS()}}var US=()=>{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=F(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 ${j(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 Rf(){return{localeError:US()}}var ZS=()=>{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=F(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 ${j(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 Pf(){return{localeError:ZS()}}var WS=()=>{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=F(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: ${j(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 Nf(){return{localeError:WS()}}var HS=()=>{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=F(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 ${j(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 Cf(){return{localeError:HS()}}var BS=()=>{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=F(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 ${j(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 ro(){return{localeError:BS()}}function zf(){return ro()}var GS=()=>{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=F(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 ${j(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 Af(){return{localeError:GS()}}var Vr=n=>n.charAt(0).toUpperCase()+n.slice(1);function Df(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 JS=()=>{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=F(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 ${j(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,Df(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${Vr(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`${Vr(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,Df(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${Vr(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`${Vr(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`${Vr(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Lf(){return{localeError:JS()}}var VS=()=>{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=F(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 ${j(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 Of(){return{localeError:VS()}}var qS=()=>{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=F(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 ${j(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 Mf(){return{localeError:qS()}}var KS=()=>{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=F(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 ${j(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 jf(){return{localeError:KS()}}var YS=()=>{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=F(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 ${j(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 Ff(){return{localeError:YS()}}var XS=()=>{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=F(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 ${j(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 Uf(){return{localeError:XS()}}var QS=()=>{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=F(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 ${j(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 Zf(){return{localeError:QS()}}var e$=()=>{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=F(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 ${j(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 Wf(){return{localeError:e$()}}var t$=()=>{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=F(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 ${j(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 Hf(){return{localeError:t$()}}function Bf(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 n$=()=>{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=F(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 ${j(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=Bf(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=Bf(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 Gf(){return{localeError:n$()}}var r$=()=>{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=F(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 ${j(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 Jf(){return{localeError:r$()}}var i$=()=>{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=F(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 ${j(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 Vf(){return{localeError:i$()}}var o$=()=>{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=F(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 ${j(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 qf(){return{localeError:o$()}}var s$=()=>{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=F(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 ${j(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 Kf(){return{localeError:s$()}}var a$=()=>{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=F(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 ${j(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 Yf(){return{localeError:a$()}}var c$=()=>{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=F(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 ${j(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 io(){return{localeError:c$()}}function Xf(){return io()}var l$=()=>{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=F(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: ${j(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 Qf(){return{localeError:l$()}}var u$=()=>{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=F(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 ${j(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 eh(){return{localeError:u$()}}var p$=()=>{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=F(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 ${j(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 th(){return{localeError:p$()}}var d$=()=>{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=F(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 ${j(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 nh(){return{localeError:d$()}}var m$=()=>{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=F(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 ${j(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 rh(){return{localeError:m$()}}var f$=()=>{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=F(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 ${j(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 ih(){return{localeError:f$()}}var oh,ql=Symbol("ZodOutput"),Kl=Symbol("ZodInput"),oo=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 so(){return new oo}(oh=globalThis).__zod_globalRegistry??(oh.__zod_globalRegistry=so());var Ee=globalThis.__zod_globalRegistry;function Yl(n,e){return new n({type:"string",...Z(e)})}function Xl(n,e){return new n({type:"string",coerce:!0,...Z(e)})}function ao(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Z(e)})}function Kr(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Z(e)})}function co(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(e)})}function lo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(e)})}function uo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(e)})}function po(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(e)})}function Yr(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Z(e)})}function mo(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(e)})}function fo(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(e)})}function ho(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(e)})}function go(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(e)})}function yo(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(e)})}function bo(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Z(e)})}function vo(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(e)})}function _o(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(e)})}function xo(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(e)})}function Ql(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...Z(e)})}function So(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(e)})}function $o(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(e)})}function wo(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Z(e)})}function Eo(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(e)})}function ko(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Z(e)})}function Io(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(e)})}var eu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function tu(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(e)})}function nu(n,e){return new n({type:"string",format:"date",check:"string_format",...Z(e)})}function ru(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...Z(e)})}function iu(n,e){return new n({type:"string",format:"duration",check:"string_format",...Z(e)})}function ou(n,e){return new n({type:"number",checks:[],...Z(e)})}function su(n,e){return new n({type:"number",coerce:!0,checks:[],...Z(e)})}function au(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(e)})}function cu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...Z(e)})}function lu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...Z(e)})}function uu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...Z(e)})}function pu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(e)})}function du(n,e){return new n({type:"boolean",...Z(e)})}function mu(n,e){return new n({type:"boolean",coerce:!0,...Z(e)})}function fu(n,e){return new n({type:"bigint",...Z(e)})}function hu(n,e){return new n({type:"bigint",coerce:!0,...Z(e)})}function gu(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Z(e)})}function yu(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Z(e)})}function bu(n,e){return new n({type:"symbol",...Z(e)})}function vu(n,e){return new n({type:"undefined",...Z(e)})}function _u(n,e){return new n({type:"null",...Z(e)})}function xu(n){return new n({type:"any"})}function Su(n){return new n({type:"unknown"})}function $u(n,e){return new n({type:"never",...Z(e)})}function wu(n,e){return new n({type:"void",...Z(e)})}function Eu(n,e){return new n({type:"date",...Z(e)})}function ku(n,e){return new n({type:"date",coerce:!0,...Z(e)})}function Iu(n,e){return new n({type:"nan",...Z(e)})}function lt(n,e){return new Bi({check:"less_than",...Z(e),value:n,inclusive:!1})}function We(n,e){return new Bi({check:"less_than",...Z(e),value:n,inclusive:!0})}function ut(n,e){return new Gi({check:"greater_than",...Z(e),value:n,inclusive:!1})}function Ce(n,e){return new Gi({check:"greater_than",...Z(e),value:n,inclusive:!0})}function To(n){return ut(0,n)}function Ro(n){return lt(0,n)}function Po(n){return We(0,n)}function No(n){return Ce(0,n)}function jt(n,e){return new _c({check:"multiple_of",...Z(e),value:n})}function Ft(n,e){return new $c({check:"max_size",...Z(e),maximum:n})}function pt(n,e){return new wc({check:"min_size",...Z(e),minimum:n})}function un(n,e){return new Ec({check:"size_equals",...Z(e),size:n})}function pn(n,e){return new kc({check:"max_length",...Z(e),maximum:n})}function wt(n,e){return new Ic({check:"min_length",...Z(e),minimum:n})}function dn(n,e){return new Tc({check:"length_equals",...Z(e),length:n})}function Dn(n,e){return new Rc({check:"string_format",format:"regex",...Z(e),pattern:n})}function Ln(n){return new Pc({check:"string_format",format:"lowercase",...Z(n)})}function On(n){return new Nc({check:"string_format",format:"uppercase",...Z(n)})}function Mn(n,e){return new Cc({check:"string_format",format:"includes",...Z(e),includes:n})}function jn(n,e){return new zc({check:"string_format",format:"starts_with",...Z(e),prefix:n})}function Fn(n,e){return new Ac({check:"string_format",format:"ends_with",...Z(e),suffix:n})}function Co(n,e,r){return new Dc({check:"property",property:n,schema:e,...Z(r)})}function Un(n,e){return new Lc({check:"mime_type",mime:n,...Z(e)})}function et(n){return new Oc({check:"overwrite",tx:n})}function Zn(n){return et(e=>e.normalize(n))}function Wn(){return et(n=>n.trim())}function Hn(){return et(n=>n.toLowerCase())}function Bn(){return et(n=>n.toUpperCase())}function Gn(){return et(n=>Da(n))}function Tu(n,e,r){return new n({type:"array",element:e,...Z(r)})}function g$(n,e,r){return new n({type:"union",options:e,...Z(r)})}function y$(n,e,r){return new n({type:"union",options:e,inclusive:!1,...Z(r)})}function b$(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...Z(i)})}function v$(n,e,r){return new n({type:"intersection",left:e,right:r})}function _$(n,e,r,i){let t=r instanceof te,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...Z(o)})}function x$(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...Z(i)})}function S$(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...Z(i)})}function $$(n,e,r){return new n({type:"set",valueType:e,...Z(r)})}function w$(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...Z(r)})}function E$(n,e,r){return new n({type:"enum",entries:e,...Z(r)})}function k$(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...Z(r)})}function Ru(n,e){return new n({type:"file",...Z(e)})}function I$(n,e){return new n({type:"transform",transform:e})}function T$(n,e){return new n({type:"optional",innerType:e})}function R$(n,e){return new n({type:"nullable",innerType:e})}function P$(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Oa(r)}})}function N$(n,e,r){return new n({type:"nonoptional",innerType:e,...Z(r)})}function C$(n,e){return new n({type:"success",innerType:e})}function z$(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function A$(n,e,r){return new n({type:"pipe",in:e,out:r})}function D$(n,e){return new n({type:"readonly",innerType:e})}function L$(n,e,r){return new n({type:"template_literal",parts:e,...Z(r)})}function O$(n,e){return new n({type:"lazy",getter:e})}function M$(n,e){return new n({type:"promise",innerType:e})}function Pu(n,e,r){let i=Z(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function Nu(n,e,r){return new n({type:"custom",check:"custom",fn:e,...Z(r)})}function Cu(n){let e=sh(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Tn(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(Tn(t))}},n(r.value,r)));return e}function sh(n,e){let r=new ue({check:"custom",...Z(e)});return r._zod.check=n,r}function zu(n){let e=new ue({check:"describe"});return e._zod.onattach=[r=>{let i=Ee.get(r)??{};Ee.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function Au(n){let e=new ue({check:"meta"});return e._zod.onattach=[r=>{let i=Ee.get(r)??{};Ee.add(r,{...i,...n})}],e._zod.check=()=>{},e}function Du(n,e){let r=Z(e),i=r.truthy??["true","1","yes","on","y","enabled"],t=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(t),a=n.Codec??Jr,c=n.Boolean??Br,l=n.String??ln,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 Jn(n,e,r,i={}){let t=Z(i),o={...Z(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...t};return r instanceof RegExp&&(o.pattern=r),new n(o)}function Ut(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??Ee,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 ae(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),ae(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"&&ze(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>
|
|
704
|
+
`)}m.write("payload.value = newResult;"),m.write("return payload;");let v=m.compile();return(b,S)=>v(d,b,S)},o,s=xn,a=!Br.jitless,l=a&&Xa.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?Cf([],f,d,m,p,n):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:n}),d)}});function bf(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=>!Xt(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=>He(s,i,$e())))}),e)}var oi=k("$ZodUnion",(n,e)=>{ne.init(n,e),se(n._zod,"optin",()=>e.options.some(t=>t._zod.optin==="optional")?"optional":void 0),se(n._zod,"optout",()=>e.options.some(t=>t._zod.optout==="optional")?"optional":void 0),se(n._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),se(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=>Vr(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=>bf(c,t,n,o)):bf(a,t,n,o)}});function _f(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=>He(s,i,$e())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Fl=k("$ZodXor",(n,e)=>{oi.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=>_f(c,t,n,o)):_f(a,t,n,o)}}),Ul=k("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,oi.init(n,e);let r=n._zod.parse;se(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=Un(()=>{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(!xn(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)}}),Wl=k("$ZodIntersection",(n,e)=>{ne.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])=>vf(r,c,l)):vf(r,o,s)}});function tl(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(Yt(n)&&Yt(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=tl(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=tl(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 vf(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}),Xt(n))return n;let s=tl(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 mo=k("$ZodTuple",(n,e)=>{ne.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=>oo(d,i,l))):oo(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=>oo(m,i,l))):oo(d,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function oo(n,e,r){n.issues.length&&e.issues.push(...Ye(r,n.issues)),e.value[r]=n.value}var Zl=k("$ZodRecord",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!Yt(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(...Ye(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...Ye(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"&&no.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=>He(p,i,$e())),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(...Ye(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...Ye(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Hl=k("$ZodMap",(n,e)=>{ne.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])=>{xf(u,p,r,s,t,n,i)})):xf(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function xf(n,e,r,i,t,o,s){n.issues.length&&(qr.has(typeof i)?r.issues.push(...Ye(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>He(a,s,$e()))})),e.issues.length&&(qr.has(typeof i)?r.issues.push(...Ye(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>He(a,s,$e()))})),r.value.set(n.value,e.value)}var Bl=k("$ZodSet",(n,e)=>{ne.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=>Sf(c,r))):Sf(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function Sf(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var Gl=k("$ZodEnum",(n,e)=>{ne.init(n,e);let r=Jr(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>qr.has(typeof t)).map(t=>typeof t=="string"?ot(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}}),Jl=k("$ZodLiteral",(n,e)=>{if(ne.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"?ot(i):i?ot(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}}),Vl=k("$ZodFile",(n,e)=>{ne.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}}),ql=k("$ZodTransform",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vt(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 dt;return r.value=t,r}});function $f(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var fo=k("$ZodOptional",(n,e)=>{ne.init(n,e),n._zod.optin="optional",n._zod.optout="optional",se(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),se(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Vr(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=>$f(o,r.value)):$f(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),Kl=k("$ZodExactOptional",(n,e)=>{fo.init(n,e),se(n._zod,"values",()=>e.innerType._zod.values),se(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),Yl=k("$ZodNullable",(n,e)=>{ne.init(n,e),se(n._zod,"optin",()=>e.innerType._zod.optin),se(n._zod,"optout",()=>e.innerType._zod.optout),se(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Vr(r.source)}|null)$`):void 0}),se(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=k("$ZodDefault",(n,e)=>{ne.init(n,e),n._zod.optin="optional",se(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=>wf(o,e)):wf(t,e)}});function wf(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var Ql=k("$ZodPrefault",(n,e)=>{ne.init(n,e),n._zod.optin="optional",se(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))}),eu=k("$ZodNonOptional",(n,e)=>{ne.init(n,e),se(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=>Ef(o,n)):Ef(t,n)}});function Ef(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 tu=k("$ZodSuccess",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vt("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)}}),nu=k("$ZodCatch",(n,e)=>{ne.init(n,e),se(n._zod,"optin",()=>e.innerType._zod.optin),se(n._zod,"optout",()=>e.innerType._zod.optout),se(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=>He(s,i,$e()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=e.catchValue({...r,error:{issues:t.issues.map(o=>He(o,i,$e()))},input:r.value}),r.issues=[]),r)}}),ru=k("$ZodNaN",(n,e)=>{ne.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)}),iu=k("$ZodPipe",(n,e)=>{ne.init(n,e),se(n._zod,"values",()=>e.in._zod.values),se(n._zod,"optin",()=>e.in._zod.optin),se(n._zod,"optout",()=>e.out._zod.optout),se(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=>so(s,e.in,i)):so(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>so(o,e.out,i)):so(t,e.out,i)}});function so(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var si=k("$ZodCodec",(n,e)=>{ne.init(n,e),se(n._zod,"values",()=>e.in._zod.values),se(n._zod,"optin",()=>e.in._zod.optin),se(n._zod,"optout",()=>e.out._zod.optout),se(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=>ao(s,e,i)):ao(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>ao(s,e,i)):ao(o,e,i)}}});function ao(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=>co(n,o,e.out,r)):co(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>co(n,o,e.in,r)):co(n,t,e.in,r)}}function co(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var ou=k("$ZodReadonly",(n,e)=>{ne.init(n,e),se(n._zod,"propValues",()=>e.innerType._zod.propValues),se(n._zod,"values",()=>e.innerType._zod.values),se(n._zod,"optin",()=>e.innerType?._zod?.optin),se(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(kf):kf(t)}});function kf(n){return n.value=Object.freeze(n.value),n}var su=k("$ZodTemplateLiteral",(n,e)=>{ne.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||ec.has(typeof i))r.push(ot(`${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)}),au=k("$ZodFunction",(n,e)=>(ne.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?Bi(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?Bi(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 Gi(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await Gi(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 mo({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)),cu=k("$ZodPromise",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),lu=k("$ZodLazy",(n,e)=>{ne.init(n,e),se(n._zod,"innerType",()=>e.getter()),se(n._zod,"pattern",()=>n._zod.innerType?._zod?.pattern),se(n._zod,"propValues",()=>n._zod.innerType?._zod?.propValues),se(n._zod,"optin",()=>n._zod.innerType?._zod?.optin??void 0),se(n._zod,"optout",()=>n._zod.innerType?._zod?.optout??void 0),n._zod.parse=(r,i)=>n._zod.innerType._zod.run(r,i)}),uu=k("$ZodCustom",(n,e)=>{he.init(n,e),ne.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=>If(o,r,i,n));If(t,r,i,n)}});function If(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(Wn(t))}}var ci={};Ke(ci,{ar:()=>Af,az:()=>zf,be:()=>Lf,bg:()=>Of,ca:()=>Mf,cs:()=>jf,da:()=>Ff,de:()=>Uf,en:()=>ho,eo:()=>Wf,es:()=>Zf,fa:()=>Hf,fi:()=>Bf,fr:()=>Gf,frCA:()=>Jf,he:()=>Vf,hu:()=>qf,hy:()=>Yf,id:()=>Xf,is:()=>Qf,it:()=>eh,ja:()=>th,ka:()=>nh,kh:()=>rh,km:()=>go,ko:()=>ih,lt:()=>sh,mk:()=>ah,ms:()=>ch,nl:()=>lh,no:()=>uh,ota:()=>ph,pl:()=>mh,ps:()=>dh,pt:()=>fh,ru:()=>gh,sl:()=>yh,sv:()=>bh,ta:()=>_h,th:()=>vh,tr:()=>xh,ua:()=>Sh,uk:()=>yo,ur:()=>$h,uz:()=>wh,vi:()=>Eh,yo:()=>Th,zhCN:()=>kh,zhTW:()=>Ih});var XS=()=>{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=U(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 ${F(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: ${R(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":""}: ${R(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 Af(){return{localeError:XS()}}var QS=()=>{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=U(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 ${F(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${R(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":""}: ${R(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 zf(){return{localeError:QS()}}function Df(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 e$=()=>{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=U(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 ${F(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 ${R(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.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=Df(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"}: ${R(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 Lf(){return{localeError:e$()}}var t$=()=>{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=U(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 ${F(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 ${R(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":""}: ${R(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 Of(){return{localeError:t$()}}var n$=()=>{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=U(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 ${F(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${R(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":""}: ${R(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 Mf(){return{localeError:n$()}}var r$=()=>{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=U(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 ${F(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${R(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: ${R(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 jf(){return{localeError:r$()}}var i$=()=>{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=U(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 ${F(t.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${R(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"}: ${R(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 Ff(){return{localeError:i$()}}var o$=()=>{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=U(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 ${F(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${R(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"}: ${R(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 Uf(){return{localeError:o$()}}var s$=()=>{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=U(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${F(t.values[0])}`:`Invalid option: expected one of ${R(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":""}: ${R(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 ho(){return{localeError:s$()}}var a$=()=>{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=U(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 ${F(t.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${R(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":""}: ${R(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 Wf(){return{localeError:a$()}}var c$=()=>{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=U(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 ${F(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${R(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":""}: ${R(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 Zf(){return{localeError:c$()}}var l$=()=>{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=U(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 ${F(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 ${R(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: ${R(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 Hf(){return{localeError:l$()}}var u$=()=>{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=U(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 ${F(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${R(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"}: ${R(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 Bf(){return{localeError:u$()}}var p$=()=>{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=U(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 : ${F(t.values[0])} attendu`:`Option invalide : une valeur parmi ${R(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":""} : ${R(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 Gf(){return{localeError:p$()}}var d$=()=>{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=U(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 ${F(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${R(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":""} : ${R(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 Jf(){return{localeError:d$()}}var m$=()=>{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=U(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 ${F(l.values[0])}`;let u=l.values.map(m=>F(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",g=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 ${g}`.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 g=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 ${g}`.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"}: ${R(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 Vf(){return{localeError:m$()}}var f$=()=>{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=U(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 ${F(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${R(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":""}: ${R(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 qf(){return{localeError:f$()}}function Kf(n,e,r){return Math.abs(n)===1?e:r}function Vn(n){if(!n)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=n[n.length-1];return n+(e.includes(r)?"\u0576":"\u0568")}var h$=()=>{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=U(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 ${F(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 ${R(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Kf(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Vn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Vn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=Kf(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Vn(t.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Vn(t.origin)} \u056C\u056B\u0576\u056B ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??t.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${t.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${t.keys.length>1?"\u0576\u0565\u0580":""}. ${R(t.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Vn(t.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Vn(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Yf(){return{localeError:h$()}}var g$=()=>{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=U(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 ${F(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${R(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":""}: ${R(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 Xf(){return{localeError:g$()}}var y$=()=>{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=U(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 ${F(t.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${R(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"}: ${R(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 Qf(){return{localeError:y$()}}var b$=()=>{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=U(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 ${F(t.values[0])}`:`Opzione non valida: atteso uno tra ${R(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"}: ${R(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 eh(){return{localeError:b$()}}var _$=()=>{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=U(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: ${F(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${R(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":""}: ${R(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 th(){return{localeError:_$()}}var v$=()=>{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=U(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 ${F(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 ${R(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"}: ${R(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 nh(){return{localeError:v$()}}var x$=()=>{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=U(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 ${F(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 ${R(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 ${R(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 go(){return{localeError:x$()}}function rh(){return go()}var S$=()=>{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=U(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 ${F(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${R(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: ${R(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 ih(){return{localeError:S$()}}var ai=n=>n.charAt(0).toUpperCase()+n.slice(1);function oh(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 $$=()=>{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=U(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 ${F(t.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${R(t.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[t.origin]??t.origin,s=e(t.origin,oh(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${ai(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`${ai(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,oh(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${ai(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`${ai(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"}: ${R(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`${ai(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function sh(){return{localeError:$$()}}var w$=()=>{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=U(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 ${F(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 ${R(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"}: ${R(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 ah(){return{localeError:w$()}}var E$=()=>{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=U(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 ${F(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${R(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: ${R(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 ch(){return{localeError:E$()}}var k$=()=>{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=U(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 ${F(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${R(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":""}: ${R(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 lh(){return{localeError:k$()}}var I$=()=>{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=U(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 ${F(t.values[0])}`:`Ugyldig valg: forventet en av ${R(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"}: ${R(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 uh(){return{localeError:I$()}}var T$=()=>{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=U(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 ${F(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${R(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":""}: ${R(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 ph(){return{localeError:T$()}}var R$=()=>{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=U(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 ${F(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${R(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"}: ${R(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 dh(){return{localeError:R$()}}var P$=()=>{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=U(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 ${F(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${R(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":""}: ${R(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 mh(){return{localeError:P$()}}var C$=()=>{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=U(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 ${F(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${R(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":""}: ${R(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 fh(){return{localeError:C$()}}function hh(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 N$=()=>{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=U(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 ${F(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 ${R(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=hh(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=hh(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":""}: ${R(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 gh(){return{localeError:N$()}}var A$=()=>{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=U(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 ${F(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${R(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"}: ${R(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 yh(){return{localeError:A$()}}var z$=()=>{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=U(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 ${F(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${R(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"}: ${R(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 bh(){return{localeError:z$()}}var D$=()=>{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=U(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 ${F(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 ${R(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":""}: ${R(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 _h(){return{localeError:D$()}}var L$=()=>{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=U(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 ${F(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 ${R(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: ${R(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 vh(){return{localeError:L$()}}var O$=()=>{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=U(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 ${F(t.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${R(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":""}: ${R(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 xh(){return{localeError:O$()}}var M$=()=>{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=U(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 ${F(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 ${R(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":""}: ${R(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 yo(){return{localeError:M$()}}function Sh(){return yo()}var j$=()=>{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=U(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: ${F(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${R(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":""}: ${R(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 $h(){return{localeError:j$()}}var F$=()=>{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=U(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 ${F(t.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${R(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":""}: ${R(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 wh(){return{localeError:F$()}}var U$=()=>{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=U(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 ${F(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 ${R(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: ${R(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 Eh(){return{localeError:U$()}}var W$=()=>{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=U(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 ${F(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${R(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): ${R(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 kh(){return{localeError:W$()}}var Z$=()=>{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=U(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 ${F(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${R(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${R(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 Ih(){return{localeError:Z$()}}var H$=()=>{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=U(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 ${F(t.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${R(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: ${R(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 Th(){return{localeError:H$()}}var Rh,pu=Symbol("ZodOutput"),du=Symbol("ZodInput"),bo=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 _o(){return new bo}(Rh=globalThis).__zod_globalRegistry??(Rh.__zod_globalRegistry=_o());var Pe=globalThis.__zod_globalRegistry;function mu(n,e){return new n({type:"string",...Z(e)})}function fu(n,e){return new n({type:"string",coerce:!0,...Z(e)})}function vo(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Z(e)})}function li(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Z(e)})}function xo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(e)})}function So(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(e)})}function $o(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(e)})}function wo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(e)})}function ui(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Z(e)})}function Eo(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(e)})}function ko(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(e)})}function Io(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(e)})}function To(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(e)})}function Ro(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(e)})}function Po(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Z(e)})}function Co(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(e)})}function No(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(e)})}function Ao(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(e)})}function hu(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...Z(e)})}function zo(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(e)})}function Do(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(e)})}function Lo(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Z(e)})}function Oo(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(e)})}function Mo(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Z(e)})}function jo(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(e)})}var gu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function yu(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(e)})}function bu(n,e){return new n({type:"string",format:"date",check:"string_format",...Z(e)})}function _u(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...Z(e)})}function vu(n,e){return new n({type:"string",format:"duration",check:"string_format",...Z(e)})}function xu(n,e){return new n({type:"number",checks:[],...Z(e)})}function Su(n,e){return new n({type:"number",coerce:!0,checks:[],...Z(e)})}function $u(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(e)})}function wu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...Z(e)})}function Eu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...Z(e)})}function ku(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...Z(e)})}function Iu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(e)})}function Tu(n,e){return new n({type:"boolean",...Z(e)})}function Ru(n,e){return new n({type:"boolean",coerce:!0,...Z(e)})}function Pu(n,e){return new n({type:"bigint",...Z(e)})}function Cu(n,e){return new n({type:"bigint",coerce:!0,...Z(e)})}function Nu(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Z(e)})}function Au(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Z(e)})}function zu(n,e){return new n({type:"symbol",...Z(e)})}function Du(n,e){return new n({type:"undefined",...Z(e)})}function Lu(n,e){return new n({type:"null",...Z(e)})}function Ou(n){return new n({type:"any"})}function Mu(n){return new n({type:"unknown"})}function ju(n,e){return new n({type:"never",...Z(e)})}function Fu(n,e){return new n({type:"void",...Z(e)})}function Uu(n,e){return new n({type:"date",...Z(e)})}function Wu(n,e){return new n({type:"date",coerce:!0,...Z(e)})}function Zu(n,e){return new n({type:"nan",...Z(e)})}function xt(n,e){return new ro({check:"less_than",...Z(e),value:n,inclusive:!1})}function Xe(n,e){return new ro({check:"less_than",...Z(e),value:n,inclusive:!0})}function St(n,e){return new io({check:"greater_than",...Z(e),value:n,inclusive:!1})}function je(n,e){return new io({check:"greater_than",...Z(e),value:n,inclusive:!0})}function Fo(n){return St(0,n)}function Uo(n){return xt(0,n)}function Wo(n){return Xe(0,n)}function Zo(n){return je(0,n)}function Qt(n,e){return new Lc({check:"multiple_of",...Z(e),value:n})}function en(n,e){return new jc({check:"max_size",...Z(e),maximum:n})}function $t(n,e){return new Fc({check:"min_size",...Z(e),minimum:n})}function wn(n,e){return new Uc({check:"size_equals",...Z(e),size:n})}function En(n,e){return new Wc({check:"max_length",...Z(e),maximum:n})}function Lt(n,e){return new Zc({check:"min_length",...Z(e),minimum:n})}function kn(n,e){return new Hc({check:"length_equals",...Z(e),length:n})}function qn(n,e){return new Bc({check:"string_format",format:"regex",...Z(e),pattern:n})}function Kn(n){return new Gc({check:"string_format",format:"lowercase",...Z(n)})}function Yn(n){return new Jc({check:"string_format",format:"uppercase",...Z(n)})}function Xn(n,e){return new Vc({check:"string_format",format:"includes",...Z(e),includes:n})}function Qn(n,e){return new qc({check:"string_format",format:"starts_with",...Z(e),prefix:n})}function er(n,e){return new Kc({check:"string_format",format:"ends_with",...Z(e),suffix:n})}function Ho(n,e,r){return new Yc({check:"property",property:n,schema:e,...Z(r)})}function tr(n,e){return new Xc({check:"mime_type",mime:n,...Z(e)})}function mt(n){return new Qc({check:"overwrite",tx:n})}function nr(n){return mt(e=>e.normalize(n))}function rr(){return mt(n=>n.trim())}function ir(){return mt(n=>n.toLowerCase())}function or(){return mt(n=>n.toUpperCase())}function sr(){return mt(n=>Ya(n))}function Hu(n,e,r){return new n({type:"array",element:e,...Z(r)})}function G$(n,e,r){return new n({type:"union",options:e,...Z(r)})}function J$(n,e,r){return new n({type:"union",options:e,inclusive:!1,...Z(r)})}function V$(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...Z(i)})}function q$(n,e,r){return new n({type:"intersection",left:e,right:r})}function K$(n,e,r,i){let t=r instanceof ne,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...Z(o)})}function Y$(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...Z(i)})}function X$(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...Z(i)})}function Q$(n,e,r){return new n({type:"set",valueType:e,...Z(r)})}function ew(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...Z(r)})}function tw(n,e,r){return new n({type:"enum",entries:e,...Z(r)})}function nw(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...Z(r)})}function Bu(n,e){return new n({type:"file",...Z(e)})}function rw(n,e){return new n({type:"transform",transform:e})}function iw(n,e){return new n({type:"optional",innerType:e})}function ow(n,e){return new n({type:"nullable",innerType:e})}function sw(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Qa(r)}})}function aw(n,e,r){return new n({type:"nonoptional",innerType:e,...Z(r)})}function cw(n,e){return new n({type:"success",innerType:e})}function lw(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function uw(n,e,r){return new n({type:"pipe",in:e,out:r})}function pw(n,e){return new n({type:"readonly",innerType:e})}function dw(n,e,r){return new n({type:"template_literal",parts:e,...Z(r)})}function mw(n,e){return new n({type:"lazy",getter:e})}function fw(n,e){return new n({type:"promise",innerType:e})}function Gu(n,e,r){let i=Z(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function Ju(n,e,r){return new n({type:"custom",check:"custom",fn:e,...Z(r)})}function Vu(n){let e=Ph(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Wn(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(Wn(t))}},n(r.value,r)));return e}function Ph(n,e){let r=new he({check:"custom",...Z(e)});return r._zod.check=n,r}function qu(n){let e=new he({check:"describe"});return e._zod.onattach=[r=>{let i=Pe.get(r)??{};Pe.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function Ku(n){let e=new he({check:"meta"});return e._zod.onattach=[r=>{let i=Pe.get(r)??{};Pe.add(r,{...i,...n})}],e._zod.check=()=>{},e}function Yu(n,e){let r=Z(e),i=r.truthy??["true","1","yes","on","y","enabled"],t=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(t),a=n.Codec??si,c=n.Boolean??ii,l=n.String??$n,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 g=m;return r.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!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 ar(n,e,r,i={}){let t=Z(i),o={...Z(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...t};return r instanceof RegExp&&(o.pattern=r),new n(o)}function tn(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??Pe,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 pe(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),pe(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"&&Fe(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 nn(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>
|
|
652
705
|
|
|
653
|
-
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 Wt(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:Vn(e,"input",n.processors),output:Vn(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ze(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 ze(i.element,r);if(i.type==="set")return ze(i.valueType,r);if(i.type==="lazy")return ze(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 ze(i.innerType,r);if(i.type==="intersection")return ze(i.left,r)||ze(i.right,r);if(i.type==="record"||i.type==="map")return ze(i.keyType,r)||ze(i.valueType,r);if(i.type==="pipe")return ze(i.in,r)||ze(i.out,r);if(i.type==="object"){for(let t in i.shape)if(ze(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(ze(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(ze(t,r))return!0;return!!(i.rest&&ze(i.rest,r))}return!1}var Lu=(n,e={})=>r=>{let i=Ut({...r,processors:e});return ae(n,i),Zt(i,n),Wt(i,n)},Vn=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=Ut({...t??{},target:o,io:e,processors:r});return ae(n,s),Zt(s,n),Wt(s,n)};var j$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ou=(n,e,r,i)=>{let t=r;t.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=n._zod.bag;if(typeof o=="number"&&(t.minLength=o),typeof s=="number"&&(t.maxLength=s),a&&(t.format=j$[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}))])}},Mu=(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)},ju=(n,e,r,i)=>{r.type="boolean"},Fu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Uu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Zu=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Wu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Hu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Bu=(n,e,r,i)=>{r.not={}},Gu=(n,e,r,i)=>{},Ju=(n,e,r,i)=>{},Vu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},qu=(n,e,r,i)=>{let t=n._zod.def,o=Ar(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},Ku=(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},Yu=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Xu=(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},Qu=(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)},ep=(n,e,r,i)=>{r.type="boolean"},tp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},np=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},rp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ip=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},op=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},sp=(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=ae(o.element,e,{...i,path:[...i.path,"items"]})},ap=(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]=ae(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=ae(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},Ao=(n,e,r,i)=>{let t=n._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>ae(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},cp=(n,e,r,i)=>{let t=n._zod.def,o=ae(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=ae(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},lp=(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)=>ae(d,e,{...i,path:[...i.path,s,m]})),l=o.rest?ae(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)},up=(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=ae(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=ae(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=ae(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)}},pp=(n,e,r,i)=>{let t=n._zod.def,o=ae(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"}]},dp=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},mp=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.default=JSON.parse(JSON.stringify(t.defaultValue))},fp=(n,e,r,i)=>{let t=n._zod.def;ae(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)))},hp=(n,e,r,i)=>{let t=n._zod.def;ae(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},gp=(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;ae(o,e,i);let s=e.seen.get(n);s.ref=o},yp=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.readOnly=!0},bp=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Do=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},vp=(n,e,r,i)=>{let t=n._zod.innerType;ae(t,e,i);let o=e.seen.get(n);o.ref=t},zo={string:Ou,number:Mu,boolean:ju,bigint:Fu,symbol:Uu,null:Zu,undefined:Wu,void:Hu,never:Bu,any:Gu,unknown:Ju,date:Vu,enum:qu,literal:Ku,nan:Yu,template_literal:Xu,file:Qu,success:ep,custom:tp,function:np,transform:rp,map:ip,set:op,array:sp,object:ap,union:Ao,intersection:cp,tuple:lp,record:up,nullable:pp,nonoptional:dp,default:mp,prefault:fp,catch:hp,pipe:gp,readonly:yp,promise:bp,optional:Do,lazy:vp};function Lo(n,e){if("_idmap"in n){let i=n,t=Ut({...e,processors:zo}),o={};for(let c of i._idmap.entries()){let[l,u]=c;ae(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]=Wt(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=Ut({...e,processors:zo});return ae(n,r),Zt(r,n),Wt(r,n)}var Oo=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=Ut({processors:zo,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 ae(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=Wt(this.ctx,e),{"~standard":t,...o}=i;return o}};var ah={};var Xr={};Ue(Xr,{ZodAny:()=>Wp,ZodArray:()=>Jp,ZodBase64:()=>is,ZodBase64URL:()=>os,ZodBigInt:()=>tr,ZodBigIntFormat:()=>cs,ZodBoolean:()=>er,ZodCIDRv4:()=>ns,ZodCIDRv6:()=>rs,ZodCUID:()=>qo,ZodCUID2:()=>Ko,ZodCatch:()=>hd,ZodCodec:()=>gs,ZodCustom:()=>li,ZodCustomStringFormat:()=>Xn,ZodDate:()=>ii,ZodDefault:()=>ld,ZodDiscriminatedUnion:()=>qp,ZodE164:()=>ss,ZodEmail:()=>Go,ZodEmoji:()=>Jo,ZodEnum:()=>Kn,ZodExactOptional:()=>sd,ZodFile:()=>id,ZodFunction:()=>wd,ZodGUID:()=>Qr,ZodIPv4:()=>es,ZodIPv6:()=>ts,ZodIntersection:()=>Kp,ZodJWT:()=>as,ZodKSUID:()=>Qo,ZodLazy:()=>xd,ZodLiteral:()=>rd,ZodMAC:()=>Lp,ZodMap:()=>td,ZodNaN:()=>yd,ZodNanoID:()=>Vo,ZodNever:()=>Bp,ZodNonOptional:()=>fs,ZodNull:()=>Up,ZodNullable:()=>cd,ZodNumber:()=>Qn,ZodNumberFormat:()=>fn,ZodObject:()=>si,ZodOptional:()=>ms,ZodPipe:()=>hs,ZodPrefault:()=>pd,ZodPromise:()=>$d,ZodReadonly:()=>bd,ZodRecord:()=>ci,ZodSet:()=>nd,ZodString:()=>Yn,ZodStringFormat:()=>le,ZodSuccess:()=>fd,ZodSymbol:()=>jp,ZodTemplateLiteral:()=>_d,ZodTransform:()=>od,ZodTuple:()=>Xp,ZodType:()=>re,ZodULID:()=>Yo,ZodURL:()=>ri,ZodUUID:()=>dt,ZodUndefined:()=>Fp,ZodUnion:()=>ai,ZodUnknown:()=>Hp,ZodVoid:()=>Gp,ZodXID:()=>Xo,ZodXor:()=>Vp,_ZodString:()=>Bo,_default:()=>ud,_function:()=>fg,any:()=>Gh,array:()=>oi,base64:()=>Rh,base64url:()=>Ph,bigint:()=>Uh,boolean:()=>Mp,catch:()=>gd,check:()=>hg,cidrv4:()=>Ih,cidrv6:()=>Th,codec:()=>pg,cuid:()=>vh,cuid2:()=>_h,custom:()=>gg,date:()=>Vh,describe:()=>yg,discriminatedUnion:()=>eg,e164:()=>Nh,email:()=>lh,emoji:()=>yh,enum:()=>ps,exactOptional:()=>ad,file:()=>ag,float32:()=>Oh,float64:()=>Mh,function:()=>fg,guid:()=>uh,hash:()=>Lh,hex:()=>Dh,hostname:()=>Ah,httpUrl:()=>gh,instanceof:()=>vg,int:()=>Ho,int32:()=>jh,int64:()=>Zh,intersection:()=>Yp,ipv4:()=>wh,ipv6:()=>kh,json:()=>xg,jwt:()=>Ch,keyof:()=>qh,ksuid:()=>$h,lazy:()=>Sd,literal:()=>sg,looseObject:()=>Xh,looseRecord:()=>ng,mac:()=>Eh,map:()=>rg,meta:()=>bg,nan:()=>ug,nanoid:()=>bh,nativeEnum:()=>og,never:()=>ls,nonoptional:()=>md,null:()=>Zp,nullable:()=>ti,nullish:()=>cg,number:()=>Op,object:()=>Kh,optional:()=>ei,partialRecord:()=>tg,pipe:()=>ni,prefault:()=>dd,preprocess:()=>Sg,promise:()=>mg,readonly:()=>vd,record:()=>ed,refine:()=>Ed,set:()=>ig,strictObject:()=>Yh,string:()=>Wo,stringFormat:()=>zh,stringbool:()=>_g,success:()=>lg,superRefine:()=>kd,symbol:()=>Hh,templateLiteral:()=>dg,transform:()=>ds,tuple:()=>Qp,uint32:()=>Fh,uint64:()=>Wh,ulid:()=>xh,undefined:()=>Bh,union:()=>us,unknown:()=>mn,url:()=>hh,uuid:()=>ph,uuidv4:()=>dh,uuidv6:()=>mh,uuidv7:()=>fh,void:()=>Jh,xid:()=>Sh,xor:()=>Qh});var Mo={};Ue(Mo,{endsWith:()=>Fn,gt:()=>ut,gte:()=>Ce,includes:()=>Mn,length:()=>dn,lowercase:()=>Ln,lt:()=>lt,lte:()=>We,maxLength:()=>pn,maxSize:()=>Ft,mime:()=>Un,minLength:()=>wt,minSize:()=>pt,multipleOf:()=>jt,negative:()=>Ro,nonnegative:()=>No,nonpositive:()=>Po,normalize:()=>Zn,overwrite:()=>et,positive:()=>To,property:()=>Co,regex:()=>Dn,size:()=>un,slugify:()=>Gn,startsWith:()=>jn,toLowerCase:()=>Hn,toUpperCase:()=>Bn,trim:()=>Wn,uppercase:()=>On});var qn={};Ue(qn,{ZodISODate:()=>Fo,ZodISODateTime:()=>jo,ZodISODuration:()=>Zo,ZodISOTime:()=>Uo,date:()=>xp,datetime:()=>_p,duration:()=>$p,time:()=>Sp});var jo=w("ZodISODateTime",(n,e)=>{Yc.init(n,e),le.init(n,e)});function _p(n){return tu(jo,n)}var Fo=w("ZodISODate",(n,e)=>{Xc.init(n,e),le.init(n,e)});function xp(n){return nu(Fo,n)}var Uo=w("ZodISOTime",(n,e)=>{Qc.init(n,e),le.init(n,e)});function Sp(n){return ru(Uo,n)}var Zo=w("ZodISODuration",(n,e)=>{el.init(n,e),le.init(n,e)});function $p(n){return iu(Zo,n)}var ch=(n,e)=>{jr.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>Ur(n,r)},flatten:{value:r=>Fr(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,kn,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,kn,2)}},isEmpty:{get(){return n.issues.length===0}}})},U$=w("ZodError",ch),Oe=w("ZodError",ch,{Parent:Error});var wp=Rn(Oe),Ep=Pn(Oe),kp=Nn(Oe),Ip=Cn(Oe),Tp=Di(Oe),Rp=Li(Oe),Pp=Oi(Oe),Np=Mi(Oe),Cp=ji(Oe),zp=Fi(Oe),Ap=Ui(Oe),Dp=Zi(Oe);var re=w("ZodType",(n,e)=>(te.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:Vn(n,"input"),output:Vn(n,"output")}}),n.toJSONSchema=Lu(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(U.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)=>Ne(n,r,i),n.brand=()=>n,n.register=((r,i)=>(r.add(n,i),n)),n.parse=(r,i)=>wp(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>kp(n,r,i),n.parseAsync=async(r,i)=>Ep(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>Ip(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>Tp(n,r,i),n.decode=(r,i)=>Rp(n,r,i),n.encodeAsync=async(r,i)=>Pp(n,r,i),n.decodeAsync=async(r,i)=>Np(n,r,i),n.safeEncode=(r,i)=>Cp(n,r,i),n.safeDecode=(r,i)=>zp(n,r,i),n.safeEncodeAsync=async(r,i)=>Ap(n,r,i),n.safeDecodeAsync=async(r,i)=>Dp(n,r,i),n.refine=(r,i)=>n.check(Ed(r,i)),n.superRefine=r=>n.check(kd(r)),n.overwrite=r=>n.check(et(r)),n.optional=()=>ei(n),n.exactOptional=()=>ad(n),n.nullable=()=>ti(n),n.nullish=()=>ei(ti(n)),n.nonoptional=r=>md(n,r),n.array=()=>oi(n),n.or=r=>us([n,r]),n.and=r=>Yp(n,r),n.transform=r=>ni(n,ds(r)),n.default=r=>ud(n,r),n.prefault=r=>dd(n,r),n.catch=r=>gd(n,r),n.pipe=r=>ni(n,r),n.readonly=()=>vd(n),n.describe=r=>{let i=n.clone();return Ee.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return Ee.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return Ee.get(n);let i=n.clone();return Ee.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),Bo=w("_ZodString",(n,e)=>{ln.init(n,e),re.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Ou(n,i,t,o);let r=n._zod.bag;n.format=r.format??null,n.minLength=r.minimum??null,n.maxLength=r.maximum??null,n.regex=(...i)=>n.check(Dn(...i)),n.includes=(...i)=>n.check(Mn(...i)),n.startsWith=(...i)=>n.check(jn(...i)),n.endsWith=(...i)=>n.check(Fn(...i)),n.min=(...i)=>n.check(wt(...i)),n.max=(...i)=>n.check(pn(...i)),n.length=(...i)=>n.check(dn(...i)),n.nonempty=(...i)=>n.check(wt(1,...i)),n.lowercase=i=>n.check(Ln(i)),n.uppercase=i=>n.check(On(i)),n.trim=()=>n.check(Wn()),n.normalize=(...i)=>n.check(Zn(...i)),n.toLowerCase=()=>n.check(Hn()),n.toUpperCase=()=>n.check(Bn()),n.slugify=()=>n.check(Gn())}),Yn=w("ZodString",(n,e)=>{ln.init(n,e),Bo.init(n,e),n.email=r=>n.check(ao(Go,r)),n.url=r=>n.check(Yr(ri,r)),n.jwt=r=>n.check(Io(as,r)),n.emoji=r=>n.check(mo(Jo,r)),n.guid=r=>n.check(Kr(Qr,r)),n.uuid=r=>n.check(co(dt,r)),n.uuidv4=r=>n.check(lo(dt,r)),n.uuidv6=r=>n.check(uo(dt,r)),n.uuidv7=r=>n.check(po(dt,r)),n.nanoid=r=>n.check(fo(Vo,r)),n.guid=r=>n.check(Kr(Qr,r)),n.cuid=r=>n.check(ho(qo,r)),n.cuid2=r=>n.check(go(Ko,r)),n.ulid=r=>n.check(yo(Yo,r)),n.base64=r=>n.check(wo(is,r)),n.base64url=r=>n.check(Eo(os,r)),n.xid=r=>n.check(bo(Xo,r)),n.ksuid=r=>n.check(vo(Qo,r)),n.ipv4=r=>n.check(_o(es,r)),n.ipv6=r=>n.check(xo(ts,r)),n.cidrv4=r=>n.check(So(ns,r)),n.cidrv6=r=>n.check($o(rs,r)),n.e164=r=>n.check(ko(ss,r)),n.datetime=r=>n.check(_p(r)),n.date=r=>n.check(xp(r)),n.time=r=>n.check(Sp(r)),n.duration=r=>n.check($p(r))});function Wo(n){return Yl(Yn,n)}var le=w("ZodStringFormat",(n,e)=>{ce.init(n,e),Bo.init(n,e)}),Go=w("ZodEmail",(n,e)=>{Zc.init(n,e),le.init(n,e)});function lh(n){return ao(Go,n)}var Qr=w("ZodGUID",(n,e)=>{Fc.init(n,e),le.init(n,e)});function uh(n){return Kr(Qr,n)}var dt=w("ZodUUID",(n,e)=>{Uc.init(n,e),le.init(n,e)});function ph(n){return co(dt,n)}function dh(n){return lo(dt,n)}function mh(n){return uo(dt,n)}function fh(n){return po(dt,n)}var ri=w("ZodURL",(n,e)=>{Wc.init(n,e),le.init(n,e)});function hh(n){return Yr(ri,n)}function gh(n){return Yr(ri,{protocol:/^https?$/,hostname:qe.domain,...U.normalizeParams(n)})}var Jo=w("ZodEmoji",(n,e)=>{Hc.init(n,e),le.init(n,e)});function yh(n){return mo(Jo,n)}var Vo=w("ZodNanoID",(n,e)=>{Bc.init(n,e),le.init(n,e)});function bh(n){return fo(Vo,n)}var qo=w("ZodCUID",(n,e)=>{Gc.init(n,e),le.init(n,e)});function vh(n){return ho(qo,n)}var Ko=w("ZodCUID2",(n,e)=>{Jc.init(n,e),le.init(n,e)});function _h(n){return go(Ko,n)}var Yo=w("ZodULID",(n,e)=>{Vc.init(n,e),le.init(n,e)});function xh(n){return yo(Yo,n)}var Xo=w("ZodXID",(n,e)=>{qc.init(n,e),le.init(n,e)});function Sh(n){return bo(Xo,n)}var Qo=w("ZodKSUID",(n,e)=>{Kc.init(n,e),le.init(n,e)});function $h(n){return vo(Qo,n)}var es=w("ZodIPv4",(n,e)=>{tl.init(n,e),le.init(n,e)});function wh(n){return _o(es,n)}var Lp=w("ZodMAC",(n,e)=>{rl.init(n,e),le.init(n,e)});function Eh(n){return Ql(Lp,n)}var ts=w("ZodIPv6",(n,e)=>{nl.init(n,e),le.init(n,e)});function kh(n){return xo(ts,n)}var ns=w("ZodCIDRv4",(n,e)=>{il.init(n,e),le.init(n,e)});function Ih(n){return So(ns,n)}var rs=w("ZodCIDRv6",(n,e)=>{ol.init(n,e),le.init(n,e)});function Th(n){return $o(rs,n)}var is=w("ZodBase64",(n,e)=>{al.init(n,e),le.init(n,e)});function Rh(n){return wo(is,n)}var os=w("ZodBase64URL",(n,e)=>{cl.init(n,e),le.init(n,e)});function Ph(n){return Eo(os,n)}var ss=w("ZodE164",(n,e)=>{ll.init(n,e),le.init(n,e)});function Nh(n){return ko(ss,n)}var as=w("ZodJWT",(n,e)=>{ul.init(n,e),le.init(n,e)});function Ch(n){return Io(as,n)}var Xn=w("ZodCustomStringFormat",(n,e)=>{pl.init(n,e),le.init(n,e)});function zh(n,e,r={}){return Jn(Xn,n,e,r)}function Ah(n){return Jn(Xn,"hostname",qe.hostname,n)}function Dh(n){return Jn(Xn,"hex",qe.hex,n)}function Lh(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=qe[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return Jn(Xn,i,t,e)}var Qn=w("ZodNumber",(n,e)=>{Xi.init(n,e),re.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Mu(n,i,t,o),n.gt=(i,t)=>n.check(ut(i,t)),n.gte=(i,t)=>n.check(Ce(i,t)),n.min=(i,t)=>n.check(Ce(i,t)),n.lt=(i,t)=>n.check(lt(i,t)),n.lte=(i,t)=>n.check(We(i,t)),n.max=(i,t)=>n.check(We(i,t)),n.int=i=>n.check(Ho(i)),n.safe=i=>n.check(Ho(i)),n.positive=i=>n.check(ut(0,i)),n.nonnegative=i=>n.check(Ce(0,i)),n.negative=i=>n.check(lt(0,i)),n.nonpositive=i=>n.check(We(0,i)),n.multipleOf=(i,t)=>n.check(jt(i,t)),n.step=(i,t)=>n.check(jt(i,t)),n.finite=()=>n;let r=n._zod.bag;n.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),n.isFinite=!0,n.format=r.format??null});function Op(n){return ou(Qn,n)}var fn=w("ZodNumberFormat",(n,e)=>{dl.init(n,e),Qn.init(n,e)});function Ho(n){return au(fn,n)}function Oh(n){return cu(fn,n)}function Mh(n){return lu(fn,n)}function jh(n){return uu(fn,n)}function Fh(n){return pu(fn,n)}var er=w("ZodBoolean",(n,e)=>{Br.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ju(n,r,i,t)});function Mp(n){return du(er,n)}var tr=w("ZodBigInt",(n,e)=>{Qi.init(n,e),re.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Fu(n,i,t,o),n.gte=(i,t)=>n.check(Ce(i,t)),n.min=(i,t)=>n.check(Ce(i,t)),n.gt=(i,t)=>n.check(ut(i,t)),n.gte=(i,t)=>n.check(Ce(i,t)),n.min=(i,t)=>n.check(Ce(i,t)),n.lt=(i,t)=>n.check(lt(i,t)),n.lte=(i,t)=>n.check(We(i,t)),n.max=(i,t)=>n.check(We(i,t)),n.positive=i=>n.check(ut(BigInt(0),i)),n.negative=i=>n.check(lt(BigInt(0),i)),n.nonpositive=i=>n.check(We(BigInt(0),i)),n.nonnegative=i=>n.check(Ce(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(jt(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function Uh(n){return fu(tr,n)}var cs=w("ZodBigIntFormat",(n,e)=>{ml.init(n,e),tr.init(n,e)});function Zh(n){return gu(cs,n)}function Wh(n){return yu(cs,n)}var jp=w("ZodSymbol",(n,e)=>{fl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Uu(n,r,i,t)});function Hh(n){return bu(jp,n)}var Fp=w("ZodUndefined",(n,e)=>{hl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Wu(n,r,i,t)});function Bh(n){return vu(Fp,n)}var Up=w("ZodNull",(n,e)=>{gl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Zu(n,r,i,t)});function Zp(n){return _u(Up,n)}var Wp=w("ZodAny",(n,e)=>{yl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Gu(n,r,i,t)});function Gh(){return xu(Wp)}var Hp=w("ZodUnknown",(n,e)=>{bl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ju(n,r,i,t)});function mn(){return Su(Hp)}var Bp=w("ZodNever",(n,e)=>{vl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Bu(n,r,i,t)});function ls(n){return $u(Bp,n)}var Gp=w("ZodVoid",(n,e)=>{_l.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Hu(n,r,i,t)});function Jh(n){return wu(Gp,n)}var ii=w("ZodDate",(n,e)=>{xl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Vu(n,i,t,o),n.min=(i,t)=>n.check(Ce(i,t)),n.max=(i,t)=>n.check(We(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 Vh(n){return Eu(ii,n)}var Jp=w("ZodArray",(n,e)=>{Sl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>sp(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(wt(r,i)),n.nonempty=r=>n.check(wt(1,r)),n.max=(r,i)=>n.check(pn(r,i)),n.length=(r,i)=>n.check(dn(r,i)),n.unwrap=()=>n.element});function oi(n,e){return Tu(Jp,n,e)}function qh(n){let e=n._zod.def.shape;return ps(Object.keys(e))}var si=w("ZodObject",(n,e)=>{$l.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ap(n,r,i,t),U.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>ps(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:mn()}),n.loose=()=>n.clone({...n._zod.def,catchall:mn()}),n.strict=()=>n.clone({...n._zod.def,catchall:ls()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>U.extend(n,r),n.safeExtend=r=>U.safeExtend(n,r),n.merge=r=>U.merge(n,r),n.pick=r=>U.pick(n,r),n.omit=r=>U.omit(n,r),n.partial=(...r)=>U.partial(ms,n,r[0]),n.required=(...r)=>U.required(fs,n,r[0])});function Kh(n,e){let r={type:"object",shape:n??{},...U.normalizeParams(e)};return new si(r)}function Yh(n,e){return new si({type:"object",shape:n,catchall:ls(),...U.normalizeParams(e)})}function Xh(n,e){return new si({type:"object",shape:n,catchall:mn(),...U.normalizeParams(e)})}var ai=w("ZodUnion",(n,e)=>{Gr.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ao(n,r,i,t),n.options=e.options});function us(n,e){return new ai({type:"union",options:n,...U.normalizeParams(e)})}var Vp=w("ZodXor",(n,e)=>{ai.init(n,e),wl.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ao(n,r,i,t),n.options=e.options});function Qh(n,e){return new Vp({type:"union",options:n,inclusive:!1,...U.normalizeParams(e)})}var qp=w("ZodDiscriminatedUnion",(n,e)=>{ai.init(n,e),El.init(n,e)});function eg(n,e,r){return new qp({type:"union",options:e,discriminator:n,...U.normalizeParams(r)})}var Kp=w("ZodIntersection",(n,e)=>{kl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>cp(n,r,i,t)});function Yp(n,e){return new Kp({type:"intersection",left:n,right:e})}var Xp=w("ZodTuple",(n,e)=>{eo.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>lp(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function Qp(n,e,r){let i=e instanceof te,t=i?r:e,o=i?e:null;return new Xp({type:"tuple",items:n,rest:o,...U.normalizeParams(t)})}var ci=w("ZodRecord",(n,e)=>{Il.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>up(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function ed(n,e,r){return new ci({type:"record",keyType:n,valueType:e,...U.normalizeParams(r)})}function tg(n,e,r){let i=Ne(n);return i._zod.values=void 0,new ci({type:"record",keyType:i,valueType:e,...U.normalizeParams(r)})}function ng(n,e,r){return new ci({type:"record",keyType:n,valueType:e,mode:"loose",...U.normalizeParams(r)})}var td=w("ZodMap",(n,e)=>{Tl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ip(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType,n.min=(...r)=>n.check(pt(...r)),n.nonempty=r=>n.check(pt(1,r)),n.max=(...r)=>n.check(Ft(...r)),n.size=(...r)=>n.check(un(...r))});function rg(n,e,r){return new td({type:"map",keyType:n,valueType:e,...U.normalizeParams(r)})}var nd=w("ZodSet",(n,e)=>{Rl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>op(n,r,i,t),n.min=(...r)=>n.check(pt(...r)),n.nonempty=r=>n.check(pt(1,r)),n.max=(...r)=>n.check(Ft(...r)),n.size=(...r)=>n.check(un(...r))});function ig(n,e){return new nd({type:"set",valueType:n,...U.normalizeParams(e)})}var Kn=w("ZodEnum",(n,e)=>{Pl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(i,t,o)=>qu(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 Kn({...e,checks:[],...U.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 Kn({...e,checks:[],...U.normalizeParams(t),entries:o})}});function ps(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new Kn({type:"enum",entries:r,...U.normalizeParams(e)})}function og(n,e){return new Kn({type:"enum",entries:n,...U.normalizeParams(e)})}var rd=w("ZodLiteral",(n,e)=>{Nl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ku(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 sg(n,e){return new rd({type:"literal",values:Array.isArray(n)?n:[n],...U.normalizeParams(e)})}var id=w("ZodFile",(n,e)=>{Cl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Qu(n,r,i,t),n.min=(r,i)=>n.check(pt(r,i)),n.max=(r,i)=>n.check(Ft(r,i)),n.mime=(r,i)=>n.check(Un(Array.isArray(r)?r:[r],i))});function ag(n){return Ru(id,n)}var od=w("ZodTransform",(n,e)=>{zl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>rp(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new At(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(U.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(U.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 ds(n){return new od({type:"transform",transform:n})}var ms=w("ZodOptional",(n,e)=>{to.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Do(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function ei(n){return new ms({type:"optional",innerType:n})}var sd=w("ZodExactOptional",(n,e)=>{Al.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Do(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function ad(n){return new sd({type:"optional",innerType:n})}var cd=w("ZodNullable",(n,e)=>{Dl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>pp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function ti(n){return new cd({type:"nullable",innerType:n})}function cg(n){return ei(ti(n))}var ld=w("ZodDefault",(n,e)=>{Ll.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>mp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function ud(n,e){return new ld({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var pd=w("ZodPrefault",(n,e)=>{Ol.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>fp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function dd(n,e){return new pd({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var fs=w("ZodNonOptional",(n,e)=>{Ml.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>dp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function md(n,e){return new fs({type:"nonoptional",innerType:n,...U.normalizeParams(e)})}var fd=w("ZodSuccess",(n,e)=>{jl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ep(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function lg(n){return new fd({type:"success",innerType:n})}var hd=w("ZodCatch",(n,e)=>{Fl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>hp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function gd(n,e){return new hd({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var yd=w("ZodNaN",(n,e)=>{Ul.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Yu(n,r,i,t)});function ug(n){return Iu(yd,n)}var hs=w("ZodPipe",(n,e)=>{Zl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>gp(n,r,i,t),n.in=e.in,n.out=e.out});function ni(n,e){return new hs({type:"pipe",in:n,out:e})}var gs=w("ZodCodec",(n,e)=>{hs.init(n,e),Jr.init(n,e)});function pg(n,e,r){return new gs({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var bd=w("ZodReadonly",(n,e)=>{Wl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>yp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function vd(n){return new bd({type:"readonly",innerType:n})}var _d=w("ZodTemplateLiteral",(n,e)=>{Hl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Xu(n,r,i,t)});function dg(n,e){return new _d({type:"template_literal",parts:n,...U.normalizeParams(e)})}var xd=w("ZodLazy",(n,e)=>{Jl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>vp(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function Sd(n){return new xd({type:"lazy",getter:n})}var $d=w("ZodPromise",(n,e)=>{Gl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>bp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function mg(n){return new $d({type:"promise",innerType:n})}var wd=w("ZodFunction",(n,e)=>{Bl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>np(n,r,i,t)});function fg(n){return new wd({type:"function",input:Array.isArray(n?.input)?Qp(n?.input):n?.input??oi(mn()),output:n?.output??mn()})}var li=w("ZodCustom",(n,e)=>{Vl.init(n,e),re.init(n,e),n._zod.processJSONSchema=(r,i,t)=>tp(n,r,i,t)});function hg(n){let e=new ue({check:"custom"});return e._zod.check=n,e}function gg(n,e){return Pu(li,n??(()=>!0),e)}function Ed(n,e={}){return Nu(li,n,e)}function kd(n){return Cu(n)}var yg=zu,bg=Au;function vg(n,e={}){let r=new li({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...U.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 _g=(...n)=>Du({Codec:gs,Boolean:er,String:Yn},...n);function xg(n){let e=Sd(()=>us([Wo(n),Op(),Mp(),Zp(),oi(e),ed(Wo(),e)]));return e}function Sg(n,e){return ni(ds(n),e)}var W$={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 H$(n){ge({customError:n})}function B$(){return ge().customError}var Id;Id||(Id={});var q={...Xr,...Mo,iso:qn},G$=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 J$(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 V$(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 $g(n,e){if(n.not!==void 0){if(typeof n.not=="object"&&Object.keys(n.not).length===0)return q.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 q.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=V$(t,e),s=Ie(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 q.null();if(t.length===0)return q.never();if(t.length===1)return q.literal(t[0]);if(t.every(s=>typeof s=="string"))return q.enum(t);let o=t.map(s=>q.literal(s));return o.length<2?o[0]:q.union([o[0],o[1],...o.slice(2)])}if(n.const!==void 0)return q.literal(n.const);let r=n.type;if(Array.isArray(r)){let t=r.map(o=>{let s={...n,type:o};return $g(s,e)});return t.length===0?q.never():t.length===1?t[0]:q.union(t)}if(!r)return q.any();let i;switch(r){case"string":{let t=q.string();if(n.format){let o=n.format;o==="email"?t=t.check(q.email()):o==="uri"||o==="uri-reference"?t=t.check(q.url()):o==="uuid"||o==="guid"?t=t.check(q.uuid()):o==="date-time"?t=t.check(q.iso.datetime()):o==="date"?t=t.check(q.iso.date()):o==="time"?t=t.check(q.iso.time()):o==="duration"?t=t.check(q.iso.duration()):o==="ipv4"?t=t.check(q.ipv4()):o==="ipv6"?t=t.check(q.ipv6()):o==="mac"?t=t.check(q.mac()):o==="cidr"?t=t.check(q.cidrv4()):o==="cidr-v6"?t=t.check(q.cidrv6()):o==="base64"?t=t.check(q.base64()):o==="base64url"?t=t.check(q.base64url()):o==="e164"?t=t.check(q.e164()):o==="jwt"?t=t.check(q.jwt()):o==="emoji"?t=t.check(q.emoji()):o==="nanoid"?t=t.check(q.nanoid()):o==="cuid"?t=t.check(q.cuid()):o==="cuid2"?t=t.check(q.cuid2()):o==="ulid"?t=t.check(q.ulid()):o==="xid"?t=t.check(q.xid()):o==="ksuid"&&(t=t.check(q.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"?q.number().int():q.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=q.boolean();break}case"null":{i=q.null();break}case"object":{let t={},o=n.properties||{},s=new Set(n.required||[]);for(let[c,l]of Object.entries(o)){let u=Ie(l,e);t[c]=s.has(c)?u:u.optional()}if(n.propertyNames){let c=Ie(n.propertyNames,e),l=n.additionalProperties&&typeof n.additionalProperties=="object"?Ie(n.additionalProperties,e):q.any();if(Object.keys(t).length===0){i=q.record(c,l);break}let u=q.object(t).passthrough(),p=q.looseRecord(c,l);i=q.intersection(u,p);break}if(n.patternProperties){let c=n.patternProperties,l=Object.keys(c),u=[];for(let d of l){let m=Ie(c[d],e),f=q.string().regex(new RegExp(d));u.push(q.looseRecord(f,m))}let p=[];if(Object.keys(t).length>0&&p.push(q.object(t).passthrough()),p.push(...u),p.length===0)i=q.object({}).passthrough();else if(p.length===1)i=p[0];else{let d=q.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)d=q.intersection(d,p[m]);i=d}break}let a=q.object(t);n.additionalProperties===!1?i=a.strict():typeof n.additionalProperties=="object"?i=a.catchall(Ie(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=>Ie(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Ie(o,e):void 0;a?i=q.tuple(s).rest(a):i=q.tuple(s),typeof n.minItems=="number"&&(i=i.check(q.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(q.maxLength(n.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>Ie(c,e)),a=n.additionalItems&&typeof n.additionalItems=="object"?Ie(n.additionalItems,e):void 0;a?i=q.tuple(s).rest(a):i=q.tuple(s),typeof n.minItems=="number"&&(i=i.check(q.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(q.maxLength(n.maxItems)))}else if(o!==void 0){let s=Ie(o,e),a=q.array(s);typeof n.minItems=="number"&&(a=a.min(n.minItems)),typeof n.maxItems=="number"&&(a=a.max(n.maxItems)),i=a}else i=q.array(q.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 Ie(n,e){if(typeof n=="boolean")return n?q.any():q.never();let r=$g(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=>Ie(l,e)),c=q.union(a);r=i?q.intersection(r,c):c}if(n.oneOf&&Array.isArray(n.oneOf)){let a=n.oneOf.map(l=>Ie(l,e)),c=q.xor(a);r=i?q.intersection(r,c):c}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)r=i?r:q.any();else{let a=i?r:Ie(n.allOf[0],e),c=i?0:1;for(let l=c;l<n.allOf.length;l++)a=q.intersection(a,Ie(n.allOf[l],e));r=a}n.nullable===!0&&e.version==="openapi-3.0"&&(r=q.nullable(r)),n.readOnly===!0&&(r=q.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))G$.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function wg(n,e){if(typeof n=="boolean")return n?q.any():q.never();let r=J$(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??Ee};return Ie(n,t)}var Td={};Ue(Td,{bigint:()=>X$,boolean:()=>Y$,date:()=>Q$,number:()=>K$,string:()=>q$});function q$(n){return Xl(Yn,n)}function K$(n){return su(Qn,n)}function Y$(n){return mu(er,n)}function X$(n){return hu(tr,n)}function Q$(n){return ku(ii,n)}ge(no());var ys=["**/node_modules/**","**/.git/**","**/dist/**","**/build/**","**/vendor/**","**/.next/**","**/.cache/**","**/coverage/**","**/*.min.js"],Eg=["**/*.{ts,tsx,yaml,yml,php,py,go}","**/*.prisma","**/*.{graphql,gql}","**/Dockerfile*","**/.env*","**/package.json","**/lerna.json","**/turbo.json","**/pnpm-workspace.yaml"],fe={MAX_DEPTH:10,MIN_DEPTH:1,MAX_LIMIT:500,MIN_LIMIT:1,MAX_QUERY_LENGTH:500,DEFAULT_DEPTH:3,DEFAULT_LIMIT:10},Ae={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},Rd={SECONDS_PER_DAY:86400,SECONDS_PER_YEAR:31536e3},bs={DEFAULT_CONCURRENCY:parseInt(process.env.INDEX_CONCURRENCY??String(5),10)};var bP=g.object({repoPath:g.string(),mode:g.enum(["init","tree","topography","scout","hologram","tools"]),subPath:g.string().optional(),maxDepth:g.number().int().min(fe.MIN_DEPTH).max(fe.MAX_DEPTH).optional()}),vP=g.object({repoPath:g.string(),mode:g.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:g.string().max(fe.MAX_QUERY_LENGTH).optional(),key:g.string().optional(),kind:g.enum(["Service","Image","Port","Env"]).optional(),limit:g.number().int().min(fe.MIN_LIMIT).max(fe.MAX_LIMIT).optional(),offset:g.number().int().min(0).optional(),compact:g.boolean().optional(),tokenBudget:g.number().int().min(1).optional()}).refine(n=>!(n.mode==="concept"&&(!n.query||n.query.trim().length===0)),{message:"Concept search requires a non-empty query",path:["query"]}),_P=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()}),xP=g.object({repoPath:g.string(),mode:g.enum(["impact","explain-diff","type-graph","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(fe.MIN_DEPTH).max(fe.MAX_DEPTH).optional(),limit:g.number().int().min(fe.MIN_LIMIT).max(fe.MAX_LIMIT).optional(),includeTests:g.boolean().optional()}),SP=g.object({repoPath:g.string(),action:g.enum(["index","repair","trace"]),deep:g.boolean().optional(),sinceCommit:g.string().optional()}),$P=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),wP=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 kg=[...zm,...Am];Q();import{execSync as kt}from"child_process";import ui from"path";import Pd from"fs";function ye(n){try{if(!Pd.existsSync(ui.join(n,".git")))return null;let e=kt("git rev-parse --abbrev-ref HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return e==="HEAD"?kt("git rev-parse --short HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():e.replace(/[\/\\:*"<>|?]/g,"-")}catch{return null}}function He(n){try{return Pd.existsSync(ui.join(n,".git"))?kt("git rev-parse HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():null}catch{return null}}function vs(n,e=50){try{let r=kt(`git rev-list --max-count=${e} HEAD`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return r?r.split(`
|
|
654
|
-
`):[]}catch{return[]}}function
|
|
655
|
-
`).some(o=>o&&
|
|
656
|
-
`).some(t=>t?
|
|
657
|
-
`).filter(Boolean).forEach(o=>r.add(o));let t=
|
|
658
|
-
`).filter(Boolean).forEach(o=>{let s=o.trim().split(/\s+/);s.length>=2&&r.add(s[s.length-1])})}catch{}return r}
|
|
659
|
-
`);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{
|
|
706
|
+
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 rn(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 g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(m.$ref&&d.def)for(let g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}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:cr(e,"input",n.processors),output:cr(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Fe(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 Fe(i.element,r);if(i.type==="set")return Fe(i.valueType,r);if(i.type==="lazy")return Fe(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 Fe(i.innerType,r);if(i.type==="intersection")return Fe(i.left,r)||Fe(i.right,r);if(i.type==="record"||i.type==="map")return Fe(i.keyType,r)||Fe(i.valueType,r);if(i.type==="pipe")return Fe(i.in,r)||Fe(i.out,r);if(i.type==="object"){for(let t in i.shape)if(Fe(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(Fe(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(Fe(t,r))return!0;return!!(i.rest&&Fe(i.rest,r))}return!1}var Xu=(n,e={})=>r=>{let i=tn({...r,processors:e});return pe(n,i),nn(i,n),rn(i,n)},cr=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=tn({...t??{},target:o,io:e,processors:r});return pe(n,s),nn(s,n),rn(s,n)};var hw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Qu=(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=hw[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}))])}},ep=(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)},tp=(n,e,r,i)=>{r.type="boolean"},np=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},rp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ip=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},op=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},sp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ap=(n,e,r,i)=>{r.not={}},cp=(n,e,r,i)=>{},lp=(n,e,r,i)=>{},up=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},pp=(n,e,r,i)=>{let t=n._zod.def,o=Jr(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},dp=(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},mp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},fp=(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},hp=(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)},gp=(n,e,r,i)=>{r.type="boolean"},yp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},_p=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},vp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},xp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Sp=(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=pe(o.element,e,{...i,path:[...i.path,"items"]})},$p=(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]=pe(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=pe(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},Go=(n,e,r,i)=>{let t=n._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>pe(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},wp=(n,e,r,i)=>{let t=n._zod.def,o=pe(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=pe(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},Ep=(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)=>pe(d,e,{...i,path:[...i.path,s,m]})),l=o.rest?pe(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)},kp=(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=pe(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=pe(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=pe(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)}},Ip=(n,e,r,i)=>{let t=n._zod.def,o=pe(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"}]},Tp=(n,e,r,i)=>{let t=n._zod.def;pe(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Rp=(n,e,r,i)=>{let t=n._zod.def;pe(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.default=JSON.parse(JSON.stringify(t.defaultValue))},Pp=(n,e,r,i)=>{let t=n._zod.def;pe(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)))},Cp=(n,e,r,i)=>{let t=n._zod.def;pe(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},Np=(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;pe(o,e,i);let s=e.seen.get(n);s.ref=o},Ap=(n,e,r,i)=>{let t=n._zod.def;pe(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.readOnly=!0},zp=(n,e,r,i)=>{let t=n._zod.def;pe(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Jo=(n,e,r,i)=>{let t=n._zod.def;pe(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Dp=(n,e,r,i)=>{let t=n._zod.innerType;pe(t,e,i);let o=e.seen.get(n);o.ref=t},Bo={string:Qu,number:ep,boolean:tp,bigint:np,symbol:rp,null:ip,undefined:op,void:sp,never:ap,any:cp,unknown:lp,date:up,enum:pp,literal:dp,nan:mp,template_literal:fp,file:hp,success:gp,custom:yp,function:bp,transform:_p,map:vp,set:xp,array:Sp,object:$p,union:Go,intersection:wp,tuple:Ep,record:kp,nullable:Ip,nonoptional:Tp,default:Rp,prefault:Pp,catch:Cp,pipe:Np,readonly:Ap,promise:zp,optional:Jo,lazy:Dp};function Vo(n,e){if("_idmap"in n){let i=n,t=tn({...e,processors:Bo}),o={};for(let c of i._idmap.entries()){let[l,u]=c;pe(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;nn(t,u),s[l]=rn(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=tn({...e,processors:Bo});return pe(n,r),nn(r,n),rn(r,n)}var qo=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=tn({processors:Bo,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 pe(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)),nn(this.ctx,e);let i=rn(this.ctx,e),{"~standard":t,...o}=i;return o}};var Ch={};var pi={};Ke(pi,{ZodAny:()=>od,ZodArray:()=>ld,ZodBase64:()=>gs,ZodBase64URL:()=>ys,ZodBigInt:()=>hr,ZodBigIntFormat:()=>vs,ZodBoolean:()=>fr,ZodCIDRv4:()=>fs,ZodCIDRv6:()=>hs,ZodCUID:()=>as,ZodCUID2:()=>cs,ZodCatch:()=>Cd,ZodCodec:()=>Ts,ZodCustom:()=>Si,ZodCustomStringFormat:()=>dr,ZodDate:()=>yi,ZodDefault:()=>Ed,ZodDiscriminatedUnion:()=>pd,ZodE164:()=>bs,ZodEmail:()=>is,ZodEmoji:()=>os,ZodEnum:()=>ur,ZodExactOptional:()=>Sd,ZodFile:()=>vd,ZodFunction:()=>Fd,ZodGUID:()=>di,ZodIPv4:()=>ds,ZodIPv6:()=>ms,ZodIntersection:()=>dd,ZodJWT:()=>_s,ZodKSUID:()=>ps,ZodLazy:()=>Od,ZodLiteral:()=>_d,ZodMAC:()=>Xp,ZodMap:()=>yd,ZodNaN:()=>Ad,ZodNanoID:()=>ss,ZodNever:()=>ad,ZodNonOptional:()=>ks,ZodNull:()=>rd,ZodNullable:()=>wd,ZodNumber:()=>mr,ZodNumberFormat:()=>Tn,ZodObject:()=>_i,ZodOptional:()=>Es,ZodPipe:()=>Is,ZodPrefault:()=>Id,ZodPromise:()=>jd,ZodReadonly:()=>zd,ZodRecord:()=>xi,ZodSet:()=>bd,ZodString:()=>pr,ZodStringFormat:()=>fe,ZodSuccess:()=>Pd,ZodSymbol:()=>td,ZodTemplateLiteral:()=>Ld,ZodTransform:()=>xd,ZodTuple:()=>fd,ZodType:()=>ie,ZodULID:()=>ls,ZodURL:()=>gi,ZodUUID:()=>wt,ZodUndefined:()=>nd,ZodUnion:()=>vi,ZodUnknown:()=>sd,ZodVoid:()=>cd,ZodXID:()=>us,ZodXor:()=>ud,_ZodString:()=>rs,_default:()=>kd,_function:()=>Mg,any:()=>gg,array:()=>bi,base64:()=>Qh,base64url:()=>eg,bigint:()=>pg,boolean:()=>ed,catch:()=>Nd,check:()=>jg,cidrv4:()=>Yh,cidrv6:()=>Xh,codec:()=>Dg,cuid:()=>Zh,cuid2:()=>Hh,custom:()=>Fg,date:()=>bg,describe:()=>Ug,discriminatedUnion:()=>wg,e164:()=>tg,email:()=>Ah,emoji:()=>Uh,enum:()=>$s,exactOptional:()=>$d,file:()=>Cg,float32:()=>ag,float64:()=>cg,function:()=>Mg,guid:()=>zh,hash:()=>sg,hex:()=>og,hostname:()=>ig,httpUrl:()=>Fh,instanceof:()=>Zg,int:()=>ns,int32:()=>lg,int64:()=>dg,intersection:()=>md,ipv4:()=>Vh,ipv6:()=>Kh,json:()=>Bg,jwt:()=>ng,keyof:()=>_g,ksuid:()=>Jh,lazy:()=>Md,literal:()=>Pg,looseObject:()=>Sg,looseRecord:()=>kg,mac:()=>qh,map:()=>Ig,meta:()=>Wg,nan:()=>zg,nanoid:()=>Wh,nativeEnum:()=>Rg,never:()=>xs,nonoptional:()=>Rd,null:()=>id,nullable:()=>fi,nullish:()=>Ng,number:()=>Qp,object:()=>vg,optional:()=>mi,partialRecord:()=>Eg,pipe:()=>hi,prefault:()=>Td,preprocess:()=>Gg,promise:()=>Og,readonly:()=>Dd,record:()=>gd,refine:()=>Ud,set:()=>Tg,strictObject:()=>xg,string:()=>ts,stringFormat:()=>rg,stringbool:()=>Hg,success:()=>Ag,superRefine:()=>Wd,symbol:()=>fg,templateLiteral:()=>Lg,transform:()=>ws,tuple:()=>hd,uint32:()=>ug,uint64:()=>mg,ulid:()=>Bh,undefined:()=>hg,union:()=>Ss,unknown:()=>In,url:()=>jh,uuid:()=>Dh,uuidv4:()=>Lh,uuidv6:()=>Oh,uuidv7:()=>Mh,void:()=>yg,xid:()=>Gh,xor:()=>$g});var Ko={};Ke(Ko,{endsWith:()=>er,gt:()=>St,gte:()=>je,includes:()=>Xn,length:()=>kn,lowercase:()=>Kn,lt:()=>xt,lte:()=>Xe,maxLength:()=>En,maxSize:()=>en,mime:()=>tr,minLength:()=>Lt,minSize:()=>$t,multipleOf:()=>Qt,negative:()=>Uo,nonnegative:()=>Zo,nonpositive:()=>Wo,normalize:()=>nr,overwrite:()=>mt,positive:()=>Fo,property:()=>Ho,regex:()=>qn,size:()=>wn,slugify:()=>sr,startsWith:()=>Qn,toLowerCase:()=>ir,toUpperCase:()=>or,trim:()=>rr,uppercase:()=>Yn});var lr={};Ke(lr,{ZodISODate:()=>Xo,ZodISODateTime:()=>Yo,ZodISODuration:()=>es,ZodISOTime:()=>Qo,date:()=>Op,datetime:()=>Lp,duration:()=>jp,time:()=>Mp});var Yo=k("ZodISODateTime",(n,e)=>{ml.init(n,e),fe.init(n,e)});function Lp(n){return yu(Yo,n)}var Xo=k("ZodISODate",(n,e)=>{fl.init(n,e),fe.init(n,e)});function Op(n){return bu(Xo,n)}var Qo=k("ZodISOTime",(n,e)=>{hl.init(n,e),fe.init(n,e)});function Mp(n){return _u(Qo,n)}var es=k("ZodISODuration",(n,e)=>{gl.init(n,e),fe.init(n,e)});function jp(n){return vu(es,n)}var Nh=(n,e)=>{Xr.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>ei(n,r)},flatten:{value:r=>Qr(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,Fn,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,Fn,2)}},isEmpty:{get(){return n.issues.length===0}}})},yw=k("ZodError",Nh),Ge=k("ZodError",Nh,{Parent:Error});var Fp=Zn(Ge),Up=Hn(Ge),Wp=Bn(Ge),Zp=Gn(Ge),Hp=Ji(Ge),Bp=Vi(Ge),Gp=qi(Ge),Jp=Ki(Ge),Vp=Yi(Ge),qp=Xi(Ge),Kp=Qi(Ge),Yp=eo(Ge);var ie=k("ZodType",(n,e)=>(ne.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:cr(n,"input"),output:cr(n,"output")}}),n.toJSONSchema=Xu(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(W.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)=>Me(n,r,i),n.brand=()=>n,n.register=((r,i)=>(r.add(n,i),n)),n.parse=(r,i)=>Fp(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>Wp(n,r,i),n.parseAsync=async(r,i)=>Up(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>Zp(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>Hp(n,r,i),n.decode=(r,i)=>Bp(n,r,i),n.encodeAsync=async(r,i)=>Gp(n,r,i),n.decodeAsync=async(r,i)=>Jp(n,r,i),n.safeEncode=(r,i)=>Vp(n,r,i),n.safeDecode=(r,i)=>qp(n,r,i),n.safeEncodeAsync=async(r,i)=>Kp(n,r,i),n.safeDecodeAsync=async(r,i)=>Yp(n,r,i),n.refine=(r,i)=>n.check(Ud(r,i)),n.superRefine=r=>n.check(Wd(r)),n.overwrite=r=>n.check(mt(r)),n.optional=()=>mi(n),n.exactOptional=()=>$d(n),n.nullable=()=>fi(n),n.nullish=()=>mi(fi(n)),n.nonoptional=r=>Rd(n,r),n.array=()=>bi(n),n.or=r=>Ss([n,r]),n.and=r=>md(n,r),n.transform=r=>hi(n,ws(r)),n.default=r=>kd(n,r),n.prefault=r=>Td(n,r),n.catch=r=>Nd(n,r),n.pipe=r=>hi(n,r),n.readonly=()=>Dd(n),n.describe=r=>{let i=n.clone();return Pe.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return Pe.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return Pe.get(n);let i=n.clone();return Pe.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),rs=k("_ZodString",(n,e)=>{$n.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Qu(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(qn(...i)),n.includes=(...i)=>n.check(Xn(...i)),n.startsWith=(...i)=>n.check(Qn(...i)),n.endsWith=(...i)=>n.check(er(...i)),n.min=(...i)=>n.check(Lt(...i)),n.max=(...i)=>n.check(En(...i)),n.length=(...i)=>n.check(kn(...i)),n.nonempty=(...i)=>n.check(Lt(1,...i)),n.lowercase=i=>n.check(Kn(i)),n.uppercase=i=>n.check(Yn(i)),n.trim=()=>n.check(rr()),n.normalize=(...i)=>n.check(nr(...i)),n.toLowerCase=()=>n.check(ir()),n.toUpperCase=()=>n.check(or()),n.slugify=()=>n.check(sr())}),pr=k("ZodString",(n,e)=>{$n.init(n,e),rs.init(n,e),n.email=r=>n.check(vo(is,r)),n.url=r=>n.check(ui(gi,r)),n.jwt=r=>n.check(jo(_s,r)),n.emoji=r=>n.check(Eo(os,r)),n.guid=r=>n.check(li(di,r)),n.uuid=r=>n.check(xo(wt,r)),n.uuidv4=r=>n.check(So(wt,r)),n.uuidv6=r=>n.check($o(wt,r)),n.uuidv7=r=>n.check(wo(wt,r)),n.nanoid=r=>n.check(ko(ss,r)),n.guid=r=>n.check(li(di,r)),n.cuid=r=>n.check(Io(as,r)),n.cuid2=r=>n.check(To(cs,r)),n.ulid=r=>n.check(Ro(ls,r)),n.base64=r=>n.check(Lo(gs,r)),n.base64url=r=>n.check(Oo(ys,r)),n.xid=r=>n.check(Po(us,r)),n.ksuid=r=>n.check(Co(ps,r)),n.ipv4=r=>n.check(No(ds,r)),n.ipv6=r=>n.check(Ao(ms,r)),n.cidrv4=r=>n.check(zo(fs,r)),n.cidrv6=r=>n.check(Do(hs,r)),n.e164=r=>n.check(Mo(bs,r)),n.datetime=r=>n.check(Lp(r)),n.date=r=>n.check(Op(r)),n.time=r=>n.check(Mp(r)),n.duration=r=>n.check(jp(r))});function ts(n){return mu(pr,n)}var fe=k("ZodStringFormat",(n,e)=>{me.init(n,e),rs.init(n,e)}),is=k("ZodEmail",(n,e)=>{il.init(n,e),fe.init(n,e)});function Ah(n){return vo(is,n)}var di=k("ZodGUID",(n,e)=>{nl.init(n,e),fe.init(n,e)});function zh(n){return li(di,n)}var wt=k("ZodUUID",(n,e)=>{rl.init(n,e),fe.init(n,e)});function Dh(n){return xo(wt,n)}function Lh(n){return So(wt,n)}function Oh(n){return $o(wt,n)}function Mh(n){return wo(wt,n)}var gi=k("ZodURL",(n,e)=>{ol.init(n,e),fe.init(n,e)});function jh(n){return ui(gi,n)}function Fh(n){return ui(gi,{protocol:/^https?$/,hostname:st.domain,...W.normalizeParams(n)})}var os=k("ZodEmoji",(n,e)=>{sl.init(n,e),fe.init(n,e)});function Uh(n){return Eo(os,n)}var ss=k("ZodNanoID",(n,e)=>{al.init(n,e),fe.init(n,e)});function Wh(n){return ko(ss,n)}var as=k("ZodCUID",(n,e)=>{cl.init(n,e),fe.init(n,e)});function Zh(n){return Io(as,n)}var cs=k("ZodCUID2",(n,e)=>{ll.init(n,e),fe.init(n,e)});function Hh(n){return To(cs,n)}var ls=k("ZodULID",(n,e)=>{ul.init(n,e),fe.init(n,e)});function Bh(n){return Ro(ls,n)}var us=k("ZodXID",(n,e)=>{pl.init(n,e),fe.init(n,e)});function Gh(n){return Po(us,n)}var ps=k("ZodKSUID",(n,e)=>{dl.init(n,e),fe.init(n,e)});function Jh(n){return Co(ps,n)}var ds=k("ZodIPv4",(n,e)=>{yl.init(n,e),fe.init(n,e)});function Vh(n){return No(ds,n)}var Xp=k("ZodMAC",(n,e)=>{_l.init(n,e),fe.init(n,e)});function qh(n){return hu(Xp,n)}var ms=k("ZodIPv6",(n,e)=>{bl.init(n,e),fe.init(n,e)});function Kh(n){return Ao(ms,n)}var fs=k("ZodCIDRv4",(n,e)=>{vl.init(n,e),fe.init(n,e)});function Yh(n){return zo(fs,n)}var hs=k("ZodCIDRv6",(n,e)=>{xl.init(n,e),fe.init(n,e)});function Xh(n){return Do(hs,n)}var gs=k("ZodBase64",(n,e)=>{$l.init(n,e),fe.init(n,e)});function Qh(n){return Lo(gs,n)}var ys=k("ZodBase64URL",(n,e)=>{wl.init(n,e),fe.init(n,e)});function eg(n){return Oo(ys,n)}var bs=k("ZodE164",(n,e)=>{El.init(n,e),fe.init(n,e)});function tg(n){return Mo(bs,n)}var _s=k("ZodJWT",(n,e)=>{kl.init(n,e),fe.init(n,e)});function ng(n){return jo(_s,n)}var dr=k("ZodCustomStringFormat",(n,e)=>{Il.init(n,e),fe.init(n,e)});function rg(n,e,r={}){return ar(dr,n,e,r)}function ig(n){return ar(dr,"hostname",st.hostname,n)}function og(n){return ar(dr,"hex",st.hex,n)}function sg(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=st[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return ar(dr,i,t,e)}var mr=k("ZodNumber",(n,e)=>{uo.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ep(n,i,t,o),n.gt=(i,t)=>n.check(St(i,t)),n.gte=(i,t)=>n.check(je(i,t)),n.min=(i,t)=>n.check(je(i,t)),n.lt=(i,t)=>n.check(xt(i,t)),n.lte=(i,t)=>n.check(Xe(i,t)),n.max=(i,t)=>n.check(Xe(i,t)),n.int=i=>n.check(ns(i)),n.safe=i=>n.check(ns(i)),n.positive=i=>n.check(St(0,i)),n.nonnegative=i=>n.check(je(0,i)),n.negative=i=>n.check(xt(0,i)),n.nonpositive=i=>n.check(Xe(0,i)),n.multipleOf=(i,t)=>n.check(Qt(i,t)),n.step=(i,t)=>n.check(Qt(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 Qp(n){return xu(mr,n)}var Tn=k("ZodNumberFormat",(n,e)=>{Tl.init(n,e),mr.init(n,e)});function ns(n){return $u(Tn,n)}function ag(n){return wu(Tn,n)}function cg(n){return Eu(Tn,n)}function lg(n){return ku(Tn,n)}function ug(n){return Iu(Tn,n)}var fr=k("ZodBoolean",(n,e)=>{ii.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>tp(n,r,i,t)});function ed(n){return Tu(fr,n)}var hr=k("ZodBigInt",(n,e)=>{po.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>np(n,i,t,o),n.gte=(i,t)=>n.check(je(i,t)),n.min=(i,t)=>n.check(je(i,t)),n.gt=(i,t)=>n.check(St(i,t)),n.gte=(i,t)=>n.check(je(i,t)),n.min=(i,t)=>n.check(je(i,t)),n.lt=(i,t)=>n.check(xt(i,t)),n.lte=(i,t)=>n.check(Xe(i,t)),n.max=(i,t)=>n.check(Xe(i,t)),n.positive=i=>n.check(St(BigInt(0),i)),n.negative=i=>n.check(xt(BigInt(0),i)),n.nonpositive=i=>n.check(Xe(BigInt(0),i)),n.nonnegative=i=>n.check(je(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(Qt(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function pg(n){return Pu(hr,n)}var vs=k("ZodBigIntFormat",(n,e)=>{Rl.init(n,e),hr.init(n,e)});function dg(n){return Nu(vs,n)}function mg(n){return Au(vs,n)}var td=k("ZodSymbol",(n,e)=>{Pl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>rp(n,r,i,t)});function fg(n){return zu(td,n)}var nd=k("ZodUndefined",(n,e)=>{Cl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>op(n,r,i,t)});function hg(n){return Du(nd,n)}var rd=k("ZodNull",(n,e)=>{Nl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ip(n,r,i,t)});function id(n){return Lu(rd,n)}var od=k("ZodAny",(n,e)=>{Al.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>cp(n,r,i,t)});function gg(){return Ou(od)}var sd=k("ZodUnknown",(n,e)=>{zl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>lp(n,r,i,t)});function In(){return Mu(sd)}var ad=k("ZodNever",(n,e)=>{Dl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ap(n,r,i,t)});function xs(n){return ju(ad,n)}var cd=k("ZodVoid",(n,e)=>{Ll.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>sp(n,r,i,t)});function yg(n){return Fu(cd,n)}var yi=k("ZodDate",(n,e)=>{Ol.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>up(n,i,t,o),n.min=(i,t)=>n.check(je(i,t)),n.max=(i,t)=>n.check(Xe(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 bg(n){return Uu(yi,n)}var ld=k("ZodArray",(n,e)=>{Ml.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Sp(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(Lt(r,i)),n.nonempty=r=>n.check(Lt(1,r)),n.max=(r,i)=>n.check(En(r,i)),n.length=(r,i)=>n.check(kn(r,i)),n.unwrap=()=>n.element});function bi(n,e){return Hu(ld,n,e)}function _g(n){let e=n._zod.def.shape;return $s(Object.keys(e))}var _i=k("ZodObject",(n,e)=>{jl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>$p(n,r,i,t),W.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>$s(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:In()}),n.loose=()=>n.clone({...n._zod.def,catchall:In()}),n.strict=()=>n.clone({...n._zod.def,catchall:xs()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>W.extend(n,r),n.safeExtend=r=>W.safeExtend(n,r),n.merge=r=>W.merge(n,r),n.pick=r=>W.pick(n,r),n.omit=r=>W.omit(n,r),n.partial=(...r)=>W.partial(Es,n,r[0]),n.required=(...r)=>W.required(ks,n,r[0])});function vg(n,e){let r={type:"object",shape:n??{},...W.normalizeParams(e)};return new _i(r)}function xg(n,e){return new _i({type:"object",shape:n,catchall:xs(),...W.normalizeParams(e)})}function Sg(n,e){return new _i({type:"object",shape:n,catchall:In(),...W.normalizeParams(e)})}var vi=k("ZodUnion",(n,e)=>{oi.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Go(n,r,i,t),n.options=e.options});function Ss(n,e){return new vi({type:"union",options:n,...W.normalizeParams(e)})}var ud=k("ZodXor",(n,e)=>{vi.init(n,e),Fl.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Go(n,r,i,t),n.options=e.options});function $g(n,e){return new ud({type:"union",options:n,inclusive:!1,...W.normalizeParams(e)})}var pd=k("ZodDiscriminatedUnion",(n,e)=>{vi.init(n,e),Ul.init(n,e)});function wg(n,e,r){return new pd({type:"union",options:e,discriminator:n,...W.normalizeParams(r)})}var dd=k("ZodIntersection",(n,e)=>{Wl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wp(n,r,i,t)});function md(n,e){return new dd({type:"intersection",left:n,right:e})}var fd=k("ZodTuple",(n,e)=>{mo.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ep(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function hd(n,e,r){let i=e instanceof ne,t=i?r:e,o=i?e:null;return new fd({type:"tuple",items:n,rest:o,...W.normalizeParams(t)})}var xi=k("ZodRecord",(n,e)=>{Zl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>kp(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function gd(n,e,r){return new xi({type:"record",keyType:n,valueType:e,...W.normalizeParams(r)})}function Eg(n,e,r){let i=Me(n);return i._zod.values=void 0,new xi({type:"record",keyType:i,valueType:e,...W.normalizeParams(r)})}function kg(n,e,r){return new xi({type:"record",keyType:n,valueType:e,mode:"loose",...W.normalizeParams(r)})}var yd=k("ZodMap",(n,e)=>{Hl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>vp(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType,n.min=(...r)=>n.check($t(...r)),n.nonempty=r=>n.check($t(1,r)),n.max=(...r)=>n.check(en(...r)),n.size=(...r)=>n.check(wn(...r))});function Ig(n,e,r){return new yd({type:"map",keyType:n,valueType:e,...W.normalizeParams(r)})}var bd=k("ZodSet",(n,e)=>{Bl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>xp(n,r,i,t),n.min=(...r)=>n.check($t(...r)),n.nonempty=r=>n.check($t(1,r)),n.max=(...r)=>n.check(en(...r)),n.size=(...r)=>n.check(wn(...r))});function Tg(n,e){return new bd({type:"set",valueType:n,...W.normalizeParams(e)})}var ur=k("ZodEnum",(n,e)=>{Gl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>pp(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 ur({...e,checks:[],...W.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 ur({...e,checks:[],...W.normalizeParams(t),entries:o})}});function $s(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new ur({type:"enum",entries:r,...W.normalizeParams(e)})}function Rg(n,e){return new ur({type:"enum",entries:n,...W.normalizeParams(e)})}var _d=k("ZodLiteral",(n,e)=>{Jl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>dp(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 Pg(n,e){return new _d({type:"literal",values:Array.isArray(n)?n:[n],...W.normalizeParams(e)})}var vd=k("ZodFile",(n,e)=>{Vl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>hp(n,r,i,t),n.min=(r,i)=>n.check($t(r,i)),n.max=(r,i)=>n.check(en(r,i)),n.mime=(r,i)=>n.check(tr(Array.isArray(r)?r:[r],i))});function Cg(n){return Bu(vd,n)}var xd=k("ZodTransform",(n,e)=>{ql.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>_p(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vt(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(W.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(W.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 ws(n){return new xd({type:"transform",transform:n})}var Es=k("ZodOptional",(n,e)=>{fo.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Jo(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function mi(n){return new Es({type:"optional",innerType:n})}var Sd=k("ZodExactOptional",(n,e)=>{Kl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Jo(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function $d(n){return new Sd({type:"optional",innerType:n})}var wd=k("ZodNullable",(n,e)=>{Yl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ip(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function fi(n){return new wd({type:"nullable",innerType:n})}function Ng(n){return mi(fi(n))}var Ed=k("ZodDefault",(n,e)=>{Xl.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Rp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function kd(n,e){return new Ed({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():W.shallowClone(e)}})}var Id=k("ZodPrefault",(n,e)=>{Ql.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Pp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Td(n,e){return new Id({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():W.shallowClone(e)}})}var ks=k("ZodNonOptional",(n,e)=>{eu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Tp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Rd(n,e){return new ks({type:"nonoptional",innerType:n,...W.normalizeParams(e)})}var Pd=k("ZodSuccess",(n,e)=>{tu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>gp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Ag(n){return new Pd({type:"success",innerType:n})}var Cd=k("ZodCatch",(n,e)=>{nu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Cp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Nd(n,e){return new Cd({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var Ad=k("ZodNaN",(n,e)=>{ru.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>mp(n,r,i,t)});function zg(n){return Zu(Ad,n)}var Is=k("ZodPipe",(n,e)=>{iu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Np(n,r,i,t),n.in=e.in,n.out=e.out});function hi(n,e){return new Is({type:"pipe",in:n,out:e})}var Ts=k("ZodCodec",(n,e)=>{Is.init(n,e),si.init(n,e)});function Dg(n,e,r){return new Ts({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var zd=k("ZodReadonly",(n,e)=>{ou.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ap(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Dd(n){return new zd({type:"readonly",innerType:n})}var Ld=k("ZodTemplateLiteral",(n,e)=>{su.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>fp(n,r,i,t)});function Lg(n,e){return new Ld({type:"template_literal",parts:n,...W.normalizeParams(e)})}var Od=k("ZodLazy",(n,e)=>{lu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Dp(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function Md(n){return new Od({type:"lazy",getter:n})}var jd=k("ZodPromise",(n,e)=>{cu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>zp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Og(n){return new jd({type:"promise",innerType:n})}var Fd=k("ZodFunction",(n,e)=>{au.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>bp(n,r,i,t)});function Mg(n){return new Fd({type:"function",input:Array.isArray(n?.input)?hd(n?.input):n?.input??bi(In()),output:n?.output??In()})}var Si=k("ZodCustom",(n,e)=>{uu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>yp(n,r,i,t)});function jg(n){let e=new he({check:"custom"});return e._zod.check=n,e}function Fg(n,e){return Gu(Si,n??(()=>!0),e)}function Ud(n,e={}){return Ju(Si,n,e)}function Wd(n){return Vu(n)}var Ug=qu,Wg=Ku;function Zg(n,e={}){let r=new Si({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...W.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 Hg=(...n)=>Yu({Codec:Ts,Boolean:fr,String:pr},...n);function Bg(n){let e=Md(()=>Ss([ts(n),Qp(),ed(),id(),bi(e),gd(ts(),e)]));return e}function Gg(n,e){return hi(ws(n),e)}var _w={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 vw(n){$e({customError:n})}function xw(){return $e().customError}var Zd;Zd||(Zd={});var V={...pi,...Ko,iso:lr},Sw=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 $w(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 ww(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 Jg(n,e){if(n.not!==void 0){if(typeof n.not=="object"&&Object.keys(n.not).length===0)return V.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 V.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=ww(t,e),s=Ne(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 V.null();if(t.length===0)return V.never();if(t.length===1)return V.literal(t[0]);if(t.every(s=>typeof s=="string"))return V.enum(t);let o=t.map(s=>V.literal(s));return o.length<2?o[0]:V.union([o[0],o[1],...o.slice(2)])}if(n.const!==void 0)return V.literal(n.const);let r=n.type;if(Array.isArray(r)){let t=r.map(o=>{let s={...n,type:o};return Jg(s,e)});return t.length===0?V.never():t.length===1?t[0]:V.union(t)}if(!r)return V.any();let i;switch(r){case"string":{let t=V.string();if(n.format){let o=n.format;o==="email"?t=t.check(V.email()):o==="uri"||o==="uri-reference"?t=t.check(V.url()):o==="uuid"||o==="guid"?t=t.check(V.uuid()):o==="date-time"?t=t.check(V.iso.datetime()):o==="date"?t=t.check(V.iso.date()):o==="time"?t=t.check(V.iso.time()):o==="duration"?t=t.check(V.iso.duration()):o==="ipv4"?t=t.check(V.ipv4()):o==="ipv6"?t=t.check(V.ipv6()):o==="mac"?t=t.check(V.mac()):o==="cidr"?t=t.check(V.cidrv4()):o==="cidr-v6"?t=t.check(V.cidrv6()):o==="base64"?t=t.check(V.base64()):o==="base64url"?t=t.check(V.base64url()):o==="e164"?t=t.check(V.e164()):o==="jwt"?t=t.check(V.jwt()):o==="emoji"?t=t.check(V.emoji()):o==="nanoid"?t=t.check(V.nanoid()):o==="cuid"?t=t.check(V.cuid()):o==="cuid2"?t=t.check(V.cuid2()):o==="ulid"?t=t.check(V.ulid()):o==="xid"?t=t.check(V.xid()):o==="ksuid"&&(t=t.check(V.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"?V.number().int():V.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=V.boolean();break}case"null":{i=V.null();break}case"object":{let t={},o=n.properties||{},s=new Set(n.required||[]);for(let[c,l]of Object.entries(o)){let u=Ne(l,e);t[c]=s.has(c)?u:u.optional()}if(n.propertyNames){let c=Ne(n.propertyNames,e),l=n.additionalProperties&&typeof n.additionalProperties=="object"?Ne(n.additionalProperties,e):V.any();if(Object.keys(t).length===0){i=V.record(c,l);break}let u=V.object(t).passthrough(),p=V.looseRecord(c,l);i=V.intersection(u,p);break}if(n.patternProperties){let c=n.patternProperties,l=Object.keys(c),u=[];for(let d of l){let m=Ne(c[d],e),f=V.string().regex(new RegExp(d));u.push(V.looseRecord(f,m))}let p=[];if(Object.keys(t).length>0&&p.push(V.object(t).passthrough()),p.push(...u),p.length===0)i=V.object({}).passthrough();else if(p.length===1)i=p[0];else{let d=V.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)d=V.intersection(d,p[m]);i=d}break}let a=V.object(t);n.additionalProperties===!1?i=a.strict():typeof n.additionalProperties=="object"?i=a.catchall(Ne(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=>Ne(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Ne(o,e):void 0;a?i=V.tuple(s).rest(a):i=V.tuple(s),typeof n.minItems=="number"&&(i=i.check(V.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(V.maxLength(n.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>Ne(c,e)),a=n.additionalItems&&typeof n.additionalItems=="object"?Ne(n.additionalItems,e):void 0;a?i=V.tuple(s).rest(a):i=V.tuple(s),typeof n.minItems=="number"&&(i=i.check(V.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(V.maxLength(n.maxItems)))}else if(o!==void 0){let s=Ne(o,e),a=V.array(s);typeof n.minItems=="number"&&(a=a.min(n.minItems)),typeof n.maxItems=="number"&&(a=a.max(n.maxItems)),i=a}else i=V.array(V.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 Ne(n,e){if(typeof n=="boolean")return n?V.any():V.never();let r=Jg(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=>Ne(l,e)),c=V.union(a);r=i?V.intersection(r,c):c}if(n.oneOf&&Array.isArray(n.oneOf)){let a=n.oneOf.map(l=>Ne(l,e)),c=V.xor(a);r=i?V.intersection(r,c):c}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)r=i?r:V.any();else{let a=i?r:Ne(n.allOf[0],e),c=i?0:1;for(let l=c;l<n.allOf.length;l++)a=V.intersection(a,Ne(n.allOf[l],e));r=a}n.nullable===!0&&e.version==="openapi-3.0"&&(r=V.nullable(r)),n.readOnly===!0&&(r=V.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))Sw.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function Vg(n,e){if(typeof n=="boolean")return n?V.any():V.never();let r=$w(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??Pe};return Ne(n,t)}var Hd={};Ke(Hd,{bigint:()=>Tw,boolean:()=>Iw,date:()=>Rw,number:()=>kw,string:()=>Ew});function Ew(n){return fu(pr,n)}function kw(n){return Su(mr,n)}function Iw(n){return Ru(fr,n)}function Tw(n){return Cu(hr,n)}function Rw(n){return Wu(yi,n)}$e(ho());var Rs=["**/node_modules/**","**/.git/**","**/dist/**","**/build/**","**/vendor/**","**/.next/**","**/.cache/**","**/coverage/**","**/*.min.js"],qg=["**/*.{ts,tsx,yaml,yml,php,py,go}","**/*.prisma","**/*.{graphql,gql}","**/Dockerfile*","**/.env*","**/package.json","**/lerna.json","**/turbo.json","**/pnpm-workspace.yaml"],ve={MAX_DEPTH:10,MIN_DEPTH:1,MAX_LIMIT:500,MIN_LIMIT:1,MAX_QUERY_LENGTH:500,DEFAULT_DEPTH:3,DEFAULT_LIMIT:10},Ue={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},Bd={SECONDS_PER_DAY:86400,SECONDS_PER_YEAR:31536e3},Ps={DEFAULT_CONCURRENCY:parseInt(process.env.INDEX_CONCURRENCY??String(5),10)};var J0=h.object({repoPath:h.string(),mode:h.enum(["init","tree","topography","scout","hologram","tools"]),subPath:h.string().optional(),maxDepth:h.number().int().min(ve.MIN_DEPTH).max(ve.MAX_DEPTH).optional()}),V0=h.object({repoPath:h.string(),mode:h.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:h.string().max(ve.MAX_QUERY_LENGTH).optional(),key:h.string().optional(),kind:h.enum(["Service","Image","Port","Env"]).optional(),limit:h.number().int().min(ve.MIN_LIMIT).max(ve.MAX_LIMIT).optional(),offset:h.number().int().min(0).optional(),compact:h.boolean().optional(),tokenBudget:h.number().int().min(1).optional()}).refine(n=>!(n.mode==="concept"&&(!n.query||n.query.trim().length===0)),{message:"Concept search requires a non-empty query",path:["query"]}),q0=h.object({repoPath:h.string(),mode:h.enum(["symbol","file"]),filePath:h.string().optional(),detailLevel:h.enum(["structure","signatures","summaries","detailed"]).optional(),symbolName:h.string().optional(),context:h.enum(["definition","full"]).optional()}),K0=h.object({repoPath:h.string(),mode:h.enum(["impact","explain-diff","type-graph","deps","flow","dead-code","circular-deps"]),filePath:h.string().optional(),symbolName:h.string().optional(),direction:h.enum(["imports","imported_by"]).optional(),depth:h.number().int().min(ve.MIN_DEPTH).max(ve.MAX_DEPTH).optional(),limit:h.number().int().min(ve.MIN_LIMIT).max(ve.MAX_LIMIT).optional(),includeTests:h.boolean().optional()}),Y0=h.object({repoPath:h.string(),action:h.enum(["index","repair","trace"]),deep:h.boolean().optional(),sinceCommit:h.string().optional()}),X0=h.object({repoPath:h.string(),action:h.enum(["install","remove","status"]),enableAutoRefresh:h.boolean().optional(),enableSymbolHealing:h.boolean().optional()}),Q0=h.object({action:h.enum(["list","link","fuse"]),repoPaths:h.array(h.string()).optional(),name:h.string().optional(),status:h.string().optional(),parentRepoPath:h.string().optional(),parentMissionId:h.number().optional(),childRepoPath:h.string().optional(),childMissionId:h.number().optional(),relationship:h.string().optional()});var Kg=[...rf,...of];X();import{execSync as Mt}from"child_process";import $i from"path";import Gd from"fs";function xe(n){try{if(!Gd.existsSync($i.join(n,".git")))return null;let e=Mt("git rev-parse --abbrev-ref HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return e==="HEAD"?Mt("git rev-parse --short HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():e.replace(/[\/\\:*"<>|?]/g,"-")}catch{return null}}function Qe(n){try{return Gd.existsSync($i.join(n,".git"))?Mt("git rev-parse HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():null}catch{return null}}function Cs(n,e=50){try{let r=Mt(`git rev-list --max-count=${e} HEAD`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return r?r.split(`
|
|
707
|
+
`):[]}catch{return[]}}function Xg(n,e,r){try{return Mt(`git merge-tree --write-tree ${e} ${r}`,{cwd:n,stdio:["ignore","ignore","ignore"]}),!1}catch{return!0}}var Aw=new Set([".ts",".tsx",".yaml",".yml",".php",".py",".go",".prisma",".graphql",".gql"]),zw=new Set(["package.json","lerna.json","turbo.json","pnpm-workspace.yaml"]),Dw=new Set(["node_modules",".git","dist","build","vendor",".next",".cache","coverage"]);function Yg(n){let e=n.split("/");for(let t of e)if(Dw.has(t))return!1;if(n.endsWith(".min.js"))return!1;let r=$i.basename(n);if(r.startsWith("Dockerfile")||r.startsWith(".env")||zw.has(r))return!0;let i=$i.extname(r).toLowerCase();return Aw.has(i)}function Lw(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 Qg(n,e){try{if(!Gd.existsSync($i.join(n,".git")))return!0;let r=Qe(n);if(!r)return!0;if(e&&e!==r){let t=Mt(`git diff --name-only ${e} ${r}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(t&&t.split(`
|
|
708
|
+
`).some(o=>o&&Yg(o)))return!0}let i=Mt("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return i?i.split(`
|
|
709
|
+
`).some(t=>t?Yg(Lw(t)):!1):!1}catch{return!0}}function ey(n,e){let r=new Set;try{let i=Mt(`git diff --name-only ${e}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();i&&i.split(`
|
|
710
|
+
`).filter(Boolean).forEach(o=>r.add(o));let t=Mt("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();t&&t.split(`
|
|
711
|
+
`).filter(Boolean).forEach(o=>{let s=o.trim().split(/\s+/);s.length>=2&&r.add(s[s.length-1])})}catch{}return r}X();var Ns=E.child({module:"strategy-normalizer"}),at=class{static normalize(e){if(!e)return{steps:[]};let r;if(typeof e=="string")try{r=JSON.parse(e)}catch(t){return Ns.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)=>{if(typeof r=="string")return{id:`step-${i}`,description:r,status:"pending"};if(typeof r=="object"&&r!==null){let{verification:t,...o}=r,s=this.sanitizeVerification(t);return{...o,id:r.id||`step-${i}`,description:r.description||r.content||r.name||`Step ${i+1}`,status:r.status||"pending",dependencies:r.dependencies||r.deps,...s!==void 0?{verification:s}:{}}}return{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)=>{if(typeof i=="string")return{id:r,description:i,status:"pending"};if(typeof i=="object"&&i!==null){let{verification:o,...s}=i,a=this.sanitizeVerification(o);return{...s,id:r,description:i.description||i.content||i.name||r,status:i.status||"pending",dependencies:i.dependencies||i.deps,...a!==void 0?{verification:a}:{}}}return{id:r||`step-${t}`,description:String(i),status:"pending"}}):[]}static looksLikeNaturalLanguage(e){return e.trim().split(/\s+/).length>=5}static VALID_VERIFICATION_TYPES=new Set(["usage","import","pattern"]);static sanitizeVerificationRule(e){if(!e)return null;if(typeof e=="string")return this.looksLikeNaturalLanguage(e)?(Ns.warn({verification:e},"Stripping natural-language verification rule (not a valid pattern)"),null):{type:"pattern",target:e};if(typeof e!="object"||Array.isArray(e))return null;let r=e;if(typeof r.target!="string"||!r.target)return Ns.warn({verification:e},"Stripping verification rule without target"),null;if(this.looksLikeNaturalLanguage(r.target))return Ns.warn({verification:e},"Stripping natural-language verification target (not a valid pattern)"),null;let t={type:typeof r.type=="string"&&this.VALID_VERIFICATION_TYPES.has(r.type)?r.type:"pattern",target:r.target};return typeof r.context=="string"&&(t.context=r.context),typeof r.filePath=="string"&&(t.filePath=r.filePath),t}static sanitizeVerification(e){if(e!=null){if(Array.isArray(e)){let r=e.map(i=>this.sanitizeVerificationRule(i)).filter(Boolean);return r.length>0?r.length===1?r[0]:r:void 0}return this.sanitizeVerificationRule(e)??void 0}}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}}}};X();import Jd from"fs";import ty from"path";import Ow from"os";var Mw=[{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"}],jw=[{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"}],Fw=[{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"}],ny=[{id:"refactoring",name:"Refactoring",description:"Impact analysis \u2192 implementation \u2192 verification",defaultGoal:"Refactor {{target}} safely with full impact analysis and verification.",steps:Mw},{id:"feature",name:"Feature",description:"Requirements \u2192 implementation \u2192 testing",defaultGoal:"Implement {{target}} with clear requirements and end-to-end verification.",steps:jw},{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:Fw}],Vd=new Map(ny.map(n=>[n.id,n])),As=!1;function Uw(){if(As)return;let n=ty.join(Ow.homedir(),".shadow","templates");if(!Jd.existsSync(n)){E.debug({templatesDir:n},"Custom templates directory does not exist"),As=!0;return}try{let e=Jd.readdirSync(n).filter(r=>r.endsWith(".json"));for(let r of e)try{let i=ty.join(n,r),t=Jd.readFileSync(i,"utf8"),o=JSON.parse(t);if(!o.id||!o.name||!o.defaultGoal||!o.steps){E.warn({file:r,template:o},"Invalid custom template structure - skipping");continue}if(!Array.isArray(o.steps)||o.steps.length===0){E.warn({file:r},"Template has no steps - skipping");continue}if(ny.some(s=>s.id===o.id)){E.warn({file:r,templateId:o.id},"Custom template ID conflicts with built-in - skipping");continue}Vd.set(o.id,o),E.info({file:r,templateId:o.id},"Loaded custom template")}catch(i){E.warn({file:r,error:i},"Failed to load custom template")}As=!0}catch(e){E.warn({error:e,templatesDir:n},"Failed to read custom templates directory"),As=!0}}function Ww(n){return Uw(),Vd.get(n)}function Zw(n,e){let r=n;for(let[i,t]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),t);return r}function ry(n,e,r={}){let i=Ww(n);if(!i)throw new Error(`Unknown template: ${n}. Use one of: ${Array.from(Vd.keys()).join(", ")}`);let t=r.target||"scope",o=e||(n==="refactoring"?`Refactor ${t}`:n==="feature"?`Feature: ${t}`:`Fix: ${t}`),s=Zw(i.defaultGoal,{...r,target:t}),a=at.normalize({steps:i.steps}),c=at.stringify(a);return{name:o,goal:s,strategy:c}}ee();ee();import{execSync as xr}from"child_process";var Ys=class{constructor(e,r="refs/notes/shadow"){this.repoPath=e;this.ref=r}addNote(e,r){try{xr(`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 xr(`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=xr(`git notes --ref ${this.ref} list`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(!r)return e;let i=r.split(`
|
|
712
|
+
`);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{xr(`git notes --ref ${this.ref} remove ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}push(e="origin"){try{xr(`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{xr(`git fetch ${e} ${this.ref}:${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}};X();Sr();var $r=E.child({module:"persistence-service"}),ht=class{gitNotes;repoPath;constructor(e){this.repoPath=e,this.gitNotes=new Ys(e)}async syncMissionToGitNotes(e){let{missions:r,intentLogs:i}=N.getInstance(this.repoPath),t=r.findById(e);if(!t)throw new Error(`Mission ${e} not found`);if(!t.commit_sha){$r.info({missionId:e},"Skipping Git Notes sync because mission has no commit_sha yet");return}$r.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}=N.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){$r.error({missionId:o.id,...Re(s)},"Failed to sync mission")}}async recoverFromGitNotes(){let e=this.gitNotes.listNotes(),{missions:r,intentLogs:i}=N.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)){$r.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++;$r.info({commitSha:s,missionName:c.mission.name,logsRecovered:o},"Re-hydrated mission from Git Notes")}catch(c){$r.error({commitSha:s,...Re(c)},"Failed to parse Git Note for recovery")}return{missionsRecovered:t,logsRecovered:o}}};Sr();import Oy from"node:path";var Ii=E.child({module:"mcp:tools:ops:plan"}),SE=["name","goal","strategy","parentId","outcomeContract"],$E="Mission update requires at least one updatable field: name, goal, strategy, parentId, outcomeContract.",wE="Mission requires name and goal (or templateId with optional templateVars).";async function My(n){let{repoPath:e,name:r,goal:i,strategy:t,workingSet:o,missionId:s,parentId:a,outcomeContract:c,templateId:l,templateVars:u}=n,{missions:p}=N.getInstance(e),d=xe(e),m=Qe(e);Ii.info({repoPath:e,name:r,missionId:s,templateId:l},"Planning mission");try{let f=r,g=i,$=t;if(!s&&l){let b=ry(l,r,u||{});f=f??b.name,g=g??b.goal,$=$??b.strategy}let y,v;if(s){let b=p.findById(s);if(!b)throw new Error(`Mission ${s} not found.`);let S;if(t!==void 0)if(t){let T=at.normalize(t);S=at.stringify(T);let z=at.validate(S);z.valid||Ii.warn({errors:z.errors,strategy:t},"Strategy validation warnings detected")}else S=null;let w={commit_sha:m};if(r!==void 0&&(w.name=r),i!==void 0&&(w.goal=i),S!==void 0&&(w.strategy_graph=S),a!==void 0&&(w.parent_id=a),c!==void 0&&(w.outcome_contract=c),Object.keys(w).length===1)throw new Error($E);p.update(s,{...w}),y=s,v=`Mission "${r??b.name}" updated.`}else{if(!f||!g)throw new Error(wE);let b=null;if($){let S=at.normalize($);b=at.stringify(S);let w=at.validate(b);w.valid||Ii.warn({errors:w.errors,strategy:$},"Strategy validation warnings detected")}if(y=p.create({name:f,goal:g,strategy_graph:b,status:"planned",git_branch:d,commit_sha:m,parent_id:a||null,verification_context:null,outcome_contract:c||null}),o&&o.length>0){p.clearWorkingSet(Number(y));for(let S of o){let w=Oy.isAbsolute(S)?S:Oy.join(e,S);p.addToWorkingSet(Number(y),w,"planned")}}v=`Mission "${f}" planned.`}try{await new ht(e).syncMissionToGitNotes(Number(y))}catch(b){Ii.info({missionId:y,...Re(b)},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:y,status:"planned",message:v,strategy_saved:!!$,working_set_populated:o?.length||0,working_set_seeded:o?.length||0,contract_saved:!!c,updateable_fields:SE,from_template:l??void 0,commit:m},null,2)}]}}catch(f){let g=It(f);throw Ii.error({repoPath:e,...Re(f)},"Failed to plan mission"),new Error(`Failed to plan mission: ${g}`)}}X();ee();ee();X();X();var EE=E.child({module:"reasoning-engine"}),Ut=class{analyze(e){EE.debug({logCount:e.length},"Performing reasoning pass over intent logs");let r={context:[],decisions:[],consequences:[],recommendations:[],unclassified:[],sourceMissions:[]};for(let t of e){let o=t.content.toLowerCase(),s=this.matchesContext(o,t.type),a=this.matchesDecision(o,t.type),c=this.matchesConsequence(o,t.type),l=this.matchesRecommendation(o,t.type);s?r.context.push(t.content):a?r.decisions.push(t.content):l?r.recommendations.push(t.content):c?r.consequences.push(t.content):t.type==="decision"?r.decisions.push(t.content):t.type==="discovery"||t.type==="fix"?r.consequences.push(t.content):r.unclassified.push(t.content)}let i=new Set;for(let t of e)t.mission_id!=null&&i.add(t.mission_id);return r.sourceMissions=[...i],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 Xs=E.child({module:"briefing-engine"}),Wt=class{intentLogs;missions;reasoningEngine;persistencePivot;constructor(e){let{intentLogs:r,missions:i}=N.getInstance(e);this.intentLogs=r,this.missions=i,this.reasoningEngine=new Ut,this.persistencePivot=new ht(e)}async distillMission(e,r=!0){Xs.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}
|
|
660
713
|
|
|
661
714
|
`;if(s+=`## Summary of Intent
|
|
662
715
|
`,s+=`Collected ${i.length} intent events across ${o.size} symbols.
|
|
@@ -678,9 +731,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
678
731
|
`}),s+=`
|
|
679
732
|
`),s+=`
|
|
680
733
|
---
|
|
681
|
-
*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),
|
|
682
|
-
`).filter(s=>s.trim()!=="");if(o.length===0)return;
|
|
683
|
-
`).map(u=>u.trim().replace(/^\* /,"")).filter(u=>u&&u!==t)}catch{}if(c.length>0){let l=this.missions.findMergedMissions(t,c);for(let u of l)this.missions.updateStatus(u.id,"completed"),bn.info({missionId:u.id,branch:u.git_branch},"Merge Sentinel: Auto-completed mission"),a++}}return(o>0||s>0||a>0)&&bn.info({suspended:o,resumed:s,completed:a},"Git-Native Lifecycle Sync complete"),{suspended:o,resumed:s,completed:a,contextPivotEnabled:r,mergeSentinelEnabled:i}}};ee();Q();var rE=S.child({module:"collision-service"}),Ys=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=ye(this.repoPath);if(!e)return[];let{missions:r,intentLogs:i}=z.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),rE.info({branch:c,currentBranch:e},"Checking predictive collisions"),Tg(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}};Tt();gn();import{spawn as iE}from"node:child_process";import qd from"node:os";import{resolve as oE}from"node:path";import{existsSync as Uy}from"node:fs";import{fileURLToPath as sE}from"node:url";import{dirname as aE}from"node:path";var Zy=sE(import.meta.url),cE=aE(Zy),lE=qd.constants.priority.PRIORITY_LOWEST??qd.constants.priority.PRIORITY_LOW;function uE(){if(Zy.endsWith(".ts"))return null;let n=oE(cE,"../../entry/ember/index.js");if(Uy(n))return n;let e=Be("dist/entry/ember/index.js");return Uy(e)?e:null}function Wy(n){try{let r=Te(n).prepare("SELECT key, value FROM ember_state WHERE key IN ('status','progress','pid')").all(),i=new Map(r.map(t=>[t.key,t.value??""]));return{status:i.get("status")??"idle",progress:i.get("progress")??"0/0",pid:i.get("pid")??null}}catch{return{status:"idle",progress:"0/0",pid:null}}}function pE(n,e){let r=Te(n);r.transaction(()=>{let i=r.prepare("INSERT OR REPLACE INTO ember_state (key, value, updated_at) VALUES (?, ?, unixepoch())");i.run("pid",String(e)),i.run("status","running"),i.run("repo_path",n)})()}function Hy(n){let{pid:e}=Wy(n);if(!e)return!1;let r=parseInt(e,10);if(!Number.isFinite(r)||r<=0)return!1;try{return process.kill(r,0),!0}catch{return!1}}function By(n){let e=uE();if(!e)return;let r=iE(process.execPath,[e,n],{detached:!0,stdio:"ignore",env:{...process.env,EMBER_MODE:"1"}});if(r.pid!=null){try{qd.setPriority(r.pid,lE)}catch{}r.unref(),pE(n,r.pid)}}function ur(n){let{status:e,progress:r}=Wy(n);return{status:e,progress:r}}var Xs=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}=z.getInstance(this.repoPath),d=He(this.repoPath),m=ye(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}=z.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(H=>!f.has(H.id)),y=new Us(t).score(h),b=.15,_=3,x=c&&y.length>_?y.filter((H,O)=>O<_||H.score>=b):y,E=x.map(H=>H.mission),I=new Map(x.map(H=>[H.mission.id,H.score])),N=H=>({id:H.id,name:H.name,goal:H.goal,status:H.status,relevance:I.get(H.id)});if(o==="orbit")return{scope:"project",altitude:"orbit",counts:i.getStats(),next_work_candidates:E.map(N),meta:{current_branch:l,activeMissionsTotal:d,ember:this.getEmberLabel(r)}};let L={},C=[];for(let H of p)H.parent_id!=null?(L[H.parent_id]||(L[H.parent_id]=[]),L[H.parent_id].push(H)):C.push(H);let $=i.findRecentCompleted(5).map(N),R=a>0?t.findRecentDecisionActivity(a):void 0,A=m.map(H=>{let O=p.find(D=>D.id===H);return{parent:c?{...O,strategy_graph:void 0,verification_context:void 0}:O,children:L[H]??[]}}),W=C.filter(H=>!f.has(H.id));return{scope:"project",altitude:o||"atmosphere",counts:i.getStats(),analytics:i.getAnalytics(),hierarchy:A.length>0?A:void 0,standalone_active:W.length>0?W:void 0,active_missions:A.length===0?c?p.map(H=>({...H,strategy_graph:void 0})):p:void 0,next_work_candidates:E.map(N),recent_completed:$,recent_activity:R,meta:{current_branch:l,current_commit:u,activeMissionsTotal:d,active_limit_applied:!!s,relevance_filtered:x.length<y.length?{shown:x.length,total:y.length}:void 0,ember:this.getEmberLabel(r)}}}getEmberLabel(e){try{let{status:r,progress:i}=ur(e);if(r==="idle")return;if(r==="done")return"symbols: fully embedded";let[t,o]=i.split("/").map(Number),s=o>0?Math.round(t/o*100):0;return r==="running"?`symbols: warming ${i} (${s}%)`:`symbols: ${r} ${i}`}catch{return}}async getMissionBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=z.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 Vt(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 je(r).detectAndRepairShifts()}catch{}let f=i.getHandoffs(u.id).map(v=>{let y=null;try{y=JSON.parse(v.metadata??"")}catch{}return{artifactId:v.id,kind:v.identifier,confidence:y?.confidence??null,findingsCount:y?.findings?.length??0,risksCount:y?.risks?.length??0,missionsCreated:y?.missionsCreated??[],createdAt:v.created_at}}),h={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),handoffs:f,shadow_trace:{ghost_analysis:d,symbols_repaired:m.repaired,symbols_missing:m.failed},context:{current_commit:l,working_set:i.getWorkingSet(u.id).map(v=>v.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 v=new Ys(r);h.predictive_collisions=await v.analyzePotentialCollisions()}catch{}if(u.parent_id){let v=s==="ground"?t.findByMission(u.parent_id,5):t.findByMissionPreferCrystal(u.parent_id,3);h.ancestor_activity_summary=v.map(y=>({type:y.type,content:y.content,date:new Date(y.created_at*1e3).toISOString()}))}return h}};var Gy=S.child({module:"mcp:tools:ops:briefing"});async function Qs(n){let{repoPath:e,scope:r="mission"}=n;Gy.info({repoPath:e,missionId:n.missionId,scope:r},"Generating briefing");try{let t=await new Xs(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 Gy.error({error:i,repoPath:e},"Failed to generate briefing"),new Error(`Failed to generate briefing: ${i instanceof Error?i.message:String(i)}`)}}ee();Q();var Jy=S.child({module:"mcp:tools:ops:synthesize"});async function Vy(n){let{repoPath:e,missionId:r}=n;Jy.info({repoPath:e,missionId:r},"Synthesizing mission");let{missions:i}=z.getInstance(e);try{if(!i.findById(r))throw new Error(`Mission ${r} not found`);let s=await new Pt(e).distillMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,adr:s.adr,metrics:s.metrics},null,2)}]}}catch(t){throw Jy.error({error:t,repoPath:e},"Failed to synthesize ADR"),new Error(`Failed to synthesize ADR: ${t instanceof Error?t.message:String(t)}`)}}Q();ee();Q();var dE=S.child({module:"narrative-service"}),pr=class{missions;briefingEngine;repoPath;constructor(e){this.repoPath=e;let{missions:r}=z.getInstance(e);this.missions=r,this.briefingEngine=new Pt(e)}async generateChronicle(e={}){dE.info(e,"Generating Repo Chronicle...");let i=this.missions.findAll().filter(l=>l.parent_id===null&&l.status!=="planned");e.branch&&(i=i.filter(l=>!l.git_branch||l.git_branch===e.branch)),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
|
|
734
|
+
*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),Xs.info({missionId:e},"Tactical Briefing synthesized, archived, and synced to Git Notes.")}catch(a){Xs.error({missionId:e,error:a},"Failed to sync ADR to Git Notes")}}else Xs.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")}};X();import{Visitor as kE}from"@swc/core/Visitor.js";import*as jy from"@swc/core";var IE=E.child({module:"verification-engine"}),im=class extends kE{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)}},Qs=class{async verify(e,r){try{let i=await jy.parse(e,{syntax:"typescript",tsx:!0,comments:!1}),t=new im(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 IE.error({error:i},"Verification failed due to parse error"),{passed:!1,errors:[`Parse error: ${i.message}`]}}}};Sr();import Fy from"path";import ea from"fs";var We=E.child({module:"mcp:tools:ops:track"});function om(n,e){return Fy.isAbsolute(e)?e:Fy.join(n,e)}async function Uy(n,e,r){let{missions:i,intentLogs:t}=N.getInstance(n),o=i.findById(e);if(!o?.parent_id)return;let s=i.findByParentId(o.parent_id);if(!s.every(u=>u.status==="completed"))return;let c=i.findById(o.parent_id);if(!c||c.status==="completed")return;We.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);let{claims:l}=N.getInstance(n);l.releaseAllForMission(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 Wt(n).distillMission(c.id),We.info({parentId:c.id},"Parent Auto-Synthesis completed")}catch(u){We.info({parentId:c.id,...Re(u)},"Parent Auto-Synthesis deferred")}try{await new ht(n).syncMissionToGitNotes(c.id)}catch(u){We.info({parentId:c.id,...Re(u)},"Parent Git Notes sync deferred")}await Uy(n,c.id,r)}async function Wy(n){let{repoPath:e,missionId:r,stepId:i,status:t,contextPivot:o,updates:s,artifacts:a}=n,{missions:c,intentLogs:l}=N.getInstance(e),u=Qe(e);We.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);let{claims:m}=N.getInstance(e),f=m.releaseAllForMission(r);f>0&&We.info({missionId:r,released:f},"Auto-released file claims on completion")}if(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 Wt(e).distillMission(r),We.info({missionId:r},"Auto-Synthesis completed successfully")}catch(m){We.info({missionId:r,...Re(m)},"Auto-Synthesis deferred or failed")}await Uy(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:g,contextPivot:$}=m,y=c.findById(r);if(!y)throw new Error(`Mission ID ${r} not found`);let v=JSON.parse(y.strategy_graph||"{}"),b=null;if(Array.isArray(v)?b=v.find(S=>S.id===f):v.nodes&&Array.isArray(v.nodes)?b=v.nodes.find(S=>S.id===f):v.steps?Array.isArray(v.steps)?b=v.steps.find(S=>S.id===f):b=v.steps[f]:v[f]&&(b=v[f]),!b)throw new Error(`Step ID "${f}" not found`);if(g==="completed"&&b.verification){let S=new Qs,w=Array.isArray(b.verification)?b.verification:[b.verification];for(let T of w){let z=T;if(typeof T=="string"){if(T.trim().split(/\s+/).length>=5){We.warn({rule:T},"Skipping natural-language verification rule");continue}z={type:"pattern",target:T}}if(!z||!z.target){We.warn({rule:T},"Skipping invalid verification rule (missing target)");continue}if(typeof z.target=="string"&&z.target.trim().split(/\s+/).length>=5){We.warn({rule:z},"Skipping natural-language verification target");continue}let D=z.filePath;if(D&&(D=om(e,D)),D){if(!ea.existsSync(D))throw new Error(`Verification failed: File not found at ${D}`);let C=await S.verify(ea.readFileSync(D,"utf8"),z);if(!C.passed)throw new Error(`Verification failed: ${C.errors.join("")}`)}else{let C=c.getWorkingSet(r),I=!1;C.length===0&&We.warn("No working set files to verify against for rule");for(let A of C){let M=om(e,A.file_path);if(!ea.existsSync(M))continue;if((await S.verify(ea.readFileSync(M,"utf8"),z)).passed){I=!0;break}}if(!I)throw new Error(`Verification failed: Rule "${z.target}" not satisfied in any working set file.`)}}}if(b.status=g,c.update(r,{strategy_graph:JSON.stringify(v),commit_sha:u}),l.create({mission_id:r,type:"system",content:`Step "${f}" updated to "${g}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),$){let S=$.trim();if(S.startsWith("{")||S.startsWith("["))try{let w=JSON.parse(S);if(w.files&&Array.isArray(w.files)){c.clearWorkingSet(r);for(let T of w.files)c.addToWorkingSet(r,om(e,T))}}catch(w){We.warn({error:w},"Failed to apply context pivot")}}d.push({stepId:f,status:g})}try{await new ht(e).syncMissionToGitNotes(r)}catch(m){We.info({missionId:r,...Re(m)},"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){let d=It(p);throw We.error({repoPath:e,...Re(p)},"Failed to update status"),new Error(`Failed to update status: ${d}`)}}X();ee();var ta=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}}};ee();yt();X();import{execSync as pb}from"child_process";import CE from"path";var ua=E.child({module:"shadow-trace"}),ln=class{intentLogs;exports;repoPath;hologramService;constructor(e){let{intentLogs:r,exports:i}=N.getInstance(e);this.intentLogs=r,this.exports=i,this.repoPath=e,this.hologramService=new Se(e)}analyzeGhostChanges(e){let r=e?`${e}..HEAD`:"HEAD~1..HEAD",i=[];try{let o=pb(`git diff --name-only ${r}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
|
|
735
|
+
`).filter(s=>s.trim()!=="");if(o.length===0)return;ua.info({files:o.length,range:r},"Initiating Shadow Trace analysis...");for(let s of o){let a=CE.join(this.repoPath,s),l=pb(`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}),ua.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),ua.info("Shadow Trace complete.")}catch(t){ua.warn({err:t.message},"Shadow Trace failed: git diff error.")}}};ee();X();import{execSync as db}from"child_process";var Nn=E.child({module:"nano-repair"}),Ve=class{intentLogs;exports;missions;repoPath;constructor(e){let{intentLogs:r,exports:i,missions:t}=N.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};Nn.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}),Nn.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}),Nn.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&&Nn.info({repaired:r,failed:i},"Nano-Repair recovery complete"),{repaired:r,failed:i}}syncLifecycle(e={}){let r=e.enableContextPivot===!0,i=e.enableMergeSentinel===!0,t="HEAD";try{t=db("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,contextPivotEnabled:r,mergeSentinelEnabled:i}}if(!t)return{suspended:0,resumed:0,completed:0,contextPivotEnabled:r,mergeSentinelEnabled:i};let o=0,s=0;if(r){let c=this.missions.findActive();for(let l of c)l.git_branch&&l.git_branch!==t&&(this.missions.updateStatus(l.id,"suspended"),Nn.info({missionId:l.id,branch:l.git_branch,current:t},"Context Pivot: Suspended mission"),o++);s=this.missions.resumeByBranch(t)}let a=0;if(i){let c=[];try{c=db(`git branch --merged "${t}"`,{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).split(`
|
|
736
|
+
`).map(u=>u.trim().replace(/^\* /,"")).filter(u=>u&&u!==t)}catch{}if(c.length>0){let l=this.missions.findMergedMissions(t,c);for(let u of l)this.missions.updateStatus(u.id,"completed"),Nn.info({missionId:u.id,branch:u.git_branch},"Merge Sentinel: Auto-completed mission"),a++}}return(o>0||s>0||a>0)&&Nn.info({suspended:o,resumed:s,completed:a},"Git-Native Lifecycle Sync complete"),{suspended:o,resumed:s,completed:a,contextPivotEnabled:r,mergeSentinelEnabled:i}}};ee();X();var NE=E.child({module:"collision-service"}),pa=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=xe(this.repoPath);if(!e)return[];let{missions:r}=N.getInstance(this.repoPath),i=r.findActive(e)??[],t=new Set(i.map(l=>l.id)),o=(r.findActive()??[]).filter(l=>!t.has(l.id)),s=[],a=new Set;for(let l of o){let u=l.git_branch||"unknown",p=[e,u].sort().join("::");NE.info({branch:u,currentBranch:e,missionId:l.id},"Checking predictive collisions"),u!==e&&!a.has(p)&&(a.add(p),Xg(this.repoPath,e,u)&&s.push({branch:u,type:"file",description:`Background merge-tree detected a file-level conflict between '${e}' and '${u}'.`}))}let c=this.analyzeMissionOverlaps([...t]);for(let l of c)s.push({branch:e,mission_id:l.missionB.id,mission_name:l.missionB.name,type:"intent",description:`Logical conflict: Mission '${l.missionA.name}' overlaps with '${l.missionB.name}'.`,conflictingFiles:l.sharedFiles});return s}analyzeMissionOverlaps(e){let r=xe(this.repoPath);if(!r)return[];let{missions:i}=N.getInstance(this.repoPath),t=i.findActive(r)??[],o=e&&e.length>0?t.filter(a=>e.includes(a.id)):t,s=[];for(let a=0;a<o.length;a+=1){let c=o[a],l=new Set(i.getWorkingSet(c.id).map(u=>u.file_path));for(let u=a+1;u<o.length;u+=1){let p=o[u],d=i.getWorkingSet(p.id).map(f=>f.file_path),m=Array.from(new Set(d.filter(f=>l.has(f)))).sort();m.length!==0&&s.push({missionA:{id:c.id,name:c.name},missionB:{id:p.id,name:p.name},sharedFiles:m})}}return s}};ee();var pm=new Set(["planned","in-progress","verifying","suspended"]),An=class{constructor(e){this.repoPath=e}buildPlanForParent(e){let{missions:r,claims:i}=N.getInstance(this.repoPath);if(!r.findById(e))throw new Error(`Mission ${e} not found`);let s=r.findByParentId(e).filter(d=>pm.has(d.status)).map(d=>{let m=r.getWorkingSet(d.id).map(f=>f.file_path);return{id:d.id,name:d.name,status:d.status,files:m}}),a=this.computeOverlapMatrix(s),c=this.colorIntoWaves(s,a),l=new Set(s.map(d=>d.id)),u=Array.from(new Set(s.flatMap(d=>d.files))),p=i.getClaimsByFiles(u).filter(d=>!l.has(d.mission_id)).map(d=>({file_path:d.file_path,mission_id:d.mission_id,mission_name:d.mission_name,mission_status:d.mission_status,mission_branch:d.mission_branch}));return this.composePlan(s,a,p,e)}buildPlanForMissions(e,r={}){let{includeClaimCheck:i=!0}=r,{missions:t,claims:o}=N.getInstance(this.repoPath),a=t.findByIds(e).filter(u=>pm.has(u.status)).map(u=>({id:u.id,name:u.name,status:u.status,files:t.getWorkingSet(u.id).map(p=>p.file_path)})),c=this.computeOverlapMatrix(a),l=i?this.computeExternalClaims(a,o.getClaimsByFiles(Array.from(new Set(a.flatMap(u=>u.files))))):[];return this.composePlan(a,c,l)}toHandlerPayload(e){let r=new Map(e.child_missions.map(u=>[u.id,u])),i=e.waves.map(u=>({waveIndex:u.wave,missions:u.missions.map(p=>{let d=r.get(p);return{id:p,name:d?.name??`Mission ${p}`,workingSetSize:d?.file_count??0}})})),t=e.overlap_matrix.map(u=>({missionA:u.mission_a,missionB:u.mission_b,sharedFiles:u.shared_files})),o=e.external_claims.map(u=>({filePath:u.file_path,claimedByMissionId:u.mission_id,claimedByMissionName:u.mission_name,claimedByMissionStatus:u.mission_status,claimedByMissionBranch:u.mission_branch})),s=e.child_missions.length,a=i.length,c=i[0]?.missions.length??0,l=`${s} missions in ${a} waves, ${c} parallelizable in wave 1`;return{waves:i,overlapMatrix:t,externalClaims:o,summary:l}}groupMissionsForParallelism(e){let{missions:r}=N.getInstance(this.repoPath),t=r.findByIds(e).filter(s=>pm.has(s.status)).map(s=>({id:s.id,name:s.name,status:s.status,files:r.getWorkingSet(s.id).map(a=>a.file_path)})),o=this.computeOverlapMatrix(t);return this.colorIntoWaves(t,o)}composePlan(e,r,i,t){let o=this.colorIntoWaves(e,r);return{...t!==void 0?{parent_mission_id:t}:{},mission_ids:e.map(s=>s.id),child_missions:e.map(s=>({id:s.id,name:s.name,status:s.status,file_count:s.files.length})),waves:o,overlap_matrix:r,external_claims:i}}computeExternalClaims(e,r){let i=new Set(e.map(t=>t.id));return r.filter(t=>!i.has(t.mission_id)).map(t=>({file_path:t.file_path,mission_id:t.mission_id,mission_name:t.mission_name,mission_status:t.mission_status,mission_branch:t.mission_branch}))}computeOverlapMatrix(e){let r=[];for(let i=0;i<e.length;i+=1){let t=e[i],o=new Set(t.files);for(let s=i+1;s<e.length;s+=1){let a=e[s],c=a.files.filter(l=>o.has(l));c.length!==0&&r.push({mission_a:t.id,mission_b:a.id,shared_files:Array.from(new Set(c)).sort()})}}return r}colorIntoWaves(e,r){if(e.length===0)return[];let i=new Map;for(let a of e)i.set(a.id,new Set);for(let a of r)i.get(a.mission_a)?.add(a.mission_b),i.get(a.mission_b)?.add(a.mission_a);let t=[...e].sort((a,c)=>{let l=(i.get(c.id)?.size??0)-(i.get(a.id)?.size??0);return l!==0?l:a.id-c.id}),o=new Map;for(let a of t){let c=new Set;for(let u of i.get(a.id)??[]){let p=o.get(u);p!==void 0&&c.add(p)}let l=1;for(;c.has(l);)l+=1;o.set(a.id,l)}let s=new Map;for(let[a,c]of o.entries()){let l=s.get(c)??[];l.push(a),s.set(c,l)}return[...s.entries()].sort((a,c)=>a[0]-c[0]).map(([a,c])=>({wave:a,missions:c.sort((l,u)=>l-u)}))}};Ft();Pn();import{spawn as AE}from"node:child_process";import dm from"node:os";import{resolve as zE}from"node:path";import{existsSync as mb}from"node:fs";import{fileURLToPath as DE}from"node:url";import{dirname as LE}from"node:path";var fb=DE(import.meta.url),OE=LE(fb),ME=dm.constants.priority.PRIORITY_LOWEST??dm.constants.priority.PRIORITY_LOW;function jE(){if(fb.endsWith(".ts"))return null;let n=zE(OE,"../../entry/ember/index.js");if(mb(n))return n;let e=et("dist/entry/ember/index.js");return mb(e)?e:null}function hb(n){try{let r=Ae(n).prepare("SELECT key, value FROM ember_state WHERE key IN ('status','progress','pid')").all(),i=new Map(r.map(t=>[t.key,t.value??""]));return{status:i.get("status")??"idle",progress:i.get("progress")??"0/0",pid:i.get("pid")??null}}catch{return{status:"idle",progress:"0/0",pid:null}}}function FE(n,e){let r=Ae(n);r.transaction(()=>{let i=r.prepare("INSERT OR REPLACE INTO ember_state (key, value, updated_at) VALUES (?, ?, unixepoch())");i.run("pid",String(e)),i.run("status","running"),i.run("repo_path",n)})()}function gb(n){let{pid:e}=hb(n);if(!e)return!1;let r=parseInt(e,10);if(!Number.isFinite(r)||r<=0)return!1;try{return process.kill(r,0),!0}catch{return!1}}function yb(n){let e=jE();if(!e)return;let r=AE(process.execPath,[e,n],{detached:!0,stdio:"ignore",env:{...process.env,EMBER_MODE:"1"}});if(r.pid!=null){try{dm.setPriority(r.pid,ME)}catch{}r.unref(),FE(n,r.pid)}}function wr(n){let{status:e,progress:r}=hb(n);return{status:e,progress:r}}var da=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}=N.getInstance(this.repoPath),d=Qe(this.repoPath),m=xe(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,claims:o}=N.getInstance(r),{altitude:s,activeMissionsLimit:a,recentActivityLimit:c,compact:l,currentBranch:u,currentCommit:p}=e,d=i.findActive(u||void 0),m=d.length;a&&d.length>a&&(d=d.slice(0,a));let f=i.findParentOnlyIds(d),g=new Set(f),$=d.filter(_=>!g.has(_.id)),v=new ta(t).score($),b=.15,S=3,w=l&&v.length>S?v.filter((_,x)=>x<S||_.score>=b):v,T=w.map(_=>_.mission),z=new Map(w.map(_=>[_.mission.id,_.score])),D=new Set(d.map(_=>_.id)),C=o.listClaims().filter(_=>D.has(_.mission_id)).map(_=>({file_path:_.file_path,mission_id:_.mission_id,mission_name:_.mission_name,mission_status:_.mission_status,mission_branch:_.mission_branch,claimed_at:_.claimed_at,updated_at:_.updated_at})),I=new An(r).groupMissionsForParallelism(d.map(_=>_.id)),A=I.length,M=new Map;for(let _ of C)M.set(_.mission_id,(M.get(_.mission_id)??0)+1);let H=_=>({id:_.id,name:_.name,goal:_.goal,status:_.status,relevance:z.get(_.id),claimedFileCount:M.get(_.id)??0}),Y=_=>({..._,claimedFileCount:M.get(_.id)??0});if(s==="orbit")return{scope:"project",altitude:"orbit",counts:i.getStats(),next_work_candidates:T.map(H),parallel_wave_count:A,claims_count:C.length,meta:{current_branch:u,activeMissionsTotal:m,ember:this.getEmberLabel(r)}};let O={},q=[];for(let _ of d)_.parent_id!=null?(O[_.parent_id]||(O[_.parent_id]=[]),O[_.parent_id].push(_)):q.push(_);let L=i.findRecentCompleted(5).map(H),G=c>0?t.findRecentDecisionActivity(c):void 0,re=f.map(_=>{let x=d.find(P=>P.id===_);return{parent:l?{...Y(x),strategy_graph:void 0,verification_context:void 0}:Y(x),children:(O[_]??[]).map(Y)}}),J=q.filter(_=>!g.has(_.id)).map(Y);return{scope:"project",altitude:s||"atmosphere",counts:i.getStats(),analytics:i.getAnalytics(),hierarchy:re.length>0?re:void 0,standalone_active:J.length>0?J:void 0,active_missions:re.length===0?l?d.map(_=>({...Y(_),strategy_graph:void 0})):d.map(Y):void 0,claims:C,parallel_groups:I,next_work_candidates:T.map(H),recent_completed:L,recent_activity:G,meta:{current_branch:u,current_commit:p,activeMissionsTotal:m,active_limit_applied:!!a,relevance_filtered:w.length<v.length?{shown:w.length,total:v.length}:void 0,ember:this.getEmberLabel(r)}}}getEmberLabel(e){try{let{status:r,progress:i}=wr(e);if(r==="idle")return;if(r==="done")return"symbols: fully embedded";let[t,o]=i.split("/").map(Number),s=o>0?Math.round(t/o*100):0;return r==="running"?`symbols: warming ${i} (${s}%)`:`symbols: ${r} ${i}`}catch{return}}async getMissionBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t,claims:o}=N.getInstance(r),{missionId:s,altitude:a,recentActivityLimit:c,currentBranch:l,currentCommit:u}=e,p;if(s?p=i.findById(s):p=i.findActive(l||void 0)[0],!p)return null;let d=null;try{p.strategy_graph&&(d=JSON.parse(p.strategy_graph))}catch{}if(a==="orbit")return{altitude:"orbit",mission:{id:p.id,name:p.name,goal:p.goal,status:p.status,last_updated:new Date(p.updated_at*1e3).toISOString()},strategy_snapshot:d};let m="No external shadow changes detected.";try{new ln(r).analyzeGhostChanges(p.commit_sha||void 0),m="Shadow Trace completed: Checked for external modifications."}catch{}let f={repaired:0,failed:0};try{f=new Ve(r).detectAndRepairShifts()}catch{}let g=i.getHandoffs(p.id).map(y=>{let v=null;try{v=JSON.parse(y.metadata??"")}catch{}return{artifactId:y.id,kind:y.identifier,confidence:v?.confidence??null,findingsCount:v?.findings?.length??0,risksCount:v?.risks?.length??0,missionsCreated:v?.missionsCreated??[],createdAt:y.created_at}}),$={altitude:a||"atmosphere",mission:{id:p.id,name:p.name,goal:p.goal,status:p.status,last_updated:new Date(p.updated_at*1e3).toISOString(),git_branch:p.git_branch,commit_sha:p.commit_sha,outcome_contract:p.outcome_contract},artifacts:i.getArtifacts(p.id),handoffs:g,shadow_trace:{ghost_analysis:m,symbols_repaired:f.repaired,symbols_missing:f.failed},context:{current_commit:u,working_set:i.getWorkingSet(p.id).map(y=>y.file_path)},claims:o.getClaimsForMission(p.id),parallel_groups:new An(r).groupMissionsForParallelism(i.findActive(l||void 0).map(y=>y.id)),strategy_snapshot:d,recent_activity:a==="ground"?t.findByMission(p.id,c||20):t.findByMissionPreferCrystal(p.id,15),ancestor_activity_summary:[],predictive_collisions:[]};try{let y=new pa(r);$.predictive_collisions=await y.analyzePotentialCollisions()}catch{}if(p.parent_id){let y=a==="ground"?t.findByMission(p.parent_id,5):t.findByMissionPreferCrystal(p.parent_id,3);$.ancestor_activity_summary=y.map(v=>({type:v.type,content:v.content,date:new Date(v.created_at*1e3).toISOString()}))}return $}};var bb=E.child({module:"mcp:tools:ops:briefing"});async function ma(n){let{repoPath:e,scope:r="mission"}=n;bb.info({repoPath:e,missionId:n.missionId,scope:r},"Generating briefing");try{let t=await new da(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 bb.error({error:i,repoPath:e},"Failed to generate briefing"),new Error(`Failed to generate briefing: ${i instanceof Error?i.message:String(i)}`)}}ee();X();var _b=E.child({module:"mcp:tools:ops:synthesize"});async function vb(n){let{repoPath:e,missionId:r}=n;_b.info({repoPath:e,missionId:r},"Synthesizing mission");let{missions:i}=N.getInstance(e);try{if(!i.findById(r))throw new Error(`Mission ${r} not found`);let s=await new Wt(e).distillMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,adr:s.adr,metrics:s.metrics},null,2)}]}}catch(t){throw _b.error({error:t,repoPath:e},"Failed to synthesize ADR"),new Error(`Failed to synthesize ADR: ${t instanceof Error?t.message:String(t)}`)}}X();ee();X();var UE=E.child({module:"narrative-service"}),Er=class{missions;briefingEngine;repoPath;constructor(e){this.repoPath=e;let{missions:r}=N.getInstance(e);this.missions=r,this.briefingEngine=new Wt(e)}async generateChronicle(e={}){UE.info(e,"Generating Repo Chronicle...");let i=this.missions.findAll().filter(l=>l.parent_id===null&&l.status!=="planned");e.branch&&(i=i.filter(l=>!l.git_branch||l.git_branch===e.branch)),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 g of u)m.push(await this.mapMissionToEpisode(g));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
|
|
684
737
|
|
|
685
738
|
`;if(r+=`*Generated at ${new Date(e.generated_at).toISOString()}*
|
|
686
739
|
|
|
@@ -691,7 +744,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
691
744
|
`,r+=`${i.adr_summary}
|
|
692
745
|
|
|
693
746
|
`),r+=`---
|
|
694
|
-
`;return r}};var
|
|
747
|
+
`;return r}};var xb=E.child({module:"mcp:tools:ops:chronicle"});async function Sb(n){let{repoPath:e,format:r="markdown",...i}=n,t=new Er(e);xb.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 xb.error({error:o,repoPath:e},"Failed to generate chronicle"),new Error(`Failed to generate chronicle: ${o instanceof Error?o.message:String(o)}`)}}yt();Ft();ee();import WE from"path";var ZE=50,HE=50,BE=20;function GE(n,e){let r=Cs(n,5e3),i=r.indexOf(e),t=i>=0?r.slice(0,i):r;if(t.length===0)return[];let o=new Set(t),{missions:s}=N.getInstance(n);return s.findAll().filter(a=>!!a.commit_sha&&o.has(a.commit_sha)).sort((a,c)=>c.updated_at-a.updated_at).slice(0,BE).map(a=>({id:a.id,name:a.name,status:a.status,git_branch:a.git_branch,commit_sha:a.commit_sha}))}function JE(n,e){if(e.length===0)return[];let r=e.map(a=>WE.resolve(n,a)),i=Array.from(new Set([...e,...r])),{exports:t}=N.getInstance(n),o=t.findByFiles(i);return Array.from(new Set(o.map(a=>a.name))).slice(0,HE)}async function $b(n){let{repoPath:e,compact:r=!0,branch:i,includeSessionDelta:t=!1,sinceCommit:o}=n,a=new Se(e).getSnapshot();r&&a.gravity?.hotspots&&(a={...a,gravity:{...a.gravity,hotspots:a.gravity.hotspots.slice(0,10),_truncated:a.gravity.hotspots.length>10,_totalHotspots:a.gravity.hotspots.length}});let c=new Er(e),l=xe(e)||void 0,u=Qe(e),p=i||l,m={...await c.generateChronicle({limit:5,compact:r,branch:p}),initiatives:[],unattached_episodes:[]},g=(await ma({repoPath:e,scope:"project",altitude:r?"orbit":"atmosphere",compact:r,activeMissionsLimit:r?10:void 0,recentActivityLimit:r?5:10})).content?.[0],$=g&&g.type==="text"?g.text:"{}",y={};try{y=JSON.parse($)}catch{}let v={counts:y.counts,next_work_candidates:y.next_work_candidates??[],active_count:Array.isArray(y.active_missions)?y.active_missions.length:0,coordination:{claims_count:Array.isArray(y.claims)?y.claims.length:0,parallel_group_count:Array.isArray(y.parallel_groups)?y.parallel_groups.length:0}},b={hologram:a,chronicle:m,briefing:v,coordination:{activeClaims:v.coordination.claims_count,parallelWaves:v.coordination.parallel_group_count}};if(t){let S=o||Ms(e),w=o?"request":"index_metadata",T=S?Array.from(ey(e,S)).sort():[],z=S?JE(e,T):[],D=S?GE(e,S):[];b.session_delta={baseline_commit:S||null,current_commit:u,changed_files:{count:T.length,sample:T.slice(0,ZE)},changed_symbols:{count:z.length,sample:z},changed_missions:{count:D.length,sample:D}},b.meta={drift_diagnostics:{branch_scope:p||null,baseline_source:w,baseline_commit:S||null,current_commit:u,session_delta_enabled:!0,session_delta_available:!!S}}}return{content:[{type:"text",text:JSON.stringify(b,null,2)}],suggestedNext:{tool:v.next_work_candidates.length>0?"shadow_ops_track":"shadow_ops_plan",reason:v.next_work_candidates.length>0?"Pick one from next_work_candidates and run /continue":"No open work; create a mission"}}}X();Ft();var mm=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}},un=new mm;function wb(){un.recordIndexStart()}function fm(){un.recordIndexCacheHit()}function Eb(n){un.recordIndexEnd(n)}function Ri(n,e){un.recordIndexPhase(n,e)}function kb(){un.clearIndexPhases()}function kr(){return un.recordQueryStart()}function Zt(){un.recordSearchHistoryFailure()}function Ib(){return un.getSnapshot()}import hm from"path";var Tb=E.child({module:"mcp:tools:ops:health"});async function Rb(n){let e=n.repoPath,r=hm.isAbsolute(e)?hm.normalize(e):hm.resolve(process.cwd(),e);Tb.info({repoPath:r},"Health check");let i=!1,t=!1;try{Ae(r),i=!0,t=Et(r)}catch(l){Tb.debug({repoPath:r,error:l},"Health: DB check failed")}let o=Ib(),s;if(i)try{let l=wr(r);if(l.status!=="idle"){let[u,p]=l.progress.split("/").map(Number),d=p>0?Math.round(u/p*100):0,m=l.status==="done"?"symbols: fully embedded":l.status==="running"?`symbols: warming ${l.progress} (${d}%)`:`symbols: ${l.status} ${l.progress}`;s={...l,label:m}}}catch{}let a={status:i?t?"ready":"index_pending":"db_unavailable",database:i,indexed:t,...s?{ember:s}:{},metrics:{index:o.index,query:o.query,uptimeMs:o.uptimeMs}},c=t?{tool:"shadow_recon_hologram",reason:"Architecture overview"}:{tool:"shadow_recon_onboard",reason:"Index the repo first"};return{content:[{type:"text",text:JSON.stringify(a,null,2)}],suggestedNext:c}}ee();X();import Pb from"node:path";var Ir=E.child({module:"mcp:tools:ops:log"}),VE=["in-progress","verifying"];function qE(n){for(let e of VE){let r=n.find(i=>i.status===e);if(r)return r.id}return n[0]?.id??null}function KE(n,e){return e?Pb.isAbsolute(e)?e:Pb.join(n,e):null}async function Cb(n){let{repoPath:e,missionId:r,type:i,content:t,filePath:o,symbolName:s,standalone:a}=n;Ir.info({repoPath:e,type:i,symbolName:s,standalone:a},"Logging intent");let{missions:c,exports:l,intentLogs:u}=N.getInstance(e),p=KE(e,o);try{let d=r??null,m=xe(e)||void 0;if(a)d=null,Ir.debug("Standalone intent requested; mission auto-resolution skipped");else if(d){if(!c.findById(d))throw new Error(`Mission ${d} not found. Use shadow_ops_briefing to see available missions.`)}else{let b=c.findActive(m);b.length>0?(d=qE(b),Ir.debug({missionId:d,currentBranch:m},"Auto-resolved to active mission on current branch")):(d=null,Ir.debug({currentBranch:m},"No active mission found on current branch; logging as system/unlinked intent"))}let f=null,g=null,$=s||null,y=p;if(s){let S=(p?l.findByNameAndFile(s,p):l.findByName(s))[0];S?(f=S.id,g=S.signature,$=S.name,y=S.file_path||y):Ir.warn({symbolName:s,filePath:p??o},"Symbol not found for intent linking")}let v=u.create({mission_id:d,symbol_id:f,file_path:y,type:i,content:t,confidence:1,symbol_name:$,signature:g,commit_sha:null});return d&&y&&c.addToWorkingSet(d,y,f?"symbol":"intent"),{content:[{type:"text",text:JSON.stringify({logId:v,missionId:d,symbolId:f,status:"logged",message:f?`Intent linked to symbol "${s}"`:"Intent logged (unlinked)"},null,2)}]}}catch(d){throw Ir.error({error:d,repoPath:e},"Failed to log intent"),new Error(`Failed to log intent: ${d instanceof Error?d.message:String(d)}`)}}X();var Db=E.child({module:"mcp:tools:ops:graph"});async function Lb(n){let{repoPath:e,missionId:r,depth:i,limit:t,format:o="mermaid"}=n;Db.info({repoPath:e,missionId:r,format:o},"Generating mission graph");try{let{GraphExporterService:s}=await Promise.resolve().then(()=>(zb(),Ab));return{content:[{type:"text",text:await new s(e).generateGraph({includeCompleted:!0,format:o,focusMissionId:r,depth:i,limit:t})}]}}catch(s){throw Db.error({error:s,repoPath:e},"Failed to generate mission graph"),new Error(`Failed to generate mission graph: ${s.message}`)}}ee();X();var Ob=E.child({module:"mcp:tools:ops:crystallize"});async function Mb(n){let{repoPath:e,missionId:r,symbolId:i}=n;Ob.info({repoPath:e,missionId:r,symbolId:i},"Crystallizing logs");let{intentLogs:t,missions:o,exports:s}=N.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 g=t.findCrystalByMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,status:g?"already_crystallized":"no_logs",message:g?"Mission already has a crystal with no new raw logs to absorb.":"No raw intent logs found for this mission.",crystalId:g?.id??null},null,2)}]}}let u=new Ut().analyze(c),p=new Set(c.map(g=>g.symbol_name).filter(Boolean)),d=new Set(c.map(g=>g.type)),m=`[Crystal] Mission #${r}: ${a.name}
|
|
695
748
|
`;m+=`Compressed ${c.length} logs across ${p.size} symbols.
|
|
696
749
|
`,m+=`Types: ${[...d].join(", ")}
|
|
697
750
|
|
|
@@ -699,13 +752,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
699
752
|
`),u.context.length>0&&(m+=`Context: ${u.context.join(" | ")}
|
|
700
753
|
`),u.consequences.length>0&&(m+=`Consequences: ${u.consequences.join(" | ")}
|
|
701
754
|
`),u.recommendations.length>0&&(m+=`Recommendations: ${u.recommendations.join(" | ")}
|
|
702
|
-
`);let f=t.crystallize(r,m.trim());return
|
|
755
|
+
`);let f=t.crystallize(r,m.trim());return Ob.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 Ut().analyze(l),d=new Set(l.map(g=>g.type)),m=`[Crystal] Symbol #${i}: ${a?.name||"Unknown"}
|
|
703
756
|
`;m+=`Compressed ${l.length} standalone insights.
|
|
704
757
|
`,m+=`Types: ${[...d].join(", ")}
|
|
705
758
|
|
|
706
759
|
`,p.decisions.length>0&&(m+=`Decisions: ${p.decisions.join(" | ")}
|
|
707
760
|
`),p.context.length>0&&(m+=`Context: ${p.context.join(" | ")}
|
|
708
|
-
`);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.")}ee();var
|
|
761
|
+
`);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.")}ee();var fa=class{constructor(e){this.repoPath=e}async crystallizeByTheme(e,r){let{generateEmbedding:i}=await Promise.resolve().then(()=>(Je(),kt)),t=await i(e);if(!t)throw new Error("Embedding generation failed \u2014 cannot perform thematic crystallization");let{intentLogs:o}=N.getInstance(this.repoPath),s=await o.findSemanticTheme(t,r?.missionIds,r?.limit??200);if(s.length<2)throw new Error("Fewer than 2 logs matched theme \u2014 threshold too high or theme too narrow");let c=new Ut().analyze(s),l=new Set(s.map(m=>m.type)),u=c.sourceMissions.length,p=`[Crystal:Theme] ${e}
|
|
709
762
|
`;return p+=`Matched ${s.length} logs across ${u} mission${u!==1?"s":""}.
|
|
710
763
|
`,p+=`Types: ${[...l].join(", ")}
|
|
711
764
|
|
|
@@ -713,9 +766,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
713
766
|
`),c.context.length>0&&(p+=`Context: ${c.context.join(" | ")}
|
|
714
767
|
`),c.consequences.length>0&&(p+=`Consequences: ${c.consequences.join(" | ")}
|
|
715
768
|
`),c.recommendations.length>0&&(p+=`Recommendations: ${c.recommendations.join(" | ")}
|
|
716
|
-
`),p=p.trim(),{crystalId:o.crystallizeTheme(e,s.map(m=>m.id),p),absorbed:s.length,sourceMissions:c.sourceMissions,summary:p}}};async function
|
|
717
|
-
`),r=[],i=0;for(let t of e)r.push(i),i+=t.length+1;return r}function
|
|
718
|
-
`)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function ra(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 yi(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 Xe(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 Eb(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 kE(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 kb(n,e,r,i,t,o,s,a,c){let l=c??(p=>na(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(x=>x.id.value).join("",""):f=d.id?.value||d.identifier?.value||"anonymous";let h=l(p.span.start-e),v=l(p.span.end-e),y=bt(h,o,i),b=a(p.span),_=[];if(p.type==="ExportDeclaration"&&(m==="ClassDeclaration"||m==="ClassExpression")){let x=d.body||[];for(let E of x)if(E.type==="ClassMethod"||E.type==="ClassProperty"){let I=E.key.value;if(!I)continue;let N=l(E.span.start-e),L=l(E.span.end-e),C=a(E.span),$=bt(N,o,i);_.push({name:I,kind:E.type,signature:Xe(C,E.type),line:de(N,t),endLine:de(L,t),doc:$,classification:E.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(m==="FunctionDeclaration"&&d.body?.type==="BlockStatement")_=em(d.body.stmts,e,r,i,t,o,a,l);else if(m==="VariableDeclaration"){for(let x of d.declarations)if(x.init&&(x.init.type==="ArrowFunctionExpression"||x.init.type==="FunctionExpression")&&x.init.body?.type==="BlockStatement"){_=em(x.init.body.stmts,e,r,i,t,o,a,l);break}}u.push({name:f,kind:m,signature:Xe(b,m),line:de(h,t),endLine:de(v,t),doc:y,classification:ra(s,f,m),capabilities:JSON.stringify(yi(b)),members:_})}if(p.type==="ExportNamedDeclaration"){for(let d of p.specifiers)if(d.type==="ExportSpecifier"){let m=d.orig.value,f=d.exported?.value||m,v=kE(n,m)||p.span,y=l(v.start-e),b=l(v.end-e),_=bt(y,o,i);u.push({name:f,kind:"ExportSpecifier",signature:`export { ${m} }`,line:de(y,t),endLine:de(b,t),doc:_,classification:"Export mapping",capabilities:"[]"})}}if(p.type==="ExportDefaultDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=bt(d,o,i),h=a(p.span),v=[];if(p.decl.type==="ClassExpression"||p.decl.type==="ClassDeclaration"){let y=p.decl.body||[];for(let b of y)if(b.type==="ClassMethod"||b.type==="ClassProperty"){let _=b.key.value;if(!_)continue;let x=l(b.span.start-e),E=l(b.span.end-e),I=a(b.span),N=bt(x,o,i);v.push({name:_,kind:b.type,signature:Xe(I,b.type),line:de(x,t),endLine:de(E,t),doc:N,classification:b.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(p.decl.type==="FunctionExpression"||p.decl.type==="FunctionDeclaration"||p.decl.type==="ArrowFunctionExpression")&&p.decl.body?.type==="BlockStatement"&&(v=em(p.decl.body.stmts,e,r,i,t,o,a,l));u.push({name:"default",kind:"DefaultExport",signature:Xe(h,"DefaultExport"),line:de(d,t),endLine:de(m,t),doc:f,classification:"Default Export",capabilities:JSON.stringify(yi(h)),members:v})}if(p.type==="ExportAllDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=p.source.value,h=bt(d,o,i);u.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${f}"`,line:de(d,t),endLine:de(m,t),doc:h,classification:"Re-export",capabilities:"[]"})}}return u}function em(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=f=>{if(f.type==="Identifier")p.push({name:f.value,span:f.span});else if(f.type==="ArrayPattern")for(let h of f.elements)h&&d(h);else if(f.type==="ObjectPattern")for(let h of f.properties)h.type==="AssignmentPatternProperty"?p.push({name:h.key.value,span:h.span}):h.type==="KeyValuePatternProperty"&&d(h.value)};d(u.id);let m=u.init&&(u.init.type==="ArrowFunctionExpression"||u.init.type==="FunctionExpression");for(let f of p){let h=m?u.init.span||u.span||f.span:u.span||f.span,v=m?u.init.type:"VariableDeclaration",y=m?"Internal Function":"Internal Variable",b=a(h.start-e),_=a(h.end-e),x=s(h),E=bt(b,o,i);c.push({name:f.name,kind:v,signature:Xe(x,v),line:de(b,t),endLine:de(_,t),doc:E,classification:y,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=bt(p,o,i);c.push({name:u,kind:"FunctionDeclaration",signature:Xe(m,"FunctionDeclaration"),line:de(p,t),endLine:de(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),v=bt(m,o,i);c.push({name:p,kind:"ReturnProperty",signature:Xe(h,"ReturnProperty"),line:de(m,t),endLine:de(f,t),doc:v,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:Xe(h,d.type),line:de(m,t),endLine:de(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:Xe(h,"HTTP Route"),line:de(m,t),endLine:de(f,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:d})})}}}}return c}function Ib(n,e,r,i,t,o){let s=o??(l=>na(l,r)),a=[];function c(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let u=IE(l);if(u){let p=s(l.span.start-e);a.push({...u,line:de(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 IE(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 bi(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 v=h.find(b=>b.kind==="FunctionDeclaration"||b.kind==="ClassDeclaration")?.name,y=v?`React component: ${v}`:"React UI component";return f?`${y} with ${f}`:y},Hook:(f,h)=>{let v=h.find(b=>b.name.startsWith("use"))?.name,y=v?`Custom React hook: ${v}`:"Custom React hook";return f?`${y} for ${f}`:y},Service:(f,h)=>{let y=`Service layer: ${h[0]?.name||"Service"}`;return f?`${y} handling ${f}`:y},Repository:(f,h)=>`Data repository: ${h[0]?.name||"Repository"} for ${f||"data access"}`,"Type Definition":(f,h)=>`Type definitions: ${h.slice(0,3).map(y=>y.name).join("")}${h.length>3?"...":""}`,Model:(f,h)=>`Data model: ${h[0]?.name||"Model"}`,"HTTP Route":(f,h)=>{let v=h.filter(y=>y.classification==="Service Boundary");return v.length>0?`API endpoints: ${v.slice(0,3).map(y=>y.name).join("")}`:"API route handler"},"Micro IR (PHP)":(f,h)=>{let v=h.some(b=>b.classification==="Service Boundary"),y=h.find(b=>b.kind==="ClassDeclaration")?.name;return v?"PHP controller with API routes":y?`PHP class: ${y}`:"PHP module"},"Micro IR (Python)":(f,h)=>{let v=h.some(b=>b.classification==="Service Boundary"),y=h.find(b=>b.kind==="ClassDeclaration")?.name;return v?"Python API handler with routes":y?`Python class: ${y}`:"Python module"},"Micro IR (Go/TS) ":(f,h)=>{let v=h.some(b=>b.kind==="TypeDeclaration"),y=h.filter(b=>b.kind==="FunctionDeclaration");return v&&y.length>0?`Go package: types and ${y.length} function(s)`:v?"Go package: type definitions":y.length>0?`Go package: ${y[0].name} and ${y.length} function(s)`:"Go module"},"Micro IR (Rust/TS) ":(f,h)=>{let v=h.find(_=>_.kind==="TraitDeclaration")?.name,y=h.find(_=>_.kind==="StructDeclaration")?.name,b=h.filter(_=>_.kind==="FunctionDeclaration");return v?f.includes("Rust trait")?`Rust module: trait ${v}`:`Rust module: ${v}`:y?`Rust module: struct ${y}`:b.length>0?`Rust module: ${b.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 Tb(n){let e=new Set;function r(i){if(!(!i||typeof i!="object")){i.typeAnnotation&&ve(i.typeAnnotation,e),(i.type==="TsTypeReference"||i.type==="TsTypeAnnotation")&&ve(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 ve(n,e){if(n){if(n.type==="TsTypeAnnotation"){ve(n.typeAnnotation,e);return}n.type==="TsTypeReference"&&(n.typeName?.type==="Identifier"&&e.add(n.typeName.value),n.typeName?.type==="TsQualifiedName"&&Rb(n.typeName,e),n.typeParams&&ve(n.typeParams,e)),n.type==="TsArrayType"&&ve(n.elementType,e),n.type==="TsUnionType"&&n.types?.forEach(r=>ve(r,e)),n.type==="TsIntersectionType"&&n.types?.forEach(r=>ve(r,e)),n.type==="TsTupleType"&&n.elemTypes?.forEach(r=>ve(r.ty,e)),(n.type==="TsFunctionType"||n.type==="TsConstructorType")&&(n.params?.forEach(r=>ve(r.typeAnnotation,e)),n.typeAnnotation&&ve(n.typeAnnotation,e)),n.type==="TsTypeParameterDeclaration"&&n.params?.forEach(r=>{r.constraint&&ve(r.constraint,e),r.default&&ve(r.default,e)}),n.type==="TsTypeParameterInstantiation"&&n.params?.forEach(r=>ve(r,e)),n.type==="TsMappedType"&&n.typeAnnotation&&ve(n.typeAnnotation,e),n.type==="TsIndexedAccessType"&&(ve(n.objectType,e),ve(n.indexType,e)),n.type==="TsConditionalType"&&(ve(n.checkType,e),ve(n.extendsType,e),ve(n.trueType,e),ve(n.falseType,e)),n.type==="TsTypeLiteral"&&n.members?.forEach(r=>{r.typeAnnotation&&ve(r.typeAnnotation,e)})}}function Rb(n,e){n.type==="TsQualifiedName"?(n.left&&Rb(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import Lb from"path";import tm from"path";Q();gn();import Nb from"path";import TE from"fs";import{fileURLToPath as RE}from"url";import*as vn from"web-tree-sitter";var KA=Nb.dirname(RE(import.meta.url)),Pb=S.child({module:"parser:tree-sitter"}),ia=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=vn.Parser||vn;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=Be("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!TE.existsSync(r))return Pb.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await vn.Language.load(r);return this.languages.set(e,i),i}catch(i){return Pb.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`
|
|
769
|
+
`),p=p.trim(),{crystalId:o.crystallizeTheme(e,s.map(m=>m.id),p),absorbed:s.length,sourceMissions:c.sourceMissions,summary:p}}};async function jb(n){let{repoPath:e,theme:r,missionIds:i,limit:t}=n;if(!r||typeof r!="string"||r.trim().length===0)return{isError:!0,content:[{type:"text",text:"theme must be a non-empty string"}]};try{let o=new fa(e),{crystalId:s,absorbed:a,sourceMissions:c,summary:l}=await o.crystallizeByTheme(r.trim(),{missionIds:i,limit:t});return{content:[{type:"text",text:JSON.stringify({crystalId:s,absorbed:a,sourceMissions:c,summary:l,theme:r.trim()},null,2)}]}}catch(o){return{isError:!0,content:[{type:"text",text:o.message}]}}}ee();var YE=["recon_report","risk_assessment","impact_map","debt_scan","custom"];async function Fb(n){let{repoPath:e,missionId:r,kind:i,findings:t,risks:o=[],missionsCreated:s=[],gaps:a=[],confidence:c,agentTag:l}=n;if(!Array.isArray(t)||t.length===0)throw new Error("findings must be a non-empty array");let u=YE.includes(i)?i:"custom",p=c!=null&&c>=0&&c<=1?c:.5,d={kind:u,findings:t.map(g=>({statement:g.statement,confidence:g.confidence,refs:g.refs})),risks:o.map(g=>({severity:g.severity,description:g.description,refs:g.refs})),missionsCreated:s,gaps:a,confidence:p,...l?{agentTag:l}:{}},{missions:m}=N.getInstance(e),f=m.addHandoff(r??null,d);return{content:[{type:"text",text:JSON.stringify({artifactId:f,missionId:r??null,kind:u,findingsCount:t.length,risksCount:o.length,missionsCreated:s,confidence:p},null,2)}]}}ee();async function Ub(n){let{repoPath:e,missionId:r,kind:i,query:t,limit:o}=n,{missions:s}=N.getInstance(e),a;if(t)try{let{generateEmbedding:l}=await Promise.resolve().then(()=>(Je(),kt)),u=await l(t);u?a=await s.findSemanticHandoffs(u,o??5):a=s.getHandoffs(r,i,o??20)}catch{a=s.getHandoffs(r,i,o??20)}else a=s.getHandoffs(r,i,o??20);let c=a.map(l=>{let u=null;try{u=JSON.parse(l.metadata??"")}catch{}return{artifactId:l.id,missionId:l.mission_id===0?null:l.mission_id,kind:l.identifier,createdAt:l.created_at,payload:u,similarity:l.similarity??null}});return{content:[{type:"text",text:JSON.stringify({handoffs:c,total:c.length},null,2)}]}}ee();X();import Wb from"node:path";var Zb=E.child({module:"mcp:tools:ops:claim"});function XE(n,e){return Wb.isAbsolute(e)?e:Wb.join(n,e)}function Hb(n,e,r){let i=e&&e.length>0?e:r?[r]:[];return Array.from(new Set(i.map(t=>XE(n,t))))}async function Bb(n){let{repoPath:e,missionId:r}=n,i=Hb(e,n.filePaths,n.filePath),{claims:t,missions:o}=N.getInstance(e);if(!o.findById(r))throw new Error(`Mission ${r} not found`);let a=[],c=[];for(let l of i){let u=t.claimFile(l,r);if(u.status==="claimed"||u.status==="already_claimed"){a.push(l);continue}c.push({file_path:l,by_mission_id:u.claim.mission_id,by_mission_name:u.claim.mission_name,by_mission_status:u.claim.mission_status,by_mission_branch:u.claim.mission_branch})}return Zb.info({repoPath:e,missionId:r,requested:i.length,claimed:a.length,alreadyClaimed:c.length},"Processed file claim request"),{content:[{type:"text",text:JSON.stringify({mission_id:r,claimed:a,alreadyClaimed:c,requested_count:i.length,claimed_count:a.length,already_claimed_count:c.length},null,2)}]}}async function Gb(n){let{repoPath:e,missionId:r}=n,i=Hb(e,n.filePaths,n.filePath),{claims:t}=N.getInstance(e),o=[],s=0;if(i.length===0)s=t.releaseAllForMission(r);else for(let a of i){let c=t.releaseFile(a,r);c.released?s+=1:o.push({file_path:a,reason:c.reason})}return Zb.info({repoPath:e,missionId:r,requested:i.length,released:s,failed:o.length},"Processed file release request"),{content:[{type:"text",text:JSON.stringify({mission_id:r,released:s,releaseFailures:o,requested_count:i.length,mode:i.length===0?"release_all":"release_selected"},null,2)}]}}X();var QE=E.child({module:"mcp:tools:ops:dispatch-plan"});async function Jb(n){let{repoPath:e,parentMissionId:r,missionId:i,missionIds:t,includeClaimCheck:o=!0}=n,s=r??i;QE.info({repoPath:e,parentMissionId:s,missionIds:t,includeClaimCheck:o},"Building dispatch plan");let a=new An(e),c=t&&t.length>0?a.buildPlanForMissions(t,{includeClaimCheck:o}):s!==void 0?a.buildPlanForParent(s):a.buildPlanForMissions([],{includeClaimCheck:o}),l=a.toHandlerPayload(c);return{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}X();ee();import ha from"path";var ek=E.child({module:"mcp:tools:ops:working-set-check"});async function Vb(n){let{repoPath:e,filePaths:r}=n,{missions:i,claims:t}=N.getInstance(e),o=i.findActive(),s=[],a=r.map(u=>ha.isAbsolute(u)?u:ha.join(e,u));for(let u of o){let p=i.getWorkingSet(u.id);for(let d of p)if(r.includes(d.file_path))s.push({file_path:d.file_path,mission_id:u.id,mission_name:u.name});else{let m=ha.isAbsolute(d.file_path)?d.file_path:ha.join(e,d.file_path);for(let f of a)if(m===f){s.push({file_path:d.file_path,mission_id:u.id,mission_name:u.name});break}}}let l=t.getClaimsByFiles(a).map(u=>({file_path:u.file_path,mission_id:u.mission_id,mission_name:u.mission_name,mission_status:u.mission_status,mission_branch:u.mission_branch,claimed_at:u.claimed_at,updated_at:u.updated_at}));return ek.info({repoPath:e,conflictsCount:s.length,claimConflicts:l.length},"Working set check completed"),{content:[{type:"text",text:JSON.stringify({conflicts:s,claims:l},null,2)}]}}import tk from"fast-glob";import qb from"fs";import nk from"ignore";import Kb from"path";async function Yb(n,e=[]){let r=nk(),i=Kb.join(n,".gitignore");return qb.existsSync(i)&&r.add(qb.readFileSync(i,"utf8")),e.length>0&&r.add(e),(await tk(qg,{cwd:n,absolute:!0,ignore:Rs,stats:!0})).filter(s=>{let a=Kb.relative(n,s.path);return!r.ignores(a)}).map(s=>({path:s.path,mtime:s.stats.mtimeMs}))}import m_ from"fs";function Xb(n){let e=n.split(`
|
|
770
|
+
`),r=[],i=0;for(let t of e)r.push(i),i+=t.length+1;return r}function ge(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 ga(n,e){return e.slice(0,n).toString("utf8").length}function Qb(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 e_(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 t_(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 Rt(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 n_(n){if(!n)return"";let r=n.replace(/\/\*\*|\*\/|\*/g,"").trim().split(`
|
|
771
|
+
`)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function ya(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 Pi(n){let e=[];return/\b(fetch|axios|superagent|got)\s*\(|import\s+.*\b(http|https|node-fetch)\b/i.test(n)&&e.push("Network"),(/\b(knex|prisma|typeorm|mongoose|sequelize|pg|mysql|sqlite3)\b/i.test(n)||/\b(SELECT\s+.*FROM|INSERT\s+INTO|UPDATE\s+.*SET|DELETE\s+FROM)\b/i.test(n)||/\.query\s*\(|\.execute\s*\(/i.test(n)&&/db|database|client|pool/i.test(n))&&e.push("Database"),(/\bfs\./i.test(n)||/\b(readFileSync|writeFileSync|readFile|writeFile|readdir)\b/.test(n)||/import\s+.*\bfs\b/.test(n))&&e.push("File System"),(/\b(localStorage|sessionStorage|indexedDB)\./.test(n)||/\bdocument\.cookie\b/.test(n))&&e.push("Browser Storage"),e}function ct(n,e){if(!n)return"";let r=n.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 r_(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 rk(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 i_(n,e,r,i,t,o,s,a,c){let l=c??(p=>ga(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 g=l(p.span.start-e),$=l(p.span.end-e),y=Rt(g,o,i),v=a(p.span),b=[];if(p.type==="ExportDeclaration"&&(m==="ClassDeclaration"||m==="ClassExpression")){let S=d.body||[];for(let w of S)if(w.type==="ClassMethod"||w.type==="ClassProperty"){let T=w.key.value;if(!T)continue;let z=l(w.span.start-e),D=l(w.span.end-e),C=a(w.span),I=Rt(z,o,i);b.push({name:T,kind:w.type,signature:ct(C,w.type),line:ge(z,t),endLine:ge(D,t),doc:I,classification:w.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(m==="FunctionDeclaration"&&d.body?.type==="BlockStatement")b=ym(d.body.stmts,e,r,i,t,o,a,l);else if(m==="VariableDeclaration"){for(let S of d.declarations)if(S.init&&(S.init.type==="ArrowFunctionExpression"||S.init.type==="FunctionExpression")&&S.init.body?.type==="BlockStatement"){b=ym(S.init.body.stmts,e,r,i,t,o,a,l);break}}u.push({name:f,kind:m,signature:ct(v,m),line:ge(g,t),endLine:ge($,t),doc:y,classification:ya(s,f,m),capabilities:JSON.stringify(Pi(v)),members:b})}if(p.type==="ExportNamedDeclaration"){for(let d of p.specifiers)if(d.type==="ExportSpecifier"){let m=d.orig.value,f=d.exported?.value||m,$=rk(n,m)||p.span,y=l($.start-e),v=l($.end-e),b=Rt(y,o,i);u.push({name:f,kind:"ExportSpecifier",signature:`export { ${m} }`,line:ge(y,t),endLine:ge(v,t),doc:b,classification:"Export mapping",capabilities:"[]"})}}if(p.type==="ExportDefaultDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=Rt(d,o,i),g=a(p.span),$=[];if(p.decl.type==="ClassExpression"||p.decl.type==="ClassDeclaration"){let y=p.decl.body||[];for(let v of y)if(v.type==="ClassMethod"||v.type==="ClassProperty"){let b=v.key.value;if(!b)continue;let S=l(v.span.start-e),w=l(v.span.end-e),T=a(v.span),z=Rt(S,o,i);$.push({name:b,kind:v.type,signature:ct(T,v.type),line:ge(S,t),endLine:ge(w,t),doc:z,classification:v.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(p.decl.type==="FunctionExpression"||p.decl.type==="FunctionDeclaration"||p.decl.type==="ArrowFunctionExpression")&&p.decl.body?.type==="BlockStatement"&&($=ym(p.decl.body.stmts,e,r,i,t,o,a,l));u.push({name:"default",kind:"DefaultExport",signature:ct(g,"DefaultExport"),line:ge(d,t),endLine:ge(m,t),doc:f,classification:"Default Export",capabilities:JSON.stringify(Pi(g)),members:$})}if(p.type==="ExportAllDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=p.source.value,g=Rt(d,o,i);u.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${f}"`,line:ge(d,t),endLine:ge(m,t),doc:g,classification:"Re-export",capabilities:"[]"})}}return u}function ym(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=f=>{if(f.type==="Identifier")p.push({name:f.value,span:f.span});else if(f.type==="ArrayPattern")for(let g of f.elements)g&&d(g);else if(f.type==="ObjectPattern")for(let g of f.properties)g.type==="AssignmentPatternProperty"?p.push({name:g.key.value,span:g.span}):g.type==="KeyValuePatternProperty"&&d(g.value)};d(u.id);let m=u.init&&(u.init.type==="ArrowFunctionExpression"||u.init.type==="FunctionExpression");for(let f of p){let g=m?u.init.span||u.span||f.span:u.span||f.span,$=m?u.init.type:"VariableDeclaration",y=m?"Internal Function":"Internal Variable",v=a(g.start-e),b=a(g.end-e),S=s(g),w=Rt(v,o,i);c.push({name:f.name,kind:$,signature:ct(S,$),line:ge(v,t),endLine:ge(b,t),doc:w,classification:y,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=Rt(p,o,i);c.push({name:u,kind:"FunctionDeclaration",signature:ct(m,"FunctionDeclaration"),line:ge(p,t),endLine:ge(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),g=s(d),$=Rt(m,o,i);c.push({name:p,kind:"ReturnProperty",signature:ct(g,"ReturnProperty"),line:ge(m,t),endLine:ge(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),g=s(d.span);c.push({name:`on:${p}`,kind:d.type,signature:ct(g,d.type),line:ge(m,t),endLine:ge(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),g=s(u.span);c.push({name:d,kind:"HTTP Route",signature:ct(g,"HTTP Route"),line:ge(m,t),endLine:ge(f,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:d})})}}}}return c}function o_(n,e,r,i,t,o){let s=o??(l=>ga(l,r)),a=[];function c(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let u=ik(l);if(u){let p=s(l.span.start-e);a.push({...u,line:ge(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 ik(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 Ci(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,g)=>{let $=g.find(v=>v.kind==="FunctionDeclaration"||v.kind==="ClassDeclaration")?.name,y=$?`React component: ${$}`:"React UI component";return f?`${y} with ${f}`:y},Hook:(f,g)=>{let $=g.find(v=>v.name.startsWith("use"))?.name,y=$?`Custom React hook: ${$}`:"Custom React hook";return f?`${y} for ${f}`:y},Service:(f,g)=>{let y=`Service layer: ${g[0]?.name||"Service"}`;return f?`${y} handling ${f}`:y},Repository:(f,g)=>`Data repository: ${g[0]?.name||"Repository"} for ${f||"data access"}`,"Type Definition":(f,g)=>`Type definitions: ${g.slice(0,3).map(y=>y.name).join("")}${g.length>3?"...":""}`,Model:(f,g)=>`Data model: ${g[0]?.name||"Model"}`,"HTTP Route":(f,g)=>{let $=g.filter(y=>y.classification==="Service Boundary");return $.length>0?`API endpoints: ${$.slice(0,3).map(y=>y.name).join("")}`:"API route handler"},"Micro IR (PHP)":(f,g)=>{let $=g.some(v=>v.classification==="Service Boundary"),y=g.find(v=>v.kind==="ClassDeclaration")?.name;return $?"PHP controller with API routes":y?`PHP class: ${y}`:"PHP module"},"Micro IR (Python)":(f,g)=>{let $=g.some(v=>v.classification==="Service Boundary"),y=g.find(v=>v.kind==="ClassDeclaration")?.name;return $?"Python API handler with routes":y?`Python class: ${y}`:"Python module"},"Micro IR (Go/TS) ":(f,g)=>{let $=g.some(v=>v.kind==="TypeDeclaration"),y=g.filter(v=>v.kind==="FunctionDeclaration");return $&&y.length>0?`Go package: types and ${y.length} function(s)`:$?"Go package: type definitions":y.length>0?`Go package: ${y[0].name} and ${y.length} function(s)`:"Go module"},"Micro IR (Rust/TS) ":(f,g)=>{let $=g.find(b=>b.kind==="TraitDeclaration")?.name,y=g.find(b=>b.kind==="StructDeclaration")?.name,v=g.filter(b=>b.kind==="FunctionDeclaration");return $?f.includes("Rust trait")?`Rust module: trait ${$}`:`Rust module: ${$}`:y?`Rust module: struct ${y}`:v.length>0?`Rust module: ${v.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(g=>g.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 s_(n){let e=new Set;function r(i){if(!(!i||typeof i!="object")){i.typeAnnotation&&ke(i.typeAnnotation,e),(i.type==="TsTypeReference"||i.type==="TsTypeAnnotation")&&ke(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 ke(n,e){if(n){if(n.type==="TsTypeAnnotation"){ke(n.typeAnnotation,e);return}n.type==="TsTypeReference"&&(n.typeName?.type==="Identifier"&&e.add(n.typeName.value),n.typeName?.type==="TsQualifiedName"&&a_(n.typeName,e),n.typeParams&&ke(n.typeParams,e)),n.type==="TsArrayType"&&ke(n.elementType,e),n.type==="TsUnionType"&&n.types?.forEach(r=>ke(r,e)),n.type==="TsIntersectionType"&&n.types?.forEach(r=>ke(r,e)),n.type==="TsTupleType"&&n.elemTypes?.forEach(r=>ke(r.ty,e)),(n.type==="TsFunctionType"||n.type==="TsConstructorType")&&(n.params?.forEach(r=>ke(r.typeAnnotation,e)),n.typeAnnotation&&ke(n.typeAnnotation,e)),n.type==="TsTypeParameterDeclaration"&&n.params?.forEach(r=>{r.constraint&&ke(r.constraint,e),r.default&&ke(r.default,e)}),n.type==="TsTypeParameterInstantiation"&&n.params?.forEach(r=>ke(r,e)),n.type==="TsMappedType"&&n.typeAnnotation&&ke(n.typeAnnotation,e),n.type==="TsIndexedAccessType"&&(ke(n.objectType,e),ke(n.indexType,e)),n.type==="TsConditionalType"&&(ke(n.checkType,e),ke(n.extendsType,e),ke(n.trueType,e),ke(n.falseType,e)),n.type==="TsTypeLiteral"&&n.members?.forEach(r=>{r.typeAnnotation&&ke(r.typeAnnotation,e)})}}function a_(n,e){n.type==="TsQualifiedName"?(n.left&&a_(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import f_ from"path";import bm from"path";X();Pn();import l_ from"path";import ok from"fs";import{fileURLToPath as sk}from"url";import*as zn from"web-tree-sitter";var jD=l_.dirname(sk(import.meta.url)),c_=E.child({module:"parser:tree-sitter"}),ba=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=zn.Parser||zn;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=et("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!ok.existsSync(r))return c_.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await zn.Language.load(r);return this.languages.set(e,i),i}catch(i){return c_.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`
|
|
719
772
|
(function_definition name: (name) @name) @func
|
|
720
773
|
(class_declaration name: (name) @name) @class
|
|
721
774
|
(interface_declaration name: (name) @name) @interface
|
|
@@ -739,144 +792,146 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
739
792
|
(trait_item name: (_type_identifier) @name) @trait
|
|
740
793
|
(type_item name: (_type_identifier) @name) @type
|
|
741
794
|
(use_declaration argument: (_) @name) @import
|
|
742
|
-
`;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=
|
|
743
|
-
`),a=this.getQueries(i);if(!a)return[];let l=new
|
|
744
|
-
`),s="",a="",c=0,l=0,u=-1,p=-1,d=[],m=[],f=!1,
|
|
745
|
-
`).trim(),capabilities:JSON.stringify(
|
|
746
|
-
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let
|
|
747
|
-
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let
|
|
748
|
-
`).trim()
|
|
749
|
-
`)
|
|
750
|
-
`).trim()),
|
|
795
|
+
`;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=l_.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(`
|
|
796
|
+
`),a=this.getQueries(i);if(!a)return[];let l=new zn.Query(t,a).matches(o.rootNode),u=[];for(let p of l){let d=p.captures.find(g=>g.name==="name")?.node,m=p.captures[0].node,f=p.captures[0].name;if(d){let g=m.startPosition.row+1,$=m.endPosition.row+1,y=s[m.startPosition.row].trim();u.push({name:d.text,kind:this.mapKind(f,i),classification:this.mapClassification(f),signature:y,line:g,endLine:$,doc:"",capabilities:"{}"})}}return u}};var _a=class{parse(e,r=!1){let i=[],t=[],o=e.split(`
|
|
797
|
+
`),s="",a="",c=0,l=0,u=-1,p=-1,d=[],m=[],f=!1,g=r?"api":"",$="",y=/^namespace\s+([a-zA-Z0-9_\\]+);/,v=/^(?:abstract\s+)?(?:readonly\s+)?class\s+([a-zA-Z0-9_]+)/,b=/^interface\s+([a-zA-Z0-9_]+)/,S=/^trait\s+([a-zA-Z0-9_]+)/,w=/^enum\s+([a-zA-Z0-9_]+)(?:\s*:\s*(string|int))?\s*/,T=/^((?:(?:public|protected|private|static)\s+)*)function\s+([a-zA-Z0-9_]+)\s*\(/,z=/^(public|protected|private)\s+(static\s+)?(readonly\s+)?(?:(\?\s*)?([a-zA-Z0-9_\\|]+)\s+)?\$([a-zA-Z0-9_]+)/,D=/^use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/,C=/^#\[([a-zA-Z0-9_\\]+)(?:\((.*)\))?\]/,I=/(?:Route::|router->|\$router->|->)(get|post|put|delete|patch|match)\s*\(\s*(?:uri\s*:\s*)?['"]([^'"]+)['"]/,A=/->prefix\s*\(\s*(?:prefix\s*:\s*)?['"]([^'"]+)['"]/,M=/\$this->(hasMany|hasOne|belongsTo|belongsToMany|morphTo|morphMany|morphOne|morphToMany|morphedByMany)\s*\(\s*([a-zA-Z0-9_\\]+)(?:::class)?/,H=/^->(hasMany|hasOne|belongsTo|belongsToMany|morphTo|morphMany|morphOne|morphToMany|morphedByMany)\s*\(\s*([a-zA-Z0-9_\\]+)(?:::class)?/,Y=/(public|protected|private)\s+(readonly\s+)?(?:(\?\s*)?([a-zA-Z0-9_\\|]+)\s+)?\$([a-zA-Z0-9_]+)/g,O=/(?:protected|public)\s+\$(fillable|casts|guarded|hidden|appends|with)\s*=/;function q(_){try{let x=JSON.parse(_||"{}");if(x&&typeof x=="object"&&!Array.isArray(x))return x}catch{}return{}}function L(_,x){let j=[],P=_,B=0,K=0;for(;P<o.length;){let oe=o[P].trim();j.push(oe),B+=(oe.match(/\[/g)||[]).length-(oe.match(/]/g)||[]).length,K+=(oe.match(/\(/g)||[]).length-(oe.match(/\)/g)||[]).length;let le=oe.includes(x),Ee=B<=0&&K<=0;if(le&&Ee)break;P+=1}return{text:j.join(" "),endIndex:P}}function G(_,x){let j=x.replace(/^[^=]+=\s*/,"").replace(/;$/,"").trim();if(_==="casts"){let oe={},le=/['"]([^'"]+)['"]\s*=>\s*['"]([^'"]+)['"]/g,Ee=null;for(;Ee=le.exec(j);)oe[Ee[1]]=Ee[2];return oe}let P=[],B=/['"]([^'"]+)['"]/g,K=null;for(;K=B.exec(j);)P.push(K[1]);return P}function re(_,x){for(let j=x;j>=0;j-=1){let P=_[j]?.trim()||"";if(P)return P}return""}function J(_,x,j,P){if(!s)return;let B=x.split("\\").pop()||x;t.push({type:"eloquent_relation",name:B,direction:"produce",line:j,snippet:P,method:_,url:`${s}->${B}`})}for(let _=0;_<o.length;_++){let x=o[_].trim();if(!x)continue;let j=(x.match(/{/g)||[]).length,P=(x.match(/}/g)||[]).length,B=l;if(l+=j-P,a&&l<=p){let te=i.find(Q=>Q.name===a&&Q.line===c);te&&(te.endLine=_+1),a="",p=-1}if(s&&l<=u){let te=i.find(Q=>Q.name===s&&(Q.kind==="ClassDeclaration"||Q.kind==="TraitDeclaration"||Q.kind==="InterfaceDeclaration"||Q.kind==="EnumDeclaration"));te&&(te.endLine=_+1),s="",u=-1}let K=x.match(A);if(K&&(g=K[1]),x.includes("});")&&(g=""),x.startsWith("/**")){f=!0,m=[];continue}if(f){x.endsWith("*/")?f=!1:m.push(x.replace(/^\*\s?/,""));continue}let oe=x.match(C);if(oe){d.push(oe[1]);continue}let le=x.match(y);if(le){$=le[1]||"",d=[],m=[];continue}let Ee=x.match(v);if(Ee){s=Ee[1],u=l-j;let te={attributes:d};$&&(te.namespace=$),i.push({name:s,kind:"ClassDeclaration",classification:"Class",signature:`class ${s}`,line:_+1,endLine:_+1,doc:m.join(`
|
|
798
|
+
`).trim(),capabilities:JSON.stringify(te),members:[]}),d=[],m=[];continue}let Ze=x.match(b);if(Ze){let te=Ze[1];s=te,u=l-j,i.push({name:te,kind:"InterfaceDeclaration",classification:"Interface",signature:`interface ${te}`,line:_+1,endLine:_+1,doc:m.join(`
|
|
799
|
+
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let Gt=x.match(S);if(Gt){let te=Gt[1];s=te,u=l-j,i.push({name:te,kind:"TraitDeclaration",classification:"Trait",signature:`trait ${te}`,line:_+1,endLine:_+1,doc:m.join(`
|
|
800
|
+
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let Te=x.match(w);if(Te){let te=Te[1],Q=Te[2]||null;s=te,u=l-j;let de={attributes:d,backedType:Q};$&&(de.namespace=$),i.push({name:te,kind:"EnumDeclaration",classification:"Enum",signature:Q?`enum ${te}: ${Q}`:`enum ${te}`,line:_+1,endLine:_+1,doc:m.join(`
|
|
801
|
+
`).trim(),capabilities:JSON.stringify(de),members:[]}),d=[],m=[];continue}let nt=x.match(T);if(nt){let te=(nt[1]||"").trim(),Q=nt[2],de=!!s,Oe=/\bprivate\b/.test(te)?"private":/\bprotected\b/.test(te)?"protected":"public",_e=/\bstatic\b/.test(te),pt=L(_,")"),zt=pt.text.match(/\)\s*:\s*([?a-zA-Z0-9_\\|]+)/),Ui=zt?zt[1]:null,Ux=j>0&&P>=j;a=Q,c=_+1,p=l-j;let Ym=!1,Ha={};for(let it of d)it.toLowerCase().includes("route")&&(Ym=!0,Ha={type:"route",method:"GET",path:"/"});let Xm=m.join(`
|
|
802
|
+
`).trim();if(Ym){let it=Ha.path||"/";i.push({name:it,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${Q}`,line:_+1,endLine:_+1,doc:Xm,capabilities:JSON.stringify({type:"route",handler:s?`${s}@${Q}`:Q,...Ha})}),t.push({type:"api_route",name:it,direction:"consume",line:_+1,snippet:x})}let Qm={name:Q,kind:de?"MethodDeclaration":"FunctionDeclaration",classification:de?"Method":"Function",signature:`${de?s+":: ":""}${Q}`,line:_+1,endLine:_+1,doc:Xm,capabilities:JSON.stringify(de?{attributes:d,visibility:Oe,static:_e,returnType:Ui}:{attributes:d,returnType:Ui})};i.push(Qm);let Ba=de?x.match(M):null;if(Ba&&J(Ba[1],Ba[2],_+1,x),de&&Q==="__construct"){let it=null;for(;it=Y.exec(pt.text);){let ef=it[1],tf=!!it[2],Ga=it[4]?`${it[3]?"?":""}${it[4]}`:null,nf=it[5],Wx=`${ef} ${tf?"readonly ":""}${Ga?`${Ga} `:""}$${nf}`.trim();i.push({name:nf,kind:"PropertyDeclaration",classification:"Property",signature:Wx,line:_+1,endLine:_+1,doc:"",capabilities:JSON.stringify({visibility:ef,static:!1,readonly:tf,type:Ga}),members:[]})}Y.lastIndex=0}Ux&&(Qm.endLine=_+1,a="",p=-1),d=[],m=[];continue}let rt=!1,Ce=!1,ce=_,be=s&&!a?x.match(z):null;if(be){rt=!0;let te=be[1],Q=!!be[2],de=!!be[3],Oe=be[5]?`${be[4]?"?":""}${be[5]}`:null,_e=be[6],pt=`${te} ${Q?"static ":""}${de?"readonly ":""}${Oe?`${Oe} `:""}$${_e}`.trim();i.push({name:_e,kind:"PropertyDeclaration",classification:"Property",signature:pt,line:_+1,endLine:_+1,doc:m.join(`
|
|
803
|
+
`).trim(),capabilities:JSON.stringify({visibility:te,static:Q,readonly:de,type:Oe}),members:[]})}let At=s&&!a?x.match(O):null;if(At){Ce=!0;let te=At[1],Q=L(_,";");ce=Q.endIndex;let de=G(te,Q.text),Oe=[...i].reverse().find(_e=>_e.name===s&&_e.kind==="ClassDeclaration");if(Oe){let _e=q(Oe.capabilities);(!_e.modelConfig||typeof _e.modelConfig!="object"||Array.isArray(_e.modelConfig))&&(_e.modelConfig={}),_e.modelConfig[te]=de,Oe.capabilities=JSON.stringify(_e)}}if(rt||Ce){Ce&&ce>_&&(_=ce),d=[],m=[];continue}let Jt=x.match(D);if(Jt){let te=Jt[1]||"",Q=Jt[2]||te.split("\\").pop()||"";i.push({name:Q,kind:"ImportSpecifier",classification:"Dependency",signature:`use ${te}`,line:_+1,endLine:_+1,doc:"",capabilities:JSON.stringify({type:"use",namespace:te})}),d=[],m=[];continue}let lt=x.match(I);if(lt){let te=lt[1].toUpperCase(),Q=lt[2];if(x.includes("Route::")||x.includes("router->")||x.includes("action")||x.includes(",")&&!x.includes("view(")){if(g){let zt=g.startsWith("/")?g:`/${g}`,Ui=Q.startsWith("/")?Q:`/${Q}`;Q=(zt+Ui).replace(/\/+/g,"/")}let Oe=null,_e=x.match(/\[\s*([a-zA-Z0-9_]+)::class\s*,\s*['"]([^'"]+)['"]\s*\]/);if(_e)Oe=`${_e[1]}@${_e[2]}`;else if(x.includes("::class")){let zt=x.match(/([a-zA-Z0-9_]+)::class/);zt&&(Oe=zt[1])}let pt=x;!x.endsWith(");")&&_+1<o.length&&(pt+=" "+o[_+1].trim(),!pt.endsWith(");")&&_+2<o.length&&(pt+=" "+o[_+2].trim())),i.push({name:Q,kind:"HTTP Route",classification:"Service Boundary",signature:pt,line:_+1,endLine:_+1,doc:"",capabilities:JSON.stringify({type:"route",method:te,path:Q,handler:Oe})}),t.push({type:"api_route",name:Q,direction:"consume",line:_+1,snippet:pt,method:te,url:Q}),m=[];continue}}let ut=s&&a?x.match(M):null,vn=s&&a?x.match(H):null;if(ut)J(ut[1],ut[2],_+1,x);else if(vn){let te=re(o,_-1);/\$this\b/.test(te)&&J(vn[1],vn[2],_+1,x)}let Km=/(?:\$client|client|Http)::(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)|(?:\$client|client)->(request|get|post|put|delete|patch)\s*\(\s*([^,)]+)/,Le=x.match(Km);if(Le){let te=(Le[1]||Le[3]).toUpperCase(),Q=(Le[2]||Le[4]).trim();(Q.startsWith("'")&&Q.endsWith("'")||Q.startsWith('"')&&Q.endsWith('"'))&&(Q=Q.substring(1,Q.length-1)),t.push({type:"api_route",name:Q,direction:"produce",line:_+1,snippet:x,method:te,url:Q})}!x.startsWith("#[")&&!x.startsWith("//")&&!x.startsWith("*")&&!f&&(d=[],m=[])}return{nodes:i,events:t}}};var va=class{currentRoutePrefix="";parse(e){this.currentRoutePrefix="";let r=[],i=[],t=e.split(`
|
|
804
|
+
`),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(b){return b.trim().split(/[.(]/)[0]?.trim()||b}function d(b){let S=b.decorators.map(T=>p(T.raw)),w={decorators:b.decorators,decoratorNames:S};return b.async===!0&&(w.async=!0),b.accessor&&(w.accessor=b.accessor),b.contextmanager===!0&&(w.contextmanager=!0),JSON.stringify(w)}function m(b,S){return(b.match(new RegExp(`\\${S}`,"g"))||[]).length}function f(b){let S=[],w=b,T=0,z=0,D=0,C=!1;do{let I=t[w].trim();if(S.push(I),T+=m(I,"(")-m(I,")"),z+=m(I,"[")-m(I,"]"),D+=m(I,"{")-m(I,"}"),C=I.endsWith("\\"),w+1>=t.length||T<=0&&z<=0&&D<=0&&!C)break;w+=1}while(!0);return{text:S.join(" "),endIndex:w}}let g=!1,$="",y=[],v=[];for(let b=0;b<t.length;b++){let S=t[b],w=S.trim();if(!w||w.startsWith("#"))continue;let T=/^([a-zA-Z0-9_]+)\s*=\s*(?:APIRouter|Blueprint)\s*\(\s*(?:prefix\s*=\s*)?['"]([^'"]+)['"]/,z=w.match(T);if(z&&(this.currentRoutePrefix=z[2]),g){if(w.endsWith($)||w.includes($)){g=!1;let P=w.replace($,"").trim();P&&y.push(P);let B=o[o.length-1];B.node&&(B.node.doc=y.join(`
|
|
805
|
+
`).trim()),y=[]}else y.push(w);continue}let D=S.search(/\S/),C=S.trim(),I=C.match(/^(['"]{3})/);if(I){let P=I[1],B=o[o.length-1];if(B.node&&!B.node.doc){if(C.substring(3).includes(P)){let K=C.replace(new RegExp(P,"g"),"").trim();B.node.doc=K}else{g=!0,$=P;let K=C.substring(3).trim();K&&y.push(K)}continue}}for(;o.length>1&&o[o.length-1].indent>=D;)o.pop();let A=o[o.length-1],M=A.type==="root"&&D===0;if(M&&/^__all__\s*=/.test(C)){let P=f(b),B=[],K=/['"]([^'"]+)['"]/g,oe=null;for(;oe=K.exec(P.text);)B.push(oe[1]);let le={name:"__all__",kind:"ModuleExports",classification:"ExportList",signature:"__all__ = [...]",line:b+1,endLine:P.endIndex+1,doc:"",capabilities:JSON.stringify({exports:B}),members:[]};v.push(le),r.push(le),b=P.endIndex,s=[];continue}let Y=/^([A-Z][A-Z0-9_]*)(?:\s*:\s*[^=]+)?\s*=/,O=M?C.match(Y):null;if(O){let P=f(b),B=P.text.length>120?`${P.text.slice(0,117)}...`:P.text,K={name:O[1],kind:"VariableDeclaration",classification:"Constant",signature:B,line:b+1,endLine:P.endIndex+1,doc:"",capabilities:"{}",members:[]};v.push(K),r.push(K),b=P.endIndex,s=[];continue}let q=C.match(u);if(q){s.push({raw:q[1].trim(),line:b+1});continue}let L=C.match(a);if(L){let P=L[1],B={name:P,kind:"ClassDeclaration",classification:"Class",signature:`class ${P}`,line:b+1,endLine:b+1,doc:"",capabilities:d({decorators:s}),members:[]};v.push(B),A.node?(A.node.members||(A.node.members=[]),A.node.members.push(B)):r.push(B),o.push({indent:D,name:P,type:"class",node:B}),s=[];continue}let G=C.match(c);if(G){let P=!!G[1],B=G[1]||G[2],K=A.type==="class",oe=s.some(ce=>/(?:^|\.)contextmanager$/.test(ce.raw.trim())),le;s.some(ce=>ce.raw.trim()==="property")&&(le="getter");for(let ce of s){let be=ce.raw.trim().match(/^[a-zA-Z_][a-zA-Z0-9_]*\.(setter|deleter)$/);if(be){le=be[1];break}}let Ee=!1,Ze={};for(let ce of s)if(ce.raw.match(/(?:app|router)\.(get|post|put|delete|patch|websocket)/)){Ee=!0;let At=["get","post","put","delete","patch","websocket"].find(ut=>ce.raw.toLowerCase().includes(`.${ut}`))?.toUpperCase()||"GET",Jt=ce.raw.match(/['"]([^'"]+)['"]/),lt=Jt?Jt[1]:"/";if(this.currentRoutePrefix){let ut=this.currentRoutePrefix.endsWith("/")?this.currentRoutePrefix.slice(0,-1):this.currentRoutePrefix,vn=lt.startsWith("/")?lt:`/${lt}`;lt=ut+vn}Ze={type:"route",method:At,path:lt}}if(Ee){let ce=Ze.path||"",be=Ze.method==="WEBSOCKET",At={name:ce||B,kind:be?"WebSocket Route":"HTTP Route",classification:"Service Boundary",signature:`Function: ${B}`,line:b+1,endLine:b+1,doc:"",capabilities:JSON.stringify({handler:K?`${A.name}.${B}`:B,async:P,...Ze})};v.push(At),r.push(At),i.push({type:be?"websocket_route":"api_route",name:ce,direction:"consume",line:b+1,snippet:C})}for(let ce of s){let be=ce.raw.match(/(?:^|\.)receiver\s*\(\s*([a-zA-Z0-9_\.]+)/);be&&i.push({type:"signal",name:be[1].split(".").pop()||be[1],direction:"consume",line:ce.line,snippet:`@${ce.raw}`})}let Gt=s.some(ce=>ce.raw==="staticmethod"),Te=s.some(ce=>ce.raw==="classmethod"),nt=`${P?"async ":""}${K?(Gt?"@staticmethod ":Te?"@classmethod ":"")+A.name+".":""}${B}`,rt=!!le,Ce={name:B,kind:rt?"PropertyDeclaration":P&&K?"AsyncMethodDeclaration":P?"AsyncFunctionDeclaration":K?"MethodDeclaration":"FunctionDeclaration",classification:rt?"Property":K?Gt||Te?"Static Method":"Method":"Function",signature:nt,line:b+1,endLine:b+1,doc:"",capabilities:d({decorators:s,async:P,accessor:le,contextmanager:oe}),members:[]};v.push(Ce),A.node?(A.node.members||(A.node.members=[]),A.node.members.push(Ce)):r.push(Ce),o.push({indent:D,name:B,type:"function",node:Ce}),s=[];continue}let re=/^(?:path|re_path|url)\s*\(\s*['"]([^'"]+)['"]/,J=C.match(re);if(J){let P=J[1].replace(/^\^/,""),B={name:P,kind:"HTTP Route",classification:"Service Boundary",signature:C.trim(),line:b+1,endLine:b+1,doc:"",capabilities:JSON.stringify({type:"route",method:"GET",path:P})};v.push(B),r.push(B),i.push({type:"api_route",name:P,direction:"consume",line:b+1,snippet:C});continue}let _=/(?:requests|httpx|client|http)\.(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)/,x=C.match(_);if(x){let P=x[1].toUpperCase(),B=x[2].trim();(B.startsWith("'")&&B.endsWith("'")||B.startsWith('"')&&B.endsWith('"'))&&(B=B.substring(1,B.length-1)),i.push({type:"api_route",name:B,direction:"produce",line:b+1,snippet:C,method:P,url:B})}let j=C.match(l);if(j){let P=j[1]||j[2],B={name:P,kind:"ImportSpecifier",classification:"Dependency",signature:`import ${P}`,line:b+1,endLine:b+1,doc:"",capabilities:JSON.stringify({type:"import",module:P})};v.push(B),r.push(B),s=[];continue}s=[],A.node&&(A.node.endLine=b+1)}return{nodes:v,events:i}}};function ak(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 u_=[{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 ck(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 xa=class{phpParser=new _a;pythonParser=new va;treeSitterParser=new ba;supports(e){return u_.some(r=>r.extension.includes(e.toLowerCase()))}async parse(e,r){let i=bm.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(f=>f.classification!=="Dependency"),p=t.filter(f=>f.classification==="Dependency"),d=ck(i,t),m=Ci({classification:l,capabilities:d,exports:u.map(f=>({name:f.name,kind:f.kind,classification:f.classification})),fileName:bm.basename(e)});return{exports:u,imports:p.map(f=>({module:f.name,name:f.name,kind:f.kind,classification:f.classification})),events:o,classification:l,summary:m||`${i.substring(1).toUpperCase()} module`,parseStatus:"success"}}}let s=u_.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(`
|
|
751
806
|
`);for(let l of s.rules){l.regex.lastIndex=0;let u;for(;(u=l.regex.exec(r))!==null;){let p=l.onMatch(u),d=r.substring(0,u.index).split(`
|
|
752
|
-
`).length,m=PE(a,d-1);t.push({name:p.name||"anonymous",kind:p.kind||"Unknown",classification:p.classification||"Other",signature:p.signature||u[0],line:d,endLine:m,doc:"",capabilities:JSON.stringify(p.meta||{})})}}let c=bi({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(l=>({name:l.name,kind:l.kind,classification:l.classification})),fileName:tm.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:c||"Module",parseStatus:t.length>0?"success":"partial"}}};Q();import*as nm from"@swc/core";function zb(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.parse=="function"&&typeof e.parseSync=="function"}function CE(){if(zb(nm))return nm;let n=nm;if(zb(n.default))return n.default;throw new Error("SWC runtime unavailable: couldn't resolve parse/parseSync from @swc/core exports")}var Ab=CE();function vi(n,e,r){return Ab.parse(n,e,r)}function ca(n,e,r){return Ab.parseSync(n,e,r)}var rm=new aa;async function _i(n){let e=Lb.extname(n);if(rm.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=await Db.promises.readFile(n,"utf-8");return{...await rm.parse(n,o),content:o}}catch(o){return S.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:o.message}}let r;try{r=await Db.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=_b(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=ca(i,c)}catch{a=ca(i,{...c,isModule:!1})}else a=ca(i,c);let l=a.span.start,u=xb(r),p=$b(i),d=E=>Sb(E,l,r),m=Eb(a.body),f=Tb(a.body);f.length>0&&S.debug({filePath:n,count:f.length},"Extracted type references"),f.forEach(E=>{m.push({module:"__type_reference__",name:E})});let h=kb(a.body,l,r,i,t,p,n,d,u),v=Ib(a.body,l,r,t,d,u),y=ra(n,"","Module"),_=p.length>0&&i.slice(0,p[0].start).trim().length===0?p[0].text:h.find(E=>E.doc)?.doc||"",x=wb(_);if(!x&&h.length>0){let E=yi(i);x=bi({classification:y,capabilities:E,exports:h.map(I=>({name:I.name,kind:I.kind,classification:I.classification})),fileName:Lb.basename(n)})}return{exports:h,imports:m,events:v,classification:y,summary:x,content:i,parseStatus:"success"}}catch(o){S.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=await rm.parse(n,i);return{...s,content:i,classification:s.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${o.message}`}}catch(s){return S.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}`}}}}Q();import sm from"p-limit";Tt();import am from"path";import pk from"fs";import dk from"os";import ot from"path";import hr from"fs";import{loadConfig as UE,createMatchPath as ZE}from"tsconfig-paths";import Kt from"path";import xi from"fs";var Yt=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function Ob(n){let e;try{e=xi.statSync(n).isDirectory()?n:Kt.dirname(n)}catch(r){throw r.code==="ENOENT"?new Yt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Yt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Yt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Kt.dirname(e);){let r=Kt.join(e,"tsconfig.json");if(xi.existsSync(r))return e;e=Kt.dirname(e)}return null}function Mb(n){let e;try{e=xi.statSync(n).isDirectory()?n:Kt.dirname(n)}catch(r){throw r.code==="ENOENT"?new Yt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Yt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Yt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Kt.dirname(e);){let r=Kt.join(e,"package.json");if(xi.existsSync(r))try{if(JSON.parse(xi.readFileSync(r,"utf8")).workspaces)return e}catch{}e=Kt.dirname(e)}return null}import fr from"path";import _n from"fs";function jb(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=fr.join(n,o);if(!_n.existsSync(s))continue;let a=_n.readdirSync(s);for(let c of a){let l=fr.join(s,c,"package.json");if(_n.existsSync(l))try{let u=JSON.parse(_n.readFileSync(l,"utf8"));u.name&&r.set(u.name,{name:u.name,path:fr.dirname(l),main:u.main||"dist/index.js"})}catch{}}}return r}function Fb(n){let e=new Map;try{let r=JSON.parse(_n.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=fr.dirname(n),c=fr.resolve(a,s),l=fr.join(c,"package.json");if(_n.existsSync(l))try{let u=JSON.parse(_n.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import Ub from"path";import it from"fs";var zE=[".ts",".tsx",".d.ts",".js",".jsx"];function Fe(n){let e=Ub.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(it.existsSync(o)&&it.statSync(o).isFile())return o}if(it.existsSync(n)&&it.statSync(n).isFile())return n}if(it.existsSync(n)&&it.statSync(n).isFile())return n;for(let r of zE){let i=n+r;if(it.existsSync(i)&&it.statSync(i).isFile())return i}if(it.existsSync(n)&&it.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=Ub.join(n,"index"+r);if(it.existsSync(i))return i}return""}import Xt from"path";import AE from"fs";import{builtinModules as DE,createRequire as LE}from"node:module";var Zb=new Set(DE.map(n=>n.replace(/^node:/,"")));function OE(n){let e=n.replace(/^node:/,""),r=e.split("/")[0]||e;return Zb.has(e)||Zb.has(r)}function ME(n){return/^@[^/]+\/[^/]+/.test(n)}function Wb(n){return!!(n.startsWith("#")||n.startsWith("@/")||n.startsWith("~/")||n.startsWith("@")&&!ME(n))}function jE(n,e){try{return LE(e).resolve(n)}catch{return null}}function FE(n,e,r){if(!e||e.size===0)return null;for(let[i,t]of e.entries()){if(i.includes("*")){let o="^"+i.replace(/[\\^$+.()|[\]{}]/g,"\\$&").replace(/\*/g,"(.*)")+"$",s=new RegExp(o),a=n.match(s);if(!a)continue;let c=a[1],l=t.replace("*",c),u=Xt.resolve(r,l);return Fe(u)}if(i===n){let o=Xt.resolve(r,t);return Fe(o)}}return null}function im(n,e,r){if(n.startsWith(".")){let t=Xt.dirname(e),o=Xt.resolve(t,n),s=Fe(o);return s?{resolved:!0,kind:"relative",resolvedPath:s,actionable:!1}:{resolved:!1,kind:"relative",error:`File not found at relative path: ${o}`,suggestion:"Check if the file exists and has a supported extension (.ts, .tsx, .js, .jsx)",actionable:!0}}if(OE(n))return{resolved:!0,kind:"builtin",resolvedPath:n,actionable:!1};let i=Si(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=Fe(o);return s?{resolved:!0,kind:"alias",resolvedPath:s,actionable:!1}:{resolved:!1,kind:"alias",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",actionable:!0}}}if(!n.startsWith("@")&&!n.startsWith("#")){let o=Xt.resolve(i.baseUrl,n),s=Fe(o);if(s)return{resolved:!0,kind:"workspace-package",resolvedPath:s,actionable:!1}}if(n.startsWith("#")){let o=FE(n,i.imports,i.baseUrl);if(o)return{resolved:!0,kind:"alias",resolvedPath:o,actionable:!1}}let t=i.workspacePackages.get(n);if(t){let o=Xt.join(t.path,"src/index.ts");if(AE.existsSync(o))return{resolved:!0,kind:"workspace-package",resolvedPath:o,actionable:!1};let s=Xt.join(t.path,t.main),a=Fe(s);return a?{resolved:!0,kind:"workspace-package",resolvedPath:a,actionable:!1}:{resolved:!1,kind:"workspace-package",error:`Workspace package '${n}' found at ${t.path} but entry point not found`,suggestion:`Check main field in ${Xt.join(t.path,"package.json")}`,actionable:!0}}}else if(Wb(n))return{resolved:!1,kind:"alias",error:"No tsconfig.json found for alias-style import",suggestion:'Ensure tsconfig.json exists and defines the expected "paths" aliases',actionable:!0};if(!n.startsWith("/")&&!n.startsWith(".")){let t=jE(n,e);if(t)return{resolved:!0,kind:"external-package",resolvedPath:t,actionable:!1}}return n.startsWith("#")?{resolved:!1,kind:"alias",error:`Package import alias '${n}' not found in package.json "imports"`,suggestion:'Check package.json "imports" configuration for this alias',actionable:!0}:Wb(n)?{resolved:!1,kind:"alias",error:`Path alias '${n}' not found in tsconfig.json paths`,suggestion:'Check tsconfig.json "paths" configuration',actionable:!0}:{resolved:!1,kind:"missing",error:`Module '${n}' could not be resolved`,suggestion:"Install dependency or check import path",actionable:!0}}var la=new Map;function Si(n){let e=Ob(n);if(!e)return null;if(la.has(e))return la.get(e)||null;let r=UE(e);if(r.resultType==="failed")return la.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?ot.dirname(i.configFileAbsolutePath):e);let o=ZE(t,i.paths,i.mainFields,i.addMatchAll),s=Mb(e),a=new Map;if(s){let p=ot.join(s,"package.json");if(hr.existsSync(p))try{let d=JSON.parse(hr.readFileSync(p,"utf8"));a=jb(s,d)}catch{}}let c=ot.join(e,"package.json");hr.existsSync(c)&&Fb(c).forEach((d,m)=>a.set(m,d));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=ot.join(e,"package.json");if(hr.existsSync(u))try{let p=JSON.parse(hr.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 la.set(e,l),l}function xn(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=xn(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=ot.dirname(e),o=ot.resolve(t,n);return Fe(o)}let i=Si(e);if(i){let t=i.matchPath(n);if(t)return Fe(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=ot.resolve(i.baseUrl,n),a=Fe(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=ot.resolve(i.baseUrl,d);return Fe(m)}}else if(s===n){let c=ot.resolve(i.baseUrl,a);return Fe(c)}let o=i.workspacePackages.get(n);if(o){let s=ot.join(o.path,"src/index.ts");if(hr.existsSync(s))return s;let a=ot.join(o.path,o.main),c=Fe(a);if(c)return c}}return""}import WE from"fs";import HE from"path";import Bb from"js-yaml";function Hb(n){let e=HE.basename(n),r=WE.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return{...VE(r,n),content:r};if(e.endsWith(".graphql")||e.endsWith(".gql"))return{...qE(r,n),content:r};let t="Configuration";return e==="lerna.json"?{...YE(r,n),content:r}:e==="turbo.json"?{...XE(r,n),content:r}:e==="pnpm-workspace.yaml"?{...QE(r,n),content:r}:(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",BE(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",GE(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",JE(r,i)):e==="package.json"&&(t="Project Manifest",KE(r,i)),{configs:i,classification:t,content:r})}function BE(n,e){let r=n.split(`
|
|
753
|
-
`);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
|
|
754
|
-
`);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
|
|
755
|
-
`).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),
|
|
756
|
-
`).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
|
|
757
|
-
`).length:0,r=
|
|
807
|
+
`).length,m=ak(a,d-1);t.push({name:p.name||"anonymous",kind:p.kind||"Unknown",classification:p.classification||"Other",signature:p.signature||u[0],line:d,endLine:m,doc:"",capabilities:JSON.stringify(p.meta||{})})}}let c=Ci({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(l=>({name:l.name,kind:l.kind,classification:l.classification})),fileName:bm.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:c||"Module",parseStatus:t.length>0?"success":"partial"}}};X();import*as _m from"@swc/core";function p_(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.parse=="function"&&typeof e.parseSync=="function"}function lk(){if(p_(_m))return _m;let n=_m;if(p_(n.default))return n.default;throw new Error("SWC runtime unavailable: couldn't resolve parse/parseSync from @swc/core exports")}var d_=lk();function Ni(n,e,r){return d_.parse(n,e,r)}function Sa(n,e,r){return d_.parseSync(n,e,r)}var vm=new xa;async function Ai(n){let e=f_.extname(n);if(vm.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=await m_.promises.readFile(n,"utf-8");return{...await vm.parse(n,o),content:o}}catch(o){return E.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:o.message}}let r;try{r=await m_.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=Xb(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=Sa(i,c)}catch{a=Sa(i,{...c,isModule:!1})}else a=Sa(i,c);let l=a.span.start,u=Qb(r),p=t_(i),d=w=>e_(w,l,r),m=r_(a.body),f=s_(a.body);f.length>0&&E.debug({filePath:n,count:f.length},"Extracted type references"),f.forEach(w=>{m.push({module:"__type_reference__",name:w})});let g=i_(a.body,l,r,i,t,p,n,d,u),$=o_(a.body,l,r,t,d,u),y=ya(n,"","Module"),b=p.length>0&&i.slice(0,p[0].start).trim().length===0?p[0].text:g.find(w=>w.doc)?.doc||"",S=n_(b);if(!S&&g.length>0){let w=Pi(i);S=Ci({classification:y,capabilities:w,exports:g.map(T=>({name:T.name,kind:T.kind,classification:T.classification})),fileName:f_.basename(n)})}return{exports:g,imports:m,events:$,classification:y,summary:S,content:i,parseStatus:"success"}}catch(o){E.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=await vm.parse(n,i);return{...s,content:i,classification:s.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${o.message}`}}catch(s){return E.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}`}}}}X();import $m from"p-limit";Ft();import wm from"path";import Wk from"fs";import Zk from"os";import _t from"path";import Rr from"fs";import{loadConfig as bk,createMatchPath as _k}from"tsconfig-paths";import pn from"path";import zi from"fs";var dn=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function h_(n){let e;try{e=zi.statSync(n).isDirectory()?n:pn.dirname(n)}catch(r){throw r.code==="ENOENT"?new dn("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new dn("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new dn("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==pn.dirname(e);){let r=pn.join(e,"tsconfig.json");if(zi.existsSync(r))return e;e=pn.dirname(e)}return null}function g_(n){let e;try{e=zi.statSync(n).isDirectory()?n:pn.dirname(n)}catch(r){throw r.code==="ENOENT"?new dn("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new dn("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new dn("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==pn.dirname(e);){let r=pn.join(e,"package.json");if(zi.existsSync(r))try{if(JSON.parse(zi.readFileSync(r,"utf8")).workspaces)return e}catch{}e=pn.dirname(e)}return null}import Tr from"path";import Dn from"fs";function y_(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=Tr.join(n,o);if(!Dn.existsSync(s))continue;let a=Dn.readdirSync(s);for(let c of a){let l=Tr.join(s,c,"package.json");if(Dn.existsSync(l))try{let u=JSON.parse(Dn.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 b_(n){let e=new Map;try{let r=JSON.parse(Dn.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(Dn.existsSync(l))try{let u=JSON.parse(Dn.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import __ from"path";import bt from"fs";var uk=[".ts",".tsx",".d.ts",".js",".jsx"];function qe(n){let e=__.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(bt.existsSync(o)&&bt.statSync(o).isFile())return o}if(bt.existsSync(n)&&bt.statSync(n).isFile())return n}if(bt.existsSync(n)&&bt.statSync(n).isFile())return n;for(let r of uk){let i=n+r;if(bt.existsSync(i)&&bt.statSync(i).isFile())return i}if(bt.existsSync(n)&&bt.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=__.join(n,"index"+r);if(bt.existsSync(i))return i}return""}import mn from"path";import pk from"fs";import{builtinModules as dk,createRequire as mk}from"node:module";var v_=new Set(dk.map(n=>n.replace(/^node:/,"")));function fk(n){let e=n.replace(/^node:/,""),r=e.split("/")[0]||e;return v_.has(e)||v_.has(r)}function hk(n){return/^@[^/]+\/[^/]+/.test(n)}function x_(n){return!!(n.startsWith("#")||n.startsWith("@/")||n.startsWith("~/")||n.startsWith("@")&&!hk(n))}function gk(n,e){try{return mk(e).resolve(n)}catch{return null}}function yk(n,e,r){if(!e||e.size===0)return null;for(let[i,t]of e.entries()){if(i.includes("*")){let o="^"+i.replace(/[\\^$+.()|[\]{}]/g,"\\$&").replace(/\*/g,"(.*)")+"$",s=new RegExp(o),a=n.match(s);if(!a)continue;let c=a[1],l=t.replace("*",c),u=mn.resolve(r,l);return qe(u)}if(i===n){let o=mn.resolve(r,t);return qe(o)}}return null}function xm(n,e,r){if(n.startsWith(".")){let t=mn.dirname(e),o=mn.resolve(t,n),s=qe(o);return s?{resolved:!0,kind:"relative",resolvedPath:s,actionable:!1}:{resolved:!1,kind:"relative",error:`File not found at relative path: ${o}`,suggestion:"Check if the file exists and has a supported extension (.ts, .tsx, .js, .jsx)",actionable:!0}}if(fk(n))return{resolved:!0,kind:"builtin",resolvedPath:n,actionable:!1};let i=Di(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=qe(o);return s?{resolved:!0,kind:"alias",resolvedPath:s,actionable:!1}:{resolved:!1,kind:"alias",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",actionable:!0}}}if(!n.startsWith("@")&&!n.startsWith("#")){let o=mn.resolve(i.baseUrl,n),s=qe(o);if(s)return{resolved:!0,kind:"workspace-package",resolvedPath:s,actionable:!1}}if(n.startsWith("#")){let o=yk(n,i.imports,i.baseUrl);if(o)return{resolved:!0,kind:"alias",resolvedPath:o,actionable:!1}}let t=i.workspacePackages.get(n);if(t){let o=mn.join(t.path,"src/index.ts");if(pk.existsSync(o))return{resolved:!0,kind:"workspace-package",resolvedPath:o,actionable:!1};let s=mn.join(t.path,t.main),a=qe(s);return a?{resolved:!0,kind:"workspace-package",resolvedPath:a,actionable:!1}:{resolved:!1,kind:"workspace-package",error:`Workspace package '${n}' found at ${t.path} but entry point not found`,suggestion:`Check main field in ${mn.join(t.path,"package.json")}`,actionable:!0}}}else if(x_(n))return{resolved:!1,kind:"alias",error:"No tsconfig.json found for alias-style import",suggestion:'Ensure tsconfig.json exists and defines the expected "paths" aliases',actionable:!0};if(!n.startsWith("/")&&!n.startsWith(".")){let t=gk(n,e);if(t)return{resolved:!0,kind:"external-package",resolvedPath:t,actionable:!1}}return n.startsWith("#")?{resolved:!1,kind:"alias",error:`Package import alias '${n}' not found in package.json "imports"`,suggestion:'Check package.json "imports" configuration for this alias',actionable:!0}:x_(n)?{resolved:!1,kind:"alias",error:`Path alias '${n}' not found in tsconfig.json paths`,suggestion:'Check tsconfig.json "paths" configuration',actionable:!0}:{resolved:!1,kind:"missing",error:`Module '${n}' could not be resolved`,suggestion:"Install dependency or check import path",actionable:!0}}var $a=new Map;function Di(n){let e=h_(n);if(!e)return null;if($a.has(e))return $a.get(e)||null;let r=bk(e);if(r.resultType==="failed")return $a.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?_t.dirname(i.configFileAbsolutePath):e);let o=_k(t,i.paths,i.mainFields,i.addMatchAll),s=g_(e),a=new Map;if(s){let p=_t.join(s,"package.json");if(Rr.existsSync(p))try{let d=JSON.parse(Rr.readFileSync(p,"utf8"));a=y_(s,d)}catch{}}let c=_t.join(e,"package.json");Rr.existsSync(c)&&b_(c).forEach((d,m)=>a.set(m,d));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=_t.join(e,"package.json");if(Rr.existsSync(u))try{let p=JSON.parse(Rr.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 $a.set(e,l),l}function Ln(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=Ln(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=_t.dirname(e),o=_t.resolve(t,n);return qe(o)}let i=Di(e);if(i){let t=i.matchPath(n);if(t)return qe(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=_t.resolve(i.baseUrl,n),a=qe(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=_t.resolve(i.baseUrl,d);return qe(m)}}else if(s===n){let c=_t.resolve(i.baseUrl,a);return qe(c)}let o=i.workspacePackages.get(n);if(o){let s=_t.join(o.path,"src/index.ts");if(Rr.existsSync(s))return s;let a=_t.join(o.path,o.main),c=qe(a);if(c)return c}}return""}import vk from"fs";import xk from"path";import $_ from"js-yaml";function S_(n){let e=xk.basename(n),r=vk.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return{...Ek(r,n),content:r};if(e.endsWith(".graphql")||e.endsWith(".gql"))return{...kk(r,n),content:r};let t="Configuration";return e==="lerna.json"?{...Tk(r,n),content:r}:e==="turbo.json"?{...Rk(r,n),content:r}:e==="pnpm-workspace.yaml"?{...Pk(r,n),content:r}:(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",Sk(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",$k(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",wk(r,i)):e==="package.json"&&(t="Project Manifest",Ik(r,i)),{configs:i,classification:t,content:r})}function Sk(n,e){let r=n.split(`
|
|
808
|
+
`);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 $k(n,e){try{let r=$_.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 wk(n,e){let r=n.split(`
|
|
809
|
+
`);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 Ek(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 kk(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 Ik(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 Tk(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 Rk(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 Pk(n,e){let r=[],i="Monorepo (pnpm) ";try{let t=$_.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}}X();import w_ from"fs";import Ck from"path";import E_ from"js-yaml";var k_={ignore:[],include:[],maxDepth:10},Nk=[{name:".liquid-shadow.yaml",parse:n=>E_.load(n)??{}},{name:".liquid-shadow.yml",parse:n=>E_.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 wa(n){for(let{name:e,parse:r}of Nk){let i=Ck.join(n,e);if(w_.existsSync(i))try{let t=w_.readFileSync(i,"utf8"),o=r(t);return E.debug({repoPath:n,configFile:e},"Loaded repository configuration"),{...k_,...o}}catch(t){E.error({repoPath:n,file:e,err:t},"Failed to parse configuration file")}}return k_}ee();Je();X();Pn();import{Worker as Ak}from"node:worker_threads";import{cpus as zk}from"node:os";import{fileURLToPath as Dk}from"node:url";import{dirname as Lk,join as Ok}from"node:path";import{existsSync as Mk}from"node:fs";var I_=Dk(import.meta.url),jk=Lk(I_),Fk=I_.endsWith(".ts");function Uk(){if(Fk)return null;let n=Ok(jk,"worker.js");return Mk(n)?n:et("dist/logic/parser/worker.js")}var Sm=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,zk().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{E.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,E.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=Uk();if(!e)throw new Error("Parser worker pool not available in development mode (tsx). Use main-thread fallback.");E.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 Ak(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),E.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),E.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=>{E.error({err:u},"Failed to replace crashed parser worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&E.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}E.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,E.info("Parser worker pool shutdown complete")}},Pr=null;function T_(n){return Pr||(Pr=new Sm(n)),Pr}async function R_(){Pr&&(await Pr.shutdown(),Pr=null)}ee();X();cn();sm();am();cm();import{execSync as P_}from"child_process";var Ea=E.child({module:"heritage-analyzer"}),Cr=class{repos;repoPath;constructor(e){this.repos=N.getInstance(e),this.repoPath=e}analyzeHeritage(e=20){try{Ea.info({limit:e},"Analyzing repository heritage...");let r=P_(`git log -n ${e} --pretty=format:"%H|%at|%an|%s"`,{cwd:this.repoPath,encoding:"utf-8"});if(!r)return;let i=r.split(`
|
|
810
|
+
`).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),Ea.debug({sha:o,subject:c},"Logged heritage move")}}Ea.info("Heritage analysis complete.")}catch(r){Ea.warn({err:r.message},"Failed to run heritage analysis")}}analyzeCommitImpact(e){let r=new Set,i=0;try{let o=P_(`git diff-tree --no-commit-id --name-only -r ${e}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
|
|
811
|
+
`).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 lm.some(i=>i.test(r))?"Test":ra.some(i=>i.test(r))||na.some(i=>i.test(r))?"Entry":Ti.some(i=>i.test(r))?"Data":oa.some(i=>i.test(r))?"Utility":sa.some(i=>i.test(r))?"Entry":aa.some(i=>i.test(r))?"Data":ca.some(i=>i.test(r))?"Entry":la.some(i=>i.test(r))?"Data":um.some(i=>i.test(r))?"Infrastructure":/\.(service|logic|usecase|interactor|manager)\.(ts|js|php|py)$/i.test(r)||ia.some(i=>i.test(r))?"Logic":"Unknown"}};var Hk=Zk.cpus().length||4,Bk=Ps.DEFAULT_CONCURRENCY;function A_(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&&A_(r.members,e));return e}function C_(n){if(typeof n!="number"||!Number.isFinite(n))return null;let e=Math.trunc(n);return e>0?e:null}function z_(n){let e=typeof n?.content=="string"&&n.content.length>0?n.content.split(`
|
|
812
|
+
`).length:0,r=A_(n?.exports),i=0,t=0,o=0,s=0;for(let a of r){let c=C_(a?.line??a?.start_line),l=C_(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 Gk(n){let e=z_(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 N_(n){let e=z_(n);return e.valid*2+e.multiLine*2-e.eofCollapsed*3-e.invalid*4}async function ae(n,e=Bk,r=!1,i=!0,t){let o=N.getInstance(n),s=o.files.database,a=wa(n),c=a.concurrency??e;if(wb(),!r&&Et(n)){let y=Ms(n),v=Qe(n);if(y&&!Qg(n,y))return fm(),E.debug({repoPath:n,commit:v},"Index is current, skipping re-index (fast-path)"),s}Di(n);let l=o.files.findAll(),u=new Map(l.map(y=>[y.path,{mtime:y.mtime,hash:y.content_hash}])),p=Date.now();t?.({phase:"scan",current:0,total:0,message:"Scanning repository..."});let d=await Yb(n,a.ignore),m=new Map(d.map(y=>[y.path,y.mtime])),f=l.filter(y=>!m.has(y.path)).map(y=>y.path),g=l.length===0,$=[];if(r||g)$.push(...d);else{let y=d.filter(w=>{let T=u.get(w.path);return!T||T.mtime!==w.mtime}),v=$m(c*4),b=y.map(w=>v(async()=>{let T=u.get(w.path);if(!T||!T.hash)return w;try{let z=await Wk.promises.readFile(w.path,"utf8");return ay(z,T.hash)?w:(o.files.updateMtime(w.path,w.mtime),null)}catch{return null}})),S=await Promise.all(b);$.push(...S.filter(w=>w!==null))}if(f.length===0&&$.length===0){fm();let y=Qe(n);return Kd(n,y||void 0),s}if(g?E.info({totalFiles:d.length},"Starting initial repository indexing..."):E.info({toDelete:f.length,toProcess:$.length},"Syncing repository updates..."),f.length>0&&o.files.deletePaths(f),$.length>0){kb(),i?(vr(!0),br().initialize().catch(()=>{})):vr(!1);let y=/\.(ts|tsx|php|py|go|js|jsx|mjs|cjs)$/,v=[],b=[];for(let O of $)y.test(wm.basename(O.path))?v.push(O):b.push(O);let S=0,w=$.length,T=!1,z=T_();try{await z.initialize(),T=!0,E.info({workers:z.workerCount},"Parser worker pool active")}catch(O){E.warn({err:O},"Parser worker pool failed to initialize, falling back to main-thread parsing"),T=!1}let D=async(O,q)=>{let L=q;if(T&&Gk(q))try{let J=await Ai(O.path);N_(J)>N_(q)&&(E.warn({filePath:O.path},"Detected suspicious worker parse ranges; using main-thread parse output"),L=J)}catch(J){E.warn({filePath:O.path,err:J instanceof Error?J.message:String(J)},"Main-thread parse retry failed after suspicious worker parse")}let G=L.imports?.map(J=>({...J,resolved_path:Ln(J.module,O.path,n)})),re=L.content?gr(L.content):null;return S++,(S%50===0||S===w)&&E.info({completed:S,total:w},"Parsing files..."),t?.({phase:"parse",current:S,total:w,message:`Parsing ${wm.basename(O.path)}`}),{meta:O,...L,imports:G,embedding:null,kind:"code",contentHash:re}},C;if(T)C=v.map(O=>z.parseFile(O.path).then(q=>D(O,q),q=>(S++,E.error({path:O.path,error:q},"Worker parse failed"),{meta:O,exports:[],imports:[],content:"",kind:"error"})));else{let O=g?Math.max(c,Math.min(Hk-1,16)):c,q=$m(O);C=v.map(L=>q(async()=>{try{let G=await Ai(L.path);return D(L,G)}catch(G){return S++,E.error({path:L.path,error:G},"Failed to parse file"),{meta:L,exports:[],imports:[],content:"",kind:"error"}}}))}let I=$m(c),A=b.map(O=>I(async()=>{try{let q=S_(O.path),L=q.content?gr(q.content):null;return S++,(S%50===0||S===w)&&E.info({completed:S,total:w},"Parsing configs..."),t?.({phase:"parse",current:S,total:w,message:`Parsing config ${wm.basename(O.path)}`}),{meta:O,...q,embedding:null,kind:"config",contentHash:L}}catch(q){return S++,E.error({path:O.path,error:q},"Failed to parse config"),{meta:O,exports:[],imports:[],content:"",kind:"error"}}}));E.info({total:w,codeFiles:v.length,configFiles:b.length,useParserPool:T},"Phase 1: Parsing all files...");let M=Date.now(),H=(await Promise.all([...C,...A])).filter(Boolean),Y=Date.now()-M;if(Ri("parse",Y),E.info({count:H.length,time:`${(Y/1e3).toFixed(1)}s`},"Phase 1 complete"),T&&R_().catch(()=>{}),s.pragma("synchronous = NORMAL"),s.pragma("cache_size = -64000"),i){let O=[];H.forEach((x,j)=>{"summary"in x&&x.summary&&O.push({fileIdx:j,text:x.summary})}),E.info("Phase 2+3: Generating file-summary embeddings + persisting in parallel..."),t?.({phase:"embed",current:0,total:H.length,message:"Generating embeddings..."});let q=Date.now(),L=(async()=>{let x=[];return O.length>0&&(E.info({count:O.length}," \u2192 Generating file summary embeddings..."),x=await rm(O.map(j=>j.text),256),E.info({count:O.length}," \u2713 File summaries complete")),x})();t?.({phase:"persist",current:0,total:H.length,message:"Saving to database..."});let G=Date.now();o.files.batchSaveIndexResults(H,n,gr,Ln);let re=Date.now()-G;Ri("persist",re),E.info({time:`${(re/1e3).toFixed(1)}s`},"Structural persist complete");let J=await L,_=Date.now()-q;if(Ri("embed",_),E.info({time:`${(_/1e3).toFixed(1)}s`},"File-summary embeddings complete"),J.length>0){let x=s.prepare("UPDATE files SET embedding = ? WHERE path = ?"),j=s.transaction(B=>{for(let K of B)x.run(K.embedding?JSON.stringify(K.embedding):null,K.path)}),P=O.map((B,K)=>({path:H[B.fileIdx].meta.path,embedding:J[K]}));j(P),E.info({count:P.length},"File embedding column updated")}}else{t?.({phase:"persist",current:0,total:H.length,message:"Saving to database..."});let O=Date.now();o.files.batchSaveIndexResults(H,n,gr,Ln),Ri("persist",Date.now()-O)}s.pragma("synchronous = FULL"),s.pragma("cache_size = -2000")}if(g||$.length>0){let y=Qe(n);Kd(n,y||void 0)}if(i&&!gb(n)&&yb(n),($.length>0||f.length>0)&&new Ve(n).detectAndRepairShifts(),g||i)try{new Cr(n).analyzeHeritage(50)}catch(y){E.warn({err:y.message},"Heritage sync deferred")}return Eb(Date.now()-p),t?.({phase:"complete",current:$.length,total:$.length,message:"Indexing complete"}),s}import tt from"path";import km from"fs";X();import Ie from"path";import Em from"fs";var ka=E.child({module:"path-resolver"}),Nr=class{repoPath;constructor(e){this.repoPath=Ie.isAbsolute(e)?Ie.normalize(e):Ie.resolve(process.cwd(),e)}resolve(e){if(!e)return this.repoPath;if(e.includes("\0"))throw ka.error({inputPath:e},"Path contains null bytes - possible attack"),new Error("Invalid path: contains null bytes");let r;if(Ie.isAbsolute(e)?r=Ie.normalize(e):r=Ie.join(this.repoPath,e),r=Ie.normalize(r),!this.isWithinRoot(r))throw ka.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 Em.existsSync(r)?r:(ka.debug({inputPath:e,resolved:r},"Path does not exist"),null)}catch(r){return ka.error({inputPath:e,error:r},"Error validating path"),null}}isWithinRoot(e){try{let r=Ie.resolve(e),i=Ie.resolve(this.repoPath),t=Ie.relative(i,r);if(t.startsWith("..")||Ie.isAbsolute(t))return!1;if(Em.existsSync(r)){let s=Em.realpathSync(r),a=Ie.relative(i,s);if(a.startsWith("..")||Ie.isAbsolute(a))return!1}return!0}catch{return!1}}getRelative(e){let r=Ie.normalize(e);return Ie.relative(this.repoPath,r)}resolveBatch(e){return e.map(r=>this.resolve(r))}static normalize(e){return Ie.normalize(e)}static isPathWithinRoot(e,r){let i=Ie.resolve(e),t=Ie.resolve(r),o=Ie.relative(i,t);return o===""||!o.startsWith("..")&&!Ie.isAbsolute(o)}};function D_(n){return new Nr(n)}var Jk=/[\x00-\x1f\x7f]/g,Vk=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function Ar(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(Jk,"").length!==n.length)throw new Error("Invalid path: control characters are not allowed");return n.trim()}function zr(n,e=4096){if(typeof n!="string")return"";let r=n.replace(Vk,"").trim();return r.length>e?r.slice(0,e):r}Ft();var Li=`
|
|
758
813
|
|
|
759
|
-
To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function
|
|
814
|
+
To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function fn(n,e,r){return{content:[{type:"text",text:`[${n}] ${e}`}],isError:!0,errorCode:n,errorDetails:r}}function Kk(n){let e=tt.isAbsolute(n)?tt.normalize(n):tt.resolve(process.cwd(),n),r=tt.parse(e).root;for(;e!==r;){if(km.existsSync(tt.join(e,".liquid-shadow.db"))||km.existsSync(tt.join(e,".git"))||km.existsSync(tt.join(e,"package.json")))return e;let i=tt.dirname(e);if(i===e)break;e=i}return null}function ze(n){let e=n?.repoPath?String(n.repoPath):void 0,r=n?.filePath?String(n.filePath):void 0;e&&(e=Ar(e)),r&&(r=Ar(r));let i;if(e)tt.isAbsolute(e)||(e=tt.resolve(process.cwd(),e)),i=e;else if(r){let s=tt.resolve(process.cwd(),r);i=Kk(tt.dirname(s))||process.cwd()}else i=process.cwd();i=tt.normalize(i);let t=D_(i),o;return r&&(o=t.resolve(r)),{...n,repoPath:i,filePath:o,resolver:t}}function L_(n,e){if(!Et(n)){let r=`Repository not indexed yet. Run initial indexing first:
|
|
760
815
|
|
|
761
816
|
1. shadow_recon_onboard({ repoPath: "${n}" }) // one-time
|
|
762
817
|
2. shadow_sync_trace({ repoPath: "${n}" }) // then sync
|
|
763
818
|
|
|
764
|
-
After that, ${e} and other tools will work
|
|
765
|
-
`),s=new Array(o.length).fill(0);for(let d=0;d<o.length;d++){let m=o[d].toLowerCase(),f=0,
|
|
819
|
+
After that, ${e} and other tools will work.`+Li;return fn("FILE_NOT_FOUND",r,{repoPath:n,toolName:e,requiresIndexing:!0})}return null}ee();var hn=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(`
|
|
820
|
+
`),s=new Array(o.length).fill(0);for(let d=0;d<o.length;d++){let m=o[d].toLowerCase(),f=0,g=0;for(let $ of t)m.includes($)&&(f++,g++);(m.includes("export ")||m.includes("class ")||m.includes("function ")||m.includes("interface "))&&(f+=1),s[d]=g*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(`
|
|
766
821
|
`).trim();return a>0&&(p=`...
|
|
767
822
|
`+p),a+l<o.length&&(p=p+`
|
|
768
|
-
...`),p.length>i?p.slice(0,i)+"...":p}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}};
|
|
823
|
+
...`),p.length>i?p.slice(0,i)+"...":p}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}};Je();ee();X();var gn=E.child({module:"clean-sweep"}),Im=class{files;intentLogs;constructor(e){let{files:r,intentLogs:i}=N.getInstance(e);this.files=r,this.intentLogs=i}pruneOrphans(){gn.info("Starting orphan pruning...");let e=0,r=0,i=this.intentLogs.findOrphans();gn.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++,gn.debug({logId:s.id,symbolName:s.symbol_name},"Converted to lapsed intent")):(this.intentLogs.delete(s.id),e++,gn.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 gn.info({deleted:e,converted:r},"Orphan pruning complete"),{deleted:e,converted:r,retained:o}}},Tm=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)}))}},Rm=class{missions;constructor(e){let{missions:r}=N.getInstance(e);this.missions=r}findColdMissions(){let e=Math.floor(Date.now()/1e3)-604800,r=this.missions.findColdMissions(e,10);return gn.info({count:r.length},"Found cold missions for compaction"),r}markDistilled(e){this.missions.update(e,{status:"distilled"})}},Dr=class{pruner;scorer;compactor;constructor(e){this.pruner=new Im(e),this.scorer=new Tm,this.compactor=new Rm(e)}runMaintenance(){gn.info("Initiating Clean Sweep maintenance protocol...");let e=this.pruner.pruneOrphans(),r=this.compactor.findColdMissions();return gn.info("Clean Sweep maintenance complete"),{pruning:e,compaction:{eligible:r.length}}}getScorer(){return this.scorer}getCompactor(){return this.compactor}};ee();X();var O_=E.child({module:"lineage-service"}),Oi=class{repoPath;constructor(e){this.repoPath=e}getAncestorMissionIds(e=50){try{let r=Cs(this.repoPath,e);if(r.length===0)return[];let{missions:i}=N.getInstance(this.repoPath),o=i.findByCommitShas(r).map(s=>s.id);return o.length>0&&O_.debug({count:o.length},"Identified ancestor missions for gravity bleed"),o}catch(r){return O_.warn({err:r.message},"Failed to identify ancestor missions"),[]}}};var Yk={Solid:1,Liquid:.8,Virtual:.4,Intel:.2,Phantom:.05},vt=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 Yk[i]}};X();function Xk(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 Qk(n,e){let r=Xk(n.toLowerCase(),e.toLowerCase()),i=Math.max(n.length,e.length);return Math.round((i-r)/i*100)}function M_(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 eI(n,e){let r=M_(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 tI(n,e){return M_(e).map(t=>t[0].toLowerCase()).join("")===n.toLowerCase()}function nI(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 tI(n,e)?{matchType:"acronym",score:75}:eI(n,e)?{matchType:"camel-case",score:65}:{matchType:"levenshtein",score:Qk(n,e)*.6}}function Mi(n,e,r=50,i=5){let t=[];for(let o of e){let{matchType:s,score:a}=nI(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)}yt();var Pt=class n{constructor(e){this.repoPath=e}get filesRepo(){return N.getInstance(this.repoPath).files}get exportsRepo(){return N.getInstance(this.repoPath).exports}get intentLogsRepo(){return N.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?vt.mapClassificationToTier(t):vt.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?Ue.FILTERED_QUERY_LIMIT_MULTIPLIER:1),ve.MAX_LIMIT)).map(v=>({...v,source:"path",keywordHits:this.countPathKeywordHits(v.path,a),relevance:this.scorePathResult(v.path,a,"path",c)}));o&&(l=l.filter(v=>n.matchesFilters(v.path,t,v.mtime,v.classification))),c&&a.length>=3&&(l=l.filter(v=>v.source==="symbol"||v.keywordHits>=2));let u=this.findSymbolBackedPaths(e,a,r*3),p=new Set(l.map(v=>v.path));for(let v of u){if(p.has(v))continue;let b=this.filesRepo.findByPath(v);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)}),p.add(v)))}l.sort((v,b)=>b.relevance-v.relevance),o||(l=l.slice(0,Math.min(r*4,ve.MAX_LIMIT)));let d=l.length;if(d===0)return{content:[{type:"text",text:`No indexed files match path/filename: "${e}".
|
|
769
824
|
|
|
770
|
-
If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};let m=
|
|
825
|
+
If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};let m=v=>v.replace(this.repoPath,"").replace(/^\//,"");if(s){let b=new Se(this.repoPath).getSection("gravity"),S=new Map;if(b?.hotspots)for(let I of b.hotspots){let A=S.get(I.filePath)||0;S.set(I.filePath,A+I.gravity)}let w=l.map(I=>{let A=S.get(I.path)||0,M=I.classification?vt.mapClassificationToTier(I.classification):vt.classify(I.path);return{...I,gravity:A,layer:M}});w.sort((I,A)=>A.gravity!==I.gravity?A.gravity-I.gravity:A.relevance!==I.relevance?A.relevance-I.relevance:I.path.localeCompare(A.path));let T=w.slice(i,i+r),z=i+r<d;if(T.length===0)return{content:[{type:"text",text:`No results at offset ${i}. Total matches: ${d}.`}]};let D=z?`
|
|
771
826
|
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"";return{content:[{type:"text",text:`# Resolved paths: "${e}" (Ranked by Gravity)
|
|
772
827
|
|
|
773
|
-
Showing ${
|
|
828
|
+
Showing ${T.length} of ${d} file(s) (offset: ${i}, limit: ${r})${D}
|
|
774
829
|
|
|
775
|
-
`+
|
|
830
|
+
`+T.map((I,A)=>{let M=I.gravity>50?" \u269B\uFE0F":I.gravity>0?" \u2022":"",H=I.gravity>0?` [G:${Math.round(I.gravity)}]`:"",Y=I.source==="symbol"?" [via symbol]":"";return`${i+A+1}. \`${m(I.path)}\` (${I.layer})${M}${H}${Y}`}).join(`
|
|
776
831
|
`)+`
|
|
777
832
|
|
|
778
|
-
> **Legend**: \u269B\uFE0F = High-gravity hotspot (>50), \u2022 = Has gravity, G = Gravity score`}]}}let f=l.slice(i,i+r),
|
|
833
|
+
> **Legend**: \u269B\uFE0F = High-gravity hotspot (>50), \u2022 = Has gravity, G = Gravity score`}]}}let f=l.slice(i,i+r),g=i+r<d;if(f.length===0)return{content:[{type:"text",text:`No results at offset ${i}. Total matches: ${d}.`}]};let $=g?`
|
|
779
834
|
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"";return{content:[{type:"text",text:`# Resolved paths: "${e}"
|
|
780
835
|
|
|
781
|
-
Showing ${f.length} of ${d} file(s) (offset: ${i}, limit: ${r})${
|
|
836
|
+
Showing ${f.length} of ${d} file(s) (offset: ${i}, limit: ${r})${$}
|
|
782
837
|
|
|
783
|
-
`+f.map((b
|
|
784
|
-
`)}]}}async searchByConcept(e,r,i,t,o,s=!1,a){
|
|
785
|
-
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",
|
|
786
|
-
> _Compact mode: snippets omitted_`:
|
|
787
|
-
> _Adaptive compression enabled under token budget._`:""
|
|
788
|
-
> _${
|
|
838
|
+
`+f.map((v,b)=>{let S=v.source==="symbol"?" [via symbol]":"";return`${i+b+1}. \`${m(v.path)}\`${v.classification?` (${v.classification})`:""}${S}`}).join(`
|
|
839
|
+
`)}]}}async searchByConcept(e,r,i,t,o,s=!1,a){E.info({repoPath:this.repoPath,query:e},"Searching by concept (Semantic Analysis)...");let c=await nm(e),l=S=>S.replace(this.repoPath,"").replace(/^\//,""),u=hn.extractKeywords(e),p=this.classifyConceptQuery(e,u),d=this.getConceptConfidenceFloor(p.profile),m=this.getIntentConfidenceFloor(p.profile),f=Math.min(Math.max((r+i)*2,r),ve.MAX_LIMIT),g=await this.findConceptMatches(e,c,t,o,f,0),$=c?await this.findIntentLogMatches(c,5):[],y=g.filter(S=>(S.score||0)>=d),v=g.filter(S=>(S.score||0)<d),b=$.filter(S=>(S.score||0)>=m);if(y.length>0){let S=y.length,w=y.slice(i,i+r),z=i+r<S?`
|
|
840
|
+
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",D=s?`
|
|
841
|
+
> _Compact mode: snippets omitted_`:S>20&&!s?"\n> \u{1F4A1} **Tip**: Use `compact: true` to reduce output size (omits snippets).":"",C=a&&a>0?`
|
|
842
|
+
> _Adaptive compression enabled under token budget._`:"",I=v.length>0?`
|
|
843
|
+
> _${v.length} lower-confidence candidate(s) were suppressed below the ${Math.round(d*100)}% evidence floor._`:"",A=`# Semantic Concept Search: "${e}"
|
|
789
844
|
|
|
790
|
-
Showing ${
|
|
845
|
+
Showing ${w.length} of ${S} high-confidence file(s) (offset: ${i}, limit: ${r})${z}${D}${C}${I}
|
|
791
846
|
|
|
792
|
-
`,
|
|
793
|
-
> \u26A0\uFE0F **STRATEGIC RISK**: High-gravity hotspot (${
|
|
794
|
-
> **Rationale**: ${
|
|
847
|
+
`,H=new Se(this.repoPath).getSection("gravity"),Y=new Map;if(H?.hotspots)for(let G of H.hotspots)Y.set(G.filePath,G.gravity);let O=w.map((G,re)=>{let J=l(G.path),_=Math.round((G.score||0)*100),j=Y.get(G.path)?" \u269B\uFE0F":"";return`${i+re+1}. \`${J}\`${j} (${_}% evidence) - ${G.summary||"No summary"}`}),q=w.map((G,re)=>{let J=l(G.path),_=Math.round((G.score||0)*100),x=Y.get(G.path),j=x?" \u269B\uFE0F **CORE**":"",P=x&&x>50?`
|
|
848
|
+
> \u26A0\uFE0F **STRATEGIC RISK**: High-gravity hotspot (${x.toFixed(0)}). Modifications may have significant architectural impact.`:"",B=`## ${i+re+1}. ${J}${j} (${_}% Evidence Match)
|
|
849
|
+
> **Rationale**: ${G.rationale}${P}
|
|
795
850
|
|
|
796
|
-
`+(
|
|
851
|
+
`+(G.snippet?`**Matched Snippet**:
|
|
797
852
|
\`\`\`typescript
|
|
798
|
-
${
|
|
853
|
+
${G.snippet}
|
|
799
854
|
\`\`\`
|
|
800
855
|
|
|
801
|
-
`:"")+`**Summary**: ${
|
|
802
|
-
`;return{index:i+
|
|
803
|
-
`);else if(a&&a>0){let
|
|
804
|
-
`),
|
|
856
|
+
`:"")+`**Summary**: ${G.summary||"No summary available"}
|
|
857
|
+
`;return{index:i+re+1,relativePath:J,matchPct:_,gravity:x,text:B}}),L="";if(s)L=A+O.join(`
|
|
858
|
+
`);else if(a&&a>0){let G=Math.max(80,Math.floor(a*.12)),re=this.estimateTokenCount(A),J=[],_=[];for(let x of q){let j=this.estimateTokenCount(x.text),P=re+j<=a-G;if(J.length<2||P)J.push(x.text),re+=j;else{let B=x.gravity?" \u269B\uFE0F":"";_.push(`${x.index}. \`${x.relativePath}\`${B} (${x.matchPct}% Evidence Match)`)}}L=A+J.join(`
|
|
859
|
+
`),_.length>0&&(L+=`
|
|
805
860
|
|
|
806
|
-
### Folded Lower-Relevance Matches (${
|
|
861
|
+
### Folded Lower-Relevance Matches (${_.length})
|
|
807
862
|
_Expanded blocks omitted to stay within token budget._
|
|
808
|
-
`+
|
|
809
|
-
`))}else
|
|
810
|
-
`);if(
|
|
863
|
+
`+_.join(`
|
|
864
|
+
`))}else L=A+q.map(G=>G.text).join(`
|
|
865
|
+
`);if(b.length>0){let G=`
|
|
811
866
|
|
|
812
867
|
---
|
|
813
|
-
## Intent Vectors (${
|
|
868
|
+
## Intent Vectors (${b.length} matching decision(s))
|
|
814
869
|
|
|
815
|
-
`+
|
|
816
|
-
> ${
|
|
870
|
+
`+b.map((J,_)=>{let x=Math.round((J.score||0)*100),j=J.symbolName?` \`${J.symbolName}\``:"",P=J.missionId?` [Mission #${J.missionId}]`:"",B=J.content.length>200?J.content.slice(0,200)+"...":J.content;return s?`${_+1}. **[${J.type}]**${j}${P} (${x}%) - ${B}`:`### ${_+1}. [${J.type}]${j}${P} (${x}% Evidence Match)
|
|
871
|
+
> ${B}
|
|
817
872
|
`}).join(`
|
|
818
|
-
`),
|
|
873
|
+
`),re=`
|
|
819
874
|
|
|
820
875
|
---
|
|
821
|
-
## Intent Vectors (${
|
|
876
|
+
## Intent Vectors (${b.length} matching decision(s))
|
|
822
877
|
|
|
823
|
-
`+
|
|
824
|
-
`)+(
|
|
825
|
-
> Additional intent matches folded by token budget.`:"");a&&a>0&&this.estimateTokenCount(
|
|
878
|
+
`+b.slice(0,2).map((J,_)=>{let x=Math.round((J.score||0)*100),j=J.symbolName?` \`${J.symbolName}\``:"",P=J.missionId?` [Mission #${J.missionId}]`:"";return`${_+1}. **[${J.type}]**${j}${P} (${x}%)`}).join(`
|
|
879
|
+
`)+(b.length>2?`
|
|
880
|
+
> Additional intent matches folded by token budget.`:"");a&&a>0&&this.estimateTokenCount(L+G)>a?L+=re:L+=G}return{content:[{type:"text",text:L}]}}if(i===0){let S=this.filesRepo.getStats(),w=e.toLowerCase().split(/\s+/),T=this.filesRepo.findByPathKeywords(w,r);if(o&&(T=T.filter(z=>n.matchesFilters(z.path,t,z.mtime,z.classification))),T.length>0)return{content:[{type:"text",text:`# Concept Search: "${e}"
|
|
826
881
|
|
|
827
|
-
\u26A0\uFE0F No high-confidence semantic matches cleared the ${Math.round(d*100)}% evidence floor (${
|
|
882
|
+
\u26A0\uFE0F No high-confidence semantic matches cleared the ${Math.round(d*100)}% evidence floor (${S.withSummary}/${S.total} summaries indexed).
|
|
828
883
|
|
|
829
|
-
Found ${
|
|
884
|
+
Found ${T.length} file(s) with matching paths:
|
|
830
885
|
|
|
831
|
-
`+
|
|
832
|
-
`)}]};if(
|
|
886
|
+
`+T.map((D,C)=>`${C+1}. \`${l(D.path)}\` (${D.classification||"Unknown"})`).join(`
|
|
887
|
+
`)}]};if(v.length>0){let z=v.slice(0,Math.min(3,r)).map((D,C)=>{let I=Math.round((D.score||0)*100);return`${C+1}. \`${l(D.path)}\` (${I}% evidence) - ${D.summary||"No summary"}`}).join(`
|
|
833
888
|
`);return{content:[{type:"text",text:`# Semantic Concept Search: "${e}"
|
|
834
889
|
|
|
835
890
|
No high-confidence semantic matches cleared the evidence floor (${Math.round(d*100)}% required for ${p.profile} queries).
|
|
836
891
|
|
|
837
892
|
Low-confidence candidates were suppressed instead of being presented as relevant matches:
|
|
838
|
-
${
|
|
839
|
-
${
|
|
893
|
+
${z?`
|
|
894
|
+
${z}
|
|
840
895
|
|
|
841
896
|
`:`
|
|
842
897
|
`}Try adding distinctive identifiers, narrowing the concept, or using shadow_search_symbol({ query: "${e}", repoPath }).`}]}}}return{content:[{type:"text",text:`No high-confidence files found matching concept: "${e}"
|
|
843
898
|
|
|
844
|
-
Try a symbol search: shadow_search_symbol({ query: "${e}", repoPath })`}]}}async searchBySymbol(e,r,i,t,o,s="any"){let a=e.toLowerCase(),c
|
|
899
|
+
Try a symbol search: shadow_search_symbol({ query: "${e}", repoPath })`}]}}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(H=>H.length>0);if(A.length>1){let H=new Map;for(let O of A){let q=Mi(O,I,40,20);for(let L of q){let G=H.get(L.match);G?(G.terms.push(O),G.bestScore=Math.max(G.bestScore,L.score)):H.set(L.match,{terms:[O],bestScore:L.score})}}let Y=Array.from(H.entries()).sort((O,q)=>q[1].terms.length!==O[1].terms.length?q[1].terms.length-O[1].terms.length:q[1].bestScore-O[1].bestScore).slice(0,10);if(Y.length>0){let O=Y.map(([q,L])=>{let G=L.terms.join(", ");return` \u2022 \`${q}\` (matches: ${G}, ${Math.round(L.bestScore)}%)`}).join(`
|
|
845
900
|
`);return{content:[{type:"text",text:`No symbols found matching all terms: "${e}"
|
|
846
901
|
|
|
847
902
|
**Partial matches:**
|
|
848
903
|
${O}
|
|
849
904
|
|
|
850
|
-
\u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let
|
|
905
|
+
\u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let H=Mi(e,I,50,5);if(H.length>0){let Y=H.map(O=>` \u2022 \`${O.match}\` (${Math.round(O.score)}% ${O.matchType} match)`).join(`
|
|
851
906
|
`);return{content:[{type:"text",text:`No symbols found matching: "${e}"
|
|
852
907
|
|
|
853
908
|
**Did you mean?**
|
|
854
|
-
${
|
|
909
|
+
${Y}
|
|
855
910
|
|
|
856
911
|
\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}"
|
|
857
912
|
|
|
858
|
-
\u{1F4A1} Try shadow_search_symbol (fuzzy) or shadow_search_concept for semantic search.`}]}}o&&(u=u.filter(
|
|
859
|
-
`);
|
|
860
|
-
`).trim()}let O=[]
|
|
913
|
+
\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 Oi(this.repoPath),d=new Se(this.repoPath),m=p.getAncestorMissionIds(),f=xe(this.repoPath)||void 0,g=this.exportsRepo.getGravityMap(m,f),$=d.getSection("gravity"),y=new Map;if($?.hotspots)for(let I of $.hotspots)y.set(`${I.filePath}::${I.symbol}`,I.gravity);let v="\u{1F525}",b="\u26A1",S="\u269B\uFE0F",w=u.map((I,A)=>{let M=g[I.id],H=y.get(`${I.file_path}::${I.name}`),Y=this.filesRepo.findByPath(I.file_path),O=vt.getMultiplier(I.file_path,Y?.classification),q=(Ue.SCORE_BASE-A)*O;M&&(q+=M.score*Ue.SCORE_BASE),H&&(q+=H*Ue.SCORE_BASE*Ue.GRAVITY_STRUCTURAL_WEIGHT),I.name.toLowerCase()===a&&(q+=Ue.EXACT_MATCH_BONUS*O);let L=Y?.mtime;if(L!=null){let re=L>1e10?L/1e3:L,J=(Date.now()/1e3-re)/Bd.SECONDS_PER_DAY;J<Ue.RECENT_FILE_THRESHOLD_DAYS?q+=Ue.RECENT_FILE_BOOST:J<Ue.OLDER_FILE_THRESHOLD_DAYS&&(q+=Ue.OLDER_FILE_BOOST)}let G=[];return M&&G.push(...M.reasons),H&&G.push(`Structural Hotspot (Gravity: ${H.toFixed(1)})`),{...I,activeGravity:M,structuralGravity:H,sortScore:q,reasons:G}}).sort((I,A)=>A.sortScore-I.sortScore).slice(i,i+r),T=u.length,z=i+r<T,D=w.map((I,A)=>{let M=c(I.file_path),H=this.filesRepo.getContent(I.file_path),Y="";if(H){let L=H.split(`
|
|
914
|
+
`);Y=L.slice(Math.max(0,I.start_line-2),Math.min(L.length,I.start_line+3)).join(`
|
|
915
|
+
`).trim()}let O=[];I.activeGravity&&(I.activeGravity.reasons.some(L=>L.includes("Working Set"))?O.push(v):I.activeGravity.reasons.some(L=>L.includes("Recent Intent"))&&O.push(b)),I.structuralGravity&&O.push(S);let q=O.length>0?` ${O.join("")}`:"";return{relPath:M,name:I.name,kind:I.kind,signature:I.signature,line:I.start_line,snippet:Y,badgeStr:q,gravityReasons:I.reasons}});return{content:[{type:"text",text:`# Symbol Search Results: "${e}"
|
|
861
916
|
|
|
862
|
-
Showing ${
|
|
917
|
+
Showing ${D.length} matching symbol(s)${z?` (use offset=${i+r} for more)`:""}:
|
|
863
918
|
|
|
864
|
-
`+
|
|
865
|
-
**File**: \`${
|
|
866
|
-
`;return
|
|
867
|
-
`)
|
|
868
|
-
`)
|
|
919
|
+
`+D.map((I,A)=>{let M=`## ${i+A+1}. \`${I.name}\` (${I.kind})${I.badgeStr}
|
|
920
|
+
**File**: \`${I.relPath}:${I.line}\`
|
|
921
|
+
`;return I.gravityReasons&&(M+=`> *${I.gravityReasons.join(", ")}*
|
|
922
|
+
`),I.signature&&(M+=`**Signature**: \`${I.signature}\`
|
|
923
|
+
`),I.snippet&&(M+=`
|
|
869
924
|
\`\`\`typescript
|
|
870
|
-
${
|
|
925
|
+
${I.snippet}
|
|
871
926
|
\`\`\`
|
|
872
|
-
`),
|
|
873
|
-
`)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=
|
|
874
|
-
${
|
|
875
|
-
${be||""}`,v),Ti=1;if(be){let Nr=/\b(class|function|const|let|var|enum)\s+\w+/.test(be);if(/export\s+/.test(be)&&!Nr){let dx=be.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");/\b(class|function|const|let|var|enum)\s+\w+/.test(dx)||(Ti=.1)}}let sx=ke?.08:pe?.1:at>0||ct>0||X?.14:f?.22:.18;if(Se&&B<=sx&&!X)continue;if(m.length>0&&at===0&&!X){if(f){if(!ke&&(sn===0&&ct===0&&B<.4||sn<=1&&ct===0&&B<.34||sn===1&&B<.3))continue}else if(sn===0&&B<.24)continue}if(f&&!ke&&ct===0&&sn<=1&&B<.3&&!X||t&&!n.matchesFilters(k.path,i,k.mtime,k.classification))continue;let ax=k.mtime>2e9?Math.floor(k.mtime/1e3):k.mtime,cx=Math.floor(Date.now()/1e3)-Rd.SECONDS_PER_YEAR,Pa=st.getMultiplier(k.path,k.classification),lx=Se?l.calculateScore(B,ax||cx):0,St=(P.fusedScore*60+lx*.2)*Pa,Ri=d[k.path],ux=k.classification?st.mapClassificationToTier(k.classification):st.classify(k.path,{content:be??void 0}),Je=`vector_rank: ${this.formatRank(P.vectorRank)} | symbol_vector_rank: ${this.formatRank(P.symbolVectorRank)} | fts_rank: ${this.formatRank(P.ftsRank)} | fused_score: ${P.fusedScore.toFixed(6)} | query_profile: ${y.profile} | Similarity: ${(B*100).toFixed(0)}%, Tier: ${ux}${Pa!==1?` (${Pa}x)`:""}`;if(ke&&(Je+=" | SymbolHint"),Y&&(Je+=` | SymbolVec: ${Y.symbolName}`),at>0&&(St+=at*Ae.LEXICAL_WEIGHT,Je+=` | Lexical: +${at.toFixed(1)}`),m.length>0)if(En>0){let Nr=f?En*.45:En*.35;St+=Nr,Je+=` | Keywords: ${(En*100).toFixed(0)}%`}else Je+=" | Keywords: 0%",f&&!X&&(St*=.55,Je+=" (penalty)");if(v.length>0)if(ct>0){let Nr=f?ct*.8:ct*.35;St+=Nr,Je+=` | Phrases: ${(ct*100).toFixed(0)}%`}else f&&!X&&(St*=.72,Je+=" | Phrases: 0% (penalty)");Ri&&(St+=Ri.score,Je+=` | \u{1F525} Gravity: +${Ri.score.toFixed(1)} (${Ri.reasons.join(", ")})`),f&&this.isGenericConceptPath(k.path)&&sn<=1&&ct===0&&!X&&(St*=.75,Je+=" | Generic path penalty"),Ti<1&&(St*=Ti,Je+=` | \u{1F4C9} Barrel: x${Ti}`);let px=be?en.extractSnippet(be,e):void 0;M.push({path:k.path,summary:k.summary||"",score:B,fusedScore:P.fusedScore,vectorRank:P.vectorRank,ftsRank:P.ftsRank,decayedScore:St,rationale:Je,snippet:px}),V.set(k.path,{lexicalScore:at,keywordCoverage:En,matchedKeywordCount:sn,phraseCoverage:ct,similarity:B,hasFtsSignal:X,hasSymbolHint:ke,hasSymbolVectorSignal:pe,lexicalConfirm:0,identifierOverlap:0,isGenericPath:this.isGenericConceptPath(k.path)})}if(M.length>0&&m.length>0){let P=this.exportsRepo.findByFiles(M.map(G=>G.path)),k=new Map;for(let G of P){let Y=k.get(G.file_path)??[];Y.push(G.name),k.set(G.file_path,Y)}for(let G of M){let Y=this.calculateIdentifierOverlap(m,k.get(G.path)??[]),ne=V.get(G.path);if(ne&&(ne.identifierOverlap=Y),Y>0){let B=f?Y*.8:Y*.25;G.decayedScore=(G.decayedScore||0)+B,G.rationale+=` | Symbols: ${(Y*100).toFixed(0)}%`}else f&&this.isGenericConceptPath(G.path)&&(G.decayedScore=(G.decayedScore||0)*.82,G.rationale+=" | Symbols: 0% (generic penalty)")}}let J=new Map;for(let P of M){let k=P.path.split("/").pop()?.split(".")[0].replace(/(Controller|Service|Repository|Component|View|Page|Handler|Wrapper|Client|DTO|Interface)$/i,"").toLowerCase();k&&k.length>3&&(J.has(k)||J.set(k,[]),J.get(k).push(P))}for(let[P,k]of J.entries())if(new Set(k.map(Y=>Y.path.split(".").pop())).size>1)for(let Y of k)Y.decayedScore=(Y.decayedScore||0)+.15,Y.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${P}')`;if(f&&M.length>1){let P=Math.min(Math.max(o*4,Ae.FILTERED_QUERY_LIMIT_MULTIPLIER*20),M.length),k=[...M].sort((Y,ne)=>(ne.decayedScore||0)-(Y.decayedScore||0)).slice(0,P),G=this.computeBm25LikeConfirmation(k.map(Y=>Y.path),m);for(let Y of k){let ne=G.get(Y.path)||0,B=V.get(Y.path);if(B&&(B.lexicalConfirm=ne),ne>0){let X=Math.min(.95,ne*.18);Y.decayedScore=(Y.decayedScore||0)+X,Y.rationale+=` | LexConfirm: +${X.toFixed(2)}`}else B&&B.matchedKeywordCount<=1&&B.phraseCoverage===0&&B.lexicalScore===0&&(Y.decayedScore=(Y.decayedScore||0)*.85,Y.rationale+=" | LexConfirm: 0 (penalty)")}}for(let P of M){let k=V.get(P.path);k&&(P.score=this.calculateConceptEvidenceScore({profile:y.profile,queryKeywordCount:m.length,...k}),P.rationale+=` | Evidence: ${(P.score*100).toFixed(0)}%`)}return M.sort((P,k)=>(k.decayedScore||0)-(P.decayedScore||0)),M.slice(s,s+Math.min(o,fe.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 d of r)d.length>=3&&l.includes(d)&&(u+=1);if(u===0)continue;let p=a.get(c.file_path)||0;u>p&&a.set(c.file_path,u)}return Array.from(a.entries()).sort((c,l)=>l[1]-c[1]).slice(0,Math.min(i,fe.MAX_LIMIT)).map(([c])=>c)}rrfMerge(e,r,i,t){let o=new Map,s=t?.vectorWeight??1.2,a=t?.ftsWeight??.8,c=t?.symbolWeight??1.1,l=t?.symbolResults??[];for(let u of e){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.vectorRank=u.rank,p.fusedScore+=s/(i+u.rank),o.set(u.path,p)}for(let u of r){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.ftsRank=u.rank,p.fusedScore+=a/(i+u.rank),o.set(u.path,p)}for(let u of l){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.symbolVectorRank=u.rank,p.symbolName=u.symbolName,p.fusedScore+=c/(i+u.rank),o.set(u.path,p)}return Array.from(o.values()).sort((u,p)=>p.fusedScore-u.fusedScore)}formatRank(e){return e==null?"none":String(e)}getConceptConfidenceFloor(e){switch(e){case"identifier-heavy":return .33;case"lexical-heavy":return .38;case"semantic-exploratory":return .3;default:return .35}}getIntentConfidenceFloor(e){return Math.max(.28,this.getConceptConfidenceFloor(e)-.05)}calculateConceptEvidenceScore(e){let r=Math.min(1,e.lexicalConfirm/Math.max(1,e.queryKeywordCount*1.5)),i=e.profile==="semantic-exploratory"?.72:.58,t=e.profile==="lexical-heavy"?.16:.12,o=e.profile==="identifier-heavy"?.12:.08,s=e.similarity*i+Math.min(1,e.lexicalScore)*.08+e.keywordCoverage*.1+e.phraseCoverage*t+e.identifierOverlap*o+r*.08;return e.hasFtsSignal&&(s+=.04),e.hasSymbolHint?s+=.03:e.hasSymbolVectorSignal&&(s+=.02),e.matchedKeywordCount===0&&e.phraseCoverage===0&&e.lexicalScore===0?s*=e.hasFtsSignal||e.hasSymbolVectorSignal?.72:.6:e.matchedKeywordCount<=1&&e.phraseCoverage===0&&e.identifierOverlap===0&&(s*=.88),e.isGenericPath&&e.matchedKeywordCount<=1&&e.phraseCoverage===0&&e.identifierOverlap===0&&(s*=.85),e.queryKeywordCount===0&&(s*=.75),Math.max(0,Math.min(.97,s))}estimateTokenCount(e){return e?Math.ceil(e.length/4):0}classifyConceptQuery(e,r){let i=e.trim(),t=r.length,o=/\b[a-z]+[A-Z][A-Za-z0-9]*\b/.test(i),s=/\b[a-z0-9]+_[a-z0-9_]+\b/i.test(i),a=/[/.:#()]/.test(i),c=t<=1&&!i.includes(" "),l=i.includes('"')||t>=5&&i.split(/\s+/).length>=6;return o||s||a&&t>=2?{profile:"identifier-heavy",rrfK:45,vectorWeight:1,ftsWeight:.75,symbolWeight:1.45,channelMultiplier:5,lexicalWindowMultiplier:5,earlyRejectThreshold:.012}:l?{profile:"lexical-heavy",rrfK:55,vectorWeight:.95,ftsWeight:1.3,symbolWeight:1,channelMultiplier:7,lexicalWindowMultiplier:8,earlyRejectThreshold:.008}:c||t<=2?{profile:"semantic-exploratory",rrfK:70,vectorWeight:1.35,ftsWeight:.6,symbolWeight:.9,channelMultiplier:4,lexicalWindowMultiplier:4,earlyRejectThreshold:.018}:{profile:"balanced",rrfK:60,vectorWeight:1.15,ftsWeight:.9,symbolWeight:1.2,channelMultiplier:6,lexicalWindowMultiplier:6,earlyRejectThreshold:.01}}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(p=>p.toLowerCase()).filter(p=>p.length>=3)));if(e.length===0||i.length===0)return new Map;let t=new Set(i),o=[],s=new Map;for(let p of e){let m=(this.filesRepo.getContent(p)??"").toLowerCase().split(/[^a-z0-9_]+/).map(h=>h.trim()).filter(Boolean),f=new Map;for(let h of m)t.has(h)&&f.set(h,(f.get(h)||0)+1);for(let h of i)(f.get(h)||0)>0&&s.set(h,(s.get(h)||0)+1);o.push({path:p,frequencies:f,length:Math.max(m.length,1)})}let a=o.reduce((p,d)=>p+d.length,0)/Math.max(o.length,1),c=1.2,l=.75,u=new Map;for(let p of o){let d=0;for(let m of i){let f=p.frequencies.get(m)||0;if(f===0)continue;let h=s.get(m)||0,v=Math.log(1+(o.length-h+.5)/(h+.5)),y=f*(c+1)/(f+c*(1-l+l*(p.length/Math.max(a,1))));d+=v*y}u.set(p.path,d)}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,fe.MAX_LIMIT)).map(([o])=>o))}isLowSignalConceptKeyword(e){return new Set(["type","types","data","update","create","list","item","value","model","helper"]).has(e.toLowerCase())}};Q();ee();function Sr(n){let{fileType:e,layer:r}=n,i={fileType:vt.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}async function av(n){let e=_r(n.query??""),r={...n,query:e},i=dr();try{let{repoPath:t}=Re(r),{query:o,limit:s=fe.DEFAULT_LIMIT,offset:a=0,compact:c=!1,tokenBudget:l}=r;await oe(t);let{filters:u,hasFilters:p}=Sr(r),m=await new vt(t).searchByConcept(o,s,a,u,p,c,l);try{let f=ur(t);if(f.status==="running"){let[h,v]=f.progress.split("/").map(Number),y=v>0?Math.round(h/v*100):0,b=`\u26A0\uFE0F Symbol embeddings still warming (${f.progress}, ${y}%) \u2014 symbol-level results may be incomplete. File-level results are fully available.
|
|
927
|
+
`),M}).join(`
|
|
928
|
+
`)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=xe(this.repoPath)||void 0,l=new Dr(this.repoPath).getScorer(),p=new Oi(this.repoPath).getAncestorMissionIds(),d=this.filesRepo.getGravityMap(p,a),m=hn.extractKeywords(e),f=m.length>=3,g=this.extractOrderedConceptTerms(e),$=this.buildNgrams(g,2,3),y=this.classifyConceptQuery(e,m),v=f?this.collectConceptSymbolHintPaths(m,Math.max(o*10,100)):new Set,b=Math.min(Math.max((o+s)*y.channelMultiplier,Ue.FILTERED_QUERY_LIMIT_MULTIPLIER*20),ve.MAX_LIMIT),S=Math.min(Math.max(b*4,200),4e3),[w,T,z]=await Promise.all([Promise.resolve(r?this.filesRepo.findWithEmbeddings():[]),Promise.resolve(this.filesRepo.findContentFts(e,b)),Promise.resolve(r?this.exportsRepo.findWithEmbeddings(S):[])]),D=[];if(r){for(let _ of w)try{let x=JSON.parse(_.embedding),j=Zs(r,x);D.push({row:_,similarity:j,vectorRank:0})}catch{}D.sort((_,x)=>x.similarity-_.similarity);for(let _=0;_<D.length;_++)D[_].vectorRank=_+1}let C=[];if(r){for(let _ of z)if(_.embedding)try{let x=JSON.parse(_.embedding),j=Zs(r,x);if(j<=0)continue;C.push({row:_,similarity:j,symbolVectorRank:0})}catch{}C.sort((_,x)=>x.similarity-_.similarity);for(let _=0;_<C.length;_++)C[_].symbolVectorRank=_+1}let I=new Map;for(let _ of w)I.set(_.path,_);for(let _ of T)I.has(_.path)||I.set(_.path,_);let A=new Map,M=[],H=new Set;for(let _ of C.slice(0,S)){let x=_.row.file_path,j=A.get(x);if((!j||_.similarity>j.similarity)&&A.set(x,{similarity:_.similarity,symbolRank:_.symbolVectorRank,symbolName:_.row.name}),H.has(x))continue;let P=I.get(x);P||(P=this.filesRepo.findByPath(x),P&&I.set(x,P)),P&&(M.push({path:x,rank:_.symbolVectorRank,score:_.similarity,row:P,symbolName:_.row.name}),H.add(x))}let Y=this.rrfMerge(D.slice(0,b).map(_=>({path:_.row.path,rank:_.vectorRank,score:_.similarity,row:_.row})),T.slice(0,b).map((_,x)=>({path:_.path,rank:x+1,bm25Rank:_.bm25_rank,row:_})),y.rrfK,{vectorWeight:y.vectorWeight,ftsWeight:y.ftsWeight,symbolWeight:y.symbolWeight,symbolResults:M.slice(0,b)});if(Y.length===0)return[];let O=new Map;for(let _ of D)O.set(_.row.path,_.similarity);let q=Math.min(Y.length,Math.max(o*y.lexicalWindowMultiplier,40)),L=new Set(Y.slice(0,q).map(_=>_.path)),G=[],re=new Map;for(let _ of Y){let x=_.row,j=O.get(x.path)||0,P=A.get(x.path),B=P?.similarity||0,K=Math.max(j,B),oe=_.ftsRank!==null,le=_.symbolVectorRank!==null||!!P,Ee=_.vectorRank!==null||le,Ze=v.has(x.path),Gt=L.has(x.path)||oe||Ze||le;if(!Gt&&_.fusedScore<y.earlyRejectThreshold&&K<.18&&!t)continue;let Te=Gt?this.filesRepo.getContent(x.path):null,nt=Ue.ENABLE_LEXICAL_SCORING&&Te?hn.calculateLexicalScore(Te,e):0,rt=Te?hn.calculateKeywordCoverageFromKeywords(Te,m):0,Ce=m.length>0?Math.round(rt*m.length):0,ce=this.calculatePhraseCoverage(`${x.path}
|
|
929
|
+
${x.summary||""}
|
|
930
|
+
${Te||""}`,$),be=1;if(Te){let _e=/\b(class|function|const|let|var|enum)\s+\w+/.test(Te);if(/export\s+/.test(Te)&&!_e){let zt=Te.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");/\b(class|function|const|let|var|enum)\s+\w+/.test(zt)||(be=.1)}}let At=Ze?.08:le?.1:nt>0||ce>0||oe?.14:f?.22:.18;if(Ee&&K<=At&&!oe)continue;if(m.length>0&&nt===0&&!oe){if(f){if(!Ze&&(Ce===0&&ce===0&&K<.4||Ce<=1&&ce===0&&K<.34||Ce===1&&K<.3))continue}else if(Ce===0&&K<.24)continue}if(f&&!Ze&&ce===0&&Ce<=1&&K<.3&&!oe||t&&!n.matchesFilters(x.path,i,x.mtime,x.classification))continue;let Jt=x.mtime>2e9?Math.floor(x.mtime/1e3):x.mtime,lt=Math.floor(Date.now()/1e3)-Bd.SECONDS_PER_YEAR,ut=vt.getMultiplier(x.path,x.classification),vn=Ee?l.calculateScore(K,Jt||lt):0,Le=(_.fusedScore*60+vn*.2)*ut,te=d[x.path],Q=x.classification?vt.mapClassificationToTier(x.classification):vt.classify(x.path,{content:Te??void 0}),de=`vector_rank: ${this.formatRank(_.vectorRank)} | symbol_vector_rank: ${this.formatRank(_.symbolVectorRank)} | fts_rank: ${this.formatRank(_.ftsRank)} | fused_score: ${_.fusedScore.toFixed(6)} | query_profile: ${y.profile} | Similarity: ${(K*100).toFixed(0)}%, Tier: ${Q}${ut!==1?` (${ut}x)`:""}`;if(Ze&&(de+=" | SymbolHint"),P&&(de+=` | SymbolVec: ${P.symbolName}`),nt>0&&(Le+=nt*Ue.LEXICAL_WEIGHT,de+=` | Lexical: +${nt.toFixed(1)}`),m.length>0)if(rt>0){let _e=f?rt*.45:rt*.35;Le+=_e,de+=` | Keywords: ${(rt*100).toFixed(0)}%`}else de+=" | Keywords: 0%",f&&!oe&&(Le*=.55,de+=" (penalty)");if($.length>0)if(ce>0){let _e=f?ce*.8:ce*.35;Le+=_e,de+=` | Phrases: ${(ce*100).toFixed(0)}%`}else f&&!oe&&(Le*=.72,de+=" | Phrases: 0% (penalty)");te&&(Le+=te.score,de+=` | \u{1F525} Gravity: +${te.score.toFixed(1)} (${te.reasons.join(", ")})`),f&&this.isGenericConceptPath(x.path)&&Ce<=1&&ce===0&&!oe&&(Le*=.75,de+=" | Generic path penalty"),be<1&&(Le*=be,de+=` | \u{1F4C9} Barrel: x${be}`);let Oe=Te?hn.extractSnippet(Te,e):void 0;G.push({path:x.path,summary:x.summary||"",score:K,fusedScore:_.fusedScore,vectorRank:_.vectorRank,ftsRank:_.ftsRank,decayedScore:Le,rationale:de,snippet:Oe}),re.set(x.path,{lexicalScore:nt,keywordCoverage:rt,matchedKeywordCount:Ce,phraseCoverage:ce,similarity:K,hasFtsSignal:oe,hasSymbolHint:Ze,hasSymbolVectorSignal:le,lexicalConfirm:0,identifierOverlap:0,isGenericPath:this.isGenericConceptPath(x.path)})}if(G.length>0&&m.length>0){let _=this.exportsRepo.findByFiles(G.map(j=>j.path)),x=new Map;for(let j of _){let P=x.get(j.file_path)??[];P.push(j.name),x.set(j.file_path,P)}for(let j of G){let P=this.calculateIdentifierOverlap(m,x.get(j.path)??[]),B=re.get(j.path);if(B&&(B.identifierOverlap=P),P>0){let K=f?P*.8:P*.25;j.decayedScore=(j.decayedScore||0)+K,j.rationale+=` | Symbols: ${(P*100).toFixed(0)}%`}else f&&this.isGenericConceptPath(j.path)&&(j.decayedScore=(j.decayedScore||0)*.82,j.rationale+=" | Symbols: 0% (generic penalty)")}}let J=new Map;for(let _ of G){let x=_.path.split("/").pop()?.split(".")[0].replace(/(Controller|Service|Repository|Component|View|Page|Handler|Wrapper|Client|DTO|Interface)$/i,"").toLowerCase();x&&x.length>3&&(J.has(x)||J.set(x,[]),J.get(x).push(_))}for(let[_,x]of J.entries())if(new Set(x.map(P=>P.path.split(".").pop())).size>1)for(let P of x)P.decayedScore=(P.decayedScore||0)+.15,P.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${_}')`;if(f&&G.length>1){let _=Math.min(Math.max(o*4,Ue.FILTERED_QUERY_LIMIT_MULTIPLIER*20),G.length),x=[...G].sort((P,B)=>(B.decayedScore||0)-(P.decayedScore||0)).slice(0,_),j=this.computeBm25LikeConfirmation(x.map(P=>P.path),m);for(let P of x){let B=j.get(P.path)||0,K=re.get(P.path);if(K&&(K.lexicalConfirm=B),B>0){let oe=Math.min(.95,B*.18);P.decayedScore=(P.decayedScore||0)+oe,P.rationale+=` | LexConfirm: +${oe.toFixed(2)}`}else K&&K.matchedKeywordCount<=1&&K.phraseCoverage===0&&K.lexicalScore===0&&(P.decayedScore=(P.decayedScore||0)*.85,P.rationale+=" | LexConfirm: 0 (penalty)")}}for(let _ of G){let x=re.get(_.path);x&&(_.score=this.calculateConceptEvidenceScore({profile:y.profile,queryKeywordCount:m.length,...x}),_.rationale+=` | Evidence: ${(_.score*100).toFixed(0)}%`)}return G.sort((_,x)=>(x.decayedScore||0)-(_.decayedScore||0)),G.slice(s,s+Math.min(o,ve.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 d of r)d.length>=3&&l.includes(d)&&(u+=1);if(u===0)continue;let p=a.get(c.file_path)||0;u>p&&a.set(c.file_path,u)}return Array.from(a.entries()).sort((c,l)=>l[1]-c[1]).slice(0,Math.min(i,ve.MAX_LIMIT)).map(([c])=>c)}rrfMerge(e,r,i,t){let o=new Map,s=t?.vectorWeight??1.2,a=t?.ftsWeight??.8,c=t?.symbolWeight??1.1,l=t?.symbolResults??[];for(let u of e){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.vectorRank=u.rank,p.fusedScore+=s/(i+u.rank),o.set(u.path,p)}for(let u of r){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.ftsRank=u.rank,p.fusedScore+=a/(i+u.rank),o.set(u.path,p)}for(let u of l){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.symbolVectorRank=u.rank,p.symbolName=u.symbolName,p.fusedScore+=c/(i+u.rank),o.set(u.path,p)}return Array.from(o.values()).sort((u,p)=>p.fusedScore-u.fusedScore)}formatRank(e){return e==null?"none":String(e)}getConceptConfidenceFloor(e){switch(e){case"identifier-heavy":return .33;case"lexical-heavy":return .38;case"semantic-exploratory":return .3;default:return .35}}getIntentConfidenceFloor(e){return Math.max(.28,this.getConceptConfidenceFloor(e)-.05)}calculateConceptEvidenceScore(e){let r=Math.min(1,e.lexicalConfirm/Math.max(1,e.queryKeywordCount*1.5)),i=e.profile==="semantic-exploratory"?.72:.58,t=e.profile==="lexical-heavy"?.16:.12,o=e.profile==="identifier-heavy"?.12:.08,s=e.similarity*i+Math.min(1,e.lexicalScore)*.08+e.keywordCoverage*.1+e.phraseCoverage*t+e.identifierOverlap*o+r*.08;return e.hasFtsSignal&&(s+=.04),e.hasSymbolHint?s+=.03:e.hasSymbolVectorSignal&&(s+=.02),e.matchedKeywordCount===0&&e.phraseCoverage===0&&e.lexicalScore===0?s*=e.hasFtsSignal||e.hasSymbolVectorSignal?.72:.6:e.matchedKeywordCount<=1&&e.phraseCoverage===0&&e.identifierOverlap===0&&(s*=.88),e.isGenericPath&&e.matchedKeywordCount<=1&&e.phraseCoverage===0&&e.identifierOverlap===0&&(s*=.85),e.queryKeywordCount===0&&(s*=.75),Math.max(0,Math.min(.97,s))}estimateTokenCount(e){return e?Math.ceil(e.length/4):0}classifyConceptQuery(e,r){let i=e.trim(),t=r.length,o=/\b[a-z]+[A-Z][A-Za-z0-9]*\b/.test(i),s=/\b[a-z0-9]+_[a-z0-9_]+\b/i.test(i),a=/[/.:#()]/.test(i),c=t<=1&&!i.includes(" "),l=i.includes('"')||t>=5&&i.split(/\s+/).length>=6;return o||s||a&&t>=2?{profile:"identifier-heavy",rrfK:45,vectorWeight:1,ftsWeight:.75,symbolWeight:1.45,channelMultiplier:5,lexicalWindowMultiplier:5,earlyRejectThreshold:.012}:l?{profile:"lexical-heavy",rrfK:55,vectorWeight:.95,ftsWeight:1.3,symbolWeight:1,channelMultiplier:7,lexicalWindowMultiplier:8,earlyRejectThreshold:.008}:c||t<=2?{profile:"semantic-exploratory",rrfK:70,vectorWeight:1.35,ftsWeight:.6,symbolWeight:.9,channelMultiplier:4,lexicalWindowMultiplier:4,earlyRejectThreshold:.018}:{profile:"balanced",rrfK:60,vectorWeight:1.15,ftsWeight:.9,symbolWeight:1.2,channelMultiplier:6,lexicalWindowMultiplier:6,earlyRejectThreshold:.01}}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(p=>p.toLowerCase()).filter(p=>p.length>=3)));if(e.length===0||i.length===0)return new Map;let t=new Set(i),o=[],s=new Map;for(let p of e){let m=(this.filesRepo.getContent(p)??"").toLowerCase().split(/[^a-z0-9_]+/).map(g=>g.trim()).filter(Boolean),f=new Map;for(let g of m)t.has(g)&&f.set(g,(f.get(g)||0)+1);for(let g of i)(f.get(g)||0)>0&&s.set(g,(s.get(g)||0)+1);o.push({path:p,frequencies:f,length:Math.max(m.length,1)})}let a=o.reduce((p,d)=>p+d.length,0)/Math.max(o.length,1),c=1.2,l=.75,u=new Map;for(let p of o){let d=0;for(let m of i){let f=p.frequencies.get(m)||0;if(f===0)continue;let g=s.get(m)||0,$=Math.log(1+(o.length-g+.5)/(g+.5)),y=f*(c+1)/(f+c*(1-l+l*(p.length/Math.max(a,1))));d+=$*y}u.set(p.path,d)}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,ve.MAX_LIMIT)).map(([o])=>o))}isLowSignalConceptKeyword(e){return new Set(["type","types","data","update","create","list","item","value","model","helper"]).has(e.toLowerCase())}};X();ee();function Lr(n){let{fileType:e,layer:r}=n,i={fileType:Pt.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}async function j_(n){let e=zr(n.query??""),r={...n,query:e},i=kr();try{let{repoPath:t}=ze(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,compact:c=!1,tokenBudget:l}=r;await ae(t);let{filters:u,hasFilters:p}=Lr(r),m=await new Pt(t).searchByConcept(o,s,a,u,p,c,l);try{let f=wr(t);if(f.status==="running"){let[g,$]=f.progress.split("/").map(Number),y=$>0?Math.round(g/$*100):0,v=`\u26A0\uFE0F Symbol embeddings still warming (${f.progress}, ${y}%) \u2014 symbol-level results may be incomplete. File-level results are fully available.
|
|
876
931
|
|
|
877
|
-
`;m.content?.[0]?.type==="text"&&(m.content[0].text=
|
|
932
|
+
`;m.content?.[0]?.type==="text"&&(m.content[0].text=v+m.content[0].text)}}catch{}return rI(t,o,"concept"),i(),m}catch(t){return E.error({error:t,args:n},"Concept Search failed"),i(),await Zt(),{content:[{type:"text",text:`Concept Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function rI(n,e,r){try{let i=N.getInstance(n),t=xe(n);i.searchHistory.record(e,r,t)}catch(i){let t=xe(n);E.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),Zt()}}X();ee();async function F_(n){let e=zr(n.query??""),r={...n,query:e},i=kr();try{let{repoPath:t}=ze(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,matchMode:c="any"}=r;await ae(t);let{filters:l,hasFilters:u}=Lr(r),d=await new Pt(t).searchBySymbol(o,s,a,l,u,c);return iI(t,o,"symbol"),i(),d}catch(t){return E.error({error:t,args:n},"Symbol Search failed"),i(),await Zt(),{content:[{type:"text",text:`Symbol Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function iI(n,e,r){try{let i=N.getInstance(n),t=xe(n);i.searchHistory.record(e,r,t)}catch(i){let t=xe(n);E.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),Zt()}}ee();X();import Or from"path";function U_(n,e){let r=n.findContentByToken(e,100);return{count:r.length,files:r}}async function W_(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 ae(e);let c=N.getInstance(e),{configs:l,files:u}=c;if(a){E.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 y=f.map(w=>{let T=U_(u,w.key),z=T.count===0?"\u26A0\uFE0F ORPHANED":`\u2713 ${T.count} usage(s)`;return{file:Or.relative(e,w.file_path),key:w.key,value:w.value,kind:w.kind,usageCount:T.count,usageFiles:T.files.slice(0,5).map(D=>Or.relative(e,D)),status:z}});y.sort((w,T)=>w.usageCount===0&&T.usageCount>0?-1:T.usageCount===0&&w.usageCount>0?1:w.usageCount-T.usageCount);let v=y.filter(w=>w.usageCount===0).length;return{content:[{type:"text",text:(v>0?`# Configuration Search: "${a}" (with Usage Analysis)
|
|
878
933
|
|
|
879
|
-
\u26A0\uFE0F **${
|
|
934
|
+
\u26A0\uFE0F **${v} orphaned var(s)** (defined but never used in code)
|
|
880
935
|
|
|
881
936
|
Found ${f.length} match(es):
|
|
882
937
|
|
|
@@ -884,35 +939,35 @@ Found ${f.length} match(es):
|
|
|
884
939
|
|
|
885
940
|
Found ${f.length} match(es), all in use:
|
|
886
941
|
|
|
887
|
-
`)+y.map(
|
|
888
|
-
**${
|
|
889
|
-
> Used in: ${
|
|
942
|
+
`)+y.map(w=>{let T=`## ${w.file} (${w.kind}) ${w.status}
|
|
943
|
+
**${w.key}**: \`${w.value}\``;return w.usageCount>0&&w.usageFiles.length>0&&(T+=`
|
|
944
|
+
> Used in: ${w.usageFiles.map(z=>`\`${z}\``).join(", ")}${w.usageCount>5?` (+${w.usageCount-5} more)`:""}`),T}).join(`
|
|
890
945
|
|
|
891
|
-
`)}]}}let
|
|
946
|
+
`)}]}}let g=f.map(y=>({file:Or.relative(e,y.file_path),key:y.key,value:y.value,kind:y.kind}));return{content:[{type:"text",text:`# Configuration Search: "${a}"
|
|
892
947
|
|
|
893
948
|
Found ${f.length} match(es):
|
|
894
949
|
|
|
895
|
-
`+
|
|
950
|
+
`+g.map(y=>`## ${y.file} (${y.kind})
|
|
896
951
|
**${y.key}**: \`${y.value}\``).join(`
|
|
897
952
|
|
|
898
|
-
`)+"\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(
|
|
953
|
+
`)+"\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(v=>{let b=U_(u,v.key);return{file:Or.relative(e,v.file_path),key:v.key,value:v.value,kind:v.kind,usageCount:b.count,usageFiles:b.files.slice(0,3).map(S=>Or.relative(e,S)),status:b.count===0?"ORPHANED":"in-use"}});f.sort((v,b)=>v.usageCount===0&&b.usageCount>0?-1:b.usageCount===0&&v.usageCount>0?1:v.usageCount-b.usageCount);let g=f.filter(v=>v.usageCount===0).length,$=f.length,y=`# Config Discovery (${t||"all"}) with Usage Analysis
|
|
899
954
|
|
|
900
|
-
`;return y+=`**Summary**: ${
|
|
955
|
+
`;return y+=`**Summary**: ${$} config(s) found, ${g} orphaned
|
|
901
956
|
|
|
902
|
-
`,
|
|
903
|
-
`,y+=f.filter(
|
|
957
|
+
`,g>0&&(y+=`## \u26A0\uFE0F Orphaned (${g})
|
|
958
|
+
`,y+=f.filter(v=>v.usageCount===0).map(v=>`- \`${v.key}\` in ${v.file}`).join(`
|
|
904
959
|
`),y+=`
|
|
905
960
|
|
|
906
|
-
`),y+=`## \u2713 In Use (${
|
|
907
|
-
`,y+=f.filter(
|
|
961
|
+
`),y+=`## \u2713 In Use (${$-g})
|
|
962
|
+
`,y+=f.filter(v=>v.usageCount>0).map(v=>{let b=v.usageFiles.length>0?`, used in ${v.usageFiles.map(S=>`\`${S}\``).join(", ")}${v.usageCount>3?` (+${v.usageCount-3} more)`:""}`:"";return`- \`${v.key}\`=\`${v.value}\` in \`${v.file}\` (${v.usageCount} usages${b})`}).join(`
|
|
908
963
|
`),p.length===o&&(y+=`
|
|
909
964
|
|
|
910
|
-
> Results limited to ${o} entries. Use the 'limit' parameter to see more.`),{content:[{type:"text",text:y}]}}let d=p.map(f=>({...f,file
|
|
965
|
+
> Results limited to ${o} entries. Use the 'limit' parameter to see more.`),{content:[{type:"text",text:y}]}}let d=p.map(f=>({...f,file:Or.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.
|
|
911
966
|
|
|
912
|
-
`+m),m+="\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars.",{content:[{type:"text",text:m}]}}Q();ee();async function pv(n){let e=_r(n.query??""),r={...n,query:e},i=dr();try{let{repoPath:t}=Re(r),{query:o,limit:s=fe.DEFAULT_LIMIT,offset:a=0,ranked:c=!1}=r;await oe(t);let{filters:l,hasFilters:u}=Sr(r),d=await new vt(t).searchByPath(o,s,a,l,u,c);return Tk(t,o,"path"),i(),d}catch(t){return S.error({error:t,args:n},"Path Search failed"),i(),await Nt(),{content:[{type:"text",text:`Path Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function Tk(n,e,r){try{let i=z.getInstance(n),t=ye(n);i.searchHistory.record(e,r,t)}catch(i){let t=ye(n);S.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),Nt()}}ee();rt();import{Visitor as Rk}from"@swc/core/Visitor.js";var wr=class extends Rk{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})}}}},nn=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)}}}};ya();ee();import xv from"path";function Sv(n){let e=n.replace(/\\/g,"/").toLowerCase();return e.includes("/test/")||e.includes("/tests/")||e.includes("/__tests__/")||e.endsWith(".spec.ts")||e.endsWith(".spec.tsx")||e.endsWith(".spec.js")||e.endsWith(".spec.jsx")||e.endsWith(".test.ts")||e.endsWith(".test.tsx")||e.endsWith(".test.js")||e.endsWith(".test.jsx")}var on=class{constructor(e){this.repoPath=e}getMappedTestsForSymbol(e,r,i=10){let t=z.getInstance(this.repoPath),o=Math.max(1,Math.min(i,50)),s=t.imports.findProxies(e).map(p=>p.file_path),a=Array.from(new Set([e,...s])),c=new Map,l=t.imports.findVerifiedDependents(a,r);for(let p of l)Sv(p.file_path)&&(c.has(p.file_path)||c.set(p.file_path,{absolutePath:p.file_path,file:xv.relative(this.repoPath,p.file_path),via:"import",confidence:"high"}));let u=t.files.findContentByToken(r,o*3);for(let p of u)Sv(p)&&(c.has(p)||c.set(p,{absolutePath:p,file:xv.relative(this.repoPath,p),via:"content",confidence:"medium"}));return Array.from(c.values()).sort((p,d)=>p.confidence!==d.confidence?p.confidence==="high"?-1:1:p.file.localeCompare(d.file)).slice(0,o)}};import Ct from"path";import ym from"fs";var Ir=class{constructor(e){this.repoPath=e}async analyze(e,r={}){let{filePath:i,depth:t=3,limit:o=50,offset:s=0}=r,a=z.getInstance(this.repoPath),c=new on(this.repoPath),l=i?a.exports.findByNameAndFile(e,i):a.exports.findByNameGlobal(e);if(l.length===0)return[];let u=[];for(let p of l){let d=a.imports.findImpactDependents(p.file_path,`%${e}%`,t),m=[],f=new Set;for(let I of d){let N=Ct.relative(this.repoPath,I.consumer_path);if(f.has(N))continue;let L=`Imports ${I.imported_symbols}`,C=await this.verifySymbolUsage(I.consumer_path,p.name);C?L+=" (\u2705 Verified Call)":L+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",f.add(N),m.push({type:"IMPORT",file:N,depth:I.depth,details:L,verified:C})}let h=a.exports.findRoutesByCapability(e);p.kind==="HTTP Route"&&h.push({name:p.name,file_path:p.file_path,signature:p.signature});for(let I of h){let L=I.name.split("/").filter($=>$.length>3&&!$.includes("{")&&!$.includes("$")&&!$.includes("<")).sort(($,R)=>R.length-$.length)[0];if(!L||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(L.toLowerCase()))continue;let C=a.files.findContentByToken(L,10);for(let $ of C){let R=Ct.relative(this.repoPath,$);!f.has(R)&&$!==p.file_path&&(f.add(R),m.push({type:"API_USAGE",file:R,depth:2,details:`Likely calls route ${I.name} (matched token '${L}')`,verified:!1}))}}let v=a.files.findContentByToken(e,20);for(let I of v){let N=Ct.relative(this.repoPath,I);!f.has(N)&&I!==p.file_path&&(f.add(N),m.push({type:"POTENTIAL_USAGE",file:N,depth:2,details:`Contains keyword '${e}' (Dynamic/Implicit usage)`,verified:!0}))}p.kind==="HTTP Route"&&await this.addCrossRepoImpact(m,f,p),m.sort((I,N)=>I.verified&&!N.verified?-1:!I.verified&&N.verified?1:I.depth!==N.depth?I.depth-N.depth:I.file.localeCompare(N.file));let y=m.length,b=m.slice(s,s+o),_=s+o<y,x=c.getMappedTestsForSymbol(p.file_path,p.name,12),E=this.calculateRiskScore(p,y,m);u.push({symbol:e,definedIn:Ct.relative(this.repoPath,p.file_path),riskScore:E,impact:b,pagination:{total:y,offset:s,limit:o,hasMore:_},verification:{coverageHint:x.length>0?"covered":"uncovered",mappedTestCount:x.length,mappedTests:x.map(I=>I.file)}})}return u}async verifySymbolUsage(e,r){try{if(!ym.existsSync(e))return!1;let i=ym.readFileSync(e,"utf8"),t=Ct.extname(e).toLowerCase(),o=new Set;if(t===".ts"||t===".tsx"||t===".js"||t===".jsx"){let s=new wr;try{let a=await vi(i,{syntax:"typescript",tsx:e.endsWith(".tsx"),target:"es2020"});s.visitModule(a),o=s.calls}catch{return i.includes(r)}}else{let s=new nn;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=gm();for(let o of t)try{let a=(await import("os")).homedir(),c=Ct.join(a,".mcp-liquid-shadow","fused"),l=o.replace(/[^a-zA-Z0-9-_]/g,"_"),u=Ct.join(c,`${l}.db`);if(!ym.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=Ct.relative(f.source_repo,f.source_file_path),v=`${f.source_repo}:${h}`;r.has(v)||(r.add(v),e.push({type:"CROSS_REPO_API_CALL",file:v,depth:1,details:`Cross-repo API call from ${Ct.basename(f.source_repo)}`,verified:!0}))}}catch{continue}}catch{}}calculateRiskScore(e,r,i){let a=(new he(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}}};Q();async function $v(n){let{repoPath:e,filePath:r,symbolName:i,depth:t=3,limit:o=50,offset:s=0}=n;await oe(e);try{let c=await new Ir(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 S.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();import bm from"path";import Fk from"fs";var ba=class{constructor(e){this.repoPath=e}async analyzeMesh(e,r){let{files:i}=z.getInstance(this.repoPath),t=i.findSynapses({name:e,type:r?.type,limit:500}),o=[],s=[];for(let c of t){let l={file:bm.relative(this.repoPath,c.file_path),line:c.line_number??null,snippet:c.code_snippet??null,repoPath:this.repoPath};c.direction==="produce"?o.push(l):s.push(l)}let a=[];if(r?.includeCrossRepo)try{let{listFusedIndexes:c}=await Promise.resolve().then(()=>(ya(),_v)),l=await import("os"),u=c();for(let p of u)try{let d=l.homedir(),m=bm.join(d,".mcp-liquid-shadow","fused"),f=p.replace(/[^a-zA-Z0-9-_]/g,"_"),h=bm.join(m,`${f}.db`);if(!Fk.existsSync(h))continue;let v=(await import("better-sqlite3")).default,y=new v(h,{readonly:!0}),b=y.prepare(`SELECT source_repo, target_repo, source_file_path, target_file_path, relationship, metadata
|
|
967
|
+
`+m),m+="\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars.",{content:[{type:"text",text:m}]}}X();ee();async function Z_(n){let e=zr(n.query??""),r={...n,query:e},i=kr();try{let{repoPath:t}=ze(r),{query:o,limit:s=ve.DEFAULT_LIMIT,offset:a=0,ranked:c=!1}=r;await ae(t);let{filters:l,hasFilters:u}=Lr(r),d=await new Pt(t).searchByPath(o,s,a,l,u,c);return oI(t,o,"path"),i(),d}catch(t){return E.error({error:t,args:n},"Path Search failed"),i(),await Zt(),{content:[{type:"text",text:`Path Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function oI(n,e,r){try{let i=N.getInstance(n),t=xe(n);i.searchHistory.record(e,r,t)}catch(i){let t=xe(n);E.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),Zt()}}ee();yt();import{Visitor as sI}from"@swc/core/Visitor.js";var Mr=class extends sI{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})}}}},yn=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)}}}};Ca();ee();import Q_ from"path";function ev(n){let e=n.replace(/\\/g,"/").toLowerCase();return e.includes("/test/")||e.includes("/tests/")||e.includes("/__tests__/")||e.endsWith(".spec.ts")||e.endsWith(".spec.tsx")||e.endsWith(".spec.js")||e.endsWith(".spec.jsx")||e.endsWith(".test.ts")||e.endsWith(".test.tsx")||e.endsWith(".test.js")||e.endsWith(".test.jsx")}var _n=class{constructor(e){this.repoPath=e}getMappedTestsForSymbol(e,r,i=10){let t=N.getInstance(this.repoPath),o=Math.max(1,Math.min(i,50)),s=t.imports.findProxies(e).map(p=>p.file_path),a=Array.from(new Set([e,...s])),c=new Map,l=t.imports.findVerifiedDependents(a,r);for(let p of l)ev(p.file_path)&&(c.has(p.file_path)||c.set(p.file_path,{absolutePath:p.file_path,file:Q_.relative(this.repoPath,p.file_path),via:"import",confidence:"high"}));let u=t.files.findContentByToken(r,o*3);for(let p of u)ev(p)&&(c.has(p)||c.set(p,{absolutePath:p,file:Q_.relative(this.repoPath,p),via:"content",confidence:"medium"}));return Array.from(c.values()).sort((p,d)=>p.confidence!==d.confidence?p.confidence==="high"?-1:1:p.file.localeCompare(d.file)).slice(0,o)}};import Ht from"path";import zm from"fs";var Ur=class{constructor(e){this.repoPath=e}async analyze(e,r={}){let{filePath:i,depth:t=3,limit:o=50,offset:s=0}=r,a=N.getInstance(this.repoPath),c=new _n(this.repoPath),l=i?a.exports.findByNameAndFile(e,i):a.exports.findByNameGlobal(e);if(l.length===0)return[];let u=[];for(let p of l){let d=a.imports.findImpactDependents(p.file_path,`%${e}%`,t),m=[],f=new Set;for(let T of d){let z=Ht.relative(this.repoPath,T.consumer_path);if(f.has(z))continue;let D=`Imports ${T.imported_symbols}`,C=await this.verifySymbolUsage(T.consumer_path,p.name);C?D+=" (\u2705 Verified Call)":D+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",f.add(z),m.push({type:"IMPORT",file:z,depth:T.depth,details:D,verified:C})}let g=a.exports.findRoutesByCapability(e);p.kind==="HTTP Route"&&g.push({name:p.name,file_path:p.file_path,signature:p.signature});for(let T of g){let D=T.name.split("/").filter(I=>I.length>3&&!I.includes("{")&&!I.includes("$")&&!I.includes("<")).sort((I,A)=>A.length-I.length)[0];if(!D||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(D.toLowerCase()))continue;let C=a.files.findContentByToken(D,10);for(let I of C){let A=Ht.relative(this.repoPath,I);!f.has(A)&&I!==p.file_path&&(f.add(A),m.push({type:"API_USAGE",file:A,depth:2,details:`Likely calls route ${T.name} (matched token '${D}')`,verified:!1}))}}let $=a.files.findContentByToken(e,20);for(let T of $){let z=Ht.relative(this.repoPath,T);!f.has(z)&&T!==p.file_path&&(f.add(z),m.push({type:"POTENTIAL_USAGE",file:z,depth:2,details:`Contains keyword '${e}' (Dynamic/Implicit usage)`,verified:!0}))}p.kind==="HTTP Route"&&await this.addCrossRepoImpact(m,f,p),m.sort((T,z)=>T.verified&&!z.verified?-1:!T.verified&&z.verified?1:T.depth!==z.depth?T.depth-z.depth:T.file.localeCompare(z.file));let y=m.length,v=m.slice(s,s+o),b=s+o<y,S=c.getMappedTestsForSymbol(p.file_path,p.name,12),w=this.calculateRiskScore(p,y,m);u.push({symbol:e,definedIn:Ht.relative(this.repoPath,p.file_path),riskScore:w,impact:v,pagination:{total:y,offset:s,limit:o,hasMore:b},verification:{coverageHint:S.length>0?"covered":"uncovered",mappedTestCount:S.length,mappedTests:S.map(T=>T.file)}})}return u}async verifySymbolUsage(e,r){try{if(!zm.existsSync(e))return!1;let i=zm.readFileSync(e,"utf8"),t=Ht.extname(e).toLowerCase(),o=new Set;if(t===".ts"||t===".tsx"||t===".js"||t===".jsx"){let s=new Mr;try{let a=await Ni(i,{syntax:"typescript",tsx:e.endsWith(".tsx"),target:"es2020"});s.visitModule(a),o=s.calls}catch{return i.includes(r)}}else{let s=new yn;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=Am();for(let o of t)try{let a=(await import("os")).homedir(),c=Ht.join(a,".mcp-liquid-shadow","fused"),l=o.replace(/[^a-zA-Z0-9-_]/g,"_"),u=Ht.join(c,`${l}.db`);if(!zm.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 g=Ht.relative(f.source_repo,f.source_file_path),$=`${f.source_repo}:${g}`;r.has($)||(r.add($),e.push({type:"CROSS_REPO_API_CALL",file:$,depth:1,details:`Cross-repo API call from ${Ht.basename(f.source_repo)}`,verified:!0}))}}catch{continue}}catch{}}calculateRiskScore(e,r,i){let a=(new Se(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}}};X();async function tv(n){let{repoPath:e,filePath:r,symbolName:i,depth:t=3,limit:o=50,offset:s=0}=n;await ae(e);try{let c=await new Ur(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 E.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();import Dm from"path";import yI from"fs";var Na=class{constructor(e){this.repoPath=e}async analyzeMesh(e,r){let{files:i}=N.getInstance(this.repoPath),t=i.findSynapses({name:e,type:r?.type,limit:500}),o=[],s=[];for(let c of t){let l={file:Dm.relative(this.repoPath,c.file_path),line:c.line_number??null,snippet:c.code_snippet??null,repoPath:this.repoPath};c.direction==="produce"?o.push(l):s.push(l)}let a=[];if(r?.includeCrossRepo)try{let{listFusedIndexes:c}=await Promise.resolve().then(()=>(Ca(),X_)),l=await import("os"),u=c();for(let p of u)try{let d=l.homedir(),m=Dm.join(d,".mcp-liquid-shadow","fused"),f=p.replace(/[^a-zA-Z0-9-_]/g,"_"),g=Dm.join(m,`${f}.db`);if(!yI.existsSync(g))continue;let $=(await import("better-sqlite3")).default,y=new $(g,{readonly:!0}),v=y.prepare(`SELECT source_repo, target_repo, source_file_path, target_file_path, relationship, metadata
|
|
913
968
|
FROM virtual_edges
|
|
914
969
|
WHERE (source_repo = ? OR target_repo = ?)
|
|
915
|
-
LIMIT 200`).all(this.repoPath,this.repoPath);y.close();for(let
|
|
970
|
+
LIMIT 200`).all(this.repoPath,this.repoPath);y.close();for(let b of v)a.push({sourceRepo:b.source_repo,targetRepo:b.target_repo,sourceFile:b.source_file_path,targetFile:b.target_file_path,relationship:b.relationship,confidence:b.metadata?JSON.parse(b.metadata)?.confidence??1:1})}catch{}}catch{}return{topic:e,type:r?.type,producers:o,consumers:s,crossRepoEdges:a,totalEdges:o.length+s.length+a.length}}};async function nv(n){let{repoPath:e,topic:r,type:i,includeCrossRepo:t=!1,format:o="json"}=n;if(!r||typeof r!="string"||r.trim().length===0)return{isError:!0,content:[{type:"text",text:"topic must be a non-empty string"}]};await ae(e);let a=await new Na(e).analyzeMesh(r.trim(),{type:i,includeCrossRepo:t});if(a.totalEdges===0)return{content:[{type:"text",text:`No producers or consumers found for topic "${r}" in the indexed files.
|
|
916
971
|
|
|
917
972
|
Suggestions:
|
|
918
973
|
- Check the topic name \u2014 partial matches are supported.
|
|
@@ -930,42 +985,42 @@ Suggestions:
|
|
|
930
985
|
`);if(a.crossRepoEdges.length>0){c+=`
|
|
931
986
|
## Cross-Repo Edges (${a.crossRepoEdges.length})
|
|
932
987
|
`;for(let l of a.crossRepoEdges)c+=`- ${l.sourceRepo} \u2192 ${l.targetRepo} (${l.relationship})
|
|
933
|
-
`}return{content:[{type:"text",text:c.trim()}]}}return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}ee();import{execSync as
|
|
934
|
-
`).map(i=>i.trim()).filter(Boolean),r=[];for(let i of e){let t=i.split(" ").filter(Boolean);if(t.length<2)continue;let s=t[0].charAt(0).toUpperCase(),a=s==="M"?"modified":s==="A"?"added":s==="D"?"deleted":s==="R"?"renamed":s==="C"?"copied":"unknown";if((a==="renamed"||a==="copied")&&t.length>=3){r.push({status:a,oldPath:
|
|
935
|
-
`);for(let t of i){if(t.startsWith("+++ ")){let c=t.slice(4).trim();c==="/dev/null"?r=null:(r=
|
|
936
|
-
`).map(l=>l.trim()).filter(Boolean))s.has(c)||s.set(c,{relativePath:c,absolutePath:Ev.resolve(this.repoPath,c),status:"added",ranges:[]})}return Array.from(s.values()).sort((a,c)=>a.relativePath.localeCompare(c.relativePath))}mapChangesToSymbols(e,r=30){let i=z.getInstance(this.repoPath),t=Math.max(1,Math.min(r,200)),o=[],s=new Set;for(let a of e){if(a.status==="deleted"||!Zk.existsSync(a.absolutePath))continue;let c=i.exports.findByFile(a.absolutePath);if(c.length!==0)for(let l of c){let u=l.start_line||1,p=l.end_line||u,d=a.ranges.length===0?[]:a.ranges.filter(f=>Gk(u,p,f));if(a.ranges.length>0&&d.length===0)continue;let m=`${a.relativePath}:${l.name}:${u}`;s.has(m)||(s.add(m),o.push({id:l.id||null,name:l.name,kind:l.kind,file:a.relativePath,absolutePath:a.absolutePath,startLine:u,endLine:p,status:a.status,changedRanges:d}))}}return o.sort((a,c)=>a.file!==c.file?a.file.localeCompare(c.file):a.startLine-c.startLine).slice(0,t)}};ee();async function Iv(n){let{repoPath:e}=Re(n),{baseCommit:r,headCommit:i,staged:t=!0,includeUntracked:o=!0,maxSymbols:s=20,impactDepth:a=2,impactLimit:c=12}=n;await oe(e);let l=new _a(e),u=l.collectFileChanges({baseCommit:r,headCommit:i,staged:t,includeUntracked:o}),p=l.mapChangesToSymbols(u,s);if(u.length===0)return{content:[{type:"text",text:JSON.stringify({summary:"No diff detected.",changes:[]},null,2)}]};let d=new Ir(e),m=new on(e),f=z.getInstance(e),h=[],v=new Set,y=new Set;for(let _ of p){let x=await d.analyze(_.name,{filePath:_.absolutePath,depth:a,limit:c}),E=x.length>0?x[0]:null;for(let L of E?.impact||[])L?.file&&v.add(String(L.file));let I=f.exports.findTypeGraphEdges(_.name,{filePath:_.absolutePath,direction:"both",limit:20}),N=m.getMappedTestsForSymbol(_.absolutePath,_.name,10);for(let L of N)y.add(L.file);h.push({symbol:{name:_.name,kind:_.kind,file:_.file,startLine:_.startLine,endLine:_.endLine,status:_.status,changedRanges:_.changedRanges},impact:E?{riskScore:E.riskScore,blastRadius:E.pagination.total,topImpacted:E.impact.slice(0,8)}:null,typeGraph:{edgeCount:I.length,edges:I.slice(0,10).map(L=>({direction:L.direction,relationship:L.relationship,source:L.source_symbol_name,target:L.target_symbol_name}))},verification:{mappedTestCount:N.length,mappedTests:N.map(L=>({file:L.file,via:L.via,confidence:L.confidence}))}})}let b={changedFiles:u.length,changedSymbols:p.length,impactedFiles:v.size,suggestedTests:y.size};return{content:[{type:"text",text:JSON.stringify({summary:b,diffScope:{staged:t,includeUntracked:o,...r?{baseCommit:r}:{},...i?{headCommit:i}:{}},changes:u.map(_=>({file:_.relativePath,status:_.status,..._.oldRelativePath?{from:_.oldRelativePath}:{},changedRanges:_.ranges})),symbols:h,verification:{suggestedTestFiles:Array.from(y).sort()}},null,2)}]}}ee();async function Tv(n){let{repoPath:e,filePath:r}=Re(n),{symbolName:i,direction:t="both",relationship:o,limit:s=50}=n;await oe(e);let c=z.getInstance(e).exports.findTypeGraphEdges(i,{filePath:r,direction:t,relationship:o,limit:s}),l=c.reduce((u,p)=>(u.byRelationship[p.relationship]||(u.byRelationship[p.relationship]=0),u.byRelationship[p.relationship]+=1,u.byDirection[p.direction]||(u.byDirection[p.direction]=0),u.byDirection[p.direction]+=1,u),{byRelationship:{},byDirection:{}});return{content:[{type:"text",text:JSON.stringify({symbol:i,...r?{filePath:r}:{},direction:t,...o?{relationship:o}:{},totalEdges:c.length,summary:l,edges:c.map(u=>({direction:u.direction,relationship:u.relationship,source:u.source_symbol_name,target:u.target_symbol_name,file:u.file_path,line:u.line_number}))},null,2)}]}}ee();Q();import $n from"fs";import Pe from"path";var Jk=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"]),Vk=new Set(["GET","POST","PUT","DELETE","PATCH"]),qk=[/\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 Kk(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ki(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function vm(n){let e=ki(n).replace(/:[^/]+/g,"__SEG__").replace(/\{[^}]+\}/g,"__SEG__").replace(/\$[^/]+/g,"__SEG__").replace(/\*/g,"__SEG__"),r=Kk(e).replace(/__SEG__/g,"[^/]+");return new RegExp(`^${r}$`)}function Rv(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&&Vk.has(r)?r:null}function Yk(n){return n.replace(/<[^>]+>/g," ")}function Xk(n){return qk.some(e=>e.test(n))}function Qk(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 eI(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 ki(e)}function tI(n,e){let r=Qk(n);for(let i of r){let t=eI(i);if(!t)continue;let o=vm(t),s=e.replace(/\*/g,"test-val");if(o.test(s)||!/[:{*$]/.test(t)&&s.startsWith(`${t}/`))return!0}return!1}function nI(n,e){if(e)try{let t=JSON.parse(e);if(typeof t.path=="string"&&t.path.startsWith("/"))return ki(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 ki(t)}}return null}function rI(n,e){let r=n.toLowerCase();return e.reduce((i,t)=>i+(r.includes(t.toLowerCase())?20:0),0)}function Pv(n,e,r){let i=e,t=e.match(/\$\{([^}]+)\}/g);if(t)for(let m of t){let f=m.substring(2,m.length-1),h=n.configs.findEnvValue(f);h&&(i=i.replace(m,h))}let o=i.split("?")[0].split("#")[0];try{o.includes("://")&&(o=new URL(o).pathname)}catch{}o=ki(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 m of u)vm(m.name).test(o.replace(/\*/g,"test-val"))&&(a.push({file_path:m.file_path,start_line:m.line_number||0,signature:`[Synapse] ${m.name}`,score:1e3}),c=!0);let p=o.split(/[^a-zA-Z0-9-_]/).filter(m=>m.length>=3&&!Jk.has(m.toLowerCase())&&!/^\d+$/.test(m));if(p.length>0){let h=[...p].sort((y,b)=>b.length-y.length).slice(0,2).flatMap(y=>n.exports.findRoutesByToken(y,20)),v=new Set;for(let y of h){let b=`${y.file_path}:${y.start_line}:${y.name}`;if(v.has(b))continue;v.add(b);let _=y.signature||y.name||"",x=Rv(_);if(s&&x&&s!==x)continue;let E=nI(_,y.capabilities);if(s&&!x&&!E)continue;let I=40;if(E){if(!vm(E).test(o.replace(/\*/g,"test-val")))continue;I+=280,c=!0}s&&x&&s===x&&(I+=120,c=!0),I+=rI(`${_} ${E||""}`,p),a.push({file_path:y.file_path,start_line:y.start_line,signature:`[Boundary] ${_}`,capabilities:y.capabilities||void 0,score:I})}}if(a.length<3&&!c){let m=p.map(f=>f.replace(/[^a-zA-Z0-9_]/g,"")).filter(f=>f.length>0).join(" AND ");if(m.length>0){let f=n.content.search(m);for(let h of f){let v=Yk(h.snippet);if(!Xk(v)||!tI(v,o))continue;let y=Rv(v);if(s&&y&&y!==s)continue;let b=0,_=h.file_path.toLowerCase(),x=v.toLowerCase();(_.includes("route")||_.includes("controller"))&&(b+=10),(_.includes("src/api")||_.includes("services/api"))&&(b+=5),(x.includes("addroute")||x.includes("@get"))&&(b+=15),(x.includes("axios.")||x.includes("fetch("))&&(b-=10),(_.includes(".spec.")||_.includes(".test."))&&(b-=20),s&&x.includes(s.toLowerCase())&&(b+=20),b>0&&a.push({file_path:h.file_path,start_line:0,signature:`[FTS Match] ${v.replace(/\n/g," ")}`,score:b})}}}let d=new Map;return a.sort((m,f)=>f.score-m.score).forEach(m=>{d.has(m.file_path)||d.set(m.file_path,m)}),Array.from(d.values()).slice(0,c?2:3)}var _m=7,Sn=80,iI=2,oI=4,sI=6,aI=3,cI=24,lI=new Set(["publish","publishmessage","publishtaskbynameandpayload"]),uI=new Set(["Error","TypeError","RangeError","ReferenceError","SyntaxError","Promise","Map","Set","WeakMap","WeakSet","Date","Array","Object","String","Number","Boolean","RegExp","URL","URLSearchParams"]),pI=new Set(["error","errors","request","response","result","results","value","values","item","data","payload","message","messages","text","description","name","id","type","status","code"]),Cv=new Set(["req","res","request","response","error","err","event","item","row","data","value","obj","window","document","console","json","math"]),dI=new Set(["length","size","value","values","name","id","type","status"]),zv=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 mI(n,e){return Pe.resolve(n)===Pe.resolve(e)}function fI(n){if(uI.has(n))return!0;let e=n.trim().toLowerCase();if(!e||e.length<2||/\[|\]|\s/.test(n)||pI.has(e))return!0;let r=n.split(/(?:\.|->|::)+/).filter(Boolean),i=(r.length>0?r[r.length-1]:e).replace(/^\$+/,"");if(dI.has(i.toLowerCase())||zv.has(i))return!0;if(r.length>1){let t=r[0].replace(/^\$+/,"").toLowerCase();if(Cv.has(t))return!0}return!1}function Sm(n,e){if(e.has(n))return e.get(n)??null;try{let r=$n.readFileSync(n,"utf8");return e.set(n,r),r}catch{return null}}function hI(n){return n<20?_m:n<45?_m-1:Math.max(4,_m-2)}function gI(n,e){let r=n<=2?1:n<=4?.7:.4,i=e<25?1:e<55?.8:.55,t=Math.floor(cI*r*i);return Math.max(aI,t)}function yI(n,e){let r=n.split(`
|
|
937
|
-
`),i=new Map,t=new Map,o=[],s=new Set;for(let a=0;a<r.length;a++){let c=r[a],l=e+a+1,u=c.match(/\b(?:const|let|var)\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*=/),p=c.match(/\b([A-Za-z_$][A-Za-z0-9_$]*)\s*=\s*[^=]/),d=u?.[1]||p?.[1];if(d){i.set(d,l);continue}for(let[m,f]of i.entries()){if(l<=f||!new RegExp(`\\b${
|
|
938
|
-
`),s=
|
|
988
|
+
`}return{content:[{type:"text",text:c.trim()}]}}return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}ee();import{execSync as bI}from"child_process";import _I from"fs";import rv from"path";function iv(n){let e=n.trim();if(!/^[A-Za-z0-9._:/-]+$/.test(e))throw new Error(`Invalid git ref: ${n}`);return e}function Aa(n){let e=n.trim();return e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function vI(n){if(n.length<=1)return n;let e=[...n].sort((i,t)=>i.start-t.start),r=[];for(let i of e){let t=r[r.length-1];if(!t||i.start>t.end+1){r.push({...i});continue}t.end=Math.max(t.end,i.end)}return r}function xI(n){if(!n.trim())return[];let e=n.split(`
|
|
989
|
+
`).map(i=>i.trim()).filter(Boolean),r=[];for(let i of e){let t=i.split(" ").filter(Boolean);if(t.length<2)continue;let s=t[0].charAt(0).toUpperCase(),a=s==="M"?"modified":s==="A"?"added":s==="D"?"deleted":s==="R"?"renamed":s==="C"?"copied":"unknown";if((a==="renamed"||a==="copied")&&t.length>=3){r.push({status:a,oldPath:Aa(t[1]),path:Aa(t[2])});continue}r.push({status:a,path:Aa(t[1])})}return r}function SI(n){let e=new Map;if(!n.trim())return e;let r=null,i=n.split(`
|
|
990
|
+
`);for(let t of i){if(t.startsWith("+++ ")){let c=t.slice(4).trim();c==="/dev/null"?r=null:(r=Aa(c),e.has(r)||e.set(r,[]));continue}if(!r)continue;let o=t.match(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/);if(!o)continue;let s=Number(o[1]),a=Number(o[2]||"1");!Number.isFinite(s)||!Number.isFinite(a)||a<=0||e.get(r).push({start:s,end:s+a-1})}for(let[t,o]of e.entries())e.set(t,vI(o));return e}function $I(n,e,r){return n<=r.end&&r.start<=e}var za=class{constructor(e){this.repoPath=e}execGit(e){let r=`git ${e.join(" ")}`;return bI(r,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim()}buildDiffArgs(e,r){let i=["diff","--find-renames"];r?i.push("--unified=0","--no-color"):i.push("--name-status"),e.staged&&i.push("--cached");let t=e.baseCommit?iv(e.baseCommit):null,o=e.headCommit?iv(e.headCommit):null;return t&&o?i.push(t,o):t?i.push(t):e.staged||i.push("HEAD"),i}collectFileChanges(e={}){let r=this.execGit(this.buildDiffArgs(e,!1)),i=this.execGit(this.buildDiffArgs(e,!0)),t=xI(r),o=SI(i),s=new Map;for(let a of t){let c=o.get(a.path)||[];s.set(a.path,{relativePath:a.path,absolutePath:rv.resolve(this.repoPath,a.path),status:a.status,...a.oldPath?{oldRelativePath:a.oldPath}:{},ranges:c})}if(e.includeUntracked){let a=this.execGit(["ls-files","--others","--exclude-standard"]);if(a)for(let c of a.split(`
|
|
991
|
+
`).map(l=>l.trim()).filter(Boolean))s.has(c)||s.set(c,{relativePath:c,absolutePath:rv.resolve(this.repoPath,c),status:"added",ranges:[]})}return Array.from(s.values()).sort((a,c)=>a.relativePath.localeCompare(c.relativePath))}mapChangesToSymbols(e,r=30){let i=N.getInstance(this.repoPath),t=Math.max(1,Math.min(r,200)),o=[],s=new Set;for(let a of e){if(a.status==="deleted"||!_I.existsSync(a.absolutePath))continue;let c=i.exports.findByFile(a.absolutePath);if(c.length!==0)for(let l of c){let u=l.start_line||1,p=l.end_line||u,d=a.ranges.length===0?[]:a.ranges.filter(f=>$I(u,p,f));if(a.ranges.length>0&&d.length===0)continue;let m=`${a.relativePath}:${l.name}:${u}`;s.has(m)||(s.add(m),o.push({id:l.id||null,name:l.name,kind:l.kind,file:a.relativePath,absolutePath:a.absolutePath,startLine:u,endLine:p,status:a.status,changedRanges:d}))}}return o.sort((a,c)=>a.file!==c.file?a.file.localeCompare(c.file):a.startLine-c.startLine).slice(0,t)}};ee();async function ov(n){let{repoPath:e}=ze(n),{baseCommit:r,headCommit:i,staged:t=!0,includeUntracked:o=!0,maxSymbols:s=20,impactDepth:a=2,impactLimit:c=12}=n;await ae(e);let l=new za(e),u=l.collectFileChanges({baseCommit:r,headCommit:i,staged:t,includeUntracked:o}),p=l.mapChangesToSymbols(u,s);if(u.length===0)return{content:[{type:"text",text:JSON.stringify({summary:"No diff detected.",changes:[]},null,2)}]};let d=new Ur(e),m=new _n(e),f=N.getInstance(e),g=[],$=new Set,y=new Set;for(let b of p){let S=await d.analyze(b.name,{filePath:b.absolutePath,depth:a,limit:c}),w=S.length>0?S[0]:null;for(let D of w?.impact||[])D?.file&&$.add(String(D.file));let T=f.exports.findTypeGraphEdges(b.name,{filePath:b.absolutePath,direction:"both",limit:20}),z=m.getMappedTestsForSymbol(b.absolutePath,b.name,10);for(let D of z)y.add(D.file);g.push({symbol:{name:b.name,kind:b.kind,file:b.file,startLine:b.startLine,endLine:b.endLine,status:b.status,changedRanges:b.changedRanges},impact:w?{riskScore:w.riskScore,blastRadius:w.pagination.total,topImpacted:w.impact.slice(0,8)}:null,typeGraph:{edgeCount:T.length,edges:T.slice(0,10).map(D=>({direction:D.direction,relationship:D.relationship,source:D.source_symbol_name,target:D.target_symbol_name}))},verification:{mappedTestCount:z.length,mappedTests:z.map(D=>({file:D.file,via:D.via,confidence:D.confidence}))}})}let v={changedFiles:u.length,changedSymbols:p.length,impactedFiles:$.size,suggestedTests:y.size};return{content:[{type:"text",text:JSON.stringify({summary:v,diffScope:{staged:t,includeUntracked:o,...r?{baseCommit:r}:{},...i?{headCommit:i}:{}},changes:u.map(b=>({file:b.relativePath,status:b.status,...b.oldRelativePath?{from:b.oldRelativePath}:{},changedRanges:b.ranges})),symbols:g,verification:{suggestedTestFiles:Array.from(y).sort()}},null,2)}]}}ee();async function sv(n){let{repoPath:e,filePath:r}=ze(n),{symbolName:i,direction:t="both",relationship:o,limit:s=50}=n;await ae(e);let c=N.getInstance(e).exports.findTypeGraphEdges(i,{filePath:r,direction:t,relationship:o,limit:s}),l=c.reduce((u,p)=>(u.byRelationship[p.relationship]||(u.byRelationship[p.relationship]=0),u.byRelationship[p.relationship]+=1,u.byDirection[p.direction]||(u.byDirection[p.direction]=0),u.byDirection[p.direction]+=1,u),{byRelationship:{},byDirection:{}});return{content:[{type:"text",text:JSON.stringify({symbol:i,...r?{filePath:r}:{},direction:t,...o?{relationship:o}:{},totalEdges:c.length,summary:l,edges:c.map(u=>({direction:u.direction,relationship:u.relationship,source:u.source_symbol_name,target:u.target_symbol_name,file:u.file_path,line:u.line_number}))},null,2)}]}}ee();X();import Mn from"fs";import De from"path";var wI=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"]),EI=new Set(["GET","POST","PUT","DELETE","PATCH"]),kI=[/\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 II(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ji(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function Lm(n){let e=ji(n).replace(/:[^/]+/g,"__SEG__").replace(/\{[^}]+\}/g,"__SEG__").replace(/\$[^/]+/g,"__SEG__").replace(/\*/g,"__SEG__"),r=II(e).replace(/__SEG__/g,"[^/]+");return new RegExp(`^${r}$`)}function av(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&&EI.has(r)?r:null}function TI(n){return n.replace(/<[^>]+>/g," ")}function RI(n){return kI.some(e=>e.test(n))}function PI(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 CI(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 ji(e)}function NI(n,e){let r=PI(n);for(let i of r){let t=CI(i);if(!t)continue;let o=Lm(t),s=e.replace(/\*/g,"test-val");if(o.test(s)||!/[:{*$]/.test(t)&&s.startsWith(`${t}/`))return!0}return!1}function AI(n,e){if(e)try{let t=JSON.parse(e);if(typeof t.path=="string"&&t.path.startsWith("/"))return ji(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 ji(t)}}return null}function zI(n,e){let r=n.toLowerCase();return e.reduce((i,t)=>i+(r.includes(t.toLowerCase())?20:0),0)}function cv(n,e,r){let i=e,t=e.match(/\$\{([^}]+)\}/g);if(t)for(let m of t){let f=m.substring(2,m.length-1),g=n.configs.findEnvValue(f);g&&(i=i.replace(m,g))}let o=i.split("?")[0].split("#")[0];try{o.includes("://")&&(o=new URL(o).pathname)}catch{}o=ji(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 m of u)Lm(m.name).test(o.replace(/\*/g,"test-val"))&&(a.push({file_path:m.file_path,start_line:m.line_number||0,signature:`[Synapse] ${m.name}`,score:1e3}),c=!0);let p=o.split(/[^a-zA-Z0-9-_]/).filter(m=>m.length>=3&&!wI.has(m.toLowerCase())&&!/^\d+$/.test(m));if(p.length>0){let g=[...p].sort((y,v)=>v.length-y.length).slice(0,2).flatMap(y=>n.exports.findRoutesByToken(y,20)),$=new Set;for(let y of g){let v=`${y.file_path}:${y.start_line}:${y.name}`;if($.has(v))continue;$.add(v);let b=y.signature||y.name||"",S=av(b);if(s&&S&&s!==S)continue;let w=AI(b,y.capabilities);if(s&&!S&&!w)continue;let T=40;if(w){if(!Lm(w).test(o.replace(/\*/g,"test-val")))continue;T+=280,c=!0}s&&S&&s===S&&(T+=120,c=!0),T+=zI(`${b} ${w||""}`,p),a.push({file_path:y.file_path,start_line:y.start_line,signature:`[Boundary] ${b}`,capabilities:y.capabilities||void 0,score:T})}}if(a.length<3&&!c){let m=p.map(f=>f.replace(/[^a-zA-Z0-9_]/g,"")).filter(f=>f.length>0).join(" AND ");if(m.length>0){let f=n.content.search(m);for(let g of f){let $=TI(g.snippet);if(!RI($)||!NI($,o))continue;let y=av($);if(s&&y&&y!==s)continue;let v=0,b=g.file_path.toLowerCase(),S=$.toLowerCase();(b.includes("route")||b.includes("controller"))&&(v+=10),(b.includes("src/api")||b.includes("services/api"))&&(v+=5),(S.includes("addroute")||S.includes("@get"))&&(v+=15),(S.includes("axios.")||S.includes("fetch("))&&(v-=10),(b.includes(".spec.")||b.includes(".test."))&&(v-=20),s&&S.includes(s.toLowerCase())&&(v+=20),v>0&&a.push({file_path:g.file_path,start_line:0,signature:`[FTS Match] ${$.replace(/\n/g," ")}`,score:v})}}}let d=new Map;return a.sort((m,f)=>f.score-m.score).forEach(m=>{d.has(m.file_path)||d.set(m.file_path,m)}),Array.from(d.values()).slice(0,c?2:3)}var Om=7,On=80,DI=2,LI=4,OI=6,MI=3,jI=24,FI=new Set(["publish","publishmessage","publishtaskbynameandpayload"]),UI=new Set(["Error","TypeError","RangeError","ReferenceError","SyntaxError","Promise","Map","Set","WeakMap","WeakSet","Date","Array","Object","String","Number","Boolean","RegExp","URL","URLSearchParams"]),WI=new Set(["error","errors","request","response","result","results","value","values","item","data","payload","message","messages","text","description","name","id","type","status","code"]),uv=new Set(["req","res","request","response","error","err","event","item","row","data","value","obj","window","document","console","json","math"]),ZI=new Set(["length","size","value","values","name","id","type","status"]),pv=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 HI(n,e){return De.resolve(n)===De.resolve(e)}function BI(n){if(UI.has(n))return!0;let e=n.trim().toLowerCase();if(!e||e.length<2||/\[|\]|\s/.test(n)||WI.has(e))return!0;let r=n.split(/(?:\.|->|::)+/).filter(Boolean),i=(r.length>0?r[r.length-1]:e).replace(/^\$+/,"");if(ZI.has(i.toLowerCase())||pv.has(i))return!0;if(r.length>1){let t=r[0].replace(/^\$+/,"").toLowerCase();if(uv.has(t))return!0}return!1}function jm(n,e){if(e.has(n))return e.get(n)??null;try{let r=Mn.readFileSync(n,"utf8");return e.set(n,r),r}catch{return null}}function GI(n){return n<20?Om:n<45?Om-1:Math.max(4,Om-2)}function JI(n,e){let r=n<=2?1:n<=4?.7:.4,i=e<25?1:e<55?.8:.55,t=Math.floor(jI*r*i);return Math.max(MI,t)}function VI(n,e){let r=n.split(`
|
|
992
|
+
`),i=new Map,t=new Map,o=[],s=new Set;for(let a=0;a<r.length;a++){let c=r[a],l=e+a+1,u=c.match(/\b(?:const|let|var)\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*=/),p=c.match(/\b([A-Za-z_$][A-Za-z0-9_$]*)\s*=\s*[^=]/),d=u?.[1]||p?.[1];if(d){i.set(d,l);continue}for(let[m,f]of i.entries()){if(l<=f||!new RegExp(`\\b${dv(m)}\\b`).test(c))continue;let g=t.get(m)||0;if(g>=2)continue;let $=`${m}:${f}->${l}`;s.has($)||(o.push({symbol:m,fromLine:f,toLine:l}),s.add($),t.set(m,g+1))}}return o}function lv(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 dv(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fm(n){let e=n.split(/(?:\.|::|->)+/).filter(Boolean);return e.length>0?e[e.length-1]:n.trim()}function qI(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 Mm(n,e,r){let i=Fm(e);if(!i)return null;try{let t=r?jm(n,r):Mn.readFileSync(n,"utf8");if(!t)return null;let o=t.split(`
|
|
993
|
+
`),s=dv(i),a=[new RegExp(`^\\s*(?:export\\s+)?(?:async\\s+)?function\\s+${s}\\b`),new RegExp(`^\\s*(?:(?:public|private|protected|static|readonly|async|abstract|get|set)\\s+)*${s}\\s*(?:<[^>]*>)?\\s*\\(`),new RegExp(`^\\s*(?:(?:public|private|protected|static|readonly|async|abstract)\\s+)*${s}\\s*[:=]\\s*(?:async\\s*)?(?:\\([^)]*\\)\\s*=>|function\\b)`),new RegExp(`^\\s*(?:export\\s+)?class\\s+${s}\\b`)];for(let c=0;c<o.length;c++){let l=o[c];if(l.includes(i)&&a.some(u=>u.test(l)))return qI(o,c)}}catch{return null}return null}function mv(n,e,r,i){try{let t=i?jm(n,i):Mn.readFileSync(n,"utf8");if(!t)return!0;let o=t.split(`
|
|
939
994
|
`);if(e.start<1||e.end<e.start||e.start>o.length||e.end>o.length||!o.slice(e.start-1,e.end).join(`
|
|
940
|
-
`).trim())return!0;if(e.start===e.end){let a=o[e.start-1]?.trim()||"",c=a.replace(/\s+/g,"");if(!c||/^[{}()[\];,]+$/.test(c))return!0;let l
|
|
941
|
-
File: ${
|
|
942
|
-
`+(
|
|
995
|
+
`).trim())return!0;if(e.start===e.end){let a=o[e.start-1]?.trim()||"",c=a.replace(/\s+/g,"");if(!c||/^[{}()[\];,]+$/.test(c))return!0;let l=Fm(r);if(l&&!a.includes(l))return!0}return!1}catch{return!0}}function Da(n,e,r,i){if(e){if(!r)return e;if(mv(n,e,r,i)){let t=Mm(n,r,i);if(t)return t}return e}}function KI(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=lv(r),c=t.find(l=>!l?.name||typeof l.name!="string"?!1:lv(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 fv(n){let{repoPath:e,filePath:r,symbolName:i}=ze(n);if(!r)return{isError:!0,content:[{type:"text",text:"Error: 'filePath' is required."}]};let t=r;await ae(e);let o=N.getInstance(e);if(!Mn.existsSync(t))return{isError:!0,content:[{type:"text",text:`File not found: ${t}`}]};let s=new Map,a,c=De.basename(t),l;if(i){let m=Fm(i),f=KI(o,t,i);if(f){let g=f;a={start:g.start_line,end:g.end_line},c=g.name,l=g.start_line}else{let g=Mm(t,i,s);if(g)a=g,l=g.start,c=m||i;else{let $=o.exports.findByFile(t).map(y=>y.name).filter(y=>!!y).slice(0,10);return{isError:!0,content:[{type:"text",text:`Symbol not found in file: "${i}"
|
|
996
|
+
File: ${De.relative(e,t)}
|
|
997
|
+
`+($.length>0?`Top symbols in file: ${$.join(", ")}`:"No indexed symbols found for this file.")}]}}}if(a&&mv(t,a,i,s)){let g=Mm(t,i,s);g&&(E.warn({filePath:t,symbolName:i,start:a.start,end:a.end},"Indexed symbol range appears degenerate; using source-inferred range for flow"),a=g,l=g.start,c===De.basename(t)&&(c=m||i))}}let u={type:a?"function":"file",name:c,path:De.relative(e,t),line:l,children:[]},p=new Set;p.add(t+(i?`:${i}`:""));let d={count:0,truncated:!1,pruned:!1};return await Wr(t,u,e,o,p,1,d,s,a),(d.truncated||d.pruned)&&u.children.push({type:"function",name:"\u26A0\uFE0F Trace Pruned",details:`Adaptive trace limits applied (depth/node budget). Current cap: ${On} nodes.`,children:[]}),{content:[{type:"text",text:JSON.stringify(u,null,2)}]}}async function Wr(n,e,r,i,t,o,s,a,c){let l=GI(s.count);if(o>l){s.pruned=!0;return}if(s.count>=On){s.truncated=!0;return}try{let u=jm(n,a);if(!u)throw new Error(`Unable to read source: ${n}`);let p=u,d=De.extname(n).toLowerCase(),f=(p.match(/import\s+[\s\S]*?from\s+['"].*?['"];?/gm)||[]).join(`
|
|
943
998
|
`);c&&(p=p.split(`
|
|
944
999
|
`).slice(c.start-1,c.end).join(`
|
|
945
|
-
`));let
|
|
946
|
-
${p}`:p,
|
|
1000
|
+
`));let g;if(d===".ts"||d===".tsx"||d===".js"||d===".jsx"){g=new Mr;let C={syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"};try{let I=c?`${f}
|
|
1001
|
+
${p}`:p,A=await Ni(I,C);g.visitModule(A)}catch{if(c)try{let A=`${f}
|
|
947
1002
|
class TraceContext {
|
|
948
1003
|
${p}
|
|
949
|
-
}`,A=await vi(R,C);h.visitModule(A)}catch{let A=new nn,W=d;A.visit(p,W),h.calls=A.calls,h.apiCalls=A.apiCalls,h.imports=A.imports}else{let R=new nn;R.visit(p,d),h.calls=R.calls,h.apiCalls=R.apiCalls,h.imports=R.imports}}}else h=new nn,h.visit(p,d);S.info({file:Pe.basename(n),calls:h.calls.size,apiCalls:h.apiCalls.length,depth:o},"Analyzed file");let v=Math.max(0,Sn-s.count),y=Math.max(2,Math.min(10,Math.floor(v/(o<=2?3:5)))),b=h.apiCalls.slice(0,y);h.apiCalls.length>y&&(s.pruned=!0);for(let C of b){if(s.count>=Sn)break;if(s.count++,C.method==="PUBSUB"){let W={type:"event_trigger",name:`PubSub Event: ${C.url}`,details:"Detected via PubSub client usage",children:[]};e.children.push(W);let H=C.url.toLowerCase();if(lI.has(H)){W.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 O=i.exports.findByNameGlobal(C.url).concat(i.exports.findByMethodName(C.url));if(C.url.length>10){let D=C.url.replace(/To[A-Z][a-zA-Z]+$/,"");if(D!==C.url){let M=i.exports.findByNameGlobal(D).concat(i.exports.findByMethodName(D));O.push(...M)}}let K=new Set;for(let D of O.slice(0,oI)){if(K.has(D.file_path)||D.file_path===n)continue;if(K.add(D.file_path),s.count>=Sn)break;s.count++;let M={type:"subscriber",name:`${D.name} (${Pe.basename(D.file_path)})`,path:Pe.relative(r,D.file_path),line:D.start_line,details:"Potential Subscriber / Handler",children:[]};W.children.push(M),$n.existsSync(D.file_path)&&!t.has(D.file_path)&&(t.add(D.file_path),await Tr(D.file_path,M,r,i,t,o+1,s,a))}continue}let $={type:"api_call",name:`${C.method} ${C.url}`,details:"Detected via string literal analysis",children:[]};e.children.push($);let A=Pv(i,C.url,C.method).slice(0,iI);for(let W of A){if(mI(W.file_path,n))continue;if(s.count>=Sn)break;s.count++;let H={type:"route",name:W.signature||"Route Handler",path:W.file_path,line:W.start_line,children:[]};if($.children.push(H),$n.existsSync(W.file_path)&&!t.has(W.file_path)&&(t.add(W.file_path),await Tr(W.file_path,H,r,i,t,o+1,s,a)),W.capabilities)try{let O=JSON.parse(W.capabilities);if(O.handler){let[K,D]=O.handler.split("@");if(K){let V=K.split("\\").pop();if(V){let J=i.exports.findClassByName(V);if(J){let P=i.exports.findByNameAndFile(D||"",J.file_path),k,G=J.start_line;P.length>0&&(k=xa(J.file_path,{start:P[0].start_line,end:P[0].end_line},D||"",a),k||(k={start:P[0].start_line,end:P[0].end_line}),G=k.start);let Y={type:"component",name:`${V}${D?" :: "+D:""}`,path:Pe.relative(r,J.file_path),line:G,details:"Controller Logic (Macro IR)",children:[]};H.children.push(Y),t.has(J.file_path+(D?`:${D}`:""))||(t.add(J.file_path+(D?`:${D}`:"")),await Tr(J.file_path,Y,r,i,t,o+1,s,a,k))}}}}}catch{}}}let _=c?c.start-1:0,x=yI(p,_).slice(0,sI);for(let C of x){if(s.count>=Sn)break;s.count++,e.children.push({type:"data_flow",name:`${C.symbol} handoff`,line:C.toLine,details:`assigned @L${C.fromLine} \u2192 used @L${C.toLine}`,children:[]})}let E=h.calls,I=Array.from(E).sort(),N=gI(o,s.count),L=I.slice(0,N);I.length>N&&(s.pruned=!0);for(let C of L)if(h.imports.has(C)){let $=h.imports.get(C);if(!$.startsWith(".")){if(["react","react-dom"].includes($))continue;e.children.push({type:"function",name:C,details:`External: ${$}`,children:[]});continue}let R=xn($,n,r);if(R&&$n.existsSync(R)){let A=i.exports.findByNameAndFile(C,R),W=A.length>0?A[0]:null,H=W?`${R}:${W.name}`:R;if(t.has(H))e.children.push({type:"function",name:C,details:"Circular / Already Visited",path:Pe.relative(r,R),line:W?.start_line,children:[]});else{t.add(H);let O={type:W?"component":"file",name:C,details:W?`Imported symbol from ${Pe.basename(R)}`:`Imported from ${Pe.basename(R)}`,path:Pe.relative(r,R),line:W?.start_line,children:[]};e.children.push(O);let K=W?xa(R,{start:W.start_line,end:W.end_line},C,a):void 0;await Tr(R,O,r,i,t,o+1,s,a,K)}}}else if(!["log","info","error","warn","print"].includes(C)&&!fI(C)){let $=i.exports.findByNameGlobal(C);if($.length===0){let R=C.split(/(?:\.|->|::)+/);if(R.length>1){let A=R[0]?.replace(/^\$+/,"").toLowerCase(),W=R[R.length-1];!zv.has(W)&&!(A&&Cv.has(A))&&($=i.exports.findByMethodName(W))}}if($.length>0){let R=$.find(W=>W.file_path===n),A=R||($.length===1?$[0]:null);if(A){let W=`${A.file_path}:${A.name}`;if(!t.has(W)){t.add(W);let H={type:"component",name:C,details:`Resolved via global index${R?" (local)":""}`,path:Pe.relative(r,A.file_path),line:xa(A.file_path,{start:A.start_line,end:A.end_line},C,a)?.start,children:[]};e.children.push(H);let O=xa(A.file_path,{start:A.start_line,end:A.end_line},C,a)||{start:A.start_line,end:A.end_line};await Tr(A.file_path,H,r,i,t,o+1,s,a,O)}}}}}catch(u){S.error({filePath:n,error:u.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:u.message,children:[]})}}ee();import Sa from"path";function _I(n){return/^@[^/]+\/[^/]+/.test(n)}function xI(n){return!!(n.startsWith("#")||n.startsWith("@/")||n.startsWith("~/")||n.startsWith("@")&&!_I(n))}function SI(n,e){if(!e)return null;let r=Sa.relative(n,e);return!r||r.startsWith("..")||Sa.isAbsolute(r)?null:r}function $I(n,e,r){return n.startsWith("node:")?"builtin":n.startsWith(".")?"relative":xI(n)?"alias":e.startsWith(r+Sa.sep)?"workspace-package":"external-package"}function wI(n){return n==="builtin"||n==="external-package"||n==="missing"}async function Mv(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await oe(e);let{imports:s}=z.getInstance(e);if(i==="imports"){let c=s.findByFile(r).filter(d=>d.module_specifier!=="__type_reference__").map(d=>{let m=d.resolved_path?null:im(d.module_specifier,r,e),f=d.resolved_path||m?.resolvedPath||null,h=d.resolved_path?$I(d.module_specifier,d.resolved_path,e):m?.kind||"missing",v={module:d.module_specifier,symbols:d.imported_symbols,resolvedPath:f,relativePath:SI(e,f),isExternal:wI(h),dependencyClass:h,isBuiltin:h==="builtin"};if(m&&!m.resolved){let y={...v,resolutionError:m.error};return m.actionable&&m.suggestion?{...y,suggestion:m.suggestion}:y}return v}),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:Ov(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:Sa.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:Ov(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 Ov(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}ee();import Ii from"path";import EI from"fs";var jv={low:0,medium:1,high:2};function wm(n,e){return jv[n]>jv[e]?e:n}function kI(n){return n==="high"?"medium":"low"}function II(n,e,r,i){let t=r,o=i,s=n.toLowerCase().replace(/\\/g,"/");return(s.includes("/__generated__/")||s.includes("/generated/")||s.includes("/.generated/")||s.includes("/dist/")||s.includes("/build/")||s.includes("/vendor/")||s.includes("/coverage/")||s.includes(".generated.")||s.includes(".gen."))&&(t=wm(t,"low"),o+="; generated artifact"),(/(^|\/)(src\/)?app\/.*\/(route|page|layout|loading|error|not-found|default|template)\.(t|j)sx?$/.test(s)||/(^|\/)(src\/)?middleware\.(t|j)sx?$/.test(s)||s.includes("/routes/")||s.includes("/controllers/"))&&(t=wm(t,"medium"),o+="; framework convention entrypoint"),(s.includes("/registry/")||s.includes("/registries/")||s.includes("/plugins/")||s.includes("/providers/")||s.includes("/bootstrap/")||/register|resolver|plugin|provider|adapter/i.test(e))&&(t=wm(t,"medium"),o+="; dynamic discovery surface"),{confidence:t,reason:o}}function TI(n){let e=new Map;for(let r of n)r.resolved_path&&(e.has(r.file_path)||e.set(r.file_path,new Set),e.has(r.resolved_path)||e.set(r.resolved_path,new Set),e.get(r.file_path).add(r.resolved_path));return e}function RI(n){let e=0,r=[],i=new Set,t=new Map,o=new Map,s=[],a=c=>{t.set(c,e),o.set(c,e),e++,r.push(c),i.add(c);for(let l of n.get(c)||[])t.has(l)?i.has(l)&&o.set(c,Math.min(o.get(c),t.get(l))):(a(l),o.set(c,Math.min(o.get(c),o.get(l))));if(o.get(c)===t.get(c)){let l=[];for(;r.length>0;){let u=r.pop();if(i.delete(u),l.push(u),u===c)break}s.push(l)}};for(let c of n.keys())t.has(c)||a(c);return s}function PI(n,e,r){let i=r.get(n);if(i===void 0){try{i=EI.readFileSync(n,"utf8")}catch{i=""}r.set(n,i)}if(!i)return!1;let t=e.module_specifier.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`import\\s+type\\s+.*from\\s+['"]${t}['"]`,"i"),s=new RegExp(`import\\s+\\{.*type\\s+.*\\}.*from\\s+['"]${t}['"]`,"s");if(o.test(i)||s.test(i))return!0;let a=e.imported_symbols.split(",").map(c=>c.trim());for(let c of a){if(!c||c==="*")continue;let l=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\(\\s*\\)\\s*=>\\s*${l}`).test(i))return!0}return!1}function NI(n){let e=new Map;for(let r of n){if(!r.resolved_path)continue;let i=`${r.file_path}|${r.resolved_path}`;e.has(i)||e.set(i,[]),e.get(i).push(r)}return e}function Fv(n,e){let r=new Map,i=new Map;for(let a of n)a.resolved_path&&(r.has(a.file_path)||r.set(a.file_path,new Set),i.has(a.file_path)||i.set(a.file_path,new Set),r.has(a.resolved_path)||r.set(a.resolved_path,new Set),i.has(a.resolved_path)||i.set(a.resolved_path,new Set),r.get(a.file_path).add(a.resolved_path),i.get(a.resolved_path).add(a.file_path));let o=Array.from(new Set([...r.keys(),...i.keys()])).map(a=>{let c=r.get(a)?.size||0,l=i.get(a)?.size||0,u=l+c===0?0:c/(l+c);return{file:Ii.relative(e,a),afferent:l,efferent:c,instability:Number(u.toFixed(3))}}),s=o.length===0?0:Number((o.reduce((a,c)=>a+c.instability,0)/o.length).toFixed(3));return{module_count:o.length,average_instability:s,top_efferent:[...o].sort((a,c)=>c.efferent-a.efferent).slice(0,10),top_afferent:[...o].sort((a,c)=>c.afferent-a.afferent).slice(0,10),most_unstable:[...o].filter(a=>a.afferent+a.efferent>0).sort((a,c)=>c.instability-a.instability||c.efferent-a.efferent).slice(0,10)}}async function Uv(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 oe(e);let{exports:l,imports:u}=z.getInstance(e);if(r==="dead-code"){let p=l.findDeadExports({limit:i,includeTests:t,includeMigrations:o,includeFixtures:s,excludePatterns:a,confidenceThreshold:c}),d=new on(e),m=u.getAllResolved(),f=Fv(m,e),h=p.map(E=>{let I=d.getMappedTestsForSymbol(E.file_path,E.name,6),N=II(E.file_path,E.name,E.confidence,E.reason),L=N.confidence,C=N.reason;return I.length>0&&(L=kI(L),C+="; covered by tests"),{name:E.name,kind:E.kind,file:Ii.relative(e,E.file_path),line:E.start_line,confidence:L,reason:C,testCoverage:{mappedTestCount:I.length,mappedTests:I.map($=>$.file),coverageHint:I.length>0?"covered":"uncovered"}}}),v={high:{},medium:{},low:{}};for(let E of h)v[E.confidence][E.file]||(v[E.confidence][E.file]=[]),v[E.confidence][E.file].push({name:E.name,kind:E.kind,line:E.line,reason:E.reason,testCoverage:E.testCoverage});let y=[],b=Object.values(v.high).flat().length,_=Object.values(v.medium).flat().length,x=Object.values(v.low).flat().length;return y.push(`# Dead Export Analysis
|
|
950
|
-
`),y.push(`Found ${
|
|
951
|
-
`),
|
|
952
|
-
`),y.push(JSON.stringify(
|
|
1004
|
+
}`,M=await Ni(A,C);g.visitModule(M)}catch{let M=new yn,H=d;M.visit(p,H),g.calls=M.calls,g.apiCalls=M.apiCalls,g.imports=M.imports}else{let A=new yn;A.visit(p,d),g.calls=A.calls,g.apiCalls=A.apiCalls,g.imports=A.imports}}}else g=new yn,g.visit(p,d);E.info({file:De.basename(n),calls:g.calls.size,apiCalls:g.apiCalls.length,depth:o},"Analyzed file");let $=Math.max(0,On-s.count),y=Math.max(2,Math.min(10,Math.floor($/(o<=2?3:5)))),v=g.apiCalls.slice(0,y);g.apiCalls.length>y&&(s.pruned=!0);for(let C of v){if(s.count>=On)break;if(s.count++,C.method==="PUBSUB"){let H={type:"event_trigger",name:`PubSub Event: ${C.url}`,details:"Detected via PubSub client usage",children:[]};e.children.push(H);let Y=C.url.toLowerCase();if(FI.has(Y)){H.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 O=i.exports.findByNameGlobal(C.url).concat(i.exports.findByMethodName(C.url));if(C.url.length>10){let L=C.url.replace(/To[A-Z][a-zA-Z]+$/,"");if(L!==C.url){let G=i.exports.findByNameGlobal(L).concat(i.exports.findByMethodName(L));O.push(...G)}}let q=new Set;for(let L of O.slice(0,LI)){if(q.has(L.file_path)||L.file_path===n)continue;if(q.add(L.file_path),s.count>=On)break;s.count++;let G={type:"subscriber",name:`${L.name} (${De.basename(L.file_path)})`,path:De.relative(r,L.file_path),line:L.start_line,details:"Potential Subscriber / Handler",children:[]};H.children.push(G),Mn.existsSync(L.file_path)&&!t.has(L.file_path)&&(t.add(L.file_path),await Wr(L.file_path,G,r,i,t,o+1,s,a))}continue}let I={type:"api_call",name:`${C.method} ${C.url}`,details:"Detected via string literal analysis",children:[]};e.children.push(I);let M=cv(i,C.url,C.method).slice(0,DI);for(let H of M){if(HI(H.file_path,n))continue;if(s.count>=On)break;s.count++;let Y={type:"route",name:H.signature||"Route Handler",path:H.file_path,line:H.start_line,children:[]};if(I.children.push(Y),Mn.existsSync(H.file_path)&&!t.has(H.file_path)&&(t.add(H.file_path),await Wr(H.file_path,Y,r,i,t,o+1,s,a)),H.capabilities)try{let O=JSON.parse(H.capabilities);if(O.handler){let[q,L]=O.handler.split("@");if(q){let re=q.split("\\").pop();if(re){let J=i.exports.findClassByName(re);if(J){let _=i.exports.findByNameAndFile(L||"",J.file_path),x,j=J.start_line;_.length>0&&(x=Da(J.file_path,{start:_[0].start_line,end:_[0].end_line},L||"",a),x||(x={start:_[0].start_line,end:_[0].end_line}),j=x.start);let P={type:"component",name:`${re}${L?" :: "+L:""}`,path:De.relative(r,J.file_path),line:j,details:"Controller Logic (Macro IR)",children:[]};Y.children.push(P),t.has(J.file_path+(L?`:${L}`:""))||(t.add(J.file_path+(L?`:${L}`:"")),await Wr(J.file_path,P,r,i,t,o+1,s,a,x))}}}}}catch{}}}let b=c?c.start-1:0,S=VI(p,b).slice(0,OI);for(let C of S){if(s.count>=On)break;s.count++,e.children.push({type:"data_flow",name:`${C.symbol} handoff`,line:C.toLine,details:`assigned @L${C.fromLine} \u2192 used @L${C.toLine}`,children:[]})}let w=g.calls,T=Array.from(w).sort(),z=JI(o,s.count),D=T.slice(0,z);T.length>z&&(s.pruned=!0);for(let C of D)if(g.imports.has(C)){let I=g.imports.get(C);if(!I.startsWith(".")){if(["react","react-dom"].includes(I))continue;e.children.push({type:"function",name:C,details:`External: ${I}`,children:[]});continue}let A=Ln(I,n,r);if(A&&Mn.existsSync(A)){let M=i.exports.findByNameAndFile(C,A),H=M.length>0?M[0]:null,Y=H?`${A}:${H.name}`:A;if(t.has(Y))e.children.push({type:"function",name:C,details:"Circular / Already Visited",path:De.relative(r,A),line:H?.start_line,children:[]});else{t.add(Y);let O={type:H?"component":"file",name:C,details:H?`Imported symbol from ${De.basename(A)}`:`Imported from ${De.basename(A)}`,path:De.relative(r,A),line:H?.start_line,children:[]};e.children.push(O);let q=H?Da(A,{start:H.start_line,end:H.end_line},C,a):void 0;await Wr(A,O,r,i,t,o+1,s,a,q)}}}else if(!["log","info","error","warn","print"].includes(C)&&!BI(C)){let I=i.exports.findByNameGlobal(C);if(I.length===0){let A=C.split(/(?:\.|->|::)+/);if(A.length>1){let M=A[0]?.replace(/^\$+/,"").toLowerCase(),H=A[A.length-1];!pv.has(H)&&!(M&&uv.has(M))&&(I=i.exports.findByMethodName(H))}}if(I.length>0){let A=I.find(H=>H.file_path===n),M=A||(I.length===1?I[0]:null);if(M){let H=`${M.file_path}:${M.name}`;if(!t.has(H)){t.add(H);let Y={type:"component",name:C,details:`Resolved via global index${A?" (local)":""}`,path:De.relative(r,M.file_path),line:Da(M.file_path,{start:M.start_line,end:M.end_line},C,a)?.start,children:[]};e.children.push(Y);let O=Da(M.file_path,{start:M.start_line,end:M.end_line},C,a)||{start:M.start_line,end:M.end_line};await Wr(M.file_path,Y,r,i,t,o+1,s,a,O)}}}}}catch(u){E.error({filePath:n,error:u.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:u.message,children:[]})}}ee();import La from"path";function YI(n){return/^@[^/]+\/[^/]+/.test(n)}function XI(n){return!!(n.startsWith("#")||n.startsWith("@/")||n.startsWith("~/")||n.startsWith("@")&&!YI(n))}function QI(n,e){if(!e)return null;let r=La.relative(n,e);return!r||r.startsWith("..")||La.isAbsolute(r)?null:r}function eT(n,e,r){return n.startsWith("node:")?"builtin":n.startsWith(".")?"relative":XI(n)?"alias":e.startsWith(r+La.sep)?"workspace-package":"external-package"}function tT(n){return n==="builtin"||n==="external-package"||n==="missing"}async function gv(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await ae(e);let{imports:s}=N.getInstance(e);if(i==="imports"){let c=s.findByFile(r).filter(d=>d.module_specifier!=="__type_reference__").map(d=>{let m=d.resolved_path?null:xm(d.module_specifier,r,e),f=d.resolved_path||m?.resolvedPath||null,g=d.resolved_path?eT(d.module_specifier,d.resolved_path,e):m?.kind||"missing",$={module:d.module_specifier,symbols:d.imported_symbols,resolvedPath:f,relativePath:QI(e,f),isExternal:tT(g),dependencyClass:g,isBuiltin:g==="builtin"};if(m&&!m.resolved){let y={...$,resolutionError:m.error};return m.actionable&&m.suggestion?{...y,suggestion:m.suggestion}:y}return $}),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:hv(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}else{let c=s.findDependents(r).map(d=>({file:d.file_path,relativePath:La.relative(e,d.file_path),importStatement:d.module_specifier,importedSymbols:d.imported_symbols})),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:hv(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}}function hv(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}ee();import Fi from"path";import nT from"fs";var yv={low:0,medium:1,high:2};function Um(n,e){return yv[n]>yv[e]?e:n}function rT(n){return n==="high"?"medium":"low"}function iT(n,e,r,i){let t=r,o=i,s=n.toLowerCase().replace(/\\/g,"/");return(s.includes("/__generated__/")||s.includes("/generated/")||s.includes("/.generated/")||s.includes("/dist/")||s.includes("/build/")||s.includes("/vendor/")||s.includes("/coverage/")||s.includes(".generated.")||s.includes(".gen."))&&(t=Um(t,"low"),o+="; generated artifact"),(/(^|\/)(src\/)?app\/.*\/(route|page|layout|loading|error|not-found|default|template)\.(t|j)sx?$/.test(s)||/(^|\/)(src\/)?middleware\.(t|j)sx?$/.test(s)||s.includes("/routes/")||s.includes("/controllers/"))&&(t=Um(t,"medium"),o+="; framework convention entrypoint"),(s.includes("/registry/")||s.includes("/registries/")||s.includes("/plugins/")||s.includes("/providers/")||s.includes("/bootstrap/")||/register|resolver|plugin|provider|adapter/i.test(e))&&(t=Um(t,"medium"),o+="; dynamic discovery surface"),{confidence:t,reason:o}}function oT(n){let e=new Map;for(let r of n)r.resolved_path&&(e.has(r.file_path)||e.set(r.file_path,new Set),e.has(r.resolved_path)||e.set(r.resolved_path,new Set),e.get(r.file_path).add(r.resolved_path));return e}function sT(n){let e=0,r=[],i=new Set,t=new Map,o=new Map,s=[],a=c=>{t.set(c,e),o.set(c,e),e++,r.push(c),i.add(c);for(let l of n.get(c)||[])t.has(l)?i.has(l)&&o.set(c,Math.min(o.get(c),t.get(l))):(a(l),o.set(c,Math.min(o.get(c),o.get(l))));if(o.get(c)===t.get(c)){let l=[];for(;r.length>0;){let u=r.pop();if(i.delete(u),l.push(u),u===c)break}s.push(l)}};for(let c of n.keys())t.has(c)||a(c);return s}function aT(n,e,r){let i=r.get(n);if(i===void 0){try{i=nT.readFileSync(n,"utf8")}catch{i=""}r.set(n,i)}if(!i)return!1;let t=e.module_specifier.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`import\\s+type\\s+.*from\\s+['"]${t}['"]`,"i"),s=new RegExp(`import\\s+\\{.*type\\s+.*\\}.*from\\s+['"]${t}['"]`,"s");if(o.test(i)||s.test(i))return!0;let a=e.imported_symbols.split(",").map(c=>c.trim());for(let c of a){if(!c||c==="*")continue;let l=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\(\\s*\\)\\s*=>\\s*${l}`).test(i))return!0}return!1}function cT(n){let e=new Map;for(let r of n){if(!r.resolved_path)continue;let i=`${r.file_path}|${r.resolved_path}`;e.has(i)||e.set(i,[]),e.get(i).push(r)}return e}function bv(n,e){let r=new Map,i=new Map;for(let a of n)a.resolved_path&&(r.has(a.file_path)||r.set(a.file_path,new Set),i.has(a.file_path)||i.set(a.file_path,new Set),r.has(a.resolved_path)||r.set(a.resolved_path,new Set),i.has(a.resolved_path)||i.set(a.resolved_path,new Set),r.get(a.file_path).add(a.resolved_path),i.get(a.resolved_path).add(a.file_path));let o=Array.from(new Set([...r.keys(),...i.keys()])).map(a=>{let c=r.get(a)?.size||0,l=i.get(a)?.size||0,u=l+c===0?0:c/(l+c);return{file:Fi.relative(e,a),afferent:l,efferent:c,instability:Number(u.toFixed(3))}}),s=o.length===0?0:Number((o.reduce((a,c)=>a+c.instability,0)/o.length).toFixed(3));return{module_count:o.length,average_instability:s,top_efferent:[...o].sort((a,c)=>c.efferent-a.efferent).slice(0,10),top_afferent:[...o].sort((a,c)=>c.afferent-a.afferent).slice(0,10),most_unstable:[...o].filter(a=>a.afferent+a.efferent>0).sort((a,c)=>c.instability-a.instability||c.efferent-a.efferent).slice(0,10)}}async function _v(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 ae(e);let{exports:l,imports:u}=N.getInstance(e);if(r==="dead-code"){let p=l.findDeadExports({limit:i,includeTests:t,includeMigrations:o,includeFixtures:s,excludePatterns:a,confidenceThreshold:c}),d=new _n(e),m=u.getAllResolved(),f=bv(m,e),g=p.map(w=>{let T=d.getMappedTestsForSymbol(w.file_path,w.name,6),z=iT(w.file_path,w.name,w.confidence,w.reason),D=z.confidence,C=z.reason;return T.length>0&&(D=rT(D),C+="; covered by tests"),{name:w.name,kind:w.kind,file:Fi.relative(e,w.file_path),line:w.start_line,confidence:D,reason:C,testCoverage:{mappedTestCount:T.length,mappedTests:T.map(I=>I.file),coverageHint:T.length>0?"covered":"uncovered"}}}),$={high:{},medium:{},low:{}};for(let w of g)$[w.confidence][w.file]||($[w.confidence][w.file]=[]),$[w.confidence][w.file].push({name:w.name,kind:w.kind,line:w.line,reason:w.reason,testCoverage:w.testCoverage});let y=[],v=Object.values($.high).flat().length,b=Object.values($.medium).flat().length,S=Object.values($.low).flat().length;return y.push(`# Dead Export Analysis
|
|
1005
|
+
`),y.push(`Found ${g.length} potentially unused exports.`),y.push(`- **High confidence** (likely dead): ${v}`),y.push(`- **Medium confidence** (possibly intentional): ${b}`),y.push(`- **Low confidence** (likely intentional): ${S}
|
|
1006
|
+
`),v>0&&(y.push(`## High Confidence (Likely Dead)
|
|
1007
|
+
`),y.push(JSON.stringify($.high,null,2))),b>0&&c!=="high"&&(y.push(`
|
|
953
1008
|
## Medium Confidence (Possibly Intentional)
|
|
954
|
-
`),y.push(JSON.stringify(
|
|
1009
|
+
`),y.push(JSON.stringify($.medium,null,2))),S>0&&c==="all"&&(y.push(`
|
|
955
1010
|
## Low Confidence (Likely Intentional)
|
|
956
|
-
`),y.push(JSON.stringify(
|
|
1011
|
+
`),y.push(JSON.stringify($.low,null,2))),y.push(`
|
|
957
1012
|
## Structural Risk Metrics
|
|
958
1013
|
`),y.push(JSON.stringify(f,null,2)),{content:[{type:"text",text:y.join(`
|
|
959
|
-
`)}]}}else if(r==="circular-deps"){let p=typeof i=="number"?i:20,d=u.getAllResolved(),m=
|
|
1014
|
+
`)}]}}else if(r==="circular-deps"){let p=typeof i=="number"?i:20,d=u.getAllResolved(),m=oT(d),f=sT(m),g=cT(d),$=new Map,y=bv(d,e),b=f.filter(S=>{if(S.length>1)return!0;let w=S[0];return(m.get(w)||new Set).has(w)}).map(S=>{let w=new Set(S),T=[];for(let D of S)for(let C of m.get(D)||[])w.has(C)&&T.push({from:D,to:C});let z=T.filter(({from:D,to:C})=>{let I=g.get(`${D}|${C}`)||[];return I.length===0?!0:!I.every(A=>aT(D,A,$))});return{component:S,internalEdges:T,unsafeEdges:z}}).filter(S=>S.unsafeEdges.length>0).sort((S,w)=>w.component.length-S.component.length||w.unsafeEdges.length-S.unsafeEdges.length).slice(0,p).map((S,w)=>({id:w+1,size:S.component.length,files:S.component.map(T=>Fi.relative(e,T)).sort(),internal_edge_count:S.internalEdges.length,unsafe_edge_count:S.unsafeEdges.length,unsafe_edges:S.unsafeEdges.slice(0,10).map(T=>`${Fi.relative(e,T.from)} -> ${Fi.relative(e,T.to)}`)}));return{content:[{type:"text",text:`# Circular Dependency Analysis
|
|
960
1015
|
|
|
961
|
-
Found ${
|
|
1016
|
+
Found ${b.length} circular dependency group(s).
|
|
962
1017
|
|
|
963
1018
|
## SCC Groups
|
|
964
|
-
${JSON.stringify(
|
|
1019
|
+
${JSON.stringify(b,null,2)}
|
|
965
1020
|
|
|
966
1021
|
## Structural Risk Metrics
|
|
967
|
-
${JSON.stringify(y,null,2)}`}]}}return{isError:!0,content:[{type:"text",text:"Invalid mode"}]}}
|
|
968
|
-
Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_search_symbol' to find what you need.`}]}}
|
|
1022
|
+
${JSON.stringify(y,null,2)}`}]}}return{isError:!0,content:[{type:"text",text:"Invalid mode"}]}}X();import vv from"path";import uT from"ignore";import xv from"fs";import Oa from"path";var lT=50;function Ma(n,e,r,i){let t={name:Oa.basename(e)||e,type:"directory",path:e,children:[]};return n.forEach(o=>{let a=Oa.relative(e,o.path).split(Oa.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=Oa.join(e,...a.slice(0,l+1)),f=c.children?.find(g=>g.name===u);if(!f){if(c.children&&c.children.length>=lT){c.children.find(y=>y.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}ee();async function Sv(n,e=Ps.DEFAULT_CONCURRENCY,r="detailed",i,t){E.info({repo:n,level:r,subPath:i},"Ensuring cache is up-to-date..."),await ae(n,e);let{files:o,exports:s,imports:a}=N.getInstance(n),c=i?o.findInSubPath(n,i):o.findAll(),l=wa(n),u=uT(),p=vv.join(n,".gitignore");if(xv.existsSync(p)&&u.add(xv.readFileSync(p,"utf8")),l.ignore&&l.ignore.length>0&&u.add(l.ignore),u.add(Rs),c=c.filter(v=>{let b=vv.relative(n,v.path);return!u.ignores(b)}),E.info({count:c.length},"Fetching data from DB..."),r==="lite"){let v=c.map(b=>({path:b.path,mtime:b.mtime}));return Ma(v,n,r,t)}if(r==="summaries"){let v=c.map(b=>({path:b.path,mtime:b.mtime,classification:b.classification||void 0,summary:b.summary||void 0}));return Ma(v,n,r,t)}let d=c.map(v=>v.path),m=s.findByFiles(d),f=r==="detailed"?a.findByFiles(d):[],g=new Map;for(let v of m){let b=g.get(v.file_path)||[];b.push(v),g.set(v.file_path,b)}let $=new Map;for(let v of f){let b=$.get(v.file_path)||[];b.push(v),$.set(v.file_path,b)}let y=c.map(v=>{let S=(g.get(v.path)||[]).map(T=>({name:T.name,kind:T.kind,signature:T.signature,line:T.start_line}));r==="structure"?S=S.map(T=>({name:T.name,kind:T.kind,line:T.line})):r==="signatures"&&(S=S.map(T=>({name:T.name,kind:T.kind,signature:T.signature,line:T.line})));let w=[];return r==="detailed"&&(w=($.get(v.path)||[]).map(z=>({module:z.module_specifier,resolved_path:z.resolved_path}))),{path:v.path,mtime:v.mtime,classification:v.classification||void 0,summary:v.summary||void 0,exports:S,imports:w.length>0?w:void 0,chunks:[]}});return E.info({count:y.length},"Building hierarchical project tree..."),Ma(y,n,r,t)}async function $v(n){let{repoPath:e,subPath:r,maxDepth:i=5}=n,t=5e4,o=[{level:"signatures",depth:i},{level:"summaries",depth:i,meta:{warning:"Export lists omitted for token efficiency.",action:"Use 'shadow_inspect_file' on specific files to see exports."}},{level:"structure",depth:i,meta:{warning:"Detailed signatures omitted due to repo size.",action:"Use 'shadow_inspect_file' on specific files to see details."}},{level:"summaries",depth:2,meta:{warning:"Repository is large. Showing top 2 levels with summaries only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore deeper."}},{level:"structure",depth:2,meta:{warning:"Repository is large. Showing top 2 levels structure only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}},{level:"lite",depth:1,meta:{warning:"Repository is massive. Showing root files only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}}];for(let s of o){let a=await Sv(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).
|
|
1023
|
+
Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_search_symbol' to find what you need.`}]}}yt();async function wv(n){let{repoPath:e,compact:r=!1}=n,t=new Se(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();cn();yt();function Ev(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 kv(n){let{repoPath:e}=n;await ae(e);let r=N.getInstance(e),i=Tt(r,e);new Se(e).updateTopography(i);let o=["Entry","Logic","Data","Utility","Infrastructure","Test","Types","Unknown"],s=`# \u{1F3D7}\uFE0F Architecture Summary
|
|
969
1024
|
|
|
970
1025
|
`;if(s+=`## Detected Pattern: **${i.pattern}**
|
|
971
1026
|
`,s+=`Confidence: ${i.patternConfidence.toFixed(0)}%
|
|
@@ -977,18 +1032,18 @@ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_sea
|
|
|
977
1032
|
|
|
978
1033
|
`,s+=`| Layer | Files | % of Total |
|
|
979
1034
|
`,s+=`|-------|------:|:----------:|
|
|
980
|
-
`;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=
|
|
1035
|
+
`;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=Ev(c);s+=`| ${p} ${c} | ${l.count} | ${u}% |
|
|
981
1036
|
`}s+=`
|
|
982
1037
|
## Top Files by Layer
|
|
983
1038
|
|
|
984
|
-
`;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=
|
|
1039
|
+
`;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=Ev(c);if(s+=`### ${u} ${c} (${l.count} files)
|
|
985
1040
|
`,l.topFiles.length>0)for(let p of l.topFiles)s+=`- \`${p.path}\` (${p.confidence}% conf)
|
|
986
1041
|
`,p.signals.length>0&&(s+=` - ${p.signals.join("; ")}
|
|
987
1042
|
`);else s+=`- _No files classified with high confidence_
|
|
988
1043
|
`;s+=`
|
|
989
1044
|
`}return s+=`---
|
|
990
1045
|
`,s+=`**Next Steps:**
|
|
991
|
-
`,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();
|
|
1046
|
+
`,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();cn();yt();import Bt from"path";async function Iv(n){let{repoPath:e}=n;await ae(e);let r=N.getInstance(e),i=Tt(r,e),o=new Se(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=Bt.isAbsolute(d)?d:Bt.join(e,d),f=r.imports.findByFile(m);for(let g of f)g.resolved_path&&l.has(Bt.relative(e,g.resolved_path))&&s.push(`\u2694\uFE0F LAYER BYPASS: \`${Bt.relative(e,d)}\` directly imports Data layer \`${Bt.relative(e,g.resolved_path)}\`. Should go through Logic.`)}let u=o.gravity?.hotspots||[];for(let d of u){let m=Cn(d.filePath,r);(m.layer==="Utility"||m.layer==="Unknown")&&d.gravity>50&&a.push(`\u{1F6A8} GRAVITY ANOMALY: \`${Bt.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=Bt.isAbsolute(d)?d:Bt.join(e,d),f=r.exports.findByFile(m);f.length>10&&a.push(`\u{1F388} ENTRY BLOAT: \`${Bt.relative(e,d)}\` exports ${f.length} symbols. Entry handlers should be thin interfaces.`)}let p=`# \u{1F575}\uFE0F Architectural Scout Report
|
|
992
1047
|
|
|
993
1048
|
`;return s.length===0&&a.length===0?p+=`\u2705 No significant architectural drift detected. The structure remains "Legit".
|
|
994
1049
|
`:(s.length>0&&(p+=`## \u274C Structural Violations
|
|
@@ -997,7 +1052,7 @@ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_sea
|
|
|
997
1052
|
`),a.length>0&&(p+=`## \u26A0\uFE0F Architectural Warnings
|
|
998
1053
|
`,a.forEach(d=>p+=`- ${d}
|
|
999
1054
|
`),p+=`
|
|
1000
|
-
`)),{content:[{type:"text",text:p}]}}
|
|
1055
|
+
`)),{content:[{type:"text",text:p}]}}Je();ee();X();import Nt from"path";yt();cn();X();Pn();import ye from"fs";import pT from"os";import Ct from"path";var jn=E.child({module:"git-hooks"}),dT="Generated by liquid-shadow",mT=1e6,Tv=["post-merge","post-checkout","post-commit"];function fT(){let n=process.env.LIQUID_SHADOW_CLI_ENTRY;if(n){let r=Ct.resolve(n);if(ye.existsSync(r))return r}let e=et("dist/entry/cli/index.js");return ye.existsSync(e)?e:null}function Wm(n){return n.includes("liquid-shadow")||n.includes("mcp-liquid-shadow")||n.includes(dT)}function hT(){let n=Ct.join(pT.homedir(),".mcp-liquid-shadow","logs"),e=Ct.join(n,"post-checkout.log");try{if(!ye.existsSync(e)||ye.statSync(e).size<=mT)return null;ye.mkdirSync(n,{recursive:!0});let i=`${e}.1`;return ye.existsSync(i)&&ye.unlinkSync(i),ye.renameSync(e,i),null}catch(r){return`Failed to rotate post-checkout.log: ${r}`}}function gT(n,e){return{"post-merge":`#!/bin/sh
|
|
1001
1056
|
# Liquid Shadow: Auto-refresh index after merge/pull
|
|
1002
1057
|
# Generated by liquid-shadow
|
|
1003
1058
|
|
|
@@ -1038,48 +1093,48 @@ REPO_PATH="$(git rev-parse --show-toplevel)"
|
|
|
1038
1093
|
nohup "${n}" "${e}" sync "$REPO_PATH" > /dev/null 2>&1 &
|
|
1039
1094
|
|
|
1040
1095
|
exit 0
|
|
1041
|
-
`}}function
|
|
1096
|
+
`}}function ja(n){let{repoPath:e,enableAutoRefresh:r=!0,enableSymbolHealing:i=!0}=n,t=Ct.join(e,".git","hooks"),o=[],s=[],a=[];if(!ye.existsSync(Ct.join(e,".git")))return a.push("Not a git repository"),{installed:o,skipped:s,errors:a};ye.existsSync(t)||ye.mkdirSync(t,{recursive:!0});let c=fT();if(!c)return a.push(`Unable to resolve CLI entry at install time. Expected ${et("dist/entry/cli/index.js")} to exist.`),{installed:o,skipped:s,errors:a};let l=gT(process.execPath,c),u=new Set;if(r&&(u.add("post-merge"),u.add("post-checkout")),i&&u.add("post-commit"),u.has("post-checkout")){let p=hT();p&&(a.push(p),jn.warn({rotationError:p},"Post-checkout log rotation failed"))}for(let p of u){let d=Ct.join(t,p),m=l[p];if(!m){a.push(`No template found for hook: ${p}`);continue}try{if(ye.existsSync(d)){let f=ye.readFileSync(d,"utf-8"),g=Wm(f);if(g&&f===m){ye.chmodSync(d,493),s.push(p),jn.info({hookName:p},"Hook already installed, skipping");continue}if(!g){let $=`${d}.backup-${Date.now()}`;ye.copyFileSync(d,$),jn.info({hookName:p,backupPath:$},"Backed up existing hook")}}ye.writeFileSync(d,m,{mode:493}),ye.chmodSync(d,493),o.push(p),jn.info({hookName:p},"Installed git hook")}catch(f){a.push(`Failed to install ${p}: ${f}`),jn.error({hookName:p,err:f},"Failed to install hook")}}return{installed:o,skipped:s,errors:a}}function Rv(n){let e=Ct.join(n,".git","hooks"),r=[],i=[];if(!ye.existsSync(e))return{removed:r,errors:i};for(let t of Tv){let o=Ct.join(e,t);try{if(ye.existsSync(o)){let s=ye.readFileSync(o,"utf-8");Wm(s)&&(ye.unlinkSync(o),r.push(t),jn.info({hookName:t},"Removed git hook"))}}catch(s){i.push(`Failed to remove ${t}: ${s}`),jn.error({hookName:t,err:s},"Failed to remove hook")}}return{removed:r,errors:i}}function yT(n,e){let r=Ct.join(n,".git","hooks"),i=Ct.join(r,e);if(!ye.existsSync(r)||!ye.existsSync(i))return"missing";try{let t=ye.readFileSync(i,"utf-8");return Wm(t)?(ye.statSync(i).mode&73)!==0?"installed":"disabled":"foreign"}catch{return"foreign"}}function Fa(n){let e=[],r=[],i=[],t=[],o={};for(let a of Tv){let c=yT(n,a);o[a]=c,c==="installed"&&e.push(a),c==="missing"&&r.push(a),c==="foreign"&&i.push(a),c==="disabled"&&t.push(a)}let s=[...r,...i,...t];return{installed:e,notInstalled:s,missing:r,foreign:i,disabled:t,statuses:o}}async function Pv(n){let{repoPath:e}=n;E.info({repoPath:e},"Setting up repository..."),E.info({repoPath:e}," Ensuring index is up-to-date...");let r=Date.now();await ae(e,void 0,!1,!0,x=>{let j=x.total>0?Math.round(x.current/x.total*100):0;E.info({phase:x.phase,progress:`${x.current}/${x.total}`,percentage:`${j}%`},x.message||`Indexing progress: ${x.phase}`)});let t=((Date.now()-r)/1e3).toFixed(1);E.info({repoPath:e,indexTime:`${t}s`}," Index check complete"),await _r();let o="";try{let x=ja({repoPath:e,enableAutoRefresh:!0,enableSymbolHealing:!0});x.errors.length>0&&E.warn({repoPath:e,errors:x.errors},"Git hook install had non-fatal errors"),o=`
|
|
1042
1097
|
## Git Hooks
|
|
1043
|
-
* Installed: ${
|
|
1044
|
-
`}catch(
|
|
1098
|
+
* Installed: ${x.installed.length}, skipped: ${x.skipped.length}, errors: ${x.errors.length}
|
|
1099
|
+
`}catch(x){E.warn({repoPath:e,error:x instanceof Error?x.message:String(x)},"Git hook installation failed (non-fatal)"),o=`
|
|
1045
1100
|
## Git Hooks
|
|
1046
1101
|
* Installation failed (non-fatal). Run \`shadow_env_hooks\` manually.
|
|
1047
|
-
`}let s=
|
|
1102
|
+
`}let s=N.getInstance(e);E.info({repoPath:e},"Populating Project Hologram...");let a=new Se(e),c=Tt(s,e);a.updateTopography(c);let l=a.computeGravityZones();a.updateGravityZones(l),E.info({repoPath:e,sections:2},"Project Hologram populated (topography + gravity)");let u=s.files.getCount(),p=s.exports.getCount(),d=s.configs.getAll(),m=s.files.getTopDirectories(e),f=[],g=[],$="Standalone",y=x=>s.files.findPackageJsonChildren(x),v=x=>{let j=Nt.join(x,"package.json"),P=d.filter(le=>le.file_path===j),B=[],K=le=>P.some(Ee=>Ee.key.startsWith("dep: ")&&Ee.key.includes(le));K("react")&&B.push("React"),K("vue")&&B.push("Vue"),K("next")&&B.push("Next.js"),K("fastify")&&B.push("Fastify"),K("express")&&B.push("Express"),K("nestjs")&&B.push("NestJS"),(K("prisma")||K("typeorm"))&&B.push("DB");let oe=P.find(le=>le.key==="description")?.value||"";return{stack:B.join(", "),description:oe.length>80?oe.substring(0,77)+"...":oe}},b=Nt.join(e,"apps"),S=Nt.join(e,"packages"),w=Nt.join(e,"services"),T=s.files.hasFilesPattern(b+"/%"),z=s.files.hasFilesPattern(S+"/%"),D=s.files.hasFilesPattern(w+"/%"),C=(x,j)=>{let P=y(x);P.length>0&&(f.push(`| **${j}/ (Directory)** | \uFE0F **DO NOT SUMMARIZE FULL DIR** | |`),P.forEach(B=>{let K=Nt.dirname(B.path),oe=Nt.basename(K);if(oe.startsWith("_")||oe.includes("template"))return;let le=Nt.relative(e,K),Ee=v(K);f.push(`| \u2514\u2500 \`${le}\` | ${Ee.stack||"Module"} | ${Ee.description} |`),g.push(le)}))};T||z||D?($="Monorepo",C(b,"apps"),C(w,"services"),C(S,"packages")):m.forEach(x=>{let j=x.root;if(!j||j.startsWith("."))return;let P=v(Nt.join(e,j));f.push(`| \`${j}/\` | ${P.stack||"Module"} | ${P.description} |`)});let I=Nt.join(e,"package.json"),M=d.find(x=>x.key==="name"&&x.kind==="Service"&&x.file_path===I)?.value||Nt.basename(e),H=d.filter(x=>x.kind==="Service"&&(x.key.startsWith("service:")||x.file==="docker-compose.yml")),Y=[...new Set(H.map(x=>x.value).filter(x=>x&&typeof x=="string"&&!x.includes("[object Object]")&&!["postgres","redis","db","worker","undefined"].includes(x.toLowerCase())))],O=Y.slice(0,5),q=O.length>0?`Service Cluster: ${O.join(", ")}${Y.length>5?` (+${Y.length-5} others)`:""}`:"",L=u<100?"small":"large",G=L==="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.',re="";try{let j=new Ve(e).detectAndRepairShifts(),P=new ln(e),B=s.missions.findLastMission();P.analyzeGhostChanges(B?.commit_sha||void 0),s.intentLogs.countByType("heritage")===0&&new Cr(e).analyzeHeritage(20);let oe=s.intentLogs.countByType("heritage"),le=s.intentLogs.countByType("discovery");oe>0||le>0||j.repaired>0?re=`
|
|
1048
1103
|
## Shadow Engine Insights
|
|
1049
|
-
`+(
|
|
1050
|
-
`:"")+(
|
|
1051
|
-
`:"")+(
|
|
1052
|
-
`:""):
|
|
1104
|
+
`+(oe>0?`* **Architectural Heritage**: Bootstrapped ${oe} significant historical moves.
|
|
1105
|
+
`:"")+(le>0?`* **Recent Changes**: Detected ${le} external modifications.
|
|
1106
|
+
`:"")+(j.repaired>0?`* **Symbol Healing**: Automatically repaired ${j.repaired} orphaned intent links.
|
|
1107
|
+
`:""):re=`
|
|
1053
1108
|
## Shadow Engine Status: **Active**
|
|
1054
1109
|
* **Integrity**: Git River matches Symbol Index.
|
|
1055
1110
|
* **Heritage**: Ready to track developer intent.
|
|
1056
|
-
`}catch(
|
|
1111
|
+
`}catch(x){re=`
|
|
1057
1112
|
## Shadow Engine Status: **Offline**
|
|
1058
|
-
* Error: ${
|
|
1059
|
-
`}try{let
|
|
1113
|
+
* Error: ${x instanceof Error?x.message:"Unknown"}
|
|
1114
|
+
`}try{let j=new Dr(e).runMaintenance();(j.pruning.deleted>0||j.pruning.converted>0)&&(re+=`
|
|
1060
1115
|
### Clean Sweep Cycle
|
|
1061
|
-
* **Pruned**: ${
|
|
1062
|
-
`+(
|
|
1063
|
-
`:""))}catch(
|
|
1064
|
-
## Active Mission: **${
|
|
1116
|
+
* **Pruned**: ${j.pruning.deleted} orphaned logs deleted, ${j.pruning.converted} converted to lapsed.
|
|
1117
|
+
`+(j.compaction.eligible>0?`* **Compaction**: ${j.compaction.eligible} cold missions eligible for briefing synthesis.
|
|
1118
|
+
`:""))}catch(x){E.warn({error:x},"Metabolism maintenance failed")}let J="";try{let x=s.missions.findActiveByPriority();x?J=`
|
|
1119
|
+
## Active Mission: **${x.name}** (#${x.id})
|
|
1065
1120
|
* Use \`shadow_ops_briefing\` to resume context.
|
|
1066
1121
|
`:J=`
|
|
1067
1122
|
## Mission Status: **Idle**
|
|
1068
1123
|
* No active mission. Use \`shadow_ops_plan\` to begin task tracking.
|
|
1069
1124
|
`}catch{}return{content:[{type:"text",text:`
|
|
1070
|
-
# Repository Indexed: ${
|
|
1125
|
+
# Repository Indexed: ${M}
|
|
1071
1126
|
|
|
1072
1127
|
\u23F1\uFE0F **Initial deep index completed in ${t}s** (one-time operation - future syncs are instant)
|
|
1073
1128
|
|
|
1074
|
-
## \u{1F3D7}\uFE0F Architecture: ${
|
|
1075
|
-
${
|
|
1129
|
+
## \u{1F3D7}\uFE0F Architecture: ${$}
|
|
1130
|
+
${q?`> ${q}
|
|
1076
1131
|
`:""}
|
|
1077
1132
|
|
|
1078
|
-
${
|
|
1133
|
+
${re}
|
|
1079
1134
|
${o}
|
|
1080
1135
|
${J}
|
|
1081
1136
|
|
|
1082
|
-
This is a ${
|
|
1137
|
+
This is a ${L} repository with ${u} files.
|
|
1083
1138
|
|
|
1084
1139
|
## System Overview
|
|
1085
1140
|
| Statistic | Value |
|
|
@@ -1097,7 +1152,7 @@ ${f.length>20?f.slice(0,20).join(`
|
|
|
1097
1152
|
`)}
|
|
1098
1153
|
|
|
1099
1154
|
## Recommended Exploration Strategy
|
|
1100
|
-
${
|
|
1155
|
+
${G}
|
|
1101
1156
|
|
|
1102
1157
|
## \uFE0F Quick Reference
|
|
1103
1158
|
| Goal | Tool | Example |
|
|
@@ -1109,15 +1164,15 @@ ${M}
|
|
|
1109
1164
|
|
|
1110
1165
|
---
|
|
1111
1166
|
**Ready.** What would you like to investigate first?
|
|
1112
|
-
`}]}}ee();import
|
|
1113
|
-
`),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||
|
|
1114
|
-
`),totalOriginalLines:i.length,foldedToLines:t.length,siblingsShown:c,siblingsFolded:a}}function
|
|
1115
|
-
However, it likely exists inside: ${
|
|
1116
|
-
Try: shadow_inspect_symbol({ symbolName: "${
|
|
1167
|
+
`}]}}ee();import Cv from"path";import bT from"fs";function _T(n,e,r){let i=n.split(`
|
|
1168
|
+
`),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||vT(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(`
|
|
1169
|
+
`),totalOriginalLines:i.length,foldedToLines:t.length,siblingsShown:c,siblingsFolded:a}}function vT(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}function xT(n,e=","){let r=[],i="",t=0,o=0,s=0,a=0,c=null,l=!1;for(let p of n){if(c){if(i+=p,l){l=!1;continue}if(p==="\\"){l=!0;continue}p===c&&(c=null);continue}if(p==='"'||p==="'"||p==="`"){c=p,i+=p;continue}if(p==="("?t++:p===")"?t=Math.max(0,t-1):p==="{"?o++:p==="}"?o=Math.max(0,o-1):p==="["?s++:p==="]"?s=Math.max(0,s-1):p==="<"?a++:p===">"&&(a=Math.max(0,a-1)),p===e&&t===0&&o===0&&s===0&&a===0){let d=i.trim();d&&r.push(d),i="";continue}i+=p}let u=i.trim();return u&&r.push(u),r}function ST(n){let e=n.indexOf("(");if(e<0)return null;let r=0;for(let i=e;i<n.length;i++){let t=n[i];if(t==="("&&r++,t===")"&&(r--,r===0))return{start:e,end:i}}return null}function Ua(n,e){let r=0,i=0,t=0,o=0,s=null,a=!1;for(let c=0;c<n.length;c++){let l=n[c];if(s){a?a=!1:l==="\\"?a=!0:l===s&&(s=null);continue}if(l==='"'||l==="'"||l==="`"){s=l;continue}if(l==="("?r++:l===")"?r=Math.max(0,r-1):l==="{"?i++:l==="}"?i=Math.max(0,i-1):l==="["?t++:l==="]"?t=Math.max(0,t-1):l==="<"?o++:l===">"&&(o=Math.max(0,o-1)),l===e&&r===0&&i===0&&t===0&&o===0)return c}return-1}function $T(n){let r=n.trim(),i=!1;r.startsWith("...")&&(i=!0,r=r.slice(3).trim());let t=Ua(r,"="),o=t>=0,s=o?r.slice(0,t).trim():r,a=o?r.slice(t+1).trim():void 0,c=Ua(s,":"),l=(c>=0?s.slice(0,c):s).replace(/^(?:readonly\s+)?(?:public|private|protected)\s+/,"").trim(),u=l.includes("?"),p=l.replace(/\?/g,"").trim(),d=c>=0&&s.slice(c+1).trim()||null;return{name:p||"(anonymous)",type:d,optional:u,rest:i,hasDefault:o,...a?{defaultValue:a}:{}}}function wT(n,e){let r=n.slice(e+1).trim();if(!r)return null;let i=r.indexOf("=>");if(i>=0){let o=r.slice(0,i).trim(),s=Ua(o,":");if(s>=0){let c=o.slice(s+1).trim();if(c)return c}return r.slice(i+2).replace(/\{.*$/,"").trim()||null}let t=Ua(r,":");return t>=0&&r.slice(t+1).replace(/\{.*$/,"").trim()||null}function ET(n){let e=n.trim();if(!e)return[];if(e==="*")return["*"];if(e.startsWith("[")&&e.endsWith("]"))try{let i=JSON.parse(e);if(Array.isArray(i))return i.map(t=>String(t).trim()).filter(Boolean).map(t=>t.replace(/^['"`]|['"`]$/g,""))}catch{}return e.replace(/^\{|\}$/g,"").split(",").map(i=>i.trim()).filter(Boolean).map(i=>i.replace(/^type\s+/,"")).map(i=>i.split(/\s+as\s+/i)[0]?.trim()||i).map(i=>i.replace(/^['"`]|['"`]$/g,""))}function kT(n,e,r){let i=n?.replace(/\s+/g," ").trim()||null,o=i?.match(/\b(public|private|protected)\b/)?.[1]||null,a=(i?.match(/\bfunction\s*\*?\s+([A-Za-z_$][A-Za-z0-9_$]*)/)||i?.match(/\bclass\s+([A-Za-z_$][A-Za-z0-9_$]*)/)||i?.match(/^(?:export\s+)?(?:async\s+)?([A-Za-z_$][A-Za-z0-9_$]*)\s*(?:<[^>]*>)?\s*\(/))?.[1]||e,c=i?ST(i):null,l=i&&c?i.slice(c.start+1,c.end):"",u=l?xT(l).map($T):[],p=i&&c?wT(i,c.end):null,d=i?.match(/(?:function\s+[A-Za-z_$][A-Za-z0-9_$]*|[A-Za-z_$][A-Za-z0-9_$]*)\s*(<[^>]+>)\s*\(/);return{raw:n,normalized:i,symbol:a,kind:r,visibility:o,isStatic:/\bstatic\b/.test(i||""),isAsync:/\basync\b/.test(i||""),isGenerator:/function\s*\*/.test(i||"")||/\*\s*[A-Za-z_$][A-Za-z0-9_$]*\s*\(/.test(i||""),isArrowFunction:/=>/.test(i||""),typeParameters:d?.[1]||null,parameters:u,parameterCount:u.length,returnType:p}}function IT(n,e,r=5){let i=new Map;for(let s of n){let a=i.get(s.file_path)||{classification:s.classification||null,importedSymbols:new Set,wildcard:!1},c=ET(s.imported_symbols);(c.length===0||c.includes("*"))&&(a.wildcard=!0);for(let l of c)a.importedSymbols.add(l);!a.classification&&s.classification&&(a.classification=s.classification),i.set(s.file_path,a)}let t=Array.from(i.entries()).map(([s,a])=>({file:Cv.relative(e,s),classification:a.classification,importedSymbols:a.importedSymbols.size>0?Array.from(a.importedSymbols).sort():["*"],wildcard:a.wildcard})),o=t.slice(0,Math.max(1,r));return{totalVerifiedCallers:t.length,showing:o.length,wildcardCallers:t.filter(s=>s.wildcard).length,topCallers:o.map(({wildcard:s,...a})=>a)}}async function Zm(n){let{repoPath:e,filePath:r,resolver:i}=ze(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 ae(e);let s=N.getInstance(e),a=[];if(t.includes(".")){let[I,A]=t.split(".");a=s.exports.findMemberCandidates(I,A,r)}else a=s.exports.findDefinitionCandidates(t,r);if(a.length===0){let I=s.exports.findPotentialParents(t);if(I.length>0){let Y=I.map(O=>`\`${O.name}\` (in ${i.getRelative(O.file_path)})`).join(", ");return{content:[{type:"text",text:`Symbol "${t}" not found as a top-level export.
|
|
1170
|
+
However, it likely exists inside: ${Y}.
|
|
1171
|
+
Try: shadow_inspect_symbol({ symbolName: "${I[0].name}", context: "full" }) to see the class body.`}]}}let M=s.exports.findFuzzyCandidates(t).map(Y=>Y.name),H=Mi(t,M,50,3);if(H.length>0){let Y=H.map(O=>` \u2022 \`${O.match}\` (${O.score}% match)`).join(`
|
|
1117
1172
|
`);return{content:[{type:"text",text:`Error: Symbol "${t}" not found in the index.
|
|
1118
1173
|
|
|
1119
1174
|
Suggestions:
|
|
1120
|
-
${
|
|
1175
|
+
${Y}
|
|
1121
1176
|
|
|
1122
1177
|
Next steps:
|
|
1123
1178
|
\u2022 Search semantically: shadow_search_concept({ query: "${t}" })
|
|
@@ -1126,55 +1181,55 @@ Next steps:
|
|
|
1126
1181
|
Next steps:
|
|
1127
1182
|
\u2022 Search for it: shadow_search_concept({ query: "${t}" })
|
|
1128
1183
|
\u2022 Try with file path: shadow_inspect_symbol({ symbolName: "${t}", filePath: "..." })
|
|
1129
|
-
`}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let
|
|
1130
|
-
`),p=c.end_line-c.start_line+1,d=150,m,f=!1,
|
|
1184
|
+
`}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let I=s.imports.findImportSource(c.file_path,t);if(I&&I.resolved_path)return Zm({...n,filePath:I.resolved_path})}let l=bT.readFileSync(c.file_path,"utf8"),u=l.split(`
|
|
1185
|
+
`),p=c.end_line-c.start_line+1,d=150,m,f=!1,g=null;if(o==="definition"&&p>d){let A=s.exports.findSiblings(c.file_path).map(M=>({name:M.name,kind:M.kind,signature:M.signature||"",startLine:M.start_line,endLine:M.end_line,lineCount:M.end_line-M.start_line+1,isTarget:M.name===c.name&&M.start_line===c.start_line,parentName:M.parent_name}));if(A.length>1){g=_T(l,{name:c.name,startLine:c.start_line,endLine:c.end_line},A);let M=i.getRelative(c.file_path);m=g.foldedSource+`
|
|
1131
1186
|
|
|
1132
1187
|
\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
|
|
1133
1188
|
\u{1F4CA} Semantic Fold Applied (context: "definition")
|
|
1134
1189
|
|
|
1135
|
-
Original file: ${
|
|
1136
|
-
Folded view: ${
|
|
1190
|
+
Original file: ${g.totalOriginalLines} lines
|
|
1191
|
+
Folded view: ${g.foldedToLines} lines
|
|
1137
1192
|
Target Symbol: ${c.name}
|
|
1138
1193
|
\u{1F4A1} Need more context?
|
|
1139
1194
|
\u2022 Full symbol + dependencies + usage: shadow_inspect_symbol({ symbolName: "${c.name}", context: "full" })
|
|
1140
|
-
\u2022 ALL symbols in this file: shadow_inspect_file({ filePath: "${
|
|
1195
|
+
\u2022 ALL symbols in this file: shadow_inspect_file({ filePath: "${M}", detailLevel: "signatures" })
|
|
1141
1196
|
\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(`
|
|
1142
1197
|
`)+`
|
|
1143
1198
|
|
|
1144
1199
|
... (truncated ${p-d} lines)`,f=!0}else m=u.slice(c.start_line-1,c.end_line).join(`
|
|
1145
|
-
`);let
|
|
1200
|
+
`);let $=c.parent_name?`${c.parent_name}.${c.name}`:c.name,y=s.exports.findHydratedById(c.id),v=c.parent_name||c.name,b=s.imports.findProxies(c.file_path).map(I=>I.file_path),S=Array.from(new Set([c.file_path,...b])),w=s.imports.findVerifiedDependents(S,v),T=IT(w,e),z=kT(c.signature,$,c.kind),D={name:$,kind:c.kind,signature:z,file:i.getRelative(c.file_path),startLine:c.start_line,endLine:c.end_line,totalLines:p,...f&&{truncated:!0,previewLines:d},classification:c.classification,callerSummary:T,source:m};if(y&&y.recent_intents&&y.recent_intents.length>0){let I={},A=Date.now();for(let M of y.recent_intents){if(M.is_crystallized&&M.type!=="crystal")continue;let H=M.created_at;H<1e10&&(H*=1e3);let Y=new Date(H).getTime(),O=A-Y,q="just now";if(O>0){let L=Math.floor(O/1e3),G=Math.floor(L/60),re=Math.floor(G/60),J=Math.floor(re/24);J>0?q=`${J}d ago`:re>0?q=`${re}h ago`:G>0?q=`${G}m ago`:q=`${L}s ago`}I[M.type]||(I[M.type]=[]),I[M.type].push(`[${q}] ${M.content}`)}D.intelligence={working_set_of:y.active_missions.map(M=>`Mission #${M.id}: ${M.name}`),total_intents:y.intent_log_count,recent_activity:I}}else y&&(D.intelligence={working_set_of:y.active_missions.map(I=>`Mission #${I.id}: ${I.name}`),total_intents:y.intent_log_count,recent_activity:null});try{let{generateEmbedding:I}=await Promise.resolve().then(()=>(Je(),kt)),A=`Symbol: ${D.name}
|
|
1146
1201
|
Signature: ${c.signature||""}
|
|
1147
|
-
File: ${
|
|
1148
|
-
import `)&&!i.startsWith("import ")||e&&
|
|
1149
|
-
`),o=
|
|
1150
|
-
export `);return r<=0?n:n.slice(0,r).trim()}async function
|
|
1151
|
-
`)}catch{u=null}Array.isArray(l.exports)&&u&&(l.exports=l.exports.map(f=>{let
|
|
1202
|
+
File: ${D.file}`,M=await I(A);if(M){let H=s.intentLogs.findSemanticMatches(M,3,c.id),Y=new Promise(q=>setTimeout(()=>q([]),100)),O=await Promise.race([H,Y]);O&&O.length>0&&(D.intelligence||(D.intelligence={}),D.intelligence.related_knowledge=O.map(q=>({type:q.type,content:q.content,from_symbol:q.symbol_name,similarity:`${(q.similarity*100).toFixed(0)}%`})))}}catch{}if(o==="definition")return{content:[{type:"text",text:JSON.stringify(D,null,2)}]};let C={definition:D,dependencies:s.imports.getImportsForFile(c.file_path).map(I=>({module:I.module_specifier,symbols:I.imported_symbols,relativePath:I.resolved_path?Cv.relative(e,I.resolved_path):null})),callerSummary:T};return C.verifiedUsages=T.topCallers,{content:[{type:"text",text:JSON.stringify(C,null,2)}]}}ee();cn();import TT from"fs";import Nv from"path";var RT=new Set(["ClassDeclaration","FunctionDeclaration","TsInterfaceDeclaration","TsTypeAliasDeclaration","TsEnumDeclaration","VariableDeclaration"]);function Av(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hm(n,e,r){let i=r.trim();return!!(!i||i.length>8e3||/^\w{1,4}\s+['"].*['"];?$/.test(i)&&!i.startsWith("export ")||i.includes(`
|
|
1203
|
+
import `)&&!i.startsWith("import ")||e&&RT.has(e)&&n&&!new RegExp(`\\b${Av(n)}\\b`).test(i))}function PT(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(`
|
|
1204
|
+
`),o=ct(t,n.kind);return o?o.length>800?`${o.slice(0,797)}...`:o:n.signature||""}function CT(n,e,r){if(!n)return null;let i=Av(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 NT(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 AT(n){return Array.isArray(n)?n.filter(e=>e.module!=="__type_reference__"):n}function zT(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 DT(n,e){if(!n||e!=="TsTypeAliasDeclaration"&&e!=="TsInterfaceDeclaration")return n;let r=n.indexOf(`
|
|
1205
|
+
export `);return r<=0?n:n.slice(0,r).trim()}async function zv(n){let{repoPath:e,filePath:r}=ze(n);if(!r)return{content:[{type:"text",text:"Error: filePath is required"}],isError:!0};let i=n.detailLevel||"signatures";await ae(e);let{files:t,exports:o}=N.getInstance(e),s=t.findByPath(r),a=Nv.basename(r),c=/\.(ts|tsx|php|py|go)$/.test(a),l;c?l=await Ai(r):l={exports:o.findByFile(r),imports:[]};let u=null;if(c)try{u=TT.readFileSync(r,"utf8").split(`
|
|
1206
|
+
`)}catch{u=null}Array.isArray(l.exports)&&u&&(l.exports=l.exports.map(f=>{let g=typeof f.signature=="string"?f.signature:"",$=f.start_line??f.line??1,y=f.end_line??f.endLine??$;if(Hm(f.name||"",f.kind,g)){let b=CT(f.name||"",f.kind,u),S=b??$,w=b?NT(S,f.kind,u):y,T=PT({name:f.name||"",kind:f.kind,signature:g,start_line:S,end_line:w},u),z=DT(T,f.kind),D=Hm(f.name||"",f.kind,z)?zT(f.name||"",f.kind):z;return{...f,signature:D,start_line:S,end_line:w,line:S,endLine:w,members:Array.isArray(f.members)?f.members.filter(C=>{let I=typeof C.signature=="string"?C.signature:"";return!Hm(C.name||"",C.kind,I)}):f.members}}return f})),l.imports=AT(l.imports),i==="structure"?(l.exports=l.exports.map(f=>{let g={name:f.name,kind:f.kind,line:f.start_line,classification:f.classification};return f.members&&f.members.length>0?{...g,members:f.members.map($=>({name:`${f.name}.${$.name}`,kind:$.kind,line:$.start_line}))}:g}),delete l.imports):i==="signatures"&&(l.exports=l.exports.map(f=>{let g={name:f.name,kind:f.kind,signature:f.signature,line:f.start_line,classification:f.classification,capabilities:JSON.parse(f.capabilities||"[]")};return f.members&&f.members.length>0?{...g,members:f.members.map($=>({name:`${f.name}.${$.name}`,kind:$.kind,signature:$.signature,line:$.start_line}))}:g}),delete l.imports);let p=Nv.relative(e,r),d=l.exports?.length||0,m="";return i==="structure"&&d>0?m=`
|
|
1152
1207
|
|
|
1153
1208
|
\u{1F4A1} Showing ${d} symbol names. For full signatures: shadow_inspect_file({ filePath: "${p}", detailLevel: "signatures" })`:i==="signatures"&&d>0&&(m=`
|
|
1154
1209
|
|
|
1155
|
-
\u{1F4A1} Showing ${d} 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:
|
|
1210
|
+
\u{1F4A1} Showing ${d} 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:Cn(r,N.getInstance(e)).layer},null,2)+m}]}}ee();cn();async function Dv(n){let{repoPath:e,enableContextPivot:r,enableMergeSentinel:i}=n;try{await ae(e),new ln(e).analyzeGhostChanges();let o=new Ve(e),s=o.detectAndRepairShifts(),a=o.syncLifecycle({enableContextPivot:r,enableMergeSentinel:i}),l=await new ht(e).recoverFromGitNotes(),{HologramService:u}=await Promise.resolve().then(()=>(yt(),ub)),p=new u(e),d=Tt(N.getInstance(e),e);p.updateTopography(d);let m=p.computeGravityZones();p.updateGravityZones(m);let f="Shadow Sync complete. Code changes indexed and intent logs updated.";return f+=`
|
|
1156
1211
|
\u269B\uFE0F Hologram: Refreshed architectural map (${m.length} hotspots).`,s.repaired>0&&(f+=`
|
|
1157
1212
|
\u2728 Nano-Repair: Fixed ${s.repaired} links.`),f+=`
|
|
1158
1213
|
\u{1F9ED} Lifecycle: contextPivot=${a.contextPivotEnabled?"on":"off"}, mergeSentinel=${a.mergeSentinelEnabled?"on":"off"}, suspended=${a.suspended}, resumed=${a.resumed}, completed=${a.completed}.`,l.missionsRecovered>0&&(f+=`
|
|
1159
|
-
\u{1F9EC} Re-hydration: Recovered ${l.missionsRecovered} missions.`),{content:[{type:"text",text:f}]}}catch(t){return{content:[{type:"text",text:`Error: ${t.message}`}],isError:!0}}}
|
|
1214
|
+
\u{1F9EC} Re-hydration: Recovered ${l.missionsRecovered} missions.`),{content:[{type:"text",text:f}]}}catch(t){return{content:[{type:"text",text:`Error: ${t.message}`}],isError:!0}}}yt();async function Lv(n){let{repoPath:e,deep:r,enableContextPivot:i,enableMergeSentinel:t}=n;try{let o=r===!0;await ae(e,5,o,o);let s=new Ve(e),a=s.detectAndRepairShifts(),c=s.syncLifecycle({enableContextPivot:i,enableMergeSentinel:t}),l=new Se(e);l.refreshTopography();let u=l.computeGravityZones();l.updateGravityZones(u);let p=`Repository at ${e} has been ${r?"deeply ":""}re-indexed.`;return a.repaired>0&&(p+=`
|
|
1160
1215
|
\u2728 Nano-Repair: Fixed ${a.repaired} links.`),p+=`
|
|
1161
1216
|
\u{1F9ED} Lifecycle: contextPivot=${c.contextPivotEnabled?"on":"off"}, mergeSentinel=${c.mergeSentinelEnabled?"on":"off"}, suspended=${c.suspended}, resumed=${c.resumed}, completed=${c.completed}.`,p+=`
|
|
1162
|
-
\u269B\uFE0F Hologram: Refreshed architectural map (${u.length} hotspots).`,{content:[{type:"text",text:p}]}}catch(o){return{content:[{type:"text",text:`Error: ${o.message}`}],isError:!0}}}async function
|
|
1217
|
+
\u269B\uFE0F Hologram: Refreshed architectural map (${u.length} hotspots).`,{content:[{type:"text",text:p}]}}catch(o){return{content:[{type:"text",text:`Error: ${o.message}`}],isError:!0}}}async function Ov(n){let{repoPath:e}=n;try{let i=new Ve(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}}}X();var Bm=E.child({module:"mcp:tools:env:hooks"});async function Mv(n){let{repoPath:e,action:r,enableAutoRefresh:i,enableSymbolHealing:t}=n;if(r==="install"){Bm.info({repoPath:e,enableAutoRefresh:i,enableSymbolHealing:t},"Installing git hooks");let o=ja({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(`
|
|
1163
1218
|
`):"- None","",`## \u23ED\uFE0F Skipped (${o.skipped.length})`,o.skipped.length>0?o.skipped.map(a=>`- \`${a}\` (already installed)`).join(`
|
|
1164
1219
|
`):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
|
|
1165
1220
|
`)),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(`
|
|
1166
|
-
`)}]}}if(r==="remove"){
|
|
1221
|
+
`)}]}}if(r==="remove"){Bm.info({repoPath:e},"Uninstalling git hooks");let o=Rv(e),s=["# Git Hooks Uninstallation","",`## Removed (${o.removed.length})`,o.removed.length>0?o.removed.map(a=>`- \`${a}\``).join(`
|
|
1167
1222
|
`):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
|
|
1168
1223
|
`))),{content:[{type:"text",text:s.join(`
|
|
1169
|
-
`)}]}}if(r==="status"){
|
|
1224
|
+
`)}]}}if(r==="status"){Bm.info({repoPath:e},"Checking git hooks status");let o=Fa(e),s=o.statuses["post-checkout"];return{content:[{type:"text",text:["# Git Hooks Status","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(c=>`- \`${c}\``).join(`
|
|
1170
1225
|
`):"- None","",`## Missing (${o.missing.length})`,o.missing.length>0?o.missing.map(c=>`- \`${c}\``).join(`
|
|
1171
1226
|
`):"- None","",`## Foreign (${o.foreign.length})`,o.foreign.length>0?o.foreign.map(c=>`- \`${c}\` (non-Liquid hook content)`).join(`
|
|
1172
1227
|
`):"- None","",`## Disabled (${o.disabled.length})`,o.disabled.length>0?o.disabled.map(c=>`- \`${c}\` (not executable)`).join(`
|
|
1173
1228
|
`):"- None","","---",`**Post-checkout status**: \`${s}\``,s==="installed"?"**Branch-switch delta reindex**: active":"**Branch-switch delta reindex**: inactive",'**To install hooks**: Use `shadow_env_hooks({ action: "install" })`'].join(`
|
|
1174
|
-
`)}]}}return{content:[{type:"text",text:`Unknown action: ${r}`}],isError:!0}}
|
|
1175
|
-
`)}]}}ee();Q();import sT from"path";import aT from"fs";var l_=S.child({module:"mcp:tools:workspace:list"});async function u_(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;l_.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(aT.existsSync(a))try{let{missions:c}=z.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:sT.basename(a),cross_repo_links:p})}}catch(c){l_.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)}]}}ee();Q();var cT=S.child({module:"mcp:tools:workspace:link"});async function p_(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;cT.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=z.getInstance(e),{missions:a}=z.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}`)}}ya();Q();var lT=S.child({module:"mcp:tools:workspace:fuse"});async function d_(n){let{repoPaths:e,name:r}=n;lT.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=hm({repoPaths:e,name:r||`workspace-${Date.now()}`});return{content:[{type:"text",text:JSON.stringify({message:"Fused index created",status:i.getStatus()},null,2)}]}}catch(i){throw new Error(`Failed to fuse: ${i.message}`)}}var m_=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()}),f_=g.object({repoPath:g.string(),missionId:g.number(),stepId:g.string().optional(),status:g.enum(["pending","planned","in-progress","verifying","completed","failed","skipped","suspended"]).optional(),contextPivot:g.string().optional(),updates:g.array(g.object({stepId:g.string(),status:g.enum(["pending","planned","in-progress","verifying","completed","failed","skipped","suspended"]),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()}),h_=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()}),g_=g.object({repoPath:g.string(),missionId:g.number().optional(),type:g.enum(["decision","blocker","discovery","fix","note","system","adr"]),content:g.string(),filePath:g.string().optional(),symbolName:g.string().optional(),standalone:g.boolean().optional()}),y_=g.object({repoPath:g.string(),missionId:g.number()}),b_=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(),branch:g.string().optional()}),v_=g.object({repoPath:g.string()}),__=g.object({repoPath:g.string(),compact:g.boolean().optional(),branch:g.string().optional(),includeSessionDelta:g.boolean().optional(),sinceCommit:g.string().optional()}),x_=g.object({repoPath:g.string(),missionId:g.number().optional(),symbolId:g.number().optional()}),S_=g.object({repoPath:g.string(),theme:g.string(),missionIds:g.array(g.number()).optional(),limit:g.number().optional()}),$_=g.object({repoPath:g.string(),missionId:g.number().optional(),depth:g.number().optional(),limit:g.number().optional(),format:g.enum(["mermaid","json"]).optional()}),w_=g.object({repoPath:g.string(),filePaths:g.array(g.string())}),E_=g.object({repoPath:g.string(),missionId:g.number().optional(),kind:g.enum(["recon_report","risk_assessment","impact_map","debt_scan","custom"]),findings:g.array(g.object({statement:g.string(),confidence:g.number(),refs:g.record(g.string(),g.any()).optional()})),risks:g.array(g.object({severity:g.enum(["low","medium","high","critical"]),description:g.string(),refs:g.record(g.string(),g.any()).optional()})).optional(),missionsCreated:g.array(g.number()).optional(),gaps:g.array(g.string()).optional(),confidence:g.number().optional(),agentTag:g.string().optional()}),k_=g.object({repoPath:g.string(),missionId:g.number().optional(),kind:g.enum(["recon_report","risk_assessment","impact_map","debt_scan","custom"]).optional(),query:g.string().optional(),limit:g.number().optional()}),I_=g.object({repoPath:g.string(),subPath:g.string().optional(),maxDepth:g.number().int().optional()}),T_=g.object({repoPath:g.string(),compact:g.boolean().optional()}),R_=g.object({repoPath:g.string()}),P_=g.object({repoPath:g.string()}),N_=g.object({repoPath:g.string()}),C_=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),compact:g.boolean().optional(),tokenBudget:g.number().int().positive().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional()}),z_=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()}),A_=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()}),D_=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()}),L_=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()}),O_=g.object({repoPath:g.string(),baseCommit:g.string().optional(),headCommit:g.string().optional(),staged:g.boolean().optional(),includeUntracked:g.boolean().optional(),maxSymbols:g.number().int().positive().optional(),impactDepth:g.number().int().positive().optional(),impactLimit:g.number().int().positive().optional()}),M_=g.object({repoPath:g.string(),symbolName:g.string(),filePath:g.string().optional(),direction:g.enum(["outbound","inbound","both"]).optional(),relationship:g.enum(["extends","implements","constrained_by"]).optional(),limit:g.number().int().positive().optional()}),j_=g.object({repoPath:g.string(),filePath:g.string(),symbolName:g.string().optional()}),F_=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()}),U_=g.object({repoPath:g.string(),topic:g.string(),type:g.enum(["socket_event","api_route","pubsub_topic"]).optional(),includeCrossRepo:g.boolean().optional(),format:g.enum(["json","text"]).optional()}),Z_=g.object({repoPath:g.string(),mode:g.enum(["dead-code","circular-deps"]),limit:g.number().int().optional(),includeTests:g.boolean().optional(),excludePatterns:g.array(g.string()).optional(),includeMigrations:g.boolean().optional(),includeFixtures:g.boolean().optional(),confidenceThreshold:g.enum(["all","high","medium"]).optional()}),W_=g.object({repoPath:g.string(),symbolName:g.string(),filePath:g.string().optional(),context:g.enum(["definition","full"]).optional()}),H_=g.object({repoPath:g.string(),filePath:g.string(),detailLevel:g.enum(["structure","signatures","summaries","detailed"]).optional()}),B_=g.object({repoPath:g.string(),enableContextPivot:g.boolean().optional(),enableMergeSentinel:g.boolean().optional()}),G_=g.object({repoPath:g.string(),deep:g.boolean().optional(),enableContextPivot:g.boolean().optional(),enableMergeSentinel:g.boolean().optional()}),J_=g.object({repoPath:g.string()}),V_=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),q_=g.object({repoPath:g.string()}),K_=g.object({repoPaths:g.array(g.string()),status:g.string().optional(),limit:g.number().int().positive().optional(),summarize:g.boolean().optional()}),Y_=g.object({parentRepoPath:g.string(),parentMissionId:g.number(),childRepoPath:g.string(),childMissionId:g.number(),relationship:g.string()}),X_=g.object({repoPaths:g.array(g.string()),name:g.string().optional()});Q();cr();var uT=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function Ra(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=>Ra(i,e)):typeof n[r]=="object"&&Ra(n[r],e)}function Q_(n){if(!(!n||typeof n!="object")){for(let e of uT)if(typeof n[e]=="string")try{n[e]=vr(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?vr(e):e))}}function ex(n,e){return async r=>{let i=S.child({handler:n});try{Q_(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),Qt("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new br(r.repoPath);Ra(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=gt(t),s=o.includes("Access denied"),a=`Handler '${n}' failed: ${o}`;return!s&&r?.repoPath&&(a+=$i),Qt(s?"FORBIDDEN":"INTERNAL_ERROR",a,we(t))}}}function tx(n,e,r){return async i=>{let t=S.child({handler:n});try{Q_(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),Qt("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new br(i.repoPath);Ra(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"),Qt("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=gt(s),c=a.includes("Access denied"),l=`Handler '${n}' failed: ${a}`,u=o.data;return!c&&u?.repoPath&&(l+=$i),Qt(c?"FORBIDDEN":"INTERNAL_ERROR",l,we(s))}}}function Rr(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=iv(i,e);return t||n(r)}}var pT={shadow_ops_plan:{default:dy},shadow_ops_track:{default:gy},shadow_ops_briefing:{default:Qs},shadow_ops_log:{default:ob},shadow_ops_synthesize:{default:Vy},shadow_ops_chronicle:{default:Ky},shadow_ops_context:{default:Rr(Yy,"shadow_ops_context")},shadow_ops_health:{default:rb},shadow_ops_graph:{default:ub},shadow_ops_crystallize:{default:db},shadow_ops_crystallize_theme:{default:mb},shadow_ops_handoff:{default:fb},shadow_ops_handoff_read:{default:hb},shadow_working_set_check:{default:Rr(gb,"shadow_working_set_check")},shadow_recon_tree:{default:Bv},shadow_recon_hologram:{default:Gv},shadow_recon_topography:{default:Vv},shadow_recon_scout:{default:qv},shadow_recon_onboard:{default:Xv},shadow_search_concept:{default:av},shadow_search_symbol:{default:cv},shadow_search_config:{default:uv},shadow_search_path:{default:pv},shadow_analyze_mesh:{default:wv},shadow_analyze_impact:{default:$v},shadow_analyze_explain_diff:{default:Iv},shadow_analyze_type_graph:{default:Tv},shadow_analyze_flow:{default:Lv},shadow_analyze_deps:{default:Mv},shadow_analyze_debt:{default:Uv},shadow_inspect_symbol:{default:Rr(km,"shadow_inspect_symbol")},shadow_inspect_file:{default:Rr(n_,"shadow_inspect_file")},shadow_sync_trace:{default:Rr(r_,"shadow_sync_trace")},shadow_sync_index:{default:i_},shadow_sync_repair:{default:Rr(o_,"shadow_sync_repair")},shadow_env_hooks:{default:s_},shadow_env_diagnose:{default:c_},shadow_workspace_list:{default:u_},shadow_workspace_link:{default:p_},shadow_workspace_fuse:{default:d_}},dT={shadow_ops_plan:m_,shadow_ops_track:f_,shadow_ops_briefing:h_,shadow_ops_log:g_,shadow_ops_synthesize:y_,shadow_ops_chronicle:b_,shadow_ops_context:__,shadow_ops_health:v_,shadow_ops_graph:$_,shadow_ops_crystallize:x_,shadow_ops_crystallize_theme:S_,shadow_ops_handoff:E_,shadow_ops_handoff_read:k_,shadow_working_set_check:w_,shadow_recon_tree:I_,shadow_recon_hologram:T_,shadow_recon_topography:R_,shadow_recon_scout:P_,shadow_recon_onboard:N_,shadow_search_concept:C_,shadow_search_symbol:z_,shadow_search_config:A_,shadow_search_path:D_,shadow_analyze_mesh:U_,shadow_analyze_impact:L_,shadow_analyze_explain_diff:O_,shadow_analyze_type_graph:M_,shadow_analyze_flow:j_,shadow_analyze_deps:F_,shadow_analyze_debt:Z_,shadow_inspect_symbol:W_,shadow_inspect_file:H_,shadow_sync_trace:B_,shadow_sync_index:G_,shadow_sync_repair:J_,shadow_env_hooks:V_,shadow_env_diagnose:q_,shadow_workspace_list:K_,shadow_workspace_link:Y_,shadow_workspace_fuse:X_},Rm=new Map;for(let[n,e]of Object.entries(pT)){let r=dT[n];r?Rm.set(n,tx(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}.
|
|
1229
|
+
`)}]}}return{content:[{type:"text",text:`Unknown action: ${r}`}],isError:!0}}Ft();import Wa from"path";import jv from"fs";X();var LT=E.child({module:"mcp:tools:env:diagnose"});async function Fv(n){let{repoPath:e}=n,r=Wa.isAbsolute(e)?Wa.normalize(e):Wa.resolve(process.cwd(),e);LT.info({repoPath:r},"Running MCP diagnose");let i=["# MCP Server Health Check","",`**Repository path**: \`${r}\``,""],t=!1;try{t=jv.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=Wa.join(r,".git"),s=t&&jv.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{Ae(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?Fa(r):{installed:[],notInstalled:[],missing:[],foreign:[],disabled:[],statuses:{}};i.push("## 4. Git hooks");let u=["post-merge","post-checkout","post-commit"],p=d=>d==="installed"?"\u2705":d==="missing"?"\u26A0\uFE0F":d==="foreign"?"\u274C":d==="disabled"?"\u23F8\uFE0F":"\u2753";if(t){for(let d of u){let m=l.statuses[d]??"missing";i.push(`- \`${d}\`: ${p(m)} ${m}`)}l.notInstalled.length>0&&i.push('- Run `shadow_env_hooks({ action: "install" })` to repair missing hooks.')}else i.push("\u26A0\uFE0F Path unavailable; hook status not checked");return i.push(""),i.push("## 5. Next steps"),t?c?((l.statuses["post-checkout"]??"missing")!=="installed"&&i.push('- Install/repair hooks: run **shadow_env_hooks** with `action: "install"`.'),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(`
|
|
1230
|
+
`)}]}}ee();X();import OT from"path";import MT from"fs";var Uv=E.child({module:"mcp:tools:workspace:list"});async function Wv(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;Uv.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(MT.existsSync(a))try{let{missions:c}=N.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:OT.basename(a),cross_repo_links:p})}}catch(c){Uv.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)}]}}ee();X();var jT=E.child({module:"mcp:tools:workspace:link"});async function Zv(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;jT.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=N.getInstance(e),{missions:a}=N.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}`)}}Ca();X();var FT=E.child({module:"mcp:tools:workspace:fuse"});async function Hv(n){let{repoPaths:e,name:r}=n;FT.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=Nm({repoPaths:e,name:r||`workspace-${Date.now()}`});return{content:[{type:"text",text:JSON.stringify({message:"Fused index created",status:i.getStatus()},null,2)}]}}catch(i){throw new Error(`Failed to fuse: ${i.message}`)}}var Bv=h.object({repoPath:h.string(),name:h.string().optional(),goal:h.string().optional(),strategy:h.string().optional(),workingSet:h.array(h.string()).optional(),missionId:h.number().optional(),parentId:h.number().optional(),outcomeContract:h.string().optional(),templateId:h.string().optional(),templateVars:h.record(h.string(),h.string()).optional()}),Gv=h.object({repoPath:h.string(),missionId:h.number(),stepId:h.string().optional(),status:h.enum(["pending","planned","in-progress","verifying","completed","failed","skipped","suspended"]).optional(),contextPivot:h.string().optional(),updates:h.array(h.object({stepId:h.string(),status:h.enum(["pending","planned","in-progress","verifying","completed","failed","skipped","suspended"]),contextPivot:h.string().optional()})).optional(),artifacts:h.array(h.object({type:h.string(),identifier:h.string(),metadata:h.record(h.string(),h.any()).optional()})).optional()}),Jv=h.object({repoPath:h.string(),missionId:h.number().optional(),scope:h.enum(["mission","project"]).optional(),altitude:h.enum(["orbit","atmosphere","ground"]).optional(),activeMissionsLimit:h.number().int().positive().optional(),recentActivityLimit:h.number().int().positive().optional(),compact:h.boolean().optional()}),Vv=h.object({repoPath:h.string(),missionId:h.number().optional(),type:h.enum(["decision","blocker","discovery","fix","note","system","adr"]),content:h.string(),filePath:h.string().optional(),symbolName:h.string().optional(),standalone:h.boolean().optional()}),qv=h.object({repoPath:h.string(),missionId:h.number()}),Kv=h.object({repoPath:h.string(),format:h.enum(["markdown","json"]).optional(),limit:h.number().optional(),offset:h.number().optional(),since:h.number().optional(),until:h.number().optional(),branch:h.string().optional()}),Yv=h.object({repoPath:h.string()}),Xv=h.object({repoPath:h.string(),compact:h.boolean().optional(),branch:h.string().optional(),includeSessionDelta:h.boolean().optional(),sinceCommit:h.string().optional()}),Qv=h.object({repoPath:h.string(),missionId:h.number().optional(),symbolId:h.number().optional()}),ex=h.object({repoPath:h.string(),theme:h.string(),missionIds:h.array(h.number()).optional(),limit:h.number().optional()}),tx=h.object({repoPath:h.string(),missionId:h.number().optional(),depth:h.number().optional(),limit:h.number().optional(),format:h.enum(["mermaid","json"]).optional()}),nx=h.object({repoPath:h.string(),filePaths:h.array(h.string())}),rx=h.object({repoPath:h.string(),missionId:h.number(),filePaths:h.array(h.string()).optional(),filePath:h.string().optional(),agentTag:h.string().optional()}).refine(n=>n.filePaths&&n.filePaths.length>0||!!n.filePath,{message:"Provide filePaths or filePath",path:["filePaths"]}),ix=h.object({repoPath:h.string(),missionId:h.number(),filePaths:h.array(h.string()).optional(),filePath:h.string().optional()}).refine(n=>n.filePaths===void 0||n.filePaths.length>0||!!n.filePath,{message:"filePaths cannot be empty",path:["filePaths"]}),ox=h.object({repoPath:h.string(),missionId:h.number().optional(),parentMissionId:h.number().optional(),missionIds:h.array(h.number()).optional(),includeClaimCheck:h.boolean().optional()}),sx=h.object({repoPath:h.string(),missionId:h.number().optional(),kind:h.enum(["recon_report","risk_assessment","impact_map","debt_scan","custom"]),findings:h.array(h.object({statement:h.string(),confidence:h.number(),refs:h.record(h.string(),h.any()).optional()})),risks:h.array(h.object({severity:h.enum(["low","medium","high","critical"]),description:h.string(),refs:h.record(h.string(),h.any()).optional()})).optional(),missionsCreated:h.array(h.number()).optional(),gaps:h.array(h.string()).optional(),confidence:h.number().optional(),agentTag:h.string().optional()}),ax=h.object({repoPath:h.string(),missionId:h.number().optional(),kind:h.enum(["recon_report","risk_assessment","impact_map","debt_scan","custom"]).optional(),query:h.string().optional(),limit:h.number().optional()}),cx=h.object({repoPath:h.string(),subPath:h.string().optional(),maxDepth:h.number().int().optional()}),lx=h.object({repoPath:h.string(),compact:h.boolean().optional()}),ux=h.object({repoPath:h.string()}),px=h.object({repoPath:h.string()}),dx=h.object({repoPath:h.string()}),mx=h.object({repoPath:h.string(),query:h.string(),limit:h.number().int().optional(),offset:h.number().int().optional(),compact:h.boolean().optional(),tokenBudget:h.number().int().positive().optional(),fileType:h.string().optional(),layer:h.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional()}),fx=h.object({repoPath:h.string(),query:h.string(),limit:h.number().int().optional(),offset:h.number().int().optional(),fileType:h.string().optional(),layer:h.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),matchMode:h.enum(["any","all","exact"]).optional()}),hx=h.object({repoPath:h.string(),query:h.string().optional(),key:h.string().optional(),kind:h.enum(["Service","Image","Port","Env"]).optional(),limit:h.number().int().optional(),showUsage:h.boolean().optional()}),gx=h.object({repoPath:h.string(),query:h.string(),limit:h.number().int().optional(),offset:h.number().int().optional(),fileType:h.string().optional(),layer:h.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),ranked:h.boolean().optional()}),yx=h.object({repoPath:h.string(),filePath:h.string().optional(),symbolName:h.string(),depth:h.number().int().optional(),limit:h.number().int().positive().optional(),offset:h.number().int().nonnegative().optional()}),bx=h.object({repoPath:h.string(),baseCommit:h.string().optional(),headCommit:h.string().optional(),staged:h.boolean().optional(),includeUntracked:h.boolean().optional(),maxSymbols:h.number().int().positive().optional(),impactDepth:h.number().int().positive().optional(),impactLimit:h.number().int().positive().optional()}),_x=h.object({repoPath:h.string(),symbolName:h.string(),filePath:h.string().optional(),direction:h.enum(["outbound","inbound","both"]).optional(),relationship:h.enum(["extends","implements","constrained_by"]).optional(),limit:h.number().int().positive().optional()}),vx=h.object({repoPath:h.string(),filePath:h.string(),symbolName:h.string().optional()}),xx=h.object({repoPath:h.string(),filePath:h.string(),direction:h.enum(["imports","imported_by"]),limit:h.number().int().positive().optional(),offset:h.number().int().nonnegative().optional()}),Sx=h.object({repoPath:h.string(),topic:h.string(),type:h.enum(["socket_event","api_route","pubsub_topic"]).optional(),includeCrossRepo:h.boolean().optional(),format:h.enum(["json","text"]).optional()}),$x=h.object({repoPath:h.string(),mode:h.enum(["dead-code","circular-deps"]),limit:h.number().int().optional(),includeTests:h.boolean().optional(),excludePatterns:h.array(h.string()).optional(),includeMigrations:h.boolean().optional(),includeFixtures:h.boolean().optional(),confidenceThreshold:h.enum(["all","high","medium"]).optional()}),wx=h.object({repoPath:h.string(),symbolName:h.string(),filePath:h.string().optional(),context:h.enum(["definition","full"]).optional()}),Ex=h.object({repoPath:h.string(),filePath:h.string(),detailLevel:h.enum(["structure","signatures","summaries","detailed"]).optional()}),kx=h.object({repoPath:h.string(),enableContextPivot:h.boolean().optional(),enableMergeSentinel:h.boolean().optional()}),Ix=h.object({repoPath:h.string(),deep:h.boolean().optional(),enableContextPivot:h.boolean().optional(),enableMergeSentinel:h.boolean().optional()}),Tx=h.object({repoPath:h.string()}),Rx=h.object({repoPath:h.string(),action:h.enum(["install","remove","status"]),enableAutoRefresh:h.boolean().optional(),enableSymbolHealing:h.boolean().optional()}),Px=h.object({repoPath:h.string()}),Cx=h.object({repoPaths:h.array(h.string()),status:h.string().optional(),limit:h.number().int().positive().optional(),summarize:h.boolean().optional()}),Nx=h.object({parentRepoPath:h.string(),parentMissionId:h.number(),childRepoPath:h.string(),childMissionId:h.number(),relationship:h.string()}),Ax=h.object({repoPaths:h.array(h.string()),name:h.string().optional()});X();Sr();var UT=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function Za(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=>Za(i,e)):typeof n[r]=="object"&&Za(n[r],e)}function zx(n){if(!(!n||typeof n!="object")){for(let e of UT)if(typeof n[e]=="string")try{n[e]=Ar(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?Ar(e):e))}}function Dx(n,e){return async r=>{let i=E.child({handler:n});try{zx(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),fn("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new Nr(r.repoPath);Za(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=It(t),s=o.includes("Access denied"),a=`Handler '${n}' failed: ${o}`;return!s&&r?.repoPath&&(a+=Li),fn(s?"FORBIDDEN":"INTERNAL_ERROR",a,Re(t))}}}function Lx(n,e,r){return async i=>{let t=E.child({handler:n});try{zx(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),fn("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new Nr(i.repoPath);Za(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"),fn("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=It(s),c=a.includes("Access denied"),l=`Handler '${n}' failed: ${a}`,u=o.data;return!c&&u?.repoPath&&(l+=Li),fn(c?"FORBIDDEN":"INTERNAL_ERROR",l,Re(s))}}}function Zr(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=L_(i,e);return t||n(r)}}var WT={shadow_ops_plan:{default:My},shadow_ops_track:{default:Wy},shadow_ops_briefing:{default:ma},shadow_ops_log:{default:Cb},shadow_ops_synthesize:{default:vb},shadow_ops_chronicle:{default:Sb},shadow_ops_context:{default:Zr($b,"shadow_ops_context")},shadow_ops_health:{default:Rb},shadow_ops_graph:{default:Lb},shadow_ops_crystallize:{default:Mb},shadow_ops_crystallize_theme:{default:jb},shadow_ops_handoff:{default:Fb},shadow_ops_handoff_read:{default:Ub},shadow_ops_claim:{default:Bb},shadow_ops_release:{default:Gb},shadow_ops_dispatch_plan:{default:Jb},shadow_working_set_check:{default:Zr(Vb,"shadow_working_set_check")},shadow_recon_tree:{default:$v},shadow_recon_hologram:{default:wv},shadow_recon_topography:{default:kv},shadow_recon_scout:{default:Iv},shadow_recon_onboard:{default:Pv},shadow_search_concept:{default:j_},shadow_search_symbol:{default:F_},shadow_search_config:{default:W_},shadow_search_path:{default:Z_},shadow_analyze_mesh:{default:nv},shadow_analyze_impact:{default:tv},shadow_analyze_explain_diff:{default:ov},shadow_analyze_type_graph:{default:sv},shadow_analyze_flow:{default:fv},shadow_analyze_deps:{default:gv},shadow_analyze_debt:{default:_v},shadow_inspect_symbol:{default:Zr(Zm,"shadow_inspect_symbol")},shadow_inspect_file:{default:Zr(zv,"shadow_inspect_file")},shadow_sync_trace:{default:Zr(Dv,"shadow_sync_trace")},shadow_sync_index:{default:Lv},shadow_sync_repair:{default:Zr(Ov,"shadow_sync_repair")},shadow_env_hooks:{default:Mv},shadow_env_diagnose:{default:Fv},shadow_workspace_list:{default:Wv},shadow_workspace_link:{default:Zv},shadow_workspace_fuse:{default:Hv}},ZT={shadow_ops_plan:Bv,shadow_ops_track:Gv,shadow_ops_briefing:Jv,shadow_ops_log:Vv,shadow_ops_synthesize:qv,shadow_ops_chronicle:Kv,shadow_ops_context:Xv,shadow_ops_health:Yv,shadow_ops_graph:tx,shadow_ops_crystallize:Qv,shadow_ops_crystallize_theme:ex,shadow_ops_handoff:sx,shadow_ops_handoff_read:ax,shadow_ops_claim:rx,shadow_ops_release:ix,shadow_ops_dispatch_plan:ox,shadow_working_set_check:nx,shadow_recon_tree:cx,shadow_recon_hologram:lx,shadow_recon_topography:ux,shadow_recon_scout:px,shadow_recon_onboard:dx,shadow_search_concept:mx,shadow_search_symbol:fx,shadow_search_config:hx,shadow_search_path:gx,shadow_analyze_mesh:Sx,shadow_analyze_impact:yx,shadow_analyze_explain_diff:bx,shadow_analyze_type_graph:_x,shadow_analyze_flow:vx,shadow_analyze_deps:xx,shadow_analyze_debt:$x,shadow_inspect_symbol:wx,shadow_inspect_file:Ex,shadow_sync_trace:kx,shadow_sync_index:Ix,shadow_sync_repair:Tx,shadow_env_hooks:Rx,shadow_env_diagnose:Px,shadow_workspace_list:Cx,shadow_workspace_link:Nx,shadow_workspace_fuse:Ax},Gm=new Map;for(let[n,e]of Object.entries(WT)){let r=ZT[n];r?Gm.set(n,Lx(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}.
|
|
1176
1231
|
|
|
1177
1232
|
\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}.
|
|
1178
1233
|
|
|
1179
|
-
\u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):
|
|
1180
|
-
`),await
|
|
1234
|
+
\u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):Gm.set(n,Dx(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 Ox(n,e){let r=Gm.get(n);if(!r)throw new Error(`Tool not found: ${n}`);return r(e)}var Jm=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}},HT=new Jm({maxRequests:parseInt(process.env.MCP_RATE_LIMIT_MAX??String(120),10),windowMs:parseInt(process.env.MCP_RATE_LIMIT_WINDOW_MS??String(6e4),10)});function Mx(){return HT}Je();X();Pn();import{readFileSync as BT}from"node:fs";var Hr={name:"@precisionutilityguild/liquid-shadow",version:"0.0.0",license:"UNLICENSED",description:"Tactical Repository Intelligence Operative - Liquid Shadow Ecosystem"};function jx(){let n=JSON.parse(BT(et("package.json"),"utf8"));return{name:typeof n.name=="string"&&n.name.trim().length>0?n.name:Hr.name,version:typeof n.version=="string"&&n.version.trim().length>0?n.version:Hr.version,license:typeof n.license=="string"&&n.license.trim().length>0?n.license:Hr.license,description:typeof n.description=="string"&&n.description.trim().length>0?n.description:Hr.description}}var Fx=Hr;try{Fx=jx()}catch(n){E.error({err:n},"Failed to parse package.json, using defaults")}var Vm=new GT({name:"liquid-shadow-mcp",version:Fx.version},{capabilities:{tools:{}}});Vm.setRequestHandler(qT,async()=>({tools:Kg}));var KT=Mx();Vm.setRequestHandler(VT,async n=>{let{name:e,arguments:r}=n.params;if(!KT.allow())return E.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 Ox(e,r)}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}});async function qm(){E.info("Shutting down gracefully...");try{await _r(),E.info("Worker pool shutdown complete")}catch(n){E.error({error:n},"Error during cleanup")}}process.on("SIGTERM",async()=>{await qm(),process.exit(0)});process.on("SIGINT",async()=>{await qm(),process.exit(0)});async function YT(){vr(!0);let n=new JT;await Vm.connect(n)}YT().catch(async n=>{process.stderr.write(`Server error: ${n.message}
|
|
1235
|
+
`),await qm(),process.exit(1)});
|