@justyork/repo-mind 0.7.2 → 0.8.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.
Files changed (76) hide show
  1. package/.cursor/skills/repomind-docs/SKILL.md +160 -0
  2. package/.cursor/skills/repomind-docs/examples.md +429 -0
  3. package/.cursor/skills/repomind-docs/reference.md +209 -0
  4. package/.cursor/skills/repomind-docs/structure.md +132 -0
  5. package/dist/cli.js +17 -0
  6. package/dist/commands/install-skill.d.ts +9 -0
  7. package/dist/commands/install-skill.js +35 -0
  8. package/dist/commands/ui.js +5 -1
  9. package/dist/ui/auth.d.ts +21 -0
  10. package/dist/ui/auth.js +117 -0
  11. package/dist/ui/fs-operations.d.ts +1 -1
  12. package/dist/ui/fs-operations.js +36 -4
  13. package/dist/ui/fs-tree.d.ts +5 -4
  14. package/dist/ui/fs-tree.js +60 -56
  15. package/dist/ui/server.d.ts +2 -0
  16. package/dist/ui/server.js +63 -2
  17. package/package.json +3 -2
  18. package/ui/dist/assets/{arc-C1R_fyW-.js → arc-BitGDA7a.js} +1 -1
  19. package/ui/dist/assets/{architectureDiagram-3BPJPVTR-CcuF3FYc.js → architectureDiagram-3BPJPVTR-BmY2OtU5.js} +1 -1
  20. package/ui/dist/assets/{blockDiagram-GPEHLZMM-BZJKe3Ei.js → blockDiagram-GPEHLZMM-btai_20t.js} +1 -1
  21. package/ui/dist/assets/{c4Diagram-AAUBKEIU-D_0fRNGS.js → c4Diagram-AAUBKEIU-CN-pXtFe.js} +1 -1
  22. package/ui/dist/assets/channel-D1plp4bS.js +1 -0
  23. package/ui/dist/assets/{chunk-2J33WTMH-0LcH4vIA.js → chunk-2J33WTMH-CUgwCKKP.js} +1 -1
  24. package/ui/dist/assets/{chunk-4BX2VUAB-DU1h67AD.js → chunk-4BX2VUAB-ZXi72_qf.js} +1 -1
  25. package/ui/dist/assets/{chunk-55IACEB6-BCx7dyYV.js → chunk-55IACEB6-BvoNhEcH.js} +1 -1
  26. package/ui/dist/assets/{chunk-727SXJPM-CRO5yOrB.js → chunk-727SXJPM-CPVv-LcP.js} +1 -1
  27. package/ui/dist/assets/{chunk-AQP2D5EJ-BayHdr67.js → chunk-AQP2D5EJ-15HMmfKe.js} +1 -1
  28. package/ui/dist/assets/{chunk-FMBD7UC4-CJemLien.js → chunk-FMBD7UC4-CTJu1mOO.js} +1 -1
  29. package/ui/dist/assets/{chunk-ND2GUHAM-B_z-tw44.js → chunk-ND2GUHAM-BaS37xMv.js} +1 -1
  30. package/ui/dist/assets/{chunk-QZHKN3VN-D40rAh_S.js → chunk-QZHKN3VN-CzNZR3D9.js} +1 -1
  31. package/ui/dist/assets/classDiagram-4FO5ZUOK-BsDWU9KJ.js +1 -0
  32. package/ui/dist/assets/classDiagram-v2-Q7XG4LA2-BsDWU9KJ.js +1 -0
  33. package/ui/dist/assets/{cose-bilkent-S5V4N54A-Cqthtrrq.js → cose-bilkent-S5V4N54A-mpC0WnuY.js} +1 -1
  34. package/ui/dist/assets/{dagre-BM42HDAG-CrxsyXEa.js → dagre-BM42HDAG-DVbZMTFr.js} +1 -1
  35. package/ui/dist/assets/{diagram-2AECGRRQ-DTYA7Rrn.js → diagram-2AECGRRQ-BvYsIaeC.js} +1 -1
  36. package/ui/dist/assets/{diagram-5GNKFQAL-CXs7RV13.js → diagram-5GNKFQAL-mM_4t2hT.js} +1 -1
  37. package/ui/dist/assets/{diagram-KO2AKTUF-Bf8EeV_S.js → diagram-KO2AKTUF-u5t0FZtc.js} +1 -1
  38. package/ui/dist/assets/{diagram-LMA3HP47-C2XWB0cI.js → diagram-LMA3HP47-Ngnghl4t.js} +1 -1
  39. package/ui/dist/assets/{diagram-OG6HWLK6-BNMXob9h.js → diagram-OG6HWLK6-DxCLvBmh.js} +1 -1
  40. package/ui/dist/assets/{erDiagram-TEJ5UH35-CnSczOvb.js → erDiagram-TEJ5UH35-Cblf5xKO.js} +1 -1
  41. package/ui/dist/assets/{flowDiagram-I6XJVG4X-DwZBJ2fr.js → flowDiagram-I6XJVG4X-3aVBpTd3.js} +1 -1
  42. package/ui/dist/assets/{ganttDiagram-6RSMTGT7-rxwvD8xn.js → ganttDiagram-6RSMTGT7-CCk8vbkn.js} +1 -1
  43. package/ui/dist/assets/{gitGraphDiagram-PVQCEYII-DjJPiQ2K.js → gitGraphDiagram-PVQCEYII-DLUIS6md.js} +1 -1
  44. package/ui/dist/assets/graph-DwaX8nDF.js +2 -0
  45. package/ui/dist/assets/{infoDiagram-5YYISTIA-BHgtQpBK.js → infoDiagram-5YYISTIA-C6umdFYV.js} +1 -1
  46. package/ui/dist/assets/{ishikawaDiagram-YF4QCWOH-BZ38ndde.js → ishikawaDiagram-YF4QCWOH-H8wERm8_.js} +1 -1
  47. package/ui/dist/assets/{journeyDiagram-JHISSGLW-CNaZf5VN.js → journeyDiagram-JHISSGLW-DnTRQ6Mn.js} +1 -1
  48. package/ui/dist/assets/{kanban-definition-UN3LZRKU-4h1Jmt_X.js → kanban-definition-UN3LZRKU-DrVEsZSL.js} +1 -1
  49. package/ui/dist/assets/main-C0Y60ppL.js +269 -0
  50. package/ui/dist/assets/{mermaid.core-BZZdRyuR.js → mermaid.core-BtOBEW5j.js} +4 -4
  51. package/ui/dist/assets/{mindmap-definition-RKZ34NQL-DG_NciLX.js → mindmap-definition-RKZ34NQL-BFEjh9BY.js} +1 -1
  52. package/ui/dist/assets/{pieDiagram-4H26LBE5-B9FyPCLY.js → pieDiagram-4H26LBE5-KLu3myN4.js} +1 -1
  53. package/ui/dist/assets/{quadrantDiagram-W4KKPZXB-B89WFfQu.js → quadrantDiagram-W4KKPZXB-DwSP1nfl.js} +1 -1
  54. package/ui/dist/assets/{requirementDiagram-4Y6WPE33-BYHKePgB.js → requirementDiagram-4Y6WPE33-CTe59AWj.js} +1 -1
  55. package/ui/dist/assets/{sankeyDiagram-5OEKKPKP-BW6YuBQM.js → sankeyDiagram-5OEKKPKP-DBG4pZal.js} +1 -1
  56. package/ui/dist/assets/{sequenceDiagram-3UESZ5HK-BnojqKwf.js → sequenceDiagram-3UESZ5HK-BV9E_Iae.js} +1 -1
  57. package/ui/dist/assets/{stateDiagram-AJRCARHV-C_x9t2o6.js → stateDiagram-AJRCARHV-BWnAUqpA.js} +1 -1
  58. package/ui/dist/assets/stateDiagram-v2-BHNVJYJU-yNXWOXzs.js +1 -0
  59. package/ui/dist/assets/theme-CfkLgQFf.js +21 -0
  60. package/ui/dist/assets/theme-DJYNWCef.css +1 -0
  61. package/ui/dist/assets/{timeline-definition-PNZ67QCA-CI8Ngfzv.js → timeline-definition-PNZ67QCA-DDoGl25M.js} +1 -1
  62. package/ui/dist/assets/{vennDiagram-CIIHVFJN-CPRKGc2P.js → vennDiagram-CIIHVFJN-DVRPIJjW.js} +1 -1
  63. package/ui/dist/assets/{visual-editor-DUVPRlY3.js → visual-editor-COzWiJ8C.js} +12 -12
  64. package/ui/dist/assets/{wardley-L42UT6IY-CZY42jFT.js → wardley-L42UT6IY-Li08EMdE.js} +1 -1
  65. package/ui/dist/assets/{wardleyDiagram-YWT4CUSO-CGKyWKnw.js → wardleyDiagram-YWT4CUSO-BA2E9m1f.js} +1 -1
  66. package/ui/dist/assets/{xychartDiagram-2RQKCTM6-Cq-onAc3.js → xychartDiagram-2RQKCTM6-DKHRvUg5.js} +1 -1
  67. package/ui/dist/graph.html +3 -3
  68. package/ui/dist/index.html +3 -3
  69. package/ui/dist/assets/channel-BlWnHbuq.js +0 -1
  70. package/ui/dist/assets/classDiagram-4FO5ZUOK-D3OdfPqd.js +0 -1
  71. package/ui/dist/assets/classDiagram-v2-Q7XG4LA2-D3OdfPqd.js +0 -1
  72. package/ui/dist/assets/graph-D_tIaE_I.js +0 -2
  73. package/ui/dist/assets/main-BeHrzLrS.js +0 -273
  74. package/ui/dist/assets/stateDiagram-v2-BHNVJYJU-CBZx8gKT.js +0 -1
  75. package/ui/dist/assets/theme-CFHWfrn1.css +0 -1
  76. package/ui/dist/assets/theme-DS1fBM5L.js +0 -1
@@ -1,4 +1,4 @@
1
- import{s as zt,g as Lt,p as Tt,o as At,a as Xt,b as Et,_ as y,I as Yt,C as It,E as Q,l as et,H as Bt,d as Ft,y as Rt,c as V}from"./mermaid.core-BZZdRyuR.js";import{p as Ot}from"./chunk-4BX2VUAB-DU1h67AD.js";import{p as Wt}from"./wardley-L42UT6IY-CZY42jFT.js";import"./main-BeHrzLrS.js";import"./theme-DS1fBM5L.js";import"./editor-CTtDusro.js";import"./transform-BwXaE9hv.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Ot(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,L=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,Ht=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new Ht;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Rt()}y(wt,"clear");var qt={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Et,getAccTitle:Xt,setDiagramTitle:At,getDiagramTitle:Tt,getAccDescription:Lt,setAccDescription:zt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,L,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var J,K;et.debug(`Rendering Wardley map
1
+ import{s as zt,g as Lt,p as Tt,o as At,a as Xt,b as Et,_ as y,I as Yt,C as It,E as Q,l as et,H as Bt,d as Ft,y as Rt,c as V}from"./mermaid.core-BtOBEW5j.js";import{p as Ot}from"./chunk-4BX2VUAB-ZXi72_qf.js";import{p as Wt}from"./wardley-L42UT6IY-Li08EMdE.js";import"./main-C0Y60ppL.js";import"./theme-CfkLgQFf.js";import"./editor-CTtDusro.js";import"./transform-BwXaE9hv.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(Ot(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,L=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,Ht=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new Ht;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Rt()}y(wt,"clear");var qt={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Et,getAccTitle:Xt,setDiagramTitle:At,getDiagramTitle:Tt,getAccDescription:Lt,setAccDescription:zt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,L,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var J,K;et.debug(`Rendering Wardley map
2
2
  `+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),L=v.getDiagramTitle(),M=((J=g.size)==null?void 0:J.width)??r.width,k=((K=g.size)==null?void 0:K.height)??r.height,N=Bt(o);N.selectAll("*").remove(),Ft(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),H=N.append("defs");H.append("marker").attr("id",`arrow-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-end-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-start-${o}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const B=M-r.padding*2,F=k-r.padding*2;L&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(L);const T=y(t=>r.padding+t/100*B,"projectX"),A=y(t=>k-r.padding-t/100*F,"projectY"),O=P.append("g").attr("class","wardley-axes");O.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+B/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+F/2})`).text(bt);const R=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(R.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===R.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/R.length;R.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}R.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*B,f=r.padding+l.end*B,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+B*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-F*s).attr("y2",k-r.padding-F*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:A(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f<i.length-1;f++){const u=i[f],w=i[f+1];n.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,l=-1/0,x=0;if(s.componentIds.forEach(f=>{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const z=(h+l)/2;S.x=z,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+30).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,z=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${z} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=T(t.targetX),i=A(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const C=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));C.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const X=C.filter(t=>t.sourceStrategy==="market");X.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const q=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",q).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:T(i.x),y:A(i.y)}));if(s.length>1)for(let i=0;i<s.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[i].x).attr("y1",s[i].y).attr("x2",s[i+1].x).attr("y2",s[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach(i=>{const h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=T(g.annotationsBox.x),s=A(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const z=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(z)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const z=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-z,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",z).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=T(n.x),i=A(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
3
3
  M ${s} ${i-l/2}
4
4
  L ${s+h-x} ${i-l/2}
@@ -1,4 +1,4 @@
1
- import{s as gi,g as xi,p as Xt,o as di,a as fi,b as pi,_ as a,l as Yt,H as mi,d as yi,y as bi,C as _t,h as Ai,E as Nt,F as wi,I as Ci,al as Si,Q as Wt}from"./mermaid.core-BZZdRyuR.js";import"./transform-BwXaE9hv.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as zt}from"./linear-COY9pyF4.js";import"./main-BeHrzLrS.js";import"./theme-DS1fBM5L.js";import"./editor-CTtDusro.js";import"./defaultLocale-DX6XiGOO.js";function Ri(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function bt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,u,p=!1,f=0,T=0,P=.5;delete e.unknown;function _(){var y=t().length,E=n<s,v=E?n:s,L=E?s:n;o=(L-v)/Math.max(1,y-f+T*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-f))*P,u=o*(1-f),p&&(v=Math.round(v),u=Math.round(u));var I=Ri(y).map(function(m){return v+o*m});return i(E?I.reverse():I)}return e.domain=function(y){return arguments.length?(t(y),_()):t()},e.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,_()):[s,n]},e.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,p=!0,_()},e.bandwidth=function(){return u},e.step=function(){return o},e.round=function(y){return arguments.length?(p=!!y,_()):p},e.padding=function(y){return arguments.length?(f=Math.min(1,T=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(T=+y,_()):T},e.align=function(y){return arguments.length?(P=Math.max(0,Math.min(1,y)),_()):P},e.copy=function(){return bt(t(),[s,n]).round(p).paddingInner(f).paddingOuter(T).align(P)},_i.apply(_(),arguments)}var At=(function(){var e=a(function(F,h,c,g){for(c=c||{},g=F.length;g--;c[F[g]]=h);return c},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],u=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],f=[1,25],T=[1,26],P=[1,28],_=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],I=[1,34],m=[1,35],R=[1,36],l=[1,37],W=[1,43],O=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],b=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],w=[1,64],V={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,c,g,x,C,r,rt){var d=r.length-1;switch(C){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:u}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:u}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:u}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:u}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:u}),{11:23,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:39,13:38,24:W,27:O,29:40,30:41,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:45,15:44,27:X,33:46,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:49,17:48,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:52,17:51,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(U,[2,37],{40:55,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l}),e(U,[2,38]),e(U,[2,39]),e(b,[2,40]),e(b,[2,42]),e(b,[2,43]),e(b,[2,44]),e(b,[2,45]),e(b,[2,46]),e(b,[2,47]),e(b,[2,48]),e(b,[2,49]),e(b,[2,50]),e(b,[2,51]),e(S,[2,10]),e(S,[2,22],{30:41,29:56,24:W,27:O}),e(S,[2,24]),e(S,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,11]),e(S,[2,30],{33:60,27:X}),e(S,[2,32]),{31:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:w},e(S,[2,14]),{17:65,24:Y},e(S,[2,16]),e(S,[2,17]),e(b,[2,41]),e(S,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(S,[2,31]),{27:[1,69]},e(S,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(S,[2,15]),e(S,[2,26]),e(S,[2,27]),{11:59,32:72,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,33]),e(S,[2,19]),{25:73,27:w},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,c){if(c.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=c,g}},"parseError"),parse:a(function(h){var c=this,g=[0],x=[],C=[null],r=[],rt=this.table,d="",ct=0,It=0,hi=2,Mt=1,li=r.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ft)&&($.yy[ft]=this.yy[ft]);D.setInput(h,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var pt=D.yylloc;r.push(pt);var ci=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(B){g.length=g.length-2*B,C.length=C.length-B,r.length=r.length-B}a(ui,"popStack");function Vt(){var B;return B=x.pop()||D.lex()||Mt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=c.symbols_[B]||B),B}a(Vt,"lex");for(var M,q,z,mt,G={},ut,N,Bt,gt;;){if(q=g[g.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=Vt()),z=rt[q]&&rt[q][M]),typeof z>"u"||!z.length||!z[0]){var yt="";gt=[];for(ut in rt[q])this.terminals_[ut]&&ut>hi&&gt.push("'"+this.terminals_[ut]+"'");D.showPosition?yt="Parse error on line "+(ct+1)+`:
1
+ import{s as gi,g as xi,p as Xt,o as di,a as fi,b as pi,_ as a,l as Yt,H as mi,d as yi,y as bi,C as _t,h as Ai,E as Nt,F as wi,I as Ci,al as Si,Q as Wt}from"./mermaid.core-BtOBEW5j.js";import"./transform-BwXaE9hv.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as zt}from"./linear-COY9pyF4.js";import"./main-C0Y60ppL.js";import"./theme-CfkLgQFf.js";import"./editor-CTtDusro.js";import"./defaultLocale-DX6XiGOO.js";function Ri(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function bt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,u,p=!1,f=0,T=0,P=.5;delete e.unknown;function _(){var y=t().length,E=n<s,v=E?n:s,L=E?s:n;o=(L-v)/Math.max(1,y-f+T*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-f))*P,u=o*(1-f),p&&(v=Math.round(v),u=Math.round(u));var I=Ri(y).map(function(m){return v+o*m});return i(E?I.reverse():I)}return e.domain=function(y){return arguments.length?(t(y),_()):t()},e.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,_()):[s,n]},e.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,p=!0,_()},e.bandwidth=function(){return u},e.step=function(){return o},e.round=function(y){return arguments.length?(p=!!y,_()):p},e.padding=function(y){return arguments.length?(f=Math.min(1,T=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(T=+y,_()):T},e.align=function(y){return arguments.length?(P=Math.max(0,Math.min(1,y)),_()):P},e.copy=function(){return bt(t(),[s,n]).round(p).paddingInner(f).paddingOuter(T).align(P)},_i.apply(_(),arguments)}var At=(function(){var e=a(function(F,h,c,g){for(c=c||{},g=F.length;g--;c[F[g]]=h);return c},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],u=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],f=[1,25],T=[1,26],P=[1,28],_=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],I=[1,34],m=[1,35],R=[1,36],l=[1,37],W=[1,43],O=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],b=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],w=[1,64],V={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,c,g,x,C,r,rt){var d=r.length-1;switch(C){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:u}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:u}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:u}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:u}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:u}),{11:23,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:39,13:38,24:W,27:O,29:40,30:41,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:45,15:44,27:X,33:46,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:49,17:48,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:52,17:51,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(U,[2,37],{40:55,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l}),e(U,[2,38]),e(U,[2,39]),e(b,[2,40]),e(b,[2,42]),e(b,[2,43]),e(b,[2,44]),e(b,[2,45]),e(b,[2,46]),e(b,[2,47]),e(b,[2,48]),e(b,[2,49]),e(b,[2,50]),e(b,[2,51]),e(S,[2,10]),e(S,[2,22],{30:41,29:56,24:W,27:O}),e(S,[2,24]),e(S,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,11]),e(S,[2,30],{33:60,27:X}),e(S,[2,32]),{31:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:w},e(S,[2,14]),{17:65,24:Y},e(S,[2,16]),e(S,[2,17]),e(b,[2,41]),e(S,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(S,[2,31]),{27:[1,69]},e(S,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(S,[2,15]),e(S,[2,26]),e(S,[2,27]),{11:59,32:72,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,33]),e(S,[2,19]),{25:73,27:w},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,c){if(c.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=c,g}},"parseError"),parse:a(function(h){var c=this,g=[0],x=[],C=[null],r=[],rt=this.table,d="",ct=0,It=0,hi=2,Mt=1,li=r.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ft)&&($.yy[ft]=this.yy[ft]);D.setInput(h,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var pt=D.yylloc;r.push(pt);var ci=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(B){g.length=g.length-2*B,C.length=C.length-B,r.length=r.length-B}a(ui,"popStack");function Vt(){var B;return B=x.pop()||D.lex()||Mt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=c.symbols_[B]||B),B}a(Vt,"lex");for(var M,q,z,mt,G={},ut,N,Bt,gt;;){if(q=g[g.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=Vt()),z=rt[q]&&rt[q][M]),typeof z>"u"||!z.length||!z[0]){var yt="";gt=[];for(ut in rt[q])this.terminals_[ut]&&ut>hi&&gt.push("'"+this.terminals_[ut]+"'");D.showPosition?yt="Parse error on line "+(ct+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+gt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":yt="Parse error on line "+(ct+1)+": Unexpected "+(M==Mt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(yt,{text:D.match,token:this.terminals_[M]||M,line:D.yylineno,loc:pt,expected:gt})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+M);switch(z[0]){case 1:g.push(M),C.push(D.yytext),r.push(D.yylloc),g.push(z[1]),M=null,It=D.yyleng,d=D.yytext,ct=D.yylineno,pt=D.yylloc;break;case 2:if(N=this.productions_[z[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ci&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(G,[d,It,ct,$.yy,z[1],C,r].concat(li)),typeof mt<"u")return mt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[z[1]][0]),C.push(G.$),r.push(G._$),Bt=rt[g[g.length-2]][g[g.length-1]],g.push(Bt);break;case 3:return!0}}return!0},"parse")},k=(function(){var F={EOF:1,parseError:a(function(c,g){if(this.yy.parser)this.yy.parser.parseError(c,g);else throw new Error(c)},"parseError"),setInput:a(function(h,c){return this.yy=c||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var c=h.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:a(function(h){var c=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(h){this.unput(this.match.slice(h))},"less"),pastInput:a(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var h=this.pastInput(),c=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
@@ -5,10 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>RepoMind — Graph</title>
7
7
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
8
- <script type="module" crossorigin src="/assets/graph-D_tIaE_I.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/theme-DS1fBM5L.js">
8
+ <script type="module" crossorigin src="/assets/graph-DwaX8nDF.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/theme-CfkLgQFf.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/transform-BwXaE9hv.js">
11
- <link rel="stylesheet" crossorigin href="/assets/theme-CFHWfrn1.css">
11
+ <link rel="stylesheet" crossorigin href="/assets/theme-DJYNWCef.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="app" class="graph-page">
@@ -5,10 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>RepoMind</title>
7
7
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
8
- <script type="module" crossorigin src="/assets/main-BeHrzLrS.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/theme-DS1fBM5L.js">
8
+ <script type="module" crossorigin src="/assets/main-C0Y60ppL.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/theme-CfkLgQFf.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/editor-CTtDusro.js">
11
- <link rel="stylesheet" crossorigin href="/assets/theme-CFHWfrn1.css">
11
+ <link rel="stylesheet" crossorigin href="/assets/theme-DJYNWCef.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="app">
@@ -1 +0,0 @@
1
- import{ah as o,ai as n}from"./mermaid.core-BZZdRyuR.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-CRO5yOrB.js";import{_ as i}from"./mermaid.core-BZZdRyuR.js";import"./transform-BwXaE9hv.js";import"./chunk-FMBD7UC4-CJemLien.js";import"./chunk-ND2GUHAM-B_z-tw44.js";import"./chunk-55IACEB6-BCx7dyYV.js";import"./chunk-2J33WTMH-0LcH4vIA.js";import"./main-BeHrzLrS.js";import"./theme-DS1fBM5L.js";import"./editor-CTtDusro.js";var c={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{c as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-CRO5yOrB.js";import{_ as i}from"./mermaid.core-BZZdRyuR.js";import"./transform-BwXaE9hv.js";import"./chunk-FMBD7UC4-CJemLien.js";import"./chunk-ND2GUHAM-B_z-tw44.js";import"./chunk-55IACEB6-BCx7dyYV.js";import"./chunk-2J33WTMH-0LcH4vIA.js";import"./main-BeHrzLrS.js";import"./theme-DS1fBM5L.js";import"./editor-CTtDusro.js";var c={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{c as diagram};
@@ -1,2 +0,0 @@
1
- import{v as _t,w as Mt,B as zt,l as bt,D as Tt}from"./theme-DS1fBM5L.js";import{s as F,g as ct,t as Nt,j as J,T as it,k as ot}from"./transform-BwXaE9hv.js";function At(t){let e;for(;e=t.sourceEvent;)t=e;return t}function K(t,e){if(t=At(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var a=n.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(e.getScreenCTM().inverse()),[a.x,a.y]}if(e.getBoundingClientRect){var u=e.getBoundingClientRect();return[t.clientX-u.left-e.clientLeft,t.clientY-u.top-e.clientTop]}}return[t.pageX,t.pageY]}const Et={passive:!1},tt={capture:!0,passive:!1};function at(t){t.stopImmediatePropagation()}function W(t){t.preventDefault(),t.stopImmediatePropagation()}function vt(t){var e=t.document.documentElement,n=F(t).on("dragstart.drag",W,tt);"onselectstart"in e?n.on("selectstart.drag",W,tt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function xt(t,e){var n=t.document.documentElement,a=F(t).on("dragstart.drag",null);e&&(a.on("click.drag",W,tt),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const et=t=>()=>t;function st(t,{sourceEvent:e,subject:n,target:a,identifier:u,active:s,x:l,y:p,dx:v,dy:o,dispatch:y}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:p,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:o,enumerable:!0,configurable:!0},_:{value:y}})}st.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function St(t){return!t.ctrlKey&&!t.button}function Dt(){return this.parentNode}function It(t,e){return e??{x:t.x,y:t.y}}function kt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pt(){var t=St,e=Dt,n=It,a=kt,u={},s=ct("start","drag","end"),l=0,p,v,o,y,T=0;function d(r){r.on("mousedown.drag",m).filter(a).on("touchstart.drag",h).on("touchmove.drag",c,Et).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(r,M){if(!(y||!t.call(this,r,M))){var A=_(this,e.call(this,r,M),r,M,"mouse");A&&(F(r.view).on("mousemove.drag",N,tt).on("mouseup.drag",g,tt),vt(r.view),at(r),o=!1,p=r.clientX,v=r.clientY,A("start",r))}}function N(r){if(W(r),!o){var M=r.clientX-p,A=r.clientY-v;o=M*M+A*A>T}u.mouse("drag",r)}function g(r){F(r.view).on("mousemove.drag mouseup.drag",null),xt(r.view,o),W(r),u.mouse("end",r)}function h(r,M){if(t.call(this,r,M)){var A=r.changedTouches,E=e.call(this,r,M),S=A.length,x,I;for(x=0;x<S;++x)(I=_(this,E,r,M,A[x].identifier,A[x]))&&(at(r),I("start",r,A[x]))}}function c(r){var M=r.changedTouches,A=M.length,E,S;for(E=0;E<A;++E)(S=u[M[E].identifier])&&(W(r),S("drag",r,M[E]))}function w(r){var M=r.changedTouches,A=M.length,E,S;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),E=0;E<A;++E)(S=u[M[E].identifier])&&(at(r),S("end",r,M[E]))}function _(r,M,A,E,S,x){var I=s.copy(),j=K(x||A,M),V,L,i;if((i=n.call(r,new st("beforestart",{sourceEvent:A,target:d,identifier:S,active:l,x:j[0],y:j[1],dx:0,dy:0,dispatch:I}),E))!=null)return V=i.x-j[0]||0,L=i.y-j[1]||0,function z(f,b,D){var k=j,P;switch(f){case"start":u[S]=z,P=l++;break;case"end":delete u[S],--l;case"drag":j=K(D||b,M),P=l;break}I.call(f,r,new st(f,{sourceEvent:b,subject:i,target:d,identifier:S,active:P,x:j[0]+V,y:j[1]+L,dx:j[0]-k[0],dy:j[1]-k[1],dispatch:I}),E)}}return d.filter=function(r){return arguments.length?(t=typeof r=="function"?r:et(!!r),d):t},d.container=function(r){return arguments.length?(e=typeof r=="function"?r:et(r),d):e},d.subject=function(r){return arguments.length?(n=typeof r=="function"?r:et(r),d):n},d.touchable=function(r){return arguments.length?(a=typeof r=="function"?r:et(!!r),d):a},d.on=function(){var r=s.on.apply(s,arguments);return r===s?d:r},d.clickDistance=function(r){return arguments.length?(T=(r=+r)*r,d):Math.sqrt(T)},d}var jt=1e-12;function ft(t){return((t=Math.exp(t))+1/t)/2}function $t(t){return((t=Math.exp(t))-1/t)/2}function Yt(t){return((t=Math.exp(2*t))-1)/(t+1)}const Xt=(function t(e,n,a){function u(s,l){var p=s[0],v=s[1],o=s[2],y=l[0],T=l[1],d=l[2],m=y-p,N=T-v,g=m*m+N*N,h,c;if(g<jt)c=Math.log(d/o)/e,h=function(E){return[p+E*m,v+E*N,o*Math.exp(e*E*c)]};else{var w=Math.sqrt(g),_=(d*d-o*o+a*g)/(2*o*n*w),r=(d*d-o*o-a*g)/(2*d*n*w),M=Math.log(Math.sqrt(_*_+1)-_),A=Math.log(Math.sqrt(r*r+1)-r);c=(A-M)/e,h=function(E){var S=E*c,x=ft(M),I=o/(n*w)*(x*Yt(e*S+M)-$t(M));return[p+I*m,v+I*N,o*x/ft(e*S+M)]}}return h.duration=c*1e3*e/Math.SQRT2,h}return u.rho=function(s){var l=Math.max(.001,+s),p=l*l,v=p*p;return t(l,p,v)},u})(Math.SQRT2,2,4);function gt(t,e){var n,a=1;t==null&&(t=0),e==null&&(e=0);function u(){var s,l=n.length,p,v=0,o=0;for(s=0;s<l;++s)p=n[s],v+=p.x,o+=p.y;for(v=(v/l-t)*a,o=(o/l-e)*a,s=0;s<l;++s)p=n[s],p.x-=v,p.y-=o}return u.initialize=function(s){n=s},u.x=function(s){return arguments.length?(t=+s,u):t},u.y=function(s){return arguments.length?(e=+s,u):e},u.strength=function(s){return arguments.length?(a=+s,u):a},u}function Lt(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return wt(this.cover(e,n),e,n,t)}function wt(t,e,n,a){if(isNaN(e)||isNaN(n))return t;var u,s=t._root,l={data:a},p=t._x0,v=t._y0,o=t._x1,y=t._y1,T,d,m,N,g,h,c,w;if(!s)return t._root=l,t;for(;s.length;)if((g=e>=(T=(p+o)/2))?p=T:o=T,(h=n>=(d=(v+y)/2))?v=d:y=d,u=s,!(s=s[c=h<<1|g]))return u[c]=l,t;if(m=+t._x.call(null,s.data),N=+t._y.call(null,s.data),e===m&&n===N)return l.next=s,u?u[c]=l:t._root=l,t;do u=u?u[c]=new Array(4):t._root=new Array(4),(g=e>=(T=(p+o)/2))?p=T:o=T,(h=n>=(d=(v+y)/2))?v=d:y=d;while((c=h<<1|g)===(w=(N>=d)<<1|m>=T));return u[w]=s,u[c]=l,t}function Vt(t){var e,n,a=t.length,u,s,l=new Array(a),p=new Array(a),v=1/0,o=1/0,y=-1/0,T=-1/0;for(n=0;n<a;++n)isNaN(u=+this._x.call(null,e=t[n]))||isNaN(s=+this._y.call(null,e))||(l[n]=u,p[n]=s,u<v&&(v=u),u>y&&(y=u),s<o&&(o=s),s>T&&(T=s));if(v>y||o>T)return this;for(this.cover(v,o).cover(y,T),n=0;n<a;++n)wt(this,l[n],p[n],t[n]);return this}function Ct(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,a=this._y0,u=this._x1,s=this._y1;if(isNaN(n))u=(n=Math.floor(t))+1,s=(a=Math.floor(e))+1;else{for(var l=u-n||1,p=this._root,v,o;n>t||t>=u||a>e||e>=s;)switch(o=(e<a)<<1|t<n,v=new Array(4),v[o]=p,p=v,l*=2,o){case 0:u=n+l,s=a+l;break;case 1:n=u-l,s=a+l;break;case 2:u=n+l,a=s-l;break;case 3:n=u-l,a=s-l;break}this._root&&this._root.length&&(this._root=p)}return this._x0=n,this._y0=a,this._x1=u,this._y1=s,this}function Rt(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function Bt(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function C(t,e,n,a,u){this.node=t,this.x0=e,this.y0=n,this.x1=a,this.y1=u}function Gt(t,e,n){var a,u=this._x0,s=this._y0,l,p,v,o,y=this._x1,T=this._y1,d=[],m=this._root,N,g;for(m&&d.push(new C(m,u,s,y,T)),n==null?n=1/0:(u=t-n,s=e-n,y=t+n,T=e+n,n*=n);N=d.pop();)if(!(!(m=N.node)||(l=N.x0)>y||(p=N.y0)>T||(v=N.x1)<u||(o=N.y1)<s))if(m.length){var h=(l+v)/2,c=(p+o)/2;d.push(new C(m[3],h,c,v,o),new C(m[2],l,c,h,o),new C(m[1],h,p,v,c),new C(m[0],l,p,h,c)),(g=(e>=c)<<1|t>=h)&&(N=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=N)}else{var w=t-+this._x.call(null,m.data),_=e-+this._y.call(null,m.data),r=w*w+_*_;if(r<n){var M=Math.sqrt(n=r);u=t-M,s=e-M,y=t+M,T=e+M,a=m.data}}return a}function Ht(t){if(isNaN(y=+this._x.call(null,t))||isNaN(T=+this._y.call(null,t)))return this;var e,n=this._root,a,u,s,l=this._x0,p=this._y0,v=this._x1,o=this._y1,y,T,d,m,N,g,h,c;if(!n)return this;if(n.length)for(;;){if((N=y>=(d=(l+v)/2))?l=d:v=d,(g=T>=(m=(p+o)/2))?p=m:o=m,e=n,!(n=n[h=g<<1|N]))return this;if(!n.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(a=e,c=h)}for(;n.data!==t;)if(u=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,u?(s?u.next=s:delete u.next,this):e?(s?e[h]=s:delete e[h],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(a?a[c]=n:this._root=n),this):(this._root=s,this)}function Ft(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function Ut(){return this._root}function qt(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function Kt(t){var e=[],n,a=this._root,u,s,l,p,v;for(a&&e.push(new C(a,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(a=n.node,s=n.x0,l=n.y0,p=n.x1,v=n.y1)&&a.length){var o=(s+p)/2,y=(l+v)/2;(u=a[3])&&e.push(new C(u,o,y,p,v)),(u=a[2])&&e.push(new C(u,s,y,o,v)),(u=a[1])&&e.push(new C(u,o,l,p,y)),(u=a[0])&&e.push(new C(u,s,l,o,y))}return this}function Ot(t){var e=[],n=[],a;for(this._root&&e.push(new C(this._root,this._x0,this._y0,this._x1,this._y1));a=e.pop();){var u=a.node;if(u.length){var s,l=a.x0,p=a.y0,v=a.x1,o=a.y1,y=(l+v)/2,T=(p+o)/2;(s=u[0])&&e.push(new C(s,l,p,y,T)),(s=u[1])&&e.push(new C(s,y,p,v,T)),(s=u[2])&&e.push(new C(s,l,T,y,o)),(s=u[3])&&e.push(new C(s,y,T,v,o))}n.push(a)}for(;a=n.pop();)t(a.node,a.x0,a.y0,a.x1,a.y1);return this}function Qt(t){return t[0]}function Wt(t){return arguments.length?(this._x=t,this):this._x}function Zt(t){return t[1]}function Jt(t){return arguments.length?(this._y=t,this):this._y}function lt(t,e,n){var a=new ht(e??Qt,n??Zt,NaN,NaN,NaN,NaN);return t==null?a:a.addAll(t)}function ht(t,e,n,a,u,s){this._x=t,this._y=e,this._x0=n,this._y0=a,this._x1=u,this._y1=s,this._root=void 0}function mt(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var R=lt.prototype=ht.prototype;R.copy=function(){var t=new ht(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,a;if(!e)return t;if(!e.length)return t._root=mt(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var u=0;u<4;++u)(a=e.source[u])&&(a.length?n.push({source:a,target:e.target[u]=new Array(4)}):e.target[u]=mt(a));return t};R.add=Lt;R.addAll=Vt;R.cover=Ct;R.data=Rt;R.extent=Bt;R.find=Gt;R.remove=Ht;R.removeAll=Ft;R.root=Ut;R.size=qt;R.visit=Kt;R.visitAfter=Ot;R.x=Wt;R.y=Jt;function Q(t){return function(){return t}}function O(t){return(t()-.5)*1e-6}function te(t){return t.x+t.vx}function ee(t){return t.y+t.vy}function ne(t){var e,n,a,u=1,s=1;typeof t!="function"&&(t=Q(t==null?1:+t));function l(){for(var o,y=e.length,T,d,m,N,g,h,c=0;c<s;++c)for(T=lt(e,te,ee).visitAfter(p),o=0;o<y;++o)d=e[o],g=n[d.index],h=g*g,m=d.x+d.vx,N=d.y+d.vy,T.visit(w);function w(_,r,M,A,E){var S=_.data,x=_.r,I=g+x;if(S){if(S.index>d.index){var j=m-S.x-S.vx,V=N-S.y-S.vy,L=j*j+V*V;L<I*I&&(j===0&&(j=O(a),L+=j*j),V===0&&(V=O(a),L+=V*V),L=(I-(L=Math.sqrt(L)))/L*u,d.vx+=(j*=L)*(I=(x*=x)/(h+x)),d.vy+=(V*=L)*I,S.vx-=j*(I=1-I),S.vy-=V*I)}return}return r>m+I||A<m-I||M>N+I||E<N-I}}function p(o){if(o.data)return o.r=n[o.data.index];for(var y=o.r=0;y<4;++y)o[y]&&o[y].r>o.r&&(o.r=o[y].r)}function v(){if(e){var o,y=e.length,T;for(n=new Array(y),o=0;o<y;++o)T=e[o],n[T.index]=+t(T,o,e)}}return l.initialize=function(o,y){e=o,a=y,v()},l.iterations=function(o){return arguments.length?(s=+o,l):s},l.strength=function(o){return arguments.length?(u=+o,l):u},l.radius=function(o){return arguments.length?(t=typeof o=="function"?o:Q(+o),v(),l):t},l}function re(t){return t.index}function dt(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function ie(t){var e=re,n=T,a,u=Q(30),s,l,p,v,o,y=1;t==null&&(t=[]);function T(h){return 1/Math.min(p[h.source.index],p[h.target.index])}function d(h){for(var c=0,w=t.length;c<y;++c)for(var _=0,r,M,A,E,S,x,I;_<w;++_)r=t[_],M=r.source,A=r.target,E=A.x+A.vx-M.x-M.vx||O(o),S=A.y+A.vy-M.y-M.vy||O(o),x=Math.sqrt(E*E+S*S),x=(x-s[_])/x*h*a[_],E*=x,S*=x,A.vx-=E*(I=v[_]),A.vy-=S*I,M.vx+=E*(I=1-I),M.vy+=S*I}function m(){if(l){var h,c=l.length,w=t.length,_=new Map(l.map((M,A)=>[e(M,A,l),M])),r;for(h=0,p=new Array(c);h<w;++h)r=t[h],r.index=h,typeof r.source!="object"&&(r.source=dt(_,r.source)),typeof r.target!="object"&&(r.target=dt(_,r.target)),p[r.source.index]=(p[r.source.index]||0)+1,p[r.target.index]=(p[r.target.index]||0)+1;for(h=0,v=new Array(w);h<w;++h)r=t[h],v[h]=p[r.source.index]/(p[r.source.index]+p[r.target.index]);a=new Array(w),N(),s=new Array(w),g()}}function N(){if(l)for(var h=0,c=t.length;h<c;++h)a[h]=+n(t[h],h,t)}function g(){if(l)for(var h=0,c=t.length;h<c;++h)s[h]=+u(t[h],h,t)}return d.initialize=function(h,c){l=h,o=c,m()},d.links=function(h){return arguments.length?(t=h,m(),d):t},d.id=function(h){return arguments.length?(e=h,d):e},d.iterations=function(h){return arguments.length?(y=+h,d):y},d.strength=function(h){return arguments.length?(n=typeof h=="function"?h:Q(+h),N(),d):n},d.distance=function(h){return arguments.length?(u=typeof h=="function"?h:Q(+h),g(),d):u},d}const oe=1664525,ae=1013904223,pt=4294967296;function ue(){let t=1;return()=>(t=(oe*t+ae)%pt)/pt}function se(t){return t.x}function ce(t){return t.y}var le=10,he=Math.PI*(3-Math.sqrt(5));function fe(t){var e,n=1,a=.001,u=1-Math.pow(a,1/300),s=0,l=.6,p=new Map,v=Nt(T),o=ct("tick","end"),y=ue();t==null&&(t=[]);function T(){d(),o.call("tick",e),n<a&&(v.stop(),o.call("end",e))}function d(g){var h,c=t.length,w;g===void 0&&(g=1);for(var _=0;_<g;++_)for(n+=(s-n)*u,p.forEach(function(r){r(n)}),h=0;h<c;++h)w=t[h],w.fx==null?w.x+=w.vx*=l:(w.x=w.fx,w.vx=0),w.fy==null?w.y+=w.vy*=l:(w.y=w.fy,w.vy=0);return e}function m(){for(var g=0,h=t.length,c;g<h;++g){if(c=t[g],c.index=g,c.fx!=null&&(c.x=c.fx),c.fy!=null&&(c.y=c.fy),isNaN(c.x)||isNaN(c.y)){var w=le*Math.sqrt(.5+g),_=g*he;c.x=w*Math.cos(_),c.y=w*Math.sin(_)}(isNaN(c.vx)||isNaN(c.vy))&&(c.vx=c.vy=0)}}function N(g){return g.initialize&&g.initialize(t,y),g}return m(),e={tick:d,restart:function(){return v.restart(T),e},stop:function(){return v.stop(),e},nodes:function(g){return arguments.length?(t=g,m(),p.forEach(N),e):t},alpha:function(g){return arguments.length?(n=+g,e):n},alphaMin:function(g){return arguments.length?(a=+g,e):a},alphaDecay:function(g){return arguments.length?(u=+g,e):+u},alphaTarget:function(g){return arguments.length?(s=+g,e):s},velocityDecay:function(g){return arguments.length?(l=1-g,e):1-l},randomSource:function(g){return arguments.length?(y=g,p.forEach(N),e):y},force:function(g,h){return arguments.length>1?(h==null?p.delete(g):p.set(g,N(h)),e):p.get(g)},find:function(g,h,c){var w=0,_=t.length,r,M,A,E,S;for(c==null?c=1/0:c*=c,w=0;w<_;++w)E=t[w],r=g-E.x,M=h-E.y,A=r*r+M*M,A<c&&(S=E,c=A);return S},on:function(g,h){return arguments.length>1?(o.on(g,h),e):o.on(g)}}}function ge(){var t,e,n,a,u=Q(-30),s,l=1,p=1/0,v=.81;function o(m){var N,g=t.length,h=lt(t,se,ce).visitAfter(T);for(a=m,N=0;N<g;++N)e=t[N],h.visit(d)}function y(){if(t){var m,N=t.length,g;for(s=new Array(N),m=0;m<N;++m)g=t[m],s[g.index]=+u(g,m,t)}}function T(m){var N=0,g,h,c=0,w,_,r;if(m.length){for(w=_=r=0;r<4;++r)(g=m[r])&&(h=Math.abs(g.value))&&(N+=g.value,c+=h,w+=h*g.x,_+=h*g.y);m.x=w/c,m.y=_/c}else{g=m,g.x=g.data.x,g.y=g.data.y;do N+=s[g.data.index];while(g=g.next)}m.value=N}function d(m,N,g,h){if(!m.value)return!0;var c=m.x-e.x,w=m.y-e.y,_=h-N,r=c*c+w*w;if(_*_/v<r)return r<p&&(c===0&&(c=O(n),r+=c*c),w===0&&(w=O(n),r+=w*w),r<l&&(r=Math.sqrt(l*r)),e.vx+=c*m.value*a/r,e.vy+=w*m.value*a/r),!0;if(m.length||r>=p)return;(m.data!==e||m.next)&&(c===0&&(c=O(n),r+=c*c),w===0&&(w=O(n),r+=w*w),r<l&&(r=Math.sqrt(l*r)));do m.data!==e&&(_=s[m.data.index]*a/r,e.vx+=c*_,e.vy+=w*_);while(m=m.next)}return o.initialize=function(m,N){t=m,n=N,y()},o.strength=function(m){return arguments.length?(u=typeof m=="function"?m:Q(+m),y(),o):u},o.distanceMin=function(m){return arguments.length?(l=m*m,o):Math.sqrt(l)},o.distanceMax=function(m){return arguments.length?(p=m*m,o):Math.sqrt(p)},o.theta=function(m){return arguments.length?(v=m*m,o):Math.sqrt(v)},o}const nt=t=>()=>t;function me(t,{sourceEvent:e,target:n,transform:a,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:u}})}function ut(t){t.stopImmediatePropagation()}function Z(t){t.preventDefault(),t.stopImmediatePropagation()}function de(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function pe(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function yt(){return this.__zoom||J}function ye(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ve(){return navigator.maxTouchPoints||"ontouchstart"in this}function xe(t,e,n){var a=t.invertX(e[0][0])-n[0][0],u=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],l=t.invertY(e[1][1])-n[1][1];return t.translate(u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u),l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l))}function we(){var t=de,e=pe,n=xe,a=ye,u=ve,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],p=250,v=Xt,o=ct("start","zoom","end"),y,T,d,m=500,N=150,g=0,h=10;function c(i){i.property("__zoom",yt).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",x).on("dblclick.zoom",I).filter(u).on("touchstart.zoom",j).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.transform=function(i,z,f,b){var D=i.selection?i.selection():i;D.property("__zoom",yt),i!==D?M(i,z,f,b):D.interrupt().each(function(){A(this,arguments).event(b).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},c.scaleBy=function(i,z,f,b){c.scaleTo(i,function(){var D=this.__zoom.k,k=typeof z=="function"?z.apply(this,arguments):z;return D*k},f,b)},c.scaleTo=function(i,z,f,b){c.transform(i,function(){var D=e.apply(this,arguments),k=this.__zoom,P=f==null?r(D):typeof f=="function"?f.apply(this,arguments):f,$=k.invert(P),Y=typeof z=="function"?z.apply(this,arguments):z;return n(_(w(k,Y),P,$),D,l)},f,b)},c.translateBy=function(i,z,f,b){c.transform(i,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof f=="function"?f.apply(this,arguments):f),e.apply(this,arguments),l)},null,b)},c.translateTo=function(i,z,f,b,D){c.transform(i,function(){var k=e.apply(this,arguments),P=this.__zoom,$=b==null?r(k):typeof b=="function"?b.apply(this,arguments):b;return n(J.translate($[0],$[1]).scale(P.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof f=="function"?-f.apply(this,arguments):-f),k,l)},b,D)};function w(i,z){return z=Math.max(s[0],Math.min(s[1],z)),z===i.k?i:new it(z,i.x,i.y)}function _(i,z,f){var b=z[0]-f[0]*i.k,D=z[1]-f[1]*i.k;return b===i.x&&D===i.y?i:new it(i.k,b,D)}function r(i){return[(+i[0][0]+ +i[1][0])/2,(+i[0][1]+ +i[1][1])/2]}function M(i,z,f,b){i.on("start.zoom",function(){A(this,arguments).event(b).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(b).end()}).tween("zoom",function(){var D=this,k=arguments,P=A(D,k).event(b),$=e.apply(D,k),Y=f==null?r($):typeof f=="function"?f.apply(D,k):f,H=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),X=D.__zoom,B=typeof z=="function"?z.apply(D,k):z,U=v(X.invert(Y).concat(H/X.k),B.invert(Y).concat(H/B.k));return function(G){if(G===1)G=B;else{var q=U(G),rt=H/q[2];G=new it(rt,Y[0]-q[0]*rt,Y[1]-q[1]*rt)}P.zoom(null,G)}})}function A(i,z,f){return!f&&i.__zooming||new E(i,z)}function E(i,z){this.that=i,this.args=z,this.active=0,this.sourceEvent=null,this.extent=e.apply(i,z),this.taps=0}E.prototype={event:function(i){return i&&(this.sourceEvent=i),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(i,z){return this.mouse&&i!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&i!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&i!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(i){var z=F(this.that).datum();o.call(i,this.that,new me(i,{sourceEvent:this.sourceEvent,target:c,transform:this.that.__zoom,dispatch:o}),z)}};function S(i,...z){if(!t.apply(this,arguments))return;var f=A(this,z).event(i),b=this.__zoom,D=Math.max(s[0],Math.min(s[1],b.k*Math.pow(2,a.apply(this,arguments)))),k=K(i);if(f.wheel)(f.mouse[0][0]!==k[0]||f.mouse[0][1]!==k[1])&&(f.mouse[1]=b.invert(f.mouse[0]=k)),clearTimeout(f.wheel);else{if(b.k===D)return;f.mouse=[k,b.invert(k)],ot(this),f.start()}Z(i),f.wheel=setTimeout(P,N),f.zoom("mouse",n(_(w(b,D),f.mouse[0],f.mouse[1]),f.extent,l));function P(){f.wheel=null,f.end()}}function x(i,...z){if(d||!t.apply(this,arguments))return;var f=i.currentTarget,b=A(this,z,!0).event(i),D=F(i.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",H,!0),k=K(i,f),P=i.clientX,$=i.clientY;vt(i.view),ut(i),b.mouse=[k,this.__zoom.invert(k)],ot(this),b.start();function Y(X){if(Z(X),!b.moved){var B=X.clientX-P,U=X.clientY-$;b.moved=B*B+U*U>g}b.event(X).zoom("mouse",n(_(b.that.__zoom,b.mouse[0]=K(X,f),b.mouse[1]),b.extent,l))}function H(X){D.on("mousemove.zoom mouseup.zoom",null),xt(X.view,b.moved),Z(X),b.event(X).end()}}function I(i,...z){if(t.apply(this,arguments)){var f=this.__zoom,b=K(i.changedTouches?i.changedTouches[0]:i,this),D=f.invert(b),k=f.k*(i.shiftKey?.5:2),P=n(_(w(f,k),b,D),e.apply(this,z),l);Z(i),p>0?F(this).transition().duration(p).call(M,P,b,i):F(this).call(c.transform,P,b,i)}}function j(i,...z){if(t.apply(this,arguments)){var f=i.touches,b=f.length,D=A(this,z,i.changedTouches.length===b).event(i),k,P,$,Y;for(ut(i),P=0;P<b;++P)$=f[P],Y=K($,this),Y=[Y,this.__zoom.invert(Y),$.identifier],D.touch0?!D.touch1&&D.touch0[2]!==Y[2]&&(D.touch1=Y,D.taps=0):(D.touch0=Y,k=!0,D.taps=1+!!y);y&&(y=clearTimeout(y)),k&&(D.taps<2&&(T=Y[0],y=setTimeout(function(){y=null},m)),ot(this),D.start())}}function V(i,...z){if(this.__zooming){var f=A(this,z).event(i),b=i.changedTouches,D=b.length,k,P,$,Y;for(Z(i),k=0;k<D;++k)P=b[k],$=K(P,this),f.touch0&&f.touch0[2]===P.identifier?f.touch0[0]=$:f.touch1&&f.touch1[2]===P.identifier&&(f.touch1[0]=$);if(P=f.that.__zoom,f.touch1){var H=f.touch0[0],X=f.touch0[1],B=f.touch1[0],U=f.touch1[1],G=(G=B[0]-H[0])*G+(G=B[1]-H[1])*G,q=(q=U[0]-X[0])*q+(q=U[1]-X[1])*q;P=w(P,Math.sqrt(G/q)),$=[(H[0]+B[0])/2,(H[1]+B[1])/2],Y=[(X[0]+U[0])/2,(X[1]+U[1])/2]}else if(f.touch0)$=f.touch0[0],Y=f.touch0[1];else return;f.zoom("touch",n(_(P,$,Y),f.extent,l))}}function L(i,...z){if(this.__zooming){var f=A(this,z).event(i),b=i.changedTouches,D=b.length,k,P;for(ut(i),d&&clearTimeout(d),d=setTimeout(function(){d=null},m),k=0;k<D;++k)P=b[k],f.touch0&&f.touch0[2]===P.identifier?delete f.touch0:f.touch1&&f.touch1[2]===P.identifier&&delete f.touch1;if(f.touch1&&!f.touch0&&(f.touch0=f.touch1,delete f.touch1),f.touch0)f.touch0[1]=this.__zoom.invert(f.touch0[0]);else if(f.end(),f.taps===2&&(P=K(P,this),Math.hypot(T[0]-P[0],T[1]-P[1])<h)){var $=F(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return c.wheelDelta=function(i){return arguments.length?(a=typeof i=="function"?i:nt(+i),c):a},c.filter=function(i){return arguments.length?(t=typeof i=="function"?i:nt(!!i),c):t},c.touchable=function(i){return arguments.length?(u=typeof i=="function"?i:nt(!!i),c):u},c.extent=function(i){return arguments.length?(e=typeof i=="function"?i:nt([[+i[0][0],+i[0][1]],[+i[1][0],+i[1][1]]]),c):e},c.scaleExtent=function(i){return arguments.length?(s[0]=+i[0],s[1]=+i[1],c):[s[0],s[1]]},c.translateExtent=function(i){return arguments.length?(l[0][0]=+i[0][0],l[1][0]=+i[1][0],l[0][1]=+i[0][1],l[1][1]=+i[1][1],c):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},c.constrain=function(i){return arguments.length?(n=i,c):n},c.duration=function(i){return arguments.length?(p=+i,c):p},c.interpolate=function(i){return arguments.length?(v=i,c):v},c.on=function(){var i=o.on.apply(o,arguments);return i===o?c:i},c.clickDistance=function(i){return arguments.length?(g=(i=+i)*i,c):Math.sqrt(g)},c.tapDistance=function(i){return arguments.length?(h=+i,c):h},c}const _e={adr:"#c97b4a","feature-spec":"#6abf69","glossary-term":"#b07cc6","open-question":"#e0c04a","agent-instruction":"#5b9fd4"};function Me(t){t.innerHTML="";const e=document.createElement("div");e.className="graph-empty hidden",e.textContent="No documents in graph",t.appendChild(e);const n=()=>t.clientWidth||800,a=()=>t.clientHeight||600,u=F(t).append("svg").attr("width",n()).attr("height",a()),s=u.append("g"),l=s.append("g"),p=s.append("g"),v=we().scaleExtent([.2,4]).on("zoom",_=>{s.attr("transform",_.transform)});u.call(v);let o=null,y=null,T=null,d=[],m=!1;function N(_,r=!0){if(r){u.transition().duration(400).call(v.transform,_);return}u.call(v.transform,_)}function g(_=48){if(d.length===0)return;const r=d.map(b=>b.x??0),M=d.map(b=>b.y??0),A=Math.min(...r),E=Math.max(...r),S=Math.min(...M),x=Math.max(...M),I=Math.max(E-A,1),j=Math.max(x-S,1),V=(A+E)/2,L=(S+x)/2,i=n(),z=a(),f=Math.min(2.5,Math.max(.35,Math.min((i-_*2)/I,(z-_*2)/j)));N(J.translate(i/2,z/2).scale(f).translate(-V,-L),!m),m=!0}function h(){m||d.length===0||g()}function c(_){const r=new Map;for(const M of _.nodes)r.set(M.slug,0);for(const M of _.edges)r.set(M.from,(r.get(M.from)??0)+1),r.set(M.to,(r.get(M.to)??0)+1);return r}function w(){u.attr("width",n()).attr("height",a()),o&&(o.force("center",gt(n()/2,a()/2)),o.alpha(.3).restart())}return window.addEventListener("resize",w),{load(_){if(_.nodes.length===0){e.classList.remove("hidden"),u.style("display","none"),o==null||o.stop();return}e.classList.add("hidden"),u.style("display","block"),o==null||o.stop(),m=!1,u.call(v.transform,J);const r=c(_),M=_.nodes.map(x=>({...x}));d=M;const A=_.edges.map(x=>({source:x.from,target:x.to}));o=fe(M).force("link",ie(A).id(x=>x.slug).distance(80)).force("charge",ge().strength(-180)).force("center",gt(n()/2,a()/2)).force("collision",ne().radius(24));const E=l.selectAll("line").data(A,x=>`${String(x.source)}-${String(x.target)}`).join("line").attr("class","link"),S=p.selectAll("g").data(M,x=>x.slug).join("g").attr("class",x=>x.slug===T?"node selected":"node").call(Pt().on("start",(x,I)=>{!x.active&&o&&o.alphaTarget(.3).restart();const j=I;j.fx=j.x,j.fy=j.y}).on("drag",(x,I)=>{const j=I;j.fx=x.x,j.fy=x.y}).on("end",(x,I)=>{!x.active&&o&&o.alphaTarget(0);const j=I;j.fx=null,j.fy=null})).on("click",(x,I)=>{T=I.slug,S.attr("class",j=>j.slug===T?"node selected":"node"),y==null||y(I.slug)});S.selectAll("circle").remove(),S.selectAll("text").remove(),S.append("circle").attr("r",x=>8+Math.min((r.get(x.slug)??0)*2,16)).attr("fill",x=>_e[x.type]??"#888"),S.append("title").text(x=>`${x.slug}
2
- ${x.title}`),S.append("text").attr("dy",4).attr("text-anchor","middle").text(x=>x.slug),o.on("tick",()=>{E.attr("x1",x=>x.source.x??0).attr("y1",x=>x.source.y??0).attr("x2",x=>x.target.x??0).attr("y2",x=>x.target.y??0),S.attr("transform",x=>`translate(${x.x??0},${x.y??0})`),!m&&o&&o.alpha()<.05&&h()})},selectSlug(_){T=_,p.selectAll("g.node").attr("class",r=>r.slug===T?"node selected":"node")},focusSlug(_){T=_,p.selectAll("g.node").attr("class",E=>E.slug===T?"node selected":"node");const r=d.find(E=>E.slug===_);if(!r||r.x===void 0||r.y===void 0)return;const M=n(),A=a();N(J.translate(M/2,A/2).scale(1.2).translate(-r.x,-r.y),!0)},onSelect(_){y=_},resize(){w(),m&&d.length>0&&g()},destroy(){o==null||o.stop(),window.removeEventListener("resize",w),u.remove(),e.remove()}}}_t();const ze="__all__";function be(){const t=new URLSearchParams(window.location.search).get("slug");return t!=null&&t.trim()?t:null}async function Te(){Mt(document.querySelector("#theme-toggle"));const t=document.querySelector("#graph"),e=document.querySelector("#stats"),n=Me(t);try{const[a,{drafts:u},s]=await Promise.all([zt(),bt(),Tt(ze)]);e.textContent=`v${a.version} · ${a.docCount} docs · ${s.nodes.length} nodes · ${u.length} drafts`,n.load(s);const l=be();l&&n.selectSlug(l),n.onSelect(p=>{window.location.href=`/?slug=${encodeURIComponent(p)}`}),requestAnimationFrame(()=>{n.resize()})}catch(a){e.textContent=a instanceof Error?a.message:"Failed to load graph"}}Te();