@aalis/plugin-webui-client 0.9.2 → 0.11.0

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 (69) hide show
  1. package/dist/assets/AuthorityPage-5YC3myl2.js +16 -0
  2. package/dist/assets/{DynamicPage-4iVywhXC.js → DynamicPage-CaesyAey.js} +1 -1
  3. package/dist/assets/{FilesPage-aDUg-HtD.js → FilesPage-mSCDNPn_.js} +1 -1
  4. package/dist/assets/LogPage-BTvnnjEI.js +1 -0
  5. package/dist/assets/MarketplacePage-CiclAMb2.js +6 -0
  6. package/dist/assets/{PlatformPage-ZLO-lxtX.js → PlatformPage-DD_pcmAe.js} +1 -1
  7. package/dist/assets/{PluginConfigPage-0Enf41AP.js → PluginConfigPage-C8aYh-x_.js} +1 -1
  8. package/dist/assets/{SessionsPage-BM_OVJOU.js → SessionsPage-CiQds4G5.js} +1 -1
  9. package/dist/assets/{arc-C1uPYL5a.js → arc-Ce9peeXq.js} +1 -1
  10. package/dist/assets/{architectureDiagram-3BPJPVTR-CmIff-zW.js → architectureDiagram-3BPJPVTR-Dcv5mhXl.js} +1 -1
  11. package/dist/assets/{blockDiagram-GPEHLZMM-DuUJxNtQ.js → blockDiagram-GPEHLZMM-C7MSrVLM.js} +1 -1
  12. package/dist/assets/{c4Diagram-AAUBKEIU-CRL_kEt8.js → c4Diagram-AAUBKEIU-D13Bjvi_.js} +1 -1
  13. package/dist/assets/channel-DwG5AtO5.js +1 -0
  14. package/dist/assets/{chunk-2J33WTMH-cqnsJdYJ.js → chunk-2J33WTMH-Dt-r6FIQ.js} +1 -1
  15. package/dist/assets/{chunk-4BX2VUAB-LO3rSmwm.js → chunk-4BX2VUAB-CIMNyAOW.js} +1 -1
  16. package/dist/assets/{chunk-55IACEB6-Bc4iS7Ky.js → chunk-55IACEB6-CF9Xuktf.js} +1 -1
  17. package/dist/assets/{chunk-727SXJPM-Cfo3XdHd.js → chunk-727SXJPM-rVdprN6-.js} +1 -1
  18. package/dist/assets/{chunk-AQP2D5EJ-CnC6_gc0.js → chunk-AQP2D5EJ-B2w3hk8u.js} +1 -1
  19. package/dist/assets/{chunk-FMBD7UC4-BXhroNLT.js → chunk-FMBD7UC4-CMD3FBWL.js} +1 -1
  20. package/dist/assets/{chunk-ND2GUHAM-6lryk8d1.js → chunk-ND2GUHAM-BbAXVB1_.js} +1 -1
  21. package/dist/assets/{chunk-QZHKN3VN-Co2N8trq.js → chunk-QZHKN3VN-B9Mhei9n.js} +1 -1
  22. package/dist/assets/classDiagram-4FO5ZUOK-WX6byV5j.js +1 -0
  23. package/dist/assets/classDiagram-v2-Q7XG4LA2-WX6byV5j.js +1 -0
  24. package/dist/assets/{clock-C4nOYixW.js → clock-hYaQrRDV.js} +1 -1
  25. package/dist/assets/{cose-bilkent-S5V4N54A-BVVQAg_W.js → cose-bilkent-S5V4N54A-BNuOc8Tg.js} +1 -1
  26. package/dist/assets/{dagre-BM42HDAG-LPtsSBFq.js → dagre-BM42HDAG-BKde6762.js} +1 -1
  27. package/dist/assets/{diagram-2AECGRRQ-C0zCFf4L.js → diagram-2AECGRRQ-CiK_Fj80.js} +1 -1
  28. package/dist/assets/{diagram-5GNKFQAL-DAPWVVm_.js → diagram-5GNKFQAL-Cj4R38mJ.js} +1 -1
  29. package/dist/assets/{diagram-KO2AKTUF-3gVw8kZA.js → diagram-KO2AKTUF-DylBwBxP.js} +1 -1
  30. package/dist/assets/{diagram-LMA3HP47-jWzwOc3Y.js → diagram-LMA3HP47-DavNsiny.js} +1 -1
  31. package/dist/assets/{diagram-OG6HWLK6-BnayQBC7.js → diagram-OG6HWLK6-DGho4c86.js} +1 -1
  32. package/dist/assets/{erDiagram-TEJ5UH35-CmjPXHZa.js → erDiagram-TEJ5UH35-DCEgrApM.js} +1 -1
  33. package/dist/assets/{flowDiagram-I6XJVG4X-igSlCSNh.js → flowDiagram-I6XJVG4X-FWWFLymx.js} +1 -1
  34. package/dist/assets/{ganttDiagram-6RSMTGT7-BBOwgwqZ.js → ganttDiagram-6RSMTGT7-mLzIX6oo.js} +1 -1
  35. package/dist/assets/{gitGraphDiagram-PVQCEYII-qgmgNJvd.js → gitGraphDiagram-PVQCEYII-5ZQKvd2G.js} +1 -1
  36. package/dist/assets/{globe-Ccm5cs9Z.js → globe-BOoUupfo.js} +1 -1
  37. package/dist/assets/index-BwjDBPnu.css +1 -0
  38. package/dist/assets/index-DuWxyVzv.js +212 -0
  39. package/dist/assets/{infoDiagram-5YYISTIA-DwJp38Pm.js → infoDiagram-5YYISTIA-r8gsZPzE.js} +1 -1
  40. package/dist/assets/{ishikawaDiagram-YF4QCWOH-C1323kdL.js → ishikawaDiagram-YF4QCWOH-B8QgO-dt.js} +1 -1
  41. package/dist/assets/{journeyDiagram-JHISSGLW-BkUm__D4.js → journeyDiagram-JHISSGLW-DLbC1Ro9.js} +1 -1
  42. package/dist/assets/{kanban-definition-UN3LZRKU-B_Xu-mFK.js → kanban-definition-UN3LZRKU-B8oPyqRF.js} +1 -1
  43. package/dist/assets/{linear-GubmOAqN.js → linear-C1nMFow1.js} +1 -1
  44. package/dist/assets/{markdown-BCywGHw2.js → markdown-B2G8c9k5.js} +21 -21
  45. package/dist/assets/{mermaid.core-yCCgYz2d.js → mermaid.core-DT-YvwaL.js} +4 -4
  46. package/dist/assets/{mindmap-definition-RKZ34NQL-LMU6XVv6.js → mindmap-definition-RKZ34NQL-jlkdbEGA.js} +1 -1
  47. package/dist/assets/{pieDiagram-4H26LBE5-BI1Z9Eo2.js → pieDiagram-4H26LBE5-47t_9nc-.js} +1 -1
  48. package/dist/assets/{quadrantDiagram-W4KKPZXB-CdV_08A_.js → quadrantDiagram-W4KKPZXB-D80NXTjU.js} +1 -1
  49. package/dist/assets/{requirementDiagram-4Y6WPE33-BwMM8Iwb.js → requirementDiagram-4Y6WPE33-DHw16YOk.js} +1 -1
  50. package/dist/assets/{sankeyDiagram-5OEKKPKP-d0Rni2EQ.js → sankeyDiagram-5OEKKPKP-BEWygPx8.js} +1 -1
  51. package/dist/assets/{sequenceDiagram-3UESZ5HK-5vKkZSQN.js → sequenceDiagram-3UESZ5HK-DcQU26Jq.js} +1 -1
  52. package/dist/assets/{stateDiagram-AJRCARHV-LCwM2z-V.js → stateDiagram-AJRCARHV-gXepjiq6.js} +1 -1
  53. package/dist/assets/stateDiagram-v2-BHNVJYJU-KIaZ8mu3.js +1 -0
  54. package/dist/assets/{timeline-definition-PNZ67QCA-BS2L3LTd.js → timeline-definition-PNZ67QCA-CN8iJwzP.js} +1 -1
  55. package/dist/assets/{vennDiagram-CIIHVFJN-DLTWccck.js → vennDiagram-CIIHVFJN-BuXejB86.js} +1 -1
  56. package/dist/assets/{wardley-L42UT6IY-B73Ny6GH.js → wardley-L42UT6IY-B2vs5XrN.js} +1 -1
  57. package/dist/assets/{wardleyDiagram-YWT4CUSO-Cj2u3uoT.js → wardleyDiagram-YWT4CUSO-C4FVRih-.js} +1 -1
  58. package/dist/assets/{xychartDiagram-2RQKCTM6-CqHHaLf2.js → xychartDiagram-2RQKCTM6-aUuppx7b.js} +1 -1
  59. package/dist/index.html +4 -4
  60. package/package.json +5 -4
  61. package/dist/assets/AuthorityPage-B7OfbJzA.js +0 -16
  62. package/dist/assets/LogPage-C_Z3RA5T.js +0 -1
  63. package/dist/assets/MarketplacePage-tbUAEd8T.js +0 -6
  64. package/dist/assets/channel-BGqD1ETn.js +0 -1
  65. package/dist/assets/classDiagram-4FO5ZUOK-Bq-CbRIF.js +0 -1
  66. package/dist/assets/classDiagram-v2-Q7XG4LA2-Bq-CbRIF.js +0 -1
  67. package/dist/assets/index-BDfciaOP.js +0 -207
  68. package/dist/assets/index-BiAVUpil.css +0 -1
  69. package/dist/assets/stateDiagram-v2-BHNVJYJU-BFmwX8ee.js +0 -1
@@ -0,0 +1,16 @@
1
+ import{r as o,j as e}from"./react-vendor-BPQixOLZ.js";import{c as _,p as B,W as xe}from"./index-DuWxyVzv.js";import{C as ve}from"./clock-hYaQrRDV.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.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 fe=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],ge=_("crown",fe);/**
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 ye=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],be=_("sliders-horizontal",ye);/**
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 je=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ne=_("user",je),h=n=>`${n.type}:${n.name}`;function we(n){const r=new Map;for(const l of n){const c=r.get(l.pluginName);c?c.push(l):r.set(l.pluginName,[l])}return[...r.entries()].sort((l,c)=>l[0].localeCompare(c[0])).map(([l,c])=>({plugin:l,ops:c}))}function ke(n,r){const l=r[h(n)];return l!==void 0?l:n.minLevel}function se(n,r){const l=r[h(n)];if(l!=="off")return l??n.confirm}const R="@aalis/plugin-authority",te=n=>n instanceof Error?n.message:String(n),ne=n=>n.split(",").map(r=>r.trim()).filter(Boolean);function H({value:n,options:r,onPick:l}){return e.jsx("span",{style:{display:"inline-flex",gap:2},children:r.map(c=>e.jsx("button",{type:"button",className:`btn btn-sm${n===c.v?" btn-primary":""}`,onClick:()=>l(c.v),children:c.label},c.v))})}function G({value:n,onCommit:r,placeholder:l,title:c}){const[w,y]=o.useState(n===""?"":String(n));o.useEffect(()=>{y(n===""?"":String(n))},[n]);const v=()=>{const d=w.trim();if(d===""){r(null);return}const I=Number.parseInt(d,10);Number.isInteger(I)?r(I):y(n===""?"":String(n))};return e.jsx("input",{type:"number",step:1,className:"config-edit-input authority-level-input",style:{width:68,textAlign:"center"},value:w,placeholder:l,title:c,onChange:d=>y(d.target.value),onBlur:v,onKeyDown:d=>{d.key==="Enter"&&d.target.blur()}})}function $e(){var Y;const[n,r]=o.useState(null),[l,c]=o.useState(!0),[w,y]=o.useState(""),v=s=>{y(s),setTimeout(()=>y(""),2200)},[d,I]=o.useState(new Set(["users","ops"])),S=s=>I(t=>{const a=new Set(t);return a.has(s)?a.delete(s):a.add(s),a}),[E,ae]=o.useState(""),[M,le]=o.useState("all"),[ie,re]=o.useState(new Set),[x,O]=o.useState({platform:"",userId:"",level:"1"}),[k,W]=o.useState({platform:"",userId:""}),[q,Q]=o.useState(!1),[m,C]=o.useState({denied:"",allow:"",duration:0}),[K,F]=o.useState(!1),b=o.useCallback(async()=>{var s,t;c(!0);try{const a=await B(R,"getOverview");r(a),C({denied:(a.deniedCapabilities??[]).join(", "),allow:(((s=a.restrictedPolicy)==null?void 0:s.allow)??[]).join(", "),duration:((t=a.restrictedPolicy)==null?void 0:t.duration)??0})}catch{r(null)}c(!1)},[]);o.useEffect(()=>{b()},[b]);const p=o.useCallback(async(s,t,a)=>{try{await B(R,s,t),a&&v(a),await b()}catch(N){v(te(N))}},[b]);if(l&&!n)return e.jsx("div",{className:"page-content",children:e.jsx("div",{className:"empty-hint",children:"加载中..."})});if(!n)return e.jsx("div",{className:"page-content",children:e.jsx("div",{className:"empty-hint",children:"获取权限数据失败"})});const z=[...n.commands,...n.tools],oe=we(z.filter(s=>M==="all"||s.type===M)),L=E.trim().toLowerCase(),A=n.users.filter(s=>!s.isOwner),j=n.deniedCapabilities??[],f=((Y=n.restrictedPolicy)==null?void 0:Y.allow)??[],g=n.autoConfirmUntil??0,J=g===-1||g>Date.now(),ce=g===-1?"一直开启":g>Date.now()?`开启中 · 剩 ${Math.ceil((g-Date.now())/6e4)} 分钟`:"关闭",V=(s,t)=>p("setUserLevel",{platform:s.platform,userId:s.userId,level:t},`已设等级: ${t}`),de=(s,t)=>p("setAuthorityOverride",{name:h(s),level:t},"已更新最低等级"),pe=(s,t)=>p("setConfirmOverride",{name:h(s),confirm:t},"已更新确认"),me=async(s,t)=>{try{await Promise.all(s.map(a=>B(R,"setAuthorityOverride",{name:h(a),level:t}))),v("整组最低等级已更新"),await b()}catch(a){v(te(a))}},X=s=>p("setConfig",{deniedCapabilities:s},"已更新硬禁"),P=(s,t)=>p("setRestrictedPolicy",{policy:{allow:s,duration:t}},"已更新自动放行");return e.jsxs("div",{className:"page-content page-authority",children:[w&&e.jsx("div",{className:"toast",children:w}),e.jsx("datalist",{id:"authority-platforms",children:(n.platforms??[]).map(s=>e.jsx("option",{value:s},s))}),e.jsxs("div",{className:"overview-grid",children:[e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(Ne,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"用户"}),e.jsx("div",{className:"overview-card-value",children:A.length})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(xe,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"操作"}),e.jsx("div",{className:"overview-card-value",children:z.length})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(ge,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"Owner"}),e.jsx("div",{className:"overview-card-value",children:n.owners.length})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(ve,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"临时放行"}),e.jsx("div",{className:"overview-card-value",children:n.temporaryGrants.length})]})]})]}),e.jsxs("div",{className:"config-block",style:J?{borderColor:"#f59e0b"}:void 0,children:[e.jsxs("div",{className:"config-block-header",style:{cursor:"default"},children:[e.jsxs("span",{className:"config-block-title",children:["确认模式",J&&e.jsx("span",{style:{marginLeft:8,color:"#f59e0b",fontSize:12},children:"⚠ 自动确认中"})]}),e.jsxs("span",{className:"config-block-hint",children:["开启后 owner 本人执行 dangerous 操作免二次确认(批处理便利)。等级门禁 / 封禁 / always 确认仍生效。当前:",ce]})]}),e.jsxs("div",{className:"config-block-body",children:[e.jsx("span",{style:{opacity:.6,fontSize:12,marginRight:8},children:"设为"}),e.jsx(H,{value:g===-1?"-1":g>Date.now()?"":"0",options:[{v:"0",label:"关"},{v:"30",label:"30 分钟"},{v:"60",label:"1 小时"},{v:"-1",label:"一直"}],onPick:s=>p("setAutoConfirm",{minutes:Number(s)},"已更新确认模式")})]})]}),e.jsxs("div",{className:"config-block",children:[e.jsxs("div",{className:"config-block-header",onClick:()=>S("users"),children:[e.jsx("span",{className:"config-block-title",children:"用户(外部身份的权限等级)"}),e.jsxs("span",{className:"config-block-hint",children:["给 QQ 等外部身份设一个整数等级:越大权限越高 · 默认 ",n.defaultAuthority," · 封禁=负数 · owner=∞。仅 owner 可改。"]}),e.jsx("span",{className:`config-block-toggle ${d.has("users")?"open":""}`,children:"▶"})]}),d.has("users")&&e.jsxs("div",{className:"config-block-body",children:[e.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:8,alignItems:"center"},children:[e.jsx("input",{className:"config-edit-input",style:{maxWidth:160},placeholder:"平台 (如 onebot)",list:"authority-platforms",value:x.platform,onChange:s=>O(t=>({...t,platform:s.target.value}))}),e.jsx("input",{className:"config-edit-input",style:{maxWidth:160},placeholder:"用户 ID",value:x.userId,onChange:s=>O(t=>({...t,userId:s.target.value}))}),e.jsx("span",{style:{opacity:.6,fontSize:12},children:"等级"}),e.jsx("input",{type:"number",step:1,className:"config-edit-input",style:{width:72,textAlign:"center"},value:x.level,onChange:s=>O(t=>({...t,level:s.target.value}))}),e.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:!x.platform||!x.userId,onClick:()=>{const s=Number.parseInt(x.level,10);if(!Number.isInteger(s)){v("等级必须是整数");return}const t={platform:x.platform,userId:x.userId};O({platform:"",userId:"",level:"1"}),V(t,s)},children:"+ 添加身份"}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:b,disabled:l,children:"刷新"})]}),A.length===0?e.jsxs("div",{className:"empty-hint",children:["暂无登记用户。默认等级(",n.defaultAuthority,")对所有人开放,无需登记;需要放权/封禁时在此添加。"]}):A.map(s=>e.jsxs("div",{className:"authority-cmd-row authority-user-row",children:[e.jsxs("span",{className:"authority-cell-id",style:{flex:1},children:[e.jsx("strong",{children:s.platform}),":",s.userId,s.note?e.jsx("span",{className:"authority-user-flag",children:s.note}):null]}),e.jsxs("span",{style:{display:"inline-flex",gap:6,alignItems:"center"},children:[e.jsx("span",{style:{opacity:.6,fontSize:12},children:"等级"}),e.jsx(G,{value:s.level,onCommit:t=>V(s,t??n.defaultAuthority),title:"整数;越大越高,负数=封禁"}),e.jsx("button",{type:"button",className:"btn btn-danger btn-sm",onClick:()=>p("deleteUser",{platform:s.platform,userId:s.userId},"已删除"),children:"删除"})]})]},`${s.platform}:${s.userId}`))]})]}),e.jsxs("div",{className:"config-block",children:[e.jsxs("div",{className:"config-block-header",onClick:()=>S("owners"),children:[e.jsx("span",{className:"config-block-title",children:"Owner"}),e.jsx("span",{className:"config-block-hint",children:"Owner 拥有全部权限;console(本机登录)恒为 Owner。"}),e.jsx("span",{className:`config-block-toggle ${d.has("owners")?"open":""}`,children:"▶"})]}),d.has("owners")&&e.jsxs("div",{className:"config-block-body",children:[e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>Q(s=>!s),children:q?"取消":"+ 添加 Owner"}),q&&e.jsxs("div",{style:{display:"flex",gap:6,marginTop:8},children:[e.jsx("input",{className:"config-edit-input",style:{maxWidth:160},placeholder:"平台",list:"authority-platforms",value:k.platform,onChange:s=>W(t=>({...t,platform:s.target.value}))}),e.jsx("input",{className:"config-edit-input",style:{maxWidth:160},placeholder:"用户 ID",value:k.userId,onChange:s=>W(t=>({...t,userId:s.target.value}))}),e.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:!k.platform||!k.userId,onClick:()=>{p("setOwners",{owners:[...n.owners,{...k}]},"Owner 已添加"),W({platform:"",userId:""}),Q(!1)},children:"确认"})]}),n.owners.length===0?e.jsx("div",{className:"empty-hint",style:{marginTop:8},children:"暂无显式 Owner。console 始终拥有全部权限。"}):e.jsx("div",{className:"authority-cmd-list",style:{marginTop:8},children:n.owners.map((s,t)=>e.jsxs("div",{className:"authority-cmd-row",children:[e.jsxs("span",{style:{flex:1},children:[e.jsx("strong",{children:s.platform}),":",s.userId]}),e.jsx("button",{type:"button",className:"btn btn-danger btn-sm",onClick:()=>p("setOwners",{owners:n.owners.filter((a,N)=>N!==t)},"Owner 已移除"),children:"移除"})]},`${s.platform}:${s.userId}`))})]})]}),e.jsxs("div",{className:"config-block",children:[e.jsxs("div",{className:"config-block-header",onClick:()=>S("ops"),children:[e.jsx("span",{className:"config-block-title",children:"操作(指令 / 工具的门槛)"}),e.jsx("span",{className:"config-block-hint",children:"每个操作一个「最低等级」(默认按风险派生 safe0/sensitive1/dangerous2)+ 确认要求。owner 可逐条/整组覆盖成任意整数;多数无需动。"}),e.jsx("span",{className:`config-block-toggle ${d.has("ops")?"open":""}`,children:"▶"})]}),d.has("ops")&&e.jsxs("div",{className:"config-block-body",children:[e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginBottom:8},children:[e.jsx("input",{className:"config-edit-input",style:{flex:1,minWidth:180},placeholder:"搜索插件 / 操作…",value:E,onChange:s=>ae(s.target.value)}),e.jsx(H,{value:M,options:[{v:"all",label:"全部"},{v:"command",label:"指令"},{v:"tool",label:"工具"}],onPick:s=>le(s)})]}),oe.map(({plugin:s,ops:t})=>{const a=t.filter(i=>!L||i.pluginName.toLowerCase().includes(L)||i.displayName.toLowerCase().includes(L));if(a.length===0)return null;const N=ie.has(s)||L.length>0,T=a.filter(i=>se(i,n.confirmOverrides)).length;return e.jsxs("div",{className:"plugin-card",style:{marginTop:8},children:[e.jsxs("div",{className:"plugin-card-header",children:[e.jsxs("button",{type:"button",className:"btn btn-sm",style:{flex:1,textAlign:"left",background:"transparent",border:"none"},onClick:()=>re(i=>{const u=new Set(i);return u.has(s)?u.delete(s):u.add(s),u}),children:[e.jsx("span",{style:{marginRight:6,opacity:.55},children:N?"▾":"▸"}),e.jsx("strong",{children:s})," ",e.jsxs("span",{style:{opacity:.5},children:["(",a.length,")"]}),T>0&&e.jsxs("span",{style:{marginLeft:8,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(245,158,11,0.16)",color:"#f59e0b"},title:`本组有 ${T} 个操作需确认(危险)`,children:["⚠ ",T," 需确认"]})]}),e.jsxs("span",{style:{display:"inline-flex",gap:6,alignItems:"center"},children:[e.jsx("span",{style:{opacity:.55,fontSize:11},children:"批量设为"}),e.jsx(G,{value:"",placeholder:"等级",title:"批量设置本组所有操作的最低等级",onCommit:i=>i!==null&&me(a,i)})]})]}),N&&e.jsx("div",{style:{borderTop:"1px solid var(--border)"},children:a.map(i=>{const u=h(i),Z=se(i,n.confirmOverrides),ee=u in n.authorityOverrides,D=i.minLevel,he=ke(i,n.authorityOverrides),ue=n.confirmOverrides[u],U=i.type==="command";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 12px",borderTop:"1px solid var(--border)"},children:[e.jsxs("span",{style:{flex:1,minWidth:0,display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:10,fontWeight:700,padding:"1px 6px",borderRadius:6,whiteSpace:"nowrap",background:U?"rgba(91,141,239,0.16)":"rgba(45,191,128,0.16)",color:U?"#5b8def":"#2dbf80"},children:U?"指令":"工具"}),e.jsx("span",{className:"authority-cmd-name",title:u,children:i.displayName}),ee&&e.jsx("span",{style:{color:"#f59e0b"},title:`已覆盖(默认 ${D})`,children:"●"})]}),e.jsxs("span",{style:{display:"inline-flex",gap:8,alignItems:"center",flexShrink:0},children:[e.jsx("span",{style:{opacity:.6,fontSize:11},children:"等级"}),e.jsx(G,{value:ee?he:"",placeholder:`默认${D}`,title:`留空=默认(${D});填整数=覆盖`,onCommit:$=>de(i,$)}),e.jsx("span",{style:{opacity:.4},children:"|"}),e.jsx("span",{style:{opacity:.6,fontSize:11},title:"确认=危险:会话/每次=执行前要人点头;关=不弹",children:"确认"}),e.jsx(H,{value:ue??"default",options:[{v:"default",label:Z?`默认(${Z==="always"?"每次":"会话"})`:"默认"},{v:"off",label:"关"},{v:"session",label:"会话"},{v:"always",label:"每次"}],onPick:$=>pe(i,$==="default"?"":$)})]})]},u)})})]},s)})]})]}),e.jsxs("div",{className:"config-block",children:[e.jsxs("div",{className:"config-block-header",onClick:()=>S("adv"),children:[e.jsxs("span",{className:"config-block-title",children:[e.jsx(be,{size:14,style:{verticalAlign:"middle",marginRight:4}}),"高级"]}),e.jsx("span",{className:"config-block-hint",children:"全局硬禁(连 owner 都拒)+ 受限操作自动放行(给自动化)+ 当前临时放行。直接选操作即可,无需手写。"}),e.jsx("span",{className:`config-block-toggle ${d.has("adv")?"open":""}`,children:"▶"})]}),d.has("adv")&&e.jsxs("div",{className:"config-block-body",children:[e.jsx("div",{className:"section-label",style:{marginTop:0},children:"硬禁操作(连 owner 都拒,慎用)"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,alignItems:"center",marginBottom:6},children:j.length===0?e.jsx("span",{className:"empty-hint",style:{padding:0},children:"无"}):j.map(s=>e.jsxs("span",{className:"tool-chip",style:{display:"inline-flex",alignItems:"center",gap:4},children:[s,e.jsx("button",{type:"button",className:"btn btn-sm",style:{padding:"0 5px",lineHeight:1},title:"移除",onClick:()=>X(j.filter(t=>t!==s)),children:"×"})]},s))}),e.jsxs("select",{className:"config-edit-input",style:{maxWidth:340},value:"",onChange:s=>{const t=s.target.value;t&&!j.includes(t)&&X([...j,t])},children:[e.jsx("option",{value:"",children:"+ 选要硬禁的操作…"}),z.map(s=>e.jsxs("option",{value:h(s),children:[s.type==="command"?"指令 ":"工具 ",s.displayName]},h(s)))]}),e.jsx("div",{className:"section-label",children:"自动放行(受限操作免确认,给自动化)"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,alignItems:"center",marginBottom:6},children:f.length===0?e.jsx("span",{className:"empty-hint",style:{padding:0},children:"无"}):f.map(s=>e.jsxs("span",{className:"tool-chip",style:{display:"inline-flex",alignItems:"center",gap:4},children:[s,e.jsx("button",{type:"button",className:"btn btn-sm",style:{padding:"0 5px",lineHeight:1},title:"移除",onClick:()=>P(f.filter(t=>t!==s),m.duration),children:"×"})]},s))}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[e.jsxs("select",{className:"config-edit-input",style:{maxWidth:340},value:"",onChange:s=>{const t=s.target.value;t&&!f.includes(t)&&P([...f,t],m.duration)},children:[e.jsx("option",{value:"",children:"+ 选要自动放行的操作…"}),z.map(s=>e.jsxs("option",{value:h(s),children:[s.type==="command"?"令 ":"具 ",s.displayName]},h(s)))]}),e.jsx("span",{style:{opacity:.6,fontSize:11},children:"时长(秒,0=永久)"}),e.jsx("input",{type:"number",min:0,className:"config-edit-input",style:{width:90},value:m.duration,onChange:s=>C(t=>({...t,duration:parseInt(s.target.value,10)||0})),onBlur:()=>P(f,m.duration)})]}),e.jsx("button",{type:"button",className:"btn btn-sm",style:{marginTop:10},onClick:()=>F(s=>!s),children:K?"收起手填":"手填 glob(高级,如 tool:* / *)"}),K&&e.jsxs("div",{className:"config-edit-form",style:{marginTop:6},children:[e.jsxs("div",{className:"config-edit-row",children:[e.jsx("label",{className:"config-edit-label",children:"硬禁(glob)"}),e.jsx("input",{className:"config-edit-input",value:m.denied,onChange:s=>C(t=>({...t,denied:s.target.value})),placeholder:"tool:dangerous.*"})]}),e.jsxs("div",{className:"config-edit-row",children:[e.jsx("label",{className:"config-edit-label",children:"放行(glob)"}),e.jsx("input",{className:"config-edit-input",value:m.allow,onChange:s=>C(t=>({...t,allow:s.target.value})),placeholder:"tool:file.* 或 *"})]}),e.jsx("div",{className:"config-edit-actions",children:e.jsx("button",{type:"button",className:"btn btn-primary btn-sm",onClick:async()=>{m.denied.trim()&&await p("setConfig",{deniedCapabilities:[...new Set([...j,...ne(m.denied)])]}),m.allow.trim()&&await p("setRestrictedPolicy",{policy:{allow:[...new Set([...f,...ne(m.allow)])],duration:m.duration}},"已追加"),C(s=>({...s,denied:"",allow:""})),F(!1)},children:"追加"})})]}),e.jsx("div",{className:"section-label",style:{marginTop:12},children:"当前临时放行"}),n.temporaryGrants.length===0?e.jsx("div",{className:"empty-hint",style:{padding:"4px 0"},children:"暂无。"}):e.jsx("div",{className:"authority-cmd-list",children:n.temporaryGrants.map(s=>e.jsxs("div",{className:"authority-cmd-row",children:[e.jsxs("span",{className:"authority-cmd-name",title:s.sessionId,children:[s.capability,e.jsx("span",{className:"authority-cmd-plugin",style:{marginLeft:6},children:s.sessionId})]}),e.jsxs("span",{style:{fontSize:12,opacity:.8,marginRight:8},children:[s.used,s.maxUses?` / ${s.maxUses}`:""]}),e.jsx("button",{type:"button",className:"btn btn-danger btn-sm",onClick:()=>p("revokeTemporaryGrant",{id:s.id},"已撤销"),children:"撤销"})]},s.id))})]})]})]})}export{$e as AuthorityPage};
@@ -1,4 +1,4 @@
1
- import{r as d,j as e,R as W,a as tt}from"./react-vendor-BPQixOLZ.js";import{c as me,a as ge,p as D,S as nt,W as st}from"./index-BDfciaOP.js";import{S as rt}from"./SchemaForm-YVQZ6Keg.js";import{c as $e}from"./cytoscape.esm-LDYqcvCF.js";import{f as at}from"./cytoscape-fcose-DXAQNCkb.js";import{G as ot}from"./globe-Ccm5cs9Z.js";import{C as it}from"./clock-C4nOYixW.js";import{M as lt,r as dt,a as ct}from"./markdown-BCywGHw2.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";/**
1
+ import{r as d,j as e,R as W,a as tt}from"./react-vendor-BPQixOLZ.js";import{c as me,a as ge,p as D,S as nt,W as st}from"./index-DuWxyVzv.js";import{S as rt}from"./SchemaForm-YVQZ6Keg.js";import{c as $e}from"./cytoscape.esm-LDYqcvCF.js";import{f as at}from"./cytoscape-fcose-DXAQNCkb.js";import{G as ot}from"./globe-BOoUupfo.js";import{C as it}from"./clock-hYaQrRDV.js";import{M as lt,r as dt,a as ct}from"./markdown-B2G8c9k5.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.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 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-BDfciaOP.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-BCywGHw2.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-DuWxyVzv.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 @@
1
+ import{r as l,j as n}from"./react-vendor-BPQixOLZ.js";const E=40,H=40;function L({logs:o,onLoadOlder:m}){const[f,C]=l.useState(null),[S,q]=l.useState(""),j=l.useDeferredValue(S),[d,b]=l.useState(!1),[N,R]=l.useState(new Set),a=l.useRef(null),u=l.useRef(!0),x=l.useRef(!1),T=l.useRef(!1),i=l.useRef(null),h=l.useRef(null),p=l.useMemo(()=>{let e=f?o.filter(s=>s.level===f):o;const t=j.trim().toLowerCase().split(/\s+/).filter(Boolean);return t.length>0&&(e=e.filter(s=>{const r=`${s.scope} ${s.message}`.toLowerCase();return t.every(c=>c.startsWith("-")&&c.length>1?!r.includes(c.slice(1)):r.includes(c))})),e},[o,f,j]),g=l.useCallback(()=>{const e=a.current;if(!e)return;e.scrollTop=e.scrollHeight;let t=0;const s=()=>{const r=a.current;!r||!u.current||(r.scrollHeight-r.scrollTop-r.clientHeight>1&&(r.scrollTop=r.scrollHeight),++t<8&&requestAnimationFrame(s))};requestAnimationFrame(s)},[]);l.useLayoutEffect(()=>{var s;const e=a.current;if(!e)return;const t=((s=p[0])==null?void 0:s.seq)??null;if(i.current&&t!==null&&h.current!==null&&t<h.current){const{prevScrollHeight:c,prevScrollTop:v}=i.current,y=e.scrollHeight-c;e.scrollTop=v+y,i.current=null,h.current=t;return}u.current&&g(),h.current=t},[p,g]);const A=l.useCallback(()=>{const e=a.current;if(!e)return;const{scrollTop:t,scrollHeight:s,clientHeight:r}=e;u.current=s-t-r<E;const c=s>r+H;t<H&&c&&!T.current&&m&&!x.current&&o.length>0&&(x.current=!0,i.current={prevScrollHeight:s,prevScrollTop:t},m().then(v=>{v===0&&(T.current=!0,i.current=null)}).catch(()=>{i.current=null}).finally(()=>{x.current=!1}))},[m,o.length]),w=e=>{R(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},$=()=>{const e=a.current;e&&(u.current=e.scrollHeight-e.scrollTop-e.clientHeight<E),b(t=>!t),R(new Set)};l.useLayoutEffect(()=>{u.current&&g()},[d,g]);const k=["debug","info","warn","error"];return n.jsxs("div",{className:"page-logs",children:[n.jsxs("div",{className:"log-controls",children:[k.map(e=>n.jsx("button",{className:`log-filter ${f===e?"active":""}`,onClick:()=>C(t=>t===e?null:e),children:e.toUpperCase()},e)),n.jsx("button",{className:`log-filter ${d?"active":""}`,onClick:$,children:d?"全部收起":"全部展开"}),n.jsx("input",{className:"log-search",type:"search",placeholder:"关键词过滤(空格=同时含,-词=排除)",value:S,onChange:e=>q(e.target.value),title:"对 scope 与内容做大小写不敏感的子串匹配;只过滤已加载的行,上滚可加载更早历史"}),n.jsxs("span",{className:"log-count",children:[p.length,"/",o.length]})]}),n.jsxs("div",{className:"log-list",ref:a,onScroll:A,children:[p.map(e=>{const t=d?!N.has(e.seq):N.has(e.seq);return n.jsxs("div",{className:`log-entry ${t?"expanded":""}`,onClick:()=>w(e.seq),style:t?void 0:{contentVisibility:"auto",containIntrinsicSize:"auto 28px"},children:[n.jsx("span",{className:"log-time",title:e.timestamp,children:e.timestamp.slice(11,23)}),n.jsx("span",{className:`log-level ${e.level}`,children:e.level.toUpperCase().padEnd(5)}),n.jsx("span",{className:"log-scope",children:e.scope}),n.jsx("span",{className:"log-msg",title:t?"":e.message,children:e.message})]},e.seq)}),p.length===0&&n.jsx("div",{className:"empty-hint",style:{padding:16},children:"暂无日志"})]})]})}export{L as LogPage};
@@ -0,0 +1,6 @@
1
+ import{j as s,r}from"./react-vendor-BPQixOLZ.js";import{c as oe,a as g,T as V,D as de}from"./index-DuWxyVzv.js";import{u as me}from"./ConfirmDialog-DbV-E1Nd.js";import{C as ue}from"./clock-hYaQrRDV.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.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 he=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],pe=oe("scale",he);function M({node:t,mode:o,depth:d=0}){var n,p;const m=((n=t.services)==null?void 0:n.requires)??[],u=((p=t.services)==null?void 0:p.provides)??[];return s.jsxs("div",{className:"dep-tree-node",style:d>0?{marginLeft:14}:void 0,children:[s.jsxs("div",{className:"dep-tree-row",children:[s.jsx("span",{className:"dep-tree-name",children:t.name}),!t.present&&s.jsx("span",{className:"dep-tree-tag dep-tag-missing",children:o==="install"?"将引入":"未装"}),m.length>0&&s.jsxs("span",{className:"dep-tree-tag dep-tag-req",children:["需 ",m.join("、")]}),u.length>0&&s.jsxs("span",{className:"dep-tree-tag dep-tag-prov",children:["供 ",u.join("、")]})]}),t.children.map(w=>s.jsx(M,{node:w,mode:o,depth:d+1},w.name))]})}function fe({graph:t}){const o=t.upstream.children,{required:d,provides:m}=t.services,u=t.downstream.children.map(n=>n.name);return s.jsxs("div",{className:"dep-disclosure",children:[s.jsx("div",{className:"dep-section-label",children:"依赖关系"}),o.length>0?o.map(n=>s.jsx(M,{node:n,mode:"install"},n.name)):s.jsx("div",{className:"dep-empty",children:"无 import 依赖"}),d.length>0&&s.jsxs("div",{className:"dep-line",children:["需要服务:",d.map(n=>s.jsxs("span",{className:`dep-svc ${n.providedBy?"ok":"warn"}`,children:[n.service,n.providedBy?`(✓ ${n.providedBy})`:"(⚠ 无提供者)"]},n.service))]}),m.length>0&&s.jsxs("div",{className:"dep-line",children:["提供服务:",m.join("、")]}),u.length>0&&s.jsxs("div",{className:"dep-line",children:["已装插件中依赖它的:",u.join("、")]})]})}function xe({graph:t}){const o=t.downstream.children;return o.length===0&&t.serviceDependents.length===0?null:s.jsxs("div",{className:"dep-uninstall-warn",children:[t.serviceDependents.length>0&&s.jsxs("div",{className:"dep-line dep-warn-block",children:["⛔ 依赖它提供的服务且无替代:",t.serviceDependents.join("、"),s.jsx("br",{}),"(卸载会被拒绝,请先卸载它们或装替代提供者)"]}),o.length>0&&s.jsxs("div",{className:"dep-warn-block",children:[s.jsx("div",{children:"⚠️ 这些已装插件 import 了它(删除后可能无法启动,需重新安装恢复):"}),o.map(d=>s.jsx(M,{node:d,mode:"view"},d.name))]})]})}const Y={workspace:{label:"工作区",hint:"源码在本仓库内,改代码即生效,不经市场更新"},link:{label:"本地链接",hint:"由 file: / link: 指向本地目录,更新请改那份源码"},git:{label:"外部源",hint:"由 git / URL / user-repo 简写安装,更新请改依赖声明"},alias:{label:"别名",hint:"由 npm: 别名指向另一个包,市场更新会拆掉别名,故不提供"},transitive:{label:"依赖引入",hint:"由其它包引入,版本随父包的范围,不单独更新"}},H={relevance:"默认排序",downloads:"下载量",updated:"最近更新",score:"综合评分"},K={all:"全部来源",official:"仅官方",community:"仅社区"},Q={all:"全部状态",installed:"已安装",available:"未安装"},z={all:"全部类型",plugin:"功能插件",interface:"前端界面",core:"内核",runtime:"宿主",api:"API 契约",schema:"数据规范",util:"工具库"},B=new Set(["plugin","interface"]);function je(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ve(t){if(!t)return"";const o=Date.parse(t);if(Number.isNaN(o))return"";const d=Math.max(0,(Date.now()-o)/1e3),m=[[31536e3,"年"],[2592e3,"个月"],[86400,"天"],[3600,"小时"],[60,"分钟"]];for(const[u,n]of m)if(d>=u)return`${Math.floor(d/u)} ${n}前`;return"刚刚"}function Ce({plugins:t,onRefresh:o,onRestart:d}){const{confirm:m,dialog:u}=me(),[n,p]=r.useState(null),[w,U]=r.useState(null),[y,X]=r.useState([]),[C,_]=r.useState(!1),[O,Z]=r.useState(!1),[A,P]=r.useState(null),[k,F]=r.useState(""),[N,ee]=r.useState("relevance"),[L,se]=r.useState("all"),[T,ae]=r.useState("all"),[D,te]=r.useState("plugin"),[W,I]=r.useState(new Set),[S,G]=r.useState(!1),[f,R]=r.useState(null),E=r.useRef(0),x=e=>{U(e),setTimeout(()=>U(null),2500)},$=r.useCallback(async()=>{const e=++E.current;_(!0),P(null);try{const[l,a]=await Promise.all([g("/api/marketplace?q="),g("/api/system-components").catch(()=>({components:[]}))]),i=l.packages??[],v=new Set(i.map(c=>c.name)),h=(a.components??[]).filter(c=>!v.has(c.name)).map(c=>({name:c.name,description:c.description??"",version:c.latest??c.version??"",resolved:c.version,request:c.request,origin:c.origin,updatable:c.updatable??!1,installed:!0,official:c.name.startsWith("@aalis/"),category:c.kind}));if(e!==E.current)return;X([...i,...h]),l.warning&&P(l.warning)}catch{if(e!==E.current)return;x("无法加载插件市场")}e===E.current&&(_(!1),Z(!0))},[]);r.useEffect(()=>{$()},[$]);const J=r.useMemo(()=>new Set(t.map(e=>e.name)),[t]),b=r.useMemo(()=>y.filter(e=>e.updatable),[y]);r.useEffect(()=>{I(e=>{const l=new Set(b.map(i=>i.name)),a=new Set([...e].filter(i=>l.has(i)));return a.size===e.size?e:a})},[b]);const j=b.filter(e=>W.has(e.name)),ne=j.some(e=>e.category==="core"||e.category==="runtime"),le=e=>I(l=>{const a=new Set(l);return a.has(e)?a.delete(e):a.add(e),a}),ie=async()=>{if(!(j.length===0||S)){G(!0),R(null);try{const e=await g("/api/marketplace/update",{method:"POST",body:JSON.stringify({targets:j.map(l=>({name:l.name,version:l.version}))})});R(e),e.ok&&e.restarting&&(d==null||d(`正在应用 ${j.length} 项更新并重启…`))}catch(e){R({ok:!1,message:e instanceof Error?e.message:String(e)})}G(!1)}},q=r.useMemo(()=>{const e=k.trim().toLowerCase().split(/\s+/).filter(Boolean),l=y.map(a=>({...a,installed:a.installed||J.has(a.name)})).filter(a=>{if(D!=="all"&&(a.category??"plugin")!==D||L==="official"&&!a.official||L==="community"&&a.official||T==="installed"&&!a.installed||T==="available"&&a.installed)return!1;if(e.length){const i=`${a.name} ${a.description} ${(a.keywords??[]).join(" ")} ${a.author??""}`.toLowerCase();if(!e.every(v=>i.includes(v)))return!1}return!0});return N==="relevance"?l:l.sort((a,i)=>N==="downloads"?(i.downloads??0)-(a.downloads??0):N==="score"?(i.score??0)-(a.score??0):N==="updated"?Date.parse(i.updated??"0")-Date.parse(a.updated??"0"):0)},[y,J,k,N,L,T,D]),re=async(e,l)=>{let a=null;try{a=await g(`/api/marketplace/depgraph?name=${encodeURIComponent(e)}`)}catch{}if(await m({title:`安装${l?"官方插件":"第三方社区插件"}「${e}」`,body:s.jsxs(s.Fragment,{children:[a&&s.jsx(fe,{graph:a}),s.jsx("div",{className:"dep-note",children:"将从 npm 安装。安装后它以你授予的能力运行(可在权限页查看依赖与权限)。请确认来源可信。"})]}),confirmLabel:"安装"})){p(e);try{const h=await g("/api/marketplace/install",{method:"POST",body:JSON.stringify({name:e})});h.ok?(x(h.message??`${e} 已安装`),o(),$()):x(h.error??h.message??"安装失败")}catch{x("安装失败")}p(null)}},ce=async e=>{let l=null;try{l=await g(`/api/marketplace/depgraph?name=${encodeURIComponent(e)}`)}catch{}if(await m({title:`卸载「${e}」`,body:s.jsxs(s.Fragment,{children:[l&&s.jsx(xe,{graph:l}),s.jsx("div",{className:"dep-note",children:"将删除其代码目录并清除残留配置。不可恢复,但可从市场重新安装。"})]}),confirmLabel:"卸载",danger:!0})){p(e);try{const i=await g("/api/marketplace/uninstall",{method:"POST",body:JSON.stringify({name:e})});i.ok?(x(i.message??`${e} 已卸载`),o(),$()):x(i.error??i.message??"卸载失败")}catch{x("卸载失败")}p(null)}};return s.jsxs("div",{className:"page-content page-marketplace",children:[u,w&&s.jsx("div",{className:"toast",children:w}),s.jsxs("div",{className:"section-label",children:["插件市场",O&&s.jsxs("span",{className:"market-count",children:["显示 ",q.length," / 共 ",y.length]})]}),b.length>0&&s.jsxs("div",{className:"update-panel",children:[s.jsxs("div",{className:"update-panel-head",children:[s.jsxs("span",{children:["可更新 ",b.length," 项,已选 ",j.length]}),s.jsxs("div",{className:"update-panel-actions",children:[s.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>I(new Set(b.map(e=>e.name))),disabled:S,children:"全选"}),s.jsx("button",{type:"button",className:"btn btn-primary btn-sm",onClick:ie,disabled:S||j.length===0,children:S?"正在更新…":`更新所选(${j.length})`})]})]}),ne&&s.jsxs("div",{className:"update-panel-warn",children:[s.jsx(V,{size:14})," 所选包含内核或宿主,更新后将重启整个应用;新版本起不来会自动回滚。"]}),s.jsx("div",{className:"update-panel-note",children:"所选项**一次性提交**:先整组做依赖预检,通过后一次安装、一次重启。任一项的 peer 版本不兼容则整批不执行且不改动任何文件——此时把它要求的包(如内核)一并勾选再试。"})]}),f&&s.jsxs("div",{className:f.ok?"update-result ok":"update-result err",children:[s.jsx("div",{children:f.error??f.message??"更新失败"}),f.conflicts&&f.conflicts.length>0&&s.jsx("ul",{className:"update-conflicts",children:f.conflicts.map(e=>s.jsx("li",{children:e},e))})]}),s.jsxs("div",{className:"market-filter-row",children:[s.jsx("input",{className:"config-edit-input",style:{flex:1,minWidth:180},placeholder:"搜索插件(名称 / 描述 / 关键词 / 作者)",value:k,onChange:e=>F(e.target.value)}),s.jsx("select",{className:"config-edit-input",value:D,onChange:e=>te(e.target.value),title:"组件类型",children:Object.keys(z).map(e=>s.jsx("option",{value:e,children:z[e]},e))}),s.jsx("select",{className:"config-edit-input",value:L,onChange:e=>se(e.target.value),children:Object.keys(K).map(e=>s.jsx("option",{value:e,children:K[e]},e))}),s.jsx("select",{className:"config-edit-input",value:T,onChange:e=>ae(e.target.value),children:Object.keys(Q).map(e=>s.jsx("option",{value:e,children:Q[e]},e))}),s.jsx("select",{className:"config-edit-input",value:N,onChange:e=>ee(e.target.value),title:"排序",children:Object.keys(H).map(e=>s.jsx("option",{value:e,children:H[e]},e))}),s.jsx("button",{className:"btn-sm",onClick:()=>$(),disabled:C,children:C?"加载中...":"刷新"})]}),!O&&C&&s.jsxs("div",{className:"empty-hint",style:{padding:16},children:["正在从 npm 加载带 ",s.jsx("code",{children:"aalis-plugin"})," 标签的插件…"]}),A&&s.jsx("div",{className:"empty-hint",style:{padding:12,color:"var(--warning, #ffb300)"},children:A}),O&&q.length===0&&!C&&!A&&s.jsx("div",{className:"empty-hint",style:{padding:16},children:y.length===0?"未找到任何插件":"无匹配项 —— 试试调整搜索词或筛选条件"}),s.jsx("div",{className:"marketplace-grid",children:q.map(e=>{var i,v,h;const l=((i=e.links)==null?void 0:i.homepage)||((v=e.links)==null?void 0:v.repository)||((h=e.links)==null?void 0:h.npm),a=l&&/^https?:\/\//i.test(l)?l:void 0;return s.jsxs("div",{className:"marketplace-card",children:[s.jsxs("div",{className:"marketplace-card-info",children:[a?s.jsx("a",{className:"marketplace-card-name",href:a,target:"_blank",rel:"noreferrer",children:e.name}):s.jsx("span",{className:"marketplace-card-name",children:e.name}),s.jsx("span",{className:"marketplace-card-version",children:e.installed?e.resolved?`v${e.resolved}`:"版本未知":`v${e.version}`}),s.jsx("span",{className:`badge ${e.official?"official":"community"}`,children:e.official?"官方":"社区"}),e.category&&e.category!=="plugin"&&s.jsx("span",{className:"badge",title:"组件类别",children:z[e.category]}),e.insecure&&s.jsxs("span",{className:"badge",style:{background:"var(--danger)",color:"#fff",display:"inline-flex",alignItems:"center",gap:3},title:"npm 标记为不安全包,谨慎安装",children:[s.jsx(V,{size:11})," 不安全"]}),e.author&&s.jsxs("span",{className:"marketplace-card-author",children:["by ",e.author]}),e.installed&&s.jsx("span",{className:"badge active",children:"已安装"}),e.installed&&e.origin&&e.origin!=="registry"&&s.jsx("span",{className:"badge",title:Y[e.origin].hint,children:Y[e.origin].label}),e.updatable&&s.jsxs("label",{className:"badge",style:{background:"var(--warning)",color:"#1a1a1a",cursor:"pointer"},title:`本地 v${e.resolved}(声明 ${e.request??"?"}),npm 最新 v${e.version}。勾选后用顶部「更新所选」批量提交`,children:[s.jsx("input",{type:"checkbox",checked:W.has(e.name),onChange:()=>le(e.name),disabled:S,style:{marginRight:4}}),"可更新 v",e.version]})]}),s.jsx("div",{className:"marketplace-card-desc",children:e.description||"(无描述)"}),e.keywords&&e.keywords.length>0&&s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:e.keywords.slice(0,6).map(c=>s.jsx("button",{type:"button",className:"market-kw",title:`按 “${c}” 筛选`,onClick:()=>F(c),children:c},c))}),s.jsxs("div",{className:"market-meta",children:[e.downloads!=null&&s.jsxs("span",{className:"market-meta-item",title:"近一月下载量",children:[s.jsx(de,{size:12})," ",je(e.downloads),"/月"]}),e.updated&&s.jsxs("span",{className:"market-meta-item",title:new Date(e.updated).toLocaleString(),children:[s.jsx(ue,{size:12})," ",ve(e.updated)]}),e.license&&s.jsxs("span",{className:"market-meta-item",title:"许可证",children:[s.jsx(pe,{size:12})," ",e.license]})]}),s.jsxs("div",{style:{marginTop:8},children:[!B.has(e.category??"plugin")&&s.jsx("span",{className:"market-meta-item",title:"随脚手架就位或作为插件依赖自动安装/卸载,无需也无法单独装卸",children:"随依赖管理"}),B.has(e.category??"plugin")&&!e.installed&&s.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>re(e.name,e.official),disabled:n!==null,title:n&&n!==e.name?`请等待 ${n} 处理完成`:void 0,children:n===e.name?"安装中...":"安装"}),B.has(e.category??"plugin")&&e.installed&&s.jsx("button",{className:"btn btn-sm",style:{color:"var(--danger)"},onClick:()=>ce(e.name),disabled:n!==null,title:n&&n!==e.name?`请等待 ${n} 处理完成`:"卸载插件(删包 + 清配置)",children:n===e.name?"处理中...":"卸载"})]})]},e.name)})})]})}export{Ce as MarketplacePage};
@@ -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-BDfciaOP.js";import{G as x}from"./globe-Ccm5cs9Z.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-BCywGHw2.js";/**
1
+ import{r as c,j as e}from"./react-vendor-BPQixOLZ.js";import{c as p,a as h}from"./index-DuWxyVzv.js";import{G as x}from"./globe-BOoUupfo.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 _,a as k,T as Ae}from"./index-BDfciaOP.js";import{b as Z,S as ve,f as Se,u as Re}from"./SchemaForm-YVQZ6Keg.js";import{u as Je}from"./ConfirmDialog-DbV-E1Nd.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-BCywGHw2.js";/**
1
+ import{r as d,j as e}from"./react-vendor-BPQixOLZ.js";import{c as _,a as k,T as Ae}from"./index-DuWxyVzv.js";import{b as Z,S as ve,f as Se,u as Re}from"./SchemaForm-YVQZ6Keg.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-BDfciaOP.js";import{M as F}from"./markdown-BCywGHw2.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",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-DuWxyVzv.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-yCCgYz2d.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-DT-YvwaL.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-yCCgYz2d.js";import{p as Ct}from"./chunk-4BX2VUAB-LO3rSmwm.js";import{p as Bt}from"./wardley-L42UT6IY-B73Ny6GH.js";import{c as tt}from"./cytoscape.esm-LDYqcvCF.js";import{f as It}from"./cytoscape-fcose-DXAQNCkb.js";import"./index-BDfciaOP.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-BCywGHw2.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-DT-YvwaL.js";import{p as Ct}from"./chunk-4BX2VUAB-CIMNyAOW.js";import{p as Bt}from"./wardley-L42UT6IY-B2vs5XrN.js";import{c as tt}from"./cytoscape.esm-LDYqcvCF.js";import{f as It}from"./cytoscape-fcose-DXAQNCkb.js";import"./index-DuWxyVzv.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-BXhroNLT.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-yCCgYz2d.js";import{G as Qe}from"./graph-CAnANduQ.js";import{c as $e}from"./channel-BGqD1ETn.js";import"./index-BDfciaOP.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-BCywGHw2.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-CMD3FBWL.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-DT-YvwaL.js";import{G as Qe}from"./graph-CAnANduQ.js";import{c as $e}from"./channel-DwG5AtO5.js";import"./index-DuWxyVzv.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-6lryk8d1.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-yCCgYz2d.js";import"./index-BDfciaOP.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-BCywGHw2.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-BbAXVB1_.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-DT-YvwaL.js";import"./index-DuWxyVzv.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-DT-YvwaL.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-yCCgYz2d.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-DT-YvwaL.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-yCCgYz2d.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-DT-YvwaL.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-yCCgYz2d.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-DT-YvwaL.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};