archik 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/archik.mjs
CHANGED
|
@@ -518,7 +518,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
518
518
|
${Zu(u.errors)}`);return u.value}function _v(o){return _ft.default.stringify(o,{indent:2,lineWidth:0})}var eVn=6;function Cft(o,c){return fte.relative(o,c).split(fte.sep).join("/")||fte.basename(c)}function tVn(o){return o.endsWith(".archik.yaml")&&!o.endsWith(".archik.suggested.yaml")}async function ul(o,c){let u=[],p=[],f=new Set,y=async v=>{if(f.has(v))return;f.add(v);let _;try{_=await YGn(v,"utf-8")}catch(T){p.push({abs:v,relPath:Cft(c,v),message:T instanceof Error?T.message:String(T)});return}try{let T=Xu(_);u.push({abs:v,relPath:Cft(c,v),doc:T})}catch(T){p.push({abs:v,relPath:Cft(c,v),message:T instanceof Error?T.message:String(T)})}};await y(o);let w=async(v,_)=>{if(_>eVn)return;let T;try{T=await QGn(v,{withFileTypes:!0})}catch{return}for(let R of T){let F=fte.join(v,R.name);if(R.isDirectory()){await w(F,_+1);continue}R.isFile()&&tVn(R.name)&&await y(F)}};return await w(fte.join(c,".archik"),0),{docs:u,errors:p}}var aon=li(Mv(),1);import{readFile as dVn,readdir as hVn}from"node:fs/promises";import gte from"node:path";var nVn=ct.enum(["sync","async","return","create","destroy"]),rVn=ct.enum(["over","left_of","right_of"]),iVn=ct.enum(["alt","opt","loop","par","break","ref"]),oVn=ct.strictObject({id:ba,nodeId:ba,label:ct.string().min(1).optional(),status:E3.optional()}),cVn=ct.strictObject({type:ct.literal("message"),id:ba,from:ba,to:ba,label:ct.string().min(1),arrow:nVn,activate:ct.boolean().optional(),status:E3.optional()}),aVn=ct.strictObject({type:ct.literal("note"),id:ba,position:rVn,participants:ct.array(ba).min(1),text:ct.string().min(1),status:E3.optional()}),sVn=ct.lazy(()=>ct.strictObject({label:ct.string().optional(),steps:ct.array(oon)})),lVn=ct.lazy(()=>ct.strictObject({type:ct.literal("group"),id:ba,kind:iVn,condition:ct.string().optional(),label:ct.string().optional(),branches:ct.array(sVn).optional(),seqFile:hte.optional(),participants:ct.array(ba).optional(),status:E3.optional()})),oon=ct.lazy(()=>ct.union([cVn,aVn,lVn]));function con(o,c){let u=[];for(let p of o)if(c.has(p.id)?u.push(p.id):c.add(p.id),p.type==="group"&&p.branches)for(let f of p.branches)u.push(...con(f.steps,c));return u}var uVn=ct.strictObject({useCase:ba,slice:ba}),pte=ct.strictObject({version:ct.literal("1.0"),name:ct.string().min(1),description:ct.string().optional(),realizes:uVn.optional(),participants:ct.array(oVn).min(1),steps:ct.array(oon)}).superRefine((o,c)=>{let u=new Set;for(let y=0;y<o.participants.length;y++){let w=o.participants[y];u.has(w.id)&&c.addIssue({code:ct.ZodIssueCode.custom,path:["participants",y,"id"],message:`duplicate participant id "${w.id}"`}),u.add(w.id)}let p=new Set,f=con(o.steps,p);for(let y of f)c.addIssue({code:ct.ZodIssueCode.custom,path:["steps"],message:`duplicate step id "${y}"`})});var fVn=6;function pVn(o,c){return gte.relative(o,c).split(gte.sep).join("/")||gte.basename(c)}async function Cv(o){let c=[],u=[],p=async y=>{let w=pVn(o,y),v;try{v=await dVn(y,"utf-8")}catch(_){u.push({abs:y,relPath:w,message:_ instanceof Error?_.message:String(_)});return}try{let _=aon.default.parse(v),T=pte.safeParse(_);if(!T.success){u.push({abs:y,relPath:w,message:T.error.issues.map(R=>R.message).join("; ")});return}c.push({abs:y,relPath:w,doc:T.data})}catch(_){u.push({abs:y,relPath:w,message:_ instanceof Error?_.message:String(_)})}},f=async(y,w)=>{if(w>fVn)return;let v;try{v=await hVn(y,{withFileTypes:!0})}catch{return}for(let _ of v){let T=gte.join(y,_.name);if(_.isDirectory()){await f(T,w+1);continue}_.isFile()&&_.name.endsWith(".archik.seq.yaml")&&await p(T)}};return await f(gte.join(o,".archik"),0),{docs:c,errors:u}}var lon=li(Mv(),1);import{readFile as xVn,readdir as SVn}from"node:fs/promises";import yte from"node:path";var gVn=ct.string().min(1).refine(o=>!o.startsWith("/")&&!/^[a-zA-Z]:[\\/]/.test(o),{message:"test path must be relative (no leading / or drive letter)"}).refine(o=>!o.includes("\\"),{message:"test path must use forward slashes"}).refine(o=>!o.split("/").some(c=>c===".."),{message:"test path must not contain `..` segments"}),yVn=/^[a-z][a-z0-9-]*\.\d+$/,bVn=ct.string().regex(yVn,"branchFrom must be `<flowId>.<stepNumber>` (e.g. basic.3)"),mVn=ct.strictObject({steps:ct.array(ct.string().min(1)).min(1)}),wVn=ct.strictObject({id:ba,branchFrom:bVn,steps:ct.array(ct.string().min(1)).min(1)}),vVn=ct.strictObject({basic:mVn,alternates:ct.array(wVn).optional()}),kVn=ct.strictObject({seqFile:hte}),MVn=ct.strictObject({id:ba,description:ct.string().min(1),flows:ct.array(ba).min(1),tests:ct.array(gVn).optional(),realization:kVn.optional(),status:E3.optional()}),son=ct.strictObject({version:ct.literal("1.0"),id:ba,name:ct.string().min(1),description:ct.string().optional(),status:E3.optional(),primaryActor:ba,secondaryActors:ct.array(ba).optional(),goal:ct.string().min(1),preconditions:ct.array(ct.string().min(1)).optional(),postconditions:ct.array(ct.string().min(1)).optional(),flows:vVn,slices:ct.array(MVn).min(1)}).superRefine((o,c)=>{let u=new Map;u.set("basic",o.flows.basic.steps.length);let p=new Set;o.flows.alternates&&(o.flows.alternates.forEach((y,w)=>{y.id==="basic"&&c.addIssue({code:ct.ZodIssueCode.custom,path:["flows","alternates",w,"id"],message:'alternate id "basic" collides with the basic flow'}),p.has(y.id)&&c.addIssue({code:ct.ZodIssueCode.custom,path:["flows","alternates",w,"id"],message:`duplicate alternate flow id "${y.id}"`}),p.add(y.id),u.set(y.id,y.steps.length)}),o.flows.alternates.forEach((y,w)=>{let[v,_]=y.branchFrom.split("."),T=Number(_),R=u.get(v);if(R===void 0){c.addIssue({code:ct.ZodIssueCode.custom,path:["flows","alternates",w,"branchFrom"],message:`branchFrom "${y.branchFrom}" references unknown flow "${v}"`});return}(T<1||T>R)&&c.addIssue({code:ct.ZodIssueCode.custom,path:["flows","alternates",w,"branchFrom"],message:`branchFrom "${y.branchFrom}" step ${T} is out of range (flow "${v}" has ${R} step(s))`})}));let f=new Set;o.slices.forEach((y,w)=>{f.has(y.id)&&c.addIssue({code:ct.ZodIssueCode.custom,path:["slices",w,"id"],message:`duplicate slice id "${y.id}"`}),f.add(y.id),y.flows.forEach((_,T)=>{u.has(_)||c.addIssue({code:ct.ZodIssueCode.custom,path:["slices",w,"flows",T],message:`slice "${y.id}" references unknown flow "${_}". Available: ${Array.from(u.keys()).join(", ")}.`})}),y.flows.includes("basic")||c.addIssue({code:ct.ZodIssueCode.custom,path:["slices",w,"flows"],message:`slice "${y.id}" does not include the basic flow. Slices must include "basic" plus zero or more alternates that branch off it; otherwise the alternate has no prefix to branch from.`}),!(y.status==="proposed"||y.status==="deprecated")&&(y.tests===void 0||y.tests.length===0)&&c.addIssue({code:ct.ZodIssueCode.custom,path:["slices",w,"tests"],message:`slice "${y.id}" has no tests. Active slices must declare at least one test path (each must exist on disk). Mark the slice \`status: proposed\` if the test isn't written yet.`})})});var _Vn=6;function CVn(o,c){return yte.relative(o,c).split(yte.sep).join("/")||yte.basename(c)}function IVn(o){return o.endsWith(".archik.uc.yaml")}async function Op(o){let c=[],u=[],p=async y=>{let w=CVn(o,y),v;try{v=await xVn(y,"utf-8")}catch(R){u.push({abs:y,relPath:w,message:R instanceof Error?R.message:String(R)});return}let _;try{_=lon.default.parse(v)}catch(R){u.push({abs:y,relPath:w,message:R instanceof Error?R.message:String(R)});return}let T=son.safeParse(_);if(!T.success){u.push({abs:y,relPath:w,message:T.error.issues.map(R=>R.message).join("; ")});return}c.push({abs:y,relPath:w,doc:T.data})},f=async(y,w)=>{if(w>_Vn)return;let v;try{v=await SVn(y,{withFileTypes:!0})}catch{return}for(let _ of v){let T=yte.join(y,_.name);if(_.isDirectory()){await f(T,w+1);continue}_.isFile()&&IVn(_.name)&&await p(T)}};return await f(yte.join(o,".archik","usecases"),0),{docs:c,errors:u}}var don=li(Mv(),1);import{readFile as LVn,readdir as TVn}from"node:fs/promises";import bte from"node:path";var EVn=ct.enum(["human","external-system","time","device"]),PVn=ct.strictObject({id:ba,kind:EVn,description:ct.string().min(1),goals:ct.array(ct.string().min(1)).optional(),status:E3.optional()}),uon=ct.strictObject({version:ct.literal("1.0"),description:ct.string().optional(),actors:ct.array(PVn).min(1)}).superRefine((o,c)=>{let u=new Set;o.actors.forEach((p,f)=>{u.has(p.id)&&c.addIssue({code:ct.ZodIssueCode.custom,path:["actors",f,"id"],message:`duplicate actor id "${p.id}"`}),u.add(p.id)})});var AVn=6;function NVn(o,c){return bte.relative(o,c).split(bte.sep).join("/")||bte.basename(c)}function RVn(o){return o.endsWith(".archik.actors.yaml")}async function aS(o){let c=[],u=[],p=async y=>{let w=NVn(o,y),v;try{v=await LVn(y,"utf-8")}catch(R){u.push({abs:y,relPath:w,message:R instanceof Error?R.message:String(R)});return}let _;try{_=don.default.parse(v)}catch(R){u.push({abs:y,relPath:w,message:R instanceof Error?R.message:String(R)});return}let T=uon.safeParse(_);if(!T.success){u.push({abs:y,relPath:w,message:T.error.issues.map(R=>R.message).join("; ")});return}c.push({abs:y,relPath:w,doc:T.data})},f=async(y,w)=>{if(w>AVn)return;let v;try{v=await TVn(y,{withFileTypes:!0})}catch{return}for(let _ of v){let T=bte.join(y,_.name);if(_.isDirectory()){await f(T,w+1);continue}_.isFile()&&RVn(_.name)&&await p(T)}};return await f(bte.join(o,".archik"),0),{docs:c,errors:u}}import{readFile as OVn,readdir as FVn}from"node:fs/promises";import mte from"node:path";var DVn=ct.strictObject({id:ba.optional(),from:ba,to:ba,label:ct.string().min(1),data:ct.strictObject({in:ct.unknown().optional(),out:ct.unknown().optional()}).optional(),status:ct.enum(["ok","error"]).default("ok")}),hon=ct.strictObject({version:ct.literal("1.0"),useCase:ba,slice:ba,seqFile:ct.string().min(1).optional(),recordedAt:ct.string().min(1),steps:ct.array(DVn).min(1)});var zVn=6;function $Vn(o,c){return mte.relative(o,c).split(mte.sep).join("/")||mte.basename(c)}async function lG(o){let c=[],u=[],p=async y=>{let w=$Vn(o,y),v;try{v=await OVn(y,"utf-8")}catch(_){u.push({abs:y,relPath:w,message:_ instanceof Error?_.message:String(_)});return}try{let _=JSON.parse(v),T=hon.safeParse(_);if(!T.success){u.push({abs:y,relPath:w,message:T.error.issues.map(R=>R.message).join("; ")});return}c.push({abs:y,relPath:w,doc:T.data})}catch(_){u.push({abs:y,relPath:w,message:_ instanceof Error?_.message:String(_)})}},f=async(y,w)=>{if(w>zVn)return;let v;try{v=await FVn(y,{withFileTypes:!0})}catch{return}for(let _ of v){let T=mte.join(y,_.name);if(_.isDirectory()){await f(T,w+1);continue}_.isFile()&&_.name.endsWith(".archik.trace.json")&&await p(T)}};return await f(mte.join(o,".archik"),0),{docs:c,errors:u}}function jVn(o){let c=new Set,u=p=>{for(let f of p){let y=f;if(y.type==="message"&&y.id&&c.add(y.id),y.branches)for(let w of y.branches)u(w.steps)}};return u(o),c}function fon(o,c,u){let p=[],f=[],y=new Set;for(let{doc:w}of c)for(let v of w.slices)y.add(`${w.id}/${v.id}`);for(let{relPath:w,doc:v}of o){if(!y.has(`${v.useCase}/${v.slice}`)){p.push({path:w,message:`trace targets unknown use case / slice "${v.useCase}/${v.slice}"`});continue}if(v.seqFile===void 0)continue;let _=u.find(B=>B.relPath===v.seqFile||B.abs.endsWith("/"+v.seqFile));if(_===void 0){p.push({path:w,message:`trace seqFile "${v.seqFile}" is not a discovered sequence diagram`});continue}let T=jVn(_.doc.steps),R=new Set(_.doc.participants.map(B=>B.id)),F=new Set;for(let B of v.steps){B.id!==void 0&&(T.has(B.id)?F.add(B.id):p.push({path:w,message:`trace step id "${B.id}" is not a message id in ${v.seqFile}`}));for(let V of[B.from,B.to])R.has(V)||p.push({path:w,message:`trace step references "${V}", not a participant in ${v.seqFile}`})}for(let B of T)F.has(B)||f.push(`${w}: seq step "${B}" was not exercised by this run`)}return{errors:p,info:f}}function pon(o,c,u,p){o.forEach((f,y)=>{let w=`${p}.${y}`;f.type==="message"?(c.has(f.from)||u.push({path:`${w}.from`,message:`participant "${f.from}" is not declared in participants`}),c.has(f.to)||u.push({path:`${w}.to`,message:`participant "${f.to}" is not declared in participants`})):f.type==="note"?f.participants.forEach((v,_)=>{c.has(v)||u.push({path:`${w}.participants.${_}`,message:`participant "${v}" is not declared in participants`})}):f.type==="group"&&f.branches&&f.branches.forEach((v,_)=>{pon(v.steps,c,u,`${w}.branches.${_}.steps`)})})}function gon(o,c){let u=[],p=new Set;return o.participants.forEach((f,y)=>{p.add(f.id),c.has(f.nodeId)||u.push({path:`participants.${y}.nodeId`,message:`nodeId "${f.nodeId}" does not match any architecture node. Run \`npx archik q list\` to see available node ids.`})}),pon(o.steps,p,u,"steps"),u}var BVn={boundary:new Set(["control"]),control:new Set(["boundary","control","entity"]),entity:new Set(["control","entity"])};function yon(o,c,u,p,f,y){o.forEach((w,v)=>{let _=`${f}.${v}`;if(w.type==="message"){let T=c.get(w.from),R=c.get(w.to);if(T===void 0||R===void 0)return;let F=BVn[T];F&&!F.has(R)&&y.push({path:`${u}:${_}`,message:`ECB violation in seq "${p}" message "${w.id}": ${T} \u2192 ${R} is forbidden by the robustness rules (boundaries don't talk to boundaries or entities; entities don't talk to boundaries). Insert a control between them, or revisit the stereotype assignment.`})}else w.type==="group"&&w.branches&&w.branches.forEach((T,R)=>{yon(T.steps,c,u,p,`${_}.branches.${R}.steps`,y)})})}function bon(o,c){let u=[],p=new Map;for(let{doc:f}of c)for(let y of f.nodes)y.stereotype!==void 0&&p.set(y.id,y.stereotype);for(let f of o){if(f.doc.realizes===void 0)continue;let y=new Map;for(let w of f.doc.participants){let v=p.get(w.nodeId);v!==void 0&&y.set(w.id,v)}yon(f.doc.steps,y,f.relPath,f.doc.name,"steps",u)}return u}function mon(o,c){let u=[],p=new Map;for(let{doc:f}of c)for(let y of f.nodes){let w=p.get(y.id)??new Set;for(let v of y.seqFiles??[])w.add(v);p.set(y.id,w)}for(let f of o){if(f.doc.realizes===void 0)continue;let y=new Set;for(let w of f.doc.participants){if(y.has(w.nodeId))continue;let v=p.get(w.nodeId);v!==void 0&&(v.has(f.relPath)||(y.add(w.nodeId),u.push({path:`${f.relPath}:participants.${w.id}`,message:`seq "${f.doc.name}" lists node "${w.nodeId}" as a participant, but that node's \`seqFiles\` array does not reference this diagram. Add "${f.relPath}" to node "${w.nodeId}"'s \`seqFiles\` array via \`npx archik suggest set\` so the canvas can surface the flow on that node.`})))}}return u}function won(o,c){let u=[],p=new Map(c.map(f=>[f.doc.id,f]));for(let f of o){if(f.doc.realizes===void 0)continue;let{useCase:y,slice:w}=f.doc.realizes,v=p.get(y);if(v===void 0){u.push({path:`${f.relPath}:realizes.useCase`,message:`seq diagram "${f.doc.name}" claims to realize use case "${y}" but no such use case file was found.`});continue}let _=v.doc.slices.find(T=>T.id===w);if(_===void 0){u.push({path:`${f.relPath}:realizes.slice`,message:`seq diagram "${f.doc.name}" claims to realize slice "${w}" of use case "${y}", but that use case has no slice with that id. Available slices: ${v.doc.slices.map(T=>T.id).join(", ")}.`});continue}if(_.realization===void 0){u.push({path:`${f.relPath}:realizes.slice`,message:`seq diagram "${f.doc.name}" realizes slice "${w}" of "${y}", but the slice does not declare \`realization.seqFile\`. Add \`realization: { seqFile: "${f.relPath}" }\` to slice "${w}" in ${v.relPath}.`});continue}_.realization.seqFile!==f.relPath&&u.push({path:`${f.relPath}:realizes.slice`,message:`seq diagram "${f.doc.name}" realizes slice "${w}" of "${y}", but that slice's realization.seqFile points at "${_.realization.seqFile}", not at this file ("${f.relPath}"). Pick one canonical seq file and update both sides.`})}return u}function von(o){let c=new Map,u=[];for(let{relPath:p,doc:f}of o)for(let y of f.actors){let w=c.get(y.id);if(w!==void 0){u.push({path:p,message:`actor id "${y.id}" is duplicated across actor files (also defined in ${w.relPath})`});continue}c.set(y.id,{relPath:p})}return{index:c,errors:u}}function kon(o){let c=new Map,u=[];for(let{relPath:p,doc:f}of o){let y=c.get(f.id);if(y!==void 0){u.push({path:p,message:`use case id "${f.id}" is duplicated across files (also defined in ${y.relPath})`});continue}c.set(f.id,{relPath:p})}return{index:c,errors:u}}function Mon(o,c){let u=[];for(let{relPath:p,doc:f}of o)c.has(f.primaryActor)||u.push({path:`${p}:primaryActor`,message:`use case "${f.id}" references unknown primaryActor "${f.primaryActor}". Define it in a *.archik.actors.yaml file.`}),f.secondaryActors&&f.secondaryActors.forEach((y,w)=>{c.has(y)||u.push({path:`${p}:secondaryActors.${w}`,message:`use case "${f.id}" references unknown secondary actor "${y}". Define it in a *.archik.actors.yaml file.`})});return u}function xon(o,c){let u=[];for(let{relPath:p,doc:f}of o)f.slices.forEach((y,w)=>{y.status==="proposed"||y.status==="deprecated"||y.tests!==void 0&&y.tests.forEach((_,T)=>{c(_)||u.push({path:`${p}:slices.${w}.tests.${T}`,message:`slice "${y.id}" test "${_}" does not exist on disk (resolved relative to project root). Either fix the path or mark the slice \`status: proposed\`.`})})});return u}function Son(o,c){let u=[],p=new Map(c.map(f=>[f.relPath,f]));for(let{relPath:f,doc:y}of o)y.slices.forEach((w,v)=>{if(w.realization===void 0)return;let _=p.get(w.realization.seqFile);if(_===void 0){u.push({path:`${f}:slices.${v}.realization.seqFile`,message:`slice "${w.id}" realization seqFile "${w.realization.seqFile}" does not exist or did not parse. Run \`npx archik q sequences\` to see available seq files.`});return}if(_.doc.realizes===void 0){u.push({path:`${f}:slices.${v}.realization.seqFile`,message:`slice "${w.id}" claims realization "${w.realization.seqFile}", but that seq diagram has no \`realizes\` block. Add \`realizes: { useCase: "${y.id}", slice: "${w.id}" }\` to ${_.relPath}, or remove the realization claim.`});return}(_.doc.realizes.useCase!==y.id||_.doc.realizes.slice!==w.id)&&u.push({path:`${f}:slices.${v}.realization.seqFile`,message:`slice "${w.id}" claims realization "${w.realization.seqFile}", but that seq diagram's \`realizes\` points at "${_.doc.realizes.useCase}/${_.doc.realizes.slice}", not at "${y.id}/${w.id}". Pick one canonical link.`})});return u}import wte from"node:path";function Iv(o){let c=wte.dirname(o),u=wte.basename(o),p=wte.extname(u),f=p.length>0?u.slice(0,-p.length):u;return wte.join(c,`${f}.suggested${p}`)}function uG(o){return wte.basename(o).endsWith(".archik.suggested.yaml")?"suggested":"normal"}function _on(o){return o.metadata?.suggestion!==void 0}function wge(o){if(o.metadata?.suggestion===void 0)return o;let{suggestion:c,...u}=o.metadata,p={...o};return Object.keys(u).length===0?delete p.metadata:p.metadata=u,p}function HVn(o){let c=new Map;for(let p of o)c.set(p.id,p.parentId);let u=new Map;for(let p of o){let f=new Set,y=p.parentId,w=0;for(;y!==void 0&&w<=o.length&&!f.has(y);)f.add(y),y=c.get(y),w++;u.set(p.id,f)}return u}function dG(o,c,u){if(c.id!==void 0&&o.id!==c.id||c.kind!==void 0&&o.kind!==c.kind||c.stereotype!==void 0&&o.stereotype!==c.stereotype)return!1;let p=u.get(o.id)??new Set;return!(c.parent!==void 0&&!p.has(c.parent)||c.notParent!==void 0&&p.has(c.notParent))}function vge(o,c,u,p){let f=o.filter(y=>y.abs!==c);return f.push({abs:c,relPath:u,doc:p}),Ift(f)}function Ift(o){let c=[],u=o.flatMap(_=>_.doc.nodes),p=o.flatMap(_=>_.doc.edges.map(T=>({edge:T,relPath:_.relPath}))),f=new Map(u.map(_=>[_.id,_])),y=HVn(u),w=[],v=new Map;for(let _ of o)for(let T of _.doc.constraints??[]){let R=v.get(T.id);if(R!==void 0){c.push({path:`constraints.${T.id}`,message:`duplicate constraint id "${T.id}" (already defined in ${R})`});continue}v.set(T.id,_.relPath),w.push({constraint:T,relPath:_.relPath})}for(let{constraint:_}of w){let T=new Set(_.except??[]);if(_.forbidEdge!==void 0){let R=_.forbidEdge;for(let{edge:F,relPath:B}of p)if(!T.has(F.id)&&!(R.relationship!==void 0&&F.relationship!==R.relationship)){if(R.from!==void 0){let V=f.get(F.from);if(V===void 0||!dG(V,R.from,y))continue}if(R.to!==void 0){let V=f.get(F.to);if(V===void 0||!dG(V,R.to,y))continue}c.push({path:`constraints.${_.id}`,message:`edge "${F.id}" (${F.from} \u2192 ${F.to} via ${F.relationship}, in ${B}) violates constraint "${_.id}": ${_.description} \u2014 fix the edge, or add "${F.id}" to the constraint's \`except\` list with a reason in review.`})}}if(_.requireEdge!==void 0){let R=_.requireEdge;for(let F of u){if(T.has(F.id)||!dG(F,R.node,y)||p.some(({edge:se})=>{if(R.relationship!==void 0&&se.relationship!==R.relationship)return!1;if(R.to!==void 0){if(se.from!==F.id)return!1;let ce=f.get(se.to);return ce!==void 0&&dG(ce,R.to,y)}if(se.to!==F.id)return!1;let ee=f.get(se.from);return ee!==void 0&&dG(ee,R.from,y)}))continue;let V=R.to!==void 0?`an outgoing edge to a node matching ${JSON.stringify(R.to)}`:`an incoming edge from a node matching ${JSON.stringify(R.from)}`;c.push({path:`constraints.${_.id}`,message:`node "${F.id}" (kind: ${F.kind}) violates constraint "${_.id}": ${_.description} \u2014 it needs ${V}`+(R.relationship!==void 0?` (relationship: ${R.relationship})`:"")+`, or add "${F.id}" to the constraint's \`except\` list.`})}}if(_.maxDependencies!==void 0){let R=_.maxDependencies;for(let F of u){if(T.has(F.id)||!dG(F,R.node,y))continue;let B=p.filter(({edge:V})=>V.from===F.id&&(R.relationship===void 0||V.relationship===R.relationship));B.length<=R.max||c.push({path:`constraints.${_.id}`,message:`node "${F.id}" (kind: ${F.kind}) violates constraint "${_.id}": ${_.description} \u2014 ${B.length} outgoing ${R.relationship??""} edge(s), max is ${R.max} (${B.map(V=>V.edge.to).join(", ")}). Split the node, introduce a port/gateway, or add "${F.id}" to \`except\`.`})}}if(_.requireOwner!==void 0){let R=_.requireOwner.kinds;for(let F of u)T.has(F.id)||R!==void 0&&!R.includes(F.kind)||F.owner===void 0&&c.push({path:`constraints.${_.id}`,message:`node "${F.id}" (kind: ${F.kind}) violates constraint "${_.id}": ${_.description} \u2014 add \`owner: <team>\` to the node, or add "${F.id}" to the constraint's \`except\` list.`})}}return c}var CE={maxNodes:15,maxEdges:20,maxChildren:6,maxDegree:6,maxDepth:3};function UVn(o,c){let u=0,p=c.get(o);for(;p!==void 0&&u<=c.size;)u++,p=c.get(p);return u}function kge(o,c){let u=[];for(let{doc:f,relPath:y}of o){f.nodes.length>c.maxNodes&&u.push({kind:"file-nodes",subject:y,value:f.nodes.length,limit:c.maxNodes,suggestion:`split ${y} into sub-files via archikFile (${f.nodes.length} nodes; limit ${c.maxNodes})`}),f.edges.length>c.maxEdges&&u.push({kind:"file-edges",subject:y,value:f.edges.length,limit:c.maxEdges,suggestion:`split ${y} into sub-files via archikFile (${f.edges.length} edges; limit ${c.maxEdges})`});let w=new Map,v=new Map;for(let _ of f.nodes)v.set(_.id,_.parentId);for(let _ of f.nodes)_.parentId!==void 0&&w.set(_.parentId,(w.get(_.parentId)??0)+1);for(let[_,T]of w)T>c.maxChildren&&u.push({kind:"container-children",subject:_,value:T,limit:c.maxChildren,suggestion:`give container '${_}' its own archikFile \u2014 ${T} children, limit ${c.maxChildren}`});for(let _ of f.nodes){let T=UVn(_.id,v);T>c.maxDepth&&u.push({kind:"nesting-depth",subject:_.id,value:T,limit:c.maxDepth,suggestion:`flatten or split \u2014 '${_.id}' is ${T} levels deep, limit ${c.maxDepth}`})}}let p=new Map;for(let{doc:f}of o)for(let y of f.edges)p.set(y.from,(p.get(y.from)??0)+1),p.set(y.to,(p.get(y.to)??0)+1);for(let[f,y]of p)y>c.maxDegree&&u.push({kind:"node-degree",subject:f,value:y,limit:c.maxDegree,suggestion:`'${f}' has ${y} connections \u2014 name a bounded context or add a port/gateway (limit ${c.maxDegree})`});return u.sort((f,y)=>y.value-y.limit-(f.value-f.limit)),u}var VVn=o=>{let c=dn(o,"json");return c!==void 0&&c!=="false"&&c!=="0"};function Ev(o){console.log(JSON.stringify(o,null,2))}async function AR(o){let c=VVn(o),u;try{u=await ac(o._[0])}catch(tn){let cn=tn instanceof Error?tn.message:String(tn);return c?Ev({ok:!1,errors:[{path:"<root>",message:cn}]}):console.error(`\u2717 ${cn}`),1}let p=Con.relative(process.cwd(),u)||u,f;try{f=await GVn(u,"utf-8")}catch(tn){let cn=tn instanceof Error?tn.message:String(tn);return c?Ev({ok:!1,file:p,errors:[{path:"<root>",message:cn}]}):(console.error(`\u2717 Cannot read ${p}`),console.error(cn)),1}let y;try{y=Ion.default.parse(f)}catch(tn){let Nr=[{path:"<root>",message:`Invalid YAML: ${tn instanceof Error?tn.message:String(tn)}`}];return c?Ev({ok:!1,file:p,errors:Nr}):(console.error(`\u2717 ${p}`),console.error(Zu(Nr))),1}let w=jg(y);if(!w.ok)return c?Ev({ok:!1,file:p,errors:w.errors}):(console.error(`\u2717 ${p}`),console.error(Zu(w.errors))),1;let v=Ba(u),_=tn=>qVn(Con.resolve(v,tn)),T=sG(w.value,_);if(T.length>0)return c?Ev({ok:!1,file:p,errors:T}):(console.error(`\u2717 ${p}`),console.error(Zu(T))),1;let R=uG(u),F=aG(w.value,R,_);if(F.length>0)return c?Ev({ok:!1,file:p,errors:F}):(console.error(`\u2717 ${p}`),console.error(Zu(F))),1;let B=await ul(u,v);if(B.errors.length>0){if(c)Ev({ok:!1,file:p,errors:B.errors.map(tn=>({path:tn.relPath,message:tn.message}))});else for(let tn of B.errors)console.error(`\u2717 ${tn.relPath}: ${tn.message}`);return 1}let V=new Set(B.docs.flatMap(tn=>tn.doc.nodes.map(cn=>cn.id))),se=[];for(let{doc:tn}of B.docs)se.push(...ion(tn,_));if(se.length>0){if(c)Ev({ok:!1,file:p,errors:se});else{console.error("\u2717 seqFiles path errors:");for(let tn of se)console.error(` \u2717 ${tn.path}: ${tn.message}`)}return 1}let ee=await Cv(v),ce=0;for(let tn of ee.errors)c||console.error(`\u2717 ${tn.relPath}: ${tn.message}`),ce++;for(let{relPath:tn,doc:cn}of ee.docs){let Nr=gon(cn,V);if(Nr.length>0){if(!c){console.error(`\u2717 ${tn}`);for(let oi of Nr)console.error(` \u2717 ${oi.path}: ${oi.message}`)}ce+=Nr.length}}if(ce>0)return c&&Ev({ok:!1,file:p,errors:[{path:"<seq>",message:`${ce} sequence diagram error(s)`}]}),1;let ge=await Op(v),Oe=await aS(v),ut=[];for(let tn of ge.errors)ut.push({path:tn.relPath,message:tn.message});for(let tn of Oe.errors)ut.push({path:tn.relPath,message:tn.message});if(ut.length===0){let tn=von(Oe.docs);ut.push(...tn.errors);let cn=kon(ge.docs);ut.push(...cn.errors),ut.length===0&&(ut.push(...Mon(ge.docs,tn.index)),ut.push(...xon(ge.docs,_)),ut.push(...Son(ge.docs,ee.docs)),ut.push(...won(ee.docs,ge.docs)),ut.push(...bon(ee.docs,B.docs)),ut.push(...mon(ee.docs,B.docs)))}if(ut.length>0)return c?Ev({ok:!1,file:p,errors:ut}):(console.error(`\u2717 ${p}`),console.error(Zu(ut))),1;let Se=await lG(v),Be=Se.errors.map(tn=>({path:tn.relPath,message:tn.message})),Ue=[];if(Be.length===0){let tn=fon(Se.docs,ge.docs,ee.docs);Be.push(...tn.errors),Ue=tn.info}if(Be.length>0)return c?Ev({ok:!1,file:p,errors:Be}):(console.error(`\u2717 ${p}`),console.error(Zu(Be))),1;let on=Ift(B.docs);if(on.length>0)return c?Ev({ok:!1,file:p,errors:on}):(console.error(`\u2717 ${p}`),console.error(Zu(on))),1;let Gt=Oe.docs.reduce((tn,cn)=>tn+cn.doc.actors.length,0),xn=ge.docs.length,Vn=kge(B.docs,CE).length;if(c)Ev({ok:!0,file:p,nodes:w.value.nodes.length,edges:w.value.edges.length,useCases:xn,actors:Gt,complexityHints:Vn});else{let tn=B.docs.reduce((Pi,ue)=>Pi+ue.doc.nodes.length,0),cn=B.docs.reduce((Pi,ue)=>Pi+ue.doc.edges.length,0),Nr=B.docs.length,oi=Nr>1?` (${Nr} files)`:"",wo=xn>0?`, ${xn} use case${xn===1?"":"s"}`:"",Za=Gt>0?`, ${Gt} actor${Gt===1?"":"s"}`:"";console.log(`\u2713 ${p}${oi} \u2014 ${tn} nodes, ${cn} edges${wo}${Za}`),Vn>0&&console.log(`\u24D8 ${Vn} complexity hint${Vn===1?"":"s"} \u2014 run \`archik complexity\` to see them`);for(let Pi of Ue)console.log(`\u24D8 ${Pi}`)}return 0}var M2t=li(P3(),1),x2t=li(Oye(),1),Kln=li(Mv(),1);import{mkdir as Jln,readFile as Zln,writeFile as Xln}from"node:fs/promises";import FG from"node:path";var Fsn=li(Nsn(),1);function ane(o,c){return o.length*c}function n0(o,c,u){if(c<=0)return"";let p=Math.floor(c/u);return o.length<=p?o:p<=1?"\u2026":o.slice(0,p-1)+"\u2026"}var sne={nodeSpacing:60,layerSpacing:100,padding:40,viewMode:"detailed"};function JXn(o){let c=o.nodeSpacing??sne.nodeSpacing,u=o.layerSpacing??sne.layerSpacing,p=o.padding??sne.padding;return{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.edgeRouting":"ORTHOGONAL","elk.layered.spacing.nodeNodeBetweenLayers":String(u),"elk.spacing.nodeNode":String(c),"elk.padding":`[top=${p}, left=${p}, bottom=${p}, right=${p}]`,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.edgeLabels.placement":"CENTER","elk.spacing.edgeLabel":"8","elk.spacing.labelLabel":"6","elk.spacing.edgeNode":"20","elk.spacing.edgeEdge":"12","elk.layered.spacing.edgeEdgeBetweenLayers":"12"}}var ed={width:172,height:82},Rsn={width:172,height:90},ZXn={service:ed,function:ed,worker:ed,agent:ed,database:{width:184,height:100},cache:Rsn,vectordb:ed,storage:ed,model:ed,dto:ed,dataobject:ed,queue:{width:188,height:80},topic:ed,stream:ed,gateway:ed,cdn:ed,route:ed,interface:ed,adapter:ed,port:ed,llm:ed,prompt:ed,tool:ed,auth:ed,observability:ed,cloud:{width:200,height:120},frontend:Rsn,page:ed,component:ed,store:ed,hook:ed,external:{width:184,height:100},human:{width:184,height:100},module:{width:240,height:130},custom:{width:240,height:130}},dl={width:152,height:36},Dsn={width:200,height:80},XXn={service:dl,function:dl,worker:dl,agent:dl,database:dl,cache:dl,vectordb:dl,storage:dl,model:dl,dto:dl,dataobject:dl,queue:{width:168,height:36},topic:dl,stream:dl,gateway:dl,cdn:dl,route:dl,interface:dl,adapter:dl,port:dl,llm:dl,prompt:dl,tool:dl,auth:dl,observability:dl,cloud:dl,frontend:dl,page:dl,component:dl,store:dl,hook:dl,external:{width:168,height:40},human:{width:168,height:40},module:Dsn,custom:Dsn},KXn=24,Osn=320;function YXn(o,c,u){if(o.kind==="module"||o.kind==="custom")return c;if(u==="compact"){let v=36+ane(o.name,5.9)+12;return Math.max(c,Math.min(Osn,Math.ceil(v)))}let p=ane(o.name,7.4),f=o.stack!==void 0?ane(o.stack,5.9):0,y=Math.max(p,f)+KXn;return Math.max(c,Math.min(Osn,Math.ceil(y)))}var QXn={top:48,left:18,bottom:18,right:18};function eKn(o,c,u,p){let f=u[o.kind],y={id:o.id,width:YXn(o,f.width,p),height:f.height};if(c.length>0){y.children=c;let w=p==="compact"?{top:30,left:12,bottom:12,right:12}:QXn;y.layoutOptions={"elk.padding":`[top=${w.top}, left=${w.left}, bottom=${w.bottom}, right=${w.right}]`}}return y}function tKn(o,c,u){let p=new Map;for(let v of o.nodes)p.set(v.id,v);let f=new Map;for(let v of o.nodes){let _=f.get(v.parentId)??[];_.push(v),f.set(v.parentId,_)}function y(v){let _=(f.get(v.id)??[]).map(y);return eKn(v,_,c,u)}return{roots:(f.get(void 0)??[]).map(y),byId:p}}function nKn(o){return o.fromFile===void 0&&o.toFile===void 0}function rKn(o){return o.edges.filter(nKn).map(c=>{let u={id:c.id,sources:[c.from],targets:[c.to]};return c.label!==void 0&&c.label.length>0&&(u.labels=[{text:c.label,width:Math.ceil(ane(c.label,5.9)),height:14}]),u})}function Gm(o){return o??0}function zsn(o,c){let u=c.get(o.id);if(!u)throw new Error(`ELK returned unknown node id "${o.id}"`);let p=(o.children??[]).map(f=>zsn(f,c));return{...u,x:Gm(o.x),y:Gm(o.y),width:Gm(o.width),height:Gm(o.height),children:p}}function iKn(o,c){let u=new Map,p=new Map,f=(T,R,F,B)=>{let V=R+Gm(T.x),se=F+Gm(T.y);u.set(T.id,{x:V,y:se}),p.set(T.id,B);let ee=[...B,T.id];for(let ce of T.children??[])f(ce,V,se,ee)};f(o,0,0,[]);let y=(T,R)=>{let F=p.get(T)??[],B=p.get(R)??[],V=0;for(;V<F.length&&V<B.length&&F[V]===B[V];)V++;let se=V===0?o.id:F[V-1];return u.get(se)??{x:0,y:0}},w=new Map,v=new Map,_=T=>{for(let R of T.edges??[]){let F=R.sources?.[0]??"",B=R.targets?.[0]??"",V=y(F,B),se=ge=>({x:Gm(ge.x)+V.x,y:Gm(ge.y)+V.y}),ee=(R.sections??[]).map(ge=>({startPoint:se(ge.startPoint),endPoint:se(ge.endPoint),bendPoints:(ge.bendPoints??[]).map(se)}));w.set(R.id,ee);let ce=(R.labels??[]).map(ge=>({text:typeof ge.text=="string"?ge.text:"",x:Gm(ge.x)+V.x,y:Gm(ge.y)+V.y,width:Gm(ge.width),height:Gm(ge.height)}));v.set(R.id,ce)}for(let R of T.children??[])_(R)};return _(o),c.edges.map(T=>({...T,sections:w.get(T.id)??[],labels:v.get(T.id)??[]}))}var oKn=new Fsn.default;async function cKn(o,c={}){if(o.nodes.length===0)return{document:o,width:0,height:0,roots:[],edges:[]};let u=c.viewMode==="compact"?"compact":"detailed",p=u==="compact"?XXn:ZXn,{roots:f,byId:y}=tKn(o,p,u),w={id:"__root__",layoutOptions:JXn(c),children:f,edges:rKn(o)},v=await oKn.layout(w),_=(v.children??[]).map(T=>zsn(T,y));return{document:o,width:Gm(v.width),height:Gm(v.height),roots:_,edges:iKn(v,o)}}var Fye={name:"elk",layout:cKn};var Dli={[Fye.name]:Fye},aKn=Fye;function NG(o,c){return aKn.layout(o,c)}function $sn(o,c,u){let p=new Map,f=(v,_)=>{let T=p.get(v)??new Set;T.add(_),p.set(v,T)};for(let v of o)f(v.from,v.to),f(v.to,v.from);let y=new Set([c]),w=new Set([c]);for(let v=0;v<u;v++){let _=new Set;for(let T of w)for(let R of p.get(T)??[])y.has(R)||(y.add(R),_.add(R));if(_.size===0)break;w=_}return y}function jsn(o,c,u){let p=o.flatMap(v=>v.doc.edges),f=$sn(p,c,u),y=[],w=[];for(let{doc:v,relPath:_}of o){for(let T of v.nodes)f.has(T.id)&&y.push({node:T,relPath:_});for(let T of v.edges)f.has(T.from)&&f.has(T.to)&&w.push({edge:T,relPath:_})}return{nodes:y,edges:w}}function Bsn(o,c,u){let p=$sn(o.edges,c,u);return{...o,nodes:o.nodes.filter(f=>p.has(f.id)).map(f=>f.parentId!==void 0&&!p.has(f.parentId)?(({parentId:y,...w})=>w)(f):f),edges:o.edges.filter(f=>p.has(f.from)&&p.has(f.to))}}function Hsn(o,c){let u=new Set(c.hideRel??[]),p=c.onlyRel?new Set(c.onlyRel):null,f=o.edges.filter(y=>!(p&&!p.has(y.relationship)||u.has(y.relationship)||c.hideStructural&&eon(y.relationship)==="structural"));return{...o,edges:f}}var zye="seq-arrow-filled",$ye="seq-arrow-open";function sKn(o){return Math.max(160,o.length*8+80)}function Usn(o,c,u,p,f,y=0){let w=u,v=[],_=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY;for(let R of o)if(R.type==="message"){let F=c.get(R.from),B=c.get(R.to),V=F?.cx??p,se=B?.cx??p;v.push({type:"message",id:R.id,fromCx:V,toCx:se,y:w,label:R.label,arrow:R.arrow,activate:R.activate??!1,isSelf:R.from===R.to,...R.status!==void 0?{status:R.status}:{}}),w+=R.from===R.to?56*1.5:56}else if(R.type==="note"){let F=R.participants.map(ce=>c.get(ce)?.cx).filter(ce=>ce!==void 0).sort((ce,ge)=>ce-ge),B=F[0]??p,V=F[F.length-1]??f,se=Math.min(Math.max(R.text.length*7.5+24,V-B+16,80),400),ee;R.position==="left_of"?ee=B-se-8:R.position==="right_of"?ee=V+8:ee=(B+V)/2-se/2,_=Math.min(_,ee),T=Math.max(T,ee+se),v.push({type:"note",id:R.id,x:ee,y:w,width:se,height:64,text:R.text,...R.status!==void 0?{status:R.status}:{}}),w+=72}else if(R.type==="group"){let F=Math.min(y*6,12),B=p-12+F,V=f-p+24-F*2,se=w;w+=24;let ee=[];if(R.branches)for(let ce=0;ce<R.branches.length;ce++){let ge=R.branches[ce],Oe=w,{items:ut,endY:Se,contentMinX:Be,contentMaxX:Ue}=Usn(ge.steps,c,w,p,f,y+1);w=Se,_=Math.min(_,Be),T=Math.max(T,Ue),ee.push({...ge.label!==void 0?{label:ge.label}:{},startY:Oe,...ce<R.branches.length-1?{dividerY:w}:{},steps:ut}),ce<R.branches.length-1&&(w+=4)}w+=12,v.push({type:"group",id:R.id,kind:R.kind,...R.condition!==void 0?{condition:R.condition}:{},...R.label!==void 0?{label:R.label}:{},...R.seqFile!==void 0?{seqFile:R.seqFile}:{},x:B,y:se,width:V,height:w-se,branches:ee,...R.status!==void 0?{status:R.status}:{}}),_=Math.min(_,B),T=Math.max(T,B+V),w+=20}return{items:v,endY:w,contentMinX:_,contentMaxX:T}}function qsn(o){let c=new Map;for(let u of o)if(u.type==="message"&&u.arrow==="destroy"&&c.set(u.toCx,u.y+56+20),u.type==="group")for(let p of u.branches)for(let[f,y]of qsn(p.steps))c.set(f,y);return c}function lKn(o){let c=[],u=new Map;function p(f){for(let y of f)if(y.type==="message"){if(y.activate&&y.arrow==="sync"&&!y.isSelf){let w=u.get(y.toCx)??[];w.push(y.y),u.set(y.toCx,w)}if(y.arrow==="return"&&!y.isSelf){let w=u.get(y.fromCx);if(w&&w.length>0){let v=w.pop();c.push({cx:y.fromCx,startY:v,endY:y.y}),w.length===0&&u.delete(y.fromCx)}}}else if(y.type==="group")for(let w of y.branches)p(w.steps)}p(o);for(let[f,y]of u)for(let w of y)c.push({cx:f,startY:w,endY:w+56/2});return c}function Gsn(o,c){let u=o.participants.map(on=>sKn(on.label??on.nodeId)),p=32,f=o.participants.map((on,Gt)=>{let xn=u[Gt],Vn=p+xn/2;p+=xn;let tn=c?.get(on.nodeId);return{id:on.id,nodeId:on.nodeId,label:on.label??on.nodeId,cx:Vn,colWidth:xn,...tn!==void 0?{kind:tn}:{},...on.status!==void 0?{status:on.status}:{},lifelineEndY:0}}),y=p+32,w=new Map(f.map(on=>[on.id,on])),v=f[0]?.cx??32,_=f[f.length-1]?.cx??y-32,T=24,{items:R,endY:F,contentMinX:B,contentMaxX:V}=Usn(o.steps,w,T,v,_),se=B<32&&Number.isFinite(B)?32-B:0,ee=Number.isFinite(V)?V+se+32:0,ce=Math.max(y+se,ee),ge=se>0?R.map(on=>Vsn(on,se)):R,Oe=se>0?f.map(on=>({...on,cx:on.cx+se})):f,ut=qsn(ge),Se=Oe.map(on=>({...on,lifelineEndY:ut.get(on.cx)??56+F+24})),Be=56+F+24,Ue=lKn(ge);return{participants:Se,steps:ge,activations:Ue,totalWidth:ce,totalHeight:Be}}function Vsn(o,c){return o.type==="message"?{...o,fromCx:o.fromCx+c,toCx:o.toCx+c}:o.type==="note"?{...o,x:o.x+c}:{...o,x:o.x+c,branches:o.branches.map(u=>({...u,steps:u.steps.map(p=>Vsn(p,c))}))}}var ci=li(u2t(),1);var D3=li(ec(),1),tln=(o,c,u)=>({width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:u,strokeLinecap:"round",strokeLinejoin:"round"});function nln({size:o=16,color:c="currentColor",strokeWidth:u=1.8}){return(0,D3.jsxs)("svg",{...tln(o,c,u),"aria-hidden":"true",children:[(0,D3.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3.5",ry:"3.5"}),(0,D3.jsx)("line",{x1:"9",y1:"9",x2:"9",y2:"13"}),(0,D3.jsx)("line",{x1:"15",y1:"9",x2:"15",y2:"13"}),(0,D3.jsx)("circle",{cx:"12",cy:"16.5",r:"1",fill:c,stroke:"none"})]})}function rln({size:o=16,color:c="currentColor",strokeWidth:u=1.8}){return(0,D3.jsxs)("svg",{...tln(o,c,u),"aria-hidden":"true",children:[(0,D3.jsx)("path",{d:"M 7.5 6 L 3.5 12 L 7.5 18"}),(0,D3.jsx)("path",{d:"M 16.5 6 L 20.5 12 L 16.5 18"}),(0,D3.jsx)("circle",{cx:"13",cy:"8.6",r:"0.9",fill:c,stroke:"none"}),(0,D3.jsx)("line",{x1:"13",y1:"11",x2:"11",y2:"16.5"})]})}var Vm={service:{color:"#38bdf8",icon:ci.Server,description:"Long-running compute that owns business logic."},function:{color:"#22d3ee",icon:ci.FunctionSquare,description:"Stateless function-as-a-service / lambda."},worker:{color:"#06b6d4",icon:ci.Cog,description:"Background job processor or consumer loop."},agent:{color:"#14b8a6",icon:ci.Bot,description:"Autonomous AI agent driving tools and actions."},database:{color:"#34d399",icon:ci.Database,description:"Persistent state \u2014 relational, document, key-value."},cache:{color:"#a78bfa",icon:ci.Layers,description:"In-memory store for fast reads."},vectordb:{color:"#c084fc",icon:ci.Sparkles,description:"Vector store for embeddings / similarity search."},storage:{color:"#84cc16",icon:ci.HardDrive,description:"Object / blob storage (S3, GCS, etc.)."},model:{color:"#2dd4bf",icon:ci.Shapes,description:"Domain model \u2014 rich business object with behavior."},dto:{color:"#4ade80",icon:ci.FileJson2,description:"Data transfer object \u2014 shape crossing a boundary."},dataobject:{color:"#86efac",icon:ci.Braces,description:"Plain data structure / record, no behavior."},queue:{color:"#fbbf24",icon:ci.SendHorizontal,description:"Asynchronous work queue with at-least-once delivery."},topic:{color:"#f97316",icon:ci.Radio,description:"Pub/sub topic with multiple consumers."},stream:{color:"#fb923c",icon:ci.Waves,description:"Append-only event log (Kafka, Kinesis)."},gateway:{color:"#6366f1",icon:ci.DoorOpen,description:"API gateway, ingress, edge router."},cdn:{color:"#0ea5e9",icon:ci.Globe,description:"Content delivery network / static edge."},route:{color:"#f59e0b",icon:ci.Route,description:"HTTP / URL route \u2014 path + method mapped to a handler."},interface:{color:"#d946ef",icon:rln,description:"Abstract contract \u2014 the <i> a system commits to."},adapter:{color:"#c026d3",icon:ci.Cable,description:"Concrete implementation of an interface."},port:{color:"#a21caf",icon:nln,description:"Hexagonal-architecture port \u2014 the socket an adapter plugs into."},llm:{color:"#a855f7",icon:ci.Brain,description:"Large language model service."},prompt:{color:"#c4b5fd",icon:ci.MessageSquare,description:"Prompt template / instruction set."},tool:{color:"#fde047",icon:ci.Wrench,description:"Tool callable by an agent or LLM."},auth:{color:"#ef4444",icon:ci.Lock,description:"Identity provider, auth service."},observability:{color:"#10b981",icon:ci.Eye,description:"Metrics, logs, traces \u2014 operational telemetry."},cloud:{color:"#0284c7",icon:ci.Cloud,description:"Managed cloud service (compute, hosted, etc.)."},frontend:{color:"#f472b6",icon:ci.Monitor,description:"User-facing surface \u2014 browser, mobile, CLI."},page:{color:"#fb7185",icon:ci.LayoutTemplate,description:"Route-level UI screen mapped to a URL."},component:{color:"#8b5cf6",icon:ci.Component,description:"Reusable UI component / view fragment."},store:{color:"#facc15",icon:ci.Boxes,description:"Client-side state container \u2014 Redux, Zustand, Pinia."},hook:{color:"#0d9488",icon:ci.Anchor,description:"Reusable client logic \u2014 React hook, Vue composable."},external:{color:"#94a3b8",icon:ci.ExternalLink,description:"Third-party system you don't own."},human:{color:"#60a5fa",icon:ci.UserRound,description:"Human actor \u2014 end user, operator, or customer."},module:{color:"#7dd3fc",icon:ci.Package,description:"Module / component grouping (logical container)."},custom:{color:"#64748b",icon:ci.Box,description:"Container or anything not in the taxonomy."}};var Kz=li(ec(),1),XOe=36,q6r=128,G6r=7,iln=20,oln=24;function cln({participant:o,nodeKind:c}){let u=c?Vm[c]:void 0,p=u?.color??"var(--archik-fg-muted)",f=(56-XOe)/2,y=u?.icon,w=Math.max(q6r,o.label.length*G6r+oln+(y?iln:0)),v=w/2,_=y?v+iln/2:v,T=o.status,R=T==="proposed"?.55:T==="deprecated"?.35:1,F=T==="proposed"||T==="deprecated"?"4 3":void 0;return(0,Kz.jsxs)("g",{transform:`translate(${o.cx-v}, ${f})`,opacity:R,children:[(0,Kz.jsx)("rect",{width:w,height:XOe,rx:8,fill:"var(--archik-node-fill)",stroke:p,strokeWidth:1.4,...F!==void 0?{strokeDasharray:F}:{}}),y&&(0,Kz.jsx)("g",{transform:`translate(${oln/2}, ${(XOe-14)/2})`,children:(0,Kz.jsx)(y,{size:14,color:p,strokeWidth:1.5})}),(0,Kz.jsx)("text",{x:_,y:XOe/2+4,textAnchor:"middle",fontSize:12,fontWeight:500,fill:"var(--archik-fg)",fontFamily:"inherit",children:o.label})]})}var sln=li(ec(),1);function aln({participant:o}){let c=o.status,u=c==="proposed"?.3:c==="deprecated"?.2:.5;return(0,sln.jsx)("line",{x1:o.cx,y1:56,x2:o.cx,y2:o.lifelineEndY,stroke:"var(--archik-node-stroke)",strokeWidth:1,strokeDasharray:"4 4",opacity:u})}var u6=li(ec(),1),h2t=32,f2t=20,V6r=-6;function lln({msg:o}){let c=o.arrow==="return",u=o.arrow==="async",p=o.arrow==="create",f=c||p,y=o.arrow==="destroy",w=c||u?$ye:zye,v=o.status==="proposed"?.5:o.status==="deprecated"?.35:1;if(o.isSelf){let F=o.fromCx,B=o.y,V=`M ${F} ${B} L ${F+h2t} ${B} L ${F+h2t} ${B+f2t} L ${F} ${B+f2t}`;return(0,u6.jsxs)("g",{opacity:v,children:[(0,u6.jsx)("path",{d:V,fill:"none",stroke:"var(--archik-edge-filled)",strokeWidth:1.4,markerEnd:`url(#${w})`}),(0,u6.jsx)("text",{x:F+h2t+6,y:B+f2t/2+4,fontSize:11,fill:"var(--archik-fg)",fontFamily:"inherit",children:o.label})]})}let T=o.fromCx<o.toCx?o.toCx-6:o.toCx+6,R=(o.fromCx+o.toCx)/2;return(0,u6.jsxs)("g",{opacity:v,children:[(0,u6.jsx)("line",{x1:o.fromCx,y1:o.y,x2:T,y2:o.y,stroke:"var(--archik-edge-filled)",strokeWidth:1.4,strokeDasharray:f?"4 4":void 0,markerEnd:y?void 0:`url(#${w})`}),(0,u6.jsxs)("text",{x:R,y:o.y+V6r,textAnchor:"middle",fontSize:11,fill:"var(--archik-fg)",fontFamily:"inherit",children:[p&&"\xABcreate\xBB ",o.label]}),o.arrow==="destroy"&&(0,u6.jsxs)("g",{transform:`translate(${o.toCx-6}, ${o.y-6})`,children:[(0,u6.jsx)("line",{x1:0,y1:0,x2:12,y2:12,stroke:"var(--archik-fg-muted)",strokeWidth:1.5}),(0,u6.jsx)("line",{x1:12,y1:0,x2:0,y2:12,stroke:"var(--archik-fg-muted)",strokeWidth:1.5})]})]})}var Y9=li(ec(),1),W6r={alt:"#6366f1",opt:"#0ea5e9",loop:"#10b981",par:"#f59e0b",break:"#ef4444",ref:"#8b5cf6"},uln=36,p2t=18;function dln({group:o,renderStep:c,onRefClick:u}){let p=W6r[o.kind]??"var(--archik-fg-muted)",f=o.status==="proposed"?.55:o.status==="deprecated"?.35:1,y=o.kind==="ref"&&o.seqFile!==void 0&&u!==void 0;return(0,Y9.jsxs)("g",{opacity:f,onClick:y?()=>u(o.seqFile):void 0,style:y?{cursor:"pointer"}:void 0,children:[(0,Y9.jsx)("rect",{x:o.x,y:o.y,width:o.width,height:o.height,rx:4,fill:"none",stroke:p,strokeWidth:1.2,opacity:.6}),(0,Y9.jsx)("rect",{x:o.x,y:o.y,width:uln,height:p2t,rx:4,fill:p,opacity:.8}),(0,Y9.jsx)("text",{x:o.x+6,y:o.y+p2t-5,fontSize:10,fontWeight:600,fill:"#fff",fontFamily:"inherit",children:o.kind}),(o.condition??o.label)&&(0,Y9.jsx)("text",{x:o.x+uln+6,y:o.y+p2t-5,fontSize:10,fill:p,fontFamily:"inherit",children:o.condition??o.label}),o.branches.map((w,v)=>(0,Y9.jsxs)("g",{children:[w.label&&(0,Y9.jsx)("text",{x:o.x+6,y:w.startY+12,fontSize:10,fill:p,fontFamily:"inherit",children:w.label}),w.steps.map(_=>c(_)),w.dividerY!==void 0&&(0,Y9.jsx)("line",{x1:o.x,y1:w.dividerY,x2:o.x+o.width,y2:w.dividerY,stroke:p,strokeWidth:1,strokeDasharray:"4 2",opacity:.5})]},v))]})}var RG=li(ec(),1);function J6r(o,c){let u=Math.max(10,Math.floor(c/6.5));if(o.length<=u)return[o];let p=o.split(" "),f=[],y="";for(let w of p)(y+(y?" ":"")+w).length>u&&y?(f.push(y),y=w):y=y?y+" "+w:w;return y&&f.push(y),f.slice(0,3)}function hln({note:o}){let{x:c,y:u,width:p,height:f,text:y}=o,w=o.status==="proposed"?.55:o.status==="deprecated"?.35:1;return(0,RG.jsxs)("g",{opacity:w,children:[(0,RG.jsx)("path",{d:`M ${c} ${u} L ${c+p-10} ${u} L ${c+p} ${u+10} L ${c+p} ${u+f} L ${c} ${u+f} Z`,fill:"var(--archik-node-fill)",stroke:"var(--archik-node-stroke)",strokeWidth:1.2}),(0,RG.jsx)("path",{d:`M ${c+p-10} ${u} L ${c+p-10} ${u+10} L ${c+p} ${u+10}`,fill:"none",stroke:"var(--archik-node-stroke)",strokeWidth:1.2}),J6r(y,p-16).map((v,_)=>(0,RG.jsx)("text",{x:c+8,y:u+8+11+_*13,fontSize:11,fill:"var(--archik-fg)",fontFamily:"inherit",children:v},_))]})}var X0=li(ec(),1);function Z6r({id:o}){return(0,X0.jsx)("marker",{id:o,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,X0.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"context-stroke"})})}function X6r({id:o}){return(0,X0.jsx)("marker",{id:o,viewBox:"0 0 12 12",refX:"11",refY:"6",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:(0,X0.jsx)("path",{d:"M 1 1 L 11 6 L 1 11",fill:"none",stroke:"context-stroke",strokeWidth:"1.5",strokeLinejoin:"round"})})}function pln({step:o,onRefClick:c}){return o.type==="message"?(0,X0.jsx)(lln,{msg:o}):o.type==="note"?(0,X0.jsx)(hln,{note:o}):o.type==="group"?(0,X0.jsx)(dln,{group:o,...c!==void 0?{onRefClick:c}:{},renderStep:u=>(0,X0.jsx)(pln,{step:u,...c!==void 0?{onRefClick:c}:{}},u.id)}):null}function gln({laid:o,svgRef:c,onRefClick:u}){let{participants:p,steps:f,activations:y,totalWidth:w,totalHeight:v}=o;return(0,X0.jsxs)("svg",{ref:c,width:w,height:v,viewBox:`0 0 ${w} ${v}`,xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"var(--archik-font, system-ui)"},children:[(0,X0.jsxs)("defs",{children:[(0,X0.jsx)(Z6r,{id:zye}),(0,X0.jsx)(X6r,{id:$ye})]}),p.map(_=>(0,X0.jsx)(aln,{participant:_},_.id)),p.map(_=>(0,X0.jsx)(cln,{participant:_,..._.kind!==void 0?{nodeKind:_.kind}:{}},_.id)),(0,X0.jsxs)("g",{transform:`translate(0, ${56})`,children:[y.map(_=>(0,X0.jsx)("rect",{x:_.cx-8/2,y:_.startY,width:8,height:_.endY-_.startY,fill:"var(--archik-node-fill)",stroke:"var(--archik-node-stroke)",strokeWidth:1,rx:2},`${_.cx}-${_.startY}`)),f.map(_=>(0,X0.jsx)(pln,{step:_,...u!==void 0?{onRefClick:u}:{}},_.id))]})]})}var HE=li(ec(),1),r0=28;function DG({kind:o,iconAt:c,labelAt:u}){let p=Vm[o],f=p.icon,y=14;return(0,HE.jsxs)(HE.Fragment,{children:[(0,HE.jsx)("g",{transform:`translate(${c.cx-y/2}, ${c.cy-y/2})`,pointerEvents:"none","aria-hidden":"true",children:(0,HE.jsx)(f,{size:y,color:p.color,strokeWidth:1.8})}),(0,HE.jsx)("text",{x:u.cx,y:u.cy,textAnchor:"middle",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:o.toUpperCase()})]})}var UE=li(ec(),1),K6r=24;function yln({node:o,selected:c}){let u=o.width,p=o.height,f=o.stack!==void 0,y=r0+(p-r0)/2,w=f?y-4:y+4,v=y+14,_=Math.max(0,u-K6r),T=n0(o.name,_,7.4),R=f?n0(o.stack,_,5.9):"";return(0,UE.jsxs)("g",{className:`archik-node archik-node--${o.kind}`,children:[(0,UE.jsx)("rect",{className:c?"archik-selected-glow":void 0,width:u,height:p,rx:10,ry:10,fill:"var(--archik-node-fill)",stroke:c?"var(--archik-selected)":"var(--archik-node-stroke)",strokeWidth:c?1.8:1.4}),(0,UE.jsx)("line",{x1:0,y1:r0,x2:u,y2:r0,stroke:"var(--archik-node-stroke)",strokeOpacity:.25,strokeWidth:1}),(0,UE.jsx)(DG,{kind:o.kind,iconAt:{cx:18,cy:r0/2},labelAt:{cx:u/2,cy:r0/2+3}}),(0,UE.jsx)("text",{x:u/2,y:w,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:T}),f&&(0,UE.jsx)("text",{x:u/2,y:v,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:R})]})}var qE=li(ec(),1);function bln({node:o,selected:c}){let u=o.width,p=o.height,f=Math.min(p/2,28),y=o.stack!==void 0,w=r0+(p-r0)/2,v=y?w-4:w+4,_=w+14,T=Math.max(0,u-2*f-8),R=n0(o.name,T,7.4),F=y?n0(o.stack,T,5.9):"",B=c?"var(--archik-selected)":"var(--archik-node-stroke)";return(0,qE.jsxs)("g",{className:"archik-node archik-node--queue",children:[(0,qE.jsx)("rect",{className:c?"archik-selected-glow":void 0,width:u,height:p,rx:f,ry:f,fill:"var(--archik-node-fill)",stroke:B,strokeWidth:c?1.8:1.4}),(0,qE.jsx)("line",{x1:f,y1:r0,x2:u-f,y2:r0,stroke:B,strokeOpacity:.25,strokeWidth:1}),(0,qE.jsx)(DG,{kind:"queue",iconAt:{cx:f+8,cy:r0/2},labelAt:{cx:u/2,cy:r0/2+3}}),(0,qE.jsx)("text",{x:u/2,y:v,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:R}),y&&(0,qE.jsx)("text",{x:u/2,y:_,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:F})]})}var GE=li(ec(),1),Y6r=24;function mln({node:o,selected:c}){let u=o.width,p=o.height,f=o.description!==void 0,y=r0,w=y+(p-y)/2,v=f?w-2:w+4,_=p-12,T=Math.max(0,u-Y6r),R=n0(o.name,T,7.4),F=f?n0(o.description,T,5.9):"",B=c?"var(--archik-selected)":"var(--archik-node-stroke-soft)";return(0,GE.jsxs)("g",{className:`archik-node archik-node--${o.kind}`,children:[(0,GE.jsx)("rect",{className:c?"archik-selected-glow":void 0,width:u,height:p,rx:8,ry:8,fill:"var(--archik-node-fill-tinted)",stroke:B,strokeWidth:c?1.8:1.2,strokeDasharray:c?void 0:"6 4"}),(0,GE.jsx)("line",{x1:6,y1:r0,x2:u-6,y2:r0,stroke:B,strokeOpacity:.25,strokeWidth:1}),(0,GE.jsx)(DG,{kind:o.kind,iconAt:{cx:18,cy:r0/2},labelAt:{cx:u/2,cy:r0/2+3}}),(0,GE.jsx)("text",{x:u/2,y:v,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:R}),f&&(0,GE.jsx)("text",{x:u/2,y:_,textAnchor:"middle",fontSize:10,fill:"var(--archik-node-text-dim)",children:F})]})}var d6=li(ec(),1),Q6r=28,g2t=10,e8r=22;function wln({node:o,selected:c}){let u=o.width,p=o.height,f=u/2,y=g2t,w=Vm[o.kind],v=w.icon,_=c?"var(--archik-selected)":"var(--archik-node-stroke)",T=c?1.8:1.4,R=o.stack!==void 0,F=Math.max(0,u-Q6r),B=n0(o.name,F,7.4),V=R?n0(o.stack,F,5.9):"",se=p,ee=se-e8r,ce=(ee+se)/2,ut=(y+8+ee)/2,Se=R?ut-4:ut+4,Be=ut+14;return(0,d6.jsxs)("g",{className:"archik-node archik-node--database",children:[(0,d6.jsx)("path",{className:c?"archik-selected-glow":void 0,d:y2t(u,p,y),fill:"var(--archik-node-fill)",stroke:_,strokeWidth:T,strokeLinejoin:"round"}),(0,d6.jsx)("ellipse",{cx:f,cy:y,rx:u/2,ry:y,fill:"var(--archik-node-fill)",stroke:_,strokeWidth:T}),(0,d6.jsx)("text",{x:f,y:Se,textAnchor:"middle",fontSize:14,fontWeight:600,fill:"var(--archik-node-text)",children:B}),R&&(0,d6.jsx)("text",{x:f,y:Be,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:V}),(0,d6.jsx)("line",{x1:4,y1:ee,x2:u-4,y2:ee,stroke:_,strokeOpacity:.45,strokeWidth:1}),(0,d6.jsx)("g",{transform:`translate(14, ${ce-7})`,pointerEvents:"none","aria-hidden":"true",children:(0,d6.jsx)(v,{size:14,color:w.color,strokeWidth:1.9})}),(0,d6.jsx)("text",{x:f,y:ce+4,textAnchor:"middle",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:o.kind.toUpperCase()})]})}var t8r=10;function y2t(o,c,u){let p=t8r;return[`M 0 ${u}`,`L 0 ${c-p}`,`A ${p} ${p} 0 0 0 ${p} ${c}`,`L ${o-p} ${c}`,`A ${p} ${p} 0 0 0 ${o} ${c-p}`,`L ${o} ${u}`,`A ${o/2} ${u} 0 0 0 0 ${u}`,"Z"].join(" ")}var bS=li(ec(),1),n8r=36,vln=18;function kln({node:o,selected:c}){let u=o.width,p=o.height,f=Vm[o.kind],y=f.icon,w=c?"var(--archik-selected)":"var(--archik-node-stroke)",v=c?1.8:1.4,_=o.stack!==void 0,T=Math.max(0,u-n8r),R=n0(o.name,T,7.4),F=_?n0(o.stack,T,5.9):"",B=u/2,V=p*.55,se=_?V-4:V+4,ee=V+14;return(0,bS.jsxs)("g",{className:"archik-node archik-node--cloud",children:[(0,bS.jsx)("path",{className:c?"archik-selected-glow":void 0,d:r8r(u,p),fill:"var(--archik-node-fill)",stroke:w,strokeWidth:v,strokeLinejoin:"round"}),(0,bS.jsx)("g",{transform:`translate(18, ${vln-6})`,pointerEvents:"none","aria-hidden":"true",children:(0,bS.jsx)(y,{size:14,color:f.color,strokeWidth:1.9})}),(0,bS.jsx)("text",{x:B,y:vln+4,textAnchor:"middle",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:o.kind.toUpperCase()}),(0,bS.jsx)("text",{x:B,y:se,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:R}),_&&(0,bS.jsx)("text",{x:B,y:ee,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:F})]})}function r8r(o,c){let p=c-2,f=c*.62,y=Math.min(c*.18,14),w=o-4,v=c*.5,_=Math.min(w*.15,v*.85),T=Math.min(w*.18,v),R=Math.min(w*.15,v*.85),F=2*(_+T+R),B=Math.max(0,w-F)/4,V=2,se=o-2,ee=V+B,ce=ee+2*_,ge=ce+B,Oe=ge+2*T,ut=Oe+B,Se=ut+2*R;return[`M ${V} ${p-y}`,`Q ${V} ${p} ${V+y} ${p}`,`L ${se-y} ${p}`,`Q ${se} ${p} ${se} ${p-y}`,`L ${se} ${f}`,`L ${Se} ${f}`,`A ${R} ${R} 0 0 0 ${ut} ${f}`,`L ${Oe} ${f}`,`A ${T} ${T} 0 0 0 ${ge} ${f}`,`L ${ce} ${f}`,`A ${_} ${_} 0 0 0 ${ee} ${f}`,`L ${V} ${f}`,"Z"].join(" ")}var hb=li(ec(),1),OG=32,KOe=14,b2t=14;function Mln({node:o,selected:c,depth:u=0}){let p=o.width,f=o.height;if(!(o.children.length>0))return(0,hb.jsx)(o8r,{node:o,selected:!!c});let w=Vm[o.kind],v=w.icon,_=Math.min(.04+u*.06,.22),T=Math.min(.55+u*.12,.95),R=c?"var(--archik-selected)":"var(--archik-container-border)",F=c?1.8:1.2,B=Math.max(0,p-KOe*2-60),V=n0(o.name,B,7.4);return(0,hb.jsxs)("g",{className:`archik-node archik-node--${o.kind} archik-node--container`,children:[(0,hb.jsx)("rect",{className:c?"archik-selected-glow":void 0,width:p,height:f,rx:8,ry:8,fill:w.color,fillOpacity:_,stroke:R,strokeWidth:F,pointerEvents:"none"}),u>=1&&p>8&&f>8&&(0,hb.jsx)("rect",{x:3,y:3,width:p-6,height:f-6,rx:6,ry:6,fill:"none",stroke:w.color,strokeOpacity:Math.min(.18+(u-1)*.06,.32),strokeWidth:1,pointerEvents:"none"}),(0,hb.jsx)("path",{d:i8r(p,OG,8),fill:w.color,fillOpacity:T*.18}),(0,hb.jsx)("line",{x1:0,y1:OG,x2:p,y2:OG,stroke:R,strokeOpacity:.45,strokeWidth:1}),(0,hb.jsx)("g",{transform:`translate(${KOe}, ${OG/2-b2t/2})`,pointerEvents:"none","aria-hidden":"true",children:(0,hb.jsx)(v,{size:b2t,color:w.color,strokeWidth:1.9})}),(0,hb.jsx)("text",{x:KOe+b2t+8,y:OG/2+4,fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:V}),(0,hb.jsx)("text",{x:p-KOe,y:OG/2+3,textAnchor:"end",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:o.kind.toUpperCase()})]})}function i8r(o,c,u){return`M ${u} 0 H ${o-u} A ${u} ${u} 0 0 1 ${o} ${u} V ${c} H 0 V ${u} A ${u} ${u} 0 0 1 ${u} 0 Z`}function o8r({node:o,selected:c}){let u=o.width,p=o.height,f=Vm[o.kind],y=c?"var(--archik-selected)":"var(--archik-node-stroke-soft)";return(0,hb.jsxs)("g",{className:`archik-node archik-node--${o.kind}`,children:[(0,hb.jsx)("rect",{className:c?"archik-selected-glow":void 0,width:u,height:p,rx:8,ry:8,fill:"var(--archik-node-fill-tinted)",stroke:y,strokeWidth:c?1.8:1.2,strokeDasharray:c?void 0:"5 4"}),(0,hb.jsx)("text",{x:u/2,y:p/2+4,textAnchor:"middle",fontSize:12,fontWeight:600,fill:f.color,children:o.name})]})}var fb=li(ec(),1),une=24,xln=10,m2t=28;function Sln({node:o,selected:c,depth:u=0}){let p=o.width,f=o.height,y=Vm[o.kind],w=y.icon,v=o.kind==="external";if(o.children.length>0)return(0,fb.jsx)(c8r,{node:o,selected:!!c,depth:u});let _=c?"var(--archik-selected)":v?"var(--archik-node-stroke-soft)":"var(--archik-node-stroke)",T=v?"var(--archik-node-fill-tinted)":"var(--archik-node-fill)",R=o.kind==="queue"?Math.min(f/2,18):8;return(0,fb.jsxs)("g",{className:`archik-node archik-node--${o.kind} archik-node--compact`,children:[(0,fb.jsx)("rect",{className:c?"archik-selected-glow":void 0,width:p,height:f,rx:R,ry:R,fill:T,stroke:_,strokeWidth:c?1.8:1.4,strokeDasharray:v&&!c?"5 4":void 0}),(0,fb.jsx)("g",{transform:`translate(${xln}, ${f/2-7})`,pointerEvents:"none","aria-hidden":"true",children:(0,fb.jsx)(w,{size:13,color:y.color,strokeWidth:1.9})}),(0,fb.jsx)("text",{x:m2t,y:f/2+4,fontSize:12,fontWeight:600,fill:"var(--archik-node-text)",children:n0(o.name,Math.max(0,p-m2t-8),5.9)})]})}function c8r({node:o,selected:c,depth:u}){let p=o.width,f=o.height,y=Vm[o.kind],w=y.icon,v=Math.min(.04+u*.035,.14),_=Math.min(.55+u*.08,.85),T=c?"var(--archik-selected)":"var(--archik-container-border)",R=Math.max(0,p-12-22),F=n0(o.name,R,5.9);return(0,fb.jsxs)("g",{className:`archik-node archik-node--${o.kind} archik-node--compact archik-node--container`,children:[(0,fb.jsx)("rect",{className:c?"archik-selected-glow":void 0,width:p,height:f,rx:6,ry:6,fill:y.color,fillOpacity:v,stroke:T,strokeWidth:c?1.8:1.2}),(0,fb.jsx)("path",{d:a8r(p,une,6),fill:y.color,fillOpacity:_*.18}),(0,fb.jsx)("line",{x1:0,y1:une,x2:p,y2:une,stroke:T,strokeOpacity:.45,strokeWidth:1}),(0,fb.jsx)("g",{transform:`translate(${xln}, ${une/2-6})`,pointerEvents:"none","aria-hidden":"true",children:(0,fb.jsx)(w,{size:12,color:y.color,strokeWidth:1.9})}),(0,fb.jsx)("text",{x:m2t,y:une/2+4,fontSize:12,fontWeight:600,fill:"var(--archik-node-text)",children:F})]})}function a8r(o,c,u){return`M ${u} 0 H ${o-u} A ${u} ${u} 0 0 1 ${o} ${u} V ${c} H 0 V ${u} A ${u} ${u} 0 0 1 ${u} 0 Z`}var Q9=li(u2t(),1),Cd=li(ec(),1),s8r=12,l8r=18;function _ln({Icon:o,cx:c,cy:u,size:p=s8r,color:f,strokeWidth:y=1.8}){return(0,Cd.jsx)("g",{transform:`translate(${c-p/2}, ${u-p/2})`,pointerEvents:"none","aria-hidden":"true",children:(0,Cd.jsx)(o,{size:p,color:f??"var(--archik-fg-dim)",strokeWidth:y})})}function Cln(o){return(0,Cd.jsx)(_ln,{Icon:Q9.Info,...o})}function Iln(o){return(0,Cd.jsx)(_ln,{Icon:Q9.StickyNote,...o})}function Eln({cx:o,cy:c,filePath:u,fileLabel:p,onClick:f,size:y=13}){return(0,Cd.jsxs)("g",{transform:`translate(${o-y/2}, ${c-y/2})`,style:{cursor:f?"pointer":"default"},onClick:f,children:[(0,Cd.jsx)("title",{children:`Cross-file edge \u2192 ${p} (${u})`}),(0,Cd.jsx)("circle",{cx:y/2,cy:y/2,r:y/2+.5,fill:"var(--archik-fg-dim)",fillOpacity:.12,stroke:"var(--archik-fg-dim)",strokeOpacity:.4,strokeWidth:1}),(0,Cd.jsx)("g",{transform:"translate(1, 1)",pointerEvents:"none",children:(0,Cd.jsx)(Q9.ArrowUpRight,{size:y-2,color:"var(--archik-fg-muted)",strokeWidth:2.2})})]})}function Pln({cx:o,cy:c,onClick:u,size:p=14}){return(0,Cd.jsxs)("g",{transform:`translate(${o-p/2}, ${c-p/2})`,style:{cursor:u?"pointer":"default"},onClick:u,children:[(0,Cd.jsx)("title",{children:"Open sub-architecture"}),(0,Cd.jsx)("circle",{cx:p/2,cy:p/2,r:p/2+.5,fill:"var(--archik-accent)",fillOpacity:.16,stroke:"var(--archik-accent)",strokeOpacity:.45,strokeWidth:1}),(0,Cd.jsx)("g",{transform:"translate(1, 1)",pointerEvents:"none",children:(0,Cd.jsx)(Q9.ChevronDown,{size:p-2,color:"var(--archik-accent)",strokeWidth:2.2})})]})}function Lln({cx:o,cy:c,files:u,count:p,size:f=14}){let y=u.length===1?`Open sequence diagram \u2192 ${u[0].label} (${u[0].path})`:`${u.length} sequence diagrams on this node:
|
|
519
519
|
`+u.map(w=>` \u2022 ${w.label}`).join(`
|
|
520
520
|
`)+`
|
|
521
|
-
Click to open the first; the rest live in the inspector.`;return(0,Cd.jsxs)("g",{transform:`translate(${o-f/2}, ${c-f/2})`,style:{cursor:"pointer"},children:[(0,Cd.jsx)("title",{children:y}),(0,Cd.jsx)("circle",{cx:f/2,cy:f/2,r:f/2+.5,fill:"var(--archik-status-proposed)",fillOpacity:.16,stroke:"var(--archik-status-proposed)",strokeOpacity:.5,strokeWidth:1}),(0,Cd.jsx)("g",{transform:"translate(1, 1)",pointerEvents:"none",children:(0,Cd.jsx)(Q9.GitBranch,{size:f-2,color:"var(--archik-status-proposed)",strokeWidth:2.2})}),p!==void 0&&p>1&&(0,Cd.jsxs)("g",{pointerEvents:"none",children:[(0,Cd.jsx)("circle",{cx:f/2,cy:-3,r:5.5,fill:"var(--archik-canvas)"}),(0,Cd.jsx)("circle",{cx:f/2,cy:-3,r:4.5,fill:"var(--archik-status-proposed)"}),(0,Cd.jsx)("text",{x:f/2,y:-.5,fontSize:7.5,fontWeight:700,fill:"#ffffff",textAnchor:"middle",children:p})]})]})}function Tln(o,c,u,p=!1){if(p)return{right:{x:c-14,y:42}};switch(o){case"queue":{let y=Math.min(u/2,28);return{right:{x:c-y-4,y:14}}}case"database":return{right:{x:c-14,y:u-11}};case"module":case"custom":return{right:{x:c-14,y:42}};default:return{right:{x:c-14,y:14}}}}function Aln(o,c){return Array.from({length:c},(u,p)=>({x:o.x-p*l8r,y:o.y}))}var hl=li(ec(),1);function u8r({node:o,selected:c,viewMode:u,depth:p}){if(u==="compact")return(0,hl.jsx)(Sln,{node:o,selected:c,depth:p});if(o.children.length>0)return(0,hl.jsx)(Mln,{node:o,selected:c,depth:p});switch(o.kind){case"queue":return(0,hl.jsx)(bln,{node:o,selected:c});case"external":case"human":return(0,hl.jsx)(mln,{node:o,selected:c});case"database":return(0,hl.jsx)(wln,{node:o,selected:c});case"cloud":return(0,hl.jsx)(kln,{node:o,selected:c});case"module":case"custom":case"service":case"function":case"worker":case"agent":case"cache":case"vectordb":case"storage":case"model":case"dto":case"dataobject":case"topic":case"stream":case"gateway":case"cdn":case"route":case"interface":case"adapter":case"port":case"llm":case"prompt":case"tool":case"auth":case"observability":case"frontend":case"page":case"component":case"store":case"hook":return(0,hl.jsx)(yln,{node:o,selected:c});default:{let f=o.kind;throw new Error("unreachable node kind")}}}function w2t({node:o,selectedNodeIds:c,glowNodeIds:u,onSelectNode:p,onOpenSubFile:f,onCrossFileNavigate:y,crossFileByNode:w,viewMode:v="detailed",depth:_=0,showStereotypeBands:T=!0}){let R=c?.has(o.id)??!1,F=u?.has(o.id)??!1,B=o.children.length>0,V=B?_+1:_,se=p?ce=>{ce.stopPropagation(),p(o.id,ce)}:void 0,ee=o.description!==void 0&&o.description.length>0;return(0,hl.jsxs)("g",{"data-archik-node-id":o.id,...R?{"data-archik-selected":"true"}:{},...o.status!==void 0&&o.status!=="active"?{"data-archik-status":o.status}:{},...o.stereotype!==void 0?{"data-archik-stereotype":o.stereotype}:{},transform:`translate(${o.x}, ${o.y})`,...se!==void 0?{onClick:se}:{},style:p?{cursor:"pointer"}:void 0,children:[F&&(0,hl.jsx)("rect",{x:-4,y:-4,width:o.width+8,height:o.height+8,rx:10,fill:"none",stroke:"var(--archik-status-proposed)",strokeWidth:2,opacity:.85,style:{pointerEvents:"none"}}),(0,hl.jsx)(u8r,{node:o,selected:R,viewMode:v,depth:_}),o.stereotype!==void 0&&T&&(0,hl.jsxs)(hl.Fragment,{children:[(0,hl.jsx)("clipPath",{id:`archik-nclip-${o.id}`,children:o.kind==="database"?(0,hl.jsx)("path",{d:y2t(o.width,o.height,g2t)}):(0,hl.jsx)("rect",{width:o.width,height:o.height,rx:8,ry:8})}),(0,hl.jsx)("rect",{className:"archik-stereotype-band",x:0,y:0,width:o.width,height:4,clipPath:`url(#archik-nclip-${o.id})`,style:{pointerEvents:"none"}})]}),v==="detailed"&&(()=>{let ce=o.notes!==void 0&&o.notes.length>0,ge=o.archikFile!==void 0&&o.archikFile.length>0,Oe=w?.get(o.id),ut=Oe?Array.from(Oe).sort():[],Se=o.seqFiles??[],Be=[];ge&&Be.push("subarch"),Se.length>0&&Be.push({type:"seq",paths:Se});for(let Gt of ut)Be.push({type:"crossfile",path:Gt});if(ee&&Be.push("info"),ce&&Be.push("notes"),Be.length===0)return null;let Ue=Tln(o.kind,o.width,o.height,B),on=Aln(Ue.right,Be.length);return(0,hl.jsx)(hl.Fragment,{children:Be.map((Gt,xn)=>{let Vn=on[xn];if(typeof Gt=="object"&&Gt.type==="seq"){let tn=Gt.paths.map(Nr=>({path:Nr,label:Nr.split("/").pop().replace(/\.archik\.seq\.yaml$/,"")})),cn=`/__archik/seq?path=${encodeURIComponent(tn[0].path)}`;return(0,hl.jsx)("a",{href:cn,onClick:Nr=>Nr.stopPropagation(),children:(0,hl.jsx)(Lln,{cx:Vn.x,cy:Vn.y,files:tn,count:tn.length})},"seq")}if(typeof Gt=="object"&&Gt.type==="crossfile"){let tn=Gt.path,cn=tn.split("/").pop().replace(/\.archik\.yaml$/,""),Nr=y??f,oi=Nr?wo=>{wo.stopPropagation(),Nr(tn,cn)}:void 0;return(0,hl.jsx)(Eln,{cx:Vn.x,cy:Vn.y,filePath:tn,fileLabel:cn,...oi?{onClick:oi}:{}},`xf-${tn}`)}if(Gt==="subarch"){let tn=o.archikFile,cn=f?Nr=>{Nr.stopPropagation(),f(tn,o.name)}:void 0;return(0,hl.jsx)(Pln,{cx:Vn.x,cy:Vn.y,...cn?{onClick:cn}:{}},"subarch")}return Gt==="info"?(0,hl.jsx)(Cln,{cx:Vn.x,cy:Vn.y,color:"var(--archik-node-caption)"},"info"):(0,hl.jsxs)("g",{children:[(0,hl.jsx)(Iln,{cx:Vn.x,cy:Vn.y,color:"var(--archik-node-caption)"}),o.notes&&o.notes.length>1&&(0,hl.jsx)("text",{x:Vn.x+7,y:Vn.y-5,fontSize:8,fontWeight:700,fill:"var(--archik-accent)",textAnchor:"middle",pointerEvents:"none",children:o.notes.length})]},"notes")})})})(),o.children.map(ce=>(0,hl.jsx)(w2t,{node:ce,viewMode:v,depth:V,showStereotypeBands:T,...c!==void 0?{selectedNodeIds:c}:{},...u!==void 0?{glowNodeIds:u}:{},...p!==void 0?{onSelectNode:p}:{},...f!==void 0?{onOpenSubFile:f}:{},...y!==void 0?{onCrossFileNavigate:y}:{},...w!==void 0?{crossFileByNode:w}:{}},ce.id))]})}var h6=li(ec(),1),Wm="archik-arrow-filled",Yz="archik-arrow-open",YOe="archik-arrow-selected",dne="archik-arrow-triangle",QOe="archik-arrow-diamond";function Nln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"context-stroke"})})}function Rln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 12 12",refX:"11",refY:"6",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 1 1 L 11 6 L 1 11",fill:"none",stroke:"context-stroke",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})})}function Dln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--archik-selected)"})})}function Oln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 14 14",refX:"13",refY:"7",markerWidth:"9",markerHeight:"9",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 1 1 L 13 7 L 1 13 z",fill:"var(--archik-panel)",stroke:"context-stroke",strokeWidth:"1.5",strokeLinejoin:"round"})})}function Fln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 14 10",refX:"1",refY:"5",markerWidth:"9",markerHeight:"7",orient:"auto",children:(0,h6.jsx)("path",{d:"M 1 5 L 7 1 L 13 5 L 7 9 z",fill:"context-stroke"})})}var Qz=li(ec(),1),f6="var(--archik-edge-filled)",hne="var(--archik-edge-dim)",d8r={http_call:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},grpc:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},invokes:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},routes_to:{stroke:f6,strokeWidth:1.4,markerId:Wm},websocket:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm,markerStartId:Wm},webhook:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},reads:{stroke:f6,strokeWidth:1.4,markerId:Yz},writes:{stroke:f6,strokeWidth:1.4,markerId:Wm},publishes:{stroke:f6,strokeWidth:1.4,markerId:Wm},subscribes:{stroke:f6,strokeWidth:1.4,markerId:Wm},streams_to:{stroke:f6,strokeWidth:1.4,markerId:Wm},implements:{stroke:hne,strokeWidth:1.2,strokeDasharray:"7 5",markerId:dne},extends:{stroke:hne,strokeWidth:1.2,markerId:dne},depends_on:{stroke:hne,strokeWidth:1.2,strokeDasharray:"7 5",markerId:Yz},has_a:{stroke:hne,strokeWidth:1.2,markerId:Yz,markerStartId:QOe},uses:{stroke:hne,strokeWidth:1.2,markerId:Yz}};function zln(o){return o.map(c=>`${c.x},${c.y}`).join(" ")}function h8r(o){if(o.length===0)return;let c=Math.floor(o.length/2);if(o.length%2===1)return o[c];let u=o[c-1],p=o[c];return{x:(u.x+p.x)/2,y:(u.y+p.y)/2}}function $ln({edge:o,selectedEdgeIds:c,onSelectEdge:u}){let p=o.sections[0];if(!p)return null;let f=[p.startPoint,...p.bendPoints,p.endPoint],y=d8r[o.relationship],w=o.labels[0],v=w?{x:w.x+w.width/2,y:w.y+w.height/2}:h8r(f),_=c?.has(o.id)??!1,T=o.status==="proposed"?"var(--archik-status-proposed)":o.status==="deprecated"?"var(--archik-status-deprecated)":void 0,R=_?"var(--archik-selected)":T??o.color??y.stroke,F=_?y.strokeWidth+.5:y.strokeWidth,B=_?YOe:y.markerId,V=!_&&y.markerStartId!==void 0?y.markerStartId:void 0,se=!_&&y.animated?"archik-edge-flowing":void 0,ee=y.strokeDasharray!==void 0?y.strokeDasharray.trim().split(/\s+/).reduce((Oe,ut)=>Oe+Number(ut),0):0,ce=se!==void 0&&ee>0?{"--archik-dash-period":String(ee)}:void 0,ge=u?Oe=>{Oe.stopPropagation(),u(o.id,Oe)}:void 0;return(0,Qz.jsxs)("g",{"data-archik-edge-id":o.id,"data-archik-edge-relationship":o.relationship,..._?{"data-archik-selected":"true"}:{},...o.status!==void 0&&o.status!=="active"?{"data-archik-status":o.status}:{},className:`archik-edge archik-edge--${o.relationship}`,...ge!==void 0?{onClick:ge}:{},style:u?{cursor:"pointer"}:void 0,children:[u&&(0,Qz.jsx)("polyline",{"data-archik-edge-hitarea":"",points:zln(f),fill:"none",stroke:"transparent",strokeWidth:14,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Qz.jsx)("polyline",{className:se,points:zln(f),fill:"none",stroke:R,strokeWidth:F,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:`url(#${B})`,...V!==void 0?{markerStart:`url(#${V})`}:{},...y.strokeDasharray!==void 0?{strokeDasharray:y.strokeDasharray}:{},...ce!==void 0?{style:ce}:{}}),o.label!==void 0&&v!==void 0&&(0,Qz.jsx)("g",{transform:`translate(${v.x}, ${w?v.y+4:v.y-6})`,children:(0,Qz.jsx)("text",{textAnchor:"middle",fontSize:11,fontWeight:_?700:500,fill:_?"var(--archik-selected)":"var(--archik-fg-dim)",stroke:"var(--archik-panel)",strokeWidth:_?4:3,paintOrder:"stroke",children:o.label})})]})}var pb=li(ec(),1);var v2t={added:"var(--archik-success)",removed:"var(--archik-danger)",changed:"var(--archik-warning)"};function f8r(o){let c=[],u=(p,f,y)=>{for(let w of p){let v=f+w.x,_=y+w.y;c.push({...w,absX:v,absY:_}),w.children.length>0&&u(w.children,v,_)}};return u(o,0,0),c}function p8r(o){return o.replace(/[^a-z0-9-]/g,c=>`\\${c}`)}function Hln({statuses:o,scopeClass:c}){let u=[];for(let[f,y]of o.nodes)y==="removed"&&u.push(f);if(u.length===0)return null;let p=u.map(f=>`.${c} [data-archik-node-id="${p8r(f)}"] { opacity: 0.35; }`).join(`
|
|
521
|
+
Click to open the first; the rest live in the inspector.`;return(0,Cd.jsxs)("g",{transform:`translate(${o-f/2}, ${c-f/2})`,style:{cursor:"pointer"},children:[(0,Cd.jsx)("title",{children:y}),(0,Cd.jsx)("circle",{cx:f/2,cy:f/2,r:f/2+.5,fill:"var(--archik-status-proposed)",fillOpacity:.16,stroke:"var(--archik-status-proposed)",strokeOpacity:.5,strokeWidth:1}),(0,Cd.jsx)("g",{transform:"translate(1, 1)",pointerEvents:"none",children:(0,Cd.jsx)(Q9.GitBranch,{size:f-2,color:"var(--archik-status-proposed)",strokeWidth:2.2})}),p!==void 0&&p>1&&(0,Cd.jsxs)("g",{pointerEvents:"none",children:[(0,Cd.jsx)("circle",{cx:f/2,cy:-3,r:5.5,fill:"var(--archik-canvas)"}),(0,Cd.jsx)("circle",{cx:f/2,cy:-3,r:4.5,fill:"var(--archik-status-proposed)"}),(0,Cd.jsx)("text",{x:f/2,y:-.5,fontSize:7.5,fontWeight:700,fill:"#ffffff",textAnchor:"middle",children:p})]})]})}function Tln(o,c,u,p=!1){if(p)return{right:{x:c-14,y:42}};switch(o){case"queue":{let y=Math.min(u/2,28);return{right:{x:c-y-4,y:14}}}case"database":return{right:{x:c-14,y:u-11}};case"module":case"custom":return{right:{x:c-14,y:42}};default:return{right:{x:c-14,y:14}}}}function Aln(o,c){return Array.from({length:c},(u,p)=>({x:o.x-p*l8r,y:o.y}))}var hl=li(ec(),1);function u8r({node:o,selected:c,viewMode:u,depth:p}){if(u==="compact")return(0,hl.jsx)(Sln,{node:o,selected:c,depth:p});if(o.children.length>0)return(0,hl.jsx)(Mln,{node:o,selected:c,depth:p});switch(o.kind){case"queue":return(0,hl.jsx)(bln,{node:o,selected:c});case"external":case"human":return(0,hl.jsx)(mln,{node:o,selected:c});case"database":return(0,hl.jsx)(wln,{node:o,selected:c});case"cloud":return(0,hl.jsx)(kln,{node:o,selected:c});case"module":case"custom":case"service":case"function":case"worker":case"agent":case"cache":case"vectordb":case"storage":case"model":case"dto":case"dataobject":case"topic":case"stream":case"gateway":case"cdn":case"route":case"interface":case"adapter":case"port":case"llm":case"prompt":case"tool":case"auth":case"observability":case"frontend":case"page":case"component":case"store":case"hook":return(0,hl.jsx)(yln,{node:o,selected:c});default:{let f=o.kind;throw new Error("unreachable node kind")}}}function w2t({node:o,selectedNodeIds:c,glowNodeIds:u,onSelectNode:p,onOpenSubFile:f,onCrossFileNavigate:y,crossFileByNode:w,viewMode:v="detailed",depth:_=0,showStereotypeBands:T=!0}){let R=c?.has(o.id)??!1,F=u?.has(o.id)??!1,B=o.children.length>0,V=B?_+1:_,se=p?ce=>{ce.stopPropagation(),p(o.id,ce)}:void 0,ee=o.description!==void 0&&o.description.length>0;return(0,hl.jsxs)("g",{"data-archik-node-id":o.id,...R?{"data-archik-selected":"true"}:{},...o.status!==void 0&&o.status!=="active"?{"data-archik-status":o.status}:{},...o.stereotype!==void 0?{"data-archik-stereotype":o.stereotype}:{},transform:`translate(${o.x}, ${o.y})`,...se!==void 0?{onClick:se}:{},style:p?{cursor:"pointer"}:void 0,children:[F&&(0,hl.jsx)("rect",{x:-4,y:-4,width:o.width+8,height:o.height+8,rx:10,fill:"none",stroke:"var(--archik-status-proposed)",strokeWidth:2,opacity:.85,style:{pointerEvents:"none"}}),(0,hl.jsx)(u8r,{node:o,selected:R,viewMode:v,depth:_}),o.stereotype!==void 0&&T&&(0,hl.jsxs)(hl.Fragment,{children:[(0,hl.jsx)("clipPath",{id:`archik-nclip-${o.id}`,children:o.kind==="database"?(0,hl.jsx)("path",{d:y2t(o.width,o.height,g2t)}):(0,hl.jsx)("rect",{width:o.width,height:o.height,rx:8,ry:8})}),(0,hl.jsx)("rect",{className:"archik-stereotype-band",x:0,y:0,width:o.width,height:4,clipPath:`url(#archik-nclip-${o.id})`,style:{pointerEvents:"none"}})]}),v==="detailed"&&(()=>{let ce=o.notes!==void 0&&o.notes.length>0,ge=o.archikFile!==void 0&&o.archikFile.length>0,Oe=w?.get(o.id),ut=Oe?Array.from(Oe).sort():[],Se=o.seqFiles??[],Be=[];ge&&Be.push("subarch"),Se.length>0&&Be.push({type:"seq",paths:Se});for(let Gt of ut)Be.push({type:"crossfile",path:Gt});if(ee&&Be.push("info"),ce&&Be.push("notes"),Be.length===0)return null;let Ue=Tln(o.kind,o.width,o.height,B),on=Aln(Ue.right,Be.length);return(0,hl.jsx)(hl.Fragment,{children:Be.map((Gt,xn)=>{let Vn=on[xn];if(typeof Gt=="object"&&Gt.type==="seq"){let tn=Gt.paths.map(Nr=>({path:Nr,label:Nr.split("/").pop().replace(/\.archik\.seq\.yaml$/,"")})),cn=`/__archik/seq?path=${encodeURIComponent(tn[0].path)}`;return(0,hl.jsx)("a",{href:cn,onClick:Nr=>Nr.stopPropagation(),children:(0,hl.jsx)(Lln,{cx:Vn.x,cy:Vn.y,files:tn,count:tn.length})},"seq")}if(typeof Gt=="object"&&Gt.type==="crossfile"){let tn=Gt.path,cn=tn.split("/").pop().replace(/\.archik\.yaml$/,""),Nr=y??f,oi=Nr?wo=>{wo.stopPropagation(),Nr(tn,cn)}:void 0;return(0,hl.jsx)(Eln,{cx:Vn.x,cy:Vn.y,filePath:tn,fileLabel:cn,...oi?{onClick:oi}:{}},`xf-${tn}`)}if(Gt==="subarch"){let tn=o.archikFile,cn=f?Nr=>{Nr.stopPropagation(),f(tn,o.name)}:void 0;return(0,hl.jsx)(Pln,{cx:Vn.x,cy:Vn.y,...cn?{onClick:cn}:{}},"subarch")}return Gt==="info"?(0,hl.jsx)(Cln,{cx:Vn.x,cy:Vn.y,color:"var(--archik-node-caption)"},"info"):(0,hl.jsxs)("g",{children:[(0,hl.jsx)(Iln,{cx:Vn.x,cy:Vn.y,color:"var(--archik-node-caption)"}),o.notes&&o.notes.length>1&&(0,hl.jsx)("text",{x:Vn.x+7,y:Vn.y-5,fontSize:8,fontWeight:700,fill:"var(--archik-accent)",textAnchor:"middle",pointerEvents:"none",children:o.notes.length})]},"notes")})})})(),o.children.map(ce=>(0,hl.jsx)(w2t,{node:ce,viewMode:v,depth:V,showStereotypeBands:T,...c!==void 0?{selectedNodeIds:c}:{},...u!==void 0?{glowNodeIds:u}:{},...p!==void 0?{onSelectNode:p}:{},...f!==void 0?{onOpenSubFile:f}:{},...y!==void 0?{onCrossFileNavigate:y}:{},...w!==void 0?{crossFileByNode:w}:{}},ce.id))]})}var h6=li(ec(),1),Wm="archik-arrow-filled",Yz="archik-arrow-open",YOe="archik-arrow-selected",dne="archik-arrow-triangle",QOe="archik-arrow-diamond";function Nln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"context-stroke"})})}function Rln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 12 12",refX:"11",refY:"6",markerWidth:"9",markerHeight:"9",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 1 1 L 11 6 L 1 11",fill:"none",stroke:"context-stroke",strokeWidth:"1.8",strokeLinejoin:"round",strokeLinecap:"round"})})}function Dln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--archik-selected)"})})}function Oln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 14 14",refX:"13",refY:"7",markerWidth:"12",markerHeight:"12",orient:"auto-start-reverse",children:(0,h6.jsx)("path",{d:"M 1 1 L 13 7 L 1 13 z",fill:"var(--archik-panel)",stroke:"context-stroke",strokeWidth:"2",strokeLinejoin:"round"})})}function Fln({id:o}){return(0,h6.jsx)("marker",{id:o,viewBox:"0 0 14 10",refX:"1",refY:"5",markerWidth:"12",markerHeight:"9",orient:"auto",children:(0,h6.jsx)("path",{d:"M 1 5 L 7 1 L 13 5 L 7 9 z",fill:"context-stroke"})})}var Qz=li(ec(),1),f6="var(--archik-edge-filled)",hne="var(--archik-edge-dim)",d8r={http_call:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},grpc:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},invokes:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},routes_to:{stroke:f6,strokeWidth:1.4,markerId:Wm},websocket:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm,markerStartId:Wm},webhook:{stroke:f6,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Wm},reads:{stroke:f6,strokeWidth:1.4,markerId:Yz},writes:{stroke:f6,strokeWidth:1.4,markerId:Wm},publishes:{stroke:f6,strokeWidth:1.4,markerId:Wm},subscribes:{stroke:f6,strokeWidth:1.4,markerId:Wm},streams_to:{stroke:f6,strokeWidth:1.4,markerId:Wm},implements:{stroke:hne,strokeWidth:1.2,strokeDasharray:"7 5",markerId:dne},extends:{stroke:hne,strokeWidth:1.2,markerId:dne},depends_on:{stroke:hne,strokeWidth:1.2,strokeDasharray:"7 5",markerId:Yz},has_a:{stroke:hne,strokeWidth:1.2,markerId:Yz,markerStartId:QOe},uses:{stroke:hne,strokeWidth:1.2,markerId:Yz}};function zln(o){return o.map(c=>`${c.x},${c.y}`).join(" ")}function h8r(o){if(o.length===0)return;let c=Math.floor(o.length/2);if(o.length%2===1)return o[c];let u=o[c-1],p=o[c];return{x:(u.x+p.x)/2,y:(u.y+p.y)/2}}function $ln({edge:o,selectedEdgeIds:c,onSelectEdge:u}){let p=o.sections[0];if(!p)return null;let f=[p.startPoint,...p.bendPoints,p.endPoint],y=d8r[o.relationship],w=o.labels[0],v=w?{x:w.x+w.width/2,y:w.y+w.height/2}:h8r(f),_=c?.has(o.id)??!1,T=o.status==="proposed"?"var(--archik-status-proposed)":o.status==="deprecated"?"var(--archik-status-deprecated)":void 0,R=_?"var(--archik-selected)":T??o.color??y.stroke,F=_?y.strokeWidth+.5:y.strokeWidth,B=_?YOe:y.markerId,V=!_&&y.markerStartId!==void 0?y.markerStartId:void 0,se=!_&&y.animated?"archik-edge-flowing":void 0,ee=y.strokeDasharray!==void 0?y.strokeDasharray.trim().split(/\s+/).reduce((Oe,ut)=>Oe+Number(ut),0):0,ce=se!==void 0&&ee>0?{"--archik-dash-period":String(ee)}:void 0,ge=u?Oe=>{Oe.stopPropagation(),u(o.id,Oe)}:void 0;return(0,Qz.jsxs)("g",{"data-archik-edge-id":o.id,"data-archik-edge-relationship":o.relationship,..._?{"data-archik-selected":"true"}:{},...o.status!==void 0&&o.status!=="active"?{"data-archik-status":o.status}:{},className:`archik-edge archik-edge--${o.relationship}`,...ge!==void 0?{onClick:ge}:{},style:u?{cursor:"pointer"}:void 0,children:[u&&(0,Qz.jsx)("polyline",{"data-archik-edge-hitarea":"",points:zln(f),fill:"none",stroke:"transparent",strokeWidth:14,strokeLinecap:"round",strokeLinejoin:"round"}),(0,Qz.jsx)("polyline",{className:se,points:zln(f),fill:"none",stroke:R,strokeWidth:F,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:`url(#${B})`,...V!==void 0?{markerStart:`url(#${V})`}:{},...y.strokeDasharray!==void 0?{strokeDasharray:y.strokeDasharray}:{},...ce!==void 0?{style:ce}:{}}),o.label!==void 0&&v!==void 0&&(0,Qz.jsx)("g",{transform:`translate(${v.x}, ${w?v.y+4:v.y-6})`,children:(0,Qz.jsx)("text",{textAnchor:"middle",fontSize:11,fontWeight:_?700:500,fill:_?"var(--archik-selected)":"var(--archik-fg-dim)",stroke:"var(--archik-panel)",strokeWidth:_?4:3,paintOrder:"stroke",children:o.label})})]})}var pb=li(ec(),1);var v2t={added:"var(--archik-success)",removed:"var(--archik-danger)",changed:"var(--archik-warning)"};function f8r(o){let c=[],u=(p,f,y)=>{for(let w of p){let v=f+w.x,_=y+w.y;c.push({...w,absX:v,absY:_}),w.children.length>0&&u(w.children,v,_)}};return u(o,0,0),c}function p8r(o){return o.replace(/[^a-z0-9-]/g,c=>`\\${c}`)}function Hln({statuses:o,scopeClass:c}){let u=[];for(let[f,y]of o.nodes)y==="removed"&&u.push(f);if(u.length===0)return null;let p=u.map(f=>`.${c} [data-archik-node-id="${p8r(f)}"] { opacity: 0.35; }`).join(`
|
|
522
522
|
`);return(0,pb.jsx)("style",{children:p})}function Uln({positioned:o,statuses:c}){return(0,pb.jsx)("g",{className:"archik-diff-nodes",pointerEvents:"none",children:f8r(o.roots).map(u=>{let p=c.nodes.get(u.id);return p===void 0||p==="unchanged"?null:(0,pb.jsx)(g8r,{node:u,status:p},u.id)})})}function g8r({node:o,status:c}){let u=v2t[c],p=o.absX+-3,f=o.absY+-3,y=o.width- -6,w=o.height- -6,v=c==="removed"?"5 4":void 0,_=jln(o.kind,p-1,f-1,y+2,w+2),T=jln(o.kind,p,f,y,w);return(0,pb.jsxs)("g",{children:[(0,pb.jsx)("path",{d:_,fill:"none",stroke:u,strokeOpacity:.25,strokeWidth:6,strokeLinejoin:"round"}),(0,pb.jsx)("path",{d:T,fill:"none",stroke:u,strokeWidth:2.2,strokeLinejoin:"round",...v!==void 0?{strokeDasharray:v}:{},opacity:.95}),(0,pb.jsx)(m8r,{x:p+y-6,y:f-6,status:c})]})}function jln(o,c,u,p,f){switch(o){case"queue":{let y=Math.min(f/2,28);return Bln(c,u,p,f,y)}case"database":return y8r(c,u,p,f,12);case"cloud":return b8r(c,u,p,f);default:return Bln(c,u,p,f,10)}}function Bln(o,c,u,p,f){let y=Math.min(f,u/2),w=Math.min(f,p/2);return[`M ${o+y} ${c}`,`H ${o+u-y}`,`A ${y} ${w} 0 0 1 ${o+u} ${c+w}`,`V ${c+p-w}`,`A ${y} ${w} 0 0 1 ${o+u-y} ${c+p}`,`H ${o+y}`,`A ${y} ${w} 0 0 1 ${o} ${c+p-w}`,`V ${c+w}`,`A ${y} ${w} 0 0 1 ${o+y} ${c}`,"Z"].join(" ")}function y8r(o,c,u,p,f){return[`M ${o} ${c+f}`,`L ${o} ${c+p-10}`,`A 10 10 0 0 0 ${o+10} ${c+p}`,`L ${o+u-10} ${c+p}`,`A 10 10 0 0 0 ${o+u} ${c+p-10}`,`L ${o+u} ${c+f}`,`A ${u/2} ${f} 0 0 0 ${o} ${c+f}`,"Z"].join(" ")}function b8r(o,c,u,p){let y=p-2,w=p*.62,v=Math.min(p*.18,14),_=u-4,T=p*.5,R=Math.min(_*.15,T*.85),F=Math.min(_*.18,T),B=Math.min(_*.15,T*.85),V=2*(R+F+B),se=Math.max(0,_-V)/4,ee=2,ce=u-2,ge=ee+se,Oe=ge+2*R,ut=Oe+se,Se=ut+2*F,Be=Se+se,Ue=Be+2*B;return[`M ${o+ee} ${c+y-v}`,`Q ${o+ee} ${c+y} ${o+ee+v} ${c+y}`,`L ${o+ce-v} ${c+y}`,`Q ${o+ce} ${c+y} ${o+ce} ${c+y-v}`,`L ${o+ce} ${c+w}`,`L ${o+Ue} ${c+w}`,`A ${B} ${B} 0 0 0 ${o+Be} ${c+w}`,`L ${o+Se} ${c+w}`,`A ${F} ${F} 0 0 0 ${o+ut} ${c+w}`,`L ${o+Oe} ${c+w}`,`A ${R} ${R} 0 0 0 ${o+ge} ${c+w}`,`L ${o+ee} ${c+w}`,"Z"].join(" ")}function m8r({x:o,y:c,status:u}){let p=u==="added"?"+":u==="removed"?"\u2212":"~";return(0,pb.jsxs)("g",{transform:`translate(${o}, ${c})`,children:[(0,pb.jsx)("circle",{r:9,fill:v2t[u],stroke:"var(--archik-canvas)",strokeWidth:1.5}),(0,pb.jsx)("text",{textAnchor:"middle",y:4,fontSize:12,fontWeight:700,fill:"white",children:p})]})}function qln({positioned:o,statuses:c}){return(0,pb.jsx)("g",{className:"archik-diff-edges",pointerEvents:"none",children:o.edges.map(u=>{let p=c.edges.get(u.id);return p===void 0||p==="unchanged"?null:(0,pb.jsx)(w8r,{edge:u,status:p},u.id)})})}function w8r({edge:o,status:c}){let u=o.sections[0];if(!u)return null;let p=[u.startPoint,...u.bendPoints,u.endPoint];return(0,pb.jsx)("polyline",{points:p.map(f=>`${f.x},${f.y}`).join(" "),fill:"none",stroke:v2t[c],strokeWidth:3,strokeOpacity:.55,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:c==="removed"?"8 4":void 0})}var td=li(ec(),1),eFe=24;function k2t({positioned:o,viewMode:c="detailed",selectedNodeIds:u,selectedEdgeIds:p,glowNodeIds:f,onSelectNode:y,onSelectEdge:w,onOpenSubFile:v,onCrossFileNavigate:_,showStereotypeBands:T=!0}){let R=new Map;for(let F of o.edges){if(F.toFile!==void 0){let B=R.get(F.from)??new Set;B.add(F.toFile),R.set(F.from,B)}if(F.fromFile!==void 0){let B=R.get(F.to)??new Set;B.add(F.fromFile),R.set(F.to,B)}}return(0,td.jsxs)(td.Fragment,{children:[(0,td.jsxs)("defs",{children:[(0,td.jsx)(Nln,{id:Wm}),(0,td.jsx)(Rln,{id:Yz}),(0,td.jsx)(Dln,{id:YOe}),(0,td.jsx)(Oln,{id:dne}),(0,td.jsx)(Fln,{id:QOe})]}),(0,td.jsx)("g",{className:"archik-edges",children:o.edges.map(F=>(0,td.jsx)($ln,{edge:F,...p!==void 0?{selectedEdgeIds:p}:{},...w!==void 0?{onSelectEdge:w}:{}},F.id))}),(0,td.jsx)("g",{className:"archik-nodes",children:o.roots.map(F=>(0,td.jsx)(w2t,{node:F,viewMode:c,showStereotypeBands:T,crossFileByNode:R,...u!==void 0?{selectedNodeIds:u}:{},...f!==void 0?{glowNodeIds:f}:{},...y!==void 0?{onSelectNode:y}:{},...v!==void 0?{onOpenSubFile:v}:{},..._!==void 0?{onCrossFileNavigate:_}:{}},F.id))})]})}function v8r(o,c){let u=(p,f,y)=>{for(let w of p){if(w.id===c)return{x:f+w.x+w.width/2,y:y+w.y+w.height/2};let v=u(w.children,f+w.x,y+w.y);if(v)return v}return null};return u(o.roots,0,0)}function Gln({positioned:o,className:c,zoom:u=1,viewMode:p="detailed",svgRef:f,dragGhost:y,selectedNodeIds:w,selectedEdgeIds:v,glowNodeIds:_,onSelectNode:T,onSelectEdge:R,onSelectNothing:F,onOpenSubFile:B,onCrossFileNavigate:V,diffStatuses:se,showStereotypeBands:ee=!0}){let ce=Math.max(o.width,1),ge=Math.max(o.height,1),Oe=-eFe,ut=-eFe,Se=ce+eFe*2,Be=ge+eFe*2,Ue=y?v8r(o,y.fromId):null;return(0,td.jsxs)("svg",{ref:f,className:c,xmlns:"http://www.w3.org/2000/svg",width:Se*u,height:Be*u,viewBox:`${Oe} ${ut} ${Se} ${Be}`,preserveAspectRatio:"xMidYMid meet",style:{display:"block",flexShrink:0},onClick:F,children:[se&&(0,td.jsx)(Hln,{statuses:se,scopeClass:"archik-diff-base"}),(0,td.jsx)("g",{className:se?"archik-diff-base":void 0,children:(0,td.jsx)(k2t,{positioned:o,viewMode:p,showStereotypeBands:ee,...w!==void 0?{selectedNodeIds:w}:{},...v!==void 0?{selectedEdgeIds:v}:{},..._!==void 0?{glowNodeIds:_}:{},...T!==void 0?{onSelectNode:T}:{},...R!==void 0?{onSelectEdge:R}:{},...B!==void 0?{onOpenSubFile:B}:{},...V!==void 0?{onCrossFileNavigate:V}:{}})}),se&&(0,td.jsxs)(td.Fragment,{children:[(0,td.jsx)(qln,{positioned:o,statuses:se}),(0,td.jsx)(Uln,{positioned:o,statuses:se})]}),y&&Ue&&(0,td.jsxs)("g",{className:"archik-drag-ghost",pointerEvents:"none",children:[(0,td.jsx)("line",{x1:Ue.x,y1:Ue.y,x2:y.pointerX,y2:y.pointerY,stroke:"var(--archik-selected)",strokeWidth:1.6,strokeDasharray:"6 4",strokeLinecap:"round",opacity:.85}),(0,td.jsx)("circle",{cx:y.pointerX,cy:y.pointerY,r:4,fill:"var(--archik-selected)",opacity:.9})]})]})}var Vln={"--archik-canvas":"#000000","--archik-panel":"#0a0a0a","--archik-surface":"#161616","--archik-surface-hover":"#222222","--archik-fg":"#ffffff","--archik-fg-dim":"#c8c8c8","--archik-fg-muted":"#9a9a9a","--archik-border":"#262626","--archik-border-strong":"#3d3d3d","--archik-accent":"#22d3ee","--archik-accent-bright":"#67e8f9","--archik-magenta":"#f472b6","--archik-success":"#34d399","--archik-warning":"#fbbf24","--archik-danger":"#fb7185","--archik-node-fill":"#0c0c0c","--archik-node-fill-tinted":"#181818","--archik-node-fill-frame":"#101010","--archik-node-stroke":"#3d3d3d","--archik-node-stroke-soft":"#2a2a2a","--archik-node-text":"#ffffff","--archik-node-text-dim":"#d6d6d6","--archik-node-caption":"#67e8f9","--archik-node-chrome-dot":"#3a3a3a","--archik-edge-filled":"#ededed","--archik-edge-open":"#b0b0b0","--archik-edge-dim":"#7a7a7a","--archik-edge-async":"#67e8f9","--archik-grid-minor":"#0f0f0f","--archik-grid-major":"#1c1c1c","--archik-selected":"#22d3ee","--archik-selected-glow":"rgba(34, 211, 238, 0.28)"},Wln={"--archik-canvas":"#f8fafc","--archik-panel":"#ffffff","--archik-surface":"#f1f5f9","--archik-surface-hover":"#e2e8f0","--archik-fg":"#0f172a","--archik-fg-dim":"#475569","--archik-fg-muted":"#94a3b8","--archik-border":"#e2e8f0","--archik-border-strong":"#cbd5e1","--archik-accent":"#2563eb","--archik-accent-bright":"#3b82f6","--archik-magenta":"#db2777","--archik-success":"#10b981","--archik-warning":"#d97706","--archik-danger":"#e11d48","--archik-node-fill":"#ffffff","--archik-node-fill-tinted":"#f1f5f9","--archik-node-fill-frame":"#ffffff","--archik-node-stroke":"#0f172a","--archik-node-stroke-soft":"#475569","--archik-node-text":"#0f172a","--archik-node-text-dim":"#475569","--archik-node-caption":"#64748b","--archik-node-chrome-dot":"#cbd5f5","--archik-edge-filled":"#0f172a","--archik-edge-open":"#334155","--archik-edge-dim":"#64748b","--archik-edge-async":"#2563eb","--archik-grid-minor":"#e2e8f0","--archik-grid-major":"#cbd5e1","--archik-selected":"#2563eb","--archik-selected-glow":"rgba(37, 99, 235, 0.18)"};function fne(o,c="dark"){let u=c==="light"?Wln:Vln;return o.replace(/var\(--archik-([a-z0-9-]+)\)/g,(p,f)=>u[`--archik-${f}`]??p)}function pne(o,c="dark"){let p=(c==="light"?Wln:Vln)["--archik-canvas"]??"#000000",f=o.match(/<svg\b[^>]*viewBox="([^"]+)"/),[y,w,v,_]=(f?.[1]??"0 0 0 0").split(/\s+/),T=`<rect x="${y}" y="${w}" width="${v}" height="${_}" fill="${p}"/>`;return o.replace(/(<svg\b[^>]*>)/,`$1${T}`)}async function k8r(o,c){let u=dn(c,"out")??"sequence.svg",p=dn(c,"theme")??"dark";if(p!=="dark"&&p!=="light")return console.error(`\u2717 --theme must be "dark" or "light" (got "${p}")`),1;let f=p,y;try{y=await Zln(o,"utf-8")}catch{return console.error(`\u2717 Cannot read ${o}`),1}let w=Kln.default.parse(y),v=pte.safeParse(w);if(!v.success)return console.error(`\u2717 ${o}: ${v.error.issues.map(ce=>ce.message).join("; ")}`),1;let _=FG.resolve(o),T=Ba(_),R;try{let ce=await ac(void 0,T),ge=await ul(ce,T),Oe=new Map;for(let{doc:ut}of ge.docs)for(let Se of ut.nodes)Oe.set(Se.id,Se.kind);R=Oe}catch{}let F=Gsn(v.data,R),B=(0,x2t.renderToStaticMarkup)((0,M2t.createElement)(gln,{laid:F})),se=`<?xml version="1.0" encoding="UTF-8"?>
|
|
523
523
|
${pne(fne(B,f),f)}
|
|
524
524
|
`,ee=FG.resolve(u);return await Jln(FG.dirname(ee),{recursive:!0}),await Xln(ee,se,"utf-8"),console.log(`\u2713 Rendered sequence "${v.data.name}" \u2192 ${u}`),0}async function gne(o){let c=dn(o,"seq");if(c!==void 0)return k8r(c,o);let u;try{u=await ac(o._[0])}catch(Be){return console.error(`\u2717 ${Be instanceof Error?Be.message:String(Be)}`),1}let p=FG.relative(process.cwd(),u)||u,f=dn(o,"out")??"diagram.svg",y=dn(o,"theme")??"dark";if(y!=="dark"&&y!=="light")return console.error(`\u2717 --theme must be "dark" or "light" (got "${y}")`),1;let w=y,v;try{v=await Zln(u,"utf-8")}catch(Be){return console.error(`\u2717 Cannot read ${p}`),console.error(Be instanceof Error?Be.message:String(Be)),1}try{Xu(v)}catch(Be){return console.error(`\u2717 ${p}`),console.error(Be instanceof Error?Be.message:String(Be)),1}let _=Ba(u),T=await ul(u,_);for(let Be of T.errors)console.error(`warn: ${Be.relPath}: ${Be.message}`);let F={version:"1.0",name:"merged",nodes:T.docs.flatMap(Be=>Be.doc.nodes),edges:T.docs.flatMap(Be=>Be.doc.edges)},B=dn(o,"focus");if(B!==void 0){let Be=dn(o,"depth"),Ue=Be!==void 0?Math.max(0,Number.parseInt(Be,10)||0):1;F=Bsn(F,B,Ue)}let V=dn(o,"hide-rel"),se=dn(o,"only-rel"),ee=dn(o,"hide-structural")==="true";(V!==void 0||se!==void 0||ee)&&(F=Hsn(F,{...V!==void 0?{hideRel:V.split(",").map(Be=>Be.trim())}:{},...se!==void 0?{onlyRel:se.split(",").map(Be=>Be.trim())}:{},...ee?{hideStructural:!0}:{}}));let ce=await NG(F),ge=(0,x2t.renderToStaticMarkup)((0,M2t.createElement)(Gln,{positioned:ce})),ut=`<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -32,7 +32,7 @@ Consider installing the package or pass your own 'workerFactory' to ELK's constr
|
|
|
32
32
|
... Falling back to non-web worker version.`);if(!Rn.workerFactory){var Qn=p("./elk-worker.min.js"),pt=Qn.Worker;Rn.workerFactory=function(dr){return new pt(dr)}}return B(this,_n,[Rn])}return ye(_n,gn),k(_n)})(re);Object.defineProperty(m.exports,"__esModule",{value:!0}),m.exports=tn,tn.default=tn},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(p,m,x){var M=typeof Worker<"u"?Worker:void 0;m.exports=M},{}]},{},[3])(3)})})(N8e)),N8e.exports}var bBn=dBn();const gBn=Q1n(bBn),AA=7.4,uk=5.9,wBn=5.9,pBn=14;function lse(f,d){return f.length*d}function Qg(f,d,p){if(d<=0)return"";const m=Math.floor(d/p);return f.length<=m?f:m<=1?"…":f.slice(0,m-1)+"…"}const I8e={nodeSpacing:60,layerSpacing:100,padding:40};function mBn(f){const d=f.nodeSpacing??I8e.nodeSpacing,p=f.layerSpacing??I8e.layerSpacing,m=f.padding??I8e.padding;return{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.edgeRouting":"ORTHOGONAL","elk.layered.spacing.nodeNodeBetweenLayers":String(p),"elk.spacing.nodeNode":String(d),"elk.padding":`[top=${m}, left=${m}, bottom=${m}, right=${m}]`,"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.edgeLabels.placement":"CENTER","elk.spacing.edgeLabel":"8","elk.spacing.labelLabel":"6","elk.spacing.edgeNode":"20","elk.spacing.edgeEdge":"12","elk.layered.spacing.edgeEdgeBetweenLayers":"12"}}const Bo={width:172,height:82},Fhn={width:172,height:90},vBn={service:Bo,function:Bo,worker:Bo,agent:Bo,database:{width:184,height:100},cache:Fhn,vectordb:Bo,storage:Bo,model:Bo,dto:Bo,dataobject:Bo,queue:{width:188,height:80},topic:Bo,stream:Bo,gateway:Bo,cdn:Bo,route:Bo,interface:Bo,adapter:Bo,port:Bo,llm:Bo,prompt:Bo,tool:Bo,auth:Bo,observability:Bo,cloud:{width:200,height:120},frontend:Fhn,page:Bo,component:Bo,store:Bo,hook:Bo,external:{width:184,height:100},human:{width:184,height:100},module:{width:240,height:130},custom:{width:240,height:130}},Ru={width:152,height:36},qhn={width:200,height:80},yBn={service:Ru,function:Ru,worker:Ru,agent:Ru,database:Ru,cache:Ru,vectordb:Ru,storage:Ru,model:Ru,dto:Ru,dataobject:Ru,queue:{width:168,height:36},topic:Ru,stream:Ru,gateway:Ru,cdn:Ru,route:Ru,interface:Ru,adapter:Ru,port:Ru,llm:Ru,prompt:Ru,tool:Ru,auth:Ru,observability:Ru,cloud:Ru,frontend:Ru,page:Ru,component:Ru,store:Ru,hook:Ru,external:{width:168,height:40},human:{width:168,height:40},module:qhn,custom:qhn},kBn=24,Ghn=320;function jBn(f,d,p){if(f.kind==="module"||f.kind==="custom")return d;if(p==="compact"){const P=36+lse(f.name,uk)+12;return Math.max(d,Math.min(Ghn,Math.ceil(P)))}const m=lse(f.name,AA),x=f.stack!==void 0?lse(f.stack,uk):0,M=Math.max(m,x)+kBn;return Math.max(d,Math.min(Ghn,Math.ceil(M)))}const SBn={top:48,left:18,bottom:18,right:18};function EBn(f,d,p,m){const x=p[f.kind],M={id:f.id,width:jBn(f,x.width,m),height:x.height};if(d.length>0){M.children=d;const k=m==="compact"?{top:30,left:12,bottom:12,right:12}:SBn;M.layoutOptions={"elk.padding":`[top=${k.top}, left=${k.left}, bottom=${k.bottom}, right=${k.right}]`}}return M}function xBn(f,d,p){const m=new Map;for(const P of f.nodes)m.set(P.id,P);const x=new Map;for(const P of f.nodes){const B=x.get(P.parentId)??[];B.push(P),x.set(P.parentId,B)}function M(P){const B=(x.get(P.id)??[]).map(M);return EBn(P,B,d,p)}return{roots:(x.get(void 0)??[]).map(M),byId:m}}function ABn(f){return f.fromFile===void 0&&f.toFile===void 0}function TBn(f){return f.edges.filter(ABn).map(d=>{const p={id:d.id,sources:[d.from],targets:[d.to]};return d.label!==void 0&&d.label.length>0&&(p.labels=[{text:d.label,width:Math.ceil(lse(d.label,wBn)),height:pBn}]),p})}function Nb(f){return f??0}function edn(f,d){const p=d.get(f.id);if(!p)throw new Error(`ELK returned unknown node id "${f.id}"`);const m=(f.children??[]).map(x=>edn(x,d));return{...p,x:Nb(f.x),y:Nb(f.y),width:Nb(f.width),height:Nb(f.height),children:m}}function MBn(f,d){const p=new Map,m=new Map,x=(U,ce,ie,le)=>{const ye=ce+Nb(U.x),He=ie+Nb(U.y);p.set(U.id,{x:ye,y:He}),m.set(U.id,le);const re=[...le,U.id];for(const tn of U.children??[])x(tn,ye,He,re)};x(f,0,0,[]);const M=(U,ce)=>{const ie=m.get(U)??[],le=m.get(ce)??[];let ye=0;for(;ye<ie.length&&ye<le.length&&ie[ye]===le[ye];)ye++;const He=ye===0?f.id:ie[ye-1];return p.get(He)??{x:0,y:0}},k=new Map,P=new Map,B=U=>{for(const ce of U.edges??[]){const ie=ce.sources?.[0]??"",le=ce.targets?.[0]??"",ye=M(ie,le),He=gn=>({x:Nb(gn.x)+ye.x,y:Nb(gn.y)+ye.y}),re=(ce.sections??[]).map(gn=>({startPoint:He(gn.startPoint),endPoint:He(gn.endPoint),bendPoints:(gn.bendPoints??[]).map(He)}));k.set(ce.id,re);const tn=(ce.labels??[]).map(gn=>({text:typeof gn.text=="string"?gn.text:"",x:Nb(gn.x)+ye.x,y:Nb(gn.y)+ye.y,width:Nb(gn.width),height:Nb(gn.height)}));P.set(ce.id,tn)}for(const ce of U.children??[])B(ce)};return B(f),d.edges.map(U=>({...U,sections:k.get(U.id)??[],labels:P.get(U.id)??[]}))}const CBn=new gBn;async function OBn(f,d={}){if(f.nodes.length===0)return{document:f,width:0,height:0,roots:[],edges:[]};const p=d.viewMode==="compact"?"compact":"detailed",m=p==="compact"?yBn:vBn,{roots:x,byId:M}=xBn(f,m,p),k={id:"__root__",layoutOptions:mBn(d),children:x,edges:TBn(f)},P=await CBn.layout(k),B=(P.children??[]).map(U=>edn(U,M));return{document:f,width:Nb(P.width),height:Nb(P.height),roots:B,edges:MBn(P,f)}}const _Bn={name:"elk",layout:OBn},NBn=_Bn;function IBn(f,d){return NBn.layout(f,d)}const ndn=(...f)=>f.filter((d,p,m)=>!!d&&d.trim()!==""&&m.indexOf(d)===p).join(" ").trim();const DBn=f=>f.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const $Bn=f=>f.replace(/^([A-Z])|[\s-_]+(\w)/g,(d,p,m)=>m?m.toUpperCase():p.toLowerCase());const Uhn=f=>{const d=$Bn(f);return d.charAt(0).toUpperCase()+d.slice(1)};var D8e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const LBn=f=>{for(const d in f)if(d.startsWith("aria-")||d==="role"||d==="title")return!0;return!1},RBn=Xn.createContext({}),PBn=()=>Xn.useContext(RBn),zBn=Xn.forwardRef(({color:f,size:d,strokeWidth:p,absoluteStrokeWidth:m,className:x="",children:M,iconNode:k,...P},B)=>{const{size:U=24,strokeWidth:ce=2,absoluteStrokeWidth:ie=!1,color:le="currentColor",className:ye=""}=PBn()??{},He=m??ie?Number(p??ce)*24/Number(d??U):p??ce;return Xn.createElement("svg",{ref:B,...D8e,width:d??U??D8e.width,height:d??U??D8e.height,stroke:f??le,strokeWidth:He,className:ndn("lucide",ye,x),...!M&&!LBn(P)&&{"aria-hidden":"true"},...P},[...k.map(([re,tn])=>Xn.createElement(re,tn)),...Array.isArray(M)?M:[M]])});const Wi=(f,d)=>{const p=Xn.forwardRef(({className:m,...x},M)=>Xn.createElement(zBn,{ref:M,iconNode:d,className:ndn(`lucide-${DBn(Uhn(f))}`,`lucide-${f}`,m),...x}));return p.displayName=Uhn(f),p};const BBn=[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]],FBn=Wi("anchor",BBn);const qBn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],tdn=Wi("arrow-right",qBn);const GBn=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],s7e=Wi("arrow-up-right",GBn);const UBn=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],JBn=Wi("bot",UBn);const HBn=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],KBn=Wi("box",HBn);const ZBn=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],XBn=Wi("boxes",ZBn);const WBn=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],VBn=Wi("braces",WBn);const YBn=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],QBn=Wi("brain",YBn);const eFn=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],nFn=Wi("cable",eFn);const tFn=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ase=Wi("chevron-down",tFn);const iFn=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],C7e=Wi("chevron-left",iFn);const rFn=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Tse=Wi("chevron-right",rFn);const cFn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],sFn=Wi("circle-alert",cFn);const uFn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],oFn=Wi("circle-check",uFn);const lFn=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],fFn=Wi("cloud",lFn);const aFn=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],hFn=Wi("cog",aFn);const dFn=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],bFn=Wi("component",dFn);const gFn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],idn=Wi("crosshair",gFn);const wFn=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],pFn=Wi("database",wFn);const mFn=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],vFn=Wi("door-open",mFn);const yFn=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],kFn=Wi("external-link",yFn);const jFn=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],SFn=Wi("eye-off",jFn);const EFn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],xFn=Wi("eye",EFn);const AFn=[["path",{d:"M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6",key:"14cnrg"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1",key:"sr0ebq"}],["path",{d:"M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1",key:"w793db"}]],TFn=Wi("file-braces-corner",AFn);const MFn=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],rdn=Wi("file-code-corner",MFn);const CFn=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],OFn=Wi("folder-tree",CFn);const _Fn=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],cdn=Wi("git-branch",_Fn);const NFn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],IFn=Wi("globe",NFn);const DFn=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],$Fn=Wi("hard-drive",DFn);const LFn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],RFn=Wi("info",LFn);const PFn=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],zFn=Wi("layers",PFn);const BFn=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],FFn=Wi("layout-grid",BFn);const qFn=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],GFn=Wi("layout-template",qFn);const UFn=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],JFn=Wi("lock",UFn);const HFn=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],KFn=Wi("maximize-2",HFn);const ZFn=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],XFn=Wi("message-square",ZFn);const WFn=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],VFn=Wi("minimize-2",WFn);const YFn=[["path",{d:"M5 12h14",key:"1ays0h"}]],QFn=Wi("minus",YFn);const eqn=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],nqn=Wi("monitor",eqn);const tqn=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],iqn=Wi("package",tqn);const rqn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],cqn=Wi("panel-right-close",rqn);const sqn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],uqn=Wi("panel-right-open",sqn);const oqn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lqn=Wi("plus",oqn);const fqn=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],aqn=Wi("radio",fqn);const hqn=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],dqn=Wi("redo-2",hqn);const bqn=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],gqn=Wi("route",bqn);const wqn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],pqn=Wi("rows-3",wqn);const mqn=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vqn=Wi("search",mqn);const yqn=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],kqn=Wi("send-horizontal",yqn);const jqn=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Sqn=Wi("server",jqn);const Eqn=[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]],xqn=Wi("shapes",Eqn);const Aqn=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Tqn=Wi("sparkles",Aqn);const Mqn=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],Cqn=Wi("square-function",Mqn);const Oqn=[["path",{d:"M14 13V8.5C14 7 15 7 15 5a3 3 0 0 0-6 0c0 2 1 2 1 3.5V13",key:"i9gjdv"}],["path",{d:"M20 15.5a2.5 2.5 0 0 0-2.5-2.5h-11A2.5 2.5 0 0 0 4 15.5V17a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1z",key:"1vzg3v"}],["path",{d:"M5 22h14",key:"ehvnwv"}]],_qn=Wi("stamp",Oqn);const Nqn=[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]],Iqn=Wi("sticky-note",Nqn);const Dqn=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],$qn=Wi("undo-2",Dqn);const Lqn=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Rqn=Wi("user-round",Lqn);const Pqn=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],zqn=Wi("waves",Pqn);const Bqn=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Fqn=Wi("wrench",Bqn);const qqn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gqn=Wi("x",qqn),sdn=(f,d,p)=>({width:f,height:f,viewBox:"0 0 24 24",fill:"none",stroke:d,strokeWidth:p,strokeLinecap:"round",strokeLinejoin:"round"});function Uqn({size:f=16,color:d="currentColor",strokeWidth:p=1.8}){return I.jsxs("svg",{...sdn(f,d,p),"aria-hidden":"true",children:[I.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3.5",ry:"3.5"}),I.jsx("line",{x1:"9",y1:"9",x2:"9",y2:"13"}),I.jsx("line",{x1:"15",y1:"9",x2:"15",y2:"13"}),I.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:d,stroke:"none"})]})}function Jqn({size:f=16,color:d="currentColor",strokeWidth:p=1.8}){return I.jsxs("svg",{...sdn(f,d,p),"aria-hidden":"true",children:[I.jsx("path",{d:"M 7.5 6 L 3.5 12 L 7.5 18"}),I.jsx("path",{d:"M 16.5 6 L 20.5 12 L 16.5 18"}),I.jsx("circle",{cx:"13",cy:"8.6",r:"0.9",fill:d,stroke:"none"}),I.jsx("line",{x1:"13",y1:"11",x2:"11",y2:"16.5"})]})}const zp={service:{color:"#38bdf8",icon:Sqn,description:"Long-running compute that owns business logic."},function:{color:"#22d3ee",icon:Cqn,description:"Stateless function-as-a-service / lambda."},worker:{color:"#06b6d4",icon:hFn,description:"Background job processor or consumer loop."},agent:{color:"#14b8a6",icon:JBn,description:"Autonomous AI agent driving tools and actions."},database:{color:"#34d399",icon:pFn,description:"Persistent state — relational, document, key-value."},cache:{color:"#a78bfa",icon:zFn,description:"In-memory store for fast reads."},vectordb:{color:"#c084fc",icon:Tqn,description:"Vector store for embeddings / similarity search."},storage:{color:"#84cc16",icon:$Fn,description:"Object / blob storage (S3, GCS, etc.)."},model:{color:"#2dd4bf",icon:xqn,description:"Domain model — rich business object with behavior."},dto:{color:"#4ade80",icon:TFn,description:"Data transfer object — shape crossing a boundary."},dataobject:{color:"#86efac",icon:VBn,description:"Plain data structure / record, no behavior."},queue:{color:"#fbbf24",icon:kqn,description:"Asynchronous work queue with at-least-once delivery."},topic:{color:"#f97316",icon:aqn,description:"Pub/sub topic with multiple consumers."},stream:{color:"#fb923c",icon:zqn,description:"Append-only event log (Kafka, Kinesis)."},gateway:{color:"#6366f1",icon:vFn,description:"API gateway, ingress, edge router."},cdn:{color:"#0ea5e9",icon:IFn,description:"Content delivery network / static edge."},route:{color:"#f59e0b",icon:gqn,description:"HTTP / URL route — path + method mapped to a handler."},interface:{color:"#d946ef",icon:Jqn,description:"Abstract contract — the <i> a system commits to."},adapter:{color:"#c026d3",icon:nFn,description:"Concrete implementation of an interface."},port:{color:"#a21caf",icon:Uqn,description:"Hexagonal-architecture port — the socket an adapter plugs into."},llm:{color:"#a855f7",icon:QBn,description:"Large language model service."},prompt:{color:"#c4b5fd",icon:XFn,description:"Prompt template / instruction set."},tool:{color:"#fde047",icon:Fqn,description:"Tool callable by an agent or LLM."},auth:{color:"#ef4444",icon:JFn,description:"Identity provider, auth service."},observability:{color:"#10b981",icon:xFn,description:"Metrics, logs, traces — operational telemetry."},cloud:{color:"#0284c7",icon:fFn,description:"Managed cloud service (compute, hosted, etc.)."},frontend:{color:"#f472b6",icon:nqn,description:"User-facing surface — browser, mobile, CLI."},page:{color:"#fb7185",icon:GFn,description:"Route-level UI screen mapped to a URL."},component:{color:"#8b5cf6",icon:bFn,description:"Reusable UI component / view fragment."},store:{color:"#facc15",icon:XBn,description:"Client-side state container — Redux, Zustand, Pinia."},hook:{color:"#0d9488",icon:FBn,description:"Reusable client logic — React hook, Vue composable."},external:{color:"#94a3b8",icon:kFn,description:"Third-party system you don't own."},human:{color:"#60a5fa",icon:Rqn,description:"Human actor — end user, operator, or customer."},module:{color:"#7dd3fc",icon:iqn,description:"Module / component grouping (logical container)."},custom:{color:"#64748b",icon:KBn,description:"Container or anything not in the taxonomy."}},C1=28;function O7e({kind:f,iconAt:d,labelAt:p}){const m=zp[f],x=m.icon,M=14;return I.jsxs(I.Fragment,{children:[I.jsx("g",{transform:`translate(${d.cx-M/2}, ${d.cy-M/2})`,pointerEvents:"none","aria-hidden":"true",children:I.jsx(x,{size:M,color:m.color,strokeWidth:1.8})}),I.jsx("text",{x:p.cx,y:p.cy,textAnchor:"middle",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:f.toUpperCase()})]})}const Hqn=24;function Kqn({node:f,selected:d}){const p=f.width,m=f.height,x=f.stack!==void 0,M=C1+(m-C1)/2,k=x?M-4:M+4,P=M+14,B=Math.max(0,p-Hqn),U=Qg(f.name,B,AA),ce=x?Qg(f.stack,B,uk):"";return I.jsxs("g",{className:`archik-node archik-node--${f.kind}`,children:[I.jsx("rect",{className:d?"archik-selected-glow":void 0,width:p,height:m,rx:10,ry:10,fill:"var(--archik-node-fill)",stroke:d?"var(--archik-selected)":"var(--archik-node-stroke)",strokeWidth:d?1.8:1.4}),I.jsx("line",{x1:0,y1:C1,x2:p,y2:C1,stroke:"var(--archik-node-stroke)",strokeOpacity:.25,strokeWidth:1}),I.jsx(O7e,{kind:f.kind,iconAt:{cx:18,cy:C1/2},labelAt:{cx:p/2,cy:C1/2+3}}),I.jsx("text",{x:p/2,y:k,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:U}),x&&I.jsx("text",{x:p/2,y:P,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:ce})]})}function Zqn({node:f,selected:d}){const p=f.width,m=f.height,x=Math.min(m/2,28),M=f.stack!==void 0,k=C1+(m-C1)/2,P=M?k-4:k+4,B=k+14,U=Math.max(0,p-2*x-8),ce=Qg(f.name,U,AA),ie=M?Qg(f.stack,U,uk):"",le=d?"var(--archik-selected)":"var(--archik-node-stroke)";return I.jsxs("g",{className:"archik-node archik-node--queue",children:[I.jsx("rect",{className:d?"archik-selected-glow":void 0,width:p,height:m,rx:x,ry:x,fill:"var(--archik-node-fill)",stroke:le,strokeWidth:d?1.8:1.4}),I.jsx("line",{x1:x,y1:C1,x2:p-x,y2:C1,stroke:le,strokeOpacity:.25,strokeWidth:1}),I.jsx(O7e,{kind:"queue",iconAt:{cx:x+8,cy:C1/2},labelAt:{cx:p/2,cy:C1/2+3}}),I.jsx("text",{x:p/2,y:P,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:ce}),M&&I.jsx("text",{x:p/2,y:B,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:ie})]})}const Xqn=24;function Wqn({node:f,selected:d}){const p=f.width,m=f.height,x=f.description!==void 0,M=C1,k=M+(m-M)/2,P=x?k-2:k+4,B=m-12,U=Math.max(0,p-Xqn),ce=Qg(f.name,U,AA),ie=x?Qg(f.description,U,uk):"",le=d?"var(--archik-selected)":"var(--archik-node-stroke-soft)";return I.jsxs("g",{className:`archik-node archik-node--${f.kind}`,children:[I.jsx("rect",{className:d?"archik-selected-glow":void 0,width:p,height:m,rx:8,ry:8,fill:"var(--archik-node-fill-tinted)",stroke:le,strokeWidth:d?1.8:1.2,strokeDasharray:d?void 0:"6 4"}),I.jsx("line",{x1:6,y1:C1,x2:p-6,y2:C1,stroke:le,strokeOpacity:.25,strokeWidth:1}),I.jsx(O7e,{kind:f.kind,iconAt:{cx:18,cy:C1/2},labelAt:{cx:p/2,cy:C1/2+3}}),I.jsx("text",{x:p/2,y:P,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:ce}),x&&I.jsx("text",{x:p/2,y:B,textAnchor:"middle",fontSize:10,fill:"var(--archik-node-text-dim)",children:ie})]})}const Vqn=28,udn=10,Yqn=22;function Qqn({node:f,selected:d}){const p=f.width,m=f.height,x=p/2,M=udn,k=zp[f.kind],P=k.icon,B=d?"var(--archik-selected)":"var(--archik-node-stroke)",U=d?1.8:1.4,ce=f.stack!==void 0,ie=Math.max(0,p-Vqn),le=Qg(f.name,ie,AA),ye=ce?Qg(f.stack,ie,uk):"",He=m,re=He-Yqn,tn=(re+He)/2,dn=(M+8+re)/2,Rn=ce?dn-4:dn+4,ut=dn+14;return I.jsxs("g",{className:"archik-node archik-node--database",children:[I.jsx("path",{className:d?"archik-selected-glow":void 0,d:odn(p,m,M),fill:"var(--archik-node-fill)",stroke:B,strokeWidth:U,strokeLinejoin:"round"}),I.jsx("ellipse",{cx:x,cy:M,rx:p/2,ry:M,fill:"var(--archik-node-fill)",stroke:B,strokeWidth:U}),I.jsx("text",{x,y:Rn,textAnchor:"middle",fontSize:14,fontWeight:600,fill:"var(--archik-node-text)",children:le}),ce&&I.jsx("text",{x,y:ut,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:ye}),I.jsx("line",{x1:4,y1:re,x2:p-4,y2:re,stroke:B,strokeOpacity:.45,strokeWidth:1}),I.jsx("g",{transform:`translate(14, ${tn-7})`,pointerEvents:"none","aria-hidden":"true",children:I.jsx(P,{size:14,color:k.color,strokeWidth:1.9})}),I.jsx("text",{x,y:tn+4,textAnchor:"middle",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:f.kind.toUpperCase()})]})}const eGn=10;function odn(f,d,p){const m=eGn;return[`M 0 ${p}`,`L 0 ${d-m}`,`A ${m} ${m} 0 0 0 ${m} ${d}`,`L ${f-m} ${d}`,`A ${m} ${m} 0 0 0 ${f} ${d-m}`,`L ${f} ${p}`,`A ${f/2} ${p} 0 0 0 0 ${p}`,"Z"].join(" ")}const nGn=36,Jhn=18;function tGn({node:f,selected:d}){const p=f.width,m=f.height,x=zp[f.kind],M=x.icon,k=d?"var(--archik-selected)":"var(--archik-node-stroke)",P=d?1.8:1.4,B=f.stack!==void 0,U=Math.max(0,p-nGn),ce=Qg(f.name,U,AA),ie=B?Qg(f.stack,U,uk):"",le=p/2,ye=m*.55,He=B?ye-4:ye+4,re=ye+14;return I.jsxs("g",{className:"archik-node archik-node--cloud",children:[I.jsx("path",{className:d?"archik-selected-glow":void 0,d:iGn(p,m),fill:"var(--archik-node-fill)",stroke:k,strokeWidth:P,strokeLinejoin:"round"}),I.jsx("g",{transform:`translate(18, ${Jhn-6})`,pointerEvents:"none","aria-hidden":"true",children:I.jsx(M,{size:14,color:x.color,strokeWidth:1.9})}),I.jsx("text",{x:le,y:Jhn+4,textAnchor:"middle",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:f.kind.toUpperCase()}),I.jsx("text",{x:le,y:He,textAnchor:"middle",fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:ce}),B&&I.jsx("text",{x:le,y:re,textAnchor:"middle",fontSize:11,fill:"var(--archik-node-text-dim)",children:ie})]})}function iGn(f,d){const m=d-2,x=d*.62,M=Math.min(d*.18,14),k=f-4,P=d*.5,B=Math.min(k*.15,P*.85),U=Math.min(k*.18,P),ce=Math.min(k*.15,P*.85),ie=2*(B+U+ce),le=Math.max(0,k-ie)/4,ye=2,He=f-2,re=ye+le,tn=re+2*B,gn=tn+le,_n=gn+2*U,dn=_n+le,Rn=dn+2*ce;return[`M ${ye} ${m-M}`,`Q ${ye} ${m} ${ye+M} ${m}`,`L ${He-M} ${m}`,`Q ${He} ${m} ${He} ${m-M}`,`L ${He} ${x}`,`L ${Rn} ${x}`,`A ${ce} ${ce} 0 0 0 ${dn} ${x}`,`L ${_n} ${x}`,`A ${U} ${U} 0 0 0 ${gn} ${x}`,`L ${tn} ${x}`,`A ${B} ${B} 0 0 0 ${re} ${x}`,`L ${ye} ${x}`,"Z"].join(" ")}const iI=32,Uce=14,$8e=14;function rGn({node:f,selected:d,depth:p=0}){const m=f.width,x=f.height;if(!(f.children.length>0))return I.jsx(sGn,{node:f,selected:!!d});const k=zp[f.kind],P=k.icon,B=Math.min(.04+p*.06,.22),U=Math.min(.55+p*.12,.95),ce=d?"var(--archik-selected)":"var(--archik-container-border)",ie=d?1.8:1.2,le=Math.max(0,m-Uce*2-60),ye=Qg(f.name,le,AA);return I.jsxs("g",{className:`archik-node archik-node--${f.kind} archik-node--container`,children:[I.jsx("rect",{className:d?"archik-selected-glow":void 0,width:m,height:x,rx:8,ry:8,fill:k.color,fillOpacity:B,stroke:ce,strokeWidth:ie,pointerEvents:"none"}),p>=1&&m>8&&x>8&&I.jsx("rect",{x:3,y:3,width:m-6,height:x-6,rx:6,ry:6,fill:"none",stroke:k.color,strokeOpacity:Math.min(.18+(p-1)*.06,.32),strokeWidth:1,pointerEvents:"none"}),I.jsx("path",{d:cGn(m,iI,8),fill:k.color,fillOpacity:U*.18}),I.jsx("line",{x1:0,y1:iI,x2:m,y2:iI,stroke:ce,strokeOpacity:.45,strokeWidth:1}),I.jsx("g",{transform:`translate(${Uce}, ${iI/2-$8e/2})`,pointerEvents:"none","aria-hidden":"true",children:I.jsx(P,{size:$8e,color:k.color,strokeWidth:1.9})}),I.jsx("text",{x:Uce+$8e+8,y:iI/2+4,fontSize:13,fontWeight:600,fill:"var(--archik-node-text)",children:ye}),I.jsx("text",{x:m-Uce,y:iI/2+3,textAnchor:"end",fontSize:9.5,fontWeight:600,letterSpacing:"0.12em",fill:"var(--archik-node-caption)",children:f.kind.toUpperCase()})]})}function cGn(f,d,p){return`M ${p} 0 H ${f-p} A ${p} ${p} 0 0 1 ${f} ${p} V ${d} H 0 V ${p} A ${p} ${p} 0 0 1 ${p} 0 Z`}function sGn({node:f,selected:d}){const p=f.width,m=f.height,x=zp[f.kind],M=d?"var(--archik-selected)":"var(--archik-node-stroke-soft)";return I.jsxs("g",{className:`archik-node archik-node--${f.kind}`,children:[I.jsx("rect",{className:d?"archik-selected-glow":void 0,width:p,height:m,rx:8,ry:8,fill:"var(--archik-node-fill-tinted)",stroke:M,strokeWidth:d?1.8:1.2,strokeDasharray:d?void 0:"5 4"}),I.jsx("text",{x:p/2,y:m/2+4,textAnchor:"middle",fontSize:12,fontWeight:600,fill:x.color,children:f.name})]})}const QU=24,ldn=10,u7e=28;function uGn({node:f,selected:d,depth:p=0}){const m=f.width,x=f.height,M=zp[f.kind],k=M.icon,P=f.kind==="external";if(f.children.length>0)return I.jsx(oGn,{node:f,selected:!!d,depth:p});const B=d?"var(--archik-selected)":P?"var(--archik-node-stroke-soft)":"var(--archik-node-stroke)",U=P?"var(--archik-node-fill-tinted)":"var(--archik-node-fill)",ce=f.kind==="queue"?Math.min(x/2,18):8;return I.jsxs("g",{className:`archik-node archik-node--${f.kind} archik-node--compact`,children:[I.jsx("rect",{className:d?"archik-selected-glow":void 0,width:m,height:x,rx:ce,ry:ce,fill:U,stroke:B,strokeWidth:d?1.8:1.4,strokeDasharray:P&&!d?"5 4":void 0}),I.jsx("g",{transform:`translate(${ldn}, ${x/2-7})`,pointerEvents:"none","aria-hidden":"true",children:I.jsx(k,{size:13,color:M.color,strokeWidth:1.9})}),I.jsx("text",{x:u7e,y:x/2+4,fontSize:12,fontWeight:600,fill:"var(--archik-node-text)",children:Qg(f.name,Math.max(0,m-u7e-8),uk)})]})}function oGn({node:f,selected:d,depth:p}){const m=f.width,x=f.height,M=zp[f.kind],k=M.icon,P=Math.min(.04+p*.035,.14),B=Math.min(.55+p*.08,.85),U=d?"var(--archik-selected)":"var(--archik-container-border)",ce=Math.max(0,m-12-22),ie=Qg(f.name,ce,uk);return I.jsxs("g",{className:`archik-node archik-node--${f.kind} archik-node--compact archik-node--container`,children:[I.jsx("rect",{className:d?"archik-selected-glow":void 0,width:m,height:x,rx:6,ry:6,fill:M.color,fillOpacity:P,stroke:U,strokeWidth:d?1.8:1.2}),I.jsx("path",{d:lGn(m,QU,6),fill:M.color,fillOpacity:B*.18}),I.jsx("line",{x1:0,y1:QU,x2:m,y2:QU,stroke:U,strokeOpacity:.45,strokeWidth:1}),I.jsx("g",{transform:`translate(${ldn}, ${QU/2-6})`,pointerEvents:"none","aria-hidden":"true",children:I.jsx(k,{size:12,color:M.color,strokeWidth:1.9})}),I.jsx("text",{x:u7e,y:QU/2+4,fontSize:12,fontWeight:600,fill:"var(--archik-node-text)",children:ie})]})}function lGn(f,d,p){return`M ${p} 0 H ${f-p} A ${p} ${p} 0 0 1 ${f} ${p} V ${d} H 0 V ${p} A ${p} ${p} 0 0 1 ${p} 0 Z`}const fGn=12,aGn=18;function fdn({Icon:f,cx:d,cy:p,size:m=fGn,color:x,strokeWidth:M=1.8}){return I.jsx("g",{transform:`translate(${d-m/2}, ${p-m/2})`,pointerEvents:"none","aria-hidden":"true",children:I.jsx(f,{size:m,color:x??"var(--archik-fg-dim)",strokeWidth:M})})}function hGn(f){return I.jsx(fdn,{Icon:RFn,...f})}function dGn(f){return I.jsx(fdn,{Icon:Iqn,...f})}function bGn({cx:f,cy:d,filePath:p,fileLabel:m,onClick:x,size:M=13}){return I.jsxs("g",{transform:`translate(${f-M/2}, ${d-M/2})`,style:{cursor:x?"pointer":"default"},onClick:x,children:[I.jsx("title",{children:`Cross-file edge → ${m} (${p})`}),I.jsx("circle",{cx:M/2,cy:M/2,r:M/2+.5,fill:"var(--archik-fg-dim)",fillOpacity:.12,stroke:"var(--archik-fg-dim)",strokeOpacity:.4,strokeWidth:1}),I.jsx("g",{transform:"translate(1, 1)",pointerEvents:"none",children:I.jsx(s7e,{size:M-2,color:"var(--archik-fg-muted)",strokeWidth:2.2})})]})}function gGn({cx:f,cy:d,onClick:p,size:m=14}){return I.jsxs("g",{transform:`translate(${f-m/2}, ${d-m/2})`,style:{cursor:p?"pointer":"default"},onClick:p,children:[I.jsx("title",{children:"Open sub-architecture"}),I.jsx("circle",{cx:m/2,cy:m/2,r:m/2+.5,fill:"var(--archik-accent)",fillOpacity:.16,stroke:"var(--archik-accent)",strokeOpacity:.45,strokeWidth:1}),I.jsx("g",{transform:"translate(1, 1)",pointerEvents:"none",children:I.jsx(Ase,{size:m-2,color:"var(--archik-accent)",strokeWidth:2.2})})]})}function wGn({cx:f,cy:d,files:p,count:m,size:x=14}){const M=p.length===1?`Open sequence diagram → ${p[0].label} (${p[0].path})`:`${p.length} sequence diagrams on this node:
|
|
33
33
|
`+p.map(k=>` • ${k.label}`).join(`
|
|
34
34
|
`)+`
|
|
35
|
-
Click to open the first; the rest live in the inspector.`;return I.jsxs("g",{transform:`translate(${f-x/2}, ${d-x/2})`,style:{cursor:"pointer"},children:[I.jsx("title",{children:M}),I.jsx("circle",{cx:x/2,cy:x/2,r:x/2+.5,fill:"var(--archik-status-proposed)",fillOpacity:.16,stroke:"var(--archik-status-proposed)",strokeOpacity:.5,strokeWidth:1}),I.jsx("g",{transform:"translate(1, 1)",pointerEvents:"none",children:I.jsx(cdn,{size:x-2,color:"var(--archik-status-proposed)",strokeWidth:2.2})}),m!==void 0&&m>1&&I.jsxs("g",{pointerEvents:"none",children:[I.jsx("circle",{cx:x/2,cy:-3,r:5.5,fill:"var(--archik-canvas)"}),I.jsx("circle",{cx:x/2,cy:-3,r:4.5,fill:"var(--archik-status-proposed)"}),I.jsx("text",{x:x/2,y:-.5,fontSize:7.5,fontWeight:700,fill:"#ffffff",textAnchor:"middle",children:m})]})]})}function pGn(f,d,p,m=!1){if(m)return{right:{x:d-14,y:42}};switch(f){case"queue":{const M=Math.min(p/2,28);return{right:{x:d-M-4,y:14}}}case"database":return{right:{x:d-14,y:p-11}};case"module":case"custom":return{right:{x:d-14,y:42}};default:return{right:{x:d-14,y:14}}}}function mGn(f,d){return Array.from({length:d},(p,m)=>({x:f.x-m*aGn,y:f.y}))}function vGn({node:f,selected:d,viewMode:p,depth:m}){if(p==="compact")return I.jsx(uGn,{node:f,selected:d,depth:m});if(f.children.length>0)return I.jsx(rGn,{node:f,selected:d,depth:m});switch(f.kind){case"queue":return I.jsx(Zqn,{node:f,selected:d});case"external":case"human":return I.jsx(Wqn,{node:f,selected:d});case"database":return I.jsx(Qqn,{node:f,selected:d});case"cloud":return I.jsx(tGn,{node:f,selected:d});case"module":case"custom":case"service":case"function":case"worker":case"agent":case"cache":case"vectordb":case"storage":case"model":case"dto":case"dataobject":case"topic":case"stream":case"gateway":case"cdn":case"route":case"interface":case"adapter":case"port":case"llm":case"prompt":case"tool":case"auth":case"observability":case"frontend":case"page":case"component":case"store":case"hook":return I.jsx(Kqn,{node:f,selected:d});default:throw f.kind,new Error("unreachable node kind")}}function adn({node:f,selectedNodeIds:d,glowNodeIds:p,onSelectNode:m,onOpenSubFile:x,onCrossFileNavigate:M,crossFileByNode:k,viewMode:P="detailed",depth:B=0,showStereotypeBands:U=!0}){const ce=d?.has(f.id)??!1,ie=p?.has(f.id)??!1,le=f.children.length>0,ye=le?B+1:B,He=m?tn=>{tn.stopPropagation(),m(f.id,tn)}:void 0,re=f.description!==void 0&&f.description.length>0;return I.jsxs("g",{"data-archik-node-id":f.id,...ce?{"data-archik-selected":"true"}:{},...f.status!==void 0&&f.status!=="active"?{"data-archik-status":f.status}:{},...f.stereotype!==void 0?{"data-archik-stereotype":f.stereotype}:{},transform:`translate(${f.x}, ${f.y})`,...He!==void 0?{onClick:He}:{},style:m?{cursor:"pointer"}:void 0,children:[ie&&I.jsx("rect",{x:-4,y:-4,width:f.width+8,height:f.height+8,rx:10,fill:"none",stroke:"var(--archik-status-proposed)",strokeWidth:2,opacity:.85,style:{pointerEvents:"none"}}),I.jsx(vGn,{node:f,selected:ce,viewMode:P,depth:B}),f.stereotype!==void 0&&U&&I.jsxs(I.Fragment,{children:[I.jsx("clipPath",{id:`archik-nclip-${f.id}`,children:f.kind==="database"?I.jsx("path",{d:odn(f.width,f.height,udn)}):I.jsx("rect",{width:f.width,height:f.height,rx:8,ry:8})}),I.jsx("rect",{className:"archik-stereotype-band",x:0,y:0,width:f.width,height:4,clipPath:`url(#archik-nclip-${f.id})`,style:{pointerEvents:"none"}})]}),P==="detailed"&&(()=>{const tn=f.notes!==void 0&&f.notes.length>0,gn=f.archikFile!==void 0&&f.archikFile.length>0,_n=k?.get(f.id),dn=_n?Array.from(_n).sort():[],Rn=f.seqFiles??[],ut=[];gn&&ut.push("subarch"),Rn.length>0&&ut.push({type:"seq",paths:Rn});for(const pt of dn)ut.push({type:"crossfile",path:pt});if(re&&ut.push("info"),tn&&ut.push("notes"),ut.length===0)return null;const dt=pGn(f.kind,f.width,f.height,le),Qn=mGn(dt.right,ut.length);return I.jsx(I.Fragment,{children:ut.map((pt,dr)=>{const tc=Qn[dr];if(typeof pt=="object"&&pt.type==="seq"){const Rr=pt.paths.map(Q=>({path:Q,label:Q.split("/").pop().replace(/\.archik\.seq\.yaml$/,"")})),Ni=`/__archik/seq?path=${encodeURIComponent(Rr[0].path)}`;return I.jsx("a",{href:Ni,onClick:Q=>Q.stopPropagation(),children:I.jsx(wGn,{cx:tc.x,cy:tc.y,files:Rr,count:Rr.length})},"seq")}if(typeof pt=="object"&&pt.type==="crossfile"){const Rr=pt.path,Ni=Rr.split("/").pop().replace(/\.archik\.yaml$/,""),Q=M??x,Vu=Q?Pu=>{Pu.stopPropagation(),Q(Rr,Ni)}:void 0;return I.jsx(bGn,{cx:tc.x,cy:tc.y,filePath:Rr,fileLabel:Ni,...Vu?{onClick:Vu}:{}},`xf-${Rr}`)}if(pt==="subarch"){const Rr=f.archikFile,Ni=x?Q=>{Q.stopPropagation(),x(Rr,f.name)}:void 0;return I.jsx(gGn,{cx:tc.x,cy:tc.y,...Ni?{onClick:Ni}:{}},"subarch")}return pt==="info"?I.jsx(hGn,{cx:tc.x,cy:tc.y,color:"var(--archik-node-caption)"},"info"):I.jsxs("g",{children:[I.jsx(dGn,{cx:tc.x,cy:tc.y,color:"var(--archik-node-caption)"}),f.notes&&f.notes.length>1&&I.jsx("text",{x:tc.x+7,y:tc.y-5,fontSize:8,fontWeight:700,fill:"var(--archik-accent)",textAnchor:"middle",pointerEvents:"none",children:f.notes.length})]},"notes")})})})(),f.children.map(tn=>I.jsx(adn,{node:tn,viewMode:P,depth:ye,showStereotypeBands:U,...d!==void 0?{selectedNodeIds:d}:{},...p!==void 0?{glowNodeIds:p}:{},...m!==void 0?{onSelectNode:m}:{},...x!==void 0?{onOpenSubFile:x}:{},...M!==void 0?{onCrossFileNavigate:M}:{},...k!==void 0?{crossFileByNode:k}:{}},tn.id))]})}const Vg="archik-arrow-filled",fI="archik-arrow-open",hdn="archik-arrow-selected",bse="archik-arrow-triangle",_7e="archik-arrow-diamond";function ddn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"context-stroke"})})}function bdn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 12 12",refX:"11",refY:"6",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 1 1 L 11 6 L 1 11",fill:"none",stroke:"context-stroke",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})})}function yGn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--archik-selected)"})})}function gdn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 14 14",refX:"13",refY:"7",markerWidth:"9",markerHeight:"9",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 1 1 L 13 7 L 1 13 z",fill:"var(--archik-panel)",stroke:"context-stroke",strokeWidth:"1.5",strokeLinejoin:"round"})})}function wdn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 14 10",refX:"1",refY:"5",markerWidth:"9",markerHeight:"7",orient:"auto",children:I.jsx("path",{d:"M 1 5 L 7 1 L 13 5 L 7 9 z",fill:"context-stroke"})})}const cv="var(--archik-edge-filled)",eJ="var(--archik-edge-dim)",pdn={http_call:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},grpc:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},invokes:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},routes_to:{stroke:cv,strokeWidth:1.4,markerId:Vg},websocket:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg,markerStartId:Vg},webhook:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},reads:{stroke:cv,strokeWidth:1.4,markerId:fI},writes:{stroke:cv,strokeWidth:1.4,markerId:Vg},publishes:{stroke:cv,strokeWidth:1.4,markerId:Vg},subscribes:{stroke:cv,strokeWidth:1.4,markerId:Vg},streams_to:{stroke:cv,strokeWidth:1.4,markerId:Vg},implements:{stroke:eJ,strokeWidth:1.2,strokeDasharray:"7 5",markerId:bse},extends:{stroke:eJ,strokeWidth:1.2,markerId:bse},depends_on:{stroke:eJ,strokeWidth:1.2,strokeDasharray:"7 5",markerId:fI},has_a:{stroke:eJ,strokeWidth:1.2,markerId:fI,markerStartId:_7e},uses:{stroke:eJ,strokeWidth:1.2,markerId:fI}};function Hhn(f){return f.map(d=>`${d.x},${d.y}`).join(" ")}function kGn(f){if(f.length===0)return;const d=Math.floor(f.length/2);if(f.length%2===1)return f[d];const p=f[d-1],m=f[d];return{x:(p.x+m.x)/2,y:(p.y+m.y)/2}}function jGn({edge:f,selectedEdgeIds:d,onSelectEdge:p}){const m=f.sections[0];if(!m)return null;const x=[m.startPoint,...m.bendPoints,m.endPoint],M=pdn[f.relationship],k=f.labels[0],P=k?{x:k.x+k.width/2,y:k.y+k.height/2}:kGn(x),B=d?.has(f.id)??!1,U=f.status==="proposed"?"var(--archik-status-proposed)":f.status==="deprecated"?"var(--archik-status-deprecated)":void 0,ce=B?"var(--archik-selected)":U??f.color??M.stroke,ie=B?M.strokeWidth+.5:M.strokeWidth,le=B?hdn:M.markerId,ye=!B&&M.markerStartId!==void 0?M.markerStartId:void 0,He=!B&&M.animated?"archik-edge-flowing":void 0,re=M.strokeDasharray!==void 0?M.strokeDasharray.trim().split(/\s+/).reduce((_n,dn)=>_n+Number(dn),0):0,tn=He!==void 0&&re>0?{"--archik-dash-period":String(re)}:void 0,gn=p?_n=>{_n.stopPropagation(),p(f.id,_n)}:void 0;return I.jsxs("g",{"data-archik-edge-id":f.id,"data-archik-edge-relationship":f.relationship,...B?{"data-archik-selected":"true"}:{},...f.status!==void 0&&f.status!=="active"?{"data-archik-status":f.status}:{},className:`archik-edge archik-edge--${f.relationship}`,...gn!==void 0?{onClick:gn}:{},style:p?{cursor:"pointer"}:void 0,children:[p&&I.jsx("polyline",{"data-archik-edge-hitarea":"",points:Hhn(x),fill:"none",stroke:"transparent",strokeWidth:14,strokeLinecap:"round",strokeLinejoin:"round"}),I.jsx("polyline",{className:He,points:Hhn(x),fill:"none",stroke:ce,strokeWidth:ie,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:`url(#${le})`,...ye!==void 0?{markerStart:`url(#${ye})`}:{},...M.strokeDasharray!==void 0?{strokeDasharray:M.strokeDasharray}:{},...tn!==void 0?{style:tn}:{}}),f.label!==void 0&&P!==void 0&&I.jsx("g",{transform:`translate(${P.x}, ${k?P.y+4:P.y-6})`,children:I.jsx("text",{textAnchor:"middle",fontSize:11,fontWeight:B?700:500,fill:B?"var(--archik-selected)":"var(--archik-fg-dim)",stroke:"var(--archik-panel)",strokeWidth:B?4:3,paintOrder:"stroke",children:f.label})})]})}const Jce=-3,N7e={added:"var(--archik-success)",removed:"var(--archik-danger)",changed:"var(--archik-warning)"};function SGn(f){const d=[],p=(m,x,M)=>{for(const k of m){const P=x+k.x,B=M+k.y;d.push({...k,absX:P,absY:B}),k.children.length>0&&p(k.children,P,B)}};return p(f,0,0),d}function EGn(f){return f.replace(/[^a-z0-9-]/g,d=>`\\${d}`)}function xGn({statuses:f,scopeClass:d}){const p=[];for(const[x,M]of f.nodes)M==="removed"&&p.push(x);if(p.length===0)return null;const m=p.map(x=>`.${d} [data-archik-node-id="${EGn(x)}"] { opacity: 0.35; }`).join(`
|
|
35
|
+
Click to open the first; the rest live in the inspector.`;return I.jsxs("g",{transform:`translate(${f-x/2}, ${d-x/2})`,style:{cursor:"pointer"},children:[I.jsx("title",{children:M}),I.jsx("circle",{cx:x/2,cy:x/2,r:x/2+.5,fill:"var(--archik-status-proposed)",fillOpacity:.16,stroke:"var(--archik-status-proposed)",strokeOpacity:.5,strokeWidth:1}),I.jsx("g",{transform:"translate(1, 1)",pointerEvents:"none",children:I.jsx(cdn,{size:x-2,color:"var(--archik-status-proposed)",strokeWidth:2.2})}),m!==void 0&&m>1&&I.jsxs("g",{pointerEvents:"none",children:[I.jsx("circle",{cx:x/2,cy:-3,r:5.5,fill:"var(--archik-canvas)"}),I.jsx("circle",{cx:x/2,cy:-3,r:4.5,fill:"var(--archik-status-proposed)"}),I.jsx("text",{x:x/2,y:-.5,fontSize:7.5,fontWeight:700,fill:"#ffffff",textAnchor:"middle",children:m})]})]})}function pGn(f,d,p,m=!1){if(m)return{right:{x:d-14,y:42}};switch(f){case"queue":{const M=Math.min(p/2,28);return{right:{x:d-M-4,y:14}}}case"database":return{right:{x:d-14,y:p-11}};case"module":case"custom":return{right:{x:d-14,y:42}};default:return{right:{x:d-14,y:14}}}}function mGn(f,d){return Array.from({length:d},(p,m)=>({x:f.x-m*aGn,y:f.y}))}function vGn({node:f,selected:d,viewMode:p,depth:m}){if(p==="compact")return I.jsx(uGn,{node:f,selected:d,depth:m});if(f.children.length>0)return I.jsx(rGn,{node:f,selected:d,depth:m});switch(f.kind){case"queue":return I.jsx(Zqn,{node:f,selected:d});case"external":case"human":return I.jsx(Wqn,{node:f,selected:d});case"database":return I.jsx(Qqn,{node:f,selected:d});case"cloud":return I.jsx(tGn,{node:f,selected:d});case"module":case"custom":case"service":case"function":case"worker":case"agent":case"cache":case"vectordb":case"storage":case"model":case"dto":case"dataobject":case"topic":case"stream":case"gateway":case"cdn":case"route":case"interface":case"adapter":case"port":case"llm":case"prompt":case"tool":case"auth":case"observability":case"frontend":case"page":case"component":case"store":case"hook":return I.jsx(Kqn,{node:f,selected:d});default:throw f.kind,new Error("unreachable node kind")}}function adn({node:f,selectedNodeIds:d,glowNodeIds:p,onSelectNode:m,onOpenSubFile:x,onCrossFileNavigate:M,crossFileByNode:k,viewMode:P="detailed",depth:B=0,showStereotypeBands:U=!0}){const ce=d?.has(f.id)??!1,ie=p?.has(f.id)??!1,le=f.children.length>0,ye=le?B+1:B,He=m?tn=>{tn.stopPropagation(),m(f.id,tn)}:void 0,re=f.description!==void 0&&f.description.length>0;return I.jsxs("g",{"data-archik-node-id":f.id,...ce?{"data-archik-selected":"true"}:{},...f.status!==void 0&&f.status!=="active"?{"data-archik-status":f.status}:{},...f.stereotype!==void 0?{"data-archik-stereotype":f.stereotype}:{},transform:`translate(${f.x}, ${f.y})`,...He!==void 0?{onClick:He}:{},style:m?{cursor:"pointer"}:void 0,children:[ie&&I.jsx("rect",{x:-4,y:-4,width:f.width+8,height:f.height+8,rx:10,fill:"none",stroke:"var(--archik-status-proposed)",strokeWidth:2,opacity:.85,style:{pointerEvents:"none"}}),I.jsx(vGn,{node:f,selected:ce,viewMode:P,depth:B}),f.stereotype!==void 0&&U&&I.jsxs(I.Fragment,{children:[I.jsx("clipPath",{id:`archik-nclip-${f.id}`,children:f.kind==="database"?I.jsx("path",{d:odn(f.width,f.height,udn)}):I.jsx("rect",{width:f.width,height:f.height,rx:8,ry:8})}),I.jsx("rect",{className:"archik-stereotype-band",x:0,y:0,width:f.width,height:4,clipPath:`url(#archik-nclip-${f.id})`,style:{pointerEvents:"none"}})]}),P==="detailed"&&(()=>{const tn=f.notes!==void 0&&f.notes.length>0,gn=f.archikFile!==void 0&&f.archikFile.length>0,_n=k?.get(f.id),dn=_n?Array.from(_n).sort():[],Rn=f.seqFiles??[],ut=[];gn&&ut.push("subarch"),Rn.length>0&&ut.push({type:"seq",paths:Rn});for(const pt of dn)ut.push({type:"crossfile",path:pt});if(re&&ut.push("info"),tn&&ut.push("notes"),ut.length===0)return null;const dt=pGn(f.kind,f.width,f.height,le),Qn=mGn(dt.right,ut.length);return I.jsx(I.Fragment,{children:ut.map((pt,dr)=>{const tc=Qn[dr];if(typeof pt=="object"&&pt.type==="seq"){const Rr=pt.paths.map(Q=>({path:Q,label:Q.split("/").pop().replace(/\.archik\.seq\.yaml$/,"")})),Ni=`/__archik/seq?path=${encodeURIComponent(Rr[0].path)}`;return I.jsx("a",{href:Ni,onClick:Q=>Q.stopPropagation(),children:I.jsx(wGn,{cx:tc.x,cy:tc.y,files:Rr,count:Rr.length})},"seq")}if(typeof pt=="object"&&pt.type==="crossfile"){const Rr=pt.path,Ni=Rr.split("/").pop().replace(/\.archik\.yaml$/,""),Q=M??x,Vu=Q?Pu=>{Pu.stopPropagation(),Q(Rr,Ni)}:void 0;return I.jsx(bGn,{cx:tc.x,cy:tc.y,filePath:Rr,fileLabel:Ni,...Vu?{onClick:Vu}:{}},`xf-${Rr}`)}if(pt==="subarch"){const Rr=f.archikFile,Ni=x?Q=>{Q.stopPropagation(),x(Rr,f.name)}:void 0;return I.jsx(gGn,{cx:tc.x,cy:tc.y,...Ni?{onClick:Ni}:{}},"subarch")}return pt==="info"?I.jsx(hGn,{cx:tc.x,cy:tc.y,color:"var(--archik-node-caption)"},"info"):I.jsxs("g",{children:[I.jsx(dGn,{cx:tc.x,cy:tc.y,color:"var(--archik-node-caption)"}),f.notes&&f.notes.length>1&&I.jsx("text",{x:tc.x+7,y:tc.y-5,fontSize:8,fontWeight:700,fill:"var(--archik-accent)",textAnchor:"middle",pointerEvents:"none",children:f.notes.length})]},"notes")})})})(),f.children.map(tn=>I.jsx(adn,{node:tn,viewMode:P,depth:ye,showStereotypeBands:U,...d!==void 0?{selectedNodeIds:d}:{},...p!==void 0?{glowNodeIds:p}:{},...m!==void 0?{onSelectNode:m}:{},...x!==void 0?{onOpenSubFile:x}:{},...M!==void 0?{onCrossFileNavigate:M}:{},...k!==void 0?{crossFileByNode:k}:{}},tn.id))]})}const Vg="archik-arrow-filled",fI="archik-arrow-open",hdn="archik-arrow-selected",bse="archik-arrow-triangle",_7e="archik-arrow-diamond";function ddn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"context-stroke"})})}function bdn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 12 12",refX:"11",refY:"6",markerWidth:"9",markerHeight:"9",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 1 1 L 11 6 L 1 11",fill:"none",stroke:"context-stroke",strokeWidth:"1.8",strokeLinejoin:"round",strokeLinecap:"round"})})}function yGn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"var(--archik-selected)"})})}function gdn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 14 14",refX:"13",refY:"7",markerWidth:"12",markerHeight:"12",orient:"auto-start-reverse",children:I.jsx("path",{d:"M 1 1 L 13 7 L 1 13 z",fill:"var(--archik-panel)",stroke:"context-stroke",strokeWidth:"2",strokeLinejoin:"round"})})}function wdn({id:f}){return I.jsx("marker",{id:f,viewBox:"0 0 14 10",refX:"1",refY:"5",markerWidth:"12",markerHeight:"9",orient:"auto",children:I.jsx("path",{d:"M 1 5 L 7 1 L 13 5 L 7 9 z",fill:"context-stroke"})})}const cv="var(--archik-edge-filled)",eJ="var(--archik-edge-dim)",pdn={http_call:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},grpc:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},invokes:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},routes_to:{stroke:cv,strokeWidth:1.4,markerId:Vg},websocket:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg,markerStartId:Vg},webhook:{stroke:cv,strokeWidth:1.4,strokeDasharray:"2 6",animated:!0,markerId:Vg},reads:{stroke:cv,strokeWidth:1.4,markerId:fI},writes:{stroke:cv,strokeWidth:1.4,markerId:Vg},publishes:{stroke:cv,strokeWidth:1.4,markerId:Vg},subscribes:{stroke:cv,strokeWidth:1.4,markerId:Vg},streams_to:{stroke:cv,strokeWidth:1.4,markerId:Vg},implements:{stroke:eJ,strokeWidth:1.2,strokeDasharray:"7 5",markerId:bse},extends:{stroke:eJ,strokeWidth:1.2,markerId:bse},depends_on:{stroke:eJ,strokeWidth:1.2,strokeDasharray:"7 5",markerId:fI},has_a:{stroke:eJ,strokeWidth:1.2,markerId:fI,markerStartId:_7e},uses:{stroke:eJ,strokeWidth:1.2,markerId:fI}};function Hhn(f){return f.map(d=>`${d.x},${d.y}`).join(" ")}function kGn(f){if(f.length===0)return;const d=Math.floor(f.length/2);if(f.length%2===1)return f[d];const p=f[d-1],m=f[d];return{x:(p.x+m.x)/2,y:(p.y+m.y)/2}}function jGn({edge:f,selectedEdgeIds:d,onSelectEdge:p}){const m=f.sections[0];if(!m)return null;const x=[m.startPoint,...m.bendPoints,m.endPoint],M=pdn[f.relationship],k=f.labels[0],P=k?{x:k.x+k.width/2,y:k.y+k.height/2}:kGn(x),B=d?.has(f.id)??!1,U=f.status==="proposed"?"var(--archik-status-proposed)":f.status==="deprecated"?"var(--archik-status-deprecated)":void 0,ce=B?"var(--archik-selected)":U??f.color??M.stroke,ie=B?M.strokeWidth+.5:M.strokeWidth,le=B?hdn:M.markerId,ye=!B&&M.markerStartId!==void 0?M.markerStartId:void 0,He=!B&&M.animated?"archik-edge-flowing":void 0,re=M.strokeDasharray!==void 0?M.strokeDasharray.trim().split(/\s+/).reduce((_n,dn)=>_n+Number(dn),0):0,tn=He!==void 0&&re>0?{"--archik-dash-period":String(re)}:void 0,gn=p?_n=>{_n.stopPropagation(),p(f.id,_n)}:void 0;return I.jsxs("g",{"data-archik-edge-id":f.id,"data-archik-edge-relationship":f.relationship,...B?{"data-archik-selected":"true"}:{},...f.status!==void 0&&f.status!=="active"?{"data-archik-status":f.status}:{},className:`archik-edge archik-edge--${f.relationship}`,...gn!==void 0?{onClick:gn}:{},style:p?{cursor:"pointer"}:void 0,children:[p&&I.jsx("polyline",{"data-archik-edge-hitarea":"",points:Hhn(x),fill:"none",stroke:"transparent",strokeWidth:14,strokeLinecap:"round",strokeLinejoin:"round"}),I.jsx("polyline",{className:He,points:Hhn(x),fill:"none",stroke:ce,strokeWidth:ie,strokeLinecap:"round",strokeLinejoin:"round",markerEnd:`url(#${le})`,...ye!==void 0?{markerStart:`url(#${ye})`}:{},...M.strokeDasharray!==void 0?{strokeDasharray:M.strokeDasharray}:{},...tn!==void 0?{style:tn}:{}}),f.label!==void 0&&P!==void 0&&I.jsx("g",{transform:`translate(${P.x}, ${k?P.y+4:P.y-6})`,children:I.jsx("text",{textAnchor:"middle",fontSize:11,fontWeight:B?700:500,fill:B?"var(--archik-selected)":"var(--archik-fg-dim)",stroke:"var(--archik-panel)",strokeWidth:B?4:3,paintOrder:"stroke",children:f.label})})]})}const Jce=-3,N7e={added:"var(--archik-success)",removed:"var(--archik-danger)",changed:"var(--archik-warning)"};function SGn(f){const d=[],p=(m,x,M)=>{for(const k of m){const P=x+k.x,B=M+k.y;d.push({...k,absX:P,absY:B}),k.children.length>0&&p(k.children,P,B)}};return p(f,0,0),d}function EGn(f){return f.replace(/[^a-z0-9-]/g,d=>`\\${d}`)}function xGn({statuses:f,scopeClass:d}){const p=[];for(const[x,M]of f.nodes)M==="removed"&&p.push(x);if(p.length===0)return null;const m=p.map(x=>`.${d} [data-archik-node-id="${EGn(x)}"] { opacity: 0.35; }`).join(`
|
|
36
36
|
`);return I.jsx("style",{children:m})}function AGn({positioned:f,statuses:d}){return I.jsx("g",{className:"archik-diff-nodes",pointerEvents:"none",children:SGn(f.roots).map(p=>{const m=d.nodes.get(p.id);return m===void 0||m==="unchanged"?null:I.jsx(TGn,{node:p,status:m},p.id)})})}function TGn({node:f,status:d}){const p=N7e[d],m=f.absX+Jce,x=f.absY+Jce,M=f.width-Jce*2,k=f.height-Jce*2,P=d==="removed"?"5 4":void 0,B=Khn(f.kind,m-1,x-1,M+2,k+2),U=Khn(f.kind,m,x,M,k);return I.jsxs("g",{children:[I.jsx("path",{d:B,fill:"none",stroke:p,strokeOpacity:.25,strokeWidth:6,strokeLinejoin:"round"}),I.jsx("path",{d:U,fill:"none",stroke:p,strokeWidth:2.2,strokeLinejoin:"round",...P!==void 0?{strokeDasharray:P}:{},opacity:.95}),I.jsx(OGn,{x:m+M-6,y:x-6,status:d})]})}function Khn(f,d,p,m,x){switch(f){case"queue":{const M=Math.min(x/2,28);return Zhn(d,p,m,x,M)}case"database":return MGn(d,p,m,x,12);case"cloud":return CGn(d,p,m,x);default:return Zhn(d,p,m,x,10)}}function Zhn(f,d,p,m,x){const M=Math.min(x,p/2),k=Math.min(x,m/2);return[`M ${f+M} ${d}`,`H ${f+p-M}`,`A ${M} ${k} 0 0 1 ${f+p} ${d+k}`,`V ${d+m-k}`,`A ${M} ${k} 0 0 1 ${f+p-M} ${d+m}`,`H ${f+M}`,`A ${M} ${k} 0 0 1 ${f} ${d+m-k}`,`V ${d+k}`,`A ${M} ${k} 0 0 1 ${f+M} ${d}`,"Z"].join(" ")}function MGn(f,d,p,m,x){return[`M ${f} ${d+x}`,`L ${f} ${d+m-10}`,`A 10 10 0 0 0 ${f+10} ${d+m}`,`L ${f+p-10} ${d+m}`,`A 10 10 0 0 0 ${f+p} ${d+m-10}`,`L ${f+p} ${d+x}`,`A ${p/2} ${x} 0 0 0 ${f} ${d+x}`,"Z"].join(" ")}function CGn(f,d,p,m){const M=m-2,k=m*.62,P=Math.min(m*.18,14),B=p-4,U=m*.5,ce=Math.min(B*.15,U*.85),ie=Math.min(B*.18,U),le=Math.min(B*.15,U*.85),ye=2*(ce+ie+le),He=Math.max(0,B-ye)/4,re=2,tn=p-2,gn=re+He,_n=gn+2*ce,dn=_n+He,Rn=dn+2*ie,ut=Rn+He,dt=ut+2*le;return[`M ${f+re} ${d+M-P}`,`Q ${f+re} ${d+M} ${f+re+P} ${d+M}`,`L ${f+tn-P} ${d+M}`,`Q ${f+tn} ${d+M} ${f+tn} ${d+M-P}`,`L ${f+tn} ${d+k}`,`L ${f+dt} ${d+k}`,`A ${le} ${le} 0 0 0 ${f+ut} ${d+k}`,`L ${f+Rn} ${d+k}`,`A ${ie} ${ie} 0 0 0 ${f+dn} ${d+k}`,`L ${f+_n} ${d+k}`,`A ${ce} ${ce} 0 0 0 ${f+gn} ${d+k}`,`L ${f+re} ${d+k}`,"Z"].join(" ")}function OGn({x:f,y:d,status:p}){const m=p==="added"?"+":p==="removed"?"−":"~";return I.jsxs("g",{transform:`translate(${f}, ${d})`,children:[I.jsx("circle",{r:9,fill:N7e[p],stroke:"var(--archik-canvas)",strokeWidth:1.5}),I.jsx("text",{textAnchor:"middle",y:4,fontSize:12,fontWeight:700,fill:"white",children:m})]})}function _Gn({positioned:f,statuses:d}){return I.jsx("g",{className:"archik-diff-edges",pointerEvents:"none",children:f.edges.map(p=>{const m=d.edges.get(p.id);return m===void 0||m==="unchanged"?null:I.jsx(NGn,{edge:p,status:m},p.id)})})}function NGn({edge:f,status:d}){const p=f.sections[0];if(!p)return null;const m=[p.startPoint,...p.bendPoints,p.endPoint];return I.jsx("polyline",{points:m.map(x=>`${x.x},${x.y}`).join(" "),fill:"none",stroke:N7e[d],strokeWidth:3,strokeOpacity:.55,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:d==="removed"?"8 4":void 0})}const Hce=24;function IGn({positioned:f,viewMode:d="detailed",selectedNodeIds:p,selectedEdgeIds:m,glowNodeIds:x,onSelectNode:M,onSelectEdge:k,onOpenSubFile:P,onCrossFileNavigate:B,showStereotypeBands:U=!0}){const ce=new Map;for(const ie of f.edges){if(ie.toFile!==void 0){const le=ce.get(ie.from)??new Set;le.add(ie.toFile),ce.set(ie.from,le)}if(ie.fromFile!==void 0){const le=ce.get(ie.to)??new Set;le.add(ie.fromFile),ce.set(ie.to,le)}}return I.jsxs(I.Fragment,{children:[I.jsxs("defs",{children:[I.jsx(ddn,{id:Vg}),I.jsx(bdn,{id:fI}),I.jsx(yGn,{id:hdn}),I.jsx(gdn,{id:bse}),I.jsx(wdn,{id:_7e})]}),I.jsx("g",{className:"archik-edges",children:f.edges.map(ie=>I.jsx(jGn,{edge:ie,...m!==void 0?{selectedEdgeIds:m}:{},...k!==void 0?{onSelectEdge:k}:{}},ie.id))}),I.jsx("g",{className:"archik-nodes",children:f.roots.map(ie=>I.jsx(adn,{node:ie,viewMode:d,showStereotypeBands:U,crossFileByNode:ce,...p!==void 0?{selectedNodeIds:p}:{},...x!==void 0?{glowNodeIds:x}:{},...M!==void 0?{onSelectNode:M}:{},...P!==void 0?{onOpenSubFile:P}:{},...B!==void 0?{onCrossFileNavigate:B}:{}},ie.id))})]})}function DGn(f,d){const p=(m,x,M)=>{for(const k of m){if(k.id===d)return{x:x+k.x+k.width/2,y:M+k.y+k.height/2};const P=p(k.children,x+k.x,M+k.y);if(P)return P}return null};return p(f.roots,0,0)}function $Gn({positioned:f,className:d,zoom:p=1,viewMode:m="detailed",svgRef:x,dragGhost:M,selectedNodeIds:k,selectedEdgeIds:P,glowNodeIds:B,onSelectNode:U,onSelectEdge:ce,onSelectNothing:ie,onOpenSubFile:le,onCrossFileNavigate:ye,diffStatuses:He,showStereotypeBands:re=!0}){const tn=Math.max(f.width,1),gn=Math.max(f.height,1),_n=-Hce,dn=-Hce,Rn=tn+Hce*2,ut=gn+Hce*2,dt=M?DGn(f,M.fromId):null;return I.jsxs("svg",{ref:x,className:d,xmlns:"http://www.w3.org/2000/svg",width:Rn*p,height:ut*p,viewBox:`${_n} ${dn} ${Rn} ${ut}`,preserveAspectRatio:"xMidYMid meet",style:{display:"block",flexShrink:0},onClick:ie,children:[He&&I.jsx(xGn,{statuses:He,scopeClass:"archik-diff-base"}),I.jsx("g",{className:He?"archik-diff-base":void 0,children:I.jsx(IGn,{positioned:f,viewMode:m,showStereotypeBands:re,...k!==void 0?{selectedNodeIds:k}:{},...P!==void 0?{selectedEdgeIds:P}:{},...B!==void 0?{glowNodeIds:B}:{},...U!==void 0?{onSelectNode:U}:{},...ce!==void 0?{onSelectEdge:ce}:{},...le!==void 0?{onOpenSubFile:le}:{},...ye!==void 0?{onCrossFileNavigate:ye}:{}})}),He&&I.jsxs(I.Fragment,{children:[I.jsx(_Gn,{positioned:f,statuses:He}),I.jsx(AGn,{positioned:f,statuses:He})]}),M&&dt&&I.jsxs("g",{className:"archik-drag-ghost",pointerEvents:"none",children:[I.jsx("line",{x1:dt.x,y1:dt.y,x2:M.pointerX,y2:M.pointerY,stroke:"var(--archik-selected)",strokeWidth:1.6,strokeDasharray:"6 4",strokeLinecap:"round",opacity:.85}),I.jsx("circle",{cx:M.pointerX,cy:M.pointerY,r:4,fill:"var(--archik-selected)",opacity:.9})]})]})}const LGn=.25,RGn=4,Xhn=1.2,PGn=6e-4,L8e=f=>Math.max(LGn,Math.min(RGn,f)),zGn=5;function BGn(f,d,p){const m=f.createSVGPoint();m.x=d,m.y=p;const x=f.getScreenCTM();if(!x)return{x:0,y:0};const M=m.matrixTransform(x.inverse());return{x:M.x,y:M.y}}function FGn({document:f,className:d,layoutOptions:p,viewMode:m="detailed",showStereotypeBands:x=!0,selectedNodeIds:M,selectedEdgeIds:k,onSelectNode:P,onSelectEdge:B,onSelectNothing:U,onConnectDrag:ce,onOpenSubFile:ie,onCrossFileNavigate:le,viewKey:ye,diffStatuses:He,glowNodeIds:re,svgRef:tn}){const gn=Xn.useMemo(()=>IBn(f,p),[f,p]),[_n,dn]=Xn.useState(null),[Rn,ut]=Xn.useState(1),[dt,Qn]=Xn.useState({type:"idle"}),pt=Xn.useRef(null),dr=Xn.useRef(null),tc=tn??dr,Rr=Xn.useRef(Rn);Rr.current=Rn;const Ni=Xn.useRef(new Map),Q=Xn.useRef(!1);Xn.useEffect(()=>{let it=!1;return gn.then(ki=>{it||dn(ki)}),()=>{it=!0}},[gn]);const Vu=_n!==null;Xn.useEffect(()=>{if(!Vu)return;const it=pt.current;if(!it)return;const ki=qr=>{if(!(qr.ctrlKey||qr.metaKey))return;qr.preventDefault();const Zc=Math.exp(-qr.deltaY*PGn);ut(Ke=>L8e(Ke*Zc))};return it.addEventListener("wheel",ki,{passive:!1}),()=>it.removeEventListener("wheel",ki)},[Vu]),Xn.useEffect(()=>{const it=pt.current;if(!it)return;const ki=qr=>{Q.current&&(Q.current=!1,qr.stopImmediatePropagation(),qr.preventDefault())};return it.addEventListener("click",ki,{capture:!0}),()=>it.removeEventListener("click",ki,{capture:!0})},[]),Xn.useEffect(()=>{if(ye===void 0)return;const it=ye;return()=>{const ki=pt.current;Ni.current.set(it,{zoom:Rr.current,scrollX:ki?.scrollLeft??0,scrollY:ki?.scrollTop??0})}},[ye]);const Pu=_n!==null;Xn.useEffect(()=>{if(ye===void 0||!Pu)return;const it=Ni.current.get(ye);ut(it?it.zoom:1);const ki=requestAnimationFrame(()=>{const qr=pt.current;qr&&(qr.scrollLeft=it?.scrollX??0,qr.scrollTop=it?.scrollY??0)});return()=>cancelAnimationFrame(ki)},[ye,Pu]);const Un=it=>{if(it.button!==0||it.metaKey||it.ctrlKey||it.shiftKey||!ce)return;const qr=(it.target instanceof Element?it.target:null)?.closest("[data-archik-node-id]");if(!qr)return;const Zc=qr.getAttribute("data-archik-node-id");if(!Zc)return;const Ke=it.clientX,et=it.clientY;let ti=!1;const ji=zu=>{if(!ti){const hu=zu.clientX-Ke,da=zu.clientY-et;if(Math.hypot(hu,da)<zGn)return;ti=!0}const Vs=tc.current;if(!Vs)return;const bh=BGn(Vs,zu.clientX,zu.clientY);Qn({type:"dragging",from:Zc,pointerSvgX:bh.x,pointerSvgY:bh.y})},br=()=>{window.removeEventListener("pointermove",ji),window.removeEventListener("pointerup",Kr),window.removeEventListener("pointercancel",Oc)},Kr=zu=>{if(br(),ti){const hu=globalThis.document.elementFromPoint(zu.clientX,zu.clientY)?.closest("[data-archik-node-id]")?.getAttribute("data-archik-node-id")??null;hu&&hu!==Zc&&ce&&ce(Zc,hu),Q.current=!0}Qn({type:"idle"})},Oc=()=>{br(),Qn({type:"idle"})};window.addEventListener("pointermove",ji),window.addEventListener("pointerup",Kr),window.addEventListener("pointercancel",Oc)};return _n?I.jsxs("div",{className:d,style:{position:"relative",overflow:"hidden"},children:[I.jsx("div",{ref:pt,onPointerDown:Un,onClick:it=>{it.target===it.currentTarget&&U&&U()},style:{width:"100%",height:"100%",overflow:"auto",display:"flex",justifyContent:"safe center",alignItems:"safe center"},children:I.jsx($Gn,{positioned:_n,zoom:Rn,viewMode:m,showStereotypeBands:x,svgRef:tc,dragGhost:dt.type==="dragging"?{fromId:dt.from,pointerX:dt.pointerSvgX,pointerY:dt.pointerSvgY}:null,...M!==void 0?{selectedNodeIds:M}:{},...k!==void 0?{selectedEdgeIds:k}:{},...P!==void 0?{onSelectNode:P}:{},...B!==void 0?{onSelectEdge:B}:{},...U!==void 0?{onSelectNothing:U}:{},...ie!==void 0?{onOpenSubFile:ie}:{},...le!==void 0?{onCrossFileNavigate:le}:{},...He!==void 0?{diffStatuses:He}:{},...re!==void 0?{glowNodeIds:re}:{}})}),I.jsx(qGn,{zoom:Rn,onZoomIn:()=>ut(it=>L8e(it*Xhn)),onZoomOut:()=>ut(it=>L8e(it/Xhn)),onZoomReset:()=>ut(1)})]}):I.jsx("div",{className:d,role:"status","aria-live":"polite",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",color:"#64748b",fontFamily:"Inter, system-ui, sans-serif",fontSize:13},children:"Laying out…"})}function qGn({zoom:f,onZoomIn:d,onZoomOut:p,onZoomReset:m}){return I.jsxs("div",{style:{position:"absolute",right:12,bottom:12,display:"flex",gap:4,padding:4,background:"var(--archik-panel)",border:"1px solid var(--archik-border)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.18)"},children:[I.jsx("button",{type:"button",onClick:p,title:"Zoom out","aria-label":"Zoom out",className:"archik-btn",style:{minWidth:28,padding:"0 8px",height:24},children:"−"}),I.jsxs("button",{type:"button",onClick:m,title:"Reset zoom (100%)","aria-label":"Reset zoom",className:"archik-btn",style:{minWidth:48,padding:"0 8px",height:24},children:[Math.round(f*100),"%"]}),I.jsx("button",{type:"button",onClick:d,title:"Zoom in","aria-label":"Zoom in",className:"archik-btn",style:{minWidth:28,padding:"0 8px",height:24},children:"+"})]})}const I7e=Symbol.for("yaml.alias"),o7e=Symbol.for("yaml.document"),Q8=Symbol.for("yaml.map"),mdn=Symbol.for("yaml.pair"),wy=Symbol.for("yaml.scalar"),MI=Symbol.for("yaml.seq"),Bp=Symbol.for("yaml.node.type"),i7=f=>!!f&&typeof f=="object"&&f[Bp]===I7e,TA=f=>!!f&&typeof f=="object"&&f[Bp]===o7e,CI=f=>!!f&&typeof f=="object"&&f[Bp]===Q8,Tl=f=>!!f&&typeof f=="object"&&f[Bp]===mdn,Ao=f=>!!f&&typeof f=="object"&&f[Bp]===wy,OI=f=>!!f&&typeof f=="object"&&f[Bp]===MI;function rf(f){if(f&&typeof f=="object")switch(f[Bp]){case Q8:case MI:return!0}return!1}function cf(f){if(f&&typeof f=="object")switch(f[Bp]){case I7e:case Q8:case wy:case MI:return!0}return!1}const vdn=f=>(Ao(f)||rf(f))&&!!f.anchor,Ib=Symbol("break visit"),ydn=Symbol("skip children"),gy=Symbol("remove node");function MA(f,d){const p=kdn(d);TA(f)?aI(null,f.contents,p,Object.freeze([f]))===gy&&(f.contents=null):aI(null,f,p,Object.freeze([]))}MA.BREAK=Ib;MA.SKIP=ydn;MA.REMOVE=gy;function aI(f,d,p,m){const x=jdn(f,d,p,m);if(cf(x)||Tl(x))return Sdn(f,m,x),aI(f,x,p,m);if(typeof x!="symbol"){if(rf(d)){m=Object.freeze(m.concat(d));for(let M=0;M<d.items.length;++M){const k=aI(M,d.items[M],p,m);if(typeof k=="number")M=k-1;else{if(k===Ib)return Ib;k===gy&&(d.items.splice(M,1),M-=1)}}}else if(Tl(d)){m=Object.freeze(m.concat(d));const M=aI("key",d.key,p,m);if(M===Ib)return Ib;M===gy&&(d.key=null);const k=aI("value",d.value,p,m);if(k===Ib)return Ib;k===gy&&(d.value=null)}}return x}async function Mse(f,d){const p=kdn(d);TA(f)?await hI(null,f.contents,p,Object.freeze([f]))===gy&&(f.contents=null):await hI(null,f,p,Object.freeze([]))}Mse.BREAK=Ib;Mse.SKIP=ydn;Mse.REMOVE=gy;async function hI(f,d,p,m){const x=await jdn(f,d,p,m);if(cf(x)||Tl(x))return Sdn(f,m,x),hI(f,x,p,m);if(typeof x!="symbol"){if(rf(d)){m=Object.freeze(m.concat(d));for(let M=0;M<d.items.length;++M){const k=await hI(M,d.items[M],p,m);if(typeof k=="number")M=k-1;else{if(k===Ib)return Ib;k===gy&&(d.items.splice(M,1),M-=1)}}}else if(Tl(d)){m=Object.freeze(m.concat(d));const M=await hI("key",d.key,p,m);if(M===Ib)return Ib;M===gy&&(d.key=null);const k=await hI("value",d.value,p,m);if(k===Ib)return Ib;k===gy&&(d.value=null)}}return x}function kdn(f){return typeof f=="object"&&(f.Collection||f.Node||f.Value)?Object.assign({Alias:f.Node,Map:f.Node,Scalar:f.Node,Seq:f.Node},f.Value&&{Map:f.Value,Scalar:f.Value,Seq:f.Value},f.Collection&&{Map:f.Collection,Seq:f.Collection},f):f}function jdn(f,d,p,m){if(typeof p=="function")return p(f,d,m);if(CI(d))return p.Map?.(f,d,m);if(OI(d))return p.Seq?.(f,d,m);if(Tl(d))return p.Pair?.(f,d,m);if(Ao(d))return p.Scalar?.(f,d,m);if(i7(d))return p.Alias?.(f,d,m)}function Sdn(f,d,p){const m=d[d.length-1];if(rf(m))m.items[f]=p;else if(Tl(m))f==="key"?m.key=p:m.value=p;else if(TA(m))m.contents=p;else{const x=i7(m)?"alias":"scalar";throw new Error(`Cannot replace node with ${x} parent`)}}const GGn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},UGn=f=>f.replace(/[!,[\]{}]/g,d=>GGn[d]);class E0{constructor(d,p){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},E0.defaultYaml,d),this.tags=Object.assign({},E0.defaultTags,p)}clone(){const d=new E0(this.yaml,this.tags);return d.docStart=this.docStart,d}atDocument(){const d=new E0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:E0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},E0.defaultTags);break}return d}add(d,p){this.atNextDocument&&(this.yaml={explicit:E0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},E0.defaultTags),this.atNextDocument=!1);const m=d.trim().split(/[ \t]+/),x=m.shift();switch(x){case"%TAG":{if(m.length!==2&&(p(0,"%TAG directive should contain exactly two parts"),m.length<2))return!1;const[M,k]=m;return this.tags[M]=k,!0}case"%YAML":{if(this.yaml.explicit=!0,m.length!==1)return p(0,"%YAML directive should contain exactly one part"),!1;const[M]=m;if(M==="1.1"||M==="1.2")return this.yaml.version=M,!0;{const k=/^\d+\.\d+$/.test(M);return p(6,`Unsupported YAML version ${M}`,k),!1}}default:return p(0,`Unknown directive ${x}`,!0),!1}}tagName(d,p){if(d==="!")return"!";if(d[0]!=="!")return p(`Not a valid tag: ${d}`),null;if(d[1]==="<"){const k=d.slice(2,-1);return k==="!"||k==="!!"?(p(`Verbatim tags aren't resolved, so ${d} is invalid.`),null):(d[d.length-1]!==">"&&p("Verbatim tags must end with a >"),k)}const[,m,x]=d.match(/^(.*!)([^!]*)$/s);x||p(`The ${d} tag has no suffix`);const M=this.tags[m];if(M)try{return M+decodeURIComponent(x)}catch(k){return p(String(k)),null}return m==="!"?d:(p(`Could not resolve tag: ${d}`),null)}tagString(d){for(const[p,m]of Object.entries(this.tags))if(d.startsWith(m))return p+UGn(d.substring(m.length));return d[0]==="!"?d:`!<${d}>`}toString(d){const p=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],m=Object.entries(this.tags);let x;if(d&&m.length>0&&cf(d.contents)){const M={};MA(d.contents,(k,P)=>{cf(P)&&P.tag&&(M[P.tag]=!0)}),x=Object.keys(M)}else x=[];for(const[M,k]of m)M==="!!"&&k==="tag:yaml.org,2002:"||(!d||x.some(P=>P.startsWith(k)))&&p.push(`%TAG ${M} ${k}`);return p.join(`
|
|
37
37
|
`)}}E0.defaultYaml={explicit:!1,version:"1.2"};E0.defaultTags={"!!":"tag:yaml.org,2002:"};function Edn(f){if(/[\x00-\x19\s,[\]{}]/.test(f)){const p=`Anchor must not contain whitespace or control characters: ${JSON.stringify(f)}`;throw new Error(p)}return!0}function xdn(f){const d=new Set;return MA(f,{Value(p,m){m.anchor&&d.add(m.anchor)}}),d}function Adn(f,d){for(let p=1;;++p){const m=`${f}${p}`;if(!d.has(m))return m}}function JGn(f,d){const p=[],m=new Map;let x=null;return{onAnchor:M=>{p.push(M),x??(x=xdn(f));const k=Adn(d,x);return x.add(k),k},setAnchors:()=>{for(const M of p){const k=m.get(M);if(typeof k=="object"&&k.anchor&&(Ao(k.node)||rf(k.node)))k.node.anchor=k.anchor;else{const P=new Error("Failed to resolve repeated object (this should not happen)");throw P.source=M,P}}},sourceObjects:m}}function dI(f,d,p,m){if(m&&typeof m=="object")if(Array.isArray(m))for(let x=0,M=m.length;x<M;++x){const k=m[x],P=dI(f,m,String(x),k);P===void 0?delete m[x]:P!==k&&(m[x]=P)}else if(m instanceof Map)for(const x of Array.from(m.keys())){const M=m.get(x),k=dI(f,m,x,M);k===void 0?m.delete(x):k!==M&&m.set(x,k)}else if(m instanceof Set)for(const x of Array.from(m)){const M=dI(f,m,x,x);M===void 0?m.delete(x):M!==x&&(m.delete(x),m.add(M))}else for(const[x,M]of Object.entries(m)){const k=dI(f,m,x,M);k===void 0?delete m[x]:k!==M&&(m[x]=k)}return f.call(d,p,m)}function Pp(f,d,p){if(Array.isArray(f))return f.map((m,x)=>Pp(m,String(x),p));if(f&&typeof f.toJSON=="function"){if(!p||!vdn(f))return f.toJSON(d,p);const m={aliasCount:0,count:1,res:void 0};p.anchors.set(f,m),p.onCreate=M=>{m.res=M,delete p.onCreate};const x=f.toJSON(d,p);return p.onCreate&&p.onCreate(x),x}return typeof f=="bigint"&&!p?.keep?Number(f):f}class D7e{constructor(d){Object.defineProperty(this,Bp,{value:d})}clone(){const d=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(d.range=this.range.slice()),d}toJS(d,{mapAsMap:p,maxAliasCount:m,onAnchor:x,reviver:M}={}){if(!TA(d))throw new TypeError("A document argument is required");const k={anchors:new Map,doc:d,keep:!0,mapAsMap:p===!0,mapKeyWarned:!1,maxAliasCount:typeof m=="number"?m:100},P=Pp(this,"",k);if(typeof x=="function")for(const{count:B,res:U}of k.anchors.values())x(U,B);return typeof M=="function"?dI(M,{"":P},"",P):P}}class Cse extends D7e{constructor(d){super(I7e),this.source=d,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(d,p){let m;p?.aliasResolveCache?m=p.aliasResolveCache:(m=[],MA(d,{Node:(M,k)=>{(i7(k)||vdn(k))&&m.push(k)}}),p&&(p.aliasResolveCache=m));let x;for(const M of m){if(M===this)break;M.anchor===this.source&&(x=M)}return x}toJSON(d,p){if(!p)return{source:this.source};const{anchors:m,doc:x,maxAliasCount:M}=p,k=this.resolve(x,p);if(!k){const B=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(B)}let P=m.get(k);if(P||(Pp(k,null,p),P=m.get(k)),P?.res===void 0){const B="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(B)}if(M>=0&&(P.count+=1,P.aliasCount===0&&(P.aliasCount=fse(x,k,m)),P.count*P.aliasCount>M)){const B="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(B)}return P.res}toString(d,p,m){const x=`*${this.source}`;if(d){if(Edn(this.source),d.options.verifyAliasOrder&&!d.anchors.has(this.source)){const M=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(M)}if(d.implicitKey)return`${x} `}return x}}function fse(f,d,p){if(i7(d)){const m=d.resolve(f),x=p&&m&&p.get(m);return x?x.count*x.aliasCount:0}else if(rf(d)){let m=0;for(const x of d.items){const M=fse(f,x,p);M>m&&(m=M)}return m}else if(Tl(d)){const m=fse(f,d.key,p),x=fse(f,d.value,p);return Math.max(m,x)}return 1}const Tdn=f=>!f||typeof f!="function"&&typeof f!="object";class vc extends D7e{constructor(d){super(wy),this.value=d}toJSON(d,p){return p?.keep?this.value:Pp(this.value,d,p)}toString(){return String(this.value)}}vc.BLOCK_FOLDED="BLOCK_FOLDED";vc.BLOCK_LITERAL="BLOCK_LITERAL";vc.PLAIN="PLAIN";vc.QUOTE_DOUBLE="QUOTE_DOUBLE";vc.QUOTE_SINGLE="QUOTE_SINGLE";const HGn="tag:yaml.org,2002:";function KGn(f,d,p){if(d){const m=p.filter(M=>M.tag===d),x=m.find(M=>!M.format)??m[0];if(!x)throw new Error(`Tag ${d} not found`);return x}return p.find(m=>m.identify?.(f)&&!m.format)}function sJ(f,d,p){if(TA(f)&&(f=f.contents),cf(f))return f;if(Tl(f)){const ie=p.schema[Q8].createNode?.(p.schema,null,p);return ie.items.push(f),ie}(f instanceof String||f instanceof Number||f instanceof Boolean||typeof BigInt<"u"&&f instanceof BigInt)&&(f=f.valueOf());const{aliasDuplicateObjects:m,onAnchor:x,onTagObj:M,schema:k,sourceObjects:P}=p;let B;if(m&&f&&typeof f=="object"){if(B=P.get(f),B)return B.anchor??(B.anchor=x(f)),new Cse(B.anchor);B={anchor:null,node:null},P.set(f,B)}d?.startsWith("!!")&&(d=HGn+d.slice(2));let U=KGn(f,d,k.tags);if(!U){if(f&&typeof f.toJSON=="function"&&(f=f.toJSON()),!f||typeof f!="object"){const ie=new vc(f);return B&&(B.node=ie),ie}U=f instanceof Map?k[Q8]:Symbol.iterator in Object(f)?k[MI]:k[Q8]}M&&(M(U),delete p.onTagObj);const ce=U?.createNode?U.createNode(p.schema,f,p):typeof U?.nodeClass?.from=="function"?U.nodeClass.from(p.schema,f,p):new vc(f);return d?ce.tag=d:U.default||(ce.tag=U.tag),B&&(B.node=ce),ce}function gse(f,d,p){let m=p;for(let x=d.length-1;x>=0;--x){const M=d[x];if(typeof M=="number"&&Number.isInteger(M)&&M>=0){const k=[];k[M]=m,m=k}else m=new Map([[M,m]])}return sJ(m,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:f,sourceObjects:new Map})}const tJ=f=>f==null||typeof f=="object"&&!!f[Symbol.iterator]().next().done;class Mdn extends D7e{constructor(d,p){super(d),Object.defineProperty(this,"schema",{value:p,configurable:!0,enumerable:!1,writable:!0})}clone(d){const p=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return d&&(p.schema=d),p.items=p.items.map(m=>cf(m)||Tl(m)?m.clone(d):m),this.range&&(p.range=this.range.slice()),p}addIn(d,p){if(tJ(d))this.add(p);else{const[m,...x]=d,M=this.get(m,!0);if(rf(M))M.addIn(x,p);else if(M===void 0&&this.schema)this.set(m,gse(this.schema,x,p));else throw new Error(`Expected YAML collection at ${m}. Remaining path: ${x}`)}}deleteIn(d){const[p,...m]=d;if(m.length===0)return this.delete(p);const x=this.get(p,!0);if(rf(x))return x.deleteIn(m);throw new Error(`Expected YAML collection at ${p}. Remaining path: ${m}`)}getIn(d,p){const[m,...x]=d,M=this.get(m,!0);return x.length===0?!p&&Ao(M)?M.value:M:rf(M)?M.getIn(x,p):void 0}hasAllNullValues(d){return this.items.every(p=>{if(!Tl(p))return!1;const m=p.value;return m==null||d&&Ao(m)&&m.value==null&&!m.commentBefore&&!m.comment&&!m.tag})}hasIn(d){const[p,...m]=d;if(m.length===0)return this.has(p);const x=this.get(p,!0);return rf(x)?x.hasIn(m):!1}setIn(d,p){const[m,...x]=d;if(x.length===0)this.set(m,p);else{const M=this.get(m,!0);if(rf(M))M.setIn(x,p);else if(M===void 0&&this.schema)this.set(m,gse(this.schema,x,p));else throw new Error(`Expected YAML collection at ${m}. Remaining path: ${x}`)}}}const ZGn=f=>f.replace(/^(?!$)(?: $)?/gm,"#");function ck(f,d){return/^\n+$/.test(f)?f.substring(1):d?f.replace(/^(?! *$)/gm,d):f}const jA=(f,d,p)=>f.endsWith(`
|
|
38
38
|
`)?ck(p,d):p.includes(`
|
package/dist/ui/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
} catch {}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-CzHO482b.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-DtElneid.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "archik",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "The shared vocabulary between you and Claude Code, at the engineering level. Plain-YAML architecture diagrams with a live browser canvas, headless SVG render in CI, and an installable Claude skill so the model treats the diagram as the spec.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"architecture",
|