@aalis/plugin-webui-client 0.12.0 → 0.12.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 (61) hide show
  1. package/dist/assets/{AuthorityPage-l-Jt-tyM.js → AuthorityPage-BQDYg1E1.js} +1 -1
  2. package/dist/assets/DynamicPage-DO0WnqVF.js +19 -0
  3. package/dist/assets/{FilesPage-CRUIl6Xj.js → FilesPage-BNn0PjPx.js} +1 -1
  4. package/dist/assets/{MarketplacePage-DoOvuOTU.js → MarketplacePage-HbYZZCz_.js} +1 -1
  5. package/dist/assets/{PlatformPage-D4EF93zF.js → PlatformPage-DEnexgD7.js} +1 -1
  6. package/dist/assets/{PluginConfigPage-IAuDP0tZ.js → PluginConfigPage-D_MBDTbB.js} +1 -1
  7. package/dist/assets/{SessionsPage-DaYw4pcv.js → SessionsPage-BmA9dlNT.js} +1 -1
  8. package/dist/assets/{arc-D900bUwz.js → arc-DnVU9gDd.js} +1 -1
  9. package/dist/assets/{architectureDiagram-3BPJPVTR-HCWDD2g-.js → architectureDiagram-3BPJPVTR-D8geOE_F.js} +1 -1
  10. package/dist/assets/{blockDiagram-GPEHLZMM-B-dSbRFF.js → blockDiagram-GPEHLZMM-BFbUkYo9.js} +1 -1
  11. package/dist/assets/{c4Diagram-AAUBKEIU-CxBH28wM.js → c4Diagram-AAUBKEIU-D-508PnY.js} +1 -1
  12. package/dist/assets/channel-BugX_IAn.js +1 -0
  13. package/dist/assets/{chunk-2J33WTMH-CKFQywNP.js → chunk-2J33WTMH-BBSHca43.js} +1 -1
  14. package/dist/assets/{chunk-4BX2VUAB-u70MbS7S.js → chunk-4BX2VUAB-CYpAo1Fy.js} +1 -1
  15. package/dist/assets/{chunk-55IACEB6-C4x7Ajeo.js → chunk-55IACEB6-CT9vDGm-.js} +1 -1
  16. package/dist/assets/{chunk-727SXJPM-Tw-HZebR.js → chunk-727SXJPM-Qbj03s5s.js} +1 -1
  17. package/dist/assets/{chunk-AQP2D5EJ-CYks0_-5.js → chunk-AQP2D5EJ-D7h7VPGB.js} +1 -1
  18. package/dist/assets/{chunk-FMBD7UC4-Di13fFRw.js → chunk-FMBD7UC4-B-8aZQXh.js} +1 -1
  19. package/dist/assets/{chunk-ND2GUHAM-CMECQpX8.js → chunk-ND2GUHAM-aY4Jm31a.js} +1 -1
  20. package/dist/assets/{chunk-QZHKN3VN-B8p6IhNt.js → chunk-QZHKN3VN-Bf1fE05f.js} +1 -1
  21. package/dist/assets/classDiagram-4FO5ZUOK-A8yISGxg.js +1 -0
  22. package/dist/assets/classDiagram-v2-Q7XG4LA2-A8yISGxg.js +1 -0
  23. package/dist/assets/{clock-DSh1391_.js → clock-CHmqRkfK.js} +1 -1
  24. package/dist/assets/{cose-bilkent-S5V4N54A-BcikHe1E.js → cose-bilkent-S5V4N54A-CLhPrA-X.js} +1 -1
  25. package/dist/assets/{dagre-BM42HDAG-BiUpQ7Wt.js → dagre-BM42HDAG-ldqthtLi.js} +1 -1
  26. package/dist/assets/{diagram-2AECGRRQ-DPQ1SZjc.js → diagram-2AECGRRQ-gVpyidoY.js} +1 -1
  27. package/dist/assets/{diagram-5GNKFQAL-BlgpZGKe.js → diagram-5GNKFQAL-DZO2z7Tj.js} +1 -1
  28. package/dist/assets/{diagram-KO2AKTUF-BoXrc2M5.js → diagram-KO2AKTUF-CdJUd5dD.js} +1 -1
  29. package/dist/assets/{diagram-LMA3HP47-CvoHVnad.js → diagram-LMA3HP47-ShvNokM1.js} +1 -1
  30. package/dist/assets/{diagram-OG6HWLK6-qPnM1YXt.js → diagram-OG6HWLK6-BAYrIDPL.js} +1 -1
  31. package/dist/assets/{erDiagram-TEJ5UH35-BFpk7X-M.js → erDiagram-TEJ5UH35--6H9xqgq.js} +1 -1
  32. package/dist/assets/{flowDiagram-I6XJVG4X-iv7orfgc.js → flowDiagram-I6XJVG4X-jsKUH1HR.js} +1 -1
  33. package/dist/assets/{ganttDiagram-6RSMTGT7-BKO2HS21.js → ganttDiagram-6RSMTGT7-DFYCrHNq.js} +1 -1
  34. package/dist/assets/{gitGraphDiagram-PVQCEYII-BV2mZ73c.js → gitGraphDiagram-PVQCEYII-DuOMKvRu.js} +1 -1
  35. package/dist/assets/{globe-CT0XtR4-.js → globe-BfItFm6P.js} +1 -1
  36. package/dist/assets/{index-Lxc_JKBO.js → index-pGwN5S79.js} +3 -3
  37. package/dist/assets/{infoDiagram-5YYISTIA-BPkphYvC.js → infoDiagram-5YYISTIA-CFc4L9CY.js} +1 -1
  38. package/dist/assets/{ishikawaDiagram-YF4QCWOH-B-oLVWH5.js → ishikawaDiagram-YF4QCWOH-Cpv8QGG-.js} +1 -1
  39. package/dist/assets/{journeyDiagram-JHISSGLW-BJ8l-DFT.js → journeyDiagram-JHISSGLW-D_ZYi-l_.js} +1 -1
  40. package/dist/assets/{kanban-definition-UN3LZRKU-B2ZbfdxW.js → kanban-definition-UN3LZRKU-BAu1Iapx.js} +1 -1
  41. package/dist/assets/{linear-DBd1vZMm.js → linear-CWbLakH9.js} +1 -1
  42. package/dist/assets/{mermaid.core-BynBM-Vs.js → mermaid.core-DCKNrwR3.js} +4 -4
  43. package/dist/assets/{mindmap-definition-RKZ34NQL-BuGZb3vZ.js → mindmap-definition-RKZ34NQL-CwjfqD6z.js} +1 -1
  44. package/dist/assets/{pieDiagram-4H26LBE5-wIN8wfaj.js → pieDiagram-4H26LBE5-iBQqAGdJ.js} +1 -1
  45. package/dist/assets/{quadrantDiagram-W4KKPZXB-D1LdeZtI.js → quadrantDiagram-W4KKPZXB-Bj5J8IjM.js} +1 -1
  46. package/dist/assets/{requirementDiagram-4Y6WPE33-DXuzTZNi.js → requirementDiagram-4Y6WPE33-X-8ktpsm.js} +1 -1
  47. package/dist/assets/{sankeyDiagram-5OEKKPKP-OvqOJ5EX.js → sankeyDiagram-5OEKKPKP-DIkb4KbP.js} +1 -1
  48. package/dist/assets/{sequenceDiagram-3UESZ5HK-CV7R-br2.js → sequenceDiagram-3UESZ5HK-Hlda4VPB.js} +1 -1
  49. package/dist/assets/{stateDiagram-AJRCARHV-Bhyzx7mz.js → stateDiagram-AJRCARHV-NOKt-PZ_.js} +1 -1
  50. package/dist/assets/{stateDiagram-v2-BHNVJYJU-D1jNH0Dq.js → stateDiagram-v2-BHNVJYJU-BF5REMmu.js} +1 -1
  51. package/dist/assets/{timeline-definition-PNZ67QCA-QzuD8t4J.js → timeline-definition-PNZ67QCA-CbG_bPsY.js} +1 -1
  52. package/dist/assets/{vennDiagram-CIIHVFJN-Dh_7y7dp.js → vennDiagram-CIIHVFJN-BVLsgOPX.js} +1 -1
  53. package/dist/assets/{wardley-L42UT6IY-uwZ17gTk.js → wardley-L42UT6IY-nRiwVAku.js} +1 -1
  54. package/dist/assets/{wardleyDiagram-YWT4CUSO-D0aj6wG2.js → wardleyDiagram-YWT4CUSO-jStW0NJa.js} +1 -1
  55. package/dist/assets/{xychartDiagram-2RQKCTM6-BpySZYJb.js → xychartDiagram-2RQKCTM6-bJC2yQYV.js} +1 -1
  56. package/dist/index.html +1 -1
  57. package/package.json +1 -1
  58. package/dist/assets/DynamicPage-Cb9bnTmR.js +0 -19
  59. package/dist/assets/channel-CKm-LJj0.js +0 -1
  60. package/dist/assets/classDiagram-4FO5ZUOK-Bs8lA-Wx.js +0 -1
  61. package/dist/assets/classDiagram-v2-Q7XG4LA2-Bs8lA-Wx.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as o,j as e}from"./react-vendor-BPQixOLZ.js";import{c as _,p as B,W as xe}from"./index-Lxc_JKBO.js";import{C as ve}from"./clock-DSh1391_.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
1
+ import{r as o,j as e}from"./react-vendor-BPQixOLZ.js";import{c as _,p as B,W as xe}from"./index-pGwN5S79.js";import{C as ve}from"./clock-CHmqRkfK.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,19 @@
1
+ import{r as l,j as e,R as U,a as at}from"./react-vendor-BPQixOLZ.js";import{c as ke,a as me,p as B,S as ot,W as it}from"./index-pGwN5S79.js";import{S as lt}from"./SchemaForm-BcYxH5r1.js";import{c as Be}from"./cytoscape.esm-LDYqcvCF.js";import{f as dt}from"./cytoscape-fcose-DXAQNCkb.js";import{G as ct}from"./globe-BfItFm6P.js";import{C as ut}from"./clock-CHmqRkfK.js";import{M as ht,r as pt,a as gt}from"./markdown-B2G8c9k5.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";/**
2
+ * @license lucide-react v1.7.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ft=[["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"}]],yt=ke("brain",ft);/**
7
+ * @license lucide-react v1.7.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const xt=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],mt=ke("chart-no-axes-column",xt);/**
12
+ * @license lucide-react v1.7.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const bt=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],vt=ke("puzzle",bt);let Ae=!1;function jt(){Ae||(Be.use(dt),Ae=!0)}function be(t){if(!Number.isFinite(t)||t===0)return"0";if(Math.abs(t)<.01)return t.toExponential(2);const i=t.toPrecision(3);return i.includes("e")||i.includes("E")?i:i.includes(".")?i.replace(/0+$/,"").replace(/\.$/,""):i}const ve="#60a5fa",_e="#fb923c",ee="#ef4444",le="#e4e4ef",je="#0f0f14",$e="#6b7280",kt="#1c1c28",W={topic:"#34d399",place:"#a78bfa",thing:"#fbbf24",work:"#f472b6"},St="#9ca3af",wt=99,Oe={"person-event":"人 → 事件","person-entity":"人 → 物","person-person":"人 → 人","event-event":"事件 → 事件","event-entity":"事件 → 物","entity-entity":"物 → 物"},Ge={initiator:"发起者",participant:"参与者",witness:"旁观者",target:"被指向",reporter:"转述者"},He={enthusiast:"深度卷入",participant:"参与/使用",owner:"拥有",creator:"创作者",critic:"行为性批评",visitor:"到访",mentioned:"仅被提及"},We={friend:"朋友",cp:"CP",rival:"对手",mentor:"师徒",colleague:"同事",familiar:"熟人",antagonist:"敌对",admirer:"仰慕者","is-alias-of":"是…的别名","alt-account-of":"是…的小号"},Ke={positive:"积极",negative:"消极",neutral:"中性",mixed:"复杂"},Nt={superior:"高位(from 高于 to)",peer:"平级",subordinate:"低位(from 低于 to)",unknown:"未知"};function ne(t,s){if(!t)return"";const i=s[t];return i?`${i}(${t})`:t}function Rt(t,s){return s?t==="person-event"?ne(s,Ge):t==="person-entity"?ne(s,He):s:""}const ze=[{selector:"node",style:{label:"data(label)","background-color":ve,color:le,"font-size":11,"text-valign":"bottom","text-margin-y":4,"text-outline-color":je,"text-outline-width":2,width:"mapData(pageRankScale, 0, 1, 20, 56)",height:"mapData(pageRankScale, 0, 1, 20, 56)","border-width":1,"border-color":"#1e3a8a"}},{selector:'node[kind = "event"]',style:{"background-color":_e,shape:"round-rectangle","border-color":"#9a3412",width:"mapData(pageRankScale, 0, 1, 24, 64)",height:"mapData(pageRankScale, 0, 1, 16, 40)"}},{selector:'node[kind = "entity"]',style:{shape:"diamond","background-color":St,"border-color":"#374151",width:"mapData(pageRankScale, 0, 1, 22, 60)",height:"mapData(pageRankScale, 0, 1, 22, 60)"}},{selector:'node[entityKind = "topic"]',style:{"background-color":W.topic}},{selector:'node[entityKind = "place"]',style:{"background-color":W.place}},{selector:'node[entityKind = "thing"]',style:{"background-color":W.thing}},{selector:'node[entityKind = "work"]',style:{"background-color":W.work}},{selector:'node[focused = "1"]',style:{"background-color":ee,"border-color":"#7f1d1d","border-width":3,width:36,height:36}},{selector:"node:selected",style:{"border-width":3,"border-color":"#0ea5e9"}},{selector:"edge",style:{width:"mapData(weightScale, 0, 1, 1, 6)","line-color":$e,"curve-style":"bezier",label:"data(label)","font-size":9,color:le,"text-rotation":"autorotate","text-background-color":kt,"text-background-opacity":.85,"text-background-padding":1,"target-arrow-shape":"triangle","target-arrow-color":$e}},{selector:'edge[kind = "person-event"]',style:{"line-color":"#fbbf24","target-arrow-color":"#fbbf24","line-style":"dashed"}},{selector:'edge[kind = "person-entity"]',style:{"line-color":"#34d399","target-arrow-color":"#34d399","line-style":"dashed"}},{selector:'edge[kind = "event-event"]',style:{"line-color":"#f472b6","target-arrow-color":"#f472b6"}},{selector:'edge[kind = "event-entity"]',style:{"line-color":"#06b6d4","target-arrow-color":"#06b6d4","line-style":"dashed"}},{selector:'edge[kind = "entity-entity"]',style:{"line-color":"#a855f7","target-arrow-color":"#a855f7"}},{selector:'edge[kind = "person-person"]',style:{"line-color":"#f87171","target-arrow-color":"#f87171"}},{selector:'edge[focused = "1"]',style:{"line-color":"#facc15","target-arrow-color":"#facc15",width:4,"overlay-color":"#facc15","overlay-opacity":.25,"overlay-padding":5,"z-index":9999}},{selector:"edge.dimmed",style:{opacity:.15}},{selector:"node.dimmed",style:{opacity:.2,"text-opacity":0}}];function Ct(t,s){if(!(t!=null&&t.length)&&!(s!=null&&s.length))return ze;const i=[];for(const c of t??[]){const u={};c.color&&(u["background-color"]=c.color,u["border-color"]=c.color),c.shape&&(u.shape=c.shape==="circle"?"ellipse":c.shape==="round-rect"?"round-rectangle":"diamond"),i.push({selector:`node[kind = "${c.kind}"]`,style:u})}for(const c of s??[]){const u={};c.color&&(u["line-color"]=c.color,u["target-arrow-color"]=c.color),c.dashed&&(u["line-style"]="dashed"),i.push({selector:`edge[kind = "${c.kind}"]`,style:u})}return[...ze,...i]}function Et({comp:t,pluginName:s,refreshTick:i,onRefresh:c}){var Me,Le;jt();const u=l.useRef(null),o=l.useRef(null),a=l.useRef(null),y=l.useRef(!1),[r,j]=l.useState(null),[z,I]=l.useState(!1),[$,P]=l.useState(null),[C,p]=l.useState(),[k,m]=l.useState(t.defaultMaxDepth??2),[D,_]=l.useState(t.defaultMaxBreadth??10),[se,de]=l.useState(""),[T,re]=l.useState(null),[qe,ce]=l.useState(null),[Ve,Se]=l.useState(!1),[O,we]=l.useState(!1),[ae,ue]=l.useState(null),he="aalis.relgraph.spacing",q=60,pe=1e3,oe=5e3,Ne=120,Re=()=>{if(typeof window>"u")return;const n=window.localStorage.getItem(he);if(n==null)return;const d=Number(n);return Number.isFinite(d)&&d>=q&&d<=oe?d:void 0},[te,Ce]=l.useState(()=>Re()??Ne),[ge,ie]=l.useState(te);l.useEffect(()=>{if(Re()!==void 0)return;let n=!1;return me("/api/plugins/@aalis/plugin-webui-server/config").then(d=>{var S;if(n)return;const b=Number((S=d==null?void 0:d.config)==null?void 0:S.relationGraphDefaultSpacing);Number.isFinite(b)&&b>=q&&b<=oe&&(Ce(b),ie(b))}).catch(()=>{}),()=>{n=!0}},[]);const V=l.useCallback(n=>{if(!Number.isFinite(n))return;const d=Math.max(q,Math.min(oe,Math.round(n)));Ce(d),ie(d);try{window.localStorage.setItem(he,String(d))}catch{}},[]),fe=`relation-graph-h:${s}:${t.source}`,[K,Qe]=l.useState(()=>{if(typeof window>"u")return 520;const n=Number(window.localStorage.getItem(fe));return Number.isFinite(n)&&n>=200?n:520}),Q=l.useRef(null),Xe=l.useCallback(n=>{n.target.setPointerCapture(n.pointerId),Q.current={y:n.clientY,h:K}},[K]),Je=l.useCallback(n=>{if(!Q.current)return;const d=Math.max(200,Math.min(1600,Q.current.h+(n.clientY-Q.current.y)));Qe(d)},[]),Ee=l.useCallback(n=>{if(Q.current){n.target.releasePointerCapture(n.pointerId),Q.current=null;try{window.localStorage.setItem(fe,String(K))}catch{}}},[fe,K]);l.useEffect(()=>{var n;(n=o.current)==null||n.resize()},[K]);const X=l.useCallback(async()=>{I(!0),P(null);try{const n={focusId:C,maxDepth:k<=0?wt:k,maxBreadth:D},d=await B(s,t.source,n);j(d?{nodes:Array.isArray(d.nodes)?d.nodes:[],edges:Array.isArray(d.edges)?d.edges:[],focusId:d.focusId,focusEdge:d.focusEdge,stats:d.stats,globalPrRanks:d.globalPrRanks}:{nodes:[],edges:[]})}catch(n){P(n.message||String(n)),j({nodes:[],edges:[]})}finally{I(!1)}},[s,t.source,C,k,D]);l.useEffect(()=>{X()},[X,i]),l.useEffect(()=>{if(!t.refresh||t.refresh<=0)return;const n=setInterval(X,t.refresh);return()=>clearInterval(n)},[t.refresh,X]),l.useEffect(()=>{if(!u.current)return;const n=Be({container:u.current,elements:[],style:Ct(t.nodeKinds,t.edgeKinds),minZoom:.2,maxZoom:3,wheelSensitivity:.2});o.current=n,n.on("tap","node",S=>{const x=S.target.data();re({data:x}),p(String(x.id))}),n.on("tap","edge",S=>{const x=S.target.id();typeof x=="string"&&x&&(re(null),p(x))});const d=(S,x)=>{const N=[],g=w=>{const f=S[w];return f==null?"":String(f)};if(x){const w=g("label"),f=g("role"),v=g("relationType");w?N.push(w):f?N.push(f):v&&N.push(v);const F=g("description");F&&N.push(F);const A=S.weight;typeof A=="number"&&N.push(`合并强度 ${A.toFixed(2)}`)}else{const w=g("kind"),f=g("title")||g("name")||g("displayName")||g("label");f&&N.push(f);const v=g("category")||g("entityKind");if(v&&N.push(`类型:${v}`),w==="event"){const A=g("sessionScope");A&&N.push(`会话:${A}`)}const F=g("summary");F&&N.push(F)}return N},b=(S,x)=>{var F,A,h;const N=(F=u.current)==null?void 0:F.getBoundingClientRect(),g=S.target.data(),w=d(g,x);if(w.length===0||!N)return;const f=((A=S.renderedPosition)==null?void 0:A.x)??0,v=((h=S.renderedPosition)==null?void 0:h.y)??0;ue({x:f+12,y:v+12,lines:w})};return n.on("mouseover","node",S=>b(S,!1)),n.on("mouseover","edge",S=>b(S,!0)),n.on("mouseout","node",()=>ue(null)),n.on("mouseout","edge",()=>ue(null)),()=>{n.destroy(),o.current=null}},[]),l.useEffect(()=>{const n=o.current;if(!n||!r)return;const d=r.focusId??C,b=new Map;for(const h of r.nodes){if(h.data.kind!=="person")continue;const R=typeof h.data.label=="string"?h.data.label:"";R&&b.set(R,(b.get(R)??0)+1)}const S=h=>{if(h.kind!=="person")return;const R=typeof h.label=="string"?h.label:"";if(!R||(b.get(R)??0)<2)return;const E=typeof h.platform=="string"?h.platform:"?",L=typeof h.userId=="string"?h.userId:"",H=L?`…${L.slice(-4)}`:typeof h.id=="string"?`…${h.id.slice(-4)}`:"?";return`${R} · ${E}:${H}`},x=new Map;for(const h of r.nodes){const R=String(h.data.kind??"person"),E=typeof h.data.lastPageRank=="number"?h.data.lastPageRank:0;let L=x.get(R);L||(L=new Map,x.set(R,L)),L.set(String(h.data.id),E)}const N=new Map;for(const[,h]of x){const R=[...h.entries()].sort((L,H)=>L[1]-H[1]),E=R.length;for(let L=0;L<E;L++){const H=E>1?L/(E-1):.5;N.set(R[L][0],H)}}const g=new Map;{const h=r.edges.map(E=>({id:E.data.id,w:typeof E.data.weight=="number"?E.data.weight:0})).sort((E,L)=>E.w-L.w),R=h.length;for(let E=0;E<R;E++)g.set(h[E].id,R>1?E/(R-1):.5)}const w=[...r.nodes.map(h=>{const R=S(h.data),E=N.get(String(h.data.id))??0;return{data:{...h.data,...R?{label:R}:{},pageRankScale:E,focused:d&&h.data.id===d?"1":void 0},group:"nodes"}}),...r.edges.map(h=>{const R=typeof h.data.label=="string"?h.data.label:"",E=g.get(h.data.id)??0;return{data:{...h.data,label:R,kind:h.data.kind??(h.data.relationType?"person-person":"person-event"),weightScale:E,focused:d&&h.data.id===d?"1":void 0},group:"edges"}})],f=a.current===r;a.current=r;const v=!y.current;let F=1;if(!f){const h=new Map;n.nodes().forEach(L=>{h.set(L.id(),{...L.position()})}),n.elements().remove(),n.add(w);let R=0;n.nodes().forEach(L=>{const H=h.get(L.id());H&&(L.position(H),R++)});const E=n.nodes().length;F=E>0?R/E:0}const A=(v||F<.5)&&!f;n.layout({name:"fcose",animate:f,animationDuration:400,randomize:A&&r.nodes.length>20,nodeRepulsion:(h=>{const R=Math.round(te*117),E=Number(h.data("pageRankScale"))||0;return Math.round(R*(1+3*E))}),idealEdgeLength:(h=>{const R=Number(h.data("weightScale"))||0;return Math.round(te*(1.4-.8*R))}),nodeSeparation:Math.round(te*.67),gravity:.1,gravityRange:3,padding:40,quality:r.nodes.length>300?"default":"proof",uniformNodeDimensions:!1}).run(),r.nodes.length>0&&(y.current=!0)},[r,C,te]),l.useEffect(()=>{const n=o.current;if(!n)return;const d=se.toLowerCase().split(/\s+/).filter(Boolean);if(n.elements().removeClass("dimmed"),d.length===0)return;const b=n.nodes().filter(x=>{const N=[String(x.data("label")??""),String(x.data("kind")??""),String(x.data("entityKind")??""),String(x.data("category")??""),String(x.data("title")??""),String(x.data("name")??""),String(x.data("displayName")??""),String(x.data("summary")??""),String(x.data("sessionScope")??"")].map(g=>g.toLowerCase());return d.every(g=>N.some(w=>w.includes(g)))});if(b.length===0)return;const S=new Set(b.map(x=>x.id()));n.nodes().forEach(x=>{S.has(x.id())||x.addClass("dimmed")}),n.edges().forEach(x=>{S.has(x.source().id())||S.has(x.target().id())||x.addClass("dimmed")})},[se,r]),l.useEffect(()=>{if(!T||!t.detailSource){ce(null);return}Se(!0),B(s,t.detailSource,{nodeId:T.data.id,kind:T.data.kind}).then(n=>ce(n??null)).catch(n=>ce({error:n.message})).finally(()=>Se(!1))},[T,s,t.detailSource]),l.useEffect(()=>{const n=o.current;if(!n)return;const d=requestAnimationFrame(()=>{n.resize(),n.fit(void 0,30)});return()=>cancelAnimationFrame(d)},[C,T]);const et=l.useCallback(()=>{const n=o.current;if(!n||n.elements().length===0)return;const d=n.png({full:!0,scale:2,bg:je,maxWidth:1/0});if(!d||d==="data:,")return;const b=document.createElement("a");b.href=d,b.download=`relation-graph-${Date.now()}.png`,document.body.appendChild(b),b.click(),document.body.removeChild(b)},[]),ye=l.useCallback(()=>{c?c():X()},[c,X]),tt=l.useCallback(async(n,d)=>{if(!(d&&!window.confirm(d)))try{await B(s,n,{focusId:C}),ye()}catch(b){alert(`操作失败: ${b.message}`)}},[s,C,ye]),Ie=(r==null?void 0:r.stats)??{},nt=l.useMemo(()=>{if(!r)return"";const n={persons:"人物",events:"事件",entities:"实体"},d=[`节点 ${r.nodes.length}`,`边 ${r.edges.length}`],b=[];for(const[x,N]of Object.entries(Ie))x!=="edges"&&b.push(`${n[x]??x} ${N}`);const S=b.length?`全库: ${b.join(" · ")}`:"";return[...d,...S?[S]:[]].join(" | ")},[r,Ie]),Pe=l.useMemo(()=>{const n=new Map;if(!r)return n;const d=[];for(const g of r.nodes){const w=g.data.lastPageRank;typeof w!="number"||!Number.isFinite(w)||d.push({id:String(g.data.id),kind:String(g.data.kind??"person"),pr:w})}const b=[...d].sort((g,w)=>w.pr-g.pr),S=b.length,x=new Map;for(let g=0;g<b.length;g++)x.set(b[g].id,g+1);const N=new Map;for(const g of d)N.has(g.kind)||N.set(g.kind,[]),N.get(g.kind).push(g);for(const[,g]of N){g.sort((w,f)=>f.pr-w.pr);for(let w=0;w<g.length;w++)n.set(g[w].id,{kindRank:w+1,kindTotal:g.length,globalRank:x.get(g[w].id)??0,globalTotal:S})}return n},[r]),Fe=l.useMemo(()=>{const n=new Map;if(!(r!=null&&r.globalPrRanks))return n;for(const[d,b]of Object.entries(r.globalPrRanks))n.set(d,b);return n},[r]),st={display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",padding:"8px 10px",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color, #2a2a42)",fontSize:12,color:"var(--text)"},rt={width:"100%",height:K,background:je,position:"relative"};return e.jsxs("div",{className:"relation-graph-wrap",style:{border:"1px solid var(--border-color, #e5e7eb)",borderRadius:6,overflow:"hidden"},children:[t.label?e.jsx("div",{style:{padding:"8px 12px",fontWeight:600},children:t.label}):null,e.jsxs("div",{style:st,children:[e.jsxs("div",{style:{position:"relative",flex:"1 1 200px",minWidth:160},children:[e.jsx("input",{type:"text",placeholder:"搜索 (label / kind / entityKind / category,空格分多关键词)",value:se,onChange:n=>de(n.target.value),onCompositionEnd:n=>de(n.target.value),style:{width:"100%",padding:"4px 24px 4px 8px"}}),se?e.jsx("button",{type:"button",onClick:()=>de(""),title:"清除搜索",style:{position:"absolute",right:4,top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:"var(--text-muted, #888)",cursor:"pointer",fontSize:14,padding:"0 4px",lineHeight:1},children:"✕"}):null]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:4,opacity:C?1:.45},title:C?"从焦点节点出发的 BFS 跳数(0 = 不限)":"深度仅在选定焦点后生效:点击节点 → 详情面板 → 「以此为焦点」",children:["深度",e.jsx("input",{type:"range",min:0,max:10,value:k,onChange:n=>m(Number(n.target.value)),disabled:!C}),e.jsx("input",{type:"number",min:0,value:k,onChange:n=>{const d=Number(n.target.value);Number.isFinite(d)&&d>=0&&m(d)},disabled:!C,style:{width:56,padding:"2px 4px",background:"var(--surface)",color:"var(--text)",border:"1px solid var(--surface-active)"}}),e.jsx("span",{style:{width:32,color:"var(--text-secondary)"},children:k===0?"∞":k})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:4,opacity:C?1:.45},title:C?"焦点模式:每个节点向外展开的邻居数上限(按边权重降序截断;0 = 不限)":"宽度仅在选定焦点后生效:点击图中任一节点即可设为焦点",children:["宽度",e.jsx("input",{type:"range",min:0,max:30,value:D,onChange:n=>_(Number(n.target.value)),disabled:!C}),e.jsx("input",{type:"number",min:0,value:D,onChange:n=>{const d=Number(n.target.value);Number.isFinite(d)&&d>=0&&_(d)},disabled:!C,style:{width:56,padding:"2px 4px",background:"var(--surface)",color:"var(--text)",border:"1px solid var(--surface-active)"}}),e.jsx("span",{style:{width:32,color:"var(--text-secondary)"},children:D===0?"∞":D})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:4},title:`布局密度(≈ 理想边长 px)。当前 ${ge}。
17
+ slider 范围 ${q}–${pe};数字框可手动输入更大值(上限 ${oe})。
18
+ 松开鼠标 / Enter / 失焦后才重排(动画过渡),同时写入本地存储。`,children:["密度",e.jsx("input",{type:"range",min:q,max:pe,step:5,value:Math.min(ge,pe),onChange:n=>ie(Number(n.target.value)),onMouseUp:n=>V(Number(n.target.value)),onTouchEnd:n=>V(Number(n.target.value)),onKeyUp:n=>V(Number(n.target.value))}),e.jsx("input",{type:"number",min:q,value:ge,onChange:n=>{const d=Number(n.target.value);Number.isFinite(d)&&ie(d)},onBlur:n=>V(Number(n.target.value)),onKeyDown:n=>{n.key==="Enter"&&V(Number(n.target.value))},style:{width:64,padding:"2px 4px",background:"var(--surface)",color:"var(--text)",border:"1px solid var(--surface-active)"}})]}),e.jsx("button",{type:"button",onClick:()=>{try{window.localStorage.removeItem(he)}catch{}V(Ne)},title:"重置密度为默认值(同时清除本地覆盖)",style:{padding:"2px 6px",fontSize:11},children:"↺"}),C?e.jsx("button",{type:"button",onClick:()=>{p(void 0),re(null)},style:{padding:"4px 8px"},title:"清除焦点,返回全图视图",children:"✕ 清除焦点"}):null,e.jsx("button",{type:"button",onClick:ye,disabled:z,style:{padding:"4px 8px"},children:z?"加载中…":"刷新"}),e.jsx("button",{type:"button",onClick:et,style:{padding:"4px 8px"},children:"导出 PNG"}),(t.actions??[]).map(n=>e.jsx("button",{type:"button",onClick:()=>tt(n.method,n.confirm),style:{padding:"4px 8px",color:n.danger?"#dc2626":void 0},children:n.label},n.method))]}),$?e.jsxs("div",{style:{padding:8,color:"#dc2626",fontSize:12},children:["错误: ",$]}):null,e.jsx("div",{style:{display:"flex"},children:e.jsxs("div",{style:{position:"relative",flex:1},children:[e.jsx("div",{ref:u,style:rt}),ae?e.jsx("div",{style:{position:"absolute",left:Math.min(ae.x,600),top:ae.y,maxWidth:320,padding:"6px 8px",background:"rgba(28, 28, 40, 0.96)",color:le,border:"1px solid rgba(120,140,200,0.5)",borderRadius:4,fontSize:11,lineHeight:1.5,pointerEvents:"none",zIndex:6,boxShadow:"0 2px 6px rgba(0,0,0,0.4)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:ae.lines.map((n,d)=>e.jsx("div",{style:d===0?{fontWeight:600}:{color:"var(--text-muted)"},children:n},d))}):null,T||C&&(r!=null&&r.focusEdge)?e.jsxs("div",{style:{position:"absolute",top:10,left:10,width:O?"auto":360,maxWidth:"calc(100% - 20px)",maxHeight:O?void 0:K-20,overflowY:O?"visible":"auto",padding:O?"4px 8px":"10px 12px",background:"rgba(28, 28, 40, 0.94)",color:le,border:`1px solid ${ee}`,borderRadius:6,fontSize:11,boxShadow:"0 2px 8px rgba(0,0,0,0.4)",pointerEvents:"auto",zIndex:5},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:8,marginBottom:O?0:6},children:[e.jsx("button",{type:"button",onClick:()=>we(n=>!n),style:{background:"none",border:0,color:"var(--text-secondary)",cursor:"pointer",fontSize:12,padding:0,lineHeight:1,width:16},title:O?"展开详情":"收起详情(保留焦点)","aria-label":O?"展开":"收起",children:O?"▸":"▾"}),e.jsx("button",{type:"button",onClick:()=>{p(void 0),re(null),we(!1)},style:{background:"none",border:0,color:"var(--text-secondary)",cursor:"pointer",fontSize:14,padding:0,lineHeight:1},title:"关闭(清焦点)","aria-label":"关闭",children:"✕"}),e.jsx("strong",{style:{color:ee},children:T?`${T.data.kind??"节点"}:${T.data.label??T.data.id}`:"焦点(边)"}),e.jsx("span",{style:{marginLeft:"auto"},children:e.jsx(It,{})})]}),O?null:T?e.jsx(Ft,{node:T,detail:qe,loading:Ve,hasDetailSource:!!t.detailSource,isFocus:C===T.data.id,prRank:{sub:Pe.get(String(T.data.id)),global:Fe.get(String(T.data.id))}}):r!=null&&r.focusEdge?(()=>{var w;const n=r.focusEdge,d=f=>{if(!f||!Number.isFinite(f))return"—";try{return new Date(f).toLocaleString("zh-CN",{hour12:!1})}catch{return String(f)}},b=f=>{const v=r.nodes.find(A=>A.data.id===f);if(!v)return;const F=v.data.lastPageRank;return{label:typeof v.data.label=="string"?v.data.label:void 0,kind:typeof v.data.kind=="string"?v.data.kind:void 0,lastPageRank:typeof F=="number"&&Number.isFinite(F)?F:void 0}},S=n.endpoints??[],x=S.map(f=>{var v;return(v=b(f))==null?void 0:v.lastPageRank}).filter(f=>typeof f=="number"),N=x.length>0?x.reduce((f,v)=>f+v,0)/x.length:void 0,g=typeof n.weight=="number"&&typeof N=="number"?n.weight*N:void 0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{marginBottom:6,fontSize:10,color:"var(--text-secondary)"},children:["id=",n.id]}),e.jsx("div",{style:{marginBottom:6},children:n.description??"(无描述)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:8,rowGap:3,color:"var(--text-secondary)",marginBottom:8},children:[e.jsx("span",{children:"kind"}),e.jsxs("span",{children:[ne(n.kind,Oe),n.directed===!0?" · 有向":n.directed===!1?" · 无向":""]}),n.relation?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"relation"}),e.jsx("span",{children:ne(n.relation,We)})]}):null,n.role?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"role"}),e.jsx("span",{children:Rt(n.kind,n.role)})]}):null,n.sentiment?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"sentiment"}),e.jsx("span",{children:ne(n.sentiment,Ke)})]}):null,typeof n.weight=="number"?e.jsxs(e.Fragment,{children:[e.jsx("span",{title:"边按 (kind, source, target[, role/relation]) 重复合并的累计强度:0.5 起步,每次合并 +(1−prev)·delta(默认 delta=0.1,由 LLM/工具调用传入)→ 0.55 → 0.595 → 0.636 → … (clamp 1.0)。语义=被强化次数,不是重要性。",style:{cursor:"help"},children:"合并强度"}),e.jsx("span",{children:n.weight.toFixed(2)})]}):null,typeof g=="number"?e.jsxs(e.Fragment,{children:[e.jsx("span",{title:"边淘汰分 = 合并强度 × 端点 PR 平均。配额淘汰时按此升序删——分越低越先删。让「弱权但连接重要节点」的边受保护。",style:{cursor:"help"},children:"边淘汰分"}),e.jsxs("span",{children:[g.toFixed(5)," ",e.jsxs("span",{style:{opacity:.6},children:["= ",n.weight.toFixed(2)," × ",be(N)]})]})]}):null,e.jsx("span",{children:"first"}),e.jsx("span",{children:d(n.firstSeenAt)}),e.jsx("span",{children:"last"}),e.jsx("span",{children:d(n.lastReinforcedAt)})]}),S.length>0?e.jsxs("div",{style:{marginBottom:8},children:[e.jsx("div",{style:{color:"var(--text-muted)",marginBottom:2},children:"端点"}),S.map(f=>{const v=b(f),F=Pe.get(f),A=Fe.get(f),h=typeof(v==null?void 0:v.lastPageRank)=="number";return e.jsxs("div",{style:{fontFamily:"monospace",fontSize:10,color:"var(--text-secondary)",marginBottom:3},children:[e.jsxs("div",{children:[(v==null?void 0:v.label)??f," ",e.jsxs("span",{style:{opacity:.6},children:["[",String((v==null?void 0:v.kind)??"?"),"]",h?` · PR ${be(v.lastPageRank)}`:""]})]}),h&&F?e.jsxs("div",{style:{opacity:.6,paddingLeft:8},children:["子图 #",F.kindRank,"/",F.kindTotal," 同类 · #",F.globalRank,"/",F.globalTotal," 全部"]}):null,h&&A?e.jsxs("div",{style:{opacity:.6,paddingLeft:8},children:["全库 #",A.kindRank,"/",A.kindTotal," 同类 · #",A.globalRank,"/",A.globalTotal," 全部"]}):null]},f)})]}):null,e.jsxs("div",{style:{color:"var(--text-muted)",marginBottom:2},children:["证据 ",((w=n.evidence)==null?void 0:w.length)??0," 条"]}),(n.evidence??[]).map((f,v)=>{var F,A;return e.jsxs("div",{style:{borderLeft:"2px solid var(--border-color, #2a2a42)",padding:"2px 6px",marginBottom:4,color:"var(--text-secondary)",lineHeight:1.4},children:[e.jsxs("div",{children:["「",f.quote??"(无摘录)","」"]}),e.jsxs("div",{style:{fontSize:10,opacity:.7},children:[f.extractedAt?d(f.extractedAt):"—",f.sessionId?` · ${f.sessionId}`:"",(F=f.messageIds)!=null&&F.length?` · ${f.messageIds.length} msg`:""]})]},`${((A=f.messageIds)==null?void 0:A.join(","))??v}-${f.extractedAt??v}`)}),e.jsxs("div",{style:{color:"var(--text-muted)",marginTop:6},children:["子图 节点 ",r.nodes.length," · 边 ",r.edges.length]})]})})():null]}):null]})}),e.jsx("div",{role:"separator","aria-orientation":"horizontal",title:"拖拽调整画布高度",onPointerDown:Xe,onPointerMove:Je,onPointerUp:Ee,onPointerCancel:Ee,style:{height:8,cursor:"ns-resize",background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color, #2a2a42)",borderBottom:"1px solid var(--border-color, #2a2a42)",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",touchAction:"none"},children:e.jsx("div",{style:{width:40,height:3,borderRadius:2,background:"var(--text-muted, #6b7280)",opacity:.6}})}),e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:12,padding:"4px 10px",fontSize:11,color:"var(--text-secondary)",background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color, #2a2a42)"},children:[(Me=t.nodeKinds)!=null&&Me.length?e.jsxs(e.Fragment,{children:[t.nodeKinds.map(n=>e.jsx(G,{shape:n.shape??"circle",color:n.color??ve,label:n.label},n.kind)),e.jsx(G,{shape:"circle",color:ee,label:"焦点"}),(Le=t.edgeKinds)!=null&&Le.length?e.jsx("span",{style:{width:1,height:12,background:"var(--border-color, #2a2a42)",margin:"0 4px"}}):null,(t.edgeKinds??[]).map(n=>e.jsx(Y,{color:n.color??"#6b7280",dashStyle:n.dashed?"dashed":"solid",label:n.label},n.kind))]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{shape:"circle",color:ve,label:"人物"}),e.jsx(G,{shape:"round-rect",color:_e,label:"事件"}),e.jsx(G,{shape:"diamond",color:W.topic,label:"话题"}),e.jsx(G,{shape:"diamond",color:W.place,label:"地点"}),e.jsx(G,{shape:"diamond",color:W.thing,label:"事物"}),e.jsx(G,{shape:"diamond",color:W.work,label:"作品"}),e.jsx(G,{shape:"circle",color:ee,label:"焦点"}),e.jsx("span",{style:{width:1,height:12,background:"var(--border-color, #2a2a42)",margin:"0 4px"}}),e.jsx(Y,{color:"#f87171",dashStyle:"solid",label:"人↔人"}),e.jsx(Y,{color:"#34d399",dashStyle:"dashed",label:"人→实体"}),e.jsx(Y,{color:"#fbbf24",dashStyle:"dashed",label:"人→事"}),e.jsx(Y,{color:"#a855f7",dashStyle:"solid",label:"实体↔实体"}),e.jsx(Y,{color:"#06b6d4",dashStyle:"dashed",label:"事→实体"}),e.jsx(Y,{color:"#f472b6",dashStyle:"solid",label:"事→事"})]}),e.jsx("span",{style:{marginLeft:"auto",opacity:.7},children:"点击节点 = 设为焦点 + 显示左上详情卡片;清除焦点请点工具栏「✕ 清除焦点」按钮"})]}),e.jsx("div",{style:{padding:"4px 10px",fontSize:11,color:"var(--text-secondary)",background:"var(--bg-secondary)"},children:nt||"—"})]})}function G({shape:t,color:s,label:i}){const c={width:12,height:12,background:s,display:"inline-block",verticalAlign:"middle"};let u;return t==="circle"?u={...c,borderRadius:"50%"}:t==="round-rect"?u={...c,width:16,height:10,borderRadius:3}:u={...c,transform:"rotate(45deg)"},e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx("span",{style:u}),i]})}function Y({color:t,dashStyle:s,label:i}){const c=s==="solid"?"solid":s==="dashed"?"dashed":"dotted";return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx("span",{style:{width:18,height:0,borderTop:`2px ${c} ${t}`,display:"inline-block"}}),i]})}function Ye(t){if(typeof t!="number"||!Number.isFinite(t))return"—";try{return new Date(t).toLocaleString("zh-CN",{hour12:!1})}catch{return String(t)}}function Z(t,s){const i=t[`${s}Text`]??t[s];if(typeof i=="string"&&i)return i;if(typeof i=="number")return Ye(i)}function M(t){if(typeof t=="string"&&t)return t;if(typeof t=="number")return String(t)}function J(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function xe({rows:t}){const s=t.filter(([,i])=>i!=null&&i!=="");return s.length===0?e.jsx(e.Fragment,{}):e.jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:8,rowGap:3,color:"var(--text-secondary)",marginBottom:8},children:s.map(i=>{const[c,u,o]=i,a=typeof u=="string"||typeof u=="number"?String(u):u;return e.jsxs(U.Fragment,{children:[e.jsx("span",{style:{color:"var(--text-muted)",cursor:o?"help":void 0},title:o,children:c}),e.jsx("span",{style:{color:"var(--text)",wordBreak:"break-word"},children:a})]},c)})})}function De({list:t}){return!t||t.length===0?e.jsx(e.Fragment,{}):e.jsxs("div",{style:{marginTop:6},children:[e.jsxs("div",{style:{color:"var(--text-muted)",marginBottom:2},children:["证据 ",t.length," 条"]}),t.map((s,i)=>{var c,u;return e.jsxs("div",{style:{borderLeft:"2px solid var(--border-color, #2a2a42)",padding:"2px 6px",marginBottom:4,color:"var(--text-secondary)",lineHeight:1.4},children:[e.jsxs("div",{children:["「",s.quote??"(无摘录)","」"]}),e.jsxs("div",{style:{fontSize:10,opacity:.7},children:[s.extractedAtText??Ye(s.extractedAt),s.sessionId?` · ${s.sessionId}`:"",(c=s.messageIds)!=null&&c.length?` · ${s.messageIds.length} msg`:""]})]},`${((u=s.messageIds)==null?void 0:u.join(","))??i}-${s.extractedAt??i}`)})]})}function It(){const[t,s]=l.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>s(!0),style:{background:"none",border:0,padding:0,cursor:"help",color:"var(--text-muted)",fontSize:11,textDecoration:"underline dotted"},title:"字段含义说明",children:"ⓘ 字段含义"}),t?e.jsx(Pt,{onClose:()=>s(!1)}):null]})}function Pt({onClose:t}){l.useEffect(()=>{const o=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t]);const s={display:"grid",gridTemplateColumns:"120px 1fr",columnGap:12,rowGap:4,fontSize:12},i={margin:"12px 0 4px",fontSize:13,color:"var(--text-primary, #e4e4ef)"},u=e.jsx("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",zIndex:9999,display:"flex",alignItems:"flex-start",justifyContent:"center",overflowY:"auto",padding:"4vh 16px"},children:e.jsxs("div",{onClick:o=>o.stopPropagation(),style:{background:"var(--bg-primary, #0f0f14)",color:"var(--text-primary, #e4e4ef)",border:"1px solid var(--border-color, #2a2a42)",borderRadius:8,padding:"16px 20px",width:"min(680px, 92vw)",boxShadow:"0 8px 32px rgba(0,0,0,0.5)",lineHeight:1.55},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6},children:[e.jsx("strong",{style:{fontSize:14},children:"关系图字段含义"}),e.jsx("button",{type:"button",onClick:t,style:{marginLeft:"auto",background:"none",border:0,color:"var(--text-secondary)",cursor:"pointer",fontSize:16},"aria-label":"关闭",title:"关闭 (Esc)",children:"✕"})]}),e.jsx("div",{style:i,children:"三个数值指标"}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:[e.jsxs("div",{children:[e.jsx("b",{children:"合并强度"}),"(weight, 0~1):节点 / 边被重复合并的累计程度。0.5 起步,每次合并 ",e.jsx("code",{children:"+(1−prev)·delta"}),"(默认 delta=0.1,可由 LLM/工具调用传入;person 别名合并是直接 ",e.jsx("code",{children:"+0.3"})," 的特殊情况)→ 0.55 → 0.595 → 0.636 → … (clamp 1.0)。",e.jsxs("u",{children:["语义 = 被强化次数,",e.jsx("b",{children:"不是"}),"重要性"]}),"。"]}),e.jsxs("div",{style:{marginTop:3},children:[e.jsx("b",{children:"图重要性"}),"(lastPageRank):最近一次 ",e.jsx("code",{children:"/relation compress | maintain"}),' 计算的全图 PageRank。个性化种子按 kind 加权(人 2 · 物 1.5 · 事 1,可配置)。越高越靠近"核心人物 · 热门事件"。未跑过压缩则为空。注:节点越多,每个 PR 值越小(PR 是归一化概率分布,总和为 1),UI 在 |n| < 0.01 时切换科学计数法(如 ',e.jsx("code",{children:"2.07e-3"}),"),否则保留 3 位有效数字小数;同时附「子图同类/全部 + 全库同类/全部」四档排名(子图=当前 focusId/depth/breadth 限定的可见视图;全库=fullSnap 全体节点)便于判读位置。"]}),e.jsxs("div",{style:{marginTop:3},children:[e.jsx("b",{children:"边淘汰分"}),"(仅边详情):",e.jsx("code",{children:"合并强度 × ((PR_from + PR_to) / 2)"}),"。配额淘汰时按此",e.jsx("u",{children:"升序"}),'删——分越低越先删,让"弱权但连接重要节点"的边受保护。']})]}),e.jsx("div",{style:i,children:"边 kind(六类)"}),e.jsx("div",{style:s,children:Object.entries(Oe).map(([o,a])=>e.jsxs(U.Fragment,{children:[e.jsx("code",{style:{color:"var(--text-muted)"},children:o}),e.jsx("span",{children:a})]},o))}),e.jsx("div",{style:i,children:"role · 人 → 事件"}),e.jsx("div",{style:s,children:Object.entries(Ge).map(([o,a])=>e.jsxs(U.Fragment,{children:[e.jsx("code",{style:{color:"var(--text-muted)"},children:o}),e.jsx("span",{children:a})]},o))}),e.jsx("div",{style:i,children:"role · 人 → 物"}),e.jsx("div",{style:s,children:Object.entries(He).map(([o,a])=>e.jsxs(U.Fragment,{children:[e.jsx("code",{style:{color:"var(--text-muted)"},children:o}),e.jsx("span",{children:a})]},o))}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:'注:单句态度声明("我喜欢 X")不在关系图记录,归 user-profile 画像层。'}),e.jsx("div",{style:i,children:"relation · 人 → 人"}),e.jsx("div",{style:s,children:Object.entries(We).map(([o,a])=>e.jsxs(U.Fragment,{children:[e.jsx("code",{style:{color:"var(--text-muted)"},children:o}),e.jsx("span",{children:a})]},o))}),e.jsx("div",{style:i,children:"sentiment"}),e.jsx("div",{style:s,children:Object.entries(Ke).map(([o,a])=>e.jsxs(U.Fragment,{children:[e.jsx("code",{style:{color:"var(--text-muted)"},children:o}),e.jsx("span",{children:a})]},o))}),e.jsx("div",{style:i,children:"hierarchy(人 → 人,与 directed 正交)"}),e.jsx("div",{style:s,children:Object.entries(Nt).map(([o,a])=>e.jsxs(U.Fragment,{children:[e.jsx("code",{style:{color:"var(--text-muted)"},children:o}),e.jsx("span",{children:a})]},o))}),e.jsxs("div",{style:{marginTop:14,fontSize:11,color:"var(--text-muted)"},children:["完整文档:",e.jsx("a",{href:"/docs/plugins/user-relation-graph.md",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-link, #8ab4f8)",marginLeft:4},title:"在新标签页打开文档",children:"docs/plugins/user-relation-graph.md ↗"})]})]})});return typeof document>"u"?u:at.createPortal(u,document.body)}function Ft({node:t,detail:s,loading:i,hasDetailSource:c,isFocus:u,prRank:o}){const a=t.data.kind,y=j=>{if(typeof j!="number"||!Number.isFinite(j))return e.jsxs("span",{style:{opacity:.6},children:["— ",e.jsx("span",{style:{fontSize:10},children:"(未跑过压缩,下次 evictByQuota 时计算)"})]});const z=be(j),I=o==null?void 0:o.sub,$=o==null?void 0:o.global;return!I&&!$?z:e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:1},children:[e.jsx("span",{children:z}),I?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{opacity:.75},children:["子图 #",I.kindRank,"/",I.kindTotal," 同类"]}),e.jsxs("span",{style:{opacity:.75},children:["子图 #",I.globalRank,"/",I.globalTotal," 全部"]})]}):null,$?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{opacity:.75},children:["全库 #",$.kindRank,"/",$.kindTotal," 同类"]}),e.jsxs("span",{style:{opacity:.75},children:["全库 #",$.globalRank,"/",$.globalTotal," 全部"]})]}):e.jsx("span",{style:{opacity:.6,fontSize:10},children:"(全库排名暂缺:服务端未返回 globalPrRanks,可能需重启 aalis)"})]})},r=e.jsxs("div",{style:{color:"var(--text-secondary)",marginBottom:8,fontSize:10},children:["id=",t.data.id,u?e.jsx("span",{style:{marginLeft:6,color:ee},children:"· 当前焦点"}):null]});if(i)return e.jsxs(e.Fragment,{children:[r,e.jsx("div",{style:{color:"var(--text-muted)"},children:"加载详情中…"})]});if(!c)return e.jsxs(e.Fragment,{children:[r,e.jsx("div",{style:{color:"var(--text-muted)"},children:"无详情(detailSource 未配置)"})]});if(!s)return e.jsxs(e.Fragment,{children:[r,e.jsx("div",{style:{color:"var(--text-muted)"},children:"无数据"})]});if(typeof s.error=="string")return e.jsxs(e.Fragment,{children:[r,e.jsxs("div",{style:{color:"#dc2626"},children:["错误: ",s.error]})]});if(a==="person"&&s.person&&typeof s.person=="object"){const j=s.person,z=[["昵称",M(j.displayName)],["平台",M(j.platform)],["用户 ID",M(j.userId)],["提及次数",J(j.mentionCount)],["图重要性",y(typeof j.lastPageRank=="number"?j.lastPageRank:void 0),"最近一次 evictByQuota 计算的全图 PageRank 分数。人/物/事 个性化种子 2:1.5:1(默认,可配置);该节点越靠近「核心人物 · 热门事件」越高。下方附「子图同类/全部 + 全库同类/全部」四档排名便于判读位置。未跑过压缩时为空。"],["首次出现",Z(j,"firstSeenAt")],["最近出现",Z(j,"lastSeenAt")],["最近提及",Z(j,"lastMentionedAt")],["关联事件",J(s.eventCount)],["关联边数",J(s.edgeCount)]],I=Array.isArray(s.recentEvents)?s.recentEvents:[],$=Array.isArray(s.edges)?s.edges:[];return e.jsxs(e.Fragment,{children:[r,e.jsx(xe,{rows:z}),I.length>0?e.jsxs("div",{style:{marginBottom:8},children:[e.jsxs("div",{style:{color:"var(--text-muted)",marginBottom:2},children:["近期事件 ",I.length]}),I.slice(0,8).map((P,C)=>e.jsxs("div",{style:{color:"var(--text-secondary)",lineHeight:1.4},children:["· ",M(P.title)??"(无标题)",M(P.category)?e.jsxs("span",{style:{opacity:.6},children:[" [",M(P.category),"]"]}):null]},M(P.id)??C))]}):null,$.length>0?e.jsxs("div",{children:[e.jsxs("div",{style:{color:"var(--text-muted)",marginBottom:2},children:["边 ",$.length]}),$.slice(0,12).map((P,C)=>{const p=typeof P.weight=="number"?` w=${P.weight.toFixed(1)}`:"",k=M(P.relationZh)??M(P.roleZh)??M(P.relationType)??M(P.role)??M(P.kind)??"?",m=M(P.targetLabel)??M(P.toEntityId)??M(P.toEventId)??M(P.toPersonId)??"";return e.jsxs("div",{style:{fontFamily:"monospace",fontSize:10,color:"var(--text-secondary)"},children:[k,p," → ",m]},M(P.id)??C)})]}):null]})}if(a==="event"){const j=[["标题",M(s.title)],["类别",M(s.category)],["摘要",M(s.summary)],["提及次数",J(s.mentionCount)],["合并强度",typeof s.weight=="number"?s.weight.toFixed(2):void 0,"按 title 重复合并的累计强度:0.5 起步,每次合并 +(1−prev)·delta(默认 delta=0.1)。语义 = 被强化次数,不是重要性。"],["图重要性",y(typeof s.lastPageRank=="number"?s.lastPageRank:void 0),'最近一次 evictByQuota 计算的全图 PageRank 分数。反映"被重要节点引用"的结构性重要性;与合并强度独立。下方附「子图同类/全部 + 全库同类/全部」四档排名便于判读位置。'],["首次出现",Z(s,"firstSeenAt")],["最近强化",Z(s,"lastReinforcedAt")],["证据数",J(s.evidenceCount)]],z=Array.isArray(s.evidence)?s.evidence:[];return e.jsxs(e.Fragment,{children:[r,e.jsx(xe,{rows:j}),e.jsx(De,{list:z})]})}if(a==="entity"){const j=Array.isArray(s.aliases)?s.aliases.filter($=>typeof $=="string").join(" / "):void 0,z=[["名称",M(s.name)],["类型",M(s.entityKind)],["别名",j||void 0],["摘要",M(s.summary)],["合并强度",typeof s.weight=="number"?s.weight.toFixed(2):void 0,"按 (kind, name) 重复合并的累计强度:0.5 起步,每次合并 +(1−prev)·delta(默认 delta=0.1)。语义 = 被强化次数,不是重要性。"],["图重要性",y(typeof s.lastPageRank=="number"?s.lastPageRank:void 0),"最近一次 evictByQuota 计算的全图 PageRank 分数。多人共同指向的实体一般分数更高。下方附「子图同类/全部 + 全库同类/全部」四档排名便于判读位置。"],["首次出现",Z(s,"firstSeenAt")],["最近强化",Z(s,"lastReinforcedAt")],["证据数",J(s.evidenceCount)]],I=Array.isArray(s.evidence)?s.evidence:[];return e.jsxs(e.Fragment,{children:[r,e.jsx(xe,{rows:z}),e.jsx(De,{list:I})]})}return e.jsxs(e.Fragment,{children:[r,e.jsx("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:11,margin:0,color:"var(--text)"},children:JSON.stringify(s,null,2)})]})}const Te={skills:e.jsx(vt,{size:18}),scheduler:e.jsx(ut,{size:18}),browser:e.jsx(ct,{size:18}),memory:e.jsx(yt,{size:18}),tools:e.jsx(it,{size:18}),agent:e.jsx(ot,{size:18}),default:e.jsx(mt,{size:18})};function Ze({comp:t,pluginName:s,refreshTick:i}){const[c,u]=l.useState("—"),[o,a]=l.useState(!0);l.useEffect(()=>{a(!0),B(s,t.source).then(r=>{r&&u(r.value)}).catch(()=>{}).finally(()=>a(!1))},[s,t.source,i]);const y=Te[t.icon??""]??Te.default;return e.jsxs("div",{className:"dyn-stat-card",children:[e.jsx("div",{className:"dyn-stat-icon",children:y}),e.jsxs("div",{className:"dyn-stat-body",children:[e.jsx("div",{className:"dyn-stat-label",children:t.label}),e.jsx("div",{className:"dyn-stat-value",children:o?"...":c})]})]})}function Mt({target:t,onZero:s}){const[i,c]=l.useState(Date.now()),u=l.useRef(!1);if(l.useEffect(()=>{u.current=!1;const y=setInterval(()=>c(Date.now()),1e3);return()=>clearInterval(y)},[t]),!t||t<=0)return e.jsx("span",{children:"-"});const o=Math.max(0,Math.round((t-i)/1e3));if(o===0&&!u.current)return u.current=!0,s&&setTimeout(s,3e3),e.jsx("span",{className:"countdown-fired",children:"⏳ 执行中"});if(o===0)return e.jsx("span",{className:"countdown-fired",children:"⏳ 执行中"});let a;if(o<60)a=`${o}秒`;else if(o<3600){const y=Math.floor(o/60),r=o%60;a=r>0?`${y}分${r}秒`:`${y}分`}else{const y=Math.floor(o/3600),r=Math.floor(o%3600/60);a=r>0?`${y}时${r}分`:`${y}时`}return e.jsx("span",{className:o<=5?"countdown-imminent":"",children:a})}function Lt({text:t}){const[s,i]=l.useState(!1);return t?e.jsxs("div",{className:`dyn-cell-expandable${s?" expanded":""}`,children:[e.jsx("span",{className:"dyn-cell-expandable-text",children:t}),e.jsx("button",{type:"button",className:"dyn-cell-expandable-toggle",onClick:()=>i(c=>!c),title:s?"收起":"展开",children:s?"收起":"展开"})]}):null}function At({comp:t,pluginName:s,refreshTick:i}){const[c,u]=l.useState([]),[o,a]=l.useState(!0),[y,r]=l.useState(null),[j,z]=l.useState(""),I=l.useCallback(()=>{a(!0),B(s,t.source).then(p=>{Array.isArray(p)&&u(p)}).catch(()=>{}).finally(()=>a(!1))},[s,t.source]);l.useEffect(()=>{if(I(),t.refresh&&t.refresh>0){const p=setInterval(I,t.refresh*1e3);return()=>clearInterval(p)}},[I,t.refresh,i]);const $=async(p,k)=>{if(p.confirm&&!confirm(p.confirm))return;const m=await B(s,p.method,k);p.danger||p.confirm?I():m&&typeof m=="object"&&!Array.isArray(m)?r(m):I()},P=p=>{if(!p.minWidth&&!p.maxWidth)return;const k={};return p.minWidth&&(k.minWidth=`${p.minWidth}px`),p.maxWidth&&(k.maxWidth=`${p.maxWidth}px`),k},C=(()=>{if(!t.searchable)return c;const p=j.toLowerCase().split(/\s+/).filter(Boolean);return p.length===0?c:c.filter(k=>{const m=t.columns.map(D=>String(k[D.key]??"")).join(" ").toLowerCase();return p.every(D=>m.includes(D))})})();return e.jsxs("div",{className:"dyn-table-block",children:[t.label&&e.jsx("h3",{className:"dyn-section-title",children:t.label}),t.searchable?e.jsxs("div",{style:{marginBottom:6},children:[e.jsx("input",{type:"text",value:j,onChange:p=>z(p.target.value),placeholder:t.searchPlaceholder??"搜索(空格分隔多个关键词,AND 语义)",style:{width:"100%",maxWidth:360,padding:"4px 8px",fontSize:12,border:"1px solid var(--border-color, #ddd)",borderRadius:4,background:"transparent",color:"inherit"}}),j?e.jsxs("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-muted)"},children:[C.length,"/",c.length]}):null]}):null,o&&c.length===0?e.jsx("div",{className:"empty-hint",children:"加载中..."}):C.length===0?e.jsx("div",{className:"empty-hint",children:j?"无匹配":"暂无数据"}):e.jsx("div",{className:"dyn-table-scroll",children:e.jsxs("table",{className:"dyn-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[t.columns.map(p=>e.jsx("th",{className:p.nowrap?"dyn-cell-nowrap":void 0,style:P(p),children:p.label},p.key)),t.actions&&t.actions.length>0&&e.jsx("th",{children:"操作"})]})}),e.jsx("tbody",{children:C.map((p,k)=>e.jsxs("tr",{children:[t.columns.map(m=>e.jsx("td",{className:m.nowrap?"dyn-cell-nowrap":void 0,style:P(m),children:m.render==="countdown"?e.jsx(Mt,{target:Number(p[m.key])||0,onZero:I}):m.render==="status-badge"?e.jsx("span",{className:`dyn-badge dyn-badge-${String(p[m.key])}`,children:String(p[m.key]??"")}):m.render==="code"?e.jsx("code",{children:String(p[m.key]??"")}):m.render==="expandable-text"?e.jsx(Lt,{text:String(p[m.key]??"")}):String(p[m.key]??"")},m.key)),t.actions&&t.actions.length>0&&e.jsx("td",{className:"dyn-table-actions",children:t.actions.map((m,D)=>e.jsx("button",{className:`btn btn-sm${m.danger?" btn-danger":""}`,onClick:()=>$(m,p),children:m.label},D))})]},k))})]})}),y&&e.jsx("div",{className:"dyn-detail-overlay",onClick:()=>r(null),children:e.jsxs("div",{className:"dyn-detail-modal",onClick:p=>p.stopPropagation(),children:[e.jsxs("div",{className:"dyn-detail-header",children:[e.jsx("span",{className:"dyn-detail-title",children:String(y.name||y.title||"详情")}),e.jsx("button",{className:"dyn-detail-close",onClick:()=>r(null),children:"×"})]}),e.jsx("div",{className:"dyn-detail-body",children:Object.entries(y).map(([p,k])=>{const m=k==null?"":typeof k=="object"?JSON.stringify(k,null,2):String(k),D=m.length>120||m.includes(`
19
+ `);return e.jsxs("div",{className:"dyn-detail-field",children:[e.jsx("div",{className:"dyn-detail-key",children:p}),D?e.jsx("pre",{className:"dyn-detail-pre",children:m}):e.jsx("div",{className:"dyn-detail-val",children:m})]},p)})})]})})]})}function $t({comp:t,pluginName:s}){const[i,c]=l.useState({}),[u,o]=l.useState(!0),[a,y]=l.useState(!1),[r,j]=l.useState(""),z=l.useRef({}),[I,$]=l.useState(void 0);l.useEffect(()=>{o(!0),B(s,t.source).then(k=>{k&&c(k)}).catch(()=>{}).finally(()=>o(!1))},[s,t.source]);const P=async()=>{y(!0),j("");try{await B(s,t.save,i),j("已保存")}catch{j("保存失败")}y(!1)},C=k=>{me(`/api/models/${k}`).then(m=>{const D=m.providers&&m.providers.length>0?m.providers.map(_=>({label:`${_.provider} / ${_.model}`,value:_.value})):(m.models??[]).map(_=>({label:_,value:_}));z.current={...z.current,[k]:D}}).catch(()=>{})},p=()=>{I||me("/api/llm-providers").then(k=>$(k.providers??[])).catch(()=>$([]))};return u?e.jsx("div",{className:"empty-hint",children:"加载中..."}):e.jsxs("div",{className:"dyn-form-block",children:[t.label&&e.jsx("h3",{className:"dyn-section-title",children:t.label}),e.jsx(lt,{schema:t.schema,draft:i,onChange:c,modelCache:z.current,onFetchModels:C,llmProviders:I,onFetchLLMProviders:p}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:12,alignItems:"center"},children:[e.jsx("button",{className:"btn btn-sm btn-primary",onClick:P,disabled:a,children:a?"保存中...":"保存"}),r&&e.jsx("span",{style:{fontSize:13,color:r==="已保存"?"#22c55e":"#ef4444"},children:r})]})]})}function zt({comp:t,pluginName:s,onRefresh:i}){const[c,u]=l.useState({}),o=async a=>{if(!(a.confirm&&!confirm(a.confirm))){u(y=>({...y,[a.method]:"执行中..."}));try{await B(s,a.method),u(y=>({...y,[a.method]:"完成"})),i()}catch{u(y=>({...y,[a.method]:"失败"}))}}};return e.jsxs("div",{className:"dyn-actions-block",children:[t.label&&e.jsx("div",{className:"dyn-section-title",children:t.label}),e.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:t.items.map((a,y)=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[e.jsx("button",{className:`btn btn-sm${a.danger?" btn-danger":a.variant==="primary"?" btn-primary":""}`,onClick:()=>o(a),children:a.label}),c[a.method]&&e.jsx("span",{className:"dyn-action-msg",children:c[a.method]})]},y))})]})}function Dt({comp:t,pluginName:s,refreshTick:i}){const[c,u]=l.useState(null);return l.useEffect(()=>{B(s,t.source).then(o=>{o&&u(o)}).catch(()=>{})},[s,t.source,i]),e.jsxs("div",{className:"dyn-info-block",children:[t.label&&e.jsx("h3",{className:"dyn-section-title",children:t.label}),c?e.jsx("div",{className:"dyn-info-grid",children:Object.entries(c).map(([o,a])=>e.jsxs("div",{className:"dyn-info-item",children:[e.jsx("span",{className:"dyn-info-key",children:o}),e.jsx("span",{className:"dyn-info-val",children:typeof a=="object"?JSON.stringify(a):String(a??"")})]},o))}):e.jsx("div",{className:"empty-hint",children:"加载中..."})]})}function Tt({comp:t,pluginName:s,refreshTick:i}){const[c,u]=l.useState("");return l.useEffect(()=>{B(s,t.source).then(o=>{o&&u(o.content)}).catch(()=>{})},[s,t.source,i]),e.jsxs("div",{className:"dyn-markdown-block",children:[t.label&&e.jsx("h3",{className:"dyn-section-title",children:t.label}),e.jsx(ht,{remarkPlugins:[gt],rehypePlugins:[pt],children:c})]})}function Bt({comp:t,pluginName:s,refreshTick:i,onRefresh:c}){var y;const[u,o]=l.useState(((y=t.items[0])==null?void 0:y.key)??""),a=t.items.find(r=>r.key===u);return e.jsxs("div",{className:"dyn-tabs-block",children:[t.label&&e.jsx("h3",{className:"dyn-section-title",children:t.label}),e.jsx("div",{className:"dyn-tabs-header",children:t.items.map(r=>e.jsx("button",{className:`dyn-tab-btn${u===r.key?" active":""}`,onClick:()=>o(r.key),children:r.label},r.key))}),e.jsx("div",{className:"dyn-tabs-body",children:a&&a.content.map((r,j)=>e.jsx(Ue,{component:r,pluginName:s,refreshTick:i,onRefresh:c},j))})]})}function Ue({component:t,pluginName:s,refreshTick:i,onRefresh:c}){switch(t.type){case"stat":return e.jsx(Ze,{comp:t,pluginName:s,refreshTick:i});case"table":return e.jsx(At,{comp:t,pluginName:s,refreshTick:i});case"form":return e.jsx($t,{comp:t,pluginName:s});case"actions":return e.jsx(zt,{comp:t,pluginName:s,onRefresh:c});case"info":return e.jsx(Dt,{comp:t,pluginName:s,refreshTick:i});case"markdown":return e.jsx(Tt,{comp:t,pluginName:s,refreshTick:i});case"tabs":return e.jsx(Bt,{comp:t,pluginName:s,refreshTick:i,onRefresh:c});case"graph":return e.jsx(Et,{comp:t,pluginName:s,refreshTick:i,onRefresh:c});default:return null}}function Vt({page:t}){const[s,i]=l.useState(0),c=l.useCallback(()=>i(a=>a+1),[]);if(l.useEffect(()=>{const a=y=>{const r=y.detail;(!r.pluginName||r.pluginName===t.plugin)&&c()};return window.addEventListener("aalis:page-refresh",a),()=>window.removeEventListener("aalis:page-refresh",a)},[t.plugin,c]),!t.content||t.content.length===0)return e.jsx("div",{className:"empty-hint",style:{padding:24},children:"此页面未提供内容"});const u=[];for(const a of t.content)if(a.type==="stat"){const y=u[u.length-1];y&&y.type==="stat-grid"?y.items.push(a):u.push({type:"stat-grid",items:[a]})}else u.push({type:"component",item:a});const o=u.some(a=>a.type==="component"&&a.item.type==="graph");return e.jsx("div",{className:`page-content dynamic-page${o?" has-graph":""}`,children:u.map((a,y)=>{const r=o&&a.type==="component"&&a.item.type==="tabs";return a.type==="stat-grid"?e.jsx("div",{className:"dyn-stat-grid",children:a.items.map((j,z)=>e.jsx(Ze,{comp:j,pluginName:t.plugin,refreshTick:s},z))},y):e.jsx("div",{className:r?"dyn-scroll-region":void 0,children:e.jsx(Ue,{component:a.item,pluginName:t.plugin,refreshTick:s,onRefresh:c})},y)})})}export{Vt as DynamicPage};
@@ -1,4 +1,4 @@
1
- import{r as i,j as e}from"./react-vendor-BPQixOLZ.js";import{c as k,a as j,C as O,f as U,F as A,g as J,D as K,h as V,X as G}from"./index-Lxc_JKBO.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
1
+ import{r as i,j as e}from"./react-vendor-BPQixOLZ.js";import{c as k,a as j,C as O,f as U,F as A,g as J,D as K,h as V,X as G}from"./index-pGwN5S79.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{j as s,r as i}from"./react-vendor-BPQixOLZ.js";import{c as me,a as y,T as H,D as ue}from"./index-Lxc_JKBO.js";import{u as he}from"./ConfirmDialog-DbV-E1Nd.js";import{C as pe}from"./clock-DSh1391_.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
1
+ import{j as s,r as i}from"./react-vendor-BPQixOLZ.js";import{c as me,a as y,T as H,D as ue}from"./index-pGwN5S79.js";import{u as he}from"./ConfirmDialog-DbV-E1Nd.js";import{C as pe}from"./clock-CHmqRkfK.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as c,j as e}from"./react-vendor-BPQixOLZ.js";import{c as p,a as h}from"./index-Lxc_JKBO.js";import{G as x}from"./globe-CT0XtR4-.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
1
+ import{r as c,j as e}from"./react-vendor-BPQixOLZ.js";import{c as p,a as h}from"./index-pGwN5S79.js";import{G as x}from"./globe-BfItFm6P.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as d,j as e}from"./react-vendor-BPQixOLZ.js";import{c as q,a as k,T as Ae}from"./index-Lxc_JKBO.js";import{b as H,S as Se,f as ke,u as Re}from"./SchemaForm-BcYxH5r1.js";import{u as Je}from"./ConfirmDialog-DbV-E1Nd.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
1
+ import{r as d,j as e}from"./react-vendor-BPQixOLZ.js";import{c as q,a as k,T as Ae}from"./index-pGwN5S79.js";import{b as H,S as Se,f as ke,u as Re}from"./SchemaForm-BcYxH5r1.js";import{u as Je}from"./ConfirmDialog-DbV-E1Nd.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as u,j as e}from"./react-vendor-BPQixOLZ.js";import{p as w,b as xe,B as V,M as _,R,d as z,e as B,W as ge}from"./index-Lxc_JKBO.js";import{M as F}from"./markdown-B2G8c9k5.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";function pe(s,x){const[N,l]=u.useState({segments:[],isStreaming:!1,done:!1}),o=u.useRef(null),d=!!(s&&(x==="active"||x==="waiting"));u.useEffect(()=>{if(!d||!s){l({segments:[],isStreaming:!1,done:!1});return}const v=location.protocol==="https:"?"wss:":"ws:",c=new WebSocket(`${v}//${location.host}/ws`);return o.current=c,c.onopen=()=>{c.send(JSON.stringify({type:"subscribe_session",sessionId:s}))},c.onmessage=m=>{try{const n=JSON.parse(m.data);if(n.type==="stream_resume"){let j=[];if(Array.isArray(n.segments)&&n.segments.length>0)j=n.segments;else{const p=n.reasoningContent??"",y=n.content??"";p&&j.push({type:"reasoning_text",content:p}),y&&j.push({type:"text",content:y})}l({segments:j,isStreaming:!n.done,done:!!n.done})}else n.type==="stream"?n.done?l(j=>({...j,isStreaming:!1,done:!0})):l(j=>{const p=[...j.segments],y=(C,$)=>{const S=p[p.length-1];S&&S.type===C?p[p.length-1]={type:C,content:S.content+$}:p.push({type:C,content:$})};return n.reasoningDelta&&y("reasoning_text",n.reasoningDelta),n.contentDelta&&y("text",n.contentDelta),{...j,segments:p,isStreaming:!0}}):n.type==="tool_call"?l(j=>{const p=[...j.segments];if(n.toolPhase==="start")p.push({type:"tool_call",name:n.toolName,args:n.toolArgs??{},startTime:Date.now()});else if(n.toolPhase==="end"&&n.toolResult!==void 0){const y=p.findLastIndex(C=>C.type==="tool_call"&&C.name===n.toolName&&C.result==null);if(y>=0){const C=p[y];p[y]={...C,result:n.toolResult,endTime:Date.now()}}}return{...j,segments:p,isStreaming:!0}}):n.type==="message"&&l(j=>({...j,done:!0,isStreaming:!1}))}catch{}},c.onclose=()=>{o.current=null},()=>{c.close(),o.current=null}},[s,d]);const a=u.useCallback(()=>{l({segments:[],isStreaming:!1,done:!1})},[]);return[N,a]}const Y={active:"进行中",waiting:"等待中",completed:"已完成",error:"错误",archived:"已归档"},q={active:"#4caf50",waiting:"#ff9800",completed:"#2196f3",error:"#f44336",archived:"#888"};function X(s,x){return s?s.length>x?s.slice(0,x)+"…":s:""}function M(s){return new Date(s).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Q(s){const x=[];for(const N of s)x.push(N.session.id),x.push(...Q(N.children));return x}function je({config:s,resolvedConfig:x,inheritedConfig:N,options:l,onSave:o,onCancel:d}){var T,A;const[a,v]=u.useState({...s}),c=x||{},m=N||{},n=(t,g)=>{v(f=>({...f,[t]:g}))},j=t=>{var g,f;return(g=a.enabledToolGroups)!=null&&g.includes(t)?"explicit":(f=m.enabledToolGroups)!=null&&f.includes(t)&&!a.enabledToolGroups?"inherited":"off"},p=t=>{if(j(t)==="inherited"){const f=[...m.enabledToolGroups||[]];n("enabledToolGroups",f.filter(E=>E!==t))}else{const f=a.enabledToolGroups||m.enabledToolGroups||[],E=f.includes(t)?f.filter(I=>I!==t):[...f,t];n("enabledToolGroups",E.length>0?E:void 0)}},y=()=>{v(t=>{const{enabledToolGroups:g,...f}=t;return f})};if(!l)return e.jsx("div",{className:"session-config-editor",children:e.jsx("span",{className:"session-config-loading",children:"加载配置选项…"})});const C=(t,g)=>!a[t]&&g?` (继承: ${g})`:"",$=(T=a.llm)!=null&&T.provider&&((A=a.llm)!=null&&A.model)?`${a.llm.provider}/${a.llm.model}`:"",S=l.models.filter(t=>!!t.provider).map(t=>({key:`${t.provider}/${t.id}`,provider:t.provider,model:t.id,label:`${t.provider} / ${t.id}${t.capabilities.length>0?` [${t.capabilities.join(",")}]`:""}`}));$&&!S.some(t=>t.key===$)&&S.unshift({key:$,provider:a.llm.provider,model:a.llm.model,label:`${a.llm.provider} / ${a.llm.model} (已离线)`});const b=m.llm?`${m.llm.provider} / ${m.llm.model}`:void 0;return e.jsxs("div",{className:"session-config-editor",onClick:t=>t.stopPropagation(),children:[e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["模型",!a.llm&&b?` (继承: ${b})`:""]}),e.jsxs("select",{value:$,onChange:t=>{const g=t.target.value;if(!g){n("llm",void 0);return}const f=S.find(E=>E.key===g);f&&n("llm",{provider:f.provider,model:f.model})},children:[e.jsx("option",{value:"",children:b?`继承 (${b})`:"继承默认"}),S.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["人设",C("persona",m.persona)]}),e.jsxs("select",{value:a.persona||"",onChange:t=>n("persona",t.target.value||void 0),children:[e.jsx("option",{value:"",children:m.persona?`继承 (${m.persona})`:"继承默认"}),l.personas.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),l.toolGroups.length>0&&e.jsxs("div",{className:"session-config-field",children:[e.jsxs("span",{children:["工具分组",a.enabledToolGroups?"":" (继承)"]}),e.jsxs("div",{className:"session-config-chips",children:[l.toolGroups.map(t=>{const g=j(t.name);return e.jsx("button",{className:`session-config-chip ${g==="explicit"?"active":g==="inherited"?"active inherited":""}`,onClick:()=>p(t.name),title:`${t.name}${g==="inherited"?" (继承)":g==="explicit"?" (已覆盖)":""}`,children:t.label||t.name},t.name)}),a.enabledToolGroups&&e.jsx("button",{className:"session-config-chip reset",onClick:y,title:"恢复为继承",children:"↺ 重置"})]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"额外提示"}),e.jsx("textarea",{rows:2,value:a.systemPromptExtra||"",onChange:t=>n("systemPromptExtra",t.target.value||void 0),placeholder:"追加到系统提示之后…"})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"工具迭代上限"}),e.jsx("input",{type:"number",min:0,max:50,value:a.maxToolIterations??"",onChange:t=>n("maxToolIterations",t.target.value?Number(t.target.value):void 0),placeholder:m.maxToolIterations?`继承 (${m.maxToolIterations})`:"默认"})]}),e.jsxs("div",{className:"session-config-toggles",children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.disableOutputFormat??c.disableOutputFormat??!1,onChange:t=>n("disableOutputFormat",t.target.checked||void 0)}),e.jsxs("span",{children:["禁用结构化输出",a.disableOutputFormat===void 0&&m.disableOutputFormat?" (继承)":""]})]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.clientSideJsonRendering??c.clientSideJsonRendering??!1,onChange:t=>n("clientSideJsonRendering",t.target.checked||void 0)}),e.jsxs("span",{children:["客户端 JSON 渲染",a.clientSideJsonRendering===void 0&&m.clientSideJsonRendering?" (继承)":""]})]})]}),e.jsxs("div",{className:"session-config-actions",children:[e.jsx("button",{className:"session-config-btn save",onClick:()=>o(a),children:"保存"}),e.jsx("button",{className:"session-config-btn cancel",onClick:d,children:"取消"})]})]})}function Se({pluginName:s,activeSessionId:x,onSwitchSession:N,onStartNewChat:l,refreshSignal:o}){const[d,a]=u.useState([]),[v,c]=u.useState(null),[m,n]=u.useState(null),[j,p]=u.useState(!1),[y,C]=u.useState(null),[$,S]=u.useState(!1),[b,T]=u.useState(new Set),[A,t]=u.useState(null),[g,f]=u.useState(""),[E,I]=u.useState(null),[G,r]=u.useState(null),[L,K]=u.useState(null),[W,O]=u.useState(null),[U,h]=u.useState(null),P=u.useCallback(()=>{w(s,"getSessionTree").then(i=>{Array.isArray(i)&&a(i)}).catch(()=>C("无法加载会话树"))},[s]);u.useEffect(()=>{P();const i=setInterval(P,3e4);return()=>clearInterval(i)},[P]),u.useEffect(()=>{o&&(P(),G&&Promise.all([w(s,"getResolvedConfig",{sessionId:G,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:G,platform:"webui"})]).then(([i,k])=>{i&&O(i),k&&h(k)}).catch(()=>{}))},[o]);const H=u.useCallback(i=>{c(i),p(!0),w(s,"getSessionDetail",{id:i}).then(k=>n(k)).catch(()=>n(null)).finally(()=>p(!1))},[s]),se=async()=>{try{await w(s,"createSession",{}),P()}catch{}},te=async i=>{try{await w(s,"createSession",{parentId:i}),P()}catch{}},ne=async i=>{if(!g.trim()){t(null);return}try{await w(s,"renameSession",{id:i,title:g.trim()}),P()}catch{}t(null)},le=async i=>{try{await w(s,"archiveSession",{id:i}),P()}catch{}},ie=async i=>{try{const k=i===x;await w(s,"deleteSession",{id:i}),P(),v===i&&(c(null),n(null)),k&&l&&l()}catch{}I(null)},ae=async i=>{if(G===i){r(null),O(null),h(null);return}r(i),O(null),h(null);try{const[k,D,J]=await Promise.all([L?Promise.resolve(L):w(s,"getConfigOptions"),w(s,"getResolvedConfig",{sessionId:i,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:i,platform:"webui"})]);k&&!L&&K(k),D&&O(D),J&&h(J)}catch{}},re=async(i,k)=>{try{await w(s,"updateSessionConfig",{id:i,config:k}),P(),r(null)}catch(D){const J=D instanceof Error?D.message:String(D);alert(`保存会话配置失败:${J}`)}},ce=i=>{T(k=>{const D=new Set(k);return D.has(i)?D.delete(i):D.add(i),D})},oe=()=>{const i=Q(d);T(new Set(i))},de=()=>T(new Set),he=async()=>{if(b.size!==0)try{await w(s,"batchArchive",{ids:[...b]}),T(new Set),P()}catch{}},me=async()=>{if(b.size!==0&&confirm(`确认删除选中的 ${b.size} 个会话?此操作不可恢复。`))try{await w(s,"batchDelete",{ids:[...b]}),T(new Set),v&&b.has(v)&&(c(null),n(null)),P()}catch{}},ue=()=>{S(!1),T(new Set)};return y?e.jsx("div",{className:"tree-page-error",children:y}):e.jsxs("div",{className:"session-tree-page",children:[e.jsxs("div",{className:"tree-visual-panel",children:[e.jsxs("div",{className:"tree-visual-header",children:[e.jsx("h3",{children:"会话"}),e.jsx("div",{className:"tree-header-actions",children:$?e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-batch-btn",onClick:oe,title:"全选",children:"全选"}),e.jsx("button",{className:"tree-batch-btn",onClick:de,title:"取消全选",children:"取消"}),e.jsxs("button",{className:"tree-batch-btn archive",onClick:he,disabled:b.size===0,children:["归档 (",b.size,")"]}),e.jsxs("button",{className:"tree-batch-btn danger",onClick:me,disabled:b.size===0,children:["删除 (",b.size,")"]}),e.jsx("button",{className:"tree-batch-btn",onClick:ue,children:"退出批量"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-action-btn",onClick:se,title:"新建会话",children:"+"}),e.jsx("button",{className:"tree-action-btn",onClick:()=>S(!0),title:"批量管理",children:"☐"}),e.jsx("button",{className:"tree-refresh-btn",onClick:P,children:"⟳"})]})})]}),e.jsx("div",{className:"tree-visual-body",children:d.length===0?e.jsx("div",{className:"tree-empty",children:"暂无会话"}):d.map(i=>e.jsx(Z,{node:i,selectedId:v,activeSessionId:x,onSelect:H,depth:0,batchMode:$,selected:b,onToggleSelect:ce,onCreateChild:te,onRename:(k,D)=>{t(k),f(D)},onArchive:le,onDelete:k=>I(k),onOpenConfig:ae,editingId:A,editTitle:g,onEditTitleChange:f,onCommitRename:ne,onCancelEdit:()=>t(null),configEditingId:G,configOptions:L,resolvedConfig:W,inheritedConfig:U,onSaveConfig:re,onCancelConfig:()=>r(null)},i.session.id))})]}),e.jsx("div",{className:"tree-detail-panel",children:v?j?e.jsx("div",{className:"tree-detail-placeholder",children:"加载中…"}):m?e.jsx(fe,{detail:m,onSwitchSession:N,onRefresh:()=>H(m.session.id)}):e.jsx("div",{className:"tree-detail-placeholder",children:"无法加载会话信息"}):e.jsx("div",{className:"tree-detail-placeholder tree-detail-placeholder-idle",children:"点击会话节点查看详情"})}),E&&e.jsx("div",{className:"delete-confirm-overlay",onClick:()=>I(null),children:e.jsxs("div",{className:"delete-confirm-dialog",onClick:i=>i.stopPropagation(),children:[e.jsx("p",{children:"确定要删除此会话吗?子会话也会被一并删除,此操作无法撤销。"}),e.jsxs("div",{className:"delete-confirm-actions",children:[e.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>ie(E),children:"删除"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>I(null),children:"取消"})]})]})})]})}function Z({node:s,selectedId:x,activeSessionId:N,onSelect:l,depth:o,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}){const[I,G]=u.useState(!0),r=s.session,L=s.children.length>0,K=r.id===x,W=r.id===N,O=y===r.id,U=a.has(r.id);return e.jsxs("div",{className:"tree-node-group",children:[e.jsxs("div",{className:`tree-node ${K?"selected":""} ${W?"active-chat":""} status-${r.status}`,style:{marginLeft:o*24},onClick:()=>d?v(r.id):l(r.id),children:[d&&e.jsx("input",{type:"checkbox",className:"tree-node-checkbox",checked:U,onChange:()=>v(r.id),onClick:h=>h.stopPropagation()}),e.jsx("button",{className:"tree-node-toggle",onClick:h=>{h.stopPropagation(),G(!I)},style:{visibility:L?"visible":"hidden"},children:I?"▾":"▸"}),e.jsx("span",{className:"tree-node-status",style:{background:q[r.status]||"#888"}}),e.jsx("div",{className:"tree-node-info",children:O?e.jsx("input",{className:"tree-node-rename-input",value:C,onChange:h=>$(h.target.value),onBlur:()=>S(r.id),onKeyDown:h=>{h.key==="Enter"&&S(r.id),h.key==="Escape"&&b()},onClick:h=>h.stopPropagation(),autoFocus:!0}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"tree-node-title",children:r.title||r.name}),e.jsxs("span",{className:"tree-node-meta",children:[Y[r.status]||r.status,r.createdBy&&r.createdBy!=="user"&&` · ${r.createdBy}`,` · ${M(r.createdAt)}`]})]})}),L&&e.jsx("span",{className:"tree-node-badge",children:s.children.length}),!d&&e.jsxs("div",{className:"tree-node-actions",onClick:h=>h.stopPropagation(),children:[e.jsx("button",{className:"tree-node-action-btn",title:"新建子会话",onClick:()=>c(r.id),children:"➕"}),e.jsx("button",{className:"tree-node-action-btn",title:"配置",onClick:()=>p(r.id),children:"⚙"}),e.jsx("button",{className:"tree-node-action-btn",title:"重命名",onClick:()=>m(r.id,r.title||r.name),children:"✎"}),r.status==="active"&&e.jsx("button",{className:"tree-node-action-btn",title:"归档",onClick:()=>n(r.id),children:"▪"}),e.jsx("button",{className:"tree-node-action-btn danger",title:"删除",onClick:()=>j(r.id),children:"✕"})]})]}),T===r.id&&e.jsx("div",{style:{marginLeft:o*24+24},children:e.jsx(je,{config:r.config||{},resolvedConfig:t,inheritedConfig:g,options:A,onSave:h=>f(r.id,h),onCancel:E})}),L&&I&&e.jsx("div",{className:"tree-node-children",children:s.children.map(h=>e.jsxs("div",{className:"tree-child-wrapper",children:[h.session.inputContext&&e.jsxs("div",{className:"tree-flow-label",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↓"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.inputContext,80)})]}),e.jsx(Z,{node:h,selectedId:x,activeSessionId:N,onSelect:l,depth:o+1,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}),h.session.result&&e.jsxs("div",{className:"tree-flow-label result",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↑"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.result,80)})]})]},h.session.id))})]})}function fe({detail:s,onSwitchSession:x,onRefresh:N}){const l=s.session,o=xe(s.messages),[d,a]=pe(l.id,l.status);return u.useEffect(()=>{d.done&&(a(),N==null||N())},[d.done,a,N]),e.jsxs("div",{className:"session-detail",children:[e.jsxs("div",{className:"session-detail-header",children:[e.jsx("h3",{children:l.title||l.name}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[x&&e.jsx("button",{className:"btn btn-sm btn-primary",onClick:()=>x(l.id),children:"进入对话"}),e.jsx("span",{className:"session-detail-status",style:{color:q[l.status]},children:Y[l.status]})]})]}),e.jsxs("div",{className:"session-detail-meta",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"ID:"})," ",l.id]}),e.jsxs("div",{children:[e.jsx("strong",{children:"创建时间:"})," ",new Date(l.createdAt).toLocaleString("zh-CN")]}),l.parentId&&e.jsxs("div",{children:[e.jsx("strong",{children:"父会话:"})," ",l.parentId]}),l.createdBy&&e.jsxs("div",{children:[e.jsx("strong",{children:"创建者:"})," ",l.createdBy]}),l.children.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"子会话数:"})," ",l.children.length]})]}),l.inputContext&&e.jsxs("div",{className:"session-detail-context",children:[e.jsx("div",{className:"context-label",children:"来自父会话的指令"}),e.jsx("div",{className:"context-content",children:l.inputContext})]}),l.result&&e.jsxs("div",{className:"session-detail-result",children:[e.jsx("div",{className:"context-label",children:"给父会话的结果"}),e.jsx("div",{className:"context-content",children:l.result})]}),e.jsxs("div",{className:"session-detail-messages",children:[e.jsxs("h4",{children:["消息记录 (",s.messages.length,")"]}),o.length===0&&!d.isStreaming?e.jsx("div",{className:"no-messages",children:"暂无消息记录"}):e.jsxs("div",{className:"message-list",children:[o.map((v,c)=>e.jsx(ve,{msg:v},c)),d.isStreaming&&d.segments.length>0&&e.jsxs("div",{className:"detail-message assistant streaming",children:[e.jsxs("div",{className:"detail-msg-role",children:["助手 ",e.jsx("span",{className:"streaming-indicator",children:"●"})]}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:(()=>{const v=[];let c=0;for(;c<d.segments.length;){const m=d.segments[c];if(m.type==="reasoning_text"){let n="";for(;c<d.segments.length&&d.segments[c].type==="reasoning_text";)n+=d.segments[c].content,c++;n&&v.push(e.jsxs("details",{className:"thinking-block",open:!0,children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(n)})})]},`r-${c}`));continue}v.push(e.jsx(ee,{seg:m},c)),c++}return v})()})]})]})]})]})}function ee({seg:s}){return s.type==="text"||s.type==="reasoning_text"?s.content?e.jsx("div",{className:"detail-text-segment",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}):null:e.jsxs("details",{className:"tool-call-block",children:[e.jsxs("summary",{className:"tool-call-summary",children:[e.jsx(ge,{size:14})," ",s.name,s.result==null?" …":""]}),e.jsxs("div",{className:"tool-call-content",children:[e.jsxs("div",{className:"tool-call-args",children:[e.jsx("strong",{children:"参数"}),e.jsx("pre",{children:JSON.stringify(s.args,null,2)})]}),s.result!=null&&e.jsxs("div",{className:"tool-call-result",children:[e.jsx("strong",{children:"结果"}),e.jsx("pre",{children:s.result})]})]})]})}function ve({msg:s}){const x=s.role==="user"?"用户":"助手";if(s.role==="user")return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content",children:s.content}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]});if(s.role==="assistant"&&s.segments&&s.segments.length>0){const l=[];let o=0;for(;o<s.segments.length;){const d=s.segments[o];if(d.type==="reasoning_text"){let a="";for(;o<s.segments.length&&s.segments[o].type==="reasoning_text";)a+=s.segments[o].content,o++;a&&l.push(e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(a)})})]},`r-${o}`));continue}l.push(e.jsx(ee,{seg:d},o)),o++}return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:l}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}const N=s.role==="assistant"&&s.reasoningContent?e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.reasoningContent)})})]}):null;return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),N,e.jsx("div",{className:"detail-msg-content detail-msg-md",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}export{Se as SessionsPage};
1
+ import{r as u,j as e}from"./react-vendor-BPQixOLZ.js";import{p as w,b as xe,B as V,M as _,R,d as z,e as B,W as ge}from"./index-pGwN5S79.js";import{M as F}from"./markdown-B2G8c9k5.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";function pe(s,x){const[N,l]=u.useState({segments:[],isStreaming:!1,done:!1}),o=u.useRef(null),d=!!(s&&(x==="active"||x==="waiting"));u.useEffect(()=>{if(!d||!s){l({segments:[],isStreaming:!1,done:!1});return}const v=location.protocol==="https:"?"wss:":"ws:",c=new WebSocket(`${v}//${location.host}/ws`);return o.current=c,c.onopen=()=>{c.send(JSON.stringify({type:"subscribe_session",sessionId:s}))},c.onmessage=m=>{try{const n=JSON.parse(m.data);if(n.type==="stream_resume"){let j=[];if(Array.isArray(n.segments)&&n.segments.length>0)j=n.segments;else{const p=n.reasoningContent??"",y=n.content??"";p&&j.push({type:"reasoning_text",content:p}),y&&j.push({type:"text",content:y})}l({segments:j,isStreaming:!n.done,done:!!n.done})}else n.type==="stream"?n.done?l(j=>({...j,isStreaming:!1,done:!0})):l(j=>{const p=[...j.segments],y=(C,$)=>{const S=p[p.length-1];S&&S.type===C?p[p.length-1]={type:C,content:S.content+$}:p.push({type:C,content:$})};return n.reasoningDelta&&y("reasoning_text",n.reasoningDelta),n.contentDelta&&y("text",n.contentDelta),{...j,segments:p,isStreaming:!0}}):n.type==="tool_call"?l(j=>{const p=[...j.segments];if(n.toolPhase==="start")p.push({type:"tool_call",name:n.toolName,args:n.toolArgs??{},startTime:Date.now()});else if(n.toolPhase==="end"&&n.toolResult!==void 0){const y=p.findLastIndex(C=>C.type==="tool_call"&&C.name===n.toolName&&C.result==null);if(y>=0){const C=p[y];p[y]={...C,result:n.toolResult,endTime:Date.now()}}}return{...j,segments:p,isStreaming:!0}}):n.type==="message"&&l(j=>({...j,done:!0,isStreaming:!1}))}catch{}},c.onclose=()=>{o.current=null},()=>{c.close(),o.current=null}},[s,d]);const a=u.useCallback(()=>{l({segments:[],isStreaming:!1,done:!1})},[]);return[N,a]}const Y={active:"进行中",waiting:"等待中",completed:"已完成",error:"错误",archived:"已归档"},q={active:"#4caf50",waiting:"#ff9800",completed:"#2196f3",error:"#f44336",archived:"#888"};function X(s,x){return s?s.length>x?s.slice(0,x)+"…":s:""}function M(s){return new Date(s).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Q(s){const x=[];for(const N of s)x.push(N.session.id),x.push(...Q(N.children));return x}function je({config:s,resolvedConfig:x,inheritedConfig:N,options:l,onSave:o,onCancel:d}){var T,A;const[a,v]=u.useState({...s}),c=x||{},m=N||{},n=(t,g)=>{v(f=>({...f,[t]:g}))},j=t=>{var g,f;return(g=a.enabledToolGroups)!=null&&g.includes(t)?"explicit":(f=m.enabledToolGroups)!=null&&f.includes(t)&&!a.enabledToolGroups?"inherited":"off"},p=t=>{if(j(t)==="inherited"){const f=[...m.enabledToolGroups||[]];n("enabledToolGroups",f.filter(E=>E!==t))}else{const f=a.enabledToolGroups||m.enabledToolGroups||[],E=f.includes(t)?f.filter(I=>I!==t):[...f,t];n("enabledToolGroups",E.length>0?E:void 0)}},y=()=>{v(t=>{const{enabledToolGroups:g,...f}=t;return f})};if(!l)return e.jsx("div",{className:"session-config-editor",children:e.jsx("span",{className:"session-config-loading",children:"加载配置选项…"})});const C=(t,g)=>!a[t]&&g?` (继承: ${g})`:"",$=(T=a.llm)!=null&&T.provider&&((A=a.llm)!=null&&A.model)?`${a.llm.provider}/${a.llm.model}`:"",S=l.models.filter(t=>!!t.provider).map(t=>({key:`${t.provider}/${t.id}`,provider:t.provider,model:t.id,label:`${t.provider} / ${t.id}${t.capabilities.length>0?` [${t.capabilities.join(",")}]`:""}`}));$&&!S.some(t=>t.key===$)&&S.unshift({key:$,provider:a.llm.provider,model:a.llm.model,label:`${a.llm.provider} / ${a.llm.model} (已离线)`});const b=m.llm?`${m.llm.provider} / ${m.llm.model}`:void 0;return e.jsxs("div",{className:"session-config-editor",onClick:t=>t.stopPropagation(),children:[e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["模型",!a.llm&&b?` (继承: ${b})`:""]}),e.jsxs("select",{value:$,onChange:t=>{const g=t.target.value;if(!g){n("llm",void 0);return}const f=S.find(E=>E.key===g);f&&n("llm",{provider:f.provider,model:f.model})},children:[e.jsx("option",{value:"",children:b?`继承 (${b})`:"继承默认"}),S.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsxs("span",{children:["人设",C("persona",m.persona)]}),e.jsxs("select",{value:a.persona||"",onChange:t=>n("persona",t.target.value||void 0),children:[e.jsx("option",{value:"",children:m.persona?`继承 (${m.persona})`:"继承默认"}),l.personas.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),l.toolGroups.length>0&&e.jsxs("div",{className:"session-config-field",children:[e.jsxs("span",{children:["工具分组",a.enabledToolGroups?"":" (继承)"]}),e.jsxs("div",{className:"session-config-chips",children:[l.toolGroups.map(t=>{const g=j(t.name);return e.jsx("button",{className:`session-config-chip ${g==="explicit"?"active":g==="inherited"?"active inherited":""}`,onClick:()=>p(t.name),title:`${t.name}${g==="inherited"?" (继承)":g==="explicit"?" (已覆盖)":""}`,children:t.label||t.name},t.name)}),a.enabledToolGroups&&e.jsx("button",{className:"session-config-chip reset",onClick:y,title:"恢复为继承",children:"↺ 重置"})]})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"额外提示"}),e.jsx("textarea",{rows:2,value:a.systemPromptExtra||"",onChange:t=>n("systemPromptExtra",t.target.value||void 0),placeholder:"追加到系统提示之后…"})]}),e.jsxs("label",{className:"session-config-field",children:[e.jsx("span",{children:"工具迭代上限"}),e.jsx("input",{type:"number",min:0,max:50,value:a.maxToolIterations??"",onChange:t=>n("maxToolIterations",t.target.value?Number(t.target.value):void 0),placeholder:m.maxToolIterations?`继承 (${m.maxToolIterations})`:"默认"})]}),e.jsxs("div",{className:"session-config-toggles",children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.disableOutputFormat??c.disableOutputFormat??!1,onChange:t=>n("disableOutputFormat",t.target.checked||void 0)}),e.jsxs("span",{children:["禁用结构化输出",a.disableOutputFormat===void 0&&m.disableOutputFormat?" (继承)":""]})]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:a.clientSideJsonRendering??c.clientSideJsonRendering??!1,onChange:t=>n("clientSideJsonRendering",t.target.checked||void 0)}),e.jsxs("span",{children:["客户端 JSON 渲染",a.clientSideJsonRendering===void 0&&m.clientSideJsonRendering?" (继承)":""]})]})]}),e.jsxs("div",{className:"session-config-actions",children:[e.jsx("button",{className:"session-config-btn save",onClick:()=>o(a),children:"保存"}),e.jsx("button",{className:"session-config-btn cancel",onClick:d,children:"取消"})]})]})}function Se({pluginName:s,activeSessionId:x,onSwitchSession:N,onStartNewChat:l,refreshSignal:o}){const[d,a]=u.useState([]),[v,c]=u.useState(null),[m,n]=u.useState(null),[j,p]=u.useState(!1),[y,C]=u.useState(null),[$,S]=u.useState(!1),[b,T]=u.useState(new Set),[A,t]=u.useState(null),[g,f]=u.useState(""),[E,I]=u.useState(null),[G,r]=u.useState(null),[L,K]=u.useState(null),[W,O]=u.useState(null),[U,h]=u.useState(null),P=u.useCallback(()=>{w(s,"getSessionTree").then(i=>{Array.isArray(i)&&a(i)}).catch(()=>C("无法加载会话树"))},[s]);u.useEffect(()=>{P();const i=setInterval(P,3e4);return()=>clearInterval(i)},[P]),u.useEffect(()=>{o&&(P(),G&&Promise.all([w(s,"getResolvedConfig",{sessionId:G,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:G,platform:"webui"})]).then(([i,k])=>{i&&O(i),k&&h(k)}).catch(()=>{}))},[o]);const H=u.useCallback(i=>{c(i),p(!0),w(s,"getSessionDetail",{id:i}).then(k=>n(k)).catch(()=>n(null)).finally(()=>p(!1))},[s]),se=async()=>{try{await w(s,"createSession",{}),P()}catch{}},te=async i=>{try{await w(s,"createSession",{parentId:i}),P()}catch{}},ne=async i=>{if(!g.trim()){t(null);return}try{await w(s,"renameSession",{id:i,title:g.trim()}),P()}catch{}t(null)},le=async i=>{try{await w(s,"archiveSession",{id:i}),P()}catch{}},ie=async i=>{try{const k=i===x;await w(s,"deleteSession",{id:i}),P(),v===i&&(c(null),n(null)),k&&l&&l()}catch{}I(null)},ae=async i=>{if(G===i){r(null),O(null),h(null);return}r(i),O(null),h(null);try{const[k,D,J]=await Promise.all([L?Promise.resolve(L):w(s,"getConfigOptions"),w(s,"getResolvedConfig",{sessionId:i,platform:"webui"}),w(s,"getInheritedDefaults",{sessionId:i,platform:"webui"})]);k&&!L&&K(k),D&&O(D),J&&h(J)}catch{}},re=async(i,k)=>{try{await w(s,"updateSessionConfig",{id:i,config:k}),P(),r(null)}catch(D){const J=D instanceof Error?D.message:String(D);alert(`保存会话配置失败:${J}`)}},ce=i=>{T(k=>{const D=new Set(k);return D.has(i)?D.delete(i):D.add(i),D})},oe=()=>{const i=Q(d);T(new Set(i))},de=()=>T(new Set),he=async()=>{if(b.size!==0)try{await w(s,"batchArchive",{ids:[...b]}),T(new Set),P()}catch{}},me=async()=>{if(b.size!==0&&confirm(`确认删除选中的 ${b.size} 个会话?此操作不可恢复。`))try{await w(s,"batchDelete",{ids:[...b]}),T(new Set),v&&b.has(v)&&(c(null),n(null)),P()}catch{}},ue=()=>{S(!1),T(new Set)};return y?e.jsx("div",{className:"tree-page-error",children:y}):e.jsxs("div",{className:"session-tree-page",children:[e.jsxs("div",{className:"tree-visual-panel",children:[e.jsxs("div",{className:"tree-visual-header",children:[e.jsx("h3",{children:"会话"}),e.jsx("div",{className:"tree-header-actions",children:$?e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-batch-btn",onClick:oe,title:"全选",children:"全选"}),e.jsx("button",{className:"tree-batch-btn",onClick:de,title:"取消全选",children:"取消"}),e.jsxs("button",{className:"tree-batch-btn archive",onClick:he,disabled:b.size===0,children:["归档 (",b.size,")"]}),e.jsxs("button",{className:"tree-batch-btn danger",onClick:me,disabled:b.size===0,children:["删除 (",b.size,")"]}),e.jsx("button",{className:"tree-batch-btn",onClick:ue,children:"退出批量"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tree-action-btn",onClick:se,title:"新建会话",children:"+"}),e.jsx("button",{className:"tree-action-btn",onClick:()=>S(!0),title:"批量管理",children:"☐"}),e.jsx("button",{className:"tree-refresh-btn",onClick:P,children:"⟳"})]})})]}),e.jsx("div",{className:"tree-visual-body",children:d.length===0?e.jsx("div",{className:"tree-empty",children:"暂无会话"}):d.map(i=>e.jsx(Z,{node:i,selectedId:v,activeSessionId:x,onSelect:H,depth:0,batchMode:$,selected:b,onToggleSelect:ce,onCreateChild:te,onRename:(k,D)=>{t(k),f(D)},onArchive:le,onDelete:k=>I(k),onOpenConfig:ae,editingId:A,editTitle:g,onEditTitleChange:f,onCommitRename:ne,onCancelEdit:()=>t(null),configEditingId:G,configOptions:L,resolvedConfig:W,inheritedConfig:U,onSaveConfig:re,onCancelConfig:()=>r(null)},i.session.id))})]}),e.jsx("div",{className:"tree-detail-panel",children:v?j?e.jsx("div",{className:"tree-detail-placeholder",children:"加载中…"}):m?e.jsx(fe,{detail:m,onSwitchSession:N,onRefresh:()=>H(m.session.id)}):e.jsx("div",{className:"tree-detail-placeholder",children:"无法加载会话信息"}):e.jsx("div",{className:"tree-detail-placeholder tree-detail-placeholder-idle",children:"点击会话节点查看详情"})}),E&&e.jsx("div",{className:"delete-confirm-overlay",onClick:()=>I(null),children:e.jsxs("div",{className:"delete-confirm-dialog",onClick:i=>i.stopPropagation(),children:[e.jsx("p",{children:"确定要删除此会话吗?子会话也会被一并删除,此操作无法撤销。"}),e.jsxs("div",{className:"delete-confirm-actions",children:[e.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>ie(E),children:"删除"}),e.jsx("button",{className:"btn btn-sm",onClick:()=>I(null),children:"取消"})]})]})})]})}function Z({node:s,selectedId:x,activeSessionId:N,onSelect:l,depth:o,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}){const[I,G]=u.useState(!0),r=s.session,L=s.children.length>0,K=r.id===x,W=r.id===N,O=y===r.id,U=a.has(r.id);return e.jsxs("div",{className:"tree-node-group",children:[e.jsxs("div",{className:`tree-node ${K?"selected":""} ${W?"active-chat":""} status-${r.status}`,style:{marginLeft:o*24},onClick:()=>d?v(r.id):l(r.id),children:[d&&e.jsx("input",{type:"checkbox",className:"tree-node-checkbox",checked:U,onChange:()=>v(r.id),onClick:h=>h.stopPropagation()}),e.jsx("button",{className:"tree-node-toggle",onClick:h=>{h.stopPropagation(),G(!I)},style:{visibility:L?"visible":"hidden"},children:I?"▾":"▸"}),e.jsx("span",{className:"tree-node-status",style:{background:q[r.status]||"#888"}}),e.jsx("div",{className:"tree-node-info",children:O?e.jsx("input",{className:"tree-node-rename-input",value:C,onChange:h=>$(h.target.value),onBlur:()=>S(r.id),onKeyDown:h=>{h.key==="Enter"&&S(r.id),h.key==="Escape"&&b()},onClick:h=>h.stopPropagation(),autoFocus:!0}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"tree-node-title",children:r.title||r.name}),e.jsxs("span",{className:"tree-node-meta",children:[Y[r.status]||r.status,r.createdBy&&r.createdBy!=="user"&&` · ${r.createdBy}`,` · ${M(r.createdAt)}`]})]})}),L&&e.jsx("span",{className:"tree-node-badge",children:s.children.length}),!d&&e.jsxs("div",{className:"tree-node-actions",onClick:h=>h.stopPropagation(),children:[e.jsx("button",{className:"tree-node-action-btn",title:"新建子会话",onClick:()=>c(r.id),children:"➕"}),e.jsx("button",{className:"tree-node-action-btn",title:"配置",onClick:()=>p(r.id),children:"⚙"}),e.jsx("button",{className:"tree-node-action-btn",title:"重命名",onClick:()=>m(r.id,r.title||r.name),children:"✎"}),r.status==="active"&&e.jsx("button",{className:"tree-node-action-btn",title:"归档",onClick:()=>n(r.id),children:"▪"}),e.jsx("button",{className:"tree-node-action-btn danger",title:"删除",onClick:()=>j(r.id),children:"✕"})]})]}),T===r.id&&e.jsx("div",{style:{marginLeft:o*24+24},children:e.jsx(je,{config:r.config||{},resolvedConfig:t,inheritedConfig:g,options:A,onSave:h=>f(r.id,h),onCancel:E})}),L&&I&&e.jsx("div",{className:"tree-node-children",children:s.children.map(h=>e.jsxs("div",{className:"tree-child-wrapper",children:[h.session.inputContext&&e.jsxs("div",{className:"tree-flow-label",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↓"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.inputContext,80)})]}),e.jsx(Z,{node:h,selectedId:x,activeSessionId:N,onSelect:l,depth:o+1,batchMode:d,selected:a,onToggleSelect:v,onCreateChild:c,onRename:m,onArchive:n,onDelete:j,onOpenConfig:p,editingId:y,editTitle:C,onEditTitleChange:$,onCommitRename:S,onCancelEdit:b,configEditingId:T,configOptions:A,resolvedConfig:t,inheritedConfig:g,onSaveConfig:f,onCancelConfig:E}),h.session.result&&e.jsxs("div",{className:"tree-flow-label result",style:{marginLeft:(o+1)*24},children:[e.jsx("span",{className:"tree-flow-arrow",children:"↑"}),e.jsx("span",{className:"tree-flow-text",children:X(h.session.result,80)})]})]},h.session.id))})]})}function fe({detail:s,onSwitchSession:x,onRefresh:N}){const l=s.session,o=xe(s.messages),[d,a]=pe(l.id,l.status);return u.useEffect(()=>{d.done&&(a(),N==null||N())},[d.done,a,N]),e.jsxs("div",{className:"session-detail",children:[e.jsxs("div",{className:"session-detail-header",children:[e.jsx("h3",{children:l.title||l.name}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[x&&e.jsx("button",{className:"btn btn-sm btn-primary",onClick:()=>x(l.id),children:"进入对话"}),e.jsx("span",{className:"session-detail-status",style:{color:q[l.status]},children:Y[l.status]})]})]}),e.jsxs("div",{className:"session-detail-meta",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"ID:"})," ",l.id]}),e.jsxs("div",{children:[e.jsx("strong",{children:"创建时间:"})," ",new Date(l.createdAt).toLocaleString("zh-CN")]}),l.parentId&&e.jsxs("div",{children:[e.jsx("strong",{children:"父会话:"})," ",l.parentId]}),l.createdBy&&e.jsxs("div",{children:[e.jsx("strong",{children:"创建者:"})," ",l.createdBy]}),l.children.length>0&&e.jsxs("div",{children:[e.jsx("strong",{children:"子会话数:"})," ",l.children.length]})]}),l.inputContext&&e.jsxs("div",{className:"session-detail-context",children:[e.jsx("div",{className:"context-label",children:"来自父会话的指令"}),e.jsx("div",{className:"context-content",children:l.inputContext})]}),l.result&&e.jsxs("div",{className:"session-detail-result",children:[e.jsx("div",{className:"context-label",children:"给父会话的结果"}),e.jsx("div",{className:"context-content",children:l.result})]}),e.jsxs("div",{className:"session-detail-messages",children:[e.jsxs("h4",{children:["消息记录 (",s.messages.length,")"]}),o.length===0&&!d.isStreaming?e.jsx("div",{className:"no-messages",children:"暂无消息记录"}):e.jsxs("div",{className:"message-list",children:[o.map((v,c)=>e.jsx(ve,{msg:v},c)),d.isStreaming&&d.segments.length>0&&e.jsxs("div",{className:"detail-message assistant streaming",children:[e.jsxs("div",{className:"detail-msg-role",children:["助手 ",e.jsx("span",{className:"streaming-indicator",children:"●"})]}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:(()=>{const v=[];let c=0;for(;c<d.segments.length;){const m=d.segments[c];if(m.type==="reasoning_text"){let n="";for(;c<d.segments.length&&d.segments[c].type==="reasoning_text";)n+=d.segments[c].content,c++;n&&v.push(e.jsxs("details",{className:"thinking-block",open:!0,children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(n)})})]},`r-${c}`));continue}v.push(e.jsx(ee,{seg:m},c)),c++}return v})()})]})]})]})]})}function ee({seg:s}){return s.type==="text"||s.type==="reasoning_text"?s.content?e.jsx("div",{className:"detail-text-segment",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}):null:e.jsxs("details",{className:"tool-call-block",children:[e.jsxs("summary",{className:"tool-call-summary",children:[e.jsx(ge,{size:14})," ",s.name,s.result==null?" …":""]}),e.jsxs("div",{className:"tool-call-content",children:[e.jsxs("div",{className:"tool-call-args",children:[e.jsx("strong",{children:"参数"}),e.jsx("pre",{children:JSON.stringify(s.args,null,2)})]}),s.result!=null&&e.jsxs("div",{className:"tool-call-result",children:[e.jsx("strong",{children:"结果"}),e.jsx("pre",{children:s.result})]})]})]})}function ve({msg:s}){const x=s.role==="user"?"用户":"助手";if(s.role==="user")return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content",children:s.content}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]});if(s.role==="assistant"&&s.segments&&s.segments.length>0){const l=[];let o=0;for(;o<s.segments.length;){const d=s.segments[o];if(d.type==="reasoning_text"){let a="";for(;o<s.segments.length&&s.segments[o].type==="reasoning_text";)a+=s.segments[o].content,o++;a&&l.push(e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(a)})})]},`r-${o}`));continue}l.push(e.jsx(ee,{seg:d},o)),o++}return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),e.jsx("div",{className:"detail-msg-content detail-msg-md",children:l}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}const N=s.role==="assistant"&&s.reasoningContent?e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(V,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.reasoningContent)})})]}):null;return e.jsxs("div",{className:`detail-message ${s.role}`,children:[e.jsx("div",{className:"detail-msg-role",children:x}),N,e.jsx("div",{className:"detail-msg-content detail-msg-md",children:e.jsx(F,{remarkPlugins:z,rehypePlugins:R,components:_,children:B(s.content)})}),s.timestamp>0&&e.jsx("div",{className:"detail-msg-time",children:M(s.timestamp)})]})}export{Se as SessionsPage};
@@ -1 +1 @@
1
- import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core-BynBM-Vs.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core-DCKNrwR3.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
@@ -1,4 +1,4 @@
1
- import{_ as f,I as ht,Y as gt,l as K,b as ut,a as pt,p as mt,q as yt,g as wt,s as kt,z as xt,F as bt,D as vt,G as $t,c as J,ak as Z,al as N,i as Et,d as St,x as Dt,am as Tt,an as At}from"./mermaid.core-BynBM-Vs.js";import{p as Ct}from"./chunk-4BX2VUAB-u70MbS7S.js";import{p as Bt}from"./wardley-L42UT6IY-uwZ17gTk.js";import{c as tt}from"./cytoscape.esm-LDYqcvCF.js";import{f as It}from"./cytoscape-fcose-DXAQNCkb.js";import"./index-Lxc_JKBO.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var W={L:"left",R:"right",T:"top",B:"bottom"},Q={L:f(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:f(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:f(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:f(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")},X={L:f((e,t)=>e-t+2,"L"),R:f((e,t)=>e-2,"R"),T:f((e,t)=>e-t+2,"T"),B:f((e,t)=>e-2,"B")},Lt=f(function(e){return T(e)?e==="L"?"R":"L":e==="T"?"B":"T"},"getOppositeArchitectureDirection"),U=f(function(e){const t=e;return t==="L"||t==="R"||t==="T"||t==="B"},"isArchitectureDirection"),T=f(function(e){const t=e;return t==="L"||t==="R"},"isArchitectureDirectionX"),z=f(function(e){const t=e;return t==="T"||t==="B"},"isArchitectureDirectionY"),V=f(function(e,t){const i=T(e)&&z(t),r=z(e)&&T(t);return i||r},"isArchitectureDirectionXY"),jt=f(function(e){const t=e[0],i=e[1],r=T(t)&&z(i),n=z(t)&&T(i);return r||n},"isArchitecturePairXY"),zt=f(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),_=f(function(e,t){const i=`${e}${t}`;return zt(i)?i:void 0},"getArchitectureDirectionPair"),Ft=f(function([e,t],i){const r=i[0],n=i[1];return T(r)?z(n)?[e+(r==="L"?-1:1),t+(n==="T"?1:-1)]:[e+(r==="L"?-1:1),t]:T(n)?[e+(n==="L"?1:-1),t+(r==="T"?1:-1)]:[e,t+(r==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Pt=f(function(e){return e==="LT"||e==="TL"?[1,1]:e==="BL"||e==="LB"?[1,-1]:e==="BR"||e==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Yt=f(function(e,t){return V(e,t)?"bend":T(e)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Rt=f(function(e){return e.type==="service"},"isArchitectureService"),Xt=f(function(e){return e.type==="junction"},"isArchitectureJunction"),et=f(e=>e.data(),"edgeData"),P=f(e=>e.data(),"nodeData"),Ot=$t.architecture,Y,it=(Y=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=ut,this.getAccTitle=pt,this.setDiagramTitle=mt,this.getDiagramTitle=yt,this.getAccDescription=wt,this.setAccDescription=kt,this.clear()}setDiagramId(t){this.diagramId=t}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",xt()}addService({id:t,icon:i,in:r,title:n,iconText:c}){if(this.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:i,iconText:c,title:n,edges:[],in:r}}getServices(){return Object.values(this.nodes).filter(Rt)}addJunction({id:t,in:i}){if(this.registeredIds[t]!==void 0)throw new Error(`The junction id [${t}] is already in use by another ${this.registeredIds[t]}`);if(i!==void 0){if(t===i)throw new Error(`The junction [${t}] cannot be placed within itself`);if(this.registeredIds[i]===void 0)throw new Error(`The junction [${t}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[i]==="node")throw new Error(`The junction [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:i}}getJunctions(){return Object.values(this.nodes).filter(Xt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:i,in:r,title:n}){var c,u,d;if(((c=this.registeredIds)==null?void 0:c[t])!==void 0)throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(((u=this.registeredIds)==null?void 0:u[r])===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(((d=this.registeredIds)==null?void 0:d[r])==="node")throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:i,title:n,in:r}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:i,lhsDir:r,rhsDir:n,lhsInto:c,rhsInto:u,lhsGroup:d,rhsGroup:l,title:s}){if(!U(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`);if(!U(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(n)}`);if(this.nodes[t]===void 0&&this.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[i]===void 0&&this.groups[i]===void 0)throw new Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);const o=this.nodes[t].in,a=this.nodes[i].in;if(d&&o&&a&&o==a)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&o&&a&&o==a)throw new Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:t,lhsDir:r,lhsInto:c,lhsGroup:d,rhsId:i,rhsDir:n,rhsInto:u,rhsGroup:l,title:s};this.edges.push(g),this.nodes[t]&&this.nodes[i]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[i].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const t={},i=Object.entries(this.nodes).reduce((l,[s,o])=>(l[s]=o.edges.reduce((a,g)=>{var p,k;const h=(p=this.getNode(g.lhsId))==null?void 0:p.in,y=(k=this.getNode(g.rhsId))==null?void 0:k.in;if(h&&y&&h!==y){const w=Yt(g.lhsDir,g.rhsDir);w!=="bend"&&(t[h]??(t[h]={}),t[h][y]=w,t[y]??(t[y]={}),t[y][h]=w)}if(g.lhsId===s){const w=_(g.lhsDir,g.rhsDir);w&&(a[w]=g.rhsId)}else{const w=_(g.rhsDir,g.lhsDir);w&&(a[w]=g.lhsId)}return a},{}),l),{}),r=Object.keys(i)[0],n={[r]:1},c=Object.keys(i).reduce((l,s)=>s===r?l:{...l,[s]:1},{}),u=f(l=>{const s={[l]:[0,0]},o=[l];for(;o.length>0;){const a=o.shift();if(a){n[a]=1,delete c[a];const g=i[a],[h,y]=s[a];Object.entries(g).forEach(([p,k])=>{n[k]||(s[k]=Ft([h,y],p),o.push(k))})}}return s},"BFS"),d=[u(r)];for(;Object.keys(c).length>0;)d.push(u(Object.keys(c)[0]));this.dataStructures={adjList:i,spatialMaps:d,groupAlignments:t}}return this.dataStructures}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}getConfig(){return bt({...Ot,...vt().architecture})}getConfigField(t){return this.getConfig()[t]}},f(Y,"ArchitectureDB"),Y),Mt=f((e,t)=>{Ct(e,t),e.groups.map(i=>t.addGroup(i)),e.services.map(i=>t.addService({...i,type:"service"})),e.junctions.map(i=>t.addJunction({...i,type:"junction"})),e.edges.map(i=>t.addEdge(i))},"populateDb"),rt={parser:{yy:void 0},parse:f(async e=>{var r;const t=await Bt("architecture",e);K.debug(t);const i=(r=rt.parser)==null?void 0:r.yy;if(!(i instanceof it))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mt(t,i)},"parse")},Gt=f(e=>`
1
+ import{_ as f,I as ht,Y as gt,l as K,b as ut,a as pt,p as mt,q as yt,g as wt,s as kt,z as xt,F as bt,D as vt,G as $t,c as J,ak as Z,al as N,i as Et,d as St,x as Dt,am as Tt,an as At}from"./mermaid.core-DCKNrwR3.js";import{p as Ct}from"./chunk-4BX2VUAB-CYpAo1Fy.js";import{p as Bt}from"./wardley-L42UT6IY-nRiwVAku.js";import{c as tt}from"./cytoscape.esm-LDYqcvCF.js";import{f as It}from"./cytoscape-fcose-DXAQNCkb.js";import"./index-pGwN5S79.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var W={L:"left",R:"right",T:"top",B:"bottom"},Q={L:f(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:f(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:f(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:f(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")},X={L:f((e,t)=>e-t+2,"L"),R:f((e,t)=>e-2,"R"),T:f((e,t)=>e-t+2,"T"),B:f((e,t)=>e-2,"B")},Lt=f(function(e){return T(e)?e==="L"?"R":"L":e==="T"?"B":"T"},"getOppositeArchitectureDirection"),U=f(function(e){const t=e;return t==="L"||t==="R"||t==="T"||t==="B"},"isArchitectureDirection"),T=f(function(e){const t=e;return t==="L"||t==="R"},"isArchitectureDirectionX"),z=f(function(e){const t=e;return t==="T"||t==="B"},"isArchitectureDirectionY"),V=f(function(e,t){const i=T(e)&&z(t),r=z(e)&&T(t);return i||r},"isArchitectureDirectionXY"),jt=f(function(e){const t=e[0],i=e[1],r=T(t)&&z(i),n=z(t)&&T(i);return r||n},"isArchitecturePairXY"),zt=f(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),_=f(function(e,t){const i=`${e}${t}`;return zt(i)?i:void 0},"getArchitectureDirectionPair"),Ft=f(function([e,t],i){const r=i[0],n=i[1];return T(r)?z(n)?[e+(r==="L"?-1:1),t+(n==="T"?1:-1)]:[e+(r==="L"?-1:1),t]:T(n)?[e+(n==="L"?1:-1),t+(r==="T"?1:-1)]:[e,t+(r==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Pt=f(function(e){return e==="LT"||e==="TL"?[1,1]:e==="BL"||e==="LB"?[1,-1]:e==="BR"||e==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Yt=f(function(e,t){return V(e,t)?"bend":T(e)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Rt=f(function(e){return e.type==="service"},"isArchitectureService"),Xt=f(function(e){return e.type==="junction"},"isArchitectureJunction"),et=f(e=>e.data(),"edgeData"),P=f(e=>e.data(),"nodeData"),Ot=$t.architecture,Y,it=(Y=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=ut,this.getAccTitle=pt,this.setDiagramTitle=mt,this.getDiagramTitle=yt,this.getAccDescription=wt,this.setAccDescription=kt,this.clear()}setDiagramId(t){this.diagramId=t}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",xt()}addService({id:t,icon:i,in:r,title:n,iconText:c}){if(this.registeredIds[t]!==void 0)throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The service [${t}] cannot be placed within itself`);if(this.registeredIds[r]===void 0)throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[r]==="node")throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:i,iconText:c,title:n,edges:[],in:r}}getServices(){return Object.values(this.nodes).filter(Rt)}addJunction({id:t,in:i}){if(this.registeredIds[t]!==void 0)throw new Error(`The junction id [${t}] is already in use by another ${this.registeredIds[t]}`);if(i!==void 0){if(t===i)throw new Error(`The junction [${t}] cannot be placed within itself`);if(this.registeredIds[i]===void 0)throw new Error(`The junction [${t}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[i]==="node")throw new Error(`The junction [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:i}}getJunctions(){return Object.values(this.nodes).filter(Xt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:i,in:r,title:n}){var c,u,d;if(((c=this.registeredIds)==null?void 0:c[t])!==void 0)throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(r!==void 0){if(t===r)throw new Error(`The group [${t}] cannot be placed within itself`);if(((u=this.registeredIds)==null?void 0:u[r])===void 0)throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if(((d=this.registeredIds)==null?void 0:d[r])==="node")throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:i,title:n,in:r}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:i,lhsDir:r,rhsDir:n,lhsInto:c,rhsInto:u,lhsGroup:d,rhsGroup:l,title:s}){if(!U(r))throw new Error(`Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`);if(!U(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(n)}`);if(this.nodes[t]===void 0&&this.groups[t]===void 0)throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[i]===void 0&&this.groups[i]===void 0)throw new Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);const o=this.nodes[t].in,a=this.nodes[i].in;if(d&&o&&a&&o==a)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&o&&a&&o==a)throw new Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:t,lhsDir:r,lhsInto:c,lhsGroup:d,rhsId:i,rhsDir:n,rhsInto:u,rhsGroup:l,title:s};this.edges.push(g),this.nodes[t]&&this.nodes[i]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[i].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const t={},i=Object.entries(this.nodes).reduce((l,[s,o])=>(l[s]=o.edges.reduce((a,g)=>{var p,k;const h=(p=this.getNode(g.lhsId))==null?void 0:p.in,y=(k=this.getNode(g.rhsId))==null?void 0:k.in;if(h&&y&&h!==y){const w=Yt(g.lhsDir,g.rhsDir);w!=="bend"&&(t[h]??(t[h]={}),t[h][y]=w,t[y]??(t[y]={}),t[y][h]=w)}if(g.lhsId===s){const w=_(g.lhsDir,g.rhsDir);w&&(a[w]=g.rhsId)}else{const w=_(g.rhsDir,g.lhsDir);w&&(a[w]=g.lhsId)}return a},{}),l),{}),r=Object.keys(i)[0],n={[r]:1},c=Object.keys(i).reduce((l,s)=>s===r?l:{...l,[s]:1},{}),u=f(l=>{const s={[l]:[0,0]},o=[l];for(;o.length>0;){const a=o.shift();if(a){n[a]=1,delete c[a];const g=i[a],[h,y]=s[a];Object.entries(g).forEach(([p,k])=>{n[k]||(s[k]=Ft([h,y],p),o.push(k))})}}return s},"BFS"),d=[u(r)];for(;Object.keys(c).length>0;)d.push(u(Object.keys(c)[0]));this.dataStructures={adjList:i,spatialMaps:d,groupAlignments:t}}return this.dataStructures}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}getConfig(){return bt({...Ot,...vt().architecture})}getConfigField(t){return this.getConfig()[t]}},f(Y,"ArchitectureDB"),Y),Mt=f((e,t)=>{Ct(e,t),e.groups.map(i=>t.addGroup(i)),e.services.map(i=>t.addService({...i,type:"service"})),e.junctions.map(i=>t.addJunction({...i,type:"junction"})),e.edges.map(i=>t.addEdge(i))},"populateDb"),rt={parser:{yy:void 0},parse:f(async e=>{var r;const t=await Bt("architecture",e);K.debug(t);const i=(r=rt.parser)==null?void 0:r.yy;if(!(i instanceof it))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Mt(t,i)},"parse")},Gt=f(e=>`
2
2
  .edge {
3
3
  stroke-width: ${e.archEdgeWidth};
4
4
  stroke: ${e.archEdgeColor};
@@ -1,4 +1,4 @@
1
- import{g as Te}from"./chunk-FMBD7UC4-Di13fFRw.js";import{ar as De,as as Gt,at as Ne,au as Zt,av as jt,aw as qt,ax as Jt,ay as wt,az as Qt,aA as $t,aB as te,aC as ee,aD as re,aE as ae,aF as Ie,aG as Ce,aH as Be,aI as Oe,aJ as Re,aK as Ae,aL as ze,aM as Me,aN as Pe,aO as Fe,aP as We,_ as d,D as ct,d as O,e as Ye,l as v,z as He,B as Ke,aQ as Ue,R as Xe,S as Ve,c as M,O as Ge,aR as H,ak as _t,aS as at,aT as Ze,u as st,k as je,aU as qe,i as Rt,aV as At,aW as Je}from"./mermaid.core-BynBM-Vs.js";import{G as Qe}from"./graph-CAnANduQ.js";import{c as $e}from"./channel-CKm-LJj0.js";import"./index-Lxc_JKBO.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";function tr(e){return Array.isArray(e)}function er(e){if(De(e))return e;const t=Gt(e);if(!rr(e))return{};if(tr(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ne(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t===Zt)return new ArrayBuffer(e.byteLength);if(t===jt){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t===qt||t===Jt||t===wt){const s=e.constructor,i=new s(e.valueOf());return t===wt?sr(i,e):xt(i,e),i}if(t===Qt)return new Date(Number(e));if(t===$t){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t===te)return Object(Symbol.prototype.valueOf.call(e));if(t===ee){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t===re){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t===ae){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ir(a,e),xt(a,e),ar(a,e),a}function rr(e){switch(Gt(e)){case ae:case We:case Zt:case jt:case qt:case Qt:case Fe:case Pe:case Me:case ze:case Ae:case ee:case Jt:case Re:case $t:case re:case wt:case te:case Oe:case Be:case Ce:case Ie:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function ar(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s<a.length;s++){const i=a[s];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function sr(e,t){const a=t.valueOf().length;for(const s in t)Object.hasOwn(t,s)&&(Number.isNaN(Number(s))||Number(s)>=a)&&(e[s]=t[s])}function ir(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var mt=(function(){var e=d(function(N,x,p,f){for(p=p||{},f=N.length;f--;p[N[f]]=x);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],g=[8,10,21,28,29,30,31,39,43,46],y=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],m=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(x,p,f,S,E,o,k){var h=o.length-1;switch(E){case 4:S.getLogger().debug("Rule: separator (NL) ");break;case 5:S.getLogger().debug("Rule: separator (Space) ");break;case 6:S.getLogger().debug("Rule: separator (EOF) ");break;case 7:S.getLogger().debug("Rule: hierarchy: ",o[h-1]),S.setHierarchy(o[h-1]);break;case 8:S.getLogger().debug("Stop NL ");break;case 9:S.getLogger().debug("Stop EOF ");break;case 10:S.getLogger().debug("Stop NL2 ");break;case 11:S.getLogger().debug("Stop EOF2 ");break;case 12:S.getLogger().debug("Rule: statement: ",o[h]),typeof o[h].length=="number"?this.$=o[h]:this.$=[o[h]];break;case 13:S.getLogger().debug("Rule: statement #2: ",o[h-1]),this.$=[o[h-1]].concat(o[h]);break;case 14:S.getLogger().debug("Rule: link: ",o[h],x),this.$={edgeTypeStr:o[h],label:""};break;case 15:S.getLogger().debug("Rule: LABEL link: ",o[h-3],o[h-1],o[h]),this.$={edgeTypeStr:o[h],label:o[h-1]};break;case 18:const T=parseInt(o[h]),D=S.generateId();this.$={id:D,type:"space",label:"",width:T,children:[]};break;case 23:S.getLogger().debug("Rule: (nodeStatement link node) ",o[h-2],o[h-1],o[h]," typestr: ",o[h-1].edgeTypeStr);const U=S.edgeStrToEdgeData(o[h-1].edgeTypeStr),F=S.edgeStrToEdgeStartData(o[h-1].edgeTypeStr),J=S.edgeStrToThickness(o[h-1].edgeTypeStr),B=S.edgeStrToPattern(o[h-1].edgeTypeStr);this.$=[{id:o[h-2].id,label:o[h-2].label,type:o[h-2].type,directions:o[h-2].directions},{id:o[h-2].id+"-"+o[h].id,start:o[h-2].id,end:o[h].id,label:o[h-1].label,type:"edge",thickness:J,pattern:B,directions:o[h].directions,arrowTypeEnd:U,arrowTypeStart:F},{id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions}];break;case 24:S.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[h-1],o[h]),this.$={id:o[h-1].id,label:o[h-1].label,type:S.typeStr2Type(o[h-1].typeStr),directions:o[h-1].directions,widthInColumns:parseInt(o[h],10)};break;case 25:S.getLogger().debug("Rule: nodeStatement (node) ",o[h]),this.$={id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions,widthInColumns:1};break;case 26:S.getLogger().debug("APA123",this?this:"na"),S.getLogger().debug("COLUMNS: ",o[h]),this.$={type:"column-setting",columns:o[h]==="auto"?-1:parseInt(o[h])};break;case 27:S.getLogger().debug("Rule: id-block statement : ",o[h-2],o[h-1]),S.generateId(),this.$={...o[h-2],type:"composite",children:o[h-1]};break;case 28:S.getLogger().debug("Rule: blockStatement : ",o[h-2],o[h-1],o[h]);const Y=S.generateId();this.$={id:Y,type:"composite",label:"",children:o[h-1]};break;case 29:S.getLogger().debug("Rule: node (NODE_ID separator): ",o[h]),this.$={id:o[h]};break;case 30:S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[h-1],o[h]),this.$={id:o[h-1],label:o[h].label,typeStr:o[h].typeStr,directions:o[h].directions};break;case 31:S.getLogger().debug("Rule: dirList: ",o[h]),this.$=[o[h]];break;case 32:S.getLogger().debug("Rule: dirList: ",o[h-1],o[h]),this.$=[o[h-1]].concat(o[h]);break;case 33:S.getLogger().debug("Rule: nodeShapeNLabel: ",o[h-2],o[h-1],o[h]),this.$={typeStr:o[h-2]+o[h],label:o[h-1]};break;case 34:S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[h-3],o[h-2]," #3:",o[h-1],o[h]),this.$={typeStr:o[h-3]+o[h],label:o[h-2],directions:o[h-1]};break;case 35:case 36:this.$={type:"classDef",id:o[h-1].trim(),css:o[h].trim()};break;case 37:this.$={type:"applyClass",id:o[h-1].trim(),styleClass:o[h].trim()};break;case 38:this.$={type:"applyStyles",id:o[h-1].trim(),stylesStr:o[h].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(g,[2,16],{14:22,15:y,16:w}),e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(b,[2,25],{27:[1,25]}),e(g,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(m,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:y,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(m,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(g,[2,28]),e(g,[2,35]),e(g,[2,36]),e(g,[2,37]),e(g,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(g,[2,27]),e(m,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(m,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(x,p){if(p.recoverable)this.trace(x);else{var f=new Error(x);throw f.hash=p,f}},"parseError"),parse:d(function(x){var p=this,f=[0],S=[],E=[null],o=[],k=this.table,h="",T=0,D=0,U=2,F=1,J=o.slice.call(arguments,1),B=Object.create(this.lexer),Y={yy:{}};for(var et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,et)&&(Y.yy[et]=this.yy[et]);B.setInput(x,Y.yy),Y.yy.lexer=B,Y.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var rt=B.yylloc;o.push(rt);var _e=B.options&&B.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ke(X){f.length=f.length-2*X,E.length=E.length-X,o.length=o.length-X}d(ke,"popStack");function Bt(){var X;return X=S.pop()||B.lex()||F,typeof X!="number"&&(X instanceof Array&&(S=X,X=S.pop()),X=p.symbols_[X]||X),X}d(Bt,"lex");for(var K,$,G,ft,tt={},lt,Q,Ot,ot;;){if($=f[f.length-1],this.defaultActions[$]?G=this.defaultActions[$]:((K===null||typeof K>"u")&&(K=Bt()),G=k[$]&&k[$][K]),typeof G>"u"||!G.length||!G[0]){var yt="";ot=[];for(lt in k[$])this.terminals_[lt]&&lt>U&&ot.push("'"+this.terminals_[lt]+"'");B.showPosition?yt="Parse error on line "+(T+1)+`:
1
+ import{g as Te}from"./chunk-FMBD7UC4-B-8aZQXh.js";import{ar as De,as as Gt,at as Ne,au as Zt,av as jt,aw as qt,ax as Jt,ay as wt,az as Qt,aA as $t,aB as te,aC as ee,aD as re,aE as ae,aF as Ie,aG as Ce,aH as Be,aI as Oe,aJ as Re,aK as Ae,aL as ze,aM as Me,aN as Pe,aO as Fe,aP as We,_ as d,D as ct,d as O,e as Ye,l as v,z as He,B as Ke,aQ as Ue,R as Xe,S as Ve,c as M,O as Ge,aR as H,ak as _t,aS as at,aT as Ze,u as st,k as je,aU as qe,i as Rt,aV as At,aW as Je}from"./mermaid.core-DCKNrwR3.js";import{G as Qe}from"./graph-CAnANduQ.js";import{c as $e}from"./channel-BugX_IAn.js";import"./index-pGwN5S79.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";function tr(e){return Array.isArray(e)}function er(e){if(De(e))return e;const t=Gt(e);if(!rr(e))return{};if(tr(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ne(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t===Zt)return new ArrayBuffer(e.byteLength);if(t===jt){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t===qt||t===Jt||t===wt){const s=e.constructor,i=new s(e.valueOf());return t===wt?sr(i,e):xt(i,e),i}if(t===Qt)return new Date(Number(e));if(t===$t){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t===te)return Object(Symbol.prototype.valueOf.call(e));if(t===ee){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t===re){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t===ae){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return ir(a,e),xt(a,e),ar(a,e),a}function rr(e){switch(Gt(e)){case ae:case We:case Zt:case jt:case qt:case Qt:case Fe:case Pe:case Me:case ze:case Ae:case ee:case Jt:case Re:case $t:case re:case wt:case te:case Oe:case Be:case Ce:case Ie:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function ar(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s<a.length;s++){const i=a[s];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function sr(e,t){const a=t.valueOf().length;for(const s in t)Object.hasOwn(t,s)&&(Number.isNaN(Number(s))||Number(s)>=a)&&(e[s]=t[s])}function ir(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var mt=(function(){var e=d(function(N,x,p,f){for(p=p||{},f=N.length;f--;p[N[f]]=x);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],g=[8,10,21,28,29,30,31,39,43,46],y=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],m=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],L={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(x,p,f,S,E,o,k){var h=o.length-1;switch(E){case 4:S.getLogger().debug("Rule: separator (NL) ");break;case 5:S.getLogger().debug("Rule: separator (Space) ");break;case 6:S.getLogger().debug("Rule: separator (EOF) ");break;case 7:S.getLogger().debug("Rule: hierarchy: ",o[h-1]),S.setHierarchy(o[h-1]);break;case 8:S.getLogger().debug("Stop NL ");break;case 9:S.getLogger().debug("Stop EOF ");break;case 10:S.getLogger().debug("Stop NL2 ");break;case 11:S.getLogger().debug("Stop EOF2 ");break;case 12:S.getLogger().debug("Rule: statement: ",o[h]),typeof o[h].length=="number"?this.$=o[h]:this.$=[o[h]];break;case 13:S.getLogger().debug("Rule: statement #2: ",o[h-1]),this.$=[o[h-1]].concat(o[h]);break;case 14:S.getLogger().debug("Rule: link: ",o[h],x),this.$={edgeTypeStr:o[h],label:""};break;case 15:S.getLogger().debug("Rule: LABEL link: ",o[h-3],o[h-1],o[h]),this.$={edgeTypeStr:o[h],label:o[h-1]};break;case 18:const T=parseInt(o[h]),D=S.generateId();this.$={id:D,type:"space",label:"",width:T,children:[]};break;case 23:S.getLogger().debug("Rule: (nodeStatement link node) ",o[h-2],o[h-1],o[h]," typestr: ",o[h-1].edgeTypeStr);const U=S.edgeStrToEdgeData(o[h-1].edgeTypeStr),F=S.edgeStrToEdgeStartData(o[h-1].edgeTypeStr),J=S.edgeStrToThickness(o[h-1].edgeTypeStr),B=S.edgeStrToPattern(o[h-1].edgeTypeStr);this.$=[{id:o[h-2].id,label:o[h-2].label,type:o[h-2].type,directions:o[h-2].directions},{id:o[h-2].id+"-"+o[h].id,start:o[h-2].id,end:o[h].id,label:o[h-1].label,type:"edge",thickness:J,pattern:B,directions:o[h].directions,arrowTypeEnd:U,arrowTypeStart:F},{id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions}];break;case 24:S.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[h-1],o[h]),this.$={id:o[h-1].id,label:o[h-1].label,type:S.typeStr2Type(o[h-1].typeStr),directions:o[h-1].directions,widthInColumns:parseInt(o[h],10)};break;case 25:S.getLogger().debug("Rule: nodeStatement (node) ",o[h]),this.$={id:o[h].id,label:o[h].label,type:S.typeStr2Type(o[h].typeStr),directions:o[h].directions,widthInColumns:1};break;case 26:S.getLogger().debug("APA123",this?this:"na"),S.getLogger().debug("COLUMNS: ",o[h]),this.$={type:"column-setting",columns:o[h]==="auto"?-1:parseInt(o[h])};break;case 27:S.getLogger().debug("Rule: id-block statement : ",o[h-2],o[h-1]),S.generateId(),this.$={...o[h-2],type:"composite",children:o[h-1]};break;case 28:S.getLogger().debug("Rule: blockStatement : ",o[h-2],o[h-1],o[h]);const Y=S.generateId();this.$={id:Y,type:"composite",label:"",children:o[h-1]};break;case 29:S.getLogger().debug("Rule: node (NODE_ID separator): ",o[h]),this.$={id:o[h]};break;case 30:S.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[h-1],o[h]),this.$={id:o[h-1],label:o[h].label,typeStr:o[h].typeStr,directions:o[h].directions};break;case 31:S.getLogger().debug("Rule: dirList: ",o[h]),this.$=[o[h]];break;case 32:S.getLogger().debug("Rule: dirList: ",o[h-1],o[h]),this.$=[o[h-1]].concat(o[h]);break;case 33:S.getLogger().debug("Rule: nodeShapeNLabel: ",o[h-2],o[h-1],o[h]),this.$={typeStr:o[h-2]+o[h],label:o[h-1]};break;case 34:S.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[h-3],o[h-2]," #3:",o[h-1],o[h]),this.$={typeStr:o[h-3]+o[h],label:o[h-2],directions:o[h-1]};break;case 35:case 36:this.$={type:"classDef",id:o[h-1].trim(),css:o[h].trim()};break;case 37:this.$={type:"applyClass",id:o[h-1].trim(),styleClass:o[h].trim()};break;case 38:this.$={type:"applyStyles",id:o[h-1].trim(),stylesStr:o[h].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(g,[2,16],{14:22,15:y,16:w}),e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(b,[2,25],{27:[1,25]}),e(g,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(m,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:y,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(m,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(g,[2,28]),e(g,[2,35]),e(g,[2,36]),e(g,[2,37]),e(g,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(g,[2,27]),e(m,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(m,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(x,p){if(p.recoverable)this.trace(x);else{var f=new Error(x);throw f.hash=p,f}},"parseError"),parse:d(function(x){var p=this,f=[0],S=[],E=[null],o=[],k=this.table,h="",T=0,D=0,U=2,F=1,J=o.slice.call(arguments,1),B=Object.create(this.lexer),Y={yy:{}};for(var et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,et)&&(Y.yy[et]=this.yy[et]);B.setInput(x,Y.yy),Y.yy.lexer=B,Y.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var rt=B.yylloc;o.push(rt);var _e=B.options&&B.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ke(X){f.length=f.length-2*X,E.length=E.length-X,o.length=o.length-X}d(ke,"popStack");function Bt(){var X;return X=S.pop()||B.lex()||F,typeof X!="number"&&(X instanceof Array&&(S=X,X=S.pop()),X=p.symbols_[X]||X),X}d(Bt,"lex");for(var K,$,G,ft,tt={},lt,Q,Ot,ot;;){if($=f[f.length-1],this.defaultActions[$]?G=this.defaultActions[$]:((K===null||typeof K>"u")&&(K=Bt()),G=k[$]&&k[$][K]),typeof G>"u"||!G.length||!G[0]){var yt="";ot=[];for(lt in k[$])this.terminals_[lt]&&lt>U&&ot.push("'"+this.terminals_[lt]+"'");B.showPosition?yt="Parse error on line "+(T+1)+`:
2
2
  `+B.showPosition()+`
3
3
  Expecting `+ot.join(", ")+", got '"+(this.terminals_[K]||K)+"'":yt="Parse error on line "+(T+1)+": Unexpected "+(K==F?"end of input":"'"+(this.terminals_[K]||K)+"'"),this.parseError(yt,{text:B.match,token:this.terminals_[K]||K,line:B.yylineno,loc:rt,expected:ot})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+K);switch(G[0]){case 1:f.push(K),E.push(B.yytext),o.push(B.yylloc),f.push(G[1]),K=null,D=B.yyleng,h=B.yytext,T=B.yylineno,rt=B.yylloc;break;case 2:if(Q=this.productions_[G[1]][1],tt.$=E[E.length-Q],tt._$={first_line:o[o.length-(Q||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Q||1)].first_column,last_column:o[o.length-1].last_column},_e&&(tt._$.range=[o[o.length-(Q||1)].range[0],o[o.length-1].range[1]]),ft=this.performAction.apply(tt,[h,D,T,Y.yy,G[1],E,o].concat(J)),typeof ft<"u")return ft;Q&&(f=f.slice(0,-1*Q*2),E=E.slice(0,-1*Q),o=o.slice(0,-1*Q)),f.push(this.productions_[G[1]][0]),E.push(tt.$),o.push(tt._$),Ot=k[f[f.length-2]][f[f.length-1]],f.push(Ot);break;case 3:return!0}}return!0},"parse")},C=(function(){var N={EOF:1,parseError:d(function(p,f){if(this.yy.parser)this.yy.parser.parseError(p,f);else throw new Error(p)},"parseError"),setInput:d(function(x,p){return this.yy=p||this.yy||{},this._input=x,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:d(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var p=x.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:d(function(x){var p=x.length,f=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var S=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),f.length-1&&(this.yylineno-=f.length-1);var E=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:f?(f.length===S.length?this.yylloc.first_column:0)+S[S.length-f.length].length-f[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(x){this.unput(this.match.slice(x))},"less"),pastInput:d(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var x=this.pastInput(),p=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as Se,d as De}from"./chunk-ND2GUHAM-CMECQpX8.js";import{s as Pe,g as Be,a as Ie,b as Me,_ as y,c as Bt,d as jt,l as de,e as Le,f as Ne,h as Tt,i as ge,j as Ye,w as je,k as $t,m as fe}from"./mermaid.core-BynBM-Vs.js";import"./index-Lxc_JKBO.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var Ft=(function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,W,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`:
1
+ import{g as Se,d as De}from"./chunk-ND2GUHAM-aY4Jm31a.js";import{s as Pe,g as Be,a as Ie,b as Me,_ as y,c as Bt,d as jt,l as de,e as Le,f as Ne,h as Tt,i as ge,j as Ye,w as je,k as $t,m as fe}from"./mermaid.core-DCKNrwR3.js";import"./index-pGwN5S79.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var Ft=(function(){var a=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],r=[1,27],l=[1,28],e=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:r,28:l,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},a(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(Ct,[2,14]),a(Qt,[2,16],{12:[1,76]}),a(Ct,[2,36],{12:[1,77]}),a(St,[2,19]),a(St,[2,20]),{25:[1,78]},{27:[1,79]},a(St,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},a(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:e,36:n,37:i,38:u,39:d,40:f,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},a(Ct,[2,15]),a(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:r,28:l}),a(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:r,28:l,34:e,36:n,37:i,38:u,39:d,40:f,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),a(St,[2,21]),a(St,[2,22]),a(T,[2,39]),a(le,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),a(Mt,[2,73]),{78:[1,133]},a(Mt,[2,75]),a(Mt,[2,76]),a(T,[2,40]),a(T,[2,41]),a(T,[2,42]),a(T,[2,43]),a(T,[2,44]),a(T,[2,45]),a(T,[2,46]),a(T,[2,47]),a(T,[2,48]),a(T,[2,49]),a(T,[2,50]),a(T,[2,51]),a(T,[2,52]),a(T,[2,53]),a(T,[2,54]),a(T,[2,55]),a(T,[2,56]),a(T,[2,57]),a(T,[2,58]),a(T,[2,60]),a(T,[2,61]),a(T,[2,62]),a(T,[2,63]),a(T,[2,64]),a(T,[2,65]),a(T,[2,66]),a(T,[2,67]),a(T,[2,68]),a(T,[2,69]),a(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},a(vt,[2,28]),a(vt,[2,29]),a(vt,[2,30]),a(vt,[2,31]),a(vt,[2,32]),a(vt,[2,33]),a(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},a(Qt,[2,18]),a(Ct,[2,38]),a(le,[2,72]),a(Mt,[2,74]),a(T,[2,24]),a(T,[2,35]),a(Ht,[2,25]),a(Ht,[2,26],{12:[1,138]}),a(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(At.yy[Gt]=this.yy[Gt]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(he,"lex");for(var I,kt,N,Jt,wt={},Nt,W,ue,Yt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=he()),N=Dt[kt]&&Dt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[kt])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,oe=D.yyleng,p=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[p,oe,Et,At.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,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:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=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),E.length-1&&(this.yylineno-=E.length-1);var R=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:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(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:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{ai as o,aj as n}from"./mermaid.core-DCKNrwR3.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
@@ -1 +1 @@
1
- import{_ as a,e as w,l as x}from"./mermaid.core-BynBM-Vs.js";var d=a((e,t,i,o)=>{e.attr("class",i);const{width:r,height:h,x:n,y:c}=u(e,t);w(e,h,r,o);const s=l(n,c,r,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{var o;const i=((o=e.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,o,r)=>`${e-r} ${t-r} ${i} ${o}`,"createViewBox");export{d as s};
1
+ import{_ as a,e as w,l as x}from"./mermaid.core-DCKNrwR3.js";var d=a((e,t,i,o)=>{e.attr("class",i);const{width:r,height:h,x:n,y:c}=u(e,t);w(e,h,r,o);const s=l(n,c,r,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{var o;const i=((o=e.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,o,r)=>`${e-r} ${t-r} ${i} ${o}`,"createViewBox");export{d as s};
@@ -1 +1 @@
1
- import{_ as l}from"./mermaid.core-BynBM-Vs.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p};
1
+ import{_ as l}from"./mermaid.core-DCKNrwR3.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p};
@@ -1 +1 @@
1
- import{_ as a,d as o}from"./mermaid.core-BynBM-Vs.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
1
+ import{_ as a,d as o}from"./mermaid.core-DCKNrwR3.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};