@rubytech/create-realagent 1.0.648 → 1.0.650

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 (143) hide show
  1. package/dist/index.js +65 -2
  2. package/package.json +1 -1
  3. package/payload/platform/plugins/docs/references/deployment.md +11 -0
  4. package/payload/platform/plugins/docs/references/getting-started.md +2 -0
  5. package/payload/platform/plugins/docs/references/memory-guide.md +2 -2
  6. package/payload/platform/plugins/docs/references/platform.md +6 -0
  7. package/payload/platform/plugins/docs/references/troubleshooting.md +16 -0
  8. package/payload/platform/plugins/memory/references/graph-primitives.md +5 -5
  9. package/payload/platform/templates/dotfiles/.tmux.conf +1 -0
  10. package/payload/platform/templates/systemd/maxy-ttyd.service +20 -0
  11. package/payload/server/public/assets/admin-S2KHPNe4.js +362 -0
  12. package/payload/server/public/assets/admin-kHJ-D0s7.css +1 -0
  13. package/payload/server/public/assets/{arc-DcrodP5U.js → arc-CRqJUbyK.js} +1 -1
  14. package/payload/server/public/assets/architecture-YZFGNWBL-CXIHKKCa.js +1 -0
  15. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-Cvo_8X6C.js → architectureDiagram-Q4EWVU46-DtICG195.js} +1 -1
  16. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-CEK06TEn.js → blockDiagram-DXYQGD6D-nw1V7I38.js} +1 -1
  17. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-QjYUSwTU.js → c4Diagram-AHTNJAMY-C1eEC43O.js} +1 -1
  18. package/payload/server/public/assets/channel-CA7njeKl.js +1 -0
  19. package/payload/server/public/assets/{chunk-2KRD3SAO-BBifNfFc.js → chunk-2KRD3SAO-Bybqj-wj.js} +1 -1
  20. package/payload/server/public/assets/{chunk-336JU56O-B-N_zWuf.js → chunk-336JU56O-Dszn2qEY.js} +2 -2
  21. package/payload/server/public/assets/chunk-426QAEUC-tWQOa3-I.js +1 -0
  22. package/payload/server/public/assets/{chunk-4BX2VUAB-CtDQKj9B.js → chunk-4BX2VUAB-DrKtrnWH.js} +1 -1
  23. package/payload/server/public/assets/{chunk-4TB4RGXK-Dnu9n3p1.js → chunk-4TB4RGXK-CBFzVYqS.js} +1 -1
  24. package/payload/server/public/assets/{chunk-55IACEB6-DSLoJJSj.js → chunk-55IACEB6-BNsOFSNf.js} +1 -1
  25. package/payload/server/public/assets/{chunk-5FUZZQ4R-rx-IvMNE.js → chunk-5FUZZQ4R-CXZykYh_.js} +1 -1
  26. package/payload/server/public/assets/{chunk-5PVQY5BW-B9w9AKCS.js → chunk-5PVQY5BW-CLNppenz.js} +1 -1
  27. package/payload/server/public/assets/{chunk-67CJDMHE-C1yEjtiu.js → chunk-67CJDMHE-DFyE0-n0.js} +1 -1
  28. package/payload/server/public/assets/{chunk-7N4EOEYR-C2f3zeVH.js → chunk-7N4EOEYR-BIKZD1_4.js} +1 -1
  29. package/payload/server/public/assets/{chunk-AA7GKIK3-B_U-NsDK.js → chunk-AA7GKIK3-D4_g24le.js} +1 -1
  30. package/payload/server/public/assets/{chunk-BSJP7CBP-DM6_wafW.js → chunk-BSJP7CBP-Cd9H-V61.js} +1 -1
  31. package/payload/server/public/assets/{chunk-CIAEETIT-DG7WkfNj.js → chunk-CIAEETIT-CAU9PIQi.js} +1 -1
  32. package/payload/server/public/assets/{chunk-EDXVE4YY-aS3_rdwQ.js → chunk-EDXVE4YY-CR1JfOwe.js} +1 -1
  33. package/payload/server/public/assets/{chunk-ENJZ2VHE-r1I0uoCf.js → chunk-ENJZ2VHE-CuXW3Isg.js} +1 -1
  34. package/payload/server/public/assets/{chunk-FMBD7UC4-CTm3YRE5.js → chunk-FMBD7UC4-BwGAtkIr.js} +1 -1
  35. package/payload/server/public/assets/{chunk-FOC6F5B3-CAIttx3K.js → chunk-FOC6F5B3-Cn0552qP.js} +1 -1
  36. package/payload/server/public/assets/{chunk-ICPOFSXX-DQFV4c1l.js → chunk-ICPOFSXX-DEZT2XyQ.js} +2 -2
  37. package/payload/server/public/assets/{chunk-K5T4RW27-B2WCPQBa.js → chunk-K5T4RW27-KwBFTzJ9.js} +1 -1
  38. package/payload/server/public/assets/{chunk-KGLVRYIC-C6w2sUOF.js → chunk-KGLVRYIC-1-3y582Z.js} +1 -1
  39. package/payload/server/public/assets/{chunk-LIHQZDEY-BT1hcDTK.js → chunk-LIHQZDEY-DXIBsDHL.js} +1 -1
  40. package/payload/server/public/assets/{chunk-ORNJ4GCN-Brl32BSe.js → chunk-ORNJ4GCN-CRbOike7.js} +1 -1
  41. package/payload/server/public/assets/{chunk-OYMX7WX6-BCO6n1CX.js → chunk-OYMX7WX6-CVT9itnY.js} +1 -1
  42. package/payload/server/public/assets/chunk-QZHKN3VN-BwkFBCAY.js +1 -0
  43. package/payload/server/public/assets/{chunk-U2HBQHQK-BvgC0fpb.js → chunk-U2HBQHQK-BLgNHWFf.js} +1 -1
  44. package/payload/server/public/assets/{chunk-X2U36JSP-3yLdcqYf.js → chunk-X2U36JSP-DHYLiYqc.js} +1 -1
  45. package/payload/server/public/assets/{chunk-XPW4576I-D876RWxK.js → chunk-XPW4576I-DBdiQ3Zy.js} +1 -1
  46. package/payload/server/public/assets/{chunk-YZCP3GAM-CiuA4hOC.js → chunk-YZCP3GAM-DXaosB5Z.js} +1 -1
  47. package/payload/server/public/assets/{chunk-ZZ45TVLE-COjEBPzv.js → chunk-ZZ45TVLE-B5dCmOpH.js} +1 -1
  48. package/payload/server/public/assets/classDiagram-6PBFFD2Q-CUZ9BU_6.js +1 -0
  49. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BGYsCDux.js +1 -0
  50. package/payload/server/public/assets/clone-BjouONkW.js +1 -0
  51. package/payload/server/public/assets/{cose-bilkent-S5V4N54A-Dap0yL0o.js → cose-bilkent-S5V4N54A-DaHtPQvk.js} +1 -1
  52. package/payload/server/public/assets/{dagre-KV5264BT-DEia9UJj.js → dagre-KV5264BT-CAL9V_HR.js} +1 -1
  53. package/payload/server/public/assets/{dagre-DBbjK-Cf.js → dagre-N8C5Xujx.js} +1 -1
  54. package/payload/server/public/assets/data-BajF3t1i.js +1 -0
  55. package/payload/server/public/assets/{diagram-5BDNPKRD-CWSP9MzJ.js → diagram-5BDNPKRD-pzBSPqlM.js} +1 -1
  56. package/payload/server/public/assets/{diagram-G4DWMVQ6-DWRsfitL.js → diagram-G4DWMVQ6-DStdLqos.js} +1 -1
  57. package/payload/server/public/assets/{diagram-MMDJMWI5-n-jyzS4D.js → diagram-MMDJMWI5-D-SfeX-6.js} +1 -1
  58. package/payload/server/public/assets/{diagram-TYMM5635-CLPTbfLq.js → diagram-TYMM5635-Cdr1DQ84.js} +1 -1
  59. package/payload/server/public/assets/{dist-Tkw8EOuG.js → dist-BKbAaes5.js} +1 -1
  60. package/payload/server/public/assets/{erDiagram-SMLLAGMA-CmPC9Cnc.js → erDiagram-SMLLAGMA-CIg1dDZT.js} +1 -1
  61. package/payload/server/public/assets/file-CRrDfnO1.js +1 -0
  62. package/payload/server/public/assets/{flatten-Db2kUB5j.js → flatten-CpKIi5d2.js} +1 -1
  63. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-DKMNmUbX.js → flowDiagram-DWJPFMVM-CJtU1T6d.js} +1 -1
  64. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-C5-y3w-l.js → ganttDiagram-T4ZO3ILL-R4fuRAT1.js} +1 -1
  65. package/payload/server/public/assets/gitGraph-7Q5UKJZL-tvzbaNdg.js +1 -0
  66. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-D9hG5kTg.js → gitGraphDiagram-UUTBAWPF-sifugSGn.js} +1 -1
  67. package/payload/server/public/assets/graph-CSBMZGGe.js +49 -0
  68. package/payload/server/public/assets/{graphlib-StP6GUhM.js → graphlib-DrlxPM8j.js} +1 -1
  69. package/payload/server/public/assets/house-D1CBraxB.js +1 -0
  70. package/payload/server/public/assets/info-OMHHGYJF-ByeBaFw5.js +1 -0
  71. package/payload/server/public/assets/infoDiagram-42DDH7IO-CjgCxerY.js +2 -0
  72. package/payload/server/public/assets/{isEmpty-CXH_nKTs.js → isEmpty-C3Vxk1It.js} +1 -1
  73. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A--K4KOS61.js → ishikawaDiagram-UXIWVN3A-CYUJOA2c.js} +1 -1
  74. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-DE-28YrW.js → journeyDiagram-VCZTEJTY-UltrLajs.js} +1 -1
  75. package/payload/server/public/assets/{jsx-runtime-BQmd8XDE.css → jsx-runtime-CZtLX8NN.css} +1 -1
  76. package/payload/server/public/assets/{jsx-runtime-DwoXvzmf.js → jsx-runtime-Cb-WunFZ.js} +1 -1
  77. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-CxSHjau2.js → kanban-definition-6JOO6SKY-BBaThtP3.js} +1 -1
  78. package/payload/server/public/assets/{line-DbcqYIG0.js → line-BhOwLD_o.js} +1 -1
  79. package/payload/server/public/assets/{linear-DXHoZSN3.js → linear-D76hoLvZ.js} +1 -1
  80. package/payload/server/public/assets/{mermaid-parser.core-CNGUA13J.js → mermaid-parser.core-D8n5xV7A.js} +2 -2
  81. package/payload/server/public/assets/{mermaid.core-IQgx_upQ.js → mermaid.core-C3TZA9fX.js} +3 -3
  82. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-BT9Up6-C.js → mindmap-definition-QFDTVHPH-Bv1kghvk.js} +1 -1
  83. package/payload/server/public/assets/{ordinal-CN3oz6oW.js → ordinal-BLrOss5K.js} +1 -1
  84. package/payload/server/public/assets/packet-4T2RLAQJ-Csybj5RO.js +1 -0
  85. package/payload/server/public/assets/pie-ZZUOXDRM-Iw1du1Bn.js +1 -0
  86. package/payload/server/public/assets/{pieDiagram-DEJITSTG-BuewQTi6.js → pieDiagram-DEJITSTG-BSYldcKa.js} +1 -1
  87. package/payload/server/public/assets/public-ukz9-gSe.js +5 -0
  88. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-Cu8y2zQL.js → quadrantDiagram-34T5L4WZ-lCDshgz1.js} +1 -1
  89. package/payload/server/public/assets/radar-PYXPWWZC-rEet4TBV.js +1 -0
  90. package/payload/server/public/assets/{reduce-SDh8_UdG.js → reduce-C5tBOlxC.js} +1 -1
  91. package/payload/server/public/assets/{requirementDiagram-MS252O5E-DiT9bo27.js → requirementDiagram-MS252O5E-C7j42RrO.js} +1 -1
  92. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-EkRnGTxM.js → sankeyDiagram-XADWPNL6-plPbHhuF.js} +1 -1
  93. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-BUiQA3SI.js → sequenceDiagram-FGHM5R23-D3Y8MXiX.js} +1 -1
  94. package/payload/server/public/assets/share-2-DkF8neDM.js +1 -0
  95. package/payload/server/public/assets/{src-DQQCRlaQ.js → src-BvrHnOMG.js} +1 -1
  96. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-Fij35Tic.js → stateDiagram-FHFEXIEX-D4BdhMPy.js} +1 -1
  97. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DhKxVkX3.js +1 -0
  98. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-BMsyr7wU.js → timeline-definition-GMOUNBTQ-Lh9jrYCl.js} +1 -1
  99. package/payload/server/public/assets/trash-2-Dde58AAR.js +1 -0
  100. package/payload/server/public/assets/treeView-SZITEDCU-PaLYyjtc.js +1 -0
  101. package/payload/server/public/assets/treemap-W4RFUUIX-CEhGYFbO.js +1 -0
  102. package/payload/server/public/assets/{useVoiceRecorder-C0Fvv_Bt.js → useVoiceRecorder-Hz9X6luB.js} +3 -3
  103. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-6fegYFB3.js → vennDiagram-DHZGUBPP-Cx0v19iv.js} +1 -1
  104. package/payload/server/public/assets/wardley-RL74JXVD-xtJ4_o4d.js +1 -0
  105. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-BtJ_B35h.js → wardleyDiagram-NUSXRM2D-BYewCTre.js} +1 -1
  106. package/payload/server/public/assets/x-D52qhSya.js +1 -0
  107. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DJ20B4NY.js → xychartDiagram-5P7HB3ND-CkfIdbJu.js} +1 -1
  108. package/payload/server/public/data.html +8 -5
  109. package/payload/server/public/graph.html +19 -0
  110. package/payload/server/public/index.html +11 -7
  111. package/payload/server/public/public.html +7 -6
  112. package/payload/server/server.js +964 -737
  113. package/payload/server/public/assets/admin-uiqCo17I.js +0 -352
  114. package/payload/server/public/assets/architecture-YZFGNWBL-C38eyeNF.js +0 -1
  115. package/payload/server/public/assets/channel-D0dIwjlN.js +0 -1
  116. package/payload/server/public/assets/chunk-426QAEUC-C8oXXITm.js +0 -1
  117. package/payload/server/public/assets/chunk-QZHKN3VN-BE_lylks.js +0 -1
  118. package/payload/server/public/assets/classDiagram-6PBFFD2Q-DH37CWIF.js +0 -1
  119. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DNJ7bv8r.js +0 -1
  120. package/payload/server/public/assets/clone-rrGuX3ZR.js +0 -1
  121. package/payload/server/public/assets/data-D8kol1ed.js +0 -1
  122. package/payload/server/public/assets/gitGraph-7Q5UKJZL-CCjgA3FG.js +0 -1
  123. package/payload/server/public/assets/info-OMHHGYJF-B65K6dQJ.js +0 -1
  124. package/payload/server/public/assets/infoDiagram-42DDH7IO-DUJfTICr.js +0 -2
  125. package/payload/server/public/assets/packet-4T2RLAQJ-fp5ishAK.js +0 -1
  126. package/payload/server/public/assets/pie-ZZUOXDRM-Bc3VMuuU.js +0 -1
  127. package/payload/server/public/assets/public-CWuf8cLU.js +0 -5
  128. package/payload/server/public/assets/radar-PYXPWWZC-D9jy5QAa.js +0 -1
  129. package/payload/server/public/assets/share-2-wGga_ldi.js +0 -1
  130. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DQzhSd8K.js +0 -1
  131. package/payload/server/public/assets/treeView-SZITEDCU-CHyRL9e4.js +0 -1
  132. package/payload/server/public/assets/treemap-W4RFUUIX-DpQ_FOO6.js +0 -1
  133. package/payload/server/public/assets/wardley-RL74JXVD-CWBIAatW.js +0 -1
  134. /package/payload/server/public/assets/{_baseFor-D71p92tl.js → _baseFor-WfS9pKAn.js} +0 -0
  135. /package/payload/server/public/assets/{array-Bs_owIvv.js → array-HeX70jSN.js} +0 -0
  136. /package/payload/server/public/assets/{chunk-lgnzUk6H.js → chunk-DD-I1_y5.js} +0 -0
  137. /package/payload/server/public/assets/{cytoscape.esm-DLG5qhup.js → cytoscape.esm-CDZo0kst.js} +0 -0
  138. /package/payload/server/public/assets/{defaultLocale-Du_2bjyv.js → defaultLocale-GJwWH1Jr.js} +0 -0
  139. /package/payload/server/public/assets/{init-BYLBkHX_.js → init-BPLPMQ3Y.js} +0 -0
  140. /package/payload/server/public/assets/{katex-lkho_UhZ.js → katex-CKZ-HWMQ.js} +0 -0
  141. /package/payload/server/public/assets/{path-BO54iFkf.js → path-YdFzr2W6.js} +0 -0
  142. /package/payload/server/public/assets/{preload-helper-DWTEM3RW.js → preload-helper-BEFjQwLd.js} +0 -0
  143. /package/payload/server/public/assets/{rough.esm-BCiZEpQC.js → rough.esm-HAx67Hnb.js} +0 -0
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-7N4EOEYR-C2f3zeVH.js";export{e as createArchitectureServices};
@@ -1 +0,0 @@
1
- import{it as e,rt as t}from"./chunk-ICPOFSXX-DQFV4c1l.js";var n=(n,r)=>e.lang.round(t.parse(n)[r]);export{n as t};
@@ -1 +0,0 @@
1
- import{h as e,p as t}from"./src-DQQCRlaQ.js";import{b as n}from"./chunk-ICPOFSXX-DQFV4c1l.js";var r=e(e=>{let{securityLevel:r}=n(),i=t(`body`);return r===`sandbox`&&(i=t((t(`#i${e}`).node()?.contentDocument??document).body)),i.select(`#${e}`)},`selectSvgElement`);export{r as t};
@@ -1 +0,0 @@
1
- import{h as e}from"./src-DQQCRlaQ.js";var t=class{constructor(e){this.init=e,this.records=this.init()}static{e(this,`ImperativeState`)}reset(){this.records=this.init()}};export{t};
@@ -1 +0,0 @@
1
- import{h as e}from"./src-DQQCRlaQ.js";import"./chunk-ICPOFSXX-DQFV4c1l.js";import"./dist-Tkw8EOuG.js";import"./chunk-5PVQY5BW-B9w9AKCS.js";import"./chunk-U2HBQHQK-BvgC0fpb.js";import"./chunk-FMBD7UC4-CTm3YRE5.js";import"./chunk-BSJP7CBP-DM6_wafW.js";import"./chunk-ZZ45TVLE-COjEBPzv.js";import"./chunk-YZCP3GAM-CiuA4hOC.js";import"./chunk-55IACEB6-DSLoJJSj.js";import"./chunk-EDXVE4YY-aS3_rdwQ.js";import"./chunk-X2U36JSP-3yLdcqYf.js";import"./chunk-5FUZZQ4R-rx-IvMNE.js";import"./chunk-ENJZ2VHE-r1I0uoCf.js";import"./chunk-336JU56O-B-N_zWuf.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-Dnu9n3p1.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-DQQCRlaQ.js";import"./chunk-ICPOFSXX-DQFV4c1l.js";import"./dist-Tkw8EOuG.js";import"./chunk-5PVQY5BW-B9w9AKCS.js";import"./chunk-U2HBQHQK-BvgC0fpb.js";import"./chunk-FMBD7UC4-CTm3YRE5.js";import"./chunk-BSJP7CBP-DM6_wafW.js";import"./chunk-ZZ45TVLE-COjEBPzv.js";import"./chunk-YZCP3GAM-CiuA4hOC.js";import"./chunk-55IACEB6-DSLoJJSj.js";import"./chunk-EDXVE4YY-aS3_rdwQ.js";import"./chunk-X2U36JSP-3yLdcqYf.js";import"./chunk-5FUZZQ4R-rx-IvMNE.js";import"./chunk-ENJZ2VHE-r1I0uoCf.js";import"./chunk-336JU56O-B-N_zWuf.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-Dnu9n3p1.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-StP6GUhM.js";var t=4;function n(n){return e(n,t)}export{n as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-lgnzUk6H.js";import{a as t,n,r,t as i}from"./jsx-runtime-DwoXvzmf.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./share-2-wGga_ldi.js";var p=n(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),m=n(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),h=n(`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`}]]),g=n(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),_=r(),v=e(t(),1),y=i();function b(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{try{t(sessionStorage.getItem(`maxy-admin-session-key`))}catch{t(null)}r(!0)},[]),n?e?(0,y.jsxs)(`div`,{className:`data-page`,children:[(0,y.jsxs)(`header`,{className:`data-header`,children:[(0,y.jsxs)(`h1`,{className:`data-title`,children:[(0,y.jsx)(o,{size:18}),` Data`]}),(0,y.jsx)(x,{})]}),(0,y.jsxs)(`main`,{className:`data-main`,children:[(0,y.jsx)(S,{sessionKey:e}),(0,y.jsx)(D,{sessionKey:e})]})]}):(0,y.jsxs)(`div`,{className:`data-page`,children:[(0,y.jsx)(`header`,{className:`data-header`,children:(0,y.jsxs)(`h1`,{className:`data-title`,children:[(0,y.jsx)(o,{size:18}),` Data`]})}),(0,y.jsxs)(`div`,{className:`data-empty`,children:[(0,y.jsx)(`p`,{children:`You are not signed in.`}),(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,y.jsx)(`div`,{className:`data-page`,children:(0,y.jsxs)(`div`,{className:`data-loading`,children:[(0,y.jsx)(a,{size:18,className:`spin`}),` Loading…`]})})}function x(){let[e,t]=(0,v.useState)(!1),n=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&(n.current.contains(e.target)||t(!1))},i=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]);let r=(0,v.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,y.jsxs)(`div`,{className:`chat-burger-wrap`,ref:n,children:[(0,y.jsx)(`button`,{type:`button`,className:`chat-burger`,onClick:()=>t(e=>!e),"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":e,children:(0,y.jsx)(u,{size:20})}),e&&(0,y.jsxs)(`div`,{className:`chat-menu`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/`},children:[(0,y.jsx)(h,{size:14}),` Chat`]}),(0,y.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/graph/browser/`},children:[(0,y.jsx)(f,{size:14}),` Graph`]}),(0,y.jsx)(`div`,{className:`chat-menu-divider`}),(0,y.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),r()},children:[(0,y.jsx)(s,{size:14}),` Log out`]})]})]})}function S({sessionKey:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=t.trim();if(!e){i(``),s(null);return}let n=setTimeout(()=>i(e),300);return()=>clearTimeout(n)},[t]),(0,v.useEffect)(()=>{if(!r)return;let t=!1;u(!0),f(null);let n=`/api/admin/graph-search?session_key=${encodeURIComponent(e)}&q=${encodeURIComponent(r)}&limit=20`;return fetch(n).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||s(e.results)}).catch(e=>{t||f(e instanceof Error?e.message:String(e))}).finally(()=>{t||u(!1)}),()=>{t=!0}},[r,e]),(0,y.jsxs)(`section`,{className:`data-panel`,children:[(0,y.jsx)(`h2`,{className:`data-panel-title`,children:`Search`}),(0,y.jsx)(`p`,{className:`data-panel-subtitle`,children:`Find anything in your knowledge base by keyword.`}),(0,y.jsxs)(`div`,{className:`data-search-input`,children:[(0,y.jsx)(c,{size:14}),(0,y.jsx)(`input`,{type:`text`,placeholder:`Search your knowledge…`,value:t,onChange:e=>n(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),l&&(0,y.jsx)(a,{size:14,className:`spin`})]}),d&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,d]}),o&&!l&&(0,y.jsxs)(`div`,{className:`data-results-meta`,children:[o.length,` result`,o.length===1?``:`s`]}),o&&o.length===0&&!l&&(0,y.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),o&&o.length>0&&(0,y.jsx)(`ul`,{className:`data-results`,children:o.map(e=>(0,y.jsx)(C,{hit:e},e.nodeId))})]})}function C({hit:e}){let t=T(e.properties),n=E(e.properties),r=w(e.labels),[i,a]=(0,v.useState)(!1),o=n&&n.length>280,s=i||!o?n:n?.slice(0,280)+`…`;return(0,y.jsxs)(`li`,{className:`data-result`,children:[r&&(0,y.jsx)(`div`,{className:`data-result-header`,children:(0,y.jsx)(`span`,{className:`data-result-labels`,children:r})}),t&&(0,y.jsx)(`div`,{className:`data-result-title`,children:t}),n&&(0,y.jsx)(`pre`,{className:`data-result-body`,children:s}),o&&(0,y.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>a(e=>!e),children:i?`Show less`:`Show more`})]})}function w(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function T(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function E(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function D({sessionKey:e}){let[t,n]=(0,v.useState)(`.`),[r,i]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,u]=(0,v.useState)(null),[f,h]=(0,v.useState)(!1),[_,b]=(0,v.useState)(null),x=(0,v.useRef)(null),[S,C]=(0,v.useState)(0),w=(0,v.useMemo)(()=>O(t),[t]);(0,v.useEffect)(()=>{let n=!1;s(!0),u(null);let r=`/api/admin/files?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(t===`.`?``:t)}`;return fetch(r).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{n||i(e.entries)}).catch(e=>{n||(i([]),u(e instanceof Error?e.message:String(e)))}).finally(()=>{n||s(!1)}),()=>{n=!0}},[e,t,S]);let T=(0,v.useCallback)(e=>{n(e)},[]),E=(0,v.useCallback)(()=>{if(t===`.`||t===``)return;let e=t.split(`/`).filter(Boolean);e.pop(),n(e.length===0?`.`:e.join(`/`))},[t]),D=(0,v.useCallback)(n=>{let r=t===`.`?n.name:`${t}/${n.name}`,i=`/api/admin/files/download?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(r)}`,a=document.createElement(`a`);a.href=i,a.rel=`noopener noreferrer`,document.body.appendChild(a),a.click(),a.remove()},[t,e]),j=(0,v.useCallback)(()=>{x.current?.click()},[]),M=(0,v.useCallback)(async t=>{b(null),h(!0);try{let r=new FormData;r.append(`session_key`,e),r.append(`file`,t);let i=await fetch(`/api/admin/files/upload`,{method:`POST`,body:r}),a=await i.json().catch(()=>({error:`HTTP ${i.status}`}));if(!i.ok)throw Error(a.error??`HTTP ${i.status}`);n(a.path.split(`/`).slice(0,-1).join(`/`)||`.`),C(e=>e+1)}catch(e){b(e instanceof Error?e.message:String(e))}finally{h(!1),x.current&&(x.current.value=``)}},[e]);return(0,y.jsxs)(`section`,{className:`data-panel`,children:[(0,y.jsxs)(`div`,{className:`data-panel-heading`,children:[(0,y.jsx)(`h2`,{className:`data-panel-title`,children:`Files`}),(0,y.jsxs)(`div`,{className:`data-file-actions`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:j,disabled:f,children:[f?(0,y.jsx)(a,{size:14,className:`spin`}):(0,y.jsx)(g,{size:14}),` Upload`]}),(0,y.jsx)(`input`,{type:`file`,ref:x,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&M(t)}})]})]}),(0,y.jsxs)(`p`,{className:`data-panel-subtitle`,children:[`Everything under your install's `,(0,y.jsx)(`code`,{children:`data/`}),` directory. Click a folder to open it, a file to download it. Uploads go to `,(0,y.jsx)(`code`,{children:`data/uploads/`}),`.`]}),(0,y.jsxs)(`div`,{className:`data-breadcrumbs`,children:[(0,y.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>T(`.`),children:`data`}),w.map(e=>(0,y.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,y.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>T(e.path),children:e.name})]},e.path)),t!==`.`&&(0,y.jsxs)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-up-btn`,onClick:E,children:[(0,y.jsx)(p,{size:14}),` Up`]})]}),_&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,_]}),c&&(0,y.jsx)(`div`,{className:`data-error`,children:c}),o&&(0,y.jsxs)(`div`,{className:`data-loading`,children:[(0,y.jsx)(a,{size:14,className:`spin`}),` Loading…`]}),!o&&r&&r.length===0&&!c&&(0,y.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!o&&r&&r.length>0&&(0,y.jsx)(`ul`,{className:`data-entries`,children:r.map(e=>{let n=e.displayName??e.name;return(0,y.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,y.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>T(t===`.`?e.name:`${t}/${e.name}`),children:[(0,y.jsx)(m,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n}),(0,y.jsx)(`span`,{className:`data-entry-meta`,children:A(e.modifiedAt)})]}):e.kind===`file`?(0,y.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>D(e),title:`Download ${n}`,children:[(0,y.jsx)(l,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n}),(0,y.jsxs)(`span`,{className:`data-entry-meta`,children:[k(e.sizeBytes),` · `,A(e.modifiedAt)]}),(0,y.jsx)(d,{size:12,className:`data-entry-download-icon`})]}):(0,y.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,y.jsx)(l,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,children:n}),(0,y.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})}function O(e){if(e===`.`||e===``)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=0;e<t.length;e++)n.push({name:t[e],path:t.slice(0,e+1).join(`/`)});return n}function k(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function A(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}(0,_.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(b,{}));
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-67CJDMHE-C1yEjtiu.js";export{e as createGitGraphServices};
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-KGLVRYIC-C6w2sUOF.js";export{e as createInfoServices};
@@ -1,2 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import"./chunk-7N4EOEYR-C2f3zeVH.js";import"./chunk-67CJDMHE-C1yEjtiu.js";import"./chunk-KGLVRYIC-C6w2sUOF.js";import"./chunk-FOC6F5B3-CAIttx3K.js";import"./chunk-AA7GKIK3-B_U-NsDK.js";import"./chunk-2KRD3SAO-BBifNfFc.js";import"./chunk-ORNJ4GCN-Brl32BSe.js";import"./chunk-LIHQZDEY-BT1hcDTK.js";import"./chunk-CIAEETIT-DG7WkfNj.js";import{g as e,h as t}from"./src-DQQCRlaQ.js";import{c as n}from"./chunk-ICPOFSXX-DQFV4c1l.js";import{t as r}from"./chunk-426QAEUC-C8oXXITm.js";import{t as i}from"./mermaid-parser.core-CNGUA13J.js";var a={parse:t(async t=>{let n=await i(`info`,t);e.debug(n)},`parse`)},o={version:`11.14.0`},s={parser:a,db:{getVersion:t(()=>o.version,`getVersion`)},renderer:{draw:t((t,i,a)=>{e.debug(`rendering info diagram
2
- `+t);let o=r(i);n(o,100,400,!0),o.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${a}`)},`draw`)}};export{s as diagram};
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-FOC6F5B3-CAIttx3K.js";export{e as createPacketServices};
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-AA7GKIK3-B_U-NsDK.js";export{e as createPieServices};
@@ -1,5 +0,0 @@
1
- import{o as e}from"./chunk-lgnzUk6H.js";import{a as t,n,r,t as i}from"./jsx-runtime-DwoXvzmf.js";import{A as a,C as o,E as s,F as c,M as l,N as u,P as d,S as f,_ as p,a as m,c as h,g,h as _,i as v,k as y,n as b,o as x,r as S,s as C,t as w,u as T,v as E,x as D,y as O}from"./useVoiceRecorder-C0Fvv_Bt.js";var k=n(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),A=r(),j=e(t(),1),M=`image/jpeg,image/png,image/gif,image/webp,application/pdf,text/plain,text/markdown,text/csv,text/html,text/calendar`,N=new Set(M.split(`,`)),P=20*1024*1024,F=typeof window<`u`&&/^(localhost|127\.0\.0\.1|[a-z0-9-]+\.local)(:|$)/.test(window.location.hostname);function I(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(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 L(){let e=window.location.pathname;if(e.startsWith(`/g/`))return;let t=e.match(/^\/([a-z][a-z0-9-]{2,49})$/);return t?t[1]:void 0}function R(){let e=window.location.pathname.match(/^\/g\/([a-z0-9][a-z0-9-]{0,49})$/);return e?e[1]:void 0}function z(e){return[{key:`length`,label:`At least 8 characters`,met:e.length>=8},{key:`number`,label:`Contains a number`,met:/\d/.test(e)},{key:`special`,label:`Contains a special character`,met:/[^A-Za-z0-9]/.test(e)},{key:`whitespace`,label:`No spaces`,met:e.length>0&&!/\s/.test(e)}]}function B(e,t){if(t===`phone`)return e.length>4?e.slice(0,e.length-4).replace(/\d/g,`•`)+` `+e.slice(-4):e;let n=e.indexOf(`@`);return n<=2?e:e.slice(0,2)+`•••`+e.slice(n)}function V(e){let[t,n]=(0,j.useState)(null),[r,i]=(0,j.useState)(null),[a,o]=(0,j.useState)(`loading`),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(null),[d,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null),_=(0,j.useMemo)(()=>L(),[]),v=(0,j.useMemo)(()=>R(),[]),[y,b]=(0,j.useState)(null),x=(0,j.useRef)(_||``),S=(0,j.useRef)(null),C=(0,j.useRef)(null),w=(0,j.useRef)(!1),T=(0,j.useRef)(null),[E,D]=(0,j.useState)(`sign-in`),[O,k]=(0,j.useState)(null),A=(0,j.useRef)(null),M=(0,j.useRef)(null);(0,j.useEffect)(()=>{try{let e=sessionStorage.getItem(`maxy_session`);e&&(M.current=e)}catch{}},[]);let N=(0,j.useCallback)(t=>{S.current=t,n(t);try{sessionStorage.setItem(`maxy_session`,t)}catch{}o(`chat`),e(t)},[e]),P=(0,j.useCallback)(()=>{S.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}n(null),o(`auth-required`),D(`sign-in`)},[]),z=(0,j.useCallback)(async e=>{try{let t=x.current,n=await fetch(`/api/access/verify-token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e,agentSlug:t})}),r=await n.json();n.ok?(A.current=r.session_key,k(r.grant),D(`set-password`),window.history.replaceState({},``,window.location.pathname)):D(`link-expired`)}catch{D(`sign-in`)}},[]),B=(0,j.useCallback)(async()=>{if(S.current)return S.current;if(C.current)return C.current;let e=(async()=>{try{let e=M.current,t=await fetch(`/api/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_id:I(),..._?{agent:_}:{},...v?{group_slug:v}:{},...e?{session_key:e}:{}})});if(!t.ok){let e=await t.json().catch(()=>({error:``}));return F&&console.error(`[session] POST /api/session failed: ${t.status} ${t.statusText}`,e),t.status===404?i(e.error||`Agent not found`):t.status===503&&i(e.error||`Service unavailable`),null}let r=await t.json();if(r.auth_required){r.agent_id&&(x.current=r.agent_id),c(r.displayName||``),r.agentImage&&u(r.agentImage),r.agentImageShape&&f(r.agentImageShape),r.showAgentName&&m(r.showAgentName),r.branding&&g(r.branding),o(`auth-required`);let e=new URLSearchParams(window.location.search).get(`token`);return e?z(e):D(`sign-in`),null}S.current=r.session_key,n(r.session_key),r.displayName&&c(r.displayName),r.agentImage&&u(r.agentImage),r.agentImageShape&&f(r.agentImageShape),r.showAgentName&&m(r.showAgentName),r.branding&&g(r.branding),o(`chat`),r.resumed&&r.messages&&(w.current=!0,T.current=r.messages),r.group&&b({groupSlug:r.groupSlug,groupName:r.groupName,participants:r.participants??[]});try{sessionStorage.setItem(`maxy_session`,r.session_key)}catch{}return r.session_key}catch(e){return F&&console.error(`[session] fetch /api/session threw:`,e),i(`Unable to connect. Please check your connection and try again.`),null}finally{C.current=null}})();return C.current=e,e},[_,v,z]);return{sessionId:t,sessionKeyRef:S,sessionError:r,pageState:a,setPageState:o,agentDisplayName:s,agentImage:l,agentImageShape:d,showAgentName:p,agentSlug:_,branding:h,resolvedSlugRef:x,ensureSession:B,startNewSession:(0,j.useCallback)(async()=>{S.current=null,C.current=null,M.current=null,w.current=!1,T.current=null,n(null),i(null);try{sessionStorage.removeItem(`maxy_session`)}catch{}let t=await B();t&&e(t)},[B,e]),enterChat:N,enterGate:P,resumedRef:w,resumeMessagesRef:T,gateState:E,setGateState:D,grantInfo:O,setGrantInfo:k,gateSessionKeyRef:A,groupContext:y,groupSlug:v}}function ee({sessionKeyRef:e,ensureSession:t,sessionError:n,pageState:r,inputRef:i}){let[a,o]=(0,j.useState)([]),[s,c]=(0,j.useState)(!1),l=(0,j.useRef)(!1),u=e=>{l.current=e,c(e)},d=(0,j.useCallback)(async a=>{if(!l.current){u(!0),o([{role:`maxy`,content:``,timestamp:Date.now()}]);try{let n=await fetch(`/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({greeting:!0,session_key:a})});if(n.status===401){e.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}F&&console.warn(`[greeting] stale session, retrying with fresh session`);let r=await t();if(!r)return;n=await fetch(`/api/chat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({greeting:!0,session_key:r})})}if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Something went wrong`)}let r=``,i=``,s=()=>{i&&(r+=i,i=``,o(e=>{let t=[...e];return t[0]={...t[0],content:r},t}))},c=setInterval(s,60);try{for await(let e of D(n)){if(e.error)throw Object.assign(Error(e.error),{fromSSE:!0});e.text&&(i+=e.text),e.type===`component`&&(s(),o(t=>{let n=[...t],r={...n[0]},i=[...r.components||[]];return i.push({name:e.name,data:e.data,submitted:!1}),n[0]={...r,components:i},n}))}}finally{clearInterval(c),s()}}catch(e){if(F&&console.error(`[chat] greeting failed:`,e),r===`auth-required`)return;let t=e instanceof Error?e.message:String(e);o([{role:`maxy`,content:e instanceof Error&&e.fromSSE?t:n??`I'm having trouble connecting right now. Try refreshing the page.`,timestamp:Date.now()}])}finally{u(!1),r===`chat`&&i.current?.focus()}}},[e,t,n,r,i]),f=(0,j.useCallback)(async(a,s)=>{let c=s?.hidden??!1,d=s?.files??[];if(!a&&d.length===0||l.current)return;u(!0);let f=d.map(e=>({filename:e.name,mimeType:e.type})),p={role:`visitor`,content:a,attachments:f.length>0?f:void 0,timestamp:Date.now(),hidden:c},m;o(e=>{let t=[...e,p,{role:`maxy`,content:``,timestamp:Date.now()}];return m=t.length-1,t});try{let n=await t();if(!n)throw Error(`session`);let r=e=>{if(d.length>0){let t=new FormData;t.append(`message`,a),t.append(`session_key`,e);for(let e of d)t.append(`attachments`,e);return{body:t,headers:{}}}return{body:JSON.stringify({message:a,session_key:e}),headers:{"Content-Type":`application/json`}}},{body:i,headers:s}=r(n),c=await fetch(`/api/chat`,{method:`POST`,headers:s,body:i});if(c.status===401){e.current=null;try{sessionStorage.removeItem(`maxy_session`)}catch{}F&&console.warn(`[session-expired] stale key cleared, retrying with fresh session`);let n=await t();if(!n)throw Error(`session`);({body:i,headers:s}=r(n)),c=await fetch(`/api/chat`,{method:`POST`,headers:s,body:i})}if(!c.ok){let e=await c.json().catch(()=>({}));throw Error(e.error||`Something went wrong`)}let l=``,u=``,f=()=>{u&&(l+=u,u=``,o(e=>{let t=[...e];return t[m]={...t[m],content:l},t}))},p=setInterval(f,60);try{for await(let e of D(c)){if(e.error)throw Object.assign(Error(e.error),{fromSSE:!0});e.text&&(u+=e.text),e.type===`component`&&(f(),o(t=>{let n=[...t],r={...n[m]},i=[...r.components||[]];return i.push({name:e.name,data:e.data,submitted:!1}),n[m]={...r,components:i},n}))}}finally{clearInterval(p),f()}}catch(e){if(F&&console.error(`[chat] sendMessage failed:`,e),r===`auth-required`)return;let t=e instanceof Error?e.message:String(e),i=e instanceof Error&&e.fromSSE;o(e=>{let r=[...e];return r[m]={...r[m],content:i?t:t===`session`?n??`I'm having trouble connecting right now. Try refreshing the page.`:`Sorry, I hit a snag. Try again in a moment.`},r})}finally{u(!1),r===`chat`&&i.current?.focus()}},[e,t,n,r,i]);return{messages:a,setMessages:o,isStreaming:s,sendMessage:f,sendGreeting:d,handleComponentSubmit:(0,j.useCallback)((e,t,n)=>{o(n=>{let r=[...n],i={...r[e]},a=[...i.components||[]];return a[t]={...a[t],submitted:!0},r[e]={...i,components:a},r}),f(n,{hidden:!0})},[f])}}function te({sessionKeyRef:e,groupSlug:t,isStreaming:n,setMessages:r}){let i=(0,j.useRef)(new Date().toISOString()),a=(0,j.useRef)(!0);(0,j.useEffect)(()=>{let e=()=>{a.current=document.visibilityState===`visible`};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let o=(0,j.useCallback)(async()=>{let n=e.current;if(!(!n||!t))try{let e=await fetch(`/api/group/messages?session_key=${encodeURIComponent(n)}&since=${encodeURIComponent(i.current)}`);if(!e.ok)return;let t=await e.json();if(!t.messages||t.messages.length===0)return;let a=t.messages[t.messages.length-1];a.timestamp&&(i.current=new Date(a.timestamp).toISOString()),r(e=>{let n=new Set(e.filter(e=>e.messageId).map(e=>e.messageId)),r=t.messages.filter(e=>!n.has(e.messageId)).map(e=>({role:e.role,content:e.content,timestamp:e.timestamp,senderName:e.senderName??void 0,senderVisitorId:e.senderVisitorId??void 0,messageId:e.messageId}));return r.length===0?e:[...e,...r]})}catch{}},[e,t,r]);(0,j.useEffect)(()=>{if(!t)return;let e,r=!1;function i(){if(r)return;let t=a.current?3e3:3e4;e=setTimeout(async()=>{n||await o(),i()},t)}return i(),()=>{r=!0,clearTimeout(e)}},[t,n,o])}var H=i();function U({value:e,onChange:t,onComplete:n,disabled:r}){let i=(0,j.useRef)([]);function a(n,r){r.key===`Backspace`?(r.preventDefault(),e[n]?t(e.slice(0,n)+e.slice(n+1)):n>0&&(t(e.slice(0,n-1)+e.slice(n)),i.current[n-1]?.focus())):r.key===`ArrowLeft`&&n>0?i.current[n-1]?.focus():r.key===`ArrowRight`&&n<5&&i.current[n+1]?.focus()}function o(r,a){let o=a.nativeEvent.data;if(!o||!/^\d$/.test(o))return;let s=e.split(``);for(s[r]=o;s.length<r;)s.push(``);let c=s.join(``).replace(/\D/g,``).slice(0,6);t(c),c.length===6?n(c):r<5&&i.current[r+1]?.focus()}function s(e){e.preventDefault();let r=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,6);r&&(t(r),r.length===6?n(r):i.current[r.length]?.focus())}return(0,H.jsx)(`div`,{className:`gate-otp-field`,children:Array.from({length:6}).map((t,n)=>(0,H.jsx)(`input`,{ref:e=>{i.current[n]=e},type:`text`,inputMode:`numeric`,className:`pin-box${e[n]?` pin-box-filled`:``}`,value:e[n]||``,onKeyDown:e=>a(n,e),onInput:e=>o(n,e),onPaste:s,onFocus:e=>e.target.select(),autoFocus:n===0,autoComplete:`off`,maxLength:1,disabled:r,"aria-label":`Code digit ${n+1}`},n))})}function ne({gateState:e,setGateState:t,grantInfo:n,setGrantInfo:r,gateSessionKeyRef:i,resolvedSlugRef:a,onAuthenticated:o}){let[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(``),[p,m]=(0,j.useState)(!1),[h,v]=(0,j.useState)(``),[y,b]=(0,j.useState)(``),[x,S]=(0,j.useState)(!1),[C,w]=(0,j.useState)(null),[T,E]=(0,j.useState)(null),[D,O]=(0,j.useState)(!1);async function k(e){if(e.preventDefault(),!D){w(null),O(!0);try{let e=a.current,n=await fetch(`/api/access/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contact:s,password:l,agentSlug:e})}),i=await n.json();n.ok?o(i.session_key):n.status===401?i.error?.includes(`setup not complete`)||i.error?.includes(`invitation link`)?(t(`private-agent`),w(null)):w(i.error||`Invalid credentials`):n.status===403?(t(`access-expired`),i.expiresAt&&r(e=>e?{...e,expiresAt:i.expiresAt}:{displayName:null,contactValue:s,contactMethod:`email`,expiresAt:i.expiresAt,status:`expired`})):n.status===429?w(i.error||`Too many attempts. Please try again later.`):w(i.error||`Something went wrong`)}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}async function A(e){if(!D){w(null),O(!0);try{let n=a.current,o=await fetch(`/api/access/verify-otp`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({phone:y,code:e,agentSlug:n})}),s=await o.json();o.ok?(i.current=s.session_key,r(s.grant),t(`set-password`)):o.status===429?t(`otp-failed`):(w(s.error||`Invalid code`),v(``))}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}async function M(e){if(e.preventDefault(),!D){if(w(null),l!==d){w(`Passwords do not match`);return}if(!z(l).every(e=>e.met)){w(`Password does not meet requirements`);return}O(!0);try{let e=i.current;if(!e){w(`Session expired. Please use your invitation link again.`);return}let t=await fetch(`/api/access/create-credentials`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_key:e,password:l})}),n=await t.json();t.ok?o(n.session_key):t.status===400&&n.requirements?w(n.requirements.filter(e=>!e.met).map(e=>e.label).join(`, `)):w(n.error||`Something went wrong`)}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}async function N(e){if(e.preventDefault(),!(D||!s)){w(null),O(!0);try{let e=a.current,t=await fetch(`/api/access/forgot-password`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contact:s,agentSlug:e})});t.status===429?w((await t.json()).error||`Too many attempts. Please try again later.`):(E(`If an account exists, a reset link has been sent.`),setTimeout(()=>{S(!1),E(null)},4e3))}catch{w(`Unable to connect. Please try again.`)}finally{O(!1)}}}switch(e){case`set-password`:{let e=z(l),t=e.every(e=>e.met),r=l===d,i=t&&r&&d.length>0;return(0,H.jsx)(`div`,{className:`gate-wrap`,children:(0,H.jsxs)(`div`,{className:`gate-card`,children:[n?.expiresAt&&(0,H.jsxs)(`div`,{className:`gate-expiry-badge`,children:[`Access until `,new Date(n.expiresAt).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`})]}),(0,H.jsxs)(`h2`,{className:`gate-title`,children:[`Welcome, `,n?.displayName||`there`]}),(0,H.jsx)(`p`,{className:`gate-subtitle`,children:`Create a password to access this agent in the future.`}),(0,H.jsxs)(`form`,{className:`gate-form`,onSubmit:M,children:[(0,H.jsxs)(`div`,{className:`gate-field`,children:[(0,H.jsx)(`label`,{htmlFor:`gate-display-name`,children:`Display name`}),(0,H.jsx)(`input`,{id:`gate-display-name`,type:`text`,value:n?.displayName||``,disabled:!0})]}),(0,H.jsxs)(`div`,{className:`gate-field gate-pw-row`,children:[(0,H.jsx)(`label`,{htmlFor:`gate-pw`,children:`Password`}),(0,H.jsx)(`div`,{className:`gate-pw-toggle`,children:(0,H.jsx)(g,{checked:p,onChange:m,label:`Show`})}),(0,H.jsx)(`input`,{id:`gate-pw`,type:p?`text`:`password`,value:l,onChange:e=>u(e.target.value),placeholder:`Your password`,autoFocus:!0,autoComplete:`new-password`}),l.length>0&&(0,H.jsx)(`div`,{className:`gate-strength`,children:e.map(e=>(0,H.jsxs)(`span`,{className:`gate-strength-item${e.met?` met`:``}`,children:[e.met?`✓`:`○`,` `,e.label]},e.key))})]}),(0,H.jsxs)(`div`,{className:`gate-field`,children:[(0,H.jsx)(`label`,{htmlFor:`gate-pw-confirm`,children:`Confirm password`}),(0,H.jsx)(`input`,{id:`gate-pw-confirm`,type:p?`text`:`password`,value:d,onChange:e=>f(e.target.value),placeholder:`Confirm your password`,autoComplete:`new-password`}),d.length>0&&!r&&(0,H.jsx)(`div`,{className:`gate-error`,children:`Passwords do not match`})]}),C&&(0,H.jsx)(`div`,{className:`gate-error`,children:C}),(0,H.jsx)(`div`,{className:`gate-submit`,children:(0,H.jsx)(_,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!i||D,loading:D,children:`Create account & enter chat`})})]})]})})}case`enter-otp`:return(0,H.jsx)(`div`,{className:`gate-wrap`,children:(0,H.jsxs)(`div`,{className:`gate-card`,children:[(0,H.jsx)(`h2`,{className:`gate-title`,children:`Enter your code`}),(0,H.jsxs)(`p`,{className:`gate-subtitle`,children:[`Enter the 6-digit code sent to `,B(y,`phone`)]}),(0,H.jsx)(U,{value:h,onChange:v,onComplete:A,disabled:D}),C&&(0,H.jsx)(`div`,{className:`gate-error`,children:C}),D&&(0,H.jsxs)(`div`,{className:`gate-loading`,children:[(0,H.jsx)(`span`,{className:`spinner`}),`Verifying...`]}),(0,H.jsx)(`div`,{className:`gate-resend`,children:(0,H.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{t(`sign-in`),v(``),w(null)},children:`Use a different number`})})]})});case`sign-in`:case`private-agent`:return(0,H.jsx)(`div`,{className:`gate-wrap`,children:(0,H.jsxs)(`div`,{className:`gate-card`,children:[(0,H.jsx)(`h2`,{className:`gate-title`,children:e===`private-agent`?`Private Agent`:`Welcome back`}),(0,H.jsx)(`p`,{className:`gate-subtitle`,children:e===`private-agent`?`This agent is invitation-only. If you have an account, sign in below.`:`Sign in to continue your conversation.`}),x?(0,H.jsxs)(`form`,{className:`gate-form`,onSubmit:N,children:[(0,H.jsxs)(`div`,{className:`gate-field`,children:[(0,H.jsx)(`label`,{htmlFor:`gate-forgot-contact`,children:`Email or phone`}),(0,H.jsx)(`input`,{id:`gate-forgot-contact`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`you@example.com`,autoFocus:!0,autoComplete:`email`})]}),C&&(0,H.jsx)(`div`,{className:`gate-error`,children:C}),T&&(0,H.jsx)(`div`,{className:`gate-success`,children:T}),(0,H.jsx)(`div`,{className:`gate-submit`,children:(0,H.jsx)(_,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!s.trim()||D,loading:D,children:`Send reset link`})}),(0,H.jsx)(`div`,{className:`gate-actions`,children:(0,H.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{S(!1),w(null),E(null)},children:`Back to sign in`})})]}):(0,H.jsxs)(`form`,{className:`gate-form`,onSubmit:k,children:[(0,H.jsxs)(`div`,{className:`gate-field`,children:[(0,H.jsx)(`label`,{htmlFor:`gate-contact`,children:`Email or phone`}),(0,H.jsx)(`input`,{id:`gate-contact`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`you@example.com`,autoFocus:!0,autoComplete:`email`})]}),(0,H.jsxs)(`div`,{className:`gate-field gate-pw-row`,children:[(0,H.jsx)(`label`,{htmlFor:`gate-login-pw`,children:`Password`}),(0,H.jsx)(`div`,{className:`gate-pw-toggle`,children:(0,H.jsx)(g,{checked:p,onChange:m,label:`Show`})}),(0,H.jsx)(`input`,{id:`gate-login-pw`,type:p?`text`:`password`,value:l,onChange:e=>u(e.target.value),placeholder:`Your password`,autoComplete:`current-password`})]}),C&&(0,H.jsx)(`div`,{className:`gate-error`,children:C}),(0,H.jsx)(`div`,{className:`gate-submit`,children:(0,H.jsx)(_,{variant:`primary`,type:`submit`,fullWidth:!0,disabled:!s.trim()||!l||D,loading:D,children:`Sign in`})}),(0,H.jsx)(`div`,{className:`gate-actions`,children:(0,H.jsx)(`button`,{type:`button`,className:`gate-link`,onClick:()=>{S(!0),w(null)},children:`Forgot password?`})})]}),e===`private-agent`&&(0,H.jsx)(`p`,{className:`gate-hint`,children:`No account? You need an invitation from the agent owner.`})]})});case`access-expired`:return(0,H.jsx)(`div`,{className:`gate-wrap`,children:(0,H.jsxs)(`div`,{className:`gate-card`,children:[(0,H.jsx)(`div`,{className:`gate-icon`,children:`⏰`}),(0,H.jsx)(`h2`,{className:`gate-title`,children:`Access expired`}),(0,H.jsxs)(`p`,{className:`gate-subtitle`,children:[n?.expiresAt?`Your access expired on ${new Date(n.expiresAt).toLocaleDateString(`en-GB`,{day:`numeric`,month:`long`,year:`numeric`})}.`:`Your access to this agent has expired.`,` `,`Contact the agent owner to renew.`]}),(0,H.jsx)(`div`,{className:`gate-actions`,children:(0,H.jsx)(_,{variant:`secondary`,onClick:()=>{t(`sign-in`),w(null),u(``)},children:`Sign in with a different account`})})]})});case`link-expired`:return(0,H.jsx)(`div`,{className:`gate-wrap`,children:(0,H.jsxs)(`div`,{className:`gate-card`,children:[(0,H.jsx)(`div`,{className:`gate-icon`,children:`⚠️`}),(0,H.jsx)(`h2`,{className:`gate-title`,children:`Link expired`}),(0,H.jsx)(`p`,{className:`gate-subtitle`,children:`This invitation link has expired or has already been used. If you already set your password, sign in below. Otherwise, ask the agent owner to send a new invitation.`}),(0,H.jsx)(`div`,{className:`gate-actions`,children:(0,H.jsx)(_,{variant:`primary`,onClick:()=>{t(`sign-in`),w(null)},children:`Go to sign in`})})]})});case`otp-failed`:return(0,H.jsx)(`div`,{className:`gate-wrap`,children:(0,H.jsxs)(`div`,{className:`gate-card`,children:[(0,H.jsx)(`div`,{className:`gate-icon`,children:`⛔`}),(0,H.jsx)(`h2`,{className:`gate-title`,children:`Too many attempts`}),(0,H.jsx)(`p`,{className:`gate-subtitle`,children:`You've entered the wrong code too many times. Ask the agent owner to send a new code.`}),(0,H.jsx)(`div`,{className:`gate-actions`,children:(0,H.jsx)(_,{variant:`secondary`,onClick:()=>{t(`sign-in`),w(null),v(``)},children:`Back to sign in`})})]})})}}var W={"single-select":h,"multi-select":C,"action-buttons":x};function G({name:e,data:t,onSubmit:n,submitted:r}){let i=W[e];return i?(0,H.jsx)(i,{data:t,onSubmit:n,submitted:r}):(console.warn(`[PublicComponentRenderer] Unknown component: "${e}". Registered: ${Object.keys(W).join(`, `)}`),(0,H.jsx)(`div`,{className:`component-card component-card--error`,children:(0,H.jsxs)(`p`,{style:{fontFamily:`var(--font-body)`,fontSize:12,color:`var(--text-secondary)`},children:[`Component “`,e,`” is not available. This may require a platform update.`]})}))}function re({messages:e,isStreaming:t,sessionError:n,selectionMode:r,selectedItems:i,toggleSelectItem:a,onComponentSubmit:o,remainingSuggestions:s,onSuggestionClick:d,isAtBottom:f,setIsAtBottom:p,isGroup:h}){let[v,y]=(0,j.useState)(new Set),[b,x]=(0,j.useState)(new Set),S=(0,j.useRef)(null),C=(0,j.useRef)(null),w=(0,j.useRef)(null),E=(0,j.useRef)(!1),D=(0,j.useRef)(!1),O=(0,j.useRef)(!1),k=(0,j.useRef)(0),A=(0,j.useRef)(!1),M=(0,j.useRef)(new Map);A.current=t,(0,j.useEffect)(()=>{t&&!E.current&&f&&(D.current=!0)},[t,f]),(0,j.useEffect)(()=>{if(!D.current&&!f){E.current=t,O.current=!1;return}if(E.current&&!t&&w.current&&C.current){let e=w.current;if(e.offsetHeight>C.current.clientHeight){D.current=!1,O.current=!0,e.scrollIntoView({behavior:`smooth`,block:`start`}),E.current=t;return}}(f||D.current)&&!O.current&&S.current?.scrollIntoView({behavior:`smooth`}),E.current&&!t&&(D.current=!1),E.current=t},[e,f,t]),(0,j.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>{let t=e.scrollTop;A.current&&t<k.current&&(D.current=!1),k.current=t,p(e.scrollHeight-e.scrollTop-e.clientHeight<80)};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>e.removeEventListener(`scroll`,t)},[p]),(0,j.useEffect)(()=>{function e(){x(e=>{let t=new Set;return M.current.forEach((n,r)=>{n.isConnected&&(v.has(r)?e.has(r)&&t.add(r):n.scrollHeight>n.clientHeight+2&&t.add(r))}),e.size===t.size&&[...e].every(e=>t.has(e))?e:t})}e();let t=new ResizeObserver(e);return M.current.forEach(e=>t.observe(e)),()=>t.disconnect()},[e.length,v]);let N=e.reduce((e,t,n)=>t.role===`maxy`&&!t.hidden?n:e,-1);return(0,H.jsxs)(`div`,{className:`chat-messages-wrap`,children:[r&&(0,H.jsx)(`div`,{className:`selection-overlay-band`}),(0,H.jsxs)(`div`,{className:`chat-messages`,ref:C,children:[n&&e.length===0&&(0,H.jsx)(`div`,{className:`session-error`,children:(0,H.jsx)(`p`,{children:n})}),e.map((n,s)=>{if(n.hidden)return null;let d=t&&s===e.length-1,f=`${n.timestamp}_${n.role}`,p=i.has(f);return(0,H.jsxs)(`div`,{ref:s===N?w:void 0,className:`message ${n.role}${p?` selected`:``}`,children:[r&&!d&&(0,H.jsx)(`div`,{className:`message-select-check`,children:(0,H.jsx)(g,{checked:p,onChange:()=>a(f)})}),(0,H.jsxs)(`div`,{className:`bubble`,children:[h&&n.role===`visitor`&&n.senderName&&(0,H.jsx)(`span`,{className:`bubble-sender`,children:n.senderName}),n.role===`visitor`&&n.content?(()=>{let e=v.has(s),t=b.has(s);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{ref:e=>{e?M.current.set(s,e):M.current.delete(s)},className:e?`bubble-content`:`bubble-content clamped${t?` overflowing`:``}`,children:n.content}),t&&(0,H.jsx)(`div`,{className:`bubble-expand`,children:(0,H.jsx)(_,{variant:`icon`,className:e?`expanded`:``,onClick:()=>y(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t}),"aria-label":e?`Collapse message`:`Expand message`,children:(0,H.jsx)(c,{size:14})})})]})})():n.content?(0,H.jsx)(T,{content:n.content,timestamp:m(n.timestamp)}):(0,H.jsxs)(`span`,{className:`typing-indicator`,children:[(0,H.jsx)(`span`,{className:`typing-dot`}),(0,H.jsx)(`span`,{className:`typing-dot`}),(0,H.jsx)(`span`,{className:`typing-dot`})]}),n.attachments&&n.attachments.length>0&&(0,H.jsx)(`div`,{className:`message-attachments`,children:n.attachments.map((e,t)=>(0,H.jsxs)(`span`,{className:`message-attachment-chip no-action`,children:[e.mimeType===`application/pdf`?(0,H.jsx)(l,{size:12}):e.mimeType.startsWith(`text/`)?(0,H.jsx)(u,{size:12}):null,(0,H.jsx)(`span`,{children:e.filename})]},t))}),n.role===`visitor`&&(0,H.jsx)(`span`,{className:`message-timestamp`,children:m(n.timestamp)})]}),n.role===`maxy`&&n.components&&n.components.length>0&&(0,H.jsx)(`div`,{className:`public-components`,children:n.components.map((e,t)=>(0,H.jsx)(`div`,{className:`public-component-enter`,children:(0,H.jsx)(G,{name:e.name,data:e.data,onSubmit:e=>o(s,t,e),submitted:e.submitted})},t))})]},s)}),!t&&s.length>0&&(0,H.jsx)(`div`,{className:`chat-suggestions`,children:s.map(e=>(0,H.jsx)(_,{variant:`suggestion`,onClick:()=>d(e),children:e},e))}),(0,H.jsx)(`div`,{ref:S})]}),!f&&(0,H.jsx)(`button`,{className:`scroll-to-bottom`,onClick:()=>S.current?.scrollIntoView({behavior:`smooth`}),"aria-label":`Scroll to bottom`,children:(0,H.jsx)(c,{size:18})})]})}function ie({selectedItems:e,messages:t,copySelected:n,exitSelection:r,showCopyToast:i}){let[a,o]=(0,j.useState)(!1),s=(0,j.useRef)(null),c=(0,j.useRef)(!1);function l(e){let n=e.lastIndexOf(`_`),r=e.slice(0,n),i=e.slice(n+1),a=parseInt(r,10);return t.find(e=>e.timestamp===a&&e.role===i)?.content??``}function u(e,t){return parseInt(e.slice(0,e.lastIndexOf(`_`)),10)-parseInt(t.slice(0,t.lastIndexOf(`_`)),10)}function p(){let e=[...t].sort((e,t)=>e.timestamp-t.timestamp),n=[];for(let t of e){if(t.hidden||!t.content)continue;let e=t.role===`visitor`?`Visitor`:`Maxy`;n.push(`${e}:\n${t.content}`)}return n.join(`
2
-
3
- ---
4
-
5
- `)}j.useEffect(()=>{if(!a)return;let e=e=>{e.target.closest(`.selection-copy-wrap`)||o(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[a]);function m(){s.current!==null&&(clearTimeout(s.current),s.current=null)}return(0,H.jsx)(`div`,{className:`chat-input-area`,children:(0,H.jsxs)(`div`,{className:`selection-bar`,children:[(0,H.jsxs)(`span`,{className:`selection-count`,children:[e.size,` Selected`]}),(0,H.jsxs)(`div`,{className:`selection-copy-wrap`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`selection-copy`,onPointerDown:()=>{if(a){o(!1);return}c.current=!1,s.current=setTimeout(()=>{c.current=!0,o(!0),s.current=null},500)},onPointerUp:m,onPointerLeave:m,onPointerCancel:m,onClick:async()=>{c.current||await n(l,u)},children:[(0,H.jsx)(d,{size:18}),(0,H.jsx)(`span`,{children:`Copy`})]}),a&&(0,H.jsx)(`div`,{className:`copy-menu`,children:(0,H.jsx)(`button`,{type:`button`,className:`copy-menu-item`,onClick:async()=>{let e=p();e&&i(await f(e)),r()},children:`Copy all`})})]}),(0,H.jsx)(`button`,{type:`button`,className:`selection-cancel`,onClick:r,children:`Cancel`})]})})}function ae({input:e,setInput:t,isStreaming:n,pendingFiles:r,setPendingFiles:i,attachError:o,setAttachError:s,isDragOver:c,setIsDragOver:d,inputRef:f,onSubmit:p,onSendVoiceNote:m}){let h=(0,j.useRef)(null),g=w(),x=g.state===`recording`||g.state===`paused`||g.state===`sending`,C=!x&&!n&&!e.trim()&&r.length===0;async function T(){let e=await g.send();if(!e)return;let t=e.type===`audio/ogg`?`.ogg`:e.type===`audio/mp4`?`.m4a`:`.webm`;m(new File([e],`voice-note${t}`,{type:e.type}))}function E(e){s(null);let t=e.find(e=>!N.has(e.type));if(t){s(`Unsupported file type: "${t.type}". Supported: images, PDF, plain text, markdown, CSV, calendar.`);return}let n=e.find(e=>e.size>P);if(n){s(`"${n.name}" exceeds the 20 MB limit.`);return}i(t=>[...t,...e].slice(0,5))}function D(e){e.preventDefault(),d(!0)}function O(){d(!1)}function k(e){e.preventDefault(),d(!1),E([...e.dataTransfer.files])}return(0,H.jsxs)(`div`,{className:`chat-input-area`,children:[(0,H.jsx)(`input`,{ref:h,type:`file`,multiple:!0,accept:M,style:{display:`none`},onChange:e=>{e.target.files&&E([...e.target.files]),e.target.value=``}}),r.length>0&&(0,H.jsx)(`div`,{className:`attachment-strip`,children:r.map((e,t)=>(0,H.jsxs)(`div`,{className:`attachment-chip`,children:[e.type.startsWith(`image/`)?(0,H.jsx)(`img`,{src:URL.createObjectURL(e),alt:e.name,className:`attachment-chip-thumb`}):e.type===`application/pdf`?(0,H.jsx)(l,{size:14}):(0,H.jsx)(u,{size:14}),(0,H.jsx)(`span`,{className:`attachment-chip-name`,children:e.name}),(0,H.jsx)(`button`,{type:`button`,className:`attachment-chip-remove`,onClick:()=>i(e=>e.filter((e,n)=>n!==t)),"aria-label":`Remove ${e.name}`,children:`×`})]},t))}),o&&(0,H.jsx)(`p`,{className:`attach-error`,children:o}),g.state===`error`&&g.errorMessage&&(0,H.jsxs)(`p`,{className:`voice-error`,role:`alert`,children:[(0,H.jsx)(a,{size:14}),g.errorMessage]}),(0,H.jsx)(v,{inputRef:f}),x?(0,H.jsx)(`div`,{className:`chat-form voice-active`,children:(0,H.jsx)(b,{state:g.state,elapsedSeconds:g.elapsedSeconds,waveform:g.waveform,onTogglePause:g.togglePause,onDiscard:g.discard,onSend:T})}):(0,H.jsxs)(`form`,{className:`chat-form${c?` drag-over`:``}`,onSubmit:p,onDragOver:D,onDragLeave:O,onDrop:k,onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t){if(e.kind!==`file`)continue;let t=e.getAsFile();if(!t)continue;let r=t.type.split(`/`)[1]?.replace(`jpeg`,`jpg`)||`png`;n.push(new File([t],`pasted-image-${Date.now()}.${r}`,{type:t.type}))}n.length>0&&E(n)},children:[(0,H.jsx)(_,{variant:`icon`,type:`button`,onClick:()=>h.current?.click(),disabled:n,"aria-label":`Attach file`,children:(0,H.jsx)(y,{size:14})}),(0,H.jsx)(S,{ref:f,value:e,onChange:t}),C?(0,H.jsx)(_,{variant:`send`,type:`button`,onClick:g.start,disabled:n,"aria-label":`Record voice note`,children:(0,H.jsx)(a,{size:14})}):(0,H.jsx)(_,{variant:`send`,type:`submit`,disabled:n||!e.trim()&&r.length===0,"aria-label":`Send message`,children:(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,H.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,H.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]})]})}var K=[];function q(){let[e,t]=(0,j.useState)(``),[n,r]=(0,j.useState)([]),[i,a]=(0,j.useState)(!1),[c,l]=(0,j.useState)(null),[u,d]=(0,j.useState)(K),[f,m]=(0,j.useState)(!0),h=(0,j.useRef)(null),{selectionMode:g,selectedItems:_,copyToast:v,exitSelection:y,enterSelection:b,toggleSelectItem:x,copySelected:S,showCopyToast:C}=o(),w=(0,j.useRef)(()=>{}),T=V((0,j.useCallback)(e=>{w.current(e)},[])),{sessionId:D,sessionKeyRef:A,sessionError:M,pageState:N,agentDisplayName:P,agentImage:F,agentImageShape:I,showAgentName:L,branding:R,ensureSession:z,startNewSession:B,resumedRef:U,resumeMessagesRef:W,groupContext:G,groupSlug:q}=T,{messages:J,setMessages:Y,isStreaming:X,sendMessage:Z,sendGreeting:Q,handleComponentSubmit:oe}=ee({sessionKeyRef:A,ensureSession:z,sessionError:M,pageState:N,inputRef:h});(0,j.useEffect)(()=>{w.current=Q},[Q]),te({sessionKeyRef:A,groupSlug:q,isStreaming:X,setMessages:Y}),(0,j.useEffect)(()=>{let e=!1;return(async()=>{let t=await z();if(!e&&t){if(U.current&&W.current&&W.current.length>0){Y(W.current.map(e=>({role:e.role,content:e.content,timestamp:e.timestamp}))),W.current=null;return}Q(t)}})(),()=>{e=!0}},[]),(0,j.useEffect)(()=>{N===`chat`&&h.current?.focus()},[N]),(0,j.useEffect)(()=>{if(N!==`chat`)return;history.pushState({maxyChat:!0},``);function e(){history.pushState({maxyChat:!0},``)}return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[N]),(0,j.useEffect)(()=>{if(!R)return;let e=document.documentElement;if(R.primaryColor&&(e.style.setProperty(`--sage`,R.primaryColor),e.style.setProperty(`--sage-hover`,R.primaryColor),e.style.setProperty(`--sage-subtle`,R.primaryColor+`14`),e.style.setProperty(`--sage-glow`,R.primaryColor+`26`)),R.accentColor&&e.style.setProperty(`--visitor-bubble`,R.accentColor),R.backgroundColor&&e.style.setProperty(`--bg`,R.backgroundColor),document.title=R.name,R.primaryColor){let e=document.querySelector(`meta[name="theme-color"]`);e||(e=document.createElement(`meta`),e.name=`theme-color`,document.head.appendChild(e)),e.content=R.primaryColor}if(R.faviconUrl){let e=document.querySelector(`link[rel="icon"]`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=R.faviconUrl}},[R]),(0,j.useEffect)(()=>{function e(e){e.key===`Escape`&&g&&y()}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g,y]);function se(){X||(Y([]),d(K),B())}function $(e){if(!e&&n.length===0||X)return;Y(e=>e.map(e=>e.components?.some(e=>!e.submitted)?{...e,components:e.components.map(e=>e.submitted?e:{...e,submitted:!0})}:e)),d(t=>t.filter(t=>t!==e)),m(!0);let i=[...n];t(``),r([]),l(null),Z(e,{files:i})}function ce(t){t.preventDefault(),$(e.trim()),h.current?.resetHeight()}return(0,H.jsxs)(`div`,{className:`chat-page`,children:[(0,H.jsxs)(`header`,{className:`chat-header`,children:[(0,H.jsx)(`img`,{src:F||R?.logoUrl||O,alt:R?.name||p.productName,className:`chat-logo${F&&I===`circle`?` chat-logo--circle`:``}${F&&I===`rounded`?` chat-logo--rounded`:``}`,onError:e=>{e.target.src=R?.logoUrl||O}}),(0,H.jsxs)(`div`,{className:`chat-header-text`,children:[L!==`none`&&(0,H.jsx)(`h1`,{className:`chat-tagline`,children:G?.groupName||L&&P||R?.name||p.productName}),(0,H.jsx)(`p`,{className:`chat-intro`,children:G?`${G.participants.length} participants`:R?.tagline||``}),(0,H.jsx)(`p`,{className:`chat-ai-indicator`,children:`AI assistant`})]}),N===`chat`&&!g&&(0,H.jsxs)(`div`,{className:`chat-header-actions`,children:[(0,H.jsx)(`button`,{className:`chat-header-action`,onClick:se,disabled:X,title:`New conversation`,"aria-label":`New conversation`,children:(0,H.jsx)(k,{size:16})}),(0,H.jsx)(`button`,{className:`chat-header-action`,onClick:b,title:`Select messages`,"aria-label":`Select messages`,children:(0,H.jsx)(s,{size:16})})]})]}),N===`loading`&&(0,H.jsx)(`div`,{className:`gate-wrap`,children:(0,H.jsx)(`div`,{className:`gate-loading`,children:(0,H.jsx)(`span`,{className:`spinner`})})}),N===`auth-required`&&(0,H.jsx)(ne,{gateState:T.gateState,setGateState:T.setGateState,grantInfo:T.grantInfo,setGrantInfo:T.setGrantInfo,gateSessionKeyRef:T.gateSessionKeyRef,resolvedSlugRef:T.resolvedSlugRef,onAuthenticated:T.enterChat}),N===`chat`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(re,{messages:J,isStreaming:X,sessionError:M,selectionMode:g,selectedItems:_,toggleSelectItem:x,onComponentSubmit:oe,remainingSuggestions:u,onSuggestionClick:$,isAtBottom:f,setIsAtBottom:m,isGroup:!!G}),g?(0,H.jsx)(ie,{selectedItems:_,messages:J,copySelected:S,exitSelection:y,showCopyToast:C}):(0,H.jsx)(ae,{input:e,setInput:t,isStreaming:X,pendingFiles:n,setPendingFiles:r,attachError:c,setAttachError:l,isDragOver:i,setIsDragOver:a,inputRef:h,onSubmit:ce,onSendVoiceNote:e=>{t(``),r([]),l(null),Z(`[Voice note]`,{files:[e]})}})]}),v&&(0,H.jsx)(`span`,{className:`copy-toast${v===`failed`?` copy-toast-failed`:``}`,children:v===`copied`?`Copied`:`Copy failed`}),(0,H.jsxs)(`footer`,{className:`chat-footer`,children:[(0,H.jsxs)(`a`,{href:E,children:[p.domain,` `,`↗`]}),D&&(0,H.jsxs)(`span`,{style:{opacity:.35,fontSize:`10px`,fontFamily:`monospace`,marginLeft:`1rem`},children:[`Conversation · `,D.slice(0,8)]})]})]})}(0,A.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(q,{}));
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-2KRD3SAO-BBifNfFc.js";export{e as createRadarServices};
@@ -1 +0,0 @@
1
- import{n as e}from"./jsx-runtime-DwoXvzmf.js";var t=e(`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`}]]),n=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),r=e(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),i=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),a=e(`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`}]]),o=e(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),s=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),c=e(`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`}]]);export{i as a,t as c,a as i,s as n,r as o,o as r,n as s,c as t};
@@ -1 +0,0 @@
1
- import{h as e}from"./src-DQQCRlaQ.js";import"./chunk-ICPOFSXX-DQFV4c1l.js";import"./dist-Tkw8EOuG.js";import"./chunk-5PVQY5BW-B9w9AKCS.js";import"./chunk-U2HBQHQK-BvgC0fpb.js";import"./chunk-BSJP7CBP-DM6_wafW.js";import"./chunk-ZZ45TVLE-COjEBPzv.js";import"./chunk-55IACEB6-DSLoJJSj.js";import"./chunk-EDXVE4YY-aS3_rdwQ.js";import"./chunk-X2U36JSP-3yLdcqYf.js";import"./chunk-5FUZZQ4R-rx-IvMNE.js";import"./chunk-ENJZ2VHE-r1I0uoCf.js";import"./chunk-336JU56O-B-N_zWuf.js";import{i as t,n,r,t as i}from"./chunk-OYMX7WX6-BCO6n1CX.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};
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-ORNJ4GCN-Brl32BSe.js";export{e as createTreeViewServices};
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-LIHQZDEY-BT1hcDTK.js";export{e as createTreemapServices};
@@ -1 +0,0 @@
1
- import"./chunk-K5T4RW27-B2WCPQBa.js";import{n as e}from"./chunk-CIAEETIT-DG7WkfNj.js";export{e as createWardleyServices};