@saluzi/saluzi-edu 0.5.21 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/cli.js +444 -327
  2. package/dist/guide/guide-data.json +174 -174
  3. package/dist/rcs-web/assets/AdminPanel-D0fVkpU2.js +1 -0
  4. package/dist/rcs-web/assets/ArtifactView-DG0-kZ2G.js +1 -0
  5. package/{packages/remote-control-server/web/dist/assets/ArtifactsGallery-B63LTThv.js → dist/rcs-web/assets/ArtifactsGallery-CcobkOm1.js} +31 -31
  6. package/dist/rcs-web/assets/Claim-CltNvmRS.js +1 -0
  7. package/dist/rcs-web/assets/Dashboard-CEzuQ0N4.js +6 -0
  8. package/dist/rcs-web/assets/Join-DX0LzcPE.js +1 -0
  9. package/dist/rcs-web/assets/Login-BVKB4X_Z.js +1 -0
  10. package/dist/rcs-web/assets/Register-D-BrLVl3.js +1 -0
  11. package/dist/rcs-web/assets/RegisterEmpty-DdDXaiEn.js +26 -0
  12. package/dist/rcs-web/assets/SessionDetail-BkKSNMD8.js +78 -0
  13. package/dist/rcs-web/assets/{SessionVisibilityBadge-DA_Sg1dx.js → SessionVisibilityBadge-Ch3s2iFY.js} +2 -2
  14. package/dist/rcs-web/assets/Setup-CyGhRI5L.js +1 -0
  15. package/dist/rcs-web/assets/{ShareLanding-DaLDc5iV.js → ShareLanding-xKcBqmJb.js} +1 -1
  16. package/dist/rcs-web/assets/TeamDetail-C3Ne25hE.js +11 -0
  17. package/dist/rcs-web/assets/TeamList-C5Zyrj2-.js +1 -0
  18. package/dist/rcs-web/assets/TeamSettings-BsT93PQO.js +1 -0
  19. package/dist/rcs-web/assets/UserSearchInput-BFpwaVmp.js +6 -0
  20. package/dist/rcs-web/assets/UserSettings-cIzS243Z.js +1 -0
  21. package/dist/rcs-web/assets/{arc-CPhgreP8.js → arc-CiWQl09E.js} +1 -1
  22. package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-CpAi-qzk.js → architectureDiagram-3BPJPVTR-DL5Id6fa.js} +1 -1
  23. package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-DcsxgO1K.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-DF-nk9Fe.js} +1 -1
  24. package/{packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-BQ5cjzbZ.js → dist/rcs-web/assets/c4Diagram-AAUBKEIU-l_Pl6m2J.js} +1 -1
  25. package/dist/rcs-web/assets/channel-CBq46cRr.js +1 -0
  26. package/dist/rcs-web/assets/{chunk-2J33WTMH-wa-oCiR6.js → chunk-2J33WTMH-Dr5xQSXu.js} +1 -1
  27. package/dist/rcs-web/assets/{chunk-4BX2VUAB-D2ybEyPG.js → chunk-4BX2VUAB-DAPTU1FG.js} +1 -1
  28. package/dist/rcs-web/assets/{chunk-55IACEB6-CQGtwyGQ.js → chunk-55IACEB6-BgaGrvZR.js} +1 -1
  29. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-D0ITaMeP.js → dist/rcs-web/assets/chunk-727SXJPM-D6dnSxU3.js} +1 -1
  30. package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-BWRrcP1d.js → dist/rcs-web/assets/chunk-AQP2D5EJ-BVCad_JN.js} +1 -1
  31. package/dist/rcs-web/assets/{chunk-FMBD7UC4-C-CaLwfI.js → chunk-FMBD7UC4-BNLx608W.js} +1 -1
  32. package/dist/rcs-web/assets/{chunk-ND2GUHAM-OPpmIsi8.js → chunk-ND2GUHAM-BAHk1eiL.js} +1 -1
  33. package/dist/rcs-web/assets/{chunk-QZHKN3VN-Bq6R2yM7.js → chunk-QZHKN3VN-CX_4LT0M.js} +1 -1
  34. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-CYdZp3iH.js +1 -0
  35. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-CYdZp3iH.js +1 -0
  36. package/{packages/remote-control-server/web/dist/assets/code-block-IT6T5CEO-BQf-xjVa.js → dist/rcs-web/assets/code-block-IT6T5CEO-BoFB9z5v.js} +1 -1
  37. package/dist/rcs-web/assets/{copy-lzYYFmlH.js → copy-EPASKX-X.js} +1 -1
  38. package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-CuUSRgoZ.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-CMpuIlrx.js} +1 -1
  39. package/{packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-BP4ZP_3D.js → dist/rcs-web/assets/dagre-BM42HDAG-Dg4Q9j21.js} +1 -1
  40. package/dist/rcs-web/assets/{diagram-2AECGRRQ-XQnH0b9k.js → diagram-2AECGRRQ-YGGSegJh.js} +1 -1
  41. package/dist/rcs-web/assets/{diagram-5GNKFQAL-BnuYmMPD.js → diagram-5GNKFQAL-Rg7tQ7zl.js} +1 -1
  42. package/{packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-LymV4oAW.js → dist/rcs-web/assets/diagram-KO2AKTUF-FwQUsRJf.js} +1 -1
  43. package/dist/rcs-web/assets/{diagram-LMA3HP47-NSg5NWFp.js → diagram-LMA3HP47-DDzZwu_E.js} +1 -1
  44. package/dist/rcs-web/assets/{diagram-OG6HWLK6-kVTMFgtZ.js → diagram-OG6HWLK6-D6Pxp9XO.js} +1 -1
  45. package/dist/rcs-web/assets/dialog-Ort95zkZ.js +1 -0
  46. package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-BJBTtX2s.js → erDiagram-TEJ5UH35-BSDAq23h.js} +1 -1
  47. package/dist/rcs-web/assets/{flowDiagram-I6XJVG4X-CcQXZNID.js → flowDiagram-I6XJVG4X-CzWT0vwA.js} +1 -1
  48. package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-DW8iKyq_.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-DPNJQ_Co.js} +1 -1
  49. package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-BTBYx3LF.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-vHpFxzAD.js} +1 -1
  50. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-BRZAYc6t.js → infoDiagram-5YYISTIA-Bk_F8hwq.js} +1 -1
  51. package/{packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-BYMQtEeD.js → dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-CBYfpD17.js} +1 -1
  52. package/{packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-aqx7w1db.js → dist/rcs-web/assets/journeyDiagram-JHISSGLW-BxoYxLNN.js} +1 -1
  53. package/{packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-BxEHfP4O.js → dist/rcs-web/assets/kanban-definition-UN3LZRKU-B5pCpO1z.js} +1 -1
  54. package/dist/rcs-web/assets/{linear-Chjw8hPE.js → linear-BpcrEfNA.js} +1 -1
  55. package/dist/rcs-web/assets/main-BC4mcO_f.js +393 -0
  56. package/dist/rcs-web/assets/main-C0n90aVY.css +1 -0
  57. package/{packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-CrqI4db6.js → dist/rcs-web/assets/mermaid-VLURNSYL-DWwqH0oB.js} +4 -4
  58. package/dist/rcs-web/assets/{mermaid.core-EjsI3GC3.js → mermaid.core-CPGFiRhL.js} +5 -5
  59. package/dist/rcs-web/assets/{mindmap-definition-RKZ34NQL-D2rO_fGA.js → mindmap-definition-RKZ34NQL-DBF7JLl0.js} +1 -1
  60. package/dist/rcs-web/assets/{notifications-WMIbgYDP.js → notifications-C7DetfWu.js} +1 -1
  61. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-DDwJZfoh.js → pieDiagram-4H26LBE5-CbUgqUZY.js} +1 -1
  62. package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-DDtqMwKx.js → quadrantDiagram-W4KKPZXB-BUF-YWIU.js} +1 -1
  63. package/dist/rcs-web/assets/{refresh-cw-l0u8pxJi.js → refresh-cw-DBXI7gD3.js} +1 -1
  64. package/{packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-BtSk2-5u.js → dist/rcs-web/assets/requirementDiagram-4Y6WPE33-B8fyHxTP.js} +1 -1
  65. package/dist/rcs-web/assets/{sankeyDiagram-5OEKKPKP-SDLDMxUT.js → sankeyDiagram-5OEKKPKP-DAZKpwBw.js} +1 -1
  66. package/dist/rcs-web/assets/{sequenceDiagram-3UESZ5HK-D7iAclg1.js → sequenceDiagram-3UESZ5HK-DamEgVx-.js} +1 -1
  67. package/dist/rcs-web/assets/{stateDiagram-AJRCARHV-Bxx23fZH.js → stateDiagram-AJRCARHV-DU-QvteV.js} +1 -1
  68. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-z1g82auz.js → stateDiagram-v2-BHNVJYJU-C5QVbdY9.js} +1 -1
  69. package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-C8kBbm_V.js → timeline-definition-PNZ67QCA-Df0hGAH6.js} +1 -1
  70. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-CPldb1-R.js → vennDiagram-CIIHVFJN-DbX36wdR.js} +1 -1
  71. package/{packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-MCHB2fG7.js → dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-rjVkCTKo.js} +1 -1
  72. package/dist/rcs-web/assets/workerType-gCLCeJDi.js +6 -0
  73. package/dist/rcs-web/assets/{xychartDiagram-2RQKCTM6-CHj-KmL6.js → xychartDiagram-2RQKCTM6-CHjulBZn.js} +1 -1
  74. package/dist/rcs-web/index.html +2 -2
  75. package/package.json +2 -1
  76. package/packages/remote-control-server/src/__tests__/backgroundTaskPipeline.test.ts +216 -0
  77. package/packages/remote-control-server/src/__tests__/client-ip.test.ts +67 -0
  78. package/packages/remote-control-server/src/__tests__/teams.test.ts +44 -0
  79. package/packages/remote-control-server/src/client-ip.ts +57 -0
  80. package/packages/remote-control-server/src/db/sqlite.ts +22 -0
  81. package/packages/remote-control-server/src/routes/v1/environments.ts +4 -0
  82. package/packages/remote-control-server/src/routes/web/teams.ts +12 -1
  83. package/packages/remote-control-server/src/services/environment.ts +12 -0
  84. package/packages/remote-control-server/src/store.ts +37 -8
  85. package/packages/remote-control-server/src/types/api.ts +7 -0
  86. package/packages/remote-control-server/web/dist/assets/AdminPanel-D0fVkpU2.js +1 -0
  87. package/packages/remote-control-server/web/dist/assets/ArtifactView-DG0-kZ2G.js +1 -0
  88. package/{dist/rcs-web/assets/ArtifactsGallery-B63LTThv.js → packages/remote-control-server/web/dist/assets/ArtifactsGallery-CcobkOm1.js} +31 -31
  89. package/packages/remote-control-server/web/dist/assets/Claim-CltNvmRS.js +1 -0
  90. package/packages/remote-control-server/web/dist/assets/Dashboard-CEzuQ0N4.js +6 -0
  91. package/packages/remote-control-server/web/dist/assets/Join-DX0LzcPE.js +1 -0
  92. package/packages/remote-control-server/web/dist/assets/Login-BVKB4X_Z.js +1 -0
  93. package/packages/remote-control-server/web/dist/assets/Register-D-BrLVl3.js +1 -0
  94. package/packages/remote-control-server/web/dist/assets/RegisterEmpty-DdDXaiEn.js +26 -0
  95. package/packages/remote-control-server/web/dist/assets/SessionDetail-BkKSNMD8.js +78 -0
  96. package/packages/remote-control-server/web/dist/assets/{SessionVisibilityBadge-DA_Sg1dx.js → SessionVisibilityBadge-Ch3s2iFY.js} +2 -2
  97. package/packages/remote-control-server/web/dist/assets/Setup-CyGhRI5L.js +1 -0
  98. package/packages/remote-control-server/web/dist/assets/{ShareLanding-DaLDc5iV.js → ShareLanding-xKcBqmJb.js} +1 -1
  99. package/packages/remote-control-server/web/dist/assets/TeamDetail-C3Ne25hE.js +11 -0
  100. package/packages/remote-control-server/web/dist/assets/TeamList-C5Zyrj2-.js +1 -0
  101. package/packages/remote-control-server/web/dist/assets/TeamSettings-BsT93PQO.js +1 -0
  102. package/packages/remote-control-server/web/dist/assets/UserSearchInput-BFpwaVmp.js +6 -0
  103. package/packages/remote-control-server/web/dist/assets/UserSettings-cIzS243Z.js +1 -0
  104. package/packages/remote-control-server/web/dist/assets/{arc-CPhgreP8.js → arc-CiWQl09E.js} +1 -1
  105. package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-CpAi-qzk.js → architectureDiagram-3BPJPVTR-DL5Id6fa.js} +1 -1
  106. package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-DcsxgO1K.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-DF-nk9Fe.js} +1 -1
  107. package/{dist/rcs-web/assets/c4Diagram-AAUBKEIU-BQ5cjzbZ.js → packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-l_Pl6m2J.js} +1 -1
  108. package/packages/remote-control-server/web/dist/assets/channel-CBq46cRr.js +1 -0
  109. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-wa-oCiR6.js → chunk-2J33WTMH-Dr5xQSXu.js} +1 -1
  110. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-D2ybEyPG.js → chunk-4BX2VUAB-DAPTU1FG.js} +1 -1
  111. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-CQGtwyGQ.js → chunk-55IACEB6-BgaGrvZR.js} +1 -1
  112. package/{dist/rcs-web/assets/chunk-727SXJPM-D0ITaMeP.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-D6dnSxU3.js} +1 -1
  113. package/{dist/rcs-web/assets/chunk-AQP2D5EJ-BWRrcP1d.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-BVCad_JN.js} +1 -1
  114. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-C-CaLwfI.js → chunk-FMBD7UC4-BNLx608W.js} +1 -1
  115. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-OPpmIsi8.js → chunk-ND2GUHAM-BAHk1eiL.js} +1 -1
  116. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-Bq6R2yM7.js → chunk-QZHKN3VN-CX_4LT0M.js} +1 -1
  117. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-CYdZp3iH.js +1 -0
  118. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-CYdZp3iH.js +1 -0
  119. package/{dist/rcs-web/assets/code-block-IT6T5CEO-BQf-xjVa.js → packages/remote-control-server/web/dist/assets/code-block-IT6T5CEO-BoFB9z5v.js} +1 -1
  120. package/packages/remote-control-server/web/dist/assets/{copy-lzYYFmlH.js → copy-EPASKX-X.js} +1 -1
  121. package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-CuUSRgoZ.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-CMpuIlrx.js} +1 -1
  122. package/{dist/rcs-web/assets/dagre-BM42HDAG-BP4ZP_3D.js → packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-Dg4Q9j21.js} +1 -1
  123. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-XQnH0b9k.js → diagram-2AECGRRQ-YGGSegJh.js} +1 -1
  124. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-BnuYmMPD.js → diagram-5GNKFQAL-Rg7tQ7zl.js} +1 -1
  125. package/{dist/rcs-web/assets/diagram-KO2AKTUF-LymV4oAW.js → packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-FwQUsRJf.js} +1 -1
  126. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-NSg5NWFp.js → diagram-LMA3HP47-DDzZwu_E.js} +1 -1
  127. package/packages/remote-control-server/web/dist/assets/{diagram-OG6HWLK6-kVTMFgtZ.js → diagram-OG6HWLK6-D6Pxp9XO.js} +1 -1
  128. package/packages/remote-control-server/web/dist/assets/dialog-Ort95zkZ.js +1 -0
  129. package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-BJBTtX2s.js → erDiagram-TEJ5UH35-BSDAq23h.js} +1 -1
  130. package/packages/remote-control-server/web/dist/assets/{flowDiagram-I6XJVG4X-CcQXZNID.js → flowDiagram-I6XJVG4X-CzWT0vwA.js} +1 -1
  131. package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-DW8iKyq_.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-DPNJQ_Co.js} +1 -1
  132. package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-BTBYx3LF.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-vHpFxzAD.js} +1 -1
  133. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-BRZAYc6t.js → infoDiagram-5YYISTIA-Bk_F8hwq.js} +1 -1
  134. package/{dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-BYMQtEeD.js → packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-CBYfpD17.js} +1 -1
  135. package/{dist/rcs-web/assets/journeyDiagram-JHISSGLW-aqx7w1db.js → packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-BxoYxLNN.js} +1 -1
  136. package/{dist/rcs-web/assets/kanban-definition-UN3LZRKU-BxEHfP4O.js → packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-B5pCpO1z.js} +1 -1
  137. package/packages/remote-control-server/web/dist/assets/{linear-Chjw8hPE.js → linear-BpcrEfNA.js} +1 -1
  138. package/packages/remote-control-server/web/dist/assets/main-BC4mcO_f.js +393 -0
  139. package/packages/remote-control-server/web/dist/assets/main-C0n90aVY.css +1 -0
  140. package/{dist/rcs-web/assets/mermaid-VLURNSYL-CrqI4db6.js → packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-DWwqH0oB.js} +4 -4
  141. package/packages/remote-control-server/web/dist/assets/{mermaid.core-EjsI3GC3.js → mermaid.core-CPGFiRhL.js} +5 -5
  142. package/packages/remote-control-server/web/dist/assets/{mindmap-definition-RKZ34NQL-D2rO_fGA.js → mindmap-definition-RKZ34NQL-DBF7JLl0.js} +1 -1
  143. package/packages/remote-control-server/web/dist/assets/{notifications-WMIbgYDP.js → notifications-C7DetfWu.js} +1 -1
  144. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-DDwJZfoh.js → pieDiagram-4H26LBE5-CbUgqUZY.js} +1 -1
  145. package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-DDtqMwKx.js → quadrantDiagram-W4KKPZXB-BUF-YWIU.js} +1 -1
  146. package/packages/remote-control-server/web/dist/assets/{refresh-cw-l0u8pxJi.js → refresh-cw-DBXI7gD3.js} +1 -1
  147. package/{dist/rcs-web/assets/requirementDiagram-4Y6WPE33-BtSk2-5u.js → packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-B8fyHxTP.js} +1 -1
  148. package/packages/remote-control-server/web/dist/assets/{sankeyDiagram-5OEKKPKP-SDLDMxUT.js → sankeyDiagram-5OEKKPKP-DAZKpwBw.js} +1 -1
  149. package/packages/remote-control-server/web/dist/assets/{sequenceDiagram-3UESZ5HK-D7iAclg1.js → sequenceDiagram-3UESZ5HK-DamEgVx-.js} +1 -1
  150. package/packages/remote-control-server/web/dist/assets/{stateDiagram-AJRCARHV-Bxx23fZH.js → stateDiagram-AJRCARHV-DU-QvteV.js} +1 -1
  151. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-z1g82auz.js → stateDiagram-v2-BHNVJYJU-C5QVbdY9.js} +1 -1
  152. package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-C8kBbm_V.js → timeline-definition-PNZ67QCA-Df0hGAH6.js} +1 -1
  153. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-CPldb1-R.js → vennDiagram-CIIHVFJN-DbX36wdR.js} +1 -1
  154. package/{dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-MCHB2fG7.js → packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-rjVkCTKo.js} +1 -1
  155. package/packages/remote-control-server/web/dist/assets/workerType-gCLCeJDi.js +6 -0
  156. package/packages/remote-control-server/web/dist/assets/{xychartDiagram-2RQKCTM6-CHj-KmL6.js → xychartDiagram-2RQKCTM6-CHjulBZn.js} +1 -1
  157. package/packages/remote-control-server/web/dist/index.html +2 -2
  158. package/dist/rcs-web/assets/AdminPanel-fsacwgfK.js +0 -1
  159. package/dist/rcs-web/assets/ArtifactView-DmMwrTRk.js +0 -1
  160. package/dist/rcs-web/assets/Claim-hOGNTz-n.js +0 -1
  161. package/dist/rcs-web/assets/Dashboard-BBIlAMpr.js +0 -6
  162. package/dist/rcs-web/assets/Join-zelwrNDz.js +0 -1
  163. package/dist/rcs-web/assets/Login-BmYeCfbw.js +0 -1
  164. package/dist/rcs-web/assets/Register-Dfw4S_A0.js +0 -1
  165. package/dist/rcs-web/assets/SessionDetail-zXHv84SV.js +0 -83
  166. package/dist/rcs-web/assets/Setup-BTTET7Rk.js +0 -1
  167. package/dist/rcs-web/assets/TeamCreate-BWtaB-_Z.js +0 -1
  168. package/dist/rcs-web/assets/TeamDetail-Crmn6PaC.js +0 -6
  169. package/dist/rcs-web/assets/TeamList-B8Rob6VK.js +0 -1
  170. package/dist/rcs-web/assets/TeamSettings-CfRHolhe.js +0 -1
  171. package/dist/rcs-web/assets/UserSearchInput-DkaGgR76.js +0 -1
  172. package/dist/rcs-web/assets/UserSettings-D1oW7oVv.js +0 -1
  173. package/dist/rcs-web/assets/channel-DHj-rIRW.js +0 -1
  174. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-DsAw9J1B.js +0 -1
  175. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-DsAw9J1B.js +0 -1
  176. package/dist/rcs-web/assets/dialog-DrDf89nL.js +0 -1
  177. package/dist/rcs-web/assets/main-CJvwpIVn.css +0 -1
  178. package/dist/rcs-web/assets/main-Dh-rPGBg.js +0 -275
  179. package/dist/rcs-web/assets/workerType-BOi1t0TG.js +0 -1
  180. package/packages/remote-control-server/web/dist/assets/AdminPanel-fsacwgfK.js +0 -1
  181. package/packages/remote-control-server/web/dist/assets/ArtifactView-DmMwrTRk.js +0 -1
  182. package/packages/remote-control-server/web/dist/assets/Claim-hOGNTz-n.js +0 -1
  183. package/packages/remote-control-server/web/dist/assets/Dashboard-BBIlAMpr.js +0 -6
  184. package/packages/remote-control-server/web/dist/assets/Join-zelwrNDz.js +0 -1
  185. package/packages/remote-control-server/web/dist/assets/Login-BmYeCfbw.js +0 -1
  186. package/packages/remote-control-server/web/dist/assets/Register-Dfw4S_A0.js +0 -1
  187. package/packages/remote-control-server/web/dist/assets/SessionDetail-zXHv84SV.js +0 -83
  188. package/packages/remote-control-server/web/dist/assets/Setup-BTTET7Rk.js +0 -1
  189. package/packages/remote-control-server/web/dist/assets/TeamCreate-BWtaB-_Z.js +0 -1
  190. package/packages/remote-control-server/web/dist/assets/TeamDetail-Crmn6PaC.js +0 -6
  191. package/packages/remote-control-server/web/dist/assets/TeamList-B8Rob6VK.js +0 -1
  192. package/packages/remote-control-server/web/dist/assets/TeamSettings-CfRHolhe.js +0 -1
  193. package/packages/remote-control-server/web/dist/assets/UserSearchInput-DkaGgR76.js +0 -1
  194. package/packages/remote-control-server/web/dist/assets/UserSettings-D1oW7oVv.js +0 -1
  195. package/packages/remote-control-server/web/dist/assets/channel-DHj-rIRW.js +0 -1
  196. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-DsAw9J1B.js +0 -1
  197. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-DsAw9J1B.js +0 -1
  198. package/packages/remote-control-server/web/dist/assets/dialog-DrDf89nL.js +0 -1
  199. package/packages/remote-control-server/web/dist/assets/main-CJvwpIVn.css +0 -1
  200. package/packages/remote-control-server/web/dist/assets/main-Dh-rPGBg.js +0 -275
  201. package/packages/remote-control-server/web/dist/assets/workerType-BOi1t0TG.js +0 -1
@@ -0,0 +1 @@
1
+ import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{aL as x,aM as o,a3 as m,aD as s,at as l,I as u}from"./main-BC4mcO_f.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{aL as A,a4 as j,aD as r,a1 as q,ao as R,P as U,N as F}from"./main-BC4mcO_f.js";import{S as O,E as G,C as K}from"./ArtifactsGallery-CcobkOm1.js";import{R as P}from"./refresh-cw-DBXI7gD3.js";import{C as J}from"./copy-EPASKX-X.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";import"./dialog-Ort95zkZ.js";let m=null;function M(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 M(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-[10px] 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-[10px] 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-[10px] 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(P,{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(J,{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,19 +1,19 @@
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 Te,au as ut,aL as Qe,aM as ft,a5 as mt,aD as f,a1 as xt,ao as gt,F as bt,i as kt,P as yt,N as wt,t as vt,a4 as St,aa as Rt,ay as Tt,a9 as $t,ai as jt,aj as Et,_ as Nt,b as Ct}from"./main-BC4mcO_f.js";import{D as It,a as At,c as Lt,d as zt,b as _t}from"./dialog-Ort95zkZ.js";import{C as Dt}from"./copy-EPASKX-X.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Mt=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Pt=Re("external-link",Mt);/**
6
+ */const Mt=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Pt=Te("external-link",Mt);/**
7
7
  * @license lucide-react v0.555.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const Bt=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],qt=Re("network",Bt);/**
11
+ */const Bt=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],qt=Te("network",Bt);/**
12
12
  * @license lucide-react v0.555.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Ht=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ft=Re("sparkles",Ht),te=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
16
+ */const Ht=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ft=Te("sparkles",Ht),re=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
17
17
  h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
18
18
  .badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; }
19
19
  .badge.ok { background: #dcfce7; color: #166534; }
@@ -28,7 +28,7 @@ h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
28
28
  <meta name="viewport" content="width=device-width, initial-scale=1">
29
29
  <title>Untitled Artifact</title>
30
30
  <style>
31
- ${te}
31
+ ${re}
32
32
  </style>
33
33
  </head>
34
34
  <body>
@@ -43,7 +43,7 @@ ${te}
43
43
  <meta name="viewport" content="width=device-width, initial-scale=1">
44
44
  <title>PR Review</title>
45
45
  <style>
46
- ${te}
46
+ ${re}
47
47
  .file { border: 1px solid #e5e7eb; border-radius: 8px; margin: 12px 0; overflow: hidden; }
48
48
  .file-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f9fafb; cursor: pointer; }
49
49
  .file-head .name { font-family: ui-monospace, Menlo, monospace; font-size: 13px; flex: 1; }
@@ -125,7 +125,7 @@ render();
125
125
  <meta name="viewport" content="width=device-width, initial-scale=1">
126
126
  <title>Incident Timeline</title>
127
127
  <style>
128
- ${te}
128
+ ${re}
129
129
  #status-banner { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-weight: 500; }
130
130
  #status-banner.investigating { background: #fef3c7; color: #92400e; }
131
131
  #status-banner.mitigated { background: #dcfce7; color: #166534; }
@@ -191,7 +191,7 @@ render();
191
191
  <meta name="viewport" content="width=device-width, initial-scale=1">
192
192
  <title>Data Dashboard</title>
193
193
  <style>
194
- ${te}
194
+ ${re}
195
195
  .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
196
196
  .kpi { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
197
197
  .kpi .label { font-size: 12px; color: #6b7280; }
@@ -281,7 +281,7 @@ renderKpis(); renderChart(); renderTable();
281
281
  <meta name="viewport" content="width=device-width, initial-scale=1">
282
282
  <title>Release Checklist</title>
283
283
  <style>
284
- ${te}
284
+ ${re}
285
285
  .progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
286
286
  .progress > div { height: 100%; background: #D77757; width: 0; transition: width .3s; }
287
287
  .stage { margin: 18px 0; }
@@ -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>`,ye=[{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 Y(t){return ye.find(e=>e.id===t)??ye[0]}function $e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var K=$e();function Ve(t){K=t}var F={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(j.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}})(),j={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|$)|$)/,se=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,je=/ {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,je).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,je).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(),Ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,er=/^[^\n]+/,Ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,tr=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rr=w(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,je).getRegex(),he="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",Ce=/<!--(?:-?>|[\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",Ce).replace("tag",he).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ye=w(Ee).replace("hr",se).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",he).getRegex(),ar=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ye).getRegex(),Ie={blockquote:ar,code:Wt,def:tr,fences:Xt,heading:Yt,hr:se,html:sr,lheading:Xe,list:rr,newline:Vt,paragraph:Ye,table:F,text:er},He=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",se).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",he).getRegex(),nr={...Ie,lheading:Jt,table:He,paragraph:w(Ee).replace("hr",se).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",he).getRegex()},ir={...Ie,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce).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:F,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(Ee).replace("hr",se).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)))/,W=/[\p{P}\p{S}]/u,ue=/[\s\p{P}\p{S}]/u,Ae=/[^\s\p{P}\p{S}]/u,dr=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ue).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,W).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,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).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,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),kr=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),yr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wr=w(yr,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),vr=w(/\\(punct)/,"gu").replace(/punct/g,W).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(Ce).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(),ce=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$r=w(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ce).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),st=w(/^!?\[(label)\]\[(ref)\]/).replace("label",ce).replace("ref",Ne).getRegex(),at=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ne).getRegex(),jr=w("reflink|nolink(?!\\()","g").replace("reflink",st).replace("nolink",at).getRegex(),Fe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Le={_backpedal:F,anyPunctuation:vr,autolink:Sr,blockSkip:ur,br:Je,code:or,del:F,delLDelim:F,delRDelim:F,emStrongLDelim:fr,emStrongRDelimAst:xr,emStrongRDelimUnd:br,escape:lr,link:$r,nolink:at,punctuation:dr,reflink:st,reflinkSearch:jr,tag:Tr,text:cr,url:F},Er={...Le,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",ce).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce).getRegex()},we={...Le,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={...we,br:w(Je).replace("{2,}","*").getRegex(),text:w(we.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},le={normal:Ie,gfm:nr,pedantic:ir},J={normal:Le,gfm:we,breaks:Nr,pedantic:Er},Cr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=t=>Cr[t];function D(t,e){if(e){if(j.escapeTest.test(t))return t.replace(j.escapeReplace,Oe)}else if(j.escapeTestNoEncode.test(t))return t.replace(j.escapeReplaceNoEncode,Oe);return t}function Ke(t){try{t=encodeURI(t).replace(j.percentDecode,"%")}catch{return null}return t}function Ze(t,e){var l;let r=t.replace(j.findPipe,(i,n,h)=>{let c=!1,u=n;for(;--u>=0&&h[u]==="\\";)c=!c;return c?"|":" |"}),a=r.split(j.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(j.slashPipe,"|");return a}function ee(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(`
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 de=class{constructor(t){S(this,"options");S(this,"rules");S(this,"lexer");this.options=t||K}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:ee(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=ee(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:ee(e[0],`
359
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=ee(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,`
@@ -370,14 +370,14 @@ ${u}`:u;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
370
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(`
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
- `,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+=`
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(`
373
+ `,t=t.substring(y.length+1),u=!0),!u){let N=this.rules.other.nextBulletRegex(R),_=this.rules.other.hrRegex(R),C=this.rules.other.fencesBeginRegex(R),M=this.rules.other.headingBeginRegex(R),H=this.rules.other.htmlBeginRegex(R),E=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
374
+ `,1)[0],A;if(y=P,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),A=y):A=y.replace(this.rules.other.tabCharGlobal," "),C.test(y)||M.test(y)||H.test(y)||E.test(y)||N.test(y)||_.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||C.test(d)||M.test(d)||_.test(d))break;m+=`
376
+ `+y}b=!y.trim(),x+=P+`
377
+ `,t=t.substring(P.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(`
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,`
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+=`
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=ee(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 ve{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||K,this.options.tokenizer=this.options.tokenizer||new de,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:j,block:le.normal,inline:J.normal};this.options.pedantic?(r.block=le.pedantic,r.inline=J.pedantic):this.options.gfm&&(r.block=le.gfm,this.options.breaks?r.inline=J.breaks:r.inline=J.gfm),this.tokenizer.rules=r}static get rules(){return{block:le,inline:J}}static lex(e,r){return new ve(r).lex(e)}static lexInline(e,r){return new ve(r).inlineTokens(e)}lex(e){e=e.replace(j.carriageReturn,`
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(j.tabCharGlobal," ").replace(j.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
  `)?"":`
383
383
  `)+n.raw,c.text+=`
@@ -390,9 +390,9 @@ ${u}`:u;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
390
390
  `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n),a=h.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
391
391
  `)?"":`
392
392
  `)+n.raw,c.text+=`
393
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var h,c,u,x,m;this.tokenizer.lexer=this;let a=e,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)l=s[2]?s[2].length:0,a=a.slice(0,s.index+l)+"["+"a".repeat(s[0].length-l-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=((c=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:c.call({lexer:this},a))??a;let i=!1,n="";for(;e;){i||(n=""),i=!1;let d;if((x=(u=this.options.extensions)==null?void 0:u.inline)!=null&&x.some(b=>(d=b.call({lexer:this},e,r))?(e=e.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let b=r.at(-1);d.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),r.push(d);continue}let y=e;if((m=this.options.extensions)!=null&&m.startInline){let b=1/0,R=e.slice(1),C;this.options.extensions.startInline.forEach(j=>{C=j.call({lexer:this},R),typeof C=="number"&&C>=0&&(b=Math.min(b,C))}),b<1/0&&b>=0&&(y=e.substring(0,b+1))}if(d=this.tokenizer.inlineText(y)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(n=d.raw.slice(-1)),i=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(e){let b="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},de=class{constructor(t){S(this,"options");S(this,"parser");this.options=t||Z}space(t){return""}code({text:t,lang:e,escaped:r}){var l;let a=(l=(e||"").match(E.notSpaceStart))==null?void 0:l[0],s=t.replace(E.endingNewline,"")+`
394
- `;return a?'<pre><code class="language-'+_(a)+'">'+(r?s:_(s,!0))+`</code></pre>
395
- `:"<pre><code>"+(r?s:_(s,!0))+`</code></pre>
393
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var h,c,u,x,m;this.tokenizer.lexer=this;let a=e,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)l=s[2]?s[2].length:0,a=a.slice(0,s.index+l)+"["+"a".repeat(s[0].length-l-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=((c=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:c.call({lexer:this},a))??a;let i=!1,n="";for(;e;){i||(n=""),i=!1;let d;if((x=(u=this.options.extensions)==null?void 0:u.inline)!=null&&x.some(b=>(d=b.call({lexer:this},e,r))?(e=e.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let b=r.at(-1);d.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),r.push(d);continue}let y=e;if((m=this.options.extensions)!=null&&m.startInline){let b=1/0,R=e.slice(1),N;this.options.extensions.startInline.forEach(_=>{N=_.call({lexer:this},R),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(y=e.substring(0,b+1))}if(d=this.tokenizer.inlineText(y)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(n=d.raw.slice(-1)),i=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(e){let b="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},pe=class{constructor(t){S(this,"options");S(this,"parser");this.options=t||K}space(t){return""}code({text:t,lang:e,escaped:r}){var l;let a=(l=(e||"").match(j.notSpaceStart))==null?void 0:l[0],s=t.replace(j.endingNewline,"")+`
394
+ `;return a?'<pre><code class="language-'+D(a)+'">'+(r?s:D(s,!0))+`</code></pre>
395
+ `:"<pre><code>"+(r?s:D(s,!0))+`</code></pre>
396
396
  `}blockquote({tokens:t}){return`<blockquote>
397
397
  ${this.parser.parse(t)}</blockquote>
398
398
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
@@ -408,9 +408,9 @@ ${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; }
413
- h1 { border-bottom: 2px solid ${be}; padding-bottom: .3rem; }
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>${D(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="'+D(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 D(r);t=s;let l=`<img src="${t}" alt="${D(r)}"`;return e&&(l+=` title="${D(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:D(t.text)}},ze=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 Se{constructor(e){S(this,"options");S(this,"renderer");S(this,"textRenderer");this.options=e||K,this.options.renderer=this.options.renderer||new pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ze}static parse(e,r){return new Se(r).parse(e)}static parseInline(e,r){return new Se(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}},oe,te=(oe=class{constructor(t){S(this,"options");S(this,"block");this.options=t||K}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(oe,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),S(oe,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),oe),zr=class{constructor(...t){S(this,"defaults",$e());S(this,"options",this.setOptions);S(this,"parse",this.parseMarkdown(!0));S(this,"parseInline",this.parseMarkdown(!1));S(this,"Parser",z);S(this,"Renderer",pe);S(this,"TextRenderer",ze);S(this,"Lexer",L);S(this,"Tokenizer",de);S(this,"Hooks",te);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 pe(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 de(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 te;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];te.passThroughHooks.has(l)?s[i]=c=>{if(this.defaults.async&&te.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>"+D(r.message+"",!0)+"</pre>";return e?Promise.resolve(a):a}if(e)return Promise.reject(r);throw r}}},O=new zr;function v(t,e){return O.parse(t,e)}v.options=v.setOptions=function(t){return O.setOptions(t),v.defaults=O.defaults,Ve(v.defaults),v};v.getDefaults=$e;v.defaults=K;v.use=function(...t){return O.use(...t),v.defaults=O.defaults,Ve(v.defaults),v};v.walkTokens=function(t,e){return O.walkTokens(t,e)};v.parseInline=O.parseInline;v.Parser=z;v.parser=z.parse;v.Renderer=pe;v.TextRenderer=ze;v.Lexer=L;v.lexer=L.lex;v.Tokenizer=de;v.Hooks=te;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;z.parse;L.lex;const ke="#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
+ h1 { border-bottom: 2px solid ${ke}; padding-bottom: .3rem; }
414
414
  h2 { margin-top: 1.5em; }
415
415
  img { max-width: 100%; }
416
416
  pre { background: #f6f6f6; padding: .75rem 1rem; border-radius: 4px; overflow-x: auto; }
@@ -419,8 +419,8 @@ pre code { background: none; padding: 0; }
419
419
  table { border-collapse: collapse; width: 100%; margin: 1em 0; }
420
420
  th, td { border: 1px solid #ddd; padding: 6px 10px; text-align: left; }
421
421
  th { background: #f6f6f6; }
422
- blockquote { border-left: 3px solid ${be}; margin: 0; padding: .25rem 1rem; color: #555; }
423
- a { color: ${be}; }
422
+ blockquote { border-left: 3px solid ${ke}; margin: 0; padding: .25rem 1rem; color: #555; }
423
+ a { color: ${ke}; }
424
424
  hr { border: none; border-top: 1px solid #ddd; }`;function Dr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Mr(t){for(const e of v.lexer(t))if(e.type==="heading"&&e.depth===1)return e.text}function Ue(t){const e=v.parse(t,{async:!1,gfm:!0,breaks:!1}),r=Mr(t);return{html:`<!DOCTYPE html>
425
425
  <html lang="en">
426
426
  <head>
@@ -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:N,isAllTeams:_}=ft(),C=k.useCallback(async()=>{try{const g=await mt(t?{session_id:t}:_?void 0:N?{team_id:N.id}:e?void 0:{scope:"personal"});s(g||[]),h("")}catch(g){h(g instanceof Error?g.message:f("artifacts.loadFailed"))}finally{i(!1)}},[t,N,_,e]);k.useEffect(()=>{C();const g=setInterval(C,15e3);return window.addEventListener("focus",C),()=>{clearInterval(g),window.removeEventListener("focus",C)}},[C]);const M=k.useRef(!1);k.useEffect(()=>{if(!M.current){M.current=!0;return}C()},[r,C]);const H=k.useCallback(g=>{u(!1),m(null),y("template"),s($=>[g,...$.filter(Q=>Q.id!==g.id)])},[]),E=k.useCallback((g,$="template")=>{m(g),y($),u(!0)},[]),P=k.useCallback(()=>{u(!1),m(null),y("template")},[]),A=k.useCallback(async g=>{if(window.confirm(f("artifacts.delete")+" — "+g.slice(0,8)+"…?"))try{await xt(g),s($=>$.filter(Q=>Q.id!==g))}catch($){alert($ instanceof Error?$.message:f("artifacts.deleteFailed"))}},[]),Z=k.useCallback(async g=>{await gt(`${window.location.origin}${g.url}`)&&(R(g.id),setTimeout(()=>R(null),1500))},[]),G=k.useMemo(()=>a,[a]),U=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))}):G.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:G.map(g=>{const $=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-[10px] font-medium ${$!==null&&$<=0?"bg-status-error/15 text-status-error":$!==null&&$<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:$===null?"∞":`${$}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:()=>E(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:()=>E(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:()=>A(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")]})]}),U,o.jsx(Re,{open:c,onClose:P,onCreated:H,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")})]}),U,o.jsx(Re,{open:c,onClose:P,onCreated:H,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 Re({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(""),[N,_]=k.useState(30),[C,M]=k.useState(!1),[H,E]=k.useState(""),[P,A]=k.useState(!1),[Z,G]=k.useState(!1),[U,g]=k.useState(null),[$,Q]=k.useState(""),[B,fe]=k.useState(""),[me,_e]=k.useState(""),[De,xe]=k.useState(!1),[ge,Me]=k.useState(null),[V,ae]=k.useState(null),[ne,ie]=k.useState(""),[q,Pe]=k.useState(!1);k.useEffect(()=>{t&&(h(i&&l==="ai"?"ai":"template"),u("pr-review"),_(30),M(!1),E(""),G(!1),R(""),Q(""),fe(a??(s==null?void 0:s.session_id)??""),_e(""),xe(!1),Me(null),ae(null),ie(""),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(Y("pr-review").html)),a||(g(null),Rt().then(p=>{const I=p.filter(T=>!Tt(T.status));g(I),fe(T=>T&&!I.some(X=>X.id===T)?"":T)}).catch(()=>g([]))))},[t,s,a,i,l]),k.useEffect(()=>{if(!t||n!=="ai"||!B){ae(null),ie("");return}let p=!1;return $t(B).then(I=>{var T;p||(ae(I.models),ie(((T=I.models)==null?void 0:T.currentModelId)??""))}).catch(()=>{p||ae(null)}),()=>{p=!0}},[t,n,B]);const lt=p=>{u(p);const I=Y(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&&!C&&!P&&!Z,ct=async()=>{let p,I;if(n==="markdown"){const T=Ue(b);p=T.html,I=T.title}else p=d.trim(),I=Y(c).defaultTitle;if(p){M(!0),E("");try{const T={html:p,ttl:N,title:x.trim()||(i?void 0:I)};i?s&&(T.hash=s.id):T.session_id=a??($||void 0);const X=await Nt(T);r(X)}catch(T){const X=T instanceof Error?T.message:"";T instanceof Ct&&T.status===404?E(f("artifacts.viewNotFound")):E(X||f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{M(!1)}}},dt=async()=>{if(!Z){if(!B){E(f("artifacts.create.ai.sessionRequired"));return}if(!me.trim()){E(f(i?"artifacts.update.ai.briefRequired":"artifacts.create.ai.briefRequired"));return}xe(!0),E("");try{V&&ne&&ne!==V.currentModelId&&await jt(B,{type:"control_request",request:{subtype:"set_model",model:ne}});const p=Hr(me,i&&s?{id:s.id,url:`${window.location.origin}${s.url}`,version:s.version}:void 0,{archify:q});await Et(B,Fr(p)),Me(B)}catch(p){E(p instanceof Error?p.message:f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{xe(!1)}}},be=U??[];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),E("")},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"&&(ge?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/${ge}`,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),"…"]}):U===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):be.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:B,onChange:p=>fe(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")}),be.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")})]}),V&&V.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:ne,onChange:p=>ie(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:V.availableModels.map(p=>o.jsx("option",{value:p.modelId,children:p.name+(p.modelId===V.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":q,onClick:()=>Pe(p=>!p),className:`flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors ${q?"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 ${q?"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 ${q?"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 ${q?"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 ${q?"left-[18px]":"left-0.5"}`})})]}),q&&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:me,onChange:p=>_e(p.target.value),placeholder:f(q?"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:ye.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"?"":Y(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:()=>_(p),className:`rounded-md border px-3 py-2 text-sm transition-colors ${N===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?"":Y(c).html.slice(0,120)+"…",rows:12,spellCheck:!1,disabled:P,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")}),U===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):o.jsxs("select",{id:"artifact-bind-session",value:$,onChange:p=>Q(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")}),be.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"})]}),Z&&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||!!ge||!B||Z,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:C?f("common.creating"):i?f("artifacts.update"):f("artifacts.create.submit")})]})]})})}const es=Object.freeze(Object.defineProperty({__proto__:null,ArtifactsGallery:Zr,CreateArtifactDialog:Re},Symbol.toStringTag,{value:"Module"}));export{Zr as A,Re 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-BC4mcO_f.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,6 @@
1
+ import{j as e,e as r}from"./vendor-DE_-CLIE.js";import{ap as Q,an as E,aM as I,aK as O,aD as t,U as V,at as q,aL as B,I as X,f as P,e as $,$ as Z,ah as G,a3 as J,a6 as Y,a2 as ee,S as U,X as se,aE as ae}from"./main-BC4mcO_f.js";import{R as H,E as te}from"./RegisterEmpty-DdDXaiEn.js";import{g as L}from"./workerType-gCLCeJDi.js";import{S as ne}from"./SessionVisibilityBadge-Ch3s2iFY.js";import{D as re,a as le,d as ce}from"./dialog-Ort95zkZ.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 de=[["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"}]],ie=Q("folder",de);function oe({teamName:c,className:x}){return c?e.jsx("span",{className:E("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",x),children:c}):null}function me({environments:c,onSelectEnvironment:x}){const{activeTeam:y,isAllTeams:v}=I(),{user:i}=O(),o=r.useMemo(()=>(i==null?void 0:i.role)==="admin"||v?c:y?c.filter(l=>l.team_id===y.id):c.filter(l=>!l.team_id),[c,y,v,i]);return!o||o.length===0?e.jsx(H,{title:t("dashboard.emptyEnvironmentsTitle"),hint:t("dashboard.emptyEnvironmentsHint")}):e.jsx("div",{className:"ds-reg",children:o.map(l=>{var w,N,g;const p=l.worker_type==="acp",b=L(l.worker_type),m=((w=l.directory)==null?void 0:w.trim())||null,f=((N=l.ip_address)==null?void 0:N.trim())||null,j=((g=l.owner_username)==null?void 0:g.trim())||null;return e.jsxs("div",{className:E("ds-reg-row group",p&&"opacity-80"),children:[e.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(l),disabled:p,className:E("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-sm font-medium text-text-primary",children:l.machine_name||l.id}),e.jsx("span",{className:E("ds-reg-tag rounded-full",b.colorClass),children:b.fullLabel}),e.jsx(te,{status:l.status,className:"ds-reg-tag"}),e.jsx(oe,{teamName:l.team_name??null,className:"ds-reg-tag"})]}),(m||f||j)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[m&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:m}),m&&f&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),f&&e.jsx("span",{className:"shrink-0 whitespace-nowrap font-mono tabular-nums",children:f}),(m||f)&&j&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),j&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${j}`,children:[e.jsx(V,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:j})]})]})]}),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:q(l.created_at)})})]},l.id)})})}function he({sessions:c,environments:x,onSelect:y,onDelete:v}){B();const{activeTeam:i,isAllTeams:o,myTeams:l}=I(),{user:p}=O(),b=r.useMemo(()=>{const s=new Map;for(const h of l)s.set(h.id,h.name);return s},[l]),m=r.useMemo(()=>(p==null?void 0:p.role)==="admin"||o?c:i?c.filter(s=>s.owner_type==="team"&&s.owner_id===i.id):c.filter(s=>s.owner_type==="user"||s.access_level==="write"||s.access_level==="read"),[c,i,o,p]),{mySessions:f,sharedSessions:j}=r.useMemo(()=>{const s=[],h=[];for(const u of m)i||o?s.push(u):u.access_level==="write"||u.access_level==="read"?h.push(u):s.push(u);return{mySessions:s,sharedSessions:h}},[m,i,o]),w=new Map;for(const s of x??[])s!=null&&s.id&&s.worker_type&&w.set(s.id,s.worker_type);const N=(s,h)=>(h.updated_at||0)-(s.updated_at||0);function g(s){var D;const h=!!v&&s.access_level!=="write"&&s.access_level!=="read";let u=s.source==="acp"?"acp":(D=s.environment)==null?void 0:D.worker_type;!u&&s.environment_id&&(u=w.get(s.environment_id));const d=L(u);return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("button",{type:"button",onClick:()=>y(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-sm font-medium text-text-primary",children:s.title||s.id}),s.visibility&&e.jsx(ne,{visibility:s.visibility||"private",className:"ds-reg-tag"}),e.jsx("span",{className:E("ds-reg-tag rounded-full",d.colorClass),children:d.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:b.get(s.owner_id)||s.owner_id})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx(X,{status:s.status}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:q(s.created_at||s.updated_at)}),h&&e.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),v(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(m.length===0)return e.jsx(H,{title:t("dashboard.emptySessionsTitle"),hint:t("dashboard.emptySessionsHint")});const k=[...f].sort(N),C=[...j].sort(N);return e.jsxs("div",{className:"space-y-4",children:[k.length>0&&e.jsx("section",{className:"space-y-2",children:e.jsx("div",{className:"ds-reg",children:k.map(g)})}),C.length>0&&e.jsxs("section",{className:"space-y-2",children:[k.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(g)})]})]})}function ue({open:c,environments:x,onClose:y,onCreated:v}){B();const{activeTeam:i,isAllTeams:o}=I(),{user:l}=O(),[p,b]=r.useState(""),[m,f]=r.useState(""),[j,w]=r.useState("same-dir"),[N,g]=r.useState(""),[k,C]=r.useState(!1),[s,h]=r.useState(!1),u=r.useMemo(()=>(l==null?void 0:l.role)==="admin"||o?x:i?x.filter(a=>a.team_id===i.id):x.filter(a=>!a.team_id),[x,i,o,l]);r.useEffect(()=>{c&&(b(""),f(""),w("same-dir"),g(""),h(!1))},[c]);const d=u.find(a=>a.id===m)||null,D=d?u.findIndex(a=>a.id===d.id)+1:null,T=async()=>{C(!0),g("");try{const a={};p.trim()&&(a.title=p.trim()),m&&(a.environment_id=m),a.spawn_mode=j;const M=(i==null?void 0:i.id)??(o?d==null?void 0:d.team_id:void 0);M&&(a.team_id=M);const S=await Z(a);v(S)}catch(a){g(a instanceof Error?a.message:t("dialog.createFailed"))}finally{C(!1)}};return e.jsx(re,{open:c,onOpenChange:a=>{a||y()},children:e.jsx(le,{className:"nsd-shell max-w-md",children:e.jsxs("div",{className:"nsd-box",children:[e.jsx(ce,{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:()=>h(a=>!a),children:[e.jsx("span",{className:"nsd-env-read",children:d?e.jsxs(e.Fragment,{children:[D!==null&&e.jsxs("span",{className:"nsd-env-idx",children:["#",D]}),e.jsx("span",{className:"nsd-env-name",children:d.machine_name||d.id}),e.jsx("span",{className:E("nsd-env-type",L(d.worker_type).colorClass),children:L(d.worker_type).shortLabel})]}):e.jsx("span",{className:"nsd-env-none",children:t("dialog.envSelectEnv")})}),e.jsx(P,{className:"nsd-env-caret"})]}),(d==null?void 0:d.directory)&&e.jsx("span",{className:"nsd-env-path",children:d.directory}),s&&e.jsxs("div",{className:"nsd-envpanel",children:[e.jsx("button",{type:"button",onClick:()=>{f(""),h(!1)},className:"nsd-envrow",children:e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsx("span",{className:"nsd-envrow-name",children:t("dialog.none")}),!m&&e.jsx($,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]})}),u.length===0?e.jsx("p",{className:"nsd-envempty",children:t("dialog.envEmpty")}):u.map((a,M)=>{const S=L(a.worker_type),R=!!a.team_id,A=a.id===m;return e.jsxs("button",{type:"button","data-selected":A?"on":void 0,onClick:()=>{f(a.id),h(!1)},className:"nsd-envrow",children:[e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsxs("span",{className:"nsd-envrow-idx",children:["#",M+1]}),e.jsx("span",{className:"nsd-envrow-name",children:a.machine_name||a.id}),e.jsx("span",{className:E("nsd-envrow-type",S.colorClass),children:S.shortLabel}),e.jsx("span",{className:E("nsd-envrow-team",R?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand-text"),children:R?`${t("dialog.envTeam")}: ${a.team_name||a.team_id}`:t("dialog.envPersonal")}),A&&e.jsx($,{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(ie,{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=>b(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:j,onChange:a=>w(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(P,{className:"nsd-mode-caret"})]})]}),N&&e.jsx("p",{className:"nsd-error",children:N}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:y,className:"nsd-cancel",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:T,disabled:k,className:"btn-ticket nsd-create",children:k?t("common.creating"):t("common.create")})]})]})})})}function ye({onNavigateSession:c}){const x=B(),y=r.useMemo(()=>new Date().toLocaleDateString(x==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short"}),[x]),[v,i]=r.useState([]),[o,l]=r.useState([]),[p,b]=r.useState(!1),[m,f]=r.useState(!1),[j,w]=r.useState(""),[N,g]=r.useState(null),[k,C]=r.useState(!1),s=r.useRef(0),[h,u]=r.useState(!1),d=m||h,D=r.useCallback(()=>{f(!1),w(""),u(!0)},[]),T=r.useCallback(()=>{u(!1)},[]),a=r.useRef(null),M=r.useRef(!1);r.useEffect(()=>{var n;M.current&&!d&&((n=a.current)==null||n.focus()),M.current=d},[d]),r.useEffect(()=>{const n=j.trim();if(!n){s.current+=1,g(null),C(!1);return}C(!0);const _=++s.current,F=setTimeout(()=>{G(n).then(K=>{s.current===_&&g(K.results??[])}).catch(()=>{s.current===_&&g([])}).finally(()=>{s.current===_&&C(!1)})},300);return()=>clearTimeout(F)},[j]);const S=r.useCallback(async()=>{try{const[n,_]=await Promise.all([J(),Y()]);i(n||[]),l(_||[])}catch(n){console.error("Dashboard render error:",n)}},[]);r.useEffect(()=>{S();const n=setInterval(S,5e3);return window.addEventListener("focus",S),()=>{clearInterval(n),window.removeEventListener("focus",S)}},[S]);const R=n=>{b(!1),c(n.id)},A=r.useCallback(n=>{},[]),W=r.useCallback(n=>{c(n)},[c]),z=r.useCallback(async n=>{if(window.confirm(t("dashboard.confirmDelete").replace("{id}",n)))try{await ee(n),i(_=>_.filter(F=>F.id!==n))}catch(_){alert(_ instanceof Error?_.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:y}),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:[v.length," ",t("dashboard.sessions")]}),e.jsxs("span",{children:[o.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(me,{environments:o,onSelectEnvironment:A})]}),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")}),d?e.jsxs("div",{className:E("ds-dash-search",h&&"ds-dash-search--folding"),onAnimationEnd:T,children:[e.jsx(U,{className:"h-4 w-4 flex-shrink-0 text-text-muted","aria-hidden":"true"}),e.jsx("input",{autoFocus:!0,value:j,onChange:n=>w(n.target.value),onKeyDown:n=>{n.key==="Escape"&&D()},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"}),k&&e.jsx("span",{className:"flex-shrink-0 text-xs text-text-muted",children:t("dashboard.searching")}),e.jsx("button",{type:"button",onClick:D,className:"ds-dash-search-close",title:t("dashboard.closeSearch"),"aria-label":t("dashboard.closeSearch"),children:e.jsx(se,{className:"h-3.5 w-3.5"})})]}):e.jsx("button",{ref:a,type:"button",onClick:()=>f(!0),className:"ds-dash-search-toggle",title:t("dashboard.searchAction"),"aria-label":t("dashboard.searchAction"),children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"btn-ticket",children:t("dashboard.newSession")})]}),N!==null?e.jsxs("div",{className:"ds-reg",children:[N.length===0&&!k&&e.jsx("p",{className:"ds-reg-row ds-reg-empty text-sm text-text-muted",children:t("dashboard.searchNoResults")}),N.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-sm 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?ae("dashboard.nMatches",{n:n.match_count}):t("dashboard.nameMatch")})]},n.session_id))]}):e.jsx(he,{sessions:v,environments:o,onSelect:W,onDelete:z})]}),e.jsx(ue,{open:p,environments:o,onClose:()=>b(!1),onCreated:R})]})}export{ye as Dashboard};
@@ -0,0 +1 @@
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aK as v,c as N,aD as t}from"./main-BC4mcO_f.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"}),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};
@@ -0,0 +1 @@
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aD as t,aE as y,aK as j,c as w}from"./main-BC4mcO_f.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function v(r){if(!(r instanceof Error))return t("auth.login.failed");if(r instanceof TypeError)return t("auth.login.unreachable");const s=r.message;return/failed to fetch|network|load failed/i.test(s)?t("auth.login.unreachable"):/csrf/i.test(s)?t("auth.login.csrfBlocked"):/too many/i.test(s)?t("auth.login.rateLimited"):/invalid credentials/i.test(s)?t("auth.login.failed"):!s||/^login failed$/i.test(s)?t("auth.login.failed"):y("auth.login.failedWithReason",{message:s})}function C({onSuccess:r,onNavigateRegister:s}){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),g=async a=>{a.preventDefault(),d(""),c(!0);try{await m(o,i),r()}catch(p){d(v(p))}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"}),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:g,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:s,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};