@rubytech/create-maxy-code 0.1.88 → 0.1.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/entitlement-flag.test.js +43 -0
- package/dist/__tests__/tier-flag.test.js +53 -0
- package/dist/index.js +68 -0
- package/dist/tier-flag.js +85 -0
- package/package.json +1 -1
- package/payload/platform/lib/admin-conversation-purge/dist/index.d.ts +54 -0
- package/payload/platform/lib/admin-conversation-purge/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/admin-conversation-purge/dist/index.js +84 -0
- package/payload/platform/lib/admin-conversation-purge/dist/index.js.map +1 -0
- package/payload/platform/lib/admin-conversation-purge/src/index.ts +120 -0
- package/payload/platform/lib/admin-conversation-purge/tsconfig.json +8 -0
- package/payload/platform/lib/graph-trash/dist/index.d.ts +12 -1
- package/payload/platform/lib/graph-trash/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-trash/dist/index.js +8 -1
- package/payload/platform/lib/graph-trash/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-trash/src/index.ts +20 -2
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -0
- package/payload/platform/plugins/admin/PLUGIN.md +1 -0
- package/payload/platform/plugins/admin/hooks/__tests__/askuserquestion-investigate-gate.test.sh +176 -0
- package/payload/platform/plugins/admin/hooks/askuserquestion-investigate-gate.sh +257 -0
- package/payload/platform/plugins/admin/skills/admin-user-management/SKILL.md +2 -0
- package/payload/platform/plugins/docs/references/admin-session.md +5 -1
- package/payload/platform/plugins/docs/references/linkedin-extension.md +49 -0
- package/payload/platform/plugins/linkedin-extension/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/linkedin-extension/PLUGIN.md +58 -0
- package/payload/platform/plugins/linkedin-extension/extension/README.md +44 -0
- package/payload/platform/plugins/linkedin-extension/extension/__tests__/fixtures/profile.html +34 -0
- package/payload/platform/plugins/linkedin-extension/extension/__tests__/fixtures/thread.html +36 -0
- package/payload/platform/plugins/linkedin-extension/extension/assets/pill.css +52 -0
- package/payload/platform/plugins/linkedin-extension/extension/background/sw.js +60 -0
- package/payload/platform/plugins/linkedin-extension/extension/content/extractors.js +127 -0
- package/payload/platform/plugins/linkedin-extension/extension/content/profile.js +82 -0
- package/payload/platform/plugins/linkedin-extension/extension/content/thread.js +84 -0
- package/payload/platform/plugins/linkedin-extension/extension/manifest.json +32 -0
- package/payload/platform/plugins/linkedin-extension/extension/options/options.html +33 -0
- package/payload/platform/plugins/linkedin-extension/extension/options/options.js +30 -0
- package/payload/platform/plugins/linkedin-extension/skills/linkedin-extension/SKILL.md +91 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts +14 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js +28 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.js +168 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-empty-trash-admin-conversation.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.d.ts +22 -3
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.js +61 -13
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-empty-trash.js.map +1 -1
- package/payload/platform/scripts/seed-neo4j.sh +12 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +3 -1
- package/payload/platform/templates/specialists/agents/database-operator.md +6 -2
- package/payload/server/public/assets/{ChatInput-BzjU6OoA.css → ChatInput-dLWJ0Q8I.css} +1 -1
- package/payload/server/public/assets/{Checkbox-BWLS5Isf.js → Checkbox-Bx8mRHQ3.js} +1 -1
- package/payload/server/public/assets/{admin-DjU0q63n.js → admin-C57bDUgs.js} +6 -6
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-lcncWUol.js → architectureDiagram-Q4EWVU46-BEW_bD50.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-SqlxCp6m.js → blockDiagram-DXYQGD6D-DFLT98C3.js} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-DWzvXvDc.js → c4Diagram-AHTNJAMY-BemKtROA.js} +1 -1
- package/payload/server/public/assets/channel-CfpByn-m.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-Bz-tPZhS.js → chunk-336JU56O-BL8fGJ7_.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-MYkbqx1u.js → chunk-426QAEUC-BD6by0MP.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-DfZRQtaZ.js → chunk-4TB4RGXK-DX-cb6Nd.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-BFMrOiNe.js → chunk-5FUZZQ4R-B2QqtIZS.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-64laDovl.js → chunk-5PVQY5BW-CzJWmsmd.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-dClAHBNd.js → chunk-EDXVE4YY-DP9vcvEU.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-Bz4gXG1p.js → chunk-ENJZ2VHE-D5xWEjF0.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-D5pWrJcN.js → chunk-ICPOFSXX-AKduf9o4.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-BCiWtqaK.js → chunk-OYMX7WX6-D6jsVNyQ.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-Brql314T.js → chunk-U2HBQHQK-BNAnTYh8.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-C-79tMym.js → chunk-X2U36JSP-UdQhYDnh.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-G4idHEoZ.js → chunk-YZCP3GAM-DSSmSGmS.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-DyHGASIn.js → chunk-ZZ45TVLE-Czm7IDMC.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DNc9R1IX.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DM1DQh8N.js +1 -0
- package/payload/server/public/assets/clone-BSrNdvLW.js +1 -0
- package/payload/server/public/assets/{dagre-KV5264BT--Bba_VRf.js → dagre-KV5264BT-CBuRCJE7.js} +1 -1
- package/payload/server/public/assets/{dagre-DfJ8a8tG.js → dagre-hSIMHJcO.js} +1 -1
- package/payload/server/public/assets/data-3n20lir5.js +1 -0
- package/payload/server/public/assets/{diagram-5BDNPKRD-CfUotMr9.js → diagram-5BDNPKRD-dbMrH0le.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-BWZJChPS.js → diagram-G4DWMVQ6-DBc6hs9a.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-BExS6IWb.js → diagram-MMDJMWI5-ubSGybUk.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-DQ4t_wIt.js → diagram-TYMM5635-WxL3cv-9.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-f1sfB-AQ.js → erDiagram-SMLLAGMA-CrBBOAN8.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-CZexxT3v.js → flowDiagram-DWJPFMVM-CXUq5Hzt.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-BNcFUX4K.js → ganttDiagram-T4ZO3ILL-vTCBnYVS.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-soyylUaR.js → gitGraphDiagram-UUTBAWPF-BHrj_bRa.js} +1 -1
- package/payload/server/public/assets/graph-ChwMpxn_.js +1 -0
- package/payload/server/public/assets/graph-labels-CUgJgIwl.js +1 -0
- package/payload/server/public/assets/{graphlib-B2ezMQY4.js → graphlib-CDO75l2X.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-4xmenbOP.js → infoDiagram-42DDH7IO-CcQdaOhi.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-C_D6CqVq.js → ishikawaDiagram-UXIWVN3A-3KvltFgV.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-DUDx0c35.js → journeyDiagram-VCZTEJTY-DZCXaGFE.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-BNr7ErhZ.js → kanban-definition-6JOO6SKY-DAIAKy1-.js} +1 -1
- package/payload/server/public/assets/{lib-iKom7FFe.js → lib-CCLURO3E.js} +1 -1
- package/payload/server/public/assets/{line-Dvs5wrj5.js → line-C8iCE2Wx.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-D0ksZQlW.js → mermaid-parser.core-ElvUhnV9.js} +1 -1
- package/payload/server/public/assets/{mermaid.core--Btu4mYy.js → mermaid.core-7dSH31Ao.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-DfyZTghB.js → mindmap-definition-QFDTVHPH-FZ0rcfac.js} +1 -1
- package/payload/server/public/assets/{page-BnBmdRbo.js → page-D3bFmqF4.js} +1 -1
- package/payload/server/public/assets/{page-x6ZXWwMx.js → page-DNjUtT5q.js} +18 -17
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-BiG9YoLj.js → pieDiagram-DEJITSTG-CDuvMZbO.js} +1 -1
- package/payload/server/public/assets/{public-DW7yINk7.js → public-g_2skbnY.js} +3 -3
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-CVufUsie.js → quadrantDiagram-34T5L4WZ-xDjhkqNc.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-UKCptCPk.js → requirementDiagram-MS252O5E-BPKpyT0n.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-e8iZYL5P.js → sankeyDiagram-XADWPNL6-BvFIrihC.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-CfZqVRxe.js → sequenceDiagram-FGHM5R23-C6G1oAE0.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-DrWX8OY8.js → stateDiagram-FHFEXIEX-DbOJT_Xh.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Ce4GFk-H.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-Blec2Yhc.js → timeline-definition-GMOUNBTQ-D1DSxHh6.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-BtACuGgu.js → vennDiagram-DHZGUBPP-BYoSeMdo.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-BWT7orYV.js → wardleyDiagram-NUSXRM2D-DH3kZdea.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DBzoIRiJ.js → xychartDiagram-5P7HB3ND-C6MROMLG.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +531 -118
- package/payload/server/public/assets/channel-dZdJT-Ou.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-CP8AWLB9.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-bUe6tAo9.js +0 -1
- package/payload/server/public/assets/clone-gXHQCPU0.js +0 -1
- package/payload/server/public/assets/data-Bt6BTjvP.js +0 -1
- package/payload/server/public/assets/graph-labels-BeDsoEVY.js +0 -1
- package/payload/server/public/assets/graph-szVcmw8D.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CvKXSO97.js +0 -1
- /package/payload/server/public/assets/{ChatInput-AR8ym-HW.js → ChatInput-DoS80kaC.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{it as e,rt as t}from"./chunk-ICPOFSXX-D5pWrJcN.js";var n=(n,r)=>e.lang.round(t.parse(n)[r]);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-B6XdH6xq.js";import"./chunk-ICPOFSXX-D5pWrJcN.js";import"./dist-Bd4S37oi.js";import"./chunk-5PVQY5BW-64laDovl.js";import"./chunk-U2HBQHQK-Brql314T.js";import"./chunk-FMBD7UC4-w-yBZsN2.js";import"./chunk-BSJP7CBP-DP7LTBll.js";import"./chunk-ZZ45TVLE-DyHGASIn.js";import"./chunk-YZCP3GAM-G4idHEoZ.js";import"./chunk-55IACEB6-BRJOZLpU.js";import"./chunk-EDXVE4YY-dClAHBNd.js";import"./chunk-X2U36JSP-C-79tMym.js";import"./chunk-5FUZZQ4R-BFMrOiNe.js";import"./chunk-ENJZ2VHE-Bz4gXG1p.js";import"./chunk-336JU56O-Bz-tPZhS.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-DfZRQtaZ.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-B6XdH6xq.js";import"./chunk-ICPOFSXX-D5pWrJcN.js";import"./dist-Bd4S37oi.js";import"./chunk-5PVQY5BW-64laDovl.js";import"./chunk-U2HBQHQK-Brql314T.js";import"./chunk-FMBD7UC4-w-yBZsN2.js";import"./chunk-BSJP7CBP-DP7LTBll.js";import"./chunk-ZZ45TVLE-DyHGASIn.js";import"./chunk-YZCP3GAM-G4idHEoZ.js";import"./chunk-55IACEB6-BRJOZLpU.js";import"./chunk-EDXVE4YY-dClAHBNd.js";import"./chunk-X2U36JSP-C-79tMym.js";import"./chunk-5FUZZQ4R-BFMrOiNe.js";import"./chunk-ENJZ2VHE-Bz4gXG1p.js";import"./chunk-336JU56O-Bz-tPZhS.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-DfZRQtaZ.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./graphlib-B2ezMQY4.js";var t=4;function n(n){return e(n,t)}export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,y as t}from"./ChatInput-AR8ym-HW.js";import"./graph-labels-BeDsoEVY.js";import{t as n}from"./page-BnBmdRbo.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DD-I1_y5.js";import{_ as t,a as n,c as r,d as i,f as a,g as o,h as s,m as c,p as l,r as u,t as d,u as f,v as p,x as m}from"./ChatInput-AR8ym-HW.js";var h=p(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),g=p(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),_=p(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),v=p(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),y=p(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),b=p(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),x=p(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),S=p(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),C=p(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),w=p(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),T=p(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),E=p(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),D=p(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),O=p(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),k=p(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),ee=p(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),A=p(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),j=p(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),M=p(`handshake`,[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]),N=p(`headset`,[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]),P=p(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),F=p(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),I=p(`linkedin`,[[`path`,{d:`M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z`,key:`c2jq9f`}],[`rect`,{width:`4`,height:`12`,x:`2`,y:`9`,key:`mk3on5`}],[`circle`,{cx:`4`,cy:`4`,r:`2`,key:`bt5ra8`}]]),te=p(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),L=p(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ne=p(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),R=p(`magnet`,[[`path`,{d:`m12 15 4 4`,key:`lnac28`}],[`path`,{d:`M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z`,key:`nlhkjb`}],[`path`,{d:`m5 8 4 4`,key:`j6kj7e`}]]),re=p(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),z=p(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ie=p(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),ae=p(`microscope`,[[`path`,{d:`M6 18h8`,key:`1borvv`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M14 22a7 7 0 1 0 0-14h-1`,key:`1jwaiy`}],[`path`,{d:`M9 14h2`,key:`197e7h`}],[`path`,{d:`M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z`,key:`1bmzmy`}],[`path`,{d:`M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3`,key:`1drr47`}]]),B=p(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),oe=p(`newspaper`,[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]),se=p(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),V=p(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),ce=p(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),le=p(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ue=p(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),de=p(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),fe=p(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),pe=p(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),H=p(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),me=p(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),he=p(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ge=p(`store`,[[`path`,{d:`M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5`,key:`slp6dd`}],[`path`,{d:`M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244`,key:`o0xfot`}],[`path`,{d:`M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05`,key:`wn3emo`}]]),_e=p(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ve=p(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),U=p(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ye=p(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),be=p(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),W=p(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),G=e(m(),1),K=i(),q=`maxy-shell-side-px`;function xe(){if(typeof window>`u`)return 0;let e=document.querySelector(`.platform > .artefact`)?.getBoundingClientRect();return e&&e.width>0?Math.round(e.width):0}function J(e){if(typeof window>`u`)return e;let t=window.innerWidth,n=Math.max(248,t-480-xe());return Math.min(Math.max(e,248),n)}function Se(){if(typeof window>`u`)return 264;try{let e=window.localStorage.getItem(q);if(!e)return 264;let t=parseInt(e,10);if(Number.isFinite(t)&&t>=248)return J(t)}catch{}return 264}function Ce({targetSelector:e=`.platform`}){let t=(0,G.useRef)(null),[n,r]=(0,G.useState)(()=>Se()),i=(0,G.useRef)(n);(0,G.useEffect)(()=>{let t=document.querySelector(e);!t||!(t instanceof HTMLElement)||(t.style.setProperty(`--side-px`,`${n}px`),i.current=n)},[n,e]);let a=(0,G.useCallback)(()=>{r(e=>{let t=J(e);return t===e?e:t})},[]);(0,G.useEffect)(()=>{a(),window.addEventListener(`resize`,a);let t=document.querySelector(e),n=null;return t instanceof HTMLElement&&(n=new MutationObserver(a),n.observe(t,{attributes:!0,attributeFilter:[`data-artefact`,`class`]})),()=>{window.removeEventListener(`resize`,a),n?.disconnect()}},[a,e]);let o=e=>{e.preventDefault();let n=t.current;if(!n)return;n.setPointerCapture(e.pointerId),n.classList.add(`dragging`);let a=!1,o=e=>{a=!0,r(J(Math.round(e.clientX)))},s=()=>{if(n.releasePointerCapture(e.pointerId),n.classList.remove(`dragging`),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),!a)return;let t=i.current;try{window.localStorage.setItem(q,String(t))}catch{}console.info(`[admin-ui] sidebar-resize px=${t}`)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)},s=()=>{let e=J(264);r(e);try{window.localStorage.removeItem(q)}catch{}console.info(`[admin-ui] sidebar-resize px=${e}`)};return(0,K.jsx)(`div`,{ref:t,className:`side-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onPointerDown:o,onDoubleClick:s})}var we=!1;function Te(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Y(){let e=typeof crypto<`u`&&typeof crypto.randomUUID==`function`;if(!we){we=!0;let t=typeof window<`u`&&`isSecureContext`in window?window.isSecureContext:!1;console.info(`[idempotency] uuid-source=${e?`native`:`getRandomValues`} secureContext=${t}`)}return e?crypto.randomUUID():Te()}function X(e,t,n,r){let i=e===`pane`?`pane-action`:`sidebar-${t}`;console.info(`[admin-ui] ${i} sessionId=${n.slice(0,8)} action=${t} outcome=${r}`)}var Ee=/session_([A-Za-z0-9_-]+)/;function De(e){if(!e)return null;let t=e.match(Ee);return t?t[1]:null}async function Oe(e,t,n,r,i){let a=De(r)??`unknown`,o=e=>e.slice(0,8),s=t===`pane`?`pane-action action=resume-archive`:`sidebar-resume-archive`,c;try{let t=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(n)}/archive?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:`archive`})});c=t.ok?`ok`:t.status===409?`409`:`error`;let r=`[admin-ui] ${s} sourceSessionId=${o(n)} newSessionId=${o(a)} result=${c}`;c===`error`?console.error(r):console.info(r)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[admin-ui] ${s} sourceSessionId=${o(n)} newSessionId=${o(a)} result=error detail=${t}`)}finally{i.refetch()}}function ke(e,t,n=`pane`){let[r,i]=(0,G.useState)(null),a=(0,G.useRef)(!1),o=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};if(a.current)return X(n,`resume`,r,`skipped-in-flight`),{ok:!1,error:`in-flight`};a.current=!0,i(`resume`);let o=Y();try{let i=await fetch(`/api/admin/claude-sessions/resume?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sessionId:r,channel:`browser`,idempotencyKey:o})}),a=await i.json();if(!i.ok||!(`sessionId`in a)){let e=a.error??`POST returned ${i.status}`;return X(n,`resume`,r,String(i.status)),{ok:!1,error:e}}return t.setSessions(e=>[a,...e.filter(e=>e.sessionId!==r)]),X(n,`resume`,r,`200`),Oe(e,n,r,a.url,t),{ok:!0}}catch(e){let i=e instanceof Error?e.message:String(e);return X(n,`resume`,r,`threw`),t.refetch(),{ok:!1,error:i}}finally{a.current=!1,i(null)}},[e,t,n]),s=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};i(`end`);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}/stop?session_key=${encodeURIComponent(e)}`,{method:`POST`});if(!i.ok){let e=await i.text().catch(()=>``);return X(n,`end`,r,String(i.status)),t.refetch(),{ok:!1,error:`POST /stop ${i.status} ${e.slice(0,200)}`}}return X(n,`end`,r,`204`),t.refetch(),{ok:!0}}catch(e){let i=e instanceof Error?e.message:String(e);return X(n,`end`,r,`threw`),t.refetch(),{ok:!1,error:i}}finally{i(null)}},[e,t,n]),c=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};i(`purge`);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}?purge=1&session_key=${encodeURIComponent(e)}`,{method:`DELETE`});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.detail||e.error||`DELETE ?purge=1 ${i.status}`;return X(n,`purge`,r,String(i.status)),{ok:!1,error:t}}return t.setSessions(e=>e.filter(e=>e.sessionId!==r)),X(n,`purge`,r,`200`),t.refetch(),{ok:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return X(n,`purge`,r,`threw`),{ok:!1,error:t}}finally{i(null)}},[e,t,n]),l=(0,G.useCallback)(async(r,a)=>{if(!e)return{ok:!1,error:`no-cache-key`};i(a);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}/archive?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:a})});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.detail||e.error||`POST /archive ${i.status}`;return X(n,a,r,String(i.status)),{ok:!1,error:t}}return a===`archive`&&t.setSessions(e=>e.filter(e=>e.sessionId!==r)),t.refetch(),X(n,a,r,`200`),{ok:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return X(n,a,r,`threw`),{ok:!1,error:t}}finally{i(null)}},[e,t,n]);return{inFlight:r,resume:o,end:s,purge:c,archive:(0,G.useCallback)(e=>l(e,`archive`),[l]),unarchive:(0,G.useCallback)(e=>l(e,`unarchive`),[l])}}function Ae(e){return`code.session.pinned.${e}`}function je(e){if(typeof window>`u`)return new Set;try{let t=window.localStorage.getItem(Ae(e));if(!t)return new Set;let n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function Me(e,t){if(!(typeof window>`u`))try{window.localStorage.setItem(Ae(e),JSON.stringify([...t]))}catch{}}function Ne(e){let[t,n]=(0,G.useState)(()=>je(e));(0,G.useEffect)(()=>{n(je(e))},[e]);let r=(0,G.useCallback)(t=>{n(n=>{let r=new Set(n);return r.has(t)?r.delete(t):r.add(t),Me(e,r),r})},[e]);return{pinned:t,isPinned:(0,G.useCallback)(e=>t.has(e),[t]),togglePin:r}}function Z(e){let{businessName:i,onLaunchBrowser:o,onNavigate:s,onToggleSidebar:l,sidebarOpen:u,onLogout:d,browserLaunching:f}=e,[p,m]=(0,G.useState)(!1),h=(0,G.useRef)(null),g=(0,G.useRef)(null),[_,v]=(0,G.useState)(null),[y,b]=(0,G.useState)(!1),[x,S]=(0,G.useState)(null),[C,w]=(0,G.useState)(null),[T,D]=(0,G.useState)(null),[k,ee]=(0,G.useState)(``);(0,G.useEffect)(()=>{ee(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]),(0,G.useEffect)(()=>{if(!p)return;let e=e=>{h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[p]),(0,G.useEffect)(()=>{if(!p)return;let e=e=>{e.key===`Escape`&&m(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p]),(0,G.useEffect)(()=>{p&&g.current?.focus()},[p]),(0,G.useEffect)(()=>{if(!p)return;let e=!1;return fetch(`/api/admin/version`).then(e=>e.json()).then(t=>{e||D(t)}).catch(e=>{console.error(`[admin/version] menu-open client fetch failed:`,e)}),()=>{e=!0}},[p]);let A=(0,G.useCallback)(()=>{m(e=>{let t=!e;return t&&console.info(`[admin-ui] header-menu-open`),t})},[]),j=(0,G.useCallback)(()=>{m(!1),o()},[o]),M=(0,G.useCallback)(e=>{m(!1),s(e)},[s]),N=(0,G.useCallback)(async()=>{if(_!==null){v(null),w(null);return}b(!0),S(null);try{let e=await fetch(`/api/admin/agents`);if(!e.ok)throw Error(`Failed to load agents`);v((await e.json()).agents??[])}catch(e){console.error(`[admin/agents] list failed:`,e),S(e instanceof Error?e.message:String(e)),v([])}finally{b(!1)}},[_]),P=(0,G.useCallback)(e=>{w(null),v(t=>t?.filter(t=>t.slug!==e)??null),fetch(`/api/admin/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(e=>console.error(`[admin/agents] delete failed:`,e))},[]),I=(0,G.useCallback)(()=>{m(!1),d()},[d]),te=i||n.productName;return(0,K.jsxs)(`header`,{className:`admin-header`,children:[(0,K.jsx)(`button`,{type:`button`,className:`admin-sidebar-toggle`,"aria-label":u?`Hide sidebar`:`Show sidebar`,title:u?`Hide sidebar`:`Show sidebar`,"aria-expanded":u,onClick:l,children:u?(0,K.jsx)(se,{size:20,strokeWidth:1.5}):(0,K.jsx)(V,{size:20,strokeWidth:1.5})}),(0,K.jsxs)(`div`,{className:`chat-header-label`,children:[(0,K.jsx)(`span`,{className:`chat-logo-btn`,"aria-hidden":`true`,children:(0,K.jsx)(`img`,{src:r,alt:``,className:`chat-logo`})}),(0,K.jsx)(`h1`,{className:`chat-tagline`,children:te})]}),(0,K.jsxs)(`div`,{className:`chat-burger-wrap`,ref:h,children:[(0,K.jsx)(`button`,{type:`button`,className:`admin-burger`,onClick:A,"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":p,children:(0,K.jsx)(z,{size:20})}),p&&(0,K.jsxs)(`div`,{className:`admin-menu`,role:`menu`,children:[(0,K.jsxs)(`button`,{ref:g,type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:j,disabled:f,children:[(0,K.jsx)(c,{size:14}),` Browser`,f&&(0,K.jsx)(L,{size:12,className:`spin`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>M(`data`),children:[(0,K.jsx)(E,{size:14}),` Data`]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>M(`graph`),children:[(0,K.jsx)(H,{size:14}),` Graph`]}),(0,K.jsx)(`div`,{className:`chat-menu-divider`}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:N,children:[(0,K.jsx)(O,{size:14}),` Public`,y&&(0,K.jsx)(L,{size:12,className:`spin`})]}),_!==null&&(0,K.jsxs)(`div`,{className:`chat-menu-agents`,children:[x&&(0,K.jsx)(`span`,{className:`chat-menu-agent-error`,children:x}),_.length===0&&!x&&(0,K.jsx)(`span`,{className:`chat-menu-agent-empty`,children:`No public agents configured`}),_.map(e=>(0,K.jsxs)(`div`,{className:`chat-menu-item chat-menu-agent-item`,children:[(0,K.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),(0,K.jsxs)(`span`,{className:`agent-text`,children:[(0,K.jsx)(`span`,{className:`agent-display-name`,children:e.displayName}),(0,K.jsxs)(`span`,{className:`agent-slug`,children:[`/`,e.slug]})]}),C===e.slug?(0,K.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm delete`,onClick:()=>P(e.slug),children:(0,K.jsx)(t,{size:12})}),(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel`,onClick:()=>w(null),children:(0,K.jsx)(W,{size:12})})]}):(0,K.jsxs)(`span`,{className:`agent-actions`,children:[(0,K.jsx)(`a`,{href:`${k}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`agent-action-btn`,title:`Open agent`,onClick:()=>m(!1),children:(0,K.jsx)(O,{size:12})}),(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-delete-btn`,title:`Delete agent`,onClick:()=>w(e.slug),children:(0,K.jsx)(a,{size:12})})]})]},e.slug))]}),(0,K.jsx)(`div`,{className:`chat-menu-divider`}),(0,K.jsxs)(`div`,{className:`chat-menu-version chat-menu-version-passive`,children:[(0,K.jsx)(F,{size:14}),(0,K.jsxs)(`span`,{className:`version-installed`,children:[T?`v${T.installed}`:`…`,T&&!T.updateAvailable&&(0,K.jsx)(`span`,{className:`version-uptodate-dot`}),T?.updateAvailable&&(0,K.jsx)(`span`,{className:`version-update-dot`})]})]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:I,children:[(0,K.jsx)(ne,{size:14}),` Log out`]})]})]})]})}var Pe=Object.freeze({admin:N,"business-assistant":y,cloudflare:w,contacts:be,"deep-research":fe,docs:s,email:re,"linkedin-import":I,memory:v,outlook:re,projects:ee,replicate:me,sales:D,scheduling:x,tasks:te,telegram:pe,waitlist:C,whatsapp:ie,workflows:A,teaching:j,"writer-craft":k,brochures:oe,"real-agent-buyers":ye,"real-agent-business":b,"real-agent-coaching":ve,"real-agent-leads":R,"real-agent-listings":P,"real-agent-loop":de,"real-agent-sales":M,"real-agent-teaching":j,"real-agent-vendors":ge,"content-producer":ce,"database-operator":E,librarian:h,"personal-assistant":U,"project-manager":S,"research-assistant":ae}),Fe=new Set;function Ie(e){return Pe[e]||(Fe.has(e)||(Fe.add(e),console.warn(`[admin-ui] sidebar-agent-icon-fallback label=${e}`)),g)}var Le=`maxy-admin-session`,Re=typeof BroadcastChannel<`u`;function ze(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`rotation`&&typeof t.newKey==`string`&&t.newKey.length>0&&(t.surface===`chat`||t.surface===`graph`||t.surface===`data`||t.surface===`sessions`)&&typeof t.ts==`number`}function Be(e){if(!Re)return()=>{};let t=new BroadcastChannel(Le),n=t=>{if(!ze(t.data)){console.warn(`[admin-session-broadcast] outcome=received-malformed payload=${JSON.stringify(t.data)}`);return}e(t.data)};return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),t.close()}}var Ve=`maxy-admin-session-key`;function Q(e,t){return`${e}${e.includes(`?`)?`&`:`?`}session_key=${encodeURIComponent(t)}`}async function He(e){let t;try{t=await e.clone().json()}catch{return`parse-failed`}if(typeof t!=`object`||!t)return`unknown-401`;let n=t.code;return n===`session-missing`||n===`session-not-registered`||n===`session-expired-age`||n===`grant-expired`?n:`unknown-401`}function Ue(){try{return sessionStorage.getItem(Ve)}catch{return null}}function We(e){let{initialCacheKey:t,surface:n}=e,[r,i]=(0,G.useState)(t),a=(0,G.useRef)(t);(0,G.useEffect)(()=>{a.current=r},[r]),(0,G.useEffect)(()=>{t!==a.current&&(i(t),a.current=t,s(e=>e+1))},[t]);let[o,s]=(0,G.useState)(0),[c,l]=(0,G.useState)(null);(0,G.useEffect)(()=>Be(e=>{let t=a.current.slice(0,8),r=e.newKey.slice(0,8);e.newKey!==a.current&&(console.log(`[admin-session-broadcast] outcome=received oldKey=${t} newKey=${r} surface=${n} senderSurface=${e.surface}`),i(e.newKey),s(e=>e+1),l(null))}),[n]);let u=(0,G.useCallback)(()=>{try{sessionStorage.removeItem(Ve)}catch{}window.location.href=`/`},[]);return{adminFetch:(0,G.useCallback)(async(e,t)=>{let r=a.current,o=Q(e,r),c=await fetch(o,t);if(c.status!==401)return c;let d=await He(c);if(d===`session-missing`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),u(),c;if(d!==`session-not-registered`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:d}),c;let f=Ue();if(!f||f===r)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=session-not-registered-no-fresh-key surface=${n} path=${e}`),l({message:`Your admin session was renewed in another tab. Click to reload.`,reason:`session-not-registered`}),c;i(f),a.current=f,s(e=>e+1),console.log(`[useAdminFetch] outcome=retry-after-rotation oldKey=${r.slice(0,8)} newKey=${f.slice(0,8)} surface=${n} path=${e}`);let p=Q(e,f),m=await fetch(p,t);return m.status===401&&(console.warn(`[useAdminFetch] outcome=redirect-to-login reason=second-401-after-retry surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:`session-not-registered`})),m},[u,n]),cacheKey:r,sessionRefetchNonce:o,banner:c,reloadToLogin:u}}var Ge=`/api/admin/claude-sessions/events`,Ke=`admin-session-list-view`,qe=`admin-session-list-include-subagents`,Je=`admin-session-list-include-background`;function Ye(e){return e===`active`||e===`archived`||e===`all`}function Xe(){let e={rows:[],view:`active`,includeBackground:!1,connected:!1},t=new Map,n=new Set,r=null,i=null,a=0,o=0,s=null,c=!1,l=!1;function u(){let n=[...t.values()].sort((e,t)=>t.updatedAt===e.updatedAt?e.sessionId<t.sessionId?-1:1:t.updatedAt-e.updatedAt);e={...e,rows:n}}function d(){for(let e of n)e()}function f(e,n){if(e===`row-removed`){let e=n?.sessionId;if(typeof e!=`string`||!t.delete(e))return;u(),d();return}let r=n;if(typeof r.sessionId!=`string`)return;let i={sessionId:r.sessionId,live:r.live===!0,status:r.status===`busy`?`busy`:r.status===`idle`?`idle`:`gone`,agentLabel:typeof r.agentLabel==`string`&&r.agentLabel.length>0?r.agentLabel:null,cwd:typeof r.cwd==`string`?r.cwd:null,firstPrompt:typeof r.firstPrompt==`string`&&r.firstPrompt.length>0?r.firstPrompt:null,updatedAt:typeof r.updatedAt==`number`?r.updatedAt:0,url:typeof r.url==`string`&&r.url.length>0?r.url:null};t.set(i.sessionId,i),u(),d()}function p(t){if(r&&s===t||(r&&=(r.close(),null),!t))return;s=t,c=!1,l=!1;let n=Q(Ge,t);try{r=new EventSource(n)}catch(e){console.error(`[admin-ui] session-row-store EventSource construct failed:`,e),h(`auto`);return}r.addEventListener(`open`,()=>{c=!0,a=0,e={...e,connected:!0},d(),console.info(`[admin-ui] session-row-store connected events-received=${o}`)});for(let e of[`row-created`,`row-updated`,`row-archived`,`row-removed`])r.addEventListener(e,t=>{o+=1;try{f(e,JSON.parse(t.data))}catch(t){console.error(`[admin-ui] session-row-store parse failed kind=${e}:`,t)}});r.addEventListener(`error`,()=>{r&&=(r.close(),null),e={...e,connected:!1},d(),!c&&!l&&(l=!0,m(n)),h(`auto`)})}async function m(e){let t=a+1,n=0,r=`unknown`;try{let t=await fetch(e,{method:`GET`});n=t.status,r=t.status>=400&&t.status<500?await He(t):`unknown`}catch(e){console.error(`[admin-ui] session-row-store sse-error-probe-failed:`,e);return}console.error(`[admin-ui] session-row-store sse-error status=${n} code=${r} attempt=${t}`)}function h(e){if(i)return;a+=1;let t=Math.min(1e3*2**Math.min(a,5),3e4);console.info(`[admin-ui] session-row-store reconnect trigger=${e} attempt=${a} delay-ms=${t}`),i=setTimeout(()=>{i=null,s&&p(s)},t)}function g(){i&&=(clearTimeout(i),null),a=0,r&&=(r.close(),null),console.info(`[admin-ui] session-row-store reconnect trigger=manual attempt=0 delay-ms=0`),s&&p(s)}function _(){if(!(typeof window>`u`))try{let t=window.localStorage.getItem(Ke);Ye(t)&&(e={...e,view:t});let n=window.localStorage.getItem(qe);if(n===null){let e=window.localStorage.getItem(Je);e!==null&&(window.localStorage.setItem(qe,e),window.localStorage.removeItem(Je),n=e,console.info(`[admin-ui] session-list-storage-migrated from=${Je} to=${qe} value=${e}`))}n===`1`&&(e={...e,includeBackground:!0})}catch{}}function v(t){e={...e,view:t};try{window.localStorage.setItem(Ke,t)}catch{}d()}function y(t){e={...e,includeBackground:t};try{window.localStorage.setItem(qe,t?`1`:`0`)}catch{}d()}function b(e){return n.add(e),()=>{n.delete(e)}}function x(){return e}function S(){r&&=(r.close(),null),i&&=(clearTimeout(i),null),s=null,e={...e,connected:!1}}function C(e,t){f(e,t)}function w(t){e={...e,connected:t},d()}function T(){t.clear(),u(),d()}function E(e){let n=new Set(e),r=0;for(let e of[...t.keys()])n.has(e)||(t.delete(e),r+=1);r!==0&&(console.info(`[admin-ui] session-row-store reconcile evicted=${r} kept=${t.size}`),u(),d())}return _(),{subscribe:b,getSnapshot:x,connect:p,disconnect:S,setView:v,setIncludeBackground:y,reconnectNow:g,reconcileFromList:E,_injectEventForTesting:C,_setConnectedForTesting:w,_clearRowsForTesting:T}}var $=Xe();$._injectEventForTesting,$.connect,$._setConnectedForTesting,$.getSnapshot,$.reconcileFromList;function Ze(e){let t=(0,G.useSyncExternalStore)($.subscribe,$.getSnapshot,$.getSnapshot);(0,G.useEffect)(()=>{e&&$.connect(e)},[e]);let n=(0,G.useCallback)(e=>$.setView(e),[]),r=(0,G.useCallback)(e=>$.setIncludeBackground(e),[]),i=(0,G.useCallback)(()=>$.reconnectNow(),[]),a=(0,G.useCallback)(e=>$.reconcileFromList(e),[]);return{rows:t.rows,view:t.view,includeBackground:t.includeBackground,connected:t.connected,setView:n,setIncludeBackground:r,reconnectNow:i,reconcileFromList:a}}function Qe(e,t,n){return e.filter(e=>!(t===`active`&&!e.live||t===`archived`&&e.live||!n&&e.agentLabel!==null&&e.agentLabel!==`admin`))}var $e=6e4,et=60*$e,tt=24*et,nt=$e,rt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],it=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function at(e){return e<10?`0${e}`:String(e)}function ot(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function st(e,t){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t))return`—`;let n=t-e;if(n<-nt)return`—`;let r=n<0?0:n;if(r<$e)return`just now`;if(r<et)return`${Math.floor(r/$e)}m`;if(r<tt)return`${Math.floor(r/et)}h`;let i=new Date(t),a=new Date(e),o=Math.round((ot(i)-ot(a))/tt);if(o===1)return`yesterday`;if(o>=2&&o<=6)return it[a.getDay()];let s=at(a.getDate()),c=rt[a.getMonth()];return a.getFullYear()===i.getFullYear()?`${s} ${c}`:`${s} ${c} ${a.getFullYear()}`}function ct(e=3e4){let[t,n]=(0,G.useState)(()=>Date.now());return(0,G.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var lt={default:`Ask`,acceptEdits:`Accept edits`,plan:`Plan`,auto:`Auto`,bypassPermissions:`Bypass permissions`},ut=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`],dt=[{value:void 0,label:`Default`},{value:`claude-opus-4-7`,label:`Opus 4.7`},{value:`claude-sonnet-4-6`,label:`Sonnet 4.6`},{value:`claude-haiku-4-5`,label:`Haiku 4.5`}];function ft({seedMode:e,submitting:n,error:r,onSubmit:i,onCancel:a,onErrorClear:s}){let[c,l]=(0,G.useState)(``),[u,f]=(0,G.useState)(e),[p,m]=(0,G.useState)(void 0),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=(0,G.useRef)(null),x=(0,G.useRef)(null);(0,G.useEffect)(()=>{y.current?.focus()},[]),(0,G.useEffect)(()=>{function e(e){if(e.key===`Escape`){if(h){g(!1),e.stopPropagation();return}if(_){v(!1),e.stopPropagation();return}a(`esc`)}}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[h,_,a]),(0,G.useEffect)(()=>{if(!h&&!_)return;function e(e){h&&b.current&&!b.current.contains(e.target)&&g(!1),_&&x.current&&!x.current.contains(e.target)&&v(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[h,_]);let S=c.trim(),C=S.length>0&&!n,w=(0,G.useCallback)(()=>{S.length===0||n||i({message:c,permissionMode:u,model:p})},[c,u,p,S,n,i]);function E(e){e.preventDefault(),w()}let D=dt.find(e=>e.value===p)?.label??`Default`;return(0,K.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`new-session-modal-title`,className:`new-session-modal-overlay`,onClick:e=>{e.target===e.currentTarget&&a(`backdrop`)},children:(0,K.jsxs)(`div`,{className:`new-session-modal`,children:[(0,K.jsx)(`h2`,{id:`new-session-modal-title`,className:`new-session-modal-title`,children:`New session`}),(0,K.jsxs)(`form`,{className:`new-session-modal-form`,onSubmit:E,children:[(0,K.jsx)(`div`,{className:`chat-form`,children:(0,K.jsx)(d,{ref:y,value:c,onChange:e=>{l(e),r&&s()},placeholder:`What should this session do?`,disabled:n})}),r&&(0,K.jsx)(`div`,{className:`tunnel-route__error`,role:`alert`,children:r}),(0,K.jsxs)(`div`,{className:`new-session-modal-actions`,children:[(0,K.jsxs)(`div`,{className:`new-session-modal-pickers`,children:[(0,K.jsxs)(`div`,{className:`new-session-modal-picker-wrap`,ref:b,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!h;console.info(`[admin-ui] new-session-modal-mode-picker action=${e?`open`:`close`} current=${u}`),g(e)},disabled:n,"aria-haspopup":`menu`,"aria-expanded":h,"aria-label":`Permission mode for this session`,children:[lt[u],(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),h&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Mode`,children:[(0,K.jsx)(`div`,{className:`side-mode-popover-head`,children:(0,K.jsx)(`span`,{children:`Mode`})}),ut.map((e,n)=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] new-session-modal-mode-change from=${u} to=${e} trigger=click`),f(e),g(!1)},children:[(0,K.jsx)(`span`,{children:lt[e]}),(0,K.jsxs)(`span`,{className:`side-mode-popover-shortcut`,children:[e===u&&(0,K.jsx)(t,{size:12}),(0,K.jsx)(`span`,{children:n+1})]})]},e))]})]}),(0,K.jsxs)(`div`,{className:`new-session-modal-picker-wrap`,ref:x,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!_;console.info(`[admin-ui] new-session-modal-model-picker action=${e?`open`:`close`} current=${p??`default`}`),v(e)},disabled:n,"aria-haspopup":`menu`,"aria-expanded":_,"aria-label":`Model for this session`,children:[D,(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),_&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Model`,children:[(0,K.jsx)(`div`,{className:`side-mode-popover-head`,children:(0,K.jsx)(`span`,{children:`Model`})}),dt.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] new-session-modal-model-change from=${p??`default`} to=${e.value??`default`} trigger=click`),m(e.value),v(!1)},children:[(0,K.jsx)(`span`,{children:e.label}),(0,K.jsx)(`span`,{className:`side-mode-popover-shortcut`,children:e.value===p&&(0,K.jsx)(t,{size:12})})]},e.label))]})]})]}),(0,K.jsxs)(`div`,{className:`new-session-modal-buttons`,children:[(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,onClick:()=>a(`button`),disabled:n,children:`Cancel`}),(0,K.jsx)(`button`,{type:`submit`,className:`new-session-modal-submit`,disabled:!C,"aria-label":`Send`,children:n?(0,K.jsx)(L,{size:14,className:`spinning`}):(0,K.jsx)(T,{size:14})})]})]})]})]})})}var pt=(0,G.forwardRef)(function(e,r){let{businessName:i,cacheKey:c,role:u,userName:d,userAvatar:f,sessions:p,sessionsLoading:m,sessionsError:h,ensureSessionsLoaded:v,refetchSessions:y,onSelectArtefact:b,onSelectProjects:x,onSelectPeople:S,onSelectTasks:C,onSelectAgents:w,onCloseMobileDrawer:T,onSelectSession:E,selectedSessionId:D,collapsed:k,mobileDrawerOpen:ee,recentsActions:A}=e,[j,M]=(0,G.useState)(null),[N,P]=(0,G.useState)(null),[F,I]=(0,G.useState)(!1);(0,G.useEffect)(()=>{v()},[v]);let ne=(0,G.useRef)(null),[R,re]=(0,G.useState)(!1),[z,ie]=(0,G.useState)(`default`),[ae,B]=(0,G.useState)(null),[oe,se]=(0,G.useState)(!1),V=(0,G.useRef)(0),ce=n.productName,de=typeof d==`string`?d:d===null?`name unavailable`:i||ce,fe=(de.trim().charAt(0)||`?`).toUpperCase(),pe=Ne(n.hostname),H=Ze(c),me=(0,G.useMemo)(()=>{let e=Qe(H.rows,H.view,H.includeBackground);if(pe.pinned.size===0)return e;let t=[],n=[];for(let r of e)(pe.pinned.has(r.sessionId)?t:n).push(r);return[...t,...n]},[H.rows,H.view,H.includeBackground,pe.pinned]),ge=me.length,ve=ct(3e4),[U,ye]=(0,G.useState)(`chat`),[W,q]=(0,G.useState)([]),[xe,J]=(0,G.useState)(!1),[Se,Ce]=(0,G.useState)(null),[we,Te]=(0,G.useState)(!1);(0,G.useImperativeHandle)(r,()=>({patchArtefact(e,t){q(n=>n.map(n=>n.id===e?{...n,...t}:n))}}),[]);let[Y,X]=(0,G.useState)(!1),Ee=(0,G.useRef)(null),De={default:`Ask`,acceptEdits:`Accept edits`,plan:`Plan`,auto:`Auto`,bypassPermissions:`Bypass permissions`},Oe=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`];(0,G.useEffect)(()=>{if(!Y)return;function e(e){Ee.current&&!Ee.current.contains(e.target)&&(console.info(`[admin-ui] sidebar-mode-picker action=close mode=${z}`),X(!1))}function t(e){if(e.key===`Escape`){console.info(`[admin-ui] sidebar-mode-picker action=close mode=${z}`),X(!1);return}let t=[`1`,`2`,`3`,`4`,`5`].indexOf(e.key);if(t>=0&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let n=Oe[t];n&&(e.preventDefault(),console.info(`[admin-ui] sidebar-mode-picker action=select mode=${n} via=shortcut`),ie(n),X(!1))}}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[Y,z]),(0,G.useEffect)(()=>{function e(e){e.shiftKey&&(e.metaKey||e.ctrlKey)&&(e.key===`m`||e.key===`M`)&&(e.preventDefault(),X(e=>{let t=!e;return console.info(`[admin-ui] sidebar-mode-picker action=${t?`open`:`close`} mode=${z} via=shortcut`),t}))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[z]);let Ae=(0,G.useCallback)(async()=>{if(c){Te(!0),Ce(null);try{let e=await fetch(`/api/admin/sidebar-artefacts?session_key=${encodeURIComponent(c)}`);if(!e.ok)throw Error(`status ${e.status}`);q((await e.json()).artefacts??[]),J(!0)}catch(e){let t=e instanceof Error?e.message:String(e);Ce(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{Te(!1)}}},[c]),je=()=>{ye(`chat`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${ge}`)},Me=()=>{ye(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${xe?W.length:0} collapsed=${k}`),xe||Ae()},Z=1.5,Pe=U===`chat`?`Sessions`:`Artefacts`,Fe=U===`chat`?m?`…`:String(ge):we?`…`:String(W.length),Le=U===`chat`?m:we,Re=()=>{console.info(`[admin-ui] sidebar-refresh surface=${U}`),U===`chat`?y().then(e=>{e!==null&&H.reconcileFromList(e.map(e=>e.sessionId))}):Ae()},ze=(0,G.useCallback)(()=>{if(R||!c){console.info(`[admin-ui] sidebar-new-session-click-ignored startingSession=${R} cacheKey=${c?`set`:`missing`}`);return}B(null),V.current=Date.now(),console.info(`[admin-ui] sidebar-new-session-modal-open seedMode=${z} cacheKey-prefix=${c.slice(0,8)}`),se(!0)},[c,R,z]),Be=(0,G.useCallback)(e=>{let t=V.current?Date.now()-V.current:0;console.info(`[admin-ui] sidebar-new-session-modal-cancel reason=${e} dwell-ms=${t}`),se(!1)},[]),Ve=(0,G.useCallback)(async e=>{if(R||!c)return;let t=V.current?Date.now()-V.current:0,n=Date.now();console.info(`[admin-ui] sidebar-new-session-modal-submit permissionMode=${e.permissionMode} model=${e.model??`default`} messageChars=${e.message.length} dwell-ms=${t}`),re(!0),B(null);try{console.info(`[admin-ui] sidebar-new-session-fetch-start permissionMode=${e.permissionMode} model=${e.model??`default`} messageChars=${e.message.length}`);let t={channel:`browser`,permissionMode:e.permissionMode,initialMessage:e.message};e.model!==void 0&&(t.model=e.model);let r=await fetch(`/api/admin/claude-sessions?session_key=${encodeURIComponent(c)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),i=Date.now()-n;console.info(`[admin-ui] sidebar-new-session-fetch-done status=${r.status} ok=${r.ok} ms=${i}`);let a=await r.json();if(!r.ok||!(`sessionId`in a)){let e=a,t=e.error??`POST returned ${r.status}`,i=e.reason?`${t}: ${e.reason}`:t;console.error(`[admin-ui] sidebar-new-session-failed status=${r.status} ms=${Date.now()-n} error=${t} reason=${e.reason??`none`} tail=${JSON.stringify(e.stderrTail??``)}`),B(i);return}console.info(`[admin-ui] sidebar-new-session-ok pid=${a.pid} sessionId=${a.sessionId.slice(0,8)} permissionMode=${e.permissionMode} model=${e.model??`default`} ms=${Date.now()-n}`),A.setSessions(e=>[a,...e]),se(!1)}catch(e){let t=e instanceof Error?e.message:String(e);B(t),console.error(`[admin-ui] sidebar-new-session-threw ms=${Date.now()-n} message=${t}`)}finally{re(!1)}},[c,R,A]),Q=ke(c,A,`sidebar`),He=(0,G.useCallback)(async e=>{let t=await Q.resume(e);t.ok||console.error(`[admin-ui] sidebar-resume failed: ${t.error}`)},[Q]),Ue=(0,G.useCallback)(async e=>{I(!0),P(null);let t=await Q.purge(e);t.ok?M(null):P(t.error??`purge failed`),I(!1)},[Q]),We=(0,G.useCallback)(async e=>{let t=await Q.end(e);t.ok||console.error(`[admin-ui] sidebar-end-session failed: ${t.error}`)},[Q]);return(0,K.jsxs)(`aside`,{className:`side`,children:[U===`chat`&&(0,K.jsxs)(`div`,{className:`side-new-session-row`,ref:Ee,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-new-session`,onClick:ze,disabled:R||!c,children:[R?(0,K.jsx)(L,{size:14,className:`spinning`}):(0,K.jsx)(le,{size:14}),(0,K.jsx)(`span`,{children:`New session`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!Y;console.info(`[admin-ui] sidebar-mode-picker action=${e?`open`:`close`} mode=${z}`),X(e)},disabled:R,"aria-haspopup":`menu`,"aria-expanded":Y,"aria-label":`Permission mode for the next session`,title:`Shift+Cmd+M`,children:[De[z],(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),Y&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Mode`,children:[(0,K.jsxs)(`div`,{className:`side-mode-popover-head`,children:[(0,K.jsx)(`span`,{children:`Mode`}),(0,K.jsx)(`span`,{className:`side-mode-popover-shortcut`,"aria-hidden":`true`,children:`⇧⌘M`})]}),Oe.map((e,n)=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] sidebar-mode-picker action=select mode=${e}`),ie(e),X(!1)},children:[(0,K.jsx)(`span`,{children:De[e]}),(0,K.jsxs)(`span`,{className:`side-mode-popover-shortcut`,children:[e===z&&(0,K.jsx)(t,{size:12}),(0,K.jsx)(`span`,{children:n+1})]})]},e))]})]}),(0,K.jsxs)(`nav`,{className:`side-nav`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`nav-row${U===`chat`?` active`:``}`,onClick:je,children:[(0,K.jsx)(_e,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=people`),S(),T()},children:[(0,K.jsx)(be,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`People`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=agents`),w(),T()},children:[(0,K.jsx)(g,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Agents`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=projects`),x(),T()},children:[(0,K.jsx)(_,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Projects`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=tasks`),C(),T()},children:[(0,K.jsx)(te,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Tasks`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row${U===`artefacts`?` active`:``}`,onClick:Me,children:[(0,K.jsx)(s,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Artefacts`}),(0,K.jsx)(`span`,{className:`kbd`})]})]}),(0,K.jsxs)(`div`,{className:`side-list`,ref:ne,children:[(0,K.jsxs)(`div`,{className:`group-head`,children:[(0,K.jsx)(`span`,{children:Pe}),(0,K.jsxs)(`span`,{className:`group-head-meta`,children:[(0,K.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh ${Pe.toLowerCase()}`,"aria-label":`Refresh ${Pe.toLowerCase()}`,onClick:Re,disabled:Le,children:(0,K.jsx)(ue,{size:12,className:Le?`spinning`:void 0})}),(0,K.jsx)(`span`,{children:Fe})]})]}),ae&&U===`chat`&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:ae}),U===`chat`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ht,{view:H.view,setView:e=>{console.info(`[admin-ui] sidebar-view-change view=${e}`),H.setView(e)},connected:H.connected,reconnectNow:H.reconnectNow}),h&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:h}),me.map(e=>{let t=D===e.sessionId,n=e.agentLabel??`admin`,r=Ie(n);return(0,K.jsxs)(`div`,{className:`conv${t?` active`:``}`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`conv-name-button`,onClick:()=>{E(e.sessionId),T()},title:`Show metadata`,children:[(0,K.jsxs)(`span`,{className:`conv-name-line`,children:[(0,K.jsx)(_e,{size:12,className:`conv-channel-icon`,"aria-label":`claude session`}),(0,K.jsx)(gt,{live:e.live,status:e.status}),(0,K.jsx)(`span`,{className:`conv-name`,children:e.firstPrompt}),(0,K.jsxs)(`span`,{className:`conv-agent-badge`,"data-kind":e.agentLabel?`specialist`:`admin`,title:n,"aria-label":n,children:[(0,K.jsx)(r,{size:12,className:`conv-agent-icon`,"aria-label":n}),(0,K.jsx)(`span`,{className:`conv-agent-label`,children:n})]})]}),(0,K.jsx)(`span`,{className:`conv-timestamp`,children:st(e.updatedAt,ve)})]}),e.live?(0,K.jsxs)(K.Fragment,{children:[e.url!==null&&(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Open in new tab`,"aria-label":`Open in new tab`,onClick:()=>_t(e.url,e.sessionId),children:(0,K.jsx)(O,{size:13})}),(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`End session`,"aria-label":`End session`,onClick:()=>void We(e.sessionId),children:(0,K.jsx)(he,{size:13})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Resume session`,"aria-label":`Resume session`,onClick:()=>void He(e.sessionId),disabled:Q.inFlight===`resume`,children:(0,K.jsx)(l,{size:13})}),(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Purge JSONL`,"aria-label":`Purge JSONL`,onClick:()=>{P(null),M({sessionId:e.sessionId,displayName:e.firstPrompt})},children:(0,K.jsx)(a,{size:13})})]})]},e.sessionId)})]}),U===`artefacts`&&(0,K.jsxs)(K.Fragment,{children:[Se&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:Se}),xe&&!Se&&W.length===0&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),W.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`conv`,onClick:()=>{b({docId:e.id,name:e.name,content:e.content,editable:e.editable,mimeType:e.mimeType,skipReason:e.skipReason},`sidebar-artefacts`),T()},children:[(0,K.jsx)(`span`,{className:`conv-name`,children:e.name}),(0,K.jsx)(`span`,{className:`conv-kind`,"data-kind":e.kind===`agent-template`?`agent`:`doc`,children:e.kind===`agent-template`?`agent`:`doc`})]},e.id))]})]}),(0,K.jsxs)(`div`,{className:`side-foot`,children:[(0,K.jsx)(`div`,{className:`avatar`,children:f?(0,K.jsx)(`img`,{src:f,alt:de}):fe}),(0,K.jsxs)(`div`,{className:`who`,children:[(0,K.jsx)(`span`,{className:`name`,children:de}),(0,K.jsx)(`span`,{className:`role`,children:u??`operator`})]})]}),oe&&(0,K.jsx)(ft,{seedMode:z,submitting:R,error:ae,onSubmit:e=>void Ve(e),onCancel:Be,onErrorClear:()=>B(null)}),j&&(0,K.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`purge-confirm-title`,className:`modal-overlay`,onClick:e=>{e.target===e.currentTarget&&!F&&M(null)},children:(0,K.jsxs)(`div`,{className:`modal-card`,children:[(0,K.jsx)(`h3`,{id:`purge-confirm-title`,style:{margin:0,marginBottom:8,fontSize:16,fontWeight:600},children:`Purge session JSONL?`}),(0,K.jsxs)(`p`,{style:{margin:0,marginBottom:8,fontSize:13},children:[`This hard-deletes the transcript for `,(0,K.jsx)(`strong`,{children:j.displayName??j.sessionId.slice(0,8)}),`. The action cannot be undone.`]}),N&&(0,K.jsx)(`p`,{style:{margin:0,marginBottom:8,fontSize:12,color:`var(--text-tertiary)`},children:N}),(0,K.jsxs)(`div`,{className:`modal-action-row`,children:[(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,disabled:F,onClick:()=>M(null),children:`Cancel`}),(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,"data-variant":`danger`,disabled:F,onClick:()=>void Ue(j.sessionId),children:F?(0,K.jsx)(L,{size:13,className:`spinning`}):`Purge`})]})]})})]})}),mt=[{value:`active`,label:`Active`},{value:`archived`,label:`Archived`},{value:`all`,label:`All`}];function ht(e){let{view:t,setView:n,connected:r,reconnectNow:i}=e;return(0,K.jsx)(`div`,{className:`session-view-controls`,children:(0,K.jsxs)(`div`,{className:`session-view-segmented`,role:`tablist`,"aria-label":`Session view`,children:[mt.map(e=>(0,K.jsx)(`button`,{type:`button`,role:`tab`,className:`session-view-tab${t===e.value?` active`:``}`,"aria-selected":t===e.value,onClick:()=>n(e.value),children:e.label},e.value)),r?(0,K.jsx)(`span`,{className:`session-view-connection connected`,"aria-label":`Live updates connected.`,title:`Live updates connected.`}):(0,K.jsx)(`button`,{type:`button`,className:`session-view-connection disconnected`,"aria-label":`Live updates paused. Click to retry.`,title:`Live updates paused. Click to retry.`,onClick:i})]})})}function gt({live:e,status:t}){return e?t===`busy`?(0,K.jsxs)(`span`,{className:`session-status session-status-busy`,"aria-label":`session busy`,children:[(0,K.jsx)(`span`,{className:`session-status-dot`}),(0,K.jsx)(`span`,{className:`session-status-dot`}),(0,K.jsx)(`span`,{className:`session-status-dot`})]}):(0,K.jsx)(`span`,{className:`session-status session-status-idle`,"aria-label":`session idle`}):(0,K.jsx)(`span`,{className:`session-status session-status-archived`,"aria-label":`session archived`})}function _t(e,t){let n=t.slice(0,8),r=window.open(e,`_blank`,`noopener,noreferrer`)===null?`blocked`:`ok`;console.info(`[admin-ui] sidebar-open-in-new-tab outcome=${r} sessionId=${n}`)}function vt(){(0,G.useEffect)(()=>{function e(e){e.data?.type===`vnc-clipboard`&&typeof e.data.text==`string`&&u(e.data.text)}window.addEventListener(`message`,e);let t=null;return typeof BroadcastChannel<`u`&&(t=new BroadcastChannel(`maxy-vnc-clipboard`),t.onmessage=e=>{typeof e.data==`string`&&u(e.data)}),()=>{window.removeEventListener(`message`,e),t?.close()}},[])}function yt({handlePopout:e,disabled:t=!1}){let n=(0,G.useCallback)(()=>{delete document.body.dataset.dragPopoutActive},[]);(0,G.useEffect)(()=>()=>n(),[n]);let r=(0,G.useCallback)(e=>{if(t){e.preventDefault();return}let n=e.target;if(n.closest(`.editor-base__actions`)||n.closest(`.browser-viewer__actions`)){e.preventDefault();return}if(!document.querySelector(`.chat-messages`)){e.preventDefault();return}e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,``),document.body.dataset.dragPopoutActive=`true`},[t,n]),i=(0,G.useCallback)(t=>{if(n(),t.clientX===0&&t.clientY===0)return;let r=document.querySelector(`.chat-messages`);if(!r)return;let i=r.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&e()},[e,n]);return t?{draggable:!1,onDragStart:()=>{},onDragEnd:()=>{}}:{draggable:!0,onDragStart:r,onDragEnd:i}}function bt(e){(0,G.useEffect)(()=>{let t=Date.now(),r=`/api/admin/browser-iframe/event`,i={brand:n.productName,surface:e};return fetch(r,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:JSON.stringify({event:`mount`,...i}),keepalive:!0}).catch(()=>{}),()=>{let e=JSON.stringify({event:`unmount`,durationMs:Date.now()-t,...i});try{let t=new Blob([e],{type:`application/json`});navigator.sendBeacon(r,t)||fetch(r,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:e,keepalive:!0}).catch(()=>{})}catch{}}},[e])}var xt=`maxy-vnc-overlay-popout`;function St(e){let[t,r]=(0,G.useState)(!1),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=(0,G.useCallback)(()=>{a.current&&=(clearInterval(a.current),null),i.current&&!i.current.closed&&i.current.close(),i.current=null,r(!1)},[]),s=(0,G.useCallback)(()=>{let t=`/vnc-popout.html?title=${encodeURIComponent(n.productName)}`,s=window.open(t,xt,`width=1024,height=768`);s&&(i.current=s,r(!0),a.current=setInterval(()=>{i.current?.closed&&(o(),e?.())},500))},[o,e]);return(0,G.useEffect)(()=>()=>o(),[o]),{poppedOut:t,popout:s,cleanupPopout:o}}var Ct=(0,G.forwardRef)(function({onClose:e},t){vt(),bt(`overlay`);let{poppedOut:r,popout:i,cleanupPopout:a}=St(e);return(0,G.useImperativeHandle)(t,()=>({popout:i}),[i]),r?(0,K.jsxs)(`div`,{className:`browser-overlay-popout`,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer__title`,children:n.productName}),(0,K.jsx)(`span`,{className:`browser-viewer__popout-label`,children:`Popped out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:B,onClick:()=>a(),"aria-label":`Pop back in`}),e&&(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:()=>{a(),e()},"aria-label":`Close`})]}):(0,K.jsx)(`iframe`,{src:`/vnc-viewer.html`,className:`browser-surface__iframe`,title:n.productName})});function wt({onClose:e}){vt(),bt(`overlay`);let{poppedOut:t,popout:r,cleanupPopout:i}=St(e),a=(0,G.useCallback)(()=>{i(),e()},[i,e]);(0,G.useEffect)(()=>{if(t)return;let e=e=>{e.key===`Escape`&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,a]);let o=yt({handlePopout:r,disabled:t});return t?(0,K.jsxs)(`div`,{className:`browser-overlay-popout`,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer__title`,children:n.productName}),(0,K.jsx)(`span`,{className:`browser-viewer__popout-label`,children:`Popped out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:B,onClick:()=>{i()},"aria-label":`Pop back in`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:a,"aria-label":`Close`})]}):(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen`,children:[(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen__bar`,...o,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer-fullscreen__title`,children:n.productName}),(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen__actions`,children:[(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:O,onClick:r,"aria-label":`Pop out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:a,"aria-label":`Close`})]})]}),(0,K.jsx)(`iframe`,{src:`/vnc-viewer.html`,className:`browser-viewer-fullscreen__iframe`,title:n.productName})]})}function Tt(e){return e.map(e=>[e.sessionId,e.displayName,e.lastMessageAt,e.status])}function Et(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r[0]!==i[0]||r[1]!==i[1]||r[2]!==i[2]||r[3]!==i[3])return!1}return!0}function Dt(e){let[t,n]=(0,G.useState)([]),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),l=(0,G.useRef)([]),u=(0,G.useCallback)(async t=>{if(!e||!t&&s===e)return null;i(!0),o(null);try{let t=await fetch(`/api/admin/claude-sessions?session_key=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`claude-sessions fetch returned ${t.status}`);let r=await t.json(),i=Array.isArray(r)?r:r.sessions??[],a=Tt(i),o=Et(l.current,a);return o||(n(i),l.current=a),c(e),console.info(`[admin-ui] sessions-poll outcome=${o?`unchanged`:`changed`} count=${i.length} cacheKey=${e.slice(0,8)}`),i}catch(t){return console.info(`[admin-ui] sessions-poll outcome=error count=0 cacheKey=${e.slice(0,8)}`),console.error(`[admin/claude-sessions] fetch failed:`,t),o(t instanceof Error?t.message:String(t)),null}finally{i(!1)}},[e,s]);(0,G.useEffect)(()=>{e||(c(null),n([]),o(null),l.current=[])},[e]);let d=(0,G.useCallback)(()=>u(!1),[u]),f=(0,G.useCallback)(()=>u(!0),[u]);return{sessions:t,setSessions:n,loading:r,loaded:s!==null&&s===e,error:a,ensureLoaded:d,refetch:f}}var Ot=`admin-sidebar-collapsed`,kt=`admin-sidebar-drawer-open`;function At(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(Ot)===`1`}catch{return!1}}function jt(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(Ot,`1`):window.sessionStorage.removeItem(Ot)}catch{}}function Mt(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(kt)===`1`}catch{return!1}}function Nt(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(kt,`1`):window.sessionStorage.removeItem(kt)}catch{}}var Pt=720;function Ft(e){let{cacheKey:t,businessName:n,onLaunchBrowser:r,onLogout:i,browserLaunching:a,userName:o,userAvatar:s,role:c,selectedSessionId:l,onSelectSession:u,onSelectArtefact:d,dataArtefact:f=`closed`,children:p,footer:m}=e,[h,g]=(0,G.useState)(()=>At()),[_,v]=(0,G.useState)(()=>Mt()),[y,b]=(0,G.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: ${Pt}px)`).matches);(0,G.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: ${Pt}px)`),t=e=>b(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let x=(0,G.useCallback)(e=>{jt(e),g(e)},[]),S=(0,G.useCallback)(e=>{Nt(e),v(e)},[]);(0,G.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} collapsed=${h} drawer=${_}`)},[]);let C=y?_:!h,w=(0,G.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${Pt}px)`).matches){let e=_;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),S(!e)}else{let e=h;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),x(!e)}},[h,_,x,S]),T=(0,G.useCallback)(e=>{console.info(`[admin-ui] header-menu-nav target=${e}`),window.location.href=e===`data`?`/data`:`/graph`},[]),[E,D]=(0,G.useState)(!1),[O,k]=(0,G.useState)(!1),ee=(0,G.useCallback)(async()=>{if(E)return;D(!0);let e=typeof window<`u`?window.location?.pathname??``:``,t=`n/a`;try{let n=await fetch(`/api/admin/browser/launch`,{method:`POST`});t=n.status;let r=await n.json().catch(()=>({ok:!1,error:`Invalid response`}));if(!r.ok)throw Error(r.error??`Failed to launch browser`);k(!0),console.info(`[admin-ui] header-menu-browser-launch outcome=ok source=shell-overlay route=${e} httpStatus=${t}`)}catch(n){console.error(`[admin-ui] header-menu-browser-launch outcome=error source=shell-overlay route=${e} httpStatus=${t} error="${n instanceof Error?n.message:String(n)}"`),window.alert(n instanceof Error?n.message:`Failed to launch browser`)}finally{D(!1)}},[E]),A=a??E,j=Dt(t),M=Ze(t),N=(0,G.useMemo)(()=>M.rows.map(e=>e.sessionId),[M.rows]),P=(0,G.useCallback)(e=>{if(u){u(e);return}window.location.assign(`/?sessionId=${encodeURIComponent(e)}`)},[u]),F=(0,G.useCallback)(e=>{d&&d(e)},[d]),I={collapsed:h,mobileDrawerOpen:_,sidebarOpen:C,onToggleSidebar:w,setMobileDrawerOpen:S,sessionsState:j,sessionRowIds:N,sessionRowsConnected:M.connected};return(0,K.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,K.jsx)(Z,{businessName:n,onLaunchBrowser:r??ee,onNavigate:T,onToggleSidebar:w,sidebarOpen:C,onLogout:i,browserLaunching:A}),(0,K.jsxs)(`div`,{className:`platform${_?` menu-open`:``}${h?` sidebar-collapsed`:``}`,"data-artefact":f,children:[(0,K.jsx)(pt,{businessName:n,cacheKey:t,role:c??null,userName:o,userAvatar:s??null,sessions:j.sessions,sessionsLoading:j.loading,sessionsError:j.error,ensureSessionsLoaded:j.ensureLoaded,refetchSessions:j.refetch,onSelectArtefact:F,onSelectProjects:()=>{window.location.href=`/graph?label=Project`},onSelectPeople:()=>{window.location.href=`/graph?label=Person`},onSelectTasks:()=>{window.location.href=`/graph?label=Task`},onSelectAgents:()=>{window.location.href=`/graph?label=Agent`},onCloseMobileDrawer:()=>S(!1),onSelectSession:P,selectedSessionId:l??null,collapsed:h,mobileDrawerOpen:_,recentsActions:{setSessions:j.setSessions,refetch:j.refetch}}),typeof p==`function`?p(I):p]}),_&&(0,K.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>S(!1)}),O&&(0,K.jsx)(wt,{onClose:()=>k(!1)}),m]})}var It={LocalBusiness:`#4F6B8A`,Service:`#6B85A0`,PriceSpecification:`#8AA0B8`,OpeningHoursSpecification:`#A8BACE`,Organization:`#8A6B47`,Person:`#B86E4A`,UserProfile:`#D08960`,Preference:`#DFA67A`,AdminUser:`#8C5230`,AccessGrant:`#66381F`,KnowledgeDocument:`#6E8A5A`,ConversationArchive:`#82A06A`,Section:`#8AA876`,Chunk:`#A6C194`,DigitalDocument:`#5A7548`,CreativeWork:`#B5C9A2`,Question:`#C7D6B5`,FAQPage:`#95B385`,DefinedTerm:`#76906A`,Review:`#3F5A2E`,ImageObject:`#A0BB8C`,Conversation:`#6B5A85`,AdminConversation:`#4F4070`,PublicConversation:`#8A75A8`,Message:`#6B7280`,UserMessage:`#DFA67A`,AssistantMessage:`#C9A876`,ToolCall:`#B5ABCB`,Task:`#B0617A`,Project:`#8E4A60`,Event:`#C68095`,Workflow:`#3A6F77`,WorkflowStep:`#5A8E96`,WorkflowRun:`#7AAAB2`,StepResult:`#9CC4CB`,Email:`#6F7F4A`,EmailAccount:`#91A063`,Agent:`#B8893D`},Lt=`#94A3B8`;Object.freeze(Object.keys(It)),Object.freeze(new Set([`Chunk`,`GraphPreference`]));var Rt=Object.freeze(new Set(`LocalBusiness.Service.PriceSpecification.OpeningHoursSpecification.Organization.Person.UserProfile.Preference.AdminUser.AccessGrant.KnowledgeDocument.DigitalDocument.CreativeWork.Question.FAQPage.DefinedTerm.Review.ImageObject.AdminConversation.PublicConversation.Task.Project.Event.Workflow.Email.EmailAccount.Agent`.split(`.`)));Object.freeze(new Set([`ToolCall`,`StepResult`,`WorkflowStep`,`WorkflowRun`])),Object.freeze(new Set([`HAS_TOOL_CALL`,`RUN_OF`,`HAS_STEP`,`HAS_RESULT`]));function zt(e){for(let t=1;t<e.length;t++)if(Object.prototype.hasOwnProperty.call(It,e[t]))return e[t];return e[0]??null}function Bt(e){return It[e]??`#94A3B8`}function Vt(e){let t=zt(e),n=t?Bt(t):Lt,r=0;for(let t=1;t<e.length;t++)Object.prototype.hasOwnProperty.call(It,e[t])&&r++;return{displayLabel:t,colour:n,driftCandidates:r}}export{E as C,O as S,ue as _,Ft as a,L as b,yt as c,ke as d,Ce as f,fe as g,H as h,Vt as i,We as l,he as m,Bt as n,wt as o,W as p,zt as r,Ct as s,Rt as t,Ne as u,le as v,P as x,B as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,y as t}from"./ChatInput-AR8ym-HW.js";import"./graph-labels-BeDsoEVY.js";import{n}from"./page-x6ZXWwMx.js";import"./Checkbox-BWLS5Isf.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-B6XdH6xq.js";import"./chunk-ICPOFSXX-D5pWrJcN.js";import"./dist-Bd4S37oi.js";import"./chunk-5PVQY5BW-64laDovl.js";import"./chunk-U2HBQHQK-Brql314T.js";import"./chunk-BSJP7CBP-DP7LTBll.js";import"./chunk-ZZ45TVLE-DyHGASIn.js";import"./chunk-55IACEB6-BRJOZLpU.js";import"./chunk-EDXVE4YY-dClAHBNd.js";import"./chunk-X2U36JSP-C-79tMym.js";import"./chunk-5FUZZQ4R-BFMrOiNe.js";import"./chunk-ENJZ2VHE-Bz4gXG1p.js";import"./chunk-336JU56O-Bz-tPZhS.js";import{i as t,n,r,t as i}from"./chunk-OYMX7WX6-BCiWtqaK.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
File without changes
|