@saluzi/saluzi-edu 0.7.3 → 0.7.5

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 (163) hide show
  1. package/dist/cli.js +95 -63
  2. package/dist/rcs-schema.sql +42 -0
  3. package/dist/rcs-web/assets/{AdminPanel-B9YWaqlO.js → AdminPanel-QjFUzKR-.js} +1 -1
  4. package/dist/rcs-web/assets/{ArtifactView-B8lAeS5B.js → ArtifactView-DSrHrqoO.js} +1 -1
  5. package/{packages/remote-control-server/web/dist/assets/ArtifactsGallery-CNd9-Awp.js → dist/rcs-web/assets/ArtifactsGallery-LD7hnmXQ.js} +1 -1
  6. package/{packages/remote-control-server/web/dist/assets/Claim-Dq08pl4W.js → dist/rcs-web/assets/Claim-rralKUvn.js} +1 -1
  7. package/dist/rcs-web/assets/{Dashboard-JZcrtByh.js → Dashboard-BhXzF4TR.js} +2 -2
  8. package/dist/rcs-web/assets/{Join-DgvRnpyb.js → Join-DYKrYQka.js} +1 -1
  9. package/{packages/remote-control-server/web/dist/assets/Login-CZbz6Wms.js → dist/rcs-web/assets/Login-Blmtx4In.js} +1 -1
  10. package/dist/rcs-web/assets/MemoriesGallery-CWyitPTS.js +1 -0
  11. package/dist/rcs-web/assets/{Register-DD7uiwEj.js → Register-CnZOK0Wa.js} +1 -1
  12. package/dist/rcs-web/assets/{RegisterEmpty-BrBfeQXp.js → RegisterEmpty-RNN7njqd.js} +2 -2
  13. package/dist/rcs-web/assets/{SessionDetail-BbnQBjP1.js → SessionDetail-BeZeeaGH.js} +19 -19
  14. package/dist/rcs-web/assets/{SessionVisibilityBadge-kSo9esvT.js → SessionVisibilityBadge-D976F6JX.js} +2 -2
  15. package/dist/rcs-web/assets/{Setup-Ca30VUSF.js → Setup-BFW58zKK.js} +1 -1
  16. package/dist/rcs-web/assets/{ShareLanding-C_vlxFAM.js → ShareLanding-BTLCFUy8.js} +1 -1
  17. package/{packages/remote-control-server/web/dist/assets/TeamDetail-8T_kKUcX.js → dist/rcs-web/assets/TeamDetail-DwZoGkMp.js} +2 -2
  18. package/dist/rcs-web/assets/{TeamList-DRXGQCJi.js → TeamList-DehdjKJu.js} +1 -1
  19. package/dist/rcs-web/assets/{TeamSettings-Byhon5C1.js → TeamSettings-DsZDvdLi.js} +1 -1
  20. package/dist/rcs-web/assets/{UserSearchInput-wixyd_8w.js → UserSearchInput-B-phMzno.js} +2 -2
  21. package/dist/rcs-web/assets/{UserSettings-Ds2retFk.js → UserSettings-po8VpRyO.js} +1 -1
  22. package/dist/rcs-web/assets/{arc-CThS8KNL.js → arc-yo8UpUoc.js} +1 -1
  23. package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-Bko99SuX.js → architectureDiagram-3BPJPVTR-CAzjNMmM.js} +1 -1
  24. package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-CqCAgp0i.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-DRvlErcg.js} +1 -1
  25. package/{packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-C1pGDG-L.js → dist/rcs-web/assets/c4Diagram-AAUBKEIU-CtqgfHXS.js} +1 -1
  26. package/dist/rcs-web/assets/channel-ByZbiIGl.js +1 -0
  27. package/dist/rcs-web/assets/{chunk-2J33WTMH-Bz0kJwEY.js → chunk-2J33WTMH-BnLSiOZc.js} +1 -1
  28. package/dist/rcs-web/assets/{chunk-4BX2VUAB-DYnlidI7.js → chunk-4BX2VUAB-CneZL39T.js} +1 -1
  29. package/dist/rcs-web/assets/{chunk-55IACEB6-cMV4HRvm.js → chunk-55IACEB6-AZPro6N3.js} +1 -1
  30. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-Bgz9JRYO.js → dist/rcs-web/assets/chunk-727SXJPM-DtoifF_Q.js} +1 -1
  31. package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-DIFGJlEF.js → dist/rcs-web/assets/chunk-AQP2D5EJ-BsdfbS-v.js} +1 -1
  32. package/dist/rcs-web/assets/{chunk-FMBD7UC4-BUC7O7T0.js → chunk-FMBD7UC4-Ba_h1XJS.js} +1 -1
  33. package/dist/rcs-web/assets/{chunk-ND2GUHAM-kGqgVnBZ.js → chunk-ND2GUHAM-CtZuWp5S.js} +1 -1
  34. package/dist/rcs-web/assets/{chunk-QZHKN3VN-B01O0qXh.js → chunk-QZHKN3VN-DF-7EztA.js} +1 -1
  35. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-B7LKcjGg.js +1 -0
  36. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-B7LKcjGg.js +1 -0
  37. package/dist/rcs-web/assets/{code-block-IT6T5CEO-CscK0pCh.js → code-block-IT6T5CEO-BB5vH41t.js} +1 -1
  38. package/dist/rcs-web/assets/{copy-CvmA5P_Q.js → copy-COu9cGeU.js} +1 -1
  39. package/dist/rcs-web/assets/{cose-bilkent-S5V4N54A-BsBsVccW.js → cose-bilkent-S5V4N54A-BvX9PMEk.js} +1 -1
  40. package/dist/rcs-web/assets/{dagre-BM42HDAG-Bn4B33S-.js → dagre-BM42HDAG-BsbASaLl.js} +1 -1
  41. package/dist/rcs-web/assets/{diagram-2AECGRRQ-DAuAIPR6.js → diagram-2AECGRRQ-zjhhcSia.js} +1 -1
  42. package/dist/rcs-web/assets/{diagram-5GNKFQAL-w3k2b4gC.js → diagram-5GNKFQAL-B0noeRZk.js} +1 -1
  43. package/dist/rcs-web/assets/{diagram-KO2AKTUF-CMLav2KT.js → diagram-KO2AKTUF-q4A3A-0G.js} +1 -1
  44. package/dist/rcs-web/assets/{diagram-LMA3HP47-D14sXWdh.js → diagram-LMA3HP47-Z8Q18cks.js} +1 -1
  45. package/{packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-BexFwBQa.js → dist/rcs-web/assets/diagram-OG6HWLK6-JYocDScA.js} +1 -1
  46. package/dist/rcs-web/assets/{dialog-B4hKrd7w.js → dialog-jGu3j2II.js} +1 -1
  47. package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-BA8ANmoV.js → erDiagram-TEJ5UH35-E18rAGwe.js} +1 -1
  48. package/{packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-dTQIvKsj.js → dist/rcs-web/assets/flowDiagram-I6XJVG4X-DBAHvZfJ.js} +1 -1
  49. package/dist/rcs-web/assets/{ganttDiagram-6RSMTGT7-8SDHYxXc.js → ganttDiagram-6RSMTGT7-1aqSO10M.js} +1 -1
  50. package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-Bu7LyvTG.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-uBw1naVm.js} +1 -1
  51. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-BuQuDvuX.js → infoDiagram-5YYISTIA-5ZFaePD-.js} +1 -1
  52. package/{packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-QjafGk8V.js → dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-DvjOCepo.js} +1 -1
  53. package/{packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-_FOXjXDF.js → dist/rcs-web/assets/journeyDiagram-JHISSGLW-dnXupGdJ.js} +1 -1
  54. package/dist/rcs-web/assets/{kanban-definition-UN3LZRKU-CbqJqyY6.js → kanban-definition-UN3LZRKU-Co4PRiOE.js} +1 -1
  55. package/dist/rcs-web/assets/{linear-H6F41eb2.js → linear-B9BaViDA.js} +1 -1
  56. package/dist/rcs-web/assets/main-CP31AzxJ.css +1 -0
  57. package/dist/rcs-web/assets/{main-BopVSHhX.js → main-CqWvY7FG.js} +62 -62
  58. package/{packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-5FH_DIq9.js → dist/rcs-web/assets/mermaid-VLURNSYL-B-oU9mPp.js} +4 -4
  59. package/dist/rcs-web/assets/{mermaid.core-C004NitB.js → mermaid.core-DE67nE19.js} +5 -5
  60. package/dist/rcs-web/assets/{mindmap-definition-RKZ34NQL-utqEJ2a8.js → mindmap-definition-RKZ34NQL-BNYnuKJy.js} +1 -1
  61. package/dist/rcs-web/assets/{notifications-DOBs9HVf.js → notifications-BjTdDOj4.js} +1 -1
  62. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-OlbTwDZQ.js → pieDiagram-4H26LBE5-n1DnXCmk.js} +1 -1
  63. package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-BOe2DhrU.js → quadrantDiagram-W4KKPZXB-MTMv8wiE.js} +1 -1
  64. package/dist/rcs-web/assets/{refresh-cw-BSwpDl-7.js → refresh-cw-Ddd1BD9C.js} +1 -1
  65. package/{packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-s6V1yWUG.js → dist/rcs-web/assets/requirementDiagram-4Y6WPE33-6KBFW0WL.js} +1 -1
  66. package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-CdJD78Mx.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-CCvT5ejn.js} +1 -1
  67. package/{packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-DvGV6Dhl.js → dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-CiOW881y.js} +1 -1
  68. package/{packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-Bj-_Ulcn.js → dist/rcs-web/assets/stateDiagram-AJRCARHV-yeM7KZfg.js} +1 -1
  69. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-BLGWynk-.js → stateDiagram-v2-BHNVJYJU-CXddkakE.js} +1 -1
  70. package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-B6VAH6Ka.js → timeline-definition-PNZ67QCA-Dfgo8yRK.js} +1 -1
  71. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-DUwaLI6R.js → vennDiagram-CIIHVFJN-CpW5v7I2.js} +1 -1
  72. package/dist/rcs-web/assets/{wardleyDiagram-YWT4CUSO-CBetJore.js → wardleyDiagram-YWT4CUSO-BsGpbaNe.js} +1 -1
  73. package/dist/rcs-web/assets/{workerType-BF4aY_R_.js → workerType-BURsA0u4.js} +1 -1
  74. package/dist/rcs-web/assets/{xychartDiagram-2RQKCTM6-BBnx6V66.js → xychartDiagram-2RQKCTM6-BZ9L5_e4.js} +1 -1
  75. package/dist/rcs-web/index.html +2 -2
  76. package/package.json +1 -1
  77. package/packages/remote-control-server/src/__tests__/memories.test.ts +654 -0
  78. package/packages/remote-control-server/src/db/rcs-schema.sql +42 -0
  79. package/packages/remote-control-server/src/registerRoutes.ts +6 -0
  80. package/packages/remote-control-server/src/routes/v1/memories.ts +132 -0
  81. package/packages/remote-control-server/src/routes/web/memories.ts +321 -0
  82. package/packages/remote-control-server/src/services/memories.ts +747 -0
  83. package/packages/remote-control-server/web/dist/assets/{AdminPanel-B9YWaqlO.js → AdminPanel-QjFUzKR-.js} +1 -1
  84. package/packages/remote-control-server/web/dist/assets/{ArtifactView-B8lAeS5B.js → ArtifactView-DSrHrqoO.js} +1 -1
  85. package/{dist/rcs-web/assets/ArtifactsGallery-CNd9-Awp.js → packages/remote-control-server/web/dist/assets/ArtifactsGallery-LD7hnmXQ.js} +1 -1
  86. package/{dist/rcs-web/assets/Claim-Dq08pl4W.js → packages/remote-control-server/web/dist/assets/Claim-rralKUvn.js} +1 -1
  87. package/packages/remote-control-server/web/dist/assets/{Dashboard-JZcrtByh.js → Dashboard-BhXzF4TR.js} +2 -2
  88. package/packages/remote-control-server/web/dist/assets/{Join-DgvRnpyb.js → Join-DYKrYQka.js} +1 -1
  89. package/{dist/rcs-web/assets/Login-CZbz6Wms.js → packages/remote-control-server/web/dist/assets/Login-Blmtx4In.js} +1 -1
  90. package/packages/remote-control-server/web/dist/assets/MemoriesGallery-CWyitPTS.js +1 -0
  91. package/packages/remote-control-server/web/dist/assets/{Register-DD7uiwEj.js → Register-CnZOK0Wa.js} +1 -1
  92. package/packages/remote-control-server/web/dist/assets/{RegisterEmpty-BrBfeQXp.js → RegisterEmpty-RNN7njqd.js} +2 -2
  93. package/packages/remote-control-server/web/dist/assets/{SessionDetail-BbnQBjP1.js → SessionDetail-BeZeeaGH.js} +19 -19
  94. package/packages/remote-control-server/web/dist/assets/{SessionVisibilityBadge-kSo9esvT.js → SessionVisibilityBadge-D976F6JX.js} +2 -2
  95. package/packages/remote-control-server/web/dist/assets/{Setup-Ca30VUSF.js → Setup-BFW58zKK.js} +1 -1
  96. package/packages/remote-control-server/web/dist/assets/{ShareLanding-C_vlxFAM.js → ShareLanding-BTLCFUy8.js} +1 -1
  97. package/{dist/rcs-web/assets/TeamDetail-8T_kKUcX.js → packages/remote-control-server/web/dist/assets/TeamDetail-DwZoGkMp.js} +2 -2
  98. package/packages/remote-control-server/web/dist/assets/{TeamList-DRXGQCJi.js → TeamList-DehdjKJu.js} +1 -1
  99. package/packages/remote-control-server/web/dist/assets/{TeamSettings-Byhon5C1.js → TeamSettings-DsZDvdLi.js} +1 -1
  100. package/packages/remote-control-server/web/dist/assets/{UserSearchInput-wixyd_8w.js → UserSearchInput-B-phMzno.js} +2 -2
  101. package/packages/remote-control-server/web/dist/assets/{UserSettings-Ds2retFk.js → UserSettings-po8VpRyO.js} +1 -1
  102. package/packages/remote-control-server/web/dist/assets/{arc-CThS8KNL.js → arc-yo8UpUoc.js} +1 -1
  103. package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-Bko99SuX.js → architectureDiagram-3BPJPVTR-CAzjNMmM.js} +1 -1
  104. package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-CqCAgp0i.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-DRvlErcg.js} +1 -1
  105. package/{dist/rcs-web/assets/c4Diagram-AAUBKEIU-C1pGDG-L.js → packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-CtqgfHXS.js} +1 -1
  106. package/packages/remote-control-server/web/dist/assets/channel-ByZbiIGl.js +1 -0
  107. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-Bz0kJwEY.js → chunk-2J33WTMH-BnLSiOZc.js} +1 -1
  108. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-DYnlidI7.js → chunk-4BX2VUAB-CneZL39T.js} +1 -1
  109. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-cMV4HRvm.js → chunk-55IACEB6-AZPro6N3.js} +1 -1
  110. package/{dist/rcs-web/assets/chunk-727SXJPM-Bgz9JRYO.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-DtoifF_Q.js} +1 -1
  111. package/{dist/rcs-web/assets/chunk-AQP2D5EJ-DIFGJlEF.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-BsdfbS-v.js} +1 -1
  112. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-BUC7O7T0.js → chunk-FMBD7UC4-Ba_h1XJS.js} +1 -1
  113. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-kGqgVnBZ.js → chunk-ND2GUHAM-CtZuWp5S.js} +1 -1
  114. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-B01O0qXh.js → chunk-QZHKN3VN-DF-7EztA.js} +1 -1
  115. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-B7LKcjGg.js +1 -0
  116. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-B7LKcjGg.js +1 -0
  117. package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-CscK0pCh.js → code-block-IT6T5CEO-BB5vH41t.js} +1 -1
  118. package/packages/remote-control-server/web/dist/assets/{copy-CvmA5P_Q.js → copy-COu9cGeU.js} +1 -1
  119. package/packages/remote-control-server/web/dist/assets/{cose-bilkent-S5V4N54A-BsBsVccW.js → cose-bilkent-S5V4N54A-BvX9PMEk.js} +1 -1
  120. package/packages/remote-control-server/web/dist/assets/{dagre-BM42HDAG-Bn4B33S-.js → dagre-BM42HDAG-BsbASaLl.js} +1 -1
  121. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-DAuAIPR6.js → diagram-2AECGRRQ-zjhhcSia.js} +1 -1
  122. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-w3k2b4gC.js → diagram-5GNKFQAL-B0noeRZk.js} +1 -1
  123. package/packages/remote-control-server/web/dist/assets/{diagram-KO2AKTUF-CMLav2KT.js → diagram-KO2AKTUF-q4A3A-0G.js} +1 -1
  124. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-D14sXWdh.js → diagram-LMA3HP47-Z8Q18cks.js} +1 -1
  125. package/{dist/rcs-web/assets/diagram-OG6HWLK6-BexFwBQa.js → packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-JYocDScA.js} +1 -1
  126. package/packages/remote-control-server/web/dist/assets/{dialog-B4hKrd7w.js → dialog-jGu3j2II.js} +1 -1
  127. package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-BA8ANmoV.js → erDiagram-TEJ5UH35-E18rAGwe.js} +1 -1
  128. package/{dist/rcs-web/assets/flowDiagram-I6XJVG4X-dTQIvKsj.js → packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-DBAHvZfJ.js} +1 -1
  129. package/packages/remote-control-server/web/dist/assets/{ganttDiagram-6RSMTGT7-8SDHYxXc.js → ganttDiagram-6RSMTGT7-1aqSO10M.js} +1 -1
  130. package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-Bu7LyvTG.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-uBw1naVm.js} +1 -1
  131. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-BuQuDvuX.js → infoDiagram-5YYISTIA-5ZFaePD-.js} +1 -1
  132. package/{dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-QjafGk8V.js → packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-DvjOCepo.js} +1 -1
  133. package/{dist/rcs-web/assets/journeyDiagram-JHISSGLW-_FOXjXDF.js → packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-dnXupGdJ.js} +1 -1
  134. package/packages/remote-control-server/web/dist/assets/{kanban-definition-UN3LZRKU-CbqJqyY6.js → kanban-definition-UN3LZRKU-Co4PRiOE.js} +1 -1
  135. package/packages/remote-control-server/web/dist/assets/{linear-H6F41eb2.js → linear-B9BaViDA.js} +1 -1
  136. package/packages/remote-control-server/web/dist/assets/main-CP31AzxJ.css +1 -0
  137. package/packages/remote-control-server/web/dist/assets/{main-BopVSHhX.js → main-CqWvY7FG.js} +62 -62
  138. package/{dist/rcs-web/assets/mermaid-VLURNSYL-5FH_DIq9.js → packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-B-oU9mPp.js} +4 -4
  139. package/packages/remote-control-server/web/dist/assets/{mermaid.core-C004NitB.js → mermaid.core-DE67nE19.js} +5 -5
  140. package/packages/remote-control-server/web/dist/assets/{mindmap-definition-RKZ34NQL-utqEJ2a8.js → mindmap-definition-RKZ34NQL-BNYnuKJy.js} +1 -1
  141. package/packages/remote-control-server/web/dist/assets/{notifications-DOBs9HVf.js → notifications-BjTdDOj4.js} +1 -1
  142. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-OlbTwDZQ.js → pieDiagram-4H26LBE5-n1DnXCmk.js} +1 -1
  143. package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-BOe2DhrU.js → quadrantDiagram-W4KKPZXB-MTMv8wiE.js} +1 -1
  144. package/packages/remote-control-server/web/dist/assets/{refresh-cw-BSwpDl-7.js → refresh-cw-Ddd1BD9C.js} +1 -1
  145. package/{dist/rcs-web/assets/requirementDiagram-4Y6WPE33-s6V1yWUG.js → packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-6KBFW0WL.js} +1 -1
  146. package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-CdJD78Mx.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-CCvT5ejn.js} +1 -1
  147. package/{dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-DvGV6Dhl.js → packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-CiOW881y.js} +1 -1
  148. package/{dist/rcs-web/assets/stateDiagram-AJRCARHV-Bj-_Ulcn.js → packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-yeM7KZfg.js} +1 -1
  149. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-BLGWynk-.js → stateDiagram-v2-BHNVJYJU-CXddkakE.js} +1 -1
  150. package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-B6VAH6Ka.js → timeline-definition-PNZ67QCA-Dfgo8yRK.js} +1 -1
  151. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-DUwaLI6R.js → vennDiagram-CIIHVFJN-CpW5v7I2.js} +1 -1
  152. package/packages/remote-control-server/web/dist/assets/{wardleyDiagram-YWT4CUSO-CBetJore.js → wardleyDiagram-YWT4CUSO-BsGpbaNe.js} +1 -1
  153. package/packages/remote-control-server/web/dist/assets/{workerType-BF4aY_R_.js → workerType-BURsA0u4.js} +1 -1
  154. package/packages/remote-control-server/web/dist/assets/{xychartDiagram-2RQKCTM6-BBnx6V66.js → xychartDiagram-2RQKCTM6-BZ9L5_e4.js} +1 -1
  155. package/packages/remote-control-server/web/dist/index.html +2 -2
  156. package/dist/rcs-web/assets/channel-D6RbJTfV.js +0 -1
  157. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-BlCPk6aR.js +0 -1
  158. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-BlCPk6aR.js +0 -1
  159. package/dist/rcs-web/assets/main-C0n90aVY.css +0 -1
  160. package/packages/remote-control-server/web/dist/assets/channel-D6RbJTfV.js +0 -1
  161. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-BlCPk6aR.js +0 -1
  162. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-BlCPk6aR.js +0 -1
  163. package/packages/remote-control-server/web/dist/assets/main-C0n90aVY.css +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e}from"./vendor-DE_-CLIE.js";import{ap as c,V as n,an as i}from"./main-BopVSHhX.js";/**
1
+ import{j as e}from"./vendor-DE_-CLIE.js";import{av as c,V as n,at as i}from"./main-CqWvY7FG.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{j as e}from"./vendor-DE_-CLIE.js";import{ap as c,V as n,an as i}from"./ma
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 p=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],b=c("lock",p);function u({visibility:o,className:t}){const a={private:{label:"Private",Icon:b,colorClass:"text-text-muted border-border/60"},team:{label:"Team",Icon:n,colorClass:"text-accent border-accent/40"},public:{label:"Public",Icon:x,colorClass:"text-accent border-accent/40"}},{label:s,Icon:r,colorClass:l}=a[o];return e.jsxs("span",{className:i("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs",l,t),children:[e.jsx(r,{className:"h-3 w-3"}),s]})}export{u as S};
11
+ */const b=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],m=c("lock",b);function u({visibility:o,className:t}){const a={private:{label:"Private",Icon:m,colorClass:"text-text-muted border-border/60"},team:{label:"Team",Icon:n,colorClass:"text-accent border-accent/40"},public:{label:"Public",Icon:x,colorClass:"text-accent border-accent/40"}},{label:s,Icon:r,colorClass:l}=a[o];return e.jsxs("span",{className:i("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs",l,t),children:[e.jsx(r,{className:"h-3 w-3"}),s]})}export{u as S};
@@ -1 +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-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function E({onSuccess:p,onAlreadyDone:b}){const{setup:h}=v(),[d,f]=r.useState(""),[l,y]=r.useState(""),[a,g]=r.useState(""),[u,w]=r.useState(""),[i,o]=r.useState(""),[c,m]=r.useState(!1),j=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==u){o(t("auth.setup.passwordMismatch"));return}m(!0);try{await h(d,l,a),p()}catch(x){const n=x instanceof Error?x.message:"Setup failed";if(n.includes("already")||n.includes("409")){b();return}o(n)}finally{m(!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.setup.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.setup.description")})]}),e.jsxs("form",{onSubmit:j,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.setup.apiKey")}),e.jsx("input",{type:"password",value:d,onChange:s=>f(s.target.value),required:!0,autoComplete:"off",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.setup.username")}),e.jsx("input",{type:"text",value:l,onChange:s=>y(s.target.value),required:!0,autoComplete:"username",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.setup.password")}),e.jsx("input",{type:"password",value:a,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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.setup.confirmPassword")}),e.jsx("input",{type:"password",value:u,onChange:s=>w(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"})]}),i&&e.jsx("p",{className:"text-sm text-status-error",children:i}),e.jsx("button",{type:"submit",disabled:c,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:c?t("common.loading"):t("auth.setup.submit")})]})]})})}export{E as Setup};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aQ as v,c as N,aJ as t}from"./main-CqWvY7FG.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function E({onSuccess:p,onAlreadyDone:b}){const{setup:h}=v(),[d,f]=r.useState(""),[l,y]=r.useState(""),[a,g]=r.useState(""),[u,w]=r.useState(""),[i,o]=r.useState(""),[c,m]=r.useState(!1),j=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==u){o(t("auth.setup.passwordMismatch"));return}m(!0);try{await h(d,l,a),p()}catch(x){const n=x instanceof Error?x.message:"Setup failed";if(n.includes("already")||n.includes("409")){b();return}o(n)}finally{m(!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.setup.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.setup.description")})]}),e.jsxs("form",{onSubmit:j,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.setup.apiKey")}),e.jsx("input",{type:"password",value:d,onChange:s=>f(s.target.value),required:!0,autoComplete:"off",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.setup.username")}),e.jsx("input",{type:"text",value:l,onChange:s=>y(s.target.value),required:!0,autoComplete:"username",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.setup.password")}),e.jsx("input",{type:"password",value:a,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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.setup.confirmPassword")}),e.jsx("input",{type:"password",value:u,onChange:s=>w(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"})]}),i&&e.jsx("p",{className:"text-sm text-status-error",children:i}),e.jsx("button",{type:"submit",disabled:c,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:c?t("common.loading"):t("auth.setup.submit")})]})]})})}export{E as Setup};
@@ -1 +1 @@
1
- import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{ae as m,b as h}from"./main-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function j(){const[t,r]=d.useState("loading"),[i,a]=d.useState(""),l=(typeof window<"u"?window.location.pathname:"").match(/\/code\/s\/([^/?]+)/),o=l?l[1]:null;return d.useEffect(()=>{if(!o){r("invalid"),a("Share link is invalid — no token found.");return}if(!o.startsWith("shr_")){r("invalid"),a("Invalid share token format.");return}let n=!1;async function c(){try{const s=await m(o);if(n)return;window.location.href=`/code/${s.id}`}catch(s){if(n)return;s instanceof h?s.status===401&&s.message.toLowerCase().includes("expired")?(r("expired"),a("This share has expired.")):s.status===404?s.message.toLowerCase().includes("session")?(r("not_found"),a("Session not found.")):(r("invalid"),a("Share not found or has been revoked.")):s.status===403?(r("invalid"),a("You do not have permission to access this share.")):(r("error"),a(s.message||"Failed to resolve share.")):(r("error"),a(s instanceof Error?s.message:"Failed to resolve share."))}}return c(),()=>{n=!0}},[o]),d.useEffect(()=>{if(t!=="loading"&&t!=="error"){const n=setTimeout(()=>{window.location.href="/code"},3e3);return()=>clearTimeout(n)}},[t]),t==="loading"?e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-muted",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-brand border-t-transparent rounded-full mx-auto mb-3"}),e.jsx("p",{children:"Resolving share link..."})]})}):e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-primary",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[t==="expired"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Share Expired"}),e.jsx("p",{className:"text-text-muted mb-4",children:i||"This share has expired."})]}),t==="invalid"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Invalid Share"}),e.jsx("p",{className:"text-text-muted mb-4",children:i||"This share link is invalid or has been revoked."})]}),t==="not_found"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Not Found"}),e.jsx("p",{className:"text-text-muted mb-4",children:i||"The session could not be found."})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Error"}),e.jsx("p",{className:"text-status-error mb-4",children:i})]}),e.jsx("a",{href:"/code",className:"text-brand-text hover:underline",children:"← Back to Dashboard"})]})})}export{j as ShareLanding};
1
+ import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{aj as m,b as h}from"./main-CqWvY7FG.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function j(){const[t,r]=d.useState("loading"),[i,a]=d.useState(""),l=(typeof window<"u"?window.location.pathname:"").match(/\/code\/s\/([^/?]+)/),o=l?l[1]:null;return d.useEffect(()=>{if(!o){r("invalid"),a("Share link is invalid — no token found.");return}if(!o.startsWith("shr_")){r("invalid"),a("Invalid share token format.");return}let n=!1;async function c(){try{const s=await m(o);if(n)return;window.location.href=`/code/${s.id}`}catch(s){if(n)return;s instanceof h?s.status===401&&s.message.toLowerCase().includes("expired")?(r("expired"),a("This share has expired.")):s.status===404?s.message.toLowerCase().includes("session")?(r("not_found"),a("Session not found.")):(r("invalid"),a("Share not found or has been revoked.")):s.status===403?(r("invalid"),a("You do not have permission to access this share.")):(r("error"),a(s.message||"Failed to resolve share.")):(r("error"),a(s instanceof Error?s.message:"Failed to resolve share."))}}return c(),()=>{n=!0}},[o]),d.useEffect(()=>{if(t!=="loading"&&t!=="error"){const n=setTimeout(()=>{window.location.href="/code"},3e3);return()=>clearTimeout(n)}},[t]),t==="loading"?e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-muted",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-brand border-t-transparent rounded-full mx-auto mb-3"}),e.jsx("p",{children:"Resolving share link..."})]})}):e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-primary",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[t==="expired"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Share Expired"}),e.jsx("p",{className:"text-text-muted mb-4",children:i||"This share has expired."})]}),t==="invalid"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Invalid Share"}),e.jsx("p",{className:"text-text-muted mb-4",children:i||"This share link is invalid or has been revoked."})]}),t==="not_found"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Not Found"}),e.jsx("p",{className:"text-text-muted mb-4",children:i||"The session could not be found."})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:"Error"}),e.jsx("p",{className:"text-status-error mb-4",children:i})]}),e.jsx("a",{href:"/code",className:"text-brand-text hover:underline",children:"← Back to Dashboard"})]})})}export{j as ShareLanding};
@@ -1,4 +1,4 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{ap as q,W as T,aL as D,aD as t,e as B,X as F,aE as G,an as I,U as K,at as X,a6 as Y,al as J,ak as Q,aK as V,z as Z,m as ee,r as te,P as se,n as ae,p as ne,o as H,q as re,N as ie}from"./main-BopVSHhX.js";import{R as M,E as oe}from"./RegisterEmpty-BrBfeQXp.js";import{U as le,A as O}from"./UserSearchInput-wixyd_8w.js";import{C as U}from"./copy-CvmA5P_Q.js";import{g as ce}from"./workerType-BF4aY_R_.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{av as q,W as T,aR as M,aJ as t,e as B,X as F,aK as G,at as I,U as J,az as K,a8 as Q,aq as X,ap as Y,aQ as V,z as Z,m as ee,r as te,P as se,n as ae,p as ne,o as H,q as re,N as ie}from"./main-CqWvY7FG.js";import{R as U,E as oe}from"./RegisterEmpty-RNN7njqd.js";import{U as le,A as O}from"./UserSearchInput-B-phMzno.js";import{C as D}from"./copy-COu9cGeU.js";import{g as ce}from"./workerType-BURsA0u4.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{ap as q,W as T,aL as D,aD
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 xe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],ue=q("user-plus",xe);function W(n){const[x,i]=r.useState([]),[k,v]=r.useState(!1),l=r.useCallback(async()=>{if(n){v(!0);try{const p=await T("GET",`/web/teams/${n}/members`);i(p)}catch{i([])}finally{v(!1)}}},[n]);r.useEffect(()=>{l()},[l]);const b=r.useCallback(async(p,y)=>{await T("POST",`/web/teams/${n}/members`,{userId:p,role:y}),await l()},[n,l]),u=r.useCallback(async p=>{await T("DELETE",`/web/teams/${n}/members/${p}`),await l()},[n,l]),d=r.useCallback(async(p,y)=>{await T("PATCH",`/web/teams/${n}/members/${p}`,{role:y}),await l()},[n,l]);return{members:x,isLoading:k,addMember:b,removeMember:u,updateRole:d,refetch:l}}function pe(n){const[x,i]=r.useState([]),k=r.useCallback(async l=>{if(!n)return null;const b=await T("POST",`/web/teams/${n}/invitations`,l);return i(u=>[...u,b]),b},[n]),v=r.useCallback(async l=>{n&&(await T("DELETE",`/web/teams/${n}/invitations/${l}`),i(b=>b.filter(u=>u.token!==l)))},[n]);return{invitations:x,createInvitation:k,revokeInvitation:v}}function he({teamId:n,canManage:x}){D();const{invitations:i,createInvitation:k,revokeInvitation:v}=pe(n),{addMember:l}=W(n),[b,u]=r.useState(!1),[d,p]=r.useState(null),[y,C]=r.useState("member"),[m,w]=r.useState(!1),[g,f]=r.useState("member"),[j,_]=r.useState(null),[A,L]=r.useState(!1),[a,s]=r.useState(!1),[c,h]=r.useState(!1),N=async()=>{u(!0);try{const o=await k({role:y,expiresIn:86400,maxUses:5});o&&p(o.token||o.inviteToken||null)}catch{}finally{u(!1)}},$=async()=>{if(!d)return;const o=`${window.location.origin}/join?invite=${d}`;let S=!1;try{navigator.clipboard&&window.isSecureContext&&(await navigator.clipboard.writeText(o),S=!0)}catch{}if(!S){const E=document.createElement("textarea");E.value=o,E.style.position="fixed",E.style.top="0",E.style.opacity="0",document.body.appendChild(E),E.focus(),E.select(),E.setSelectionRange(0,o.length);try{S=document.execCommand("copy")}catch{S=!1}document.body.removeChild(E)}S?(h(!1),s(!0),setTimeout(()=>s(!1),2e3)):(s(!1),h(!0),setTimeout(()=>h(!1),4e3))},R=async o=>{L(!0),_(null);try{await l(o,g),w(!1)}catch(S){_(S instanceof Error?S.message:t("invitation.addFailed"))}finally{L(!1)}};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.invitations")}),x&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",value:y,onChange:o=>C(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]}),e.jsx("button",{type:"button",onClick:N,disabled:b,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:b?t("invitation.creating"):t("invitation.create")}),e.jsxs("button",{type:"button",onClick:()=>w(o=>!o),"aria-pressed":m,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2",title:t("invitation.addExistingHint"),children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),t("invitation.addExisting")]})]}),d&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-surface-1 px-3 py-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-primary",children:`${window.location.origin}/join?invite=${d}`}),e.jsx("button",{type:"button",onClick:$,className:a?"text-status-active":"text-text-muted hover:text-text-primary",title:a?t("share.copied"):t("share.copy"),children:a?e.jsx(B,{className:"h-4 w-4"}):e.jsx(U,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>p(null),className:"text-text-muted hover:text-text-primary","aria-label":t("common.cancel"),children:e.jsx(F,{className:"h-4 w-4"})})]}),c&&e.jsx("p",{className:"text-xs text-status-error",children:t("share.copyFailed")}),m&&x&&e.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-surface-1 p-3",children:[e.jsx("p",{className:"text-xs text-text-muted",children:t("invitation.addExistingHint")}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2 py-1.5 text-sm text-text-primary focus:border-accent focus:outline-none",value:g,onChange:o=>f(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]})}),j&&e.jsx("p",{className:"text-xs text-destructive",children:j}),e.jsx(le,{onSelect:R,actionDisabled:A,placeholder:t("invitation.searchUser")})]}),i.length===0?e.jsx(M,{title:t("invitation.emptyTitle"),hint:t("invitation.emptyHint")}):e.jsx("div",{className:"ds-reg",children:i.map(o=>e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsx("span",{className:"ds-reg-tag shrink-0 rounded-full border border-border/60 bg-surface-2 text-text-muted",children:o.role==="admin"?t("invitation.admin"):t("invitation.member")}),e.jsx("span",{className:"ds-reg-meta truncate font-mono text-xs text-text-muted",children:G("invitation.expires",{date:new Date(o.expiresAt).toLocaleDateString()})})]}),x&&e.jsx("div",{className:"ds-reg-aside",children:e.jsx("button",{type:"button",onClick:()=>v(o.token),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:t("invitation.revoke"),"aria-label":t("invitation.revoke"),children:e.jsx(F,{className:"h-4 w-4"})})})]},o.token))})]})}function be({teamId:n,canManage:x}){D();const[i,k]=r.useState([]),[v,l]=r.useState(!0),[b,u]=r.useState(null),[d,p]=r.useState(""),[y,C]=r.useState(null),[m,w]=r.useState(!1),g=async()=>{try{const a=await Y();k(a||[])}catch(a){u(a instanceof Error?a.message:t("team.detail.loadEnvsFailed"))}finally{l(!1)}};r.useEffect(()=>{g()},[]);const f=r.useMemo(()=>i.filter(a=>a.team_id===n),[i,n]),j=r.useMemo(()=>i.filter(a=>!a.team_id),[i]),_=async()=>{if(d){C(null);try{await Q(d,n),p(""),await g()}catch(a){C(a instanceof Error?a.message:t("team.detail.linkFailed"))}}},A=async a=>{if(window.confirm(t("team.detail.unlinkConfirm"))){C(null);try{await J(n,a),await g()}catch(s){C(s instanceof Error?s.message:t("team.detail.unlinkFailed"))}}},L=async()=>{const a=`slz rc --team-id ${n}`;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(a),w(!0),setTimeout(()=>w(!1),2e3);return}}catch{}const s=document.createElement("textarea");s.value=a,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();try{document.execCommand("copy"),w(!0),setTimeout(()=>w(!1),2e3)}catch{}document.body.removeChild(s)};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.environments")}),v?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):b?e.jsx("p",{className:"text-sm text-status-error",children:b}):e.jsxs(e.Fragment,{children:[f.length===0?e.jsx(M,{title:t("team.detail.envsEmptyTitle"),hint:t("team.detail.envsEmptyHint")}):e.jsx("div",{className:"ds-reg",children:f.map(a=>{var N,$;const s=ce(a.worker_type),c=((N=a.directory)==null?void 0:N.trim())||null,h=(($=a.owner_username)==null?void 0:$.trim())||null;return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",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:a.machine_name||a.id}),e.jsx("span",{className:I("ds-reg-tag rounded-full",s.colorClass),children:s.fullLabel}),e.jsx(oe,{status:a.status,className:"ds-reg-tag"})]}),(c||h)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[c&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:c}),c&&h&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),h&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${h}`,children:[e.jsx(K,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:h})]})]})]}),e.jsxs("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:X(a.created_at)}),x&&e.jsx("button",{type:"button",onClick:()=>A(a.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:t("team.detail.unlink"),"aria-label":t("team.detail.unlink"),children:e.jsx(me,{className:"h-4 w-4"})})]})]},a.id)})}),x&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs text-text-muted",children:t("team.detail.registerHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("code",{className:"rounded-md border border-border bg-surface-2 px-3 py-1.5 font-mono text-xs text-text-primary",children:["slz rc --team-id ",n]}),e.jsx("button",{type:"button",onClick:L,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyCommand"),title:t("team.detail.copyCommand"),children:e.jsx(U,{className:"h-3.5 w-3.5"})}),m&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")})]})]}),j.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"team-link-env",className:"text-xs text-text-muted",children:t("team.detail.linkHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{id:"team-link-env",value:d,onChange:a=>p(a.target.value),className:"max-w-md rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:t("team.detail.linkSelect")}),j.map(a=>e.jsx("option",{value:a.id,children:a.machine_name||a.id},a.id))]}),e.jsx("button",{type:"button",onClick:_,disabled:!d,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:t("team.detail.link")})]})]})]}),y&&e.jsx("p",{className:"text-sm text-status-error",children:y})]})]})}async function fe(n){try{const x=n.startsWith("team_")?`/web/teams/${n}`:`/web/teams/by-slug/${n}`;return await T("GET",x)}catch{return null}}const ye={owner:"team.member.roleOwner",admin:"team.member.roleAdmin",member:"team.member.roleMember"},P={owner:"border-brand/30 bg-brand/10 text-brand-text",admin:"border-accent/30 bg-accent/10 text-accent",member:"border-border/60 bg-surface-2 text-text-muted"};function z(n){return t(ye[n]||"team.member.roleMember")}function Se(){D();const n=window.location.pathname.split("/"),x=n[n.length-1]||"",[i,k]=r.useState(null),[v,l]=r.useState(!0),[b,u]=r.useState(!1),{members:d,isLoading:p,updateRole:y,removeMember:C}=W((i==null?void 0:i.id)||null),{user:m}=V(),[w,g]=r.useState("");if(r.useEffect(()=>{x&&(l(!0),fe(x).then(s=>{k(s),l(!1)}))},[x]),v)return e.jsx("div",{className:"ds-page text-sm text-text-muted",children:t("common.loading")});if(!i)return e.jsxs("div",{className:"ds-page",children:[e.jsx("div",{className:"ds-page-head",children:e.jsxs("a",{href:"/teams",className:"ds-page-back",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),t("team.detail.back")]})}),e.jsx("p",{className:"text-sm text-text-muted",children:t("team.detail.notFound")})]});const f=d.find(s=>s.user_id===(m==null?void 0:m.userId)),j=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner"||(f==null?void 0:f.role)==="admin",_=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner",A=async()=>{const s=i.id;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(s),u(!0),setTimeout(()=>u(!1),2e3);return}}catch{}const c=document.createElement("textarea");c.value=s,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select();try{document.execCommand("copy"),u(!0),setTimeout(()=>u(!1),2e3)}catch{}document.body.removeChild(c)},L=async(s,c)=>{if(s.role!==c){g("");try{await y(s.user_id,c)}catch(h){g(h instanceof Error?h.message:t("team.member.updateFailed"))}}},a=async s=>{const c=s.username||s.user_id;if(window.confirm(t("team.member.removeConfirm").replace("{name}",c))){g("");try{await C(s.user_id)}catch(N){g(N instanceof Error?N.message:t("team.member.updateFailed"))}}};return e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("span",{className:"ds-page-runhead-label",children:t("team.list.kicker")})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:i.name}),e.jsx("span",{className:"ds-page-count",children:G("team.detail.memberCount",{n:d.length})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"font-mono text-xs text-text-muted",children:["/",i.slug]}),e.jsx("span",{className:"font-mono text-xs text-text-muted","aria-hidden":"true",children:"·"}),e.jsx("code",{className:"font-mono text-xs text-text-muted",children:i.id}),e.jsx("button",{type:"button",onClick:A,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyId"),title:t("team.detail.copyId"),children:e.jsx(U,{className:"h-3.5 w-3.5"})}),b&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")}),j&&e.jsx("a",{href:`/teams/${i.slug}/settings`,className:"ml-1 text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.settings.title"),title:t("team.settings.title"),children:e.jsx(Z,{className:"h-4 w-4"})}),e.jsx("a",{href:"/teams",className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.back"),title:t("team.detail.back"),children:e.jsx(O,{className:"h-4 w-4"})})]}),i.description&&e.jsx("p",{className:"ds-page-lede",children:i.description})]}),e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.members")}),w&&e.jsx("p",{className:"text-sm text-status-error",children:w}),p?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):d.length===0?e.jsx(M,{title:t("team.detail.membersEmptyTitle"),hint:t("team.detail.membersEmptyHint")}):e.jsx("div",{className:"ds-reg",children:d.map(s=>{const c=s.user_id===(m==null?void 0:m.userId),h=s.role==="owner"||s.role==="admin",N=j&&(!h||_),$=N&&!(s.role==="owner"&&d.filter(o=>o.role==="owner").length<=1),R=["owner","admin","member"];return e.jsxs("div",{className:"ds-reg-row",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:s.username||s.user_id}),c&&e.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:t("team.member.you")}),e.jsx("span",{className:I("ds-reg-tag shrink-0 rounded-full border",P[s.role]||P.member),children:z(s.role)})]}),e.jsx("span",{className:"ds-reg-meta min-w-0 truncate font-mono text-xs text-text-muted",children:s.user_id})]}),j&&e.jsx("div",{className:"ds-reg-aside",children:e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,children:e.jsx("button",{type:"button",disabled:!N,className:"rounded p-1 text-text-muted transition-colors hover:bg-surface-1 hover:text-text-primary disabled:opacity-40 disabled:hover:bg-transparent","aria-label":t("team.member.changeRole"),title:t("team.member.changeRole"),children:e.jsx(se,{className:"h-4 w-4"})})}),e.jsxs(ae,{align:"end",className:"w-48",children:[e.jsx(ne,{className:"text-xs text-text-muted",children:t("team.member.changeRole")}),R.map(o=>e.jsxs(H,{onSelect:()=>L(s,o),className:"flex items-center justify-between",children:[e.jsx("span",{children:z(o)}),s.role===o&&e.jsx(B,{className:"h-3.5 w-3.5 text-brand-text"})]},o)),e.jsx(re,{}),e.jsxs(H,{variant:"destructive",disabled:!$,onSelect:()=>a(s),className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t("team.member.remove")})]})]})]})})]},s.user_id)})})]}),e.jsx(be,{teamId:i.id,canManage:j}),e.jsx(he,{teamId:i.id,canManage:j})]})}export{Se as TeamDetail};
11
+ */const xe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],ue=q("user-plus",xe);function W(n){const[x,i]=r.useState([]),[k,v]=r.useState(!1),l=r.useCallback(async()=>{if(n){v(!0);try{const p=await T("GET",`/web/teams/${n}/members`);i(p)}catch{i([])}finally{v(!1)}}},[n]);r.useEffect(()=>{l()},[l]);const b=r.useCallback(async(p,y)=>{await T("POST",`/web/teams/${n}/members`,{userId:p,role:y}),await l()},[n,l]),u=r.useCallback(async p=>{await T("DELETE",`/web/teams/${n}/members/${p}`),await l()},[n,l]),d=r.useCallback(async(p,y)=>{await T("PATCH",`/web/teams/${n}/members/${p}`,{role:y}),await l()},[n,l]);return{members:x,isLoading:k,addMember:b,removeMember:u,updateRole:d,refetch:l}}function pe(n){const[x,i]=r.useState([]),k=r.useCallback(async l=>{if(!n)return null;const b=await T("POST",`/web/teams/${n}/invitations`,l);return i(u=>[...u,b]),b},[n]),v=r.useCallback(async l=>{n&&(await T("DELETE",`/web/teams/${n}/invitations/${l}`),i(b=>b.filter(u=>u.token!==l)))},[n]);return{invitations:x,createInvitation:k,revokeInvitation:v}}function he({teamId:n,canManage:x}){M();const{invitations:i,createInvitation:k,revokeInvitation:v}=pe(n),{addMember:l}=W(n),[b,u]=r.useState(!1),[d,p]=r.useState(null),[y,C]=r.useState("member"),[m,w]=r.useState(!1),[g,f]=r.useState("member"),[j,_]=r.useState(null),[R,L]=r.useState(!1),[a,s]=r.useState(!1),[c,h]=r.useState(!1),N=async()=>{u(!0);try{const o=await k({role:y,expiresIn:86400,maxUses:5});o&&p(o.token||o.inviteToken||null)}catch{}finally{u(!1)}},$=async()=>{if(!d)return;const o=`${window.location.origin}/join?invite=${d}`;let S=!1;try{navigator.clipboard&&window.isSecureContext&&(await navigator.clipboard.writeText(o),S=!0)}catch{}if(!S){const E=document.createElement("textarea");E.value=o,E.style.position="fixed",E.style.top="0",E.style.opacity="0",document.body.appendChild(E),E.focus(),E.select(),E.setSelectionRange(0,o.length);try{S=document.execCommand("copy")}catch{S=!1}document.body.removeChild(E)}S?(h(!1),s(!0),setTimeout(()=>s(!1),2e3)):(s(!1),h(!0),setTimeout(()=>h(!1),4e3))},A=async o=>{L(!0),_(null);try{await l(o,g),w(!1)}catch(S){_(S instanceof Error?S.message:t("invitation.addFailed"))}finally{L(!1)}};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.invitations")}),x&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",value:y,onChange:o=>C(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]}),e.jsx("button",{type:"button",onClick:N,disabled:b,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:b?t("invitation.creating"):t("invitation.create")}),e.jsxs("button",{type:"button",onClick:()=>w(o=>!o),"aria-pressed":m,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2",title:t("invitation.addExistingHint"),children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),t("invitation.addExisting")]})]}),d&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-surface-1 px-3 py-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-primary",children:`${window.location.origin}/join?invite=${d}`}),e.jsx("button",{type:"button",onClick:$,className:a?"text-status-active":"text-text-muted hover:text-text-primary",title:a?t("share.copied"):t("share.copy"),children:a?e.jsx(B,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>p(null),className:"text-text-muted hover:text-text-primary","aria-label":t("common.cancel"),children:e.jsx(F,{className:"h-4 w-4"})})]}),c&&e.jsx("p",{className:"text-xs text-status-error",children:t("share.copyFailed")}),m&&x&&e.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-surface-1 p-3",children:[e.jsx("p",{className:"text-xs text-text-muted",children:t("invitation.addExistingHint")}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2 py-1.5 text-sm text-text-primary focus:border-accent focus:outline-none",value:g,onChange:o=>f(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]})}),j&&e.jsx("p",{className:"text-xs text-destructive",children:j}),e.jsx(le,{onSelect:A,actionDisabled:R,placeholder:t("invitation.searchUser")})]}),i.length===0?e.jsx(U,{title:t("invitation.emptyTitle"),hint:t("invitation.emptyHint")}):e.jsx("div",{className:"ds-reg",children:i.map(o=>e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsx("span",{className:"ds-reg-tag shrink-0 rounded-full border border-border/60 bg-surface-2 text-text-muted",children:o.role==="admin"?t("invitation.admin"):t("invitation.member")}),e.jsx("span",{className:"ds-reg-meta truncate font-mono text-xs text-text-muted",children:G("invitation.expires",{date:new Date(o.expiresAt).toLocaleDateString()})})]}),x&&e.jsx("div",{className:"ds-reg-aside",children:e.jsx("button",{type:"button",onClick:()=>v(o.token),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:t("invitation.revoke"),"aria-label":t("invitation.revoke"),children:e.jsx(F,{className:"h-4 w-4"})})})]},o.token))})]})}function be({teamId:n,canManage:x}){M();const[i,k]=r.useState([]),[v,l]=r.useState(!0),[b,u]=r.useState(null),[d,p]=r.useState(""),[y,C]=r.useState(null),[m,w]=r.useState(!1),g=async()=>{try{const a=await Q();k(a||[])}catch(a){u(a instanceof Error?a.message:t("team.detail.loadEnvsFailed"))}finally{l(!1)}};r.useEffect(()=>{g()},[]);const f=r.useMemo(()=>i.filter(a=>a.team_id===n),[i,n]),j=r.useMemo(()=>i.filter(a=>!a.team_id),[i]),_=async()=>{if(d){C(null);try{await Y(d,n),p(""),await g()}catch(a){C(a instanceof Error?a.message:t("team.detail.linkFailed"))}}},R=async a=>{if(window.confirm(t("team.detail.unlinkConfirm"))){C(null);try{await X(n,a),await g()}catch(s){C(s instanceof Error?s.message:t("team.detail.unlinkFailed"))}}},L=async()=>{const a=`slz rc --team-id ${n}`;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(a),w(!0),setTimeout(()=>w(!1),2e3);return}}catch{}const s=document.createElement("textarea");s.value=a,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();try{document.execCommand("copy"),w(!0),setTimeout(()=>w(!1),2e3)}catch{}document.body.removeChild(s)};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.environments")}),v?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):b?e.jsx("p",{className:"text-sm text-status-error",children:b}):e.jsxs(e.Fragment,{children:[f.length===0?e.jsx(U,{title:t("team.detail.envsEmptyTitle"),hint:t("team.detail.envsEmptyHint")}):e.jsx("div",{className:"ds-reg",children:f.map(a=>{var N,$;const s=ce(a.worker_type),c=((N=a.directory)==null?void 0:N.trim())||null,h=(($=a.owner_username)==null?void 0:$.trim())||null;return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",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:a.machine_name||a.id}),e.jsx("span",{className:I("ds-reg-tag rounded-full",s.colorClass),children:s.fullLabel}),e.jsx(oe,{status:a.status,className:"ds-reg-tag"})]}),(c||h)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[c&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:c}),c&&h&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),h&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${h}`,children:[e.jsx(J,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:h})]})]})]}),e.jsxs("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:K(a.created_at)}),x&&e.jsx("button",{type:"button",onClick:()=>R(a.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:t("team.detail.unlink"),"aria-label":t("team.detail.unlink"),children:e.jsx(me,{className:"h-4 w-4"})})]})]},a.id)})}),x&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs text-text-muted",children:t("team.detail.registerHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("code",{className:"rounded-md border border-border bg-surface-2 px-3 py-1.5 font-mono text-xs text-text-primary",children:["slz rc --team-id ",n]}),e.jsx("button",{type:"button",onClick:L,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyCommand"),title:t("team.detail.copyCommand"),children:e.jsx(D,{className:"h-3.5 w-3.5"})}),m&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")})]})]}),j.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"team-link-env",className:"text-xs text-text-muted",children:t("team.detail.linkHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{id:"team-link-env",value:d,onChange:a=>p(a.target.value),className:"max-w-md rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:t("team.detail.linkSelect")}),j.map(a=>e.jsx("option",{value:a.id,children:a.machine_name||a.id},a.id))]}),e.jsx("button",{type:"button",onClick:_,disabled:!d,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:t("team.detail.link")})]})]})]}),y&&e.jsx("p",{className:"text-sm text-status-error",children:y})]})]})}async function fe(n){try{const x=n.startsWith("team_")?`/web/teams/${n}`:`/web/teams/by-slug/${n}`;return await T("GET",x)}catch{return null}}const ye={owner:"team.member.roleOwner",admin:"team.member.roleAdmin",member:"team.member.roleMember"},P={owner:"border-brand/30 bg-brand/10 text-brand-text",admin:"border-accent/30 bg-accent/10 text-accent",member:"border-border/60 bg-surface-2 text-text-muted"};function z(n){return t(ye[n]||"team.member.roleMember")}function Se(){M();const n=window.location.pathname.split("/"),x=n[n.length-1]||"",[i,k]=r.useState(null),[v,l]=r.useState(!0),[b,u]=r.useState(!1),{members:d,isLoading:p,updateRole:y,removeMember:C}=W((i==null?void 0:i.id)||null),{user:m}=V(),[w,g]=r.useState("");if(r.useEffect(()=>{x&&(l(!0),fe(x).then(s=>{k(s),l(!1)}))},[x]),v)return e.jsx("div",{className:"ds-page text-sm text-text-muted",children:t("common.loading")});if(!i)return e.jsxs("div",{className:"ds-page",children:[e.jsx("div",{className:"ds-page-head",children:e.jsxs("a",{href:"/teams",className:"ds-page-back",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),t("team.detail.back")]})}),e.jsx("p",{className:"text-sm text-text-muted",children:t("team.detail.notFound")})]});const f=d.find(s=>s.user_id===(m==null?void 0:m.userId)),j=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner"||(f==null?void 0:f.role)==="admin",_=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner",R=async()=>{const s=i.id;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(s),u(!0),setTimeout(()=>u(!1),2e3);return}}catch{}const c=document.createElement("textarea");c.value=s,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select();try{document.execCommand("copy"),u(!0),setTimeout(()=>u(!1),2e3)}catch{}document.body.removeChild(c)},L=async(s,c)=>{if(s.role!==c){g("");try{await y(s.user_id,c)}catch(h){g(h instanceof Error?h.message:t("team.member.updateFailed"))}}},a=async s=>{const c=s.username||s.user_id;if(window.confirm(t("team.member.removeConfirm").replace("{name}",c))){g("");try{await C(s.user_id)}catch(N){g(N instanceof Error?N.message:t("team.member.updateFailed"))}}};return e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("span",{className:"ds-page-runhead-label",children:t("team.list.kicker")})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:i.name}),e.jsx("span",{className:"ds-page-count",children:G("team.detail.memberCount",{n:d.length})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"font-mono text-xs text-text-muted",children:["/",i.slug]}),e.jsx("span",{className:"font-mono text-xs text-text-muted","aria-hidden":"true",children:"·"}),e.jsx("code",{className:"font-mono text-xs text-text-muted",children:i.id}),e.jsx("button",{type:"button",onClick:R,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyId"),title:t("team.detail.copyId"),children:e.jsx(D,{className:"h-3.5 w-3.5"})}),b&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")}),j&&e.jsx("a",{href:`/teams/${i.slug}/settings`,className:"ml-1 text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.settings.title"),title:t("team.settings.title"),children:e.jsx(Z,{className:"h-4 w-4"})}),e.jsx("a",{href:"/teams",className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.back"),title:t("team.detail.back"),children:e.jsx(O,{className:"h-4 w-4"})})]}),i.description&&e.jsx("p",{className:"ds-page-lede",children:i.description})]}),e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.members")}),w&&e.jsx("p",{className:"text-sm text-status-error",children:w}),p?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):d.length===0?e.jsx(U,{title:t("team.detail.membersEmptyTitle"),hint:t("team.detail.membersEmptyHint")}):e.jsx("div",{className:"ds-reg",children:d.map(s=>{const c=s.user_id===(m==null?void 0:m.userId),h=s.role==="owner"||s.role==="admin",N=j&&(!h||_),$=N&&!(s.role==="owner"&&d.filter(o=>o.role==="owner").length<=1),A=["owner","admin","member"];return e.jsxs("div",{className:"ds-reg-row",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:s.username||s.user_id}),c&&e.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:t("team.member.you")}),e.jsx("span",{className:I("ds-reg-tag shrink-0 rounded-full border",P[s.role]||P.member),children:z(s.role)})]}),e.jsx("span",{className:"ds-reg-meta min-w-0 truncate font-mono text-xs text-text-muted",children:s.user_id})]}),j&&e.jsx("div",{className:"ds-reg-aside",children:e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,children:e.jsx("button",{type:"button",disabled:!N,className:"rounded p-1 text-text-muted transition-colors hover:bg-surface-1 hover:text-text-primary disabled:opacity-40 disabled:hover:bg-transparent","aria-label":t("team.member.changeRole"),title:t("team.member.changeRole"),children:e.jsx(se,{className:"h-4 w-4"})})}),e.jsxs(ae,{align:"end",className:"w-48",children:[e.jsx(ne,{className:"text-xs text-text-muted",children:t("team.member.changeRole")}),A.map(o=>e.jsxs(H,{onSelect:()=>L(s,o),className:"flex items-center justify-between",children:[e.jsx("span",{children:z(o)}),s.role===o&&e.jsx(B,{className:"h-3.5 w-3.5 text-brand-text"})]},o)),e.jsx(re,{}),e.jsxs(H,{variant:"destructive",disabled:!$,onSelect:()=>a(s),className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t("team.member.remove")})]})]})]})})]},s.user_id)})})]}),e.jsx(be,{teamId:i.id,canManage:j}),e.jsx(he,{teamId:i.id,canManage:j})]})}export{Se as TeamDetail};
@@ -1 +1 @@
1
- import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{aL as b,aM as v,aD as a,aK as C,aE as f,N as D,W as S}from"./main-BopVSHhX.js";import{D as E,a as T,d as k}from"./dialog-B4hKrd7w.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function L({open:c,onClose:n,onCreated:m}){b();const{createTeam:N}=v(),[l,h]=d.useState(""),[i,o]=d.useState(""),[x,p]=d.useState(""),[s,r]=d.useState(""),[u,j]=d.useState(!1);d.useEffect(()=>{c&&(h(""),o(""),p(""),r(""),j(!1))},[c]);const w=t=>{h(t),i||o(t.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-"))},y=async t=>{t.preventDefault(),r(""),j(!0);try{const g=await N({name:l,slug:i,description:x||void 0});m(g)}catch(g){r(g instanceof Error?g.message:a("team.create.failed"))}finally{j(!1)}};return e.jsx(E,{open:c,onOpenChange:t=>{t||n()},children:e.jsx(T,{className:"nsd-shell max-w-md",children:e.jsxs("form",{className:"nsd-box nsd-box--single",onSubmit:y,children:[e.jsx(k,{className:"nsd-h",children:a("team.create.title")}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.name")}),e.jsx("input",{type:"text",required:!0,value:l,onChange:t=>w(t.target.value),placeholder:"Engineering",className:"nsd-title"}),e.jsx("span",{className:"text-xs text-text-muted",children:a("team.create.nameHint")})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.slug")}),e.jsx("input",{type:"text",required:!0,value:i,onChange:t=>o(t.target.value),pattern:"^[a-z0-9-]{3,32}$",placeholder:"engineering",className:"nsd-title"}),e.jsx("span",{className:"text-xs text-text-muted",children:a("team.create.slugHint")})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.description")}),e.jsx("textarea",{value:x,onChange:t=>p(t.target.value),rows:3,className:"nsd-title nsd-area"})]}),s&&e.jsx("p",{className:"nsd-error",children:s}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:n,className:"nsd-cancel",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:u||!l||!i,className:"btn-ticket nsd-create",children:u?a("common.creating"):a("team.create.submit")})]})]})})})}function z(c,n){const m=new Date(c);return Number.isNaN(m.getTime())?"":new Intl.DateTimeFormat(n==="zh"?"zh-CN":"en-US",{year:"numeric",month:"short"}).format(m)}function I(){const c=b(),{myTeams:n,isLoading:m,refetch:N}=v(),{user:l}=C(),[h,i]=d.useState(!1),o=s=>{i(!1),window.history.pushState(null,"",`/teams/${s.slug}`),window.dispatchEvent(new PopStateEvent("popstate"))},x=s=>(l==null?void 0:l.role)==="admin"||s.created_by===(l==null?void 0:l.userId),p=async s=>{if(window.confirm(f("team.list.deleteConfirm",{name:s.name})))try{await S("DELETE",`/web/teams/${s.id}`),await N()}catch(r){alert(r instanceof Error?r.message:a("team.list.deleteFailed"))}};return m?e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("div",{className:"h-2.5 w-20 animate-pulse rounded bg-surface-2"})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("div",{className:"h-12 w-44 animate-pulse rounded bg-surface-2"}),e.jsxs("div",{className:"ds-page-titlerow-end",children:[e.jsx("div",{className:"h-2.5 w-14 animate-pulse rounded bg-surface-2"}),e.jsx("div",{className:"h-7 w-24 animate-pulse rounded-sm bg-surface-2"})]})]}),e.jsx("div",{className:"h-4 w-72 animate-pulse rounded bg-surface-2"})]}),e.jsx("div",{className:"space-y-10",children:[0,1,2].map(s=>e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-2"}),e.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-surface-2"})]},s))})]}):e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("span",{className:"ds-page-runhead-label",children:a("team.list.kicker")})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:a("team.list.title")}),e.jsxs("div",{className:"ds-page-titlerow-end",children:[n.length>0&&e.jsx("span",{className:"ds-page-count",children:f("team.list.count",{n:n.length})}),e.jsx("button",{type:"button",onClick:()=>i(!0),className:"btn-ticket",children:a("team.list.create")})]})]}),e.jsx("p",{className:"ds-page-lede",children:n.length===0?a("team.list.empty"):a("team.list.lede")})]}),n.length>0&&e.jsx("ul",{className:"space-y-10",children:n.map((s,r)=>{const u=z(s.created_at,c);return e.jsxs("li",{className:"ds-team-item group",children:[e.jsxs("a",{href:`/teams/${s.slug}`,className:"ds-team-link",children:[e.jsxs("div",{className:"ds-team-name",children:[e.jsx("span",{className:"ds-team-idx","aria-hidden":"true",children:String(r+1).padStart(2,"0")}),e.jsx("h2",{className:"font-display text-lg font-medium tracking-tight text-text-primary transition-colors group-hover:text-accent",children:s.name}),e.jsxs("span",{className:"font-mono text-xs text-text-muted",children:["/",s.slug]})]}),s.description?e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-text-muted",children:s.description}):e.jsx("p",{className:"mt-2 text-sm italic text-text-muted/60",children:a("team.list.noDescription")})]}),e.jsxs("div",{className:"ds-team-aside",children:[u&&e.jsxs("span",{className:"ds-team-date",children:[a("team.list.founded")," ",u]}),x(s)&&e.jsx("button",{type:"button",onClick:()=>p(s),className:"ds-team-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:a("team.list.delete"),"aria-label":a("team.list.delete"),children:e.jsx(D,{className:"h-4 w-4"})})]})]},s.id)})}),e.jsx(L,{open:h,onClose:()=>i(!1),onCreated:o})]})}export{I as TeamList};
1
+ import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{aR as b,aS as v,aJ as a,aQ as C,aK as f,N as S,W as D}from"./main-CqWvY7FG.js";import{D as E,a as T,d as k}from"./dialog-jGu3j2II.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function L({open:c,onClose:n,onCreated:m}){b();const{createTeam:N}=v(),[l,h]=d.useState(""),[i,o]=d.useState(""),[x,p]=d.useState(""),[s,r]=d.useState(""),[u,j]=d.useState(!1);d.useEffect(()=>{c&&(h(""),o(""),p(""),r(""),j(!1))},[c]);const w=t=>{h(t),i||o(t.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-"))},y=async t=>{t.preventDefault(),r(""),j(!0);try{const g=await N({name:l,slug:i,description:x||void 0});m(g)}catch(g){r(g instanceof Error?g.message:a("team.create.failed"))}finally{j(!1)}};return e.jsx(E,{open:c,onOpenChange:t=>{t||n()},children:e.jsx(T,{className:"nsd-shell max-w-md",children:e.jsxs("form",{className:"nsd-box nsd-box--single",onSubmit:y,children:[e.jsx(k,{className:"nsd-h",children:a("team.create.title")}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.name")}),e.jsx("input",{type:"text",required:!0,value:l,onChange:t=>w(t.target.value),placeholder:"Engineering",className:"nsd-title"}),e.jsx("span",{className:"text-xs text-text-muted",children:a("team.create.nameHint")})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.slug")}),e.jsx("input",{type:"text",required:!0,value:i,onChange:t=>o(t.target.value),pattern:"^[a-z0-9-]{3,32}$",placeholder:"engineering",className:"nsd-title"}),e.jsx("span",{className:"text-xs text-text-muted",children:a("team.create.slugHint")})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.description")}),e.jsx("textarea",{value:x,onChange:t=>p(t.target.value),rows:3,className:"nsd-title nsd-area"})]}),s&&e.jsx("p",{className:"nsd-error",children:s}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:n,className:"nsd-cancel",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:u||!l||!i,className:"btn-ticket nsd-create",children:u?a("common.creating"):a("team.create.submit")})]})]})})})}function z(c,n){const m=new Date(c);return Number.isNaN(m.getTime())?"":new Intl.DateTimeFormat(n==="zh"?"zh-CN":"en-US",{year:"numeric",month:"short"}).format(m)}function I(){const c=b(),{myTeams:n,isLoading:m,refetch:N}=v(),{user:l}=C(),[h,i]=d.useState(!1),o=s=>{i(!1),window.history.pushState(null,"",`/teams/${s.slug}`),window.dispatchEvent(new PopStateEvent("popstate"))},x=s=>(l==null?void 0:l.role)==="admin"||s.created_by===(l==null?void 0:l.userId),p=async s=>{if(window.confirm(f("team.list.deleteConfirm",{name:s.name})))try{await D("DELETE",`/web/teams/${s.id}`),await N()}catch(r){alert(r instanceof Error?r.message:a("team.list.deleteFailed"))}};return m?e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("div",{className:"h-2.5 w-20 animate-pulse rounded bg-surface-2"})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("div",{className:"h-12 w-44 animate-pulse rounded bg-surface-2"}),e.jsxs("div",{className:"ds-page-titlerow-end",children:[e.jsx("div",{className:"h-2.5 w-14 animate-pulse rounded bg-surface-2"}),e.jsx("div",{className:"h-7 w-24 animate-pulse rounded-sm bg-surface-2"})]})]}),e.jsx("div",{className:"h-4 w-72 animate-pulse rounded bg-surface-2"})]}),e.jsx("div",{className:"space-y-10",children:[0,1,2].map(s=>e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-2"}),e.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-surface-2"})]},s))})]}):e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("span",{className:"ds-page-runhead-label",children:a("team.list.kicker")})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:a("team.list.title")}),e.jsxs("div",{className:"ds-page-titlerow-end",children:[n.length>0&&e.jsx("span",{className:"ds-page-count",children:f("team.list.count",{n:n.length})}),e.jsx("button",{type:"button",onClick:()=>i(!0),className:"btn-ticket",children:a("team.list.create")})]})]}),e.jsx("p",{className:"ds-page-lede",children:n.length===0?a("team.list.empty"):a("team.list.lede")})]}),n.length>0&&e.jsx("ul",{className:"space-y-10",children:n.map((s,r)=>{const u=z(s.created_at,c);return e.jsxs("li",{className:"ds-team-item group",children:[e.jsxs("a",{href:`/teams/${s.slug}`,className:"ds-team-link",children:[e.jsxs("div",{className:"ds-team-name",children:[e.jsx("span",{className:"ds-team-idx","aria-hidden":"true",children:String(r+1).padStart(2,"0")}),e.jsx("h2",{className:"font-display text-lg font-medium tracking-tight text-text-primary transition-colors group-hover:text-accent",children:s.name}),e.jsxs("span",{className:"font-mono text-xs text-text-muted",children:["/",s.slug]})]}),s.description?e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-text-muted",children:s.description}):e.jsx("p",{className:"mt-2 text-sm italic text-text-muted/60",children:a("team.list.noDescription")})]}),e.jsxs("div",{className:"ds-team-aside",children:[u&&e.jsxs("span",{className:"ds-team-date",children:[a("team.list.founded")," ",u]}),x(s)&&e.jsx("button",{type:"button",onClick:()=>p(s),className:"ds-team-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:a("team.list.delete"),"aria-label":a("team.list.delete"),children:e.jsx(S,{className:"h-4 w-4"})})]})]},s.id)})}),e.jsx(L,{open:h,onClose:()=>i(!1),onCreated:o})]})}export{I as TeamList};
@@ -1 +1 @@
1
- import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{W as c}from"./main-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";async function j(s){try{const r=s.startsWith("team_")?`/web/teams/${s}`:`/web/teams/by-slug/${s}`;return await c("GET",r)}catch{return null}}async function w(s,r){await c("PATCH",`/web/teams/${s}`,r)}async function N(s){await c("DELETE",`/web/teams/${s}`)}function k(){const s=window.location.pathname.split("/"),r=s[s.length-2]||"",[a,f]=n.useState(null),[b,g]=n.useState(!0),[i,m]=n.useState(""),[d,l]=n.useState(""),[u,o]=n.useState(null),[x,h]=n.useState(!1);n.useEffect(()=>{r&&j(r).then(t=>{t&&(f(t),m(t.name),l(t.description||"")),g(!1)})},[r]);const v=async t=>{if(t.preventDefault(),!!a){o(null),h(!0);try{await w(a.id,{name:i,description:d}),window.location.href=`/teams/${a.slug}`}catch(p){o(p instanceof Error?p.message:"Failed to update")}finally{h(!1)}}},y=async()=>{if(a&&window.confirm("Delete this team? Environments must be transferred first."))try{await N(a.id),window.location.href="/teams"}catch(t){o(t instanceof Error?t.message:"Failed to delete")}};return b?e.jsx("div",{className:"ds-page text-text-muted",children:"Loading..."}):a?e.jsx("div",{className:"ds-page",children:e.jsxs("div",{children:[e.jsxs("header",{className:"mb-12",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:a.name}),e.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:["/",a.slug]})]}),e.jsxs("form",{onSubmit:v,className:"mb-16 max-w-md space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-text-primary mb-2",children:"Team Name"}),e.jsx("input",{id:"name",type:"text",required:!0,value:i,onChange:t=>m(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-text-primary mb-2",children:"Description"}),e.jsx("textarea",{id:"description",value:d,onChange:t=>l(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",rows:3})]}),u&&e.jsx("p",{className:"text-sm text-destructive",children:u}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"rounded-md border border-border px-4 py-2 text-sm text-text-primary hover:bg-surface-2 transition-colors",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:x||!i,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50 transition-colors",children:x?"Saving...":"Save Changes"})]})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"mb-3 text-sm font-medium text-destructive",children:"Delete team"}),e.jsx("p",{className:"mb-4 text-sm text-text-muted",children:"Deleting a team requires all environments to be transferred first."}),e.jsx("button",{type:"button",onClick:y,className:"rounded-md border border-destructive/60 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/10 transition-colors",children:"Delete Team"})]})]})}):e.jsx("div",{className:"ds-page",children:e.jsxs("div",{className:"max-w-lg",children:[e.jsx("p",{className:"text-text-muted",children:"Team not found."}),e.jsx("a",{href:"/teams",className:"text-accent hover:underline",children:"Back to teams"})]})})}export{k as TeamSettings};
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{W as c}from"./main-CqWvY7FG.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";async function j(s){try{const r=s.startsWith("team_")?`/web/teams/${s}`:`/web/teams/by-slug/${s}`;return await c("GET",r)}catch{return null}}async function w(s,r){await c("PATCH",`/web/teams/${s}`,r)}async function N(s){await c("DELETE",`/web/teams/${s}`)}function k(){const s=window.location.pathname.split("/"),r=s[s.length-2]||"",[a,f]=n.useState(null),[b,g]=n.useState(!0),[i,m]=n.useState(""),[d,l]=n.useState(""),[u,o]=n.useState(null),[x,h]=n.useState(!1);n.useEffect(()=>{r&&j(r).then(t=>{t&&(f(t),m(t.name),l(t.description||"")),g(!1)})},[r]);const v=async t=>{if(t.preventDefault(),!!a){o(null),h(!0);try{await w(a.id,{name:i,description:d}),window.location.href=`/teams/${a.slug}`}catch(p){o(p instanceof Error?p.message:"Failed to update")}finally{h(!1)}}},y=async()=>{if(a&&window.confirm("Delete this team? Environments must be transferred first."))try{await N(a.id),window.location.href="/teams"}catch(t){o(t instanceof Error?t.message:"Failed to delete")}};return b?e.jsx("div",{className:"ds-page text-text-muted",children:"Loading..."}):a?e.jsx("div",{className:"ds-page",children:e.jsxs("div",{children:[e.jsxs("header",{className:"mb-12",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:a.name}),e.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:["/",a.slug]})]}),e.jsxs("form",{onSubmit:v,className:"mb-16 max-w-md space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-text-primary mb-2",children:"Team Name"}),e.jsx("input",{id:"name",type:"text",required:!0,value:i,onChange:t=>m(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-text-primary mb-2",children:"Description"}),e.jsx("textarea",{id:"description",value:d,onChange:t=>l(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",rows:3})]}),u&&e.jsx("p",{className:"text-sm text-destructive",children:u}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"rounded-md border border-border px-4 py-2 text-sm text-text-primary hover:bg-surface-2 transition-colors",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:x||!i,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50 transition-colors",children:x?"Saving...":"Save Changes"})]})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"mb-3 text-sm font-medium text-destructive",children:"Delete team"}),e.jsx("p",{className:"mb-4 text-sm text-text-muted",children:"Deleting a team requires all environments to be transferred first."}),e.jsx("button",{type:"button",onClick:y,className:"rounded-md border border-destructive/60 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/10 transition-colors",children:"Delete Team"})]})]})}):e.jsx("div",{className:"ds-page",children:e.jsxs("div",{className:"max-w-lg",children:[e.jsx("p",{className:"text-text-muted",children:"Team not found."}),e.jsx("a",{href:"/teams",className:"text-accent hover:underline",children:"Back to teams"})]})})}export{k as TeamSettings};
@@ -1,6 +1,6 @@
1
- import{ap as v,aL as w,aD as o,W as S}from"./main-BopVSHhX.js";import{e as a,j as t}from"./vendor-DE_-CLIE.js";/**
1
+ import{av as v,aR as w,aJ as o,W as S}from"./main-CqWvY7FG.js";import{e as a,j as t}from"./vendor-DE_-CLIE.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 L=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],C=v("arrow-left",L);function E({onSelect:l,excludeUserIds:x=[],placeholder:u,actionLabel:m,actionDisabled:h=!1,className:p}){w();const[n,c]=a.useState(""),[f,s]=a.useState([]),[d,i]=a.useState(!1),b=async e=>{if(c(e),e.trim().length<2){s([]);return}i(!0);try{const N=await S("GET",`/web/users/search?q=${encodeURIComponent(e.trim())}`);s(N)}catch{s([])}finally{i(!1)}},y=e=>{l(e),c(""),s([])},r=f.filter(e=>!x.includes(e.id)),g=m??o("invitation.add"),j=u??o("invitation.searchUser");return t.jsxs("div",{className:p,children:[t.jsx("input",{type:"text",value:n,onChange:e=>b(e.target.value),placeholder:j,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"}),d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"Searching..."}),r.length>0&&t.jsx("ul",{className:"mt-2 divide-y divide-border rounded border border-border bg-surface-1",children:r.map(e=>t.jsxs("li",{className:"flex items-center justify-between px-3 py-2 text-sm",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-text-primary",children:e.username}),t.jsx("div",{className:"truncate font-mono text-xs text-text-muted",children:e.id})]}),t.jsx("button",{type:"button",onClick:()=>y(e.id),disabled:h,className:"rounded bg-accent px-2 py-1 text-xs text-white hover:bg-accent/90 disabled:opacity-50",children:g})]},e.id))}),n.trim().length>=2&&r.length===0&&!d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"No users found."})]})}export{C as A,E as U};
6
+ */const R=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],C=v("arrow-left",R);function E({onSelect:l,excludeUserIds:x=[],placeholder:u,actionLabel:m,actionDisabled:h=!1,className:p}){w();const[n,c]=a.useState(""),[f,s]=a.useState([]),[d,i]=a.useState(!1),b=async e=>{if(c(e),e.trim().length<2){s([]);return}i(!0);try{const N=await S("GET",`/web/users/search?q=${encodeURIComponent(e.trim())}`);s(N)}catch{s([])}finally{i(!1)}},y=e=>{l(e),c(""),s([])},r=f.filter(e=>!x.includes(e.id)),g=m??o("invitation.add"),j=u??o("invitation.searchUser");return t.jsxs("div",{className:p,children:[t.jsx("input",{type:"text",value:n,onChange:e=>b(e.target.value),placeholder:j,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"}),d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"Searching..."}),r.length>0&&t.jsx("ul",{className:"mt-2 divide-y divide-border rounded border border-border bg-surface-1",children:r.map(e=>t.jsxs("li",{className:"flex items-center justify-between px-3 py-2 text-sm",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-text-primary",children:e.username}),t.jsx("div",{className:"truncate font-mono text-xs text-text-muted",children:e.id})]}),t.jsx("button",{type:"button",onClick:()=>y(e.id),disabled:h,className:"rounded bg-accent px-2 py-1 text-xs text-white hover:bg-accent/90 disabled:opacity-50",children:g})]},e.id))}),n.trim().length>=2&&r.length===0&&!d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"No users found."})]})}export{C as A,E as U};
@@ -1 +1 @@
1
- import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aK as U,aL as X,aD as s,f as v,aC as H}from"./main-BopVSHhX.js";import{a as W,i as z,s as y}from"./notifications-DOBs9HVf.js";import{C as J}from"./copy-CvmA5P_Q.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function Z(){const{user:r,logout:C}=U(),S=X(),[h,m]=n.useState(""),[o,p]=n.useState(""),[x,N]=n.useState(""),[g,f]=n.useState(""),[j,i]=n.useState(""),[P,c]=n.useState(!1),w=W(),[l,b]=n.useState(()=>z()),[E,k]=n.useState(()=>w&&Notification.permission==="denied"),[d,D]=n.useState(!1),q=async()=>{if(l){y(!1),b(!1);return}let t=!0;try{Notification.permission==="default"?t=await Notification.requestPermission()==="granted":t=Notification.permission==="granted"}catch{t=!1}k(!t),t&&(y(!0),b(!0))};if(!r)return null;const T=async()=>{const t=r.userId;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),2e3);return}}catch{}const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy"),c(!0),setTimeout(()=>c(!1),2e3)}catch{}document.body.removeChild(a)},L=async t=>{if(t.preventDefault(),i(""),f(""),o.length<8){i(s("auth.setup.passwordTooShort"));return}if(o!==x){i(s("auth.setup.passwordMismatch"));return}try{const a=await fetch("/web/auth/change-password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({currentPassword:h,newPassword:o})});if(!a.ok){const u=await a.json();throw new Error(u.error||s("user.settings.changeFailed"))}f(s("user.settings.passwordChanged")),m(""),p(""),N("")}catch(a){const u=a instanceof Error?a.message:s("user.settings.changeFailed");i(u)}},O=async()=>{try{if(!(await fetch("/web/auth/logout-all",{method:"POST",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest"}})).ok){i(s("common.error"));return}await C()}catch{i(s("common.error"))}},R=()=>e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"uset-uid",children:r.userId}),e.jsx("button",{type:"button",onClick:T,className:"uset-ghost","aria-label":"Copy user ID",children:e.jsx(J,{className:"h-3.5 w-3.5"})}),P&&e.jsx("span",{className:"uset-copied",children:s("share.copied")})]}),F=()=>w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:q,className:"uset-ctl","aria-pressed":l,children:l?s("user.settings.notificationsOn"):s("user.settings.notificationsOff")}),e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsDesc")}),E&&e.jsx("p",{className:"uset-warn",children:s("user.settings.notificationsDenied")})]}):e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsUnsupported")}),I=()=>e.jsxs("span",{className:"uset-select",children:[e.jsxs("select",{value:S,onChange:t=>H(t.target.value),className:"uset-ctl uset-ctl--select",children:[e.jsx("option",{value:"zh",children:"中文"}),e.jsx("option",{value:"en",children:"English"})]}),e.jsx(v,{className:"uset-select-ico","aria-hidden":!0})]}),A=()=>e.jsxs("form",{onSubmit:L,className:"uset-form",children:[e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.currentPassword")}),e.jsx("input",{type:"password",value:h,onChange:t=>m(t.target.value),required:!0,autoComplete:"current-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.newPassword")}),e.jsx("input",{type:"password",value:o,onChange:t=>p(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.confirmNewPassword")}),e.jsx("input",{type:"password",value:x,onChange:t=>N(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),j&&e.jsx("p",{className:"uset-err",children:j}),g&&e.jsx("p",{className:"uset-ok",children:g}),e.jsx("div",{className:"uset-actions",children:e.jsx("button",{type:"submit",className:"btn-ticket",children:s("user.settings.submit")})})]}),M=()=>e.jsx("button",{onClick:O,className:"uset-danger",children:s("user.settings.logoutAll")});return e.jsxs("div",{className:"uset",children:[e.jsxs("header",{className:"uset-head",children:[e.jsx("h1",{className:"uset-name",children:r.username}),e.jsxs("div",{className:"uset-meta",children:[R(),e.jsx("span",{className:"uset-role",children:r.role})]})]}),e.jsxs("div",{className:"uset-body",children:[e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.notifications")})}),e.jsx("div",{className:"uset-secctl",children:F()})]}),e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.language")})}),e.jsx("div",{className:"uset-secctl",children:I()})]}),e.jsxs("section",{className:"uset-sec uset-sec--wide",children:[e.jsx("h2",{className:"uset-h",children:e.jsxs("button",{type:"button",className:"uset-disclosure","aria-expanded":d,"aria-controls":"uset-password",onClick:()=>D(t=>!t),children:[e.jsx("span",{children:s("user.settings.changePassword")}),e.jsx(v,{className:"uset-chev","aria-hidden":!0})]})}),e.jsx("div",{id:"uset-password",className:"uset-reveal","data-open":d,children:e.jsx("div",{className:"uset-reveal-clip",inert:!d,children:e.jsx("div",{className:"uset-secctl",children:A()})})})]})]}),e.jsxs("footer",{className:"uset-foot",children:[e.jsxs("div",{className:"uset-footlab",children:[e.jsx("h2",{className:"uset-dangerh",children:s("user.settings.logoutAll")}),e.jsx("p",{className:"uset-hint",children:"Revoke sessions on all devices."})]}),M()]})]})}export{Z as UserSettings};
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aQ as U,aR as X,aJ as s,f as v,aI as H}from"./main-CqWvY7FG.js";import{a as J,i as W,s as y}from"./notifications-BjTdDOj4.js";import{C as z}from"./copy-COu9cGeU.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function Z(){const{user:r,logout:C}=U(),S=X(),[h,m]=n.useState(""),[o,p]=n.useState(""),[x,N]=n.useState(""),[g,f]=n.useState(""),[j,i]=n.useState(""),[P,c]=n.useState(!1),w=J(),[l,b]=n.useState(()=>W()),[E,k]=n.useState(()=>w&&Notification.permission==="denied"),[d,q]=n.useState(!1),D=async()=>{if(l){y(!1),b(!1);return}let t=!0;try{Notification.permission==="default"?t=await Notification.requestPermission()==="granted":t=Notification.permission==="granted"}catch{t=!1}k(!t),t&&(y(!0),b(!0))};if(!r)return null;const T=async()=>{const t=r.userId;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),2e3);return}}catch{}const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy"),c(!0),setTimeout(()=>c(!1),2e3)}catch{}document.body.removeChild(a)},O=async t=>{if(t.preventDefault(),i(""),f(""),o.length<8){i(s("auth.setup.passwordTooShort"));return}if(o!==x){i(s("auth.setup.passwordMismatch"));return}try{const a=await fetch("/web/auth/change-password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({currentPassword:h,newPassword:o})});if(!a.ok){const u=await a.json();throw new Error(u.error||s("user.settings.changeFailed"))}f(s("user.settings.passwordChanged")),m(""),p(""),N("")}catch(a){const u=a instanceof Error?a.message:s("user.settings.changeFailed");i(u)}},R=async()=>{try{if(!(await fetch("/web/auth/logout-all",{method:"POST",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest"}})).ok){i(s("common.error"));return}await C()}catch{i(s("common.error"))}},I=()=>e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"uset-uid",children:r.userId}),e.jsx("button",{type:"button",onClick:T,className:"uset-ghost","aria-label":"Copy user ID",children:e.jsx(z,{className:"h-3.5 w-3.5"})}),P&&e.jsx("span",{className:"uset-copied",children:s("share.copied")})]}),L=()=>w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:D,className:"uset-ctl","aria-pressed":l,children:l?s("user.settings.notificationsOn"):s("user.settings.notificationsOff")}),e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsDesc")}),E&&e.jsx("p",{className:"uset-warn",children:s("user.settings.notificationsDenied")})]}):e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsUnsupported")}),F=()=>e.jsxs("span",{className:"uset-select",children:[e.jsxs("select",{value:S,onChange:t=>H(t.target.value),className:"uset-ctl uset-ctl--select",children:[e.jsx("option",{value:"zh",children:"中文"}),e.jsx("option",{value:"en",children:"English"})]}),e.jsx(v,{className:"uset-select-ico","aria-hidden":!0})]}),A=()=>e.jsxs("form",{onSubmit:O,className:"uset-form",children:[e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.currentPassword")}),e.jsx("input",{type:"password",value:h,onChange:t=>m(t.target.value),required:!0,autoComplete:"current-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.newPassword")}),e.jsx("input",{type:"password",value:o,onChange:t=>p(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.confirmNewPassword")}),e.jsx("input",{type:"password",value:x,onChange:t=>N(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),j&&e.jsx("p",{className:"uset-err",children:j}),g&&e.jsx("p",{className:"uset-ok",children:g}),e.jsx("div",{className:"uset-actions",children:e.jsx("button",{type:"submit",className:"btn-ticket",children:s("user.settings.submit")})})]}),M=()=>e.jsx("button",{onClick:R,className:"uset-danger",children:s("user.settings.logoutAll")});return e.jsxs("div",{className:"uset",children:[e.jsxs("header",{className:"uset-head",children:[e.jsx("h1",{className:"uset-name",children:r.username}),e.jsxs("div",{className:"uset-meta",children:[I(),e.jsx("span",{className:"uset-role",children:r.role})]})]}),e.jsxs("div",{className:"uset-body",children:[e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.notifications")})}),e.jsx("div",{className:"uset-secctl",children:L()})]}),e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.language")})}),e.jsx("div",{className:"uset-secctl",children:F()})]}),e.jsxs("section",{className:"uset-sec uset-sec--wide",children:[e.jsx("h2",{className:"uset-h",children:e.jsxs("button",{type:"button",className:"uset-disclosure","aria-expanded":d,"aria-controls":"uset-password",onClick:()=>q(t=>!t),children:[e.jsx("span",{children:s("user.settings.changePassword")}),e.jsx(v,{className:"uset-chev","aria-hidden":!0})]})}),e.jsx("div",{id:"uset-password",className:"uset-reveal","data-open":d,children:e.jsx("div",{className:"uset-reveal-clip",inert:!d,children:e.jsx("div",{className:"uset-secctl",children:A()})})})]})]}),e.jsxs("footer",{className:"uset-foot",children:[e.jsxs("div",{className:"uset-footlab",children:[e.jsx("h2",{className:"uset-dangerh",children:s("user.settings.logoutAll")}),e.jsx("p",{className:"uset-hint",children:"Revoke sessions on all devices."})]}),M()]})]})}export{Z as UserSettings};
@@ -1 +1 @@
1
- import{bl as ln,aO as an,H as z,b8 as w,F as G,ah as un,W as y,bd as tn,b9 as J,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core-C004NitB.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function U(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/J(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*J(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*z(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):J(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),K=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(D=0,m=g=(f+c)/2)}var B=s*z(m),C=s*w(m),L=u*z(T),M=u*w(T);if(b>y){var N=s*z(g),Q=s*w(g),V=u*z(R),X=u*w(R),O;if(S<an)if(O=pn(B,C,V,X,N,Q,L,M)){var Y=B-O[0],Z=C-O[1],$=N-O[0],k=Q-O[1],nn=1/w(fn((Y*$+Z*k)/(J(Y*Y+Z*Z)*J($*$+k*k)))/2),en=J(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=U(V,X,B,C,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(B,C,V,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{bl as ln,aO as an,H as z,b8 as w,F as G,ah as un,W as y,bd as tn,b9 as J,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core-DE67nE19.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function U(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/J(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*J(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*z(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):J(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),K=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(D=0,m=g=(f+c)/2)}var B=s*z(m),C=s*w(m),L=u*z(T),M=u*w(T);if(b>y){var N=s*z(g),Q=s*w(g),V=u*z(R),X=u*w(R),O;if(S<an)if(O=pn(B,C,V,X,N,Q,L,M)){var Y=B-O[0],Z=C-O[1],$=N-O[0],k=Q-O[1],nn=1/w(fn((Y*$+Z*k)/(J(Y*Y+Z*Z)*J($*$+k*k)))/2),en=J(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=U(V,X,B,C,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(B,C,V,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};