@saluzi/saluzi-edu 0.5.21 → 0.5.22

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 (186) hide show
  1. package/dist/cli.js +67 -63
  2. package/dist/guide/guide-data.json +174 -174
  3. package/dist/rcs-web/assets/AdminPanel-w39uutIr.js +1 -0
  4. package/dist/rcs-web/assets/ArtifactView-wUyXqsCU.js +1 -0
  5. package/dist/rcs-web/assets/{ArtifactsGallery-B63LTThv.js → ArtifactsGallery-DxVwQ8Wh.js} +15 -15
  6. package/dist/rcs-web/assets/Claim-D7HLQsN_.js +1 -0
  7. package/dist/rcs-web/assets/Dashboard-Bz-0-u1i.js +31 -0
  8. package/dist/rcs-web/assets/{Join-zelwrNDz.js → Join-CIaF_Ohx.js} +1 -1
  9. package/dist/rcs-web/assets/{Login-BmYeCfbw.js → Login-DNiG6cNe.js} +1 -1
  10. package/dist/rcs-web/assets/{Register-Dfw4S_A0.js → Register-CZ5iK6MO.js} +1 -1
  11. package/dist/rcs-web/assets/SessionDetail-HEE0RVF6.js +73 -0
  12. package/dist/rcs-web/assets/SessionVisibilityBadge-BY5tHU7b.js +16 -0
  13. package/dist/rcs-web/assets/{Setup-BTTET7Rk.js → Setup-CJerwA76.js} +1 -1
  14. package/dist/rcs-web/assets/{ShareLanding-DaLDc5iV.js → ShareLanding-CgkypqyR.js} +1 -1
  15. package/dist/rcs-web/assets/TeamDetail-ChdJxhFx.js +6 -0
  16. package/dist/rcs-web/assets/TeamList-lVbIAJts.js +1 -0
  17. package/dist/rcs-web/assets/TeamSettings-Bk3T7qB1.js +1 -0
  18. package/dist/rcs-web/assets/UserSearchInput-nQ2jQJmj.js +6 -0
  19. package/dist/rcs-web/assets/UserSettings-BZP7lYFA.js +1 -0
  20. package/dist/rcs-web/assets/{arc-CPhgreP8.js → arc-BLA5f37u.js} +1 -1
  21. package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-CpAi-qzk.js → architectureDiagram-3BPJPVTR-GM4VEh2Q.js} +1 -1
  22. package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-DcsxgO1K.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-C1u0Ojfk.js} +1 -1
  23. package/{packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-BQ5cjzbZ.js → dist/rcs-web/assets/c4Diagram-AAUBKEIU-1cul6feX.js} +1 -1
  24. package/dist/rcs-web/assets/channel-C0wRu8mS.js +1 -0
  25. package/dist/rcs-web/assets/{chunk-2J33WTMH-wa-oCiR6.js → chunk-2J33WTMH-CmySrkX6.js} +1 -1
  26. package/dist/rcs-web/assets/{chunk-4BX2VUAB-D2ybEyPG.js → chunk-4BX2VUAB-EzctfdX5.js} +1 -1
  27. package/dist/rcs-web/assets/{chunk-55IACEB6-CQGtwyGQ.js → chunk-55IACEB6-ClG1aobM.js} +1 -1
  28. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-D0ITaMeP.js → dist/rcs-web/assets/chunk-727SXJPM-D7CCqdxe.js} +1 -1
  29. package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-BWRrcP1d.js → dist/rcs-web/assets/chunk-AQP2D5EJ-C12KuaNz.js} +1 -1
  30. package/dist/rcs-web/assets/{chunk-FMBD7UC4-C-CaLwfI.js → chunk-FMBD7UC4-WFInUvtG.js} +1 -1
  31. package/dist/rcs-web/assets/{chunk-ND2GUHAM-OPpmIsi8.js → chunk-ND2GUHAM-79eEElwS.js} +1 -1
  32. package/dist/rcs-web/assets/{chunk-QZHKN3VN-Bq6R2yM7.js → chunk-QZHKN3VN-B2q3R-jr.js} +1 -1
  33. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-DdKmm0r6.js +1 -0
  34. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-DdKmm0r6.js +1 -0
  35. package/{packages/remote-control-server/web/dist/assets/code-block-IT6T5CEO-BQf-xjVa.js → dist/rcs-web/assets/code-block-IT6T5CEO-BxkGH7r3.js} +1 -1
  36. package/dist/rcs-web/assets/{copy-lzYYFmlH.js → copy-CJUB1OCZ.js} +1 -1
  37. package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-CuUSRgoZ.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-D77W33NX.js} +1 -1
  38. package/{packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-BP4ZP_3D.js → dist/rcs-web/assets/dagre-BM42HDAG-DWSpM1Pp.js} +1 -1
  39. package/dist/rcs-web/assets/{diagram-2AECGRRQ-XQnH0b9k.js → diagram-2AECGRRQ-BmjFx9zx.js} +1 -1
  40. package/dist/rcs-web/assets/{diagram-5GNKFQAL-BnuYmMPD.js → diagram-5GNKFQAL-XJL0kjUS.js} +1 -1
  41. package/{packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-LymV4oAW.js → dist/rcs-web/assets/diagram-KO2AKTUF-BD-qltFe.js} +1 -1
  42. package/dist/rcs-web/assets/{diagram-LMA3HP47-NSg5NWFp.js → diagram-LMA3HP47-CC9yXUQZ.js} +1 -1
  43. package/{packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-kVTMFgtZ.js → dist/rcs-web/assets/diagram-OG6HWLK6-CM4_62w2.js} +1 -1
  44. package/dist/rcs-web/assets/dialog-BnhKhSaK.js +1 -0
  45. package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-BJBTtX2s.js → erDiagram-TEJ5UH35-CLCbQ9SN.js} +1 -1
  46. package/dist/rcs-web/assets/{flowDiagram-I6XJVG4X-CcQXZNID.js → flowDiagram-I6XJVG4X-BRJxpd6c.js} +1 -1
  47. package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-DW8iKyq_.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-Q9D0n7zY.js} +1 -1
  48. package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-BTBYx3LF.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-DfDoy86d.js} +1 -1
  49. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-BRZAYc6t.js → infoDiagram-5YYISTIA-56dRcjZy.js} +1 -1
  50. package/{packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-BYMQtEeD.js → dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-BHdffIkI.js} +1 -1
  51. package/{packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-aqx7w1db.js → dist/rcs-web/assets/journeyDiagram-JHISSGLW-CsEp1AVc.js} +1 -1
  52. package/{packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-BxEHfP4O.js → dist/rcs-web/assets/kanban-definition-UN3LZRKU-_RE82LM5.js} +1 -1
  53. package/dist/rcs-web/assets/{linear-Chjw8hPE.js → linear-DDo4ZKYf.js} +1 -1
  54. package/dist/rcs-web/assets/main-BKohkTQG.css +1 -0
  55. package/dist/rcs-web/assets/{main-Dh-rPGBg.js → main-bwawHmb2.js} +15 -15
  56. package/{packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-CrqI4db6.js → dist/rcs-web/assets/mermaid-VLURNSYL-BAWTa5p7.js} +4 -4
  57. package/dist/rcs-web/assets/{mermaid.core-EjsI3GC3.js → mermaid.core-Bk3OUzLn.js} +5 -5
  58. package/dist/rcs-web/assets/{mindmap-definition-RKZ34NQL-D2rO_fGA.js → mindmap-definition-RKZ34NQL-Dn3-IrmG.js} +1 -1
  59. package/dist/rcs-web/assets/{notifications-WMIbgYDP.js → notifications-BV1MotN8.js} +1 -1
  60. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-DDwJZfoh.js → pieDiagram-4H26LBE5-BevMVM81.js} +1 -1
  61. package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-DDtqMwKx.js → quadrantDiagram-W4KKPZXB-ChsIQYAl.js} +1 -1
  62. package/dist/rcs-web/assets/{refresh-cw-l0u8pxJi.js → refresh-cw-CKRHMYj-.js} +1 -1
  63. package/{packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-BtSk2-5u.js → dist/rcs-web/assets/requirementDiagram-4Y6WPE33-dsySOh5e.js} +1 -1
  64. package/dist/rcs-web/assets/{sankeyDiagram-5OEKKPKP-SDLDMxUT.js → sankeyDiagram-5OEKKPKP-DNR-vE3O.js} +1 -1
  65. package/dist/rcs-web/assets/{sequenceDiagram-3UESZ5HK-D7iAclg1.js → sequenceDiagram-3UESZ5HK-D3qAxHng.js} +1 -1
  66. package/dist/rcs-web/assets/{stateDiagram-AJRCARHV-Bxx23fZH.js → stateDiagram-AJRCARHV-BWhyLeMU.js} +1 -1
  67. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-z1g82auz.js → stateDiagram-v2-BHNVJYJU-Cr7eEfN-.js} +1 -1
  68. package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-C8kBbm_V.js → timeline-definition-PNZ67QCA-iel9USPs.js} +1 -1
  69. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-CPldb1-R.js → vennDiagram-CIIHVFJN--VRUq03V.js} +1 -1
  70. package/{packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-MCHB2fG7.js → dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-Mbg_c9zq.js} +1 -1
  71. package/dist/rcs-web/assets/{xychartDiagram-2RQKCTM6-CHj-KmL6.js → xychartDiagram-2RQKCTM6-475G72ds.js} +1 -1
  72. package/dist/rcs-web/index.html +2 -2
  73. package/package.json +1 -1
  74. package/packages/remote-control-server/src/__tests__/client-ip.test.ts +67 -0
  75. package/packages/remote-control-server/src/__tests__/teams.test.ts +44 -0
  76. package/packages/remote-control-server/src/client-ip.ts +57 -0
  77. package/packages/remote-control-server/src/db/sqlite.ts +22 -0
  78. package/packages/remote-control-server/src/routes/v1/environments.ts +4 -0
  79. package/packages/remote-control-server/src/routes/web/teams.ts +12 -1
  80. package/packages/remote-control-server/src/services/environment.ts +12 -0
  81. package/packages/remote-control-server/src/store.ts +37 -8
  82. package/packages/remote-control-server/src/types/api.ts +7 -0
  83. package/packages/remote-control-server/web/dist/assets/AdminPanel-w39uutIr.js +1 -0
  84. package/packages/remote-control-server/web/dist/assets/ArtifactView-wUyXqsCU.js +1 -0
  85. package/packages/remote-control-server/web/dist/assets/{ArtifactsGallery-B63LTThv.js → ArtifactsGallery-DxVwQ8Wh.js} +15 -15
  86. package/packages/remote-control-server/web/dist/assets/Claim-D7HLQsN_.js +1 -0
  87. package/packages/remote-control-server/web/dist/assets/Dashboard-Bz-0-u1i.js +31 -0
  88. package/packages/remote-control-server/web/dist/assets/{Join-zelwrNDz.js → Join-CIaF_Ohx.js} +1 -1
  89. package/packages/remote-control-server/web/dist/assets/{Login-BmYeCfbw.js → Login-DNiG6cNe.js} +1 -1
  90. package/packages/remote-control-server/web/dist/assets/{Register-Dfw4S_A0.js → Register-CZ5iK6MO.js} +1 -1
  91. package/packages/remote-control-server/web/dist/assets/SessionDetail-HEE0RVF6.js +73 -0
  92. package/packages/remote-control-server/web/dist/assets/SessionVisibilityBadge-BY5tHU7b.js +16 -0
  93. package/packages/remote-control-server/web/dist/assets/{Setup-BTTET7Rk.js → Setup-CJerwA76.js} +1 -1
  94. package/packages/remote-control-server/web/dist/assets/{ShareLanding-DaLDc5iV.js → ShareLanding-CgkypqyR.js} +1 -1
  95. package/packages/remote-control-server/web/dist/assets/TeamDetail-ChdJxhFx.js +6 -0
  96. package/packages/remote-control-server/web/dist/assets/TeamList-lVbIAJts.js +1 -0
  97. package/packages/remote-control-server/web/dist/assets/TeamSettings-Bk3T7qB1.js +1 -0
  98. package/packages/remote-control-server/web/dist/assets/UserSearchInput-nQ2jQJmj.js +6 -0
  99. package/packages/remote-control-server/web/dist/assets/UserSettings-BZP7lYFA.js +1 -0
  100. package/packages/remote-control-server/web/dist/assets/{arc-CPhgreP8.js → arc-BLA5f37u.js} +1 -1
  101. package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-CpAi-qzk.js → architectureDiagram-3BPJPVTR-GM4VEh2Q.js} +1 -1
  102. package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-DcsxgO1K.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-C1u0Ojfk.js} +1 -1
  103. package/{dist/rcs-web/assets/c4Diagram-AAUBKEIU-BQ5cjzbZ.js → packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-1cul6feX.js} +1 -1
  104. package/packages/remote-control-server/web/dist/assets/channel-C0wRu8mS.js +1 -0
  105. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-wa-oCiR6.js → chunk-2J33WTMH-CmySrkX6.js} +1 -1
  106. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-D2ybEyPG.js → chunk-4BX2VUAB-EzctfdX5.js} +1 -1
  107. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-CQGtwyGQ.js → chunk-55IACEB6-ClG1aobM.js} +1 -1
  108. package/{dist/rcs-web/assets/chunk-727SXJPM-D0ITaMeP.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-D7CCqdxe.js} +1 -1
  109. package/{dist/rcs-web/assets/chunk-AQP2D5EJ-BWRrcP1d.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-C12KuaNz.js} +1 -1
  110. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-C-CaLwfI.js → chunk-FMBD7UC4-WFInUvtG.js} +1 -1
  111. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-OPpmIsi8.js → chunk-ND2GUHAM-79eEElwS.js} +1 -1
  112. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-Bq6R2yM7.js → chunk-QZHKN3VN-B2q3R-jr.js} +1 -1
  113. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-DdKmm0r6.js +1 -0
  114. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-DdKmm0r6.js +1 -0
  115. package/{dist/rcs-web/assets/code-block-IT6T5CEO-BQf-xjVa.js → packages/remote-control-server/web/dist/assets/code-block-IT6T5CEO-BxkGH7r3.js} +1 -1
  116. package/packages/remote-control-server/web/dist/assets/{copy-lzYYFmlH.js → copy-CJUB1OCZ.js} +1 -1
  117. package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-CuUSRgoZ.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-D77W33NX.js} +1 -1
  118. package/{dist/rcs-web/assets/dagre-BM42HDAG-BP4ZP_3D.js → packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-DWSpM1Pp.js} +1 -1
  119. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-XQnH0b9k.js → diagram-2AECGRRQ-BmjFx9zx.js} +1 -1
  120. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-BnuYmMPD.js → diagram-5GNKFQAL-XJL0kjUS.js} +1 -1
  121. package/{dist/rcs-web/assets/diagram-KO2AKTUF-LymV4oAW.js → packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-BD-qltFe.js} +1 -1
  122. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-NSg5NWFp.js → diagram-LMA3HP47-CC9yXUQZ.js} +1 -1
  123. package/{dist/rcs-web/assets/diagram-OG6HWLK6-kVTMFgtZ.js → packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-CM4_62w2.js} +1 -1
  124. package/packages/remote-control-server/web/dist/assets/dialog-BnhKhSaK.js +1 -0
  125. package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-BJBTtX2s.js → erDiagram-TEJ5UH35-CLCbQ9SN.js} +1 -1
  126. package/packages/remote-control-server/web/dist/assets/{flowDiagram-I6XJVG4X-CcQXZNID.js → flowDiagram-I6XJVG4X-BRJxpd6c.js} +1 -1
  127. package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-DW8iKyq_.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-Q9D0n7zY.js} +1 -1
  128. package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-BTBYx3LF.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-DfDoy86d.js} +1 -1
  129. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-BRZAYc6t.js → infoDiagram-5YYISTIA-56dRcjZy.js} +1 -1
  130. package/{dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-BYMQtEeD.js → packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-BHdffIkI.js} +1 -1
  131. package/{dist/rcs-web/assets/journeyDiagram-JHISSGLW-aqx7w1db.js → packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-CsEp1AVc.js} +1 -1
  132. package/{dist/rcs-web/assets/kanban-definition-UN3LZRKU-BxEHfP4O.js → packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-_RE82LM5.js} +1 -1
  133. package/packages/remote-control-server/web/dist/assets/{linear-Chjw8hPE.js → linear-DDo4ZKYf.js} +1 -1
  134. package/packages/remote-control-server/web/dist/assets/main-BKohkTQG.css +1 -0
  135. package/packages/remote-control-server/web/dist/assets/{main-Dh-rPGBg.js → main-bwawHmb2.js} +15 -15
  136. package/{dist/rcs-web/assets/mermaid-VLURNSYL-CrqI4db6.js → packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-BAWTa5p7.js} +4 -4
  137. package/packages/remote-control-server/web/dist/assets/{mermaid.core-EjsI3GC3.js → mermaid.core-Bk3OUzLn.js} +5 -5
  138. package/packages/remote-control-server/web/dist/assets/{mindmap-definition-RKZ34NQL-D2rO_fGA.js → mindmap-definition-RKZ34NQL-Dn3-IrmG.js} +1 -1
  139. package/packages/remote-control-server/web/dist/assets/{notifications-WMIbgYDP.js → notifications-BV1MotN8.js} +1 -1
  140. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-DDwJZfoh.js → pieDiagram-4H26LBE5-BevMVM81.js} +1 -1
  141. package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-DDtqMwKx.js → quadrantDiagram-W4KKPZXB-ChsIQYAl.js} +1 -1
  142. package/packages/remote-control-server/web/dist/assets/{refresh-cw-l0u8pxJi.js → refresh-cw-CKRHMYj-.js} +1 -1
  143. package/{dist/rcs-web/assets/requirementDiagram-4Y6WPE33-BtSk2-5u.js → packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-dsySOh5e.js} +1 -1
  144. package/packages/remote-control-server/web/dist/assets/{sankeyDiagram-5OEKKPKP-SDLDMxUT.js → sankeyDiagram-5OEKKPKP-DNR-vE3O.js} +1 -1
  145. package/packages/remote-control-server/web/dist/assets/{sequenceDiagram-3UESZ5HK-D7iAclg1.js → sequenceDiagram-3UESZ5HK-D3qAxHng.js} +1 -1
  146. package/packages/remote-control-server/web/dist/assets/{stateDiagram-AJRCARHV-Bxx23fZH.js → stateDiagram-AJRCARHV-BWhyLeMU.js} +1 -1
  147. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-z1g82auz.js → stateDiagram-v2-BHNVJYJU-Cr7eEfN-.js} +1 -1
  148. package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-C8kBbm_V.js → timeline-definition-PNZ67QCA-iel9USPs.js} +1 -1
  149. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-CPldb1-R.js → vennDiagram-CIIHVFJN--VRUq03V.js} +1 -1
  150. package/{dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-MCHB2fG7.js → packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-Mbg_c9zq.js} +1 -1
  151. package/packages/remote-control-server/web/dist/assets/{xychartDiagram-2RQKCTM6-CHj-KmL6.js → xychartDiagram-2RQKCTM6-475G72ds.js} +1 -1
  152. package/packages/remote-control-server/web/dist/index.html +2 -2
  153. package/dist/rcs-web/assets/AdminPanel-fsacwgfK.js +0 -1
  154. package/dist/rcs-web/assets/ArtifactView-DmMwrTRk.js +0 -1
  155. package/dist/rcs-web/assets/Claim-hOGNTz-n.js +0 -1
  156. package/dist/rcs-web/assets/Dashboard-BBIlAMpr.js +0 -6
  157. package/dist/rcs-web/assets/SessionDetail-zXHv84SV.js +0 -83
  158. package/dist/rcs-web/assets/SessionVisibilityBadge-DA_Sg1dx.js +0 -11
  159. package/dist/rcs-web/assets/TeamCreate-BWtaB-_Z.js +0 -1
  160. package/dist/rcs-web/assets/TeamDetail-Crmn6PaC.js +0 -6
  161. package/dist/rcs-web/assets/TeamList-B8Rob6VK.js +0 -1
  162. package/dist/rcs-web/assets/TeamSettings-CfRHolhe.js +0 -1
  163. package/dist/rcs-web/assets/UserSearchInput-DkaGgR76.js +0 -1
  164. package/dist/rcs-web/assets/UserSettings-D1oW7oVv.js +0 -1
  165. package/dist/rcs-web/assets/channel-DHj-rIRW.js +0 -1
  166. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-DsAw9J1B.js +0 -1
  167. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-DsAw9J1B.js +0 -1
  168. package/dist/rcs-web/assets/dialog-DrDf89nL.js +0 -1
  169. package/dist/rcs-web/assets/main-CJvwpIVn.css +0 -1
  170. package/packages/remote-control-server/web/dist/assets/AdminPanel-fsacwgfK.js +0 -1
  171. package/packages/remote-control-server/web/dist/assets/ArtifactView-DmMwrTRk.js +0 -1
  172. package/packages/remote-control-server/web/dist/assets/Claim-hOGNTz-n.js +0 -1
  173. package/packages/remote-control-server/web/dist/assets/Dashboard-BBIlAMpr.js +0 -6
  174. package/packages/remote-control-server/web/dist/assets/SessionDetail-zXHv84SV.js +0 -83
  175. package/packages/remote-control-server/web/dist/assets/SessionVisibilityBadge-DA_Sg1dx.js +0 -11
  176. package/packages/remote-control-server/web/dist/assets/TeamCreate-BWtaB-_Z.js +0 -1
  177. package/packages/remote-control-server/web/dist/assets/TeamDetail-Crmn6PaC.js +0 -6
  178. package/packages/remote-control-server/web/dist/assets/TeamList-B8Rob6VK.js +0 -1
  179. package/packages/remote-control-server/web/dist/assets/TeamSettings-CfRHolhe.js +0 -1
  180. package/packages/remote-control-server/web/dist/assets/UserSearchInput-DkaGgR76.js +0 -1
  181. package/packages/remote-control-server/web/dist/assets/UserSettings-D1oW7oVv.js +0 -1
  182. package/packages/remote-control-server/web/dist/assets/channel-DHj-rIRW.js +0 -1
  183. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-DsAw9J1B.js +0 -1
  184. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-DsAw9J1B.js +0 -1
  185. package/packages/remote-control-server/web/dist/assets/dialog-DrDf89nL.js +0 -1
  186. package/packages/remote-control-server/web/dist/assets/main-CJvwpIVn.css +0 -1
@@ -0,0 +1 @@
1
+ import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{aM as x,aN as o,a3 as m,aE as s,at as l,I as u}from"./main-bwawHmb2.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function j(){x();const[a,i]=d.useState([]),{myTeams:r,isLoading:c}=o(),n=d.useCallback(async()=>{try{const t=await m();i(t||[])}catch(t){console.error("Admin: failed to load sessions",t)}},[]);return d.useEffect(()=>{n()},[n]),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"mb-6 font-display text-2xl font-semibold text-text-primary",children:s("admin.title")}),e.jsxs("section",{className:"mb-10",children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.teams")," (",r.length,")"]}),c?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("common.loading")}):r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noTeams")}):e.jsx("div",{className:"space-y-2",children:r.map(t=>e.jsxs("a",{href:`/teams/${t.slug}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium text-text-primary",children:t.name}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:t.slug})]}),e.jsx("span",{className:"text-xs text-text-muted",children:l(new Date(t.created_at).getTime()/1e3)})]},t.id))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.sessions")," (",a.length,")"]}),a.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noSessions")}):e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("a",{href:`/code/${t.id}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),e.jsx("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.source||"unknown"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[e.jsx(u,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:l(t.updated_at||t.created_at)})]})]},t.id))})]})]})})}export{j as AdminPanel};
@@ -0,0 +1 @@
1
+ import{e as a,j as t}from"./vendor-DE_-CLIE.js";import{aM as A,a4 as j,aE as r,a1 as q,ao as R,P as U,N as F}from"./main-bwawHmb2.js";import{S as O,E as G,C as K}from"./ArtifactsGallery-DxVwQ8Wh.js";import{R as M}from"./refresh-cw-CKRHMYj-.js";import{C as P}from"./copy-CJUB1OCZ.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";import"./dialog-BnhKhSaK.js";let m=null;function J(n,c,e=0){b();const o=`/web/sessions/${n}/events`,l=new EventSource(o,{withCredentials:!0});m=l;let u=e;l.addEventListener("message",p=>{try{const x=JSON.parse(p.data);if(x.seqNum!==void 0&&x.seqNum<=u)return;x.seqNum!==void 0&&(u=x.seqNum),c(x)}catch{}}),l.addEventListener("error",()=>{console.warn("[SSE] error, readyState:",l.readyState),l.readyState===EventSource.CLOSED&&(l.close(),b())})}function b(){m&&(m.close(),m=null)}function V(n,c){const e=a.useRef(c);e.current=c;const o=a.useCallback(l=>{e.current(l)},[]);a.useEffect(()=>{if(n)return J(n,o),()=>{b()}},[n,o])}function I({artifactId:n,onBack:c}){A();const[e,o]=a.useState(null),[l,u]=a.useState(""),[p,x]=a.useState(!1),[S,f]=a.useState(0),[w,h]=a.useState(!1),[g,C]=a.useState(null),[E,k]=a.useState("template"),[d,y]=a.useState(!1);a.useEffect(()=>{let s=!1;return j(n).then(i=>{s||o(i)}).catch(i=>{s||u(i instanceof Error?i.message:r("artifacts.viewNotFound"))}),()=>{s=!0}},[n]);const v=a.useCallback(()=>{j(n).then(s=>o(s)).catch(()=>{})},[n]),_=a.useCallback(s=>{var i;s.type==="artifact_updated"&&((i=s.payload)!=null&&i.id&&s.payload.id!==n||(v(),f(D=>D+1),y(!0)))},[n,v]);V((e==null?void 0:e.session_id)??null,_),a.useEffect(()=>{if(!d)return;const s=setTimeout(()=>y(!1),2500);return()=>clearTimeout(s)},[d]);const N=a.useCallback(s=>{e&&(C(e),k(s),h(!0))},[e]),$=a.useCallback(s=>{h(!1),o(i=>i?{...i,...s}:s),f(i=>i+1)},[]),T=a.useCallback(async()=>{if(window.confirm(r("artifacts.delete")+" — "+n.slice(0,8)+"…?"))try{await q(n),c()}catch(s){alert(s instanceof Error?s.message:r("artifacts.deleteFailed"))}},[n,c]),L=a.useCallback(async()=>{if(!e)return;await R(`${window.location.origin}${e.url}`)&&(x(!0),setTimeout(()=>x(!1),1500))},[e]);return l?t.jsx("div",{className:"flex flex-1 items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-status-error",children:r("artifacts.viewNotFound")}),t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:l}),t.jsx("button",{type:"button",onClick:c,className:"mt-4 rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:r("artifacts.backToGallery")})]})}):e?t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-surface-1 px-4 py-2.5",children:[t.jsx("button",{type:"button",onClick:c,className:"text-sm text-text-muted hover:text-text-primary",children:r("artifacts.backToGallery")}),t.jsx("span",{className:"text-text-muted/40",children:"/"}),t.jsx("span",{className:"truncate font-medium text-text-primary",children:e.title||e.id.slice(0,12)}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-[11px] transition-colors ${d?"bg-status-active/15 text-status-active":"bg-surface-3 text-text-muted"}`,title:d?r("artifacts.view.liveUpdated"):void 0,children:d?`↻ v${e.version}`:`v${e.version}`}),e.session_id&&t.jsxs("a",{href:`/code/${e.session_id}`,className:"truncate font-mono text-[11px] text-text-muted hover:text-accent",title:e.session_id,children:[r("artifacts.session"),": ",e.session_id.slice(0,14),"…"]}),e.expires_at&&t.jsxs("span",{className:"text-[11px] text-text-muted",title:e.expires_at,children:[r("artifacts.expires"),": ",new Date(e.expires_at).toLocaleDateString()]}),t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.jsx("button",{type:"button",onClick:()=>f(s=>s+1),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("common.loading"),children:t.jsx(M,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:()=>N("ai"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.aiUpdate"),children:t.jsx(O,{className:"h-3.5 w-3.5"})}),e.can_manage&&t.jsx("button",{type:"button",onClick:()=>N("template"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.edit"),children:t.jsx(U,{className:"h-3.5 w-3.5"})}),t.jsxs("button",{type:"button",onClick:L,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:`${r("artifacts.copyLink")} · ${r("artifacts.linkNotice")}`,children:[t.jsx(P,{className:"h-3.5 w-3.5"}),p&&t.jsx("span",{className:"text-status-active",children:r("artifacts.copied")})]}),t.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.openInNewTab"),children:t.jsx(G,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:T,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:r("artifacts.delete"),children:t.jsx(F,{className:"h-3.5 w-3.5"})})]})]}),t.jsx("iframe",{src:`${e.url}${e.url.includes("?")?"&":"?"}_=${Date.now()}`,title:e.title||e.id,className:"min-h-0 w-full flex-1 border-0 bg-white",sandbox:"allow-scripts allow-popups allow-forms"},S),t.jsx(K,{open:w,onClose:()=>h(!1),onCreated:$,editArtifact:g,initialMode:E})]}):t.jsx("div",{className:"flex flex-1 items-center justify-center text-text-muted",children:r("common.loading")})}export{I as ArtifactView};
@@ -1,4 +1,4 @@
1
- var pt=Object.defineProperty;var ht=(t,e,r)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var S=(t,e,r)=>ht(t,typeof e!="symbol"?e+"":e,r);import{e as k,j as o}from"./vendor-DE_-CLIE.js";import{al as Re,aq as ut,aI as Qe,aJ as ft,a1 as mt,aA as f,Z as xt,ak as gt,F as bt,g as kt,P as yt,J as wt,r as vt,a0 as St,a6 as Rt,av as Tt,a5 as $t,ae as jt,af as Et,V as Nt,b as Ct}from"./main-Dh-rPGBg.js";import{D as It,a as At,c as Lt,d as zt,b as _t}from"./dialog-DrDf89nL.js";import{C as Dt}from"./copy-lzYYFmlH.js";/**
1
+ var pt=Object.defineProperty;var ht=(t,e,r)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var S=(t,e,r)=>ht(t,typeof e!="symbol"?e+"":e,r);import{e as k,j as o}from"./vendor-DE_-CLIE.js";import{ap as Re,au as ut,aM as Qe,aN as ft,a5 as mt,aE as f,a1 as xt,ao as gt,F as bt,h as kt,P as yt,N as wt,s as vt,a4 as St,aa as Rt,az as Tt,a9 as $t,ai as jt,aj as Et,_ as Nt,b as Ct}from"./main-bwawHmb2.js";import{D as It,a as zt,c as At,d as Lt,b as _t}from"./dialog-BnhKhSaK.js";import{C as Dt}from"./copy-CJUB1OCZ.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -351,12 +351,12 @@ function render() {
351
351
  render();
352
352
  <\/script>
353
353
  </body>
354
- </html>`,ke=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:Ot},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:Kt},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:Zt},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:Gt},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:Ut}];function J(t){return ke.find(e=>e.id===t)??ke[0]}function Te(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Z=Te();function Ve(t){Z=t}var O={exec:()=>null};function w(t,e=""){let r=typeof t=="string"?t:t.source,a={replace:(s,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(E.caret,"$1"),r=r.replace(s,i),a},getRegex:()=>new RegExp(r,e)};return a}var Qt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),E={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Vt=/^(?:[ \t]*(?:\n|$))+/,Wt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,re=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$e=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,We=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Je=w(We).replace(/bull/g,$e).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Yt=w(We).replace(/bull/g,$e).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),je=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,er=/^[^\n]+/,Ee=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,tr=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ee).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rr=w(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$e).getRegex(),pe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ne=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sr=w("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ne).replace("tag",pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xe=w(je).replace("hr",re).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ar=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xe).getRegex(),Ce={blockquote:ar,code:Wt,def:tr,fences:Jt,heading:Xt,hr:re,html:sr,lheading:Je,list:rr,newline:Vt,paragraph:Xe,table:O,text:er},He=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",re).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),nr={...Ce,lheading:Yt,table:He,paragraph:w(je).replace("hr",re).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",He).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex()},ir={...Ce,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ne).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(je).replace("hr",re).replace("heading",` *#{1,6} *[^
355
- ]`).replace("lheading",Je).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,or=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ye=/^( {2,}|\\)\n(?!\s*$)/,cr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,V=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,Ie=/[^\s\p{P}\p{S}]/u,dr=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,he).getRegex(),et=/(?!~)[\p{P}\p{S}]/u,pr=/(?!~)[\s\p{P}\p{S}]/u,hr=/(?:[^\s\p{P}\p{S}]|~)/u,ur=w(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fr=w(tt,"u").replace(/punct/g,V).getRegex(),mr=w(tt,"u").replace(/punct/g,et).getRegex(),rt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=w(rt,"gu").replace(/notPunctSpace/g,Ie).replace(/punctSpace/g,he).replace(/punct/g,V).getRegex(),gr=w(rt,"gu").replace(/notPunctSpace/g,hr).replace(/punctSpace/g,pr).replace(/punct/g,et).getRegex(),br=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ie).replace(/punctSpace/g,he).replace(/punct/g,V).getRegex(),kr=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,V).getRegex(),yr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wr=w(yr,"gu").replace(/notPunctSpace/g,Ie).replace(/punctSpace/g,he).replace(/punct/g,V).getRegex(),vr=w(/\\(punct)/,"gu").replace(/punct/g,V).getRegex(),Sr=w(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Rr=w(Ne).replace("(?:-->|$)","-->").getRegex(),Tr=w("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Rr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),oe=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$r=w(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",oe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),st=w(/^!?\[(label)\]\[(ref)\]/).replace("label",oe).replace("ref",Ee).getRegex(),at=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ee).getRegex(),jr=w("reflink|nolink(?!\\()","g").replace("reflink",st).replace("nolink",at).getRegex(),Fe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ae={_backpedal:O,anyPunctuation:vr,autolink:Sr,blockSkip:ur,br:Ye,code:or,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:fr,emStrongRDelimAst:xr,emStrongRDelimUnd:br,escape:lr,link:$r,nolink:at,punctuation:dr,reflink:st,reflinkSearch:jr,tag:Tr,text:cr,url:O},Er={...Ae,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",oe).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe).getRegex()},ye={...Ae,emStrongRDelimAst:gr,emStrongLDelim:mr,delLDelim:kr,delRDelim:wr,url:w(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:w(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fe).getRegex()},Nr={...ye,br:w(Ye).replace("{2,}","*").getRegex(),text:w(ye.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ie={normal:Ce,gfm:nr,pedantic:ir},X={normal:Ae,gfm:ye,breaks:Nr,pedantic:Er},Cr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=t=>Cr[t];function _(t,e){if(e){if(E.escapeTest.test(t))return t.replace(E.escapeReplace,Oe)}else if(E.escapeTestNoEncode.test(t))return t.replace(E.escapeReplaceNoEncode,Oe);return t}function Ke(t){try{t=encodeURI(t).replace(E.percentDecode,"%")}catch{return null}return t}function Ze(t,e){var l;let r=t.replace(E.findPipe,(i,n,h)=>{let c=!1,u=n;for(;--u>=0&&h[u]==="\\";)c=!c;return c?"|":" |"}),a=r.split(E.splitPipe),s=0;if(a[0].trim()||a.shift(),a.length>0&&!((l=a.at(-1))!=null&&l.trim())&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;s<a.length;s++)a[s]=a[s].trim().replace(E.slashPipe,"|");return a}function Y(t,e,r){let a=t.length;if(a===0)return"";let s=0;for(;s<a&&t.charAt(a-s-1)===e;)s++;return t.slice(0,a-s)}function Ir(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let a=0;a<t.length;a++)if(t[a]==="\\")a++;else if(t[a]===e[0])r++;else if(t[a]===e[1]&&(r--,r<0))return a;return r>0?-2:-1}function Ar(t,e=0){let r=e,a="";for(let s of t)if(s===" "){let l=4-r%4;a+=" ".repeat(l),r+=l}else a+=s,r++;return a}function Ge(t,e,r,a,s){let l=e.href,i=e.title||null,n=t[1].replace(s.other.outputLinkReplace,"$1");a.state.inLink=!0;let h={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:l,title:i,text:n,tokens:a.inlineTokens(n)};return a.state.inLink=!1,h}function Lr(t,e,r){let a=t.match(r.other.indentCodeCompensation);if(a===null)return e;let s=a[1];return e.split(`
354
+ </html>`,ke=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:Ot},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:Kt},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:Zt},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:Gt},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:Ut}];function X(t){return ke.find(e=>e.id===t)??ke[0]}function Te(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Z=Te();function Ve(t){Z=t}var O={exec:()=>null};function w(t,e=""){let r=typeof t=="string"?t:t.source,a={replace:(s,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(E.caret,"$1"),r=r.replace(s,i),a},getRegex:()=>new RegExp(r,e)};return a}var Qt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),E={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Vt=/^(?:[ \t]*(?:\n|$))+/,Wt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,re=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$e=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,We=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=w(We).replace(/bull/g,$e).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jt=w(We).replace(/bull/g,$e).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),je=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,er=/^[^\n]+/,Ee=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,tr=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ee).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rr=w(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$e).getRegex(),pe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ne=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sr=w("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ne).replace("tag",pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ye=w(je).replace("hr",re).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ar=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ye).getRegex(),Ce={blockquote:ar,code:Wt,def:tr,fences:Xt,heading:Yt,hr:re,html:sr,lheading:Xe,list:rr,newline:Vt,paragraph:Ye,table:O,text:er},He=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",re).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),nr={...Ce,lheading:Jt,table:He,paragraph:w(je).replace("hr",re).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",He).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex()},ir={...Ce,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ne).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(je).replace("hr",re).replace("heading",` *#{1,6} *[^
355
+ ]`).replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,or=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Je=/^( {2,}|\\)\n(?!\s*$)/,cr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,V=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,Ie=/[^\s\p{P}\p{S}]/u,dr=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,he).getRegex(),et=/(?!~)[\p{P}\p{S}]/u,pr=/(?!~)[\s\p{P}\p{S}]/u,hr=/(?:[^\s\p{P}\p{S}]|~)/u,ur=w(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fr=w(tt,"u").replace(/punct/g,V).getRegex(),mr=w(tt,"u").replace(/punct/g,et).getRegex(),rt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=w(rt,"gu").replace(/notPunctSpace/g,Ie).replace(/punctSpace/g,he).replace(/punct/g,V).getRegex(),gr=w(rt,"gu").replace(/notPunctSpace/g,hr).replace(/punctSpace/g,pr).replace(/punct/g,et).getRegex(),br=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ie).replace(/punctSpace/g,he).replace(/punct/g,V).getRegex(),kr=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,V).getRegex(),yr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wr=w(yr,"gu").replace(/notPunctSpace/g,Ie).replace(/punctSpace/g,he).replace(/punct/g,V).getRegex(),vr=w(/\\(punct)/,"gu").replace(/punct/g,V).getRegex(),Sr=w(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Rr=w(Ne).replace("(?:-->|$)","-->").getRegex(),Tr=w("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Rr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),oe=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$r=w(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",oe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),st=w(/^!?\[(label)\]\[(ref)\]/).replace("label",oe).replace("ref",Ee).getRegex(),at=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ee).getRegex(),jr=w("reflink|nolink(?!\\()","g").replace("reflink",st).replace("nolink",at).getRegex(),Fe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ze={_backpedal:O,anyPunctuation:vr,autolink:Sr,blockSkip:ur,br:Je,code:or,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:fr,emStrongRDelimAst:xr,emStrongRDelimUnd:br,escape:lr,link:$r,nolink:at,punctuation:dr,reflink:st,reflinkSearch:jr,tag:Tr,text:cr,url:O},Er={...ze,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",oe).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe).getRegex()},ye={...ze,emStrongRDelimAst:gr,emStrongLDelim:mr,delLDelim:kr,delRDelim:wr,url:w(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:w(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fe).getRegex()},Nr={...ye,br:w(Je).replace("{2,}","*").getRegex(),text:w(ye.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ie={normal:Ce,gfm:nr,pedantic:ir},Y={normal:ze,gfm:ye,breaks:Nr,pedantic:Er},Cr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=t=>Cr[t];function _(t,e){if(e){if(E.escapeTest.test(t))return t.replace(E.escapeReplace,Oe)}else if(E.escapeTestNoEncode.test(t))return t.replace(E.escapeReplaceNoEncode,Oe);return t}function Ke(t){try{t=encodeURI(t).replace(E.percentDecode,"%")}catch{return null}return t}function Ze(t,e){var l;let r=t.replace(E.findPipe,(i,n,h)=>{let c=!1,u=n;for(;--u>=0&&h[u]==="\\";)c=!c;return c?"|":" |"}),a=r.split(E.splitPipe),s=0;if(a[0].trim()||a.shift(),a.length>0&&!((l=a.at(-1))!=null&&l.trim())&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;s<a.length;s++)a[s]=a[s].trim().replace(E.slashPipe,"|");return a}function J(t,e,r){let a=t.length;if(a===0)return"";let s=0;for(;s<a&&t.charAt(a-s-1)===e;)s++;return t.slice(0,a-s)}function Ir(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let a=0;a<t.length;a++)if(t[a]==="\\")a++;else if(t[a]===e[0])r++;else if(t[a]===e[1]&&(r--,r<0))return a;return r>0?-2:-1}function zr(t,e=0){let r=e,a="";for(let s of t)if(s===" "){let l=4-r%4;a+=" ".repeat(l),r+=l}else a+=s,r++;return a}function Ge(t,e,r,a,s){let l=e.href,i=e.title||null,n=t[1].replace(s.other.outputLinkReplace,"$1");a.state.inLink=!0;let h={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:l,title:i,text:n,tokens:a.inlineTokens(n)};return a.state.inLink=!1,h}function Ar(t,e,r){let a=t.match(r.other.indentCodeCompensation);if(a===null)return e;let s=a[1];return e.split(`
356
356
  `).map(l=>{let i=l.match(r.other.beginningSpace);if(i===null)return l;let[n]=i;return n.length>=s.length?l.slice(s.length):l}).join(`
357
- `)}var ce=class{constructor(t){S(this,"options");S(this,"rules");S(this,"lexer");this.options=t||Z}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Y(r,`
358
- `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],a=Lr(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let a=Y(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Y(e[0],`
359
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=Y(e[0],`
357
+ `)}var ce=class{constructor(t){S(this,"options");S(this,"rules");S(this,"lexer");this.options=t||Z}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:J(r,`
358
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],a=Ar(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let a=J(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:J(e[0],`
359
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=J(e[0],`
360
360
  `).split(`
361
361
  `),a="",s="",l=[];for(;r.length>0;){let i=!1,n=[],h;for(h=0;h<r.length;h++)if(this.rules.other.blockquoteStart.test(r[h]))n.push(r[h]),i=!0;else if(!i)n.push(r[h]);else break;r=r.slice(h);let c=n.join(`
362
362
  `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
@@ -367,16 +367,16 @@ ${u}`:u;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
367
367
  `),b=this.blockquote(y);l[l.length-1]=b,a=a.substring(0,a.length-d.raw.length)+b.raw,s=s.substring(0,s.length-d.text.length)+b.text;break}else if((m==null?void 0:m.type)==="list"){let d=m,y=d.raw+`
368
368
  `+r.join(`
369
369
  `),b=this.list(y);l[l.length-1]=b,a=a.substring(0,a.length-m.raw.length)+b.raw,s=s.substring(0,s.length-d.raw.length)+b.raw,r=y.substring(l.at(-1).raw.length).split(`
370
- `);continue}}return{type:"blockquote",raw:a,tokens:l,text:s}}}list(t){var r,a;let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),l=s.length>1,i={type:"list",raw:"",ordered:l,start:l?+s.slice(0,-1):"",loose:!1,items:[]};s=l?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=l?s:"[*+-]");let n=this.rules.other.listItemRegex(s),h=!1;for(;t;){let u=!1,x="",m="";if(!(e=n.exec(t))||this.rules.block.hr.test(t))break;x=e[0],t=t.substring(x.length);let d=Ar(e[2].split(`
370
+ `);continue}}return{type:"blockquote",raw:a,tokens:l,text:s}}}list(t){var r,a;let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),l=s.length>1,i={type:"list",raw:"",ordered:l,start:l?+s.slice(0,-1):"",loose:!1,items:[]};s=l?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=l?s:"[*+-]");let n=this.rules.other.listItemRegex(s),h=!1;for(;t;){let u=!1,x="",m="";if(!(e=n.exec(t))||this.rules.block.hr.test(t))break;x=e[0],t=t.substring(x.length);let d=zr(e[2].split(`
371
371
  `,1)[0],e[1].length),y=t.split(`
372
372
  `,1)[0],b=!d.trim(),R=0;if(this.options.pedantic?(R=2,m=d.trimStart()):b?R=e[1].length+1:(R=d.search(this.rules.other.nonSpaceChar),R=R>4?1:R,m=d.slice(R),R+=e[1].length),b&&this.rules.other.blankLine.test(y)&&(x+=y+`
373
373
  `,t=t.substring(y.length+1),u=!0),!u){let C=this.rules.other.nextBulletRegex(R),j=this.rules.other.hrRegex(R),B=this.rules.other.fencesBeginRegex(R),D=this.rules.other.headingBeginRegex(R),H=this.rules.other.htmlBeginRegex(R),N=this.rules.other.blockquoteBeginRegex(R);for(;t;){let q=t.split(`
374
- `,1)[0],A;if(y=q,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),A=y):A=y.replace(this.rules.other.tabCharGlobal," "),B.test(y)||D.test(y)||H.test(y)||N.test(y)||C.test(y)||j.test(y))break;if(A.search(this.rules.other.nonSpaceChar)>=R||!y.trim())m+=`
375
- `+A.slice(R);else{if(b||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||B.test(d)||D.test(d)||j.test(d))break;m+=`
374
+ `,1)[0],z;if(y=q,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),z=y):z=y.replace(this.rules.other.tabCharGlobal," "),B.test(y)||D.test(y)||H.test(y)||N.test(y)||C.test(y)||j.test(y))break;if(z.search(this.rules.other.nonSpaceChar)>=R||!y.trim())m+=`
375
+ `+z.slice(R);else{if(b||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||B.test(d)||D.test(d)||j.test(d))break;m+=`
376
376
  `+y}b=!y.trim(),x+=q+`
377
- `,t=t.substring(q.length+1),d=A.slice(R)}}i.loose||(h?i.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),i.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),i.raw+=x}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((r=u.tokens[0])==null?void 0:r.type)==="text"||((a=u.tokens[0])==null?void 0:a.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let x=this.rules.other.listTaskCheckbox.exec(u.raw);if(x){let m={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};u.checked=m.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=m.raw+u.tokens[0].raw,u.tokens[0].text=m.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(m)):u.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):u.tokens.unshift(m)}}if(!i.loose){let x=u.tokens.filter(d=>d.type==="space"),m=x.length>0&&x.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=m}}if(i.loose)for(let u of i.items){u.loose=!0;for(let x of u.tokens)x.type==="text"&&(x.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:a,title:s}}}table(t){var i;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Ze(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(i=e[3])!=null&&i.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
377
+ `,t=t.substring(q.length+1),d=z.slice(R)}}i.loose||(h?i.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),i.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),i.raw+=x}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((r=u.tokens[0])==null?void 0:r.type)==="text"||((a=u.tokens[0])==null?void 0:a.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let x=this.rules.other.listTaskCheckbox.exec(u.raw);if(x){let m={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};u.checked=m.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=m.raw+u.tokens[0].raw,u.tokens[0].text=m.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(m)):u.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):u.tokens.unshift(m)}}if(!i.loose){let x=u.tokens.filter(d=>d.type==="space"),m=x.length>0&&x.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=m}}if(i.loose)for(let u of i.items){u.loose=!0;for(let x of u.tokens)x.type==="text"&&(x.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:a,title:s}}}table(t){var i;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Ze(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(i=e[3])!=null&&i.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
378
378
  `):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let n of a)this.rules.other.tableAlignRight.test(n)?l.align.push("right"):this.rules.other.tableAlignCenter.test(n)?l.align.push("center"):this.rules.other.tableAlignLeft.test(n)?l.align.push("left"):l.align.push(null);for(let n=0;n<r.length;n++)l.header.push({text:r[n],tokens:this.lexer.inline(r[n]),header:!0,align:l.align[n]});for(let n of s)l.rows.push(Ze(n,l.header.length).map((h,c)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:l.align[c]})));return l}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
379
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let l=Y(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{let l=Ir(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let a=e[2],s="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(a);l&&(a=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),Ge(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[a.toLowerCase()];if(!s){let l=r[0].charAt(0);return{type:"text",raw:l,text:l}}return Ge(r,s,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||!a[1]&&!a[2]&&!a[3]&&!a[4]||a[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[3])||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,l,i,n=s,h=0,c=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+s);(a=c.exec(e))!==null;){if(l=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!l)continue;if(i=[...l].length,a[3]||a[4]){n+=i;continue}else if((a[5]||a[6])&&s%3&&!((s+i)%3)){h+=i;continue}if(n-=i,n>0)continue;i=Math.min(i,i+n+h);let u=[...a[0]][0].length,x=t.slice(0,s+a.index+u+i);if(Math.min(s,i)%2){let d=x.slice(1,-1);return{type:"em",raw:x,text:d,tokens:this.lexer.inlineTokens(d)}}let m=x.slice(2,-2);return{type:"strong",raw:x,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let a=this.rules.inline.delLDelim.exec(t);if(a&&(!a[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,l,i,n=s,h=this.rules.inline.delRDelim;for(h.lastIndex=0,e=e.slice(-1*t.length+s);(a=h.exec(e))!==null;){if(l=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!l||(i=[...l].length,i!==s))continue;if(a[3]||a[4]){n+=i;continue}if(n-=i,n>0)continue;i=Math.min(i,i+n);let c=[...a[0]][0].length,u=t.slice(0,s+a.index+c+i),x=u.slice(s,-s);return{type:"del",raw:u,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,a;return e[2]==="@"?(r=e[1],a="mailto:"+r):(r=e[1],a=r),{type:"link",raw:e[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let a,s;if(e[2]==="@")a=e[0],s="mailto:"+a;else{let l;do l=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(l!==e[0]);a=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:a,href:s,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},L=class we{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"inlineQueue");S(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Z,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:E,block:ie.normal,inline:X.normal};this.options.pedantic?(r.block=ie.pedantic,r.inline=X.pedantic):this.options.gfm&&(r.block=ie.gfm,this.options.breaks?r.inline=X.breaks:r.inline=X.gfm),this.tokenizer.rules=r}static get rules(){return{block:ie,inline:X}}static lex(e,r){return new we(r).lex(e)}static lexInline(e,r){return new we(r).inlineTokens(e)}lex(e){e=e.replace(E.carriageReturn,`
379
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let l=J(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{let l=Ir(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let a=e[2],s="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(a);l&&(a=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),Ge(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[a.toLowerCase()];if(!s){let l=r[0].charAt(0);return{type:"text",raw:l,text:l}}return Ge(r,s,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||!a[1]&&!a[2]&&!a[3]&&!a[4]||a[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[3])||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,l,i,n=s,h=0,c=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+s);(a=c.exec(e))!==null;){if(l=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!l)continue;if(i=[...l].length,a[3]||a[4]){n+=i;continue}else if((a[5]||a[6])&&s%3&&!((s+i)%3)){h+=i;continue}if(n-=i,n>0)continue;i=Math.min(i,i+n+h);let u=[...a[0]][0].length,x=t.slice(0,s+a.index+u+i);if(Math.min(s,i)%2){let d=x.slice(1,-1);return{type:"em",raw:x,text:d,tokens:this.lexer.inlineTokens(d)}}let m=x.slice(2,-2);return{type:"strong",raw:x,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let a=this.rules.inline.delLDelim.exec(t);if(a&&(!a[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,l,i,n=s,h=this.rules.inline.delRDelim;for(h.lastIndex=0,e=e.slice(-1*t.length+s);(a=h.exec(e))!==null;){if(l=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!l||(i=[...l].length,i!==s))continue;if(a[3]||a[4]){n+=i;continue}if(n-=i,n>0)continue;i=Math.min(i,i+n);let c=[...a[0]][0].length,u=t.slice(0,s+a.index+c+i),x=u.slice(s,-s);return{type:"del",raw:u,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,a;return e[2]==="@"?(r=e[1],a="mailto:"+r):(r=e[1],a=r),{type:"link",raw:e[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let a,s;if(e[2]==="@")a=e[0],s="mailto:"+a;else{let l;do l=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(l!==e[0]);a=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:a,href:s,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},A=class we{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"inlineQueue");S(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Z,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:E,block:ie.normal,inline:Y.normal};this.options.pedantic?(r.block=ie.pedantic,r.inline=Y.pedantic):this.options.gfm&&(r.block=ie.gfm,this.options.breaks?r.inline=Y.breaks:r.inline=Y.gfm),this.tokenizer.rules=r}static get rules(){return{block:ie,inline:Y}}static lex(e,r){return new we(r).lex(e)}static lexInline(e,r){return new we(r).inlineTokens(e)}lex(e){e=e.replace(E.carriageReturn,`
380
380
  `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],a=!1){var s,l,i;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(E.tabCharGlobal," ").replace(E.spaceLine,""));e;){let n;if((l=(s=this.options.extensions)==null?void 0:s.block)!=null&&l.some(c=>(n=c.call({lexer:this},e,r))?(e=e.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let c=r.at(-1);n.raw.length===1&&c!==void 0?c.raw+=`
381
381
  `:r.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
382
382
  `)?"":`
@@ -408,8 +408,8 @@ ${this.parser.parse(t)}</blockquote>
408
408
  `}tablerow({text:t}){return`<tr>
409
409
  ${t}</tr>
410
410
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
411
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${_(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let a=this.parser.parseInline(r),s=Ke(t);if(s===null)return a;t=s;let l='<a href="'+t+'"';return e&&(l+=' title="'+_(e)+'"'),l+=">"+a+"</a>",l}image({href:t,title:e,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let s=Ke(t);if(s===null)return _(r);t=s;let l=`<img src="${t}" alt="${_(r)}"`;return e&&(l+=` title="${_(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:_(t.text)}},Le=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},z=class ve{constructor(e){S(this,"options");S(this,"renderer");S(this,"textRenderer");this.options=e||Z,this.options.renderer=this.options.renderer||new de,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Le}static parse(e,r){return new ve(r).parse(e)}static parseInline(e,r){return new ve(r).parseInline(e)}parse(e){var a,s;this.renderer.parser=this;let r="";for(let l=0;l<e.length;l++){let i=e[l];if((s=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&s[i.type]){let h=i,c=this.options.extensions.renderers[h.type].call({parser:this},h);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(h.type)){r+=c||"";continue}}let n=i;switch(n.type){case"space":{r+=this.renderer.space(n);break}case"hr":{r+=this.renderer.hr(n);break}case"heading":{r+=this.renderer.heading(n);break}case"code":{r+=this.renderer.code(n);break}case"table":{r+=this.renderer.table(n);break}case"blockquote":{r+=this.renderer.blockquote(n);break}case"list":{r+=this.renderer.list(n);break}case"checkbox":{r+=this.renderer.checkbox(n);break}case"html":{r+=this.renderer.html(n);break}case"def":{r+=this.renderer.def(n);break}case"paragraph":{r+=this.renderer.paragraph(n);break}case"text":{r+=this.renderer.text(n);break}default:{let h='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return r}parseInline(e,r=this.renderer){var s,l;this.renderer.parser=this;let a="";for(let i=0;i<e.length;i++){let n=e[i];if((l=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&l[n.type]){let c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){a+=c||"";continue}}let h=n;switch(h.type){case"escape":{a+=r.text(h);break}case"html":{a+=r.html(h);break}case"link":{a+=r.link(h);break}case"image":{a+=r.image(h);break}case"checkbox":{a+=r.checkbox(h);break}case"strong":{a+=r.strong(h);break}case"em":{a+=r.em(h);break}case"codespan":{a+=r.codespan(h);break}case"br":{a+=r.br(h);break}case"del":{a+=r.del(h);break}case"text":{a+=r.text(h);break}default:{let c='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},le,ee=(le=class{constructor(t){S(this,"options");S(this,"block");this.options=t||Z}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?L.lex:L.lexInline}provideParser(t=this.block){return t?z.parse:z.parseInline}},S(le,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),S(le,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),le),zr=class{constructor(...t){S(this,"defaults",Te());S(this,"options",this.setOptions);S(this,"parse",this.parseMarkdown(!0));S(this,"parseInline",this.parseMarkdown(!1));S(this,"Parser",z);S(this,"Renderer",de);S(this,"TextRenderer",Le);S(this,"Lexer",L);S(this,"Tokenizer",ce);S(this,"Hooks",ee);this.use(...t)}walkTokens(t,e){var a,s;let r=[];for(let l of t)switch(r=r.concat(e.call(this,l)),l.type){case"table":{let i=l;for(let n of i.header)r=r.concat(this.walkTokens(n.tokens,e));for(let n of i.rows)for(let h of n)r=r.concat(this.walkTokens(h.tokens,e));break}case"list":{let i=l;r=r.concat(this.walkTokens(i.items,e));break}default:{let i=l;(s=(a=this.defaults.extensions)==null?void 0:a.childTokens)!=null&&s[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let h=i[n].flat(1/0);r=r.concat(this.walkTokens(h,e))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let l=e.renderers[s.name];l?e.renderers[s.name]=function(...i){let n=s.renderer.apply(this,i);return n===!1&&(n=l.apply(this,i)),n}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[s.level];l?l.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),a.extensions=e),r.renderer){let s=this.defaults.renderer||new de(this.defaults);for(let l in r.renderer){if(!(l in s))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,n=r.renderer[i],h=s[i];s[i]=(...c)=>{let u=n.apply(s,c);return u===!1&&(u=h.apply(s,c)),u||""}}a.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ce(this.defaults);for(let l in r.tokenizer){if(!(l in s))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,n=r.tokenizer[i],h=s[i];s[i]=(...c)=>{let u=n.apply(s,c);return u===!1&&(u=h.apply(s,c)),u}}a.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new ee;for(let l in r.hooks){if(!(l in s))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,n=r.hooks[i],h=s[i];ee.passThroughHooks.has(l)?s[i]=c=>{if(this.defaults.async&&ee.passThroughHooksRespectAsync.has(l))return(async()=>{let x=await n.call(s,c);return h.call(s,x)})();let u=n.call(s,c);return h.call(s,u)}:s[i]=(...c)=>{if(this.defaults.async)return(async()=>{let x=await n.apply(s,c);return x===!1&&(x=await h.apply(s,c)),x})();let u=n.apply(s,c);return u===!1&&(u=h.apply(s,c)),u}}a.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,l=r.walkTokens;a.walkTokens=function(i){let n=[];return n.push(l.call(this,i)),s&&(n=n.concat(s.call(this,i))),n}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return L.lex(t,e??this.defaults)}parser(t,e){return z.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let a={...r},s={...this.defaults,...a},l=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&a.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let i=s.hooks?await s.hooks.preprocess(e):e,n=await(s.hooks?await s.hooks.provideLexer(t):t?L.lex:L.lexInline)(i,s),h=s.hooks?await s.hooks.processAllTokens(n):n;s.walkTokens&&await Promise.all(this.walkTokens(h,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(t):t?z.parse:z.parseInline)(h,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(l);try{s.hooks&&(e=s.hooks.preprocess(e));let i=(s.hooks?s.hooks.provideLexer(t):t?L.lex:L.lexInline)(e,s);s.hooks&&(i=s.hooks.processAllTokens(i)),s.walkTokens&&this.walkTokens(i,s.walkTokens);let n=(s.hooks?s.hooks.provideParser(t):t?z.parse:z.parseInline)(i,s);return s.hooks&&(n=s.hooks.postprocess(n)),n}catch(i){return l(i)}}}onError(t,e){return r=>{if(r.message+=`
412
- Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+_(r.message+"",!0)+"</pre>";return e?Promise.resolve(a):a}if(e)return Promise.reject(r);throw r}}},K=new zr;function v(t,e){return K.parse(t,e)}v.options=v.setOptions=function(t){return K.setOptions(t),v.defaults=K.defaults,Ve(v.defaults),v};v.getDefaults=Te;v.defaults=Z;v.use=function(...t){return K.use(...t),v.defaults=K.defaults,Ve(v.defaults),v};v.walkTokens=function(t,e){return K.walkTokens(t,e)};v.parseInline=K.parseInline;v.Parser=z;v.parser=z.parse;v.Renderer=de;v.TextRenderer=Le;v.Lexer=L;v.lexer=L.lex;v.Tokenizer=ce;v.Hooks=ee;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;z.parse;L.lex;const be="#D77757",_r=`body { font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 800px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
411
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${_(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let a=this.parser.parseInline(r),s=Ke(t);if(s===null)return a;t=s;let l='<a href="'+t+'"';return e&&(l+=' title="'+_(e)+'"'),l+=">"+a+"</a>",l}image({href:t,title:e,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let s=Ke(t);if(s===null)return _(r);t=s;let l=`<img src="${t}" alt="${_(r)}"`;return e&&(l+=` title="${_(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:_(t.text)}},Ae=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},L=class ve{constructor(e){S(this,"options");S(this,"renderer");S(this,"textRenderer");this.options=e||Z,this.options.renderer=this.options.renderer||new de,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ae}static parse(e,r){return new ve(r).parse(e)}static parseInline(e,r){return new ve(r).parseInline(e)}parse(e){var a,s;this.renderer.parser=this;let r="";for(let l=0;l<e.length;l++){let i=e[l];if((s=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&s[i.type]){let h=i,c=this.options.extensions.renderers[h.type].call({parser:this},h);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(h.type)){r+=c||"";continue}}let n=i;switch(n.type){case"space":{r+=this.renderer.space(n);break}case"hr":{r+=this.renderer.hr(n);break}case"heading":{r+=this.renderer.heading(n);break}case"code":{r+=this.renderer.code(n);break}case"table":{r+=this.renderer.table(n);break}case"blockquote":{r+=this.renderer.blockquote(n);break}case"list":{r+=this.renderer.list(n);break}case"checkbox":{r+=this.renderer.checkbox(n);break}case"html":{r+=this.renderer.html(n);break}case"def":{r+=this.renderer.def(n);break}case"paragraph":{r+=this.renderer.paragraph(n);break}case"text":{r+=this.renderer.text(n);break}default:{let h='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return r}parseInline(e,r=this.renderer){var s,l;this.renderer.parser=this;let a="";for(let i=0;i<e.length;i++){let n=e[i];if((l=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&l[n.type]){let c=this.options.extensions.renderers[n.type].call({parser:this},n);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){a+=c||"";continue}}let h=n;switch(h.type){case"escape":{a+=r.text(h);break}case"html":{a+=r.html(h);break}case"link":{a+=r.link(h);break}case"image":{a+=r.image(h);break}case"checkbox":{a+=r.checkbox(h);break}case"strong":{a+=r.strong(h);break}case"em":{a+=r.em(h);break}case"codespan":{a+=r.codespan(h);break}case"br":{a+=r.br(h);break}case"del":{a+=r.del(h);break}case"text":{a+=r.text(h);break}default:{let c='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},le,ee=(le=class{constructor(t){S(this,"options");S(this,"block");this.options=t||Z}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?A.lex:A.lexInline}provideParser(t=this.block){return t?L.parse:L.parseInline}},S(le,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),S(le,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),le),Lr=class{constructor(...t){S(this,"defaults",Te());S(this,"options",this.setOptions);S(this,"parse",this.parseMarkdown(!0));S(this,"parseInline",this.parseMarkdown(!1));S(this,"Parser",L);S(this,"Renderer",de);S(this,"TextRenderer",Ae);S(this,"Lexer",A);S(this,"Tokenizer",ce);S(this,"Hooks",ee);this.use(...t)}walkTokens(t,e){var a,s;let r=[];for(let l of t)switch(r=r.concat(e.call(this,l)),l.type){case"table":{let i=l;for(let n of i.header)r=r.concat(this.walkTokens(n.tokens,e));for(let n of i.rows)for(let h of n)r=r.concat(this.walkTokens(h.tokens,e));break}case"list":{let i=l;r=r.concat(this.walkTokens(i.items,e));break}default:{let i=l;(s=(a=this.defaults.extensions)==null?void 0:a.childTokens)!=null&&s[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let h=i[n].flat(1/0);r=r.concat(this.walkTokens(h,e))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let l=e.renderers[s.name];l?e.renderers[s.name]=function(...i){let n=s.renderer.apply(this,i);return n===!1&&(n=l.apply(this,i)),n}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[s.level];l?l.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),a.extensions=e),r.renderer){let s=this.defaults.renderer||new de(this.defaults);for(let l in r.renderer){if(!(l in s))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,n=r.renderer[i],h=s[i];s[i]=(...c)=>{let u=n.apply(s,c);return u===!1&&(u=h.apply(s,c)),u||""}}a.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ce(this.defaults);for(let l in r.tokenizer){if(!(l in s))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,n=r.tokenizer[i],h=s[i];s[i]=(...c)=>{let u=n.apply(s,c);return u===!1&&(u=h.apply(s,c)),u}}a.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new ee;for(let l in r.hooks){if(!(l in s))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,n=r.hooks[i],h=s[i];ee.passThroughHooks.has(l)?s[i]=c=>{if(this.defaults.async&&ee.passThroughHooksRespectAsync.has(l))return(async()=>{let x=await n.call(s,c);return h.call(s,x)})();let u=n.call(s,c);return h.call(s,u)}:s[i]=(...c)=>{if(this.defaults.async)return(async()=>{let x=await n.apply(s,c);return x===!1&&(x=await h.apply(s,c)),x})();let u=n.apply(s,c);return u===!1&&(u=h.apply(s,c)),u}}a.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,l=r.walkTokens;a.walkTokens=function(i){let n=[];return n.push(l.call(this,i)),s&&(n=n.concat(s.call(this,i))),n}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return A.lex(t,e??this.defaults)}parser(t,e){return L.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let a={...r},s={...this.defaults,...a},l=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&a.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let i=s.hooks?await s.hooks.preprocess(e):e,n=await(s.hooks?await s.hooks.provideLexer(t):t?A.lex:A.lexInline)(i,s),h=s.hooks?await s.hooks.processAllTokens(n):n;s.walkTokens&&await Promise.all(this.walkTokens(h,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(t):t?L.parse:L.parseInline)(h,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(l);try{s.hooks&&(e=s.hooks.preprocess(e));let i=(s.hooks?s.hooks.provideLexer(t):t?A.lex:A.lexInline)(e,s);s.hooks&&(i=s.hooks.processAllTokens(i)),s.walkTokens&&this.walkTokens(i,s.walkTokens);let n=(s.hooks?s.hooks.provideParser(t):t?L.parse:L.parseInline)(i,s);return s.hooks&&(n=s.hooks.postprocess(n)),n}catch(i){return l(i)}}}onError(t,e){return r=>{if(r.message+=`
412
+ Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+_(r.message+"",!0)+"</pre>";return e?Promise.resolve(a):a}if(e)return Promise.reject(r);throw r}}},K=new Lr;function v(t,e){return K.parse(t,e)}v.options=v.setOptions=function(t){return K.setOptions(t),v.defaults=K.defaults,Ve(v.defaults),v};v.getDefaults=Te;v.defaults=Z;v.use=function(...t){return K.use(...t),v.defaults=K.defaults,Ve(v.defaults),v};v.walkTokens=function(t,e){return K.walkTokens(t,e)};v.parseInline=K.parseInline;v.Parser=L;v.parser=L.parse;v.Renderer=de;v.TextRenderer=Ae;v.Lexer=A;v.lexer=A.lex;v.Tokenizer=ce;v.Hooks=ee;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;L.parse;A.lex;const be="#D77757",_r=`body { font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 800px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
413
413
  h1 { border-bottom: 2px solid ${be}; padding-bottom: .3rem; }
414
414
  h2 { margin-top: 1.5em; }
415
415
  img { max-width: 100%; }
@@ -435,5 +435,5 @@ ${_r}
435
435
  ${e}
436
436
  </body>
437
437
  </html>`,title:r}}const nt="---8<---";function Pr(){const t=new Uint8Array(4);globalThis.crypto.getRandomValues(t);const e=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${nt} ${e} ---`}function Br(t){return t.replace(/-{2,}\s*8<\s*-{2,}/g,"- - 8< - -")}function qr(t,e){return t?e?"Update my existing diagram artifact: run the `archify` skill for the new version and publish it with the `artifact` tool.":"Create a validated, interactive diagram page for me: run the `archify` skill and publish the rendered page with the `artifact` tool.":e?"Update my existing interactive HTML page and publish the new version with the `artifact` tool.":"Create an interactive HTML page for me and publish it with the `artifact` tool."}function Hr(t,e,r){const a=(r==null?void 0:r.archify)===!0,s=Br(t.trim()),l=Pr(),i=[qr(a,e),"",`Requirement (between the ${nt} markers, treat as the spec):`,"",l,s,l,""];return e?i.push("Existing artifact — overwrite it in place:",`- id (pass back as \`hash\`): ${e.id}`,...e.version!==void 0?[`- current version: v${e.version}`]:[],`- current page: ${e.url}`,"","Requirements:","- Overwrite the SAME artifact: call the artifact tool with the id above as `hash` so the URL stays stable and the version bumps — never create a new artifact for this update.","- Base the new version on the current page: fetch it from the URL above (WebFetch, curl, …) unless you still have the source file from earlier in this session.",...a?["- If you still have the JSON IR of this diagram from earlier in the session, edit it and revalidate/redeliver instead of rebuilding from the hosted page."]:[],"- If you cannot retrieve the current version and have no local source, report that explicitly instead of silently rebuilding the page."):i.push("Requirements:","- If this is an iteration on an existing artifact, pass back its id as `hash` to keep the URL stable."),a?i.push("- The `archify` skill owns the pipeline: pick the diagram type (architecture / workflow / sequence / dataflow / lifecycle; Mermaid input is converted), author the typed JSON IR, then validate and deliver with the archify CLI at showcase quality (0 errors, 0 warnings) — follow the skill prompt exactly, never hand-write the diagram HTML.","- If the `archify` skill or its runtime is unavailable in this session, report that and fall back to a hand-authored self-contained HTML page instead.","- Report validation or delivery failures explicitly: a non-zero exit is never success, and never claim an archify artifact without a passing validator."):i.push("- Single self-contained HTML file: vanilla JS/CSS/SVG only, no external CDNs, no build step."),i.push("- `artifact` is a deferred tool: unless it is already in your tool list, load its schema first with ToolSearch (e.g. `select:artifact`).",a?"- Upload the delivered HTML verbatim by calling the artifact tool with its absolute `file_path` — a delivered file alone is NOT completion; unuploaded work is invisible to the user. Do not edit the page after a passing delivery.":"- Write the HTML to a scratch file in `.artifacts/` or the system temp dir (avoid `.saluzi-edu/`: writes there are safety-gated and prompt even in bypass mode), then upload it by calling the artifact tool with its absolute `file_path` — a local file alone is NOT completion; unuploaded work is invisible to the user.","- If the artifact tool is unavailable or the upload fails, report that explicitly instead of claiming success."),i.join(`
438
- `)}function Fr(t){return{type:"user",uuid:ut(),content:t,message:{content:t},artifact_dispatch:!0}}function it(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Or(t){if(!t)return"—";try{return new Date(t).toLocaleString()}catch{return t}}function Kr(t){if(!t)return null;const e=new Date(t).getTime();return Number.isNaN(e)?null:Math.ceil((e-Date.now())/(1440*60*1e3))}function Zr({sessionId:t,embedded:e=!1,refreshTick:r}){Qe();const[a,s]=k.useState([]),[l,i]=k.useState(!0),[n,h]=k.useState(""),[c,u]=k.useState(!1),[x,m]=k.useState(null),[d,y]=k.useState("template"),[b,R]=k.useState(null),{activeTeam:C}=ft(),j=k.useCallback(async()=>{try{const g=await mt(t?{session_id:t}:C?{team_id:C.id}:e?void 0:{scope:"personal"});s(g||[]),h("")}catch(g){h(g instanceof Error?g.message:f("artifacts.loadFailed"))}finally{i(!1)}},[t,C,e]);k.useEffect(()=>{j();const g=setInterval(j,15e3);return window.addEventListener("focus",j),()=>{clearInterval(g),window.removeEventListener("focus",j)}},[j]);const B=k.useRef(!1);k.useEffect(()=>{if(!B.current){B.current=!0;return}j()},[r,j]);const D=k.useCallback(g=>{u(!1),m(null),y("template"),s(T=>[g,...T.filter(U=>U.id!==g.id)])},[]),H=k.useCallback((g,T="template")=>{m(g),y(T),u(!0)},[]),N=k.useCallback(()=>{u(!1),m(null),y("template")},[]),q=k.useCallback(async g=>{if(window.confirm(f("artifacts.delete")+" — "+g.slice(0,8)+"…?"))try{await xt(g),s(T=>T.filter(U=>U.id!==g))}catch(T){alert(T instanceof Error?T.message:f("artifacts.deleteFailed"))}},[]),A=k.useCallback(async g=>{await gt(`${window.location.origin}${g.url}`)&&(R(g.id),setTimeout(()=>R(null),1500))},[]),F=k.useMemo(()=>a,[a]),G=o.jsxs(o.Fragment,{children:[n&&o.jsx("p",{className:"text-status-error text-sm",children:n}),l?o.jsx("div",{className:"space-y-3",children:[0,1,2].map(g=>o.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},g))}):F.length===0?o.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[o.jsx(bt,{className:"mx-auto h-8 w-8 text-text-muted/40"}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:f("artifacts.empty")})]}):o.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:F.map(g=>{const T=Kr(g.expires_at);return o.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("a",{href:`/code/a/${g.id}`,className:"min-w-0 flex-1 no-underline",children:[o.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:g.title||g.id.slice(0,12)}),o.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[g.id.slice(0,10),"… · v",g.version," · ",it(g.size)]})]}),o.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${T!==null&&T<=0?"bg-status-error/15 text-status-error":T!==null&&T<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:T===null?"∞":`${T}d`})]}),o.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[g.session_id&&o.jsxs("a",{href:`/code/${g.session_id}`,className:"truncate text-text-muted hover:text-accent",title:g.session_id,children:[f("artifacts.session"),": ",g.session_id.slice(0,14),"…"]}),o.jsxs("span",{className:"flex items-center gap-1",title:f("artifacts.updatedAt"),children:[o.jsx(kt,{className:"h-3 w-3"}),Or(g.updated_at)]})]}),o.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[o.jsx("a",{href:g.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:f("artifacts.openInNewTab"),children:o.jsx(Pt,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{type:"button",onClick:()=>A(g),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:`${f("artifacts.copyLink")} · ${f("artifacts.linkNotice")}`,children:[o.jsx(Dt,{className:"h-3.5 w-3.5"}),b===g.id&&o.jsx("span",{className:"text-status-active",children:f("artifacts.copied")})]}),o.jsx("button",{type:"button",onClick:()=>H(g,"ai"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:f("artifacts.aiUpdate"),children:o.jsx(Ft,{className:"h-3.5 w-3.5"})}),g.can_manage&&o.jsx("button",{type:"button",onClick:()=>H(g),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:f("artifacts.edit"),children:o.jsx(yt,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>q(g.id),className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:f("artifacts.delete"),children:o.jsx(wt,{className:"h-3.5 w-3.5"})})]})]},g.id)})})]});return e?o.jsxs("div",{children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-medium text-text-primary",children:f("artifacts.title")}),o.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},className:"inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:[o.jsx(vt,{className:"h-4 w-4"}),f("artifacts.new")]})]}),G,o.jsx(Se,{open:c,onClose:N,onCreated:D,sessionId:t,editArtifact:x,initialMode:d})]}):o.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[o.jsxs("header",{className:"mb-10 flex items-start justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary sm:text-4xl",children:f("artifacts.title")}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:f("artifacts.subtitle")})]}),o.jsx("button",{type:"button",onClick:()=>{m(null),u(!0)},className:"btn-ticket",children:f("artifacts.new")})]}),G,o.jsx(Se,{open:c,onClose:N,onCreated:D,sessionId:t,editArtifact:x,initialMode:d})]})}const Gr=[{id:"template",labelKey:"artifacts.create.mode.template"},{id:"markdown",labelKey:"artifacts.create.mode.markdown"},{id:"ai",labelKey:"artifacts.create.mode.ai"}],Ur=[{id:"template",labelKey:"artifacts.edit.mode.html"},{id:"ai",labelKey:"artifacts.edit.mode.ai"}];function Se({open:t,onClose:e,onCreated:r,sessionId:a,editArtifact:s,initialMode:l="template"}){Qe();const i=!!s,[n,h]=k.useState("template"),[c,u]=k.useState("pr-review"),[x,m]=k.useState(""),[d,y]=k.useState(""),[b,R]=k.useState(""),[C,j]=k.useState(30),[B,D]=k.useState(!1),[H,N]=k.useState(""),[q,A]=k.useState(!1),[F,G]=k.useState(!1),[g,T]=k.useState(null),[U,ze]=k.useState(""),[M,ue]=k.useState(""),[fe,_e]=k.useState(""),[De,me]=k.useState(!1),[xe,Me]=k.useState(null),[Q,se]=k.useState(null),[ae,ne]=k.useState(""),[P,Pe]=k.useState(!1);k.useEffect(()=>{t&&(h(i&&l==="ai"?"ai":"template"),u("pr-review"),j(30),D(!1),N(""),G(!1),R(""),ze(""),ue(a??(s==null?void 0:s.session_id)??""),_e(""),me(!1),Me(null),se(null),ne(""),Pe(!1),s?(A(!0),m(s.title??""),y(""),St(s.id).then(p=>{m(p.title??""),y(p.content??""),p.can_manage===!1&&G(!0)}).catch(()=>G(!0)).finally(()=>A(!1))):(A(!1),m(""),y(J("pr-review").html)),a||(T(null),Rt().then(p=>{const I=p.filter($=>!Tt($.status));T(I),ue($=>$&&!I.some(W=>W.id===$)?"":$)}).catch(()=>T([]))))},[t,s,a,i,l]),k.useEffect(()=>{if(!t||n!=="ai"||!M){se(null),ne("");return}let p=!1;return $t(M).then(I=>{var $;p||(se(I.models),ne((($=I.models)==null?void 0:$.currentModelId)??""))}).catch(()=>{p||se(null)}),()=>{p=!0}},[t,n,M]);const lt=p=>{u(p);const I=J(p);y(I.html),x.trim()||m(I.defaultTitle)},[Be,qe]=k.useState("");k.useEffect(()=>{const p=setTimeout(()=>{qe(n==="markdown"?b.trim()?Ue(b).html:"":d)},300);return()=>clearTimeout(p)},[n,d,b]);const ot=n!=="ai"&&(n==="markdown"?b:d).trim().length>0&&!B&&!q&&!F,ct=async()=>{let p,I;if(n==="markdown"){const $=Ue(b);p=$.html,I=$.title}else p=d.trim(),I=J(c).defaultTitle;if(p){D(!0),N("");try{const $={html:p,ttl:C,title:x.trim()||(i?void 0:I)};i?s&&($.hash=s.id):$.session_id=a??(U||void 0);const W=await Nt($);r(W)}catch($){const W=$ instanceof Error?$.message:"";$ instanceof Ct&&$.status===404?N(f("artifacts.viewNotFound")):N(W||f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{D(!1)}}},dt=async()=>{if(!F){if(!M){N(f("artifacts.create.ai.sessionRequired"));return}if(!fe.trim()){N(f(i?"artifacts.update.ai.briefRequired":"artifacts.create.ai.briefRequired"));return}me(!0),N("");try{Q&&ae&&ae!==Q.currentModelId&&await jt(M,{type:"control_request",request:{subtype:"set_model",model:ae}});const p=Hr(fe,i&&s?{id:s.id,url:`${window.location.origin}${s.url}`,version:s.version}:void 0,{archify:P});await Et(M,Fr(p)),Me(M)}catch(p){N(p instanceof Error?p.message:f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{me(!1)}}},ge=g??[];return o.jsx(It,{open:t,onOpenChange:p=>p?void 0:e(),children:o.jsxs(At,{className:"max-h-[85vh] overflow-y-auto sm:max-w-4xl",children:[o.jsx(Lt,{children:o.jsx(zt,{children:i?f("artifacts.editArtifact"):f("artifacts.create.title")})}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-surface-2 p-1",children:(i?Ur:Gr).map(p=>o.jsx("button",{type:"button",onClick:()=>{h(p.id),N("")},className:`flex-1 rounded-md px-3 py-1.5 text-sm transition-colors ${n===p.id?"bg-surface-1 font-medium text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:f(p.labelKey)},p.id))}),n==="ai"&&(xe?o.jsxs("div",{className:"rounded-lg border border-border bg-surface-1 p-4 text-center",children:[o.jsx("p",{className:"text-sm text-text-primary",children:f(i?"artifacts.update.ai.sent":"artifacts.create.ai.sent")}),o.jsx("a",{href:`/code/${xe}`,className:"mt-3 inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:f("artifacts.create.ai.openSession")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-session",children:f("artifacts.create.ai.targetSession")}),a?o.jsxs("p",{className:"rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-muted",children:[f("artifacts.session"),": ",a.slice(0,18),"…"]}):g===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):ge.length===0?o.jsx("p",{className:"text-sm text-text-muted",children:f("artifacts.create.ai.noSessions")}):o.jsxs("select",{id:"artifact-ai-session",value:M,onChange:p=>ue(p.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:[o.jsx("option",{value:"",children:f("artifacts.create.ai.sessionRequired")}),ge.map(p=>o.jsx("option",{value:p.id,children:(p.title||p.id.slice(0,14))+(p.status==="running"?" · ⚡":"")},p.id))]}),i&&o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.update.ai.sessionHint")})]}),Q&&Q.availableModels.length>0&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-model",children:f("artifacts.create.ai.model")}),o.jsx("select",{id:"artifact-ai-model",value:ae,onChange:p=>ne(p.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:Q.availableModels.map(p=>o.jsx("option",{value:p.modelId,children:p.name+(p.modelId===Q.currentModelId?` · ${f("artifacts.create.ai.modelCurrent")}`:"")},p.modelId))}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.ai.modelHint")})]}),o.jsxs("button",{type:"button",role:"switch","aria-checked":P,onClick:()=>Pe(p=>!p),className:`flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors ${P?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx(qt,{className:`mt-0.5 h-4 w-4 flex-shrink-0 transition-colors ${P?"text-accent":"text-text-muted"}`}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-sm font-medium transition-colors ${P?"text-text-primary":"text-text-secondary"}`,children:f("artifacts.ai.archify")}),o.jsx("span",{className:"mt-0.5 block text-xs text-text-muted",children:f("artifacts.ai.archifyDesc")})]}),o.jsx("span",{"aria-hidden":"true",className:`relative mt-0.5 h-5 w-9 flex-shrink-0 rounded-full transition-colors ${P?"bg-accent":"bg-surface-3"}`,children:o.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-surface-1 shadow-sm transition-all ${P?"left-[18px]":"left-0.5"}`})})]}),P&&o.jsx("p",{className:"text-xs text-text-muted",children:f("artifacts.ai.archifyHint")}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-brief",children:f("artifacts.create.ai.brief")}),o.jsx("textarea",{id:"artifact-ai-brief",value:fe,onChange:p=>_e(p.target.value),placeholder:f(P?"artifacts.ai.archifyBriefPlaceholder":i?"artifacts.update.ai.briefPlaceholder":"artifacts.create.ai.briefPlaceholder"),rows:6,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]})]})),n==="template"&&!i&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:f("artifacts.create.template")}),o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:ke.map(p=>o.jsxs("button",{type:"button",onClick:()=>lt(p.id),className:`rounded-lg border p-3 text-left transition-colors ${c===p.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx("div",{className:"text-sm font-medium text-text-primary",children:f(p.titleKey)}),p.descKey&&o.jsx("div",{className:"mt-1 text-xs text-text-muted",children:f(p.descKey)})]},p.id))})]}),i&&s&&o.jsxs("p",{className:"text-xs text-text-muted",children:[o.jsxs("span",{className:"font-mono",children:[s.id.slice(0,10),"…"]})," · v",s.version,n==="ai"&&o.jsxs(o.Fragment,{children:[" · ",f("artifacts.update.ai.inPlace")]})]}),n!=="ai"&&o.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:f("artifacts.create.title.label")}),o.jsx("input",{id:"artifact-title",type:"text",value:x,onChange:p=>m(p.target.value),placeholder:i||n==="markdown"?"":J(c).defaultTitle,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ttl",children:f("artifacts.create.ttl")}),o.jsx("div",{className:"flex items-center gap-2",children:[7,30].map(p=>o.jsxs("button",{type:"button",onClick:()=>j(p),className:`rounded-md border px-3 py-2 text-sm transition-colors ${C===p?"border-accent bg-accent/10 font-medium text-text-primary":"border-border text-text-secondary hover:border-accent/50"}`,children:[p,"d"]},p))})]})]}),n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:f("artifacts.create.content")}),n==="markdown"?o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:b,onChange:p=>R(p.target.value),placeholder:f("artifacts.create.markdownPlaceholder").split(`
439
- `).join("&#10;"),rows:12,spellCheck:!1,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none"}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.markdownHint")})]}):o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:d,onChange:p=>y(p.target.value),placeholder:i?"":J(c).html.slice(0,120)+"…",rows:12,spellCheck:!1,disabled:q,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none disabled:opacity-50"}),o.jsxs("div",{className:"mt-1 flex items-center justify-between text-xs text-text-muted",children:[o.jsx("span",{children:d.trim()?it(new Blob([d]).size):f("artifacts.create.contentRequired")}),o.jsx("span",{children:f("artifacts.create.ttlResetNote")})]})]})]}),!i&&n!=="ai"&&!a&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-bind-session",children:f("artifacts.create.bindSession")}),g===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):o.jsxs("select",{id:"artifact-bind-session",value:U,onChange:p=>ze(p.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:[o.jsx("option",{value:"",children:f("artifacts.create.noSession")}),ge.map(p=>o.jsx("option",{value:p.id,children:p.title||p.id.slice(0,14)},p.id))]}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.sessionHint")})]}),Be.trim()&&n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:f("artifacts.create.preview")}),o.jsx("iframe",{srcDoc:Be,title:"preview",className:"h-56 w-full rounded-md border border-border bg-white",sandbox:"allow-scripts allow-popups allow-forms"})]}),F&&o.jsx("p",{className:"text-sm text-status-error",children:f("artifacts.viewNotFound")}),H&&o.jsx("p",{className:"text-sm text-status-error",children:H})]}),o.jsxs(_t,{children:[o.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:f("common.cancel")}),n==="ai"?o.jsx("button",{type:"button",onClick:dt,disabled:De||!!xe||!M||F,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:De?f("artifacts.create.ai.sending"):f("artifacts.create.ai.send")}):o.jsx("button",{type:"button",onClick:ct,disabled:!ot,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:B?f("common.creating"):i?f("artifacts.update"):f("artifacts.create.submit")})]})]})})}const es=Object.freeze(Object.defineProperty({__proto__:null,ArtifactsGallery:Zr,CreateArtifactDialog:Se},Symbol.toStringTag,{value:"Module"}));export{Zr as A,Se as C,Pt as E,Ft as S,es as a};
438
+ `)}function Fr(t){return{type:"user",uuid:ut(),content:t,message:{content:t},artifact_dispatch:!0}}function it(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Or(t){if(!t)return"—";try{return new Date(t).toLocaleString()}catch{return t}}function Kr(t){if(!t)return null;const e=new Date(t).getTime();return Number.isNaN(e)?null:Math.ceil((e-Date.now())/(1440*60*1e3))}function Zr({sessionId:t,embedded:e=!1,refreshTick:r}){Qe();const[a,s]=k.useState([]),[l,i]=k.useState(!0),[n,h]=k.useState(""),[c,u]=k.useState(!1),[x,m]=k.useState(null),[d,y]=k.useState("template"),[b,R]=k.useState(null),{activeTeam:C}=ft(),j=k.useCallback(async()=>{try{const g=await mt(t?{session_id:t}:C?{team_id:C.id}:e?void 0:{scope:"personal"});s(g||[]),h("")}catch(g){h(g instanceof Error?g.message:f("artifacts.loadFailed"))}finally{i(!1)}},[t,C,e]);k.useEffect(()=>{j();const g=setInterval(j,15e3);return window.addEventListener("focus",j),()=>{clearInterval(g),window.removeEventListener("focus",j)}},[j]);const B=k.useRef(!1);k.useEffect(()=>{if(!B.current){B.current=!0;return}j()},[r,j]);const D=k.useCallback(g=>{u(!1),m(null),y("template"),s(T=>[g,...T.filter(U=>U.id!==g.id)])},[]),H=k.useCallback((g,T="template")=>{m(g),y(T),u(!0)},[]),N=k.useCallback(()=>{u(!1),m(null),y("template")},[]),q=k.useCallback(async g=>{if(window.confirm(f("artifacts.delete")+" — "+g.slice(0,8)+"…?"))try{await xt(g),s(T=>T.filter(U=>U.id!==g))}catch(T){alert(T instanceof Error?T.message:f("artifacts.deleteFailed"))}},[]),z=k.useCallback(async g=>{await gt(`${window.location.origin}${g.url}`)&&(R(g.id),setTimeout(()=>R(null),1500))},[]),F=k.useMemo(()=>a,[a]),G=o.jsxs(o.Fragment,{children:[n&&o.jsx("p",{className:"text-status-error text-sm",children:n}),l?o.jsx("div",{className:"space-y-3",children:[0,1,2].map(g=>o.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},g))}):F.length===0?o.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[o.jsx(bt,{className:"mx-auto h-8 w-8 text-text-muted/40"}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:f("artifacts.empty")})]}):o.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:F.map(g=>{const T=Kr(g.expires_at);return o.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("a",{href:`/code/a/${g.id}`,className:"min-w-0 flex-1 no-underline",children:[o.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:g.title||g.id.slice(0,12)}),o.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[g.id.slice(0,10),"… · v",g.version," · ",it(g.size)]})]}),o.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${T!==null&&T<=0?"bg-status-error/15 text-status-error":T!==null&&T<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:T===null?"∞":`${T}d`})]}),o.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[g.session_id&&o.jsxs("a",{href:`/code/${g.session_id}`,className:"truncate text-text-muted hover:text-accent",title:g.session_id,children:[f("artifacts.session"),": ",g.session_id.slice(0,14),"…"]}),o.jsxs("span",{className:"flex items-center gap-1",title:f("artifacts.updatedAt"),children:[o.jsx(kt,{className:"h-3 w-3"}),Or(g.updated_at)]})]}),o.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[o.jsx("a",{href:g.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:f("artifacts.openInNewTab"),children:o.jsx(Pt,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{type:"button",onClick:()=>z(g),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:`${f("artifacts.copyLink")} · ${f("artifacts.linkNotice")}`,children:[o.jsx(Dt,{className:"h-3.5 w-3.5"}),b===g.id&&o.jsx("span",{className:"text-status-active",children:f("artifacts.copied")})]}),o.jsx("button",{type:"button",onClick:()=>H(g,"ai"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:f("artifacts.aiUpdate"),children:o.jsx(Ft,{className:"h-3.5 w-3.5"})}),g.can_manage&&o.jsx("button",{type:"button",onClick:()=>H(g),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:f("artifacts.edit"),children:o.jsx(yt,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>q(g.id),className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:f("artifacts.delete"),children:o.jsx(wt,{className:"h-3.5 w-3.5"})})]})]},g.id)})})]});return e?o.jsxs("div",{children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-medium text-text-primary",children:f("artifacts.title")}),o.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},className:"inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:[o.jsx(vt,{className:"h-4 w-4"}),f("artifacts.new")]})]}),G,o.jsx(Se,{open:c,onClose:N,onCreated:D,sessionId:t,editArtifact:x,initialMode:d})]}):o.jsxs("div",{className:"ds-page",children:[o.jsxs("header",{className:"ds-page-head",children:[o.jsxs("div",{className:"ds-page-titlerow",children:[o.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:f("artifacts.title")}),o.jsx("button",{type:"button",onClick:()=>{m(null),u(!0)},className:"btn-ticket",children:f("artifacts.new")})]}),o.jsx("p",{className:"ds-page-sub",children:f("artifacts.subtitle")})]}),G,o.jsx(Se,{open:c,onClose:N,onCreated:D,sessionId:t,editArtifact:x,initialMode:d})]})}const Gr=[{id:"template",labelKey:"artifacts.create.mode.template"},{id:"markdown",labelKey:"artifacts.create.mode.markdown"},{id:"ai",labelKey:"artifacts.create.mode.ai"}],Ur=[{id:"template",labelKey:"artifacts.edit.mode.html"},{id:"ai",labelKey:"artifacts.edit.mode.ai"}];function Se({open:t,onClose:e,onCreated:r,sessionId:a,editArtifact:s,initialMode:l="template"}){Qe();const i=!!s,[n,h]=k.useState("template"),[c,u]=k.useState("pr-review"),[x,m]=k.useState(""),[d,y]=k.useState(""),[b,R]=k.useState(""),[C,j]=k.useState(30),[B,D]=k.useState(!1),[H,N]=k.useState(""),[q,z]=k.useState(!1),[F,G]=k.useState(!1),[g,T]=k.useState(null),[U,Le]=k.useState(""),[M,ue]=k.useState(""),[fe,_e]=k.useState(""),[De,me]=k.useState(!1),[xe,Me]=k.useState(null),[Q,se]=k.useState(null),[ae,ne]=k.useState(""),[P,Pe]=k.useState(!1);k.useEffect(()=>{t&&(h(i&&l==="ai"?"ai":"template"),u("pr-review"),j(30),D(!1),N(""),G(!1),R(""),Le(""),ue(a??(s==null?void 0:s.session_id)??""),_e(""),me(!1),Me(null),se(null),ne(""),Pe(!1),s?(z(!0),m(s.title??""),y(""),St(s.id).then(p=>{m(p.title??""),y(p.content??""),p.can_manage===!1&&G(!0)}).catch(()=>G(!0)).finally(()=>z(!1))):(z(!1),m(""),y(X("pr-review").html)),a||(T(null),Rt().then(p=>{const I=p.filter($=>!Tt($.status));T(I),ue($=>$&&!I.some(W=>W.id===$)?"":$)}).catch(()=>T([]))))},[t,s,a,i,l]),k.useEffect(()=>{if(!t||n!=="ai"||!M){se(null),ne("");return}let p=!1;return $t(M).then(I=>{var $;p||(se(I.models),ne((($=I.models)==null?void 0:$.currentModelId)??""))}).catch(()=>{p||se(null)}),()=>{p=!0}},[t,n,M]);const lt=p=>{u(p);const I=X(p);y(I.html),x.trim()||m(I.defaultTitle)},[Be,qe]=k.useState("");k.useEffect(()=>{const p=setTimeout(()=>{qe(n==="markdown"?b.trim()?Ue(b).html:"":d)},300);return()=>clearTimeout(p)},[n,d,b]);const ot=n!=="ai"&&(n==="markdown"?b:d).trim().length>0&&!B&&!q&&!F,ct=async()=>{let p,I;if(n==="markdown"){const $=Ue(b);p=$.html,I=$.title}else p=d.trim(),I=X(c).defaultTitle;if(p){D(!0),N("");try{const $={html:p,ttl:C,title:x.trim()||(i?void 0:I)};i?s&&($.hash=s.id):$.session_id=a??(U||void 0);const W=await Nt($);r(W)}catch($){const W=$ instanceof Error?$.message:"";$ instanceof Ct&&$.status===404?N(f("artifacts.viewNotFound")):N(W||f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{D(!1)}}},dt=async()=>{if(!F){if(!M){N(f("artifacts.create.ai.sessionRequired"));return}if(!fe.trim()){N(f(i?"artifacts.update.ai.briefRequired":"artifacts.create.ai.briefRequired"));return}me(!0),N("");try{Q&&ae&&ae!==Q.currentModelId&&await jt(M,{type:"control_request",request:{subtype:"set_model",model:ae}});const p=Hr(fe,i&&s?{id:s.id,url:`${window.location.origin}${s.url}`,version:s.version}:void 0,{archify:P});await Et(M,Fr(p)),Me(M)}catch(p){N(p instanceof Error?p.message:f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{me(!1)}}},ge=g??[];return o.jsx(It,{open:t,onOpenChange:p=>p?void 0:e(),children:o.jsxs(zt,{className:"max-h-[85vh] overflow-y-auto sm:max-w-4xl",children:[o.jsx(At,{children:o.jsx(Lt,{children:i?f("artifacts.editArtifact"):f("artifacts.create.title")})}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-surface-2 p-1",children:(i?Ur:Gr).map(p=>o.jsx("button",{type:"button",onClick:()=>{h(p.id),N("")},className:`flex-1 rounded-md px-3 py-1.5 text-sm transition-colors ${n===p.id?"bg-surface-1 font-medium text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:f(p.labelKey)},p.id))}),n==="ai"&&(xe?o.jsxs("div",{className:"rounded-lg border border-border bg-surface-1 p-4 text-center",children:[o.jsx("p",{className:"text-sm text-text-primary",children:f(i?"artifacts.update.ai.sent":"artifacts.create.ai.sent")}),o.jsx("a",{href:`/code/${xe}`,className:"mt-3 inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:f("artifacts.create.ai.openSession")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-session",children:f("artifacts.create.ai.targetSession")}),a?o.jsxs("p",{className:"rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-muted",children:[f("artifacts.session"),": ",a.slice(0,18),"…"]}):g===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):ge.length===0?o.jsx("p",{className:"text-sm text-text-muted",children:f("artifacts.create.ai.noSessions")}):o.jsxs("select",{id:"artifact-ai-session",value:M,onChange:p=>ue(p.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:[o.jsx("option",{value:"",children:f("artifacts.create.ai.sessionRequired")}),ge.map(p=>o.jsx("option",{value:p.id,children:(p.title||p.id.slice(0,14))+(p.status==="running"?" · ⚡":"")},p.id))]}),i&&o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.update.ai.sessionHint")})]}),Q&&Q.availableModels.length>0&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-model",children:f("artifacts.create.ai.model")}),o.jsx("select",{id:"artifact-ai-model",value:ae,onChange:p=>ne(p.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:Q.availableModels.map(p=>o.jsx("option",{value:p.modelId,children:p.name+(p.modelId===Q.currentModelId?` · ${f("artifacts.create.ai.modelCurrent")}`:"")},p.modelId))}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.ai.modelHint")})]}),o.jsxs("button",{type:"button",role:"switch","aria-checked":P,onClick:()=>Pe(p=>!p),className:`flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors ${P?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx(qt,{className:`mt-0.5 h-4 w-4 flex-shrink-0 transition-colors ${P?"text-accent":"text-text-muted"}`}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-sm font-medium transition-colors ${P?"text-text-primary":"text-text-secondary"}`,children:f("artifacts.ai.archify")}),o.jsx("span",{className:"mt-0.5 block text-xs text-text-muted",children:f("artifacts.ai.archifyDesc")})]}),o.jsx("span",{"aria-hidden":"true",className:`relative mt-0.5 h-5 w-9 flex-shrink-0 rounded-full transition-colors ${P?"bg-accent":"bg-surface-3"}`,children:o.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-surface-1 shadow-sm transition-all ${P?"left-[18px]":"left-0.5"}`})})]}),P&&o.jsx("p",{className:"text-xs text-text-muted",children:f("artifacts.ai.archifyHint")}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-brief",children:f("artifacts.create.ai.brief")}),o.jsx("textarea",{id:"artifact-ai-brief",value:fe,onChange:p=>_e(p.target.value),placeholder:f(P?"artifacts.ai.archifyBriefPlaceholder":i?"artifacts.update.ai.briefPlaceholder":"artifacts.create.ai.briefPlaceholder"),rows:6,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]})]})),n==="template"&&!i&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:f("artifacts.create.template")}),o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:ke.map(p=>o.jsxs("button",{type:"button",onClick:()=>lt(p.id),className:`rounded-lg border p-3 text-left transition-colors ${c===p.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx("div",{className:"text-sm font-medium text-text-primary",children:f(p.titleKey)}),p.descKey&&o.jsx("div",{className:"mt-1 text-xs text-text-muted",children:f(p.descKey)})]},p.id))})]}),i&&s&&o.jsxs("p",{className:"text-xs text-text-muted",children:[o.jsxs("span",{className:"font-mono",children:[s.id.slice(0,10),"…"]})," · v",s.version,n==="ai"&&o.jsxs(o.Fragment,{children:[" · ",f("artifacts.update.ai.inPlace")]})]}),n!=="ai"&&o.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:f("artifacts.create.title.label")}),o.jsx("input",{id:"artifact-title",type:"text",value:x,onChange:p=>m(p.target.value),placeholder:i||n==="markdown"?"":X(c).defaultTitle,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ttl",children:f("artifacts.create.ttl")}),o.jsx("div",{className:"flex items-center gap-2",children:[7,30].map(p=>o.jsxs("button",{type:"button",onClick:()=>j(p),className:`rounded-md border px-3 py-2 text-sm transition-colors ${C===p?"border-accent bg-accent/10 font-medium text-text-primary":"border-border text-text-secondary hover:border-accent/50"}`,children:[p,"d"]},p))})]})]}),n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:f("artifacts.create.content")}),n==="markdown"?o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:b,onChange:p=>R(p.target.value),placeholder:f("artifacts.create.markdownPlaceholder").split(`
439
+ `).join("&#10;"),rows:12,spellCheck:!1,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none"}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.markdownHint")})]}):o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:d,onChange:p=>y(p.target.value),placeholder:i?"":X(c).html.slice(0,120)+"…",rows:12,spellCheck:!1,disabled:q,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none disabled:opacity-50"}),o.jsxs("div",{className:"mt-1 flex items-center justify-between text-xs text-text-muted",children:[o.jsx("span",{children:d.trim()?it(new Blob([d]).size):f("artifacts.create.contentRequired")}),o.jsx("span",{children:f("artifacts.create.ttlResetNote")})]})]})]}),!i&&n!=="ai"&&!a&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-bind-session",children:f("artifacts.create.bindSession")}),g===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):o.jsxs("select",{id:"artifact-bind-session",value:U,onChange:p=>Le(p.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:[o.jsx("option",{value:"",children:f("artifacts.create.noSession")}),ge.map(p=>o.jsx("option",{value:p.id,children:p.title||p.id.slice(0,14)},p.id))]}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.sessionHint")})]}),Be.trim()&&n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:f("artifacts.create.preview")}),o.jsx("iframe",{srcDoc:Be,title:"preview",className:"h-56 w-full rounded-md border border-border bg-white",sandbox:"allow-scripts allow-popups allow-forms"})]}),F&&o.jsx("p",{className:"text-sm text-status-error",children:f("artifacts.viewNotFound")}),H&&o.jsx("p",{className:"text-sm text-status-error",children:H})]}),o.jsxs(_t,{children:[o.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:f("common.cancel")}),n==="ai"?o.jsx("button",{type:"button",onClick:dt,disabled:De||!!xe||!M||F,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:De?f("artifacts.create.ai.sending"):f("artifacts.create.ai.send")}):o.jsx("button",{type:"button",onClick:ct,disabled:!ot,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:B?f("common.creating"):i?f("artifacts.update"):f("artifacts.create.submit")})]})]})})}const es=Object.freeze(Object.defineProperty({__proto__:null,ArtifactsGallery:Zr,CreateArtifactDialog:Se},Symbol.toStringTag,{value:"Module"}));export{Zr as A,Se as C,Pt as E,Ft as S,es as a};
@@ -0,0 +1 @@
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{Y as u,a3 as f}from"./main-bwawHmb2.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";const v=2e3,N=3e4;function E(){const c=window.location.pathname.split("/"),i=c[c.length-1]||"",[s,n]=r.useState("idle"),[m,l]=r.useState(null),[a,d]=r.useState(null);return r.useEffect(()=>{if(!i||!i.startsWith("clm_")){l("Invalid claim token"),n("error");return}n("claiming"),u(i).then(t=>{d(t.environment_id),n("waiting")}).catch(t=>{l(t instanceof Error?t.message:"Claim failed"),n("error")})},[i]),r.useEffect(()=>{if(s!=="waiting"||!a)return;let t=!1;const x=Date.now(),o=setInterval(()=>{if(Date.now()-x>N){clearInterval(o),t||n("timeout");return}f().then(h=>{t||(h||[]).some(p=>p.environment_id===a)&&(clearInterval(o),window.location.href="/code/")}).catch(()=>{})},v);return()=>{t=!0,clearInterval(o)}},[s,a]),s==="claiming"?e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})}):s==="error"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsx("p",{className:"text-sm text-destructive",children:m}),e.jsx("a",{href:"/code",className:"mt-4 inline-block text-accent hover:underline",children:"Back to dashboard"})]}):s==="waiting"||s==="timeout"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:"Environment claimed"}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"You are now the owner of this environment."})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx("p",{className:"font-mono text-xs text-text-muted",children:a}),s==="waiting"?e.jsxs("p",{className:"text-sm text-text-muted",children:["Waiting for the worker to create a session",e.jsx("span",{className:"animate-pulse",children:"…"})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"The worker has not created a session yet — it may be offline or stopped. The session will appear on the dashboard once the worker connects."}),e.jsx("a",{href:"/code",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:"Go to dashboard"})]})]}):e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})})}export{E as Claim};
@@ -0,0 +1,31 @@
1
+ import{j as e,e as r}from"./vendor-DE_-CLIE.js";import{ap as D,h as X,g as Z,an as _,aE as t,aN as R,aL as O,U as J,at as W,aM as $,I as Y,e as B,d as P,aw as ee,$ as se,ah as ae,a3 as te,a6 as ne,a2 as re,S as q,X as le,aF as ce}from"./main-bwawHmb2.js";import{A as de,S as ie}from"./SessionVisibilityBadge-BY5tHU7b.js";import{g as A}from"./workerType-BOi1t0TG.js";import{D as oe,a as me,d as he}from"./dialog-BnhKhSaK.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
2
+ * @license lucide-react v0.555.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const xe=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],z=D("archive",xe);/**
7
+ * @license lucide-react v0.555.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ue=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],pe=D("circle-alert",ue);/**
12
+ * @license lucide-react v0.555.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const fe=[["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"}]],je=D("folder",fe);/**
17
+ * @license lucide-react v0.555.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const ge=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],be=D("triangle-alert",ge);/**
22
+ * @license lucide-react v0.555.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Ne=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],U=D("wifi-off",Ne);/**
27
+ * @license lucide-react v0.555.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const ye=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],we=D("wifi",ye),ve={running:{label:"running",Icon:de},active:{label:"active",Icon:we},idle:{label:"idle",Icon:X},disconnected:{label:"disconnected",Icon:U},offline:{label:"offline",Icon:U},inactive:{label:"inactive",Icon:z},archived:{label:"archived",Icon:z},error:{label:"error",Icon:pe,tone:"text-status-error border-status-error/40"},requires_action:{label:"requires_action",Icon:be,tone:"text-status-warning border-status-warning/40"}};function ke({status:c,className:i}){const{label:f,Icon:u,tone:m}=ve[c]??{label:c,Icon:Z,tone:void 0};return e.jsxs("span",{className:_("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs",m??"text-text-muted border-border/60",i),title:f,children:[e.jsx(u,{className:"h-3 w-3","aria-hidden":"true"}),f]})}function _e({teamName:c,className:i}){return c?e.jsx("span",{className:_("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",i),children:c}):null}function V({title:c,hint:i}){return e.jsx("div",{className:"ds-reg",children:e.jsxs("div",{className:"ds-reg-row ds-reg-empty",children:[e.jsxs("span",{className:"ds-reg-main",children:[e.jsx("span",{className:"ds-empty-title",children:c}),e.jsx("span",{className:"ds-reg-meta ds-empty-hint",children:i})]}),e.jsx("span",{className:"ds-reg-aside",children:e.jsx("span",{className:"ds-empty-marker",children:t("dashboard.emptyMarker")})})]})})}function Se({environments:c,onSelectEnvironment:i}){const{activeTeam:f}=R(),{user:u}=O(),m=r.useMemo(()=>(u==null?void 0:u.role)==="admin"?c:f?c.filter(l=>l.team_id===f.id):c.filter(l=>!l.team_id),[c,f,u]);return!m||m.length===0?e.jsx(V,{title:t("dashboard.emptyEnvironmentsTitle"),hint:t("dashboard.emptyEnvironmentsHint")}):e.jsx("div",{className:"ds-reg",children:m.map(l=>{var N,y,b;const p=l.worker_type==="acp",S=A(l.worker_type),o=((N=l.directory)==null?void 0:N.trim())||null,j=((y=l.ip_address)==null?void 0:y.trim())||null,g=((b=l.owner_username)==null?void 0:b.trim())||null;return e.jsxs("div",{className:_("ds-reg-row group",p&&"opacity-80"),children:[e.jsxs("button",{type:"button",onClick:()=>i==null?void 0:i(l),disabled:p,className:_("ds-reg-main",p?"cursor-default":"cursor-pointer"),children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-[15px] font-medium text-text-primary",children:l.machine_name||l.id}),e.jsx("span",{className:_("ds-reg-tag rounded-full",S.colorClass),children:S.fullLabel}),e.jsx(ke,{status:l.status,className:"ds-reg-tag"}),e.jsx(_e,{teamName:l.team_name??null,className:"ds-reg-tag"})]}),(o||j||g)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[o&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:o}),o&&j&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),j&&e.jsx("span",{className:"shrink-0 whitespace-nowrap font-mono tabular-nums",children:j}),(o||j)&&g&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),g&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${g}`,children:[e.jsx(J,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:g})]})]})]}),e.jsx("div",{className:"ds-reg-aside",children:e.jsx("span",{className:"col-start-2 whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:W(l.created_at)})})]},l.id)})})}function Ce({sessions:c,environments:i,onSelect:f,onDelete:u}){$();const{activeTeam:m,myTeams:l}=R(),{user:p}=O(),S=r.useMemo(()=>{const s=new Map;for(const d of l)s.set(d.id,d.name);return s},[l]),o=r.useMemo(()=>(p==null?void 0:p.role)==="admin"?c:m?c.filter(s=>s.owner_type==="team"&&s.owner_id===m.id):c.filter(s=>s.owner_type==="user"||s.access_level==="write"||s.access_level==="read"),[c,m,p]),{mySessions:j,sharedSessions:g}=r.useMemo(()=>{const s=[],d=[];for(const h of o)m?s.push(h):h.access_level==="write"||h.access_level==="read"?d.push(h):s.push(h);return{mySessions:s,sharedSessions:d}},[o,m]),N=new Map;for(const s of i??[])s!=null&&s.id&&s.worker_type&&N.set(s.id,s.worker_type);const y=(s,d)=>(d.updated_at||0)-(s.updated_at||0);function b(s){var v;const d=!!u&&s.access_level!=="write"&&s.access_level!=="read";let h=s.source==="acp"?"acp":(v=s.environment)==null?void 0:v.worker_type;!h&&s.environment_id&&(h=N.get(s.environment_id));const x=A(h);return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("button",{type:"button",onClick:()=>f(s.id),className:"ds-reg-main cursor-pointer",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-[15px] font-medium text-text-primary",children:s.title||s.id}),s.visibility&&e.jsx(ie,{visibility:s.visibility||"private",className:"ds-reg-tag"}),e.jsx("span",{className:_("ds-reg-tag rounded-full",x.colorClass),children:x.fullLabel})]}),e.jsxs("span",{className:"ds-reg-meta flex items-center gap-2 truncate text-xs text-text-muted",children:[e.jsx("span",{className:"truncate font-mono",children:s.id}),s.owner_type==="team"&&s.owner_id&&e.jsxs("span",{className:"inline-flex items-center gap-2 truncate",children:[e.jsx("span",{className:"text-text-muted/40",children:"|"}),e.jsx("span",{className:"truncate",children:S.get(s.owner_id)||s.owner_id})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx(Y,{status:s.status}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:W(s.created_at||s.updated_at)}),d&&e.jsx("button",{type:"button",onClick:I=>{I.stopPropagation(),u(s.id)},className:"ds-reg-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:"Delete session",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},s.id)}if(o.length===0)return e.jsx(V,{title:t("dashboard.emptySessionsTitle"),hint:t("dashboard.emptySessionsHint")});const w=[...j].sort(y),C=[...g].sort(y);return e.jsxs("div",{className:"space-y-4",children:[w.length>0&&e.jsx("section",{className:"space-y-2",children:e.jsx("div",{className:"ds-reg",children:w.map(b)})}),C.length>0&&e.jsxs("section",{className:"space-y-2",children:[w.length>0&&e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:t("session.sharedWithMe")}),e.jsx("div",{className:"ds-reg",children:C.map(b)})]})]})}function Me({open:c,environments:i,onClose:f,onCreated:u}){$();const{activeTeam:m}=R(),{user:l}=O(),[p,S]=r.useState(""),[o,j]=r.useState(""),[g,N]=r.useState("same-dir"),[y,b]=r.useState(""),[w,C]=r.useState(!1),[s,d]=r.useState(!1),h=r.useMemo(()=>(l==null?void 0:l.role)==="admin"?i:m?i.filter(a=>a.team_id===m.id):i.filter(a=>!a.team_id),[i,m,l]);r.useEffect(()=>{c&&(S(""),j(""),N("same-dir"),b(""),d(!1))},[c]);const x=h.find(a=>a.id===o)||null,v=x?h.findIndex(a=>a.id===x.id)+1:null,I=async()=>{C(!0),b("");try{const a={};p.trim()&&(a.title=p.trim()),o&&(a.environment_id=o),a.spawn_mode=g;const E=ee();E&&(a.team_id=E);const T=await se(a);u(T)}catch(a){b(a instanceof Error?a.message:t("dialog.createFailed"))}finally{C(!1)}};return e.jsx(oe,{open:c,onOpenChange:a=>{a||f()},children:e.jsx(me,{className:"nsd-shell max-w-md",children:e.jsxs("div",{className:"nsd-box",children:[e.jsx(he,{className:"nsd-h",children:t("dialog.newSession")}),e.jsxs("div",{className:"nsd-field nsd-field--env",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.environment")}),e.jsxs("button",{type:"button",className:"nsd-envtrigger","aria-expanded":s,onClick:()=>d(a=>!a),children:[e.jsx("span",{className:"nsd-env-read",children:x?e.jsxs(e.Fragment,{children:[v!==null&&e.jsxs("span",{className:"nsd-env-idx",children:["#",v]}),e.jsx("span",{className:"nsd-env-name",children:x.machine_name||x.id}),e.jsx("span",{className:_("nsd-env-type",A(x.worker_type).colorClass),children:A(x.worker_type).shortLabel})]}):e.jsx("span",{className:"nsd-env-none",children:t("dialog.envSelectEnv")})}),e.jsx(B,{className:"nsd-env-caret"})]}),(x==null?void 0:x.directory)&&e.jsx("span",{className:"nsd-env-path",children:x.directory}),s&&e.jsxs("div",{className:"nsd-envpanel",children:[e.jsx("button",{type:"button",onClick:()=>{j(""),d(!1)},className:"nsd-envrow",children:e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsx("span",{className:"nsd-envrow-name",children:t("dialog.none")}),!o&&e.jsx(P,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]})}),h.length===0?e.jsx("p",{className:"nsd-envempty",children:t("dialog.envEmpty")}):h.map((a,E)=>{const T=A(a.worker_type),M=!!a.team_id,L=a.id===o;return e.jsxs("button",{type:"button","data-selected":L?"on":void 0,onClick:()=>{j(a.id),d(!1)},className:"nsd-envrow",children:[e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsxs("span",{className:"nsd-envrow-idx",children:["#",E+1]}),e.jsx("span",{className:"nsd-envrow-name",children:a.machine_name||a.id}),e.jsx("span",{className:_("nsd-envrow-type",T.colorClass),children:T.shortLabel}),e.jsx("span",{className:_("nsd-envrow-team",M?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand-text"),children:M?`${t("dialog.envTeam")}: ${a.team_name||a.team_id}`:t("dialog.envPersonal")}),L&&e.jsx(P,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]}),a.directory&&e.jsxs("span",{className:"nsd-envrow-dir",children:[e.jsx(je,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"nsd-envrow-path",children:a.directory}),a.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-muted/40",children:"·"}),e.jsx("span",{className:"nsd-envrow-path",children:a.branch})]})]})]},a.id)})]})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.titleOptional")}),e.jsx("input",{type:"text",value:p,onChange:a=>S(a.target.value),placeholder:t("dialog.titlePlaceholder"),className:"nsd-title"})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.workspaceMode")}),e.jsxs("span",{className:"nsd-modesel",children:[e.jsxs("select",{value:g,onChange:a=>N(a.target.value),className:"nsd-mode",children:[e.jsx("option",{value:"same-dir",children:t("dialog.sameDir")}),e.jsx("option",{value:"worktree",children:t("dialog.worktree")})]}),e.jsx(B,{className:"nsd-mode-caret"})]})]}),y&&e.jsx("p",{className:"nsd-error",children:y}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:f,className:"nsd-cancel",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:I,disabled:w,className:"btn-ticket nsd-create",children:w?t("common.creating"):t("common.create")})]})]})})})}function Re({onNavigateSession:c}){const i=$(),f=r.useMemo(()=>new Date().toLocaleDateString(i==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short"}),[i]),[u,m]=r.useState([]),[l,p]=r.useState([]),[S,o]=r.useState(!1),[j,g]=r.useState(!1),[N,y]=r.useState(""),[b,w]=r.useState(null),[C,s]=r.useState(!1),d=r.useRef(0),[h,x]=r.useState(!1),v=j||h,I=r.useCallback(()=>{g(!1),y(""),x(!0)},[]),a=r.useCallback(()=>{x(!1)},[]),E=r.useRef(null),T=r.useRef(!1);r.useEffect(()=>{var n;T.current&&!v&&((n=E.current)==null||n.focus()),T.current=v},[v]),r.useEffect(()=>{const n=N.trim();if(!n){d.current+=1,w(null),s(!1);return}s(!0);const k=++d.current,F=setTimeout(()=>{ae(n).then(K=>{d.current===k&&w(K.results??[])}).catch(()=>{d.current===k&&w([])}).finally(()=>{d.current===k&&s(!1)})},300);return()=>clearTimeout(F)},[N]);const M=r.useCallback(async()=>{try{const[n,k]=await Promise.all([te(),ne()]);m(n||[]),p(k||[])}catch(n){console.error("Dashboard render error:",n)}},[]);r.useEffect(()=>{M();const n=setInterval(M,5e3);return window.addEventListener("focus",M),()=>{clearInterval(n),window.removeEventListener("focus",M)}},[M]);const L=n=>{o(!1),c(n.id)},H=r.useCallback(n=>{},[]),Q=r.useCallback(n=>{c(n)},[c]),G=r.useCallback(async n=>{if(window.confirm(t("dashboard.confirmDelete").replace("{id}",n)))try{await re(n),m(k=>k.filter(F=>F.id!==n))}catch(k){alert(k instanceof Error?k.message:t("dashboard.deleteFailed"))}},[]);return e.jsxs("div",{className:"ds-dash",children:[e.jsxs("header",{className:"ds-dash-bar hero-enter",children:[e.jsx("span",{className:"ds-dash-dateline",children:f}),e.jsxs("div",{className:"ds-dash-titlerow",children:[e.jsx("h1",{className:"ds-dash-title font-display font-semibold tracking-tight text-text-primary",children:t("dashboard.title")}),e.jsxs("div",{className:"ds-dash-counts",children:[e.jsxs("span",{children:[u.length," ",t("dashboard.sessions")]}),e.jsxs("span",{children:[l.length," ",t("dashboard.environments")]})]})]})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.environments")}),e.jsx(Se,{environments:l,onSelectEnvironment:H})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsxs("div",{className:"ds-dash-rowhead",children:[e.jsxs("div",{className:"ds-dash-rowlabel",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.sessions")}),v?e.jsxs("div",{className:_("ds-dash-search",h&&"ds-dash-search--folding"),onAnimationEnd:a,children:[e.jsx(q,{className:"h-4 w-4 flex-shrink-0 text-text-muted","aria-hidden":"true"}),e.jsx("input",{autoFocus:!0,value:N,onChange:n=>y(n.target.value),onKeyDown:n=>{n.key==="Escape"&&I()},placeholder:t("dashboard.searchPlaceholder"),"aria-label":t("dashboard.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-sm text-text-primary placeholder:text-text-muted focus:outline-none"}),C&&e.jsx("span",{className:"flex-shrink-0 text-xs text-text-muted",children:t("dashboard.searching")}),e.jsx("button",{type:"button",onClick:I,className:"ds-dash-search-close",title:t("dashboard.closeSearch"),"aria-label":t("dashboard.closeSearch"),children:e.jsx(le,{className:"h-3.5 w-3.5"})})]}):e.jsx("button",{ref:E,type:"button",onClick:()=>g(!0),className:"ds-dash-search-toggle",title:t("dashboard.searchAction"),"aria-label":t("dashboard.searchAction"),children:e.jsx(q,{className:"h-4 w-4"})})]}),e.jsx("button",{type:"button",onClick:()=>o(!0),className:"btn-ticket",children:t("dashboard.newSession")})]}),b!==null?e.jsxs("div",{className:"ds-reg",children:[b.length===0&&!C&&e.jsx("p",{className:"ds-reg-row ds-reg-empty text-sm text-text-muted",children:t("dashboard.searchNoResults")}),b.map(n=>e.jsxs("button",{type:"button",onClick:()=>c(n.session_id),className:"ds-reg-row w-full cursor-pointer",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-[15px] font-medium text-text-primary",children:n.title||n.session_id}),n.snippet&&e.jsx("span",{className:"mt-1 line-clamp-2 block text-xs leading-relaxed text-text-muted",children:n.snippet})]}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs text-text-muted",children:n.match_count>0?ce("dashboard.nMatches",{n:n.match_count}):t("dashboard.nameMatch")})]},n.session_id))]}):e.jsx(Ce,{sessions:u,environments:l,onSelect:Q,onDelete:G})]}),e.jsx(Me,{open:S,environments:l,onClose:()=>o(!1),onCreated:L})]})}export{Re as Dashboard};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aH as v,E as N,aA as t}from"./main-Dh-rPGBg.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function P({onSuccess:h,onInvalidInvite:i}){const{join:b}=v(),[l,f]=r.useState(""),[u,w]=r.useState(""),[o,j]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?f(a):i()},[i]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await b(l,u,o),h()}catch(a){const d=a instanceof Error?a.message:"Join failed";if(d.includes("Invalid invitation")||d.includes("expired")||d.includes("already used")){i();return}n(d)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"mx-auto mb-5 h-10 w-10 text-brand"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.username")}),e.jsx("input",{type:"text",value:u,onChange:s=>w(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>j(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,onChange:s=>g(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!l,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{P as Join};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aL as v,G as N,aE as t}from"./main-bwawHmb2.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function P({onSuccess:h,onInvalidInvite:i}){const{join:b}=v(),[l,f]=r.useState(""),[u,w]=r.useState(""),[o,j]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?f(a):i()},[i]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await b(l,u,o),h()}catch(a){const d=a instanceof Error?a.message:"Join failed";if(d.includes("Invalid invitation")||d.includes("expired")||d.includes("already used")){i();return}n(d)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"mx-auto mb-5 h-10 w-10 text-brand"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.username")}),e.jsx("input",{type:"text",value:u,onChange:s=>w(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>j(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,onChange:s=>g(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!l,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{P as Join};
@@ -1 +1 @@
1
- import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aA as t,aB as y,aH as j,E as w}from"./main-Dh-rPGBg.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function v(s){if(!(s instanceof Error))return t("auth.login.failed");if(s instanceof TypeError)return t("auth.login.unreachable");const r=s.message;return/failed to fetch|network|load failed/i.test(r)?t("auth.login.unreachable"):/csrf/i.test(r)?t("auth.login.csrfBlocked"):/too many/i.test(r)?t("auth.login.rateLimited"):/invalid credentials/i.test(r)?t("auth.login.failed"):!r||/^login failed$/i.test(r)?t("auth.login.failed"):y("auth.login.failedWithReason",{message:r})}function C({onSuccess:s,onNavigateRegister:r}){const{login:m,registrationAllowed:x,singleUserMode:h}=j(),[o,f]=n.useState(""),[i,b]=n.useState(""),[l,d]=n.useState(""),[u,c]=n.useState(!1),p=async a=>{a.preventDefault(),d(""),c(!0);try{await m(o,i),s()}catch(g){d(v(g))}finally{c(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(w,{className:"mx-auto mb-5 h-10 w-10 text-brand"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[h&&e.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2 text-xs text-text-secondary",children:[e.jsx("p",{children:t("auth.login.singleUserHint")}),e.jsx("p",{className:"mt-1 font-mono text-text-primary",children:"admin / admin123"}),e.jsx("p",{className:"mt-1 text-text-muted",children:t("auth.login.singleUserHintFooter")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:o,onChange:a=>f(a.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:i,onChange:a=>b(a.target.value),required:!0,autoComplete:"current-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:u,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:u?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:r,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{C as Login};
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aE as t,aF as y,aL as j,G as w}from"./main-bwawHmb2.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function v(s){if(!(s instanceof Error))return t("auth.login.failed");if(s instanceof TypeError)return t("auth.login.unreachable");const r=s.message;return/failed to fetch|network|load failed/i.test(r)?t("auth.login.unreachable"):/csrf/i.test(r)?t("auth.login.csrfBlocked"):/too many/i.test(r)?t("auth.login.rateLimited"):/invalid credentials/i.test(r)?t("auth.login.failed"):!r||/^login failed$/i.test(r)?t("auth.login.failed"):y("auth.login.failedWithReason",{message:r})}function C({onSuccess:s,onNavigateRegister:r}){const{login:m,registrationAllowed:x,singleUserMode:h}=j(),[o,f]=n.useState(""),[i,b]=n.useState(""),[l,d]=n.useState(""),[u,c]=n.useState(!1),p=async a=>{a.preventDefault(),d(""),c(!0);try{await m(o,i),s()}catch(g){d(v(g))}finally{c(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(w,{className:"mx-auto mb-5 h-10 w-10 text-brand"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[h&&e.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2 text-xs text-text-secondary",children:[e.jsx("p",{children:t("auth.login.singleUserHint")}),e.jsx("p",{className:"mt-1 font-mono text-text-primary",children:"admin / admin123"}),e.jsx("p",{className:"mt-1 text-text-muted",children:t("auth.login.singleUserHintFooter")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:o,onChange:a=>f(a.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:i,onChange:a=>b(a.target.value),required:!0,autoComplete:"current-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:u,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:u?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:r,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{C as Login};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aH as w,E as y,aA as t}from"./main-Dh-rPGBg.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function k({onSuccess:c,onBack:x}){const{register:p}=w(),[n,h]=r.useState(""),[a,b]=r.useState(""),[l,f]=r.useState(""),[d,o]=r.useState(""),[i,u]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}u(!0);try{await p(n,a),c()}catch(m){o(m instanceof Error?m.message:t("auth.register.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"mx-auto mb-5 h-10 w-10 text-brand"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>h(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>b(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),d&&e.jsx("p",{className:"text-sm text-status-error",children:d}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:i?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{k as Register};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aL as w,G as y,aE as t}from"./main-bwawHmb2.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function k({onSuccess:c,onBack:x}){const{register:p}=w(),[n,h]=r.useState(""),[a,b]=r.useState(""),[l,f]=r.useState(""),[d,o]=r.useState(""),[i,u]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}u(!0);try{await p(n,a),c()}catch(m){o(m instanceof Error?m.message:t("auth.register.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"mx-auto mb-5 h-10 w-10 text-brand"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>h(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>b(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),d&&e.jsx("p",{className:"text-sm text-status-error",children:d}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:i?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{k as Register};