@abtnode/blocklet-services 1.17.5-beta-20251209-090953-3a59e7ac → 1.17.5-beta-20251214-122206-29056e8c

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 (252) hide show
  1. package/api/libs/connect/session.js +8 -0
  2. package/api/routes/user-session.js +2 -2
  3. package/api/services/auth/connect/switch-passport.js +1 -0
  4. package/dist/assets/{AdapterDayjs-DEl3BogQ.js → AdapterDayjs-p1MGZm94.js} +1 -1
  5. package/dist/assets/{Google-FE-PKKgg.js → Google-qCiUM9VP.js} +1 -1
  6. package/dist/assets/{access-control-BQ-IG3_x.js → access-control-C6MQq9M9.js} +1 -1
  7. package/dist/assets/{actions-DhSvOHy-.js → actions-CiAs-6JM.js} +1 -1
  8. package/dist/assets/{add-component-core-Cb9Jf9pu.js → add-component-core-CFL73x1V.js} +21 -21
  9. package/dist/assets/{add-resource-BmEJTiqi.js → add-resource-DVpeKvW6.js} +1 -1
  10. package/dist/assets/{addon-CzieGOEG.js → addon-B5NG3IsS.js} +1 -1
  11. package/dist/assets/{advanced-B94516o4.js → advanced-Djs25PXG.js} +1 -1
  12. package/dist/assets/{aigne-CYChXVP3.js → aigne-WBAWm6yx.js} +1 -1
  13. package/dist/assets/api-Cjc501Es.js +1 -0
  14. package/dist/assets/{appearance-C1uh29fy.js → appearance-CVS4AfPI.js} +1 -1
  15. package/dist/assets/ar-BBr9bsOg.js +7 -0
  16. package/dist/assets/{ar-oq8oqbkp.js → ar-DWlBAKPH.js} +1 -1
  17. package/dist/assets/{arrow-down.svg-DCPm0wfX.js → arrow-down.svg-Dhs0HydJ.js} +1 -1
  18. package/dist/assets/{audit-logs-Dcdyar51.js → audit-logs-CXjhDj8M.js} +1 -1
  19. package/dist/assets/authorize-uzVAAuOd.js +1 -0
  20. package/dist/assets/{base-chart-CcNdwghd.js → base-chart-BXspUQ5X.js} +1 -1
  21. package/dist/assets/{base32-eAS52qli.js → base32-E_M8YiDy.js} +1 -1
  22. package/dist/assets/{bind-account-BX-KG0Qr.js → bind-account-N3cioth0.js} +1 -1
  23. package/dist/assets/{branding-Ce0jZMDd.js → branding-B6_O9dwM.js} +1 -1
  24. package/dist/assets/branding-BFn6p_xP.js +1 -0
  25. package/dist/assets/{branding-CqhvExJP.js → branding-BN5xzu2K.js} +3 -3
  26. package/dist/assets/{bundle-avatar--xYBq9Gb.js → bundle-avatar-CfVy3gda.js} +1 -1
  27. package/dist/assets/button-4KPacREM.js +1 -0
  28. package/dist/assets/{click-to-copy-BuSTGPjJ.js → click-to-copy-DXHOGoUP.js} +1 -1
  29. package/dist/assets/{cloneDeep-DHlHhGOY.js → cloneDeep-DjDct56M.js} +1 -1
  30. package/dist/assets/{collapse-CzqKk-Uw.js → collapse-DRXViE1U.js} +1 -1
  31. package/dist/assets/{complete-CF2ewVuD.js → complete-DERkCyic.js} +3 -3
  32. package/dist/assets/{component-u6OazrP-.js → component-BFEXoFyD.js} +12 -12
  33. package/dist/assets/{config-Cj_KRqwi.js → config-CwbUhIlW.js} +1 -1
  34. package/dist/assets/{config-DwBbQRLw.js → config-DBQhYXkx.js} +1 -1
  35. package/dist/assets/{config-BdGGivQg.js → config-mfnTXE1f.js} +2 -2
  36. package/dist/assets/config-navigation-CL9YkEzl.js +40 -0
  37. package/dist/assets/{config-space-DI_Aw2fC.js → config-space-3dNLmLWy.js} +1 -1
  38. package/dist/assets/{confirm-F2_i30bc.js → confirm-BIsS5xyi.js} +1 -1
  39. package/dist/assets/{connect-4HW3qKz4.js → connect-DMt_37_e.js} +1 -1
  40. package/dist/assets/{connect-BeA4k1eX.js → connect-DXN8mBKc.js} +1 -1
  41. package/dist/assets/{connect-to-BBcrmPHg.js → connect-to-D3C0j8V8.js} +1 -1
  42. package/dist/assets/{content-layout-B-2tfq3i.js → content-layout-B5NObRcH.js} +1 -1
  43. package/dist/assets/{create-passport-svg-CIUyZVGt.js → create-passport-svg-BwqsyTOz.js} +1 -1
  44. package/dist/assets/{createClass-C4n9PQtV.js → createClass-CkCf2FLT.js} +1 -1
  45. package/dist/assets/dashboard-DHhNID_3.js +106 -0
  46. package/dist/assets/de-CDBOH3k5.js +7 -0
  47. package/dist/assets/{de-CvWwatyh.js → de-CLQx9XAb.js} +1 -1
  48. package/dist/assets/{delete-confirm-DBhiUq1r.js → delete-confirm-DSQSBte5.js} +1 -1
  49. package/dist/assets/{did-address-j4poFq12.js → did-address-Qmm0nyiR.js} +1 -1
  50. package/dist/assets/{domain-CM8EYUUH.js → domain-DcU9P4mp.js} +1 -1
  51. package/dist/assets/{domain-action-card-BdWmmq7M.js → domain-action-card-D9HXIIpd.js} +2 -2
  52. package/dist/assets/domains-DVkGbWo7.js +1 -0
  53. package/dist/assets/{email-CbHnzIjr.js → email-DDHqRiNE.js} +2 -2
  54. package/dist/assets/{empty-spinner-G6osPzkH.js → empty-spinner-0EAHJWBW.js} +1 -1
  55. package/dist/assets/engine-Cx3nUUOw.js +1 -0
  56. package/dist/assets/{es-DS01ke5n.js → es-BG3WIPEb.js} +1 -1
  57. package/dist/assets/es-BJ8CsIZi.js +9 -0
  58. package/dist/assets/{exchange-passport-3WK7243a.js → exchange-passport-Bxh8blMK.js} +1 -1
  59. package/dist/assets/{form-CCmYt5yy.js → form-C-ZRaynb.js} +1 -1
  60. package/dist/assets/{form-text-input-Sp9mVO8Z.js → form-text-input-CbjI2VZQ.js} +2 -2
  61. package/dist/assets/{form-wrapper-CU8kJXy5.js → form-wrapper-dz0PgYyA.js} +1 -1
  62. package/dist/assets/{fr-DzxE_CQq.js → fr-B-p8406E.js} +1 -1
  63. package/dist/assets/fr-DSXQFpNy.js +7 -0
  64. package/dist/assets/{fuel-BG9pjC0w.js → fuel-BdIacIqD.js} +1 -1
  65. package/dist/assets/gen-access-key-DdjBRI5O.js +1 -0
  66. package/dist/assets/{gen-simple-access-key-CZGyIc9a.js → gen-simple-access-key-CBGi0io0.js} +1 -1
  67. package/dist/assets/get-safe-url-pZvXlaJu.js +1 -0
  68. package/dist/assets/hi-DLsQ4VdX.js +5 -0
  69. package/dist/assets/{hi-BNIc0EGT.js → hi-DNSN9klG.js} +1 -1
  70. package/dist/assets/{home-CQklhtpC.js → home-D8RPk4rl.js} +1 -1
  71. package/dist/assets/id-AzAQyOHL.js +7 -0
  72. package/dist/assets/{id-AeuJFLj9.js → id-drFcVZg9.js} +1 -1
  73. package/dist/assets/{iframe-CKjr768a.js → iframe-DbxlfoSv.js} +1 -1
  74. package/dist/assets/index-5B_H2zYd.js +1 -0
  75. package/dist/assets/index-6M8OhYM1.js +1 -0
  76. package/dist/assets/{index-CVED_BmV.js → index-B6QOO2yw.js} +7 -7
  77. package/dist/assets/{index-BjYRoSYo.js → index-BIFlvVef.js} +3 -3
  78. package/dist/assets/{index-B7Hwfql4.js → index-BOiRUuPB.js} +1 -1
  79. package/dist/assets/{index-21gjg2tv.js → index-BRGQOPmE.js} +1 -1
  80. package/dist/assets/{index-BnLnviXD.js → index-BRky7Qm3.js} +2 -2
  81. package/dist/assets/{index-Dw7qYst2.js → index-BXtrOI0G.js} +1 -1
  82. package/dist/assets/{index-CVVhDiqm.js → index-BajjN1HU.js} +3 -3
  83. package/dist/assets/index-BfyoUnq5.js +63 -0
  84. package/dist/assets/{index-ySP_m_Ux.js → index-BjLM8Gon.js} +1 -1
  85. package/dist/assets/index-Bs5xamxm.js +6 -0
  86. package/dist/assets/{index-CJ1z6qNA.js → index-C0q1NhNR.js} +1 -1
  87. package/dist/assets/{index-CpF08yLs.js → index-CAtE4xM9.js} +1 -1
  88. package/dist/assets/{index-Dy3yCmIK.js → index-CIvZ7HIX.js} +1 -1
  89. package/dist/assets/index-CJBVOMty.js +124 -0
  90. package/dist/assets/{index-CdOL_gmG.js → index-CUIcSX4q.js} +1 -1
  91. package/dist/assets/{index-SZPelu8V.js → index-Ccjxs0wr.js} +12 -12
  92. package/dist/assets/{index-CnWOeW7L.js → index-CiQvt8QY.js} +2 -2
  93. package/dist/assets/{index-rDCB37wy.js → index-CmT6o_W4.js} +1 -1
  94. package/dist/assets/index-CtuxXUm_.js +1 -0
  95. package/dist/assets/{index-NecLGEW0.js → index-DCPJbOWh.js} +2 -2
  96. package/dist/assets/index-DD9ceQKr.js +1 -0
  97. package/dist/assets/{index-BmnHj012.js → index-DHn4LCaq.js} +1 -1
  98. package/dist/assets/{index-BnOhhAn2.js → index-DK4Rvfj9.js} +1 -1
  99. package/dist/assets/index-Dijoh4El.js +1041 -0
  100. package/dist/assets/{index-Dke96m3s.js → index-Dn_bIjgF.js} +2 -2
  101. package/dist/assets/{index-Dx6HKVtJ.js → index-Dnont80V.js} +1 -1
  102. package/dist/assets/index-G1If4Shq.js +120 -0
  103. package/dist/assets/{index-CX38UUlR.js → index-RxqUBm3A.js} +1 -1
  104. package/dist/assets/{index-DqGlhvi9.js → index-SH0LXIEm.js} +1 -1
  105. package/dist/assets/{index-DlXYHnCm.js → index-bb4s-8hu.js} +5 -5
  106. package/dist/assets/{index-CQbGIqeS.js → index-mgpYakv8.js} +1 -1
  107. package/dist/assets/{invitation-DquuV8dW.js → invitation-Cjg3Rgxl.js} +5 -5
  108. package/dist/assets/{invitations-CTnzBAUW.js → invitations-xEsO2f9m.js} +1 -1
  109. package/dist/assets/{invite-Cqtkz9TE.js → invite-ChOQtk0E.js} +1 -1
  110. package/dist/assets/{isURL-BHeH7II4.js → isURL-wZZwzwyC.js} +1 -1
  111. package/dist/assets/{issue-passport-O1f1uJyL.js → issue-passport-CUGjhBZr.js} +1 -1
  112. package/dist/assets/{item-Gzu2HZ93.js → item-Bpf_gGYt.js} +1 -1
  113. package/dist/assets/ja-C3ccbBe-.js +9 -0
  114. package/dist/assets/{ja-DVjbOvSw.js → ja-NGJjDf-2.js} +1 -1
  115. package/dist/assets/ko-9Vbo8tR2.js +9 -0
  116. package/dist/assets/{ko-ThcaJAOD.js → ko-yyXX-YSM.js} +1 -1
  117. package/dist/assets/{landing-page-BJPl6ZR-.js → landing-page-zT1Tduxx.js} +1 -1
  118. package/dist/assets/{launch-result-message-CO-R7GIB.js → launch-result-message-BTBdTioQ.js} +1 -1
  119. package/dist/assets/{layout-CbkYBUG0.js → layout-CZo9vMzc.js} +1 -1
  120. package/dist/assets/{list-CA3FRf5d.js → list-Cj5o6_aJ.js} +3 -3
  121. package/dist/assets/{list-BC0XcUGx.js → list-dBF9Lx52.js} +1 -1
  122. package/dist/assets/{list-header-Cv_gaaAc.js → list-header-BQo9L_6R.js} +1 -1
  123. package/dist/assets/localization-BhQNA1fu.js +1 -0
  124. package/dist/assets/{log-ljlYVvKz.js → log-KsUeQx46.js} +1 -1
  125. package/dist/assets/logger-CWdgyrlX.js +1 -0
  126. package/dist/assets/{login-e_NJksFx.js → login-BRtDYFyr.js} +1 -1
  127. package/dist/assets/{login-oauth-callback-6FC8idn6.js → login-oauth-callback-BVOT5KIP.js} +1 -1
  128. package/dist/assets/{logo-uploader-BghZxaXm.js → logo-uploader-CMuaTg_2.js} +1 -1
  129. package/dist/assets/{lost-passport-sW8DA7d5.js → lost-passport-DWR3ith-.js} +3 -3
  130. package/dist/assets/{omit-CpvduH4b.js → omit-DZEUV_m7.js} +1 -1
  131. package/dist/assets/{open-window-CXEIuhm-.js → open-window-Ct_MP3Sx.js} +1 -1
  132. package/dist/assets/{over-due-invoice-payment-CcPBU5m-.js → over-due-invoice-payment-EIjXZOAF.js} +1 -1
  133. package/dist/assets/overview-5u7B_D_6.js +116 -0
  134. package/dist/assets/{page-header-BkgoSN-0.js → page-header-Cgwo2np-.js} +1 -1
  135. package/dist/assets/passport-BcfDxGFq.js +1 -0
  136. package/dist/assets/{passport-item-7G49I01A.js → passport-item-BnRaEMVZ.js} +1 -1
  137. package/dist/assets/{permission-DVlrf60Y.js → permission-BYxNrlaa.js} +1 -1
  138. package/dist/assets/preferences-BgyNzrci.js +1 -0
  139. package/dist/assets/profile-embed-C3hI8xed.js +1 -0
  140. package/dist/assets/{pt-DKZZkfsB.js → pt-BPAfyek8.js} +1 -1
  141. package/dist/assets/pt-iqygmSLa.js +5 -0
  142. package/dist/assets/publish-resource-CreTipUc.js +1 -0
  143. package/dist/assets/{react-beautiful-dnd.esm-DFHKVO-K.js → react-beautiful-dnd.esm-Cvsu51oI.js} +1 -1
  144. package/dist/assets/{react-stripe.esm-C-04j7I2.js → react-stripe.esm-Dqbe1A8R.js} +1 -1
  145. package/dist/assets/{required-Btg6mEmX.js → required-B0Gua-D1.js} +1 -1
  146. package/dist/assets/ru-BkfMvpq6.js +5 -0
  147. package/dist/assets/{ru-DuAqnhp6.js → ru-CVlekA3F.js} +1 -1
  148. package/dist/assets/runtime-BwoZhRe2.js +1 -0
  149. package/dist/assets/{sanitize-CdfxCSD9.js → sanitize-D6Abg5_T.js} +1 -1
  150. package/dist/assets/sdk-Do4pV1s0.js +1 -0
  151. package/dist/assets/{section-Cyr0YvGa.js → section-BkMzBpvM.js} +1 -1
  152. package/dist/assets/{security-BFYfTqZs.js → security-DCG1tmZe.js} +1 -1
  153. package/dist/assets/session-DUT2afHJ.js +1 -0
  154. package/dist/assets/{setup-DSHYh-k3.js → setup-ephJCw43.js} +1 -1
  155. package/dist/assets/{shorten-label-D6jbe4l0.js → shorten-label-DhOty_4j.js} +1 -1
  156. package/dist/assets/{simple-select-Bif1RlSz.js → simple-select-D0q2J-Br.js} +1 -1
  157. package/dist/assets/{spaces-CLjWPJSv.js → spaces-DM95DgFM.js} +1 -1
  158. package/dist/assets/{start-RseKdDAg.js → start-sucUqu8u.js} +1 -1
  159. package/dist/assets/{starting-progress-BdHDbZA8.js → starting-progress-aMYWzin8.js} +1 -1
  160. package/dist/assets/{status-B02rE3OJ.js → status-BFw6nCWi.js} +1 -1
  161. package/dist/assets/{step-actions-gJEftNli.js → step-actions-nHHLzUFh.js} +1 -1
  162. package/dist/assets/{studio-VRwDw2v1.js → studio-BKkw9WY-.js} +1 -1
  163. package/dist/assets/switch-C5K07M96.js +1 -0
  164. package/dist/assets/{switch-control-D-yLpfsT.js → switch-control-BAyRLHvJ.js} +1 -1
  165. package/dist/assets/{table-tips-sMVI7VOu.js → table-tips-BA9A3QDk.js} +1 -1
  166. package/dist/assets/{team-D29LjHNf.js → team-HgvOpVEJ.js} +1 -1
  167. package/dist/assets/th-D-pgFsDa.js +5 -0
  168. package/dist/assets/{th-d9fJJu30.js → th-DLVYQmRY.js} +1 -1
  169. package/dist/assets/{traffic-DGDO-5_X.js → traffic-BvA-dAE6.js} +1 -1
  170. package/dist/assets/{transfer-CzsMxoja.js → transfer-CiITg5ql.js} +1 -1
  171. package/dist/assets/unsubscribe-2BjO5Axx.js +1 -0
  172. package/dist/assets/{use-app-logo-D768RYSo.js → use-app-logo-D9eQSUYq.js} +1 -1
  173. package/dist/assets/{use-mobile-C5RjvO7g.js → use-mobile-Dwc30NoL.js} +1 -1
  174. package/dist/assets/{use-mobile-ajdJIsoX.js → use-mobile-Vtj5nBdp.js} +1 -1
  175. package/dist/assets/{use-server-logo-D4Yh4atf.js → use-server-logo-BfNy3Xkj.js} +1 -1
  176. package/dist/assets/{use-window-close-CgevJhno.js → use-window-close-DLSxYDw-.js} +1 -1
  177. package/dist/assets/{useAsync-BCC9JxQR.js → useAsync-DNDhrs-2.js} +1 -1
  178. package/dist/assets/{useAsync-P_Velqz1.js → useAsync-Dy8z2Lh_.js} +1 -1
  179. package/dist/assets/{useAsyncRetry-LJm0Fhbe.js → useAsyncRetry-CSW1hopB.js} +1 -1
  180. package/dist/assets/{useLocalStorage-6wbaKET6.js → useLocalStorage-oIIa9C3F.js} +1 -1
  181. package/dist/assets/{user-center-B6mso4VA.js → user-center-BODNsVgb.js} +2 -2
  182. package/dist/assets/{user-follower-Bx_h5g8K.js → user-follower-ODH9p68y.js} +1 -1
  183. package/dist/assets/{util-BQmjsgsT.js → util-BxX0TJKJ.js} +1 -1
  184. package/dist/assets/{util-CW4LiHT7.js → util-DSnAozzs.js} +1 -1
  185. package/dist/assets/{vendor-arcblock-D8WYBDYe.js → vendor-arcblock-D4Rvz_D3.js} +1 -1
  186. package/dist/assets/{vendor-hooks-PN9SWiQm.js → vendor-hooks-U4TTuKG0.js} +1 -1
  187. package/dist/assets/{vendor-mui-core-BPQ6AEW_.js → vendor-mui-core-B5XNUjey.js} +2 -2
  188. package/dist/assets/{vendor-mui-x-CWNb8fsW.js → vendor-mui-x-DtPl0qBm.js} +1 -1
  189. package/dist/assets/vendor-utils-CFxoplqC.js +213 -0
  190. package/dist/assets/{vendor-ux-r9bApERu.js → vendor-ux-BX9dSNUy.js} +11 -11
  191. package/dist/assets/vi-BuffIn3I.js +5 -0
  192. package/dist/assets/{vi-C8B_KLxV.js → vi-Y-USOQ5S.js} +1 -1
  193. package/dist/assets/{wait-connect-DOCM-L84.js → wait-connect-CCXiMHZY.js} +1 -1
  194. package/dist/assets/{wizard-BsZNkmTe.js → wizard-TEBzHS-w.js} +1 -1
  195. package/dist/assets/{wizard-components-Bhn-EsyA.js → wizard-components-MqkmgXy5.js} +2 -2
  196. package/dist/assets/wrap-locale-Dk2yVg3Y.js +1 -0
  197. package/dist/assets/{zh-qzgEmNi8.js → zh-BDke39oQ.js} +1 -1
  198. package/dist/assets/{zh-DhM7svnr.js → zh-C6-KWz-k.js} +1 -1
  199. package/dist/assets/zh-Dr9buZnV.js +10 -0
  200. package/dist/assets/{zh-tw-Bu0-uVuH.js → zh-tw-BhpgIqwH.js} +1 -1
  201. package/dist/assets/zh-tw-CeXBj2i0.js +9 -0
  202. package/dist/index.html +1 -1
  203. package/dist/service-worker.js +2 -2
  204. package/package.json +50 -50
  205. package/dist/assets/api-uGeIZn4a.js +0 -1
  206. package/dist/assets/ar-Cwm1-0yA.js +0 -7
  207. package/dist/assets/authorize-QHj4ueFL.js +0 -1
  208. package/dist/assets/branding-Dnj3tYIM.js +0 -1
  209. package/dist/assets/button-DqhIB3De.js +0 -1
  210. package/dist/assets/config-navigation-2cI6Tcgp.js +0 -40
  211. package/dist/assets/dashboard-BDag6cuN.js +0 -106
  212. package/dist/assets/de-XQM4sDLo.js +0 -7
  213. package/dist/assets/doc-board-bg-DWZHV9Ng.png +0 -0
  214. package/dist/assets/domains-C_hsR6kY.js +0 -1
  215. package/dist/assets/engine-C3zb9k-C.js +0 -1
  216. package/dist/assets/es-D4zFwVhj.js +0 -9
  217. package/dist/assets/fr-BQXlmrTL.js +0 -7
  218. package/dist/assets/gen-access-key-BPsrFRZB.js +0 -1
  219. package/dist/assets/get-safe-url-BrPSNpgv.js +0 -1
  220. package/dist/assets/hi-Cdz2GskJ.js +0 -5
  221. package/dist/assets/id-Q9i8FdSt.js +0 -7
  222. package/dist/assets/index-0tKuoOtp.js +0 -1
  223. package/dist/assets/index-2T0bIXYn.js +0 -120
  224. package/dist/assets/index-B-xwjRHD.js +0 -62
  225. package/dist/assets/index-C6JbpwU_.js +0 -1
  226. package/dist/assets/index-C_xi8Qiz.js +0 -6
  227. package/dist/assets/index-DQt_6j3C.js +0 -1039
  228. package/dist/assets/index-D_0Kti8n.js +0 -1
  229. package/dist/assets/index-cDc_AEjv.js +0 -124
  230. package/dist/assets/index-y-XalrLG.js +0 -1
  231. package/dist/assets/ja-CH8WZngC.js +0 -9
  232. package/dist/assets/ko-Nli9PwTV.js +0 -9
  233. package/dist/assets/localization-CHT9qqQu.js +0 -1
  234. package/dist/assets/logger-Du6zTrGC.js +0 -1
  235. package/dist/assets/overview-D4mRghWV.js +0 -85
  236. package/dist/assets/passport-InAw8ts3.js +0 -1
  237. package/dist/assets/preferences-DDCeejgD.js +0 -1
  238. package/dist/assets/profile-embed-BLiDn2ls.js +0 -1
  239. package/dist/assets/pt-eVksFEJb.js +0 -5
  240. package/dist/assets/publish-resource-ztAbEOYJ.js +0 -1
  241. package/dist/assets/ru-ycnIgUGb.js +0 -5
  242. package/dist/assets/runtime-DI-5yi3_.js +0 -1
  243. package/dist/assets/sdk-BbyMeQrc.js +0 -1
  244. package/dist/assets/session-SqadLMEY.js +0 -1
  245. package/dist/assets/switch-D2wksu-s.js +0 -1
  246. package/dist/assets/th-BvLhxkpi.js +0 -5
  247. package/dist/assets/unsubscribe-BPqvl0Qq.js +0 -1
  248. package/dist/assets/vendor-utils-BgSaqjGx.js +0 -213
  249. package/dist/assets/vi-BmM-09Iq.js +0 -5
  250. package/dist/assets/wrap-locale-BovKZCTj.js +0 -1
  251. package/dist/assets/zh-BkVzTN9N.js +0 -10
  252. package/dist/assets/zh-tw-CW4J6ddt.js +0 -9
@@ -0,0 +1,120 @@
1
+ import{r as x}from"./vendor-react-CUXIiAnY.js";import{j as e,W as d,am as mt,ak as N,T as Q,U as ke,y as Fe,cI as Ve,b5 as Re,b6 as Te,a5 as Ie,Q as Ce,cJ as Pe,aN as Ee,a6 as Ge,D as Qe,ci as ht,ad as Ye,cK as gt,cL as xt,at as ae,c2 as qe,n as bt,J as yt,x as jt,bc as St,M as He,cx as vt}from"./vendor-mui-core-B5XNUjey.js";import{e as ee,F as Ct,a0 as pe}from"./vendor-utils-CFxoplqC.js";import{H,Q as Nt,V as J,ac as wt,m as Je,$ as Xe,n as Ae,h as Ze,ad as be,b as Rt,j as Tt,z as It,a2 as Et}from"./vendor-ux-BX9dSNUy.js";import{_ as At,a1 as q,c as E,o as Dt,aS as Ue}from"./index-Dijoh4El.js";import{a as Y,g as De}from"./vendor-hooks-U4TTuKG0.js";import{S as me}from"./shorten-label-DhOty_4j.js";import{v as et}from"./index-BjLM8Gon.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-Cj5o6_aJ.js";import{j as Pt,c as _t,N as Bt}from"./team-HgvOpVEJ.js";import{W as zt}from"./did-address-Qmm0nyiR.js";import{p as st}from"./util-DSnAozzs.js";import{D as Wt,g as Kt}from"./traffic-BvA-dAE6.js";import{B as nt}from"./bundle-avatar-CfVy3gda.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./server-logo-notext.svg-DHxZ1bRk.js";import"./session-DUT2afHJ.js";import"./isURL-wZZwzwyC.js";import"./use-app-logo-D9eQSUYq.js";import"./base32-E_M8YiDy.js";import"./useAsyncRetry-CSW1hopB.js";import"./useAsync-DNDhrs-2.js";import"./iframe-DbxlfoSv.js";import"./index-6M8OhYM1.js";import"./index-DBs9Ljax.js";import"./base-chart-BXspUQ5X.js";import"./index-DK4Rvfj9.js";import"./vendor-mui-x-DtPl0qBm.js";import"./AdapterDayjs-p1MGZm94.js";const at=x.createContext({}),{Provider:Mt,Consumer:qs}=at;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Y(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=Y(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[q(T.dateRange[0]).toISOString(),q(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return H.error(D.message),[]}},K=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[q(T.dateRange[0]).toISOString(),q(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw H.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&K()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const X={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Mt,{value:{notificationRecords:X},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}const Ut=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=Ut(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Yt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=q().startOf("day");return t.filter(n=>q(n.sendAt).isSame(s,"day")).length},Jt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Xt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=J();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=it(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ve,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=J(),m=it(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=J(),r=q().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){H.error("Please select a date range");return}if(q(h.startDate).isAfter(h.endDate)||!q(h.startDate).isValid()||!q(h.endDate).isValid()){H.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Kt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=J();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const Zt=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=J(),[i,l]=x.useState(Zt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ve,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=J(),l=Qe(),b=x.useMemo(()=>Je(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),K=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,X]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[q().subtract(1,"month").startOf("day").toDate(),q().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));U(o),X(a.paging),F(!1)}catch(a){H.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],M=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(M,p.emailSendStatus)||g(W=>({...W,emailSendStatus:M,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Yt(r,a),[r]),f=()=>{K.anchorEl=null,K.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){H.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Jt(o,c)>=4){H.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const M=a.currentTarget,W=M.getBoundingClientRect();K.anchorEl=M,K.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const M=await oe(c,o.receiver);await ge(1),$({channel:c,result:M}),(typeof M=="boolean"&&M||Ct(M)&&Object.values(M).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(M){H.error(M.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=Y(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Xe,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:M=>R(M,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Ye,{theme:b,children:[e.jsx(Ze,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Ke,{...o,canDelete:()=>!1})})}}),K.anchorEl&&e.jsx(Ee,{open:!!K.anchorEl,anchorReference:"anchorPosition",anchorPosition:K.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
2
+ td.MuiTableCell-footer {
3
+ border: none !important;
4
+ }
5
+ .sent-status-cell {
6
+ .resend-btn {
7
+ display: none;
8
+ }
9
+ &:hover {
10
+ .resend-btn {
11
+ display: flex;
12
+ }
13
+ }
14
+ }
15
+ `,ss=ae.div`
16
+ padding: 8px 16px;
17
+ .check-title {
18
+ font-weight: 500;
19
+ margin-bottom: 8px;
20
+ &::first-letter {
21
+ text-transform: uppercase;
22
+ }
23
+ }
24
+ .check-item {
25
+ svg {
26
+ font-size: 16px;
27
+ }
28
+ font-size: 12px;
29
+ }
30
+ `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ns(t){const{wallet:s,push:n,email:r,webhook:i}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...i.total>0?[{name:"Webhook",value:e.jsx(de,{item:i,isWebhook:!0})}]:[]]}function as(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Me.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=J(),r=s?t.success.length:t.success,i=t.total,l=r===i?"success":"failed";return e.jsx(N,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(i)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=E.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=J(),{success:b,failed:m,pending:S}=s,h=Xt(t),y=n?b.length:b,v=n?m.length:m,P=n?S.length:S,F=async L=>{L.stopPropagation();const k=n?[...new Set([...b,...m].map($=>$))]:[];await r([t],[],!0,k)},w=y+v,U=w>0?y/w*100:0,K=w>0?v/w*100:0;return e.jsxs(is,{successRatio:U,failedRatio:K,children:[e.jsxs(Q,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(Q,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(v)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(P)," ",l("notification.sendStatus.pending")]})]}),v>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:F,children:l("notification.resend")})})]})]})}function Me({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const i=Y(()=>s==="simple"?ns(t):as(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(et,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(qe,{container:!0,spacing:2,children:i.map(l=>e.jsx(qe,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const is=ae(N)`
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: flex-start;
34
+ padding: 16px;
35
+ border-radius: 8px;
36
+ background: ${({successRatio:t,failedRatio:s,theme:n})=>t===0&&s===0?n.palette.grey[300]:`linear-gradient(to right, ${bt(n.palette.success.light,.4)} ${t}%, ${n.palette.grey[100]} ${t}%)`};
37
+ transition: 'background 0.5s ease';
38
+ cursor: pointer;
39
+ .unsent-area {
40
+ width: 100%;
41
+ position: relative;
42
+ .resend-btn {
43
+ position: absolute;
44
+ right: 0;
45
+ bottom: 0;
46
+ }
47
+ }
48
+ `;ut.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ut({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=J(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=Y(()=>b(t.componentDid)||n,[n,t.componentDid]),v=De({tab:r||"info"}),P=x.useCallback(async(p,g,T=!0,D=[])=>{if(!p.length||!t.id)return;const O=g.length>0?g:t?.receivers?.map(_=>_.receiver);if(!O.length)return;let z=[...p];if(z.includes(E.NOTIFICATION_SEND_CHANNEL.PUSH)&&!rt(n)&&(H.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.PUSH)),z.includes(E.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ot(n)&&(H.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!z.length)try{h(!0),await m({notificationId:t.id,receivers:O,channels:z,resendFailedOnly:T,...z.includes("webhook")&&D.length?{webhookUrls:D}:{}}),H.success("Message has been sent!")}catch(_){console.error("handleResend error",{error:_}),H.error(_.response?_.response.statusText:_.message)}finally{h(!1)}},[n,t.id,t?.receivers,m,i]),F=Y(()=>Pt(t),[t]),w=Y(()=>_t(t),[t]),U=Y(()=>F?t?.actorInfo:[],[t]),K=Y(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(Ot,{actors:U,teamDid:K,size:32,showName:!0}):e.jsx(Lt,{size:32,blocklet:y,showName:!0,hideDot:!0})},{name:i("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:i("notification.body"),value:F?e.jsx(kt,{notification:t,blocklet:n}):e.jsx(Bt,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(It,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(et,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const k={info:{label:i("common.basicInfo"),value:"info",component:L},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},$=Object.values(k).map(({label:p,value:g})=>({label:p,value:g})),V=k[v.tab]||k.info,X=p=>{v.tab=p};return e.jsx(Rt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{v.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(rs,{children:[e.jsx(N,{className:"tabs",sx:{mx:3},children:e.jsx(Tt,{tabs:$,current:v.tab,onChange:X,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[v.tab==="receivers"&&e.jsx(es,{notificationId:t.id,resending:S,handleResend:P}),v.tab==="statistics"&&e.jsx(Me,{statistics:t.statistics,mode:"detail",resending:S,onResend:P}),v.tab==="info"&&e.jsx(V.component,{})]})]})})}const os=x.memo(ut),rs=ae.div`
49
+ & > .notification-row {
50
+ padding: 0;
51
+ }
52
+
53
+ .tabs {
54
+ margin: 0;
55
+ }
56
+ .body {
57
+ margin-top: 16px;
58
+ }
59
+
60
+ .channel-item {
61
+ display: flex;
62
+ padding: 4px;
63
+ justify-content: flex-start;
64
+ align-items: center;
65
+ gap: 8px;
66
+ > p {
67
+ font-size: 15px;
68
+ }
69
+ .resend-btn {
70
+ svg {
71
+ font-size: 16px;
72
+ }
73
+ display: flex;
74
+ align-items: center;
75
+ font-size: 12px;
76
+ cursor: pointer;
77
+ &.disabled {
78
+ cursor: not-allowed;
79
+ color: ${be.text.disabled};
80
+ }
81
+ }
82
+ }
83
+ `;ve.propTypes={blocklet:d.object,label:d.string};const ls=ae.div`
84
+ display: flex;
85
+ justify-items: flex-start;
86
+ align-items: center;
87
+ gap: 8px;
88
+ .name {
89
+ display: block;
90
+ max-width: 260px;
91
+ white-space: nowrap;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ }
95
+ `;function ve({blocklet:t=null,label:s=""}){return e.jsx(ls,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(nt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}pt.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function pt({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function cs(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ds({customTableButtons:t}){const{t:s,locale:n}=J(),r=Qe(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Je(r,lt()),[r]),[b,m]=x.useState(!1),{data:S,paging:h,blocklet:y,fetch:v,getComponent:P,componentDids:F,inService:w,teamDid:U}=_e(),K=x.useRef(null),[L,k]=x.useState(null),[$,V]=x.useState("info"),X=`notification-records-${y.meta?.did}`,p=Et(X),[g,T]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[q().subtract(1,"month").startOf("day").toDate(),q().endOf("day").toDate()]}),D=Y(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;F.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[F,y]),O=async f=>{try{m(!0),await v(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{O(g)},[g]),x.useEffect(()=>{const f=S.find(u=>u.id===L?.id);L&&f&&k({...f})},[S]);const z=(f,u,j,I)=>{f.stopPropagation();const A=j.filter(R=>R!==u);T(R=>({...R,[I]:A,page:1}))},_=({page:f,rowsPerPage:u,filterList:j})=>{const[I=[],,,,A=[]]=j;g.pageSize!==u?T(R=>({...R,pageSize:u,page:1})):g.page!==f+1?T(R=>({...R,page:f+1})):pe(g.dids,I)?pe(g.severities,A)||T(R=>({...R,severities:A,page:1})):T(R=>({...R,dids:I,page:1}))},ie=x.useCallback(()=>{k(null),V("info")},[]),se=x.useCallback(()=>{v(g)},[v,g]),Z=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=D.find(A=>(A.did||A.meta?.did)===u);return e.jsx(ve,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(f,u,j)=>(f[j].splice(u,1),f)},filterOptions:{names:D,logic:(f,u)=>u.length?!u.includes(f):!1,display:(f,u,j,I)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[j],renderValue:A=>e.jsx(N,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:A.map(R=>{if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const re=D.find(ne=>(ne.did||ne.meta?.did)===R);return e.jsx(ve,{blocklet:re,label:re?.title||re?.meta?.title},R)})}),onChange:A=>{f[j]=A.target.value,u(f[j],j,I)},children:[e.jsx(He,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(He,{value:R,children:e.jsx(ve,{blocklet:A,label:A.title||A.meta?.title})},R)})]})]})},customBodyRenderLite:f=>{const u=S[f],j=P(u.componentDid);return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(nt,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Ft,{blocklet:y,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||y?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f],{receivers:j}=u;return e.jsx(vt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:I=>{I.stopPropagation(),k(u),V("receivers")},children:j.map(I=>{const{receiverUser:A}=I,R=st(A.avatar,U,w);return e.jsx(Xe,{alt:A.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(N,{onClick:j=>{j.stopPropagation(),k(u),V("statistics")},children:e.jsx(Me,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const u=S[f];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:g.severities??[],customFilterListOptions:{render:f=>e.jsx(pt,{list:f,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),z(u,j,Z[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:$e,fullWidth:!0,logic:je,display:(f,u,j,I)=>e.jsx(cs,{label:s("notification.severity"),filterList:f,onChange:u,index:j,column:I,filterValues:$e})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:u}=S[f];return e.jsx(tt,{value:u,locale:n,shouldUpdate:!0})}}}],oe=f=>{T(u=>({...u,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(N,{ref:K,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(us,{isBreakpointsDownSm:i,children:e.jsx(Ye,{theme:l,children:e.jsx(Ze,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:Z,data:S,durable:X,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...p,onRowClick:(f,{dataIndex:u})=>{k(S[u])}},title:e.jsx(ze,{value:g.dateRange,onChange:oe}),customButtons:Ne,components:{TableFilterList:f=>e.jsx(We,{...f,itemComponent:u=>e.jsx(Ke,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),L&&e.jsx(os,{refresh:se,onCancel:ie,notification:L,blocklet:y,tab:$})]})}const us=ae.div`
96
+ td.MuiTableCell-footer {
97
+ border: none !important;
98
+ }
99
+ .sent-status-cell {
100
+ .resend-btn {
101
+ display: none;
102
+ }
103
+ &:hover {
104
+ .resend-btn {
105
+ display: flex;
106
+ }
107
+ }
108
+ }
109
+
110
+ .custom-toobar-btns {
111
+ gap: 4px;
112
+ }
113
+ .custom-toobar-title-inner {
114
+ display: flex;
115
+ justify-content: ${({isBreakpointsDownSm:t})=>t?"space-between":"flex-end"};
116
+ padding-right: ${({isBreakpointsDownSm:t})=>t?"0":"8px"};
117
+ flex-wrap: wrap;
118
+ gap: 8px;
119
+ }
120
+ `;ps.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};function ps({blocklet:t={},customTableButtons:s=[]}){return e.jsx(qt,{blocklet:t,children:e.jsx(ds,{customTableButtons:s})})}export{ps as default};
@@ -1,4 +1,4 @@
1
- import{r as u}from"./vendor-react-CUXIiAnY.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,bn as B,I as P,a6 as W,bF as M,aj as X,bG as G}from"./vendor-mui-core-BPQ6AEW_.js";import{C as H}from"./Google-FE-PKKgg.js";import{p as U}from"./vendor-ux-r9bApERu.js";import{c as Y}from"./create-passport-svg-CIUyZVGt.js";import{A as $}from"./vendor-arcblock-D8WYBDYe.js";import{e as J}from"./index-DQt_6j3C.js";import{R as Q}from"./required-Btg6mEmX.js";import{F as Z}from"./form-wrapper-CU8kJXy5.js";import{L as v}from"./logo-uploader-BghZxaXm.js";import{A as ee,a as ne,b as te}from"./collapse-CzqKk-Uw.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(H,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?$(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:J.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=G`
1
+ import{r as u}from"./vendor-react-CUXIiAnY.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,bn as B,I as P,a6 as W,bF as M,aj as X,bG as G}from"./vendor-mui-core-B5XNUjey.js";import{C as H}from"./Google-qCiUM9VP.js";import{p as U}from"./vendor-ux-BX9dSNUy.js";import{c as Y}from"./create-passport-svg-BwqsyTOz.js";import{A as $}from"./vendor-arcblock-D4Rvz_D3.js";import{e as J}from"./index-Dijoh4El.js";import{R as Q}from"./required-B0Gua-D1.js";import{F as Z}from"./form-wrapper-dz0PgYyA.js";import{L as v}from"./logo-uploader-CMuaTg_2.js";import{A as ee,a as ne,b as te}from"./collapse-DRXViE1U.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(H,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?$(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:J.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=G`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -1 +1 @@
1
- import{r as l}from"./vendor-react-CUXIiAnY.js";import{V as C,$ as E,j as M,k as P}from"./vendor-ux-r9bApERu.js";import{k as y}from"./vendor-hooks-PN9SWiQm.js";import{j as e,ak as s,a6 as S,aX as w,b1 as W,y as L,x as _,bc as B,M as D,T as z,a$ as A,I as K,bd as N,Q as F,W as U}from"./vendor-mui-core-BPQ6AEW_.js";import{c as $,_ as k}from"./index-DQt_6j3C.js";import{a as V}from"./api-uGeIZn4a.js";import{T as q}from"./table-tips-sMVI7VOu.js";import{u as G}from"./team-D29LjHNf.js";import{u as H}from"./session-SqadLMEY.js";import"./vendor-utils-BgSaqjGx.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D8WYBDYe.js";import"./use-mobile-ajdJIsoX.js";import"./isURL-BHeH7II4.js";import"./use-app-logo-D768RYSo.js";function T({endpoint:i}){const[t,a]=l.useState("mcp-link"),x=k(),{api:h}=k(),{teamDid:m}=G(),{t:c,locale:p}=C(),{session:r}=H(),{data:u,run:o,loading:g}=y(()=>{const f={owner:$.SERVER_ROLES.ADMIN}[r?.user?.role]||r?.user?.role;return h.createAccessKey({input:{teamDid:m,passport:f,authType:"simple",remark:"Generated by MCP Servers"}})},{manual:!0}),{imgPrefix:n}=x,j=l.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[n]),v=j.find(d=>d.value===t),b=l.useMemo(()=>u?.data?.accessKeySecret,[u]),R=l.useMemo(()=>!b&&t!=="mcp-link",[b,t]),I=d=>{const f=`npx @blocklet/install-mcp@latest i ${i} --client ${d} --streamableHTTP --oauth2Bearer ${b}`;switch(d){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return f;case"mcp-link":default:return i}};return e.jsxs(s,{className:"mcp-servers-container",children:[e.jsx(M,{tabs:j,current:t,onChange:a,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(z,{component:"span",variant:"h6",sx:{fontWeight:"bold",my:2},children:t==="mcp-link"?v?.label:`${v?.label} ${c("installCommand")}`}),t!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${p}/mcp-${t}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(K,{size:"small",children:e.jsx(N,{fontSize:"small"})})})]}),e.jsxs(s,{className:"mcp-servers-codeblock",sx:{position:"relative","& pre":{borderRadius:1},"& .codeblock__inner":{overflow:"auto !important",borderRadius:1}},children:[e.jsx(P,{code:I(t),language:"shell",style:{margin:0},showDefaultText:!1}),R&&e.jsx(s,{sx:{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:g?e.jsx(S,{}):e.jsx(F,{variant:"contained",color:"primary",onClick:o,size:"small",children:`${c("common.generate")} ${c("command")}`})})]})]})]})}T.propTypes={endpoint:U.string.isRequired};function ce(){const[i,t]=l.useState(null),{t:a,locale:x}=C(),h=`${window?.blocklet?.appUrl}${$.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:m,loading:c,error:p}=y(()=>Promise.all([V.get(h)])),r=l.useMemo(()=>m?.[0]?.data?.servers||[],[m]);l.useEffect(()=>{r?.length&&t(r.find(o=>o.did===window?.blocklet?.did)||r[0])},[r]);const u=o=>{const g=o.target.value;t(r.find(n=>n.did===g))};return c?e.jsx(s,{children:e.jsx(S,{})}):p?e.jsx(w,{color:"error",children:p?.message}):r?.length?e.jsxs(W,{sx:{gap:2,maxWidth:1200},children:[e.jsx(q,{title:a("mcp.listTitle"),tooltipTitle:a("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${x}/mcp-server`}),e.jsxs(L,{fullWidth:!0,children:[e.jsx(_,{id:"server-select-label",children:a("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:i?.did||"",label:a("mcp.available"),onChange:u,children:r.map(o=>e.jsx(D,{value:o.did,children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(E,{variant:"rounded",shape:"square",did:o.did,src:o.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:o.name})]})},o.did))})]}),i&&e.jsx(T,{endpoint:i.endpoint})]}):e.jsx(w,{color:"warning",children:a("mcp.noServer")})}export{ce as default};
1
+ import{r as l}from"./vendor-react-CUXIiAnY.js";import{V as C,$ as E,j as M,k as P}from"./vendor-ux-BX9dSNUy.js";import{k as y}from"./vendor-hooks-U4TTuKG0.js";import{j as e,ak as s,a6 as S,aX as w,b1 as W,y as L,x as _,bc as B,M as D,T as z,a$ as A,I as K,bd as N,Q as F,W as U}from"./vendor-mui-core-B5XNUjey.js";import{c as $,_ as k}from"./index-Dijoh4El.js";import{a as V}from"./api-Cjc501Es.js";import{T as q}from"./table-tips-BA9A3QDk.js";import{u as G}from"./team-HgvOpVEJ.js";import{u as H}from"./session-DUT2afHJ.js";import"./vendor-utils-CFxoplqC.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./use-mobile-Vtj5nBdp.js";import"./isURL-wZZwzwyC.js";import"./use-app-logo-D9eQSUYq.js";function T({endpoint:i}){const[t,a]=l.useState("mcp-link"),x=k(),{api:h}=k(),{teamDid:m}=G(),{t:c,locale:p}=C(),{session:r}=H(),{data:u,run:o,loading:g}=y(()=>{const f={owner:$.SERVER_ROLES.ADMIN}[r?.user?.role]||r?.user?.role;return h.createAccessKey({input:{teamDid:m,passport:f,authType:"simple",remark:"Generated by MCP Servers"}})},{manual:!0}),{imgPrefix:n}=x,j=l.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${n}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[n]),v=j.find(d=>d.value===t),b=l.useMemo(()=>u?.data?.accessKeySecret,[u]),R=l.useMemo(()=>!b&&t!=="mcp-link",[b,t]),I=d=>{const f=`npx @blocklet/install-mcp@latest i ${i} --client ${d} --streamableHTTP --oauth2Bearer ${b}`;switch(d){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return f;case"mcp-link":default:return i}};return e.jsxs(s,{className:"mcp-servers-container",children:[e.jsx(M,{tabs:j,current:t,onChange:a,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(z,{component:"span",variant:"h6",sx:{fontWeight:"bold",my:2},children:t==="mcp-link"?v?.label:`${v?.label} ${c("installCommand")}`}),t!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${p}/mcp-${t}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(K,{size:"small",children:e.jsx(N,{fontSize:"small"})})})]}),e.jsxs(s,{className:"mcp-servers-codeblock",sx:{position:"relative","& pre":{borderRadius:1},"& .codeblock__inner":{overflow:"auto !important",borderRadius:1}},children:[e.jsx(P,{code:I(t),language:"shell",style:{margin:0},showDefaultText:!1}),R&&e.jsx(s,{sx:{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:g?e.jsx(S,{}):e.jsx(F,{variant:"contained",color:"primary",onClick:o,size:"small",children:`${c("common.generate")} ${c("command")}`})})]})]})]})}T.propTypes={endpoint:U.string.isRequired};function ce(){const[i,t]=l.useState(null),{t:a,locale:x}=C(),h=`${window?.blocklet?.appUrl}${$.WELLKNOWN_SERVICE_PATH_PREFIX}/mcp/servers`,{data:m,loading:c,error:p}=y(()=>Promise.all([V.get(h)])),r=l.useMemo(()=>m?.[0]?.data?.servers||[],[m]);l.useEffect(()=>{r?.length&&t(r.find(o=>o.did===window?.blocklet?.did)||r[0])},[r]);const u=o=>{const g=o.target.value;t(r.find(n=>n.did===g))};return c?e.jsx(s,{children:e.jsx(S,{})}):p?e.jsx(w,{color:"error",children:p?.message}):r?.length?e.jsxs(W,{sx:{gap:2,maxWidth:1200},children:[e.jsx(q,{title:a("mcp.listTitle"),tooltipTitle:a("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${x}/mcp-server`}),e.jsxs(L,{fullWidth:!0,children:[e.jsx(_,{id:"server-select-label",children:a("mcp.available")}),e.jsx(B,{labelId:"server-select-label",value:i?.did||"",label:a("mcp.available"),onChange:u,children:r.map(o=>e.jsx(D,{value:o.did,children:e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(E,{variant:"rounded",shape:"square",did:o.did,src:o.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:o.name})]})},o.did))})]}),i&&e.jsx(T,{endpoint:i.endpoint})]}):e.jsx(w,{color:"warning",children:a("mcp.noServer")})}export{ce as default};
@@ -1,4 +1,4 @@
1
- import{r as g}from"./vendor-react-CUXIiAnY.js";import{j as e,y as O,x as X,bc as G,M as J,ak as m,W as x,a6 as ke,cb as ve,b1 as Q,z as U,b6 as Te,a5 as Ae,at as P,T as E,cc as Ke,bb as Re,aX as De,Q as Se,ci as Ie}from"./vendor-mui-core-BPQ6AEW_.js";import{V as S,z as B,n as F,p as Be,b as oe,k as H,H as $e,a2 as Ne,o as Ee,J as _e,h as Pe,i as We}from"./vendor-ux-r9bApERu.js";import{f as ze}from"./index-DBs9Ljax.js";import{c as z,_ as I,o as Me,aJ as qe,ac as Le,ar as ie,as as ae,at as re,e as Ue}from"./index-DQt_6j3C.js";import{a as ce}from"./passport-item-7G49I01A.js";import{u as W}from"./team-D29LjHNf.js";import{l as le}from"./arrow-down.svg-DCPm0wfX.js";import{T as de}from"./index-CQbGIqeS.js";import{C as pe}from"./confirm-F2_i30bc.js";import{R as Fe,C as _}from"./vendor-utils-BgSaqjGx.js";import{u as He}from"./session-SqadLMEY.js";import{C as V}from"./click-to-copy-BuSTGPjJ.js";import{f as Ve}from"./index-BojVbZw0.js";import{D as Oe}from"./delete-confirm-DBhiUq1r.js";import{P as Xe}from"./permission-DVlrf60Y.js";import{l as M}from"./vendor-arcblock-D8WYBDYe.js";import{B as Ge}from"./bundle-avatar--xYBq9Gb.js";import{W as Je}from"./did-address-j4poFq12.js";import{u as me}from"./use-mobile-ajdJIsoX.js";import{A as Qe}from"./actions-DhSvOHy-.js";import{T as ne}from"./table-tips-sMVI7VOu.js";import{s as Ye}from"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";import"./ua-parser-DP5omx3I.js";import"./util-CW4LiHT7.js";import"./base32-eAS52qli.js";import"./isURL-BHeH7II4.js";import"./use-app-logo-D768RYSo.js";import"./vendor-mui-x-CWNb8fsW.js";import"./AdapterDayjs-DEl3BogQ.js";function Y({value:s}){const{t,locale:n}=S(),a=new Date;return new Date(s)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}Y.propTypes={value:x.string.isRequired};function Z({value:s,onChange:t,...n}){const{t:a}=S(),o=g.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(X,{children:a("setting.accessKey.authType")}),e.jsx(G,{value:s,onChange:t,fullWidth:!0,label:a("setting.accessKey.authType"),IconComponent:l=>e.jsx(le,{...l,width:20,height:20}),children:o.map(l=>e.jsx(J,{value:l.value,children:e.jsxs(m,{children:[e.jsx("span",{children:l.title}),e.jsx(m,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))})]})}Z.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const ee=()=>{const s=z.RBAC_CONFIG.roles.filter(o=>o.passport),{inService:t}=I(),{roles:n}=W(),a=[...s,...t?n:[]];return Fe(a,"name").filter(o=>o.name!==z.ROLES.OWNER)};function ue(){const{session:s}=He(),t=ee();return g.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const a=t.filter(l=>l.name==="guest");return[...t.filter(l=>l.name!=="guest").filter(l=>s.user.passports.find(b=>b.role===l.name)),...a]},[t,s?.user?.passports,s?.user?.role])}function xe({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:a}=W(),{t:o}=S(),[l,b]=g.useState(!1),[p,j]=g.useState(null),u=ue(),K=()=>{b(!1),j(null)},w=async c=>{const{remark:C,passport:h,authType:i}=c;b(!0);const v=await n.createAccessKey({input:{teamDid:a,remark:C.trim(),passport:h,expireAt:c.expireAt?new Date(c.expireAt).getTime():null,authType:i}}),{data:R}=v;s(R),j(null),b(!1)},d={title:`${o("common.create")} ${o("accessKey")}`,description:(c,C,h)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:c.remark,onChange:i=>{C({...c,remark:i.target.value,__disableConfirm:!c.passport||!i.target.value.trim()}),i.target.value.trim()?h(""):h(o("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{sx:{width:"calc(100% - 46px)"},children:o("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"create-access-key-select-passport",value:c.passport,onChange:i=>{const v=i.target.value;h(null),C({...c,passport:v,__disableConfirm:!c.remark||!v})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:l,IconComponent:i=>e.jsx(le,{...i,width:20,height:20}),children:u.map(i=>e.jsx(J,{value:i.name,"data-cy":`create-access-key-passport-option-${i.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:i.title||i.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:i.description})]})},i.name))})]}),e.jsx(Z,{value:c.authType,onChange:i=>{C({...c,authType:i.target.value})}}),e.jsx(de,{placeholder:o("setting.accessKey.expireTime"),value:c.expireAt,onChange:i=>{C({...c,expireAt:i,__disableConfirm:!c.passport||!c.remark||!i})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:w,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>j(d),className:"rule-action",children:[l?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),o("common.create")]}),p&&e.jsx(pe,{title:p.title,description:p.description,confirm:p.confirm,color:p.color,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}xe.propTypes={remark:x.string,onCreate:x.func};function fe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:a=!0}){const{t:o}=g.useContext(Be),[l,b]=g.useState(!1),[p,j]=g.useState(()=>a),u=I(),K=()=>{j(!p)},w=h=>{b(h.target.checked)},d=_(window.location.origin,u?.info?.routing?.adminPath),c=g.useMemo(()=>a?`const Client = require('@blocklet/server-js');
1
+ import{r as g}from"./vendor-react-CUXIiAnY.js";import{j as e,y as O,x as X,bc as G,M as J,ak as m,W as x,a6 as ke,cb as ve,b1 as Q,z as U,b6 as Te,a5 as Ae,at as P,T as E,cc as Ke,bb as Re,aX as De,Q as Se,ci as Ie}from"./vendor-mui-core-B5XNUjey.js";import{V as S,z as B,n as F,p as Be,b as oe,k as H,H as $e,a2 as Ne,o as Ee,J as _e,h as Pe,i as We}from"./vendor-ux-BX9dSNUy.js";import{f as ze}from"./index-DBs9Ljax.js";import{c as z,_ as I,o as Me,aJ as qe,ac as Le,ar as ie,as as ae,at as re,e as Ue}from"./index-Dijoh4El.js";import{a as ce}from"./passport-item-BnRaEMVZ.js";import{u as W}from"./team-HgvOpVEJ.js";import{l as le}from"./arrow-down.svg-Dhs0HydJ.js";import{T as de}from"./index-mgpYakv8.js";import{C as pe}from"./confirm-BIsS5xyi.js";import{R as Fe,C as _}from"./vendor-utils-CFxoplqC.js";import{u as He}from"./session-DUT2afHJ.js";import{C as V}from"./click-to-copy-DXHOGoUP.js";import{f as Ve}from"./index-BojVbZw0.js";import{D as Oe}from"./delete-confirm-DSQSBte5.js";import{P as Xe}from"./permission-BYxNrlaa.js";import{l as M}from"./vendor-arcblock-D4Rvz_D3.js";import{B as Ge}from"./bundle-avatar-CfVy3gda.js";import{W as Je}from"./did-address-Qmm0nyiR.js";import{u as me}from"./use-mobile-Vtj5nBdp.js";import{A as Qe}from"./actions-CiAs-6JM.js";import{T as ne}from"./table-tips-BA9A3QDk.js";import{s as Ye}from"./vendor-hooks-U4TTuKG0.js";import"./lottie-web-4koyQiv_.js";import"./ua-parser-DP5omx3I.js";import"./util-DSnAozzs.js";import"./base32-E_M8YiDy.js";import"./isURL-wZZwzwyC.js";import"./use-app-logo-D9eQSUYq.js";import"./vendor-mui-x-DtPl0qBm.js";import"./AdapterDayjs-p1MGZm94.js";function Y({value:s}){const{t,locale:n}=S(),a=new Date;return new Date(s)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}Y.propTypes={value:x.string.isRequired};function Z({value:s,onChange:t,...n}){const{t:a}=S(),i=g.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(X,{children:a("setting.accessKey.authType")}),e.jsx(G,{value:s,onChange:t,fullWidth:!0,label:a("setting.accessKey.authType"),IconComponent:l=>e.jsx(le,{...l,width:20,height:20}),children:i.map(l=>e.jsx(J,{value:l.value,children:e.jsxs(m,{children:[e.jsx("span",{children:l.title}),e.jsx(m,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))})]})}Z.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const ee=()=>{const s=z.RBAC_CONFIG.roles.filter(i=>i.passport),{inService:t}=I(),{roles:n}=W(),a=[...s,...t?n:[]];return Fe(a,"name").filter(i=>i.name!==z.ROLES.OWNER)};function ue(){const{session:s}=He(),t=ee();return g.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const a=t.filter(l=>l.name==="guest");return[...t.filter(l=>l.name!=="guest").filter(l=>s.user.passports.find(b=>b.role===l.name)),...a]},[t,s?.user?.passports,s?.user?.role])}function xe({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:a}=W(),{t:i}=S(),[l,b]=g.useState(!1),[p,j]=g.useState(null),u=ue(),K=()=>{b(!1),j(null)},C=async r=>{const{remark:w,passport:f,authType:o}=r;b(!0);const v=await n.createAccessKey({input:{teamDid:a,remark:w.trim(),passport:f,expireAt:r.expireAt?new Date(r.expireAt).getTime():null,authType:o}}),{data:R}=v;s(R),j(null),b(!1)},d={title:`${i("common.create")} ${i("accessKey")}`,description:(r,w,f)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:r.remark,onChange:o=>{w({...r,remark:o.target.value,__disableConfirm:!r.passport||!o.target.value.trim()}),o.target.value.trim()?f(""):f(i("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{sx:{width:"calc(100% - 46px)"},children:i("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"create-access-key-select-passport",value:r.passport,onChange:o=>{const v=o.target.value;f(null),w({...r,passport:v,__disableConfirm:!r.remark||!v})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:l,IconComponent:o=>e.jsx(le,{...o,width:20,height:20}),children:u.map(o=>e.jsx(J,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(Z,{value:r.authType,onChange:o=>{w({...r,authType:o.target.value})}}),e.jsx(de,{placeholder:i("setting.accessKey.expireTime"),value:r.expireAt,onChange:o=>{w({...r,expireAt:o,__disableConfirm:!r.passport||!r.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:C,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:r=>{r.stopPropagation(),j(d)},className:"rule-action",children:[l?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),i("common.create")]}),p&&e.jsx(pe,{title:p.title,description:p.description,confirm:p.confirm,color:p.color,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}xe.propTypes={remark:x.string,onCreate:x.func};function fe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:a=!0}){const{t:i}=g.useContext(Be),[l,b]=g.useState(!1),[p,j]=g.useState(()=>a),u=I(),K=()=>{j(!p)},C=f=>{b(f.target.checked)},d=_(window.location.origin,u?.info?.routing?.adminPath),r=g.useMemo(()=>a?`const Client = require('@blocklet/server-js');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -16,7 +16,7 @@ const result = await client.getBlocklet(
16
16
  { input: { did: rootDid, attachRuntimeInfo: false } },
17
17
  { headers: { 'x-access-blocklet': rootDid } }
18
18
  );
19
- `:u.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(d,"/api/did/session")}"`,[a,t,n,u.inService,d]),C=g.useMemo(()=>a?`blocklet deploy --endpoint ${u.inService?window.blocklet?.appUrl:d} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[a,t,n,u.inService,d]);return e.jsxs(oe,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:a?!l:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ze,{children:o(a?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(L,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(V,{children:t})]}),e.jsxs(L,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),p?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:o("setting.accessKey.showSecret")}):e.jsx(V,{children:n})]}),!p&&e.jsxs(L,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(H,{code:c,language:"shell",showDefaultText:!1}),C&&e.jsx(H,{code:C,language:"shell",showDefaultText:!1})]}),a&&e.jsx("div",{children:e.jsx(Te,{value:"end",disabled:p,control:e.jsx(Ae,{checked:l,onChange:w}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}fe.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};const q=P.div`
19
+ `:u.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(d,"/api/did/session")}"`,[a,t,n,u.inService,d]),w=g.useMemo(()=>a?`blocklet deploy --endpoint ${u.inService?window.blocklet?.appUrl:d} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[a,t,n,u.inService,d]);return e.jsxs(oe,{title:i("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:(f,o)=>{o!=="backdropClick"&&s()},showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:a?!l:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:i("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ze,{children:i(a?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(L,{children:[e.jsx(q,{children:i("setting.accessKey.accessKeyId")}),e.jsx(V,{children:t})]}),e.jsxs(L,{children:[e.jsx(q,{children:i("setting.accessKey.accessKeySecret")}),p?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:i("setting.accessKey.showSecret")}):e.jsx(V,{children:n})]}),!p&&e.jsxs(L,{children:[e.jsx(q,{children:`Access Key ${i("setting.accessKey.usage")}`}),e.jsx(H,{code:r,language:"shell",showDefaultText:!1}),w&&e.jsx(H,{code:w,language:"shell",showDefaultText:!1})]}),a&&e.jsx("div",{children:e.jsx(Te,{value:"end",disabled:p,control:e.jsx(Ae,{checked:l,onChange:C}),label:i("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}fe.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};const q=P.div`
20
20
  display: flex;
21
21
  justify-content: space-between;
22
22
  align-items: center;
@@ -27,14 +27,14 @@ const result = await client.getBlocklet(
27
27
  `,Ze=P.div`
28
28
  font-size: 16px;
29
29
  font-weight: bold;
30
- `;function he({accessKeyId:s,time:t,remark:n,onDelete:a=()=>{},onClose:o=()=>{}}){const{t:l,locale:b}=S(),{api:p}=I(),{teamDid:j}=W(),u=()=>{o()},K=async()=>{try{await p.deleteAccessKey({input:{teamDid:j,accessKeyId:s}}),a()}catch(c){$e.error(c?.message)}finally{u()}},w=c=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:Me(c,b),timeAge:Ve(new Date(c),qe(b))}),d={keyName:n,title:l("setting.accessKey.title"),description:t?`${l("setting.accessKey.description",w(t))}`:`${l("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:l("setting.accessKey.confirm_desc",{name:n}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:K,onCancel:u};return e.jsx(Oe,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})}he.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:a="",expireAt:o="",authType:l="signature",onClose:b=()=>{}}){const{api:p}=I(),{teamDid:j}=W(),{t:u}=S(),[K,w]=g.useState(!1),d=ue(),c=()=>{w(!1),b()},C=async i=>{const{accessKeyId:v,remark:R="",passport:f,expireAt:y,authType:$}=i;w(!0),await p.updateAccessKey({input:{teamDid:j,accessKeyId:v,remark:R.trim(),passport:f,expireAt:y?new Date(y).getTime():null,authType:$}}),n(),c()},h={title:`${u("common.update")} ${u("accessKey")}`,description:(i,v,R)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:u("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:i.accessKeyId,disabled:!0}),e.jsx(U,{label:u("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:i.remark,onChange:f=>{v({...i,remark:f.target.value,__disableConfirm:!f.target.value.trim()}),f.target.value.trim()?R(""):R(u("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{children:u("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"update-access-key-select-passport",value:i.passport,onChange:f=>{const y=f.target.value;R(null),v({...i,passport:y,__disableConfirm:!i.remark||!y})},fullWidth:!0,label:u("setting.accessKey.passport"),disabled:K,children:d.map(f=>e.jsx(J,{value:f.name,"data-cy":`update-access-key-passport-option-${f.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:f.title||f.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:f.description})]})},f.name))})]}),e.jsx(Z,{disabled:!0,value:i.authType,onChange:f=>{v({...i,authType:f.target.value})}}),e.jsx(de,{placeholder:u("setting.accessKey.expireTime"),value:i.expireAt,onChange:f=>{v({...i,expireAt:f,__disableConfirm:!i.passport||!i.remark||!f})}})]}),confirm:u("common.confirm"),cancel:u("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:a,expireAt:o,authType:l},onConfirm:C,onCancel:c};return e.jsx(pe,{title:h.title,description:h.description,confirm:h.confirm,color:h.color,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})}ge.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};function ye({accessKey:s,onCancel:t}){const{t:n}=S();return e.jsx(oe,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{sx:{maxWidth:800,"@media (max-width: 768px)":{margin:"16px",maxWidth:"calc(100vw - 32px)"}}},fullWidth:!0,children:e.jsx(et,{children:e.jsx(be,{accessKey:s})})})}ye.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};const et=P(m)`
30
+ `;function he({accessKeyId:s,time:t,remark:n,onDelete:a=()=>{},onClose:i=()=>{}}){const{t:l,locale:b}=S(),{api:p}=I(),{teamDid:j}=W(),u=()=>{i()},K=async()=>{try{await p.deleteAccessKey({input:{teamDid:j,accessKeyId:s}}),a()}catch(r){$e.error(r?.message)}finally{u()}},C=r=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:Me(r,b),timeAge:Ve(new Date(r),qe(b))}),d={keyName:n,title:l("setting.accessKey.title"),description:t?`${l("setting.accessKey.description",C(t))}`:`${l("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:l("setting.accessKey.confirm_desc",{name:n}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:K,onCancel:u};return e.jsx(Oe,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})}he.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:a="",expireAt:i="",authType:l="signature",onClose:b=()=>{}}){const{api:p}=I(),{teamDid:j}=W(),{t:u}=S(),[K,C]=g.useState(!1),d=ue(),r=()=>{C(!1),b()},w=async o=>{const{accessKeyId:v,remark:R="",passport:h,expireAt:y,authType:$}=o;C(!0),await p.updateAccessKey({input:{teamDid:j,accessKeyId:v,remark:R.trim(),passport:h,expireAt:y?new Date(y).getTime():null,authType:$}}),n(),r()},f={title:`${u("common.update")} ${u("accessKey")}`,description:(o,v,R)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:u("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:o.accessKeyId,disabled:!0}),e.jsx(U,{label:u("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:o.remark,onChange:h=>{v({...o,remark:h.target.value,__disableConfirm:!h.target.value.trim()}),h.target.value.trim()?R(""):R(u("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{children:u("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"update-access-key-select-passport",value:o.passport,onChange:h=>{const y=h.target.value;R(null),v({...o,passport:y,__disableConfirm:!o.remark||!y})},fullWidth:!0,label:u("setting.accessKey.passport"),disabled:K,children:d.map(h=>e.jsx(J,{value:h.name,"data-cy":`update-access-key-passport-option-${h.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:h.title||h.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:h.description})]})},h.name))})]}),e.jsx(Z,{disabled:!0,value:o.authType,onChange:h=>{v({...o,authType:h.target.value})}}),e.jsx(de,{placeholder:u("setting.accessKey.expireTime"),value:o.expireAt,onChange:h=>{v({...o,expireAt:h,__disableConfirm:!o.passport||!o.remark||!h})}})]}),confirm:u("common.confirm"),cancel:u("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:a,expireAt:i,authType:l},onConfirm:w,onCancel:r};return e.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,color:f.color,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}ge.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};function ye({accessKey:s,onCancel:t}){const{t:n}=S();return e.jsx(oe,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{sx:{maxWidth:800,"@media (max-width: 768px)":{margin:"16px",maxWidth:"calc(100vw - 32px)"}}},fullWidth:!0,children:e.jsx(et,{children:e.jsx(be,{accessKey:s})})})}ye.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};const et=P(m)`
31
31
  margin-top: -16px;
32
32
 
33
33
  .tabs {
34
34
  margin-left: 0;
35
35
  margin-right: 0;
36
36
  }
37
- `;function be({accessKey:s}){const{t,locale:n}=S(),{blocklet:a}=Le(),o=I(),l=ee(),b=me(),p=(a?.children||[]).find(d=>d?.meta?.did===s.componentDid),j=l.find(d=>d.name===s.passport),u=j?j.title:s.passport,K=g.useMemo(()=>o.inService?`curl -H "Authorization: Bearer blocklet-${M.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${M.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,o?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,o.inService,o?.info?.routing?.adminPath]),w=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Je,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(V,{children:`blocklet-${M.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(m,{children:ce(u,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ie,{showDid:!0,did:s.createdBy,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(Y,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...p?[{label:t("setting.accessKey.component"),content:e.jsxs(m,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Ge,{blocklet:p,ancestors:[a]}),e.jsx(m,{sx:{ml:"16px",minWidth:0},children:e.jsxs(m,{className:"component-header",children:[e.jsx(m,{className:"component-name",children:Ue.getDisplayName(p,!0)}),e.jsx(m,{className:"component-version",children:p?.meta?.version})]})})]},p)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:K,language:"shell",showDefaultText:!1})}:null].filter(Boolean)}];return e.jsx(tt,{gap:3,children:e.jsx(m,{className:"info-area",children:w.map(d=>e.jsxs(m,{sx:{mb:3},children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:d.title}),e.jsx(m,{className:"info-grid",children:d.items.map(c=>e.jsxs(m,{className:"info-item",children:[e.jsx(m,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:c.label})}),e.jsx(m,{className:"info-content",sx:{flex:1,minWidth:0,"@media (max-width: 768px)":{width:"100%",flex:"none"}},children:c.content})]},c.label))})]},d.title))})})}be.propTypes={accessKey:x.object.isRequired};const tt=P(Q)`
37
+ `;function be({accessKey:s}){const{t,locale:n}=S(),{blocklet:a}=Le(),i=I(),l=ee(),b=me(),p=(a?.children||[]).find(d=>d?.meta?.did===s.componentDid),j=l.find(d=>d.name===s.passport),u=j?j.title:s.passport,K=g.useMemo(()=>i.inService?`curl -H "Authorization: Bearer blocklet-${M.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${M.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,i?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,i.inService,i?.info?.routing?.adminPath]),C=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Je,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(V,{children:`blocklet-${M.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(m,{children:ce(u,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ie,{showDid:!0,did:s.createdBy,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(Y,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...p?[{label:t("setting.accessKey.component"),content:e.jsxs(m,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Ge,{blocklet:p,ancestors:[a]}),e.jsx(m,{sx:{ml:"16px",minWidth:0},children:e.jsxs(m,{className:"component-header",children:[e.jsx(m,{className:"component-name",children:Ue.getDisplayName(p,!0)}),e.jsx(m,{className:"component-version",children:p?.meta?.version})]})})]},p)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:K,language:"shell",showDefaultText:!1})}:null].filter(Boolean)}];return e.jsx(tt,{gap:3,children:e.jsx(m,{className:"info-area",children:C.map(d=>e.jsxs(m,{sx:{mb:3},children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:d.title}),e.jsx(m,{className:"info-grid",children:d.items.map(r=>e.jsxs(m,{className:"info-item",children:[e.jsx(m,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:r.label})}),e.jsx(m,{className:"info-content",sx:{flex:1,minWidth:0,"@media (max-width: 768px)":{width:"100%",flex:"none"}},children:r.content})]},r.label))})]},d.title))})})}be.propTypes={accessKey:x.object.isRequired};const tt=P(Q)`
38
38
  .info-card {
39
39
  margin-bottom: 24px;
40
40
  overflow: hidden;
@@ -147,4 +147,4 @@ const result = await client.getBlocklet(
147
147
  margin: 0;
148
148
  }
149
149
  }
150
- `;function st({isSelf:s=!1,columnSx:t={}}){const{t:n,locale:a}=S(),{api:o,inService:l}=I(),{teamDid:b}=W(),[p,j]=g.useState({}),[u,K]=g.useState(null),[w,d]=g.useState(null),[c,C]=g.useState(null),h=me(),i=ee(),v=g.useRef(null),R=`access-keys-${b}`,f=Ne(R),[y,$]=g.useState({searchText:f.searchText||"",pageSize:f.rowsPerPage||10,page:1}),D=Ye(async()=>{const r={teamDid:b,paging:{page:y.page,pageSize:y.pageSize}};return y.searchText&&(r.remark=y.searchText),await o.getAccessKeys({input:r})},[y.page,y.pageSize,y.searchText]),{loading:je,error:te}=D,N=g.useMemo(()=>D.value?.list||[],[D.value?.list]),se=g.useMemo(()=>s?["accessKeyId","createdVia","createdBy","createdBy"]:[],[s]),we=g.useMemo(()=>[{label:n("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{className:"remark",sx:Ee({display:"flex",alignItems:"center",gap:2},t),children:e.jsx(E,{children:A.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(m,{sx:t,children:e.jsx(_e,{showDidLogo:!1,children:r})})}},{label:n("common.role"),name:"passport",options:{customBodyRender:r=>{const T=i.find(k=>k.name===r),A=T?T.title:r;return e.jsx(m,{sx:t,children:ce(A,r)})}}},{label:n("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx(E,{sx:t,children:r})}},{label:n("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx(E,{sx:t,children:n(`setting.accessKey.${r}`)})}},{label:n("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(m,{sx:t,children:r?e.jsx(B,{value:r,locale:a}):"-"})}},{label:n("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(m,{sx:t,children:r?e.jsx(B,{value:r,locale:a}):"-"})}},{label:n("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>e.jsx(m,{className:"expired-at",sx:t,children:r?e.jsx(Y,{value:r}):n("common.neverExpired")})}},{label:n("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:r=>e.jsx(m,{sx:t,children:r?e.jsx(ie,{showDid:!0,did:r,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0,...h&&{minWidth:"unset"}}}):"-"})}},{label:n("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(r,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{sx:t,children:e.jsx(Qe,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(Ke,{}),text:n("common.edit"),onClick:k=>{k.stopPropagation(),C(A)}},{icon:e.jsx(Re,{}),text:n("common.delete"),onClick:k=>{k.stopPropagation(),d(A)}}]})})}}}].filter(r=>!se.includes(r.name)),[N,a,n,i,d,C,t,h,se]),Ce=({page:r,rowsPerPage:T,searchText:A})=>{y.pageSize!==T?$(k=>({...k,pageSize:T,page:1})):y.page!==r+1?$(k=>({...k,searchText:A,page:r+1})):y.searchText!==A&&$(k=>({...k,searchText:A,page:1}))};return te?e.jsx(De,{severity:"error",children:ze(te)}):e.jsxs(m,{ref:v,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[h?e.jsx(ne,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}):null,e.jsx(Pe,{durable:R,durableKeys:["page","rowsPerPage","searchText"],data:N,locale:a,columns:we,className:"pc-access-key-table",options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:y.page-1,rowsPerPage:y.pageSize,count:D.value?.paging?.total||0,searchText:y.searchText,searchDebounceTime:600,onRowClick(r,{dataIndex:T},A){if(v.current?.contains(A.target)){const k=N[T];K(k)}}},loading:je,onChange:Ce,title:h?null:e.jsx(ne,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}),customButtons:[e.jsx(Xe,{permission:l?"":"mutate_accessKey",children:e.jsx(xe,{onCreate:r=>{const{accessKeyId:T,accessKeySecret:A,authType:k}=r;j({show:!0,accessKeyId:T,accessKeySecret:A,authType:k})}})}),e.jsx(Se,{variant:"contained",color:"primary",startIcon:e.jsx(Ie,{}),onClick:()=>{D.retry()},children:n("common.refresh")})],emptyNode:e.jsx(We,{children:n("oauth.client.empty")})}),p.show&&e.jsx(fe,{hideSecret:p.authType==="signature",onConfirm:()=>{D.retry(),j({show:!1})},...p}),u&&e.jsx(ye,{onCancel:()=>K(null),accessKey:u}),w&&e.jsx(he,{accessKeyId:w.accessKeyId,time:w.lastUsedAt,remark:w.remark||"N/A",onDelete:D.retry,onClose:()=>d(null)}),c&&e.jsx(ge,{...c,onUpdate:D.retry,onClose:()=>C(null)})]})}st.propTypes={isSelf:x.bool,columnSx:x.object};export{st as default};
150
+ `;function st({isSelf:s=!1,columnSx:t={}}){const{t:n,locale:a}=S(),{api:i,inService:l}=I(),{teamDid:b}=W(),[p,j]=g.useState({}),[u,K]=g.useState(null),[C,d]=g.useState(null),[r,w]=g.useState(null),f=me(),o=ee(),v=g.useRef(null),R=`access-keys-${b}`,h=Ne(R),[y,$]=g.useState({searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:1}),D=Ye(async()=>{const c={teamDid:b,paging:{page:y.page,pageSize:y.pageSize}};return y.searchText&&(c.remark=y.searchText),await i.getAccessKeys({input:c})},[y.page,y.pageSize,y.searchText]),{loading:je,error:te}=D,N=g.useMemo(()=>D.value?.list||[],[D.value?.list]),se=g.useMemo(()=>s?["accessKeyId","createdVia","createdBy","createdBy"]:[],[s]),Ce=g.useMemo(()=>[{label:n("common.name"),name:"remark",options:{customBodyRender:(c,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{className:"remark",sx:Ee({display:"flex",alignItems:"center",gap:2},t),children:e.jsx(E,{children:A.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:c=>e.jsx(m,{sx:t,children:e.jsx(_e,{showDidLogo:!1,children:c})})}},{label:n("common.role"),name:"passport",options:{customBodyRender:c=>{const T=o.find(k=>k.name===c),A=T?T.title:c;return e.jsx(m,{sx:t,children:ce(A,c)})}}},{label:n("common.createdVia"),name:"createdVia",options:{customBodyRender:c=>e.jsx(E,{sx:t,children:c})}},{label:n("setting.accessKey.authType"),name:"authType",options:{customBodyRender:c=>e.jsx(E,{sx:t,children:n(`setting.accessKey.${c}`)})}},{label:n("common.createdAt"),name:"createdAt",options:{customBodyRender:c=>e.jsx(m,{sx:t,children:c?e.jsx(B,{value:c,locale:a}):"-"})}},{label:n("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:c=>e.jsx(m,{sx:t,children:c?e.jsx(B,{value:c,locale:a}):"-"})}},{label:n("common.expiredAt"),name:"expireAt",options:{customBodyRender:c=>e.jsx(m,{className:"expired-at",sx:t,children:c?e.jsx(Y,{value:c}):n("common.neverExpired")})}},{label:n("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:c=>e.jsx(m,{sx:t,children:c?e.jsx(ie,{showDid:!0,did:c,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0,...f&&{minWidth:"unset"}}}):"-"})}},{label:n("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(c,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{sx:t,children:e.jsx(Qe,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(Ke,{}),text:n("common.edit"),onClick:k=>{k.stopPropagation(),w(A)}},{icon:e.jsx(Re,{}),text:n("common.delete"),onClick:k=>{k.stopPropagation(),d(A)}}]})})}}}].filter(c=>!se.includes(c.name)),[N,a,n,o,d,w,t,f,se]),we=({page:c,rowsPerPage:T,searchText:A})=>{y.pageSize!==T?$(k=>({...k,pageSize:T,page:1})):y.page!==c+1?$(k=>({...k,searchText:A,page:c+1})):y.searchText!==A&&$(k=>({...k,searchText:A,page:1}))};return te?e.jsx(De,{severity:"error",children:ze(te)}):e.jsxs(m,{ref:v,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[f?e.jsx(ne,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}):null,e.jsx(Pe,{durable:R,durableKeys:["page","rowsPerPage","searchText"],data:N,locale:a,columns:Ce,className:"pc-access-key-table",options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:y.page-1,rowsPerPage:y.pageSize,count:D.value?.paging?.total||0,searchText:y.searchText,searchDebounceTime:600,onRowClick(c,{dataIndex:T},A){if(v.current?.contains(A.target)){const k=N[T];K(k)}}},loading:je,onChange:we,title:f?null:e.jsx(ne,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}),customButtons:[e.jsx(Xe,{permission:l?"":"mutate_accessKey",children:e.jsx(xe,{onCreate:c=>{const{accessKeyId:T,accessKeySecret:A,authType:k}=c;j({show:!0,accessKeyId:T,accessKeySecret:A,authType:k})}})}),e.jsx(Se,{variant:"contained",color:"primary",startIcon:e.jsx(Ie,{}),onClick:()=>{D.retry()},children:n("common.refresh")})],emptyNode:e.jsx(We,{children:n("oauth.client.empty")})}),p.show&&e.jsx(fe,{hideSecret:p.authType==="signature",onConfirm:()=>{D.retry(),j({show:!1})},...p}),u&&e.jsx(ye,{onCancel:()=>K(null),accessKey:u}),C&&e.jsx(he,{accessKeyId:C.accessKeyId,time:C.lastUsedAt,remark:C.remark||"N/A",onDelete:D.retry,onClose:()=>d(null)}),r&&e.jsx(ge,{...r,onUpdate:D.retry,onClose:()=>w(null)})]})}st.propTypes={isSelf:x.bool,columnSx:x.object};export{st as default};
@@ -1 +1 @@
1
- import{r as p}from"./vendor-react-CUXIiAnY.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-BPQ6AEW_.js";import{a as j}from"./vendor-hooks-PN9SWiQm.js";import{a1 as r}from"./index-DQt_6j3C.js";import{V as A}from"./vendor-ux-r9bApERu.js";import{l as C}from"./arrow-down.svg-DCPm0wfX.js";import{L as O,D as H}from"./vendor-mui-x-CWNb8fsW.js";import{A as R}from"./AdapterDayjs-DEl3BogQ.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:h="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const T=e?r(n).tz(e):r(n);i(new Date(T.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:h,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(C,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:h=!0}){const{t:e}=A(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[T,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),M=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},_=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>h?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>M(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},sx:{"& .MuiInputLabel-root":{width:"calc(100% - 46px)"}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(I,{children:a.jsx(v,{value:m,onChange:_,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:T})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
1
+ import{r as p}from"./vendor-react-CUXIiAnY.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-B5XNUjey.js";import{a as j}from"./vendor-hooks-U4TTuKG0.js";import{a1 as r}from"./index-Dijoh4El.js";import{V as A}from"./vendor-ux-BX9dSNUy.js";import{l as C}from"./arrow-down.svg-Dhs0HydJ.js";import{L as O,D as H}from"./vendor-mui-x-DtPl0qBm.js";import{A as R}from"./AdapterDayjs-p1MGZm94.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:h="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const T=e?r(n).tz(e):r(n);i(new Date(T.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:h,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(C,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:h=!0}){const{t:e}=A(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[T,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),M=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},_=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>h?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>M(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},sx:{"& .MuiInputLabel-root":{width:"calc(100% - 46px)"}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(I,{children:a.jsx(v,{value:m,onChange:_,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:T})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
@@ -1,4 +1,4 @@
1
- import{r}from"./vendor-react-CUXIiAnY.js";import{j as i,cd as N,at as g,W as t,ak as _,b0 as S,a6 as E,s as z}from"./vendor-mui-core-BPQ6AEW_.js";import{g as Z,h as $,b as y,k as T}from"./vendor-hooks-PN9SWiQm.js";import{a1 as A,R as D,c as U,aT as q,aU as L,aV as H,t as F}from"./index-DQt_6j3C.js";import{p as O,b as W,n as B,V as w,$ as Y}from"./vendor-ux-r9bApERu.js";import{N as J}from"./index-CdOL_gmG.js";import{C as K}from"./vendor-utils-BgSaqjGx.js";import{u as X}from"./use-passport-id-B-b-_oYF.js";import{u as G}from"./session-SqadLMEY.js";import{b as Q}from"./sdk-BbyMeQrc.js";import{w as e2}from"./wrap-locale-BovKZCTj.js";function b({invitation:e,createPassportSvg:o,passportColor:c="auto"}){const[d,n]=r.useState(!1),{t:p}=r.useContext(O),s=r.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),C=r.useMemo(()=>o({title:s,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:A(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,s]),m=r.useCallback(()=>{n(!0)},[]),a=r.useCallback(()=>{n(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(i2,{children:i.jsxs("div",{className:"invite-passport__card",onClick:m,children:[!!e.display&&i.jsx(J,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:C}})]})}),i.jsx(W,{open:d,title:p("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:a,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(u=>i.jsx("li",{style:{listStyle:"circle"},children:u.description},u.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(N,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:p("invite.emptyPermission")})]})})]})}b.propTypes={invitation:t.object.isRequired,createPassportSvg:t.func.isRequired,passportColor:t.string};const i2=g.div`
1
+ import{r}from"./vendor-react-CUXIiAnY.js";import{j as i,cd as N,at as g,W as t,ak as _,b0 as S,a6 as E,s as z}from"./vendor-mui-core-B5XNUjey.js";import{g as Z,h as $,b as y,k as T}from"./vendor-hooks-U4TTuKG0.js";import{a1 as U,U as A,c as D,aT as q,aU as L,aV as H,t as F}from"./index-Dijoh4El.js";import{p as O,b as W,n as B,V as w,$ as Y}from"./vendor-ux-BX9dSNUy.js";import{N as J}from"./index-CUIcSX4q.js";import{C as K}from"./vendor-utils-CFxoplqC.js";import{u as X}from"./use-passport-id-B-b-_oYF.js";import{u as G}from"./session-DUT2afHJ.js";import{b as Q}from"./sdk-Do4pV1s0.js";import{w as e2}from"./wrap-locale-Dk2yVg3Y.js";function b({invitation:e,createPassportSvg:o,passportColor:c="auto"}){const[d,n]=r.useState(!1),{t:p}=r.useContext(O),s=r.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),C=r.useMemo(()=>o({title:s,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:U(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,s]),m=r.useCallback(()=>{n(!0)},[]),a=r.useCallback(()=>{n(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(i2,{children:i.jsxs("div",{className:"invite-passport__card",onClick:m,children:[!!e.display&&i.jsx(J,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:C}})]})}),i.jsx(W,{open:d,title:p("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:a,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(u=>i.jsx("li",{style:{listStyle:"circle"},children:u.description},u.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(N,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:p("invite.emptyPermission")})]})})]})}b.propTypes={invitation:t.object.isRequired,createPassportSvg:t.func.isRequired,passportColor:t.string};const i2=g.div`
2
2
  display: flex;
3
3
  max-width: 350px;
4
4
  margin: 30px auto;
@@ -39,7 +39,7 @@ import{r}from"./vendor-react-CUXIiAnY.js";import{j as i,cd as N,at as g,W as t,a
39
39
  line-height: 18px;
40
40
  color: ${({theme:e})=>e.palette.primary.main};
41
41
  }
42
- `,t2=e=>r.createElement("svg",{width:239,height:42,viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M24.6042 2.26271L28.5233 0H42.7899V41.8617H28.7912C28.6157 41.8617 28.4433 41.8155 28.2912 41.7277L13.1882 33.0079L13.1882 8.85374L15.0055 7.80451L18.2055 9.65203L16.3882 10.7013V31.1604L29.3807 38.6617H39.5899V3.2H29.3807L27.8042 4.11023L24.6042 2.26271Z",fill:"currentColor"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.4018 31.1604V10.7013L13.4092 3.2H3.2V38.6617H13.4092L14.9906 37.7486L18.1906 39.5961L14.2666 41.8617H0V0H14.2666L29.6018 8.85374V33.0079L27.7893 34.0543L24.5893 32.2068L26.4018 31.1604Z",fill:"currentColor"}),r.createElement("path",{d:"M138.44 27.684C138.632 27.684 138.797 27.7587 138.936 27.908L140.28 29.38C139.341 30.4893 138.195 31.348 136.84 31.956C135.496 32.564 133.875 32.868 131.976 32.868C130.312 32.868 128.803 32.58 127.448 32.004C126.104 31.428 124.952 30.6227 123.992 29.588C123.043 28.5533 122.307 27.316 121.784 25.876C121.261 24.436 121 22.852 121 21.124C121 19.396 121.272 17.812 121.816 16.372C122.371 14.932 123.144 13.6947 124.136 12.66C125.128 11.6253 126.312 10.82 127.688 10.244C129.075 9.668 130.605 9.38 132.28 9.38C133.912 9.38 135.363 9.64666 136.632 10.18C137.901 10.7133 139.005 11.4227 139.944 12.308L138.824 13.892C138.749 14.0093 138.653 14.1053 138.536 14.18C138.429 14.2547 138.285 14.292 138.104 14.292C137.901 14.292 137.661 14.1907 137.384 13.988C137.117 13.7853 136.76 13.5613 136.312 13.316C135.875 13.06 135.331 12.8307 134.68 12.628C134.029 12.4253 133.219 12.324 132.248 12.324C131.107 12.324 130.061 12.5267 129.112 12.932C128.163 13.3267 127.341 13.9027 126.648 14.66C125.965 15.4067 125.432 16.3293 125.048 17.428C124.675 18.516 124.488 19.748 124.488 21.124C124.488 22.5213 124.685 23.764 125.08 24.852C125.475 25.94 126.019 26.8627 126.712 27.62C127.405 28.3773 128.221 28.9533 129.16 29.348C130.099 29.7427 131.112 29.94 132.2 29.94C132.861 29.94 133.453 29.9027 133.976 29.828C134.509 29.7427 134.995 29.62 135.432 29.46C135.88 29.3 136.301 29.0973 136.696 28.852C137.091 28.596 137.48 28.292 137.864 27.94C137.949 27.8653 138.04 27.8067 138.136 27.764C138.232 27.7107 138.333 27.684 138.44 27.684Z",fill:"currentColor"}),r.createElement("path",{d:"M149.68 16.1C150.875 16.1 151.952 16.2973 152.912 16.692C153.883 17.076 154.704 17.636 155.376 18.372C156.059 19.0973 156.581 19.9773 156.944 21.012C157.307 22.036 157.488 23.188 157.488 24.468C157.488 25.748 157.307 26.9053 156.944 27.94C156.581 28.9747 156.059 29.8547 155.376 30.58C154.704 31.3053 153.883 31.8653 152.912 32.26C151.952 32.644 150.875 32.836 149.68 32.836C148.475 32.836 147.387 32.644 146.416 32.26C145.456 31.8653 144.635 31.3053 143.952 30.58C143.269 29.8547 142.741 28.9747 142.368 27.94C142.005 26.9053 141.824 25.748 141.824 24.468C141.824 23.188 142.005 22.036 142.368 21.012C142.741 19.9773 143.269 19.0973 143.952 18.372C144.635 17.636 145.456 17.076 146.416 16.692C147.387 16.2973 148.475 16.1 149.68 16.1ZM149.68 30.404C151.216 30.404 152.363 29.8867 153.12 28.852C153.877 27.8173 154.256 26.3613 154.256 24.484C154.256 22.6067 153.877 21.1507 153.12 20.116C152.363 19.0707 151.216 18.548 149.68 18.548C148.123 18.548 146.96 19.0707 146.192 20.116C145.435 21.1507 145.056 22.6067 145.056 24.484C145.056 26.3613 145.435 27.8173 146.192 28.852C146.96 29.8867 148.123 30.404 149.68 30.404Z",fill:"currentColor"}),r.createElement("path",{d:"M163.899 18.612C164.251 18.2387 164.619 17.8973 165.003 17.588C165.387 17.2787 165.792 17.0173 166.219 16.804C166.656 16.58 167.12 16.4093 167.611 16.292C168.112 16.164 168.645 16.1 169.211 16.1C170.107 16.1 170.891 16.2493 171.563 16.548C172.245 16.8467 172.816 17.268 173.275 17.812C173.733 18.3453 174.08 18.9907 174.315 19.748C174.549 20.5053 174.667 21.3427 174.667 22.26V32.612H171.531V22.26C171.531 21.0973 171.264 20.196 170.731 19.556C170.197 18.9053 169.381 18.58 168.283 18.58C167.483 18.58 166.731 18.772 166.027 19.156C165.333 19.5293 164.688 20.0413 164.091 20.692V32.612H160.971V16.356H162.843C163.28 16.356 163.552 16.564 163.659 16.98L163.899 18.612Z",fill:"currentColor"}),r.createElement("path",{d:"M181.805 18.612C182.157 18.2387 182.525 17.8973 182.909 17.588C183.293 17.2787 183.698 17.0173 184.125 16.804C184.562 16.58 185.026 16.4093 185.517 16.292C186.018 16.164 186.552 16.1 187.117 16.1C188.013 16.1 188.797 16.2493 189.469 16.548C190.152 16.8467 190.722 17.268 191.181 17.812C191.64 18.3453 191.986 18.9907 192.221 19.748C192.456 20.5053 192.573 21.3427 192.573 22.26V32.612H189.437V22.26C189.437 21.0973 189.17 20.196 188.637 19.556C188.104 18.9053 187.288 18.58 186.189 18.58C185.389 18.58 184.637 18.772 183.933 19.156C183.24 19.5293 182.594 20.0413 181.997 20.692V32.612H178.877V16.356H180.749C181.186 16.356 181.458 16.564 181.565 16.98L181.805 18.612Z",fill:"currentColor"}),r.createElement("path",{d:"M207.551 22.676C207.551 22.0573 207.461 21.4867 207.279 20.964C207.109 20.4413 206.853 19.988 206.511 19.604C206.17 19.22 205.754 18.9213 205.263 18.708C204.773 18.4947 204.207 18.388 203.567 18.388C202.255 18.388 201.221 18.7667 200.463 19.524C199.717 20.2813 199.242 21.332 199.039 22.676H207.551ZM210.127 30.292C209.743 30.74 209.301 31.1293 208.799 31.46C208.298 31.78 207.765 32.0413 207.199 32.244C206.634 32.4467 206.047 32.596 205.439 32.692C204.842 32.788 204.25 32.836 203.663 32.836C202.543 32.836 201.503 32.6493 200.543 32.276C199.594 31.892 198.767 31.3373 198.063 30.612C197.37 29.876 196.826 28.9693 196.431 27.892C196.047 26.804 195.855 25.556 195.855 24.148C195.855 23.0173 196.031 21.9667 196.383 20.996C196.735 20.0147 197.237 19.1613 197.887 18.436C198.549 17.7107 199.354 17.14 200.303 16.724C201.253 16.308 202.319 16.1 203.503 16.1C204.495 16.1 205.407 16.2653 206.239 16.596C207.082 16.916 207.807 17.3853 208.415 18.004C209.023 18.6227 209.498 19.3853 209.839 20.292C210.191 21.1987 210.367 22.2333 210.367 23.396C210.367 23.876 210.314 24.2013 210.207 24.372C210.101 24.532 209.903 24.612 209.615 24.612H198.959C198.991 25.5827 199.13 26.4307 199.375 27.156C199.621 27.8707 199.957 28.468 200.383 28.948C200.821 29.428 201.338 29.7853 201.935 30.02C202.533 30.2547 203.199 30.372 203.935 30.372C204.629 30.372 205.226 30.292 205.727 30.132C206.239 29.972 206.677 29.8013 207.039 29.62C207.413 29.428 207.722 29.252 207.967 29.092C208.223 28.932 208.447 28.852 208.639 28.852C208.895 28.852 209.093 28.948 209.231 29.14L210.127 30.292Z",fill:"currentColor"}),r.createElement("path",{d:"M225.113 19.396C225.017 19.5133 224.921 19.6093 224.825 19.684C224.739 19.748 224.611 19.78 224.441 19.78C224.27 19.78 224.089 19.716 223.897 19.588C223.715 19.4493 223.481 19.3053 223.193 19.156C222.915 18.996 222.574 18.852 222.169 18.724C221.774 18.5853 221.283 18.516 220.697 18.516C219.929 18.516 219.251 18.6547 218.665 18.932C218.078 19.2093 217.587 19.604 217.193 20.116C216.809 20.628 216.515 21.252 216.313 21.988C216.11 22.724 216.009 23.5507 216.009 24.468C216.009 25.4173 216.115 26.2653 216.329 27.012C216.542 27.748 216.846 28.372 217.241 28.884C217.635 29.3853 218.115 29.7693 218.681 30.036C219.246 30.292 219.875 30.42 220.569 30.42C221.241 30.42 221.795 30.34 222.233 30.18C222.67 30.0093 223.033 29.828 223.321 29.636C223.609 29.444 223.849 29.268 224.041 29.108C224.233 28.9373 224.43 28.852 224.633 28.852C224.889 28.852 225.086 28.948 225.225 29.14L226.121 30.292C225.747 30.7507 225.326 31.14 224.857 31.46C224.398 31.78 223.907 32.0413 223.385 32.244C222.862 32.4467 222.313 32.596 221.737 32.692C221.171 32.788 220.595 32.836 220.009 32.836C218.995 32.836 218.046 32.6493 217.161 32.276C216.286 31.9027 215.523 31.3587 214.873 30.644C214.233 29.9293 213.726 29.0547 213.353 28.02C212.979 26.9747 212.793 25.7907 212.793 24.468C212.793 23.2627 212.958 22.148 213.289 21.124C213.63 20.1 214.126 19.22 214.777 18.484C215.438 17.7373 216.249 17.156 217.209 16.74C218.169 16.3133 219.267 16.1 220.505 16.1C221.667 16.1 222.691 16.2867 223.577 16.66C224.462 17.0333 225.251 17.5613 225.945 18.244L225.113 19.396Z",fill:"currentColor"}),r.createElement("path",{d:"M234.121 32.868C232.809 32.868 231.796 32.5 231.081 31.764C230.377 31.028 230.025 29.9773 230.025 28.612V18.884H228.137C227.956 18.884 227.801 18.8307 227.673 18.724C227.556 18.6067 227.497 18.436 227.497 18.212V16.948L230.137 16.58L230.841 11.732C230.884 11.5507 230.964 11.412 231.081 11.316C231.209 11.2093 231.369 11.156 231.561 11.156H233.145V16.612H237.753V18.884H233.145V28.404C233.145 29.044 233.3 29.524 233.609 29.844C233.929 30.1533 234.335 30.308 234.825 30.308C235.113 30.308 235.359 30.2707 235.561 30.196C235.775 30.1213 235.956 30.0413 236.105 29.956C236.255 29.86 236.383 29.7747 236.489 29.7C236.596 29.6253 236.692 29.588 236.777 29.588C236.884 29.588 236.964 29.6147 237.017 29.668C237.081 29.7107 237.145 29.7853 237.209 29.892L238.137 31.396C237.625 31.8653 237.017 32.228 236.313 32.484C235.609 32.74 234.879 32.868 234.121 32.868Z",fill:"currentColor"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8154 33.2842V9H70.6597C73.9281 9.22427 76.4828 11.9486 76.4828 15.2433V27.026C76.4828 30.4823 73.6809 33.2842 70.2246 33.2842H57.8154ZM84.5586 9H81.2237V33.3211H84.5586V9ZM61.1503 29.9493V12.32H70.2246C71.8391 12.32 73.1479 13.6288 73.1479 15.2433V27.026C73.1479 28.6405 71.8391 29.9493 70.2246 29.9493H61.1503ZM89.2432 9V33.2842H101.652C105.109 33.2842 107.911 30.4823 107.911 27.026V15.2433C107.911 11.9486 105.356 9.22427 102.087 9H89.2432ZM112.155 14.6355H115.883V18.3639H112.155V14.6355ZM115.883 23.9572H112.155V27.6856H115.883V23.9572ZM92.5781 12.32V29.9493H101.652C103.267 29.9493 104.576 28.6405 104.576 27.026V15.2433C104.576 13.6288 103.267 12.32 101.652 12.32H92.5781Z",fill:"currentColor"}));function j({children:e=null,...o}){return i.jsxs(B,{color:"did",variant:"contained",...o,children:[i.jsx(_,{sx:{fontWeight:400},children:e||"Continue With"}),i.jsx(t2,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}j.propTypes={children:t.any};function k({invitation:e,onLogin:o=()=>{},onReceive:c=null,inService:d=!1,action:n="invite",orgId:p=""}){const{t:s,locale:C}=w(),{connectApi:m}=G(),{getPassportId:a}=X();let u;typeof window<"u"&&(u=window?.blocklet?.componentId);const l=Z({loading:!1,extraParams:{baseUrl:window.location.origin,componentId:u,sourceAppPid:e?.sourceAppPid||null}});$(async()=>{const x=a();if(x&&(l.extraParams.passportId=x),n==="invite"?(l.extraParams.inviteId=e.inviteId,l.extraParams.orgId=p):n==="issue-passport"&&(l.extraParams.inviteId=e.inviteId,l.extraParams.id=e.inviteId),d&&e?.receiver?.did){l.loading=!0;try{const f=await Q.user.getUserPublicInfo({did:e.receiver.did});f?.sourceAppPid&&(l.extraParams.sourceAppPid=f.sourceAppPid)}finally{l.loading=!1}}});const v=y(()=>{m.close()}),h=y((...x)=>{m.close(),o(...x)}),M=y(()=>{if(typeof c=="function"){c();return}const x=e?.receiver?.did||!1,f=x?s("receive.dialog.scanWithDid",{did:e?.receiver?.did}):s("receive.dialog.scan");d?m.open({action:n,className:"connect",forceConnected:x,autoConnect:!1,disableSwitchApp:!0,locale:C,extraParams:{provider:"wallet",...l.extraParams},baseUrl:window.location.origin,prefix:K(window.location.origin,U.WELLKNOWN_SERVICE_PATH_PREFIX,D),messages:{title:s("receive.dialog.title"),scan:f,confirm:s("receive.dialog.confirm"),success:s("receive.dialog.success")},onSuccess:h,onClose:v,passkeyBehavior:"both"},{locale:C}):m.open({action:n,className:"connect",forceConnected:x,autoConnect:!1,disableSwitchApp:!0,locale:C,extraParams:l.extraParams,messages:{title:s("receive.dialog.title"),scan:f,confirm:s("receive.dialog.confirm"),success:s("receive.dialog.success")},onSuccess:h,onClose:v,passkeyBehavior:"both"},{locale:C})});return i.jsxs(r2,{children:[i.jsx(j,{loading:l.loading,size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:M,children:s("invite.receive")}),i.jsxs("div",{className:"invite-receive__until",children:[s("invite.validUntil"),q(e.expireDate,C)]})]})}k.propTypes={invitation:t.object.isRequired,onLogin:t.func,onReceive:t.func,inService:t.bool,action:t.oneOf(["invite","issue-passport"]),orgId:t.string};const r2=g.div`
42
+ `,t2=e=>r.createElement("svg",{width:239,height:42,viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M24.6042 2.26271L28.5233 0H42.7899V41.8617H28.7912C28.6157 41.8617 28.4433 41.8155 28.2912 41.7277L13.1882 33.0079L13.1882 8.85374L15.0055 7.80451L18.2055 9.65203L16.3882 10.7013V31.1604L29.3807 38.6617H39.5899V3.2H29.3807L27.8042 4.11023L24.6042 2.26271Z",fill:"currentColor"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.4018 31.1604V10.7013L13.4092 3.2H3.2V38.6617H13.4092L14.9906 37.7486L18.1906 39.5961L14.2666 41.8617H0V0H14.2666L29.6018 8.85374V33.0079L27.7893 34.0543L24.5893 32.2068L26.4018 31.1604Z",fill:"currentColor"}),r.createElement("path",{d:"M138.44 27.684C138.632 27.684 138.797 27.7587 138.936 27.908L140.28 29.38C139.341 30.4893 138.195 31.348 136.84 31.956C135.496 32.564 133.875 32.868 131.976 32.868C130.312 32.868 128.803 32.58 127.448 32.004C126.104 31.428 124.952 30.6227 123.992 29.588C123.043 28.5533 122.307 27.316 121.784 25.876C121.261 24.436 121 22.852 121 21.124C121 19.396 121.272 17.812 121.816 16.372C122.371 14.932 123.144 13.6947 124.136 12.66C125.128 11.6253 126.312 10.82 127.688 10.244C129.075 9.668 130.605 9.38 132.28 9.38C133.912 9.38 135.363 9.64666 136.632 10.18C137.901 10.7133 139.005 11.4227 139.944 12.308L138.824 13.892C138.749 14.0093 138.653 14.1053 138.536 14.18C138.429 14.2547 138.285 14.292 138.104 14.292C137.901 14.292 137.661 14.1907 137.384 13.988C137.117 13.7853 136.76 13.5613 136.312 13.316C135.875 13.06 135.331 12.8307 134.68 12.628C134.029 12.4253 133.219 12.324 132.248 12.324C131.107 12.324 130.061 12.5267 129.112 12.932C128.163 13.3267 127.341 13.9027 126.648 14.66C125.965 15.4067 125.432 16.3293 125.048 17.428C124.675 18.516 124.488 19.748 124.488 21.124C124.488 22.5213 124.685 23.764 125.08 24.852C125.475 25.94 126.019 26.8627 126.712 27.62C127.405 28.3773 128.221 28.9533 129.16 29.348C130.099 29.7427 131.112 29.94 132.2 29.94C132.861 29.94 133.453 29.9027 133.976 29.828C134.509 29.7427 134.995 29.62 135.432 29.46C135.88 29.3 136.301 29.0973 136.696 28.852C137.091 28.596 137.48 28.292 137.864 27.94C137.949 27.8653 138.04 27.8067 138.136 27.764C138.232 27.7107 138.333 27.684 138.44 27.684Z",fill:"currentColor"}),r.createElement("path",{d:"M149.68 16.1C150.875 16.1 151.952 16.2973 152.912 16.692C153.883 17.076 154.704 17.636 155.376 18.372C156.059 19.0973 156.581 19.9773 156.944 21.012C157.307 22.036 157.488 23.188 157.488 24.468C157.488 25.748 157.307 26.9053 156.944 27.94C156.581 28.9747 156.059 29.8547 155.376 30.58C154.704 31.3053 153.883 31.8653 152.912 32.26C151.952 32.644 150.875 32.836 149.68 32.836C148.475 32.836 147.387 32.644 146.416 32.26C145.456 31.8653 144.635 31.3053 143.952 30.58C143.269 29.8547 142.741 28.9747 142.368 27.94C142.005 26.9053 141.824 25.748 141.824 24.468C141.824 23.188 142.005 22.036 142.368 21.012C142.741 19.9773 143.269 19.0973 143.952 18.372C144.635 17.636 145.456 17.076 146.416 16.692C147.387 16.2973 148.475 16.1 149.68 16.1ZM149.68 30.404C151.216 30.404 152.363 29.8867 153.12 28.852C153.877 27.8173 154.256 26.3613 154.256 24.484C154.256 22.6067 153.877 21.1507 153.12 20.116C152.363 19.0707 151.216 18.548 149.68 18.548C148.123 18.548 146.96 19.0707 146.192 20.116C145.435 21.1507 145.056 22.6067 145.056 24.484C145.056 26.3613 145.435 27.8173 146.192 28.852C146.96 29.8867 148.123 30.404 149.68 30.404Z",fill:"currentColor"}),r.createElement("path",{d:"M163.899 18.612C164.251 18.2387 164.619 17.8973 165.003 17.588C165.387 17.2787 165.792 17.0173 166.219 16.804C166.656 16.58 167.12 16.4093 167.611 16.292C168.112 16.164 168.645 16.1 169.211 16.1C170.107 16.1 170.891 16.2493 171.563 16.548C172.245 16.8467 172.816 17.268 173.275 17.812C173.733 18.3453 174.08 18.9907 174.315 19.748C174.549 20.5053 174.667 21.3427 174.667 22.26V32.612H171.531V22.26C171.531 21.0973 171.264 20.196 170.731 19.556C170.197 18.9053 169.381 18.58 168.283 18.58C167.483 18.58 166.731 18.772 166.027 19.156C165.333 19.5293 164.688 20.0413 164.091 20.692V32.612H160.971V16.356H162.843C163.28 16.356 163.552 16.564 163.659 16.98L163.899 18.612Z",fill:"currentColor"}),r.createElement("path",{d:"M181.805 18.612C182.157 18.2387 182.525 17.8973 182.909 17.588C183.293 17.2787 183.698 17.0173 184.125 16.804C184.562 16.58 185.026 16.4093 185.517 16.292C186.018 16.164 186.552 16.1 187.117 16.1C188.013 16.1 188.797 16.2493 189.469 16.548C190.152 16.8467 190.722 17.268 191.181 17.812C191.64 18.3453 191.986 18.9907 192.221 19.748C192.456 20.5053 192.573 21.3427 192.573 22.26V32.612H189.437V22.26C189.437 21.0973 189.17 20.196 188.637 19.556C188.104 18.9053 187.288 18.58 186.189 18.58C185.389 18.58 184.637 18.772 183.933 19.156C183.24 19.5293 182.594 20.0413 181.997 20.692V32.612H178.877V16.356H180.749C181.186 16.356 181.458 16.564 181.565 16.98L181.805 18.612Z",fill:"currentColor"}),r.createElement("path",{d:"M207.551 22.676C207.551 22.0573 207.461 21.4867 207.279 20.964C207.109 20.4413 206.853 19.988 206.511 19.604C206.17 19.22 205.754 18.9213 205.263 18.708C204.773 18.4947 204.207 18.388 203.567 18.388C202.255 18.388 201.221 18.7667 200.463 19.524C199.717 20.2813 199.242 21.332 199.039 22.676H207.551ZM210.127 30.292C209.743 30.74 209.301 31.1293 208.799 31.46C208.298 31.78 207.765 32.0413 207.199 32.244C206.634 32.4467 206.047 32.596 205.439 32.692C204.842 32.788 204.25 32.836 203.663 32.836C202.543 32.836 201.503 32.6493 200.543 32.276C199.594 31.892 198.767 31.3373 198.063 30.612C197.37 29.876 196.826 28.9693 196.431 27.892C196.047 26.804 195.855 25.556 195.855 24.148C195.855 23.0173 196.031 21.9667 196.383 20.996C196.735 20.0147 197.237 19.1613 197.887 18.436C198.549 17.7107 199.354 17.14 200.303 16.724C201.253 16.308 202.319 16.1 203.503 16.1C204.495 16.1 205.407 16.2653 206.239 16.596C207.082 16.916 207.807 17.3853 208.415 18.004C209.023 18.6227 209.498 19.3853 209.839 20.292C210.191 21.1987 210.367 22.2333 210.367 23.396C210.367 23.876 210.314 24.2013 210.207 24.372C210.101 24.532 209.903 24.612 209.615 24.612H198.959C198.991 25.5827 199.13 26.4307 199.375 27.156C199.621 27.8707 199.957 28.468 200.383 28.948C200.821 29.428 201.338 29.7853 201.935 30.02C202.533 30.2547 203.199 30.372 203.935 30.372C204.629 30.372 205.226 30.292 205.727 30.132C206.239 29.972 206.677 29.8013 207.039 29.62C207.413 29.428 207.722 29.252 207.967 29.092C208.223 28.932 208.447 28.852 208.639 28.852C208.895 28.852 209.093 28.948 209.231 29.14L210.127 30.292Z",fill:"currentColor"}),r.createElement("path",{d:"M225.113 19.396C225.017 19.5133 224.921 19.6093 224.825 19.684C224.739 19.748 224.611 19.78 224.441 19.78C224.27 19.78 224.089 19.716 223.897 19.588C223.715 19.4493 223.481 19.3053 223.193 19.156C222.915 18.996 222.574 18.852 222.169 18.724C221.774 18.5853 221.283 18.516 220.697 18.516C219.929 18.516 219.251 18.6547 218.665 18.932C218.078 19.2093 217.587 19.604 217.193 20.116C216.809 20.628 216.515 21.252 216.313 21.988C216.11 22.724 216.009 23.5507 216.009 24.468C216.009 25.4173 216.115 26.2653 216.329 27.012C216.542 27.748 216.846 28.372 217.241 28.884C217.635 29.3853 218.115 29.7693 218.681 30.036C219.246 30.292 219.875 30.42 220.569 30.42C221.241 30.42 221.795 30.34 222.233 30.18C222.67 30.0093 223.033 29.828 223.321 29.636C223.609 29.444 223.849 29.268 224.041 29.108C224.233 28.9373 224.43 28.852 224.633 28.852C224.889 28.852 225.086 28.948 225.225 29.14L226.121 30.292C225.747 30.7507 225.326 31.14 224.857 31.46C224.398 31.78 223.907 32.0413 223.385 32.244C222.862 32.4467 222.313 32.596 221.737 32.692C221.171 32.788 220.595 32.836 220.009 32.836C218.995 32.836 218.046 32.6493 217.161 32.276C216.286 31.9027 215.523 31.3587 214.873 30.644C214.233 29.9293 213.726 29.0547 213.353 28.02C212.979 26.9747 212.793 25.7907 212.793 24.468C212.793 23.2627 212.958 22.148 213.289 21.124C213.63 20.1 214.126 19.22 214.777 18.484C215.438 17.7373 216.249 17.156 217.209 16.74C218.169 16.3133 219.267 16.1 220.505 16.1C221.667 16.1 222.691 16.2867 223.577 16.66C224.462 17.0333 225.251 17.5613 225.945 18.244L225.113 19.396Z",fill:"currentColor"}),r.createElement("path",{d:"M234.121 32.868C232.809 32.868 231.796 32.5 231.081 31.764C230.377 31.028 230.025 29.9773 230.025 28.612V18.884H228.137C227.956 18.884 227.801 18.8307 227.673 18.724C227.556 18.6067 227.497 18.436 227.497 18.212V16.948L230.137 16.58L230.841 11.732C230.884 11.5507 230.964 11.412 231.081 11.316C231.209 11.2093 231.369 11.156 231.561 11.156H233.145V16.612H237.753V18.884H233.145V28.404C233.145 29.044 233.3 29.524 233.609 29.844C233.929 30.1533 234.335 30.308 234.825 30.308C235.113 30.308 235.359 30.2707 235.561 30.196C235.775 30.1213 235.956 30.0413 236.105 29.956C236.255 29.86 236.383 29.7747 236.489 29.7C236.596 29.6253 236.692 29.588 236.777 29.588C236.884 29.588 236.964 29.6147 237.017 29.668C237.081 29.7107 237.145 29.7853 237.209 29.892L238.137 31.396C237.625 31.8653 237.017 32.228 236.313 32.484C235.609 32.74 234.879 32.868 234.121 32.868Z",fill:"currentColor"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8154 33.2842V9H70.6597C73.9281 9.22427 76.4828 11.9486 76.4828 15.2433V27.026C76.4828 30.4823 73.6809 33.2842 70.2246 33.2842H57.8154ZM84.5586 9H81.2237V33.3211H84.5586V9ZM61.1503 29.9493V12.32H70.2246C71.8391 12.32 73.1479 13.6288 73.1479 15.2433V27.026C73.1479 28.6405 71.8391 29.9493 70.2246 29.9493H61.1503ZM89.2432 9V33.2842H101.652C105.109 33.2842 107.911 30.4823 107.911 27.026V15.2433C107.911 11.9486 105.356 9.22427 102.087 9H89.2432ZM112.155 14.6355H115.883V18.3639H112.155V14.6355ZM115.883 23.9572H112.155V27.6856H115.883V23.9572ZM92.5781 12.32V29.9493H101.652C103.267 29.9493 104.576 28.6405 104.576 27.026V15.2433C104.576 13.6288 103.267 12.32 101.652 12.32H92.5781Z",fill:"currentColor"}));function j({children:e=null,...o}){return i.jsxs(B,{color:"did",variant:"contained",...o,children:[i.jsx(_,{sx:{fontWeight:400},children:e||"Continue With"}),i.jsx(t2,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}j.propTypes={children:t.any};function k({invitation:e,onLogin:o=()=>{},onReceive:c=null,inService:d=!1,action:n="invite",orgId:p=""}){const{t:s,locale:C}=w(),{connectApi:m}=G(),{getPassportId:a}=X();let u;typeof window<"u"&&(u=window?.blocklet?.componentId);const l=Z({loading:!1,extraParams:{baseUrl:window.location.origin,componentId:u,sourceAppPid:e?.sourceAppPid||null}});$(async()=>{const x=a();if(x&&(l.extraParams.passportId=x),n==="invite"?(l.extraParams.inviteId=e.inviteId,l.extraParams.orgId=p):n==="issue-passport"&&(l.extraParams.inviteId=e.inviteId,l.extraParams.id=e.inviteId),d&&e?.receiver?.did){l.loading=!0;try{const f=await Q.user.getUserPublicInfo({did:e.receiver.did});f?.sourceAppPid&&(l.extraParams.sourceAppPid=f.sourceAppPid)}finally{l.loading=!1}}});const v=y(()=>{m.close()}),h=y((...x)=>{m.close(),o(...x)}),M=y(()=>{if(typeof c=="function"){c();return}const x=e?.receiver?.did||!1,f=x?s("receive.dialog.scanWithDid",{did:e?.receiver?.did}):s("receive.dialog.scan");d?m.open({action:n,className:"connect",forceConnected:x,autoConnect:!1,disableSwitchApp:!0,locale:C,extraParams:{provider:"wallet",...l.extraParams},baseUrl:window.location.origin,prefix:K(window.location.origin,D.WELLKNOWN_SERVICE_PATH_PREFIX,A),messages:{title:s("receive.dialog.title"),scan:f,confirm:s("receive.dialog.confirm"),success:s("receive.dialog.success")},onSuccess:h,onClose:v,passkeyBehavior:"both"},{locale:C}):m.open({action:n,className:"connect",forceConnected:x,autoConnect:!1,disableSwitchApp:!0,locale:C,extraParams:l.extraParams,messages:{title:s("receive.dialog.title"),scan:f,confirm:s("receive.dialog.confirm"),success:s("receive.dialog.success")},onSuccess:h,onClose:v,passkeyBehavior:"both"},{locale:C})});return i.jsxs(r2,{children:[i.jsx(j,{loading:l.loading,size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:M,children:s("invite.receive")}),i.jsxs("div",{className:"invite-receive__until",children:[s("invite.validUntil"),q(e.expireDate,C)]})]})}k.propTypes={invitation:t.object.isRequired,onLogin:t.func,onReceive:t.func,inService:t.bool,action:t.oneOf(["invite","issue-passport"]),orgId:t.string};const r2=g.div`
43
43
  text-align: center;
44
44
  .invite-receive__logo-wrapper {
45
45
  display: inline-flex;
@@ -132,7 +132,7 @@ import{r}from"./vendor-react-CUXIiAnY.js";import{j as i,cd as N,at as g,W as t,a
132
132
  .invite-user__link {
133
133
  color: ${({theme:e})=>e.palette.primary.main};
134
134
  }
135
- `;function R({invitation:e,type:o="inviter"}){const{t:c}=w(),d=r.useMemo(()=>c("invite.success",{dapp:"{{dapp}}"}),[c]),n=L(e.info.chainHost,e.inviter.did,"account"),p=o==="receiver"?e.receiver:e.inviter,s=H(d,{name(){return n?i.jsx("a",{target:"_blank",href:n,className:"invite-user__link",rel:"noreferrer",children:p.fullName},"name"):p.fullName},dapp(){return i.jsx("a",{target:"_blank",href:e.info.url,className:"invite-user__link",rel:"noreferrer",children:e.info.name},"dapp")}});return i.jsxs(o2,{children:[i.jsx(_,{sx:{pt:1,color:"success.main"},children:i.jsx(S,{style:{fontSize:80}})}),i.jsx("div",{className:"invite-user__message",children:s})]})}R.propTypes={invitation:t.object.isRequired,type:t.oneOf(["inviter","receiver"])};const o2=g.div`
135
+ `;function P({invitation:e,type:o="inviter"}){const{t:c}=w(),d=r.useMemo(()=>c("invite.success",{dapp:"{{dapp}}"}),[c]),n=L(e.info.chainHost,e.inviter.did,"account"),p=o==="receiver"?e.receiver:e.inviter,s=H(d,{name(){return n?i.jsx("a",{target:"_blank",href:n,className:"invite-user__link",rel:"noreferrer",children:p.fullName},"name"):p.fullName},dapp(){return i.jsx("a",{target:"_blank",href:e.info.url,className:"invite-user__link",rel:"noreferrer",children:e.info.name},"dapp")}});return i.jsxs(o2,{children:[i.jsx(_,{sx:{pt:1,color:"success.main"},children:i.jsx(S,{style:{fontSize:80}})}),i.jsx("div",{className:"invite-user__message",children:s})]})}P.propTypes={invitation:t.object.isRequired,type:t.oneOf(["inviter","receiver"])};const o2=g.div`
136
136
  display: flex;
137
137
  flex-direction: column;
138
138
  justify-content: center;
@@ -155,7 +155,7 @@ import{r}from"./vendor-react-CUXIiAnY.js";import{j as i,cd as N,at as g,W as t,a
155
155
  .invite-user__link {
156
156
  color: ${({theme:e})=>e.palette.primary.main};
157
157
  }
158
- `;function P({getDataFn:e,passportColor:o="auto",createPassportSvg:c,onLoginSuccess:d=()=>{},checkFn:n,onReceive:p=null,inService:s=!1,action:C="invite",status:m=""}){const a=T(e),u=r.useMemo(()=>a?.data?.orgId||"",[a?.data?.orgId]);if(a?.loading)return i.jsx(E,{});if(a?.error)return i.jsx(F,{status:"404",title:a?.error?.response?.data,description:""});const l=m==="success"||a?.data?.status==="success",v=l?R:I,h=l?V:k;return i.jsx(a2,{className:"page-invite__wrapper",children:a?.data?i.jsxs(_,{className:"page-invite__card",children:[i.jsx(v,{invitation:a.data}),i.jsx(b,{invitation:a.data,action:C,createPassportSvg:c,passportColor:o}),i.jsx(h,{invitation:a.data,action:C,onLogin:d,checkFn:n,onReceive:p,inService:s,orgId:u})]}):null})}P.propTypes={getDataFn:t.func.isRequired,checkFn:t.func.isRequired,createPassportSvg:t.func.isRequired,onLoginSuccess:t.func,onReceive:t.func,passportColor:t.string,inService:t.bool,action:t.oneOf(["invite","issue-passpor"]),status:t.oneOf(["success",""])};const a2=z(_)`
158
+ `;function R({getDataFn:e,passportColor:o="auto",createPassportSvg:c,onLoginSuccess:d=()=>{},checkFn:n,onReceive:p=null,inService:s=!1,action:C="invite",status:m=""}){const a=T(e),u=r.useMemo(()=>a?.data?.orgId||"",[a?.data?.orgId]);if(a?.loading)return i.jsx(E,{});if(a?.error)return i.jsx(F,{status:"404",title:a?.error?.response?.data,description:""});const l=m==="success"||a?.data?.status==="success",v=l?P:I,h=l?V:k;return i.jsx(a2,{className:"page-invite__wrapper",children:a?.data?i.jsxs(_,{className:"page-invite__card",children:[i.jsx(v,{invitation:a.data}),i.jsx(b,{invitation:a.data,action:C,createPassportSvg:c,passportColor:o}),i.jsx(h,{invitation:a.data,action:C,onLogin:d,checkFn:n,onReceive:p,inService:s,orgId:u})]}):null})}R.propTypes={getDataFn:t.func.isRequired,checkFn:t.func.isRequired,createPassportSvg:t.func.isRequired,onLoginSuccess:t.func,onReceive:t.func,passportColor:t.string,inService:t.bool,action:t.oneOf(["invite","issue-passpor"]),status:t.oneOf(["success",""])};const a2=z(_)`
159
159
  max-width: 460px;
160
160
  max-height: 650px;
161
161
  min-height: 450px;
@@ -174,4 +174,4 @@ import{r}from"./vendor-react-CUXIiAnY.js";import{j as i,cd as N,at as g,W as t,a
174
174
  .page-invite__app {
175
175
  margin-top: 20px;
176
176
  }
177
- `,h2=e2(P);export{h2 as I};
177
+ `,h2=e2(R);export{h2 as I};
@@ -1,3 +1,3 @@
1
- import{r}from"./vendor-react-CUXIiAnY.js";import{j as o,a6 as b,am as D,ak as w,bb as L,at as H,W as x}from"./vendor-mui-core-BPQ6AEW_.js";import{p as S,n as T,h as Y,i as z}from"./vendor-ux-r9bApERu.js";import{_ as M,a1 as N,B as P,a2 as E,a3 as W}from"./index-DQt_6j3C.js";import{n as _}from"./vendor-utils-BgSaqjGx.js";import{u as A}from"./team-D29LjHNf.js";import{C as K}from"./confirm-F2_i30bc.js";import{P as q}from"./permission-DVlrf60Y.js";import{C as F}from"./click-to-copy-BuSTGPjJ.js";function G({invitations:a=[],onRefresh:v=_}){const{api:C,inService:d}=M(),{t,locale:y}=r.useContext(S),{teamDid:h,invitations:f,refresh:g,endpoint:l,roles:j}=A(),[i,m]=r.useState(null),[I,c]=r.useState(!1),s=r.useMemo(()=>a.length>0?a:f,[a,f]),k=async({inviteId:e})=>{if(!I){c(!0);try{await C.deleteInvitation({input:{teamDid:h,inviteId:e}}),g(),v?.(),await E(800)}catch(n){console.error(n)}finally{c(!1),m(null)}}},R=()=>{c(!1),m(null)},p=e=>l?W({inviteId:e.inviteId,endpoint:l}):"",B=[{label:t("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return l?o.jsx(F,{children:p(n)}):o.jsx(b,{size:16})}}},{label:t("common.role"),name:"role",widtn:70,options:{sort:!1,customBodyRender:e=>{const n=j.find(u=>u.name===e);return n?.title?o.jsx(D,{title:e,children:n.title}):e||"--"}}},{label:t("common.remark"),name:"remark",options:{sort:!1,customBodyRender:e=>e||"--"}},{label:t("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:(e,{rowIndex:n})=>s[n]?.inviter?.fullName}},{label:t("common.expires"),name:"expireDate",options:{sort:!1,customBodyRender:e=>o.jsx(w,{children:N(e).format("YYYY-MM-DD HH:mm")})}},{label:t("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return o.jsx(q,{permission:d?"":"mutate_team",role:d?P:[],children:o.jsxs(T,{onClick:()=>m({title:t("team.inviting.delete.title"),description:t("team.inviting.delete.description",{link:p(n)}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>k(n),onCancel:R}),size:"small",color:"error",variant:"text",children:[o.jsx(L,{style:{fontSize:"1.2em"}}),t("common.delete")]})})}}}];return o.jsxs(J,{children:[s.length?o.jsx(Y,{locale:y,data:[...s],columns:B,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}}):o.jsx(z,{sx:{minHeight:200},children:t("common.empty")}),i&&o.jsx(K,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}G.propTypes={invitations:x.array,onRefresh:x.func};const J=H.div`
1
+ import{r}from"./vendor-react-CUXIiAnY.js";import{j as o,a6 as b,am as D,ak as w,bb as L,at as H,W as x}from"./vendor-mui-core-B5XNUjey.js";import{p as S,n as T,h as Y,i as z}from"./vendor-ux-BX9dSNUy.js";import{_ as M,a1 as N,B as P,a2 as E,a3 as W}from"./index-Dijoh4El.js";import{n as _}from"./vendor-utils-CFxoplqC.js";import{u as A}from"./team-HgvOpVEJ.js";import{C as K}from"./confirm-BIsS5xyi.js";import{P as q}from"./permission-BYxNrlaa.js";import{C as F}from"./click-to-copy-DXHOGoUP.js";function G({invitations:a=[],onRefresh:v=_}){const{api:C,inService:d}=M(),{t,locale:y}=r.useContext(S),{teamDid:h,invitations:f,refresh:g,endpoint:l,roles:j}=A(),[i,m]=r.useState(null),[I,c]=r.useState(!1),s=r.useMemo(()=>a.length>0?a:f,[a,f]),k=async({inviteId:e})=>{if(!I){c(!0);try{await C.deleteInvitation({input:{teamDid:h,inviteId:e}}),g(),v?.(),await E(800)}catch(n){console.error(n)}finally{c(!1),m(null)}}},R=()=>{c(!1),m(null)},p=e=>l?W({inviteId:e.inviteId,endpoint:l}):"",B=[{label:t("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return l?o.jsx(F,{children:p(n)}):o.jsx(b,{size:16})}}},{label:t("common.role"),name:"role",widtn:70,options:{sort:!1,customBodyRender:e=>{const n=j.find(u=>u.name===e);return n?.title?o.jsx(D,{title:e,children:n.title}):e||"--"}}},{label:t("common.remark"),name:"remark",options:{sort:!1,customBodyRender:e=>e||"--"}},{label:t("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:(e,{rowIndex:n})=>s[n]?.inviter?.fullName}},{label:t("common.expires"),name:"expireDate",options:{sort:!1,customBodyRender:e=>o.jsx(w,{children:N(e).format("YYYY-MM-DD HH:mm")})}},{label:t("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return o.jsx(q,{permission:d?"":"mutate_team",role:d?P:[],children:o.jsxs(T,{onClick:()=>m({title:t("team.inviting.delete.title"),description:t("team.inviting.delete.description",{link:p(n)}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>k(n),onCancel:R}),size:"small",color:"error",variant:"text",children:[o.jsx(L,{style:{fontSize:"1.2em"}}),t("common.delete")]})})}}}];return o.jsxs(J,{children:[s.length?o.jsx(Y,{locale:y,data:[...s],columns:B,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}}):o.jsx(z,{sx:{minHeight:200},children:t("common.empty")}),i&&o.jsx(K,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}G.propTypes={invitations:x.array,onRefresh:x.func};const J=H.div`
2
2
  margin-top: -20px;
3
3
  `;export{G as I};
@@ -1 +1 @@
1
- import{j as e,ak as l}from"./vendor-mui-core-BPQ6AEW_.js";import{i as x,r as w}from"./vendor-react-CUXIiAnY.js";import{b as g}from"./vendor-hooks-PN9SWiQm.js";import{I as v}from"./invitation-DquuV8dW.js";import{K as u}from"./landing-page-BJPl6ZR-.js";import{V as I,y as k}from"./vendor-ux-r9bApERu.js";import{a as S,d as E,s as T,b as j,c as P,H as R}from"./index-DQt_6j3C.js";import{g as W}from"./get-safe-url-BrPSNpgv.js";import{c as b}from"./passport-InAw8ts3.js";import"./vendor-utils-BgSaqjGx.js";import"./index-CdOL_gmG.js";import"./use-passport-id-B-b-_oYF.js";import"./session-SqadLMEY.js";import"./sdk-BbyMeQrc.js";import"./wrap-locale-BovKZCTj.js";import"./index-C6JbpwU_.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D8WYBDYe.js";import"./create-passport-svg-CIUyZVGt.js";function J(n){const c=x(),{searchParams:s}=new URL(window.location.href),{api:m,session:p}=S(),{t:d}=I(),r=s.get("inviteId"),a=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await E.get("invitation",{params:{inviteId:r}});return t},[r]),h=g(async(t,o=i=>i)=>{t&&(T(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await p.refresh(),setTimeout(()=>{if(a){const i=decodeURIComponent(a);i.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(i,{replace:!0}):window.location.href=W(i)}else window.location.href=window.env.pathPrefix||"/"},50)});return e.jsxs(u,{did:window.blocklet?.appPid,children:[e.jsx(R,{children:e.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),e.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:e.jsx(v,{...n,getDataFn:f,checkFn:m.get,createPassportSvg:t=>b({...t}),onLoginSuccess:h,inService:!0})})]})}export{J as default};
1
+ import{j as e,ak as l}from"./vendor-mui-core-B5XNUjey.js";import{i as x,r as w}from"./vendor-react-CUXIiAnY.js";import{b as g}from"./vendor-hooks-U4TTuKG0.js";import{I as v}from"./invitation-Cjg3Rgxl.js";import{K as u}from"./landing-page-zT1Tduxx.js";import{V as I,y as k}from"./vendor-ux-BX9dSNUy.js";import{a as S,d as E,s as T,b as j,c as P,H as R}from"./index-Dijoh4El.js";import{g as W}from"./get-safe-url-pZvXlaJu.js";import{c as b}from"./passport-BcfDxGFq.js";import"./vendor-utils-CFxoplqC.js";import"./index-CUIcSX4q.js";import"./use-passport-id-B-b-_oYF.js";import"./session-DUT2afHJ.js";import"./sdk-Do4pV1s0.js";import"./wrap-locale-Dk2yVg3Y.js";import"./index-5B_H2zYd.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./create-passport-svg-BwqsyTOz.js";function J(n){const c=x(),{searchParams:s}=new URL(window.location.href),{api:m,session:p}=S(),{t:d}=I(),r=s.get("inviteId"),a=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await E.get("invitation",{params:{inviteId:r}});return t},[r]),h=g(async(t,o=i=>i)=>{t&&(T(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await p.refresh(),setTimeout(()=>{if(a){const i=decodeURIComponent(a);i.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(i,{replace:!0}):window.location.href=W(i)}else window.location.href=window.env.pathPrefix||"/"},50)});return e.jsxs(u,{did:window.blocklet?.appPid,children:[e.jsx(R,{children:e.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),e.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:e.jsx(v,{...n,getDataFn:f,checkFn:m.get,createPassportSvg:t=>b({...t}),onLoginSuccess:h,inService:!0})})]})}export{J as default};
@@ -1,2 +1,2 @@
1
- import{g as P}from"./vendor-react-CUXIiAnY.js";import{aK as E,aL as F,aM as H,aN as N,aO as $}from"./index-DQt_6j3C.js";var h={exports:{}},p={exports:{}},I;function Q(){return I||(I=1,function(c,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var v=function(d,y){return d.indexOf(y)!==-1};n.default=v,c.exports=n.default,c.exports.default=n.default}(p,p.exports)),p.exports}var A;function K(){return A||(A=1,function(c,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=T;var v=o(E()),g=o(H()),d=o(Q()),y=o($()),w=o(N()),S=o(F());function o(e){return e&&e.__esModule?e:{default:e}}function L(e,r){return U(e)||O(e,r)||j(e,r)||R()}function R(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{g as P}from"./vendor-react-CUXIiAnY.js";import{aK as E,aL as F,aM as H,aN as N,aO as $}from"./index-Dijoh4El.js";var h={exports:{}},p={exports:{}},I;function Q(){return I||(I=1,function(c,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var v=function(d,y){return d.indexOf(y)!==-1};n.default=v,c.exports=n.default,c.exports.default=n.default}(p,p.exports)),p.exports}var A;function K(){return A||(A=1,function(c,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=T;var v=o(E()),g=o(H()),d=o(Q()),y=o($()),w=o(N()),S=o(F());function o(e){return e&&e.__esModule?e:{default:e}}function L(e,r){return U(e)||O(e,r)||j(e,r)||R()}function R(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j(e,r){if(e){if(typeof e=="string")return b(e,r);var l={}.toString.call(e).slice(8,-1);return l==="Object"&&e.constructor&&(l=e.constructor.name),l==="Map"||l==="Set"?Array.from(e):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?b(e,r):void 0}}function b(e,r){(r==null||r>e.length)&&(r=e.length);for(var l=0,u=Array(r);l<r;l++)u[l]=e[l];return u}function O(e,r){var l=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(l!=null){var u,a,_,s,i=[],t=!0,f=!1;try{if(_=(l=l.call(e)).next,r!==0)for(;!(t=(u=_.call(l)).done)&&(i.push(u.value),i.length!==r);t=!0);}catch(m){f=!0,a=m}finally{try{if(!t&&l.return!=null&&(s=l.return(),Object(s)!==s))return}finally{if(f)throw a}}return i}}function U(e){if(Array.isArray(e))return e}var M={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},k=/^\[([^\]]+)\](?::([0-9]+))?$/;function T(e,r){if((0,v.default)(e),!e||/[\s<>]/.test(e)||e.indexOf("mailto:")===0||(r=(0,S.default)(r,M),r.validate_length&&e.length>r.max_allowed_length)||!r.allow_fragments&&(0,d.default)(e,"#")||!r.allow_query_components&&((0,d.default)(e,"?")||(0,d.default)(e,"&")))return!1;var l,u,a,_,s,i,t,f;if(t=e.split("#"),e=t.shift(),t=e.split("?"),e=t.shift(),t=e.split("://"),t.length>1){if(l=t.shift().toLowerCase(),r.require_valid_protocol&&r.protocols.indexOf(l)===-1)return!1}else{if(r.require_protocol)return!1;if(e.slice(0,2)==="//"){if(!r.allow_protocol_relative_urls)return!1;t[0]=e.slice(2)}}if(e=t.join("://"),e==="")return!1;if(t=e.split("/"),e=t.shift(),e===""&&!r.require_host)return!0;if(t=e.split("@"),t.length>1){if(r.disallow_auth||t[0]===""||(u=t.shift(),u.indexOf(":")>=0&&u.split(":").length>2))return!1;var m=u.split(":"),x=L(m,2),C=x[0],D=x[1];if(C===""&&D==="")return!1}_=t.join("@"),i=null,f=null;var q=_.match(k);if(q?(a="",f=q[1],i=q[2]||null):(t=_.split(":"),a=t.shift(),t.length&&(i=t.join(":"))),i!==null&&i.length>0){if(s=parseInt(i,10),!/^[0-9]+$/.test(i)||s<=0||s>65535)return!1}else if(r.require_port)return!1;return r.host_whitelist?(0,g.default)(a,r.host_whitelist):a===""&&!r.require_host?!0:!(!(0,w.default)(a)&&!(0,y.default)(a,r)&&(!f||!(0,w.default)(f,6))||(a=a||f,r.host_blacklist&&(0,g.default)(a,r.host_blacklist)))}c.exports=n.default,c.exports.default=n.default}(h,h.exports)),h.exports}var W=K();const G=P(W);export{G as i};